Lazy Diary @ Hatena Blog

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

Entries from 2022-03-01 to 1 month

Determine whether you are behind a proxy or not with .NET

You can get the default proxy setting for a specific url with System.Net.WebRequest.GetSystemWebProxy().GetProxy(). The result is System.Uri object, and its OriginalString property will be the same the parameter if you are not behind a pro…

JDBCドライバがサーバとの1回の通信で取得する行数のデフォルト値

Oracle 11.2は10行。*1 By default, when Oracle JDBC runs a query, it retrieves a result set of 10 rows at a time from the database cursor. This is the default Oracle row fetch size value. Oracle 21は10行。*2 By default, when Oracle JDBC run…

Test-NetConnectionの不思議な挙動

最近はICMP Echoに応答しないサイトも多い(たとえばlogin.live.com)。そんなときは、TCPでポートを指定して接続確認が行えるTest-NetConnectionコマンドレットが便利に使える。 ただこのTest-NetConnectionコマンドレット、ネットワーク接続が確立していな…

You cannot identify platforms of an application that is about to authenticate

Background You are trying to write an authentication logic for an application that calls a Microsoft Graph API. When you retrieve an authentication token, you have to pass client secret if the application is registerd with "Web" platform c…

OneDriveにMicrosoft Graph APIでアクセスする

OAuth2のトークンを取得する際にtenantを指定する*1のだが、これはOneDriveのURLのhttps://XXXXX-my.sharepoint.com/のところに入るテナント名とは別で、commonかorganizationsかconsumersを指定するとある。commonを指定しているドキュメント*2を参考にして…

GitLabの在宅勤務のルール

常時ビデオONで会議を行っている*1と「ネットワーク帯域が……」となることもあるだろうに、GitLabはどうしてるだろう?と思って調べてみたら、インターネット接続の月額費用を経費精算可能にしてた*2。 在宅勤務で必要な机・椅子・モニタなども経費精算可能な…

Windowsをシャットダウンする方法いろいろ

Windowsをシャットダウンする方法には スタートメニューから「シャットダウン」を選択(内部的にはC:\Windows\System32\RuntimeBroker.exeが呼ばれているみたい) デスクトップでAlt+F4を押して「シャットダウン」を選択 ロック画面から「シャットダウン」を…