content stringlengths 10 4.9M |
|---|
package com.company.MidExam.E02;
import java.math.BigDecimal;
import java.util.*;
public class P03Numbers {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[] numbersArr = Arrays.stream(scanner.nextLine().split(" "))
.mapToInt(Integer::parseIn... |
import styled from "styled-components";
export const CardSearch = styled.div`
width: 282px;
height: auto;
left: 0px;
top: 100px;
margin-top: 20px;
background: #29274B;
box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.5);
border-radius: 10px;
@media only screen and (max-width:... |
<gh_stars>1-10
package string_memset
import (
unsafe "unsafe"
libc "github.com/goplus/libc"
testing "testing"
)
var buf_cgo1 [400]int8
var buf2_cgo2 [400]int8
var pmemset_cgo3 func(unsafe.Pointer, int32, uint64) unsafe.Pointer
func aligned_cgo4(p unsafe.Pointer) *int8 {
return (*int8)(unsafe.Pointer(uintptr((uin... |
<filename>spring/interfacesDAO/AdminDAOInterface.java
package ttps.spring.interfacesDAO;
import ttps.spring.model.Admin;
public interface AdminDAOInterface extends GenericDAOInterface<Admin> {
public Admin recuperarAdmin(Long id);
} |
import Hooks from 'burdy/src/shared/features/hooks';
import asyncMiddleware from 'burdy/src/server/middleware/async.middleware';
import Tag from 'burdy/src/server/models/tag.model';
import { getEnhancedRepository } from 'burdy/src/server/common/orm-helpers';
import Post from 'burdy/src/server/models/post.model';
import... |
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DaffProductModule } from '@daffodil/product';
import { DaffLoadingIconModule } from '@daffodil/design';
import { ProductGridModule } from '../product-grid/product-grid.module';
import { BestSellersComponent } from './be... |
<gh_stars>0
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
@api_view(['GET'])
def api_root(request, format=None):
return Response({
'cabinets': reverse('api_v1:hardware:cabinet-list', request=request, format=format),
... |
For Whom the Bell Trolls: Troll Behaviour in the Twitter Brexit Debate
In a review into automated and malicious activity Twitter released a list of accounts that they believed were connected to state sponsored manipulation of the 2016 American Election. This list details 2,752 accounts Twitter believed to be controlle... |
package de.mygrades;
import android.app.Application;
import android.database.sqlite.SQLiteOpenHelper;
import android.preference.PreferenceManager;
import de.mygrades.database.DatabaseHelper;
import de.mygrades.database.dao.DaoMaster;
import de.mygrades.database.dao.DaoSession;
import de.mygrades.main.alarm.ScrapeAlar... |
Whether you are in the web hosting business, or run a few web sites on a VPS yourself, chances are you want to display visitor statistics such as top visitors, requested files (dynamic or static), used bandwidth, client browsers, and referring sites, and so forth.
GoAccess is a command-line log analyzer and interactiv... |
The Saskatchewan government passed legislation Wednesday that would allow it sell up to 49 per cent of the province's Crown corporations.
Bill 40 creates a legal definition of privatization that allows the partial sale of a Crown without requiring a vote of support from the people of the province.
Up to 49 per cent o... |
// Define a class, but leave its key function undefined.
class C
{
public:
C() : c(1) { }
virtual void set();
virtual void clear();
int c;
} |
<reponame>afgoulart/react-analytics
import {
EventArgs,
GaOptions,
InitializeOptions,
Tracker,
TrackerNames,
FieldsObject,
TimingArgs,
Plugin,
TestModeAPI,
OutboundLinkArgs,
OutboundLinkProps,
} from 'react-ga';
export type ReactGAType = {
EventArgs: EventArgs;
GaOptions: GaOptions;
Initial... |
/*
* Copyright (c) 2019 <NAME>
*
* This file is part of http-ece, which is MIT licensed.
* See http://opensource.org/licenses/MIT
*/
package httpece
import (
"crypto/elliptic"
"crypto/rand"
"encoding/base64"
"encoding/binary"
"log"
)
var debug = debugT(false)
type debugT bool
func (d debugT) dumpBinary(b... |
<gh_stars>1-10
#pragma once
#include <stdint.h>
struct RI_t{
volatile uint32_t ICR;
volatile uint32_t ASCR1;
volatile uint32_t ASCR2;
volatile uint32_t HYSCR[4];
volatile uint32_t ASMR1;
volatile uint32_t CMR1;
volatile uint32_t CIRC1;
volatile uint32_t ASMR2;
volatile uint32_t CMR2;
volatile uint32_t CICR2... |
<reponame>weclaw1/learn_opengl<filename>src/utils/input.rs<gh_stars>1-10
const MIN_PITCH: f32 = -89.0;
const MAX_PITCH: f32 = 89.0;
pub struct Input {
up: bool,
down: bool,
left: bool,
right: bool,
close: bool,
yaw: f32,
pitch: f32,
fov: f32,
}
impl Input {
pub fn new() -> Self {
... |
This article is about the American author. For other people with the same name, see Michael Talbot (disambiguation)
Michael Coleman Talbot (September 29, 1953 – May 27, 1992)[1] was an American author of several books highlighting parallels between ancient mysticism and quantum mechanics, and espousing a theoretical m... |
/**
* Store payload objects that come from web submissions until they are retrieved by SUBMISSION_TOKEN value
*/
public class WebSubmissionPlace extends ServiceProviderPlace implements emissary.place.AgentsNotSupportedPlace {
/** The hash of stored documents */
protected final Map<String, List<IBaseDataObjec... |
MIAMI — Josh Richardson is the Heat’s new $42 million man. But will he be the Heat’s new starter this season?
We answer that question and more in the latest installment of the Heat mailbag. If you weren’t able to ask a question this time, send your questions for future mailbags via Twitter (@Anthony_Chiang and @tomdan... |
/**
* @file
* @author __AUTHOR_NAME__ <<EMAIL>>
* @copyright 2021 __COMPANY_LTD__
* @license <a href="https://opensource.org/licenses/MIT">MIT License</a>
*/
#ifndef ZEN_CAMERAS_SCENE2D_SYSTEMS_FADE_HPP
#define ZEN_CAMERAS_SCENE2D_SYSTEMS_FADE_HPP
#include <functional>
#include <SDL2/SDL_types.h>
#include "../... |
Building A More Decentralized Internet: It's Happening Faster Than People Realize
from the you-bet-we-can dept
More than three years ago, I wrote a post predicting that "the revolution will be distributed." In talking about a variety of attacks (mainly on Wikileaks), I pointed out that these were only going to inspir... |
/**
* Represents a range of versions that a particular broker supports for some feature.
*/
public class SupportedVersionRange {
private final short minVersion;
private final short maxVersion;
/**
* Raises an exception unless the following conditions are met:
* 1 <= minVersion <= maxVersion.
... |
An umanned rocket lit up the night sky over Florida like a larger-than-life roman candle Thursday night (March 12), carrying a four satellites on a mission to seek an explosive phenomenon in Earth's magnetic field.
The United Launch Alliance Atlas V rocket blasted off from a launch pad here at Cape Canaveral Air Force... |
// Then creates a wrapper function that forces a request to run through a your gauntlet of middleware
// functions before finally executing the intent/request handler you're registering.
func (m Middleware) Then(handler HandlerFunc) HandlerFunc {
for i := len(m) - 1; i >= 0; i-- {
mw := m[i]
if mw == nil {
cont... |
def convert_strehl(sr1,lambda1,lambda2):
return np.power(sr1,(lambda1/lambda2)**2) |
use utils::InputType;
use std::collections::HashSet;
fn main() {
let xss = read_input(InputType::Input);
println!("Day09 part a = {}", part_a(&xss)); // 591
println!("Day09 part b = {}", part_b(&xss)); // 1113424
}
fn part_a(xss: &Vec<Vec<u32>>) -> usize {
let res = get_low_spots(&xss).iter().fold(0, ... |
/* Parse a string of the form attr=value,attr=value,attr=value */
bool
keychain_query_parse_string(CFMutableDictionaryRef q, CFStringRef s) {
bool inkey = true;
bool escaped = false;
bool error = false;
CFStringRef key = NULL;
CFMutableStringRef str = CFStringCreateMutable(0, 0);
CFRange rng = {... |
/**
* @author Yusuke Ikeda
*/
public class HttpResponseTest {
@Rule
public TemporaryFolder tmpDir = new TemporaryFolder();
@Test
public void file_html() throws Exception {
File tmpFile = new File(tmpDir.getRoot(), "test.html");
Files.write(tmpFile.toPath(), "hello!!".getBytes("UTF-8"... |
/**
* a proxy class that helps classes to communicate internally without exposing the unnecessary API
*
* @param <S> the Outer Object type
* @param <T> the stored item type
*/
abstract class Proxy<S, T> {
/**
* access the Outer Object of this {@link Proxy}
*
* @return the Outer Object
*/
... |
def quit_alternate_screen(self):
if self._in_alternate_screen:
stdout = HANDLE(self._winapi(windll.kernel32.GetStdHandle, STD_OUTPUT_HANDLE))
self._winapi(windll.kernel32.SetConsoleActiveScreenBuffer, stdout)
self._winapi(windll.kernel32.CloseHandle, self.hconsole)
... |
<gh_stars>10-100
/* YUV->RGB conversion for Raspberry Pi camera, because fast video
port doesn't currently support raw RGB capture, only YUV.
python-dev required to build.
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source development by purchasing
... |
<reponame>zixia/node-clone-class<gh_stars>1-10
#!/usr/bin/env -S node --no-warnings --loader ts-node/esm
/**
* Wechaty - https://github.com/chatie/wechaty
*
* @copyright 2016-2018 <NAME> <<EMAIL>>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in co... |
// ExistsAddresses is the concurrency safe, exported function that returns
// whether or not each address in a slice of addresses has been seen before.
func (idx *ExistsAddrIndex) ExistsAddresses(addrs []dcrutil.Address) ([]bool, error) {
exists := make([]bool, len(addrs))
addrKeys := make([][addrKeySize]byte, len(ad... |
/**
* Returns a list of activities that are part of this application, skipping
* those from included libraries and *this* activity.
*/
public ArrayList<ExampleEntry> listActivities(Context context) {
ArrayList<ExampleEntry> result = new ArrayList<>();
try {
final String packag... |
/*
* write a region of pages back to the server
*/
static int afs_writepages_region(struct address_space *mapping,
struct writeback_control *wbc,
loff_t start, loff_t end, loff_t *_next)
{
struct folio *folio;
struct page *head_page;
ssize_t ret;
int n, skips = 0;
_enter("%llx,%llx,", start, end);
do ... |
// DialogGetDialogsByOffsetDate
// dialog.getDialogsByOffsetDate user_id:long exclude_pinned:Bool offset_date:int limit:int = Vector<DialogExt>;
func (c *DialogCore) DialogGetDialogsByOffsetDate(in *dialog.TLDialogGetDialogsByOffsetDate) (*dialog.Vector_DialogExt, error) {
c.Logger.Errorf("dialog.getDialogsByOffsetDat... |
<reponame>dreadw8/test-task<filename>src/app/modules/categories/categories.module.ts
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { CqrsModule } from '@nestjs/cqrs';
import { CategoryEntity } from './entity';
import { FindCategoryBySlugQueryHandler } from './queries'... |
// putBucketRequest wrapper creates a new putBucket request
func (a apiV1) putBucketRequest(bucket, acl, location string) (*request, error) {
var r *request
var err error
op := &operation{
HTTPServer: a.config.Endpoint,
HTTPMethod: "PUT",
HTTPPath: "/" + bucket,
}
var createBucketConfigBuffer *bytes.Reader... |
def reglob(path: str, exp: str, invert: bool = False) -> List[str]:
m = re.compile(exp)
if invert is False:
res = [f for f in os.listdir(path) if m.match(f)]
else:
res = [f for f in os.listdir(path) if not m.match(f)]
res = [os.path.join(path, x) for x in res]
return res |
// GetAssetsFromBatch - get a group of assets
func (contract *FixedAssetContract) GetAssetsFromBatch(ctx utils.Context, batch []string) (*[]*assets.FixedAsset, error) {
fmt.Println("Entering getAssetsFromBatch")
retArr := make([]*assets.FixedAsset, len(batch))
for idx, uuid := range batch {
bytes, err := ctx.GetSt... |
/**
* @author Biju Joseph
*/
@CaaersUseCases({CREATE_PARTICIPANT})
public class ParticipantTest extends CaaersNoSecurityTestCase {
private Participant participant;
@Override
protected void setUp() throws Exception {
super.setUp();
participant = new Participant();
}
public void t... |
Assam Floods: Why Forgotten Assam not getting desired attention from Modi Govt?
Feature
oi-Reetu
By Reetu
After flash floods ravaged Jammu & Kashmir, in the worst ever natural disaster in last six decades, the North Eastern states of Assam and Meghalaya are the latest to witness the same tragedy triggered by incess... |
With VMworld 2015 around the corner I thought this would be a great time to announce our latest version of the VMware Certified Professional – DCV study guide. A few years back, Jason Langer (blog / twitter) and I teamed up with Veeam Software and released the VMware Certified Professional 5 – DCV study guide, which yo... |
// There is nothing in a caterpillar that tells you its going to be a butterfly --------------------- !
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define pi pair<int,int>
#define pii pair<ll,pi>
#define f first
#define mp make_pair
#define mod 1... |
n=input()
a=[int(x) for x in raw_input().split()]
m=input()
for i in xrange(m):
y,x=map(int,raw_input().split())
l=x-1
r=a[y-1]-x
if y==1:
a[0]=0
if len(a)>1:
a[1]+=r
elif y==n:
a[-2]+=l
a[-1]=0
else:
a[y-2]+=l
a[y]+=r
... |
/**
* Facilitates the extraction of AAC samples from elementary audio files formatted as AAC with ADTS
* headers.
*/
public class AdtsExtractor extends HlsExtractor {
private static final int MAX_PACKET_SIZE = 200;
private final long firstSampleTimestamp;
private final ParsableByteArray packetBuffer;
priva... |
// FetchEvents returns all events for a calendar in a slice
func (cal Calendar) FetchEvents() ([]Event, error) {
var events []Event
err := db.View(func(tx *bolt.Tx) error {
c := tx.Bucket([]byte(cal)).Cursor()
for k, v := c.First(); k != nil; k, v = c.Next() {
var event Event
err := json.Unmarshal(v, &event... |
// return null if the media type can not be recognized.
private static OdfDocument loadDocumentFromTemplate(OdfMediaType odfMediaType) throws Exception {
final Resource documentTemplate;
switch (odfMediaType) {
case TEXT:
case TEXT_TEMPLATE:
case TEXT_MASTER:
case TEXT_WEB:
docum... |
<filename>vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go
// +build !go1.7
package tlsconfig
import (
"crypto/x509"
"github.com/Sirupsen/logrus"
)
// SystemCertPool returns an new empty cert pool,
// accessing system cert pool is supported in go 1.7
func SystemCertPool() (*x509.CertPool, error... |
/* Code decompiled incorrectly, please refer to instructions dump. */
public final int M(T r17, byte[] r18, int r19, int r20, int r21, int r22, int r23, int r24, long r25, int r27, long r28, b.l.a.c.f.e.jm r30) {
/*
r16 = this;
r0 = r16
r1 = r17
r3 = r18
... |
//
// unpackTitleSeparator set the Title separator using the first character in
// meta attribute "title-separator" value.
//
func (doc *Document) unpackTitleSeparator() {
v, ok := doc.Attributes[metaNameTitleSeparator]
if ok {
v = strings.TrimSpace(v)
if len(v) > 0 {
doc.Title.sep = v[0]
}
}
} |
# ----------------------------------------------------------------- #
# The HMM-Based Speech Synthesis System (HTS) #
# developed by HTS Working Group #
# http://hts.sp.nitech.ac.jp/ #
# --------------------------------------... |
<gh_stars>1-10
package org.coinjoin.util;
import java.math.BigInteger;
public class RSABlindedData {
private BigInteger r;
private byte[] m;
public BigInteger GetMultiplier() {
return r;
}
public byte[] GetData() {
return m;
}
public RSABlindedData(BigInteger r, byte[] m) {
this.m = m;
this.r = r... |
// Update updates device weight in DeviceWeights slice, or appends it if not found.
func (w *DeviceWeights) Update(maj, min, val int64) {
for index, devWeight := range *w {
if devWeight.Major == maj && devWeight.Minor == min {
(*w)[index].Weight = val
return
}
}
w.Append(maj, min, val)
} |
/* Basically a depth-first search (DFS).
Marks each array value as 1 when visiting (Side-effect: alters array) */
private static boolean solvable(int [] array, int m, int i) {
/* Base Cases */
if (i < 0 || array[i] == 1) {
return false;
} else if (i + 1 >= array.length || i +... |
<gh_stars>1-10
//
// Shoulder
// Copyright (C) 2018 Assured Information Security, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation ... |
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... |
/* apr.parse_query_string(query_string) -> parameters {{{1
*
* Parse a URL encoded string into a Lua table. On success the table with
* parameter name/value pairs is returned, otherwise nil followed by an error
* message and error code is returned.
*
* This function uses `&` and `;` as the set of tokens to delin... |
<filename>src/org/python/indexer/Def.java
/**
* Copyright 2009, Google Inc. All rights reserved.
* Licensed to PSF under a Contributor Agreement.
*/
package org.python.indexer;
import org.python.indexer.ast.NName;
import org.python.indexer.ast.NNode;
import org.python.indexer.ast.NUrl;
/**
* Encapsulates informa... |
#include <bits/stdc++.h>
using namespace std;
int nums[100];
void swap(int i1,int i2){
int temp = nums[i1];
nums[i1] = nums[i2];
nums[i2] = temp;
}
void sort(int l) {
for (int begin = 1;begin<l;begin++){
int cur = begin;
int temp = nums[cur];
while (cur>0 && tem... |
// RemoveAllRecv close and revmove all the receivers.
func (s *Broadcaster) RemoveAllRecv() {
s.mux.Lock()
defer s.mux.Unlock()
for _, rs := range s.recvs {
close(rs)
}
s.recvs = make(map[uuid.UUID]chan processor.Event)
} |
/*
* Given DiffIterable on non-whitespace characters, convert it into DiffIterable on original texts.
*
* matched characters: matched non-space characters + all adjustment whitespaces
*/
@Nonnull
private static DiffIterable matchAdjustmentSpacesIW(@Nonnull CharOffsets chars1,
... |
/**
* @see <a href="https://github.com/BuiltBrokenModding/VoltzEngine/blob/development/license.md">License</a> for what you can and can't do with the code.
* Created by Dark(DarkGuardsman, Robert) on 12/30/2018.
*/
public class EntityXmasSkeletonBoss extends EntityXmasSkeleton
{
private final BossInfoServer boss... |
/**
* To be called before commencing the deletion of a VM.
*
* @param nodeName
* The name of the VM being deleted.
* @return null if the VM is not unwanted (it may have recently been
* deleted). false if another thread is currently trying to delete
* it. tr... |
<reponame>jonfortescue/wpf
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/*=========================================================================*\
\*=====... |
/**
* This method checks if a line is within or crosses a Quad
* @param q1 Quadrilateral one
* @param q2 Quadrilateral two
* @return boolean true if intersection.
*/
public synchronized static boolean checkCollision(Quadrilateral q1, Quadrilateral q2) {
Circle c1 = new Circle(q1.getCent... |
Confirmed reservations: mental travel.
When Kosslyn, Ball, and Reiser asked subjects to scan a memorized picture, they found a strong positive linear relationship between distance scanned and reaction time. However, more recent research has suggested that this result may be as much a function of the demand characteris... |
<gh_stars>0
package com.blink.shared.common;
import com.blink.utilities.BlinkJSON;
public class File {
private String resource;
private String url;
public File() {}
public File(String resource, String url) {
this.resource = resource;
this.url = url;
}
public String getResource() {
return resource;
}
... |
A Carolina Morning
"You boys had better shut up," said Fred, "as soon as I can see again, I'm gonna bust your heads." Dad drove us all back home. He made Fred sit in the back of the truck, for a couple of reasons. He wanted Fred to watch Brian and Eric. He knew that either one would sure enough try to heave the other ... |
#include <bits/stdc++.h>
using namespace::std;
#define ll long long int
#define mp make_pair
#define ff first
#define ss second
const int MOD=1000000007,INF = 1e9,MAX = 2e6;
ll a[MAX],b[MAX],C[MAX];
vector < pair < ll , ll > > v;
int main()
{
std::ios_base::sync_with_stdio(false);
ll i,j,k,l,... |
Earlier today the WordPress team noticed suspicious commits to several popular plugins (AddThis, WPtouch, and W3 Total Cache) containing cleverly disguised backdoors. We determined the commits were not from the authors, rolled them back, pushed updates to the plugins, and shut down access to the plugin repository while... |
<reponame>ssavitzky/Silvermine-Resources
/*********************************************************************\
**
** View.c -- View data on the screen
**
** 880422 SS major changes: view data structure
** 880111 SS create PC version from DD
**
\*********************************************************************/
... |
// Copyright 2020 New Relic Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
// Package nrlambda adds support for AWS Lambda.
//
// Use this package to instrument your AWS Lambda handler function. Data is
// sent to CloudWatch when the Lambda is invoked. CloudWatch collects Lambda
// log data... |
package com.coltsoftware.liquidsledgehammer.collections;
import org.junit.Before;
import com.coltsoftware.liquidsledgehammer.MoneyTestBase;
import com.coltsoftware.liquidsledgehammer.model.FinancialTransaction;
import com.coltsoftware.liquidsledgehammer.model.Money;
import com.coltsoftware.liquidsledgehammer.model.Nu... |
import java.util.*;
public class CodeForces {
public static long max(long a,long b,long c)
{
if(a>=b&&a>=c) {return a;}
if(b>=c&&b>=a) {return b;}
else {
return c;
}
}
public static long min(long a,long b,long c)
{
if(a<=b&&a<=c) {return a;}
if(b<=c&&b<=a) {return b;}
else {
... |
/**
* To get resultSet from database for Concept Class.
*
* calls oracle stored procedure
* "{call SBREXT_CDE_CURATOR_PKG.SEARCH_CONCEPT(InString, ContName, ASLName, OracleTypes.CURSOR)}"
* loop through the ResultSet and add them to bean which is added to the vector to return
* @param data
*
*/... |
def update_contact(self, data):
return self._put('contacts/edit-properties', data=data) |
Local Decode and Update for Big Data Compression
This paper investigates data compression that simultaneously allows local decoding and local update. The main result is a universal compression scheme for memoryless sources with the following features. The rate can be made arbitrarily close to the entropy of the underl... |
// GetKnativeService returns a knative Service that matches the given function
func (c *Collection) GetKnativeService(filter func(*serving.Service) bool) *serving.Service {
var retValue *serving.Service
c.VisitKnativeService(func(re *serving.Service) {
if filter(re) {
retValue = re
}
})
return retValue
} |
Testing growth hormone deficiency in adults.
Growth hormone deficiency (GHD) in adults is a recognized syndrome which is defined biochemically within an appropriate clinical context. Clinically, patients investigated for GHD should include those with signs and symptoms of hypothalamic-pituitary disease, those who have... |
/**
* Class Product implements a product.
*/
public abstract class Product implements Serializable {
/** Serial number for serialization. */
private static final long serialVersionUID = 2021212121091006L;
/** Product attributes. */
private boolean _isSimpleProduct;
private double _maxPrice;
... |
<gh_stars>0
from intcode import IntCode
def RunSpringScript(program: str, script: str) -> int:
inputValues = list(map(ord, script))
springDroid = IntCode(program, inputValues, False)
springDroid.run()
for c in springDroid.output_values:
if c < 128:
print(chr(c), end="")
els... |
/*FinishTask
if task process finished, invoke this method
*/
func (p *MySQLPicTaskPipe) FinishTask(task *TaskFinished) error {
_, err := p.db.Exec(`
UPDATE pic_task_queue
SET status = 2, nodetype = ?, nodenum = ?, ext = ?
WHERE id = ?;
`, task.NodeType, task.NodeName, task.MIMEInfo, task.Key)
... |
Impacts of pm2.5 on respiratory system among traffic policemen.
BACKGROUND
Malaysian traffic policemen are constantly exposed to unhealthy air in the outdoor environment, which results in various health problems. This study investigates the relationship of the personal exposure level to PM2.5 and lung functions in tra... |
import java.util.Arrays;
import java.util.Scanner;
public class StringProblem {
final static int INF = 99999999;
static int[][] map = new int[30][30];
public static void main(String[] args) {
//System.setIn(new FileInputStream("in.test"));
//System.setOut(new PrintStream(new FileOutputStream("o... |
/**
* @Author Mara
* @CreateDate 2018-7-8
* @Description
* @License Apache License Version 2.0
*/
public class DirectorySynchronizeController extends BaseBatchFileController {
protected boolean isConditional, startHandle;
protected String lastFileName;
protected FileSynchronizeAttributes copyAttr;
... |
<gh_stars>1-10
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package stackclass;
/**
*
* @author c3
*/
public class StaticStack extends AbstractStack {
int stack[];
int ... |
#ifndef art_Framework_Core_TriggerReport_h
#define art_Framework_Core_TriggerReport_h
// ====================================================================
// TriggerReport: This struct contains all the information relevant to
// reporting on the behavior of the trigger at the time of its
// creation.
// ===========... |
/*!
* @brief This API writes the data into the auxiliary sensor
*/
uint16_t bma4_aux_write(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len, struct bma4_dev *dev)
{
uint16_t rslt = BMA4_OK;
rslt |= bma4_null_pointer_check(dev);
if (rslt == BMA4_OK) {
if (len > 0) {
while (len--) ... |
// Downloads the format part by part, with as many requests as needed
private void downloadByPart(Format format, OutputStream os, final OnYoutubeDownloadListener listener) throws IOException {
long done = 0;
int partNumber = 0;
final String pathPrefix = "&cver=" + clientVersion + "&range=";
... |
import React from "react";
import styled from "styled-components";
export interface HeadingProps {
// The heading ID used for internal page links.
id?: string;
// The HTML heading tag.
as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
// The content of the heading.
children: string;
// Any unknown props.
[k... |
def pilatus_metadata(self):
if not self.is_pilatus:
return None
return pilatus_description_metadata(self.pages[0].description) |
/**
* the following three methods are three activities that would affect parameter
* values
*
* @param stats the int array that stores values for hair, money and knowledge
*/
public static int[] haircare(int[] stats){
if(stats[1]==0){
System.out.println("You don't have any money left. Please choose a... |
import en from './en'
import zh_cn from './zh-cn'
import {I18nStrings} from './I18nStrings'
export class I18n {
static get(language: string): I18nStrings {
var messages = {
en,
zh_cn
} as any
return messages[language.toLowerCase().replace(/-/g, '_')] as I18nStrings
}
}
|
import { Component, lazy } from "solid-js";
import "./App.scss";
import "./codeTheme.scss";
import "./bootstrap.scss";
import Navbar from "./components/Navbar/Navbar";
import Hero from "./components/Hero/Hero";
import BasicDropdown from "./components/ExamplesSection/BasicDropdown";
import IOSDebugger from "./component... |
//===----------------------------------------------------------------------===//
// DuckDB
//
// duckdb/planner/operator/logical_index_scan.hpp
//
//
//===----------------------------------------------------------------------===//
#pragma once
#include "duckdb/catalog/catalog_entry/table_catal... |
/**
* Created by nanye on 17/5/8.
*/
public class SettingsFragment extends com.dailystudio.app.fragment.SettingsFragment {
private class GetVoiceModalTask extends AsyncTask<Context, Void, VoiceModalItem[]> {
private int mStatus;
private RadioSetting<VoiceModalItem> mSetting;
private Ge... |
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Textures/SlateShaderResource.h"
#include "Rendering/SlateRenderer.h"
class FSlateDrawBuffer;
class FSlateUpdatableTexture;
class SWindow;
struct Rect;
/** A slate null rendering implementation */
class FSlat... |
package sort
/*Insertion []int*/
func Insertion(input []int) []int {
for j := 1; j < len(input); j++ {
key := input[j]
i := j - 1
for input[i] > key {
input[i+1] = input[i]
i -= 1
if i < 0 {
break
}
}
input[i+1] = key
}
return input
}
|
<reponame>mdnu/snake
def cocktailsort(lst):
''' (list of number) -> NoneType
Modify lst to sort the items for smallest to largest.
>>> my_list = [4, 2, 5, 8, 6, 7, 3, 1]
>>> cocktailsort(my_list)
>>> my_list
[1, 2, 3, 4, 5, 6, 7, 8]
'''
top = len(lst) - 1
bottom = 0
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.