query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
f92e13aa0338229735327b2288da35a9 | 7f61448ad6da3ef0f9cb03f40c5be655 | and characters above ASCII 127 | cases like (1) | 0 |
60f9a71b1fa9d1d88706eab866dc3c07 | 6ec4f594c0ecb5b4339691639adfd9d2 | 封装flink读取kafka数据 | DataStreamSource<String> ds = env.addSource(new FlinkKafkaConsumer011<String>("test", new SimpleStringSchema(), KafkaUtils.getKfkPreperties())).setParallelism(1);
RMQConnectionConfig config = new RMQConnectionConfig.Builder()
.setHost("s-rabbitmq1.qa.bj4.daling.com")
.setVirtualHost("/" +
"xcpcent... | 1 |
b9f003b1f08338c9f40fe5d3ab908eae | b7d7e08483ebe386f31c0c6212814163 | This method shows progressbar and hides the button text | public class BulkLocallyOperationalActivity extends AppCompatActivity
private void showWorkInProgress() {
progressBar.setVisibility(View.VISIBLE);
pbText.setVisibility(View.VISIBLE);
} | 0 |
1179c8cde226b2c1a3c615c9b3629226 | 5483e83bfdace55b8ec9795f995ae31e | ______________________________
Goes to the passed ID in the students array checking
if the ID is set to a defined ID or the ID set in initStudents | for (let i = 0; i < School_Array.length; i++) {
for (let j = 0; J < School_Array[i].Current_Students.length; j++) {
if (School_Array[i].Current_Students[j] === Student_UUID) {
return i;
}
}
}
return -1;
} | 0 |
18bcb08d117ec717b859fb5087e5b6ba | c957cb7149da767b39e3599d7ac4e49a | Determine a good position to 'spawn' the ghost dropoff. | {
bool safePositionFound = false;
int attemptsRemaining = 100;
Vector3 potentialPosition = Vector3.zero;
Quaternion potentialRotation = new Quaternion();
while (!safePositionFound && attemptsRemaining > 0)
{
attemptsRemaining--;
if (inFrontOfO... | 1 |
6464e579007711d1d488d832a65531ee | 11ae107a2bd475cac9a3429a0f736e2c | Checks if spot price has expired | class MarketData
def expired?
self.updated_at.yday < Time.now.yday || self.updated_at.year < Time.now.year || self.updated_at.hour < 3
rescue
true
end | 1 |
e8309758dd9b3d0403c1d17ec16a44da | 3804d366f9c93ef2cc1fd1f7827fe98b | 根据码库id 查询 remote | List<RemoteOperationRecode> selectRemoteInfo(String deviceMac); | 0 |
0577034c43284a95cd76c9dbdecee4f6 | 5ef61cf7aa2b4598cf5d23ac7bfb6fcf | Returns the value of the '<em><b>Voyage ID</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Voyage ID</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | public class FALForm1 implements Serializable
public String getVoyageNumber() {
return voyageNumber;
} | 1 |
3d743b83ae13743de893e45edb7be8fb | c9ad0f6d3a8f0b78f6239c76a48491d3 | Returns a retry policy with the specified error detection strategy and the default retry strategy
defined in the configuration. | namespace Mongo.Framework.TransientFault
ITransientErrorDetectionStrategy CreateErrorDetectionStrategy(); | 0 |
afc03012dd0a20f6c63fe1be89b7be47 | b7547870cedf2b21bfbd569cc710137d | 拼多多回调 | def purchase_callback(request):
AppID = request.POST.get("AppID", "")
OrderSerial = request.POST.get("OrderSerial", "")
CooperatorOrderSerial = request.POST.get("CooperatorOrderSerial", "")
Sign = request.POST.get("Sign", "")
Content = request.POST.get("Content", "")
secret_key = settings.CHANNE... | 0 |
e0de584b03a75262881ebbd65d110661 | 43e882240cde79e0a927487b284d2fa7 | Tests orthonormality of the basis set. | from numpy import linalg
from .msg import err
b1 = basis[0]
b2 = basis[1]
b3 = basis[2]
minkowski_check = True
if linalg.norm(b1) > (linalg.norm(b2) + eps):
minkowski_check = False
err("Minkowski_condition 1 failed: b1 > b2")
if linalg.norm(b2) > (linalg.norm(b3) + eps):
... | 0 |
ccdaedcce59a84b0fa44e8e5d6bf8a64 | 42c50fc9854307567f637655f5ca3eaf | Methode identique a celle transformant une string en tableau de bits mais avec un MP3
Elle transforme donc le contenu (tableau de Bytes) en bits. | {
int limit = TAILLEMOT;
int caractere;
int position=0;
int i=0;
int j=0;
char *mot;
Maillon *maille;
Maillon *m;
int nboctet = compteNbCaracter(texte.fd);
int nbcomp = 0;
float pourcent=0;
float taux;
mot = (char *)malloc(limit);
if(mot == NULL)
{
afficheErr... | 0 |
37465b7ee4edfb0cedd42387968e3279 | 906efd47673cdbe9927d5bdd9ac47ea9 | Get Solution Config Information associated with a given service.
Returns Solution Config information for a given service. | class Service(VapiInterface):
def get(self,
service,
):
return self._invoke('get',
{
'service': service,
}) | 1 |
a42ff503af6e17d60c8428d72a842fab | ec00c95a441d9ce0f103007daf4ed1ad | 获取单个游戏的礼包种类数量 | function getPkListTotal($type) {
if($type > 0 && $type < 4) $value = "WHERE `type`='{$type}'"; else $value = "";
$query = DB::query("SELECT count(*) AS total FROM ng_game_pk {$value}");
$result = DB::fetch($query);
return $result['total'];
} | 0 |
5ac13ebcc93926e7fc69bce872636738 | a66e98822ea3ee7429de1b7917cabd3d | Check if a list of circuit events represents a successfully
finished circuit. | if self._ready_nodes is None:
raise ValueError("prepare() must be called first")
return self._nfinished < self._npassedout or bool(self._ready_nodes) | 0 |
009b2781024062c1116cf68758a42a06 | 3c6409316f0475d8699607a1c982e4e3 | Allows you to mark as positive a user given his or her id
A positive user can be marked positive again
Useful when embedding functionality in a button
Notifications are sent to all his contacts (other customers or operators)
And to the operators who have received your booking
Error status codes:
404 -- User not found | {
$db = $this->negotiateDB($database);
if ( $reference === null ) {
$reference = 'WPTripolis' . (isset($_SERVER['REMOTE_ADDR']) ? '::' . $_SERVER['REMOTE_ADDR'] : '::CLI');
}
$body = array(
'contactId' => $contactId,
'contactGroupIds' => array(
'contactGroupId' => $groupId
),
'reference' => ... | 0 |
1ab22e6641c37e30d240e9af98acd4f8 | 8f9dd12524bd14c75ab66633980bfc6e | regarde si tous les paniers sont chargés
si oui, on lance le diaporama. | function crtPanier (){
if (localStorage.getItem("monPanier")){
}else{
let init = [];
localStorage.setItem("monPanier", (JSON.stringify(init)));
window.location.reload();
}
} | 0 |
656cfa7bd6d4238082b0e33f0cd731e5 | deccb209d7585edb99fc77407412af14 | 设备租赁合同 打包文件的下载 (压缩下载) | @Controller
@RequestMapping("/device/rent")
public class DeviceRentController
@GetMapping("/doc/zip")
public void downloadZipFile(Integer id,HttpServletResponse response) throws IOException {
DeviceRent deviceRent=deviceService.findDeviceRentById(id);
if (deviceRent==null){
throw new Not... | 1 |
08fae5ace81c94331ddb946f0b54d648 | 54d9f4a7bf13dbe70046eb3523655e04 | r"""Get the commands executed on this vertex.
Returns:
List: command list | class Cmd:
def command_list(self):
return self._command_list | 1 |
c82059a22193661e85b4e778352e36a8 | fca02a9e14a31ecf8d6200c8f9346da5 | 获取本年的注册用户数 | @Table(name = "web_info")
public class WebInfo
public Integer getUserRegisterNum() {
return userRegisterNum;
} | 0 |
c7d84b469ec46a62d9e2ea6876ace870 | 8f07c98f213465d6f624a726f85abcf3 | Deletes piece on board, by setting posn to None. | def remove(pos: list) -> None:
grid[pos[0]][pos[1]].passable = True
grid[pos[0]][pos[1]].enemy = False | 0 |
fde2c0f7dafefd992ab364af2d9c5908 | d25e9df497d083151565421cd0a2d356 | Show selected media summary in a textbox | var sender = (e && e.target) || (window.event && window.event.srcElement);
document.getElementById("newMediaType").innerHTML = sender.text.toString() + ' <b class="caret"></b>';
} | 0 |
7b1d89d112cd96faaa18334d8acf8b2e | 7c2afc08c62774540409ad5cb4b3466e | <pre>
Optional. HCFS URIs of files to be placed in the working directory of
each executor.
</pre>
<code>repeated string file_uris = 5 [(.google.api.field_behavior) = OPTIONAL];</code> | class WorkflowTemplateJobHadoopJob(dict):
def file_uris(self) -> Optional[Sequence[str]]:
return pulumi.get(self, "file_uris") | 1 |
9621fed5d370009a590d2f449e6a4f3b | d3fe8e72b378e9c851c58d4743764796 | Attempts to log the user in using stored credentials if present | namespace realworld.spaf.Services
Task TryAutoLoginWithStoredToken(); | 1 |
7f250b335d40c19eab717044c2dcdb56 | 2ac6f6ff33035457555830ebddb527e0 | Trapezoidal integration over a potentially irregular grid | def cumtrapz(value, grid, initial=None):
return it.cumtrapz(value, grid, initial=initial) | 1 |
9c56bb3ddb1411c3a0d9565b4a9bf2b5 | e36f084a23c9069fe609fb0e771bf76b | 修改FTP配置 | async function update (ctx) {
const ftp = await Ftp.findById(ctx.params.id).exec();
const updated = _.assign(ftp, _.omit(ctx.request.fields, ['_id']));
ctx.body = await updated.save();
} | 1 |
556e39027dfb08d8cf1851be1e058c72 | 59947401f1481314cb8b40223b0804a7 | A generic method to create a building group. | public class CityBuilder
private GameObject BuildSingleBuildingNodeGroup(GameObject building, NodeGroup nodeGroup, Triangulation triangulation) {
GameObject buildingNodeGroupGo = new GameObject(building.name + "_nodes");
buildingNodeGroupGo.transform.SetParent(building.transform, false);
foreach (Node node in nod... | 1 |
ed106d32f44bd0204ef10d1f32f3965c | 6cdb9b26fcc891187b201094fe845f50 | Do nothing. Just redirect to product list action. | class ProductController extends ApiController
public function action()
{
} | 0 |
93417ed0f67f61364cd9534ac76d6800 | bcd7afc9907fcdb0d76882f477df8cec | subscribes serial port interrupts for recived transmition | namespace CDMA
public partial class Form1 : Form
private void Form1_Load(object sender, EventArgs e)
{
serialPort1.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
} | 1 |
132d3c9130f9fd6c3739ea6afb0f7719 | 1788b106f9720cca6c79fe0d3aacf13c | Добавление элементов в стек 2 | {
struct stack *temp =(struct stack *)malloc(sizeof(struct stack));
temp->data = number;
temp->next = NULL;
if(topstick2 != NULL)
{
temp->next = topstick2;
}
topstick2 = temp;
} | 1 |
27a9de8174dc17a8bfdd3f4a69787643 | 14e98129d5a04cb69ff0fdd17829cef9 | @brief Gets the current maximum 'x' value | DataType & Painter::set_zoomed_max_x()
{
return max_x;
} | 0 |
012a15c3061e7e92cd42aa67bc797c2f | 2d768ecc3db03eff47b294418221d02c | Create a configuration file under the config dir.
Also creates any intermediate paths needed so the file can be
in a subdirectory. | config_filepath = os.path.join(dirpath, CONFIG_YAML_FILENAME)
config_filepath = os.path.expanduser(config_filepath)
config_filepath = os.path.abspath(config_filepath)
with open(config_filepath, "w") as f:
yaml.dump({}, f)
return config_filepath | 0 |
3064b05aec3c77f91a5489655336dcc2 | 5a147080cf49c2c54243c88db7204e01 | Removes a certain entity (by it's ID) from the control list | namespace CGUI
public class ControlList : IEnumerable
public void Remove(Control control, Control focusNext)
{
if (GetControlIndex(control) > -1)
{
VGADriver.DeleteControl(control, focusNext);
Controls.RemoveAt(GetControlIndex(control));
}
... | 0 |
f3f7dd66f745b1dba8fc501208789362 | 913323570de591cb1a279831fba7102a | Parameterless constructor(ctor) | class Test
Test(int a, int b)
{
;
} | 0 |
8aed1fcd25d50ebfe67b5879163ab97f | 45bfefd6659352e0b12cec0c49af0a2e | Returns if both www sub domains are unreachable | class TestLiveliness(unittest.TestCase):
def test_httpwww_only(self):
self.domain.httpwww.live = True
self.assertTrue(is_live(self.domain)) | 0 |
39ac8645cb4a8c67e81c57863057dc2a | 610d4295d935abfd2a0bf2a5b0060ce0 | 将时间差转化为秒 | long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
long ns = 1000;
long diff = endDate.getTime() - nowDate.getTime();
long sec = diff / ns;
return sec;
} | 1 |
206a152b77b2453a553a0c4cbdcde60e | ffec4b39a1cf83671929daa52fb3989c | Cancel the task to delete state users (started with
{@link #deleteStaleUsers()}) if it is running. | public void onDestroy() {
super.onDestroy();
if (mGetUserGroupmatesTask != null) {
mGetUserGroupmatesTask.cancel(true);
}
} | 0 |
17ebf315e4cbcfd8f328e23f3615c3e1 | aaaff71785a3175afc191047e961bde3 | Will go through the Fibonacci sequence until number is found or the sequence number is greater than the target value | if (count($this->fibonacciSequence) == $numberOfNumbers) {
return $this->fibonacciSequence;
} else {
$this->fibonacciSequence[] = $this->getPreceding(1) + $this->getPreceding(2);
return $this->calcSomeFibos($numberOfNumbers);
}
} | 0 |
24939d96cc844bededc68cfe5b1f14e8 | ebbfa00a30282fe4d95dd2a5993012d1 | Fetch and return the values associated with the given +key+s from the
cache. Returns +nil+ for any value that wasn’t in the cache. | class KV
def exists(key)
validate_key(key)
mexists([key]).map { |values| values[0] }
end | 0 |
a5a2b47f3d75d258d3e42e57b6da55fa | bdee56c78b5afe15ef9d1c5d3f583fbf | Gets the cardholder_id of this Cardholder.
Identificador único do portador. # noqa: E501 | class WebPayTokenizationResponse implements ModelInterface, ArrayAccess
public function getCardId()
{
return $this->container['card_id'];
} | 0 |
d66b541dab14afb32c4aed811699820d | e3df291e63e97f5f8b2ba8fd867d4700 | 根据子订单的id获取该订单的分派状态是否开启 | class StoresOrderdispatchModel extends BaseModel
function getWuliuStatus($parent_order_id,$storeorder_id){
$f_s=M("stores_order")->where("storeorder_id=".$storeorder_id." and parent_order_id=".$parent_order_id." and shipping_status=2")->find();
$return['status']=0;
if($f_s){
$f=M("stores_orderdispatch d")->fi... | 1 |
462707738a55ed01a96339906185c98e | 6bc33304893acaf2375b0bbac19c46c7 | Second part of the discover process.
1. Grabs a message that has been sent from the first part and thus we know that the source port is
and active ISL.
2. Check the status of the destination port, in Path[1], and if activeISL then emit to Kafka | bool isData,
unsigned msgSize,
double timeoutDelay,
bool dstNodeIdPresent,
unsigned dstNodeId)
{
} | 0 |
b1f4a926e0f137d6de4222ed396cef00 | 1a56030cf0eb9a31ca9cf0f805919701 | 生成 AudioBook 下载数据 | abstract class DetailPresenter extends BasePresenter<DetailView, Model>
public abstract List<DownloadAudioBean> loadDownloadData(); | 1 |
bfbb66a2400a07d4d8494b9b4b0478c9 | 75f9548799dc3d01793ee09f3ec25501 | Returns the billing_ hording with the primary key or returns <code>null</code> if it could not be found. | function Cached_getBillingByBillingNo(billingNo, pi_list) {
var list = pi_list;
if (list == null)
list = Cached_getBillingList();
var foundObj;
$.each(list, function(i, beanObj) {
if (beanObj.billingNo == billingNo) {
foundObj = beanObj;
return false;
}
});
return foundObj;
} | 1 |
9a15ac8070e7bae48d8a5151dadaaf2a | 4e98357ccd66be48a194909357721b5d | Creates and sends all dut info packet to server | public class WiPortManager
public void sendUDP(){
try {
InetAddress host = InetAddress.getByName(serverAddress);
int port = 30704;
DatagramSocket ds = new DatagramSocket();
byte [] data = new byte[9];
byte[] data_ = makePacket(vibration, ledRed, ledGreen, ledBlue, motorRight, motorLeft);
DatagramPac... | 1 |
0e7091239181d85385dd731b6061f13b | 0467df8a93bd979de9601411e85a6b6d | 가장 많은 급여를 받은 직원이 누구인지 알려주는 메서드 | @Query("select e.name from Employee e where e.salary=(SELECT max(em.salary) from Employee em WHERE em.companyId = ?1)")
String findEmployee(Integer companyId); | 1 |
319359399768015eafe59693eb7a8185 | 6474ee1e2a191ae43ffe07c330502c49 | 配置TLS的http2处理器 | tlsconfig := new(tls.Config)
tlsconfig.Certificates = make([]tls.Certificate, 0)
urls := make(map[string]*url.URL)
for _, v := range allConfig {
if !v.ListenHttps {
continue
}
cc, err := tls.LoadX509KeyPair(v.CertFile, v.KeyFile)
if err != nil {
fmt.Println(err, cc)
continue
}
tlsconfig.Certifi... | 0 |
57e6b7c3ecd2a0934d4e0af2abadcf4d | 37c53c3169a50be77fdf69996afe8839 | loops through all the labels and sets them as true hence making them visable | {
for (int i = 0; i <= 20; ++i)
{
if (i >= 0 && i <= 5)
{
NYX.setTrue(i);
NYY.setTrue(i);
}
if (i >= 6 && i <= 10)
{
SFX.setTrue(i);
SFY.setTrue(i);
}
if (i >= 11 && i <= 15)
{
LAX.setTrue(i);
LAY.setTrue(i);
}
if (i >= 16 && i <= 20)
{
CHX.setTrue(i);
CHY.setTrue(i);... | 1 |
32895c66390e7220b4b90feb925d8478 | fb4ec046fe21b781f658a0374191a4f0 | Changes materials for all keys | {
foreach (KeyValuePair<GameObject, Material> obj in originalMaterials)
{
obj.Key.GetComponent<Renderer>().material = obj.Value;
}
} | 1 |
fdbbd1aa97e941b6fbcf02ff26165199 | 78b456308df1889f10cbb1a2ccbb2c1f | Ottiene le registrazioni FIN per cui e' necessario inserire la prima nota.
Nel caso in cui non sia necessario inserire la prima nota (nessuna regisrazione inserita) restituisce una lista vuota. | final String methodName = "controllaNecessitaRichiestaUlterioreConferma";
if(model.isEsisteUnaRegistrazioneNonAnnullataPerLAccertamentoAssociatoAllaQuota()) {
return SUCCESS;
}
for (SubdocumentoEntrata subdocumentoEntrata : model.getListaSubdocumentoEntrata()) {
List<RegistrazioneMovFin> registrazioni = o... | 0 |
00e0ee59011e8805465d1c023e3704c6 | 4c4a2749d6d90267fdc9e619de30907f | Display a listing of the BagItems. | class BagController extends Controller
public function actionIndex()
{
$searchModel = new TblbagSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvi... | 1 |
66c2d371914366639da20ff23b44c4b9 | ce8e24f645010c09b4328528cb582ede | Draw pin pad | pin = Image.load("image/pin2.png")
Window.draw_scale(170, 170, pin, 0.5, 0.5)
Window.draw_scale(200, 170, pin, 0.5, 0.5)
Window.draw_scale(230, 170, pin, 0.5, 0.5)
Window.draw_scale(260, 170, pin, 0.5, 0.5)
Window.draw_scale(185, 180, pin, 0.5, 0.5)
Window.draw_scale(215, 180, pin, 0.5, 0.5)
Window.draw... | 1 |
c804e24125b922c58e84defeea83c557 | a64102ae22e15432f92680745b29f2d6 | Wypisuje na standardowe wyjście wartość wyrażenia. | def wyswietl(wynik):
print(wynik)
return | 1 |
28b0b41caa6b060fb1510c77fc69817a | 952391df606f2b6af6f2163004aa5f91 | Test smart_ptr<T>::operator-> | class SmartPointer
Obj* operator->() const
{
if(!oc.a[index])
{
cout << "Zero value";
return (Obj*)0;
}
return oc.a[index];
} | 1 |
295f2541c08673b1a09ea1d0669b89cd | 840e4e9fc3e6d821b1cb921edd616dbc | 若队列不为空,用 e 返回 Q 的队头元素并返回 TRUE, 否则返回 FALSE | if (q->front == q->rear)
return false;
else {
e = q->data[q->front];
q->front++;
return true;
}
} | 1 |
d950a3dd60f962ae09a7bcff8b61efbe | 7b482302d5ef2eeb47f0aec94657967a | Mount user's moods and activities from state | function handleMoodsHook()
end | 0 |
f0593563d877d63cb7c685bac63d290f | 0e449eb78d783004325fdbf04a205854 | based on VL53L0X_perform_single_ref_calibration() | uint32_t data_size,
uint32_t *read_cnt,
cs_step_t *out)
{
sl_status_t ret = SL_STATUS_OK;
uint8_t data_octet;
ret = read_byte(data, data_size, read_cnt, &out-... | 0 |
4bde4e903defe9cf66d1940d369a94eb | 8de2dd0787ab74b7d09283841fee3c3b | Compare dbname of real keys | class Acad_Model_Course_DmcInfo extends Acad_Model_Generic
protected function correctDbKeys ($key)
{
switch ($key) {
case 'total_marks':
return 'max_marks';
break;
default:
return $key;
break;
}
} | 0 |
bcef17fcfc5775634f152bce92936f17 | 47045e17bd0bf6e957f29574d426e338 | returns list of all the ports | class Board:
def get_port_list(self):
return self.__port_list | 1 |
45d86f04fc9c8c7d717b744a1ff98805 | f2b45fb4177dc711670021b529eb566b | Generate Auth
Uses the stored user/pass to generate an authorization token
Returns:
str | byte_user_pass = bytes("{u}:{pw}".format(
u=self._username, pw=self._password), "utf-8")
b64_str_userpass = base64.standard_b64encode(
byte_user_pass).decode("utf-8")
return {"Authorization": "Basic {}".format(b64_str_userpass)} | 1 |
7a92a9216591d58d32d92bacf19100e6 | 3b36abf2625e05406783a39d17f21b3a | 根据classify进行删除 | {
Dictionary<string, object> dic = new Dictionary<string, object>();
dic.Add(nameof(Model.Project.ClassifyId), classifyId);
return dal.Delete(dic)>0;
} | 1 |
87a43c29c2f08f483000207cbbd42bc0 | 29c10818a7176ebaa7cab0a564866b22 | Converts position of antenna and position of satellite to
azimuth and elevation angle of satellite relative to antenna | assert type(ha) == type(dec)
sinalt = np.sin(dec) * np.sin(lat) + np.cos(dec) * np.cos(lat) * np.cos(ha)
alt = np.arcsin(sinalt)
cosaz = (np.sin(dec)-np.sin(alt)*np.sin(lat)) / (np.cos(alt)*np.cos(lat))
convert_to_float = False
if isinstance(cosaz, float):
cosaz = np.array([cosaz])
... | 1 |
eea583d3f60844e45a2880e2fe3ad3d6 | 3efad3cb3f7e3773b7d44237556c4e65 | Returns dynamic range of passed signal - max-min. | def peak_range(df):
return df.max() - df.min() | 1 |
dfcf622cc3feebebe27b2a453361c7ff | da8f4daada423750d645e3160cbb0cc2 | Ferme la fenêtre d'introduction et lance le jeu. | def rejoueQuit():
time.sleep(1)
play = True
while play:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
if event.type == pygame.KEYDOWN and event.key == pygame.K_SPACE:
main() | 1 |
f9332a715479c104dc5449114435d060 | 283026e56aafe9eb2e739c1f5ebaf887 | Load all EmailMessageRoutes | class EmailMessageGen extends QBaseClass
public function UnassociateAllEmailMessageRoutes() {
if ((is_null($this->intId)))
throw new QUndefinedPrimaryKeyException('Unable to call UnassociateEmailMessageRoute on this unsaved EmailMessage.');
$objDatabase = EmailMessage::GetDatabase();
if ($objDatabase->Jour... | 0 |
06f0a1269e44192c5d05fe0da691f4d6 | c5958bc3ed254b00229199424787fc1a | 判断科目是否勾选了核算项 | function isZyNjChecked(zy_arr,zydm_id,njdmb_id){
var is_zy_nj_checked = false;
$.each(zy_arr,function(index,row){
if(row["zydm_id"]==zydm_id){
var current_zy_nj_list = row["list"]||[];
$.each(current_zy_nj_list,function(index,zy_njdm_id){
if(zy_njdm_id==njdmb_id){
is_zy_nj... | 1 |
d3f1b87da3e29af879f727cd427aacd7 | 4654aa9f9f2cc1388fff6542854be66c | Mostrar mapa para colocar návios dos players. Quase a mesma lógica da função mostrar_mapa_jogo() | for l in range(x+1):
for f in range(y+1):
if l > 9 and f == 0:
print(lista_mapa[l][f], end=" ")
elif f > 9 and l != 0:
print(lista_mapa[l][f], end=" ")
else:
print(lista_mapa[l][f], end=" ")
print() | 1 |
db57007d4ee5c6dacbd9de06b729a3a3 | ba8684ec32df9d7cf1bc1775d615036f | Removes the given elements from the collection. | public abstract class OpenCollection<E> extends Collection<E>
public int removeElements(E[] elements) {
logger.entry(elements);
int count = 0;
for (E element : elements) {
if (removeElement(element)) {
count++;
}
}
logger.exit(count);
... | 1 |
1b3f12f4e07114eac912fdf728b8663d | 70d9c8d55e723e2551c49b7186acdc0a | Linearly interpolates `da` along dimension `dim`. This function
returns a function that evaluates `da` at a set of values along
dimension `dim`. | domain = as_float_array(domain)
if len(domain) != 2:
return domain
else:
assert is_numeric(size), 'Linear table size must be a numeric!'
return np.linspace(domain[0], domain[1], size) | 0 |
0c2b5218969a3b7a9811ebcc5a118bee | d35ebe6d91815b59c56759e7d2100052 | remplissage initial avec des têtes, pour les listes chaînées des tables | @Stateless
public class CreationPDF
public Document insererEnTeteTableau(Document document) throws DocumentException {
PdfPTable table = new PdfPTable(4);
table.setSpacingBefore(50);
PdfPCell defaultcell = table.getDefaultCell();
defaultcell.setFixedHeight(35f);
defaultcell.setVerticalAlignment(Element.ALIGN... | 1 |
6a3aeae78a5e50dd58149d4e9893ce3e | 2819ad5c0c18ee8909403eb513828847 | esta funcion extrae los usuarios y claves del archivo "usuarios.txt"
para devolver se lo al sistema en un map por referencia | public HashMap<String, Usuario> load(){
String filePath = this.directory + this.filename;
File f = new File(filePath);
ObjectInputStream in;
HashMap < String, Usuario> users = null;
try {
in = new ObjectInputStream(new FileInputStream(f));
users = (HashMap <String, Usuario>) in.readObject();
in.clos... | 0 |
ba1c36d15ce2c3aa7c60c43dcb47921d | e0963a6f21586d897a2b4567e3a09d14 | 通过倍率和周期计算每个周期的倍率 | public final class FinanceCalculateUtils
public static BigDecimal[] getPeriodAndModRate(BigDecimal rate, int periodNum, int roundType) {
BigDecimal[] result = new BigDecimal[2];
result[0] = rate.divide(new BigDecimal(String.valueOf(periodNum)), 18, roundType);
result[1] = rate.subtract(result[0]... | 1 |
52de1dcef70fdeea5ca86e0b9b43806b | be433f0a565f8b4437f1c94c9acb3bd0 | render HTML to be displayed in service card | class ProductsController extends \craft\web\Controller
public function actionRenderCardHtml(): string
{
$id = (int)Craft::$app->request->getParam('id');
$product = Product::find()->id($id)->status(null)->one();
return ProductHelper::renderCardHtml($product);
} | 1 |
39acfca4c08842da3c0a87755a6cd4d7 | 279e7fe35ad8ad44a633d89e7d401068 | grants a point to the computer every time the player loses | {
if (this.player < this.computer)
{
this.numberOfLosses = this.numberOfLosses + 1;
}
} | 0 |
bd840a8be89c149b9b8434f9c45918a0 | 7927c1d1bc9fc9152323009572b3f099 | Выбираем сертификаты для работы | function openSertificate() {
$(document).ready(function() {
document.querySelectorAll('.sertificate__zoom').forEach(item => {
item.addEventListener('click', function() {
document.querySelector('.modal__block img').src = this.parentElement.parentElement.querySelect... | 0 |
b1360765b5aee37481b46c3360c149ab | 897b065b576c948bcf28d2d27e30c667 | https://github.com/opencontainers/distribution-spec/blob/main/spec.md#deleting-manifests | if withDigest, ok := image.(reference.Canonical); ok {
return withDigest.Digest(), nil
}
tagSvc := repo.Tags(ctx)
tag := "latest"
if withTag, ok := image.(reference.NamedTagged); ok {
tag = withTag.Tag()
}
descriptor, err := tagSvc.Get(ctx, tag)
if err != nil {
if _, ok := err.(*client.UnexpectedHTTPRespo... | 0 |
06692b9fdab079ad9eb24b5c4eb14bf4 | d493a1cf10cf4a85bf0d1621b5942fa9 | Handler for webhook calls directly from mbed cloud | def webhook():
send_welcome_message()
set_get_started_button()
data = request.get_json()
log(data)
if data["object"] == "page":
for entry in data["entry"]:
for messaging_event in entry["messaging"]:
if messaging_event.get("message"):
sender... | 0 |
0a5a3d21a969b9027af2991106eb75af | e23d9c506ef232debf195e98c8827776 | Issue a {@link android.content.ContentResolver#requestSync} for a specific mailbox. | String providerAuthority = getResources().getString(R.string.provider_authority);
Bundle bdl = new Bundle();
getContentResolver().requestSync(account, providerAuthority, bdl);
} | 1 |
de39746ebf9963aa439d1f9cb996fec5 | 009b178ac2fb4e52b3b2557f60fc1294 | 写入头条首页的request | public String body(HomeForm formbean,Model model,HttpServletRequest request){
String ip =request.getRemoteHost();
VistRecord vr = new VistRecord(ip, new Date());
vistRecordService.save(vr);
request.getSession().setAttribute("vistcount", vistRecordService.getCount());
formbean=new HomeForm("xue", "down", "ton... | 1 |
a5cbccdd95e24b41b3a7e58f1e88f99d | 41d78bb70b559508dc01e1a93cc0289f | Получение параметров фильтра в виде строки XML | if (this.properties.size() == 0) {
return "";
}
StringBuilder sb = new StringBuilder();
for (Entry<String, Object> entry : this.properties.entrySet()) {
sb.append(String.format(FILTER_STRING_FORMAT, entry.getKey(), entry.getValue()));
}
if (this.pr... | 0 |
b71d8e9f810cdbf90aa4bc70f3d7deaf | 97f7d883891b6f235c662fbe54659438 | 切换至指定sheet,失败返回false | {
try
{
ISheet sheet = _myExcel.GetSheet(sheetName);
if (null == sheet)
{
return false;
}
_myExcel.SetActiveSheet(_myExcel.GetSheetIndex(sheet));
_activeSheet = sheet;
... | 1 |
f8ceb3f1ffe821a1b0995bebfe8a3b71 | 6569c3f1c0addf5eb54f8c3a651aba41 | 检查调整后的教师和场地是否存在冲突 | {
$Teacher_id1 = $Teacher_id0 = request()->input('beforeteacher_id');
$Course_id = request()->input('beforeclass_id');
$Classroom_id1 = $Classroom_id0 = request()->input('beforeclassroom_id');
$Teacher_name0 = request()->input('beforeteacher_name');
$Teacher_name1 = request()... | 1 |
a9f8478a57f27367729998dc05bb43b2 | 93373e8b73f3149b5073ed1e47fbc96b | 科室信息分页查询 | public PageBean listDeptOfPage(PageBean pageBean); | 1 |
61f38dbd05349680bede536dca012370 | 71f286c37ef9bf31adc74cafdfad3437 | https://github.com/cfwheels/cfwheels/blob/cf8e6da4b9a216b642862e7205345dd5fca34b54/wheels/global/misc.cfm#L112 | return textTpl.FuncMap{
"title": strings.Title,
"toUpper": strings.ToUpper,
"toLower": strings.ToLower,
"crlfEscape": func(q string) string {
q = strings.Replace(q, "\n", `\n`, -1)
return strings.Replace(q, "\r", `\r`, -1)
},
"quotesEscape": quotesEscape,
"jsonEscape": jsonEscape,
"htmlEscape": h... | 0 |
63123b3fad4ad6a6b23a6d5789fa9d8a | f9fd78a74ab8e1b4cdb7ce5544512c50 | 根据javabean对象组织日志内容 | if (args == null) {
return null;
}
StringBuffer rs = new StringBuffer();
rs.append(mName);
String className = null;
int index = 1;
for (Object info : args) {
className = info.getClass().getName();
className = c... | 1 |
e079ccd3ff96d6db688f795fa9a8260a | fc016c2aace610990bcbeddfca812464 | 打印出每一步的概率值 | for(int i=0;i<2;++i){
for(int j=0;j<STEP;++j){
printf("%4.2lf ",pheromone[i][j]);
}
printf("\n");
}
} | 1 |
4af2d14d8d08c78f672ab1d859a5321e | c47da0fd75962a9cb17fd9e734d6459b | Get show product count setting | public function getShowCounter(): int
{
return (int)$this['SHOW_COUNTER'];
} | 1 |
f0e4547285a6a5373c78e8f0612fcf9c | a84f653616165579f715fa72fc50b25f | 微信分享 微信分享好友 仅分享图片 | public class WxActivity extends AppCompatActivity
public void testShareImage2friend(View view) {
share2Wx(true);
} | 1 |
f48e5d21178769739c8a0460854f6cc0 | 1be24e4c42237abb4497793c047439b4 | Метод вызывает каждый раз, когда изменяется количество игроков
(добавляется новый игрок или удаляется существующий)
При этом от сервера приходит сообщения вида:
{"action": "players", 'players' : {....} } | if (!messageData.playerListUpdate) return
const players = messageData.playerListUpdate.playerUpdates
if (!players) return
connector.setPlayers(players)
updateRPC({ partySize: players.length })
} | 1 |
b862bec518f174824da9a9c01383b4ca | 428fe42d57349293ac2f459d080bfd1c | \brief Play recording. | {
uint8 result;
char *mp2_buff_addr = (char *) MURAM1H_ADDR;
char *mp2_array_addr = log_table;
memcpy(mp2_buff_addr, mp2_array_addr, sizeof(log_table));
result = recSendCommand(MC_OPEN, 0);
recSendCommand(MC_SET_RECORD_DELAY, (void *) g_record_vars.rec_DelayTime);
recSendCommand(MC_SETGAIN_D... | 0 |
4937152c415dc3c0984d8b6f68b58ae5 | 81666e1aa0c7bb8aeb74a54f7bd052b1 | Direction of movement based on previous position of dragging widget | if (oldPos[0] === newPos[0]) {
if (oldPos[1] > newPos[1])
return moveDirection.W
else
return moveDirection.E
}
else {
if (oldPos[0] > newPos[0]) {
if (oldPos[1] === newPos[1])
return moveDirection.NW
else
... | 1 |
3f8b653a41229dc2be0b3b637bb9285a | c6d5c827c6b61e45257fd4dc3295cd08 | sub-function for GradWENO | void EulerSolver2D::Solver::lsq_gradients_nc(
EulerSolver2D::MainData2D& E2Ddata, int inode, int ivar) {
int in, inghbr;
int ix, iy;
real da, ax, ay;
ix = 0;
iy = 1;
ax = zero;
ay = zero;
for (size_t in = 0; in < E2Ddata.node[inode].nnghbrs; in ++) {
inghbr = (*E2Ddata.node[inode].nghbr... | 0 |
32e52030beb45080c769910a2516c509 | a38308ad22ce672a0f2a5967f1e60631 | 全加 | if(option & CAL){
for(int it=0;it<2;it++){
for(int il=0;il<16;il++){
this->cal[it][il] += d->cal[it][il];
}
}
}
if(option & FC){
for(int it=0;it<2;it++){
for(int il=0;il<4;il++){
this->fc[it][il] += d->fc[it][il];
}
}
}
for(int il=0;il<4;il++){
for(int ixy=0;ix... | 1 |
0135085da2d459edd7d453cbd7053ad0 | b3befa92dee4a58abef339564d9f9fc4 | @brief Picks VR widgets and updates clipping cube. | {
for(int side = LEFT; side <= RIGHT; side++)
{
for(unsigned i = 0; i < vcore[side]->NumGestalts(Gestalt::CUBE); i++)
{
Cube *core_cube = (Cube*)vcore[side]->Gestalts(Gestalt::CUBE, i);
if(!vcore[side]->use_masking || !core_cube->IsMasked())
{
TmpCube cube(core_cube);
if(cube.IsValid())
cu... | 0 |
3c314a6e0b98c04b4acc8208724a739a | 4407e0640d2111f735d8e3f9cb92aa7f | 将结构体写入文件 | {
if (fwrite(&member, sizeof(member), 1, fp) <= 0)
{
std::cout << "write error!" << std::endl;
return false;
}
return true;
} | 1 |
9dde1f59b411ea7304a165258221dfad | a72158986f95519e2da26815c601fd8f | 微信支付完成后的门票订单更新 | @Service
public class PayDayServiceImpl implements PayDayService
@Override
public void wxUpdateOrder(HttpServletRequest request, HttpServletResponse response, Operator operator) {
String out_trade_no = "";
synchronized (this) {
try {
String appkey = WxpayConfig.key;
ResponseHandler resHandler = new Resp... | 1 |
31399acfd97b945d3d27e536a949cbf1 | 344d6125339a6176a93889ff4994139b | Reduces max number of addresses that a user can have | class AddressViewSet(mixins.CreateModelMixin, mixins.UpdateModelMixin, GenericViewSet):
def create(self, request, *args, **kwargs):
count = request.user.addresses.count()
if count >= constants.USER_ADDRESS_COUNTS_LIMIT:
return Response(ec.ADDRESS_LIMIT, status=status.HTTP_400_BAD_REQUEST)
... | 1 |
84c37466a2fb0497fc0326c7e5a31356 | 1c1992abbf8ab7e6589dba081ab72463 | Returns the meta object for the reference '{@link dC.Transition#getTarget <em>Target</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Transition_targetContainer_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Transition_targetContainer_feature", "_U... | 0 |
cb4787b8c924a7aafcb19ae5f7b2ef15 | 160cde7fc090eb52184e5b8a92b7a9bf | 窗口显示在屏幕右下角,并且窗口从右边往左边滑入 | public class ChatPopWindow extends PopupWindow implements View.OnClickListener, ChangeInfoWindow.OnAddContantClickListener
public void showAtBottom(View view) {
showAsDropDown(view, Math.abs((view.getWidth() - getWidth()) / 2), 0);
} | 0 |
b4113dbc2ca55c7ea771d34f8cb9b872 | c6528e83be56e33c8a3e72810dbd70fe | Returns an arraylist of the items in the list from head of list to tail of list | public String[] toArray() {
if(head == null) {
return new String[0];
}
Node current = head;
String[] neededArray = new String[itemCount];
int entry = 0;
while(current != null) {
neededArray[entry] = current.data;
entry++;
current = current.next;
}
return neededArray;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.