content stringlengths 263 5.24M | pred_label stringclasses 1
value | pred_score_pos float64 0.6 1 |
|---|---|---|
"use strict";
function OptionsMenuState(layer) {
GameObjectList.call(this, layer);
var background = new SpriteGameObject(sprites.background_options, ID.layer_background);
this.add(background);
var onOffLabel = new Label("Arial", "60px", ID.layer_overlays);
onOffLabel.text = "Hints";
onOffLabe... | __label__POS | 0.81686 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 17:27:06 11/23/2018
// Design Name:
// Module Name: MEM
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Rev... | __label__POS | 0.9476 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.901745 |
`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 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 16:56:51 11/23/2018
// Design Name:
// Module Name: ID
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revi... | __label__POS | 0.608091 |
package chapter4;
public class Individual {
/**
* In this case, the chromosome is an array of integers rather than a string.
*/
private int[] chromosome;
private double fitness = -1;
/**
* Initializes individual with specific chromosome
*
* @param chromosome
* The chromosome to give ind... | __label__POS | 0.972341 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 16:57:34 11/24/2018
// Design Name:
// Module Name: forward_mux
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
/... | __label__POS | 0.998473 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 17:31:53 11/23/2018
// Design Name:
// Module Name: mux
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Rev... | __label__POS | 0.675673 |
package chapter4;
/**
* A simple abstraction of a city. This class maintains Cartesian coordinates
* and also knows the Pythagorean theorem.
*
* @author bkanber
*
*/
public class City {
private int x;
private int y;
/**
* Initalize a city
*
* @param x
* X position of city
* @param y
... | __label__POS | 0.998991 |
"use strict";
function GameStateManager_Singleton() {
this._gameStates = [];
this._currentGameState = null;
}
GameStateManager_Singleton.prototype.add = function (gamestate) {
this._gameStates.push(gamestate);
this._currentGameState = gamestate;
return this._gameStates.length - 1;
};
GameStateMan... | __label__POS | 0.944907 |
package chapter4;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Random;
public class Population {
private Individual population[];
private double populationFitness = -1;
/**
* Initializes blank population of individuals
*
* @param populationSize
* The size of the popula... | __label__POS | 0.811864 |
package chapter4;
/**
* The main Evaluation class for the TSP. It's pretty simple -- given an
* Individual (ie, a chromosome) and a list of canonical cities, calculate the
* total distance required to travel to the cities in the specified order. The
* result returned by getDistance() is used by GeneticAlgorithm.ca... | __label__POS | 0.988374 |
package chapter4;
import java.util.Arrays;
public class GeneticAlgorithm {
private int populationSize;
private double mutationRate;
private double crossoverRate;
private int elitismCount;
protected int tournamentSize;
public GeneticAlgorithm(int populationSize, double mutationRate, double crossove... | __label__POS | 0.701841 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 11:13:10 11/30/2018
// Design Name:
// Module Name: Mult_Div
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
/... | __label__POS | 0.693174 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 16:57:57 11/23/2018
// Design Name:
// Module Name: dm
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revi... | __label__POS | 0.983991 |
package chapter4;
/**
* Main, executive class for the Traveling Salesman Problem.
*
* We don't have a real list of cities, so we randomly generate a number of them
* on a 100x100 map.
*
* The TSP requires that each city is visited once and only once, so we have to
* be careful when initializing a random Indiv... | __label__POS | 0.715013 |
package chapter2;
/**
* An "Individual" represents a single candidate solution. The core piece of
* information about an individual is its "chromosome", which is an encoding of
* a possible solution to the problem at hand. A chromosome can be a string, an
* array, a list, etc -- in this class, the chromosome is an... | __label__POS | 0.918495 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22:40:05 12/12/2018
// Design Name:
// Module Name: DEV1
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Re... | __label__POS | 0.73065 |
package chapter2;
/**
* This is our main class used to run the genetic algorithm.
*
* This case is one of the simplest problems we can solve: the objective is to
* end up with an individual whose chromosome is all ones.
*
* The simplicity of this problem makes the GeneticAlgorithm class'
* "calcFitness" metho... | __label__POS | 0.9438 |
package chapter2;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Random;
/**
* A population is an abstraction of a collection of individuals. The population
* class is generally used to perform group-level operations on its individuals,
* such as finding the strongest individuals, collecti... | __label__POS | 0.871856 |
package chapter5;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Random;
public class Population {
private Individual population[];
private double populationFitness = -1;
/**
* Initializes blank population of individuals
*
* @param populationSize
* The size of the popula... | __label__POS | 0.655669 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 17:13:22 11/23/2018
// Design Name:
// Module Name: npc
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Rev... | __label__POS | 0.664167 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 11:53:56 11/24/2018
// Design Name:
// Module Name: controller
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//... | __label__POS | 0.753453 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.626629 |
package chapter5;
/**
* A simple class abstraction -- basically a container for class, group, module, professor, timeslot, and room IDs
*/
public class Class {
private final int classId;
private final int groupId;
private final int moduleId;
private int professorId;
private int timeslotId;
pr... | __label__POS | 0.99961 |
package chapter5;
/**
* Simple course module abstraction, which defines the Professors teaching the module.
*/
public class Module {
private final int moduleId;
private final String moduleCode;
private final String module;
private final int professorIds[];
/**
* Initialize new Module
... | __label__POS | 0.998726 |
package chapter3;
/**
* An "Individual" represents a single candidate solution. The core piece of
* information about an individual is its "chromosome", which is an encoding of
* a possible solution to the problem at hand. A chromosome can be a string, an
* array, a list, etc -- in this class, the chromosome is an... | __label__POS | 0.918598 |
package chapter3;
/**
* The main executive class for the Robot Controller problem in chapter 3.
*
* We'll create a maze by hand, and feed it to the GeneticAlgorithm's
* `evalPopulation` method, which is then responsible for scoring an abstract
* robot with sensors against the maze.
*
* @author bkanber
*
*/
... | __label__POS | 0.92825 |
package chapter3;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Random;
/**
* A population is an abstraction of a collection of individuals. The population
* class is generally used to perform group-level operations on its individuals,
* such as finding the strongest individuals, collecti... | __label__POS | 0.871875 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22:05:26 12/12/2018
// Design Name:
// Module Name: DEV0
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Re... | __label__POS | 0.733526 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 17:30:22 11/23/2018
// Design Name:
// Module Name: WB
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revi... | __label__POS | 0.963491 |
"use strict";
GameObjectList.prototype = Object.create(GameObject.prototype);
function GameObjectList(layer, id) {
GameObject.call(this, layer, id);
this._gameObjects = [];
}
Object.defineProperty(GameObjectList.prototype, "length", {
get: function () {
return this._gameObjects.length;
}
});... | __label__POS | 0.918857 |
package chapter3;
import java.util.ArrayList;
/**
* This class abstracts a maze through which a robot will have to navigate. The
* maze is represented as a 2d array of integers, with different environment
* types represented by integers as follows:
*
* 0 = Empty
* 1 = Wall
* 2 = Starting position
* 3 = Ro... | __label__POS | 0.993737 |
package cm.aptoide.pt.database.room;
import android.text.TextUtils;
import androidx.annotation.IntDef;
import androidx.room.Ignore;
import cm.aptoide.pt.utils.IdUtils;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
public class RoomFileToDownload {
@Ignore public static final i... | __label__POS | 0.854976 |
package chapter3;
import java.util.ArrayList;
/**
* A robot abstraction. Give it a maze and an instruction set, and it will
* attempt to navigate to the finish.
*
* @author bkanber
*
*/
public class Robot {
private enum Direction {NORTH, EAST, SOUTH, WEST};
private int xPosition;
private int yPosi... | __label__POS | 0.716499 |
"use strict";
function TitleMenuState(layer) {
GameObjectList.call(this, layer);
this.add(new SpriteGameObject(sprites.background_title, ID.layer_background));
this.playButton = new Button(sprites.button_play, ID.layer_overlays);
this.playButton.position = new Vector2(415, 540);
this.add(this.pla... | __label__POS | 0.678482 |
"use strict";
function LevelMenuState(layer) {
GameObjectList.call(this, layer);
this.background = new SpriteGameObject(sprites.background_levelselect, ID.layer_background);
this.add(this.background);
this.back = new Button(sprites.button_back, ID.layer_overlays);
this.back.position = new Vector2... | __label__POS | 0.636406 |
"use strict";
function OptionsMenuState(layer) {
GameObjectList.call(this, layer);
var background = new SpriteGameObject(sprites.background_options, ID.layer_background);
this.add(background);
var onOffLabel = new Label("Arial", "60px", ID.layer_overlays);
onOffLabel.text = "Hints";
onOffLabe... | __label__POS | 0.81686 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 17:21:31 11/23/2018
// Design Name:
// Module Name: EX
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revi... | __label__POS | 0.951514 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.901745 |
package cm.aptoide.pt.database.room;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
@Entity(tableName = "localNotificationSync") public class RoomLocalNotificationSync {
@NonNull @PrimaryKey private final String notificationId;
private final String title;
priv... | __label__POS | 0.954322 |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 17:27:06 11/23/2018
// Design Name:
// Module Name: MEM
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Rev... | __label__POS | 0.948628 |
`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 |
package cm.aptoide.pt.database.room;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
@Entity(tableName = "notification") public class RoomNotification {
@Ignore public final static String KEY = "key";
@Ignore public static final int N... | __label__POS | 0.877191 |
package com.example.network
import org.json.JSONArray
import org.json.JSONObject
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_json_parse.*
/**
* Created by ouyangshen on 2017/9/24.
*/
class JsonParseActivity : AppCompatActivity() {
ov... | __label__POS | 0.992088 |
package cm.aptoide.pt.database.room;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Environment;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.room.Entity;
import androidx.room.Igno... | __label__POS | 0.938507 |
/*
* Copyright (c) 2016.
* Modified by Neurophobic Animal on 24/05/2016.
*/
package cm.aptoide.pt.database.room;
import androidx.annotation.IntDef;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
imp... | __label__POS | 0.948802 |
package cm.aptoide.pt.database.room;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
@Entity(tableName = "experiment") public class RoomExperiment {
@NonNull @PrimaryKey private String experimentName;
private long requestTime;
private String assignment;
priva... | __label__POS | 0.931926 |
package cm.aptoide.pt.database.room;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
@Entity(tableName = "store") public class RoomStore {
public static final String STORE_ID = "storeId";
public static final String ICON_PATH = "iconPath";
public static final Str... | __label__POS | 0.878015 |
"use strict";
function Level(levelIndex, id) {
powerupjs.GameObjectList.call(this, id);
this._levelIndex = levelIndex;
this._waterdrops = new powerupjs.GameObjectList(ID.layer_objects);
this._quitButton = new powerupjs.Button(sprites.button_quit, ID.layer_overlays);
this._quitButton.position = ne... | __label__POS | 0.900691 |
"use strict";
function PlayingState() {
powerupjs.IGameLoopObject.call(this);
this.currentLevelIndex = -1;
this.levels = [];
this.loadLevelsStatus();
this.loadLevels();
}
PlayingState.prototype = Object.create(powerupjs.IGameLoopObject.prototype);
Object.defineProperty(PlayingState.prototype, "... | __label__POS | 0.879785 |
"use strict";
function TitleMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
// the title screen
var titleScreen = new powerupjs.SpriteGameObject(sprites.background_title, ID.layer_background);
this.add(titleScreen);
// add a play button
this.playButton = new powerupjs.Button(sp... | __label__POS | 0.905293 |
"use strict";
function LevelMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
this.background = new powerupjs.SpriteGameObject(sprites.levelselect, ID.layer_background);
this.add(this.background);
this.back = new powerupjs.Button(sprites.button_back, ID.layer_overlays);
this.back.pos... | __label__POS | 0.713346 |
package cm.aptoide.pt.downloadmanager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import rx.Completable;
import rx.Observable;
import rx.observ... | __label__POS | 0.911442 |
package com.example.network.bean
import com.example.network.R
data class RecyclerInfo(var pic_id: Int=0, var title: String="", var desc: String="", var pressed: Boolean=false) {
var id: Int = 0
init {
this.id = RecyclerInfo.seq
RecyclerInfo.seq++
}
companion object {
private ... | __label__POS | 0.996332 |
package com.example.network.util
import android.content.Intent
import android.support.v4.app.ActivityCompat
import android.content.pm.PackageManager
import android.support.v4.content.ContextCompat
import android.os.Build
import android.app.Activity
import android.content.Context
/**
* Created by ouyangshen on 2018/... | __label__POS | 0.880913 |
package com.example.network.util
import android.annotation.SuppressLint
import java.text.SimpleDateFormat
import java.util.*
/**
* Created by ouyangshen on 2017/9/24.
*/
@SuppressLint("SimpleDateFormat")
object DateUtil {
val nowDateTime: String
get() {
val sdf = SimpleDateFormat("yyyy-MM-d... | __label__POS | 0.997751 |
function linearSearch(array, n) {
for (var i = 0; i < array.length; i++) {
if (array[i] == n) {
return true;
}
}
return false;
}
console.log(linearSearch([1,2,3,4], 4));
console.log(linearSearch([1,2,3,4], 5));
function binarySearch(array, n) {
var lowIndex = 0,
hi... | __label__POS | 0.998385 |
package com.example.network.util
import android.app.Activity
import android.content.Context
import android.view.View
import android.view.inputmethod.InputMethodManager
import android.widget.EditText
/**
* Created by ouyangshen on 2017/8/27.
*/
object ViewUtil {
fun getMaxLength(et: EditText): Int {
var... | __label__POS | 0.991251 |
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
@Injectable()
export class JhiConfigurationService {
constructor(private http: Http) {
}
get(): Observable<any> {
return this.http.get('management/configprops').map((r... | __label__POS | 0.880343 |
var array1 = [1,2,3,4];
array1 = [1,2,3,4];
array1.push(5); // array1 = [1,2,3,4,5]
array1.push(7); // array1 = [1,2,3,4,5,7]
array1.push(2); // array1 = [1,2,3,4,5,7,2]
console.log(array1);
array1 = [1,2,3,4];
array1.pop(); //returns 4, array1 = [1,2,3]
array1.pop(); //returns 3, array1 = [1,2]
array1 = [1,2,3,... | __label__POS | 0.799666 |
0.1 + 0.2 === 0.3;
5/4; // 1.25
Math.floor(0.9); // 0
Math.floor(1.1); // 1
Math.round(0.49); // 0
Math.round(0.5); // 1
Math.round(2.9); // 3
Math.ceil(0.1); // 1
Math.ceil(0.9); // 1
Math.ceil(21); // 21
Math.ceil(21.01); // 22
function numberEquals(x, y) {
return Math.abs(x - y) < Number.EPSILON;
}
0.1 + 0... | __label__POS | 0.97484 |
function Stack(array) {
this.array = [];
if (array) this.array = array;
}
Stack.prototype.getBuffer = function() {
return this.array.slice();
}
Stack.prototype.isEmpty = function() {
return this.array.length == 0;
}
//instance of the stack class
var stack1 = new Stack();
console.log(stack1); // {arr... | __label__POS | 0.967785 |
function TrieNode() {
this.children = {}; // table
this.endOfWord = false;
}
function Trie() {
this.root = new TrieNode();
}
Trie.prototype.insert = function(word) {
var current = this.root;
for (var i = 0; i < word.length; i++) {
var ch = word.charAt(i);
var node = current.childr... | __label__POS | 0.919179 |
# Errata for *Book Title*
***
### page 22
On **page 22**
**Before**:
```latex
$(-1)^{\text{sign}} \times 2^{e-127} \times \left(1 + \sum_{i=1}^{23} b_{52-i} 2^{-i} \right)$
```
**Corrected**
```latex
$(-1)^{\text{sign}} \times 2^{e-1023} \times \left(1 + \sum_{i=1}^{52} b_{52-i} 2^{-i} \right)$
```
***
### page... | __label__POS | 0.820684 |
function SinglyLinkedListNode(data) {
this.data = data;
this.next = null;
}
function SinglyLinkedList() {
this.head = null;
this.size = 0;
}
SinglyLinkedList.prototype.isEmpty = function() {
return this.size == 0;
}
SinglyLinkedList.prototype.insert = function(value) {
if (this.head === null)... | __label__POS | 0.677519 |
var exampleSet = new Set();
exampleSet.add(1); // exampleSet: Set(1) {1}
exampleSet.add(1); // exampleSet: Set(1) {1}
exampleSet.add(2); // exampleSet: Set(2) {1, 2}
exampleSet
var exampleSet = new Set();
exampleSet.add(1); // exampleSet: Set {1}
exampleSet.delete(1); // true
exampleSet.add(2); // exampleSet: Set {1,... | __label__POS | 0.992143 |
localStorage.setItem("testKey", "testValue");
location = location; // refreshes the page
//-----------------------------------
localStorage.getItem("testKey"); // prints "testValue"
// Start of: Linear Probing -----------------------------------
function HashTable(size) {
this.size = size;
this.keys = this.i... | __label__POS | 0.65885 |
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
@Injectable()
export class JhiHealthService {
separator: string;
constructor(private http: Http) {
this.separator = '.';
}
checkHealth(): Observable<any> {
... | __label__POS | 0.848703 |
function countDownToZero(n) {
// base case. Stop at 0
if (n <= -1) {
return; // stop the function
} else {
console.log(n);
countDownToZero(n - 1); // count down 1
}
}
countDownToZero(12);
function getNthFibo(n) {
if (n <= 1) return n;
var sum = 0,
last = 1,
... | __label__POS | 0.98146 |
function bubbleSort(array) {
for (var i = 0, arrayLength = array.length; i < arrayLength; i++) {
for (var j = 0; j <= i; j++) {
if (array[j] > array[j+1]) {
swap(array, i, j);
}
}
}
return array;
}
function swap(array, index1, index2) {
var temp =... | __label__POS | 0.902294 |
var cache = {};
function fiboBest(n) {
if (n <= 1) return n;
if (cache[n]) return cache[n];
return (cache[n] = fiboBest(n - 1) + fiboBest(n - 2));
}
fiboBest(10); // 55
function waysToCoverSteps(step) {
if (step < 0) return 0;
if (step == 0) return 1;
return waysToCoverSteps(step - 1) + waysTo... | __label__POS | 0.978576 |
package com.example.network.provider
import com.example.network.database.UserDBHelper
import android.net.Uri
import android.provider.BaseColumns
class UserInfoContent : BaseColumns {
companion object {
// 这里的名称必须与AndroidManifest.xml里的android:authorities保持一致
val AUTHORITIES = "com.example.network.... | __label__POS | 0.964996 |
package com.example.network.provider
import com.example.network.database.UserDBHelper
import android.content.ContentProvider
import android.content.ContentUris
import android.content.ContentValues
import android.content.UriMatcher
import android.database.Cursor
import android.net.Uri
class UserInfoProvider : Content... | __label__POS | 0.686795 |
import { HttpInterceptor } from 'ng-jhipster';
import { RequestOptionsArgs, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
export class NotificationInterceptor extends HttpInterceptor {
constructor() {
super();
}
requestIntercept(options?: RequestOptionsArgs): Requ... | __label__POS | 0.683736 |
function BinaryTree() {
this._root = null;
}
BinaryTree.prototype.traverseInOrder = function() {
traverseInOrderHelper(this._root);
function traverseInOrderHelper(node) {
if (!node)
return;
traverseInOrderHelper(node.left);
console.log(node.value);
traverseInOrd... | __label__POS | 0.818559 |
'dog'.charAt(1); // 'o'
'Youtube'.substring(1,2); // 'o'
'Youtube'.substring(3,7); // 'tube'
'Youtube'.substring(1); // returns 'outube'
var a = 'a';
var b = 'b';
console.log(a < b); // prints 'true'
var a = 'add';
var b = 'b';
console.log(a < b); // prints 'true'
var a = 'add';
var b = 'ab';
console.log(a < b);... | __label__POS | 0.844466 |
function BitwiseAdd(a, b) {
while (b != 0) {
var carry = (a & b);
a = a ^ b;
b = carry << 1;
}
return a;
}
console.log(BitwiseAdd(4, 5)); // 9
function BitwiseNegate(a) {
return BitwiseAdd(~a, 1);
}
console.log(BitwiseNegate(9)); // -9
// negation with itself gives back origi... | __label__POS | 0.981868 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.798199 |
import { Component, ElementRef, Input, Renderer } from '@angular/core';
@Component({
selector: 'jhi-password-strength-bar',
template: `
<div id="strength">
<small>Password strength:</small>
<ul id="strengthBar">
<li class="point"></li>
<li class="... | __label__POS | 0.623352 |
"use strict";
GameObjectList.prototype = Object.create(GameObject.prototype);
function GameObjectList(layer) {
GameObject.call(this, layer);
this._gameObjects = [];
}
Object.defineProperty(GameObjectList.prototype, "length", {
get: function () {
return this._gameObjects.length;
}
});
GameOb... | __label__POS | 0.940307 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.896437 |
//
// MVVM_MyToDosTests.swift
// MVVM_MyToDosTests
//
// Created by Raúl Ferrer on 12/6/22.
//
import XCTest
class MVVM_MyToDosTests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
ov... | __label__POS | 0.782426 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.798199 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.896437 |
package com.example.chapter08;
import android.os.Bundle;
import android.util.Log;
import androidx.appcompat.app.AppCompatActivity;
public class FragmentStaticActivity extends AppCompatActivity {
private static final String TAG = "FragmentStaticActivity";
@Override
protected void onCreate(Bundle savedIns... | __label__POS | 0.987721 |
package com.example.chapter08;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState... | __label__POS | 0.810626 |
package com.example.chapter08;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;
import com.example.chapter08.adapter.LaunchImproveAdapter;
public class LaunchImproveActivity extends AppCompatActivity {
// 声明引导页面的图片数组
private int[] lanuchI... | __label__POS | 0.999 |
"use strict";
function Level(levelIndex, id) {
powerupjs.GameObjectList.call(this, id);
this._levelIndex = levelIndex;
this._waterdrops = new powerupjs.GameObjectList(ID.layer_objects);
this._enemies = new powerupjs.GameObjectList(ID.layer_objects);
this._quitButton = new powerupjs.Button(sprites.... | __label__POS | 0.926159 |
{"cells":[{"cell_type":"markdown","id":"c23b4dd1","metadata":{"id":"c23b4dd1"},"source":["<div>\n"," <h1>Large Language Models Projects</a></h1>\n"," <h3>Apply and Implement Strategies for Large Language Models</h3>\n"," <h2>6.1-Creating a NL2SQL Superprompt for OpenAI.</h2>\n"," <h3></h3>\n","</div>\n","\n... | __label__POS | 0.840844 |
package com.example.chapter08;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.Toast... | __label__POS | 0.729844 |
package com.example.chapter08;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedList... | __label__POS | 0.750528 |
//
// HomeCoordinator.swift
// MVVM-C_MyToDos
//
// Created by Raúl Ferrer on 26/7/22.
//
import UIKit
protocol HomeCoordinatorProtocol {
func showSelectedList(_ list: TasksListModel)
func gotoAddList()
}
class HomeCoordinator: Coordinator, HomeCoordinatorProtocol {
var navigationController: UINa... | __label__POS | 0.657389 |
"use strict";
function PlayingState() {
powerupjs.IGameLoopObject.call(this);
this.currentLevelIndex = -1;
this.levels = [];
this.loadLevelsStatus();
this.loadLevels();
}
PlayingState.prototype = Object.create(powerupjs.IGameLoopObject.prototype);
Object.defineProperty(PlayingState.prototype, "... | __label__POS | 0.826897 |
/**
* 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.
*/
/*
* Created on Aug 25, 2004
... | __label__POS | 0.718029 |
"use strict";
function TitleMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
// the title screen
var titleScreen = new powerupjs.SpriteGameObject(sprites.background_title, ID.layer_background);
this.add(titleScreen);
// add a play button
this.playButton = new powerupjs.Button(sp... | __label__POS | 0.905293 |
"use strict";
function LevelMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
this.background = new powerupjs.SpriteGameObject(sprites.levelselect, ID.layer_background);
this.add(this.background);
this.back = new powerupjs.Button(sprites.button_back, ID.layer_overlays);
this.back.pos... | __label__POS | 0.713346 |
package com.example.chapter08;
import android.app.Application;
import android.graphics.Bitmap;
import android.util.Log;
import com.example.chapter08.database.CartDBHelper;
import java.util.HashMap;
public class MainApplication extends Application {
private final static String TAG = "MainApplication";
public... | __label__POS | 0.962656 |
package com.example.chapter08;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.Toast... | __label__POS | 0.743939 |
package com.example.custom
import android.os.Bundle
import android.os.Handler
import android.support.v7.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_progress_animation.*
/**
* Created by ouyangshen on 2017/9/17.
*/
class ProgressAnimationActivity : AppCompatActivity() {
override fun on... | __label__POS | 0.924729 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.