<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>petitviolet blog</title>
        <link>https://blog.petitviolet.net</link>
        <description>blog written by petitviolet</description>
        <lastBuildDate>Tue, 12 May 2026 13:54:49 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>ja</language>
        <image>
            <title>petitviolet blog</title>
            <url>https://blog.petitviolet.net/profile.png</url>
            <link>https://blog.petitviolet.net</link>
        </image>
        <copyright>All rights reserved 2026, petitviolet</copyright>
        <item>
            <title><![CDATA[Maintenance Mode on Remix w/Google Cloud Armor]]></title>
            <link>https://blog.petitviolet.net/post/2025-07-15/maintenance-mode-on-remix-with-google-cloud-armor</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2025-07-15/maintenance-mode-on-remix-with-google-cloud-armor</guid>
            <pubDate>Tue, 15 Jul 2025 01:30:00 GMT</pubDate>
            <description><![CDATA[How to implement maintenance mode on Remix using Google Cloud Armor functionality to inject custom headers for requests from non-whitelisted IPs.]]></description>
            <content:encoded><![CDATA[
 tl;dr

Use Google Cloud Armor's header_action to inject a custom header into requests from non-allowlisted IPs, so that your application can check this header in Remix's root loader and display a maintenance page if present.

 Background

Sometimes you need to put your service into maintenance]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Well-formatted logs for Google Cloud Logging]]></title>
            <link>https://blog.petitviolet.net/post/2025-03-20/logger-implementation-for-google-cloud-logging</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2025-03-20/logger-implementation-for-google-cloud-logging</guid>
            <pubDate>Thu, 20 Mar 2025 01:30:00 GMT</pubDate>
            <description><![CDATA[Implementing a logger that writes well-formatted informative logs to be compiled to trace logs in Google Cloud Logging]]></description>
            <content:encoded><![CDATA[
In writing logs in applications that run on Google Cloud Platform, it requires some configurations to be compiled to trace logs in Cloud Logging.
This post describes how to implement it, and also some tips for making logs more useful and informative.

 Tracked as trace logs in Cloud Logging

Node]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Provisioning a custom domain on Cloud Run using Firebase Hosting]]></title>
            <link>https://blog.petitviolet.net/post/2024-03-25/provisioning-a-custom-domain-on-cloud-run-using-firebase-hosting</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2024-03-25/provisioning-a-custom-domain-on-cloud-run-using-firebase-hosting</guid>
            <pubDate>Mon, 25 Mar 2024 01:30:00 GMT</pubDate>
            <description><![CDATA[Firebase Hosting now can be used for provisioning a domain on Cloud Run instead of running a load balancer]]></description>
            <content:encoded><![CDATA[
It used to be that using a load balancer is the most common way to provision a custom domain on Cloud Run. However, it's a bit complicated and costly because it requires a load balancer.
In order to have lower running cost, using load balancer should not be the best option.

For provisioning custom]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Panda CSS]]></title>
            <link>https://blog.petitviolet.net/post/2023-10-15/getting-started-with-pandacss</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2023-10-15/getting-started-with-pandacss</guid>
            <pubDate>Sun, 15 Oct 2023 01:30:00 GMT</pubDate>
            <description><![CDATA[PandaCSS is a zero runtime CSS-in-JS library powered by Chakra. This post tries to give a getting started document with React.]]></description>
            <content:encoded><![CDATA[
[Panda CSS](https://panda-css.com) is a zero runtime CSS-in-JS library powered by [Chakra](https://chakra-ui.com/).

What "zero runtime" means is that Panda CSS statically analyze codes during preprocessing phase and then generates CSS which is not JavaScript.
It's better in terms of performance an]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Seeded Random in Unity C#]]></title>
            <link>https://blog.petitviolet.net/post/2023-07-30/seeded-random-in-unity-csharp</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2023-07-30/seeded-random-in-unity-csharp</guid>
            <pubDate>Sun, 30 Jul 2023 01:30:00 GMT</pubDate>
            <description><![CDATA[Unity provide UnityEngine.Random to access 'random' capabilities, but it's not easy to test it because of its interface. This post describes how to deal with it.]]></description>
            <content:encoded><![CDATA[
In Unity, UnityEngine.Random is to deal with random capabilities that can be used as below:

cs
using System;

UnityEngine.Random.value


It looks simple, however, as UnityEngine.Random.value is a shared value in the global scope, it's nearly impossible to test codes that are using Unity]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Singleton MonoBehavior to data live through Scene transitions]]></title>
            <link>https://blog.petitviolet.net/post/2023-06-15/singleton-monobehavior-to-data-live-through-scene-transitions</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2023-06-15/singleton-monobehavior-to-data-live-through-scene-transitions</guid>
            <pubDate>Thu, 15 Jun 2023 01:30:00 GMT</pubDate>
            <description><![CDATA[MonoBehavior in Unity spawn in a scene and then get destroyed when the scene is unloaded. But, data should be living even after scene transitions happens. To make it possible, keeping MonoBehaviors live before and after scene transitions.]]></description>
            <content:encoded><![CDATA[
This post instructs how to achieve Singleton MonoBehavior in Unity C that stay living even after scene transitions.
Singleton is a well-known design pattern in the industry for long time and it's useful for having data and states in-memory or limit an active instance only one at the same time.

In]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform to provision GCP CDN for GCS backend]]></title>
            <link>https://blog.petitviolet.net/post/2023-02-20/terraform-to-provision-gcp-cdn-for-gcs-backend</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2023-02-20/terraform-to-provision-gcp-cdn-for-gcs-backend</guid>
            <pubDate>Mon, 20 Feb 2023 01:30:00 GMT</pubDate>
            <description><![CDATA[Provision CDN on GCS in GCP using Terraform]]></description>
            <content:encoded><![CDATA[
Google Cloud offers CDN(content delivery/distributed network) that can be backed by Cloud Storage, a.k.a GCS.
Terraform supports provisioning CDN in GCP as always.

As well as the previous post, in Terraform, variables should be declared in variables.tf but use locals here instead for simplicity ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GCP IAP protected Cloud Run Application by Terraform]]></title>
            <link>https://blog.petitviolet.net/post/2023-01-18/gcp-iap-protected-cloud-run-application-by-terraform</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2023-01-18/gcp-iap-protected-cloud-run-application-by-terraform</guid>
            <pubDate>Wed, 18 Jan 2023 01:30:00 GMT</pubDate>
            <description><![CDATA[Terraform to build a Cloud Run Application protected by GCP Identity-Aware Proxy]]></description>
            <content:encoded><![CDATA[
Google Cloud(GCP) has Identity-Aware Proxy that uses ID and contexts to protect applications and VMs from unexpected access.

https://cloud.google.com/iap

Thanks to IAP, it's a way easy to protect an application running on Cloud Run by requiring Google login within the organization, for example.

]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Show filter input if applyable records exist in ReactAdmin]]></title>
            <link>https://blog.petitviolet.net/post/2022-11-20/show-filter-input-if-applyable-records-exist-in-reactadmin</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2022-11-20/show-filter-input-if-applyable-records-exist-in-reactadmin</guid>
            <pubDate>Thu, 29 Dec 2022 01:00:00 GMT</pubDate>
            <description><![CDATA[Switch visibility of a filter if records to be applied not exist in React Admin]]></description>
            <content:encoded><![CDATA[
[React Admin](https://marmelab.com/react-admin/) provides a capability to filter records shown in a list.

https://marmelab.com/react-admin/FilteringTutorial.html

Basically, the combo of ReferenceInput and SelectInput works when applying a filter based on referenced resources.
However, it some]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use Firestore SDK in WebGL built by Unity]]></title>
            <link>https://blog.petitviolet.net/post/2022-10-15/how-to-use-firestore-sdk-in-webgl-built-by-unity</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2022-10-15/how-to-use-firestore-sdk-in-webgl-built-by-unity</guid>
            <pubDate>Sat, 15 Oct 2022 01:30:00 GMT</pubDate>
            <description><![CDATA[Official Firestore SDK can't run on Unity WebGL. Use .jslib for interacting JS SDK and C#.]]></description>
            <content:encoded><![CDATA[
Firebase offers Cloud Firestore which is a well-known NoSQL document datastore that has been widely used in particularly mobile app development.

One of the key features of Firestore I think is realtime-ish data propagation through Firestore SDK.
When a client is subscribing a (sub-)collection and ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Working with Json over HTTP in Unity]]></title>
            <link>https://blog.petitviolet.net/post/2022-09-15/working-with-json-over-http-in-unity</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2022-09-15/working-with-json-over-http-in-unity</guid>
            <pubDate>Thu, 15 Sep 2022 01:30:00 GMT</pubDate>
            <description><![CDATA[To send and receive JSON payload over HTTP in Unity, some techniques needed for de-/serialization.]]></description>
            <content:encoded><![CDATA[
Unity provides handy class called UnityWebRequest for sending HTTP requests.  
See the document for details.
[Unity - Scripting API: UnityWebRequest](https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.html)

As the document illustrates, UnityWebRequest handles Web requests with]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform to manage GCP Service Accounts]]></title>
            <link>https://blog.petitviolet.net/post/2022-06-30/terraform-to-manage-gcp-service-accounts</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2022-06-30/terraform-to-manage-gcp-service-accounts</guid>
            <pubDate>Thu, 30 Jun 2022 01:30:00 GMT</pubDate>
            <description><![CDATA[Terraform provides a few methods for managing Service Accounts in GCP. This post attempts to describe how to create Service Accounts in a good manner.]]></description>
            <content:encoded><![CDATA[
The Google provider of Terraform has some mechanisms to manage Service Accounts in GCP as followings.

- [google_service_account_iam](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_service_account_iam)
    - google_service_account_iam_policy
    - google_servi]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Send Google Form notification to Slack via GoogleAppScript]]></title>
            <link>https://blog.petitviolet.net/post/2022-04-15/send-google-form-notification-to-slack-via-googleappscript</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2022-04-15/send-google-form-notification-to-slack-via-googleappscript</guid>
            <pubDate>Fri, 15 Apr 2022 01:30:00 GMT</pubDate>
            <description><![CDATA[Using GAS to notify new update of Google Form immediately with fancy layout in Slack]]></description>
            <content:encoded><![CDATA[
This post aims to describe how to integrate Google Form and Slack through Google App Script.
The goal is that when a user submits a response to a form, the result shows up in Slack immediately.

 Setup Slack App

First of all, create a Slack App and let it authorized to be allowed to send chat me]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Merge sorted arrays with ordering in some manner in TypeScript]]></title>
            <link>https://blog.petitviolet.net/post/2022-02-14/merge-sorted-arrays-with-ordering-in-some-manner-in-typescript</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2022-02-14/merge-sorted-arrays-with-ordering-in-some-manner-in-typescript</guid>
            <pubDate>Mon, 14 Feb 2022 01:30:00 GMT</pubDate>
            <description><![CDATA[Arrays can be concatnated with Array#concat method but there is no built-in function to concatnating sorted arrays with giving a certain order]]></description>
            <content:encoded><![CDATA[
In Rust, iterable objects have peek method to get the next value without advancing the iterator.
[Peekable in std::iter - Rust](https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html)

This concept could be used to achieve the purpose.
In merging 2 arrays with giving a certain order, peek]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy a Next.js application running on Cloud Run via GitHub Actions]]></title>
            <link>https://blog.petitviolet.net/post/2022-01-25/how-to-deploy-a-next.js-application-running-on-cloud-run-via-github-actions</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2022-01-25/how-to-deploy-a-next.js-application-running-on-cloud-run-via-github-actions</guid>
            <pubDate>Tue, 25 Jan 2022 01:30:00 GMT</pubDate>
            <description><![CDATA[Explain how to deploy a blog powered by Next.js to GCP Cloud Run through GitHub Actions]]></description>
            <content:encoded><![CDATA[
As I posted before, this blog is running on GCP Cloud Run and also is built with Next.js.

https://blog.petitviolet.net/post/2021-12-28/running-a-blog-powered-by-next.js-on-cloud-run

Previously, before migrating to Next.js from Gatsby, this blog used to get deployed automatically via GitHub Action]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running a blog powered by Next.js on Cloud Run]]></title>
            <link>https://blog.petitviolet.net/post/2021-12-28/running-a-blog-powered-by-next.js-on-cloud-run</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-12-28/running-a-blog-powered-by-next.js-on-cloud-run</guid>
            <pubDate>Tue, 28 Dec 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[Build a blog with Next.js and run it on GCP Cloud Run which is a managed platform for enabling users to run containers very easily]]></description>
            <content:encoded><![CDATA[
This blog had been built with [Gatsby](https://nextjs.org), but I decided to migrate to [Next.js](https://nextjs.org) just for learning it.
This post is going to describe what the arcitecture is and how to deploy this blog to [GCP Cloud Run](https://cloud.google.com/run) which is a serverless platf]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rehype plugin for oEmbed]]></title>
            <link>https://blog.petitviolet.net/post/2021-12-20/rehype-plugin-for-oembed-expansion</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-12-20/rehype-plugin-for-oembed-expansion</guid>
            <pubDate>Mon, 20 Dec 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[Build a rehype plugin for oEmbed which is a format for allowing embedding a url with nice looking.]]></description>
            <content:encoded><![CDATA[
I've posted a couple of posts about oEmbed like

https://blog.petitviolet.net/post/2020-03-06/oembed-expansion

Needless to say, the above card is build via oEmbed.

 What Rehype Plugin is

First of all, according to [the official repository(rehypejs/rehype)](https://github.com/rehypejs/rehype),
]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GraphQL on Scala3 with Sangria]]></title>
            <link>https://blog.petitviolet.net/post/2021-10-25/graphql-on-scala3-with-sangria</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-10-25/graphql-on-scala3-with-sangria</guid>
            <pubDate>Mon, 25 Oct 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[Use sangria-graphql to build GraphQL HTTP server on top of Akka-HTTP in Scala3]]></description>
            <content:encoded><![CDATA[
Almost two and a half years ago, I posted a post about how to build a GraphQL HTTP server using sangria-graphql library in Scala2.

https://blog.petitviolet.net/post/2018-01-26/scala-sangriaを使ってgraphql-apiを実装する

I've spent some time to refresh my knowledge and learn Scala3 features like contextural]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make Thread synchronous in Rspec]]></title>
            <link>https://blog.petitviolet.net/post/2021-09-25/make-thread-synchronous-in-rspec</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-09-25/make-thread-synchronous-in-rspec</guid>
            <pubDate>Sat, 25 Sep 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[Stop using sleep to wait for asynchronous execution run on another Thread in Rspec]]></description>
            <content:encoded><![CDATA[
 tl;dr

ruby
allow(Thread).to receive(:new).and_yield


 What's the problem?

In Ruby, Thread can be used for asynchronous processings that would take a while.
However, the asynchronousity sometimes cause unexpected results in unit tests, like Rspec.
Say, a class that uses Thread inte]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[allow_any_instance_of to count up number of method calls behind the scene]]></title>
            <link>https://blog.petitviolet.net/post/2021-08-25/allow_any_instance_of-to-count-up-number-of-method-calls-behind-the-scene</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-08-25/allow_any_instance_of-to-count-up-number-of-method-calls-behind-the-scene</guid>
            <pubDate>Wed, 25 Aug 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[Rspec offers allow_any_instance_of to stub any instances that matches given class]]></description>
            <content:encoded><![CDATA[
Rspec is one of the most popular test framework in Ruby, and of course it offers lots of functionalities for being able to write various type of test cases, like mock, stub, matcher, etc.
allow_any_instance_of is a powerful method, which is able to stub any instance of a class even though using i]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rust async/await with Trait]]></title>
            <link>https://blog.petitviolet.net/post/2021-07-24/rust-async/await-with-trait</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-07-24/rust-async/await-with-trait</guid>
            <pubDate>Sat, 24 Jul 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[Quick note for how to use async/await syntax with Trait in Rust]]></description>
            <content:encoded><![CDATA[
Rust supports asynchronous programming with async and await syntax since Rust 1.39.0.

https://blog.rust-lang.org/2019/11/07/Rust-1.39.0.html

[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/) would be the best material to learn asynchronous programming in Rust.

This ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Subscribe a Web Page using GoogleAppScript]]></title>
            <link>https://blog.petitviolet.net/post/2021-06-20/subscribe-a-web-page-using-googleappscript</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-06-20/subscribe-a-web-page-using-googleappscript</guid>
            <pubDate>Sun, 20 Jun 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[GoogleAppScript to watch and notify new updates of a web page that doesn't publish RSS feed.]]></description>
            <content:encoded><![CDATA[
Some of web pages have RSS feed so that we can get notified when the pages updated through Feedly, Slack, etc.
However, some of them don't have such useful features.
This post describes how to _subscribe_ web pages that don't offer RSS feeds or something like that.

 HOW TO

Use Google App Script]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Relational Database on top of RocksDB in Rust]]></title>
            <link>https://blog.petitviolet.net/post/2021-05-25/building-database-on-top-of-rocksdb-in-rust</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-05-25/building-database-on-top-of-rocksdb-in-rust</guid>
            <pubDate>Tue, 25 May 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[Developed a tiny database system in Rust with using RocksDB as its underlying storage layer and rust-rocksdb library to interact with RocksDB]]></description>
            <content:encoded><![CDATA[
Recently I developed a tiny database system called rrrdb in Rust on top of RocksDB, which is a well-known Key-Value store.  
"rrrdb" came from Relational-database in Rust with RocksDB, though I'd not say rrrdb is a relational database since it doesn't support having relations between objects at all]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Use RocksDB from Rust]]></title>
            <link>https://blog.petitviolet.net/post/2021-03-25/use-rocksdb-from-rust</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-03-25/use-rocksdb-from-rust</guid>
            <pubDate>Thu, 25 Mar 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[Basic usage of rust-rocksdb, and some findings]]></description>
            <content:encoded><![CDATA[
RocksDB is an embeddable key-value storage that has been developed by Facebook.
Many database products are using RocksDB as their low-level storage layer, such as MySQL, MongoDB, TiDB, etc.
This post describes the basic usage of RocksDB from Rust.

OSS community has been developing [rust-rocksdb](h]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Flink Basics]]></title>
            <link>https://blog.petitviolet.net/post/2021-02-10/apache-flink-basics</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-02-10/apache-flink-basics</guid>
            <pubDate>Wed, 10 Feb 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[Apache Flink overview and basic knowledges]]></description>
            <content:encoded><![CDATA[
The last 2 posts described how to launch Apache Flink and run realtime streaming applications on it with Apache Kafka.

https://blog.petitviolet.net/post/2020-12-14/getting-started-with-apache-flink

https://blog.petitviolet.net/post/2021-01-15/apache-flink-with-apache-kafka

In order to understand]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Flink with Apache Kafka]]></title>
            <link>https://blog.petitviolet.net/post/2021-01-15/apache-flink-with-apache-kafka</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2021-01-15/apache-flink-with-apache-kafka</guid>
            <pubDate>Fri, 15 Jan 2021 01:30:00 GMT</pubDate>
            <description><![CDATA[Running a simple streaming application on top of Apache Flink with using Apache Kafka as Source and Sink]]></description>
            <content:encoded><![CDATA[
This post describes how to utilize Apache Kafka as Source as well as Sink of realtime streaming application that run on top of Apache Flink.

The previous post describes how to launch Apache Flink locally, and use Socket to put events into Flink cluster and process in it.
Please refer to it to get ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Apache Flink]]></title>
            <link>https://blog.petitviolet.net/post/2020-12-14/getting-started-with-apache-flink</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-12-14/getting-started-with-apache-flink</guid>
            <pubDate>Mon, 14 Dec 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[How to launch Apache Flink locally by standalone, Docker, and Kubernetes. Also how to run my own streaming application on that.]]></description>
            <content:encoded><![CDATA[
> Apache Flink is a framework and distributed processing engine for stateful computations over unbounded and bounded data streams. 

https://flink.apache.org/flink-architecture.html

In my words, we can run stateful streaming applications on top of it that consume unbounded data come from wherever ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fix GCP Deployment from GitHub Action]]></title>
            <link>https://blog.petitviolet.net/post/2020-11-23/fix-gcp-deployment-from-github-action</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-11-23/fix-gcp-deployment-from-github-action</guid>
            <pubDate>Mon, 23 Nov 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Update GCP related GitHub Action configurations to fix deployment issues]]></description>
            <content:encoded><![CDATA[
Previously, I posted about how to deploy this blog via GitHub Actions to Google AppEngine.

https://blog.petitviolet.net/post/2020-03-10/deploy-blog-via-github-actions

However, because of recent updates, it started failing.
This post describes how to update the GitHub Action configurations to fix ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Call Another Controller Action In Rails]]></title>
            <link>https://blog.petitviolet.net/post/2020-11-16/call-another-controller-action-in-rails</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-11-16/call-another-controller-action-in-rails</guid>
            <pubDate>Mon, 16 Nov 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Implement a controller action depending on another controller without using inheritance and redirection]]></description>
            <content:encoded><![CDATA[
Sometimes we want to reuse a controller's action in another controller for some reasons.
We know redirect is an answer of that, however, there is no way to touch the response when using redirect, and it might be necessary to modify the response, such as transforming response body to another format.]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitHub Action for Rust Project Test and Benchmark]]></title>
            <link>https://blog.petitviolet.net/post/2020-10-08/github-action-for-rust-project</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-10-08/github-action-for-rust-project</guid>
            <pubDate>Thu, 08 Oct 2020 00:30:00 GMT</pubDate>
            <description><![CDATA[Set up GitHub Action for Rust project to run tests and benchmarks]]></description>
            <content:encoded><![CDATA[
I've been learning Rust as posted previously.

https://blog.petitviolet.net/post/2020-09-15/sorted-string-table-in-rust

This project has a small amount of tests as well as benchmark.
To enable running tests and benchmark to validate how recent changes affect both functionality and performance, I d]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sorted String Table in Rust]]></title>
            <link>https://blog.petitviolet.net/post/2020-09-15/sorted-string-table-in-rust</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-09-15/sorted-string-table-in-rust</guid>
            <pubDate>Tue, 15 Sep 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Implement SSTable to learn Rust and for fun]]></description>
            <content:encoded><![CDATA[
Recently, I've been learning Rust. Then, I started implementing sorted string table in Rust in order to learn Rust deeply and also understand SSTable architecture, which is used by underlying storage engines in various modern database softwares.

I'm going to describe what I implemented as my first]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reading Note - Spanner paper]]></title>
            <link>https://blog.petitviolet.net/post/2020-08-01/reading-note-spanner-paper</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-08-01/reading-note-spanner-paper</guid>
            <pubDate>Sat, 01 Aug 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Reading note of a paper of Google's Spanner which is a well-known globally distributed database]]></description>
            <content:encoded><![CDATA[
This post is my reading note for the paper of Spanner.
Distributed SQL database and also NewSQL are a kind of trends in our industry.
I think that Spanner, Google's globally-distributed database, is the beginning of such era.

The paper is available [here](https://research.google.com/archive/spanne]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ruby on Rails on YugabyteDB]]></title>
            <link>https://blog.petitviolet.net/post/2020-07-13/ruby-on-rails-on-yugabytedb</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-07-13/ruby-on-rails-on-yugabytedb</guid>
            <pubDate>Mon, 13 Jul 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[How to use YugabyteDB as a backend storage of Ruby on Rails application.]]></description>
            <content:encoded><![CDATA[
YugabyteDB is "The Leading High-Performance Distributed SQL Database".

https://www.yugabyte.com/

It has been developed as an open source and called [Distributed SQL](https://blog.yugabyte.com/what-is-distributed-sql/).  
YugabyteDB is a Distributed SQL product, like Google Cloud Spanner which is ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tiny compiler written in Ruby]]></title>
            <link>https://blog.petitviolet.net/post/2020-06-20/tiny-compiler-written-in-ruby</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-06-20/tiny-compiler-written-in-ruby</guid>
            <pubDate>Sat, 20 Jun 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Build a tiny compiler for a toy programming language in Ruby]]></description>
            <content:encoded><![CDATA[
As a software engineer's habit, I've implemented a toy programming language in Ruby for my learning.
GitHub repository is [petitviolet/9cc-ruby](https://github.com/petitviolet/9cc-ruby.git).

 What it looks like

Almost *basic* syntax is supported, and only int type is available.

- use number
  ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reading Note - Presto The Definitive Guide]]></title>
            <link>https://blog.petitviolet.net/post/2020-06-06/read-presto-the-definitive-guide</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-06-06/read-presto-the-definitive-guide</guid>
            <pubDate>Sat, 06 Jun 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Reading note of Presto the Definitive Guide, architecture ovewview, terminologies]]></description>
            <content:encoded><![CDATA[
A book about [Presto](https://prestosql.io/), "Presto: The Definitive Guide" has been published by Starburst.
We can get PDF for free from here
[O'Reilly Presto Guide Download – Starburst Data](https://www.starburstdata.com/oreilly-presto-guide-download/)

The book covers a broader themes of [Prest]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build oEmbed API for Gatsby blog]]></title>
            <link>https://blog.petitviolet.net/post/2020-05-15/build-oembed-api-for-gatsby-blog</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-05-15/build-oembed-api-for-gatsby-blog</guid>
            <pubDate>Fri, 22 May 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Build an API for oEmbed expansion of blog posts powered by Gatsby]]></description>
            <content:encoded><![CDATA[
Previously, I wrote a post about that this blog has a capability to expand oEmbed articles using [raae/gatsby-remark-oembed](https://github.com/raae/gatsby-remark-oembed).

https://blog.petitviolet.net/post/2020-03-06/oembed-expansion

As it is embed here, this blog is also able to expand self post]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ksqlDB first impression]]></title>
            <link>https://blog.petitviolet.net/post/2020-05-08/ksqldb-first-impression</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-05-08/ksqldb-first-impression</guid>
            <pubDate>Fri, 08 May 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Getting started ksqlDB, and how it works]]></description>
            <content:encoded><![CDATA[
Recently, I've listened a couple of podcast episodes about ksqlDB.

- [kSQLDB： Kafka Streaming Interface with Michael Drogalis - Software Engineering Daily](https://softwareengineeringdaily.com/2020/04/07/ksqldb-kafka-streaming-interface-with-michael-drogalis/)
- [Easier Stream Processing On Kafka ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure custom 404 in GAE with Gatsby]]></title>
            <link>https://blog.petitviolet.net/post/2020-05-01/configure-custom-404-in-gae-with-gatsby</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-05-01/configure-custom-404-in-gae-with-gatsby</guid>
            <pubDate>Fri, 01 May 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[How to write app.yaml to specify 404 in static file hosting]]></description>
            <content:encoded><![CDATA[
 tl;dr

Use require_matching_file: true for not 404, and wildcard routing for 404 to handle the other paths.

yaml:title=app.yaml
- url: /(.*)
  static_files: public/\1
  upload: public/(.*)
  secure: always
  require_matching_file: true

- url: /(.*)
  static_files: public/404.html
  upload]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Empower Pattern Matching in Ruby]]></title>
            <link>https://blog.petitviolet.net/post/2020-04-10/pattern-match-in-ruby</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-04-10/pattern-match-in-ruby</guid>
            <pubDate>Fri, 10 Apr 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Quick overview of pattern match in Ruby and Gems to empower it]]></description>
            <content:encoded><![CDATA[
Ruby2.7 provides Pattern Matching feature as an experimental one.

https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/

I used to do pattern matching in Scala, so I'm excited to be able to use it in Ruby!

 tl;dr

[Rstructural Gem](https://github.com/petitviolet/rstructural) what I']]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Circuit Breaker in Ruby]]></title>
            <link>https://blog.petitviolet.net/post/2020-04-02/ruby-circuitbreaker-rcb</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-04-02/ruby-circuitbreaker-rcb</guid>
            <pubDate>Thu, 16 Apr 2020 10:30:00 GMT</pubDate>
            <description><![CDATA[Introduction of Circuit Breaker and RCB gem I developed]]></description>
            <content:encoded><![CDATA[
I've developed a circuit breaker in Ruby, and published it as rcb gem in RubyGems.org.

- GitHub: [petitviolet/rcb](https://github.com/petitviolet/rcb)
- RubyGems: [rcb](https://rubygems.org/gems/rcb)

 What is CircuitBreaker?

CircuitBreaker is a well-known pattern to make services stable that]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Imported blogs from Qiita]]></title>
            <link>https://blog.petitviolet.net/post/2020-03-28/imported-blogs-from-qiita</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-03-28/imported-blogs-from-qiita</guid>
            <pubDate>Sat, 28 Mar 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Download my contents and tranform into Gatsby style]]></description>
            <content:encoded><![CDATA[
Qiita began to provide a feature to show what types of articles I write and put +1.
At that time, they made when I read public without opt-in.
[ユーザーページをリニューアルしました - Qiita Blog](https://blog.qiita.com/user-page-renewal/)

I'd like not to make my browsing histories public, so I was going to delete my]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scheduled blog publishing]]></title>
            <link>https://blog.petitviolet.net/post/2020-03-25/scheduled-blog-publish</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-03-25/scheduled-blog-publish</guid>
            <pubDate>Wed, 25 Mar 2020 01:30:00 GMT</pubDate>
            <description><![CDATA[Schedule a pulishing of new blog entry using GitHub Action]]></description>
            <content:encoded><![CDATA[
When I write a new blog entry, I'd like to schedule its publishing since usually write them at night and it's not a good time to make it open.
As I write in [the last post](/post/deploy-blog-via-github-actions), this blog is running on GAE and deployed via GitHub Actions when PR is merged.
Therefor]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Manage new entry using GitHub Actions]]></title>
            <link>https://blog.petitviolet.net/post/2020-03-18/manage-new-entry-using-github-actions</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-03-18/manage-new-entry-using-github-actions</guid>
            <pubDate>Wed, 18 Mar 2020 00:30:00 GMT</pubDate>
            <description><![CDATA[Deploy preview version and notify it]]></description>
            <content:encoded><![CDATA[
[The previous entry](/post/deploy-blog-via-github-actions) describes how to deploy static sites through GitHub Actions.
As the next step, this entry is going to show how to manage new entries, and also how to publish entries based on schedules.

 Deploy preview versions triggered by pull requests]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy blog via GitHub Actions]]></title>
            <link>https://blog.petitviolet.net/post/2020-03-10/deploy-blog-via-github-actions</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-03-10/deploy-blog-via-github-actions</guid>
            <pubDate>Tue, 10 Mar 2020 09:30:00 GMT</pubDate>
            <description><![CDATA[Deploy automation using GitHub Actions.]]></description>
            <content:encoded><![CDATA[
This blog(https://blog.petitviolet.net) is hosted on Google AppEngine(a.k.a GAE).
GAE is super useful not only for dynamic WEB applications but also for static sites.
To deploy applications and sites on GAE, it just needs to call gcloud app deploy command.  
Speaking of GAE deployments, it usuall]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[oEmbed expansion in Gatsby]]></title>
            <link>https://blog.petitviolet.net/post/2020-03-06/oembed-expansion</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-03-06/oembed-expansion</guid>
            <pubDate>Fri, 06 Mar 2020 23:25:44 GMT</pubDate>
            <description><![CDATA[oEmbed expansion in Gatsby]]></description>
            <content:encoded><![CDATA[
[oEmbed](https://oembed.com/)

> oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello World]]></title>
            <link>https://blog.petitviolet.net/post/2020-03-04/hello-world</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2020-03-04/hello-world</guid>
            <pubDate>Wed, 04 Mar 2020 22:12:03 GMT</pubDate>
            <description><![CDATA[New Blog using Gatsby]]></description>
            <content:encoded><![CDATA[
Created a new blog with using [GatsbyJS](https://www.gatsbyjs.org/) and [gatsby-starter-blog](https://github.com/gatsbyjs/gatsby-starter-blog).  
The end of the fiscal year is a good time to build something new.

1 year ago, I renewed my portfolio as well using Gatsby.

https://petitviolet.hatenabl]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KubernetesにおけるPodの初期化処理]]></title>
            <link>https://blog.petitviolet.net/post/2018-12-04/kubernetesにおけるpodの初期化処理</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-12-04/kubernetesにおけるpodの初期化処理</guid>
            <pubDate>Tue, 04 Dec 2018 01:36:19 GMT</pubDate>
            <description><![CDATA[これはなに？本記事ではKubernetesにおけるPodという形でアプリケーショ]]></description>
            <content:encoded><![CDATA[
 これはなに？

本記事では Kubernetes における Pod という形でアプリケーションを起動する際、どのように初期化処理を実行できるのかについて取り上げる。
なお終了処理は触れない。

 lifecycle.postStart を使う

spec.containers.lifecycle.postStartを利用すればライフサイクルにおける"起動"直後に何かしら処理を差し込むことが可能。
これは Pod の起動、ENTRYPOINT や CMD と同時(非同期)に実行される。
ドキュメント: [Attach Handlers to Container Lifecycle]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ScalaをGraalVMで動かす&ネイティブイメージ化する]]></title>
            <link>https://blog.petitviolet.net/post/2018-12-01/scalaをgraalvmで動かす＆ネイティブイメージ化する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-12-01/scalaをgraalvmで動かす＆ネイティブイメージ化する</guid>
            <pubDate>Sat, 01 Dec 2018 02:47:28 GMT</pubDate>
            <description><![CDATA[Scalaプログラマの観点からGraalVMを紹介、使ってみる。GraalVM?]]></description>
            <content:encoded><![CDATA[
Scala プログラマの観点から[GraalVM](https://www.graalvm.org)を紹介、使ってみる。

 GraalVM?

[GraalVM](https://www.graalvm.org)は、思い切り雑に紹介すると Scala(Java)プログラムを高速化することが出来る(ことがある)らしい。

このあたりを読むともう少し詳しく書いてある。
https://www.graalvm.org/docs/why-graal/for-java-programs

簡単にまとめておくと、特徴としては

1. Java を高速化
   JIT コンパイルになにかしら改良が]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GraphQLの認証をどこでやるか]]></title>
            <link>https://blog.petitviolet.net/post/2018-07-16/graphqlの認証をどこでやるか</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-07-16/graphqlの認証をどこでやるか</guid>
            <pubDate>Mon, 16 Jul 2018 01:09:54 GMT</pubDate>
            <description><![CDATA[GraphQLなAPIを実装するにあたって、認証をどうするか。-GraphQL内]]></description>
            <content:encoded><![CDATA[
GraphQL な API を実装するにあたって、認証をどうするか。

- GraphQL 内部で認証する
- GraphQL の外で認証する
- 認証とスキーマ

参考:

- [A guide to authentication in GraphQL – Apollo GraphQL](https://dev-blog.apollodata.com/a-guide-to-authentication-in-graphql-e002a4039d1)
- [Learn Sangria](https://sangria-graphql.org/learn/)の[Authentication a]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SangriaでGraphQLのinterfaceを扱うには]]></title>
            <link>https://blog.petitviolet.net/post/2018-07-01/sangriaでgraphqlのinterfaceを扱うには</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-07-01/sangriaでgraphqlのinterfaceを扱うには</guid>
            <pubDate>Sun, 01 Jul 2018 08:48:17 GMT</pubDate>
            <description><![CDATA[sangria-graphql/sangriaを使ってGraphQLなAPIを実]]></description>
            <content:encoded><![CDATA[
[sangria-graphql/sangria](https://github.com/sangria-graphql/sangria/)を使って GraphQL な API を実装する時に interface をどうやって使うか、という話。  
interface 自体は特に難しい話ではないが、地味に動かなくて困ったので残しておく。

 まとめ

- interface の実装自体はInterfaceTypeを使うだけ
- Field.fieldTypeにInterfaceTypeを与えるだけだと Scheme がエラーになる
- 解決策として
  - Schema.a]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scala - SangriaでUpdateCtxを使ってGraphQLの認証を実装する]]></title>
            <link>https://blog.petitviolet.net/post/2018-04-27/scala-sangriaでupdatectxを使ってgraphqlの認証を実装する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-04-27/scala-sangriaでupdatectxを使ってgraphqlの認証を実装する</guid>
            <pubDate>Fri, 27 Apr 2018 04:28:37 GMT</pubDate>
            <description><![CDATA[Scala用GraphQLフレームワークのsangriaでUpdateCtxを使]]></description>
            <content:encoded><![CDATA[
Scala 用 GraphQL フレームワークの[sangria](https://github.com/sangria-graphql/sangria/)でUpdateCtxを使って認証処理を実装する。
使い方に注意点がいくつかあるが、まずは普通に動かすための方法について。

 UpdateCtx を使って実装する

認証処理に関するドキュメントは[Learn Sangria](http://sangria-graphql.org/learn)の[Authentication and Authorisation](http://sangria-graphql.org/learn/]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[kubernetesで動かすコンテナのヘルスチェック]]></title>
            <link>https://blog.petitviolet.net/post/2018-04-01/kubernetesで動かすコンテナのヘルスチェック</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-04-01/kubernetesで動かすコンテナのヘルスチェック</guid>
            <pubDate>Sun, 01 Apr 2018 03:06:12 GMT</pubDate>
            <description><![CDATA[この記事は何タイトル通り。kubernetes上でコンテナなWebアプリを動かす]]></description>
            <content:encoded><![CDATA[
 この記事は何

タイトル通り。
kubernetes 上でコンテナな Web アプリを動かす時に必要になってくるヘルスチェックや起動時のデータ読み込みをどうやって設定するか。

ドキュメントはこの辺り。
[Configure Liveness and Readiness Probes | Kubernetes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/define-readiness-probes)

コンテナのヘルスチェックには 2 種類]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[kubernetesで動かすソフトウェアの設定をConfigMapで記述する]]></title>
            <link>https://blog.petitviolet.net/post/2018-03-18/kubernetesで動かすソフトウェアの設定をconfigmapで記述する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-03-18/kubernetesで動かすソフトウェアの設定をconfigmapで記述する</guid>
            <pubDate>Sun, 18 Mar 2018 08:10:31 GMT</pubDate>
            <description><![CDATA[まとめnginx.confなどの設定ファイルをkubernetesのConfig]]></description>
            <content:encoded><![CDATA[
 まとめ

nginx.conf などの設定ファイルを kubernetes の ConfigMap で記述し、Volume としてマウントすることが出来る。  
ドキュメントはこの辺り。

- [Configure a Pod to Use a ConfigMap | Kubernetes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/add-configmap-data-to-a-volume)
- [Volumes | Kubernetes](https://ku]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Macでminikubeを使ってkubernetesクラスタを動かす]]></title>
            <link>https://blog.petitviolet.net/post/2018-03-17/macでminikubeを使ってkubernetesクラスタを動かす</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-03-17/macでminikubeを使ってkubernetesクラスタを動かす</guid>
            <pubDate>Sat, 17 Mar 2018 03:59:51 GMT</pubDate>
            <description><![CDATA[タイトル通り。minikubeでローカルにkubenetesクラスタを構築してみ]]></description>
            <content:encoded><![CDATA[
タイトル通り。
[minikube](https://github.com/kubernetes/minikube)でローカルに kubenetes クラスタを構築してみる。

 インストール

Homebrew-Cask で簡単にインストール出来る。


$ brew cask install minikube


 事前準備


$ minikube start


して minikube を起動する。
そして、kubectlで認識されることを確認する。


$ kubectl config current-context
minikube
]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[gRPCのサーバ/クライアントをScalaで実装する]]></title>
            <link>https://blog.petitviolet.net/post/2018-02-28/grpcのサーバ_クライアントをscalaで実装する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-02-28/grpcのサーバ_クライアントをscalaで実装する</guid>
            <pubDate>Wed, 28 Feb 2018 00:17:16 GMT</pubDate>
            <description><![CDATA[この記事はなに？ScalaでgRPCなアプリケーションを作るためのやりかた。具体]]></description>
            <content:encoded><![CDATA[
 この記事はなに？

Scala で gRPC なアプリケーションを作るためのやりかた。

具体的には 4 つの通信方式、

- unary
- server straming
- client streaming
- bidirectional streaming

それぞれについてサーバ/クライアントを Scala で実装する。

**参考**

- [gRPC | Scala での Protocol Buffer](http://xuwei-k.github.io/scala-protobuf-docs/grpc.html)
- [scala で gRPC する - Qiita](]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scalaで作ったWebアプリをDockerizeして動かす]]></title>
            <link>https://blog.petitviolet.net/post/2018-02-09/scalaで作ったwebアプリをdockerizeして動かす</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-02-09/scalaで作ったwebアプリをdockerizeして動かす</guid>
            <pubDate>Fri, 09 Feb 2018 05:10:23 GMT</pubDate>
            <description><![CDATA[この記事はなにタイトル通り。主にsbt-native-packagerのとりあえ]]></description>
            <content:encoded><![CDATA[
 この記事はなに

タイトル通り。
主に sbt-native-packager のとりあえずの使い方紹介。  
Akka-HTTP で Web アプリを実装し、sbt-native-packager を使って Docker イメージを作成、localhost で稼働させて HTTP リクエストを受け付けられるようにするまで。

 環境

- Scala 2.12.4
- sbt 1.0.4
- [Akka-HTTP](https://doc.akka.io/docs/akka-http/current/) 10.0.10
- [sbt-native-packager](http:/]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SangriaでGraphQL APIを実装するのに知っておきたいこと]]></title>
            <link>https://blog.petitviolet.net/post/2018-01-30/sangriaでgraphql-apiを実装するのに知っておきたいこと</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-01-30/sangriaでgraphql-apiを実装するのに知っておきたいこと</guid>
            <pubDate>Tue, 30 Jan 2018 04:01:51 GMT</pubDate>
            <description><![CDATA[この記事はなにSangriaでGraphQLなAPIを実装するにあたって、公式の]]></description>
            <content:encoded><![CDATA[
 この記事はなに

[Sangria](http://sangria-graphql.org)で GraphQL な API を実装するにあたって、公式のサンプルだけだと少し足りないためそれの補足というか tips 的な記事。

Sangria の導入にはこちらをどうぞ。  
[[Scala]Sangria を使って GraphQL API を実装する - Qiita](https://qiita.com/petitviolet/items/e3e87c3f3e740b3c57ba)

 複数のモデルにアクセスしたい

[Ctx と Val についての補足](https://qiit]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scala - Sangriaを使ってGraphQL APIを実装する]]></title>
            <link>https://blog.petitviolet.net/post/2018-01-26/scala-sangriaを使ってgraphql-apiを実装する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2018-01-26/scala-sangriaを使ってgraphql-apiを実装する</guid>
            <pubDate>Fri, 26 Jan 2018 03:45:31 GMT</pubDate>
            <description><![CDATA[この記事はなに？ScalaでGraphQLサーバを実装するためのsangria/]]></description>
            <content:encoded><![CDATA[
 この記事はなに？

Scala で GraphQL サーバを実装するための[sangria/sangria](https://github.com/sangria-graphql/sangria)の導入。

[公式ドキュメント](http://sangria-graphql.org)および[Larning Sangria](http://sangria-graphql.org/learn/)を読むのが一番速い。
さらに公式がサンプルも用意しているので、そちらを参照するのが良い。  
[sangria-graphql/sangria-akka-http-example](https://]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GAE SE for Java8でStackdriver Loggingのログがずれる問題]]></title>
            <link>https://blog.petitviolet.net/post/2017-12-17/gae-se-for-java8でstackdriver-loggingのログがずれる問題</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2017-12-17/gae-se-for-java8でstackdriver-loggingのログがずれる問題</guid>
            <pubDate>Sun, 17 Dec 2017 03:44:16 GMT</pubDate>
            <description><![CDATA[GoogleAppEngineStandardEnvironmentforJav]]></description>
            <content:encoded><![CDATA[
Google AppEngine Standard Environment for Java8 に乗せたアプリケーションで非同期処理しつつログ出力すると、
ログがリクエストに正しく紐付かずに別のリクエストのログとして出力されてしまう、という細かすぎて伝わらない問題と戦った話です。

なお言語は Scala で、[Skinny Micro](http://skinny-framework.org/documentation/micro.html)を使用。

 まとめ

まず結論。
GAE では独自のスレッドではなくThreadManager.createThreadForCurrentR]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[テストコードを楽に書きたい]]></title>
            <link>https://blog.petitviolet.net/post/2017-12-04/テストコードを楽に書きたい</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2017-12-04/テストコードを楽に書きたい</guid>
            <pubDate>Mon, 04 Dec 2017 01:00:41 GMT</pubDate>
            <description><![CDATA[この記事はなにPropertyBasedTestingは何となく難しくて普通のア]]></description>
            <content:encoded><![CDATA[
 この記事はなに

Property Based Testing は何となく難しくて普通のアプリケーション開発におけるテストコードには使用しないイメージかも知れないが、単にテストデータ自動生成器くらいに捉えてカジュアルに使ってみてはいかがでしょうか？という紹介です。
言語には Scala を用いますが、他言語でも探せばライブラリやフレームワークは見つかると思います。

 UnitTest って面倒くさいですよね

JUnit とか ScalaTest で書いているテストは Example Based Testing と呼ばれるもので、いわゆる UnitTest が指しているもののはず]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scala - ScalazのTaskを使う上で知っておきたいこと]]></title>
            <link>https://blog.petitviolet.net/post/2017-11-17/scala-scalazのtaskを使う上で知っておきたいこと</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2017-11-17/scala-scalazのtaskを使う上で知っておきたいこと</guid>
            <pubDate>Fri, 17 Nov 2017 04:38:23 GMT</pubDate>
            <description><![CDATA[この記事は何？scalazのTaskを使う上で知っておきたいtipsとか注意点と]]></description>
            <content:encoded><![CDATA[
 この記事は何？

scalaz の Task を使う上で知っておきたい tips とか注意点とか。
以前、こういう記事を書いた。  
[[Scala]scalaz の Task は何が嬉しいのか - Qiita](https://qiita.com/petitviolet/items/18b1108ab904172baf61)

> Scala の Future と同じようなこと出来る + 便利な API が生えているというイメージ。

と書いたが、実際に使っていく上ではもう少し知っておくべきことがあるのでまとめておく。

 Task は遅延評価される

改めて、Task は遅延評]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scala - scalazのTaskは何が嬉しいのか]]></title>
            <link>https://blog.petitviolet.net/post/2017-09-30/scala-scalazのtaskは何が嬉しいのか</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2017-09-30/scala-scalazのtaskは何が嬉しいのか</guid>
            <pubDate>Sat, 30 Sep 2017 00:45:43 GMT</pubDate>
            <description><![CDATA[Task?scalaz/scalazにあるクラス。[scalaz/Task.sc]]></description>
            <content:encoded><![CDATA[
 Task?

[scalaz/scalaz](https://github.com/scalaz/scalaz)にあるクラス。  
[scalaz/Task.scala](https://github.com/scalaz/scalaz/blob/473c99f0fe07bf51a36cf5a08fa334659422f7b3/concurrent/src/main/scala/scalaz/concurrent/Task.scala)

これは[scalaz/Future.scala](https://github.com/scalaz/scalaz/blob/473c99f0fe0]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scala - case classのコンストラクタを隠蔽する]]></title>
            <link>https://blog.petitviolet.net/post/2017-09-26/scala-case-classのコンストラクタを隠蔽する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2017-09-26/scala-case-classのコンストラクタを隠蔽する</guid>
            <pubDate>Tue, 26 Sep 2017 00:01:04 GMT</pubDate>
            <description><![CDATA[この記事はなに？caseclassを使いながらコンストラクタを隠蔽してファクトリ]]></description>
            <content:encoded><![CDATA[
 この記事はなに？

case class を使いながらコンストラクタを隠蔽してファクトリー経由で生成するように強制したい。
ここでいう"コンストラクタ"はnewで生成する通常コンストラクタに加えて case class で自動生成されるapplyも対象としている。

 まとめ

- sealed abstract case classを使う
  - [こちらのコメント](https://qiita.com/petitviolet/items/b6af2877f64ebe8fe312comment-08e2ffe396177bf5a252)をご参照下さい(@aoiroa]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[shellでTTL付きのキャッシュをしたい]]></title>
            <link>https://blog.petitviolet.net/post/2017-05-04/shellでttl付きのキャッシュをしたい</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2017-05-04/shellでttl付きのキャッシュをしたい</guid>
            <pubDate>Thu, 04 May 2017 02:22:11 GMT</pubDate>
            <description><![CDATA[こんな感じsleep3;echoの結果を最大5秒間キャッシュしている様子。![c]]></description>
            <content:encoded><![CDATA[
 こんな感じ

sleep 3 ; echoの結果を最大 5 秒間キャッシュしている様子。

![cache-ttl-on-sh.gif](https://qiita-image-store.s3.amazonaws.com/0/280/48a2a249-cc43-3a5b-ab5a-511e6df326da.gif)

 キャッシュの実装

実装は[このあたり](https://github.com/petitviolet/dotfiles/blob/71e0102270dfb424f4204a4cedb36b3020ac81ee/_zshrc.aliasL327-L369)に置]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[メタプログラミングScala]]></title>
            <link>https://blog.petitviolet.net/post/2017-04-18/メタプログラミングscala</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2017-04-18/メタプログラミングscala</guid>
            <pubDate>Tue, 18 Apr 2017 11:39:53 GMT</pubDate>
            <description><![CDATA[社内勉強会の資料をちょっと改変したやつ。メタプロ&scala.metaの入門編。]]></description>
            <content:encoded><![CDATA[
社内勉強会の資料をちょっと改変したやつ。
メタプロ & scala.meta の入門編。

 メタプログラミングとは

> プログラミング技法の一種で、ロジックを直接コーディングするのではなく、あるパターンをもったロジックを生成する高位ロジックによってプログラミングを行う方法、またその高位ロジックを定義する方法のこと。

[メタプログラミング - wikipedia
](https://ja.wikipedia.org/wiki/メタプログラミング)

 つまり

プログラムを引数としてプログラムを出力とする関数、みたいなもの。

リフレクションも一種のメタプログラミングで、文字列から]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[scalametaに入門する]]></title>
            <link>https://blog.petitviolet.net/post/2017-02-19/scalametaに入門する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2017-02-19/scalametaに入門する</guid>
            <pubDate>Sun, 19 Feb 2017 02:34:31 GMT</pubDate>
            <description><![CDATA[scalametaはinlinemacroと呼ばれるmacroannotatio]]></description>
            <content:encoded><![CDATA[
scalameta は inline macro と呼ばれる macro annotation のためのツールキット。
型安全に macro 出来る。

公式とチュートリアルは以下。

- [scala.meta](http://scalameta.org/)
- [A Whirlwind Tour of scala.meta](http://scalameta.org/tutorial/Part4-Macroannotations)

 setup

まずは使えるようにするために build.sbt に追記。

sbt
libraryDependencies += "org.sc]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[scalametaでの型パラメータとコンストラクタ]]></title>
            <link>https://blog.petitviolet.net/post/2017-02-19/scalametaでの型パラメータとコンストラクタ</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2017-02-19/scalametaでの型パラメータとコンストラクタ</guid>
            <pubDate>Sun, 19 Feb 2017 02:34:44 GMT</pubDate>
            <description><![CDATA[tl;dr直接、annotationclassの型パラメータやコンストラクタには]]></description>
            <content:encoded><![CDATA[
 tl;dr

直接、annotation class の型パラメータやコンストラクタにはアクセス出来ない。
その代わりに、thisを用いてパターンマッチで取得することが出来る。

 題材

mix-in injection とか minimal cake pattern と呼ばれる、DI 対象となる class を mix-in する macro annotation を実装した。

- Uses[MyService]とするとval myService: MyServiceがフィールドに追加される
- MixIn[MyService](new MyServiceImpl)]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Akka-PersistenceのserializerとしてKryoを使う]]></title>
            <link>https://blog.petitviolet.net/post/2017-01-23/akka-persistenceのserializerとしてkryoを使う</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2017-01-23/akka-persistenceのserializerとしてkryoを使う</guid>
            <pubDate>Mon, 23 Jan 2017 02:13:25 GMT</pubDate>
            <description><![CDATA[とりあえず使えるようにするAkka-PersistenceでKryoをとりあえず]]></description>
            <content:encoded><![CDATA[
 とりあえず使えるようにする

Akka-Persistence で Kryo をとりあえず使えるようにする設定については以前書いた。
[Akka-Persistence コトハジメserializer として kryo を使う](http://qiita.com/petitviolet/items/92826357bd10aace14f5serializer%E3%81%A8%E3%81%97%E3%81%A6kryo%E3%82%92%E4%BD%BF%E3%81%86)

 serializer 選択について

Akka-Persistence のPersistentActo]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ActorでCircuitBreakerを実装してみた話]]></title>
            <link>https://blog.petitviolet.net/post/2016-12-06/actorでcircuitbreakerを実装してみた話</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-12-06/actorでcircuitbreakerを実装してみた話</guid>
            <pubDate>Mon, 05 Dec 2016 22:46:05 GMT</pubDate>
            <description><![CDATA[実装してみる理由ReactiveSystemやMicroservices等の文脈]]></description>
            <content:encoded><![CDATA[
 実装してみる理由

ReactiveSystem や Microservices 等の文脈で登場する CircuitBreaker について以前調べた。

- [[Akka]CircuitBreaker はどう動くのか - Qiita](http://qiita.com/petitviolet/items/777be810e3c5756a393d)
- [Akka の CircuitBreaker と Netflix の Hystrix の違い - Qiita](http://qiita.com/petitviolet/items/f1975fba06655a95e3b0)

Circu]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AkkaのCircuitBreakerとNetflixのHystrixの違い]]></title>
            <link>https://blog.petitviolet.net/post/2016-12-03/akkaのcircuitbreakerとnetflixのhystrixの違い</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-12-03/akkaのcircuitbreakerとnetflixのhystrixの違い</guid>
            <pubDate>Sat, 03 Dec 2016 04:00:53 GMT</pubDate>
            <description><![CDATA[この記事はなに？マイクロサービス等の文脈で登場するCircuitBreaker。]]></description>
            <content:encoded><![CDATA[
 この記事はなに？

マイクロサービス等の文脈で登場する[CircuitBreaker](http://martinfowler.com/bliki/CircuitBreaker.html)。
Scala で使えるものの代表(要出典)として以下の 2 つを比較する。

- [Circuit Breaker - Akka Documentation](http://doc.akka.io/docs/akka/current/common/circuitbreaker.html)
  - シンプルだが単機能
- [Netflix/Hystrix](https://github.com/Netf]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Akka - CircuitBreakerはどう動くのか]]></title>
            <link>https://blog.petitviolet.net/post/2016-11-28/akka-circuitbreakerはどう動くのか</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-11-28/akka-circuitbreakerはどう動くのか</guid>
            <pubDate>Mon, 28 Nov 2016 01:14:50 GMT</pubDate>
            <description><![CDATA[CircuitBreakerとは原典にあたるのは[MartinFowler氏のp]]></description>
            <content:encoded><![CDATA[
 CircuitBreaker とは

原典にあたるのは[Martin Fowler 氏の post](http://martinfowler.com/bliki/CircuitBreaker.html)になるはず。
リモートへのリクエストが失敗した時にうまいこと障害が伝搬しないようにするためのデザイン。

昨今の Microservice アーキテクチャな文脈だと考えやすい。
特定のサービスがダウンしてしまった時に、
それに依存するサービスが引きずられてダウンしてしまわないようにするもの。
Reactive なシステムを作る上で欠かせない存在になりそう。

 CircuitBreak]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Akka-StreamのRunnableGraphの構築パターン]]></title>
            <link>https://blog.petitviolet.net/post/2016-10-22/akka-streamのrunnablegraphの構築パターン</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-10-22/akka-streamのrunnablegraphの構築パターン</guid>
            <pubDate>Sat, 22 Oct 2016 03:11:40 GMT</pubDate>
            <description><![CDATA[Akka-Streamでアプリケーションを実装する場合、SourceとFlowと]]></description>
            <content:encoded><![CDATA[
[Akka-Stream](http://doc.akka.io/docs/akka/current/scala/stream/)でアプリケーションを実装する場合、
Source と Flow と Sink を組み合わせてRunnableGraphを構築し、runして実行する。

本記事では Akka-Stream の部品のメインとなる Source, Flow, Sink を、
[Akka-Actor](http://doc.akka.io/docs/akka/current/scala/actors.html)および[ActorPublisher](https://github.]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2016年だけどMakefileを使ってみる]]></title>
            <link>https://blog.petitviolet.net/post/2016-10-19/2016年だけどmakefileを使ってみる</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-10-19/2016年だけどmakefileを使ってみる</guid>
            <pubDate>Wed, 19 Oct 2016 11:15:17 GMT</pubDate>
            <description><![CDATA[この資料はなに？Makeの良さを伝えるものです-CとかC++の持ち物じゃない-普]]></description>
            <content:encoded><![CDATA[
 この資料はなに？

Make の良さを伝えるものです

- C とか C++の持ち物じゃない
- 普段使うコマンドのショートカットみたいな
- 2016 年でも Makefile は便利

---

![ 2016-10-19 19.11.07.png](https://fringe81.qiita.com/files/6b83b0a2-f9d5-4505-67e0-647d64e1ffd2.png " 2016-10-19 19.11.07.png")

[頑張らないで Scala 〜VOYAGE GROUP におけるアドネットワーク開発の戦略〜 // Speaker Deck](ht]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[akka.actor.FSMを永続化出来るPersistentFSM]]></title>
            <link>https://blog.petitviolet.net/post/2016-08-30/akka.actor.fsmを永続化出来るpersistentfsm</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-08-30/akka.actor.fsmを永続化出来るpersistentfsm</guid>
            <pubDate>Tue, 30 Aug 2016 05:12:05 GMT</pubDate>
            <description><![CDATA[状態の保持/状態遷移に長けたFSMと、その状態/状態遷移を永続化する[Akka-]]></description>
            <content:encoded><![CDATA[
状態の保持/状態遷移に長けた[FSM](http://doc.akka.io/docs/akka/current/scala/fsm.html)と、その状態/状態遷移を永続化する[Akka-Persistent](http://doc.akka.io/docs/akka/current/scala/persistence.html)の組み合わせとして[PersistentFSM](http://doc.akka.io/docs/akka/current/scala/persistence.htmlPersistent_FSM)がある。

状態を持つ Actor でイベントを永続化したいケー]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Akka-Persistenceコトハジメ]]></title>
            <link>https://blog.petitviolet.net/post/2016-08-28/akka-persistenceコトハジメ</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-08-28/akka-persistenceコトハジメ</guid>
            <pubDate>Sun, 28 Aug 2016 02:15:57 GMT</pubDate>
            <description><![CDATA[Akka-Persistenceはstatefulなactorの内部状態]]></description>
            <content:encoded><![CDATA[
[Akka-Persistence](http://doc.akka.io/docs/akka/current/scala/persistence.html)は stateful な actor の内部状態を永続化することによって、生成時、再開時、migration 時などに状態を復旧することを可能とするもの。

内部状態に至るまでのイベント(メッセージ)を永続化しておくことで、そのイベントを再生すれば全く同じ状態を再現させることが出来るため、CQRS/ES の文脈で最近はよく出てきている(気がする)。

 build.sbt

まずは build.sbt に依存を追加する。
バージョンは]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Actorで作る有限オートマトン]]></title>
            <link>https://blog.petitviolet.net/post/2016-08-24/actorで作る有限オートマトン</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-08-24/actorで作る有限オートマトン</guid>
            <pubDate>Wed, 24 Aug 2016 01:05:01 GMT</pubDate>
            <description><![CDATA[有限オートマトン？FiniteStateMachine(FSM)ざっくり言うとイ]]></description>
            <content:encoded><![CDATA[
 有限オートマトン？

Finite State Machine(FSM)
ざっくり言うとイベントを受け取って状態遷移するステートマシン。
詳しくは[Wikipedia](https://ja.wikipedia.org/wiki/有限オートマトン)参照

 FSM を Actor で実装する

まさにそのためのakka.actor.FSMがあるので、これを使って実装する。

 FSM に必要な型を定義する

必要となるのは以下の 3 つの型

- State
  - FSM の状態
- Data
  - FSM が内部的に持つ情報
- Event
  - FSM の]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Akka-HTTP - spray-jsonの使い方とAkka-HTTP]]></title>
            <link>https://blog.petitviolet.net/post/2016-06-02/akka-http-spray-jsonの使い方とakka-http</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-06-02/akka-http-spray-jsonの使い方とakka-http</guid>
            <pubDate>Thu, 02 Jun 2016 03:06:57 GMT</pubDate>
            <description><![CDATA[Akka-HTTPで公式にサポートされているJSONライブラリのspray-js]]></description>
            <content:encoded><![CDATA[
Akka-HTTP で公式にサポートされている JSON ライブラリの[spray-json](https://github.com/spray/spray-json)の使い方。
[JSON Support — Akka Documentation](http://doc.akka.io/docs/akka/2.4.4/scala/http/common/json-support.html)
Akka-HTTP と一緒に使いたいので、Marshaller/Unmarshaller として使用法も載せる。

 tl;dr

- クラスのフィールドに独自の型を使わない場合 or 独自の型に対応]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Akka-HTTP - DSLにおける暗黙の型変換]]></title>
            <link>https://blog.petitviolet.net/post/2016-05-28/akka-http-dslにおける暗黙の型変換</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-05-28/akka-http-dslにおける暗黙の型変換</guid>
            <pubDate>Sat, 28 May 2016 00:51:01 GMT</pubDate>
            <description><![CDATA[akka.http.scaladslパッケージをimportすることで使えるよう]]></description>
            <content:encoded><![CDATA[
akka.http.scaladslパッケージを import することで使えるようになる DSL が、
裏側でどのように実装されているか気になったので調べた。

 題材

akka-http において、単純なルーティングについて考えてみる。

scala
val route = path("ping") {
  get {
    complete("pong")
  }
}


localhost:8080/pingに GET リクエストを送ると期待通りにpongと返ってくる。


$ curl localhost:8080/ping
pong

]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Akka-HTTPを型で縛る]]></title>
            <link>https://blog.petitviolet.net/post/2016-05-27/akka-httpを型で縛る</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-05-27/akka-httpを型で縛る</guid>
            <pubDate>Fri, 27 May 2016 00:39:48 GMT</pubDate>
            <description><![CDATA[httpリクエスト/レスポンスでやり取りするStringな値をアプリケーションが]]></description>
            <content:encoded><![CDATA[
http リクエスト/レスポンスでやり取りする String な値をアプリケーションが期待する Scala の型に変換する方法について。

 リクエストを型で縛る

ユーザーからのリクエストをなるべくStringとして触らないようにする。

 URL パラメータ

以下のルーティングを考える。


GET /message?id=<ID>&body=<BODY>'


URL パラメータのidとbodyをなるべくString以外で扱う。
まず、型を用意する。

scala
sealed trait Content {
  val id: Long
  ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Akka-HTTP - カスタムヘッダーの取り扱い方]]></title>
            <link>https://blog.petitviolet.net/post/2016-05-19/akka-http-カスタムヘッダーの取り扱い方</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-05-19/akka-http-カスタムヘッダーの取り扱い方</guid>
            <pubDate>Thu, 19 May 2016 04:33:47 GMT</pubDate>
            <description><![CDATA[標準で用意されていない独自のヘッダーを定義して使いたいケース。大雑把に、文字列と]]></description>
            <content:encoded><![CDATA[
標準で用意されていない独自のヘッダーを定義して使いたいケース。
大雑把に、文字列として扱う場合と型で扱う場合に分ける

 文字列で扱う

headerValueByNameで良い。
引数にSymbolかStringを渡せば、それにマッチするヘッダーの値が取り出せる。

scala
val route =
  path("header" / "ping") {
    get {
      headerValueByName('Message) { msg: String =>
        complete(s"pong: $msg")
      }
    }
 ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Akka-HTTP - ルーティングDSLの基本となるPathMatcherのまとめ]]></title>
            <link>https://blog.petitviolet.net/post/2016-05-18/akka-http-ルーティングdslの基本となるpathmatcherのまとめ</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-05-18/akka-http-ルーティングdslの基本となるpathmatcherのまとめ</guid>
            <pubDate>Tue, 17 May 2016 22:58:00 GMT</pubDate>
            <description><![CDATA[Pathを構築するためのDSLであるDirectiveとPathMathcerに]]></description>
            <content:encoded><![CDATA[
Path を構築するための DSL であるDirectiveとPathMathcerについて。
ドキュメントは以下。
[The PathMatcher DSL — Akka Documentation](http://doc.akka.io/docs/akka/2.4.4/scala/http/routing-dsl/path-matchers.html)

 tl;dr

大体ここに書いてある。
[The PathMatcher DSL — Akka Documentation](http://doc.akka.io/docs/akka/2.4.4/scala/http/rout]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MonadicでReactiveなSlick3.xを使う]]></title>
            <link>https://blog.petitviolet.net/post/2016-03-30/monadicでreactiveなslick3.xを使う</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2016-03-30/monadicでreactiveなslick3.xを使う</guid>
            <pubDate>Wed, 30 Mar 2016 01:38:07 GMT</pubDate>
            <description><![CDATA[MonadicでReactiveだと言われているSlick3.xを使ってみる。本]]></description>
            <content:encoded><![CDATA[
Monadic で Reactive だと言われている Slick3.x を使ってみる。
本記事時点での最新はは 3.1.1 となっている。
公式のサンプルだと h2 を使っていたが、今回はローカルに立てた MySQL を使用する。

[Getting Started — Slick 3.1.1 documentation](http://slick.typesafe.com/doc/3.1.1/gettingstarted.htmlquick-introduction)

 準備

事前にuserテーブルを作っておく

sql
Create Table: CREATE TAB]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[静的ダックタイピングのパフォーマンスとその仕組み]]></title>
            <link>https://blog.petitviolet.net/post/2015-12-22/静的ダックタイピングのパフォーマンスとその仕組み</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-12-22/静的ダックタイピングのパフォーマンスとその仕組み</guid>
            <pubDate>Tue, 22 Dec 2015 00:07:50 GMT</pubDate>
            <description><![CDATA[ここでの静的ダックタイピングはScalaの構造的部分型(StructuralTy]]></description>
            <content:encoded><![CDATA[
ここでの静的ダックタイピングは Scala の構造的部分型(Structural Typing)を用いて実現されるものを指しています。
構造的部分型については以下が参考になるかと思います。

- [構造的部分型について - Qiita](http://qiita.com/tacke_jp/items/657626a08a02b5ecd0a62-1)
- [Scala School - Advanced types](https://twitter.github.io/scala_school/advanced-types.htmlstructural)
- [Structural typ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[気持ちよくAndroidを書くために]]></title>
            <link>https://blog.petitviolet.net/post/2015-12-03/気持ちよくandroidを書くために</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-12-03/気持ちよくandroidを書くために</guid>
            <pubDate>Thu, 03 Dec 2015 01:18:25 GMT</pubDate>
            <description><![CDATA[ちょっとでもJava7なAndroidを気持ちよくプログラミングしたい、Java]]></description>
            <content:encoded><![CDATA[
ちょっとでも Java7 な Android を気持ちよくプログラミングしたい、
Java っぽい(?)ところがありつつもモダンなパラダイムが取り入れられている Scala が羨ましく見えたので、Scala っぽく書きたいという意志から書いています
サンプルコードでは紙面の都合上、retrolambda で lambda 式使っています

 Scala の羨ましいところ

挙げればキリが無いですが、以下とします

- 関数型プログラミング
- 強力な式

 関数型プログラミングっぽく

これについては[Roppongi.aar 2 - connpass](http://roppon]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[数字の文字列をread使って数字列に変換する]]></title>
            <link>https://blog.petitviolet.net/post/2015-09-22/数字の文字列をread使って数字列に変換する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-09-22/数字の文字列をread使って数字列に変換する</guid>
            <pubDate>Tue, 22 Sep 2015 06:39:23 GMT</pubDate>
            <description><![CDATA[やり方read.returnを使って型を指定すれば良い haskellPrelu]]></description>
            <content:encoded><![CDATA[
 やり方

read . returnを使って型を指定すれば良い

haskell
Prelude> let n = "123456789" :: String
Prelude> n
"123456789"
Prelude> map return n :: [String]
["1","2","3","4","5","6","7","8","9"]
Prelude> map (read . return) n :: [Int]
[1,2,3,4,5,6,7,8,9]
Prelude> map (read . return) n :: [Float]
[1.0,2.0,3.0,4.]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native for Androidでアプリを作る]]></title>
            <link>https://blog.petitviolet.net/post/2015-09-16/react-native-for-androidでアプリを作る</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-09-16/react-native-for-androidでアプリを作る</guid>
            <pubDate>Wed, 16 Sep 2015 01:19:03 GMT</pubDate>
            <description><![CDATA[[ReactNativeforAndroid:Howwebuiltthefirs]]></description>
            <content:encoded><![CDATA[
[React Native for Android: How we built the first cross-platform React Native app | Engineering Blog | Facebook Code](https://code.facebook.com/posts/1189117404435352/)
[React Native | A framework for building native apps using React](http://facebook.github.io/react-native/)

 Setup

 Android S]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[constなNSStringでdiscards qualifiers警告が出る]]></title>
            <link>https://blog.petitviolet.net/post/2015-09-08/constなnsstringでdiscards-qualifiers警告が出る</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-09-08/constなnsstringでdiscards-qualifiers警告が出る</guid>
            <pubDate>Tue, 08 Sep 2015 04:45:02 GMT</pubDate>
            <description><![CDATA[元の解説はこちら[objectivec-"sending'constNSStr]]></description>
            <content:encoded><![CDATA[
 元の解説はこちら

[objective c - "sending 'const NSString _' to parameter of type 'NSString _' discards qualifiers" warning - Stack Overflow](http://stackoverflow.com/questions/6828831/sending-const-nsstring-to-parameter-of-type-nsstring-discards-qualifier)

 起こったこと

以下のように constant な文字列を定義したとき、discard]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AndroidでAssertJを使ってテストする]]></title>
            <link>https://blog.petitviolet.net/post/2015-08-11/androidでassertjを使ってテストする</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-08-11/androidでassertjを使ってテストする</guid>
            <pubDate>Mon, 10 Aug 2015 23:30:47 GMT</pubDate>
            <description><![CDATA[最近知ったAssertJというテストライブラリを使ってみた[AssertJ/Fl]]></description>
            <content:encoded><![CDATA[
最近知った AssertJ というテストライブラリを使ってみた
[AssertJ / Fluent assertions for java](http://joel-costigliola.github.io/assertj/index.html)

> Fluent assertions

とあるように流れるような assertion が出来ると聞いてちょっと気になった

 AssertJ の導入

 gradle の設定

[AssertJ / Fluent assertions for java](http://joel-costigliola.github.io/assertj]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[h2oをリバースプロキシとして導入してみた]]></title>
            <link>https://blog.petitviolet.net/post/2015-07-29/h2oをリバースプロキシとして導入してみた</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-07-29/h2oをリバースプロキシとして導入してみた</guid>
            <pubDate>Wed, 29 Jul 2015 06:50:25 GMT</pubDate>
            <description><![CDATA[流行りのh2o/h2oをインストールして動かしてみたApacheがすでに動いてい]]></description>
            <content:encoded><![CDATA[
流行りの[h2o/h2o](https://github.com/h2o/h2o)をインストールして動かしてみた
Apache がすでに動いていてその上で PHP とか uwsgi とか動いていたので、今回はリバースプロキシとして導入することにした

 環境

さくら VPS


$ cat /etc/redhat-release
CentOS release 6.6 (Final)
$ uname -r
2.6.32-504.3.3.el6.x86_64


 インストール

[Install - H2O](https://h2o.examp1e.net/install.]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RxJava(RxAndroid)でのBackpressureについて]]></title>
            <link>https://blog.petitviolet.net/post/2015-07-21/rxjava(rxandroid)でのbackpressureについて</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-07-21/rxjava(rxandroid)でのbackpressureについて</guid>
            <pubDate>Tue, 21 Jul 2015 00:47:55 GMT</pubDate>
            <description><![CDATA[RxJavaのAndroidバインディングであるRxAndroidを使い始めてB]]></description>
            <content:encoded><![CDATA[
RxJava の Android バインディングである[RxAndroid](https://github.com/ReactiveX/RxAndroid)を使い始めて Backpressure ではまったので整理
[retrolambda](https://github.com/orfjackal/retrolambda)で lambda 式使っていますが、使っていなければ適宜newするコードに置き換えてください

 Backpressure

[Backpressure · ReactiveX/RxJava Wiki](https://github.com/ReactiveX/Rx]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OkHttpのメインスレッドコールバックの実装]]></title>
            <link>https://blog.petitviolet.net/post/2015-07-06/okhttpのメインスレッドコールバックの実装</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-07-06/okhttpのメインスレッドコールバックの実装</guid>
            <pubDate>Sun, 05 Jul 2015 23:44:33 GMT</pubDate>
            <description><![CDATA[OkHttpがサンプルとして用意している[AsynchronousGet](ht]]></description>
            <content:encoded><![CDATA[
OkHttp がサンプルとして用意している[Asynchronous Get](https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/AsynchronousGet.java)レシピのように、OkHttp をバックグラウンド通信に使用した時、CallbackクラスのonFailuerとonResponseはどちらもバックグラウンドで実行される
Android で OkHttp を使う場合、バックグラウンド通信しなければならない理由から、コールバックをメインス]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Androidバージョンの違いをCustomViewで吸収する]]></title>
            <link>https://blog.petitviolet.net/post/2015-06-01/androidバージョンの違いをcustomviewで吸収する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-06-01/androidバージョンの違いをcustomviewで吸収する</guid>
            <pubDate>Mon, 01 Jun 2015 11:36:48 GMT</pubDate>
            <description><![CDATA[新し目のバージョンのAndroidにしか無いViewを使いたいが、xmlをバージ]]></description>
            <content:encoded><![CDATA[
新し目のバージョンの Android にしか無い View を使いたいが、xml をバージョンで分けたりしたくない
そこで、そういった View をラップする CustomView を作る

今回、ICS 以上でTextureView、それ以下でSurfaceViewを使ったカメラを実装した

 リポジトリ

https://github.com/petitviolet/MultiCamera
記事中のコードはこのリポジトリの一部抜粋となっています

 ライブラリとして使用

Github に aar をアップロードしたので、以下のように記述するとライブラリとして使用できます
]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gradleのtaskをpecoで選択する]]></title>
            <link>https://blog.petitviolet.net/post/2015-05-24/gradleのtaskをpecoで選択する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-05-24/gradleのtaskをpecoで選択する</guid>
            <pubDate>Sun, 24 May 2015 07:50:06 GMT</pubDate>
            <description><![CDATA[Gradleを使ってAndroid開発しているとき、Gradleのtaskを選択]]></description>
            <content:encoded><![CDATA[
Gradle を使って Android 開発しているとき、Gradle の task を選択することが多く、以前書いた内容で TAB 補完は出来るようになった
[Android - Gradle を Zsh で補完する - Qiita](http://qiita.com/petitviolet/items/11ae1c7791e6343a6c1e)

今回は、task を TAB 補完ではなく peco で選択出来るようにした
![gradle_comp.gif](https://qiita-image-store.s3.amazonaws.com/0/280/5b09e355-75e7-7]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[treeからpecoで選択したファイルをvimで開く]]></title>
            <link>https://blog.petitviolet.net/post/2015-04-28/treeからpecoで選択したファイルをvimで開く</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-04-28/treeからpecoで選択したファイルをvimで開く</guid>
            <pubDate>Tue, 28 Apr 2015 07:00:49 GMT</pubDate>
            <description><![CDATA[shfunctionpeco-tree-vim(){localSELECTED]]></description>
            <content:encoded><![CDATA[
sh
function peco-tree-vim(){
  local SELECTED_FILE=$(tree --charset=o -f | peco | tr -d '\|||-' | xargs echo)
  BUFFER="vim $SELECTED_FILE"
  zle accept-line
}
bindkey "^t" peco_tree_vim


-fオプションでフルパスを表示しつつ--charsetオプションで罫線に使用する文字を変更して扱いやすくし、pecoで選択した行にある罫線をtrで除去してvimで開く
<Ctrl-t>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSVのデータを使って散布図とヒストグラムを作る]]></title>
            <link>https://blog.petitviolet.net/post/2015-02-09/csvのデータを使って散布図とヒストグラムを作る</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-02-09/csvのデータを使って散布図とヒストグラムを作る</guid>
            <pubDate>Mon, 09 Feb 2015 14:14:17 GMT</pubDate>
            <description><![CDATA[はじめにR-Tips見たら全部わかるデータの用意ファイルの読]]></description>
            <content:encoded><![CDATA[
 はじめに

[R-Tips](http://cse.naro.affrc.go.jp/takezawa/r-tips/r.html)
見たら全部わかる

 データの用意

 ファイルの読み込み

R
> data <- read.csv('./plot_tfidf.csv', header=T, sep=",")
> data
      a      b
1 0.688 0.1930
2 0.701 0.7370
3 0.705 0.6860
4 0.732 0.0174
5 0.341 0.1390


read.csvの引数のheaderにT[RUE]]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TeXを監視して自動コンパイルする]]></title>
            <link>https://blog.petitviolet.net/post/2015-01-05/texを監視して自動コンパイルする</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2015-01-05/texを監視して自動コンパイルする</guid>
            <pubDate>Mon, 05 Jan 2015 06:43:57 GMT</pubDate>
            <description><![CDATA[rubyのguard/guardを使ってファイルの変更を監視して、裏で自動コンパ]]></description>
            <content:encoded><![CDATA[
ruby の[guard/guard](https://github.com/guard/guard)を使ってファイルの変更を監視して、
裏で自動コンパイルする

 準備

まずguardをインストールする

以下の様な Gemfile を用意する

Gemfile
source 'http://rubygems.org'
gem 'guard'
gem 'guard-shell'
gem 'rb-readline'
gem 'rb-inotify'


そして

sh
 gem install bundle
bundle install


でguard]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vimでブラウザを操る]]></title>
            <link>https://blog.petitviolet.net/post/2014-12-22/vimでブラウザを操る</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-12-22/vimでブラウザを操る</guid>
            <pubDate>Mon, 22 Dec 2014 04:09:42 GMT</pubDate>
            <description><![CDATA[この記事はVimAdventCalendar2014-Qiita22日目の記事で]]></description>
            <content:encoded><![CDATA[
この記事は[Vim Advent Calendar 2014 - Qiita](http://qiita.com/advent-calendar/2014/vim) 22 日目の記事です
21 日目の記事は @mitsuse さんの[非英語ネイティブでも Vim で快適に英語を書きたい](http://mitsuse.jp/2014/12/20/vim-ac-2014-writing-english/)でした

Vim アドベントカレンダーですが、ちょっと趣向を変えて[Vimperator](https://addons.mozilla.org/ja/firefox/addon/vimper]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zshで長い処理をしている間に読込中を表示する]]></title>
            <link>https://blog.petitviolet.net/post/2014-12-21/zshで長い処理をしている間に読込中を表示する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-12-21/zshで長い処理をしている間に読込中を表示する</guid>
            <pubDate>Sun, 21 Dec 2014 12:33:11 GMT</pubDate>
            <description><![CDATA[内容-shellでのバックグラウンド処理	-ジョブ制御フラグ-メタ文字による標準]]></description>
            <content:encoded><![CDATA[
 内容

- shell でのバックグラウンド処理 - ジョブ制御フラグ
- メタ文字による標準出力の管理

[Android - Gradle を Zsh で補完する - Qiita](http://qiita.com/petitviolet/items/11ae1c7791e6343a6c1e)という記事を書いた時に

> なお、初回のみタスクの読み込みに時間がかかるが、2 回目以降はファイルキャッシュを読み込むため比較的速くなる

と書いたが、初回の読み込み時の長さが気になるので読み込み中である indicator を表示することにした

 参考

[Python でローディン]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Qiita API v2のPythonラッパー実装した]]></title>
            <link>https://blog.petitviolet.net/post/2014-12-20/qiita-api-v2のpythonラッパー実装した</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-12-20/qiita-api-v2のpythonラッパー実装した</guid>
            <pubDate>Sat, 20 Dec 2014 09:01:24 GMT</pubDate>
            <description><![CDATA[QiitaAPIv2のPythonラッパーがなかったので作りました-Github]]></description>
            <content:encoded><![CDATA[
Qiita API v2 の Python ラッパーがなかったので作りました

- Github: [petitviolet/qiita_py](https://github.com/petitviolet/qiita_py)
- Pypi: [qiita_v2 0.1.0 : Python Package Index](https://pypi.python.org/pypi/qiita_v2)

テストとかdoctestで適当に書いてるのしか無いので、バージョンは0.1.0としています

 インストール

Pypi に登録しているのでpipで出来ます

sh
pip ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GradleをZshで補完する]]></title>
            <link>https://blog.petitviolet.net/post/2014-12-19/gradleをzshで補完する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-12-19/gradleをzshで補完する</guid>
            <pubDate>Thu, 18 Dec 2014 17:08:01 GMT</pubDate>
            <description><![CDATA[快適なAndroid(Studio)ライフを送りたい内容ZshでもGradleコ]]></description>
            <content:encoded><![CDATA[
快適な Android(Studio)ライフを送りたい

 内容

Zsh でも Gradle コマンドを補完出来るようにした

![gradle_zsh_complete.gif](https://qiita-image-store.s3.amazonaws.com/0/280/19ab9d9b-a5b8-8bad-5e2d-410e2234fe83.gif "gradle_zsh_complete.gif")

 参考

[zsh 補完関数を自作すると便利 - はこべブログ ♨](http://hakobe932.hatenablog.com/entry/2012/02/13/2]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GsonとProguard]]></title>
            <link>https://blog.petitviolet.net/post/2014-12-11/gsonとproguard</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-12-11/gsonとproguard</guid>
            <pubDate>Thu, 11 Dec 2014 04:52:41 GMT</pubDate>
            <description><![CDATA[AndroidでJsonを扱うライブラリとして有名なGsonですが、Progua]]></description>
            <content:encoded><![CDATA[
Android で Json を扱うライブラリとして有名な Gson ですが、
Proguard を有効にしたビルドだと問題が発生します

 問題

普通だと

java
new Gson().fromJson(jsonString, Hoge.class);


でjsonStringをHogeクラスに変換出来るはずです
しかし Proguard を有効にしてあると、Hogeクラスのフィールド名が難読化されて例えばアルファベット 1 文字に変更されているため、
jsonStringにおける json のキー名とHogeクラスのフィールド名が一致しなくなり]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pythonistaなら知ってるオプションパーサ]]></title>
            <link>https://blog.petitviolet.net/post/2014-12-02/pythonistaなら知ってるオプションパーサ</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-12-02/pythonistaなら知ってるオプションパーサ</guid>
            <pubDate>Tue, 02 Dec 2014 01:33:50 GMT</pubDate>
            <description><![CDATA[この記事はPythonAdventCalendar2014-Qiita2日目の記]]></description>
            <content:encoded><![CDATA[
この記事は[Python Advent Calendar 2014 - Qiita](http://qiita.com/advent-calendar/2014/python) 2 日目の記事です
前日は @kureikei さんの[Blender 関連](http://pronama.azurewebsites.net/2014/12/01/python-pronama-chan-blender-add-on/) でした

最近は golang でツールを作るのが流行っていますが、負けじと python ももっと盛り上がって欲しいですね
ということで、コマンドラインツールを作る時に必要な引]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Androidのoptions menuまわりのtips]]></title>
            <link>https://blog.petitviolet.net/post/2014-11-28/androidのoptions-menuまわりのtips</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-11-28/androidのoptions-menuまわりのtips</guid>
            <pubDate>Fri, 28 Nov 2014 02:55:29 GMT</pubDate>
            <description><![CDATA[-ActionBarメニューの表示/非表示を切り替える-Fragmentにメニュ]]></description>
            <content:encoded><![CDATA[
- ActionBar メニューの表示/非表示を切り替える
- Fragment にメニューを表示させる

 ActionBar メニューの表示/非表示を切り替える

 概要

ActionBarActivityな Activity の ActionBar にあるメニュー(options menu)について、

java
MenuItem item = menu.findItem(R.id.menu_id);
item.setVisible(false);


をしても消えてくれなかった options menu を何とかして消す

 やり方

java:ti]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DexIndexOverflowExceptionと戦った話]]></title>
            <link>https://blog.petitviolet.net/post/2014-11-16/dexindexoverflowexceptionと戦った話</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-11-16/dexindexoverflowexceptionと戦った話</guid>
            <pubDate>Sun, 16 Nov 2014 05:54:23 GMT</pubDate>
            <description><![CDATA[AndroidStudioでビルドした時に、com.android.dex.De]]></description>
            <content:encoded><![CDATA[
Android Studio でビルドした時に、
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
っていうが出て困った。

なんとか解決したので、メモ

 参考

- [Building Apps with Over 65K Methods | Android Developers](http://developer.android.com/tools/building/multidex.html)
- [android - Unable to execute dex: met]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android StudioでJavaDocを生成する]]></title>
            <link>https://blog.petitviolet.net/post/2014-11-09/android-studioでjavadocを生成する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-11-09/android-studioでjavadocを生成する</guid>
            <pubDate>Sat, 08 Nov 2014 15:45:45 GMT</pubDate>
            <description><![CDATA[頑張って書いたJavaDocをAndroidStudioから生成する手順環境An]]></description>
            <content:encoded><![CDATA[
頑張って書いた JavaDoc を Android Studio から生成する手順

 環境

Android Studio 0.8.6
jdk1.7.0_60.jdk

 手順

 メニューの[Tools] -> [Generate JavaDoc...]を選択

![スクリーンショット_2014-11-09_0_19_48.png](https://static.petitviolet.net/image/qiita_58_431bb849-2283-5bc7-71f9-1dfe225409d1.png "スクリーンショット_2014-11-09_0_19_48.png")

]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fragment自身を終了させる]]></title>
            <link>https://blog.petitviolet.net/post/2014-11-08/fragment自身を終了させる</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-11-08/fragment自身を終了させる</guid>
            <pubDate>Sat, 08 Nov 2014 14:46:10 GMT</pubDate>
            <description><![CDATA[Fragment自身でActivityで言うところのfinish()を実行したい]]></description>
            <content:encoded><![CDATA[
Fragment自身でActivityで言うところのfinish()を実行したい

java
getFragmentManager().beginTransaction().remove(this).commit();


で出来た

 追記

backstack がある場合は以下の方がいいでしょう

java
getFragmentManager().popBackStack();


from: https://qiita.com/petitviolet/items/9a8302d1f08fbde1fc65
]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ansibleでローカルのディレクトリをリモートにコピーする]]></title>
            <link>https://blog.petitviolet.net/post/2014-09-27/ansibleでローカルのディレクトリをリモートにコピーする</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-09-27/ansibleでローカルのディレクトリをリモートにコピーする</guid>
            <pubDate>Sat, 27 Sep 2014 10:26:19 GMT</pubDate>
            <description><![CDATA[まとめAnsibleでローカルのファイル/ディレクトリをリモートに持っていくため]]></description>
            <content:encoded><![CDATA[
 まとめ

Ansible でローカルのファイル/ディレクトリをリモートに持っていくためには
synchronizeではなくcopyモジュールを使えば良い

 synchronizeとcopy

[ansible directory copy - Google 検索](https://www.google.co.jp/search?q=ansible+directory+copy)すると、copyとsynchronizeの 2 つのコマンドが出てくる![kobito.1411812903.512220.png](https://static.petitviolet]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flaskでloggingの設定を外部ファイルから読み込む]]></title>
            <link>https://blog.petitviolet.net/post/2014-09-23/flaskでloggingの設定を外部ファイルから読み込む</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-09-23/flaskでloggingの設定を外部ファイルから読み込む</guid>
            <pubDate>Tue, 23 Sep 2014 13:13:32 GMT</pubDate>
            <description><![CDATA[Flaskで普通にloggingをする場合、Flaskloggingexampl]]></description>
            <content:encoded><![CDATA[
Flask で普通に logging をする場合、[Flask logging example](https://gist.github.com/ibeex/3257877)のように、

py:title=app.py
app = Flask(__name__)
app.logger.debug("test message")


のようにすれば簡単に出来る。
しかし、loggingの外部ファイルから設定を読み込むfileConfig

py:title=fileConfig
import logging.config
logging.config.fileConf]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Androidでcwac-cameraを使って写真撮影する]]></title>
            <link>https://blog.petitviolet.net/post/2014-08-26/androidでcwac-cameraを使って写真撮影する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-08-26/androidでcwac-cameraを使って写真撮影する</guid>
            <pubDate>Tue, 26 Aug 2014 10:47:28 GMT</pubDate>
            <description><![CDATA[ざっくり概要-commonsguy/cwac-cameraというカメラ用のライブ]]></description>
            <content:encoded><![CDATA[
 ざっくり概要

- [commonsguy/cwac-camera](https://github.com/commonsguy/cwac-camera)というカメラ用のライブラリを使う
- Android で写真を撮る - 動作設定をする - 起動・撮影・保存する
- 撮影した写真をあとで使う - イベントバスの[Otto](http://square.github.io/otto/)を使う

 カメラの動作設定

基本的には
[cwac-camera/SimpleCameraHost.java](https://github.com/commonsguy/cwac-camera/b]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHPのTestでheader関数によるエラーを回避する]]></title>
            <link>https://blog.petitviolet.net/post/2014-07-17/phpのtestでheader関数によるエラーを回避する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-07-17/phpのtestでheader関数によるエラーを回避する</guid>
            <pubDate>Thu, 17 Jul 2014 08:49:13 GMT</pubDate>
            <description><![CDATA[まとめheader関数を使っている関数などをテストする際には、テストを走らせる前]]></description>
            <content:encoded><![CDATA[
 まとめ

header関数を使っている関数などをテストする際には、テストを走らせる前に
ob_start()と書きましょう

 問題

PHP でテストしようとして、何故か[SimpleTest - Unit Testing for PHP](http://simpletest.sourceforge.net/)を利用した

テストを実行するとheader()によるエラーが出た

> E_WARNING: Cannot modify header information - headers already sent by (output started at ...

よく]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[vimのインストール]]></title>
            <link>https://blog.petitviolet.net/post/2014-07-04/vimのインストール</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-07-04/vimのインストール</guid>
            <pubDate>Fri, 04 Jul 2014 08:33:26 GMT</pubDate>
            <description><![CDATA[内容-Mac	-homebrewを使ったインストール-CentOS	-ソースから]]></description>
            <content:encoded><![CDATA[
 内容

- Mac - homebrew を使ったインストール
- CentOS - ソースからコンパイルしてインストール

 ドキュメント

ここ読み込んだら幸せになれそう
http://vim-jp.org/vimdoc-ja/

 Mac に homebrew でインストール

sh
brew install vim --with-features=huge --enable-multibyte --enable-pythoninterp=dynamic --enable-cscope --enable-fontset --disable-gui --without]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHPでPDOを使ってAND検索(OR検索)を実装する]]></title>
            <link>https://blog.petitviolet.net/post/2014-06-16/phpでpdoを使ってand検索(or検索)を実装する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-06-16/phpでpdoを使ってand検索(or検索)を実装する</guid>
            <pubDate>Mon, 16 Jun 2014 12:09:34 GMT</pubDate>
            <description><![CDATA[概要-日本語で検索-GETパラメータをキーワードとして検索-PDO使ってMySQ]]></description>
            <content:encoded><![CDATA[
 概要

- 日本語で検索
- GET パラメータをキーワードとして検索
- PDO 使って MySQL に接続し、プレースホルダを使って SQL を構築する
- 可変長な AND(OR)検索

 ポイント

 日本語対策

- mb_internal_encoding('UTF-8');をファイルの先頭に書く
  - 今回は特に関係ないっぽいですが、とりあえず書いてます
- PDO作成の際にutf8を指定する
- MySQL の設定を変更する

  - こうなってたら動いた

        >mysql> show variables like 'character_]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[zshでの自作関数と、それに対する補完関数を実装する]]></title>
            <link>https://blog.petitviolet.net/post/2014-05-30/zshでの自作関数と、それに対する補完関数を実装する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-05-30/zshでの自作関数と、それに対する補完関数を実装する</guid>
            <pubDate>Fri, 30 May 2014 00:48:36 GMT</pubDate>
            <description><![CDATA[やりたいこと-zshでオリジナルな関数を実装したい-自作関数にも補完を効くように]]></description>
            <content:encoded><![CDATA[
 やりたいこと

- zsh でオリジナルな関数を実装したい
- 自作関数にも補完を効くようにしたい
  - ファイル一覧を表示させたい
- オプションも付けたい

 参考

- [zsh の補完関数の自作導入編](https://gist.github.com/mitukiii/4954559)

 自作関数

rmを~/.Trash/にmvするだけのコマンド(もらいもの)に置き換えており、rmfは/bin/rm/に置き換えている
以前は

zsh
function rmf() {
  for file in $*
  /bin/rm $file
}
]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[sqlalchemyのテーブル定義tips]]></title>
            <link>https://blog.petitviolet.net/post/2014-05-28/sqlalchemyのテーブル定義tips</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-05-28/sqlalchemyのテーブル定義tips</guid>
            <pubDate>Wed, 28 May 2014 08:34:51 GMT</pubDate>
            <description><![CDATA[tips-データベースエンジンの指定-複数カラムに対するユニーク制約-外部キー制]]></description>
            <content:encoded><![CDATA[
 tips

- データベースエンジンの指定
- 複数カラムに対するユニーク制約
- 外部キー制約
- NULL を許さない
- unsigned int(MySQL)
- 随時追加？

バージョンは 0.9.4 です

 データベースエンジンの指定

__table_args__で指定出来る

python
__table_args__ = {'mysql_engine': 'InnoDB'}


 ユニーク制約

単一カラムへは簡単だが、複数カラムにユニーク制約を貼るには
sqlalchemy.schema.UniqueConstraintを使用する必]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scala - パターンマッチにおけるアットマーク(@)]]></title>
            <link>https://blog.petitviolet.net/post/2014-05-23/scala-パターンマッチにおけるアットマーク(@)</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-05-23/scala-パターンマッチにおけるアットマーク(@)</guid>
            <pubDate>Fri, 23 May 2014 04:23:12 GMT</pubDate>
            <description><![CDATA[参照http://stackoverflow.com/questions/451]]></description>
            <content:encoded><![CDATA[
 参照

http://stackoverflow.com/questions/4513380/scala-match-help

 問題

こんなコードがある

scala
def flatMapSublists[A,B](ls: List[A])(f: (List[A]) => List[B]): List[B] =
  ls match {
    case Nil => Nil
    case sublist@(_ :: tail) => f(sublist) ::: flatMapSublists(tail)(f)
  }


 ん？sublist]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gitbucketの導入からgit pushまで]]></title>
            <link>https://blog.petitviolet.net/post/2014-05-13/gitbucketの導入からgit-pushまで</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-05-13/gitbucketの導入からgit-pushまで</guid>
            <pubDate>Tue, 13 May 2014 03:23:51 GMT</pubDate>
            <description><![CDATA[要約-GithubクローンのGitbucketの導入-ssh経由でGitbuck]]></description>
            <content:encoded><![CDATA[
 要約

- Github クローンの[Gitbucket](https://github.com/takezoe/gitbucket)の導入
- ssh 経由で Gitbucket を利用する流れ

 Gitbucket の導入

1. ダウンロード
   Zsh
   wget https://github.com/takezoe/gitbucket/releases/download/1.13/gitbucket.war



1. openjdkのインストール

	Zsh
sudo yum install openjdk-7-jre


1.  t]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[lftpでファイル転送]]></title>
            <link>https://blog.petitviolet.net/post/2014-05-07/lftpでファイル転送</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-05-07/lftpでファイル転送</guid>
            <pubDate>Wed, 07 May 2014 05:07:41 GMT</pubDate>
            <description><![CDATA[sftpだとTAB補完が効かないので不便だったでもsshでファイル転送したかった]]></description>
            <content:encoded><![CDATA[
sftp だと TAB 補完が効かないので不便だった
でも ssh でファイル転送したかった

 使い方

sh
brew install lftp
 sftp hoge@example.com
lftp sftp://hoge@example.com


これだけで補完の効く sftp になる
sftp だとllsだったのが!lsになったり、少しだけ違う
getだとワイルドカードが展開できないのでmgetを使う
mgetで上書きを許可するにはset xfer:clobber onと入力すれば OK

Ctrl-rでインクリメンタルサーチ出来たり]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[パッケージを作成し、PyPIに登録したメモ]]></title>
            <link>https://blog.petitviolet.net/post/2014-04-21/パッケージを作成し、pypiに登録したメモ</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-04-21/パッケージを作成し、pypiに登録したメモ</guid>
            <pubDate>Mon, 21 Apr 2014 13:25:34 GMT</pubDate>
            <description><![CDATA[Pythonでパッケージを作って、PyPIに登録した時の作業メモなお、今回はコマ]]></description>
            <content:encoded><![CDATA[
Python でパッケージを作って、[PyPI](https://pypi.python.org/pypi)に登録した時の作業メモ
なお、今回はコマンドラインツールを作りました

PyPI に登録することによってpipでインストール出来るようになります

 ディレクトリ構成


├── README.md
├── requirements.txt
├── setup.py
└── src
    ├── __init__.py
    └── hoge.py


 ファイル詳細

- requirements.txt、src/**init**.py

      	]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javaでクローラを実装する]]></title>
            <link>https://blog.petitviolet.net/post/2014-04-10/javaでクローラを実装する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-04-10/javaでクローラを実装する</guid>
            <pubDate>Thu, 10 Apr 2014 10:27:28 GMT</pubDate>
            <description><![CDATA[なにかライブラリが無いかと思ってcrawler4jに行き着きました。使用準備ht]]></description>
            <content:encoded><![CDATA[
なにかライブラリが無いかと思って[crawler4j](http://code.google.com/p/crawler4j/)に行き着きました。

 使用準備

http://code.google.com/p/crawler4j/ のサイドバーにある[Downloads]から crawler4j-3.5.zip と crawler4j-3.5-dependencies.zip をダウンロードする。
html のパースには jsoup を使うので、[ここ](http://jsoup.org/download)からダウンロードしておく。

eclipse だと[ビルドパスの構成]>[ライ]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PythonからGoogleのAPIを利用してAndroidへPUSH通知する]]></title>
            <link>https://blog.petitviolet.net/post/2014-03-08/pythonからgoogleのapiを利用してandroidへpush通知する</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-03-08/pythonからgoogleのapiを利用してandroidへpush通知する</guid>
            <pubDate>Sat, 08 Mar 2014 02:41:09 GMT</pubDate>
            <description><![CDATA[GoogleのAPIを用いてAndroid端末へのPUSHとステータスバーへの通]]></description>
            <content:encoded><![CDATA[
Google の API を用いて Android 端末への PUSH とステータスバーへの通知の表示メモ

 クライアント(Android)

Android で PUSH 通知をするための準備は[http://dev.classmethod.jp/smartphone/android/gcm/](http://dev.classmethod.jp/smartphone/android/gcm/)に書いてあります。
本当に参考になりました。

ここからは上のリンクからの変更点と追加点についてです。

-
Google Developers Console での手順が多少変わっているので]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[アラームの作り方]]></title>
            <link>https://blog.petitviolet.net/post/2014-03-06/アラームの作り方</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-03-06/アラームの作り方</guid>
            <pubDate>Thu, 06 Mar 2014 09:13:14 GMT</pubDate>
            <description><![CDATA[これが正しい方法かどうかわかりませんが、アラームとして機能したのでメモAndro]]></description>
            <content:encoded><![CDATA[
これが正しい方法かどうかわかりませんが、アラームとして機能したのでメモ

Android でアラームを鳴らすためには、

1. アラーム時に起動するサービスを PendingIntent を使って指定する
1. 指定されたタイミングで起動したサービスから sendBroadcast を利用してレシーバーを起こす
1. 起こされたレシーバーからアラーム時に起動する Activity を Intent によって指定、起動

というプロセスでいけるようです。
めんどくさいですが。

サービスとレシーバーを利用するためには権限が必要なため、Manifest に記載する
必要な部分のみ書いています。
]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[論文のための句読点変換スクリプト]]></title>
            <link>https://blog.petitviolet.net/post/2014-02-15/論文のための句読点変換スクリプト</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-02-15/論文のための句読点変換スクリプト</guid>
            <pubDate>Sat, 15 Feb 2014 12:50:16 GMT</pubDate>
            <description><![CDATA[sh:paper!/usr/local/bin/zshfind.-name'*]]></description>
            <content:encoded><![CDATA[
sh:title=paper
!/usr/local/bin/zsh
find . -name '*.tex' -print0 | xargs -0 sed -i '' -e 's/、/，/g'
find . -name '*.tex' -print0 | xargs -0 sed -i '' -e 's/。/．/g'


そして

zsh
chmod +x paper
sudo mv paper /usr/local/bin


これでどこでも

zsh
paper


とコマンドを打てば句読点が論文用になります！

from: https://qii]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[pipで既にインストールされているパッケージをuser環境(非su)でアップデートする]]></title>
            <link>https://blog.petitviolet.net/post/2014-01-31/pipで既にインストールされているパッケージをuser環境(非su)でアップデートする</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-01-31/pipで既にインストールされているパッケージをuser環境(非su)でアップデートする</guid>
            <pubDate>Fri, 31 Jan 2014 00:08:45 GMT</pubDate>
            <description><![CDATA[既にインストールされているパッケージをアップデートしたいが、sudo権限がなく、]]></description>
            <content:encoded><![CDATA[
既にインストールされているパッケージをアップデートしたいが、sudo 権限がなく、
-I や--user だけでは permission エラーや ez_setup.py がない等で出来なかった。

手順

手元にダウンロードして解凍し、解凍後のディレクトリから pip で user 環境にインストールする

zsh
 ./tmpにtar.gzをダウンロードする
pip install [package] -I --user -d ./tmp
tar zxvf ./tmp/[package].tar.gz
pip install -e ./tmp/package --user

]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[外部キー貼り直し手順メモ]]></title>
            <link>https://blog.petitviolet.net/post/2014-01-29/外部キー貼り直し手順メモ</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-01-29/外部キー貼り直し手順メモ</guid>
            <pubDate>Wed, 29 Jan 2014 01:55:45 GMT</pubDate>
            <description><![CDATA[userテーブルとarticleテーブルがあり、articleテーブルにはuse]]></description>
            <content:encoded><![CDATA[
user テーブルと article テーブルがあり、article テーブルには user_id という user.id を参照する外部キーを持っている。
そして、article.user_id に on (delete|update) cascade を付け加えたかった

テーブルの構造および外部キーの名前を確認する

mysql
mysql> show create table user \G
*************************** 1. row ***************************
       Table: user
Create Ta]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQLAlchemyとmultiprocessingを使う]]></title>
            <link>https://blog.petitviolet.net/post/2014-01-17/sqlalchemyとmultiprocessingを使う</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-01-17/sqlalchemyとmultiprocessingを使う</guid>
            <pubDate>Fri, 17 Jan 2014 14:32:11 GMT</pubDate>
            <description><![CDATA[Pythonの便利なマルチプロセスライブラリであるmultiprocessing]]></description>
            <content:encoded><![CDATA[
Python の便利なマルチプロセスライブラリである multiprocessing と SQLAlchemy を組み合わせて使用するサンプル
プロセス間のデータのやり取りは Queue で行い、DB には SQLALchemy の session を使ってアクセスする

py
from multiprocessing import (Process, Queue)
from sqlalchemy import (create_engine, MetaData)
from sqlalchemy.ext.declarative import declarative_base
from s]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[networkxでグラフを描く]]></title>
            <link>https://blog.petitviolet.net/post/2014-01-16/networkxでグラフを描く</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-01-16/networkxでグラフを描く</guid>
            <pubDate>Thu, 16 Jan 2014 02:01:38 GMT</pubDate>
            <description><![CDATA[pythonのnetworkxを使ってグラフを作ってみたのでメモ py:make]]></description>
            <content:encoded><![CDATA[
=
python の networkx を使ってグラフを作ってみたのでメモ

py:title=make_graph.py

 -*- encoding:utf-8 -*-

import networkx
import pylab
from matplotlib import font_manager
from itertools import combinations
from random import randint

 ノードをkey、エッジをはるノードのlistをvalueとするdict
vector = {}
persons = [u"田中", u"鈴木", u"山田]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[argparseの使い方とoptparseとの違い]]></title>
            <link>https://blog.petitviolet.net/post/2014-01-16/argparseの使い方とoptparseとの違い</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2014-01-16/argparseの使い方とoptparseとの違い</guid>
            <pubDate>Thu, 16 Jan 2014 10:10:13 GMT</pubDate>
            <description><![CDATA[以前、OptParserの使い方として記事を書いたが、どうやらargparse.]]></description>
            <content:encoded><![CDATA[
以前、[OptParser の使い方](http://qiita.com/petitviolet/items/c2ba174a153bbdc5ad22)として記事を書いたが、どうやら argparse.ArgumentParser の方がなういらしい

なので argparse.ArgumentParser の使い方のメモ

py
 -*- coding:utf-8 -*-
from optparse import OptionParser
from argparse import ArgumentParser

if __name__ == '__main__':

    """]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scipyでの疎行列の扱い]]></title>
            <link>https://blog.petitviolet.net/post/2013-09-25/scipyでの疎行列の扱い</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2013-09-25/scipyでの疎行列の扱い</guid>
            <pubDate>Wed, 25 Sep 2013 06:20:27 GMT</pubDate>
            <description><![CDATA[pythonで疎な文書ベクトルの類似度や距離を計算をするメモScipyで疎行列を]]></description>
            <content:encoded><![CDATA[
 python で疎な文書ベクトルの類似度や距離を計算をするメモ

Scipy で疎行列を使う際の基本的な操作について
書いたのが昔なので、どっか間違ってるかも

py:title=行列の計算
import scipy.sparse as sp
import numpy as np

a = sp.lil_matrix((1, 10000))  1*10000の疎行列が作成される
b = sp.lil_matrix((1, 10000))
 a.shape => (1, 10000)
for i in xrange(a.shape[1]):
	r = np.random.ran]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OptParserの使い方]]></title>
            <link>https://blog.petitviolet.net/post/2013-09-25/optparserの使い方</link>
            <guid isPermaLink="false">https://blog.petitviolet.net/post/2013-09-25/optparserの使い方</guid>
            <pubDate>Wed, 25 Sep 2013 06:56:16 GMT</pubDate>
            <description><![CDATA[py!/usr/bin/envpython-*-coding:utf-8-*-]]></description>
            <content:encoded><![CDATA[
py
!/usr/bin/env python
 -*- coding:utf-8 -*-
from optparse import OptionParser

if __name__ == '__main__':

    """ コマンドエラー時に表示する文字列 """
    usage = u'%prog [Args] [Options]\nDetailed options -h or --help'

    version = 0.1
    parser = OptionParser(usage=usage, version=version)

    """ tes]]></content:encoded>
        </item>
    </channel>
</rss>