text stringlengths 27 775k |
|---|
typedef int *(*intpa3p_t)[3];
typedef int *intpa3_t[3];
int main() {
int x = 3;
intpa3_t f = {&x, &x, &x,};
intpa3p_t g = &f;
int y = *(*g)[1];
return 0;
}
|
import React from "react";
function Footer() {
return (
<footer className="footer d-flex align-items-end">
<div className="d-flex flex-column" style={{ height: 70 }}>
<div>
</div>
</div>
<div className="d-flex align-items-start">
<div>© {new Date().getFullYear... |
import Component from 'ember-component';
import layout from '../templates/components/tta-if-resolved';
import { task } from 'ember-concurrency';
import get from 'ember-metal/get';
export default Component.extend({
layout,
tagName: '',
resolveTask: task(function *() {
return yield get(this, 'promise');
}).... |
// Copyright 2020 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0
use std::convert::TryFrom;
use tss_esapi::constants::*;
use tss_esapi::tss2_esys::TPM2_ALG_ID;
use tss_esapi::utils::algorithm_specifiers::*;
mod test_object_type {
use super::*;
#[test]
fn test_into_alogithm_id(... |
package name.alatushkin.api.vk.generated.widgets
import name.alatushkin.api.vk.api.VkDate
import name.alatushkin.api.vk.generated.users.UserFull
open class CommentRepliesItem(
val cid: Long? = null,
val uid: Long? = null,
val date: VkDate? = null,
val text: String? = null,
val likes: WidgetLikes? ... |
# Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: AGPL-3.0
class EnforceUniqueIdentityUrl < ActiveRecord::Migration[5.0]
def change
add_index :users, [:identity_url], :unique => true
end
end
|
# Ansible variables to set up
* `wsid_install_dir` (default: /opt/wsid-server)
* `wsid_identity_url` -- (required!) https url which application will use
* `wsid_port` -- local port to bind to
* `wsid_allowed_users` -- system users exclusively allowed to connect to port (nginx must be included)
|
subroutine setup_map()
implicit none
integer smallend(2),bigend(2)
integer mgrid, ngrid, ntotal
double precision r1
integer n, m
c # Number of boxes
call create_boxes()
open(10,file='boxes.dat')
read(10,*) ntotal
read(10,*) mgrid
c read(10,*) ngrid... |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/mivisionx/lib:/opt/rocm/rpp/lib
rm -rf RALI-GPU-RESULTS
mkdir RALI-GPU-RESULTS
../../../utilities/rali/rali_unittests/build/rali_unittests image_224x224 RALI-GPU-RESULTS/1-RALI-GPU-Rotate.png 224 224 2 1 1
../../../utilities/rali/rali_unittests/build/rali_unittests ima... |
module Auth
class Admin::UserTaggedsController < Admin::BaseController
before_action :set_user_tag
before_action :set_user_tagged, only: [:show, :edit, :update]
def index
@user_taggeds = @user_tag.user_taggeds.page(params[:page])
end
def new
@user_tagged = @user_tag.user_taggeds.buil... |
// Mock ApiService object
const ApiService = {
async getRestaurantData() {
return new Promise((resolve) => {
resolve({ status: 'success' });
});
},
async getMenuData() {
return new Promise((resolve) => {
resolve({ status: 'success' });
});
},
async getAnalytics() {
return new... |
<?php
namespace Adldap\Laravel\Tests;
use Adldap\Connections\Ldap;
use Adldap\Laravel\Auth\DatabaseUserProvider;
use Adldap\Laravel\Tests\Models\User;
use Adldap\Schemas\ActiveDirectory;
use Illuminate\Support\Facades\Schema;
class DatabaseTestCase extends TestCase
{
public function setUp()
{
parent:... |
using FreeRedis.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FreeRedis
{
partial class RedisClient
{
class SingleTempAdapter : BaseAdapter
{
readonly RedisClient _cli;
readonly IRedisSocket _redisSocket;
... |
<?php
namespace App\Http\Controllers;
use App\Services\DateCreatorService;
class WeatherController extends Controller
{
//Display the index page and add start dates to buttons
public function getIndex()
{
//Get Mondays date for the week filter
$monday = DateCreatorService::getMonday();
retur... |
##########################################################################
# Copyright 2007 Applied Research in Patacriticism and the University of Virginia
#
# 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 ... |
package com.thedancercodes.android.creatures.ui.test.mapper
import com.thedancercodes.android.creatures.ui.mapper.CreatureMapper
import com.thedancercodes.android.creatures.ui.test.factory.CreatureFactory
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
impo... |
require 'guard/jobs/base'
module Guard
module Jobs
class PryWrapper < Base
def _setup(options)
Pry.config.should_load_rc = false
Pry.config.should_load_local_rc = false
history_file_path = options[:history_file] || HISTORY_FILE
if legacy_pry?
Pry.config.history.f... |
using System;
using System.Configuration;
namespace XSockets.Geo.WebTestClient
{
public partial class _default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
XSocketsUrl = ConfigurationManager.AppSettings[... |
import { MutableRefObject } from 'react'
import { delay } from '../../events/delay'
/**
* Determine if a promise has been resolved.
* @param promise - The promise to check.
* @returns A boolean indicating whether the promise has been resolved.
* @example
* // Asynchronous usage
* async function exampleCallback()... |
# Stock research from TWSE
## crawler-service
##### Spring boot + Web + jsoup + mongoDb
It's a crawler service for twse to get stock info.
http://mis.twse.com.tw/stock/fibest.jsp
|
#!/bin/bash
set -euo pipefail
prosodyctl --config ./prosody.cfg.lua register testpilot localhost asdf
prosody --config ./prosody.cfg.lua
|
module API
module V3
class ProviderSuggestionsController < API::V3::ApplicationController
before_action :build_recruitment_cycle
def index
return render(status: :bad_request) if params[:query].nil? || params[:query].length < 3
found_providers = @recruitment_cycle.providers
... |
package socket
import (
"testing"
"github.com/smartystreets/goconvey/convey"
)
func TestDecodePackage(t *testing.T) {
convey.Convey("test decode packet", t, func() {
msgByte := message{Data: []byte("hello"), EventName: "test"}.MarshalBinary()
p := sockPackage{PT: PackTypeEvent, Payload: msgByte}.MarshalBinary... |
# -*-coding: utf-8 -*-
from django.db import models
class DBLogEntry(models.Model):
time = models.DateTimeField(auto_now_add=True)
level = models.CharField(max_length=10)
message = models.TextField()
def __str__(self):
return str(self.time.strftime("%d.%B.%Y %H:%M"))+" "+str(self.level)
|
//This file is part of Photon (http://photon.sourceforge.net)
//Copyright (C) 2004-2005 James Turk
//
// Author:
// James Turk (jpt2433@rit.edu)
//
// Version:
// $Id: RandGen.hpp,v 1.6 2005/10/30 21:08:57 cozman Exp $
#ifndef PHOTON_UTIL_RANDGEN_HPP
#define PHOTON_UTIL_RANDGEN_HPP
namespace photon
{
namespace ut... |
<?php
/**
* Created by PhpStorm.
* User: haohui
* Date: 2016/6/30
* Time: 10:13
*/
namespace App\Service;
use App\Models\Setting;
class BootService
{
public function domainSetting()
{
$data = Setting::all()->toArray();
$setting = [];
foreach ($data as $key => $item) {
... |
---
title: Docker 镜像保存和加载
date: 2020-01-17 10:00:00
tags: 'Docker'
categories:
- ['部署', '容器化']
permalink: docker-save-load
photo:
---
## 简介
> 这篇文章主要介绍了一种根据便捷的镜像交付过程
一般项目的交付都需要一个甲乙双方私用的注册中心,然后乙方推送后自动在甲方那边集成部署,当然对于很多项目,大部分流程都是乙方打包,然后通过邮件或者其他形式,直接进行发送处理。
docker 也提供类似的功能,通过 `docker save`, `docker load... |
namespace cbb.core
{
using System.ComponentModel;
/// <summary>
/// A base view model functionality for all view models.
/// </summary>
public class BaseViewModel : INotifyPropertyChanged
{
#region events
/// <summary>
/// Occurs when a property value changes.
... |
using UnityEngine;
using System.Collections;
public class ArmyCommandsController : MonoBehaviour {
public StrategyController strCtrl;
public MyPathfinding path;
public SelectTargetCity selectTargetCity;
public MenuDisplayAnim armyCommands;
public ACInformationController infoCtrl;
public CCGener... |
## 题3: 无重复字符的最长子串
### 描述
```
给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。
示例 1:
输入: "abcabcbb"
输出: 3
解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。
示例 2:
输入: "bbbbb"
输出: 1
解释: 因为无重复字符的最长子串是 "b",所以其长度为 1。
示例 3:
输入: "pwwkew"
输出: 3
解释: 因为无重复字符的最长子串是 "wke",所以其长度为 3。
请注意,你的答案必须是 子串 的长度,"pwke" 是一个子序列,不是子串。
```
### 思路
标签: 滑动窗口
步骤: ... |
---
layout: page
title: You want to know me?
tags: [about, know, new, here]
modified: 2015-05-14T20:53:07.573882-04:00
image:
feature: sample-image-2.jpg
credit: Raspberrypi
creditlink: https://www.raspberrypi.org/
---
### On this blog, I will talk about numerals things, like:
* Crazy ideias;
* Plugins and App... |
using Otter.Utility.MonoGame;
using System;
using WormGame.Entities;
using WormGame.Static;
namespace WormGame.Core
{
/// @author Antti Harju
/// @version v0.5
/// <summary>
/// Collision system.
/// </summary>
public class Collision
{
/// Collision types. Use these instead of raw ... |
# NodeumApi.TaskExecution
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**taskId** | **Number** | | [optional]
**name** | **String** | | [optional]
**workflowType** | **String** | | [optional]
**workflowAction** ... |
#!/bin/sh
# Precompile assets for production
bundle exec rake assets:precompile
echo "Assets Pre-compiled!"
bundle exec rake webpacker:compile
echo "Ran Webpacker Compile!"
|
<?php declare(strict_types = 1);
namespace Contributte\GopayInline\Api\Lists;
class PaymentState
{
// Payment created
public const CREATED = 'CREATED';
// Payment method chosen
public const PAYMENT_METHOD_CHOSEN = 'PAYMENT_METHOD_CHOSEN';
// Payment paid
public const PAID = 'PAID';
// Payment pre-authorize... |
import { Logger } from '@hmcts/nodejs-logging';
import autobind from 'autobind-decorator';
import axios, { AxiosResponse } from 'axios';
import config from 'config';
import { Response } from 'express';
import { v4 as uuid } from 'uuid';
import { CITIZEN_UPDATE } from '../../../app/case/definition';
import { AppRequest... |
package com.github.mdr.mash.evaluator
import com.github.mdr.mash.functions.MashCallable
import com.github.mdr.mash.parser.Provenance
import com.github.mdr.mash.utils.{ LineInfo, Point, PointedRegion }
case class SourceLocation(provenance: Provenance, pointedRegion: PointedRegion) {
def source = pointedRegion.of(pr... |
---
id: js-quickstart
title: Quickstart for Sauce Labs with Cypress, Playwright, and TestCafe
sidebar_label: Getting Started with JavaScript Testing
description: Basic steps for getting going quickly with JavaScript based frameworks using saucectl
---
<p><span className="sauceRed">PAGE DEPRECATED</span></p>
Please re... |
#! /bin/bash
echo "Docker build assitant for travis..."
set -ex
DOCKER_NODE="arm32v7/node:10-buster"
[ -n "$1" ] && DOCKER_NODE="$1"
echo "Building with docker for node $DOCKER_NODE"
#docker run --rm --privileged multiarch/qemu-user-static:register --reset -p yes
#docker run -t --rm -v $(pwd):/root/node-nrf24 \
# ... |
# encoding: UTF-8
module Rivet
VERSION = '3.2.0'
end
|
/*
* Copyright 2013 Chiwan Park
*
* 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... |
-- Largest Square Inside A Circle
-- https://www.codewars.com/kata/5887a6fe0cfe64850800161c
module Kata (areaLargestSquare) where
areaLargestSquare :: Double -> Double
areaLargestSquare = (*2) . (^2)
|
## intent:greet
- hey
- hello
- hi
- good morning
- good evening
- hey there
## intent:goodbye
- bye
- goodbye
- see you around
- see you later
## intent:mood_affirm
- yes
- indeed
- of course
- that sounds good
- correct
## intent:mood_deny
- no
- never
- I don't think so
- don't like that
- no way
- not really
##... |
package com.hariofspades.blockchain.inject
import com.hariofspades.blockchain.BuildConfig
import com.hariofspades.domain.repository.TransactionRemote
import com.hariofspades.remote.TransactionRemoteImpl
import com.hariofspades.remote.mapper.TransactionHistoryMapper
import com.hariofspades.remote.mapper.TransactionItem... |
# setup-yq-action
GitHub Action to setup the `jq` and `yq` command for yaml and json parsing
Example of use :
```yaml
name: Release
on: [ "push" ]
jobs:
parse_yaml:
name: Parse Yaml
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install yq
... |
/*******************************************************************************
Copyright(c) 2015-2021 Parker Hannifin Corp. All rights reserved.
MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
*******************************************************************************/
#include "ms... |
import { WalletProviderState } from 'app/containers/WalletProvider/types';
import { TradingPageState } from 'app/containers/TradingPage/types';
import { FastBtcFormState } from 'app/containers/FastBtcForm/types';
import { LendBorrowSovrynState } from 'app/containers/LendBorrowSovryn/types';
import { EventsStoreState } ... |
<?php
namespace Modules\GameServer\Entities;
use App\Model\Model;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Collection;
use Modules\Event\Entities\Event;
use Modules\Game\Entities\Game;
use Modules\Match\Entities\MatchModel;
/**
* Class GameServer
* @package Modules\GameServer\Entities
*
... |
/*
* Copyright (c) 2017, 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.
*/
/**
* @assertion Capability pauseCapability
* read-only
* Capability granting the abilit... |
/*
*
* Copyright 2020 Netflix, 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... |
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
KEYPATH=$SCRIPTPATH/../.secrets
mkdir -p $KEYPATH
PRIVATE_KEY=$KEYPATH/private.pem
PUBLIC_KEY=$KEYPATH/public.pem
openssl genrsa -out $PRIVATE_KEY 2048
openssl rsa -in $PRIVATE_KEY -outform PEM -pubout -out $PUBLIC_KEY
|
#!/bin/bash
SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# Build collector
pushd ../opentelemetry-lambda/collector || exit
make package
popd || exit
# Build the sdk layer and sample apps
./gradlew build
mkdir -p ../opentelemetry-lambda/java/build/extensions
cp ./build/libs/aws-otel-l... |
<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Request;
/**
* Class TestRestFul
* @package app\index\controller
* 测试资源控制器
* 此控制器,是使用此命令创建的: php think make:controller index/TestRestFul
*
* restful理解:
* 概念:
* 一种软件架构风格、设计风格,而不是标准,只是提供了一组设计原则和约束条件。
* ... |
#! /bin/bash
basePath=$(cd "$(dirname "$0")";pwd)
cd $basePath
pod repo push FMPodSpec FMLayoutKit.podspec --allow-warnings &&
pod trunk push FMLayoutKit.podspec --allow-warnings
|
package verificationcode
type Service interface {
Type() string
Challenge(ctx *Context) (challenge *Challenge, err error)
Response(ctx *Context, code []byte) (result *Result, err error)
}
|
(function() {
'use strict';
angular.module('JournalApp.core')
.factory('ProcessData', ProcessData);
function ProcessData() {
var service = {
// place data manipulating functions here
formatDate: formatDate,
formatText: formatText,
getDateObject: getDateObject,
getMoodsArray... |
import React from "react";
import Layout from "../components/Layout";
import { push } from "gatsby";
interface State {
timeout: number;
}
class NotFoundPage extends React.Component<{}, State> {
private timer = -1;
constructor(props: {}) {
super(props);
this.state = { timeout: 5 };
}
public compone... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Text;
using Azure.Storage.Files.DataLake.Models;
namespace Azure.Storage.Files.DataLake
{
internal class DataLakeErrors
{
public static Argument... |
export * from './const'
export * from './core'
export * from './definitions'
export * from './level'
export * from './root'
export * from './types'
|
#!/bin/bash
BASEDIR=$(dirname "$BASH_SOURCE")
$BASEDIR/../vendor/bin/php-cs-fixer fix "$@" $BASEDIR/../
|
use crate::*;
use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)]
pub struct MediaType {
#[serde(skip_serializing_if = "Option::is_none")]
pub schema: Option<ReferenceOr<Schema>>,
#[serde(skip_serializing_if = "Option::is_none")]
... |
import * as ts from 'typescript';
import * as Lint from 'tslint';
const OPTION_ALWAYS = 'always';
export class Rule extends Lint.Rules.AbstractRule {
public static FAILURE_STRING = {
always: {
start: `A space is required after '{'`,
end: `A space is required before '}'`
},
never: {
sta... |
# Finds non-whitelisted tags.
module JekyllPrepublish
class PostTagValidator
def initialize(configuration)
@whitelist = Set.new(
configuration.fetch('tag_whitelist', Array.new))
end
def describe_validation
"Checking tags are from whitelist [#{@whitelist.to_a.join(', ')}]."
end
... |
import {
TextDocumentContentProvider,
ExtensionContext,
Uri,
Event,
EventEmitter,
commands,
window
} from 'vscode';
import { CheckpointsModel, ICheckpoint, IFile, ICheckpointStore, isCheckpoint, isFile } from './CheckpointsModel';
import * as path from 'path';
export class CheckpointsDocumentView implements Tex... |
import sys
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import confusion_matrix, f1_score
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import train_test_split
np.set_printoptions(threshold=sys.maxsize)
# printing an... |
package abc
import utilities.debugLog
import java.util.*
fun main(args: Array<String>) {
val sc = Scanner(System.`in`)
val r1 = sc.nextLong()
val c1 = sc.nextLong()
val r2 = sc.nextLong()
val c2 = sc.nextLong()
println(problem184c(r1, c1, r2, c2))
}
fun problem184c(r1: Long, c1: Long, r2: Lon... |
// import store from '~/monitoring/stores/embed_group';
import * as actions from '~/monitoring/stores/embed_group/actions';
import * as types from '~/monitoring/stores/embed_group/mutation_types';
import { mockNamespace } from '../../mock_data';
describe('Embed group actions', () => {
describe('addModule', () => {
... |
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright 2021 Authors of Cilium
DIR=$(dirname $(readlink -ne $BASH_SOURCE))
source "${DIR}/lib/common.sh"
source "${DIR}/../backporting/common.sh"
usage() {
logecho "usage: $0 <RUN-URL> [VERSION] [GH-USERNAME]"
logecho "RUN-URL GitHub URL with the RUN ... |
---
title: Verkefni dagsins
lysing: >-
Draga einhvern í fjölskyldunni niður á bryggju, taka mynd af sér herma eftir
fiski og senda okkur....:)
dagsetning: 12/14
---
|
using Distributed
addprocs(3, exeflags="--project")
const jobs = RemoteChannel(()->Channel{Int}(32))
const results = RemoteChannel(()->Channel{Tuple}(32))
n = 12
function make_jobs(n)
for i in 1:n
put!(jobs, i)
end
end
make_jobs(n) # Feed the jobs channel with "n" jobs.
@everywhere function do_work(jobs, re... |
import Tag from './src/Tag.vue';
export { Tag as OTag };
|
package by.godevelopment.currencyappsample.domain.models
data class CurrenciesDataModel(
val header: String = "",
val oldData: String = "",
val newData: String = "",
val currencyItems: List<ItemCurrencyModel> = listOf()
)
|
require "spec_helper"
describe Glysellin::Image do
it { should belong_to(:imageable) }
it { should have_attached_file(:image) }
before(:each) do
@discount_type = create(:discount_type)
end
describe '#image_url' do
[
['order-percentage', '%'],
['fixed-price', '€']
].each do |(identif... |
import java.util.*;
import org.junit.Test;
import static org.junit.Assert.*;
// LC1665: https://leetcode.com/problems/minimum-initial-energy-to-finish-tasks/
//
// You are given an array tasks where tasks[i] = [actual_i, minimum_i]:
// actual_i is the actual amount of energy you spend to finish the ith task.
// mini... |
using System;
namespace TNeural
{
public delegate float Activator(float input);
public static class Activators
{
public static readonly Activator ReLU = (i) => Math.Max(0.0f, i);
public static readonly Activator Sigmoid = (i) => (float) (1.0 / (1 + Math.Exp(-i)));
pu... |
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Http\Request;
use App\Torneo;
use PDF;
class Torneo... |
import 'dart:convert' show jsonDecode, jsonEncode;
import 'package:http/http.dart' as http;
import 'package:lifx_http_api/src/responses/exceptions/lifx_http_exception.dart';
import './properties/properties.dart';
import './devices/devices.dart';
import './responses/responses.dart';
/// Client to access the LIFX HTTP A... |
/*
* vim:ts=4:sw=4:expandtab
*
* Copyright © 2016 Ingo Bürk
*
* 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, co... |
@file:JvmName("StringExtensionsParameters")
package net.tassia
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.Arguments.arguments
import java.util.stream.Stream
fun provideEQIC(): Stream<Arguments> {
return Stream.of(
arguments("Hello World!", "hello world!", true),
a... |
module PrettyTopLevel where
import Core
import Pretty
import PrettyExpr
import SourceMap (SourceMap, lookupDef)
import Data.ByteString.Char8 (ByteString, unpack)
data PrettyTopLevel =
PrettyTopLevel (SourceMap ByteString) (TopLevelEnv ByteString)
instance Show (PrettyTopLevel) where
show = pare... |
class PopulateCartPaymentTransaction
include Interactor
def call
context.transaction.transaction_type = 'cart_payment'
context.transaction.amount = - context.cart.total_price
context.cart.cart_items.each do |ci|
context.transaction.transaction_items.build(
price: ci.unit_price,
q... |
CREATE TABLE sys."Login"
(
id bigint PRIMARY KEY NOT NULL,
"userId" bigint NOT NULL,
type smallint NOT NULL,
date timestamp(6) NOT NULL
);
COMMENT ON COLUMN sys."Login".id IS '唯一标识';
COMMENT ON COLUMN sys."Login"."userId" IS '用户id';
COMMENT ON COLUMN sys."Login".type IS '类型
0-密码登录
1-验证码登录';
COMMENT ON C... |
module WaveSimulator
using Base.Cartesian, ComputationalResources, TiledIteration, ProgressMeter, ValueHistories
export
CPU1,
CPUThreads,
CUDALibs,
UniformWave,
BoxDomain,
Simulator,
simulate,
simulate_gauss,
simulate!,
update!,
toimage
abstract type Domain{N} end
abstra... |
# Xhear 6.0
基于全新的 stanz 7 打造,大幅优化代码,性能更强;
<!-- 重构原因:因Xhear 6 添加 x-fill 特性后,开发风格大幅度往 x-fill 上靠,所以重构向x-fill更友好的风格; -->
<!-- # Xhear 5.0
将基于 stanz 6.0 开发,大幅度优化代码,提高兼容性;
将新增 `:attr` 等模板语法;
将采用 web components 方案封装,相比4.0性能更强,体积更小,使用更容易;
相比 xhear 4.0,优化事件绑定机制;
想要运行 watch编译,请将 stanz 6 放在与项目同一个目录;
# Xhear 4.0
基于新的 sta... |
using System.Collections.Generic;
namespace Akismet.Net
{
/// <summary>
/// Describes a response from Akismet
/// </summary>
public class AkismetResponse
{
/// <summary>
/// Indicates the status of the submitted comment
/// </summary>
public SpamStatus... |
package com.xplusj.factory;
import com.xplusj.ExpressionContext;
import com.xplusj.operator.unary.DefaultExpressionUnaryOperatorFactory;
import com.xplusj.operator.unary.UnaryOperator;
import com.xplusj.operator.unary.UnaryOperatorDefinition;
public interface ExpressionUnaryOperatorFactory {
UnaryOperator create(... |
package b //@diag("", "go list", "import cycle not allowed")
import (
"golang.org/x/tools/internal/lsp/circular/one"
)
func Test1() {
one.Test()
}
|
package com.mmoreno.favmovies.model
import androidx.lifecycle.LiveData
import com.mmoreno.favmovies.app.FavMoviesApplication
import com.mmoreno.favmovies.model.concurrency.ioThread
/**
* Custom class following the repository pattern
* for interacting with the Movie Table
* @author [Mario]
*/
class MovieRepository... |
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
$LOAD_PATH.unshift File.dirname(__FILE__) # NEEDED for rake test:coverage
class ActiveSupport::TestCase
fixtures :all
# def login_as( user=nil )
# uid = ( user.is_a?(User) ) ? user.uid : user
... |
import config from "./config";
import { HttpService } from "./http";
const { app } = new HttpService({
logger: config.debug ? "debug" : "warn",
});
app.listen(+config.port, config.host, err => {
if (err) throw err;
});
|
from smtplib import SMTPException
from django.conf import settings
from django.core.mail import send_mail
from PIL import Image
def send_mail_notify(client_1, client_2):
site_service_email = settings.EMAIL_HOST_USER
message_follower = (
f'Вы понравились {client_2["username"]}! ' +
f'Почта уч... |
/*
Copyright (c) 2020-21 Project re-Isearch and its contributors: See CONTRIBUTORS.
It is made available and licensed under the Apache 2.0 license: see LICENSE
*/
/*@@@
File: dlist.cxx
Version: 1.00
$Revision: 1.2 $
Description: Class DATELIST
Author: Edward Zimmermann edz@nonmonotonic.com
@@@*/
#include <stdlib.h>... |
-- Convert schema './Tapper-Schema-ReportsDB-2.010013-MySQL.sql' to 'Tapper::Schema::ReportsDB v2.010015':
BEGIN;
ALTER TABLE reportfile CHANGE COLUMN filecontent filecontent LONGBLOB NOT NULL DEFAULT '';
ALTER TABLE reportsection CHANGE COLUMN language_description language_description text;
COMMIT;
|
---
'@backstage/plugin-techdocs': patch
---
Handle URLs with a `#hash` correctly when rewriting link URLs.
|
<?php
namespace JTL\Extensions\Upload;
use JTL\DB\ReturnType;
use JTL\Nice;
use JTL\Shop;
use stdClass;
/**
* Class Scheme
* @package JTL\Extensions\Upload
*/
final class Scheme
{
/**
* @var int
*/
public $kUploadSchema;
/**
* @var int
*/
public $kCustomID;
/**
* @va... |
# frozen_string_literal: true
module Paperclip
# This module contains all the methods that are available for interpolation
# in paths and urls. To add your own (or override an existing one), you
# can either open this module and define it, or call the
# Paperclip.interpolates method.
module Interpolations
... |
require 'forwardable'
module Ripgrep
class Client
extend Forwardable
def_delegators Core, :version, :help, :files
def initialize(verbose: false)
@verbose = verbose
end
def exec(*args, opts)
unless opts.is_a? Hash
args << opts
opts = {}
end
verbose = opts... |
## Changelog (Current version: 0.9.3)
-----------------
### 0.9.3 (2018 May 04)
* [630c83b] Prepare for 0.9.3
* [71c1702] proper indentation (#2)
### 0.9.2 (2018 Feb 13)
* [a33d6bd] Prepare for 0.9.2
### 0.9.1 (2018 Feb 12)
* [46c5d38] Prepare for 0.9.1
* [6bfaf25] Merge pull request #1 from bitrise-steplib/viktorb... |
module Test.Util
( module Test.Util
, module Ex
, HC.Address
, T.Text
, BS.ByteString
)
where
import qualified Servant as S
import Control.Monad.IO.Class as Ex
import Data.Word as Ex
import Data.String.Conversions as Ex
import Data.Either as Ex
import Data.Maybe as ... |
import styled from 'styled-components';
import React, { FC } from 'react';
import { Button, CenterButtonText, ButtonProps } from './Buttons';
export const StyledLoginBtn = styled(Button)`
background: ${({ background }: ButtonProps) => background || 'white'};
color: ${({ color }: ButtonProps) => color || 'black'};
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.