パスワードを忘れた? アカウント作成
14259559 journal
Python

finedaypicnicの日記: リストの追加部分以外が本当に合っているかの確認方法

日記 by finedaypicnic

Python 3.8.2 (default, Jul 16 2020, 14:00:26)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a = ["a", "b", "c"]
>>> b = ["a", "b", "c", "d"]
>>> l = len(a)
>>> l
3
>>> l = len(a[:-1])
>>> l
2
>>> c = a[:l]
>>> d = b[:l]
>>> print(c and d)
['a', 'b']
>>> print(c == d)
True
>>> e = "".join(a)
>>> e
'abc'
>>> f = "".join(b)
>>> f
'abcd'
>>> l = len(e)
>>> l
3
>>> g = f[:l]
>>> g
'abc'
>>> print(e == g)
True

12369344 journal
Google

finedaypicnicの日記: Emacs Lisp: search-on-browser.el

日記 by finedaypicnic

;;; search-on-browser.el --- Search term on browser
 
;; Copyright (C) 2015  Akihiro Kuroiwa
 
;; Author: Akihiro Kuroiwa
;; URL: http://akuroiwa.env-reform.com/
;; Keywords: browse-url
 
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
 
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
 
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
(defcustom search-engine '(
               ("google" . "http://www.google.com/search?q=%s")
               ("finance" . "http://www.google.com/finance?q=%s")
               ("stock-price-ja" . "https://www.google.co.jp/?gws_rd=ssl#q=株価+%s")
               ("translate" . "http://translate.google.com/?source=osdd#auto|auto|%s")
               ("github" . "https://github.com/search?q=%s")
               ("cookpad-us" . "https://cookpad.com/us/search/%s")
               ("cookpad-ja" . "http://cookpad.com/search/%s")
               )
  "Search engine alist"
  :type '(alist
      :key-type (string :tag "Name")
      :value-type (string :tag "URL"))
  :group 'search-on-browser
  )
 
(defun search-on-browser (engine str)
  "Search term in mini buffer."
  (interactive (list
        (completing-read "Search engine: " search-engine nil t "google")
        (read-string "Search term: ")))
  (browse-url
   (format
    (cdr (assoc engine search-engine))
    str)))
 
(defun search-on-browser-region (engine start end)
  "Search term in region."
  (interactive (let ((engine
              (completing-read "Search engine: " search-engine nil t "google")))
         (list engine (region-beginning) (region-end))))
  (save-excursion
    (browse-url
     (format
      (cdr (assoc engine search-engine))
      (buffer-substring start end)))))

12293424 journal
Debian

finedaypicnicの日記: Kernelのversionを指定してpurgeする

日記 by finedaypicnic

function purge-kernel(){
    aptitude search $1 | grep ^i | awk {'print $2'} | xargs aptitude -y purge
}

11125653 journal
Python

finedaypicnicの日記: Emacs24にjedi.elをインストール

日記 by finedaypicnic
この方法が正しいかどうか、わかりませんが参考にしてください。
まず、必要なパッケージをインストールします。

sudo aptitude install python-virtualenv auto-complete-el

/usr/share/doc/auto-complete-el/README.Debianを読んで~/.emacs.d/init.elに設定を追加します。 次にEmacsWikiにあるとおり、~/.emacs.d/init.elに追加してmarmaladeやMELPAのレポジトリを使えるようにします。

(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                         ("marmalade" . "http://marmalade-repo.org/packages/")
                         ("melpa" . "http://melpa.milkbox.net/packages/")))

さらにここにあるとおり、jediの設定も追加します。

(add-hook 'python-mode-hook 'auto-complete-mode)
(add-hook 'python-mode-hook 'jedi:ac-setup)

次にEmacsを再起動して、このコマンドをEmacsで実行します。

M-x package-list-packages

リストからjediを選択してインストールすると、~/.emacs.d/elpa/にインストールされます。
初回利用時に次のコマンドを実行します。

M-x jedi:install-server

すると、ここに紹介されているとおりに、~/.emacs.d/.python-environments/default/ができてPythonの自動補完が使えるようになります。

11125545 journal
Ubuntu

finedaypicnicの日記: Ubuntuにvim-python-jediインストールする際の設定

日記 by finedaypicnic
Ubuntuにvim-python-jediをインストールした後、それぞれのアカウントでvim-addon-managerを設定する必要があります。
詳しくはaskubuntuに投稿しました。
10782768 journal
日記

finedaypicnicの日記: GrampsのWindowsでの日本語設定

日記 by finedaypicnic
普段、UbuntuでGrampsを使っていますが、父のパソコンのWindows 7にインストールを試みました。
GrampsのWindows用の GrampsAIO32-3.4.7-1.exe (Stable 3.4.7 32bit用)を使用して日本語表示が文字化けしました。 そこで、このメーリングリストを参考に、このファイルを直接編集。
C:\Program Files(x86)\GrampsAIO\etc\gtk-2.0\gtkrc
このようにしました。

style "UniFont" {
  font_name = "Meiryo Normal 9"
}

widget_class "*" style "UniFont"

最初、こちらのブログを参考にしてGrampsAIO¥bin¥gtk2_prefs.exeを実行したのですが、中身が更新されず、仕方なく直接編集しました。

10711850 journal
Python

finedaypicnicの日記: Web Storyboard 2

日記 by finedaypicnic

インターネット上で絵コンテを公開できるサイトをDjangoで書きました。
映像製作などにお役立てください。

2015年1月3日追記:
このサイトは閉鎖しました。

10306873 journal
Ubuntu

finedaypicnicの日記: storyboard

日記 by finedaypicnic
storyboardという 絵コンテのデータベースを作るソフトウェアを書きました。
Ubuntuで次の通りにしてインストールできます。

sudo -H -s
add-apt-repository ppa:akuroiwa/storyboard
aptitude update
aptitude install storyboard

6418972 journal
Debian

finedaypicnicの日記: Ubuntuでlive-build利用の際の注意点

日記 by finedaypicnic
live-build 3.xになってから仕様が大幅に変わりました。
Ubuntuでlive-buildを利用してDebian Live作成するには、次の設定をしないと、debootstrapでエラーとなります。

lb config --mode debian

189315 journal

finedaypicnicの日記: Freedom Toaster 邦訳終了

日記 by finedaypicnic
Freedom Toasterのftsoftwareとマニュアルの翻訳が終了しました。詳しくはこちらを御覧下さい。
typodupeerror

皆さんもソースを読むときに、行と行の間を読むような気持ちで見てほしい -- あるハッカー

読み込み中...