2021年1月31日日曜日

Q# without VS code

 Not sure the reason, but I cannot install Q# template with newly install Ubuntu 20.04 and VS code.
I have just learned that CLI also works.

% dotnet new console -lang Q# -o [ProjectName] % cd [ProjectName]
% dotnet build % dotnet run

I needed to install .NET-SDK 3.1, instead of 5.0.

2021年1月30日土曜日

福島の事故がもたらしたもの

福島の事故を軽く見せたい人が一定数おりますが、住めない土地を作ったことについてはどう考えるのか聞きたいものです。


 【福島から伝えたい】”ハゲと白髪”集う「じじい部隊」に問う「原発があって幸せだった?」記者が見た10年

http://web.archive.org/web/20210130064836/https://news.yahoo.co.jp/articles/e05797830e256aece6056c6a4cd8b343d29037a8

2021年1月22日金曜日

Give select grants on all tables in my schema

 The following code gives the select grant on all the tables in your schema to "test2" user.

BEGIN
FOR t IN (SELECT * FROM user_tables)
LOOP
EXECUTE IMMEDIATE 'GRANT SELECT ON ' || t.table_name || ' TO test2';
END LOOP;
END;

/

(last slash "/" is important)

Just a copy from;
https://sites.google.com/site/nazmulhudadba/grant-select-on-all-tables-in-a-specific-schema-to-a-user

2021年1月21日木曜日

Pandas on Python 2.6

We are still using Python2.6 on RH6, and packages are getting out-dated.

Pandas is one of those, and need the following command to be installed.

% easy_install 'pandas==0.17.1'

This seems the latest version for Python 2.6

And also numexpr is necessary for the "query" but the latest version numexpr cannot be installed.

% easy_install 'pandas==2.4'

at least works.

2021年1月20日水曜日

Convert datetime to epoch in a old Python (2.6)

 Since I always forget how to convert datetime to epoch, I just want to write a memo.

In Python
>>> import datetime
>>> d = datetime.datetime(2019,1,1,0,0,0)
>>> print(d)

2019-01-01 00:00:00

>>> epoch = d.strftime("%s")
>>> print(epoch)

1546300800

On Bash
% date -d @1546300800
Tue Jan  1 00:00:00 GMT 2019

2021年1月11日月曜日

OpenMP Offloading on Intel Core i7

 I am thinking if OpenMP Offloading works with XcalableMP, and desire to play around it.

Luckily, my laptop has Core i7-8665U, and Intel's OneAPI compiler provides us with openmp-offloading.


Software installation is quite straightforward;
https://software.intel.com/content/www/us/en/develop/articles/installing-intel-oneapi-toolkits-via-apt.html#aptpkg

And the first step guide is;
https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-cpp-fortran-compiler-openmp/top.html

Surely working!