content stringlengths 263 5.24M | pred_label stringclasses 1
value | pred_score_pos float64 0.6 1 |
|---|---|---|
<!DOCTYPE html>
<head>
<title>Tutorial Code 2d</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.915085 |
package com.ps;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import javax.sql.DataSource;
import java.util.Properties;
import static org.junit.Assert.as... | __label__POS | 0.969692 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 1b</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.915319 |
package com.ps;
import com.ps.config.*;
import com.ps.repos.PetRepo;
import com.ps.repos.RequestRepo;
import com.ps.repos.UserRepo;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.... | __label__POS | 0.769881 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 6c</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.915073 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 5a</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.914946 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 4b</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.914364 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 2b</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.914776 |
package com.ps.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import javax.sql.DataSource;
import java.sql.SQLExcepti... | __label__POS | 0.978137 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 6b</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.914782 |
package com.ps.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.PropertySource;
... | __label__POS | 0.8975 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 6a</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.912223 |
package com.ps.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.PropertySource;
import org... | __label__POS | 0.87601 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 4a</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.914402 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 3c</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.914937 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 1a</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.91442 |
<!DOCTYPE html>
<head>
<title>Tutorial Code 5b</title>
</head>
<!--Use embedded shader code for now, in order to remove async loading complexity.-->
<body onload="
var game = new MyGameScene();
gEngine.Core.initializeEngineCore('GLCanvas', game);
">
<!-- the following says ther... | __label__POS | 0.915444 |
package com.ps.services.impl;
import com.ps.base.RequestStatus;
import com.ps.ents.Pet;
import com.ps.ents.Request;
import com.ps.ents.User;
import com.ps.repos.RequestRepo;
import com.ps.services.RequestService;
import com.ps.util.Pair;
import org.joda.time.DateTime;
/**
* Created by iuliana.cosmina on 2/22/16.
*/... | __label__POS | 0.950423 |
package web;
import com.ps.ents.User;
import com.ps.problem.NotFoundException;
import com.ps.web.UserController;
import org.junit.Before;
import org.junit.Test;
import org.springframework.ui.ExtendedModelMap;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNot... | __label__POS | 0.925261 |
package com.ps.init;
import com.ps.config.ServiceConfig;
import com.ps.config.WebConfig;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.filter.HiddenHttpMethodFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
imp... | __label__POS | 0.995203 |
// class String, for char arrays
// -- from _C++20 for Lazy Programmers_
#include <cstring>
#include "string.h"
using namespace std;
String& String::operator= (String&& other) noexcept // move =
{
if (contents_) delete[] contents_;
contents_ = other.contents_;
other.contents_ = nullptr;
return... | __label__POS | 0.829351 |
package com.ps.config;
import com.ps.ents.User;
import com.ps.services.UserService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.test.conte... | __label__POS | 0.898255 |
// Program to generate a random passcode of digits
// -- from _C++20 for Lazy Programmers_
#include <stdio.h>
#include <stdlib.h> // for srand, rand, malloc, free
#include <time.h> // for time
// Disable a warning about scanf, etc., in Visual Studio
#ifdef _MSC_VER
#pragma warning (di... | __label__POS | 0.608763 |
package com.ps.repos.impl;
import com.ps.ents.User;
import com.ps.repos.UserRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;
import java.sql.ResultSe... | __label__POS | 0.725649 |
package com.ps.config.db;
import com.ps.config.db.DataConfig;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.*;
import org.springframework.context.support.PropertySourcesPlacehold... | __label__POS | 0.824951 |
package com.ps.jms;
import com.ps.config.ServiceConfig;
import com.ps.ents.User;
import com.ps.jms.config.JmsCommonConfig;
import com.ps.jms.config.JmsConsumerConfig;
import com.ps.jms.config.JmsProducerConfig;
import com.ps.services.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spri... | __label__POS | 0.934096 |
package com.ps.jms;
import com.ps.config.ServiceConfig;
import com.ps.ents.User;
import com.ps.jms.config.JmsCommonConfig;
import com.ps.jms.config.JmsConsumerConfig;
import com.ps.services.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.AnnotationCon... | __label__POS | 0.999034 |
package com.ps.jms.config;
import com.ps.jms.UserReceiver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.list... | __label__POS | 0.974747 |
package com.ps.jms.config;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.spr... | __label__POS | 0.84166 |
package com.ps.jms.config;
import com.ps.jms.ConfirmationReceiver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.... | __label__POS | 0.976731 |
package com.ps.init;
import com.ps.config.ServiceConfig;
import com.ps.config.WebConfig;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.filter.HiddenHttpMethodFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
im... | __label__POS | 0.999338 |
package com.ps.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.*;
import org.springframework.web.servlet.view.InternalResourceViewResol... | __label__POS | 0.775932 |
// Program to demonstrate stack, with exceptions
// -- from _C++20 for Lazy Programmers_
#include <iostream>
#include "stack.h"
using namespace std;
char getAnswer (const char* question); // Ask question, get a (char) answer
void destroyAndPrint (Stack&); // Take everything off stack, and
... | __label__POS | 0.920498 |
package com.ps.repo.services;
import com.ps.repo.stub.*;
import com.ps.repos.*;
import com.ps.services.OperationsService;
import com.ps.services.impl.*;
/**
* Created by iuliana.cosmina on 3/4/16.
*/
public class SimpleServiceTestBase {
protected SimpleRequestService requestService;
protected SimpleRespons... | __label__POS | 0.999952 |
// class String, for char arrays
// -- from _C++20 for Lazy Programmers_
#include <cstring>
#include "string.h"
using namespace std;
String& String::operator= (String&& other) noexcept // move =
{
if (contents_) delete[] contents_;
contents_ = other.contents_;
other.contents_ = nullptr;
return... | __label__POS | 0.829351 |
package com.ps.repo.services;
import com.ps.base.*;
import com.ps.ents.*;
import com.ps.services.OperationsService;
import com.ps.services.impl.SimpleOperationsService;
import com.ps.util.Pair;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;... | __label__POS | 0.681842 |
package com.ps.services.impl;
import com.ps.base.RequestStatus;
import com.ps.base.ResponseStatus;
import com.ps.ents.*;
import com.ps.repos.RequestRepo;
import com.ps.repos.UserRepo;
import com.ps.services.RequestService;
import com.ps.util.Pair;
import org.joda.time.DateTime;
/**
* Created by iuliana.cosmina on 2/... | __label__POS | 0.912217 |
package com.ps.config;
import com.ps.ents.Pet;
import com.ps.mock.MockTemplateConfig;
import com.ps.services.impl.SimplePetService;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
impor... | __label__POS | 0.661867 |
package com.ps.repo.services;
import com.ps.base.UserType;
import com.ps.ents.Request;
import com.ps.ents.Review;
import com.ps.ents.User;
import com.ps.repos.ReviewRepo;
import com.ps.services.impl.SimpleReviewService;
import org.junit.Before;
import org.junit.Test;
import java.util.HashSet;
import java.util.Set;
i... | __label__POS | 0.93389 |
package com.ps.repo.services;
import com.ps.base.RequestStatus;
import com.ps.base.UserType;
import com.ps.ents.Request;
import com.ps.ents.User;
import com.ps.repos.RequestRepo;
import com.ps.services.impl.SimpleRequestService;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.joda.time.DateTime;
im... | __label__POS | 0.74702 |
package com.ps.services.impl;
import com.ps.base.RequestStatus;
import com.ps.ents.Pet;
import com.ps.ents.Request;
import com.ps.ents.User;
import com.ps.repos.RequestRepo;
import com.ps.services.RequestService;
import com.ps.util.Pair;
import org.joda.time.DateTime;
import org.springframework.stereotype.Service;
im... | __label__POS | 0.637593 |
package com.ps.services.impl;
import com.ps.base.PetType;
import com.ps.ents.Pet;
import com.ps.ents.User;
import com.ps.repos.PetRepo;
import com.ps.services.PetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotyp... | __label__POS | 0.693872 |
// List class tester with iterator, const_iterator
// -- from _C++20 for Lazy Programmers_
#include <iostream>
#include <cassert>
#include <string>
#include "list.h"
using namespace std;
//used for testing move semantics; see below
template<typename T>
List<T> testMove(const T& foo) { List<T> result; result.pu... | __label__POS | 0.794859 |
package com.ps;
import com.ps.sample.ComplexBean;
import com.ps.sample.SimpleBean;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import javax.... | __label__POS | 0.873636 |
<!DOCTYPE html>
<html>
<head>
<title>The Adventures of Dye</title>
<link rel ="icon" type ="image/x-icon" href="./assets/favicon.png">
<!-- the following says there are javascript source code contained in
the external source files
-->
<!-- external library -->
... | __label__POS | 0.954817 |
// class Date -- functions
// -- from _C++20 for Lazy Programmers_
#include "date.h"
bool isLeapYear (int year)
{
// If a year is divisible by 4, it's a leap year
// Except if it's also divisible by 100, it's not
// Except if it's also divisible by 400, it is
// Not simple, but there it is
... | __label__POS | 0.927888 |
package com.ps.sample;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Required;
/**
* Created by iuliana.cosmina on 3/28/16.
* Sample class used to make bean creation staged understanding easy.
* This class contains all the methods used to initialize an... | __label__POS | 0.970309 |
package com.ps.sample;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by iuliana.cosmina on 3/28/16.
* Sample class used to make bean creation staged understanding easy.
* This class contains all the methods used to initialize and detroy a bean altogether, so you can the
* order they are c... | __label__POS | 0.865011 |
// Program to illustrate a few char-array functions
// -- from _C++20 for Lazy Programmers_
#include <iostream>
using namespace std;
constexpr int MAX_LINE_LENGTH=255;
bool getYOrNAnswer (const char question[]);
unsigned int myStrlen (const char str[]);
int main ()
{
bool letsRepeat; ... | __label__POS | 0.997794 |
---- MODULE max ----
EXTENDS Integers, Sequences, TLC
CONSTANTS IntSet, MaxSetLen
ASSUME IntSet \subseteq Int
ASSUME MaxSetLen > 0
PT == INSTANCE PT
Max(seq) ==
LET indice == CHOOSE x \in 1..Len(seq): \A y \in 1..Len(seq): seq[y] <= seq[x]
IN seq[indice]
AllInputs == PT!SeqOf(IntSet, MaxSetLen) \ {<<>>}
(*--alg... | __label__POS | 0.695733 |
// Program to illustrate a few char-array functions
// -- from _C++20 for Lazy Programmers_
#include <iostream>
using namespace std;
// Ways to copy source to destination
void myStrcpy1 (char destination[], const char source[]);
void myStrcpy2 (char* destination, const char* source);
void myStrcpy3 (char* de... | __label__POS | 0.868018 |
------------------------------ MODULE recycler ------------------------------
EXTENDS Sequences, Integers, TLC, FiniteSets
(*--algorithm recycler
variables
capacity \in [trash: 1..10, recycle: 1..10],
bins = [trash |-> <<>>, recycle |-> <<>>],
count = [trash |-> 0, recycle |-> 0],
item = [type: {"tras... | __label__POS | 0.828826 |
package com.ps.repo;
import com.ps.config.AppConfig;
import com.ps.config.TestDataConfig;
import com.ps.repos.UserRepo;
import com.ps.ents.User;
import com.ps.util.Pair;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
impor... | __label__POS | 0.742522 |
package com.ps.repos.impl;
import com.ps.ents.User;
import com.ps.repos.UserRepo;
import com.ps.repos.util.UserRowMapper;
import com.ps.util.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import... | __label__POS | 0.775375 |
package com.ps.repos.impl;
import com.ps.ents.User;
import com.ps.repos.UserRepo;
import com.ps.repos.util.UserRowMapper;
import com.ps.util.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.NamedParamete... | __label__POS | 0.670827 |
package com.ps.jms;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
import javax.jms.Message;
import java.util.concurrent.atomic.AtomicInteger... | __label__POS | 0.601133 |
package com.ps.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.*;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import javax.sql.DataSource;
import ja... | __label__POS | 0.977711 |
// Program to do some things with ranged loops
// -- from _C++20 for Lazy Programmers_
#include <iostream>
#include <vector>
#include <string>
#include <list>
#ifdef __cpp_concepts
#include <concepts>
#endif
using namespace std;
int main ()
{
// An array of ints -- print it, double it, print it
int myAr... | __label__POS | 0.640973 |
package com.ps.services.impl;
import com.ps.base.RequestStatus;
import com.ps.ents.Pet;
import com.ps.ents.Request;
import com.ps.ents.User;
import com.ps.repos.RequestRepo;
import com.ps.services.RequestService;
import com.ps.util.Pair;
import org.joda.time.DateTime;
import org.springframework.stereotype.Service;
im... | __label__POS | 0.637593 |
package com.ps.services.impl;
import com.ps.base.PetType;
import com.ps.ents.Pet;
import com.ps.ents.User;
import com.ps.repos.PetRepo;
import com.ps.services.PetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Set;
/**
* Created... | __label__POS | 0.670603 |
from my_or_tools import newSolver, SolVal
from my_or_tools import k_out_of_n
def get_row(x,i):
return [x[i][j] for j in range(len(x[0]))]
def get_column(x,i):
return [x[j][i] for j in range(len(x[0]))]
def solve_maxrook(n):
s = newSolver('Maxrook',True)
x = [[s.IntVar(0,1,'') for _ in range(n)] for _ in ... | __label__POS | 0.829232 |
from random import randint
def gen_dcost(m,n):
R=[]
S=0
for i in range(m):
RR=[]
for j in range(n):
RR.append(randint(10,30))
RR.append(randint(500,700))
R.append(RR)
S += RR[-1]
A = S/n
RR = []
for i in range(n... | __label__POS | 0.869658 |
// Program to use find, copy, copy_if, sort, erase, erase_if
// -- from _C++20 for Lazy Programmers_
#include <vector>
#include <list>
#include <cassert>
#include <iterator> // for ostream_iterator
#include <iostream>
#include <algorithm>
using namespace std;
bool isEven (int i) { return i % 2 == 0; }
#ifdef ... | __label__POS | 0.688867 |
package com.ps.web;
import com.ps.ents.User;
import com.ps.problem.NotFoundException;
import org.junit.Before;
import org.junit.Test;
import org.springframework.ui.ExtendedModelMap;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
/**
* Created by iu... | __label__POS | 0.819466 |
// Test List::iterator and some other List functions
// -- from _C++20 for Lazy Programmers_
#include <iostream>
#include <cassert>
#include <string>
#include "list.h"
using namespace std;
int main ()
{
// Test default ctor, size, empty, push_front, front
List<int> L;
assert(L.size() == 0); assert(L.e... | __label__POS | 0.947049 |
from random import randint, uniform
def gen_data_content(m,n):
# Oils down, acids accross (more oils than acids m > n)
R=[]
for i in range(m):
RR=[]
P = 100
for j in range(n-1):
if P>1:
acid = randint(1,min(70,P))*randint(0,1)
else:
... | __label__POS | 0.967493 |
from random import randint,uniform,shuffle,sample
def gen_data(m,n):
# m is number of jobs, n is the number of machines
R=[]
for j in range(m):
p=list(range(n))
p=sample(p,len(p))
RR=[]
for i in range(n):
RR.append((p[i],randint(5,10)))
R.append(RR)
r... | __label__POS | 0.653944 |
from random import randint
def gen_data(n,convex=True):
R=[]
SQ,SP,TP=0,20,0
for i in range(n):
Q = randint(100,200)
P = randint(1,5)
if convex:
SP1 = SP+P
else:
SP1 = SP-P
RR=[SQ, SQ+Q,SP1, TP, TP+Q*(SP1)]
R.append(RR)
TP=TP+Q... | __label__POS | 0.771441 |
// Program to read in & dissect a phone number
// -- from _C++20 for Lazy Programmers_
#include <iostream>
#if __has_include (<span>)
#include <span> // for std::span
#else
#warning "This compiler does not support spans."
#endif
using namespace std;
// Converts a char to a single-digit number
int char2digi... | __label__POS | 0.945849 |
from mincost import gen_data, solve_model
def main():
import sys
import random
import tableutils
m=3
n=7
if len(sys.argv)<=1:
print('Usage is main [data|run] [seed]')
return
elif len(sys.argv)>=2:
random.seed(int(sys.argv[2]))
C=gen_data(m,n)
if sys.argv[1]==... | __label__POS | 0.907424 |
from random import randint, uniform
def gen_data(m,n,n0):
# m is number of time intervals, n is number of shifts
R = [[0 for _ in range(n+1)] for _ in range(m+1)]
for i in range(m): # Staffing needs
R[i][-1] = randint(10,20)
n1 = n-n0 # Part-time
d0 = int(round(m/n0)+1) ... | __label__POS | 0.820375 |
// Program to get the frequencies of letters
// -- from _C++20 for Lazy Programmers_
#include <iostream>
using namespace std;
int main ()
{
// make an array of frequencies for letters, all initially zero
constexpr int LETTERS_IN_ALPHABET = 26;
int frequenciesOfLetters[LETTERS_IN_ALPHABET] = {}; // ... | __label__POS | 0.977466 |
package com.ps.config;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.filter.HiddenHttpMethodFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import javax.servlet.Filter;
/**
* Created by iuliana.cosmina on 8/... | __label__POS | 0.999831 |
from piecewise import gen_data, minimize_piecewise_linear_convex,\
minimize_non_linear,verbose_minimize_non_linear
from piecewise_ncvx import minimize_piecewise_linear
def my_function(x):
from math import sin, exp
return sin(x)*exp(x)
def main():
import sys
import random
import tableutils
... | __label__POS | 0.815717 |
from random import randint
def gen_data(n):
R=[]
S=0
for i in range(n):
R.append([randint(1,12), randint(5,40)])
return R
from my_or_tools import ObjVal, SolVal, newSolver
def solve_model(D):
s,n = newSolver('Cutting Stock', True), len(D)
k,b = bounds(D)
y = [s.IntVar(0,1,'') for i in... | __label__POS | 0.770445 |
from random import randint,uniform
from math import sqrt
def dist(p1,p2):
return int(round(10*sqrt((p1[0]-p2[0])**2 + (p1[1]-p2[1])**2)))
def gen_data(n):
points=[(randint(1,100), randint(1,100)) for i in range(n)]
R=[[None for i in range(n)] for j in range(n)]
for i in range(n):
for j in range(n):
p... | __label__POS | 0.746673 |
from random import randint
def gen_data(n):
R=[]
S=0
for i in range(n):
RR=[i] # Task number
RR.append(randint(2,8)) # Duration
P=[]
for j in range(i):
if randint(0,1)*randint(0,1):
P.append(j)
RR.append(P)
R.appe... | __label__POS | 0.786463 |
from random import randint
def inner(a,b):
s=0
for i in range(len(a)):
s += a[i]*b[i]
return s
def gen_features(n,m):
# Generating n vectors of m features linearly separable
a=gen_hyperplane(m)
A,B,i=[],[],0
while len(A) < n:
x=[randint(-10,10) for _ in range(m)]
if inner(a[0:m],x) < a[m]-1:... | __label__POS | 0.951331 |
// A (partial) game with killer robots
// meant to demonstrate use of file I/O
// This loads 3 points and prints them
// -- from _C++20 for Lazy Programmers_
#include <iostream>
#include <fstream> // 1. include <fstream>
using namespace std;
struct Point2D { int x_=0, y_=0; };
int main ()
{
... | __label__POS | 0.974927 |
/*
* File: CameraShake.js
* Defines a damped simple harmonic motion to simulate camera shakie
*/
/*jslint node: true, vars: true, bitwise: true */
/*global gEngine, vec2, ShakePosition */
/* find out more about jslint: http://www.jslint.com/help.html */
"use strict";
/**
* Defines a damped simple harmonic motion... | __label__POS | 0.803081 |
from random import randint
from math import sqrt
def dist(p1,p2):
return int(round(sqrt((p1[0]-p2[0])**2 + (p1[1]-p2[1])**2))/10)
def gen_data(n):
points=[(randint(1,1000), randint(1,1000)) for i in range(n)]
points.sort()
R=[]
S=0
for i in range(n):
RR=[]
for j in range(n):
... | __label__POS | 0.694354 |
from random import randint
def gen_data(m,n):
R=[]
S=0
for i in range(m):
RR=[]
for j in range(n):
yesno = 1-randint(0,1)*randint(0,1)
RR.append(randint(10,30)*yesno)
RR.append(randint(500,700))
R.append(RR)
S += RR[-1]
A = S/n... | __label__POS | 0.690909 |
import transship_dist
def main():
import sys
import random
import tableutils
n=8
if len(sys.argv)<=1:
print('Usage is main [data|run] [seed]')
return
elif len(sys.argv)>=2:
random.seed(int(sys.argv[2]))
C=transship_dist.gen_data(n)
if sys.argv[1]=='data':
... | __label__POS | 0.893207 |
from my_or_tools import ObjVal, SolVal, newSolver
def k_out_of_n(solver,k,x,rel='=='):
n = len(x)
binary = sum(x[i].Lb()==0 for i in range(n)) == n and \
sum(x[i].Ub()==1 for i in range(n)) == n
if binary:
l = x
else:
l = [solver.IntVar(0,1,'') for i in range(n)]
for i in range(n):
... | __label__POS | 0.841181 |
from gas_blend import gen_raw, gen_refined, solve_gas
def main():
import sys
import random
import tableutils
n=8
m=3
if len(sys.argv)<=1:
print('Usage is main [raw|ref|run] [seed]')
return
elif len(sys.argv)>=3:
random.seed(int(sys.argv[2]))
C=gen_raw(n)
D=g... | __label__POS | 0.815433 |
// class String, for char arrays
// -- from _C++20 for Lazy Programmers_
#include <cstring>
#include "string.h"
using namespace std;
String& String::operator= (String&& other) noexcept // move =
{
if (contents_) delete[] contents_;
contents_ = other.contents_;
other.contents_ = nullptr;
return... | __label__POS | 0.829351 |
package com.apress.cems.repos;
import com.apress.cems.dao.Person;
import java.util.*;
/**
* @author Iuliana Cosmina
* @since 1.0
*/
public interface PersonRepo extends AbstractRepo<Person> {
Optional<Person> findByUsername(String username);
default Set<Person> findAllByUsernamePart(String part){
... | __label__POS | 0.852525 |
package com.apress.cems.dto;
import javax.validation.constraints.NotEmpty;
/**
* Created by iuliana.cosmina on 3/30/15.
*/
public class CriteriaDto {
private String fieldName;
@NotEmpty
private String fieldValue;
private Boolean exactMatch;
/**
* Field needed just to communicate a mess... | __label__POS | 0.658346 |
function Boss(atX, atY, velocity, movementRange, type, texture0, texture1, texture2,
texture3, texture4, texture5, texture6, normal, lightSet, hero) {
this.kMinionTex = "assets/minion_sprite.png";
this.kDelta = 0.1;
this.kWidth = 8;
this.kHeight = 8;
this.kSpeed = 0.02;
this.kSpawnerTota... | __label__POS | 0.618155 |
function Button(cx, cy, texture, type, lightSet) {
this.kWidth = 2.25;
this.kHeight = 2;
this.mIsUnlocked = false;
this.mButton = new LightRenderable(texture);
var i;
for (i = 2; i < lightSet.numLights(); i++) {
this.mButton.addLight(lightSet.getLightAt(i));
}
this.buildSprite... | __label__POS | 0.693103 |
<!DOCTYPE html>
<html>
<head>
<title>Example 8.4: Normal Maps and Illumination Shaders </title>
<link rel ="icon" type ="image/x-icon" href="./assets/favicon.png">
<!-- the following says there are javascript source code contained in
the external source files
-->
... | __label__POS | 0.704012 |
'use strict';
ecomApp.factory('OrderService', ['$http', '$q','$cookies', function($http, $q,$cookies){
return {
addNewOrder: function(orderDTO) {
return $http.post(sessionStorage.getItem('apiUrl')+'/core/order/',orderDTO)
.then(
function(response){
return response.data;
},
... | __label__POS | 0.904677 |
'use strict';
ecomApp.factory('UserService', ['$http','$httpParamSerializer' ,'$q','$cookies', function($http, $httpParamSerializer,$q,$cookies){
return {
addNewuser: function(customerDTO){
return $http.post(sessionStorage.getItem('apiUrl')+'/customer/customer/',customerDTO)
.then(
functi... | __label__POS | 0.628311 |
'use strict';
ecomApp.factory('ProductService', ['$http', '$q', function($http, $q){
return {
getProductsByCategory: function(category) {
return $http.get(sessionStorage.getItem('apiUrl')+'/product/productsByCategory?category='+category)
.then(
function(response){
return response.da... | __label__POS | 0.930453 |
<!DOCTYPE html>
<html>
<head>
<title>Example 8.6: Directional and Spot Lights</title>
<link rel ="icon" type ="image/x-icon" href="./assets/favicon.png">
<!-- the following says there are javascript source code contained in
the external source files
-->
<!-- ex... | __label__POS | 0.768605 |
'use strict';
ecomApp.controller('ProductController', ['$scope', 'ProductService','CartService','$location','$routeParams', function($scope, ProductService,CartService,$location,$routeParams) {
var prodCtrl=this;
$scope.inventory=null;
$scope.quantities = [];
$scope.isStockAvailable = true;
... | __label__POS | 0.684119 |
'use strict';
var ecomAdminApp = angular.module('ecomAdminApp', ['ecomApp']);
ecomAdminApp.controller('AdminController', ['$scope','OrderService','UserService','$http','$window', function($scope,OrderService,UserService,$http,$window) {
var adminCtrl = this;
$scope.shippingOrder=null;
$scope.deliveringOrder=... | __label__POS | 0.709208 |
'use strict';
ecomApp.controller('CartController', ['$scope','$location','CartService','ProductService', function($scope,$location,CartService,ProductService) {
var cartCtrl=this;
$scope.productImgs={}
$scope.init = function () {
if($scope.myCart.lineItems!=null){
for(var i=0;i<$scope.myCart.lineItems... | __label__POS | 0.712274 |
<?php
session_start();
if (!isset($_SESSION['user_level']) || ($_SESSION['user_level'] != 1))
header("Location: login.php");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>View Users Page</title>
<meta charset="utf-8">
<meta n... | __label__POS | 0.655598 |
<!DOCTYPE html>
<html>
<head>
<title>Example 8.5: Material and Specularity </title>
<link rel ="icon" type ="image/x-icon" href="./assets/favicon.png">
<!-- the following says there are javascript source code contained in
the external source files
-->
<!-- exte... | __label__POS | 0.763815 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.