tag:blogger.com,1999:blog-2321379787409558812024-03-14T07:06:14.190-07:00Z's spaceQunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.comBlogger130125tag:blogger.com,1999:blog-232137978740955881.post-15425607963985917202022-07-02T10:17:00.000-07:002024-03-01T17:53:06.561-08:00New release of Ada for Slackware 15.0<p>Finally, after many years of inavtivity, a <a href="https://github.com/qunying/ada-4-slackware/releases" target="_blank">new release</a> is out for Slacware 15.0.</p>
<p>Major changes of this release: contains the <a href="https://github.com/qunying/ada-4-slackware/releases" target="_blank">Alire</a>; the GNATStudio is using the binary <a href="https://github.com/AdaCore/gnatstudio/releases" target="_blank">GNAT Studio Continuous Release 20220512</a>, I failed to build it from source due to lots of dependcies and stuck in the <a href="https://github.com/AdaCore/ada_language_server/" target="_blank">Ada langguare server</a>; a build script that boostrap <a href="https://github.com/AdaCore/gprbuild/" target="_blank">gprbuild</a> and build/install all the basic packages (XMLAda, GTKAda, Florist, AUnit, GNATCOLL, etc).</p>Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-74460967577166711212022-02-03T14:04:00.003-08:002022-02-03T14:04:56.426-08:00Hooray Slackware 15.0 is released!Finally, after years of hardwork, <a href="https://www.slackware.com/index.php" target="_blank" rel="nofollow">Slackware 15.0 finally released</a>!
Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-70530094223491838782021-10-17T18:00:00.000-07:002021-10-17T18:00:39.133-07:00Feed from AdaCore's blog not working properlyI have been subscribed to <a href="https://blog.adacore.com/feed" target="_blank" rel="nofollow">AadCore's blog feed</a> for some time. Its feed content was OK for some time, and suddently does not work any more (also for some time already, I just did not have time to tackle the problem). I could not get any new feed, altough I could see new blog entries posted. With both feed readers <a href="https://lzone.de/liferea/" target="_blank" rel="nofollow">Liferea</a> and Thunderbird, I could not get it display any feed.
<p>After invesitigation, I found the feed respone content is not conform to the standard, it contains a new line at the start of the feed, and has javascript block at the end of the response.
<p>When doing further investigation with Liferea, I found that it supports a very useful feature, a conversion filter. After try and error, I formuate a sed filter commands that could remove all those invalid entries in the source:
<pre>sed -e '1d' -e 's/<\/rss>.*$/<\/rss>/' -e '/<\/rss>/q'</pre>
The first script removes the first line, the 2nd script remvoes all characters after <i></rss></i> in the same line, the 3rd scripte stops when encounter <i></rss></i>, effectively remove all contents after the matching line.
Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-80842304264689950172020-11-27T10:32:00.001-08:002022-07-14T14:08:54.166-07:00Mystery crash in an SDL2 application (solved)<p>I am developing an application in SDL2. It works OK most of the time.
But once in a while, it will crash while just going to refresh the screen with new content with <a href="https://wiki.libsdl.org/SDL_RenderPresent" target="_blank">SDL_RenderPresent()</a>. The backtrace from gdb shows:
<pre>#0 0x00007ffff73a1c7b in raise () from /lib64/libc.so.6
#1 0x00007ffff7382548 in abort () from /lib64/libc.so.6
#2 0x00007ffff35a682b in ?? () from /usr/lib64/xorg/modules/dri/iris_dri.so
#3 0x00007ffff40a5886 in ?? () from /usr/lib64/xorg/modules/dri/iris_dri.so
#4 0x00007ffff35c29e9 in ?? () from /usr/lib64/xorg/modules/dri/iris_dri.so
#5 0x00007ffff35b6d2b in ?? () from /usr/lib64/xorg/modules/dri/iris_dri.so
#6 0x00007ffff4ef99e0 in glPrimitiveBoundingBox () from /usr/lib64/libGLX_mesa.so.0
#7 0x00007ffff4eecad1 in ?? () from /usr/lib64/libGLX_mesa.so.0
#8 0x00007ffff7ef6283 in ?? () from /usr/lib64/libSDL2-2.0.so.0
#9 0x0000000000415f42 in refresh_display (ctx=0x7fffffffd370) at gui/main.c:1077
#10 0x0000000000413c79 in main_loop_handler (ctx=0x7fffffffd370) at gui/main.c:362
#11 0x0000000000413b22 in main (argc=1, argv=0x7fffffffdd58) at gui/main.c:323
</pre></p>
<p>I searched around the web with SDL2 crashing during <emph>SDL_RenderPresent()</emph>. Most of them points to some form of memory corruption causing that, but I have double check my code with various tools and manual inspection, there is no memory corruption. Then I came across this article <a href="https://devcry.heiho.net/html/2015/20150211-rock-solid-frame-rates.html" target="_blank">"Rock solid frame rates with SDL2"</a>, it mentioned a function <emph>SDL_SetSwapInterval()</emph> which will delay <emph>SDL_RenderPresent()</emph> from swapping the render buffers till the swap interval (wait for vsync). This seems match what I suspected that the buffer is updated on the wrong time and causing the crash.</p>
<p>There is just a little problem, there is no more <emph>SDL_SetSwapInterval()</emph> any more, in stead it become <a href="https://wiki.libsdl.org/SDL_GL_SetSwapInterval" target="_blank">SDL_GL_SetSwapInterval()</a>. I added in the oneline call <emph>SDL_GL_SetSwapInterval(1)</emph>, and vala, so far all tests do not show the crash anymore.</p>Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-88380963624985300442020-07-09T09:46:00.001-07:002024-03-01T17:51:28.241-08:00WebAssmebly passing string from C to JavaScript<p>Recently, I am working on a project that involves <a href="https://webassembly.org/">WebAssembly.</a>
In the project I would need to call out a JavaScript function with a C string
<var>char *string</var> as parameter.</p>
<p>I could not get the string in JavaScript function, searching on the internet does not
result in any useful information. None of the solutions I found are elegant. Then I realized I had
used the WebSocket APIs from <a href="https://emscripten.org/">Emscripten</a>, which is passing the
URL as a C string to the underline JavaScript support function. How does it do that? I digged out the <a href="https://github.com/emscripten-core/emscripten/blob/master/src/library_websocket.js">source</a> of it
and found in function <var>emscripten_websocket_new</var>, it is using <var>UTF8ToString</var>
to convert the C string to a JavaScript String.
<a href=https://emscripten.org/docs/api_reference/preamble.js.html#conversion-functions-strings-pointers-and-arrays><var>UTF8ToString</var></a> is Emscripten's runtime function,
I could not call it directly from my JavaScript function.</p>
<p>According to the <a href=https://emscripten.org/docs/api_reference/preamble.js.html>preamble.js</a> document,
I would need to use <code>-s 'EXTRA_EXPORTED_RUNTIME_METHODS=["UTF8ToString"]'</code> on the linker command to
export the function and use it as <code>Module.UTF8ToString</code>. Problem solved.</p>
<p>Below are sample code that demonstrate the usage:<br />
JavaScirpt function:
<pre>
function processing_string_from_c(ptr, len) {
var text = Module.UTF8ToString(ptr, len);
....
}
</pre>
In the C code:
<pre>
char *string;
...
EM_ASM({process_string_from_c($0, $1);}, string, strlen(string));
...
</pre>
And in the linker line, remember to use
<pre>-s 'EXTRA_EXPORTED_RUNTIME_METHODS=["UTF8ToString"]'</pre>
P.S. In the latest release of emscripten, the export functions become global scope. So calls would be <code>UTF8ToString()</code> directly.Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-54172996647632472152018-07-25T16:17:00.000-07:002018-08-08T13:22:35.937-07:00Slackware Creator Patrick Volkerding needs helpIt was sad to know that <a href="https://www.linuxquestions.org/questions/slackware-14/donating-to-slackware-4175634729/#post5882751">Patrick (The creator/maintainer of Slackware)</a> is on financial crisis.
<p>
It is unfortunate that he do not get his share of income from the store, and now he is
<blockquote>I mean, I'm sitting here in a house with a giant hole in the roof, a broken
door sealed with duct tape, and a failed air conditioning condenser that I can't afford
to fix, my wife has been driving on a spare tire for weeks, my teeth need serious
attention again, and I only just got a machine here with UEFI for the first time
(bought a used machine... really out of my budget but it had to be done).</blockquote>
<p>
The Slackware community is eager to help and for
the time being <a href="https://www.linuxquestions.org/questions/slackware-14/donating-to-slackware-4175634729/page11.html#post5883695">Patrick gave his PayPal</a> account link before he could setup
a proper channel for donation.
<p>
Patrick Volkerding's Paypal account: <a href="https://www.paypal.me/volkerdi">https://www.paypal.me/volkerdi</a>
<p>And please donate if you like Slackware and willing to help.
<p>Patrick has a cafepress account for <a href="https://www.cafepress.com/volkerdi">Official Licensed Slackware Store</a>.
<a href="https://www.linuxquestions.org/questions/slackware-14/donating-to-slackware-4175634729/page37.html#post5889067">Confirmed by Patrick.</a>
Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-89343102771591111232018-02-02T10:36:00.001-08:002018-02-02T10:36:08.260-08:00Why people think bitcoin has value, I still don't understand?<p>I still don't understand why people will value Bitcoin or any derivative
coins.
</p>
<p>
When I first heard about the name of Bitcoin when it was first come out,
my instinct think of it has absolutely no value besides
wasting resources to calculate those blocks.
</p>
<p>
The so call decentralize nature of it only has value on the eyes criminal
for money launching. Each and every transaction need to be kept in the
bitcoin network and it is growing bigger and bigger. That is causing
<a href="https://coincentral.com/how-long-do-bitcoin-transfers-take/">Transaction are getting longer and longer</a>
</p>
<p>
Even with today's value of USD$8K per bitcoin, I still see no value of it.
</p>Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-78474825939289964542017-10-30T14:46:00.002-07:002017-10-30T14:46:56.956-07:00Ref: Macbook charger teardownRef: <a href="http://www.righto.com/2015/11/macbook-charger-teardown-surprising.html">Macbook charger teardown: The surprising complexity inside Apple's power adapter</a> by Ken Shirriff.Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-76608636597030532292017-10-04T10:44:00.000-07:002017-10-04T10:44:41.145-07:00New Ada for Slackware releasedFinally, long after released of GNAT GPL 2017 and GCC in 7.x series in Slackware-current,
I got some time to work on the Ada environment for Slackware and got a working version of GPS.
<p>
The new release is at <a href="https://github.com/qunying/ada-4-slackware/">GitHub</a>Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-47494580692003251722017-05-19T11:05:00.000-07:002017-05-19T11:12:20.459-07:00Raised Fist Emoji<div style="text=center"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLKDCh1nstQKj0IXEp4qylF5BvTD-02Lw7EUZogwPJouB2n7zqihmbTsxpoKts7WWC4VHVcW6uCBsr_99sR6DvYS-JsIvGFzyZ-_I9ffUI8_ZhByidlls2BXZ7R2EtLrMsm7E1zBq8Tew/s1600/435fe70307bc055c802a5bb9f4613f8c.png" /><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLKDCh1nstQKj0IXEp4qylF5BvTD-02Lw7EUZogwPJouB2n7zqihmbTsxpoKts7WWC4VHVcW6uCBsr_99sR6DvYS-JsIvGFzyZ-_I9ffUI8_ZhByidlls2BXZ7R2EtLrMsm7E1zBq8Tew/s1600/435fe70307bc055c802a5bb9f4613f8c.png" /><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLKDCh1nstQKj0IXEp4qylF5BvTD-02Lw7EUZogwPJouB2n7zqihmbTsxpoKts7WWC4VHVcW6uCBsr_99sR6DvYS-JsIvGFzyZ-_I9ffUI8_ZhByidlls2BXZ7R2EtLrMsm7E1zBq8Tew/s1600/435fe70307bc055c802a5bb9f4613f8c.png" /></div>
✊✊✊Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-91341327317618223552017-05-04T10:14:00.000-07:002017-05-04T11:10:58.919-07:00GCC 7.1 is out<p><a href="https://gcc.gnu.org/gcc-7/" target=_blank>GCC 7.1 was released on May 2.</a></p>
<p>I tried it out and recompiled all my Ada related builds, <strike>finally I got a stable GPS
that does not crash after opening a project file</strike>. It still crashed on me, maybe I should revert
to an older version?
</p>
<p>
I have updated my build scripts
<a href="http://https://github.com/qunying/ada-4-slackware" target=_blank>ada-4-slackware</a> on gitHub.
There is still some problems with ASIS 2016, some API changed for the new compiler,
will update the build script once got time.</p>Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-22302569078834882952017-04-20T11:06:00.000-07:002017-04-20T11:06:31.152-07:00A strange 3D building from Google earthAs Google just release a new version of Google earth, I tried it on my phone with
"I'm feeling Lucky" button ^_^, it lead me to the "Montparnasse Tower", the 3D view
is strange on the north-west facing, there is a swirling hole in the upper part of the building.
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY6P-6tTSXQp-c0EYFTfMy5jCCgMbP2sNyU_ngLH2OILT323untfXYgDo0sY5AClCqC6ynw7nc5Bj0dhg6GYOU2bv0rTimQTiE2VYGB_6eOiZjXVe8Ii874rFKE_48021x8i2D9P9px4o/s1600/Montparnasse-tower.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY6P-6tTSXQp-c0EYFTfMy5jCCgMbP2sNyU_ngLH2OILT323untfXYgDo0sY5AClCqC6ynw7nc5Bj0dhg6GYOU2bv0rTimQTiE2VYGB_6eOiZjXVe8Ii874rFKE_48021x8i2D9P9px4o/s320/Montparnasse-tower.jpg" width="320" height="224" /></a></div>
You could find it by searching "Montparnasse Tower" or go to this link <a href="https://earth.google.com/web/@48.84208373,2.32163335,176.80863415a,316.99543728d,35y,126.46197217h,44.99777544t,-0r/data=ClUaUxJNCiUweDQ3ZTY3MWNjYWUwMDI0NTE6MHhmYzA0ZmY5YzFiMWM1OTNjGW6cuSzLa0hAIRk2b0FbkwJAKhJNb250cGFybmFzc2UgVG93ZXIYASAB" target='_blank'>Montparnasse Tower</a> from Chrome.Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-75504872529362146532017-01-25T17:20:00.001-08:002017-01-25T17:20:32.250-08:00Ref: Decrypting TLS Browser Traffic With Wireshark – The Easy Way!Ref: <a href="https://jimshaver.net/2015/02/11/decrypting-tls-browser-traffic-with-wireshark-the-easy-way/">Decrypting TLS Browser Traffic With Wireshark – The Easy Way!</a>
<br>
Ref: <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format">NSS Key Log Format</a>
Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-90166217380110340962017-01-20T16:16:00.001-08:002018-06-07T15:39:20.732-07:00Tangerine Bonus Orange Key <div style="background-color: rgb(245, 132, 38); border: 5px solid #f58426; border-radius: 25px;">
<br>
<h1 style="text-align: center;"><font size="15">Your Free Orange Key</font></h1>
<div align="center">
<table style=" text-align: center; width: auto;" cellspacing="0"
cellpadding="0">
<tbody>
<tr><td style="vertical-align: top;">
<h1 style="text-align: center; background-color: rgb(51, 102, 255);">
<font size="15">48455197S1</font></h1>
</td>
</tr>
</tbody>
</table>
</div>
<h4 style="text-align:center;"><font size="+3"><a
href="http://www.tangerine.ca/en/sign-me-up/index.html"
target="_blank">Enroll Now</a></font><br>
</h4>
</div>
This is my orange key, when you signed up for a new account, please use it as a
reference so that both of us could get some bonus from Tangerine.
</p>
Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-56116262034285505072017-01-16T10:54:00.001-08:002017-01-16T10:54:40.425-08:00iPad not charging and a simple solution<p>I got an iPad that is not charging, connect the power cable does not show any indication
of charging, and power keeps draining. Search around the web, it seems it is quite common.</p>
<p>
I follow a few advises from the search:<br />
<ol>
<li>Use compressed air to clean the input socket.</li>
<li>Force a restart.</li>
<li>Switch outlets or ports.</li>
<li>Switch cables.</li>
<li>Restore in iTunes
</ol>
</p>
<p>None of it working. But, during test of stage 5, I actually got the iPad
charged in recovery mode. And it only works in recovery mode when connecting to a computer,
it won't work when charging from an power adapter.</p>
<p>That makes me thinking, why could it be charged under recovery mode but not normal operation?
Hardware seems working, is it a software issue? But I have fully restored the iPad with no success.
I search the web again, and found this one:
<a href="http://http://www.iphonehacks.com/2013/12/tip-iphone-not-charging.html">Simple solution if your iPhone or iPad is not charging</a>.
It seems simple, and I took a toothpick and start picking the input socket, it does not
have lots of lint coming out, just a little bit of dirt. And it works!
</p>
Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-91142180292886497142016-11-30T10:35:00.001-08:002016-11-30T10:35:43.598-08:00ZSTD - A new compression tool <p>I has some personal interest in compression. Recently, I found this new compression tool:
<a href="http://facebook.github.io/zstd/" target=_blank>ZStd</a>. It compresses much faster than gzip with
better compression ratio.
</p>
<p>For a not so scientific benchmark ^_^, to compress linux-4.4.34.tar (648867840 bytes) kernel,
time reports the following:
</p>
<pre>
time zstd linux-4.4.34.tar
real 0m5.157s
user 0m4.116s
sys 0m0.534s
time gzip -k linux-4.4.34.tar
real 0m21.255s
user 0m20.891s
sys 0m0.175s
time xz -k linux-4.4.34.tar
real 4m21.785s
user 4m21.430s
sys 0m0.265s
648867840 linux-4.4.34.tar
132581836 linux-4.4.34.tar.zst (20.43%) 5.157s
137210920 linux-4.4.34.tar.gz (21.15%) 21.255s
90543184 linux-4.4.34.tar.xz (13.95%) 4m21.785s
</pre>
<p>It took zstd much less time to compress with slightly better compression than gzip.
For a better benchmark, please refer to the zstd's
<a href="http://facebook.github.io/zstd/" target=_blank>home page</a>.</p>
<p>There is a <a href="https://slackbuilds.org/repository/14.2/system/zstd/?search=zstd" target=_blank>SlackBuilds package</a> maintain by me for Slackware also.
Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-58812215991242638702016-09-13T10:31:00.000-07:002016-09-20T10:18:25.846-07:00Ada programming environment based on GCC 6.2 and GNAT GPL 2016 in Slackware64 14.2<p>New release of Slackware and new version of GNAT GPL 2016 prompt me to update the Ada programming environment under Slackware.</p>
<p>First, I was trying to use the stock 5.3 compiler, but encounter gnat compiler error when compiling gprbuild. So has to use the FSF GCC 6.2 as the based.</p>
<h4>The FSF GCC compiler</h4>
At the writing, the latest release of GCC is 6.2.0. First I update the build script to matched what's in the current tree. I have changed the build directory to a fixed location to avoid the random location in the original script. As it is needed for gnat_util build, a fixed location is easier for the script to find the right files. Built and install without problem.
<br />
<br />
<h4>GNAT Environment package</h4>
<p>This package contains startup scripts to setup Ada project path environment variable ADA_PROJECT_PATH and GPR_PROJECT_PATH. They will be installed into /etc/profile.d by the doinst.sh.</p>
<p>Also soft link of the GNAT Ada run time libraries are also created in doinst.sh.</p>
<h4>XMLAda</h4>
For XMLAda GPL 2016, the default build process is making use of gprbuild, which depends on XMLAda. I followed what was done on Arch Linux and created a custom Makefile.SlackBuild. But I installed the package with the following scheme, similar to what GNAT GPL 2016 is doing but with sub-directories for each sub-module:
<pre>
usr/include/xmlada
|- input
|- unicode
...
usr/lib64/xmlada
|- input
| |- static
| `- relocatable
|- unicode
| |- static
| `- relocatable
...
</pre>
The document build requires Sphinx, as SlackBuilds.orgprovides all necessary build scripts, it is a matter of installing the relevant packages and dependencies.
<h4>GPRBuild</h4>
The 2016 version of gprbuild required gprbuild itself. So Similar to XMLAda, a custom Makefile was borrowed from the Arch Linux project and modified to suite the needs of Slackware. A patch was developed for the gprinstall program, so that its default library subdir and library soft link subdir points to lib64 under Slackware64. A gpr library is also created, as it is needed by a few other programs
<br /><br />
<h4>GNAT_UTIL</h4>
The GNAT Util Libraryprovides access to GNAT compiler internals for AdaCore utilities. The latest release is 5.1.0, it is used for our GCC 6.2.0. The build went well.
<br /><br />
<h4>GTKAda</h4>
It does not build very well at the first few builds, it keeps installing libs into /usr/lib in stead of /usr/lib64 on 64-bit system. It seems the generate file still insist on the lib's path. So more sed commands are added to change the lib path to lib64 on 64-bit system. After that, it built without problem with proper installation path.
<br /><br />
<h4>Aunit</h4>
Aunit's build script has no big change from the previous version, except for the version bump.
<br /><br />
<h4>GNATColl</h4>
I used version 16.1 from <a href="https://github.com/AdaCore/gnatcoll/releases">GitHub</a>. GNATColl compiled OK, with minor problem with lib's installation path, similar to the problem in GtkAda. I always got gpr.gpr problem when compiling GPS, latter I found that not sure why, the installing process of gnatcoll will install a copy of the gpr.gpr project file and related object file and source into its own directory structure with some modification to gpr.gpr and causing error on the project file. I have to manually remove all gpr related files and directories and entries in the manifests file. Then GPS will compile with correct project file.
<br /><br />
<h4>GPS</h4>
After fixing the gprbuild, gpr and gnatcoll libraries, GPS compile without problem. When running GPS, it gave python script warning about pep8 and jedi, after install those two from SlackBuilds.org, everything is working fine.
<br /><br />
<h4>Florist</h4>
No trouble when compile and install florist.
<br /><br />
<h4>Asis</h4>
Asis has no problem to compile and install after fixed the gprbuild install path.
<br /><br />
<h4>Gnatmem and Ahven</h4>
Gnatmem (need to compile the binutils for Slackware 14.2 and use the build tree) and Aheven gave no trouble when compiled for the 2016 version.
<br /><br />
All build scripts are available at <a href="https://github.com/qunying/ada-4-slackware">GitHub</a>.
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnTzf7f2ZHVsJM6ctxJEgfj53Q8YdSVY3d2odopLq4yeVzO18zjhpne-EKRJErHlr7G-fh1dT7fejQjpbJHeP6zRtpQoG4Lxd9LkljIVKU6YjOQamnHNvF7aJ0nAWQjgdnHKYTnnZE9jM/s1600/gps-2016.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnTzf7f2ZHVsJM6ctxJEgfj53Q8YdSVY3d2odopLq4yeVzO18zjhpne-EKRJErHlr7G-fh1dT7fejQjpbJHeP6zRtpQoG4Lxd9LkljIVKU6YjOQamnHNvF7aJ0nAWQjgdnHKYTnnZE9jM/s320/gps-2016.png" width="295" height="320" /></a></div>Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-45782526407858235912016-06-19T09:01:00.002-07:002016-06-23T14:45:49.418-07:00How to mount NTFS filesystem on OS X<p>I have a Dell backup drive and would like to backup some of my files on OS X to it.
But unfortunately it is formatted as NTFS, by default it is mounted read only on OS X.
</p>
<p>Searching around, I found someone mention about the NTFS-3G, that is the tool
I am using for Linux. It seems the fastest access is NTFS for Mac from <a target=_blank href="http://www.tuxera.com/products/tuxera-ntfs-for-mac/">Tuxera.com</a>, it is
also the sponsor of the open source project NTFS-3G. At first, I try to see if I could
order it, but it has a price tag of $36.33, well, if it were below the $10 mark I will buy it,
this price is a little pricy.
</p>
<p>Next I try to find if any ntfs-3g binary package is available, the latest I could
find is from 2010, a little bit out dated. Then I came across this OSXFuse's project wiki about
<a target=_blank href="https://github.com/osxfuse/osxfuse/wiki/NTFS-3G">NTFS-3G</a>.
I install the latest 3.4 <a target=_blank href="http://osxfuse.github.io/">OSXFUSE</a>. Then
the <a target=_blank href="http://brew.sh">package manager "Homebrew"</a>.
</p>
<p>Follow the procedure from the wiki, I issue the command
<pre>
brew install homebrew/fuse/ntfs-3g
</pre>
Then it starts to download and compiling ... After a few minutes, I got ntfs-3g install.</p>
<p>
Then I try the commands from a command shell.
<pre>
mkdir /Volumes/ntfs
ntfs-3g /dev/disk1s1 /Volumes/ntfs
</pre>
Hooray, I got a writable NTFS disk mounted! I did not try to replace the system's mount_ntfs for
automount NTFS to read/write. The current form works for me.
</p>
<p>
PS. Of course, in order to compile all related programs, you need to have Xcode installed.Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-38011388133867823272016-03-24T17:29:00.000-07:002017-02-08T17:43:53.925-08:00Google's hterm: HTML5 terminal emulator<p>Google's <a href="https://github.com/chromium/hterm" target="_blank">hterm</a> is a nice terminal
emulator. I would like to use the hterm part only and do some remote telnet session test
(I used <a href="https://github.com/seanmiddleditch/libtelnet" target=_blank>libtelnet</a> for the back-end server). But I encountered some usage problems.</p>
<p>
First, you could not build a functional hterm script with the github repository, you will need
to checkout the full repository from <a href="https://chromium.googlesource.com/apps/libapps/" target="_blank">https://chromium.googlesource.com/apps/libapps/</a> and build from there.
</p>
<p>
Second, <a href="https://chromium.googlesource.com/apps/libapps/+/HEAD/hterm/doc/embed.md">the embedded document</a> is lagging. After following the description in the document, the terminal
could be displayed without problem, but there is no input at all. The call back function register to the <em>io.onVTKeystroke()</em> never get called. After digging through other part of the libapps repository
for hterm's usage, I found <em>term.installKeyboard()</em> function of the hterm terminal instance need
to be called after the <em>term.decorate()</em> call. After that input event could be received.
</p>
<p>
Third, I haven't found a way to make it acknowledge IME input. Cut and paste utf8 encoded
characters causing it to output escaped utf8 stream (utf8 encoded of an utf8 stream).
</p>
Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-70330873951976870432015-11-13T16:03:00.001-08:002016-09-14T12:43:04.386-07:00Running i3 under HiDPI displayI recently got a MacbookPro (early 2015) with retina display for work.
I installed a fresh Slackware64-current on to it with
<a href="http://www.rodsbooks.com/refind/">rEFInd</a> as the boot loader.
The process was quite smooth,
I used a USB boot image then network install (with a thunderbolt gigabyte adapter).
Some devices/functions are not fully functional but usable for me. Console font is
using the kernel built in SUN12x22 font with kernel option "fbcon:font=SUN12x22". <br />
<br />
Since this laptop has a 2560x1600 on a 13" display, roughly 227DI, my old setting for
i3 did not work well, although I already using xft font for status bar display.
After a few search, I found out xorg server always set DPI 96, that is a bad move in my opinion,
as it makes previous valid DPI calculation wrong and still wrong for those cases
that the calculation do not fit. And I have to add a line
<pre>xrandr --fbmm 286x179
</pre>
in <em>.xinitrc</em> file in order to let i3 pick up the correct DPI setting. OK, now the
i3 status bar display fine. <strike>The default <em>dmenu</em> I initially installed does not
support xft font, so it looks really small. Luckily there is a
<em><a href="http://slackbuilds.org/repository/14.1/desktop/dmenu2/">dmenu2</a></em> which
merged the xft patched. Remove the old dmenu package and install the dmenu2 package,
then add the font parameter to the dmenu_run command in i3's config</strike> Latest <em>dmenu</em>
works with xft font now. Everything works fine.<br />
<br />
I have the following settings in my <em>.Xresources</em> file.
<pre>Xft.dpi : 227
Xft.antialias: false
Xft.rgba: rgb
URxvt.scrollstyle: xterm
URxvt.background: black
URxvt.foreground: gray
URxvt.preeditType: Root
URxvt.scrollBar_right: true
URxvt.jumpScroll: true
URxvt.perl-ext-common: tabbed
URxvt.tabbed.tabbar-fg: 2
URxvt.tabbed.tabbar-bg: 0
URxvt.tabbed.tab-fg: 3
URxvt.tabbed.tab-bg: 0
URxvt.termName: rxvt
URxvt.geometry: 83x27
urxvt.font: xft:DejaVuSansMono:size=8
Xpdf*fontList: -adobe-helvetica-bold-r-normal--0-0-0-0-p-0-iso8859-1
Xpdf.initialZoom: 200
Xcursor.size: 64
With the following, the width should be $((11*COLUMNS+13)) pixels;
! in contrast, the fixed = 6x13 bitmap font is typically used on a
! low-definition screen, giving a width of $((6*COLUMNS+13)) pixels.
XTerm*faceName: Monospace
XTerm*faceSize: 10
! For xterm menus. This font is large enough, but a bit ugly.
XTerm*font: -adobe-helvetica-bold-r-normal--0-0-0-0-p-0-iso8859-1
</pre>
My default terminal is <em>rxvt-unicode</em>, so it works fine. You may notice I have turn antialias off, the font looks sharp, you may see zigzag when looking really close, but for 227DPI, it's very clear without it already. Most of the document on line regarding GTK+3's HiDPI support is by setting<div><div><pre>export GDK_SCALE=2
export GDK_DPI_SCALE=05
</pre>
I found the program behave a little strange when this kind of scaling in effect.
Font is a little blur than none scale one. For the Gnat Programing Studio (GPS),
with the scaling effect, the menu display strangely:
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-kBwZHVWoxN50rQ2A9mOGOoWJRo1kn8W4fAnkLZ4JHUnwQNVDhOH4sPKv5XiaJQPz_0JGPEf0_Zik07atQRHmvUlhiUV6Sv5erfEMIsj994sL_Q6PvWQLw7y-9hGHpCErKiqT8U62cOg/s1600/gps-screen.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-kBwZHVWoxN50rQ2A9mOGOoWJRo1kn8W4fAnkLZ4JHUnwQNVDhOH4sPKv5XiaJQPz_0JGPEf0_Zik07atQRHmvUlhiUV6Sv5erfEMIsj994sL_Q6PvWQLw7y-9hGHpCErKiqT8U62cOg/s320/gps-screen.png"></a></div>
compare with the one without scaling:
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk6Dtgm-8M79YxB06IjJ5U21px-zAeKm6ZoguY28zD3FqxdZTC_qxC1fZ47RVYC0_26sATG5rYgRmUafTF-WtWohzSBiPFU6F0Qqql1yhx17ah-qC4f-1VMj_8poOSOtUeautn8PNAn2E/s1600/gps-screen-ok.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk6Dtgm-8M79YxB06IjJ5U21px-zAeKm6ZoguY28zD3FqxdZTC_qxC1fZ47RVYC0_26sATG5rYgRmUafTF-WtWohzSBiPFU6F0Qqql1yhx17ah-qC4f-1VMj_8poOSOtUeautn8PNAn2E/s320/gps-screen-ok.png"></a></div>
I am not sure whether its GTK3' fault or GPS's fault. I would hope for a GDK_IMAGE_SCALE and only scale image, maybe that will work better.
</div></div>
<br />
<br />
P.S. After upgrade to kernel 4.4, all the special keys (fn+Fx) works as expected (with <a href="https://github.com/bytbox/pommed-light">pommed-light</a>)Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-14344644574919806172015-10-01T11:05:00.000-07:002016-04-28T13:21:50.017-07:00Using mutool to repair a PDF file that has corrupted xref tableSomeone send me a PDF and I could not opened it on my Nexus 5 with Adobe's PDF reader
(It suits me the best for a PDF viewer in the android phone).
But both <a href="http://www.foolabs.com/xpdf/" target=blank><em>XPDF</em></a> and
<a href="http://www.mupdf.com/" target=blank><em>muPDF</em></a> under
Linux could opened it with some error message saying
the xref table is corrupted and try to rebuild it. <br />
<br />
How could I repair the pdf file? The first tool comes in my mind is <em>pdftk</em>,
it failed to read the corrupted file and give exception. Then I try <em>pdf2ps</em>, it failed either. <br />
<br />
Google shows me some one saying <em>mutool</em> from <em>muPDF</em> could repair it. I have
using <em>muPDF</em> for some time, it is the default PDF viewer in my Slackware desktop.
But I never take attention to the little tools come along with it,
after <em>man mutool</em>, the following command save me:
<pre>
mutool clean corrupted.pdf clean.pdf
</pre>
The repaired PDF file is in clean.pdf.<br />
<br />
P.S. muPDF does not come with Slackware, but it has a <a href="http://slackbuilds.org/repository/14.1/office/mupdf/">SlackBuild script</a>. For Windows user, muPDF provide <a href="http://www.mupdf.com/downloads/">windows version too</a>.Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-60428703633294602742015-09-24T17:03:00.000-07:002016-05-20T09:51:49.096-07:00gnatpp could not align exception declaration properlyI normally use the <a href="http://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn/gnat_utility_programs.html#the-gnat-pretty-printer-gnatpp">GNAT Pretty-Printer <em>gnatpp</em></a>
to format my Ada code.
The output of it is not perfect but acceptable and make my code look consistent.<br />
<br />
It has a small alignment bug, for exception declaration, it could not handle it
properly. For this specification <em>align_test.ads</em>:
<pre>
package Align_Test is
Index: Integer;
Number_Test : Integer;
Bad_File : exception;
Bad_Argument : exception;
end Align_Test;
</pre>
<em>gnatpp -r align_test.ads</em> will produce:
<pre>
package Align_Test is
Index : Integer;
Number_Test : Integer;
Bad_File : exception;
Bad_Argument : exception;
end Align_Test;
</pre>
I have to manually align the declaration and add specific comments to fence it
from <em>gnatpp</em> to change my alignment in future.
<pre>
package Align_Test is
Index : Integer;
Number_Test : Integer;
--!pp off
Bad_File : exception;
Bad_Argument : exception;
--!pp on
end Align_Test;
</pre>
It does not look good, but acceptable. Wish next version of <em>gnatpp</em>
could solve this problem.
<p>
P.S. Hooray, today (May. 19, 2016) AdaCore <a href="http://www.adacore.com/developers/development-log/NF-17-P519-029-gnat#When:00:00:00Z">fixed the alignment problem</a>. It will properly show up in GNAT GPL 2016.
</p>Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-16524116358728893582015-09-16T16:58:00.000-07:002015-09-16T16:59:43.865-07:00Where/when is my next laptop purchaseMy fastest computer in my home right now is a MacBook from 2009. It's hard disk
has been replaced by a SSD and runs smoothly with the latest OS X and Slackware
with some minor glitches (web-camera not working, occasionally system have USB bus error,
result in non usable system without keyboard, have to reboot back to OS X to fix it).
I have been searching for my next laptop for some time, but still don't find
a perfect one that suites my particular requirements:
<ul>
<li>With 13"/14" screen resolution must be high DPI, the higher the better,
minimum 3200x1800.</li>
<li>Must have optical digital sound output, be it dedicated TOSLINK connector
or combo with head phone jack (this has been standard for MacBook for years).</li>
<li>Be lightweight and have longer battery life (>= 8 hours)</li>
<li>Must be Linux friendly.</li>
</ul>
Actually, Dell's XPS 13 almost meets the requirement, except for the
optical digital sound output. Apple's MacBook Pro comes close but
it is not Linux friendly, and screen resolution is lower than Dell's.
All of Lenovo's offers lack optical digital sound output, X1 carbon does not
have high resolution screen, Yoga Pro does not have enough CPU power.<br />
<br />
Maybe I should wait one or two more years, then Intel's new 3D XPoint maybe used for
storage, oh my, maybe I will never buy a new one ... ...Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-24805730179920073912015-09-15T16:25:00.000-07:002015-09-15T16:25:10.372-07:00Microsoft is downloading Windows 10 to your machine 'just in case'Oh, Microsoft is doing his "smart" again. Now it will silently download Windows
10 image to your machine regardless you want it or not.<br />
<br />
<a href="http://www.theinquirer.net/inquirer/news/2425381/microsoft-is-downloading-windows-10-to-your-machine-just-in-case">News from Inquirer confirmed it with Microsoft</a>.<br />
<br />
It is time to turn off automatically update if you still want to keep running
it, or better wipe it out with a Linux distribution
(<a href="http://www.slackware.com">Slackware</a>, should you ask for recommendation). ^_^
Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0tag:blogger.com,1999:blog-232137978740955881.post-76090303453234838682015-09-10T11:18:00.001-07:002015-09-23T11:39:42.140-07:00Getting Started with GtkAda - ContentThis is the content for my previous Getting Started with GtkAda blogs.
<ul>
<li><a href="/2014/03/getting-started-with-gtkada.html">Basic</a></li>
<li><a href="/2014/03/getting-started-with-gtkada-packing.html">Packing</a></li>
<li><a href="/2014/03/getting-started-with-gtkada-building.html">Building user interfaces</a></li>
<li><a href="/2014/03/getting-started-with-gtkada-drawing.html">Drawing</a></li>
<li><a href="/2014/04/internationalized-application-with.html">Internationalized application with Gtkada.Intl</a></li>
</ul>Qunyinghttp://www.blogger.com/profile/13348553855322529578noreply@blogger.com0