text stringlengths 27 775k |
|---|
require 'gooddata/cli/cli'
describe GoodData::CLI do
before do
allow(GoodData::Helpers::AuthHelper).to receive(:read_credentials) { credentials }
end
context 'when verify_ssl is not specified' do
let(:credentials) { { username: 'john', password: 'secret' } }
it 'sets verify_ssl to true' do
ex... |
package psug201607.annexe.liste_monoid_non_iso
import org.scalatest.FunSuite
import org.scalacheck.{Prop, Test}
import org.scalacheck.Shapeless._
import org.scalacheck.Prop._
class ListeMonoidNonIso extends FunSuite with org.typelevel.discipline.scalatest.Discipline {
val lconcat = new ListeOptConcat[Int]
val la... |
#!/bin/bash
echo "cleaning cache..."
rm -rf ../tmp/[!sess_]*
|
# coding: utf-8
from bertsota.common.utils import init_logger
from bertsota.parser.dep_parser import SDPParser
if __name__ == '__main__':
save_dir = 'data/model/psd'
parser = SDPParser()
parser.train(train_file='data/semeval15/en.psd.train.conllu',
dev_file='data/semeval15/en.psd.dev.conll... |
-module(rebar_cargo_path_resource).
-export([init/2,
lock/2,
download/4,
needs_update/2,
make_vsn/2]).
-include_lib("kernel/include/file.hrl").
-include("rebar3_cargo.hrl").
init(Type, _State) ->
Resource = rebar_resource_v2:new(Type, ?MODULE, #{}),
{ok, Resource}.
lock(App... |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Equipmentorder;
use DB;
use Carbon\Carbon;
use Illuminate\Support\Facades\Input;
use Auth;
use App\Sale;
use App\Report;
class farmorderController extends Controller
{
public function index($id){
echo "Succeed";
}
... |
# create a simple range method
def range(min, max)
arr = []
i = min
while min <= max
arr << min
min += 1
end
arr
end
print range(2, 7) # => [2, 3, 4, 5, 6, 7]
puts
print range(13, 20) # => [13, 14, 15, 16, 17, 18, 19, 20]
|
package flow
import (
"strconv"
"time"
"github.com/hortonworks/cb-cli/dataplane/oauth"
flow_logs "github.com/hortonworks/cb-cli/dataplane/api/client/flow"
"github.com/hortonworks/cb-cli/dataplane/api/model"
fl "github.com/hortonworks/cb-cli/dataplane/flags"
"github.com/hortonworks/dp-cli-common/utils"
log "g... |
(require '[reagent.core :as r]
'[reagent.dom :as rdom])
(defn make-cm
[value id]
(js/CodeMirror
(.getElementById js/document id)
{:value value
:lineNumbers true
:tabSize 2
:matchBrackets true
:mode "clojure"
:theme "nord"
:width "500px"
#_#_:on-change #(reset! value (-> %... |
// Licensed under the MIT License. See LICENSE in the git repository root for license information.
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Ecwid.Models
{
/// <summary>
/// Limit for catalog element coupon.
/// </summary>
public class DiscountCouponCatalogLimit
{
... |
window.onload = function(){
// Load the data from the Medium RSS feed
// Uses the Google Apps Script to avoid cross site origin requests
$.ajax({
url: "https://script.google.com/macros/s/AKfycbwafKoSHjdBxd9sDBB-ohKjaDsOlaeXkRD4BMLPG28ZNgK7wFw/exec",
type : "GET",
success : function (... |
import os
import datetime
from flask import render_template, request, flash, redirect, url_for, jsonify
from flask_login import login_user, logout_user, login_required, current_user
from flask_mail import Message
from werkzeug.datastructures import CombinedMultiDict
from werkzeug.utils import secure_filename
from bcryp... |
/*
* @CopyRight:
* FISCO-BCOS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FISCO-BCOS is distributed in the hope that it ... |
package tenis
import "errors"
type Match struct {
gameScores []int
setScores []int
advantage int
}
type Score struct {
set []int
game []string
}
func newMatch() Match {
return Match{gameScores: make([]int, 2), setScores: make([]int, 2), advantage: -1}
}
func (m *Match) Point(player int) error {
playerInd... |
/*
* Copyright © 2014-2017 Cask Data, Inc.
*
* 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 agr... |
import styled from 'styled-components';
const Input = styled.input`
height: 2em;
padding: 0 1em;
width: 100%;
border: 1px solid ${({ borderColor }) => borderColor || 'black'};
${({ disabled }) => disabled && 'color: gray'};
`;
export default Input;
|
<?php
namespace Dugajean\Repositories\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Composer;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Dugajean\Repositories\Console\Commands\Creators\BaseCreator;
use Dugajean\Repositories\Consol... |
extern crate chacha20poly1305;
extern crate sodiumoxide;
#[cfg(feature = "resolve")]
pub use ddoresolver_rs::*;
use didcomm_rs::{
crypto::{SignatureAlgorithm, Signer},
Error,
Message,
};
use k256::elliptic_curve::rand_core::OsRng;
use serde_json::Value;
#[test]
fn can_create_flattened_jws_json() -> Result... |
---
description: Specifies the maximum number of dynamic audio objects that can be rendered by the audio endpoint simulataneously.
ms.assetid: 6B6D73C1-C2E6-4C23-BBAD-7B51E8441C71
title: MF_MT_SPATIAL_AUDIO_MAX_DYNAMIC_OBJECTS attribute (Mfapi.h)
ms.topic: reference
ms.date: 05/31/2018
---
# MF\_MT\_SPATIAL\_AUDIO\_MA... |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
#import "MWPhoto.h"
@class NSString, NSURL, UIImage;
@interface MWPhoto : NSObject <MWPhoto>
{
_Bool _loadingInProgress;
id <SDWebImageOperation> _we... |
package Kotlin.strategyPattern
import Kotlin.strategyPattern.DispatchStrategies.EmailStrategy
import Kotlin.strategyPattern.DispatchStrategies.PrivateMessageStrategy
import Kotlin.strategyPattern.DispatchStrategies.SMSStrategy
import java.util.*
fun main(args : Array<String>) {
//Create Users
var me: UserDet... |
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart';
import '../tools/test_utils.dart';
void main() {
group('订单部分:', () {
FlutterDriver driver;
setUpAll(() async {
driver = await FlutterDriver.connect();
await driver.waitUntilFirstFrameRasterized();
});
... |
import 'package:hive/hive.dart';
class AddSongsCount {
void addSong(String playlistName, int len, List images) {
Map playlistDetails =
Hive.box('settings').get('playlistDetails', defaultValue: {});
if (playlistDetails.containsKey(playlistName)) {
playlistDetails[playlistName]['count'] = len;
... |
# frozen_string_literal: true
module Cloudenvoy
# Handle execution of Cloudenvoy subscribers
class SubscriberController < ApplicationController
# Authenticate all requests.
before_action :authenticate!
# Return 401 when API Token is invalid
rescue_from AuthenticationError do
head :unauthoriz... |
package com.bongo;
import javax.swing.*;
import java.awt.*;
import java.util.concurrent.TimeUnit;
class Canvas extends JComponent {
public void paintComponent(Graphics g){
g.clearRect(0, 0, Main.window.getWidth(), Main.window.getHeight());
for(int i=0;i<Main.bongos.length;i++){
Rendere... |
package com.kyawhut.atsycast.tiktok.data.network.response
import androidx.annotation.Keep
import com.google.gson.annotations.SerializedName
/**
* @author kyawhtut
* @date 10/4/21
*/
@Keep
internal data class VideoResponse(
@SerializedName("video_id")
val videoID: String,
@SerializedName("video_descript... |
using AutoFixture.Idioms;
using AutoFixture.NUnit3;
using EMG.Extensions.Logging.Loggly;
using Moq;
using NUnit.Framework;
namespace Tests.Loggly
{
[TestFixture]
public class LogglyLoggerProviderTests
{
[Test, AutoMoqData]
public void Constructor_is_guarded(GuardClauseAssertion assertion)
... |
#include <chess/fen.hpp>
#include <chess/perft.hpp>
#include <chess/position.hpp>
#include <chrono>
#include <iostream>
int main() {
auto pos = chess::Position();
chess::set_fen(pos, "startpos");
std::cout << pos;
std::cout << chess::get_fen(pos) << "\n\n";
for (int i = 1; i <= 6; ++i) {
... |
SET NOCOUNT ON;
SELECT count(*)
FROM v_threatcatalog tc
LEFT JOIN v_threatseverities sev ON tc.severityid = sev.severityid
LEFT JOIN v_threatcategories cat ON tc.categoryid = cat.categoryid;
|
/* Copyright 2019 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* MAX32660 HW Timer module for Chrome EC */
#include "clock.h"
#include "console.h"
#include "common.h"
#include "hooks.h"
#include "hwtimer.h"
#... |
package foundation.icon.iconex.intro.auth;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.appcompat.app.AppCompatActivity;
import foundation.icon.ICONexApp;
... |
# Based on: https://github.com/samvera/hyrax/blob/master/spec/factories/users.rb
FactoryBot.define do
factory :role do
sequence(:name) { |n| "role-#{n}"}
trait :admin do
name { 'admin' }
end
end
end
|
// Copyright 2021 Andy Grove
//
// 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 agreed to in writi... |
using NewsSite.Core.Database.Tables;
using System;
using System.Linq;
namespace NewsSite.Service.MembershipService
{
public interface IMembershipService
{
/// <summary>
/// Kullanıcı bul.
/// </summary>
/// <param name="userName"></param>
/// <param name="password"></pa... |
export {
DEFAULT_FACET,
ES_ALLFIELD,
PERMISSION_ACCESS_SEARCH_VIEW,
ES_IDFIELD,
K_CLS_STORAGE_INDEX_TYPES,
SEARCH_PAGE,
TN_INDEX,
TXS_SEARCH,
XS_P_$AGGREGATION,
XS_P_$FACETS,
XS_P_$INDEX,
XS_P_$MAX_SCORE,
XS_P_$SCORE
} from './lib/Constants';
export { IIndexData } from './lib/events/IIndexDa... |
<#
.NOTES
Created with: Plaster
Created on: 8/13/2017 10:10 AM
Edited on: 8/17/2017
Created by: Mark Kraus
Organization:
Filename: 014-RedditListing.ps1
.DESCRIPTION
RedditListing Class
#>
Class RedditListing : RedditDataObject {
[string]$B... |
# -*- coding: future_fstrings -*-
from sys import version_info
import importlib
PYTHON_VER = (version_info.major, version_info.minor)
if PYTHON_VER == (2, 7):
import pathlib2 as pathlib
else:
import pathlib
import pytest
HERE = pathlib.Path(__file__)
TEST_ROOT = pathlib.Path(HERE.parent).resolve()
PKG_ROOT ... |
# frozen_string_literal: true
require "erb"
class TemplateRenderer
attr_reader :template, :root
def initialize(template, root:)
@template = template
@root = root
end
def render(contents = template)
ERB.new(contents, trim_mode: "<>").result(binding)
end
def code(path)
contents = File.rea... |
/*
* Copyright 2018-2019 Scala Steward contributors
*
* 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 applicab... |
// Browsers that support the __Secure cookie prefix will reject this due to the
// missing Secure attribute.
document.cookie = '__Secure-invalid-without-secure=1';
// All browsers, including those that support the __Secure cookie prefix,
// will accept this since the Secure attribute is present.
document.cookie = '__Se... |
// Copyright 2017-2020 Lei Ni (nilei81@gmail.com) and other contributors.
//
// 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... |
from decimal import Decimal
import pytest # type:ignore[import]
from bo4e.com.preis import Preis, PreisSchema
from bo4e.enum.mengeneinheit import Mengeneinheit
from bo4e.enum.preisstatus import Preisstatus
from bo4e.enum.waehrungseinheit import Waehrungseinheit
example_preis = Preis(wert=Decimal(12.5), einheit=Waeh... |
FactoryBot.define do
factory :registered_organization do
organization { organization }
api_id { '923a4f7b-eade-494a-8ca4-7a685edacfad' }
api_env { 0 }
end
end
|
import { Vue } from 'vue-property-decorator';
import EventDTO from '@/api/dto/EventDTO';
import BaseVue from '@/api/core/BaseVue';
export default class BaseOrderVue extends BaseVue {
protected ERROR_UPDATE_PATH: string = 'data.event.update.errors';
protected event = new EventDTO();
}
|
#!/usr/bin/env perl
use strict;
use warnings;
require Hang::Slack::Bot;
use Data::Printer;
my $client_id = '516481921508-k6kuq5o970cish6daf5b3iutj3htbplh.apps.googleusercontent.com';
my $token = 'xoxb-35491816976-iLjbDXbZrGfQvf8oihXtAQVL';
my $secret_key = 'nX7gYAcPQHvPpjxPLv6B_tzx';
my $refresh_token = '1/-F1jrY0av... |
// Copyright 2010-2013 (c) IeAT, Siemens AG, AVANTSSAR and SPaCIoS consortia.
// 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
//
// Unles... |
var assetService = function($http, $q){
var service = {};
service.getAssetsByCategoryId = function (categoryId) {
var deferred = $q.defer();
$http.get('/api/categories/' + categoryId + '/assets').then(function(response){
deferred.resolve(response.data);
});
return deferred.promise;
}
return service;
... |
# encoding: UTF-8
require 'spec_helper'
describe MovieShowTimes::GenreParser do
context 'when initialized with language that does not have genre names file' do
it "it should return nil" do
@parser = MovieShowTimes::GenreParser.new('ur')
@parser.parse('1گھنٹہ 40م - ہسپانوی').should be_nil
end
... |
DELETE FROM merge WHERE id = 'buffered';
INSERT INTO merge
SELECT
'buffered',
ST_Force_Collection(ST_Buffer(geom, 500))
FROM merge
WHERE id = 'unioned';
|
ALTER TABLE
EPS_PROPOSAL
ADD
(
ANTICIPATED_AWARD_TYPE_CODE NUMBER(3,0)
)
/
ALTER TABLE EPS_PROPOSAL ADD PROPOSALNUMBER_GG VARCHAR2(12)
/
|
#ifndef RESOUCESDOWNLOADER_H
#define RESOUCESDOWNLOADER_H
#include <vector>
#include <list>
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QTimer>
#include <mutex>
#include "Json/Entity.hpp"
class GameItem;
class ResoucesDownloader : public QObject
{
Q_OBJECT
private:
... |
#!/bin/bash
cd ../../cmd/plvp
GOOS=linux GOARCH=386 go build -a -ldflags \
"-X main.versionNo=$1 -X main.pidFile=$2 -X main.lockFile=$3 -X main.configPath=/home/uw_geoloc4/plvp/plvp.config"
|
#!/bin/bash
# Run all the beast Python unit tests.
python -m unittest discover -p \*_test.py
|
package software.rsquared.appprofiler;
import javax.annotation.processing.Filer;
import javax.annotation.processing.Messager;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.util.Elements;
/**
* Created by Rafal on 27.10.2017.
*/
abstract class Generator {
static Filer filer;
st... |
# labwork_4.4
Работа с исключениями в языке Python
|
namespace DDictionary.Domain.Entities
{
//https://www.thoughtco.com/part-of-speech-english-grammar-1691590
public enum PartOfSpeech: byte
{
Unknown,
Noun,
Pronoun,
Verb,
Adjective,
Adverb,
Preposition,
Conjunction, //and, but, or, so, yet, w... |
---
title: Istio 1.0.3
publishdate: 2018-10-30
icon: notes
release: 1.0.3
---
This release addresses some critical issues found by the community when using Istio 1.0.2.
This release note describes what's different between Istio 1.0.2 and Istio 1.0.3.
{{< relnote >}}
|
517,534,3498
539,9,4234
539,11,4234
539,150,4426
562,37413,258
562,116000,308
562,1,28311
562,140199,271
562,1500,451
575,24447,117
575,10000,117
628,103,4620
628,2000,3750
638,42976,144
650,42,4204
650,13,4204
664,1676,97
664,3000,97
681,5002,123
681,10000,165
681,10000,195
475,16805,107
475,66000,107
699,69675,91
711... |
<?
Class Json_request_status_simple {
private static $version = 'v0';
public $global_status;
public $status;
public $code;
public $message;
public function init(bool $global_status, string $state, string $code, string $message = ''){
$this->global_status = $global_status;
$this->status... |
import { fromJS } from 'immutable';
import { ledger, txhistory } from '@emeraldwallet/store';
import { createStore } from './createStore';
import { screen } from './index';
describe('store', () => {
it('should create store with dependecy', () => {
const store = createStore(null);
expect(store).toBeDefined();... |
# ansible-playbook
ansible playbook项目与示例,在每个目录中有单独的说明。
|
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Lime;
namespace Orange.Source.Actions
{
static partial class Actions
{
[Export(nameof(OrangePlugin.MenuItems))]
[ExportMetada... |
class ManageIQ::Providers::InfraManager::MetricsCapture < ManageIQ::Providers::BaseManager::MetricsCapture
def capture_ems_targets(options = {})
Metric::Targets.capture_infra_targets([ems], options)
end
end
|
module AuthModel
def self.included(base)
base.send(:include, InstanceMethods)
base.send(:extend, ClassMethods)
end
module InstanceMethods
def authenticated?(password)
crypted_password == encrypt(password)
end
# before filter
def encrypt_password
return if passwor... |
// Copyright (c) 2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package sessions
import "errors"
var (
// ErrNotFound is returned when an entry is not found in the database.
ErrNotFound = errors.New("session not found")
)
// DB represe... |
# frozen_string_literal: true
# -*- coding: utf-8 -*-
# myanimelist.rb
# Author: Winston Weinert
# ------------------------
# A Cinch plugin that provides MyAnimeList search interaction for yossarian-bot.
# ------------------------
# This code is licensed by Winston Weinert under the MIT License.
# http://ope... |
echo "updating and installing packages"
apt update
apt upgrade -y
sed -n -r "s/^[ \t]*([^ #\t]+)[ \t#]?.*$/\1/p" "$INITDATA/package.list" | xargs -i -r -- sudo apt-get install -y {}
|
//---------------------------------------------------------------------
// NOC.main.ref.stencil.LookupField
//---------------------------------------------------------------------
// Copyright (C) 2007-2013 The NOC Project
// See LICENSE for details
//--------------------------------------------------------------------... |
<?php
namespace App\Models\Dingtalk;
use App\Models\Traits\ListScopes;
use Illuminate\Database\Eloquent\Model;
class Message extends Model
{
use ListScopes;
protected $table = 'dingtalk_messages';
protected $fillable = [
'client_id',
'agent_id',
'create_staff',
'create_re... |
---
layout: design
title: WIP list of case studies and design writing
excerpt: "Ryan's Design Philosophy"
---
Here's a bit more about my design philosophy [WIP] with links.
|
---
layout: page
title: אודות
permalink: /about-he/
ref: about
lang: he
---
TODO
### צרו קשר
[me@alexkubica.com](mailto:me@alexkubica.com) |
import mock from "mock-require";
import { VsCodeWindowBuilder } from "./vscode-window-builder";
import { createFunctionSpy } from "alsatian";
mock("vscode", {
TreeItem: class TreeItem {},
EventEmitter: class EventEmitter {
event = createFunctionSpy();
},
window: new VsCodeWindowBuilder().build(... |
# confirm-message-for-hubot
## Build
```
gulp
```
For more information, run `gulp help`:
```
$ gulp help
[23:15:33] Using gulpfile /path/to/example/gulpfile.js
[23:15:33] Starting 'help'...
Main Tasks
------------------------------
build
changelog
clean
default
help
lint
watch
Sub Task... |
require 'json'
def read_data
data = File.read(Rails.root.to_s + "/app/controllers/buslines/lines.json")
end
def get_lines val, type
lines = []
hash = JSON.parse read_data
hash["public_transport"]["Service"][val]["#{type}"].each do |e|
lines << e["num"]
end
return lines
end
def get_bus_company(line)
hash = ... |
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911
// .1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.... |
#!/usr/bin/env bash
set -eo pipefail
here="$(dirname "$(readlink --canonicalize "${BASH_SOURCE[0]}")")"
root="$(readlink --canonicalize "$here/..")"
export SRIOV_NETWORK_OPERATOR_IMAGE="${SRIOV_NETWORK_OPERATOR_IMAGE:-sriov-network-operator:latest}"
export SRIOV_NETWORK_CONFIG_DAEMON_IMAGE="${SRIOV_NETWORK_CONFIG_DAEMO... |
package com.deveddy.clujbike.data;
import dagger.Module;
@Module(includes = {DebugDataModule.class})
public class VariantDataModule {
}
|
# i = 0
# while (i<5):
# print(i)
# i+=1
# x = 1
# while (x<4):
# x +=1
# print("X vale {}.".format(x))
#
# i = 6
#
# while (i> 0):
# i -=3
# print(i)
# i = 2
# while i % 3!=0:
# print(i)
# i +=2
# tamanho = int(input("Digite o tamanho da sequencia: "))
# produto = 1
# valor = 1
# i ... |
<?php
/**
*
*/
class Pemain_Model extends CI_Model
{
public function validasi($nama, $sandi)
{
$sql = "SELECT nama FROM daftar_pemain WHERE nama = '$nama' AND sandi = '$sandi'";
$query = $this->db->query($sql, array($nama));
return $query->row_array();
}
public function tambah()
{
$data = array(
'... |
using System;
namespace Anlog.Appenders.Dummy
{
/// <summary>
/// Appends logs to nothing.
/// </summary>
public class DummyLogAppender : ILogAppender
{
/// <inheritdoc />
public ILogAppender Append(string key, string value)
{
return this;
}
... |
package net.nemerosa.ontrack.model.structure
/**
* Item which can be searched upon.
*/
interface SearchItem {
/**
* ID of this item
*/
val id: String
/**
* Fields for this item
*/
val fields: Map<String, Any?>
} |
package oops
class Node[T](val data : T ,val next : Node[T])
object Generic extends App{
def nth[T](curr : Node[T] , n: Int) : T = {
if(n==1)curr.data
//else if(curr.next==null)error("size is less then n")
else nth(curr.next , n-1)
}
val list = new Node(2,new Node(3,new Node(5,null)))
... |
"""
Week 1, Day 7: Cousins in Binary Tree
In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1.
Two nodes of a binary tree are cousins if they have the same depth, but have different parents.
We are given the root of a binary tree with unique values, and the values x and ... |
import {Component, Inject} from '@angular/core'
@Component({
selector: 'home',
template: `
<input
(keyup.enter)="addNewPerson(name)"
[(ngModel)]="name"
type="text" />
<ul><li *ngFor="let user of names">{{ user.name }}</li></ul>`
})
export class HomeComponent{
name: string = '';
names = [
{
name: 'A... |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// ------------------------------------------------------------
namespace Dapr.Actors.Communication
{
using System.Runtime.Serialization;
using Dapr.Actors;
[DataContr... |
package com.hymnal.welcome.koin
import org.koin.dsl.module
val appModule = module {
single<UserService> { UserServiceImpl() }
factory { ServiceManager(get()) }
} |
<?php
namespace Ambengers\QueryFilter;
use Ambengers\QueryFilter\Exceptions\MissingLoaderClassException;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Collection;... |
package play.api.libs
import java.util.Locale
import javax.xml.XMLConstants
import javax.xml.transform.stream.StreamSource
import javax.xml.validation.SchemaFactory
import akka.stream.scaladsl.Sink
import akka.util.ByteString
import org.xml.sax.InputSource
import play.api.Logger
import play.api.libs.streams.Accumulat... |
package de.tum.in.www1.artemis;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.fact... |
import type { DrawingContext } from '../models/drawing-context';
import { PENCIL } from '../tools/all';
import { DEFAULT_COLORS, DEFAULT_PALETTE } from './colors';
export const DRAWING_CONTEXT: DrawingContext = {
lineWidth: 1,
colors: { ...DEFAULT_COLORS },
palette: [...DEFAULT_PALETTE],
previewColor: null,
... |
<?php
return array(
'WXAPPID' => 'your appid',
'WXAPPSECRET' => 'your secret',
'LOGINURL' => "https://api.weixin.qq.com/sns/jscode2session?".
"appid=%s&secret=%s&js_code=%s&grant_type=authorization_code",
'TOKENURL' => "https://api.weixin.qq.com/cgi-bin/token?".
... |
#include "sensor_msgs/LaserScan.h"
#include "ros/ros.h"
class Scan_macher
{
public:
sensor_msgs::LaserScan downlaser;
ros::Publisher pub;
bool new_downlaser;
ros::NodeHandle nh;
ros::Subscriber sub;
ros::Subscriber sub1;
explicit Scan_macher()
{
new_downlaser=false;
... |
require 'rails_helper'
describe IiifController do
include Devise::Test::ControllerHelpers
before(:each) do
@tmp_assets_dir = Dir.mktmpdir
Settings.dri.files = @tmp_assets_dir
end
after(:each) do
FileUtils.remove_dir(@tmp_assets_dir, force: true)
end
describe 'GET show' do
let(:collection... |
using SPIXI.WPF.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Platform.WPF;
[assembly: ExportRenderer(typeof(WebView), typeof(SpixiWebViewRenderer))]
namespace SPIXI.WPF.Classes
{
public class ... |
#pragma once
#include <cstdio>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#if __unix__ || __linux__ || __APPLE__
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/file.h>
#else
#include <io.h>
#include <windows.h>
#endif
na... |
@extends('layout')
@section('title', '| Home')
@section('content')
<div class="content">
<hr>
<div class="container">
{{ $posts->links() }}
@foreach ($posts as $post)
<div class="post_card">
<p><b>Title:</b> <i>{{ $post->title }}</i></p>
<p class="sub_title">Body</p>
... |
#!/bin/bash
# for WordPress website deploy (need SSH)
before_sync(){
# extension of backup files which are created before replacement
ext=".temp_bakup"
# remove "DEP_XXX_RM "
find . -name "*.htaccess" -exec sed -i$ext "s|#DEP_REMOTE_RM ||" {} \;
find . -name "*.htaccess" -exec sed -i$ext "s|#DEP_${DRONE_B... |
//@dart=2.12
import 'package:flutter/material.dart';
import 'package:little_light/dev_mode/pages/login/dev_mode_login.page_widget.dart';
class DevModeLoginPageRoute extends MaterialPageRoute {
DevModeLoginPageRoute(RouteSettings settings)
: super(settings: settings, builder: (context) => DevModeLoginPageWidge... |
import * as React from 'react';
import { select, text } from '@storybook/addon-knobs';
import StatusHint from '../StatusHint';
// CSF format story
export const all = () => {
const children = text('children', 'Status Hint');
const appearance = select('Appearance', ['default', 'alert', 'info', 'warning', 'success']... |
<?php
declare(strict_types=1);
namespace Rector\AttributeAwarePhpDoc\Ast\Type;
use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode;
use PHPStan\PhpDocParser\Ast\Type\CallableTypeNode;
use Rector\BetterPhpDocParser\Attributes\Attribute\AttributeTrait;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\AttributeAwareNodeIn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.