query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
64dea303d77830221874b4a99b69af1f | ae029561fe1ea55c5e8ba57d47ec876c | For two given path, return the first common ancester.
:arg path1, a list of nodes.
:arg path2, a list of nodes. | path_to_a = []
path_to_b = []
path_to_a = self.populate_path_to_node(root, path_to_a, A)
path_to_b = self.populate_path_to_node(root, path_to_b, B)
max_common_path_length = min(len(path_to_a), len(path_to_b))
for i in range(max_common_path_length):
if path_to_... | 1 |
043ba229e6726d55614422c8240a0781 | 9a74b923289138d0bdd79c1775f4c589 | Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA. | class Specimen extends Entity
withPartOf(partOf) {
this.partOf = partOf; return this;
} | 0 |
238e94c9a875fc00f028ce39c0365a63 | be042704c0938c8bad39487622e81ce8 | This unit test verifies blob bounds computation. | public class RestUtilsTest
@Test
public void getBlobPropertiesVariedInputTest() throws Exception {
String ttl = Long.toString(RestUtilsTest.RANDOM.nextInt(10000));
String serviceId = generateRandomString(10);
String contentType = "image/gif";
String ownerId = generateRandomString(10)... | 0 |
d1d3a32549742f5df9002762f9e9d480 | f52f0a017ee338da54aeb0ad61466bb0 | Lista os Usuários e seus Pacientes ou Médicos correspondentes | class PacientController extends Controller
public function index(Request $request)
{
$query = $request->all();
$status = \App\Status::all();
$deficiencies = \App\Deficiency::all();
$therapies = \App\Therapy::all();
$users = DB::table('users as u')
->distin... | 1 |
cd612817650d97f0ac455a42830864e6 | a78a8e76b59ec9115c43809db6dbc53d | 查询已知人的 在一定时间范围内的值班次数 | Map<String,String> queryShopTechnicianOccupyTimes(String shopId, String technicianId, String dateTime); | 0 |
688b195b34096548769a920342e0a6d8 | 890dc5da8174caff648def207801426c | 读取一个 md 文件并输出对应的目录 | function readDir(dir) {
fs.readdir(dir, (err, fileList) => {
console.log(fileList);
fileList.forEach((file, index) => {
let joinedDir = `${dir}/${file}`
fs.stat(joinedDir, (err, stats) => {
if (stats.isDirectory()) {
readDir(joinedDir)
... | 0 |
5409b91c50f96a4ca31c92f5aa05d7d8 | a03246ed5e7fff6819e0f71c1ccf317a | 从服务端获取系统中最受欢迎的讲解员 | List<EduTeacher> getHotTeacher(); | 1 |
ede7f3243b27ae0c83a260093b8a0759 | 157aa1856422328a504973403d64793a | Gets Total runtime of all movies that have an IMDb ID | global ls
mx=max([film['time'] for film in ls ])
return {'val': mx} | 0 |
4a9558ba497732c898c4fbc4005ecce6 | 3fc66452162dd0c8993cd20bda2a621f | Given an action a, generate the observation, which is random.
Input:
a: the action, an integer in [K]
Output:
obs: the observation, 0 or 1 | class NotXOREnv(gym.Env):
def _get_obs(self):
return [random.choice([0, 1]),
random.choice([0, 1])] | 0 |
e22bac0913ed2d21d0374a3a0b27b4f3 | 62c0566a5cfba9a3819426c88a724313 | Action after rollback a split table region action. | void preSplit(final ObserverContext<RegionCoprocessorEnvironment> c, byte[] splitRow)
throws IOException; | 0 |
a0890251fd23801379a977a1380de058 | 26ea96175b67549cb79a7f5955c80a9a | 获取供应商的预付款相关总金额(对供应商的,排除废弃的和审核不通过的)
<br/>从supplier_pre_pay_supplier中获取 | public double getBeginningPayableBalanceBySupplier(QueryParam param) throws Exception {
double beginningMoney = 0;
List<Map<String, Object>> beginningPayableBalanceMapList = financePayDao.getBeginningPayableBalanceList(param, FinancePayDao.PRODUCT_LINE_PAYABLE_BALANCE);
for(Map<String, Object> map : beginningPay... | 0 |
21a4fb4f4432710d33c942c25d5bd204 | 014fa2e093c3fa63fae8e2962e623224 | 设置:逾期贷款利率 | function overdueRateChange() {
var overdueValue = getParam("overdueValue");
var intrate = loanContDs.getCurrent().get("intrate");
if (overdueValue != null && overdueValue != "") {
loanContDs.getCurrent().set("overdueValue", overdueValue);
if (isNumber(overdueValue)) {
if (intrate... | 1 |
693d95ae59ab8a5660b462ebea89b57f | 6667ec14987424def8300fb66bef9a8c | Send unicode to the client and append a carriage return and newline. | class Script(object):
def writeline(self, line):
self.sendall((six.text_type(line) + u'\r\n').encode(self.encoding)) | 1 |
c18f232dee3cebd7924431ad72859f09 | f05d4d08d4bf17c88b30197ecadd8032 | 转换原始字符串为权限串的格式 | public class ShiroUtils
public static String convertToPermissionString(String source, boolean filterDigits) {
if (source == null) {
return source;
}
String[] pathElement = source.replaceAll("\\?.*", "").replaceAll("(^/)|(/$)", "").split("/");
List<String> pathElementList = ne... | 1 |
e9066303bfd56e137a3f2695f8d0be63 | fc1f7abadd7d43ad2ed458e24d8a1496 | 读取Session数据 | {
$session_data = '';
if (CACHE_ENABLE) {
$session_data = Yii::$app->cache->get($this->session_prefix . $id);
echo $session_data;
}
echo '<br/>read=' . $id . '=session=' . print_r($session_data, true) . '=read<br/>';
echo '<br/>read=' . $this->session_... | 1 |
16cc816b0acd25036af2bd9db930f854 | af3f1fc41509d0135ef1a9bdf933e82b | 准备原材料,不同材料可以制作不同披萨,所以定义成抽象方法 | class VegPizza(metaclass=ABCMeta):
def prepare(self, VegPizza):
pass | 1 |
414d8e3469d37acec5d4a8804243e4d7 | e29b452335c5e1fbceb1876e5cf4e9e6 | Lists all data collection rules in the specified resource group. | @ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AlertRuleResourceInner> listByResourceGroup(String resourceGroupName); | 1 |
cc2714e1e5d03e10b713bb3bb74ddc87 | 78b712a8fb50a4158bbd6700d26be870 | Checks if the car queue is empty. | {
if(queue_Length == 0)
{
return true;
}
else
{
return false;
}
} | 1 |
2d712a132d2ac87981349ef1a5b6a454 | 450b07885607b084ed1c0370a2e43d6f | Elimina un appender del logger configurado | public class LogbackListAppender extends UnsynchronizedAppenderBase<ILoggingEvent>
public void removeFromLogger(Class<?> loggerClass) {
Logger logger = (Logger) LoggerFactory.getLogger(loggerClass);
logger.detachAppender(this);
} | 1 |
273c82b670277ea4b8bd235bc642949b | 8157148bf18a0c97b76a146345f3d507 | Used to mark the moment when all sets of runs begin by placing the time into the
Ecoplane parameters singleton. | def PhaseBegin(options):
global phase_start
phase_start = datetime.datetime.now() | 1 |
a33495bf3fcfbfc3b1566c5ce83ae4f4 | 2846026c9e57b83c2f16ce0ee507003d | Debug.LogError扩展,用法与Debug.LogError相符 | namespace MGS.Logger
public sealed class UnityDebugger : Singleton<UnityDebugger>, Common.Logger.ILogger
public void LogError(int level, string format, params object[] args)
{
Debug.LogErrorFormat(format, args);
} | 1 |
1a9e8cc39f1b95a27fb7fe7e6baff47d | b0408c050fba3731592f9fd3d0ef6d2f | Returns list of every device within PCP. | result = map(lambda dev: dev.full(), Devices.by_int(INPUT))
result += map(lambda dev: dev.full(), Devices.by_int(RELAY))
result += map(lambda dev: dev.full(), Devices.by_int(OUTPUT))
result += map(lambda dev: dev.full(), Devices.by_int(AI))
result += map(lambd... | 1 |
c291e2d853fbc232e101564d81badd03 | 194c43b4cee96beaee3140ea3d10d5cd | Go to the "TestApp" Add form page | employee_id = request.GET.get('employee')
redirect_url = "/admin/HumanResources/testapplication/add/?employee=" + str(employee_id)
return HttpResponseRedirect(redirect_url) | 1 |
6c141be9e4526e251bde4576403a03b9 | 4d4d138f31434f84084145145243aa69 | Get tweets near guid. | public void nearby_timeline(Double longtitude, Double latitude, RequestListener listener) {
WeiboParameters params = new WeiboParameters(mAppKey);
String coordinate = longtitude + "," + latitude;
params.put("coordinate", coordinate);
requestAsync(URL_Constant.place_nearby_timeline_... | 0 |
4edd91eaf11bfeb74fb803f3a78d21d1 | 7d408e126c6eef517cd2c620c036e0bf | Displays a verbose list of counts and their associated status results. | self._organize_counts()
r_width = 70
leader = " "*2
w = str( r_width - len(leader) - len(leader) - 3)
print( self.pname )
print( "-"*len(self.pname) )
print( "{}Assignments:".format(leader) )
for assignment in sorted( self.a_counts.keys() ):
... | 1 |
820733bb451809dd720f924db2b6bd08 | df335772de4ef6ae1eec369f07fdada1 | spreedSheet è una struttura "lista di liste".
Ogni elemento (riga) contiene una lista di numeri(contenuto della riga)
esempio:
5 1 9 5
7 5 3
2 4 6 8
verrebbe rappresentato dalla seguente struttura
lista=[[5,1,9,5]]
lista.append([7,5,3])
lista.append([2,4,6,8]) | let matriceSchedina = [];
let flagSchedinaOk = false;
while (flagSchedinaOk == false) {
var numeriDisponibili = [];
for (let i = 1; i <= 90; i++) {
numeriDisponibili.push(i);
}
var numeriSicuri = [];
let numeroCasuale;
for (let i = 1; i <= 9; i++... | 0 |
1cecdeafdfee65f17b44d49e0dc42754 | da139c97f12dbe26c17b7f572139750c | Test les déplacements de base valide pour un Cavalier. | public class Cavalier
void principal() {
lanceur();
testAfficherDamier();
testEstCeValide();
testDonnerSuivants();
testEssayer();
} | 1 |
9c19574a9102ddca8eff38c1408296c5 | 5d010721b6767f198aca1bcb2a2f6e2b | check memory leak in VC++ | void DetectMemoryLeaks()
{
#if defined(_DEBUG)
_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF);
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
#endif
} | 1 |
a52aea2d32e8de2eda6298119f119bfa | 532d0b748def7ec067a31c2190a3cdaf | 以小时为单位的计划任务 | class Cron
function hourly($IM,$module) {
$me = $IM->getModule($module);
if (is_file($me->getModule()->getPath().'/crons/hourly.php') == true) {
$start_date = time();
$start_time = $IM->getMicroTime();
ob_start();
INCLUDE $me->getModule()->getPath().'/crons/hourly.php';
$result = ob_get_clean();
$... | 1 |
073f468146c9a1c814080393a94ccb7e | 6432b825f939eab2205b7e80e54a9e03 | Retrieve the converter for a statistic. | {
$definition = $this->definition_factory->get($input_format, $output_format);
foreach ($this->converters as $class => $formats) {
if (array($input_format, $output_format) == $formats) {
$assets = new Metadata\Assets();
$assets->setLogger($this->logger);
... | 0 |
4bebb05c8473fb1e32db52b4e5c6d7b6 | 0bd059c9f8adb158b48f872077eadb16 | Returns the port number of the sender of the current XDR data.
This method should only be called after {@link #beginDecoding}, otherwise
it might return stale information. | public final class I2PDatagramDissector
public Destination getSender() throws I2PInvalidDatagramException {
this.verifySignature();
return this.extractSender();
} | 0 |
1a9827343b82c3bdfeaab737bf21048d | a92a720cf999789a69e72b190d5b847c | 调用后台接口编辑航段 | @Controller
@RequestMapping("/account")
public class AccountLineController extends BaseController
@AuthorityPolicy(authorityTypes = { Right.MODIFY_PRODUCT })
@RequestMapping(value = "/lineupdate.htm", method = RequestMethod.POST)
@ResponseBody
public JsonResult lineUpdate(TravelLineVO line) throws Exception... | 1 |
0734461339eea243bc302b65e44c168b | c31cf8cc3298b25b0b923f31caeed8e0 | Returns a list containing all states, but ordered with the likeliest-to-override-this-state first. | namespace Genix.MachineLearning.LanguageModel
internal sealed class CompositeState : State
public override IList<State> NextStates()
{
if (this.nextstates == null)
{
IDictionary<char, int> statesmap = null;
IList<State> s = this.states;
... | 0 |
dbf6a4cc88002c2144451e6f6c1e832d | 42868417ebd3d8b440fdc46bc9de3f81 | Checks for pending deliveries and delivers them. | @Slf4j
@Service
public class Manager4Delivery implements InitializingBean, DisposableBean
public synchronized void start() {
if (!active) {
active = true;
stats.values().stream()
.filter(stat -> stat.getStuck() == 0 && stat.getUnprocessed() > 0)
.m... | 1 |
4e5b050c44ce6eade7a447d57b79e28d | a3abcd466d53994ace8a12bac25c2d61 | アドレスを変えながら、イベントテーブルを追加。
現時点でないイベントについてのみ、追加する。 | {
if ($post->content_type == Post::type('event')) {
$address= $form->append('text', 'url', 'null:null', _t('Event Address'), 'admincontrol_text');
$address->value= $post->info->address;
$form->move_after($address, $form->content);
}
} | 0 |
fe722e25d4bf81a8ece0aefa7505df07 | 205a47a6bee5c364e05172b5356e5da1 | Get or set FIFO gyroscope decimation. Look at FIFO_CTRL3_DEC_GYRO_MAP for available values. | lsm6ds3tr_c_dec_ds4_fifo_t val))
{
lsm6ds3tr_c_fifo_ctrl4_t *fifo_ctrl4 = (void *)&lsm6ds3tr_data_buffer[0];
PT_BEGIN(pt);
lsm6ds3tr_c_read_reg(ctx, LSM6DS3TR_C_FIFO_CTRL4, (uint8_t *)fifo_ctrl4, 1);
PT_WAIT_UNTIL(pt, ctx->read_write_done);
fifo_ctrl4->dec_ds4_fifo = (uint8_t)val;
lsm6ds3tr_... | 0 |
2cd79bb452cd4282a98d4e9e5333cecd | 6c0734f58631f1a7e275f25bb1caf278 | Lists records in descending order by ID | @Query("select * from records order by id desc")
LiveData<List<Record>> queryAllRecordsLive(); | 1 |
a5a2a43bb59b380662b91a4ce99f1ab8 | 305bec55640ea55ba89fe11c17b8b94c | Retorna o dataFim do Regime | class DashboardModal extends \Phalcon\Mvc\Model
public function getDataFim()
{
return $this->data_fim;
} | 1 |
22ee3d493d32d97f0c0d61952088c800 | c7f70a1899d42d3b5f599cb39696e4f1 | If either vector is zero, this method returns zero. | if ((v1.x == 0 && v1.y == 0 && v1.z == 0) ||
(v2.x == 0 && v2.y == 0 && v2.z == 0))
return 0.0f;
double dot = v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
double v1norm = Math.sqrt(v1.x * v1.x + v1.y * v1.y + v1.z * v1.z);
double v2norm = Math.sqrt(v2.x * v2.x + v2.y * v2.y + v2.z * v2.z);
... | 1 |
7c9e130127199af547bc3ce97b3e3c98 | 03f187cef2865002fec01d32df0dc968 | Routine to write an ops_halo to a named hdf5 file,
if file does not exist, creates it | d_m = [halos[0]]*block.ndim
d_p = [halos[1]]*block.ndim
dset.attrs.create("d_p", d_p, dtype="int32")
dset.attrs.create("d_m", d_m, dtype="int32")
dset.attrs.create("dim", [1], dtype="int32")
dset.attrs.create("ops_type", u"ops_dat",dtype="S7")
dset.attrs.create("block_index", [block.blocknum... | 0 |
b8bc0487deb4ffa9f2a6a299a4705353 | 19284243efd52b073fcf27f010dafe07 | calculate theta from pressure and air temperature
# Potential temperature based on https://en.wikipedia.org/wiki/Potential_temperature
# with gas constant R = 287.05 and specific heat capacity c_p = 1004.64 | def thetacalc(tempf, P):
theta = (tempf+273.15)*np.power((100000/(P*100)),0.286)
return theta | 1 |
528f524168de8e6c78e097572a27493d | e0a50382c77e571073909cc46ef23092 | Выполняет мгновенную поставку товара по следующим вводным данным:
- товар (экземпляр Assortiment)
- количество поставляемого товара (int) | def execute_incoming_express(item, quantity):
storage = Storage.get(Storage.goods == item)
Incoming.create(goods=item,
quantity=quantity,
date_time=datetime.now(),
comment=u'Срочная поставка!')
storage.quantity += quantity
storage.save() | 1 |
04c05fac5114454c0c321bc4a7120d59 | 6dc308fbaad2b3794273f19358e06c0e | Handles the KeyPress event of the CityTextBox control. | namespace weatherForecastAppPOE
public partial class frmNewEntry : Form
private void tbCityName_KeyPress(object sender, KeyPressEventArgs e)
{
if (!char.IsControl(e.KeyChar) && !char.IsLetter(e.KeyChar))
{
e.Handled = true;
}
} | 1 |
5a26ec4e4b9c028212119bce329d5211 | a5251307635860399ff4fa649a373d07 | Combines the acquire and prepare functions to produce three dataframes
(a dataframe with both data science and web development students,
a dataframe consisting of only data science students,
and a dataframe consisting of only web development students) | cohorts = acquire_cohorts()
cohorts.loc[46] = [0, 'Missing', '2014-02-04', '2021-05-04', 0]
df.columns = ['date','time','page_viewed','user_id','cohort_id','ip']
df['cohort_id'] = df.cohort_id.fillna(0)
df['cohort_id'] = df.cohort_id.astype("int")
df = pd.merge(df, cohorts, left_on='cohort_id', ... | 0 |
279e348d29e33f9cff785c0bcb5beaf7 | 963131c05fac68eb9deec9d3477b900d | рисует солнышко (не солнце, а именно детское солнышко) | void xydraw_sunny(int x, int y)
{
attron(COLOR_PAIR(SUNNY_YELLOW));
mvprintw(y+1, x+4, ".-.");
mvprintw(y+2, x+3, "( )");
mvprintw(y+3, x+4, "`-’");
attron(A_BLINK);
mvprintw(y, x+3, "\\ /");
mvprintw(y+2, x, "――");
mvprintw(y+2, x+9, "――");
mvprintw(y+4, x+3, "/ \\");
attroff(A_BLINK);
attroff(COLOR_P... | 1 |
54f7cb7e70f23b9ffc610153649909e2 | 65e93317f27131fce9dcf8ae1c7aa2c0 | shows size of 'context' uploaded to docker when building docker image | containerInfo, err := cli.ContainerInspect(context.Background(), containerID)
if err != nil {
logrus.Error(err.Error())
return 0
}
upperDir := containerInfo.GraphDriver.Data["UpperDir"]
upperDirSize, _ := util.CalDirSize(upperDir)
return upperDirSize
} | 0 |
10135d4cd4d40111e023d386c796b293 | 7caa272802f3d753a43b8f32237d2d56 | 获取该话题的所有评论,按时间先后顺序排列,时间早的在前,时间晚的在后 | public class Topic extends AbstractPersistent<ForumDi>
public ResultPage<Comment> getComment() {
return ResultPages.toSortResultPage(getBusinessDi().getCommentByTopic(this),
Comment.COMMENT_TIME_OLD, ResultPage.LIMIT_NONE);
} | 1 |
1e5761cfc1ff717fdc746836e925299b | 81ae148aed6d62cf54b613843558521e | Given a two body matrix, perform antisymmeterization on the elements. | Csym = zeros([N,N], float)
for i in range(N):
for j in range(N):
Csym[i,j] = 0.5*(C[i,j] + C[j,i])
return Csym | 0 |
f0de58694e0a37ef45cc6589c913c008 | 84feb011c607eb8a912e8da27c00678b | Override the {@link Connection} that is being used for execution.
<p>
This may have no effect, if called at the wrong moment. | public void setConnection(Connection c); | 1 |
508abfd3c9115ccf96b383f8c4fb3c0e | 18a63cdbc51cf140e59a46e0568975e8 | Architecture of a 17 * 17 to 8 * 8 Reduction_B block. | with slim.arg_scope([slim.conv2d, slim.avg_pool2d, slim.max_pool2d],
stride=1, padding='SAME'):
with tf.variable_scope(scope, 'BlockReductionA', [inputs], reuse=reuse):
with tf.variable_scope('Branch_0'):
branch_0 = slim.conv2d(inputs, 384, [3, 3], stride=... | 0 |
5d7bbdfe9bfbb5c1256aa0459f87f3d7 | d2350d4cd0f08925c6358fa9fb6e6a96 | Gets the event date mappings by learner identifier. | {
int sourceId = _getSourceIdForLearner(Context, schoolId, learnerId);
return _getEventDateMappingsByLearnerIdForAllDc(Context, schoolId, sourceId, learnerId, startDate, endDate);
} | 1 |
c7edd031b8276b6f6866043667654b74 | 117ca64a2a2a7fac9ec05d0c76a28bfb | Updates the thumbnail image in the capture indicator. | public class CameraIntentActivity extends AppCompatActivity
@RequiresApi(api = Build.VERSION_CODES.Q)
private void showThumbnail() {
Bitmap thumbnail;
try {
thumbnail = getApplicationContext().getContentResolver().loadThumbnail(imageFileUri, new Size(640, 480), null);
binding.ivShowCaptureImage.se... | 1 |
8d03153dd9fa288ca8bb0ceb03353e9b | 40f7c0f435dad21961d5d2d04c0f4022 | get possible employees on a specific date | {
$results = $this->find(array(
'where' => array(
'relation' => 'AND',
'conditions' => array(
array(
'field' => 'date',
'condition' => '>=',
'value' => $start_date
),
array(
'field' => 'date',
'condition' => '<=',
'value' => $e... | 0 |
efd6512ee8c1f1985a1f664e3e5039f3 | a3a51c714000451741ea91231bec2fd2 | Lists all Rules models. | $data = array();
if ( Request::ajax() ) {
$data = $this->ajaxSearch();
return Response::json( $data );
}
$group = $this->rule_model->orderBy( 'rule_name' )->paginate( 50 );
$delete_rule = FALSE;
if ( 'developer' == $this->auth_user->user_type ) {
... | 1 |
9eb65e3f4ea06d4d8044de76f769cedc | 3d017d6a9148770675512454e5d147cc | calculates the first and last page to show | class Pagination{
public function calculate(){
$this->pages = $this->results > 0 ? ceil($this->results / $this->limit) : 1;
$this->currentPage = $this->currentPage <= $this->pages ? $this->currentPage : $this->pages;
} | 0 |
549156bef471d2c781ab9daaa4a3a9df | 0953c3de1f06d084056a02ff8c2cb407 | Searches OrderedList for item, returns True if item is in list, False otherwise | class UnorderedList:
#each list object will maintain a single reference to the head of the list
#list class itself does not contain any node objects. it contains a single reference to only the first node
#in the linked structure
def search(self, item):
current = self.head
found = False
while current != None an... | 0 |
538c8c3af3a2a655f5303ad69bd180e8 | d2c653fd046cf7c949d1fedf64e90250 | 6、输出从2000年(含)到3000年(含)间的所有闰年(闰年是能被4整除且不能被100整除或者是能被400整除) | function Topic () {
for (var i =2000;i <= 3000;i++) {
if (i % 400 == 0) {
console.log(i)
}
if (i % 4 ==0 && i % 100 != 0) {
console.log(i)
}
}
} | 1 |
8320f78b4bf3f8d10f17037ccf21793d | 5477cb5c9b99baea6ba41fa5e5f21f67 | ============================= Initialisation ============================ | ofSetVerticalSync(true);
ofEnableSmoothing();
ofBackground(ofColor::black);
internet = false;
if(internet){
std::string requete;
std::cout << "Que voulez-vous dessiner ?" << std::endl;
std::cin >> requete ;
Flickr::downloadImageFromFlickr(requete);
painting.loadImage("tmp.jpg");
wt.setCity("Nantes") ;... | 1 |
aea99d9035653af9a40bc2cdba8d333b | b9f5299b03a762355e98bcdb8bc0fb7e | Test conversion of abundances from Synplot format | helium_only = Synplot_abund('[2, 2, 10.93]')
assert helium_only.from_synplot('He') == {'He': 10.93}
he_o = Synplot_abund('[2, 2, 10.93, 8, 8, 8.69]')
assert he_o.from_synplot('He') == {'He': 10.93}
assert he_o.from_synplot(2) == {'He': 10.93}
assert he_o.from_synplot(['He', 8]) == {'He': 10.93, ... | 1 |
a401c74ae4f0ed6a7643b4b2be8a1de8 | e187420df0035e768b8a32c4f38ee42a | Not any excluded states for QcDD attribute in read access. | namespace LiberaBrilliancePlus_ns
bool LiberaBrilliancePlus::is_VcTD_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
return true;
} | 0 |
128ad9c1c67dbc885b7ee2d2e3a5e6bc | 3361c802b5ae16fce29992dd351f2e46 | Возвращает вопросы. | class Team extends \Brainworkers\Entity\Team implements \Doctrine\ORM\Proxy\Proxy
public function getQuestions()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getQuestions', array());
return parent::getQuestions();
} | 1 |
2d15e21b339492d8e4fef435fdaaa620 | e396bd1f973bc5ea1cfc88607f8f294c | \fn Protected function GetMagX( void )
\brief Reads the two registers that contain the X value on the LSM303DLHC magnetometer. | {
uint8_t buffer[6];
int i;
i2c_BufferRead(I2C_DEFAULT_DEV, I2C_NO_SEM_LOCK,
LSM_M_ADDRESS, buffer, LSM_M_OUT_X_H_ADDR, 6);
for(i = 0; i < 3; i++){
out[i] = (((uint16_t)buffer[2 * i] & 0xff) << 8) | ((uint16_t)buffer[2 * i + 1] & 0xff);
}
} | 1 |
4d639e476783b5b4604c4e353df693c6 | 0a4c133dc0a22f5e30066a8c42b64f41 | Genera una explosión en la casilla solicitada | public class Control : MonoBehaviour
private static void IniciarExplosion(int i, int j) {
int vUp = (i - rangoLlama) >= 0 ? i - rangoLlama : 0;
int vDown = (i + rangoLlama + 1) <= Alto ? i + rangoLlama + 1 : Alto;
int hIzq = (j - rangoLlama) >= 0 ? j - rangoLlama : 0;
int hDer = (j + rangoLlama + 1) <= Ancho ? ... | 1 |
eb2654b95b98f6bca0e0053b733cd605 | b3906e1387deb38e98e5da5cd1eb72dd | mm_gps constructor | mm_gps *gps = (mm_gps*)malloc(sizeof(mm_gps));
memset(gps, 0, sizeof(mm_gps));
gps->buffer.head = gps->buffer.packet.b;
gps->userdata = data;
return gps;
} | 1 |
d3cbef326049570ba79b0b33ad18c92a | ebc2194eaab0e9bbf1bf5c0435b721b5 | @brief returns pointer to the end of the character buffer | class MyBuffer
char* end() const {return my_end;} | 1 |
59071283f0841632e42a057384ea96e7 | 3de385879920bdbe5cf9354945b1059d | Parse should throw NullReferenceException when the "input" string is Null. | public final void testParseNull() {
Parser parser = new ChangesParser();
assertNull(parser.parse(INVALID_CHANGELIST_TEXT));
} | 0 |
01a29581f95d0026fe675094c8e855d2 | f404d7150a91c0c277b9e5b5bc8adb91 | Keeps ball speed constant | if (ball.velocityX >= 0) {
ball.velocityX = max(1, (ball.velocityX + speedModifier));
}
if (ball.velocityX < 0) {
ball.velocityX = min(-1, ball.velocityX - speedModifier);
}
if (ball.velocityY >= 0) {
ball.velocityY = max(1, ball.velocityY + speedModifier);
}
if (ball.velocityY < 0) {
ball.vel... | 0 |
908b35293f35768c1e7927de40ad9a60 | 4640ff96e396de1a7acd9abab135414f | Draw clef. | {
bool leftOrRight = _note.IsUpOrDown();
int headPosition = Start;
int lastPosition = 0;
for (int i = 0; i < _note.GetChordList().Count - 1; i++)
{
Note extraNote = _note.GetChordList()[i];
DrawShiftLine(extraNote.GetShi... | 0 |
474cbf43123bb4b2938e2ad29e4c4dfe | d65f3202ab855975e3b5136f747c768e | The hash function I use is the CRC style taken from
http://www.cs.hmc.edu/~geoff/classes/hmc.cs070.200101/homework10/hashfuncs.html
It takes a word as an arg and returns the hash value. | h = 0xfee13117
for i in range(len(tohash)):
h ^= ord(tohash[i])
h = (h & 0xffffffff)
h += (h << 11)
h = (h & 0xffffffff)
h ^= (h >> 7)
h = (h & 0xffffffff)
h -= ord(tohash[i])
h = (h & 0xffffffff)
h += (h << 3)
h = (h & 0xffffffff)
h ^= (h >> 10)
h = (h & 0xffffffff)
h += (h << 15)
h = (h & 0xff... | 1 |
807c9f7ed618f66db386f11c855ff58f | 93c17a8a5b2f3dcf5c4b894a2c65043c | Funkcja generująca tablicę danych do widoku
na podstawie gotowych danych wejściowych | $fieldsData = [];
$fieldCache = [];
$filteredEntitiesIds = [];
$allFilteredFields = $this->getAllFilteredFields();
foreach ($allFilteredFields as $key => $field) {
$fieldType = $field->getFieldType();
$fieldCache[$key] = [
'field' => $field,
'fieldType' => $fieldType,
'dataType' =>... | 1 |
d45f839e5186df09378186201d7282d1 | 5e3084b821155384b905b3b02343f935 | This is really really basic physics just for demo purposes. You'll have your own physics I'm assuming. | public class TestPhysicsMover : MonoBehaviour
void Start ()
{
} | 0 |
dc20282cde7d71ea128401a646da0607 | 98f8fe95dca3829f1e92ea88d24f5f6a | 获取流的回放地址和分段数据 | $tem = config('video_stream');
return $this->sucJson(array_map(function ($v) use($id){
return sprintf($v, $id);
}, $tem));
} | 0 |
82d53081b125c410f5dc09ca4ca80e56 | 30bd338a937842eabf86e91647bd233a | Player type, e.g. real player | AI | PlayerType RemotePlayer::getPType() {
return pType;
} | 1 |
c54a5baaae40ef5e5ab80cead4b09b33 | ec827ffadf03ed3e6a92ae873084d127 | Подробная информация о представленном ответе | class AnswerModel extends IML_Abstract
public function getInfo($ansId)
{
if (isset($this->_info[$ansId])) {
return $this->_info[$ansId];
}
$this->_info[$ansId] = $this->db->select()
->from(array('ans' => 'ask_answer'))
->join(
array('qst' =... | 1 |
74998a103298b8074403157fdfe32dc4 | 1655ebe4a37073d49242756c34dce01a | Increment the number of package received. | class SummaryTable():
def increment_receive(self, hostname):
with self.lock:
if hostname not in self._receive:
self._receive[hostname] = 1
else:
self._receive[hostname] += 1 | 1 |
f7b1ae6a92a5bd8d30268a63394a7771 | f36fe7aeff31210e33175e4a53dfdaaa | Show the form for creating a new cs tpo procedimiento. | class ProcedimientosController extends Controller
public function create()
{
$requisiciones = Requisicion::definitivas()->sinasignar()->get();
$nullOption = "Selecciona";
$analistas = ['' => "$nullOption"] + User::analistasProcedimiento()->pluck('name', 'id')->toArray();
$requisicion_array = "create";
return... | 1 |
7f3cc2297254cb1a626e8f8ed23b8349 | b8736857cd5522ecef3eb8c5e9ae46e5 | Insert a grid of users | def insert_users_list(users_list):
conn = psycopg2.connect(CONFIG["postgres_url"])
with conn:
cur = conn.cursor()
LOGGER.info("Inserting {nb_rows} CSV row(s) in cp_datawarehouse.users table...".format(
nb_rows=len(users_list) - 1
))
psycopg2.extras.execute_values(
... | 1 |
9f2b4c38e3d6eaf9903edb01fb4d883a | 0c85911aa739e6ab0df6b0a922b80de1 | Gets the query operations related to numerical types | String[] getNumericFunctions() throws SQLException; | 1 |
ce4281f50682e04560c52163e8b4eecd | 55db323bd69c6bf3a92c1c2285c55e40 | If the finish is marked this function is called by the grid. The score is stopped and added to the statistics. | void CGameScreenController::OnReachedFinishPoint ()
{
m_bFinishLine = true;
} | 0 |
930715e18620fc1657c1fb86772fbeca | e3c3f1b73ad104d15ce74c64c1f837be | Get a web form interface for this restful service. | public class NuxeoServiceFactory
public static IFormsService getFormsService() {
INuxeoService nuxeoService = getNuxeoService();
return nuxeoService.getFormsService();
} | 0 |
529d26aea6b85bc4d95c0922bfe6b876 | fbe72528386a286f775ebbb46ae34f74 | Tests getting responses for a split requests in the incorrect order. | namespace Nexus.Http.Server.Test.SplitRequestHttp.Request
[TestFixture]
public class SplitClientRequestHandlerTests
[Test]
public void TestSplitResponses()
{
var CuT = new TestSplitClientRequestHandler(200,"text/html");
var response = CuT.GetResponseData(new HttpRequest("... | 1 |
7e40d83163bec2f72caf6d42b845c712 | b0d428077bd45eabaf7191cdf814c308 | Sample code for creating async calling server client with token credential. | String endpoint = "https://<resource-name>.communication.azure.com";
TokenCredential tokenCredential = new DefaultAzureCredentialBuilder().build();
CallingServerClient callingServerClient = new CallingServerClientBuilder()
.endpoint(endpoint)
.credential(tokenCredential)... | 1 |
f9efa906a0df839a84eebfb58112c7bd | 721398c4a3120de65d4ed3f1dc48bea5 | GETTER: gets the sort type of the hand
RETURNS
@sort_type (Sort): the way cards will be sorted | def get_hand_type(hand):
hand = sort_hand(hand)
print('Hand is: ')
for card in hand:
print(str(card.value) + ' of ' + card.suit)
is_hand_flush = is_flush(hand)
print('Hand is Flush: ' + str(is_hand_flush))
is_hand_straight = is_straight(hand, 0)
print('Hand is Straight: ' + str(is_ha... | 0 |
ad1010f622ddf36ae82307c2d136b707 | ec79e58da186b06837cffa8b0f52bd59 | [Hash]设置key的hash并设置时间 | @Component
public class RedisUtil
public boolean putForHashAndTime(String key,String item,Object value,long time) {
try {
redisTemplate.opsForHash().put(key, item, value);
if(time>0){
expire(key, time);
}
return true;
} catch (Exception e) ... | 1 |
48b74ebb098f90448f2cedca2e4195cd | 20db5c2351165f8b4a2a429e0fb3cdc7 | 多线程在回调抛出的异常并不能被调用方法捕获, 事实上, 调用方法可能已经执行完毕
如果调用线程在等待回调执行完毕, 那么在回调方法抛出异常之后, 目标线程变成了Stopped状态,
调用线程正常执行, 好像没有发生异常一样 | TEST(ExecutorThread, ExceptionThrownByCallback)
{
ExecutorThread exec(
[]() { throw std::exception(); }, std::chrono::milliseconds(1));
std::this_thread::sleep_for(std::chrono::seconds(3));
EXPECT_TRUE(!exec.isRunning());
} | 1 |
a38e7c2387c7fbacbcce173122bde5d7 | 5992ad24293cb789b3882f5c22a2154e | Stops a set of tasks that meet the filter criteria | namespace Nest
public partial class ElasticClient
public Task<CancelTasksResponse> CancelTasksAsync(Func<CancelTasksDescriptor, ICancelTasksRequest> selector = null,
CancellationToken ct = default
) =>
CancelTasksAsync(selector.InvokeOrDefault(new CancelTasksDescriptor()), ct); | 1 |
16a78696177c740e64e25f43b6e91a83 | a537c9897443c4747e9a6942131aa991 | Checks if the given block id is white-listed for interaction by Eagle Factions. | public class BlockHandler
public static boolean isMimicableBlock(int blockId) {
return !unmimicableBlocks.containsKey(blockId);
} | 0 |
b6e559d23b5cbd6f8f89760cf03e3064 | 2f6ebda0275993a4aff4f3fc4a33283b | 商家审核用户的任务,驳回 | void vendorRefuse(Integer taskId,Integer vendorId,LoginUser loginUser); | 1 |
89b40003d7877ff304c639bb4b09aa66 | 61c15bd7b2b00f43ea21a4cae8d382d2 | Remove all modifiers that match the condition. | export default class SCNParticleSystem extends NSObject
removeAllModifiers() {
} | 0 |
4271d508f5d118253872b1667bb632b7 | eca4df6b1aca9c53cc5c8d66e1e423cf | Filter by region name | {
if (!empty($RegionId)) {
if (is_array($RegionId)) {
$this->addFieldToFilter('rname.region_id', array('in' => $RegionId));
} else {
$this->addFieldToFilter('rname.region_id', $RegionId);
}
}
return $this;
} | 0 |
24ea65739fa8c215d4cb51344387b245 | c8b0d66cf72b57859342806011628a9e | Returns the value in the fourth dimension | namespace LangExt
public static class TupleModule
public static T4 _4<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13>> self) { return self.Item4 ; } | 1 |
df7bc208518d716303ac3f3838d9e1b7 | 77aabef4d749282709508532bdc825bc | Get SellerInvoiceTime | return [
'seller_name' => $this->faker->name,
'seller_code' => $this->faker->randomNumber(8),
'seller_address' => $this->faker->address,
'seller_vat' => 'LT' . $this->faker->randomNumber(8),
'number' => 'SUB' . $this->faker->randomNumber(8),
... | 0 |
92ee32a761364397a38bb14ad596f87e | 74298889f077c0e7b9155de0da1ce29a | 找回密码页面1 | class CAction extends CommonAction{
public function forget01(){
$this->display(forget01);
} | 1 |
97e5a1b961b629ed78b30f3cca700e45 | 40e3d8b0212be72cadde60b03d7bbace | Suggestion for where and when to catch fish. | {
var specificFishSpawnTimes = specificFishData[5].Split(' ');
if (specificFishLocation == -1 || gameLocation.getFishingLocation(tileLocation) == specificFishLocation)
{
for (var t = 0; t < specificFishSpawnTimes.Length; t += 2)
{
if (Game1.timeOfDay >= Convert.ToInt32(specificFishSpawnTimes[t])... | 1 |
e1ca8db0e35c489a58cfe664c0b3b299 | 574b5ee0c352926c05ce05ca1105d0e6 | ## Convert a weighted to a binary matrix | ints<- c(0:(n-1))/(n-1)
ints<- 1/(1+exp(scale*(0.5-ints)))
b<- min(ints)
m<- 2*b/(n-1)
ints<- ints+(m*c(0:(n-1)) -b)
YW <- ints[ints < 0.5] *2
WB <- (ints[ints >= 0.5]-0.5) *2
YW[YW<0] <- 0; WB[WB>1] <- 1
c(rgb(1, 1, YW), rgb(1-WB, 1-WB, 1))
} | 0 |
f872a49a422839eeeb740581033cba97 | 92a2478d9d75075cbcb6d0a323dc987e | Initializes internal state of BaseCastleQuery object. | self.__search_interface = search_interface
self.__output_controller = output_controller
self.__topic = topic
self.__actions = []
self.__depths = []
self.__query_list = query_list
self.__query_count = 0 ... | 1 |
f8cdf222eac02b9217f305bbaf545038 | 7975e4a437f1c9366df54031dda477ac | 两票系统中工作票办理延期成功时修改计划完工时间 | {
string strSql = "update tmp_dayplan set N_EXEC_STATUS=1 where C_PLCODE='"+plancode+"'";
return DbHelperOra.ExecuteSql(strSql) > 0 ? true : false;
} | 0 |
dafa8d4ac905249bcfca2af4f313fa57 | 832ae00b332c5ecb1f7944e8743ece5d | Save the component state to WISE. | class WISEAPI
handleComponentStateSavedMessage(messageData) {
const componentState = messageData.componentState;
} | 0 |
906797611976f1478622bd7aa2222bbe | bd8a163535634b8638eaac7f856eeac9 | Navigates users to SME cluster to initiate a business opportunity for the search product.
We pass the search query, selected category and other filters to SME cluster. | {
String strStepDesc = "";
bool blnStepRC = false;
string pageName = dictTestData["PageName"];
string databaseQuery = "";
strStepDesc = "Launch 'COT' application URL.";
dictTestParameters["UserName"] = dictCommonValue["COTUserName"];
... | 0 |
f5e339db62ab8a485a7ab7be52adcaca | 2aa1969b7f20a0a6a3411389bad65287 | Initializes the loader with repository object | void initializeRepository(); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.