text stringlengths 27 775k |
|---|
import replace from 'replace-in-file';
import { Project } from 'ts-morph';
import { PATHS, SCHEMAS } from '../src/constants';
import { kebabSchemaName } from './util';
/**
* Iterates through all generated models, removes the `createRequestFunction` from the
* `common` import and injects the `createRequestFunction` f... |
# 🍀☁️
Clover drone simulation playground for cloud.
<img src="screenshot.png" width=800>
## Running
Prerequisites: [Docker](https://docs.docker.com/engine/install/ubuntu/).
```bash
docker run \
-p 8080:8080 \
-p 9090:9090 \
-p 7070:7070 \
-p 57575:57575 \
-p 8000:80 \
-p 18570:18570/udp \
ghcr.io/co... |
namespace Models
{
public class Teacher : User
{
public Teacher(string firstName, string lastName, string userName, string password) :
base(firstName, lastName, userName, password, RoleEnum.Teacher)
{
}
}
}
|
BLOCK_MESSAGE = ['你请求过快,超过了频率限制,暂时屏蔽一段时间。如果有问题,请到 https://github.com/ruby-china/ruby-china/issues/new 提出。'.freeze]
class Rack::Attack
Rack::Attack.cache.store = Rails.cache
### Throttle Spammy Clients ###
throttle('req/ip', limit: 500, period: 3.minutes) do |req|
req.ip unless req.path.start_with?('/mini-pr... |
---
title: First Datebox
pagenum: 3
layout: doc
---
# Your First Datebox
Adding a datebox is as simple as adding a data-role to a date or text input element
and specifying the {% api_doc mode %} you wish to use.
{% highlight html %}
<input type="text" data-role="datebox" data-options='{"mode":"calbox"}'>
{% endhighl... |
# frozen_string_literal: true, encoding: ASCII-8BIT
require 'bindata'
require 'bacnet/objects'
require 'bacnet/services'
require 'bacnet/npdu'
class BACnet
Datagram = Struct.new(:header, :request, :objects, :junk) do
def to_binary_s
data = String.new(request.to_binary_s)
objects.e... |
using System.Collections.Generic;
namespace CParser.Parsing.Ast
{
public class ParameterTypeListAstNode : AstNode
{
public IReadOnlyList<ParameterDeclarationAstNode>? ParameterList { get; }
public bool VarArgs { get; }
public ParameterTypeListAstNode(
IReadOnlyList<Parameter... |
<?php
use Illuminate\Database\Seeder;
use App\User;
use App\Course;
use App\Track;
use App\Photo;
use App\Video;
use App\Question;
use App\Quiz;
class DatabaseSeeder extends Seeder
{
public function run()
{
// Do not check foreign keys
DB::statement('set FOREIGN_KEY_CHECKS = 0');
// reset All... |
require_dependency 'cartodb_config_utils'
module CartoGearsApi
module Helpers
# This should be included in every controller using the following CARTO layouts:
# - carto_gears_api/dashboard
# - carto_gears_api/profile
module GearControllerHelper
include SafeJsObject
include CartoDB::Config... |
/*
Package english groups some utility functions for working with english text.
*/
package english
|
package objects
import (
"../locate"
"lib/utils"
"log"
"net/url"
"os"
)
func getFile(hash string) string {
file := os.Getenv("STORAGE_ROOT") + "/objects/" + hash
f, _ := os.Open(file)
d := url.PathEscape(utils.CalculateHash(f))
f.Close()
if d != hash {
log.Println("object hash mismatch, remove", file)
l... |
require 'cfn-nag/iam_complexity_metric/condition_metric'
require 'cfn-model/model/statement'
describe ConditionMetric do
describe '#metric' do
context 'zero conditions' do
it 'returns 0' do
statement = Statement.new
statement.effect = 'Allow'
statement.actions = ['fred:YellAtDino']
... |
/*
* Copyright (c) 2021 NetEase, Inc. All rights reserved.
* Use of this source code is governed by a MIT license that can be found in the LICENSE file
*/
package com.netease.yunxin.nertc.demo.feedback
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.view.View
im... |
package com.essue.jabac.client.model;
import java.lang.reflect.Field;
public class Attribute {
private Field field;
private String alias;
private String name;
private String path;
public Attribute(Field field, String name, String alias, String path) {
this.field = field;
this.alias = alias;
... |
using System;
using MikhailKhalizev.Processor.x86.BinToCSharp;
namespace MikhailKhalizev.Max.Program
{
public partial class RawProgram
{
[MethodInfo("0x1_1311-29341e7b")]
public void Method_0001_1311()
{
ii(0x1_1311, 1); pop(ax); /*... |
#!/bin/bash
docker rm $(docker ps -a -q -f status=exited)
docker images | grep -v REPOSITORY| grep "<none>" | awk '{printf("%s\n", $3)}' |xargs docker rmi
|
# mlp.jl
# original: https://github.com/denizyuret/Knet.jl/blob/master/examples/reinforcement-learning/dqn/mlp.jl
using AutoGrad
const ArrayOrKnetArray{T} = Union{<:Array{T}, <:KnetArray{T}}
const WeightParams{T} = Dict{String, <:ArrayOrKnetArray{T}}
const WeightParamsR{T} = Union{<:WeightParams{T}, <:AutoGrad.Rec{<:... |
pub const ALPHA_MUL_TABLE : [u32; 256] =
[
0x00000000, 0xE19FCF13, 0x6B973726, 0x8A08F835,
0xD6876E4C, 0x3718A15F, 0xBD10596A, 0x5C8F9679,
0x05A7DC98, 0xE438138B, 0x6E30EBBE, 0x8FAF24AD,
0xD320B2D4, 0x32BF7DC7, 0xB8B785F2, 0x59284AE1,
0x0AE71199, 0xEB78DE8A, 0x617026BF, 0x80EFE9AC,
0xDC607FD5, 0... |
<?php
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Pterodactyl\Models\Permission;
use Illuminate\Support\Facades\Schema;
use Pterodactyl\Models\Permission as P;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MergePermissionsTableIntoSubusers ... |
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 applicable law or agre... |
<?php
/**
* @see https://pestphp.com/docs/
*/
use App\Models\Lotacao;
test('retorna as lotações usando o escopo ascendente por nome', function () {
$first = 'Lotação A';
$second = 'Lotação B';
$third = 'Lotação C';
Lotacao::factory()
->create(['nome' => $third]);
Lotacao::factory(... |
# Example
A demo django project for *django-echarts*.
## Feature
- Examples for django-echarts
- sqlite3 database
## Run
1 Install the dependency packages.
```shell
pip install -r requirements.txt
```
2 Run with development server.
```shell
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
```
... |
package couchdb
import (
"errors"
"fmt"
"net/url"
"reflect"
"strings"
"testing"
)
func TestRowObject(t *testing.T) {
results, err := designDB.View("_all_docs", nil, map[string]interface{}{"keys": []string{"blah"}})
if err != nil {
t.Error("db view error", err)
}
rows, err := results.Rows()
if err != nil... |
import { Get, Controller, Render, Param } from '@nestjs/common';
@Controller()
export class AppController {
@Get()
@Render('index')
root() {
}
@Get(':slug')
@Render('page')
page(@Param('slug') slug) {
return {
slug,
};
}
} |
# IO integration {#io_page}
**Experimental** - The `proton::io` interfaces are new and remain
subject to change.
The `proton::io` namespace contains a service provider interface (SPI)
that allows you to implement the Proton API over alternative IO or
threading libraries.
The `proton::io::connection_driver` class con... |
export 'src/communication/device.dart';
export 'src/communication/driver.dart';
export 'src/communication/session.dart';
export 'src/communication/web_socket_communicator.dart';
export 'src/config/server_configuration.dart';
export 'src/handlers/goodbye_handler.dart';
export 'src/handlers/list_devices_handler.dart';
... |
namespace GameBase.Common.Interface.Poker
{
public interface IPlayerVector_Controller:Interface.IPlayerVector_Controller
{
Core.Poker.GameSubType GameSubType { get; }
}
} |
const mongoose = require('mongoose');
const crypto = require('crypto')
const postSchema = new mongoose.Schema({
userId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
},
title: {
type: String,
default: 'New Post'
},
content: {
type: String,
defau... |
import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/account/models/city_entity.dart';
import 'package:azlistview/azlistview.dart';
CityEntity $CityEntityFromJson(Map<String, dynamic> json) {
final CityEntity cityEntity = CityEntity();
final String? name = jsonCo... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const crypto = require("crypto");
const fs = require("fs");
const path = require("path");
const url_1 = require("url");
const util = require("util");
const publication_link_1 = require("../models/publication-l... |
#!/bin/bash
# ./unzip_yfcc100m.sh /mnt/ds3lab-scratch/jiawei/yfcc100m/original_data/ 4 96
dir_path=$1
start_index=$2
end_index=$3
cd ${dir_path}
for ((i=${start_index}; i<=${end_index}; i++)); do
data_path="${dir_path}/YFCC100M_hybridCNN_gmean_fc6_${i}.txt.gz"
gzip -d ${data_path}
done |
package ch.mhaspra.sensorstream.ui.streams
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ListView
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.Observer
import ch.mhaspra... |
namespace bbv.Examples.SOLID._3_LSP.II_Solution
{
using System.Linq;
public class AreaCalculator
{
private readonly Shape[] shapes;
public AreaCalculator(Shape[] shapes)
{
this.shapes = shapes;
}
public double Sum()
{
return this.sh... |
# frozen_string_literal: true
require "application_system_test_case"
# Test for project editors to edit subject medications.
class MedicationsTest < ApplicationSystemTestCase
setup do
@project = projects(:medications)
@subject = subjects(:meds_01)
@project_editor = users(:meds_project_editor)
@medic... |
/**
* @typedef {AnimationJob} CarouselImageSlideJob
*/
/**
* This module defines a constructor for CarouselImageSlideJob objects.
*
* @module CarouselImageSlideJob
*/
(function () {
// ------------------------------------------------------------------------------------------- //
// Private static ... |
module Pseudopotentials
export PerdewZunger,
VoskoWilkNusair,
PerdewBurkeErnzerhof,
PBE,
PerdewBurkeErnzerhofRevisedForSolids,
PBEsol,
BeckeLeeYangParr,
BLYP,
PerdewWang91,
TaoPerdewStaroverovScuseria,
TPSS,
Coulomb,
KresseJoubert,
Blöchl,
TroullierMartins,
B... |
#!/bin/bash
# The MIT License (MIT)
#
# Copyright (c) 2015 Southern Nazarene University Computer Science/Network Engineering Department
#
# 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 wi... |
define(['jquery-ui'], function() {
util.ui = {
resizableAndDraggable: function(el, self) {
$(el).resizable({
handles: "n, e, s, w, se",
resize: self.resized,
containment: "parent"
});
$(el).draggable({
drag: self.moved,
containment: "parent"
});
... |
; Copyright by Shlomi Fish, 2018 under the Expat licence
; https://opensource.org/licenses/mit-license.php
; This aims to be a solution for:
; http://projecteuler.net/problem=23
(asdf:oos 'asdf:load-op :iterate)
(use-package :iterate)
(asdf:oos 'asdf:load-op :memoize)
(use-package :memoize)
; a^2 + b^2 = c^2
; a + b... |
using System;
using System.Collections.Generic;
using System.Text;
using NRuler.Terms;
namespace NRuler.Conditions
{
/// <summary>
/// foamliu, 2008/12/10.
/// Note:
/// (1) only one;
/// (2) must be last.
/// </summary>
public class NegativeCondition : Condition
... |
import h from '../spec_helper';
import ChordParser from '../../src/chords/chord-parser';
describe('ChordParser:', () => {
// ------------------------------------
it('roots', () => {
const parser = new ChordParser();
const checkRoot = (parserInstance, chord, expectedRoot) => {
const parsedChord = par... |
;; AUTHORS:
;; Shilpi Goel <shigoel@cs.utexas.edu>
;; Matt Kaufmann <kaufmann@cs.utexas.edu>
(in-package "X86ISA")
(include-book "x86-other-non-det"
:ttags (:include-raw :undef-flg :syscall-exec :other-non-det))
(local (include-book "centaur/bitops/ihs-extensions" :dir :system))
(in-theory (e/d () (mv-... |
from nltk.tag.stanford import NERTagger
import dautil as dl
import os
from zipfile import ZipFile
from nltk.corpus import brown
def download_ner():
url = 'http://nlp.stanford.edu/software/stanford-ner-2015-04-20.zip'
dir = os.path.join(dl.data.get_data_dir(), 'ner')
if not os.path.exists(dir):
os.... |
(ns obb-rules-api.routes
(:use compojure.core)
(:gen-class)
(:require [compojure.handler :as handler]
[obb-rules-api.index :as index]
[obb-rules-api.focus :as focus]
[obb-rules-api.units :as units]
[obb-rules-api.unit :as unit]
[obb-rules-api.random-game... |
#--
# Cloud Foundry 2012.02.03 Beta
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
# You may not use this product except in compliance with the License.
#
# This product includes a number of subcomponents with
# se... |
module Blaze.Import.Source.BinaryNinja (
module Blaze.Import.Source.BinaryNinja,
module Exports,
) where
import Binja.Core (BNBinaryView)
import qualified Binja.Core as Bn
import qualified Binja.Function as BnFunc
import qualified Binja.MLIL as Mlil
import Blaze.Import.CallGraph (CallGraphImporter (getCallSites, g... |
require 'action_view/helpers/translation_helper'
class AttendeePlan < ActiveRecord::Base
include YearlyModel
extend ActionView::Helpers::TranslationHelper
belongs_to :attendee
belongs_to :plan
has_many :dates, :class_name => 'AttendeePlanDate'
# As with other attendee linking tables, mass-assignment secu... |
import { Message } from 'element-ui';
export default {
name: 'message',
success(content) {
Message({
showClose: true,
message: content,
type: 'success',
customClass: 'layer-level-zindex'
});
},
warning(content) {
Message({
showClose: true,
message: content,
... |
<?php
namespace NodeRunner\Queue;
class Immediate extends \NodeRunner\Queue
{
public function __construct($DBAdapter, $queueName = 'immediate')
{
parent::__construct($DBAdapter, $queueName);
}
} |
var express = require('express');
require = require('esm')(module);
//module.exports = require('./app.js');
var app = express();
app.use(express.static('./'));
app.use(express.static('./shaders'));
app.use(express.static('/dist/js'));
app.listen(8000); |
# CS12J
Material For Supplemental Instruction for CS12J (Introduction to Programming Concepts and Methodology, Java)
## [All Slides](https://drive.google.com/drive/folders/1XgwLqsDrXuAsVudMv9tlvET-yUtsR6Kt?usp=sharing)
## Spring of 2020 Recordings
[Recordings](https://www.youtube.com/playlist?list=PLx97YYNRB4zQ98qMMX... |
package pt.isel.vsddashboardapplication.repository.base.implementation
import android.util.Log
import androidx.lifecycle.LiveData
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import pt.isel.vsddashboardapplication.model.statistics.DpiProbestats
import pt.isel.vsddashboardapplication.repo... |
module NMEA.AIS.AreaNotice where
newtype AreaNotice = AreaNotice Int deriving (Eq)
instance Show AreaNotice where
show (AreaNotice 0) = "Caution Area: Marine mammals habitat"
show (AreaNotice 1) = "Caution Area: Marine mammals in area - reduce speed"
show (AreaNotice 2) = "Caution Area: Marine mammals in ... |
package pl.shockah.wowdiscordrpc.comm.activity.other;
import javax.annotation.Nullable;
import lombok.Getter;
import lombok.Setter;
import pl.shockah.wowdiscordrpc.comm.activity.Activity;
@Getter
@Setter
public class WorldActivity extends Activity {
@Nullable
public String zoneName;
} |
Instructions for running the example are on the linked [wiki](https://udst.github.io/activitysim/gettingstarted.html) |
package com.dtstack.taier.flink.client;
import com.dtstack.taier.pluginapi.JobIdentifier;
import org.apache.flink.client.program.ClusterClient;
import org.apache.hadoop.yarn.client.api.YarnClient;
/**
* @program: engine-plugins
* @author: xiuzhu
* @create: 2021/07/15
*/
public interface IClientManager {
/**... |
//===- MlirInit.cpp -------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
package org.jesperancinha.plugins.omni.reporter.utils
import java.io.File
import java.io.FileNotFoundException
import java.net.URL
import kotlin.io.path.toPath
class Utils {
companion object {
val root = File(
Utils::class.java.getResource("/")?.toURI() ?: throw FileNotFoundException()
... |
from stl import mesh
import cv2
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
import os
import sys
"""
Generates a mesh based on an image of detected walls.
Can optionally generate a mesh above detected doorways and windows.
"""
def open_file(path_to_file):
"""
Open ... |
import fetch from 'node-fetch';
import { SET_IDS } from '../helpers/constants';
import { ArtifactCache } from './cache';
export interface CardSetResponse {
card_set: CardSet;
}
export interface CardSet {
version: number;
set_info: {
set_id: number;
pack_item_def: number;
... |
use gtk::gio;
use gtk::glib::Cast;
use gtk::prelude::*;
use std::ops::Index;
pub const MAIN_WINDOW_NAME: &str = "main-window";
#[derive(Debug)]
pub struct RotateVec<T> {
data: Vec<T>,
start: usize,
}
impl<T> RotateVec<T> {
pub fn new(d: Vec<T>) -> RotateVec<T> {
RotateVec { data: d, start: 0 }
... |
# TODO: Should we use autoload instead of require here? Probably yes
require "rails_ui_config/version"
require "rails_ui_config/engine"
require "rails_ui_config/configurator"
# require "rails_ui_config/config/old_environment.rb"
require "rails_ui_config/config/environment.rb"
require "rails_ui_config/config/ruby_file_m... |
---
layout: post
title: Visualize Tree Structure with PyGraphviz
categories:
- post
---
## The SegmentTree
Count the number within interval range.
```python
def build(arr):
# full binary tree represented by an array.
# https://hg.python.org/cpython/file/2.7/Lib/heapq.py
sz = 1
while sz < len(arr):
... |
package com.wo1f.domain.repository
import com.wo1f.base.DataResource
import com.wo1f.domain.model.ExploreData
interface ExploreRepository {
suspend fun getExploreData(): DataResource<ExploreData>
suspend fun insertExploreData(exploreData: ExploreData)
}
|
using System.Collections.Generic;
using Blamite.Blam;
using Blamite.IO;
namespace Blamite.Patching
{
/// <summary>
/// [DEPRECATED] Provides static methods for patching tag meta in a cache file.
/// </summary>
public static class MetaPatcher
{
/// <summary>
/// Writes a series of meta changes back to... |
actions :install_grants, :wait_until_started
attribute :wait_time, :kind_of => Integer, :default => 20
attribute :remove_mycnf, :kind_of => Integer, :default => 0
default_action :install_grants
|
import { useRef, useEffect, useState } from "react";
import { v4 as uuid } from "uuid";
import convert from "./convertRgbToHsl";
const useGradientEffector = ({
dimensions: { width, height } = {},
position: { x, y } = {},
// falloff, TODO: add non-linear gradient ramp for radial gradient
innerRadius = 1,
oute... |
import { NativeModules } from 'react-native';
export type HyperwalletConfig = {
transferMethodCountry: string;
transferMethodCurrency: string;
bankAccountId: string;
branchId: string;
bankAccountPurpose: string;
};
type HyperwalletConstants = {
BANK_ACCOUNT_PURPOSE_CHECKING: string;
BANK_ACCOUNT_PURPOSE... |
package pulsar
import (
log "github.com/apache/pulsar-client-go/pulsar/log"
)
type cumulativeAcksTracker struct {
requestCh chan interface{}
trackedMessageList []*trackingMessageID
closeCh chan struct{}
log log.Logger
}
// requests
type messagesReceivedReq struct {
msgIDs []*... |
import { Selector } from 'testcafe';
import url from '../../helpers/getPageUrl';
import List from '../../model/list';
fixture `List`
.page(url(__dirname, './pages/t718398.html'));
test("List selection should work with keyboard arrows (T718398)", async t => {
const list = new List('#list');
const input = S... |
# the name for the logstash instance, affects initscript names and other things
default['elkstack']['config']['logstash']['instance_name'] = 'server'
# enable logging with logstash using ELK stack
default['elkstack']['config']['agent']['enabled'] = true
# the name for an agent logstash instance, affects initscript na... |
# Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.
require 'ramaze/template/ezamar/engine'
module Ezamar
# A transformer for <render /> tags.
#
# Setup:
#
# pipeline = Ramaze::Template::Ezamar::TRANSFORM_... |
package noop
import (
"github.com/mlab-lattice/lattice/pkg/backend/kubernetes/lifecycle/system/bootstrap/bootstrapper"
)
func NewBootstrapper() *DefaultBootstrapper {
return &DefaultBootstrapper{}
}
type DefaultBootstrapper struct {
}
func (b *DefaultBootstrapper) BootstrapSystemResources(resources *bootstrapper.... |
from datetime import datetime, timedelta
from unittest import TestCase
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.search.query.querySuggestionResults import QuerySuggestionResults
from office365.sharepoint.search.queryResult import QueryResult
from office365.sharepoint.sear... |
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
namespace MvcTypescript.MvcWebClient.Models
{
public class StandardFormViewModel
{
public StandardFormViewModel(object data)
{
Data = data;
}
... |
export type MsSqlConfiguration = {
type: "mssql";
serverIp: string;
port: string;
username: string;
password: string;
database: string;
trustServerCertificate: boolean;
};
|
module MCMCChainsStorage
import Base: read, write
using HDF5
using MCMCChains
"""
write(f::Union{HDF5.File, HDF5.Group}, chains::Chains)
Write MCMCChains object to the HDF5 file or group.
"""
function Base.write(f::Union{HDF5.File, HDF5.Group}, c::Chains)
for s in sections(c)
g = create_group(f, str... |
var
_ = require('lodash'),
io = require('socket.io'),
fs = require('fs'),
express = require('express'),
path = require('path'),
port = 9222,
app = express(),
hosts = {},
server ... |
/** Loading组件 用于按需加载时过渡显示等 **/
import React from "react";
import "./index.less";
import ImgLoading from "../../assets/loading.gif";
export default function LoadingComponent(props) {
function makeType(p) {
let msg;
if (p.error) {
msg = "加载出错,请刷新页面";
} else if (p.timedOut) {
... |
# Custom Provider
In this chapter, we will create a custom provider that reads a json object as a pandas data frame.
## Folder Structure
```
├── catalog.yml
├── main.py
├── data
│ └── dataset.json
└── src
├── __init__.py
└── custom_provider.py
```
## Subclass `BaseProvider`
* You must implement `.load()... |
package edu.uw.zookeeper.safari.peer.protocol;
import com.google.common.base.MoreObjects;
import edu.uw.zookeeper.protocol.Session;
import edu.uw.zookeeper.protocol.ConnectMessage;
public abstract class OpenSessionMessage<V extends ConnectMessage<?>> extends ValueMessage<Long, V> {
protected OpenSessionMessage(... |
using System.Xml.Serialization;
namespace IFConverter.Base.Model.IFolor
{
[XmlRoot(ElementName = "Color")]
public class Color
{
[XmlAttribute(AttributeName = "colorA")]
public int ColorA { get; set; }
[XmlAttribute(AttributeName = "colorR")]
public int ColorR { get; set; }
... |
#!/usr/bin/env bash
export CC="armv7a-cros-linux-gnueabi-gcc"
export CFLAGS="--sysroot=$MARVELL_ROOTFS -marm -mfpu=neon -mfloat-abi=hard"
|
# MongoDB Basics Chapter 3: Deeper Dive on the MongoDB Query Language
> Ch3 其實比較無聊,可以自己看 Query Operator 的文件就好
[Query and Projection Operators](https://docs.mongodb.com/manual/reference/operator/query/)
## Comparison Operators
* `$gt`: >
* `$lt`: <
* `$gte:`: >=
* `$lte`: <=
* `$ne`: != (包含 undefined)
* `$in`: match... |
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'card_button.g.dart';
@JsonSerializable()
/// {@template card_button_template}
///
/// {@endtemplate}
class CardButton extends Equatable {
/// The text to show on the button.
final String? text;
/// The text... |
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Offer extends Model
{
protected $fillable = [
'customer_id',
'info',
'rfq',
'offer_date',
'valid_date',
'service_id',
'subservice_id',
'equipment_id',
'conditionn',
'... |
use crate::Init;
use core::{
marker::PhantomData,
ptr::{null_mut, NonNull},
};
use super::GlobalTlsfOptions;
const MIN_ALIGN: usize = crate::GRANULARITY;
/// The allocation unit, which is intentionally set to be larger than the usual
/// page sizes to reduce overhead. TODO: Make this adjustable
const ALLOC_U... |
# `@marigold/jest-config`
> Shareable `jest` configuration used by marigold
|
#ifndef DD_DBG_H
#define DD_DBG_H
inline void Dbg(LPCTSTR lpFmt,... )
{
#ifdef DD_DBG
va_list marker;
va_start( marker,lpFmt );
char text[1000]={0,};
vsprintf( text,lpFmt,marker);
va_end( marker );
CString buf(text);
OutputDebugString (buf);
#endif
}
inline CString DDFORMAT(LPC... |
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace ApplicationModels.Helpers {
public static class ConnectionStringHelper {
static string appsettings_path = "appsettings.json";
public static string GetConnStr(string database) {
using (StreamReader r = new S... |
/*
* MIT License
*
* Copyright (c) 2021 A M Satrio
*
* 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 the rights
* to use, copy, modif... |
using ApartmanYonetimOtomasyonu.DataAccess.EntityFramework.Repository.Abstracts;
using ApartmanYonetimOtomasyonu.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApartmanYonetimOtomasyonu... |
---
layout: album
title: "Album: X4: Foundations"
album_name: x4foundations
--- |
# encoding: utf-8
#
# Copyright (c) 2020-2021 Hopenly srl.
#
# This file is part of Ilyde.
#
# 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
#... |
import sys
sys.path.append(r"..")
from Source.linked_list import LinkedList
class _LinkedListNode():
"""A node structure for a doubly linked list."""
def __init__(self, data=None, next=None, previous=None):
self.data = data
self.next = next
self.previous = previous
class DoublyLin... |
use std::{
fs::File,
io::{BufRead, BufReader},
};
pub fn read_list(filename: &str) -> Vec<String> {
let f = File::open(filename).expect("Could not read file");
BufReader::new(f).lines().map(|l| l.expect("Err")).collect()
}
#[derive(Debug, Clone)]
struct Image {
pixels: Vec<Vec<u8>>,
algorithm:... |
# TLS 1.2 Handshake - An explanation
> An effort to understand and explain TLS, at the _right_ level of abstraction
## Sections
* [Target audience](#target)
* [A New Session Negotiation: Explained!](#new-session-negotiation)
* [How to read this explanation?](#how-to-read-this-explanation)
* [Flow](#flow)
* [Abbr... |
#!/bin/bash
# Script to check if there have been any changes to the files in the /etc/ directory
# if changes have been detected it alerts the user and then updates its reference
# target directory to be checked
targetdir=/etc/
# reference file, if none exsists its created and populated with the hash generated
reffi... |
# @param {Integer} n
# @return {Boolean}
def is_power_of_two(n)
n != 0 && (n == 1 || (n % 2 == 0 && is_power_of_two(n / 2)))
end
|
import PropTypes from 'prop-types';
import React, {Component} from 'react';
class DisqusThread extends Component {
static propTypes = {
identifier: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
title: PropTypes.string.isRequired
}
componentDidMount() {
var d = document, s = d.cr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.