content
stringlengths
263
5.24M
pred_label
stringclasses
1 value
pred_score_pos
float64
0.6
1
package com.bsg6.chapter08; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.util.UriUtils; import java.nio.ch...
__label__POS
0.675395
package com.bsg6.chapter08; import org.springframework.lang.NonNull; import java.util.Objects; import java.util.StringJoiner; public class Song { Integer id; @NonNull Integer artistId; @NonNull String name; int votes; public Song() { } public Song(Integer id, @NonNull Integer ar...
__label__POS
0.803858
// Exercise 7-4 Check for anagrams. // There's more than one way to do this. // We chose to delete characters in one word that are common to both. // If the length of the word that has characters deleted is zero, they are anagrams. #include <iostream> #include <cctype> #include <string> int main() { std::string wo...
__label__POS
0.805722
// Exercise 7-3 Replacing a word in text by asterisks. // Because we are looking for the word regardless of case, // the best way is to scan the text character by character. #include <iostream> #include <string> #include <cctype> int main() { std::string text; // The text to be searched std::string word; ...
__label__POS
0.720692
// Exercise 7-6 Finding words that begin with a given letter. // If you wanted the words ordered by the first letter, you could sort the contents of letter first. // You could also retain all the sets of words for each letter in a separate vector for each set; // for this you could in other words use a std::vector<std:...
__label__POS
0.92259
package com.bsg6.chapter11; import jakarta.persistence.Entity; import jakarta.persistence.Id; import java.util.Objects; @Entity public class Artist { @Id private Integer id; private String name; public Artist() { } public Artist(String name) { this.name = name; } public Int...
__label__POS
0.82917
// Exercise 7-7 // Practice string concatenation, looping over strings, and stoi()-like functions #include <iostream> #include <string> int main() { std::cout << "Enter a sequence of numbers terminated by #:\n"; // Read a long string containing any number of integers std::string numbers; std::getline(std::c...
__label__POS
0.922047
package com.bsg6.chapter04; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.stereo...
__label__POS
0.626072
// Exercise 7-1 Storing student names and grades. // This uses a vector of string objects to store the names. #include <iostream> #include <format> #include <cctype> #include <vector> #include <string> int main() { std::vector<std::string> names; std::vector<double> grades; size_t max_length {}; // Lo...
__label__POS
0.827697
package com.bsg6.chapter04; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.testng.annotations.Tes...
__label__POS
0.70338
package com.bsg6.chapter04; import com.bsg6.chapter04.model.Artist; import com.bsg6.chapter04.model.Song; import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; public abst...
__label__POS
0.919941
// Exercise 9-4. Using std::optional<> #include <iostream> #include <string> #include <vector> #include <array> #include <span> #include <optional> // Function prototypes std::optional<double> largest(std::span<const double> data); std::optional<int> largest(std::span<const int> data); std::optional<std::string> large...
__label__POS
0.799144
package com.bsg6.chapter04.model; import java.util.HashMap; import java.util.Map; import java.util.Objects; import java.util.StringJoiner; public class Artist { private String name; private Map<String, Song> songs=new HashMap<>(); public Artist() { } public Artist(String name) { setName(...
__label__POS
0.818172
package com.bsg6.chapter04.model; import java.util.Objects; import java.util.StringJoiner; public class Song implements Comparable<Song> { private String name; private int votes=0; public Song() { } public Song(String name) { setName(name); } public String getName() { re...
__label__POS
0.948781
// Exercise 4-2 Testing for exact division of one integer by another. // We can use an if statement to check that the input is valid // and we can use another to arrange the input as we need. // Then we use an if-else to generate the appropriate output. #include <iostream> int...
__label__POS
0.87568
// Exercise 4-05 // Using the conditional operator to select output. #include <iostream> #include <format> int main() { int mice {}; // Count of all mice int brown {}; // Count of brown mice int white {}; // Count of white mice std::cout << "How many brown mice do you have? "; std::cin >> bro...
__label__POS
0.955916
package com.bsg6.chapter03; import com.bsg6.chapter03.model.Artist; import com.bsg6.chapter03.model.Song; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; public abstract class AbstractMusicService implements MusicService, Resettable { private Map<String, Artist> bands ...
__label__POS
0.811312
package com.bsg6.chapter03.mem04; import com.bsg6.chapter03.AbstractMusicService; import com.bsg6.chapter03.Normalizer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @Component public class...
__label__POS
0.991915
package com.bsg6.chapter03.mem03; import com.bsg6.chapter03.AbstractMusicService; import com.bsg6.chapter03.Normalizer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Scope; import org.springfra...
__label__POS
0.834523
package com.bsg6.chapter03.model; import java.util.*; public class Artist { private String name; private Map<String, Song> songs=new HashMap<>(); public Artist() { } public Artist(String name) { setName(name); } public String getName() { return name; } public vo...
__label__POS
0.916683
package com.bsg6.chapter03.model; import java.util.Objects; import java.util.StringJoiner; public class Song implements Comparable<Song> { private String name; private int votes; public Song() { } public Song(String name) { setName(name); } public String getName() { retu...
__label__POS
0.946785
// Exercise 8-2 Reversing the order of a string of characters. /****************************************************************** The reverse() function works with an argument of type string, or a C-style string terminated with '\0'. *******************************************************************/ #include <iostr...
__label__POS
0.951069
// Exercise 8_4 An overloaded plus() function. #include <iostream> #include <string> int plus(int a, int b); double plus(double x, double y); std::string plus(const std::string& s1, const std::string& s2); int main() { const int n {plus(3, 4)}; std::cout << "plus(3, 4) returns " << n << std::endl; const dou...
__label__POS
0.789172
package com.bsg6.chapter09.mongodb; import com.bsg6.chapter09.common.BaseArtist; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.lang.NonNull; import java.util.Objects; import java.util.StringJoiner; @Document public class Artis...
__label__POS
0.65942
// Exercise 3-1. Output an integer and its complements in binary and decimal. // This tests how well you remember string formatting using std::format() // (see Chapter 2 if you forgot some of the formatting options), // as well as two's complement binary encoding and bitwise ~. #include <iostream> #include <format> ...
__label__POS
0.885558
package com.bsg6.chapter06; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Mustache.Compiler; import org.springframework.web.servlet.view.AbstractTemplateViewResolver; import org.springframework.web.servlet.view.AbstractUrlBasedView; public class MustacheViewResolver extends AbstractTemplate...
__label__POS
0.898301
// Exercise 3-2. Calculating the number of boxes that can be stored on a shelf, without overhang. // We have to calculate how many boxes we can get into a row, // and how many rows we can have, and then multiply these numbers together. // The 'no overhang' problem is easily handled: casting from double to long // (us...
__label__POS
0.899437
// Exercise 14-4 Working with Employee and Executive objects #include <iostream> #include <vector> #include "Person.h" int main() { std::vector<Employee> employees { Employee{ 21, "Randy Marathon", Gender::male, 34567 }, Employee{ 32, "Anna Pothecary", Gender::female, 34578 }, Employee{ 46, "Peter Out...
__label__POS
0.824342
package com.bsg6.chapter07; import java.util.Objects; import java.util.StringJoiner; public class Artist implements Comparable<Artist> { private int id; private String name; public Artist() { } public Artist(int id, String name) { this.id = id; this.name = name; } public...
__label__POS
0.726932
package com.bsg6.chapter06; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Mustache.Compiler; import org.springframework.web.servlet.view.AbstractTemplateViewResolver; import org.springframework.web.servlet.view.AbstractUrlBasedView; public class MustacheViewResolver extends AbstractTemplateV...
__label__POS
0.899565
package com.bsg6.chapter06; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.EnableW...
__label__POS
0.835198
package com.bsg6.chapter06; import com.samskivert.mustache.Mustache.Compiler; import com.samskivert.mustache.Template; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.springframework.core.io.Resource; import org.springframework.web.servlet.view.AbstractTempla...
__label__POS
0.653993
// Exercise 21-5 Recreating std::advance() using constraint-based specialisation #include <iostream> #include <iterator> #include <vector> #include <list> #include <forward_list> template <std::random_access_iterator Iter> auto my_advance(Iter iter, std::iter_difference_t<Iter> n) { return iter + n; } template <s...
__label__POS
0.997718
// Exercise 20-14: the hard nut #include <iostream> #include <algorithm> #include <ranges> #include <iterator> #include <cmath> using namespace std::ranges::views; bool isPrime(unsigned number) { return number >= 2 && std::ranges::none_of( iota(2u, static_cast<unsigned>(std::sqrt(number) + 1)), ...
__label__POS
0.6623
// Exercise 20-5 Create a generic average() algorithm using std::accumulate() #include <iostream> #include <numeric> #include <utility> // for std::pair<> (only required for Solution 2 below) #include <optional> #include <vector> // Solution 1: simply use accumulate to sum, and determine the count using std::dista...
__label__POS
0.995479
// Exercise 20-10: exercising projection with range-based algorithms #include <iostream> #include <string> #include <vector> #include <algorithm> int main() { std::vector<std::string> names{"Frodo Baggins", "Gandalf the Gray", "Aragon", "Samwise Gamgee", "Peregrin Took", "Meriadoc Brandybuck", "Gimli", "Le...
__label__POS
0.926141
// Exercise 20-2 // Replace a custom stack container by the standard stack container adapter #include <stack> #include <iostream> #include <string> /* Two challenges: - std::stack<>::pop() is a void function. To access the top of the stack, you use std::stack<>::top(). - std::stack<const T> is not allowed *...
__label__POS
0.995593
// Exercise 15-6 Exercising Shape classes #include "Shapes.h" #include <iostream> #include <vector> double calculateSumAreas(const std::vector<Shape*>& shapes); double calculateSumPerimeters(const std::vector<Shape*>& shapes); void printSums(const std::vector<Shape*>& shapes); int main() { Circle c1{ Point{1, 1}, ...
__label__POS
0.798953
// Exercise 15-1 Animals.h // Animal classes #ifndef ANIMALS_H #define ANIMALS_H #include <string> #include <string_view> class Animal { public: Animal(std::string_view name, unsigned weight);// Constructor virtual ~Animal() = default; // Very important: a virtual destructor! virtual std::str...
__label__POS
0.784392
#ifndef TRUCKLOAD_H #define TRUCKLOAD_H #include "Box.h" #include <memory> #include <vector> using SharedBox = std::shared_ptr<Box>; class Truckload { public: Truckload() = default; // Default constructor - empty truckload Truckload(SharedBox box); // Constructor - one Box Truckload(const ...
__label__POS
0.619314
/*****************************************************************\ To implement printCount(), you first need a static member variable to store the object count. Every constructor should then increment this count, and you need to add a destructor that decrements it. \************************************************...
__label__POS
0.972744
#include <iostream> #include "Integer.h" /****************************************************************\ Implementing compare() as a friend is quite simple. We must declare the function as a friend in the class definition. We now need both objects as arguments and the code in the body of the function just compa...
__label__POS
0.819571
// Create a doubly-linked list of Packages #include "RandomBoxes.h" #include "Truckload.h" /* To show reverse iteration, we've modified findSmallestBox() to iterate in reverse order */ SharedBox findLargestBox(const Truckload& truckload); SharedBox findSmallestBox(const Truckload& truckload); int main() { Truc...
__label__POS
0.716637
// Throwing and catching standard exceptions #include <iostream> #include <stdexcept> #include <vector> #include <format> #include <typeinfo> #include <optional> /* This solution triggers all exceptions mentioned in the text accompanying the Table with all Standard Library exceptions, in order. To know how to t...
__label__POS
0.782847
// Exercising the SparseArray class template in combination with the LinkedList class template #include "SparseArray.h" #include "LinkedList.h" #include <string> #include <string_view> #include <iostream> #include <cctype> #include <utility> int main() { std::string text; // Stores inp...
__label__POS
0.721692
// Exercise 17-5 Exercising the LinkedList template class // This program reverses the text that is entered #include "LinkedList.h" #include <string> #include <string_view> #include <iostream> int main() { std::string text; // Stores input prose or poem std::cout << "\nEnter a poem or ...
__label__POS
0.951969
import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; public class ListModels { public static void main(String[] args) {      try {          // Create URL object for the API endpoint          URL url = new URL("https://api.openai.com/v1/models");    ...
__label__POS
0.838281
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; im...
__label__POS
0.6292
public class AudioSplitter { public static void main(String[] args) { String inputFilePath = "path/to/file/sample.mp3"; String outputDirectory = "path/to/folder/"; int segmentDurationInSeconds = 600; // 10 minutes in seconds try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(inputFilePath)) ...
__label__POS
0.979378
import java.io.IOException; import okhttp3.*; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; public class DALLEClient { public static void main(String[] args) { String openAIKey = ""; String endpoint = "https://api.openai.com/v1/images...
__label__POS
0.73942
#The NMS function def non_max_suppression(boxes, scores, overlap_threshold): # If there are no boxes, return an empty list if len(boxes) == 0: return [] # Initialize the list of picked indices pick = [] # Grab the coordinates of the bounding boxes x1 = boxes[:, 0] y1 = boxes[:, 1] ...
__label__POS
0.768674
;;;; clcs-36-case-assertions.lisp (defpackage #:clcs-36-case-assertions (:use #:cl) (:export #:test-1 #:test-2 #:test-3 #:test-4)) (in-package #:clcs-36-case-assertions) (defun test-1 () (let ((x 24)) (handler-case (ecase x (42 :integer) (:forty-two :keyword) ...
__label__POS
0.846089
;;;; clcs-35-check-type.lisp (defpackage #:clcs-35-check-type (:use #:cl) (:export #:test-1 #:test-2 #:test-3 #:test-4)) (in-package #:clcs-35-check-type) (defun test-1 () (let ((x 42)) (check-type x integer))) (defun test-2 () (let ((x "42")) (handler-case (check-type x integer) (type-error (...
__label__POS
0.9744
;;;; clcs-32-reporting-restarts.lisp (defpackage #:clcs-32-reporting-restarts (:use #:cl) (:export #:test-1 #:test-2)) (in-package #:clcs-32-reporting-restarts) (defvar *toplevel-restarts* '()) (defun compute-relevant-restarts (&optional condition) (set-difference (compute-restarts condition) *toplevel-restar...
__label__POS
0.894382
;;;; clcs-98-handler-bind-case.lisp (defpackage #:clcs-98-handler-bind-case (:use #:cl) (:export #:test-1 #:test-2 #:test-3)) (in-package #:clcs-98-handler-bind-case) (eval-when (:compile-toplevel :load-toplevel :execute) (defun make-handler-bind-case-with-no-error-case (form cases) (let* ((no-error-case (...
__label__POS
0.626923
;;;; t/ansi-test-data.lisp (in-package #:portable-condition-system/test) (eval-when (:compile-toplevel :load-toplevel :execute) (locally (declare (optimize safety)) (ignore-errors (setf (logical-pathname-translations "PCSTEST") `(("**;*.*.*" ,(merge-pathnames "t/" ...
__label__POS
0.851071
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Fri Mar 21 22:28:53 2003 ;;;; Contains: Tests for RESTART-BIND (in-package #:portable-condition-system/test) (deftest restart-bind.1 (restart-bind () nil) nil) (deftest restart-bind.2 (restart-bind () (values))) (deftest restart-bind.3 (re...
__label__POS
0.807116
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Sun Mar 23 09:10:22 2003 ;;;; Contains: Tests for STORE-VALUE restart and function (in-package #:portable-condition-system/test) (deftest store-value.1 (restart-case (progn (store-value 10) 'bad) (store-value (x) (list x 'good))) (10 g...
__label__POS
0.656405
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Sat Feb 15 20:12:04 2003 ;;;; Contains: Tests of CHECK-TYPE (in-package #:portable-condition-system/test) (deftest check-type.1 (let ((x 'a)) (values (check-type x symbol) x)) nil a) (deftest check-type.2 (signals-type-error x 'a (check-t...
__label__POS
0.948517
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Sun Feb 23 20:48:12 2003 ;;;; Contains: Tests for WARN (in-package #:portable-condition-system/test) (deftest warn.1 (let ((warned nil)) (handler-bind ((warning #'(lambda (c) (assert (typep c 'simple-warning)) ...
__label__POS
0.808527
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Fri Oct 18 21:06:45 2002 ;;;; Contains: Tests of CCASE (in-package #:portable-condition-system/test) (deftest ccase.1 (let ((x 'b)) (ccase x (a 1) (b 2) (c 3))) 2) (deftest ccase.2 (signals-type-error x 1 (ccase x)) t) (deftest ccase.3...
__label__POS
0.829293
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Tue Jan 28 06:48:19 2003 ;;;; Contains: Tests of ASSERT (in-package #:portable-condition-system/test) (deftest assert.1 (assert t) nil) (deftest assert.2 (assert t ()) nil) ;;; I am assuming that when no places are given to ASSERT, ;;; it ...
__label__POS
0.76898
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Fri Feb 28 21:59:57 2003 ;;;; Contains: Tests of INVOKE-DEBUGGER (in-package #:portable-condition-system/test) ;;; We can't test actual entry into the debugger, but we can test ;;; that the function in *debugger-hook* is properly called. (deftest i...
__label__POS
0.967271
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Sun Mar 23 04:06:06 2003 ;;;; Contains: Tests of WITH-CONDITION-RESTARTS (in-package #:portable-condition-system/test) (deftest with-condition-restarts.1 (let (a b c (i 0)) (values (with-condition-restarts (progn (setf a (incf ...
__label__POS
0.881458
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Sun Mar 23 09:13:59 2003 ;;;; Contains: Tests for USE-VALUE restart and function (in-package #:portable-condition-system/test) (deftest use-value.1 (restart-case (progn (use-value 10) 'bad) (use-value (x) (list x 'good))) (10 good)) (...
__label__POS
0.663646
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Sat Mar 8 22:38:53 2003 ;;;; Contains: Tests of DEFINE-CONDITION (part 1) (in-package #:portable-condition-system/test) (define-condition-with-tests condition-1 nil nil) (define-condition-with-tests condition-2 (condition) nil) (define-condition-...
__label__POS
0.994791
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Sun Mar 23 04:36:52 2003 ;;;; Contains: Tests for WITH-SIMPLE-RESTART (in-package #:portable-condition-system/test) (deftest with-simple-restart.1 (with-simple-restart (foo "")) nil) (deftest with-simple-restart.2 (with-simple-restart (foo ""...
__label__POS
0.622726
;;;; -*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Fri Oct 18 23:05:10 2002 ;;;; Contains: Tests of CTYPECASE (in-package #:portable-condition-system/test) (deftest ctypecase.1 (let ((x 1)) (ctypecase x (integer 'a) (t 'b))) a) (deftest ctypecase.2 (check-type-error #'(lambda (x) (ctypeca...
__label__POS
0.966671
namespace GetInjectedThreads.Enums { // https://docs.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-token_information_class enum TOKEN_INFORMATION_CLASS { TokenUser = 1, TokenGroups, TokenPrivileges, TokenOwner, TokenPrimaryGroup, TokenDefaultDacl, ...
__label__POS
0.652238
namespace GetInjectedThreads.Enums { public enum PRIVILEGE_CONSTANT { SeCreateTokenPrivilege = 1, SeAssignPrimaryTokenPrivilege, SeLockMemoryPrivilege, SeIncreaseQuotaPrivilege, SeUnsolicitedInputPrivilege, SeMachineAccountPrivilege, SeTcbPrivilege, ...
__label__POS
0.956307
using GetInjectedThreads.Enums; using System; namespace GetInjectedThreads.Structs { // MEMORY_BASIC_INFORMATION struct required for VirtualQueryEx - to read state and type fields // https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-memory_basic_information public struct MEMORY_BASIC_INF...
__label__POS
0.690812
/** * */ package com.apress.demo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.domain.Page; import org.springframework.test.context.junit4.SpringRunn...
__label__POS
0.906563
/** * */ package com.apress.demo.entities; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.Table; im...
__label__POS
0.647544
/** * */ package com.apress.demo.rest.model; import java.io.Serializable; import java.util.List; import javax.xml.bind.annotation.XmlRootElement; import org.springframework.data.domain.Page; import com.apress.demo.entities.Post; /** * @author Siva * */ @XmlRootElement public class PostsResponseDTO implements...
__label__POS
0.930938
# Applied Deep Learning - A Case-Based Approach to Understanding Deep Neural Networks ### By Umberto Michelucci Welcome to the github repository for the book "Applied Deep Learning - A Case-Based Approach to Understanding Deep Neural Networks". Here you will find the jupyter notebooks that I used during the completio...
__label__POS
0.623387
/** * */ package com.apress.demo.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.validation.Validator; ...
__label__POS
0.815456
/** * */ package com.apress.demo.security; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.AuthorityUtils; import com.apress.demo.entities.Role; import ...
__label__POS
0.930633
/** * */ package com.apress.demo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import java.util.List; import static o...
__label__POS
0.691836
package com.apress.webfluxdemo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; import java.util.Arrays; import java.util.List; @Component public class SampleDataPopulator implements CommandLineRunner {...
__label__POS
0.636628
package com.apress.webfluxdemo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; import java.util.Arrays; import java.util.List; @Component public class SampleDataPopulator implements CommandLineRunner {...
__label__POS
0.636628
// Copyright (C) 2023 Intel Corporation // SPDX-License-Identifier: MIT #include <iostream> #include <sycl/sycl.hpp> using namespace std; int my_selector(int isgpu, string foo) { int score = -1; // We prefer non-Martian GPUs, especially ACME GPUs if (isgpu) { if (foo.find("ACME") != std::string::npos) sco...
__label__POS
0.629393
/** * */ package com.apress.spring.boot.autoconfigure; import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; import org.springframework.boot.test.util.TestPropertyValues; ...
__label__POS
0.996101
/** * */ package com.apress.spring.boot.autoconfigure; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * @author Siva * */ @ConfigurationProperties(prefix= Twitter4jProperties.TWITTER4J_PREFIX) public...
__label__POS
0.869292
/** * */ package com.apress.demo.config; import org.apache.catalina.Context; import org.apache.catalina.connector.Connector; import org.apache.coyote.http11.AbstractHttp11Protocol; import org.apache.tomcat.util.descriptor.web.SecurityCollection; import org.apache.tomcat.util.descriptor.web.SecurityConstraint; impor...
__label__POS
0.631626
package com.apress.demo.controllers; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation...
__label__POS
0.647733
/** * */ package com.apress.demo.controllers; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.tomcat.util.http.fileupload.FileUploadBase.FileSizeLimitExceededException; import org.springframework.web.bin...
__label__POS
0.982023
/** * */ package com.apress.demo.healthchecks; import java.util.Date; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.stereotype.Component; import org.springframework.web.client.RestClientException; import org.springf...
__label__POS
0.992382
/** * */ package com.apress.demo.controllers; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework...
__label__POS
0.819256
/** * */ package com.apress.demo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import java.util.Arrays; import java.util.Date; import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; i...
__label__POS
0.855595
/** * */ package com.apress.demo.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Configuration; import org.springframework.validation.Validator; import org.springframework.validation.beanvalidation...
__label__POS
0.965871
/** * * */ package com.apress.demo.controllers; import java.io.PrintWriter; import java.io.StringWriter; import java.util.List; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.Errors; import org.springframework.validation.ObjectError...
__label__POS
0.667021
/** * */ package com.apress.demo.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** ...
__label__POS
0.993958
/** * */ package com.apress.demo; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; /** * @author Siva * */ @Entity @Table(name="USERS") public class Use...
__label__POS
0.611831
/* * This file is generated by jOOQ. */ package com.apress.demo.jooq.domain; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.annotation.Generated; import org.jooq.Schema; import org.jooq.impl.CatalogImpl; /** * This class is generated by jOOQ. */ @Generated( value =...
__label__POS
0.924542
/* * This file is generated by jOOQ. */ package com.apress.demo.jooq.domain; import javax.annotation.Generated; import org.jooq.Sequence; import org.jooq.impl.SequenceImpl; /** * Convenience access to all sequences in PUBLIC */ @Generated( value = { "http://www.jooq.org", "jOOQ version:3.9.1...
__label__POS
0.811725
/* * This file is generated by jOOQ. */ package com.apress.demo.jooq.domain; import com.apress.demo.jooq.domain.tables.Comments; import com.apress.demo.jooq.domain.tables.Posts; import com.apress.demo.jooq.domain.tables.records.CommentsRecord; import com.apress.demo.jooq.domain.tables.records.PostsRecord; import ja...
__label__POS
0.950872
/* * This file is generated by jOOQ. */ package com.apress.demo.jooq.domain; import com.apress.demo.jooq.domain.tables.Comments; import com.apress.demo.jooq.domain.tables.Posts; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.annotation.Generated; import org.jooq.Catalog; ...
__label__POS
0.959903
/* * This file is generated by jOOQ. */ package com.apress.demo.jooq.domain.tables; import com.apress.demo.jooq.domain.Keys; import com.apress.demo.jooq.domain.Public; import com.apress.demo.jooq.domain.tables.records.CommentsRecord; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; import...
__label__POS
0.661872
/* * This file is generated by jOOQ. */ package com.apress.demo.jooq.domain.tables.records; import com.apress.demo.jooq.domain.tables.Comments; import java.sql.Timestamp; import javax.annotation.Generated; import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; import org.jooq.Row6; import org.jo...
__label__POS
0.765675
/* * This file is generated by jOOQ. */ package com.apress.demo.jooq.domain.tables.records; import com.apress.demo.jooq.domain.tables.Posts; import java.sql.Timestamp; import javax.annotation.Generated; import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; import org.jooq.Row4; import org.jooq....
__label__POS
0.665873