text stringlengths 27 775k |
|---|
/**
* 查找单链表中的倒数第K个节点(k > 0)
*/
var Node = function (data) {
this.data = data;
this.next = null;
}
var node1 = new Node(1);
var node2 = new Node(2);
var node3 = new Node(3);
var node4 = new Node(4);
var node5 = new Node(5);
node1.next = node2;
node2.next = node3;
node3.next = node4;
node4.next = node5;
... |
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:permission_handler/permission_handler.dart';
class MapViewCurrentLocation extends StatefulWidget {
const MapViewCurrentLocation({Key? key}) : super(key: key);
@override
_MapViewState createSt... |
package g0801_0900.s0864_shortest_path_to_get_all_keys
import org.hamcrest.CoreMatchers.equalTo
import org.hamcrest.MatcherAssert.assertThat
import org.junit.jupiter.api.Test
internal class SolutionTest {
@Test
fun shortestPathAllKeys() {
assertThat(
Solution().shortestPathAllKeys(arrayOf(... |
package dev.rosewood.guiframework.framework.gui.screen;
import dev.rosewood.guiframework.gui.screen.GuiPageContentsResult;
import dev.rosewood.guiframework.gui.screen.Slotable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.inventory.ItemStack;
public class Framewor... |
(ns bodol.parser
(:require [instaparse.core :as insta]
[clojure.edn :as edn]
[bodol.types :as t]
[bodol.lambda :as l])
(:import [bodol.types LBoolean LNumber LString LSymbol LCons]))
(def parser
(insta/parser
"
<PROGRAM> = SPACE* SEXPS SPACE*
<SEXPS> = (SEXP SPACE+)* SEXP
<... |
# Create new log file
function New-LogFile(
[Parameter(Mandatory=$True)][string]$FileName,
[Parameter(Mandatory=$True)][string]$FolderName)
{
$IsFolderPresent = Test-Path ".\$FolderName\logs"
if($IsFolderPresent -eq $false)
{
New-Item -Path ".\$FolderName\logs" -ItemType Directory
}
$FileName = $F... |
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using TTController.Common;
using TTController.Common.Plugin;
namespace TTController.Service.Utils
{
public class Servi... |
import { RecipeEntity } from "src/recipe/entities/recipe.entity";
import { UserEntity } from "src/user/entities/user.entity";
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
@Entity('favorite')
export class FavoriteEntity {
@PrimaryGeneratedColumn()
id : number ;
... |
$LOAD_PATH.unshift( "../../pixelart/pixelart/lib" )
require 'cryptopunks'
klimt_the_kiss_90 = Image.read( './i/klimt-the-kiss-90-degree.png' )
klimt_judith = Image.read( './i/klimt-judith.png' )
HEART_SHADES = Punks::Sheet.find_by( name: 'Heart Shades', gender: 'f' )
PIPE = Punks::Sheet.find_by( nam... |
package main
import (
"bufio"
"fmt"
"log"
"os"
)
func main() {
inFile := "input.txt"
f, err := os.Open(inFile)
if err != nil {
log.Fatalf("Cannot open file %v: %v", inFile, err)
}
reader := bufio.NewReader(f)
sums := make([]int, 2)
for {
b, _, err := reader.ReadLine()
if err != nil {
break
}
t... |
module LoginHelper
def user_signup
fill_in("user[name]", :with => "Professor McGonagal")
fill_in("user[password]", :with => "password")
click_button('Create User')
end
def user_login
select 'Potter', from: 'user_name'
fill_in("password", :with => "password")
click_button('Sign In')
end... |
<?php
class Logger
{
private static self $instance;
protected $descriptor;
protected function __clone(){}
protected function __construct()
{
$this->descriptor = fopen("log.txt", "a") or die("Fatal error: can't open log file");
}
public function __destruct()
{
fclose($... |
package org.apache.aries.events.memory;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.contains;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
import static org.mockito.MockitoAnnotations.initMocks;
... |
<?php
namespace App\Http\Controllers;
use App\Aluno;
use Illuminate\Http\Request;
class AlunoController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Aluno $model)
{
return view('alunos.index', ['al... |
package com.javarush.task.task20.task2025;
import java.util.TreeSet;
/*
Алгоритмы-числа
Число S состоит из M цифр, например, S=370 и M (количество цифр) = 3
Реализовать логику метода getNumbers, который должен среди натуральных чисел меньше N (long)
находить все числа, удовлетворяющие следующему критерию:
число S ра... |
use bcc_sys::bccapi::{bpf_attach_socket, bpf_open_raw_sock};
use crate::helpers::to_cstring;
use crate::BccError;
use std::fs::File;
use std::os::unix::prelude::AsRawFd;
#[derive(Debug)]
pub struct Socket {
pub iface: String,
pub sock_fd: i32,
}
impl Socket {
pub fn new(iface: &str, code_fd: &File) -> R... |
package main
import (
"github.com/go-flutter-desktop/go-flutter"
"github.com/go-flutter-desktop/plugins/url_launcher"
"github.com/miguelpruivo/flutter_file_picker/go"
"pgo/cmd/plugin/pica"
)
var options = []flutter.Option{
flutter.WindowInitialDimensions(600, 900),
flutter.AddPlugin(&pica.Plugin{}),
flutter.Ad... |
use nom::character::is_alphanumeric;
use nom::{do_parse, named, tag, take_until, take_while, IResult};
use std::borrow::Cow;
use std::fmt;
use crate::{Parse, ParseError};
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "typed-builde... |
<?php
namespace App\Core;
use App\Core\Database\Sql;
use App\Models\User;
class Auth
{
const SESSION_AUTH_ID = 'auth_id';
const SESSION_AUTH_NOM = 'auth_nom';
const SESSION_AUTH_UTILISATEUR = 'auth_utilisateur';
const SESSION_AUTH_EMAIL = 'auth_email';
const SESSION_AUTH_ROLE = 'auth_role';
c... |
# 普通的session登录
> session的原理

## 普通session登录问题
1. 不同域名不能共享session
2. 多个后台服务器不能共享session
## 解决方案
> session复制
将a服务器的session同步到B服务器,这个只需要修改tomcat配置
> > 存在问题
1. session同步会占用带宽
2. 占用后台服务器的内存,如果有100个服务器,一个服务器就要存100个服务器的session... |
package org.quant.fenmatrix.interpolation;
public class SABRInterpolation extends Interpolation {
@Override
public double getValue(double x) {
return 0;
}
}
|
package net.nemerosa.ontrack.git.model
import java.time.LocalDateTime
class GitTag(
val name: String,
val time: LocalDateTime
) : Comparable<GitTag> {
override fun compareTo(other: GitTag): Int {
return this.time.compareTo(other.time)
}
}
|
<?php
/**
* index.php
* Created by PhpStorm.
* User: chenli
* Time: 2018-07-25 17:29
*/
namespace App\home\index;
use App\home\index\model;
use Core\library\Controller;
use Core\library\Request;
class IndexController extends Controller
{
public function index(){
$model = new model... |
# cipher-decipherer
## Goals
* Store a list of ciphers
* Store some details about:
* What they were used for
* Where did they come from
* How they work (formula?)
* Implement each cipher programmatically
* Allow users to:
* Supply a value to be encoded
* Specify a cipher to be used
* View the e... |
package hello.world.models
case class Counter(value: Integer = 1)
case class ApplicationContainer(var app: Application = Application())
case class Application
(
counter1: Counter = Counter(),
counter2: Counter = Counter(),
counterList: Vector[Counter] =
Vector(
Counter(), Counter(), Counter()
)
)
|
import {
Component,
Input,
Output,
EventEmitter,
ChangeDetectionStrategy,
} from '@angular/core'
import {GamesService} from 'a2/services'
import template from './template.html!text'
import styles from './style.css!text'
import moment from 'moment'
import {ReplaySubject, Observable} from 'rxjs'
@Component({
selec... |
// Copyright (c) 2018 Spotify AB.
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Ve... |
CREATE TABLE `act_lottery_configuration` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` VARCHAR(100) NOT NULL COMMENT '标题',
`status` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '1启用,2停用,3已过期',
`start_time` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '开始时间',
`end_time` INT(10) UNSIGNED NOT NULL... |
import { ThemeContext } from './theme-context';
import React, { Component } from 'react'
export default class ThemedButton extends Component {
render() {
const props = this.props;
const theme = this.context;
return ( <button {...props} sstyle={{backgroundColor: theme.background}}/>)
... |
# encoding: utf-8
#
=begin
-----------------
Benchmark: PostgreSQL 9.x Security Technical Implementation Guide
Status: Accepted
This Security Technical Implementation Guide is published as a tool to improve
the security of Department of Defense (DoD) information systems. The
requirements are derived from the National ... |
/*
* @Description:
* @Author: seven
* @Date: 2020-03-09 20:43:37
* @LastEditTime: 2020-03-09 21:27:03
* @LastEditors: seven
*/
import {isPlainObjcet} from './util'
function normalizeHeaderName(headers:any, normalizedName: string): void{
if(headers){
return
}
Object.keys(headers).forEach((name... |
class UsersController < ApplicationController
def top_creators
@users = User.non_admin
@sorted = @users.sort_by{|a| a.total_programs}
end
end
|
# StackOverflow GDD
## Název hry
Stack Overflow
## Autoři hry
Anna Skorobogatova, Aleš Calábek, Ondřej Lomič
## Popis cílové skupiny
Hru může hrát kdokoliv se znalostí základů programování a syntaxe jazyka Python.
## Chtěný herní zážitek
Vycházíme z předpokladu, že hráče baví počítání - ať už z hlavy nebo na papíře.
Mé... |
package com.adapty.internal.data.models
import com.adapty.models.ProductSubscriptionPeriodModel
import java.math.BigDecimal
data class ProductDiscount(
val price: BigDecimal,
val numberOfPeriods: Int,
val localizedPrice: String,
val subscriptionPeriod: ProductSubscriptionPeriodModel,
) |
require 'erb'
require 'tempfile'
module Bosh; end # Ugly hack
require 'common/properties'
class Deployment
def initialize(spec)
@spec = spec
generate_deployment_manifest(spec)
end
def name
yaml['name']
end
def to_path
path
end
def delete
puts "<-- rm #{path}" if debug?
FileUt... |
var toBuffer = require('../../lib/event-stream/to-buffer').toBuffer;
var Int64 = require('../../lib/event-stream/int64').Int64;
describe('Int64', function() {
it('should hold integers greather than Number.MAX_SAFE_INTEGER without losing precision', function() {
var bytes = toBuffer([0x7f, 0xff, 0xff, 0xff,... |
class ListExtensionsTest < Test::Unit::TestCase
def test_bracket_getter
cls, = compile(<<-EOF)
x = [1,2]
puts x[0]
EOF
assert_output("1\n") do
cls.main(nil)
end
end
def test_bracket_assignment
cls, = compile(<<-EOF)
import java.util.ArrayList
x = ArrayList.new
... |
package network
import (
"net"
)
const (
bitOfSize = 1
byteOfSize = bitOfSize * 1024
megaByteOfSize = byteOfSize * 1024
maxPacketSize = megaByteOfSize * 10
)
type sessionReadFunc func(session *Session, data []byte, size int)
type sessionWriteFunc func(session *Session, bytesTransferred int)
type sessi... |
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Table extends Model
{
use HasFactory;
protected $fillable=[
'id_branch',
'capacity',
'status'
];
//relacion, una mesa_x_reserva a una reservacion
publ... |
"use strict";
//TO-DO rewrite for hset/hgetall/hget
var Bluebird = require("bluebird")
var client = require("../redisClient");
var h = require("whispeerHelper");
var Decryptor = require("./decryptor");
var util = require("util");
var Key = function () {};
Key.prototype._getAttribute = function(attr) {
return clien... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.3
-- Dumped by pg_dump version 13.3 (Debian 13.3-1.pgdg100+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_con... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
---
title: PjBorder Enumeration (Project)
ms.prod: project-server
api_name:
- Project.PjBorder
ms.assetid: 84a62523-8bde-3a24-1a94-cea940ca96e6
ms.date: 06/08/2017
---
# PjBorder Enumeration (Project)
Contains constants that specify the type borders.
|**Name**|**Value**|**Description**|
|:-----|:-----|:-----|
|**... |
function label_basic(_args) {
var win = Ti.UI.createWindow({
title:_args.title
});
var l1 = Titanium.UI.createLabel({
id:'font_label_test',
text:'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ... |
<?php
namespace Photon\Wrapper\Effect;
/**
* Class Quality
* @package Photon\Wrapper\Effect
*/
class Quality extends EffectAbstract implements EffectInterface
{
/**
* @var int
*/
protected $quality;
public function __construct($quality = 100)
{
$this->quality = $quality;
}
} |
CREATE DATABASE IF NOT EXISTS `casbin`;
USE casbin;
CREATE TABLE IF NOT EXISTS `casbin_rule` (
`id` int NOT NULL AUTO_INCREMENT,
`ptype` varchar(255) DEFAULT NULL,
`v0` varchar(255) DEFAULT NULL,
`v1` varchar(255) DEFAULT NULL,
`v2` varchar(255) DEFAULT NULL,
`v3` varchar(255) DEFAULT NULL,
`v4` varchar... |
namespace Vehicles
{
public enum TurretType
{
None,
Static,
Rotatable
}
}
|
package sort
import (
"sort"
)
func BubbleSort(elements []int) {
keepWorking := true
for keepWorking {
keepWorking = false
for i := 0; i < len(elements)-1; i++ {
if elements[i] > elements[i+1] {
keepWorking = true
elements[i], elements[i+1] = elements[i+1], elements[i]
}
}
}
}
func Sort(eleme... |
using Benchmark.HashParser;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
#pragma warning disable 1591
namespace BCrypt.Net.Benchmarks
{
[MemoryDiagnoser]
[RPlotExporter, RankColumn]
[KeepBenchmarkFiles]
public class TestB64Decoder
{
[Benchmark(Baseline = true)]
[... |
#!/usr/bin/env perl
# 讀入moe的辭典檔案,印出文字和注音一式的部分。
# 有些單字詞會有多種讀音,記錄在第12欄,並且以(一)(二)等格式紀錄各種注音。
# note: 注音一式會將輕聲符號放在最前面。
# known issues:
# 1. 有些字詞是以圖片檔名呈現,例如異體字,這部分會直接忽略。
# 2. 約有四個詞出現utf-8編碼範圍外的問題。
# usage: moedict_parser.pl xls-file > output.txt
use Spreadsheet::ParseExcel;
use utf8;
binmode(STDIN, ':encoding(UTF-8)');
binm... |
---
name: Scheduled maintenance
about: 'Report a new scheduled maintenance.'
title: ''
labels: 'maintenance'
---
<!--
start: 2021-02-24T13:00:00.220Z
end: 2021-02-24T14:00:00.220Z
expectedDown: site-name, another-site-name
-->
|
INSERT INTO department (name)
VALUES
('Information Systems and Technology'),
('Finance'),
('Legal'),
('Human Resources'),
('Security'),
('Sales');
INSERT INTO role (title, salary, department_id)
VALUES
('Web Developer', 100000, 1),
('Accountant', 65000, 2),
('Paralegal', 55000, 3),
('Manager', 75000, 4),
('Engineer',... |
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib 'lib';
use Test::Nginx::Socket;
#worker_connections(1014);
#master_process_enabled(1);
#log_level('warn');
repeat_each(2);
#repeat_each(1);
plan tests => blocks() * repeat_each() * 3;
#no_diff();
#no_long_string();
run_tests();
__DATA__
=== TEST 1: set response con... |
SECTION code_stdio
PUBLIC __stdio_unlock_file_list
EXTERN __stdio_file_list_lock
EXTERN asm_mtx_unlock
__stdio_unlock_file_list:
; unlock stdio's FILE lists
;
; enter : none
;
; exit : none
;
; uses : af, bc, de, hl
ld hl,__stdio_file_list_lock
jp asm_mtx_unlock
|
export class UserService {
_db: any;
constructor(dbService: any) {
this._db = dbService;
}
async save(user) {
const users = await this._db.dbList('user');
for (let i = 0; i < users.length; i++) {
if (users[i].username === user.username) {
return 'User already exists';
}
}
... |
class HomeController < ApplicationController
before_action :enable_script
before_action :set_user, only: [:user, :doc]
def index
@docs = Doc.where(access: [:pub, :open])
end
def user
if current_user == @user
@docs = @user.docs
else
@docs = Doc.where(user: @user, access: [:pub, :open]... |
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Rute extends Model
{
protected $table = 'rute';
public $timestamps = false;
protected $fillable = [
'id',
'depart_at',
'rute_from',
'rute_to',
'price',
'transportationid',
];
}
|
---
layout: category
title: Azure
slug: 'azure'
---
|
import { BuHeroModule } from './bu-hero.module';
describe('BuHeroModule', () => {
let buHeroModule: BuHeroModule;
beforeEach(() => {
buHeroModule = new BuHeroModule();
});
it('should create an instance', () => {
expect(buHeroModule).toBeTruthy();
});
});
|
package com.howtographql.hackernews.graphql.payloads;
import com.howtographql.hackernews.graphql.repositories.AccessTokenRepository;
import com.howtographql.hackernews.graphql.resolvers.AuthResolver;
import com.howtographql.hackernews.graphql.utils.security.AccessTokenGenerator;
public class AccessToken {
privat... |
/*
* Copyright 2020 Learner 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 agreed to ... |
module Computer
module Composite
class CompositeEquipment < Computer::Equipments::Equipment
def post_initialize(args = {})
@equipments = []
end
def net_price
equipments.map(&:net_price).sum
end
def power
equipments.map(&:power).sum
end
def disco... |
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2014 Phalcon Team (http://www.phalconphp.com) |
+-----... |
<?php
namespace myDelivery\Http\Controllers;
use Illuminate\Http\Request;
use myDelivery\Http\Requests\UserRequest;
use myDelivery\Models\User;
use myDelivery\Models\Client;
use myDelivery\Models\Order;
class UsersController extends Controller
{
private $userModel;
public function __construct(User $user) ... |
package cats
import simulacrum.typeclass
/**
* Weaker version of Applicative[F]; has apply but not pure.
*
* Must obey the laws defined in cats.laws.ApplyLaws.
*/
@typeclass(excludeParents=List("ApplyArityFunctions"))
trait Apply[F[_]] extends Functor[F] with Cartesian[F] with ApplyArityFunctions[F] { self =>
... |
#!/usr/bin/env python2.7
# -*- coding:utf-8 -*-
#Time-stamp: <2017-01-07 07:55:39 hamada>
import time
import glob
import Queue
import sys
import os.path
import logging as LG
import commands
def gen_code(quotes):
c = '''#!/usr/bin/env python2.7
# -*- coding:utf-8 -*-
import os
import logging as LG
import random
im... |
part of charts_painter;
class ChartDecorationChildRenderer<T> extends SingleChildRenderObjectWidget {
ChartDecorationChildRenderer(
this.chartState, this.decorationPainter, Widget child,
{Key? key})
: super(key: key, child: child);
final ChartState<T?> chartState;
final DecorationPainter decor... |
using Unity.Networking.Transport;
using Unity.NetCode;
using Unity.Burst;
using Unity.Entities;
using Unity.Collections;
[GenerateAuthoringComponent]
public struct PlayerScoreComponent : IComponentData
{
[GhostField]
public int networkId;
[GhostField]
public FixedString64 playerName;
[GhostField]
... |
package com.bp.weatherapp.viewModels
import android.util.Log
import androidx.lifecycle.ViewModel
import com.bp.weatherapp.models.Location
import com.bp.weatherapp.models.Weather
import com.bp.weatherapp.repositories.WeatherRepository
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.schedulers.Sc... |
import bodyParser from "body-parser";
import express from "express";
import passport from "passport";
import { config, ConfigKey } from "./infastructure/Config";
import { connectSingletonDatabase } from "./infastructure/Database";
import { getRequestLoggerHandler, initLogger } from "./infastructure/Logger";
import { c... |
class Config
PROJECT_DIR = `git rev-parse --show-toplevel`.strip
PROJECT_FILE = "#{PROJECT_DIR}/.workflow-tools.yml"
class << self
def user
@@user ||= Hashie::Mash.load(File.expand_path("../../config/config.yml", __FILE__))
end
def project
@@project ||=
if File.exists?(PROJECT_FI... |
<?php
namespace App;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\Model;
class Department extends Model
{
public function getAll(){
$departments
= DB::table('departments')
//->join('lead_sources', 'call_leads.lead_source_id', '=', 'lead_sources.id')
... |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class RTCP_1733(Base):
__slots__ = ()
_SDM_NAME = 'realTimeTransportControlProtocol1733'
_SDM_ATT_MAP = {
'Version': 'realTimeTransportControlProtocol1733.rtcpHeader.version',
'Padding': 'realTimeTransportContr... |
#! /usr/bin/env bash
defaults write com.apple.menuextra.battery ShowPercent -string "NO"
defaults write com.apple.menuextra.battery ShowTime -string "YES"
# From <https://github.com/rtrouton/rtrouton_scripts/>
IS_LAPTOP=`/usr/sbin/system_profiler SPHardwareDataType | grep "Model Identifier" | grep "Book"`
if [[ "$IS_... |
require 'hidden_hippo/scanner'
describe HiddenHippo::Scanner do
let(:extractor) {double 'extractor', call: nil}
let(:packet_class) {double 'packet_class', filter: '', tshark_fields: []}
def make_scanner(file)
HiddenHippo::Scanner.new file, packet_class, extractor
end
describe '#call' do
it 'shoul... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package proxmox
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type LXCDisk struct {
pul... |
<?php
$key = strtolower(md5(microtime().rand(1000, 9999)));
$uid = mysqli_real_escape_string($conn, $_GET["userid"]);
$sql = "UPDATE users SET apikey = '$key' WHERE userid = $uid";
if ($conn->query($sql) === TRUE) {
header("Location: ?page=personinfo&userid=$uid");
}
else {
... |
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require 'socket'
require 'openssl'
host = ARGV.shift
port = ARGV.shift.to_i
if port == 0
abort("usage: #$0 host port")
end
TCPSocket.open(host, port) do |sock|
ssl = OpenSSL::SSL::SSLSocket.new(sock)
ssl.sync_close = true
# SNI support since ruby 1.9.3
if ssl.respond... |
#!/bin/bash
#
gfortran -c analemma.f
if [ $? -ne 0 ]; then
echo "Errors compiling analemma.f"
exit
fi
#
gfortran analemma.o
if [ $? -ne 0 ]; then
echo "Errors linking and loading analemma.o"
exit
fi
#
rm analemma.o
#
chmod ugo+x a.out
mv a.out ~/binf77/analemma
#
echo "Executable installed as ~/binf77/analemma"... |
// Copyright 2021 Leptopoda. All rights reserved.
// Use of this source code is governed by an APACHE-style license that can be
// found in the LICENSE file.
part of 'package:bierverkostung/screens/money_management/money_management.dart';
/// User Profile Information
///
/// Widget displaying the user information lik... |
<?php
namespace Jiannius\Atom\JsonResources;
class Ability extends JsonResource
{
/**
* Get the resource
*
* @return array
*/
public function getResource($request)
{
return [
'module' => $this->module,
'name' => $this->name,
// relationship
... |
package com.arefbhrn.marketpay
sealed class ConnectionState {
object Connected : ConnectionState()
object FailedToConnect : ConnectionState()
object Disconnected : ConnectionState()
}
|
namespace AutoTest.ExampleLibrary.Issues.Issue002
{
using System;
public abstract class AbstractBase
{
public void AMethod(object data)
{
if (data == null)
throw new ArgumentNullException(nameof(data));
}
public abstract void MethodToCall(object... |
import 'package:flutter/material.dart';
import '../../design_system_example.dart';
final theme2 = ThemeData(
primarySwatch: Colors.yellow,
disabledColor: mediumGreyColor,
textTheme: const TextTheme(
button: TextStyle(color: Colors.black26),
),
progressIndicatorTheme: const ProgressIndicatorThemeData(
... |
<div class="form-container">
<div class="form-main">
<!-- Title -->
<div class="form-group">
<label class="required" for="input-title"><?= __d('posts', 'Title') ?></label>
<?= $this->Alert->error(@$errors['title']) ?>
<input
type="text" name="title" id="input-title" class="form-cont... |
package api
import (
"github.com/noah-blockchain/noah-go-node/core/types"
)
type WaitlistResponse struct {
List []*Wait `json:"list"`
}
type Wait struct {
Coin Coin `json:"coin"`
Value string `json:"value"`
}
func Waitlist(pubkey types.Pubkey, address types.Address, height int) (*WaitlistResponse, error) {
... |
unit InputF;
interface
uses
StdCtrls,
Spin,
Forms,
Controls,
Classes;
type
TInputForm = class(TForm)
CancelButton : TButton;
InputEdit : TEdit;
InputLabel : TLabel;
InputSpinEdit : TSpinEdit;
OKButton : TButton;
procedure CancelButtonClick(Sender :... |
<?php
require_once "excel_reader.php";
function printCSS($ext) {
if($ext=="xls") {
$p=dirname(__FILE__)."/excel.css";
return file_get_contents($p);
}
}
function printJS($ext) {
if($ext=="xls") {
$p=dirname(__FILE__)."/excel.js";
return file_get_contents($p);
}
}
?>
|
mod opts;
mod oximeter;
use std::collections::HashMap;
use clap::Clap;
use chrono::{Duration, NaiveDate, Local};
use hidapi::{HidApi, HidDevice};
use log::{self, debug, log_enabled};
use oximeter::RecordingMode;
use crate::opts::{Opts, Subcommand};
use crate::oximeter::{
calculate_checksum, CommandCode, Command... |
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:convert';
import 'dart:io';
import '../benchmarks.dart';
Future<int> _runProcess(
Strin... |
/*
* Revision History:
* From: NCEPU-PPT
* Test environment: Swi-prolog 7.6.4
*/
hanoi(N):-
move(N,left,middle,right),nl,nl.
move(1,A,_,C):-
inform(1,A,C),!.
move(N,A,B,C):-
N1 is N-1,
move(N1,A,C,B),
inform(N,A,C),
move(N1,B,A,C).
inform(N,Loc1,Loc2):-
writelist(... |
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
application
kotlin("jvm") version "1.5.30"
id("com.github.johnrengelman.shadow") version "7.0.0"
}
group = "com.jaspervanmerle.cglocal"
version = "1.3.0"
application {
ma... |
import copy
from pathlib import Path
import pickle
import fire
from det3d.datasets.kitti import kitti_common as kitti_ds
from det3d.datasets.utils.create_gt_database import create_groundtruth_database
def kitti_data_prep(root_path):
kitti_ds.create_kitti_info_file(root_path)
kitti_ds.create_redu... |
package database
import "log"
type User struct {
UserId int `json:"user_id"`
Username string `json:"username"`
Password string `json:"password"`
ConfirmPassword string `json:"confirm_password"`
}
func (u *User) Add() error {
stmtIn, err := db.Prepare("INSERT INTO `users`(username, pass... |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrom... |
export default (params: { search?: string, page?: string }): { search?: string, page?: number } => {
const queryObject: { search?: string, page?: number } = {};
if (params['search']) {
queryObject.search = params.search.toString();
}
if (params['page']) {
queryObject.page = parseInt(params.page);
}
... |
#!/usr/bin/env ruby
require_relative './lib/salesforce_zoom_sync'
Process.setproctitle('weekly_sync')
LOG = Logger.new(File.join(File.dirname(__FILE__), 'log', 'weekly_sync.log'))
p '****** Running weekly sync ******'
p 'Killing push job...'
`pkill -f salesforce_push_sync`
LOG.info('Running weekly Zoom to SF sync job... |
import models._
import services._
import services.query._
import _root_.ui.modal.{ColumnDetailManager, RowUpdateManager}
import _root_.ui.{HistoryManager, UserManager}
import util.NetworkMessage
trait ResponseMessageHelper { this: DatabaseFlowApp =>
protected[this] def handleMessage(rm: ResponseMessage) = rm match {... |
using System;
using System.Threading;
using Scheduler.Cron;
namespace Scheduler.Jobs
{
public enum JobType {
OneShot,
Scheduled,
Delayed
};
/// <summary>
/// The main job class.
/// This class is a main building block for the scheduler,
/// as it holds all the required... |
## NWCUA's WordPress Theme
A WordPress theme created for NWCUA.org by Giraph Creative.
© 2015 NWCUA. All rights reserved. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.