This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.net.URI; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Objects; | |
| public record PagedResult<T>( | |
| List<T> content, | |
| int pageNumber, // 1-based | |
| int pageSize, | |
| long totalElements, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.nemesis; | |
| import jakarta.servlet.http.HttpServlet; | |
| import jakarta.servlet.http.HttpServletRequest; | |
| import jakarta.servlet.http.HttpServletResponse; | |
| import org.eclipse.jetty.server.Server; | |
| import org.eclipse.jetty.servlet.ServletContextHandler; | |
| import org.eclipse.jetty.servlet.ServletHolder; | |
| import java.sql.*; | |
| import java.time.LocalDateTime; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.time.LocalDate; | |
| import java.util.UUID; | |
| public class Booking { | |
| public String id; | |
| public String guestName; | |
| public String roomNumber; | |
| public LocalDate checkIn; | |
| public LocalDate checkOut; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.lang.reflect.*; | |
| import java.util.*; | |
| public class DefaultObjectGenerator { | |
| public <T> T create(Class<T> clazz) { | |
| try { | |
| // Base cases: primitive, string, enum | |
| if (isSimpleType(clazz)) return getPrimitive(clazz); | |
| if (clazz.isEnum()) return clazz.cast(createEnumValue(clazz)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package conditionalFormattingExcel; | |
| import org.jetbrains.annotations.NotNull; | |
| public sealed interface FormattableNumber permits FormattableNumber.Currency, FormattableNumber.Fixed, FormattableNumber.Percentage { | |
| double rawNumber(); | |
| static Fixed ofFixed(double value) { | |
| return new Fixed(value); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package evaluation; | |
| import com.ezylang.evalex.EvaluationException; | |
| import com.ezylang.evalex.Expression; | |
| import com.ezylang.evalex.config.ExpressionConfiguration; | |
| import com.ezylang.evalex.data.EvaluationValue; | |
| import com.ezylang.evalex.functions.AbstractFunction; | |
| import com.ezylang.evalex.functions.FunctionParameter; | |
| import com.ezylang.evalex.parser.Token; | |
| import lombok.extern.slf4j.Slf4j; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| This script provides three modes of operation: | |
| 1. Converts a given string to its hexadecimal representation. | |
| 2. Decodes a given hexadecimal string back to its original UTF-8 representation. | |
| 3. Renames files in a given directory by encoding the part of the filename before the first '.' or '_'. | |
| .PARAMETER InputString | |
| A string that will be converted to hexadecimal encoding. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $process = Get-Process | Where-Object { $_.MainWindowTitle -like "*xxx*" } | |
| if ($process) { | |
| # Get the executable file path | |
| $exePath = Get-CimInstance -ClassName Win32_Process -Filter "ProcessId = $($process.Id)" | Select-Object -ExpandProperty ExecutablePath | |
| Write-Output "Executable Path: $exePath" | |
| } else { | |
| Write-Output "No process found with the specified window title." | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.example2; | |
| import com.fasterxml.jackson.core.*; | |
| import com.fasterxml.jackson.databind.*; | |
| import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | |
| import java.io.IOException; | |
| import java.util.*; | |
| import java.util.stream.Collectors; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function findCodePointsLikeAtoZ() { | |
| const targetLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
| const normalizationResults = {}; | |
| // Initialize the dictionary for each letter | |
| for (const letter of targetLetters) { | |
| normalizationResults[letter] = []; | |
| } | |
| // Iterate over all Unicode code points |
NewerOlder