Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

Entries from 2017-10-01 to 1 month

XmlNode.SelectNodes() always returns List in PowerShell 2.0

Problem: In PowerShell, by using XML DOM API in .NET, you can access to a child element in XML as a ordinary property. PS > $xml = New-Object System.Xml.XmlDocument PS > $xml.LoadXml('<a><b id="1">foo</b></a>') PS > $xml.SelectNodes('//a').b id #text -- ----- …

How to get a #text in XML even if the tag doesn't have attributes

Background: In PowerShell (even in C# or VB.NET?), you can get a body of the tag (text content) with '#text#' property. > $xml = New-Object System.Xml.XmlDocument > $xml.LoadXml('<a><b id="1">foo</b></a>') > $xml.SelectNodes('//a').b.'#text' foo Problem: If a …

Who does recommend to encrypt the attachments in email

In Japan, so many companies have their own security policy like "When you send email with attachments, you must zip all the attachments with password, and send the password in another email". Some say this policy is pointless, but on the o…

What can you do with account lockout and its unlock

Purpose of account lockout These are some purpose for account lockout, such as: Detect login attempts 1 Example: Logging 2 Slow down login attempts Example: Duration-based lockout, scrypt, Argon2 Interrupt login attempts Example: Requires …

日本における貧困率(相対的貧困)と世界貧困線(絶対的貧困)

日本における貧困率のカウントには、相対的貧困が用いられる。日本における貧困率にカウントされるのは、2017年の国民生活基礎調査の場合、年間の等価処分所得が122万円未満の世帯。 世界における貧困率のカウントには、絶対的貧困が用いられる。世界単位で…

iOS 11ではリマインダーに保存したツイートのURLからTwitterのアプリを開けない

iOS 10.3では、リマインダーに保存したツイートのURLはTwitterのアイコンで表示される。また、TwitterのアイコンをタップするとTwitterのアプリが起動し、対応するツイートが表示される。 iOS 11.0では、リマインダーに保存したツイートのURLはアイコンなし…

A List of What Cannot JCache do

JCache cannot save the order of insertion. You should use LinkedHashMap for that purposes. JCache cannot update whole entries in a cache atomically. You should use AtomicReference or some locking mechanisms for that purpose. (Ofcourse you …

The meanings of word "cache" in software engineering

I think the word "cache" has so many different meanings in different contexts like below. Note: In this list, the word "invalidated" means the source of cached value might be changed. Something like the cache in web browsers. The cache sto…