Brazil's Blog Musings on automation, scripting, programing, DevOps, and cybersecurity Built on jello: – Jello Explorer (jellex): TUI interactive JSON filter using Python syntax – jello web demo I’m a big fan of using structured data at the command line. So much so that I’ve written a couple of utilities to promote JSON in the CLI: jc to JSONify command line output of scores of commands and file-ty
Notice: Unmaintained This repo is no longer maintained, however there are many alternatives: Markdown-It Showdown Marked and more... markdown-js Yet another Markdown parser, this time for JavaScript. There's a few options that precede this project but they all treat Markdown to HTML conversion as a single step process. You pass Markdown in and get HTML out, end of story. We had some pretty particu
import java.net.{InetAddress,UnknownHostException} import util.parsing.combinator.RegexParsers object IpParsers extends RegexParsers { def ipAddress: Parser[String] = """[0-9a-fA-F:\.]+""".r.withFilter { str => try { val addr = InetAddress.getByName(str) true } catch { case e: UnknownHostException => false } } } 前提として、IPv4またはIPv6文字列をまとめて扱い、ざっくりと文字列の範囲を選びとる。(最初の正規表現マッチ) withFilterで抽出した文字列の検証を追加 Ine
この記事はPython Advent Calendar 2014 - Qiita 2日目の記事です 前日は @kureikei さんのBlender関連 でした 最近はgolangでツールを作るのが流行っていますが、負けじとpythonももっと盛り上がって欲しいですね ということで、コマンドラインツールを作る時に必要な引数・オプションパーサを紹介していきます コンテンツ Pythonからコマンドラインでの引数・オプションを処理します 使用するものは sys.argv argparser.ArgumentParser docopt.docopt の3種類 getoptしか使えないような古いPythonは切り捨てました optparseはdeprecatedになっているので、ここでは紹介しません Deprecation of optparse 対応バージョン argparseがPython2.
I'm using Google Apps Script for a lot of things - from automate tasks to data analysis. I have discovered, that there was repetitive use-case: scrape data from web and parse exact value from HTML source code. If you are novice in programming, you probably know, that's difficult to write and use regular expresion. For me too :) I have written Google Apps Script library, which helps you to parse d
概要 原著者の許諾を得て翻訳・公開いたします。 英語記事: The Missing Ruby Code Formatter | Meta Redux 原文公開日: 2019/03/30 著者: Bozhidar -- RuboCopの作者です サイト: Meta Redux 日本語タイトルは内容に即したものにしました。記事が長いので3分割いたしました。参考までに、元記事の後にtestdouble社のstandard(standardrb)というgemも登場しています↓。 2019/06/05: 初版公開 2023/04/12: 更新 パーサー選択の影響 ここからは、うんとテクニカルな方面に舵を切りますので、ご自由に読み飛ばしていただいて構いません。ツールを支えるパーサーライブラリをどう選択するかについて議論したいと思います。パーサーにはさまざまな選択肢がありますが、実用上はRuby組み込み
お金とかソース管理とか何も考えなくていいスクレイピングbotを作りたい 「SlackにStackShare.ioからトレンドランキング拾って投稿するbot作って」「ほいきた」 Slackのbotってhubotとかいう奴の事でしょ?皆作ってるし余裕だろ、と何も考えずに引き受けたら何やらサーバが必要だわyo hubotしたらファイルが2000個自動生成されるわ、で速攻ぶん投げたくなりました。目的が単純ならその実装も運用も管理も可能な限りシンプルにしたいものです。探してみたところ、Google Apps Scriptが一番手軽そうだったので早速やってみました。 PaaSやIaaS系のサービスとかでは全然無いです。ざっくり言えばGoogleドライブにスクリプトをアップしておくだけ。 新規⇢アプリを追加⇢Apps Scriptを検索、追加しておきます。 プログラミング 新規⇢その他⇢Google A
Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode
JavaScript is a general purpose programming language that was introduced as the page scripting language for Netscape Navigator. It is still widely believed to be a subset of Java, but it is not. It is a Scheme-like language with C-like syntax and soft objects. JavaScript was standardized in the ECMAScript Language Specification, Third Edition. JSON is a subset of the object literal notatio
PLT Scheme には既に JSON のパーサーが2つあるんですが: http://www.lshift.net/blog/2005/08/22/json-for-mzscheme-and-a-portable-packrat-parsing-combinator-library http://planet.plt-scheme.org/display.ss?package=json.plt&owner=dherman 気にせず作ってみました。 JSON 自体は文法が簡単なので短時間で作れたんですが、その過程でライブラリの重大な欠点も見つかりました。Scheme の #f の値をパース失敗と見なす方式だったために、JavaScript の "false" の値を #f に変換できない、という問題が判明したんです。 そのような問題修正やブラッシュアップを施したコードはこちらです (まだパ
Scalaにはご存知のとおり scala.util.parsing.combinator というパーサコンビネータライブラリがある。さらには scala.util.parsing.ast というのもあるわけだけど、これは激しく開発中な感じ。Scalaはバージョンがあがるとこういう開発中ライブラリはごそっと変わったりするので今はおいておく。ちなみに、2.7.1では前のパーサコンビネータは scala.util.parsing.combinatorold といういかにも使いたくない名前にされてしまった。 パーサコンビネータといえば言語処理系だ(そうか?)。というわけで scala.util.parsing.ast は置いておいて、とりあえずASTについてほとんど考える必要がない、簡単なスタック指向言語を実装してみることにする。実行はScala 2.7.1.finalで。 スタック指向言語とは
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く