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.
E.G

“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!!!

Advertisements

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,,,

Eclipse error:Editor does not contain a main type or cannot be resolved to a type

eclipse error.jpeg

 

To begin from the cause and solve method…

serObj=load("jaydle.ser");

This statement causes all errors which eclipse said “cannot be resolved to a type” or something like that error.

It highlighted as red circle X, and the others are red light objects.
It said all of my original objects in the class are “cannot be resolved to a type” or something wrong.

From terminal (command line), I tried to compile and error occurred, it pointed

masa@em-p:~/Public/git/jaydle-project/jaydle-project$ javac src/jaydle/JaydlePrototype.java 
src/jaydle/JaydlePrototype.java:61: error: <identifier> expected
serObj=load("jaydle.ser");

So commented out the line,

all of errors disappeared and Mose came. lol.

 

I tried configure “Java build path” but it wasn’t effective.

Eclipse configuration is hard. And error detective system this case reverse effected….

See you!

Installing Qtractor: Made a lots errors

qtractor installing a lots errros.

My case it needed

sai means “sudo apt-get install”

 

ERROR MESSAGE1
*checking for Qt library version >= 5.1… no; Qt 5.1 or greater is required

-> sudo apt-get install qt5-default

 

ERROR MESSAGE2
*configure: error: *** SNDFILE library not found.

-> sai -libsndfile-dev

 

ERROR MESSAGE3
checking for qmake-qt5… no
configure: error: qmake-qt5 not found in current PATH. Maybe QT development environment isn’t available. (qt5-devel)

->sudo apt-get install qt5-qmake

Next I tried below commands but don’t know was necessary.

{-> sai qtchooser

->export QT_SELECT=5}

Next

-> sudo apt-get install qt5-default

 

next

ERROR MESSAGE4
checking for sndfile… no
configure: error: *** SNDFILE library not found.

-> sai -libsndfile-dev

 

next

ERROR MESSAGE5
Project ERROR: Unknown module(s) in QT: x11extras

 

->apt-cache search libqt5x11extras

->sai libqt5x11extras5-dev

solved
And then, did
“sudo make” and “sudo make install”
ERROR MESSAGE5
lupdate: could not exec ‘/usr/lib/x86_64-linux-gnu/qt5/bin/lupdate’: No such file or directory

->sudo apt-get install qttools5-dev-tools

FINISHED😃

 

qtractor

 

Ubuntu: Package broken error

My ubuntu couldn’t update because of linux-header missing.

To tell the result, “sudo apt-get clean, update, upgrade” solved this problem.

upgrade called grub install prompt, so perhaps avoiding this is better.

Below is just memo.

Package Broken

Check if you are using third party repositories. If so disable them, since they are a common source of problems.

Furthermore run the following command in a Terminal: apt-get install -f

Transaction failed: The package system is broken

The following packages have unmet dependencies:
linux-headers-4.4.0-139-generic: Depends: linux-headers-4.4.0-139 but it is not installed

linux-headers-4.4.0-139-lowlatency: Depends: linux-headers-4.4.0-139 but it is not installed

-f option of apt-get install  is  ( -f, –fix-broken)

Fix; attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution. If packages are specified, these have to completely correct the problem. The option is sometimes necessary when running
APT for the first time; APT itself does not allow broken package dependencies to exist on a system. It is possible that a system’s dependency structure can be so corrupt as to require manual intervention (which usually means using dpkg –remove to eliminate some of the offending packages). Use of this option together with -m may produce an error in some situations. Configuration Item:
APT::Get::Fix-Broken.

Is linux-header api of c?

error message of desktop icon:
Error
Broken count > 0.

Error message of “sudo apt-get install linux-headers-4.4.0-139”

masa@em-p:~$ sai linux-headers-4.4.0-139
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
linux-headers-4.15.0-34 linux-headers-4.15.0-34-generic linux-headers-4.4.0-137 linux-headers-4.4.0-137-lowlatency
linux-headers-4.4.0-138-generic linux-image-4.15.0-34-generic linux-image-4.4.0-137-lowlatency
linux-modules-4.15.0-34-generic linux-modules-extra-4.15.0-34-generic
Use ‘sudo apt autoremove’ to remove them.
The following NEW packages will be installed:
linux-headers-4.4.0-139
0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.
42 not fully installed or removed.
Need to get 0 B/10.1 MB of archives.
After this operation, 71.0 MB of additional disk space will be used.
(Reading database … 486606 files and directories currently installed.)
Preparing to unpack …/linux-headers-4.4.0-139_4.4.0-139.165_all.deb …
Unpacking linux-headers-4.4.0-139 (4.4.0-139.165) …
dpkg-deb (subprocess): cannot copy archive member from ‘/var/cache/apt/archives/linux-headers-4.4.0-139_4.4.0-139.165_all.deb’ to decompressor pipe: failed to read (Input/output error)
dpkg-deb (subprocess): decompressing archive member: lzma error: unexpected end of input
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/linux-headers-4.4.0-139_4.4.0-139.165_all.deb (–unpack):
cannot copy extracted data for ‘./usr/src/linux-headers-4.4.0-139/arch/mips/include/asm/octeon/cvmx-npi-defs.h’ to ‘/usr/src/linux-headers-4.4.0-139/arch/mips/include/asm/octeon/cvmx-npi-defs.h.dpkg-new’: unexpected end of file or stream
Errors were encountered while processing:
/var/cache/apt/archives/linux-headers-4.4.0-139_4.4.0-139.165_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

“sudo apt-get clean” (clear cache)

“sudo apt-get update” and “sudo apt-get upgrade”

resolved this.

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

#!/bin/bash
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.

#!/bin/bash
#Suspend script for JACK(qjackctl)
#First stop JACK and go to suspend
dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.stop
password='********'
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.😀

 

 

 

Music from Youtube: Ami Suzuki “Love the island”

 

My new demo song reminded me this song.

The the words of this song spiked me.

Wanna listen 12 times.😤

 

※love the island 過ぎてゆく 小さい毎日が 気まぐれと ずっと遊んでいたら こんなに時がすぎていた

※※love the island 忘れない はじめて夜空の下で 抱き合っていたい やっとわかった あなたを思い出しすぎている

ゆっくりと静かに 気付かれず忘れたい

綺麗に焼けていく肌と 乾いてる心を 慰めてくれるのは 街並みのイルミネーション

また今度ってじらされて 涙も流したかもね 何だって教えてくれた あの夏を忘れられない

love the island 深呼吸 している 座り込んで 愛は結局出会っても 不安で何も楽になれない

本当はあなたの 目の前で思いきって 泣いてみたり笑ってみたり 怒ってみたりさせて欲しかった
穏やかな一日も あなたへの想いはつのる

海を3時間ちょっと 飛行機で飛び超えた

空港ではきかえた サンダルがちょっとてれてる

また出直しだから いくらでもどうにでもなる

旅立ちの季節かな? 少しだけ夢を見させて
※love the island 過ぎてゆく 小さい毎日が 気まぐれと ずっと遊んでいたら こんなに時がすぎていた

※※love the island 忘れない はじめて夜空の下で 抱き合っていたい やっとわかった あなたを思い出しすぎている

ゆっくりと静かに 気付かれず忘れたい mu…

 

 

 

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().

SwingWorker<T,V>
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
http://www.javacreed.com/swing-worker-example/

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

First post end. 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!

change

/sys/class/backlight/radeon_bl1/brightness

file by text editor or

echo 100 | sudo tee brightness

I was making shell script to do this like

#!/bin/bash
#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.

And

sudo "User Command"

results

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.

Tough!!😊

Run Gauche Interpreter on Eclipse with SchemeScript Plugin

First you supposed to have Gauche interpreter on your system.

Here
http://practical-scheme.net/gauche/download.html

And install Eclipse plugin from

Help > Install New Software

Work with:
http://schemeway.github.io/SchemeScript/update-site

GaucheEclipse

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