View on GitHub

Quorten Blog 1

First blog for all Quorten's blog-like writings

Setup Vim indent without tabs

2016-08-26

Categories: misc   important  
Tags: misc   important  

Important! Vim indent without tabs. Example to indent 4 spaces.

:set shiftwidth=4
:set expandtab
5>>

And to show existing tabs as 4 spaces wide:

:set tabstop=4

And to change cursor behavior on backspace when expanding tabs:

:set softtabstop=4

But you probably don’t want to do this, in order to make existing tabs stick out as incorrect.

To stay simple, you want to do this:

:set tabstop=4
:set expandtab

There’s also autoindent and smartindent.

Wireless mice

2016-08-22

Categories: misc  
Tags: misc  

Wireless mice? What does Wikipedia have to say about these?

20160821/https://en.wikipedia.org/wiki/Computer_mouse

Oh, interesting. The beginning of Microsoft hardware, the Microsoft mouse came before the Macintosh?

20160821/https://en.wikipedia.org/wiki/Microsoft_hardware

Awww, only but a stub of a Wikipedia article.

Okay, so more important software notes on web development. Gunicorn, CherryPy, django, Ruby on Rails, RAML, Haml. OpenShift, Docker, Jenkins, Vagrant, Chef, Puppet, Ansible, AWS, MongoDB, OAuth.

But do you know what’s most interesting about Haml? It starts by mounting some criticisms against HTML, whereas in fact these are criticisms against XML, and XML was created in response to criticisms against SGML, namely, the complexity of the grammar and parsing algorithms. And here we go again, right back in the same direction where we came from.

20160822/http://haml.info
20160822/http://haml.info/about.html

Film camera (i.e. retro camera) notes.

Aww, got the film wound up all the way inside the canister? No worries, here’s how to pull it out, without a film puller. Er, well, maybe there are worries here. You really do need to have film to stick into the canister, as that will be the only thing that gives you the necessary curl and strength to complete the pulling.

20160820/DuckDuckGo how to remove film from canister

20160820/https://www.lomography.com/magazine/75374-get-the-film-out-the-canister-without-a-film-puller


Disposable camera? What does Wikipedia have to say about this?

20160821/https://en.wikipedia.org/wiki/Disposable_camera
20160821/https://en.wikipedia.org/wiki/Lomography
20160821/https://en.wikipedia.org/wiki/Coil_gun
20160821/http://www.koreatimes.co.kr/www/news/art/2009/09/148_43411.html

So, I’m wondering. What kind of lighting instrumentation is used inside of a camera flash?

20160821/https://en.wikipedia.org/wiki/Flash_%28photography%29

Wow, I certainly didn’t know that the camera flash had a much longer history and many more intermediary technologies than I originally thought.

So it is like you thought. The flash bulbs that you were looking at in your current cameras are in fact a kind of fluorescent light. Gas-filled tube that electricity is sent through.

20160821/https://en.wikipedia.org/wiki/Flash_tube

Oh, but one important thing that I did learn about from reading the flash article is that often times, bounce flash is very important for taking good-looking photographs. Especially with humans, the human retina reflects red light directly back in the direction of incidence, which is why there is the red-eye effect unless sophisticated umbrella bounce flash is used.

Oh yeah, and bounce flash often times results in better photographs of still objects because the ambient light gives better shadow tones and distributions, or so I am told. So, for still 2D photographs, definitely yes, but what about for 3D scans? Don’t you want straight-on flash? Well, maybe not. Maybe you want consistent flash angle, and just rotate the camera independently of the flash.

Wow, and about flash safety. 80 uF capacitor? Really dangerous, and it too can get the problem of dielectric absorption that makes CRTs perpetually dangerous without proper grounding. And the exploding flash tube problem? Without a flash cavity and shielding behind glass, use of the device requires eye and ear protection. So should I be weary of long-term use of the flash in a disposable camera? Well, I guess that is an unanswered question. Oh, and some cameras charge the flash just by being powered on or by inserting batteries? Good thing my vintage cameras are not among those types.

Convert WebEx recordings? Here’s how.

20160819/http://www.linuxquestions.org/questions/linux-software-2/convering-webex-arf-to-mp4-4175512862/
20160819/http://blog.ricardoamaro.com/content/how-watch-arf-webex-files-your-linux-desktop

Oh, important. Chat notes.

[P1] wrote:

@[P2] - We had attempted converting *.arf to *.mp4 few days back for the CuttingEdge event. We used the WebEx Network Recording Player to convert *.arf to *.mp4 (https://www.webex.com/play-webex-recording.html). Thereafter we used VLC Player to convert *.wmv to *.mp4. Although the *.mp4 played fine using VLC (and other desktop players), it failed to play in the Silverlight plugin which was embedded in the SharePoint website (the CuttingEdge portal). Also, please note that the WebEx Network Recording Player seems to be available only for Windows. Hope this helps!

Working around a buggy X11 Emacs problem

2016-08-17

Categories: misc  
Tags: misc  

Oh my gosh. Now I have this particular problem with Emacs that when I use it in daemon mode, sometimes my X11 connection to Emacs is buggy, and in particular, sometimes when I control-click for a popup menu, somehow I loose focus to the X window and cannot get it back, Emacs is frozen and locked up in a loop that it thinks it can get out of but will never get out, so what can I do? Okay, here’s my experience. You have to open up GDB and manually jump out of the problematic code. This will cause a segmentation violation in the offending thread. At this point, you probably want to restart your Emacs server, but before you do, you can safely re-attach with emacsclient -t and do whatever you want to do to wrap up and close down for a restart. But don’t use emacsclient -c, because that is highly risky and may cause the server to crash.

So what do you do in GDB? This is what I did:

(gdb) jump XSync

Important note. How do you close a file descriptor on a process? You attach to it in gdb, and run the following command:

call close(filedes)

where filedes is the descriptor number.

20160813/http://stackoverflow.com/questions/5987820/how-to-close-file-descriptor-via-linux-shell-command

Now, this is an interesting link. It clearly demonstrates (at the time of visit) the imperfection of the StackOverflow website. And, it shows how sometimes, you must actually read further in order to get the correct information.

20160813/http://stackoverflow.com/questions/323146/how-to-close-a-file-descriptor-from-another-process-in-unix-systems

VERY IMPORTANT Python notes. How do you catch an exception, then re-raise it as a new exception class, but still carrying the data of the original exception? What you need is exception chaining, a feature that is only available in Python 3. For Python 2, there are a long list of caveats that achieve only in part what can be done in Python 3, and they cannot be all combined together to get the same effect.

Oh, and by the way, this was a long and hard search for me to summon all of the available information. The first Google results were clearly inadequate, and I had to try multiple different search strings.

20160812/http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html
20160812/http://www.ianbicking.org/blog/2007/09/re-raising-exceptions.html
20160812/https://doughellmann.com/blog/2009/06/19/python-exception-handling-techniques/
20160812/Google python initialize a new exception object from an existing exception
20160812/http://stackoverflow.com/questions/696047/re-raise-exception-with-a-different-type-and-message-preserving-existing-inform
20160812/https://www.python.org/dev/peps/pep-3134/

OH, and this was an interesting article linked from the Python website. Interesting because it crosses over from the same author of one of the previous very-valuable articles I’ve linked.

20160812/http://pyfound.blogspot.com/2016/08/avoiding-curse-of-knowledge-ned-batchelder.html?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed%3A+PythonSoftwareFoundationNews+%28Python+Software+Foundation+News%29

Now, these are some interesting notes on Flask. Why does Flask have the weird license? It doesn’t quite seem to be exactly a BSD license. Here is the explanation.

20160810/http://flask.pocoo.org/docs/0.11/
20160810/http://flask.pocoo.org/docs/0.11/license/#flask-artwork-license
20160810/http://lucumr.pocoo.org/2010/6/19/licenses-dammed-licenses/