並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 33 件 / 33件

新着順 人気順

java try catch throws exceptionの検索結果1 - 33 件 / 33件

  • 【2020年】CTF Web問題の攻撃手法まとめ - こんとろーるしーこんとろーるぶい

    はじめに 対象イベント 読み方、使い方 Remote Code Execution(RCE) 親ディレクトリ指定によるopen_basedirのバイパス PHP-FPMのTCPソケット接続によるopen_basedirとdisable_functionsのバイパス JavaのRuntime.execでシェルを実行 Cross-Site Scripting(XSS) nginx環境でHTTPステータスコードが操作できる場合にCSPヘッダーを無効化 GoogleのClosureLibraryサニタイザーのXSS脆弱性 WebのProxy機能を介したService Workerの登録 括弧を使わないXSS /記号を使用せずに遷移先URLを指定 SOME(Same Origin Method Execution)を利用してdocument.writeを順次実行 SQL Injection MySQ

      【2020年】CTF Web問題の攻撃手法まとめ - こんとろーるしーこんとろーるぶい
    • (プログラマのための)いまさら聞けない標準規格の話 第2回 文字コード実践編 | オブジェクトの広場

      プログラマがシステム開発において共通で必要となる、技術と業務の狭間の共通知識を解説します。連載第2回は文字コードの実践編です。 0. 前回の復習と今回の概要 システム開発で必要となる標準規格の話、前回 は文字コードの概要について説明しました。ざっくりまとめるとこんな内容でした。 「符号化文字集合」で文字集合と符号位置を定義し、「符号化方式」でバイト表現に変換していること。 日本では、しばらく文字集合 JIS X 0208 を、ISO-2022-JP、EUC-JP、Shift_JIS の符号化方式で利用してきたこと。 近年は、世界中の文字が扱える Unicode が主流となっており、UTF-8、UTF-16 などの符号化方式があること。 常用漢字、人名用漢字に限っても、字体を正確に扱おうとすると、JIS X 0208 の範囲では不十分であり、JIS X 0213、Unicode、サロゲートペ

        (プログラマのための)いまさら聞けない標準規格の話 第2回 文字コード実践編 | オブジェクトの広場
      • BigQueryのアンチパターン認識ツールで独自のSQLリンターを開発しました - ZOZO TECH BLOG

        こんにちは、株式会社ZOZOで25卒の内定者アルバイトをしている村井です。この記事では業務で取り組んでいる、BigQueryで使うSQLのリンターの作成方法について紹介します。 目次 目次 課題と解決策 課題 解決策 BigQueryのアンチパターン認識ツール ミニマムな使い方 日本語がSQL内に含まれている際の問題 アンチパターンを定義する リンターとしてBigQueryのアンチパターン認識ツールを使用する際に生じる課題と解決策 構成 APIサーバ化 Chrome拡張 動作例 まとめ 課題と解決策 課題 社内では様々なチームがSQLを書いており、動作はするものの良くない書き方をしている場合があります。そういった構文を検知して、前もって修正する必要があります。 解決策 BigQueryのコンソールで入力されたSQLの不正構文を検知、修正案を提示できるようにしました。 BigQueryのアン

          BigQueryのアンチパターン認識ツールで独自のSQLリンターを開発しました - ZOZO TECH BLOG
        • Virtual Thread導入の背景 - Javaのマルチスレッドの歴史を振り返る

          このエントリーは Java Advent Calendar の9日目のエントリーです。 qiita.com Virtual ThraedはJava 19でPreview (JEP 425)、Java 20でSecond Preview (JEP 436)となり、うまくいけば次のLTSであるJava 21で導入予定です。 パフォーマンスを考える時に、一般的にはスループットと応答性の2つがあります。スループットは単位時間あたりにどのくらいリクエストをさばけるか、応答性は処理のリクエストから結果が帰るまでの時間です。Virtual Threadのこの2者のうち、スループットを向上させるために導入されます。 では、なぜ今になってVirtual Threadが導入されるのかということを、歴史を振り返りながら考えてみるのがこのエントリーです。 いにしえの時代 - Java 1.0からJ2SE 1.4

          • タイムゾーン呪いの書 (Java 編)

            「タイムゾーン呪いの書」は、もともと 2018年に Qiita に投稿した記事でしたが、大幅な改訂を 2021年におこない、同時にこちらの Zenn に引っ越してきました。この改訂で記事全体が長大になったので、「知識編」・「実装編」・「Java 編」と記事を分けることにしました。 この「Java 編」は、「知識編」と「実装編」に続く最終章です。本記事全体を通して、「知識編」「実装編」を読んでいることを前提にしているので、ご注意ください。 はじめに 「知識編」と「実装編」では、言語やソフトウェア特有の話にはあまり踏み込まずに、時刻とタイムゾーンについてなるべく一般論を書いてきました。そんな中でも Java の JSR 310: Date and Time API は何度も参照しています。 JSR 310 は時刻やタイムゾーンという概念をけっこう上手に一般化していて、一般論の検討にもいいモデル

              タイムゾーン呪いの書 (Java 編)
            • Java の CLI アプリケーション用フレームワーク picocli はミスタイプ時にサジェスチョンを出してくれる - Mitsuyuki.Shiiba

              長くなっちゃったから最初にまとめ まとめ picocli は便利。 デフォルトでサジェスチョンの機能がついている。なので、オプションやサブコマンドの定義だけしておけば、ミスタイプしたときにサジェスチョンを出してくれる。 オプションの場合は、先頭2文字が一致するオプション一覧 サブコマンドの場合は、先頭2文字じゃなくて、似たものを出してくれる こんなつぶやきを見かけて がくぞさんのこんなつぶやきを見かけて そういえばCLIのオプションパーザのライブラリは多種あるけど、定義されてないオプションが指定されたときにオプション名から類推して正しくはコレじゃない?ってサジェストしてくれるような機構まで盛り込んだライブラリってあるのかな?— がくぞ (@gakuzzzz) August 11, 2021 あぁ、たしかにそういうのフレームワークに含まれてたら便利だなー、picocli だったらありそうだけ

                Java の CLI アプリケーション用フレームワーク picocli はミスタイプ時にサジェスチョンを出してくれる - Mitsuyuki.Shiiba
              • プログラムの内容ではChatGPTのトークン数はどのようになるか? - Taste of Tech Topics

                枝差ししていたバジルが順調に成長して切り出し元の株と代替わりをしました、またバジル生活が始まりそうな菅野です。 皆さんはChatGPTのAPIを利用していますでしょうか? まだ利用していない、利用方法がわからないという方は以下の記事をご覧ください。 acro-engineer.hatenablog.com APIの仕組みの中でも直感的にわかりづらいトークン数について、今回はさらに深堀していこうと思います。 トークンとは、Chat Completions API等OpenAIが提供するAPIの処理単位です。 入力、出力共にByte Pair Encodingした結果を1トークンとして処理します。 英語の場合は通常1単語1トークン、日本語の場合は1文字でも複数トークン換算される場合がある模様です。 実際に利用する文章のトークン数が事前に知りたい場合は以下のページで確認することができます。 ht

                  プログラムの内容ではChatGPTのトークン数はどのようになるか? - Taste of Tech Topics
                • Announcing TypeScript 5.2 - TypeScript

                  Today we’re excited to announce the release of TypeScript 5.2! If you’re not familiar with TypeScript, it’s a language that builds on top of JavaScript by making it possible to declare and describe types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with null and undefined, and more. Types also power TypeScript’s edi

                    Announcing TypeScript 5.2 - TypeScript
                  • Announcing TypeScript 5.2 RC - TypeScript

                    Today we’re excited to announce our Release Candidate of TypeScript 5.2! Between now and the stable release of TypeScript 5.2, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or through npm with the following command: npm install -D typescript@rc Here’s a quick list of what’s new in TypeScript 5.2! using Declarations and Explic

                      Announcing TypeScript 5.2 RC - TypeScript
                    • Exploiting JNDI Injections in Java | Veracode

                      Introduction Java Naming and Directory Interface (JNDI) is a Java API that allows clients to discover and look up data and objects via a name. These objects can be stored in different naming or directory services, such as Remote Method Invocation (RMI), Common Object Request Broker Architecture (CORBA), Lightweight Directory Access Protocol (LDAP), or Domain Name Service (DNS). In other words, JND

                      • Python's "Type Hints" are a bit of a disappointment to me

                        blog - git - desktop - images - contact Python's "Type Hints" are a bit of a disappointment to me 2022-04-21 Preface You are reading version 2.0 of this blog post. I've incorporated some feedback I got into this revised version. Introduction Over the course of several Python 3.x versions, "type hints" were introduced. You can now annotate functions: def greeting(name: str) -> str: return 'Hello '

                        • A Walk with LuaJIT

                          The following is a chronicle of implementing a general purpose zero-instrumentation BPF based profiler for LuaJIT. Some assumptions are made about what this entails and it may be helpful to read some of our other work in this area. One major change from prior efforts is that instead of working with the original Parca unwinder we are now working with the OpenTelemetry eBPF profiler. If you missed t

                            A Walk with LuaJIT
                          • Wasm core dumps and debugging Rust in Cloudflare Workers

                            Wasm core dumps and debugging Rust in Cloudflare Workers2023-08-14 A clear sign of maturing for any new programming language or environment is how easy and efficient debugging them is. Programming, like any other complex task, involves various challenges and potential pitfalls. Logic errors, off-by-ones, null pointer dereferences, and memory leaks are some examples of things that can make software

                              Wasm core dumps and debugging Rust in Cloudflare Workers
                            • Java 24のVirtual Threadでsynchronizedの注意点はずっと昔と同じになっただけ - #chiroito ’s blog

                              Java 24で導入された、JEP 491: Synchronize Virtual Threads without Pinningはwithout Pinningです!ここが重要です。 3行で Java 24からでもVirtualThread上でsynchronizedを使ってもいいわけではなく、これまでどおりできるだけ使わない。 JEP 491はPlatform Threadがsynchronizedを含むVirtual Threadによって占有されることを防ぎ、ほかのVirtual Threadを処理できるようにする。 複数のVirtual Threadで同じオブジェクトをモニタ(≒ロック)しているsynchronized 処理はこれまで通りロックの取り合いで止まる。 背景 Java 24は、JEP 491: Synchronize Virtual Threads without P

                                Java 24のVirtual Threadでsynchronizedの注意点はずっと昔と同じになっただけ - #chiroito ’s blog
                              • スクラッチ開発で挑んだZOZOマッチのアプリ内課金同期 - ZOZO TECH BLOG

                                はじめに こんにちは、新規事業部バックエンドブロックの三浦です。2025年6月にリリースされたマッチングアプリ「ZOZOマッチ」のバックエンド開発を担当しています。 ZOZOマッチでは、App StoreやGoogle Playの決済システムを利用したアプリ内課金を提供しており、定期購読(サブスクリプション)することで一部機能の制限解除や機能拡張が可能になります。アプリ内課金の実装には、アプリからの購入処理と購読のキャンセル・返金・自動更新といったライフサイクルイベントの同期処理が必要です。ZOZOマッチではこれらの処理をスクラッチで開発しました。 本記事では、特に開発が難航した、ライフサイクルイベントによって変更される課金ステータスをバックエンドに同期する仕組みについて紹介します。AppleとGoogleそれぞれが提供する通知の仕組みの違いや、同期処理の実装における課題と工夫についても解

                                  スクラッチ開発で挑んだZOZOマッチのアプリ内課金同期 - ZOZO TECH BLOG
                                • The Koka programming language

                                  Statically typed programming languages can help catch mismatches between the kinds of values a program is intended to manipulate, and the values it actually manipulates. While there have been many bytes spent on discussions of whether this is worth the effort, some programming language designers believe that the type checking in current languages does not go far enough. Koka, an experimental funct

                                  • JEP 425: Virtual Threads (Preview)

                                    Summary Introduce virtual threads to the Java Platform. Virtual threads are lightweight threads that dramatically reduce the effort of writing, maintaining, and observing high-throughput concurrent applications. This is a preview API. Goals Enable server applications written in the simple thread-per-request style to scale with near-optimal hardware utilization. Enable existing code that uses the j

                                    • OpenJDK 8uでJDK Flight Recorderの入門 - 赤帽エンジニアブログ

                                      Red Hat で Solution Architect として OpenJDK を担当している伊藤ちひろ(@chiroito)です。 この記事は、Red Hat Developerのブログ記事、Get started with JDK Flight Recorder in OpenJDK 8u | Red Hat Developer の翻訳記事です。 OpenJDK 8u 262 releaseには、いくつかのセキュリティ関連のパッチと、新しい追加機能であるJDK Flight Recorder(JFR)が含まれています。この記事では、OpenJDKの開発者向けに、JDK Mission Controlや関連ユーティリティーを使ったJDK Flight Recorderの使い方を紹介します。また、コンテナJFRとして知られるProject Hamburgについても簡単に紹介します。 JD

                                        OpenJDK 8uでJDK Flight Recorderの入門 - 赤帽エンジニアブログ
                                      • その try-catch、意味がありますか?NestJSにおける例外処理の戦略 | TrustHub テックブログ

                                        弊社(トラストハブ)では、バックエンドのプログラミング言語として TypeScript、ウェブフレームワークとしてNestJSを採用しています。本記事では、NestJSの特長を生かした、実際に弊社で採用されている例外処理の戦略について述べます。 その try-catch、意味がありますか? TypeScriptのコードにおいて、try-catch が使われている場面をたびたび見かけます。 try-catch で囲う意図としては以下のようなものがあると思います。 例外をハンドリングすることで処理を継続したい。 例外の型によって処理を分岐したい。 例外の内容をログに出力したい。 例外をハンドリングする必要がありますか 例外は、例外的な状態なので例外なのです。 例外が発生した多くの場合、書かれたコードでは処理を継続できない状況が発生します。処理を継続できない状況において、例外を catch して

                                          その try-catch、意味がありますか?NestJSにおける例外処理の戦略 | TrustHub テックブログ
                                        • Announcing TypeScript 5.2 Beta - TypeScript

                                          Today we are excited to announce the availability of TypeScript 5.2 Beta. To get started using the beta, you can get it through NuGet, or through npm with the following command: npm install -D typescript@beta Here’s a quick list of what’s new in TypeScript 5.2! using Declarations and Explicit Resource Management Decorator Metadata Named and Anonymous Tuple Elements Easier Method Usage for Unions o

                                            Announcing TypeScript 5.2 Beta - TypeScript
                                          • Full Stack Java with React, Spring Boot, and JHipster

                                            Press Enter, and JHipster will create your app in the current directory and run npm install to install all the dependencies specified in package.json. Verify Everything Works with Cypress and KeycloakWhen you choose OAuth 2.0 and OIDC for authentication, the users are stored outside of the application rather than in it. You need to configure an identity provider (IdP) to store your users and allow

                                              Full Stack Java with React, Spring Boot, and JHipster
                                            • Kotlin+Ktorで技術要素を試しながらクリーンアーキテクチャでAPIサーバ構築 – rinoguchi's techlog

                                              まずは各ディレクトリを作成して、先ほど作ったApplication.ktをinfrastructureディレクトリに移動します。 設定(application.conf)を読み込んで /gradlew run 実行 設定ファイルでサーバーを構成できるようにしたいと思います。 Ktorでは、こちらを参照すると、mainClassNameで特定のWebサーバエンジンのEngineMainクラスを指定する必要があるようです。embeddedServerを利用する場合は、lambdaとDSLで記述するようです。 今回は Nettyエンジンを使うようにしたいと思います。 ./gradlew runで起動するメインクラスをNettyエンジンのメインクラスに変更 これまでは、対象のメインクラスを右クリックして直接プログラムを起動していましたが、Nettyエンジンのメインクラスを起動する際にはその方法は使

                                              • 現代的な高速リフレクション

                                                本記事はJava Advent Calendar 2024の9日目です。 最近のJavaには、動的にメソッドやフィールドを操作するための方法がいくつか存在します。本記事では、それぞれの特徴や利点をベンチマークを利用しながら実行速度に焦点を絞って解説していきたいと思います。 リフレクションの対象はインスタント化、フィールドアクセス、メソッド呼び出し等多岐に渡りますが、今回は下記のようなgetメソッドを呼び出す例で比較します。 1. Core Reflection 概要 みんな大好き、太古の昔から存在するリフレクションは、java.lang.reflect パッケージを利用して、実行時にクラスやメンバー(メソッド、フィールド、コンストラクタ)の情報を取得し、それらを操作する仕組みです。ライブラリやフレームワークの汎用性を担保するために使用されることが多いと思います。 特徴 汎用性: クラス、メ

                                                  現代的な高速リフレクション
                                                • Dynamic Exception Reporting in Haskell

                                                  Exceptions kind of suck in Haskell. You don’t get a stack trace. They don’t show up in the types of functions. They incorporate a subtyping mechanism that feels more like Java casting than typical Haskell programming. A partial solution to the problem is HasCallStack - that gives us a CallStack which gets attached to error calls. However, it only gets attached to error - so you can either have Str

                                                  • AWS Lambda SnapStartを利用してJava Lambda関数高速化の可能性を探る | TECH | NRI Digital

                                                    こんにちは、NRIデジタルの島です。 昨年のre:Inventにて、AWS Lambda(以下Lambda)にコールドスタートの性能を大幅に改善し、初回起動を高速化する「SnapStart機能」のリリースが発表されました。 New – Accelerate Your Lambda Functions with Lambda SnapStart サーバレスアーキテクチャであるLambdaを使用してアプリケーションを構築する際、必ず課題となるのが「コールドスタートにおける処理遅延」です。特にJavaの場合フットプリントも大きく、またJIT(Just-In-Time)等アプリケーションアーキテクチャの特性上初動が遅いです。ひとたびコードが最適化されると他の言語よりも高速になりますが、初動時からスピードが求められるサーバレスアーキテクチャとの相性はあまり良くないです。これが原因で「Lambdaには

                                                      AWS Lambda SnapStartを利用してJava Lambda関数高速化の可能性を探る | TECH | NRI Digital
                                                    • Javaのシンクロナイザ使い方メモ - Qiita

                                                      package synchronizer; import java.util.concurrent.TimeUnit; public class SynchronizerTest { public static void main(String[] args) { runThread(() -> { System.out.println("Thread 1 start"); System.out.println("Thread 1 end"); }); runThread(() -> { System.out.println("Thread 2 start"); System.out.println("Thread 2 sleeping..."); TimeUnit.SECONDS.sleep(3); System.out.println("Thread 2 awake"); System

                                                        Javaのシンクロナイザ使い方メモ - Qiita
                                                      • JSON is not JSON Across Languages | Dochia CLI Blog

                                                        Introduction: These Aren’t the JSONs You’re Looking For JSON (JavaScript Object Notation) was designed as a simple, lightweight, and human-readable data interchange format, often positioned as a more accessible alternative to XML. It has become the de facto standard for web APIs and system integration. However, while the specification itself is straightforward, different programming languages and

                                                          JSON is not JSON Across Languages | Dochia CLI Blog
                                                        • とほほのJava入門 - とほほのWWW入門

                                                          このページの内容は Java 1.4 時代の内容と Java 21 時代の内容が混在しています。順次、Java 21 に合わせて改版していきたいと思います。下記目次の各章に Java 1.4 か Java 21 かを示します。 索引 Javaとは ... Java 21 Javaとは JDKとJRE Javaのエディション(Java SE, Java EE, Java ME) Javaのバージョン Oracle JDKとOpenJDK OpenJDKのライセンス はじめてみよう ... Java 21 JDKをインストールする Javaアプリケーションのサンプル(Hello World) 文法 ... Java 21 コメント(//, /* */, /** */) キーワード リテラル プリミティブ型(boolean, byte, char, short, int, long, float

                                                          • Spring FrameworkのTask Executionを試す - CLOVER🍀

                                                            これは、なにをしたくて書いたもの? Spring Frameworkには、タスク実行とスケジューリングの機能があります。 Task Execution and Scheduling 今回は、タスク実行にフォーカスして見ていきたいと思います。 具体的には、TaskExecutorとThreadPoolTaskExecutor、@Asyncアノテーションを扱います。 Task Execution Spring FrameworkのTask Execution…タスクの実行に関するドキュメントは、こちらです。 Task Execution and Scheduling Spring Frameworkでは、JavaのExecutorを抽象化したTaskExecutorを提供しています。 The Spring TaskExecutor Abstraction Java SE環境であってもJava

                                                              Spring FrameworkのTask Executionを試す - CLOVER🍀
                                                            • いまさら訊けないバッチ実装の心得 6選(超基本編) - Qiita

                                                              はじめに これまでWEBアプリケーションをメインで作ってきましたが、最近新規のバッチジョブをまるっと1つ作るという経験をしました。 バッチ実装レベルとしては、既存のバッチ処理の不具合修正を何件かこなしたことがある程度。新規実装は初体験でした。 バッチ実装経験者であれば息を吸うかのように判断できるであろうことに、残念ながらとても悩んでしまう場面が多々ありました。 そんな状態ではありつつ、上司や同僚に質問・相談しながらなんとかローンチに漕ぎつけました。 その際に学んだり、自分なりに行き着いたりした、初めてバッチ実装する際には悩んだり盲点になったりすると思われる超基本的な心得を明文化しておこうと思います。 なお、今回実装したバッチ処理は超シンプルなデータ取込処理だったので、「こういう場合はどうするんだろう?たぶんこうするんだろうな」という考察・憶測も記載しています。そちらに関する編集リクエスト、

                                                                いまさら訊けないバッチ実装の心得 6選(超基本編) - Qiita
                                                              • Introducing the Advanced JDBC Wrapper Driver for Amazon Aurora | Amazon Web Services

                                                                AWS Database Blog Introducing the Advanced JDBC Wrapper Driver for Amazon Aurora Today’s modern applications are expected to be scalable and resilient. The top of this list is scalability, which depending on the size of the application workload could mean the ability to handle millions of users on demand. With stateful applications such as eCommerce, Financial Services and Games, this means having

                                                                  Introducing the Advanced JDBC Wrapper Driver for Amazon Aurora | Amazon Web Services
                                                                • Django for Startup Founders: A better software architecture for SaaS startups and consumer apps

                                                                  In an ideal world, startups would be easy. We'd run our idea by some potential customers, build the product, and then immediately ride that sweet exponential growth curve off into early retirement. Of course it doesn't actually work like that. Not even a little. In real life, even startups that go on to become billion-dollar companies typically go through phases like: Having little or no growth fo

                                                                  • Philosophy of coroutines

                                                                    [Simon Tatham, initial version 2023-09-01, last updated 2025-03-25] [Coroutines trilogy: C preprocessor | C++20 native | general philosophy ] Introduction Why I’m so enthusiastic about coroutines The objective view: what makes them useful? Versus explicit state machines Versus conventional threads The subjective view: why do I like them so much? “Teach the student when the student is ready” They s

                                                                    1