query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
2c9d1553b92d52303ba5662bb652993b | e4f994ffe7c12dc2ba3c4df52a7e5f0d | Adds service API versioning to the specified container builder. | where T : notnull, IDeclareApiVersionConventionBuilder
{
builder.HasApiVersion( new ApiVersion( groupVersion, status ) );
return builder;
} | 1 |
efc05aa4dd49bf9f37cd05e72c76653f | 133d10f00463a5e2273c72d66b9b3dd0 | 绑定Dictionary数据集至ListControl. | {
listControl.Items.Clear();
listControl.DataSource = GetEnumToDictionary(enumType);
listControl.DataValueField = "key";
listControl.DataTextField = "value";
listControl.DataBind();
} | 1 |
7754cffb7e8f41deaff61655151e83fa | 3f32aa138e49bc40c4fd3ee00a62fcbc | Deassert the chip select for the TRF79x0. | void iqrfDeselectTRmodule(void)
{
digitalWrite(TR_SS_PIN, HIGH);
IqrfControl.TRmoduleSelected = false;
SPI.endTransaction();
} | 1 |
eb2591a5f9f67faa549b8c3135ee3028 | 9c54faae34004334d6eaed1c230d11de | 넘어온 셀 영역을 병합하는 함수 | namespace Xp_Table_V1
public partial class TableController : MonoBehaviour,IPointerClickHandler
public void MergeSelectCell()
{
CellData leftTop, rigthDown;
Get_Select_LeftTop_And_RigthDown_Cell(out leftTop, out rigthDown);
if (leftTop == null || rigthDown == null) retur... | 1 |
414b7390bdcadd90c3423bda361c31aa | ebc11b98bf8eafe06ec06f3f016f10bd | save the page to disk for further processing | {
StreamWriter sw = File.CreateText(getSavePath() + _FileName);
sw.Write(currentPagePath);
sw.Flush();
sw.Close();
} | 1 |
46390ae83332194af62fcc486536cf53 | 913d1a3ebbcc64686aa79e0385f0eeaf | initialises the value of scoreText | class Score:
#Initialize the variables for the score
def __init__(self, fontName='Gameplay.ttf'):
self.value = 0
self.font = pygame.font.Font(os.path.join('../fonts', fontName), 24)
self.score = self.font.render(
'SCORE : ' + str(self.value), True, (255, 255, 255)) | 1 |
a5e0dc28aa138d0f2bb19fc790017c95 | b2913bea44208a418281f864f2948518 | Create a Haiku conditioner that assumes a single batch dimension. | class WinoBias(datasets.GeneratorBasedBuilder):
def __init__(self, *args, writer_batch_size=None, **kwargs):
super(WinoBias, self).__init__(*args, **kwargs)
self._writer_batch_size = writer_batch_size or 100 | 0 |
b3fe4acd2c29c5e57fd3c0cc87c6abed | bec170a7ff5c398824257310ec37557d | Helper to grab the last gram in a line. | namespace Poetry.Uploader.PoetryGeneration
public class PoetryParser : IPoetryParser
private string[] GetLineBeginning(string[] splitLine, int gramSize)
{
string[] gramWords = new string[gramSize];
for (int i = 0; i < gramSize; i++)
{
gramWords[i] = splitL... | 0 |
fc21bcfb9f721f6f7b7833d9ceb1667e | 512b1a19f0998c9b13219d563c98f2de | Gets the allowInsertColumns property value. Represents the worksheet protection option of allowing inserting columns. | namespace NPOI.XSSF.UserModel
public class XSSFSheet : POIXMLDocumentPart, ISheet
public void LockInsertColumns()
{
CreateProtectionFieldIfNotPresent();
worksheet.sheetProtection.insertColumns = (true);
} | 0 |
4b90933057486244bcd67a0440140365 | 50ed16dec558d85e0fe751458d32ae1b | 购物车数量金额计算(减法) | function goodsCarReduce(ev) {
var ev = ev || window.event;
var nowObj = $(ev.target);
var goodsNum = nowObj.next().html();
goodsNum--;
console.log(nowObj)
console.log(goodsNum)
nowObj.next().html(goodsNum);
carNum--;
$(".car-count").html(carNum);
var fodPrice = nowObj.parent().prev().find($(".goods-... | 1 |
f5865c3ba0d84d5da5644c0bdfb79cce | 93ef01bf51d0e7017488ae562781c40a | Consulta si el entityManager esta activo | @ManagedBean(name = "matos_auth")
@SessionScoped
public class MatosAuth implements Serializable
public boolean isManaged() {
return (connection != null);
} | 0 |
d96be40627b7ab7feb222919e6e31923 | b48e761fb36bd9b6cc8089c50b679d38 | Returns True if the binning value is circular | class QUANTITY:
def isLinear(self): return self.circular_range == [] | 0 |
3dbf8ab23ea0c5e3bf8b3b102c5f3e54 | 5a8dc7d0409dfacd27d9caee4720bf0b | Get the fait generic7. | class SuiviClient
public function getFaitGeneric9() {
return $this->faitGeneric9;
} | 0 |
228ee0751c5647dbc6dff6af24d68500 | 7a74f8851ca9d77241a12762479b6acd | Met à jour le joueur courant lorsqu'il a trouvé un trésor
c-à-d enlève le trésor de sa liste de trésors à trouver | def tresorTrouve(joueur):
del joueur[1][0] | 1 |
e39ba9fb7c6cf6bf2d1c1c0d94270629 | 6d51f86ccf9d72553217d88820bfcce5 | The canonical host is guaranteed to be lower case. | class Server
class Description
def hosts
@hosts ||= (config[HOSTS] || []).map { |s| s.downcase }
end | 1 |
c0fe2410448e4b482fd229f3d8dd7df1 | 8b80f79ebe0a060e2f2d23bce53b9721 | | Manually stops the camera when in free-look mode. | class PluginSceneManager extends PluginBase
void FreeCameraControlEnable()
{
GetGame().GetInput().ChangeGameFocus(-1);
GetGame().GetUIManager().ShowUICursor(false);
} | 0 |
a363b847bf43d048fcd9287ba3bcac7f | f378ccc119aab1a312d5e2f9238d6eed | =========================================
Edita un profesional con sus datos
========================================= | @Controller
public class UsuarioController
@RequestMapping(value = "/ProfesionalUpdate/ProfesionalUpdateSave", method = RequestMethod.POST)
public ModelAndView guardarProfesionalporid(Profesional p, ModelMap model, Locale locale) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
Stri... | 1 |
7c2768019a07697506c18f93ac843d51 | 0d349231c2549fbfd9381e43aa1c8e23 | Check that the EMS inventory is as up to date as the CloneVM_Task completeTime
to prevent issues with post-provision depending on data that isn't in VMDB yet | timerightnow = datetime.utcnow().replace(tzinfo=None)
ec2launchtime = instance.launch_time.replace(tzinfo=None)
ec2uptimeSecond = (timerightnow - ec2launchtime).seconds
conn_health = ""
if ec2uptimeSecond > 180:
conn_health = await self.wait_until_SSHable(instan... | 0 |
91560fe314824e582739bbe8ab6bd396 | d18b1063321cc32e3997f78ab654b8f3 | validate the node if it's ok to use and have enough resources | namespace Server
public class NodeManager : CustomNodeManager2
protected override NodeState ValidateNode(ServerSystemContext context, NodeHandle handle, IDictionary<NodeId, NodeState> cache)
{
if (handle == null)
{
return null;
}
if (handle.Val... | 0 |
dc57f854388a3de255e7033d76a64ffe | 2173750cb1accda32e8b67a9d3dace04 | Clone course files | class CourseFileController extends Controller
public function destroy(Coursefile $coursefile)
{
$coursefile->delete();
return redirect()->route('coursefile.coursefiles')
->with('success','Course File deleted successfully');
} | 0 |
573547a484788a21732f6de55fe27887 | 020ce3bc9baacef36c09edbf649b2b8a | 接收数据
如果缓冲已满,断开连接,不再接受数据。 | {
try
{
int count = _socket.EndReceive(ar);
if (count <= 0)
{
Close();
return;
}
ReceiveProcess(count);
AsyncReceive();
}
catch ... | 0 |
496cf131489ba73fe7e0da39124c0123 | 279b936fe4b3e5d6aee9b41bc20b82a8 | Quita un libro de la posicion | class LibroController extends Controller
public function destroy(Libro $libro)
{
$libro->status=0;
$libro->save();
return redirect()->route('libro.index');
} | 0 |
a157f2ac231e8c9eb0d856859ffbd39f | f183f1ee11e9b5745fd4f603f9eec04b | One hot encoding of the network outputs | def onehot(x): return np.array(OneHotEncoder().fit_transform(x.values.reshape(-1,1)).todense()) | 1 |
26ca5c7e33e48176261bd5249b96de07 | a7142a7891af6cf511857fd739f57c91 | get a request from user to share a file with another user. | let that = this,
reader,
fileToSend,
sendId;
let neighbour = that.neighbourService.getNeighbourBySocketId(socketId);
let fileChannel = neighbour.file_channel;
sendId = that.getRandomString();
fileToSend = {
file: file,
state: "ask"
};
fileChannel[sendId] = fileT... | 1 |
fdae354884398d8176995fb82e6f7aed | d6c08e8b7f7ca50794667eb78f699575 | 返回“可选包”列表 (以前的“标准扩展”)
已声明在与这个类装入器相关的库中可用, 加上实现相同类的任何父类装入器 | @aBaseArg(name = "package", pos = 1, type = aOpt.class, def = "*package*")
public tSYMBOL UNUSE_PACKAGE(@aArg(name = "packages") tLIST packages
); | 0 |
85bab5498e5d2d9b10b2ef6b5f6fe2e7 | ec3ef7b43c0e64cf34bac169d98a4ef0 | Performs POIs conflation by identifying the duplicates among a group of POIs. | pontos.forEach(function(ponto, index){
for (i=index+1; i < pontos.length; i++){
if ((ponto.origem.id == pontos[i].origem.id) || (ponto.origem.norte == pontos[i].origem.norte && ponto.origem.este == pontos[i].origem.este)){
ponto.origem.duplicate = true;
pontos[i].origem.duplicate = true;
}
}
});
} | 1 |
874dd5da9c9905634e421d4cfbf5fdf9 | 3b35ce6c7248936bcecdbb0ba4492038 | 收到流中所有数据时调用 | public class NettyServerHandler extends ChannelInboundHandlerAdapter
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
ctx.flush();
System.out.println("feedback");
} | 0 |
05a17c88d8417b00ab8e1c6822a5bd04 | 7bd1ddb89ac35616d5de3f60b0b4cad0 | Loads test events for the program (if any) | class TestReadEvents:
def test_load_events(self):
command = "{}".format(self.fits_fileA)
hen.read_events.main(command.split())
ev = hen.io.load_events(self.ev_fileA)
assert hasattr(ev, "header")
assert hasattr(ev, "gti")
main_readfile([self.ev_fileA]) | 1 |
1480109b2022beed4a09d219ba039b4c | 35cb7491784ecadba66f3f672a13808b | Начать перетаскивать мышью можно:
1) задания уже назначенные на процессоры из области расписания
2) свободные задания из первой колонки области матрицы ресурсов | {
if (mode != Mode.Connect)
{
Unsellect();
AllChildrenIsSelectable = true;
workArea.MouseLeftButtonDown -= Canvas_Arrow_MouseLeftButtonDown;
workArea.MouseLeftButtonDown += Canvas_Connect_MouseLeftButtonDown;
... | 0 |
35977653ad5f4ce12041ab04ee1868b3 | 22c215954fbb3b80441f5dadc66b9e06 | Register built-in effects | {
effects.resize((size_t)EffectType::_Length);
for (auto e : Enum_EffectType::GetMap())
{
effects[(size_t)e.first] = CreateDefault(e.first);
}
} | 1 |
60d7bb19486c0be7a91dec0c2b4b1aec | 3a12c274319014cc5c3ce6a5c2ccd032 | ERROR: type should be string, got "https://codility.com/demo/results/trainingBPDPM9-XQG\nTask score: 100%" | def solution(A):
return sum(range(len(A) + 2)) - sum(A) | 1 |
e905145e07813c1ea3e285d7274cb67b | b25f9840730a22f152999dd79022abec | @brief Block used to add image processing support to fragment shader. | super().__init__(name, **kwargs)
self._fragmentShader = '''
in vec2 fragTexCoord;
uniform sampler2D inputTexture;
layout (location = 0) out vec4 FragColor;
void main() {
vec2 texFlip = vec2(0.5 - fragTexCoord.x, fragTexCoord.y);
if (fragTexCoord.x >= 0.5) {
texFlip.x = 0.5 + 0.5 - (frag... | 1 |
acfa0a08698e5ad6553983656e878d9c | 47c8738f3e16b64b3b4c044daa9501ca | Convert the parsed index information into options to the Generators index method. | public class IndexSettings implements ToJsonp
public void toJsonp(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
toJsonpInternal(generator, mapper);
generator.writeEnd();
} | 0 |
38d49390b214f5293235d95c6fdb4d63 | 303f45207c3f57881ef9c2a0f1abe654 | Performs a reduce scatter operation. | inp: Tensor, group: Optional[Group] = WORLD, device: Optional[str] = ""
) -> Tensor:
mode = CollectiveComm.Mode.SCATTER
return collective_comm(inp, mode, group, device) | 0 |
7ce4905cff478b2db3d4c78ba7b34dd8 | 8615b2e16dbe469301d2901df75b87ec | Returns a list of the variables directly owned by this element | abstract class Erfurt_Sparql_Query2_ContainerHelper extends Erfurt_Sparql_Query2_ElementHelper
public function getVars() {
$ret = array();
foreach($this->elements as $element){
if($element instanceof Erfurt_Sparql_Query2_Var){
$ret[] = $element;
} else if ($elemen... | 1 |
c9ddd6fc4704486eee8fd4e1d509c854 | 5259b0f65274a1d50a8ecf11e67f8ce7 | 批量建立试卷与问题的联系 | sql = """select id, nquestion from yy_test where user_id =%s and object_id=%s """ % (
user_id, task_id)
test = db.tbkt_yingyu.fetchone_dict(sql)
if test:
return test
sql = """select id,text from yy_task_detail where task_id = %s and content_type=10 AND text like '%%%s%%'""" % \
... | 1 |
0173d9dd89cee758017f2fd92f99b133 | aaf7f946796e3f0e25b5eb1fc1a93083 | !
@brief - Configures the pinouts of SPI1 interface | {
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hspi->Instance==SPI1)
{
__HAL_RCC_SPI1_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.S... | 1 |
fa34f2e4f97aeafd655908ac31d4bd95 | 3cd8e8a2b812a8a564b0b002d93f69dd | Decorator to check whether user can unpublish a given
collection. | handler: Callable[..., _GenericHandlerFunctionReturnType]
) -> Callable[..., _GenericHandlerFunctionReturnType]:
@functools.wraps(handler)
def test_can_unpublish_collection(
self: _SelfBaseHandlerType, collection_id: str, **kwargs: Any
) -> _GenericHandlerFunctionReturnType:
collection_r... | 1 |
caa2c0e82f1ab54a6bf9697fb25f4fb1 | d8562f8eef76fce21089caa7b5b27f29 | Get the currently selected biome | String getCurrentBiome(); | 1 |
dc9b61abbd4100588b16b4fe250b5f93 | 862c669e10917d6e6286b6266939b501 | Check for feasibility and initialize the dictionary. | class base(object):
def initialize_search(cls):
unix.cd(cls.path)
if cls.iter == 1:
s_new = loadtxt('s_new')
f_new = loadtxt('f_new')
else:
s_old = loadtxt('s_old')
s_new = loadtxt('s_new')
f_old = loadtxt('f_old')
f_new = l... | 0 |
fff8a4bd75b68f30a6e06b2f322c766d | 2c95e26273b0cd1eea26f470354f2c28 | this method reads out the games with details from the gameday data | page = requests.get(url)
soup = BeautifulSoup(page.content, "html.parser")
game_days = soup.find_all('div', attrs={'class': "eventGroup class-mlb-baseball show-rotation"})
total_lines = []
for game_day in game_days:
game_date = get_game_date(game_day)
if game_date:
games ... | 1 |
b8215e7053047b27ba273fd129dd7ed7 | 7e931e63525ec2e89eaee20a5728f979 | Запуск лифта. | namespace VipaksTestTask.Services
public class AirportEngine : IDisposable
public void Start()
{
_schedule = TryGetShedule();
_schedule.Validate();
_schedule.Flights = _schedule.Flights.OrderBy(x => x.Time).ToList();
_timeManager.Start();
} | 0 |
db5ce77641da5c1982abbde8f438a951 | 3bc3dc6054b98664ab6763f4fb88177b | Move to previous example | function like() {
endExample(true);
if (my_current_example > 1) {
sendExample('Like');
}
} | 0 |
b7573ad7321acb7ff2b85bb909eb2908 | 69617a16cddb030468637136ae34be60 | 获得填充的矩形框 | class Form
private function getRect() {
$input = '<b>请输入 | 矩形 | 的宽度和高度: </b><p>';
$input .= '宽度: <input type="text" name="width" value="'.$_POST['width'].'"><br>';
$input .= '高度: <input type="text" name="height" value="'.$_POST['height'].'"><br>';
return $input;
} | 0 |
afacc611ef5e27f08b0ae9b1bab3f3bf | 0b555f8bec85303e203a68afde643a66 | ********************************** // INTERSECT HEAD // ****************************************// | function Video_CreateHeaderVideo(mydivsi){
var sampledatasection = document.getElementsByClassName('sampledatasectionVO')[0];
var myh1 = CheckifVoidandAssign_Gen("h1", 0, mydivsi);
var myh2 = CheckifVoidandAssign_Gen("h2", 0, mydivsi);
var myp = CheckifVoidandAssign_P_Gen(mydivsi);
var myifram... | 0 |
2847f31ec051a07d422cc73fade5cb6c | 21a4a4fa887fbd50f4bdd803f34048a4 | Returns an array of items which positively fuzzy matched against a given query. | namespace Y_
public partial class AutoCompleteFilters
public Y_.Array phraseMatchCase(object query, Y_.Array results){return null;} | 0 |
9123433ca0d79f92d2b086a9bc2e5459 | b85f8d8ff62042d40048d665f19f2cae | 得到是否为夜间模式的item,设置此item的title | public class AppraiseActivity extends BaseActivity{
@Override
protected void initData() {
if (SharePreferenceUtil.getNightMode(this)){
mToolbar.setBackgroundColor(Color.parseColor("#534f4f"));
}
getDataFromBmob();
} | 0 |
c0bd9198d09923fcba42da5b2c4d62e2 | c76e44e4b69b054930f1565e1923417f | Remove wireless settings from search in demo mode | function remove_demo()
{
if (class_exists('ReduxFrameworkPlugin')) {
remove_filter('plugin_row_meta', array(ReduxFrameworkPlugin::get_instance(), 'plugin_meta_demo_mode_link'), null, 2);
}
remove_action('admin_notices', array(ReduxFram... | 0 |
0f64af4e60d7e46c99666e14ab760010 | f325ffd5b26c367f900ec6ac0be6cb82 | Checks that integer is greater than or equal to zero | function isIntGtZero(num) {
return num > 0;
} | 0 |
c1ab5232a2ef40df1be13c0f8143877d | f58b48a8756b7d7c1faed8e57da0dbbb | 微博稿件显示微博正文,普通稿件显示稿件标题 | $contentStr = "";
switch ($postObj->Event) {
case "subscribe" :
$sql = "select * from wypublic_tuisong where top_status=1 and use_status =1";
$res = yii::app ()->db->createCommand ( $sql )->queryRow ();
if ($res ['type'] == 0) {
$content = str_replace ( "<br />", "\n", $res ['content'] );
$... | 0 |
8f43a366947bad371ce8e394d6d9ec22 | e87f7af77f0eaf840aefcff1f3b855c2 | unicornHatHDの画面更新関数 | temperature_range = (0, 40)
pressure_range = (950, 1050)
humidity_range = (0, 100)
temperature = scale(clamp(recv[0], *temperature_range), *temperature_range)
pressure = scale(clamp(recv[1], *pressure_range), *pressure_range)
humidity = scale(clamp(recv[2], *humidity_range), *humidity_range)
... | 1 |
e641bee740e0ed36f791e9bd21c2acfa | ec60bc55ff1b99cc9e28cf6f6c1ec9c4 | Prints the entire Queue fom front to rear | void Queue::printQueue() const
{
if (isEmpty())
{
cout << "Queue is empty" << endl;
return;
}
node *curr = rear;
cout << "REAR | ";
while(curr)
{
cout << curr->data << " | ";
curr = curr->next;
}
cout << " FRONT" << endl;
} | 0 |
0fa4780474a4d08ecccca7ed61169669 | a2f1b02db58f35ebfbb1b7153f6cb78d | Generation of JSON to render Properties.
current request
current response | protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
throws ServletException, IOException {
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
String[] selectors = request.getRequestPathInfo().getSelectors();
... | 1 |
0d3b4f30173f38818d923b30e9e0f431 | d2fb11d92c4e8c514b4d8b6fc7181867 | When a player lets go of W stop feeding | public class PlayerController : MonoBehaviour
public bool OnWHeld()
{
if (grounded)
{
rb2d.velocity = new Vector2(rb2d.velocity.x, jumpPower + baseSpeed.y);
}
else
{
if (hasDistanceJoint2D(grappleShooter))
{
grapple.distanc... | 0 |
e906db96801b3a7e025196efafb1053f | 8fdf3dfba586d716fc0cae633a5adefe | Set the value of a thread attribute. | {
struct pthread_attr *attr = (struct pthread_attr *)_attr;
int priority = schedparam->sched_priority;
if ((attr == NULL) || (attr->initialized == 0U) ||
(is_posix_prio_valid(priority, attr->schedpolicy) == false)) {
return EINVAL;
}
attr->priority = priority;
return 0;
} | 1 |
1fe39941ae19cd7feb0eb3cfdd7e4579 | e2e9004bbc7f125b30499aa5adb99761 | get the boundaries for acceptance of measurements - [-3sigma, 3sigma]
with
regards to the mean | bottom = mean - sd*treshold
top = mean + sd*treshold
return(bottom, top) | 1 |
a1437c2bfd70d8a5586a95e9fd46d495 | ccc4c603360dac15851fd6b8b4cddd84 | backticks | backtick <- function(code) {
paste0("<code>`", code, "`</code>")
} | 1 |
d908e15ebc1ed213ac328fd755725a69 | 70953bcc0093ef681bf86657e027176e | 根据登录账号查询学生的借书情况 | @Select("select * from book_borrowing where username=#{username}")
List<BookBorrowing> selectBookByUsername(String username); | 1 |
5b574c0542c1b691a120aea6aea3b4c7 | 8e311224b1f9aa3926e32d6884f99001 | Allocate memory and release wait task,
as long as there are enough free memory. | static inline void dsma_trigger_task
(
dsm_augment_pool_data_type *aug_data
)
{
if(DSM_LIKELY((dsm_get_external_memory_usage() < dsma_ext_memory_upper_limit)
&& (!dsma_ext_memory_check_lower_limit) && (!aug_data->dsm_task_alloc)))
{
atomic_set(&aug_data->reuse_trigger_cnt,1);
dsma_alloc_dynamic_reuse... | 1 |
8024a3d74e9f498b309cd46358a955f0 | 41e9474a6f3b953418fd01ca2b3c2367 | We demonstrate using the full viewport area or the work area (without menu-bars, task-bars etc.)
Based on your use case you may want one or the other. | return when {
!isVisual -> {
Screen.getPrimary().bounds.width.toInt() to Screen.getPrimary().bounds.height.toInt()
}
else -> {
Screen.getPrimary().visualBounds.width.toInt() to Screen.getPrimary().visualBounds.height.toInt()
}
... | 1 |
2db459f3ab8f521419eb4a41e974da38 | 55fc602d75fd4702e0f7bc9f33ce5590 | Método que permite obtener la distancia total obtenido por equipo. | Double min = Double.MAX_VALUE;
Double max = Double.MIN_VALUE;
Double diff;
for (bfsBarrendero b : this.barrenderos) {
min = Math.min(min, b.distanciaTotal);
max = Math.max(max, b.distanciaTotal);
}
diff = max - min;
return diff;
} | 0 |
d77270ecf145585cc8998af98411c080 | 1c47762b9ea481a0ec3c6befce1627ed | 设置标题颜色
<p> | public Builder setTitleColor(int titleColor) {
this.mTitleColor = titleColor;
return this;
} | 1 |
f699869ab3b846c05c18d5c6e7bfc9c0 | 7588a4ff1a40bc13a568293ec454fd2a | スキルの名前でスキルを返す関数 | public class TMBattle
private Skill getSkillIntoChara(CharaStatus status, int skillNo) {
return status.skillList.get(skillNo);
} | 0 |
77a05345c72d77584eb2b4ae2427bc7a | 11369cc6df6f221490d5200ccc96b0b9 | Executa o algortimo de menor tempo de movimento para
o elevador levar ao destino todos os passageiros, e mostra
como resposta a estado final dos andares do edifício. | {
Dictionary<int, int> trajeto = new Dictionary<int, int>();
int iCidadeDestino = IndiceDe(cidadeDestino);
double[] distancias = new double[numVerts];
for (int i=0; i< numVerts; i++)
{
distancias[i] = double.MaxValue;
... | 0 |
ae6a8528a1fcac4833457874a32555f3 | f8a61959b1cb5635171575ccc37762d4 | @brief Function for deleting RECORDS request. | static void delete_records_request_execute(ble_os_t * p_os, ble_racp_value_t * p_racp_request)
{
ret_code_t err_code;
uint8_t resp_code_value;
uint16_t total_records;
uint16_t num_records;
total_records = ble_os_db_num_records_get();
num_records = 0;
if (p_racp_request->operator == RACP_OP... | 1 |
c242b52eda2573384e2a273a1cecdfda | 2e2c267b6df73e73b33bd8b42071a72c | Runs when the BuzzardMoveEvent fires. It updates the position
of the Control to that of the model. | {
ControlModelView notifiableModelView = this.InfoControl.DataContext as ControlModelView;
if ( notifiableModelView != null )
{
ICommand angleChangeCommand = notifiableModelView.AngleChangeCommand;
if ( angleChangeCommand.CanExecute( null ) )
... | 0 |
855f3c1fb442c527c706435360434eb4 | 4972b0af7ffaf7e304b5ffb20d9335c6 | Restores the read position previously saved with <see>Push</see>. | namespace CsQuery.Utility.StringScanner.Implementation
public class StringScanner: IStringScanner
protected void RestorePos()
{
if (cached)
{
Pos = cachedPos;
Match= cachedMatch;
cached = false;
}
} | 1 |
0a5cba1c7562eb3254ceb607fa7b52ec | b047e976c5021e3de5b27854314456fb | We only display date and title in the model | class Booking(models.Model):
def __str__(self):
return self.title | 0 |
7f3c779b242b42fec63eac7e840974fd | 3e90e01cc21b0a958c2b7efe72f574d1 | Retrieve L3 Cache Allocation | const char *getL2CacheAss(unsigned u)
{
switch (u)
{
case 0: return "off ";
case 1: return "direct";
case 2: return "2 way ";
case 3: return "res3 ";
case 4: return "4 way ";
case 5: return "res5 ";
case 6: return "8 way ";
case 7: retu... | 0 |
d54ba117da082760552ee42a16789010 | f206412a4a40eded2a64987be49e6e60 | 字符串转字节数组,使用utf-8编码 | final class CommonUtil
public static function str2ByteArray($str) {
$bytes = array();
if (!is_string($str) || empty($str)) {
return $bytes;
}
$len = strlen($str);
for ($i = 0; $i < $len; $i++) {
$ascii = ord($str{$i});
if ($ascii >= 128) {
$ascii -= 256;
}
$bytes[] = $ascii;
} | 0 |
763b9c970ae5f67374750ac8f5c960a1 | 62696baff6fb3df31d1c3948d8e2ad19 | Will make sure to take servers offline from load balancer before executing
operations on it. This requires load balancer configuration in your env.json config. | void syncLoadBalancer() throws ApplicationException, Exception; | 0 |
1927b539960d7e0c30200ba60146c7b1 | 2040a8981f75ee0ad9d3f0fa57fd3448 | Convert true anomaly to eccentric anomaly | if e>=1:
print 'EccenToTrueAnomaly does not support parabolic or hyperbolic orbits!'
f = -999
else:
sinf = np.sin(E)*np.sqrt(1 - e**2)/(1 - e * np.cos(E));
cosf = (np.cos(E) - e)/(1 - e * np.cos(E));
f = np.arctan2(sinf, cosf);
return f | 0 |
066be3208bdf1b5a80f7fa25a029dd81 | ea5dd20c173845ddc1a735553c74b03b | How many testcases which are 'ok' are there? | retval = 0
for result in self._testcase_results:
if result.success:
retval += 1
return retval | 1 |
b3cc469f339ba0d36e5c6bfb0fbd40ca | 2ec3eae5ab9c6b0b0e74553aeb86ce2c | Tests that listeners receive the right events | namespace logview4net.test
[TestFixture]
public class MultipleListenersTest
[Test]
public void ListenTest()
{
_session.Start();
_listenerBaseA.AddEvent("a_1");
_listenerBaseA.AddEvent("b_1");
_listenerBaseA.AddEvent("a_2");
_listenerBaseA.AddEvent("b_2");
Assert.AreEqual(4, _viewer.ReceivedData... | 1 |
ea3698f0ef416b3132b9626b549886d6 | e50df5b0e281c5372755b06621786335 | Installs a package on a remote server. | if not Port._updated:
self.call(['selfupdate'],
capture_output=False, retry_with_sudo=True)
Port._updated = True
self.call(['install', package],
capture_output=False, retry_with_sudo=True) | 1 |
0be97b95fdc2d13484d9c9bd10247b37 | fa2977998ee11055cec1f433bc825ed3 | Sets the number of questions to the user's input | public void setNumQuestions(int numQuestions); | 1 |
5176729e3e04e3f670d0bd00acd0a378 | 053e72bc6a5c22ca3453c5b63f29ab0d | Gets the access levels a person has from all permissions | $objRoleBasedAccess = DB::table('user_role')
->leftJoin('scope_role', 'scope_role.role_id', '=', 'user_role.role_id')
->select('scope_role.data_type_user_level_id', 'scope_role.data_row_user_level_id')
->where('user_role.user_id', $this->intUserId)
... | 1 |
ddd4de3c1372f4779c663cc4eb5944e4 | 42f4a5ea87286638c227d73defd9b05c | According to atomic_base.h: __cmpexch_failure_order | TEST_FUNCTION(interlocked_compare_exchange_128_calls_InterlockedCompareExchange128_false_case)
{
volatile int64_t* destination;
InterlockedExchangePointer((PVOID volatile*)&destination, malloc(2 * sizeof(int64_t)));
int64_t* comperand_result = malloc(2 * sizeof(int64_t));
ASSERT_IS_NOT_NULL(comperand_re... | 0 |
760bcdc71f8ecaa536bbec9e7bc84c1c | ac3902ced402dca2709b90342e36ab95 | Override metode som avslutter programmet når du trekker "x"'en | namespace TransportGUI
public partial class Abfahrtstafel : Form
private void Abfahrtstafel_FormClosing(object sender, FormClosingEventArgs e)
{
Application.Exit();
} | 1 |
e91c7577fb1501ffca80ed2c2fb51723 | a89155b431f088701ee12f8864eff3f7 | Sets the closeDate attribute of the DocumentStore object | class TDProject_Project_Block_Project_View
extends TDProject_Project_Block_Abstract_Project
public function setClosingDate($closingDate)
{
$this->_closingDate = new TechDivision_Lang_String($closingDate);
} | 0 |
c9a5f86f1ab71303b553c620c882f494 | c3207a1a2f2c0856895ae9fc3b09beff | Creates a <see cref="TableDeleteStatement"/>. This method is intended to delete rows from a
table. | namespace FluentMigrator
string Generate(DeleteTableExpression expression); | 0 |
bee4f80cdc6f259cb4140373140442f7 | c3831828a672f98bb38191d6677c2f91 | maps specified UniFileType to particular standard Spectrum FileType | if (fileType == "html" || fileType == "plain" || fileType == "css") {
return 1;
} else if (fileType == "png" || fileType == "jpeg" || fileType == "jpg" ||
fileType == "gif") {
return 2;
} else if (fileType == "js") {
return 3;
} else... | 1 |
c660e3193adcc9593b47ec168dec9d4e | caf0f5d56725a06a0011d57ec98311af | Collect bug report on failure | if rep.longrepr not in self._failed_collection_errors:
self._failed_collection_errors[rep.longrepr] = True
self.config.hook.pytest_collectreport(report=rep)
self._handlefailures(rep) | 1 |
c6f67df9f350edb6b62801167c2d6dc3 | e69152211ea7dbfedc545fd99b1268d4 | 设置角色各部分位置和大小 | for i = 1, 3 do
local ph = self.ph_list["ph_role_display"]
self.role_list[i] = RoleDisplay.New(self.node_t_list["layout_display_role_" .. i].node, 1, false, false, true, true)
self.role_list[i]:SetPosition(ph.x, ph.y)
end
end | 1 |
e931f77ec5482d90d86e4ce62fb7f223 | 9c46584f3c607b579de6621fd647f0b7 | 删除镜像不可变规则 | namespace TencentCloud.Tcr.V20190924
public class TcrClient : AbstractClient{
public DeleteImageLifecycleGlobalPersonalResponse DeleteImageLifecycleGlobalPersonalSync(DeleteImageLifecycleGlobalPersonalRequest req)
{
JsonResponseModel<DeleteImageLifecycleGlobalPersonalResponse> rsp = null;
... | 1 |
9f55feba4ecfa5a8230fbd42d2c0206d | 56f484fe95ee342943655e56a572b1c8 | 每年1月1号1点30执行,将下载类型限制是每年的用户,下载限制内数量重置为0 | public class ClearUserOnlineJob
public void executeByYear() {
List<BbsUserOnline> onlines = manager.getList();
for (BbsUserOnline online : onlines) {
online.setOnlineYear(0d);
manager.update(online);
}
log.info("clear userOnline by year BbsUserOnline success!");
} | 0 |
4f0a2fe8b2104bed8536b8a17f6ce575 | e64109041353c4d88aed8d61c87df85e | maps over the keyboard displaying every single character as a button | let buttonsHTML = 'abcdefghijklmnopqrstuvwxyz'.split('').map(letter =>
`
<button
class="btn btn-lg btn-light m-2"
id='` + letter + `'
onClick="handleGuess('` + letter + `')"
>
` + letter + `
</button>
`).join('');
document.getElementById('keyboard').innerHTM... | 1 |
c6d6f12266def2885ae8df83bd92a0e3 | 6c5d6b9f13f6d70da818b24ff9f058c1 | 链队列取队头结点值,输入链队列起始地址,要接收值的指针,输出成功或失败标志 | int GetHead(LinkQueue Q, QElemType *e)
{
QNode *p;
if(Q.front == Q.rear)
return ERROR;
p = Q.front->next;
strcpy(e,p->data);
return OK;
} | 1 |
2a7ba81197cead03ee33f6cde5b6816c | a3339cd9eea6e13c4e3b72084db8eaf3 | Retrieves the value of one of the constants from the current fundamental catalogue (FK) model. | public Constant getConstant(String k); | 1 |
610b3ba3b2204087932b9c2d460ff8af | d55da18cec9f3d281a15a447c1eafd48 | Sets the "domainname" element | {
const char* name;
if (!PyArg_ParseTuple(args, "s", &name))
{
return NULL;
}
int result = setdomainname(name, strlen(name));
return Py_BuildValue("i", result);
} | 1 |
129b7cf46e5f468516b7939979048e69 | f7b2a53435cc0ea014ec3a83ff856e5c | 除去超管 | class table_task_organization_user extends dzz_table
public function remove_uid_by_orgid($orgid,$uid){
$data=DB::fetch_first("select * from %t where orgid=%d and uid=%d",array($this->_table,$orgid,$uid));
if($data['perm']>2 && DB::result_first("select COUNT(*) from %t where orgid=%d and perm>2",array($this->_table,... | 0 |
7d1a14c02d335dca3a9cd728d9f7b220 | 6ae3e24a290bcd2e0b81fbf79af2f866 | Test sorted union error handling where middle table is not sorted (Negative test) | data = [31, 12, 15, 99, 3, 102]
order = "abc"
response = requests.post("{}/sorting".format(BASE_URL), json={"data": data, "order": order})
self.assertEqual(response.status_code, 400) | 0 |
fe05eb6d697ce79f438e3e151d2074d5 | 12e30ec433d818df631cc4b488fc96dc | Function to validate each field. Takes the field and messageDiv.
It highlights the field if it has an error. | var msgElemObj = jQuery('#' + msgElem)[0];
var msgElem2Obj = jQuery('#' + msgElem2)[0];
var elemVal = jQuery('#' + elem).val();
var elem2Val = jQuery('#' + elem2).val();
var name = msgElem2.replace('_status', '');
if (!required && elemVal.length==0 && elem2Val.length==0) {
msgElemObj.inn... | 1 |
109331f374e5dcedadb191225d78d668 | b751103afc4f4df460d4ab5f52be6632 | 스로틀을 당기고 있는지 여부를 체크하는 함수 | public class RPPlayerPunch : MonoBehaviour
private bool IsPunching()
{
return timerPunching.IsRunning();
} | 0 |
2bac2a38ab8002a3a0e5f97667143b89 | 5d2080b8da57d4327e39613e71f13f7c | Test the SupplierPartDelete view | class SupplierPartViewTests(CompanyViewTestBase):
def test_supplier_part_delete(self):
url = reverse('supplier-part-delete')
response = self.client.get(url, {'part': '1'}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
self.assertEqual(response.status_code, 200)
response = self.client.get(url +... | 1 |
90cfddf852fff36f1a9f45677d72609c | 8bf76df8a7fb46aedcb1c77201c2b4bb | Reset metric states at the begin of each pass/user specified batch. | class MinitaurAverageMaxSpeedMetric(py_metrics.StreamingMetric):
def _reset(self, batch_size):
self._np_state.speed = np.zeros(shape=(batch_size,), dtype=float) | 1 |
38efa9b415e19ae3176dc6fd70396164 | e34c03ccb3baebcc7a937d2c8cf067dd | Get the original string Id for the given signed integer Id. | {
$stringBuffer = "";
if (is_string($objectSid) && !empty($objectSid)) {
$position = 0;
$reversedString = strrev($objectSid);
for ($i = 0; $i < strlen($reversedString); $i++) {
if ($reversedString[$i] === "-") {
$position = $i +... | 0 |
ebea52649212a6d48c014ca304201869 | df168291e810a7075bef138fee70049f | 取得したOAuthIDとOAuthアカウントをDBと照合するメソッド | $link = DbConnect::getInstance();
$error = '';
$command="SET NAMES 'utf8'";
$stmt=mysqli_prepare($link, $command);
mysqli_stmt_execute($stmt);
$command = "SELECT oauth_token, oauth_token_secret, user_id, screen_name
FROM tw_token
WHERE user_id_hash=?... | 1 |
b92d0c2896a24ec0a9e7d1cc91461ad8 | dce1d7ebadc9d1e43c996a037ffa6841 | toggle time display and/or time tracking mode | {
if(!m_binaryMode)
{
displayHours();
displayMinutes();
for(int i = 0 ; i < 60 ; i++)
{
if(i <= 15)
m_disp->setLed(i, 0, (boolean) i <= m_secs);
else if(i <= 30)
m_disp->setLed(15, i - 15, (boolean) i <= m_secs);
else if(i <= 45)
m_disp->setLed(45 - i, 1... | 0 |
c1a58e0f77e394919d1c4f1493771ec1 | 06152287aa3ad5c6a3af25c34796f0ed | Exibe a caixa de curtir uma fan page. | class Sher_App_Action_User extends Sher_App_Action_Authorize implements DoggyX_Action_Initialize
public function fans(){
$page = $this->stash['page'];
$this->set_target_css_state('home');
$this->stash['profile'] = $this->stash['user']['profile'];
$this->stash['pager_url'] = Sher_Core_Helper_Url::user_fans... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.