-
Notifications
You must be signed in to change notification settings - Fork 38
/
dev-diary.txt
206 lines (123 loc) · 5.94 KB
/
dev-diary.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
YEAR 2022
MARCH
31st
Well, frontend development is just ongoing.
APRIL
1st
Costed one hour try to find an event propagation problem,
but finally found it's a matter of CSS selector.
BTW frontend can communicate with backend now.
2nd
(Formally) Started playing with Android.
Costed 4 hours to find why Java class (on android) always can't be found,
but finally realized pyjnius can't work with python thread/subprocess,
while I'm using ThreadingHTTPServer.
See "Note" around:
https://python-for-android.readthedocs.io/en/latest/buildoptions/#webview
NEVER MISS ANY SENTENCE OF A DOCUMENT
3rd
Costed the whole day to solve WebView problem --
it doesn't do reaction to <input type="file"> by default.
Finally done with library AdvancedWebView, but still with some hacks.
... It's now 4th 2:00 a.m. though
4th
Purged many small problems.
Wished to release it today, but no luck...
5th
Bundle script, optimized project structure.
It's finally ready...
6th
Documentation.
What else? First Release!
... ...
(some day)
Determined to make backend better,
but resulting in full rewrite.
... ... (worked hard)
15th
Feeling it's there.
Oh, asyncio always quits like a mad cat, throwing bleak there
and just ends everything, uncleanly.
16th
Solved many things left yesterday.
Thought i18n needs be universal across there, so made one by myself.
Tried to implement flip, rtl and wrap in text printing,
wasted some time, but didn't regret.
Well, slightly update document and try compiling,
give everyone a surprise.
Try --release on p4a build. It worked. 5.9MiB apk, satisfied now?
Don't forget -Djava.net.useSystemProxies=true on gradle anymore,
when a proxy to google is needed.
Phone says a release apk should be signed to be installed.
Satisfy it. https://stackoverflow.com/questions/4853011/how-to-sign-an-android-apk-file
Okay, it's 17th 3 a.m. publish it and sleep.
... ... (doing something else)
24th
Took some misc things.
Made a minor change in `server.py`,
but resulting in MUCH faster server response...
I don't know what's the point. But it's great. Period.
... ... (went away for other ideas)
JULY
7th
In this period I've struggled about many bad things, notably Node.js.
That's the worst dev experience, ever. Darn it and luckily I didn't take it as my primary skill.
I'd tell less about; here is a place to start to know what's wrong with all of those:
http://harmful.cat-v.org/software/
(Don't take everything serious; what really matters is the philosophy: do one thing and do it well.)
I'm trying to balance it all the way. And look that in this small project:
how users are satisfied, average or advanced;
how developers contributed, novice or experienced.
Here is an unseen star of the galaxy, not even comparable to the megas.
But, settling here means that we are unique, and its existence is the best gift, to the world, to everyone.
Hope the spirit will persist.
----
After seeking around, I'll go farther. In my GitHub profile Bio there is a short description.
Here in this project, I have idea: Tcl/Tk
https://tcl.tk/
I want to make a path to communicate between that Python backend and a "better" frontend.
There's currently one, Web, but Web is too heavy in some cases, and I'm not that satisfied.
Tcl/Tk is a good choice. Python have Tkinter, but I don't go with it.
The simplest approach is shell/subprocess `python3 printer.py` at Tcl side.
Feel free to make one if you have experience & time, but I'd go in other way --
I want it through stdin/stdout of `wish`, the Tk shell.
Tk just do the UI, and echo interactions back (like when user click button, or input text)
The same can also be applied to Web, but maybe with frequent/delayed requests (or even WebSocket),
so that it become universal.
That may involve another (partial) rewrite.
Afraid not, experiment always worth it. And remember: it's all about idea, everyone can make use of then.
Yawn... bed time...
9th
Did some stylesheet fix.
Then go for image rotation. It shouldn't be that hard:
0 1 2 3 16 17 18 19 32 33 34 35 48 49 50 51
4 5 6 7 20 21 22 23 36 37 38 39 52 53 54 55
8 9 10 11 24 25 26 27 40 41 42 43 56 57 58 59
12 13 14 15 28 29 30 31 44 45 46 47 60 61 62 63
16 17 18 19 32 33 34 35 48 49 50 51 64 65 66 67
20 21 22 23 36 37 38 39 52 53 54 55 68 69 70 71
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
Think about HTML canvas ImageData, one dimensional [R,G,B,A,...] array.
The "big" problem is just make a procedure to transform from the first matrix to the second.
(and flip the result horizontally)
Know what happened? I produced a right procedure from very start, but the image screwed up.
Tried to "fix" it, used at least 4 hours, finally found it's a matter of didn't floor a floating number.
(Height is got by multiplying aspect ratio)
So the Internet JavaScript memes are damned true.
https://programmerhumor.io/javascript-memes/why-is-it-like-this-2/
https://programmerhumor.io/javascript-memes/sorry-dad-_-2/
14th
... How silly is the above approach. This time I simply changed to Uint32Array. That became much more trivial.
So, I've re-written the image processing "lib". I wanted to go for WebAssembly (with AssemblyScript), so made it separate (in dir `wasm`).
After finish, it really worked -- but it's ~100% slower than the equivalent JavaScript (`asc` versus `tsc`)
And that may involve unacceptable change to scripting structure (ESModule etc.), thus Wasm was given up.
But hey, in this rewrite some algorithm practial overhead was removed, thus much more efficient! Enjoy the blazing speed!
In main.js the event handler was reworked too. No more double event dispatches.
Thanks to this, another image processing performance problem is fixed.
YEAR 2023
APRIL
2nd
Anniversary days to Cat-Printer! Thank all of you! Keep it up!