- To exit the environment(or console dialog), the followings will work, according to this
You can use Environment.Exit(0); and Application.Exit.
Saturday, August 1, 2020
C#
Saturday, May 16, 2020
Regular Expression
- To search for unicode character sets used in certain languages, one can use \p properties, i.e. perluniprops. Such as the following to search for a part of strings composed Arabic letters and/or spaces.
grep '[\s\p{Arabic}]*'
https://perldoc.perl.org/perluniprops.html#Properties-accessible-through-%5cp%7b%7d-and-%5cP%7b%7d
Friday, May 8, 2020
linux commands
- To find which partition is mounted where, use findmnt:
findmnt /dev/sda1 - To mount, use mount, to unmount use umount.
- To list all mount disk, "mount -l".
- To check file systems
https://www.tecmint.com/find-linux-filesystem-type/ - To make partitions and format and mount, see
http://www.nemotos.net/?p=3132
Monday, May 4, 2020
Wiktionary
- Parsing raw compressed dump file. Example to extract the title of all pages().
bzcat pages-articles.xml.bz2 | grep '<title>[^[:space:][:punct:]]*</title>' | sed 's:.*<title>\(.*\)</title>.*:\1:'
https://stackoverflow.com/questions/3364279/has-anyone-parsed-wiktionary/9735019 - Regular expression which include unicode characters. For instance if Arabic,
^[\p{Arabic}\s\p{N}]+$
https://stackoverflow.com/questions/29729391/regular-expression-arabic-characters-and-numbers-only
Saturday, May 2, 2020
BeautifulSoup
- To check if an object is of NavigableString instance, one can use
isinstance(your_obj, bs4.element.NavigableString) - file method executed as a member function of a tag object fails. https://en.wikipedia.org/wiki/Duck_typing
- To download image from its url:
import shutil; import requests
url = 'http://example.com/img.png'
response = requests.get(url, stream=True)
with open('img.png', 'wb') as out_file:
shutil.copyfileobj(response.raw, out_file)
del response
https://stackoverflow.com/questions/13137817/how-to-download-image-using-requests
Subscribe to:
Posts (Atom)
Writing a post in Markdown in Blogger
Following articles are helpful. * [【令和最新版】Blogger で Markdown を用いて記事を書く方法](https://qiita.com/hoge_fu-ga/items/267ea5ad4f8c120eaeb8) * [Bl...
-
Build in Release Go to "Product" menu, "Scheme" and "Edit Scheme". Select "Run" from the list...
-
OpenCV implements various key point detectors and descriptors as subclasses of features2d class. But it is not clear at once whether such...
-
I installed pyenv and a version of python on it, but executing "brew info opencv" keeps telling me that I don't satisfy depe...