星期四, 8月 24, 2017

Perl — Calculate timing difference in microseconds

Time::Piece has been in core since 5.10.


use Time::Piece;

sub str2time {
    my ($str) = @_;
    $str =~ s/(\.[0-9]+)?\z//;
    my $fraction = $1 || 0;
    return Time::Piece->strptime($str, '%Y-%m-%d %H:%M:%S')->epoch + $fraction;
}

my $t1 = str2time('2013-12-27 13:28:14.975952');
my $t2 = str2time('2013-12-27 13:28:16.345667');

printf "difference: %f\n", $t2 - $t1;


This can be used to analyze the trace for performance issue.

Note:

||                              if the left operand is true, the right operand is not even evaluated.
\z                             Match only at end of string
 ?                             Match 1 or 0 times
$var =~ s/A/B/       
把變數 $var 內的第一個A子字串整個代換成B子字串。特別注意第一部份(A)為RE, 但第二部分(B)僅為字串

http://irw.ncut.edu.tw/peterju/perl.html

$str =~ s/(\.[0-9]+)?\z//   => 表示將小數點後(含小數點)的部分用空字串取代, 也就是移除
$fraction = $1 || 0            => 表示若有找到小數點後的部分, 即把其值copy 給fraction, 不然就設為0




星期二, 8月 15, 2017

星期四, 8月 03, 2017

How to specify the path of the JVM core dump file

https://jazz.net/forum/questions/147686/is-it-possible-to-customize-the-java-core-and-heap-dump-paths-for-tomcat

http://www-01.ibm.com/support/docview.wss?uid=swg21255223

http://www-01.ibm.com/support/docview.wss?uid=swg21242497

Using dump agent to specify the path of the core file

example:

-Xdump:system:file="/path/core.%Y%m%d.%H%M%S.%pid.%seq.dmp"



How to install ComputerCraft mod for Minecraft

https://www.youtube.com/watch?v=pMrxzffJVs8


1. launch the Minecraft with the correct version
2. download and install corresponding forge version mod
3. download the corresponding ComputerCraft mod and put it into the mod subfolder

*** 不同版本的mod 可能無法被不同版本的Minecraft forge載入, 要搭配正確版本
例如: 1.7.10 的Minecraft 就要搭配同樣是1.7.10 的forge 和 ComputerCraft

若要切換不同版本, 也要記得移除mod目錄下的檔案, 換成正確版本的mod 檔案



星期四, 7月 27, 2017

Recording a response file with Installation Manager

https://www.ibm.com/support/knowledgecenter/en/SSDV2W_1.8.4/com.ibm.silentinstall12.doc/topics/t_silent_create_response_files_IM.html

https://www.youtube.com/watch?v=G7G_uMA17J8



  • Windows: IBMIM.exe -record responseFile -skipInstall agentDataLocation
  • Linux, UNIX, and the OS X operating system: ./IBMIM -record responseFile -skipInstall agentDataLocation

Example:

Examples:
Table 1. -record commands by operating system
Operating SystemCommand
WindowsIBMIM.exe -record c:\response_files\install_product.xml -skipInstall c:\skipInstall\IBM_product
Linux, UNIX, and the OS X operating system./IBMIM -record /response_files/install_product.xml -skipInstall skipInstall/IBM_product

MQ QMGR on Windows does not start after system reboot even if it is configured to automatically start in the MQ explorer?

https://developer.ibm.com/answers/questions/216225/mq-qmgr-on-windows-does-not-start-after-system-reb.html

Q:
A WebSphere MQ queue manager on Windows is configured to automatically start in the MQ explorer, however, after system reboot, the queue manager does not start. No errors can be found in the Windows event log or MQ error log. The queue manager can be manually started successfully using command line or MQ explorer (V7.1 or later version).

Ans:
One possible scenario could be that the Startup value in the qm.ini file has been set to "2". If the Startup value is 2, the MQ queue manager will not start automatically. If this is the case, please follow these steps to solve the problem.
1) Change "Startup" value to "1" in /qmgrs//qm.ini For example, InstanceData:    InstanceID=1381394841    Startup=1 .
2) Stop IBM MQ Service ( endmqsvc)
3) Start IBM MQServices ( strmqsvc)



https://developer.ibm.com/answers/questions/216225/mq-qmgr-on-windows-does-not-start-after-system-reb.html

星期五, 5月 26, 2017

PM85864: SYMBOLIC LINK UNDER INSTALLEDAPPS DIRECTORY DOES NOT GET RETAINED AFTER APPLICATION UNINSTALL AND RE-INSTALL

PM85864: SYMBOLIC LINK UNDER INSTALLEDAPPS DIRECTORY DOES NOT GET RETAINED AFTER APPLICATION UNINSTALL AND RE-INSTALL
http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg1PM85864

Any symbolic links that exist in the application installation directory will be deleted when the application is uninstalled or updated.

Problem conclusion
The code has been modified to allow you to set the custom property

com.ibm.websphere.management.application.sync.deleteSymbolicLinks 
on the JVM to false to override the default setting of true.

1) To enable the System Property in the administrative
console: a) In a Network Deployment edition, the system
property needs to be set on the nodeagent. System
administration --> Node agents --> nodeagent --> Java and
Process Management --> Process definition --> Java Virtual
Machine --> Custom properties Name:
com.ibm.websphere.management.application.sync.deleteSymbolicLinks 
Value: true/false

*** both node agent and application server must restart to take effect 

b) In a Base edition, the system property is set on the
server. Servers --> Application Servers --> server1 --> Java
and Process Management --> Process Definition --> Java Virtual
Machine --> Custom Properties Name:
com.ibm.websphere.management.application.sync.deleteSymbolicLinks 
Value: true/false

*** Restrictions: ***
Do not use symbolic links on Microsoft Windows operating systems as they are not supported.


The fix for this APAR is currently targeted for inclusion in
fix pack 8.0.0.7 and fix pack 8.5.5.1.