content
stringlengths
263
5.24M
pred_label
stringclasses
1 value
pred_score_pos
float64
0.6
1
// Using a reference parameter #include <iostream> #include <iomanip> #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() { string text; ...
__label__POS
0.729226
package cm.aptoide.pt.account; import android.accounts.Account; import android.accounts.AccountManager; import android.os.Build; import rx.Completable; import rx.Scheduler; import rx.Single; public class AndroidAccountProvider { private final AccountManager androidAccountManager; private final String accountType...
__label__POS
0.920784
// Program 14.1 Classifying wide characters #define __STDC_WANT_LIB_EXT1__ 1 #include <stdio.h> #include <wchar.h> #include <wctype.h> int main(void) { wchar_t ch = 0; // Stores a character fwprintf_s(stdout, L"Enter a character: "); fwscanf_s(stdin, L" %lc", &ch, sizeof(ch)...
__label__POS
0.890428
// Overloading a function #include <iostream> #include <string> #include <vector> using std::string; using std::vector; // Function prototypes double largest(const double data[], size_t count); double largest(const vector<double>& data); int largest(const vector<int>& data); string largest(const vector<string>& word...
__label__POS
0.78055
package cm.aptoide.pt.account; import cm.aptoide.analytics.AnalyticsManager; import cm.aptoide.analytics.implementation.navigation.NavigationTracker; import java.util.HashMap; import java.util.Map; public class AdultContentAnalytics { public static final String ADULT_CONTENT = "Adult Content"; public static final...
__label__POS
0.999344
package cm.aptoide.pt.account; import cm.aptoide.accountmanager.Account; import cm.aptoide.accountmanager.AccountPersistence; import cm.aptoide.accountmanager.AdultContent; import rx.Completable; import rx.Single; public class MatureContentPersistence implements AccountPersistence { private final AccountPersistence...
__label__POS
0.884385
package cm.aptoide.pt.reactions; import cm.aptoide.pt.reactions.network.LoadReactionModel; import cm.aptoide.pt.reactions.network.ReactionsResponse; import cm.aptoide.pt.reactions.network.ReactionsService; import java.util.HashMap; import rx.Single; public class ReactionsManager { private final ReactionsService re...
__label__POS
0.884687
// Program 13.1 Debugging using preprocessing directives #define __STDC_WANT_LIB_EXT1__ 1 #include <stdio.h> #include <stdlib.h> #include <time.h> // Macro to generate pseudo-random number from 0 to NumValues */ #define random(NumValues) ((int)(((double)(rand())*(NumValues))/(RAND_MAX + 1.0))) #define iterations 6 #d...
__label__POS
0.851222
// Requesting the compiler to generate a default constructor #include <iostream> // Class to represent a box class Box { private: double length {1.0}; double width {1.0}; double height {1.0}; public: // Default constructor Box() = default; // Constructor Box(double lengthValue, double widthValue, dou...
__label__POS
0.695379
#include "Truckload.h" // Constructor Truckload::Truckload(const std::vector<SharedBox>& boxes) { for (auto pBox : boxes) { addBox(pBox); } } // Copy constructor Truckload::Truckload(const Truckload& src) { for (Package* package{src.pHead}; package; package = package->pNext) { addBox(package->pBox);...
__label__POS
0.701946
/* * Copyright (c) 2016. * Modified on 02/09/2016. */ package cm.aptoide.pt.file; import cm.aptoide.pt.downloadmanager.CacheManager; import cm.aptoide.pt.logger.Logger; import cm.aptoide.pt.utils.AptoideUtils; import cm.aptoide.pt.utils.FileUtils; import java.io.File; import java.util.List; import rx.Observable; i...
__label__POS
0.918551
package cm.aptoide.pt.file; import cm.aptoide.pt.dataprovider.cache.L2Cache; import cm.aptoide.pt.downloadmanager.AptoideDownloadManager; import cm.aptoide.pt.utils.FileUtils; import rx.Observable; import rx.Single; /** * Created by trinkes on 11/16/16. */ public class FileManager { private final CacheHelper ca...
__label__POS
0.96364
// Program 9.1 Pointing to functions #include <stdio.h> // Function prototypes int sum(int, int); int product(int, int); int difference(int, int); int main(void) { int a = 10; // Initial value for a int b = 5; // Initial value for b int result = 0; ...
__label__POS
0.990675
package cm.aptoide.pt.analytics; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.os.Bundle; import cm.aptoide.analytics.AnalyticsLogger; import cm.aptoide.analytics.AnalyticsManager; import cm.aptoide.pt.GmsStatusValueProvider; import cm.aptoide.pt.logger.Logger; impo...
__label__POS
0.686117
// Program 9.3 Passing a Pointer to a function #include <stdio.h> // Function prototypes int sum(int,int); int product(int,int); int difference(int,int); int any_function(int(*pfun)(int, int), int x, int y); int main(void) { int a = 10; // Initial value for a int b = 5; ...
__label__POS
0.999887
package cm.aptoide.pt.analytics; import cm.aptoide.analytics.implementation.tracking.Tracking; import cm.aptoide.analytics.implementation.tracking.UTM; import cm.aptoide.pt.dataprovider.ws.v7.BiUtmAnalyticsRequestBody; /** * Created by pedroribeiro on 29/06/17. */ public class UTMTrackingBuilder { private final...
__label__POS
0.999149
// Program 9.2 Arrays of Pointers to functions #include <stdio.h> // Function prototypes int sum(int, int); int product(int, int); int difference(int, int); int main(void) { int a = 10; // Initial value for a int b = 5; // Initial value for b int result = 0; ...
__label__POS
0.998008
package org.python.pydev.shared_core.structure; import java.util.Arrays; import org.python.pydev.shared_core.log.Log; /** * This is a low-memory/optimized map from Strings to ints (note that it may be slow for larger collections * -- not recommended for more than 8 items, ideally the usual case is 1-3 items). * ...
__label__POS
0.897391
#include "Truckload.h" // Constructor Truckload::Truckload(const std::vector<SharedBox>& boxes) { for (const auto& pBox : boxes) { addBox(pBox); } } // Copy constructor Truckload::Truckload(const Truckload& src) { for (Package* package{src.pHead}; package; package = package->getNext()) { addBox(pack...
__label__POS
0.729514
package cm.aptoide.pt.analytics; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; /** * Created by jdandrade on 01/08/16. */ public class UTMTrackingFileParser { private BufferedReader bufferedReader; private String utm_line; public UTM...
__label__POS
0.996152
/* Example 9.6a Recursion example A checkboard unsorted where a fly must visit each cell, but cannot pass through two identical cells. Start and Finish are wildcards */ #include <stdio.h> #include <math.h> #define SIZE 5 // board's size #define MAX_BRANCH 8 // 8 = possible branches bool used[SIZE * ...
__label__POS
0.814521
// Program 9.9 REVERSI An Othello type game #define __STDC_WANT_LIB_EXT1__ 1 #include <stdio.h> #include <ctype.h> #include <string.h> #define SIZE 6 // Board size - must be even const char comp_c = '@'; // Computer's counter const char player_c = 'O'; // Player's c...
__label__POS
0.621343
/** * Copyright (c) 2005-2013 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Eclipse Public License (EPL). * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ package org.python.pydev.shared...
__label__POS
0.69083
package cm.aptoide.pt.bottomNavigation; import cm.aptoide.analytics.AnalyticsManager; import cm.aptoide.analytics.implementation.navigation.NavigationTracker; import java.util.HashMap; import java.util.Map; /** * Created by franciscocalado on 27/03/18. */ public class BottomNavigationAnalytics { public static fi...
__label__POS
0.990219
// Calling the base class version of a virtual function (see ToughPack.h) #include <iostream> #include <memory> // For smart pointers #include <vector> // For vector #include "Box.h" // For the Box class #include "ToughPack.h"...
__label__POS
0.927908
/** * Copyright (c) 2005-2013 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Eclipse Public License (EPL). * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ package org.python.pydev.shared...
__label__POS
0.784332
// Polymorphic vectors of smart pointers #include <iostream> #include <memory> // For smart pointers #include <vector> // For vector #include "Box.h" // For the Box class #include "ToughPack.h" // For...
__label__POS
0.946741
// Polymorphic vectors of smart pointers #include <iostream> #include <memory> // For smart pointers #include <vector> // For vector #include "Box.h" // For the Box class #include "ToughPack.h" // For...
__label__POS
0.946741
/****************************************************************************** * Copyright (C) 2013 Fabio Zadrozny * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * h...
__label__POS
0.830483
// Throwing exceptions in nested try blocks #include <iostream> void throwIt(int i) { throw i; // Throws the parameter value } int main() { for (int i {}; i <= 5; ++i) { try { std::cout << "outer try:\n"; if (i == 0) throw i; // Throw...
__label__POS
0.966102
// Exercise 8.2 A function to return a string representation of an integer #include <stdio.h> #include <stdbool.h> #define STR_LEN 6 // Length of string to store value string // Converts an integer to a string. Caller must allocate string array. // Function returns the string to all...
__label__POS
0.983366
// Exercise 8.3 A function to return a string representation of an integer with a given width #include <stdio.h> #include <stdbool.h> #define STR_LEN 15 // Length of string to store value string // Convert an integer to a string with a fixed width. // if the widh is too small, the minimu...
__label__POS
0.973894
// Exercise 8.4 A function to return the number of words in a string passed as an argument */ #include <stdio.h> #include <stdlib.h> #include <ctype.h> #define LENGTH_INCREMENT 20 #define MAX_WORD_LENGTH 30 int countwords(char str[]); // Function to count words in a string int se...
__label__POS
0.931418
// Exercise 8.1 A function to calculate an average #define __STDC_WANT_LIB_EXT1__ 1 #include <stdio.h> #include <stdlib.h> #include <ctype.h> #define CAPACITY_INCREMENT 6 // Increment in the capacity for data values double average(double data[], int count) { double sum = 0.0; for(int i = 0 ; i...
__label__POS
0.609348
#include "Truckload.h" // Constructor Truckload::Truckload(const std::vector<SharedBox>& boxes) { for (auto pBox : boxes) { addBox(pBox); } } // Get the first Box SharedBox Truckload::Iterator::getFirstBox() { // Return pHead's box (or nullptr if the list is empty) pCurrent = pHead; return pCurrent? p...
__label__POS
0.787798
// Ex4.5 A Modified Guessing Game #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <time.h> // For time() function #include <ctype.h> // I added this for toupper() #include <stdbool.h> // I added...
__label__POS
0.718426
#include "Truckload.h" SharedBox Truckload::nullBox {}; // Initialize static class member // Constructor Truckload::Truckload(const std::vector<SharedBox>& boxes) { for (const auto& pBox : boxes) { addBox(pBox); } } // Copy constructor Truckload::Truckload(const Truckload& src) { for (P...
__label__POS
0.803466
/****************************************************************************** * Copyright (C) 2013 Fabio Zadrozny * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * h...
__label__POS
0.864066
package cm.aptoide.pt.view; import cm.aptoide.pt.app.view.AppViewFragment.OpenType; import cm.aptoide.pt.search.model.SearchAdResult; /** * Created by D01 on 17/05/2018. */ public class AppViewConfiguration { private final long appId; private final String packageName; private final String storeName; priva...
__label__POS
0.923353
package cm.aptoide.pt.view; import android.os.Bundle; import cm.aptoide.aptoideviews.socialmedia.SocialMediaView; import cm.aptoide.pt.CatappultNavigator; import cm.aptoide.pt.app.view.AppViewFragment; import cm.aptoide.pt.dataprovider.model.v7.Event; import cm.aptoide.pt.dataprovider.ws.v7.store.StoreContext; import ...
__label__POS
0.692243
package org.python.pydev.shared_core.string; /******************************************************************************* * Copyright (c) 2000, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v...
__label__POS
0.960018
// Exercise 11.4 Using a structure to record the count of occurrences of a word. /* This program defines a structure that stores a word and the count of its occurrences. The structures are stored as they are created in a linked list. If you wanted the output in alphabetical order, you could insert the structures ...
__label__POS
0.687592
/****************************************************************************** * Copyright (C) 2012-2013 Fabio Zadrozny and others * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is ...
__label__POS
0.990794
// Using the templates for overloaded comparison operators for Box ojects #include <iostream> #include <string_view> #include <vector> #include <utility> // For the std::rel_ops utility function templates #include "Box.h" using namespace std::rel_ops; void show(const Box& box1, std::string_view relationship, cons...
__label__POS
0.723609
// Exercise 11.5 Sorting names using a binary tree #define __STDC_WANT_LIB_EXT1__ 1 #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #define FIRST_MAX 30 #define SECOND_MAX 50 // Defines a name typedef struct Name { char first[FIRST_MAX]; char second[SECOND_MAX]; } Name; // Defines...
__label__POS
0.832491
/** * Copyright (c) 2005-2013 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Eclipse Public License (EPL). * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ package org.python.pydev.shared...
__label__POS
0.955504
package cm.aptoide.pt.view; import androidx.fragment.app.Fragment; import cm.aptoide.pt.app.view.AppViewFragment; import cm.aptoide.pt.dataprovider.model.v7.Event; import cm.aptoide.pt.dataprovider.ws.v7.store.StoreContext; import cm.aptoide.pt.search.model.SearchAdResult; import cm.aptoide.pt.store.view.StoreFragment...
__label__POS
0.90003
// Exercise 6.1 Convert an integer to words #define _CRT_SECURE_NO_WARNINGS #define __STDC_WANT_LIB_EXT1__ 1 #include <stdio.h> #include <string.h> int main(void) { char *unit_words[] = {"zero", "one","two","three","four","five","six","seven","eight","nine"}; char *teen_words[] = {"ten", "eleven","twelve","thirtee...
__label__POS
0.773918
/** * Copyright (c) 2005-2013 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Eclipse Public License (EPL). * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ package org.python.pydev.shared...
__label__POS
0.752519
package cm.aptoide.pt.view; import android.os.Bundle; import androidx.annotation.Nullable; import cm.aptoide.pt.AptoideApplication; import cm.aptoide.pt.BuildConfig; import cm.aptoide.pt.FlavourActivityModule; import cm.aptoide.pt.presenter.View; import com.trello.rxlifecycle.components.support.RxAppCompatActivity; p...
__label__POS
0.822895
// Using a stack defined by nested class templates #include "Stack.h" #include <iostream> #include <string> #include <array> // for std::size() int main() { std::string words[] {"The", "quick", "brown", "fox", "jumps"}; Stack<std::string> wordStack; // A stack of strings for (size_t i {...
__label__POS
0.998158
package cm.aptoide.pt.permission; import androidx.annotation.IntRange; import androidx.annotation.NonNull; import java.util.List; import rx.Observable; public interface PermissionProvider { void providePermissions(final @NonNull String[] permissions, final @IntRange(from = 0) int requestCode); Observable<...
__label__POS
0.995909
// Stack.h Templates to define stacks #ifndef STACK_H #define STACK_H #include <stdexcept> template <typename T> class Stack { private: // Nested class class Node { public: T item {}; // The object stored in this node Node* next {}; ...
__label__POS
0.651006
// Exercise 7.4 Read and process daily temperatures #define __STDC_WANT_LIB_EXT1__ 1 #include <stdio.h> #include <stdlib.h> #include <ctype.h> #define DAYS 2 // Initial number of days allowed for #define READINGS_PER_DAY 6 // Readings per day ...
__label__POS
0.694428
package cm.aptoide.pt.permission; import android.content.pm.PackageManager; import android.os.Bundle; import android.util.SparseArray; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.app.ActivityCompat; import com.jakewharton.rxrelay.PublishRelay; import java.util.ArrayLis...
__label__POS
0.889115
/****************************************************************************** * Copyright (C) 2013 Fabio Zadrozny * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * h...
__label__POS
0.735044
package cm.aptoide.pt.share; import android.content.Context; import android.graphics.drawable.Drawable; import androidx.appcompat.app.AlertDialog; import cm.aptoide.pt.R; import cm.aptoide.pt.networking.image.ImageLoader; import com.bumptech.glide.request.target.SimpleTarget; import com.bumptech.glide.request.transiti...
__label__POS
0.681818
// Using a stack defined by nested class templates #include "Stack.h" #include <iostream> #include <string> #include <array> // for std::size() int main() { std::string words[] {"The", "quick", "brown", "fox", "jumps"}; Stack<std::string> wordStack; // A stack of strings for (size_t i {...
__label__POS
0.998158
//Exercise 5.5 Calculating average student grades. #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdbool.h> #include <ctype.h> int main(void) { size_t nclasses = 0; // Number classes size_t nstudents_max = 0; // Maximum number of students in a class char answer = 'N'; ...
__label__POS
0.991159
//Exercise 5.1 Summing reciprocals of five values #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main(void) { const int nValues = 5; // Number of data values double data[nValues]; // Stores data values double reciprocals[nValues]; double sum = 0.0; // Sto...
__label__POS
0.785953
// Format specifiers for std::format() import <iostream>; import <format>; import <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 fi...
__label__POS
0.658962
package cm.aptoide.pt.reviews; import android.view.View; import android.widget.ProgressBar; import android.widget.TextView; import cm.aptoide.pt.R; import cm.aptoide.pt.dataprovider.model.v7.GetAppMeta; import cm.aptoide.pt.utils.AptoideUtils; public class RatingBarsLayout { private ProgressAndTextLayout[] progres...
__label__POS
0.920744
package cm.aptoide.pt.reviews; import android.widget.Spinner; import cm.aptoide.pt.R; import cm.aptoide.pt.view.recycler.displayable.Displayable; /** * Created by neuro on 04-09-2017. */ public class ReviewsLanguageFilterDisplayable extends Displayable { private LanguageFilterSpinnerHelper.OnItemSelected onItem...
__label__POS
0.996149
// Using the std::function<> template #include <iostream> #include <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::functi...
__label__POS
0.846985
package cm.aptoide.pt.reviews; import android.content.res.Resources; import androidx.annotation.StringRes; import cm.aptoide.pt.R; import cm.aptoide.pt.utils.AptoideUtils; import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; import java.util.List; /** * Created by neuro on 28-08-2017. ...
__label__POS
0.924648
// Formatting text using std::format() import <iostream>; import <format>; import <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 fi...
__label__POS
0.623826
// Sizing a pond for happy fish import <iostream>; import <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_f...
__label__POS
0.872637
// Inserting in and erasing from sequence containers #include <iostream> #include <vector> void printVector(const std::vector<int>& v); int main() { std::vector<int> numbers{ 2, 4, 5 }; numbers.insert(numbers.begin(), 1); // Add single element to the beginning of the sequence printVector(numbers); ...
__label__POS
0.981123
// Working with maps #include <iostream> #include <iomanip> #include <map> #include <string> #include <string_view> #include <vector> // Type aliases using Words = std::vector<std::string_view>; using WordCounts = std::map<std::string, size_t>; // Function prototypes Words extract_words(std::string_view text, std::st...
__label__POS
0.624684
// Removing all elements that satisfy a certain condition // usign the remove-erase idiom #include <vector> #include <string_view> #include <iostream> #include <algorithm> std::vector<int> fillVector_1_to_N(size_t N); // Fill a vector with 1, 2, ..., N void printVector(std::string_view message, const std::vecto...
__label__POS
0.835796
// Dereferencing pointers // Calculates the purchase price for a given quantity of items import <iostream>; import <format>; int main() { int unit_price {295}; // Item unit price in cents int count {}; // Number of items ordered int discount_threshold {25}; // Quanti...
__label__POS
0.853323
// Using smart pointers import <iostream>; import <format>; import <memory>; // For smart pointers import <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.791074
"""Redo the `...` (representation) but with limits on most sizes.""" __all__ = ["Repr","repr"] class Repr: def __init__(self): self.maxlevel = 6 self.maxtuple = 6 self.maxlist = 6 self.maxdict = 4 self.maxstring = 30 self.maxlong = 40 self.maxother = 20 ...
__label__POS
0.791
package cm.aptoide.pt.home; public class HomePromotionsWrapper { private final String title; private final String featureGraphic; private final boolean hasPromotions; private final int promotions; private final float totalUnclaimedAppcValue; private final boolean showDialog; private final String descrip...
__label__POS
0.835671
package cm.aptoide.pt.home; import android.view.View; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearSnapHelper; import androidx.recyclerview.widget.OrientationHelper; import androidx.recyclervi...
__label__POS
0.988926
// Removing all elements that satisfy a certain condition // while iterating over a container #include <vector> #include <string_view> #include <iostream> std::vector<int> fillVector_1_to_N(size_t N); // Fill a vector with 1, 2, ..., N void printVector(std::string_view message, const std::vector<int>& numbers);...
__label__POS
0.888004
// Sizing a pond for happy fish import std; 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_foot { 12.0 }; double fish_count {}; // Number of fish double fish_length {}; ...
__label__POS
0.718215
// Generating multiplication tables using nested loops import <iostream>; import <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.79309
package cm.aptoide.pt.home; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import cm.aptoide.pt.R; import java.text.DecimalFormat; public class AppSecondaryInfoViewHolder { private final DecimalFormat oneDecimalFormatter; private final LinearLayout appcLayout; priv...
__label__POS
0.762953
package cm.aptoide.pt.home; import cm.aptoide.analytics.AnalyticsManager; import cm.aptoide.analytics.implementation.navigation.NavigationTracker; import cm.aptoide.pt.ads.data.ApplicationAd; import cm.aptoide.pt.home.bundles.base.HomeEvent; import java.util.HashMap; import java.util.Map; import static cm.aptoide.ana...
__label__POS
0.762985
// Using a do-while loop to manage input import <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.983458
// Dereferencing pointers // Calculates the purchase price for a given quantity of items import std; int main() { int unit_price {295}; // Item unit price in cents int count {}; // Number of items ordered int discount_threshold {25}; // Quantity threshold for discoun...
__label__POS
0.816218
// Classifying the letters in a C-style string import <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.627856
// Using smart pointers import std; int main() { std::vector<std::shared_ptr<std::vector<double>>> records; // Temperature records by days for (int day{ 1 };; ++day) // Collect temperatures by day { // Vector to store current day's temperatures created in the free store auto day_records{ std::make...
__label__POS
0.872142
// Generating multiplication tables using nested loops import std; int main() { int table {}; // Table size const int table_min {2}; // Minimum table size - at least up to the 2-times const int table_max {12}; // Maximum table size char reply {}; // Response to prompt do { std:...
__label__POS
0.956235
package cm.aptoide.pt.blacklist; public class BlacklistManager { private BlacklistUnitMapper blacklistUnitMapper; private Blacklister blacklister; public BlacklistManager(Blacklister blacklister, BlacklistUnitMapper blacklistUnitMapper) { this.blacklister = blacklister; this.blacklistUnitMapper = black...
__label__POS
0.893179
package cm.aptoide.pt.navigator; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import rx.Observable; public interface FragmentNavigator { String REQUEST_CODE_EXTRA = "cm.aptoide.pt.view.navigator.extra.REQUEST_CODE"; void navigateForResult(Fragment fragment, int requestCode...
__label__POS
0.717437
// Generating multiplication tables using nested loops // In this version an indefinite for loop is used, in combination with break statements. import std; int main() { int table {}; // Table size const int table_min {2}; // Minimum table size - at least up to the 2-times const int table_max {12}; /...
__label__POS
0.840504
### Examples It's our goal to create a wide variety of example of how Tether can be used. Here's what we have so far, please send a PR with any examples you might create. #### Beginner - [simple](../../examples/simple): A simple example to get you started - [out-of-bounds](../../examples/out-of-bounds): How to hide...
__label__POS
0.941365
// Exercise 2-5. Calculating the Body Mass Index. // In the expression for bmi, both h_feet and h_inches will be implicitly converted to double // because the other operand of the sub-expression is double. // If you omit the std::fixed from the final output statement // setprecision() specifies the number of digits pr...
__label__POS
0.760293
// Searching a string for characters from a set import std; int main() { std::string text; // The string to be searched std::println("Enter some text terminated by *:\n"); std::getline(std::cin, text, '*'); const std::string separators{ " ,;:.\"!?'\n" }; // Word delimiters ...
__label__POS
0.770909
package cm.aptoide.pt.ads; import android.content.SharedPreferences; import cm.aptoide.pt.dataprovider.interfaces.TokenInvalidator; import cm.aptoide.pt.dataprovider.ws.BodyInterceptor; import cm.aptoide.pt.dataprovider.ws.v7.BaseBody; import cm.aptoide.pt.dataprovider.ws.v7.home.WalletAdsOfferRequest; import okhttp3....
__label__POS
0.603665
// Overloading a function import <iostream>; import <string>; import <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 largest...
__label__POS
0.616928
// Exercise 6-2. Traversing arrays using pointer arithmetics // An exercise to further deepen your understanding of the relation // between pointers, pointer arithmetic, and arrays. #include <iostream> #include <iomanip> int main() { const size_t n {50}; size_t odds[n]; for (size_t i {}; i < n; ++i) odds[i...
__label__POS
0.643435
// Using std::span<const T> to ensure largest() works for const inputs import std; // Old function prototypes //double largest(const double data[], std::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>& w...
__label__POS
0.661937
// Exercise 5-7. Outputting product records & cost // Getting the alignment right is tricky. // You have to adjust the field widths until it looks OK. #include <iostream> #include <iomanip> #include <cctype> #include <vector> using std::setw; int main() { std::vector<size_t> product_id; std::vector<size_t> quantit...
__label__POS
0.914047
package cm.aptoide.pt.ads; import cm.aptoide.pt.database.room.RoomStoredMinimalAd; import cm.aptoide.pt.dataprovider.model.MinimalAdInterface; import cm.aptoide.pt.dataprovider.model.v2.GetAdsResponse; import cm.aptoide.pt.search.model.SearchAdResult; public class MinimalAdMapper { public MinimalAd map(GetAdsRespo...
__label__POS
0.779353
package cm.aptoide.pt.ads; import rx.Single; public class MoPubAdsManager { private final WalletAdsOfferManager walletAdsOfferManager; private final MoPubConsentDialogManager moPubConsentDialogManager; public MoPubAdsManager(WalletAdsOfferManager walletAdsOfferManager, MoPubConsentDialogManager moPubCon...
__label__POS
0.961254
// Exercise 5-4 Print out characters entered by the user in reverse order #include <iostream> int main() { const size_t max_num_characters {1'000}; char string[max_num_characters]; std::cout << "Please enter a string: "; std::cin.getline(string, max_num_characters); // Count the number of characters si...
__label__POS
0.729052
// Exercise 7-2 Frequency of words in text. #include <iostream> #include <iomanip> #include <string> #include <vector> int main() { std::string text; // The text to be searched std::cout << "Enter some text terminated by *:\n"; std::getline(std::cin, text, '*'); const...
__label__POS
0.731259