content stringlengths 263 5.24M | pred_label stringclasses 1
value | pred_score_pos float64 0.6 1 |
|---|---|---|
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 17:02:24 11/23/2018
// Design Name:
// Module Name: grf
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Rev... | __label__POS | 0.79872 |
// Using the std::function<> template
import <iostream>;
import <functional>;
#include <cmath> // for std::abs()
// A global less() function
bool less(int x, int y) { return x < y; }
int main()
{
int a{ 18 }, b{ 8 };
std::cout << std::boolalpha; // Print true/false rather than 1/0
std::function<bo... | __label__POS | 0.604835 |
package cm.aptoide.pt.search.view.item;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import cm.aptoide.pt.R;
import cm.aptoide.pt.search.model.Suggestion;
import cm.aptoide.pt.search.suggestions.SearchQueryEvent;
import rx.... | __label__POS | 0.76842 |
// Exercise 16-6 Exercising the SparseArray class template with the LinkedList class template
#include "SparseArray.h"
#include "LinkedList.h"
#include <string>
#include <iostream>
#include <cctype>
#include <utility>
int main()
{
std::string text; // Stores input prose or poem
std::... | __label__POS | 0.674006 |
// Convert SI to imperial weight
// The conversion values are constant,
// and should not be changed within the program,
// so we recognize this by declaring them as a const.
//
// Note: we always output "pounds" even if it concerns only 1 pound.
// In a later chapter you will learn about the conditional
// statement... | __label__POS | 0.743654 |
// Exercise 16-5 Exercising the LinkedList template class
// This program reverses the text that is entered
#include "LinkedList.h"
#include <string>
#include <iostream>
int main()
{
std::string text; // Stores input prose or poem
std::cout << "\nEnter a poem or prose over one or more ... | __label__POS | 0.953562 |
// Exercise 6-2. Traversing arrays using pointer arithmetics
// An exercise to further deepen your understanding of the relation
// between pointers, pointer arithmetic, and arrays.
import std;
int main()
{
const int n {50};
int odds[n];
for (int i {}; i < n; ++i)
odds[i] = i * 2 + 1;
const int perline ... | __label__POS | 0.902538 |
// Exercise 5-7. Outputting product records & cost
// Getting the alignment right is tricky.
// You have to adjust the field widths until it looks OK.
import std;
int main()
{
std::vector<unsigned> product_id;
std::vector<unsigned> quantity;
std::vector<double> unit_cost;
// Read the records
while (true)
... | __label__POS | 0.921653 |
// Exercise 5-4 Print out characters entered by the user in reverse order
import std;
int main()
{
const std::size_t max_num_characters {1'000};
char string[max_num_characters];
std::print("Please enter a string: ");
std::cin.getline(string, max_num_characters);
// Count the number of characters
std::s... | __label__POS | 0.800214 |
// Exercise 7-2 Frequency of words in text.
import std;
int main()
{
std::string text; // The text to be searched
std::println("Enter some text terminated by *:");
std::getline(std::cin, text, '*');
const std::string separators {" ,;:.\"!?'\n"}; // Word del... | __label__POS | 0.884427 |
package cm.aptoide.pt.store.view;
import android.app.Activity;
import android.content.SharedPreferences;
import cm.aptoide.accountmanager.AptoideAccountManager;
import cm.aptoide.pt.R;
import cm.aptoide.pt.database.room.RoomStore;
import cm.aptoide.pt.dataprovider.interfaces.TokenInvalidator;
import cm.aptoide.pt.data... | __label__POS | 0.696338 |
package cm.aptoide.pt.store.view;
import android.view.View;
import androidx.annotation.NonNull;
import cm.aptoide.pt.R;
import cm.aptoide.pt.account.AccountAnalytics;
import cm.aptoide.pt.account.view.AccountNavigator;
import cm.aptoide.pt.account.view.LoginDisplayable;
import cm.aptoide.pt.crashreports.CrashReport;
i... | __label__POS | 0.857901 |
// Format specifiers for std::format()
#include <iostream>
#include <format>
#include <numbers> // For the pi constant
#include <cmath> // For the square root function
int main()
{
// 2 square feet pond surface for every 6 inches of fish
const double fish_factor{ 2.0 / 0.5 }; // Area per unit length of... | __label__POS | 0.830263 |
// 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.
import std;
int main()
{
std::string word1, word2;
std::print("Enter the first w... | __label__POS | 0.848541 |
// 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.
import std;
int main()
{
std::string text; // The text to be searched
std::string word; // Stores the word to be replaced
std::pri... | __label__POS | 0.704623 |
package cm.aptoide.pt.store.view;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import cm.aptoide.analytics.AnalyticsManager;
import cm.aptoide.analytics.implementation.navigation.NavigationTrac... | __label__POS | 0.673801 |
// 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.915415 |
// Exercise 7-7
// Practice string concatenation, looping over strings, and stoi()-like functions
import std;
int main()
{
std::println("Enter a sequence of numbers terminated by #:");
// Read a long string containing any number of integers
std::string numbers;
std::getline(std::cin, numbers, '#');
long ... | __label__POS | 0.954652 |
package cm.aptoide.pt.store.view;
import android.os.Bundle;
import cm.aptoide.pt.dataprovider.interfaces.ErrorRequestListener;
import cm.aptoide.pt.dataprovider.model.v7.BaseV7EndlessResponse;
import cm.aptoide.pt.dataprovider.ws.v7.Endless;
import cm.aptoide.pt.dataprovider.ws.v7.V7;
import cm.aptoide.pt.view.recycle... | __label__POS | 0.790129 |
// Formatting text using std::format()
#include <iostream>
#include <format>
#include <numbers> // For the pi constant
#include <cmath> // For the square root function
int main()
{
// 2 square feet pond surface for every 6 inches of fish
const double fish_factor{ 2.0 / 0.5 }; // Area per unit length of... | __label__POS | 0.807782 |
// Exercise 7-1 Storing student names and grades.
// This uses a vector of string objects to store the names.
import std;
int main()
{
std::vector<std::string> names;
std::vector<double> grades;
std::size_t max_length {}; // Longest name length
double average_grade {}; // First accumulates the sum of... | __label__POS | 0.711622 |
package cm.aptoide.pt.store.view;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import cm.aptoide.analytics.AnalyticsManager;
import cm.aptoide.analytics.implementation.navigation.NavigationTracker;
import cm.aptoide.pt.dataprovider.model.v7.store.ListStores;
imp... | __label__POS | 0.897189 |
// Sizing a pond for happy fish
#include <iostream>
#include <numbers> // For the pi constant
#include <cmath> // For the square root function
int main()
{
// 2 square feet pond surface for every 6 inches of fish
const double fish_factor { 2.0/0.5 }; // Area per unit length of fish
const double inches_per... | __label__POS | 0.945655 |
// Exercise 9-4. Using std::optional<>
import std;
// Function prototypes
std::optional<double> largest(std::span<const double> data);
std::optional<int> largest(std::span<const int> data);
std::optional<std::string> largest(std::span<const std::string> words);
int main()
{
const double array[]{ 1.5, 44.6, 13.7, 21... | __label__POS | 0.746564 |
package cm.aptoide.pt.store.view;
import cm.aptoide.pt.R;
import cm.aptoide.pt.dataprovider.model.v7.Comment;
import cm.aptoide.pt.themes.ThemeManager;
import cm.aptoide.pt.view.recycler.displayable.Displayable;
import java.util.Collections;
import java.util.List;
public class StoreLatestCommentsDisplayable extends D... | __label__POS | 0.896624 |
// Calculating primes using pointer notation
#include <iostream>
#include <format>
int main()
{
const size_t max {100}; // Number of primes required
long primes[max] {2L}; // First prime defined
size_t count {1}; // Count of primes found so far
long trial {3L}; // Candidate prime
w... | __label__POS | 0.672391 |
// Dereferencing pointers
// Calculates the purchase price for a given quantity of items
#include <iostream>
#include <format>
int main()
{
int unit_price {295}; // Item unit price in cents
int count {}; // Number of items ordered
int discount_threshold {25}; // Quan... | __label__POS | 0.929428 |
// Using smart pointers
#include <iostream>
#include <format>
#include <memory> // For smart pointers
#include <vector> // For std::vector<> container
#include <cctype> // For std::toupper()
int main()
{
std::vector<std::shared_ptr<std::vector<double>>> records; // Temperature records by days
size_t day{ 1 }... | __label__POS | 0.931194 |
// 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.
import std;
int main()
... | __label__POS | 0.683061 |
// Generating multiplication tables using nested loops
#include <iostream>
#include <format>
#include <cctype>
int main()
{
size_t table {}; // Table size
const size_t table_min {2}; // Minimum table size - at least up to the 2-times
const size_t table_max {12}; // Maximum table size
char reply... | __label__POS | 0.871572 |
// Exercise 8-7 Computing Fibonacci numbers iteratively.
// On most systems (it depends on sizeof(unsigned long long)),
// you can correctly compute up to 93 Fibonacci numbers with this program.
import std;
unsigned long long fib(unsigned int n);
int main()
{
unsigned int num{};
std::print("Good day, master. How... | __label__POS | 0.737321 |
package cm.aptoide.pt.store.view;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.widget.AutoCompleteTextView;
/**
* Created by pedroribeiro on 26/01/17.
*/
public class StoreAutoCompleteTextView extends AutoCompleteTextView {
... | __label__POS | 0.994454 |
" Language: Colorful CSS Color Preview
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
" Commit: $Format:%H$
" Licence: The MIT License (MIT)
" W3C extended colors
syntax include syntax/colornames/basic.vim
hi BG00008b guibg=#00008B guifg=#FFFFFF ctermbg=18 ctermfg=15
hi BG0000cd guibg=#0000CD... | __label__POS | 0.952825 |
// 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'.
*******************************************************************/
import std;
st... | __label__POS | 0.951257 |
// Using a do-while loop to manage input
#include <iostream>
#include <cctype> // For tolower() function
int main()
{
char reply {}; // Stores response to prompt for input
int count {}; // Counts the number of inp... | __label__POS | 0.994588 |
package cm.aptoide.pt.store.view;
import cm.aptoide.analytics.implementation.navigation.NavigationTracker;
import cm.aptoide.pt.R;
import cm.aptoide.pt.dataprovider.model.v7.GetStoreWidgets;
import cm.aptoide.pt.dataprovider.ws.v7.store.StoreContext;
import cm.aptoide.pt.view.recycler.displayable.Displayable;
public ... | __label__POS | 0.751641 |
// Exercise 8-1 Reading and validating a date of birth.
// As always, there are many ways of doing this!
import std;
int validate_input(int lower, int upper, const std::string& description);
int year();
int month();
int day(int month_value, int year_value);
std::string ending(int date_day);
int main()
{
std::prin... | __label__POS | 0.629026 |
package cm.aptoide.pt.store.view;
import androidx.fragment.app.Fragment;
import cm.aptoide.pt.dataprovider.model.v7.Event;
import cm.aptoide.pt.dataprovider.model.v7.store.GetStore;
import cm.aptoide.pt.view.recycler.displayable.Displayable;
import java.util.List;
import rx.Observable;
import rx.schedulers.Schedulers;... | __label__POS | 0.999548 |
// Classifying the letters in a C-style string
#include <iostream>
#include <cctype>
int main()
{
const int max_length {100}; // Array size
char text[max_length] {}; // Array to hold input string
std::cout << "Enter a line of text:" << std::endl;
// Read a line of characters including spaces
std::cin... | __label__POS | 0.82813 |
// Removing all elements that satisfy a certain condition
// while iterating over a container
#include <vector>
#include <string_view>
#include <iostream>
#include <algorithm> // for std::remove_if()
#include <numeric> // for std::iota()
std::vector<int> fillVector_1_to_N(size_t N); // Fill a vector with ... | __label__POS | 0.788055 |
// 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 ~.
import std;
// See Appendix A (availa... | __label__POS | 0.780293 |
module words;
import std;
size_t max_word_length(const words::Words& words);
void words::extract_words(Words& words, const std::string& text, const std::string& separators)
{
std::size_t start {text.find_first_not_of(separators)}; // Start index of first word
while (start != std::string::npos)
{
std::size... | __label__POS | 0.765835 |
#include <iostream>
#include <format>
#include <string>
#include <vector>
int main()
{
std::string text; // The string to be searched
std::cout << "Enter some text terminated by *:\n";
std::getline(std::cin, text, '*');
const std::string separators{ " ,;:.\"!?'\n" }; ... | __label__POS | 0.896162 |
module words.utils;
import std;
std::size_t max_word_length(const words::Words& words)
{
std::size_t max{};
for (auto& pword : words)
if (max < pword->length()) max = pword->length();
return max;
}
void words::utils::extract_words(Words& words, const std::string& text, const std::string& separators)
{
st... | __label__POS | 0.807791 |
module words.sorting;
/* Additional helpers for word::sort(Words&) */
void swap(words::Words& words, std::size_t first, std::size_t second)
{
auto temp{ words[first] };
words[first] = words[second];
words[second] = temp;
}
void sort(words::Words& words, std::size_t start, std::size_t end);
// Sort strings in a... | __label__POS | 0.792401 |
package com.bsg6.chapter08;
import org.springframework.lang.NonNull;
import java.util.Objects;
import java.util.StringJoiner;
public class Artist {
Integer id;
@NonNull
String name;
public Artist() {}
public Artist(@NonNull String name) {
this.name=name;
}
public Artist(Integer... | __label__POS | 0.867825 |
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 |
// Using std::span<const T> to ensure largest() works for const inputs
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <span>
// Old function prototypes
//double largest(const double data[], size_t count);
//double largest(const std::vector<double>& data);
//int largest(const std::vec... | __label__POS | 0.710697 |
package cm.aptoide.pt.store.view;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import cm.aptoide.pt.dataprovider.model.v7.GetStoreWidgets;
import cm.aptoide.pt.dataprovider.ws.v7.Endless;
import cm.aptoide.pt.dataprovider.ws.v7.V7;
import cm.aptoide.pt.view.recy... | __label__POS | 0.976098 |
// Exercise 19-2
// Replace a custim stack container by the standard stack container adapter
#include <stack>
#include <iostream>
#include <string>
#include <array> // for std::size()
int main()
{
std::string words[] {"The", "quick", "brown", "fox", "jumps"};
std::stack<std::string> wordStack; ... | __label__POS | 0.992224 |
// Using std::string_view parameters
#include <iostream>
#include <format>
#include <string>
#include <string_view>
#include <vector>
using std::string;
using std::string_view;
using std::vector;
void find_words(vector<string>& words, string_view str, string_view separators);
void list_words(const vector<string>& wor... | __label__POS | 0.747624 |
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 |
export module words;
import std;
export namespace words
{
using Words = std::vector<std::shared_ptr<std::string>>;
void sort(Words& words);
void extract_words(Words& words, const std::string& text, const std::string& separators);
void print_words(const Words& words);
}
namespace words
{
std::size_t max_wo... | __label__POS | 0.682206 |
// Exercise 19-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::... | __label__POS | 0.993989 |
package cm.aptoide.pt.store.view;
import cm.aptoide.pt.R;
import cm.aptoide.pt.themes.StoreTheme;
import cm.aptoide.pt.view.recycler.displayable.Displayable;
public class StoreAddCommentDisplayable extends Displayable {
private final long storeId;
private final String storeName;
private final StoreTheme storeT... | __label__POS | 0.977812 |
module words;
import std;
size_t max_word_length(const words::Words& words);
void words::extract_words(Words& words, const std::string& text, const std::string& separators)
{
std::size_t start {text.find_first_not_of(separators)}; // Start index of first word
while (start != std::string::npos)
{
std::size... | __label__POS | 0.765835 |
module words;
import std;
import :internals;
void words::extract_words(Words& words, const std::string& text, const std::string& separators)
{
std::size_t start {text.find_first_not_of(separators)}; // Start index of first word
while (start != std::string::npos)
{
std::size_t end{ text.find_first_of(separa... | __label__POS | 0.778781 |
// Animal class and classes derived from Animal
export module animals;
import std;
export class Animal
{
public:
Animal(std::string_view name, int weight) // Constructor
: m_name{ name }, m_weight{ weight }
{}
protected:
void who() const // Display name and weight
{
std::println... | __label__POS | 0.821548 |
// Using a reference parameter
#include <iostream>
#include <format>
#include <string>
#include <vector>
using std::string;
using std::vector;
void find_words(vector<string>& words, const string& str, const string& separators);
void list_words(const vector<string>& words);
int main()
{
std::string text; //... | __label__POS | 0.741101 |
// Overloading a function
#include <iostream>
#include <string>
#include <vector>
// Function prototypes
double largest(const double data[], size_t count);
double largest(const std::vector<double>& data);
int largest(const std::vector<int>& data);
std::string largest(const std::vector<std::string>& words);
// int larg... | __label__POS | 0.826195 |
package cm.aptoide.pt.store.view.ads;
import android.content.Context;
import android.os.Bundle;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import cm.aptoide.pt.AptoideApplication;
import cm.aptoide.pt.ads.AdsRepository;
import cm.aptoide.pt.ads.Minima... | __label__POS | 0.908263 |
package cm.aptoide.pt.store.view.top;
import cm.aptoide.analytics.implementation.navigation.NavigationTracker;
import cm.aptoide.pt.R;
import cm.aptoide.pt.dataprovider.model.v7.listapp.App;
import cm.aptoide.pt.dataprovider.ws.v7.store.StoreContext;
import cm.aptoide.pt.view.recycler.displayable.DisplayablePojo;
pub... | __label__POS | 0.865235 |
#===================================================================================================
# SplitTextInCommas
#===================================================================================================
def SplitTextInCommas(txt):
'''
Splits the text in the commas, considering it's python co... | __label__POS | 0.834631 |
// Exercise 13-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 Pothe... | __label__POS | 0.989179 |
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 |
package cm.aptoide.pt.store.view.my;
import android.content.Context;
import cm.aptoide.pt.R;
import cm.aptoide.pt.dataprovider.model.v7.store.Store;
import cm.aptoide.pt.dataprovider.ws.v7.store.StoreContext;
import cm.aptoide.pt.view.recycler.displayable.Displayable;
import java.util.Calendar;
import java.util.Date;
... | __label__POS | 0.915372 |
package cm.aptoide.pt.store.view.my;
import cm.aptoide.pt.bottomNavigation.BottomNavigationItem;
import cm.aptoide.pt.bottomNavigation.BottomNavigationMapper;
import cm.aptoide.pt.home.AptoideBottomNavigator;
import cm.aptoide.pt.navigator.FragmentNavigator;
import cm.aptoide.pt.view.settings.MyAccountFragment;
import... | __label__POS | 0.981263 |
// Exercise 20-3 Replacing custom container types with standard ones
/*
The following replacements were made compared to Soln17_06.cpp:
- LinkedList<T> --> std::vector<T> (not std::list<>, because vector<> should
be your go-to container; there's rarely a good reason to use linked lists)
- SparseArray<T> --> std... | __label__POS | 0.645039 |
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 20-5 Create a generic average() algorithm using std::accumulate()
import std;
// Solution 1: simply use accumulate to sum, and determine the count using std::distance()
// (the latter is more general than using iterator arithmetic, end - begin,
// which only works for random-access iterators)
template <t... | __label__POS | 0.983178 |
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 cm.aptoide.pt.store.view.recommended;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import cm.aptoide.accountmanager.AptoideAccountManager;
import cm.aptoide.pt.AptoideApplication;
import cm.aptoide.pt.dataprovider.model.v7.store.ListStores;
import cm.apt... | __label__POS | 0.731941 |
// Exercise 20-2
// Replace a custom stack container by the standard stack container adapter
import std;
/*
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
*/
int main()
{
std::string words[]{ "The... | __label__POS | 0.992277 |
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 |
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 cm.aptoide.pt.updates.view.excluded;
import android.view.View;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;
import cm.aptoide.pt.R;
import cm.aptoide.pt.database.room.RoomUpdate;
import cm.aptoide.pt.networking.image.ImageLoader;
import cm.aptoide.pt.view.rec... | __label__POS | 0.604751 |
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 15-1 Animals.cppm
// Animal classes
export module animals;
import std;
export class Animal
{
public:
Animal(std::string_view name, unsigned weight);// Constructor
virtual ~Animal() = default; // Very important: a virtual destructor!
virtual std::string who() const; /... | __label__POS | 0.737749 |
try{
(()=>{var $=__STORYBOOK_API__,{ActiveTabs:Z,Consumer:j,ManagerContext:J,Provider:Q,RequestResponseError:X,addons:i,combineParameters:oo,controlOrMetaKey:eo,controlOrMetaSymbol:no,eventMatchesShortcut:to,eventToShortcut:co,experimental_MockUniversalStore:ro,experimental_UniversalStore:ao,experimental_getStatusStore... | __label__POS | 0.975586 |
package cm.aptoide.pt.app.view;
import cm.aptoide.pt.home.bundles.BundlesRepository;
import cm.aptoide.pt.home.bundles.HomeBundlesModel;
import rx.Single;
/**
* Created by D01 on 05/06/2018.
*/
public class MoreBundleManager {
private final BundlesRepository bundlesRepository;
public MoreBundleManager(Bundle... | __label__POS | 0.988191 |
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 |
try{
(()=>{var T=__STORYBOOK_API__,{ActiveTabs:v,Consumer:E,ManagerContext:O,Provider:y,RequestResponseError:A,addons:a,combineParameters:P,controlOrMetaKey:h,controlOrMetaSymbol:x,eventMatchesShortcut:R,eventToShortcut:b,experimental_MockUniversalStore:g,experimental_UniversalStore:k,experimental_getStatusStore:I,expe... | __label__POS | 0.998015 |
// Constraint based specialization
#include <concepts> // For the std::equality_comparable<> concept
#include <iterator> // The iterator concepts and the iter_difference_t<>() trait
#include <vector>
#include <list>
#include <iostream>
// Precondition: incrementing first eventually leads to last
template <std::input... | __label__POS | 0.969252 |
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 cm.aptoide.pt.app.view;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import cm.aptoide.pt.app.AppReview;
/**
* Created by franciscocalado on 10/05/18.
*/
public class TopReviewsAdapter extends RecyclerView.Adapter<MiniTopReviewViewHold... | __label__POS | 0.989114 |
// Copyright (c) Corporation for National Research Initiatives
package org.python.core;
import java.util.Stack;
public class ThreadState {
// public InterpreterState interp;
public PySystemState systemState;
public PyFrame frame;
// public PyObject curexc_type, curexc_value, curexc_traceback;
//... | __label__POS | 0.931822 |
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 |
try{
(()=>{var N=__STORYBOOK_API__,{ActiveTabs:G,Consumer:W,ManagerContext:K,Provider:Y,RequestResponseError:V,addons:s,combineParameters:q,controlOrMetaKey:z,controlOrMetaSymbol:Z,eventMatchesShortcut:j,eventToShortcut:J,experimental_MockUniversalStore:Q,experimental_UniversalStore:X,experimental_getStatusStore:$,expe... | __label__POS | 0.969037 |
// Creating and working with Standard iterators
#include <vector>
#include <iostream>
int main()
{
std::vector<char> letters{ 'a', 'b', 'c', 'd', 'e' };
auto my_iter{ letters.begin() };
std::cout << *my_iter << std::endl; // a
*my_iter = 'x';
std::cout << letters[0] << std::endl; // x
++my_ite... | __label__POS | 0.972516 |
package org.python.core;
import java.io.*;
import java.util.zip.*;
public class SyspathArchive extends PyString {
private ZipFile zipFile;
public SyspathArchive(String archiveName) throws IOException {
super(archiveName);
archiveName = getArchiveName(archiveName);
if (archiveName == n... | __label__POS | 0.758992 |
package cm.aptoide.pt.app.view;
import android.util.Pair;
import cm.aptoide.pt.R;
import cm.aptoide.pt.dataprovider.model.v7.GetAppMeta;
import cm.aptoide.pt.view.recycler.displayable.Displayable;
public class OfficialAppDisplayable extends Displayable {
private final Pair<String, GetAppMeta> messageGetApp;
pri... | __label__POS | 0.94413 |
package cm.aptoide.pt.app.view;
import cm.aptoide.pt.app.AppCoinsAdvertisingModel;
import cm.aptoide.pt.bonus.BonusAppcModel;
public class AppCoinsViewModel {
private final boolean loading;
private final boolean hasBilling;
private final AppCoinsAdvertisingModel advertisingModel;
private final BonusAppcModel ... | __label__POS | 0.991262 |
// Removing all elements that satisfy a certain condition
// while iterating over a container
#include <vector>
#include <string_view>
#include <iostream>
std::vector<int> fillVector_1toN(size_t N); // Fill a vector with 1, 2, ..., N
void printVector(std::string_view message, const std::vector<int>& numbers);
void ... | __label__POS | 0.955347 |
package org.python.core;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/**
* Helper class handling the VM specific java package detection.
*/
public class JavaImportHelper {
private static final String DOT = ".";
/**
* Tr... | __label__POS | 0.881297 |
// Removing all elements that satisfy a certain condition
// usign the remove-erase idiom and the range-based version of std::remove_if.
// Unlike the iterator-based version, std::ranges::erase_if() returns a subrange,
// and not an iterator.
// Note also that in this case std::erase_if() is even more compact (see E... | __label__POS | 0.742526 |
package cm.aptoide.pt.app.view;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import cm.aptoide.pt.R;
import cm.aptoide.pt.app.AppViewSimilarApp;
import cm.aptoide.pt.app.view.similar.SimilarAppClickEvent;
import java.text.DecimalFormat;
import jav... | __label__POS | 0.698052 |
// Inserting in and erasing from sequence containers
#include <iostream>
#include <vector>
void printVector(const std::vector<int>& v);
int main()
{
std::vector numbers{ 2, 4, 5 }; // Deduced type: std::vector<int>
numbers.insert(numbers.begin(), 1); // Add single element to the beginning of the sequence
pr... | __label__POS | 0.96807 |
/*****************************************************************\
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.957528 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.