Jaydle Development Journal:JA(va) Y(outube)D(l)-E(xtended)

I’m going to make post about note of jaydle development.
This is program which enhance youtube-dl command.

First I made prototype in bash.

It can download simultaneously and can download by just search keywords.

“jaydle -keywords tsunami disasters”

will downloads result videos top 10 automatically.
And I have numbering option from the top search result.
So you can know the order of search result after downloading.

But this shell script needing edit somehow. LoL.

I’m planning to make public journal of Jaydle development. e.g. Implementing SwingWorker, Menu bar, Serialization of the store path, …

So watching me!!!


Programming column: A programming unified viewand

My case fun of programming started from bash script. Was really wanted to accustomed with unix or Linux culture bought tons of unix used books mainly under $10.. lol.

Before that I learned Java but it’s hard to living well with OS ( computing environment). Especially make files, directories, reading, writing, using regular expression and co-operating with environment.

Bash is perfect for co-work with the environments. But not Object Oriented so hard to code maintain and manage.

Once you got through one bash book ( My case O’reilly’s “Learning bash shell” Second edition maybe) u will be interested in Sed & Awk.

Sed is “Stream EDitor” by my memory. This using ed text editor inside might be? Ed is very old text editing program. AT&T Bell Lab’s product. Line orient and matrix(mother) of Vi text editor. It won’t even display whole text. 🤓 Because it’s for printer type display(teletype). In the era no crt display and printed to papers. So this was efficient for paper printer.

Awk is acronym for “Adrian will kome “. 🤕

This is splendid language, Jon Bentley was attracted . Perl’s main influencer..

Python is made by masters of low or middle level languages. There are tons of splendid libraries, functions and programming style guide lines.

The point of the view rom function builder on Java, python or frameworks like angular are built arts by the hackers.

Now they must be loving Arduino or Raspy because that’s EECS “Ying and Yang”.

Compiler knowledge is essential.


Almost Unix commands are written in C.
But those are very small programs. Like things between programs and API.
Programming approach history is getting generality as it in mathematical description.
Unix commands are more like organic, C? Lol.
I thought like this when reviewing Grep command usage and bash programming.

To be continued,,,

Writing “sleep or suspend script” for JACK and qjackctl

JACK is weak for suspend because it needs to be stopped and restarted when come back from suspend. So I’m trying to write suspend script which stop JACK before go to suspend mode and start after come back from sleep.

First stop and start qjackctl command is below.

dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.stop


dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.start


Now I have very simple script that very useful when come back from suspend mode because it stop and restart qjackctl automatically. That is

dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.stop && dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.start

Actually this is enough useful. Lol. But I will try to make better one.

It use

sudo pm-suspend

command. The problem is needs sudoers configuration to use pm-suspend command.
Without this “sudo pm-suspend” in bash shell script won’t do anything.

sudo -S pm-suspend

will work, it receives password from a terminal and will suspend.
And this is almost perfect except for security problem

password='Hacker\'s password'
echo $password | sudo -S pm-suspend

It won’t require to input password interactively.

#Suspend script for JACK(qjackctl)
#First stop JACK and go to suspend
dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.stop
echo $password | sudo -S pm-suspend

Then, this should be assigned with hot key on GUI manager on Ubuntu.

And I guess restart script is harder because I should research mechanism and the script path which automatically done when return from suspend mode.

My plan was logging about sudoers configuration but now I think i can go with this.

I will write again soon. Bye.😀




Personal Memo: SwingWorker class study note (English)

24, Oct, 2018 Wed

Memo to know how to use “SwingWorker” class

publish() is connected with process()

Publish() is used in doInBackground() and send data chunk to process().

T – Result type
V – Type for intermediate result

In processBuild() which is my own, I could’t invoke publish() method.
publish() is method should used in doInBackground() method..
How it be written to process method which takes arguments in doInBackground()?

Reference site

MultiThreading is natural.
Practically Swing suppose to launch several threads.

First post end. To be continued…


とりあえずLibreOffice Writer似とったメモを貼っておく🙃




 簡単 うまくいった




JMenuItemオブジェクトのメソッド addActionListenerからactionPerformedメソッドを実行する


  ダウンロードボタンも少し修正した(JFrameActionListenerを実装せずに内部クラスで実装した)Screenshot from 2018-10-23 22-18-21




class ButtonListener implements ActionListener

public void actionPerformed(ActionEvent e)










  • showOpenDialog()showSaveDialog()メソッドと使うのが最も簡単

  • showDialog()も使える

  • 上記のメソッドはそれぞれユーザがどのようにダイアログを終わらせたかを表す整数のステータスコードを返す

  • もし返却された値がAPPROVE_OPTIONならば、ユーザはファイルを選んだ、それはgetSelectedFile()メソッドから得ることができる












c JARファイルの作成
f ファイル名の決定
v 内容のリストをverboseモードで
m   マニフェストファイルから値と名前を特定する
-C はfileオペランドで指定されたファイルを処理する際にディレクトリが一時的に変更される





     applications - JaydlePrototype01.java がメインメソッドを含むクラス
     practice - IOMethods.java  がメインクラスで使った依存するクラス




javac -d ../JaydleBuild/ applications/JaydlePrototype01.java 
javac -d ../JaydleBuild/ practice/IOMethods.java




masa@em-p:~/Desktop/git/JaydleBuildTest$ tree
├── applications
│   └── JaydlePrototype01.class
└── practice
    └── IOMethods.class

2 directories, 2 files





Manifest-Version: 1.0
Main-Class: applications.JaydlePrototype01



masa@em-p:~/Desktop/git/JaydleBuildTest$ jar cmf Manifest.txt JaydleJarTest.jar ../masa-examples/



masa@em-p:~/Desktop/git/JaydleBuildTest$ jar cmf Manifest.txt JaydleJarTest.jar .


Screenshot from 2018-10-21 22-56-14

jar コマンドで実行可能な JAR ファイルを作成する | まくまく Java ノート




注 Youtube-dlコマンドがターミナルから起動できることが条件です。


Learning About “ActionPerformed” Method And Around “Actions” In JAVA Swing


javax.swing.Action interface

David Flanagan著
JAVA FOUNDATION CLASSES IN A NUTSHELL, A Desktop Quick Reference (O’reilly) 1999, First Edition より

Chapter 3 – Swing Programming Topics – Actions (P26)





To be continued ..


Changing Display Brightness on iMac Ubuntu

Screenshot from 2018-10-20 11-32-35.png

My iMac Ubuntu is hard to change display brightness.

It needs terminal command. By the way have to burn chips again😍 Repair man!



file by text editor or

echo 100 | sudo tee brightness

I was making shell script to do this like

#To change iMac display brightness

echo $1 | sudo tee /sys/class/backlight/radeon_bl1/brightness

But use sudo command in a shell script is pretty hard.


sudo "User Command"


masa@em-p:/sys/class/backlight/radeon_bl1$ sudo iMacDisplay02.sh 
sudo: iMacDisplay02.sh: command not found

Because of /etc/sudoers .

Recommended edit by visudo.


Run Gauche Interpreter on Eclipse with SchemeScript Plugin

First you supposed to have Gauche interpreter on your system.


And install Eclipse plugin from

Help > Install New Software

Work with:


And configure from

Window > Preferences > Scheme > Interpreter > External Interpreter

Command line:

gosh -i
Window > Perspective > Open Perspective > Scheme

and launch Scheme perspective.

Menu > Scheme > Select Interpreter > External Interpreter

And start interpreter.

Good luck😂

Gauche Eclipse



Git push error:Gitでプッシュできなかった件

masa@lve-imac2:~/Desktop/git/masa-examples$ git push https://github.com/iamaturtle113/masa-examples.git master
Username for 'https://github.com': iamaturtle113
Password for 'https://iamaturtle113@github.com': 
To https://github.com/iamaturtle113/masa-examples.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/iamaturtle113/masa-examples.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.



git pull https://github.com/iamaturtle113/masa-examples.git master


masa@lve-imac2:~/Desktop/git/masa-examples$ git pull https://github.com/iamaturtle113/masa-examples.git master
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), done.
From https://github.com/iamaturtle113/masa-examples
* branch master -> FETCH_HEAD
Adding practice/testImport.java
Adding practice/testImport.class
Adding practice/candelTestdir/IOMethods.java
Adding practice/candelTestdir/IOMethods.class
Adding practice/candelTestdir/.IOMethods.java.swp
Auto-merging practice/Thread1.java
CONFLICT (content): Merge conflict in practice/Thread1.java
Adding practice/Thread1.class
Adding practice/Thread1$ImpleRunnable2.class
Adding practice/Thread1$ImpleRunnable.class
Adding practice/RegexPractice01.java
Adding practice/RegexPractice01.class
Adding practice/IOMethods.class
Adding practice/.testImport.java.swp
CONFLICT (directory/file): There is a directory with name practice in HEAD. Adding practice as practice~b343e0c4b8b3b437105f2e8e535e69781941291c
Automatic merge failed; fix conflicts and then commit the result.
masa@lve-imac2:~/Desktop/git/masa-examples$ git push https://github.com/iamaturtle113/masa-examples.git master



To https://github.com/iamaturtle113/masa-examples.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/iamaturtle113/masa-examples.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


git remote add origin https://github.com/iamaturtle113/masa-examples.git



masa@lve-imac2:~/Desktop/git/masa-examples$ git fetch && git merge origin/master
From https://github.com/iamaturtle113/masa-examples
* [new branch] master -> origin/master
error: 'practice' appears as both a file and as a directory
error: practice: cannot drop to stage #0
error: merge is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.


masa@lve-imac2:~/Desktop/git/masa-examples$ git merge origin/master
error: 'practice' appears as both a file and as a directory
error: practice: cannot drop to stage #0
error: merge is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.


masa@lve-imac2:~/Desktop/git/masa-examples$ git status
On branch master
You have unmerged paths.
(fix conflicts and run "git commit")

Unmerged paths:
(use "git add <file>..." to mark resolution)

added by them: practice
both modified: practice/Thread1.java

Untracked files:
(use "git add <file>..." to include in what will be committed)


no changes added to commit (use "git add" and/or "git commit -a")


git add .
git status で確認すると、エラー消えた。
git merge origin/master -> commitしてからマージしてくれと

masa@lve-imac2:~/Desktop/git/masa-examples$ git merge origin/master
fatal: You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you merge.
masa@lve-imac2:~/Desktop/git/masa-examples$ git merge origin/master
Already up-to-date.

masa@lve-imac2:~/Desktop/git/masa-examples$ git push https://github.com/iamaturtle113/masa-examples.git masterUsername for 'https://github.com': iamaturtle113
Password for 'https://iamaturtle113@github.com': 
Counting objects: 21, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (21/21), 7.34 KiB | 0 bytes/s, done.
Total 21 (delta 6), reused 0 (delta 0)
remote: Resolving deltas: 100% (6/6), done.
To https://github.com/iamaturtle113/masa-examples.git
b343e0c..b442916 master -> master