content stringlengths 263 5.24M | pred_label stringclasses 1
value | pred_score_pos float64 0.6 1 |
|---|---|---|
namespace ApprovalUtilities.Reflection;
using System;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using Utilities;
public class HandlerListEntry
{
const string HandlerFieldName = "handler";
const string KeyFieldName = "key";
const string NextFieldName = "next";
readonly ob... | __label__POS | 0.826838 |
package com.spun.util.parser;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.assertEquals;
... | __label__POS | 0.976631 |
using ApprovalUtilities.Persistence;
using ApprovalUtilities.SimpleLogger.Writers;
namespace ApprovalUtilities.SimpleLogger;
public static class Logger
{
static LoggerInstance log = new();
public static IAppendable Writer
{
get => log.Writer;
set => log.Writer = value;
}
public s... | __label__POS | 0.719175 |
**[How To Page The Result Set of a `JOIN`](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootJoinPagination)**
**Description:** Using `JOIN` is very useful for fetching DTOs (data that is never modified, not in the current or subsequent requests). For example, consider two entities, ... | __label__POS | 0.67297 |
using System.Xml.Linq;
namespace ApprovalUtilities.Xml;
public class XmlUtils
{
public static string FormatXml(string xml, bool safe)
{
try
{
return XElement.Parse(xml).ToString();
}
catch
{
if (safe)
{
return xml;
... | __label__POS | 0.959448 |
using System.Collections;
using System.Text;
namespace ApprovalUtilities.Utilities;
public static class StringUtils
{
/// <summary>
/// A better string formatter for enumerables.
/// </summary>
public static string ToReadableString(this IEnumerable list)
{
if (list == null)
{
... | __label__POS | 0.796733 |
namespace ApprovalUtilities.Utilities;
public static class ExceptionUtilities
{
public static string FormatException(Exception exception, params string[] additional) =>
string.Join("\n", GetExceptionLines(exception, additional));
public static string[] GetExceptionLines(Exception except, params string... | __label__POS | 0.998858 |
package com.spun.util.timers;
import com.spun.util.logger.SimpleLogger;
import com.spun.util.timers.test.MockClock;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
public class LapTimerTest
{
@Test
public void te... | __label__POS | 0.970531 |
**[How To Configure Two Data Sources With Two Connection Pools](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootTwoDataSourceBuilderKickoff)**
**Note:** The best way to tune the connection pool parameters consist in using [Flexy Pool](https://github.com/vladmihalcea/flexy-pool) by ... | __label__POS | 0.894296 |
package com.apress.springrecipes.bookshop.config;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.DriverMana... | __label__POS | 0.677564 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated;
import com.apress.prospring6.seven.jooq.generated.tables.Album;
import com.apress.prospring6.seven.jooq.generated.tables.Instrument;
import com.apress.prospring6.seven.jooq.generated.tables.Singer;
import com.apress.prosprin... | __label__POS | 0.97427 |
using System.Management;
namespace ApprovalUtilities.Utilities;
public enum ApprovalsPlatform
{
Windows,
Linux,
Mac
}
public class OsUtils
{
public static ApprovalsPlatform GetPlatformId()
{
var platformID = Environment.OSVersion.Platform;
if (platformID is PlatformID.MacOSX or P... | __label__POS | 0.990903 |
using System.Diagnostics;
namespace ApprovalUtilities.Utilities;
public static class PathUtilities
{
public static string GetDirectoryForCaller() =>
GetDirectoryForCaller(1);
public static string GetDirectoryForCaller(int callerStackDepth)
{
var stackFrame = new StackTrace(true).GetFrame(... | __label__POS | 0.976746 |
package com.mobaijun.varbook.util;
import cn.hutool.http.HttpException;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONException;
import cn.hutool.json.JSONUtil;
import com.mobaijun.varbook.dto.XiaoNiuTranslateResponse;
import java.util.Map;
import java.util.regex.Pattern;
/**
* Description: [小牛翻译工具类]
* ... | __label__POS | 0.977101 |
using System.Text;
namespace ApprovalUtilities.Utilities;
public static class JsonPrettyPrint
{
const string INDENT_STRING = " ";
public static string FormatJson(this string str)
{
var indent = 0;
var quoted = false;
var builder = new StringBuilder();
for (var i = 0; i... | __label__POS | 0.616086 |
package com.mobaijun.varbook.enums;
import java.util.Arrays;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Description: [常量]
* Author: [mobaijun]
* Date: [2025/7/16 19:08]
* IntelliJ IDEA Version: [IntelliJ IDEA 2023.1.4]
*/
@Getter
@AllArgsConstructor
public enum CommonSuffixType {
CONTROLLE... | __label__POS | 0.985 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated;
import com.apress.prospring6.seven.jooq.generated.tables.Album;
import com.apress.prospring6.seven.jooq.generated.tables.Instrument;
import com.apress.prospring6.seven.jooq.generated.tables.Singer;
import com.apress.prosprin... | __label__POS | 0.999568 |
package com.mobaijun.varbook.mapper;
import com.mobaijun.varbook.entity.TranslateLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* 翻译日... | __label__POS | 0.99832 |
namespace ApprovalUtilities.Utilities;
public static class Guard
{
public static void AgainstNull(object value, string argumentName)
{
if (value == null)
{
throw new ArgumentNullException(argumentName);
}
}
public static void AgainstUpperCase(string value, string ar... | __label__POS | 0.816097 |
#include "ApprovalTests/comparators/TextFileComparator.h"
#include <fstream>
namespace ApprovalTests
{
std::ifstream::int_type
TextFileComparator::getNextRelevantCharacter(std::ifstream& astream)
{
auto ch = astream.get();
if (ch == '\r')
{
return astream.get();
... | __label__POS | 0.921886 |
**[How To Retry Transaction Via `TransactionTemplate` After `OptimisticLockException` Exception (`@Version`)](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootRetryVersionedOptimisticLockingTT)**
**Note:** Optimistic locking via `@Version` works for detached entities as well.
**Des... | __label__POS | 0.637008 |
package com.spun.util.io;
import com.spun.util.io.FileMonitor.FileListener;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.File;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class FileMonitorTest
{
FileMonitor... | __label__POS | 0.856804 |
package com.spun.util.io;
import com.spun.util.io.xml.XmlExtractorUtil;
import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class XMLUtilsTest
{
@Test
public void testXML() ... | __label__POS | 0.772202 |
using System.Data;
using System.Data.Common;
using System.Text;
using ApprovalUtilities.Utilities;
namespace ApprovalUtilities.Persistence.Database;
public class SqlLoaderUtils
{
public static string ExecuteQueryToDisplayString(string query, DbConnection conn)
{
if (conn.State == ConnectionState.Close... | __label__POS | 0.948946 |
using System.ComponentModel;
using System.Windows.Forms;
using ApprovalUtilities.Reflection;
public class HandlerListEntryTest
{
[Fact]
public void BecomeNullObjectWhenItemIsWrongType() =>
Approvals.Verify(new HandlerListEntry(new Button()));
[Fact]
public void GetListEntryTest() =>
As... | __label__POS | 0.888636 |
#pragma warning disable CS0169
using System.Reflection;
using System.Windows.Forms;
using ApprovalUtilities.Reflection;
using ApprovalTests.Reporters;
using Polyfills;
[UseReporter(typeof(DiffReporter))]
public class ReflectionUtilitiesTest
{
[Fact]
public void ControlWithLocalAndBaseKeys()
{
var ... | __label__POS | 0.747472 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.records;
import com.apress.prospring6.seven.jooq.generated.tables.Singer;
import java.time.LocalDate;
import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record5;
import org.jooq.Row5;
import org.jooq.imp... | __label__POS | 0.7622 |
#if os(OSX)
import ApprovalTests_Swift
#elseif os(iOS)
import ApprovalTests_iOS
#endif
import XCTest
final class ApprovalsTests: XCTestCase {
func testToString() throws {
try Approvals.verify(CGRect(x: 5, y: 10, width: 100, height: 200))
}
func testAsJson() throws {
try Approvals.v... | __label__POS | 0.798137 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.records;
import com.apress.prospring6.seven.jooq.generated.tables.SingerInstrument;
import org.jooq.Field;
import org.jooq.Record2;
import org.jooq.Row2;
import org.jooq.impl.UpdatableRecordImpl;
/**
* This class i... | __label__POS | 0.648885 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.records;
import com.apress.prospring6.seven.jooq.generated.tables.Album;
import java.time.LocalDate;
import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record5;
import org.jooq.Row5;
import org.jooq.impl... | __label__POS | 0.780884 |
public class StringUtilitiesTest
{
[Fact]
public void TestToReadableString()
{
Assert.Equal("[]", Array.Empty<int>().ToReadableString());
Assert.Equal("[1, 2, 3]", new[] {1, 2, 3}.ToReadableString());
int[] empty = null;
Assert.Equal("[]", empty.ToReadableString());
}
... | __label__POS | 0.872669 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.daos;
import com.apress.prospring6.seven.jooq.generated.tables.Singer;
import com.apress.prospring6.seven.jooq.generated.tables.records.SingerRecord;
import java.time.LocalDate;
import java.util.List;
import java.util... | __label__POS | 0.94138 |
**[Batch Inserts In Spring Boot Style Via `CompletableFuture`](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootBatchInsertsCompletableFuture)**
<b><a href="https://persistencelayer.wixsite.com/springboot-hibernate/post/how-to-batch-inserts-in-spring-boot-style-via-completablefutur... | __label__POS | 0.882032 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.daos;
import com.apress.prospring6.seven.jooq.generated.tables.Instrument;
import com.apress.prospring6.seven.jooq.generated.tables.records.InstrumentRecord;
import java.util.List;
import java.util.Optional;
import o... | __label__POS | 0.703571 |
#pragma once
#include "ApprovalTests/reporters/FirstWorkingReporter.h"
#include "ApprovalTests/reporters/GenericDiffReporter.h"
namespace ApprovalTests
{
namespace Windows
{
class VisualStudioCodeReporter : public GenericDiffReporter
{
public:
VisualStudioCodeReporter();
... | __label__POS | 1.000009 |
using ApprovalTests.Reporters.ContinuousIntegration;
[TestFixture]
public class ReporterTest
{
[Test]
public void Testname()
{
var old = Environment.GetEnvironmentVariable(NCrunchReporter.EnvironmentVariable);
Environment.SetEnvironmentVariable(NCrunchReporter.EnvironmentVariable, "1");
... | __label__POS | 0.821322 |
#if os(OSX)
import ApprovalTests_Swift
#elseif os(iOS)
import ApprovalTests_iOS
#endif
import XCTest
// swiftlint:disable anonymous_argument_in_multiline_closure multiline_arguments
final class CombinationTests: XCTestCase {
private func threeParams(_ in1: Int, _ in2: Int, _ in3: Int) -> Int {
in1... | __label__POS | 0.955898 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.daos;
import com.apress.prospring6.seven.jooq.generated.tables.Album;
import com.apress.prospring6.seven.jooq.generated.tables.records.AlbumRecord;
import java.time.LocalDate;
import java.util.List;
import java.util.O... | __label__POS | 0.937855 |
package com.apress.springrecipes.bookshop;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
import or... | __label__POS | 0.60685 |
package com.apress.springrecipes.bookshop.config;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.DriverMana... | __label__POS | 0.856495 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Win... | __label__POS | 0.74488 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.daos;
import com.apress.prospring6.seven.jooq.generated.tables.SingerInstrument;
import com.apress.prospring6.seven.jooq.generated.tables.records.SingerInstrumentRecord;
import java.util.List;
import org.jooq.Configu... | __label__POS | 0.855889 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.pojos;
import java.io.Serializable;
/**
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Instrument implements Serializable {
private static final long s... | __label__POS | 0.99304 |
**[How To Extract Tables Metadata](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootTablesMetadata)**
**Description:** This application is an example of using the Hibernate SPI, `org.hibernate.integrator.spi.Integrator` for extracting tables metadata.
**Key points:**
- implement `... | __label__POS | 0.883924 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.pojos;
import java.io.Serializable;
/**
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class SingerInstrument implements Serializable {
private static final ... | __label__POS | 0.990993 |
#pragma once
#include "ApprovalTests/reporters/GenericDiffReporter.h"
#include "ApprovalTests/reporters/FirstWorkingReporter.h"
namespace ApprovalTests
{
namespace Linux
{
class SublimeMergeSnapReporter : public GenericDiffReporter
{
public:
SublimeMergeSnapReporter();
... | __label__POS | 1.00001 |
[TestFixture]
public class FirstWorkingReporterTest
{
[Test]
public void TestCallsFirstAndOnlyFirst()
{
var a = new RecordingReporter(false);
var b = new RecordingReporter(true);
var c = new RecordingReporter(true);
var reporter = new FirstWorkingReporter(a, b, c);
C... | __label__POS | 0.904176 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.pojos;
import java.io.Serializable;
import java.time.LocalDate;
/**
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Singer implements Serializable {
pri... | __label__POS | 0.976766 |
/*
* This file is generated by jOOQ.
*/
package com.apress.prospring6.seven.jooq.generated.tables.pojos;
import java.io.Serializable;
import java.time.LocalDate;
/**
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Album implements Serializable {
priv... | __label__POS | 0.979352 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Win... | __label__POS | 0.861306 |
import Foundation
public let TEXT = [".txt", ".csv", ".htm", ".html", ".xml", ".eml", ".java", ".css", ".js", ".json", ".md"]
public let IMAGES = [".png", ".gif", ".jpg", ".jpeg", ".bmp", ".tif", ".tiff"]
public let TEXT_AND_IMAGES = TEXT + IMAGES
public class GenericDiffReporterBase: EquatableFailureReporter {
l... | __label__POS | 0.885358 |
[TestFixture]
[UseReporter(typeof(ClassLevelReporter))]
public class ReporterFactoryTest
{
static IEnumerable<Type> GetSingletonReporterTypes()
{
var types = typeof(UseReporterAttribute).Assembly.GetTypes();
var reporters = types.Where(r => r.GetInterfaces().Contains(typeof(IApprovalFailureRepor... | __label__POS | 0.776693 |
package com.apress.springrecipes.bookshop.config;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.DriverMana... | __label__POS | 0.677564 |
import Foundation
public class ReportByCallingScript: GenericDiffReporter {
private let createIfNeeded: Bool
public init(createIfNeeded: Bool = false, _ file: String = #filePath) {
self.createIfNeeded = createIfNeeded
let parentDirectory = URL(fileURLWithPath: file).deletingLastPathComponent()... | __label__POS | 0.630918 |
**[How To Use Hibernate Soft Deletes In A Spring Boot Application](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootSoftDeletes)**
**Description:** This application is an example of using Hibernate soft deletes in a Spring Boot application.
**Key points:**
- define an `abstract` c... | __label__POS | 0.680912 |
// Requires Tools->Create Command-line Launcher
public class ReportWithAppCode: GenericDiffReporter {
public init() {
super.init(
programPath: "/usr/local/bin/appcode",
arguments: { received, approved in
["diff", received, approved]
}
)
}
}
p... | __label__POS | 0.984898 |
[TestFixture]
public class InlineTextReporterTest
{
[Test]
public void TestComment()
{
var actual = "Hello";
var expected = "Hello";
Approvals.AssertText(expected, actual);
}
[Test]
public void CSharpStrings()
{
var example1 = new[]
{
"**... | __label__POS | 0.994498 |
using ApprovalTests.Set;
using System.Text.RegularExpressions;
[TestFixture]
public class SetTests
{
[Test]
public void TestListString()
{
// Approved file has order apple, banana, carrot
var list = new List<string> { "carrot", "apple", "banana" };
SetApprovals.VerifySet(list, stri... | __label__POS | 0.797972 |
#pragma once
#include "ApprovalTests/reporters/GenericDiffReporter.h"
#include "ApprovalTests/reporters/FirstWorkingReporter.h"
namespace ApprovalTests
{
namespace Mac
{
class DiffMergeReporter : public GenericDiffReporter
{
public:
DiffMergeReporter();
};
... | __label__POS | 0.999868 |
#S#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="HTML Tidy for Cygwin (vers 1st February 2003), see www.w3.org" name="generator">
<meta name="keywords" content="electronic commerce, ecommerce, ebusiness, e-business, e-commer... | __label__POS | 0.744266 |
#include "ApprovalTests/reporters/DiffInfo.h"
#include "ApprovalTests/utilities/SystemUtils.h"
namespace ApprovalTests
{
std::string DiffInfo::receivedFileTemplate()
{
return "{Received}";
}
std::string DiffInfo::approvedFileTemplate()
{
return "{Approved}";
}
std::string ... | __label__POS | 0.664597 |
**[How To `JOIN FETCH` an `@ElementCollection`](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootElementCollectionJoinFetch)**
**Description:** This application is an example applying `JOIN FETCH` to fetch an `@ElementCollection`.
**Key points:**
- by default, `@ElementCollection`... | __label__POS | 0.811471 |
**[Calling Stored Procedure That Returns A Result Set Via `JdbcTemplate` And `BeanPropertyRowMapper`](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootCallStoredProcedureJdbcTemplateBeanPropertyRowMapper)**
**Description:** This application is an example of calling a MySQL stored p... | __label__POS | 0.646043 |
#S## * AC Fry - JavaScript Framework v1.0
# *
# * Remote backend implementation - Ruby on Rails
# *
# * (c)2006 Petr Krontorad, April-Child.com
# * Portions of code based on WHOA Bender Framework, (c)2002-2005 Petr Krontorad, WHOA Group.
# * http://www.april-child.com. All rights reserved.
# * See the license/l... | __label__POS | 0.669426 |
import Foundation
public class FileApprover: ApprovalApprover {
private static var failer: Failer = XCTFailer()
public static func registerFailer(_ failer: Failer) {
Self.failer = failer
}
public static func resetFailer() {
Self.failer = XCTFailer()
}
private let fileManager ... | __label__POS | 0.613085 |
import { cn } from "@/lib/utils";
import { useId } from "react";
/**
* DotPattern Component Props
*
* @param {number} [width=16] - The horizontal spacing between dots
* @param {number} [height=16] - The vertical spacing between dots
* @param {number} [x=0] - The x-offset of the entire pattern
* @param {number} ... | __label__POS | 0.701534 |
package org.packagesettings;
import com.spun.util.ObjectUtils;
import com.spun.util.ThreadUtils;
import org.lambda.functions.Function0;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
public cla... | __label__POS | 0.866029 |
/*
* Copyright 2013 APPNEXUS INC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... | __label__POS | 0.828465 |
#include "Scrubbers.h"
#include <string>
#include <functional>
#include <regex>
#include <map>
namespace ApprovalTests
{
namespace Scrubbers
{
std::string doNothing(const std::string& input)
{
return input;
}
std::string scrubRegex(const std::string& input,
... | __label__POS | 0.720194 |
package appnexus.com.trackertestapp
import android.net.Uri
import com.appnexus.opensdk.ut.UTConstants
import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
class MockDispatcher : Dispatcher() {
lateinit var adType: String
var arrRequest... | __label__POS | 0.733043 |
#include "ApprovalTests/utilities/StringUtils.h"
#include "ApprovalTests/utilities/Macros.h"
#include <cctype>
namespace ApprovalTests
{
APPROVAL_TESTS_NO_DISCARD
std::string StringUtils::replaceAll(std::string inText,
const std::string& find,
... | __label__POS | 0.989713 |
package org.lambda.query;
import org.lambda.functions.Function1;
import java.util.Comparator;
public class OrderBy<T, Out extends Comparable<?>> implements Comparator<T>
{
public static enum Order {
Ascending, Descending
}
private Function1<T, Out> f1;
private int as... | __label__POS | 0.993675 |
package org.lambda.query;
import com.spun.util.ArrayUtils;
import org.lambda.functions.Function0;
import org.lambda.functions.Function1;
import org.lambda.query.OrderBy.Order;
import java.util.AbstractMap.SimpleEntry;
import java.util.*;
import java.util.Map.Entry;
public class Query<In>
{
public static <In, Out> ... | __label__POS | 0.956863 |
package com.apress.springrecipes.bookshop.config;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.DriverMana... | __label__POS | 0.677564 |
[TestFixture]
[UseReporter(typeof(QuietReporter))]
public class ExecutableTest
{
static List<string> RunExecutableApproval()
{
var output = new List<string>();
try
{
NamerFactory.AdditionalInformation = "Inner";
Approvals.VerifyWithCallback("Sam", s => output.Add... | __label__POS | 0.962229 |
package org.lambda.utils;
import com.spun.util.ThreadUtils;
import org.lambda.actions.Action0;
import org.lambda.functions.Function0;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class Once
{
private static final Set<Class> ... | __label__POS | 0.955105 |
package org.lambda.utils;
import com.spun.util.markdown.table.MarkdownTable;
import org.lambda.functions.Function2;
import org.lambda.query.Queryable;
public class Grid
{
public static String print(int width, int height, Function2<Integer, Integer, String> f2)
{
StringBuffer b = new StringBuffer();
for (i... | __label__POS | 0.979902 |
package org.lambda.actions;
import com.spun.util.ObjectUtils;
public class Actions
{
public static <In> Action1<In> unchecked(Action1WithException<In> action)
{
return i -> ObjectUtils.throwAsError(() -> action.call(i));
}
public static <In1, In2> Action2<In1, In2> unchecked(Action2WithException<In1, In2>... | __label__POS | 0.901713 |
package org.lambda.functions;
import com.spun.util.ObjectUtils;
public class Functions
{
public static <In, Out> Function1<In, Out> unchecked(Function1WithException<In, Out> function)
{
return i -> ObjectUtils.throwAsError(() -> function.call(i));
}
public static <In1, In2, Out> Function2<In1, In2, Out> u... | __label__POS | 0.889437 |
package com.spun.util;
import com.spun.util.logger.SimpleLogger;
import java.io.File;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Map;
public class SystemUtils
{
/**
* @deprecated Use {@link #isWindowsEnvironment()} instead.
* For example inline your usage of this meth... | __label__POS | 0.778286 |
package com.spun.util;
import com.spun.util.filters.Filter;
import org.lambda.query.Query;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
public class MethodExecutionPath implements Serializable
{
private static final long serialVersionUID ... | __label__POS | 0.702816 |
**[Calling Stored Procedure That Returns A Result Set Via `JdbcTemplate`](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootCallStoredProcedureJdbcTemplate)**
**Note:** Most probably you'll like to process the result set via `BeanPropertyRowMapper` as [here](https://github.com/Anghel... | __label__POS | 0.846841 |
package com.spun.util;
/**
* Phone number validation, and formatter.
* this class is immutable.
**/
public class PhoneNumber
{
public static final int USA = 0;
public static final String[] COUNTRY_CODES = {"1",
"20",
... | __label__POS | 0.601871 |
package com.spun.util;
import com.spun.swing.Paintable;
import com.spun.swing.Paintables;
import com.spun.util.logger.SimpleLogger;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import java.awt.Dimension;
import java.awt.event.WindowAdapter;
public class WindowUtils
{
public... | __label__POS | 0.878378 |
#include "ApprovalTests/integrations/google/GoogleCustomizationsFactory.h"
namespace ApprovalTests
{
GoogleCustomizationsFactory::ComparatorContainer&
GoogleCustomizationsFactory::comparatorContainer()
{
static ComparatorContainer container;
if (container.empty())
{
auto... | __label__POS | 0.791314 |
package com.spun.util;
import com.spun.util.logger.SimpleLogger;
import java.util.Calendar;
import java.util.Date;
public class DateDifference
{
public static final String[] STANDARD_TIME_TEXT = {"Year",
"Years",
... | __label__POS | 0.978079 |
**[How To Obtain Auto-Generated Keys](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootReturnGeneratedKeys)**
**Description:** This application is an example of retrieving the database auto-generated primary keys.
**Key points:**
- JPA style, retrieve the auto-generated keys via `... | __label__POS | 0.828786 |
package com.spun.util;
import java.util.HashMap;
public class StateToPostalCode
{
/*
* Utility that maps postal code to full state names.
*/
public static final String ALABAMA = "Alabama";
public static final String ALASKA = "Alaska";
public static fina... | __label__POS | 0.999968 |
**[How To Fetch Data From A MySQL Database View](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootDatabaseView)**
**Description:** This application is an example of fetching a read-only MySQL database view in a JPA immutable entity.
**Key points:**
- the database view is available ... | __label__POS | 0.708813 |
#import "AMAAppMetricaImpl+TestUtilities.h"
#import "AMAEventCountDispatchStrategy.h"
#import "AMATimerDispatchStrategy.h"
#import "AMAReporterStorage.h"
@implementation AMAAppMetricaImpl (TestUtilities)
- (AMAEventCountDispatchStrategy *)eventCountDispatchStrategyInSet:(NSSet *)strategies forApiKey:(NSString *)apiK... | __label__POS | 0.762 |
package com.spun.util;
import com.spun.util.io.FileUtils;
import org.lambda.functions.Function1;
import org.lambda.query.OrderBy.Order;
import org.lambda.query.Query;
import org.lambda.query.Queryable;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modif... | __label__POS | 0.814585 |
package com.spun.util;
import org.lambda.actions.Action0;
import org.lambda.actions.Action0WithException;
import org.lambda.functions.Function0WithException;
import org.lambda.query.Query;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
/**
* A static class of convenience functio... | __label__POS | 0.789206 |
**[Avoid Spring Redundant `save()` Call](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootRedundantSave)**
**Description:** This application is an example when calling `save()` for an entity is redundant (not necessary).
**Key points:**
- at flush time, Hibernate relies on *dirty ... | __label__POS | 0.622272 |
package com.apress.prospring5.ch16.init;
import javax.servlet.MultipartConfigElement;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.support.XmlWebApp... | __label__POS | 0.868975 |
package com.apress.springrecipes.bookshop.config;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.DriverMana... | __label__POS | 0.677564 |
package com.spun.util;
import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class SearchingFileFilter implements FilenameFilter
{
private final List<String> matches;
public SearchingFileFilter(List<String> matches)
{
this.matc... | __label__POS | 0.999205 |
package com.spun.util;
import org.lambda.query.Query;
public enum State {
Alabama("AL"), Alaska("AK"), Arizona("AZ"), Arkansas("AR"), California("CA"), Colorado("CO"),
Connecticut("CT"), Delaware("DE"), DistrictOfColumbia("Washington D.C.", "DC"), Florida("FL"),
... | __label__POS | 0.943226 |
package com.spun.util;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import com.google.gson.TypeAdapter;
import com.... | __label__POS | 0.672945 |
package com.apress.springrecipes.bookshop.config;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import com.apress.springrecipes.bookshop.BookShop;
import... | __label__POS | 0.938946 |
package com.spun.util;
import com.spun.util.logger.SimpleLogger;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
public class WhiteSpaceStripper
{
public static void stripFolder(File... | __label__POS | 0.710534 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.