text stringlengths 27 775k |
|---|
package com.flickr4java.flickr.places;
import java.util.ArrayList;
public class ShapeDataList<E> extends ArrayList<ShapeData>{
/**
*
*/
private static final long serialVersionUID = 3405746186476466870L;
private int total;
private String woeId;
private String placeId;
private String placeType;
private i... |
package quickcheck
import common._
import org.scalacheck._
import Arbitrary._
import Gen._
import Prop._
abstract class QuickCheckHeap extends Properties("Heap") with IntHeap {
lazy val genHeap: Gen[H] = oneOf(
const(empty),
for {
k <- arbitrary[A]
h <- frequency(1 -> const(empty), 9 -> genHea... |
import {
BaseEntity,
Check,
Column,
Entity,
ManyToOne,
PrimaryGeneratedColumn,
} from "typeorm";
import { Lazy } from "../types/query";
import { Room } from "./room";
import { Field, Int, ObjectType } from "type-graphql";
import { IsoDay } from "../../types/day";
import { checkFieldValueInEnum }... |
package hblade
import "strings"
// controlFlow tells the main loop what it should do next.
type controlFlow int
// controlFlow values.
const (
controlStop controlFlow = 0
controlBegin controlFlow = 1
controlNext controlFlow = 2
)
// dataType specifies which type of data we are going to save for each node.
type... |
package gr.blackswamp.damagereports.logic.vms
import android.app.Application
import gr.blackswamp.core.vms.CoreViewModel
import gr.blackswamp.damagereports.logic.interfaces.DamageViewModel
class DamageViewModelImpl(app: Application) : CoreViewModel(app), DamageViewModel |
function mode(list) {
const objectList= {};
list.map(
//The list.map allows me to go throught all the array
//and the function that i use in the inside fills the object that is going
//to have all the diferents elements
function (elementOfArray) {
if (objectList[elementOfArray]) {
... |
using AutomationTestSetFramework;
using System;
using System.Collections.Generic;
using System.Text;
using static AutomationTestSetFramework.IMethodBoundaryAspect;
namespace AutomationTestSetFrameworkNUnit
{
public class FakeTestSet : ITestSet
{
public bool ShouldExecuteVariable { get; set; } = true;
... |
#! /bin/bash
PJHOME=/Users/feiyu/workspace/SparkPlayground/Scala/
SPARKHOME=/Users/feiyu/workspace/sparkOrg/spark-1.3.0-bin-hadoop2.4/
cd $PJHOME
${SPARKHOME}bin/spark-submit --driver-memory 2g --class com.feiyu.util.SimpleApp target/scala-2.11/scala_2.11-1.0.jar
|
<?php
namespace App\Http\Livewire\Admin;
use App\Models\Attendent;
use Livewire\Component;
use Livewire\WithPagination;
class AdminAttendentComponent extends Component
{
use WithPagination;
public function render()
{
$leave=Attendent::paginate(10);
return view('livewire.admin.admin-attend... |
package com.arkivanov.decompose.value
import com.arkivanov.decompose.lifecycle.Lifecycle
import com.arkivanov.decompose.lifecycle.subscribe
import kotlin.reflect.KProperty
operator fun <T : Any> Value<T>.getValue(thisRef: Any?, property: KProperty<*>): T = value
fun <T : Any> Value<T>.observe(
lifecycle: Lifecyc... |
// Copyright 2020 BlueCat Networks. All rights reserved
package entities
import "fmt"
// Block IPv4 Block entity
type Block struct {
BAMBase `json:"-"`
Configuration string `json:"-"`
ParentBlock string `json:"-"`
Name string `json:"name"`
Address string `json:"address"`
CIDR st... |
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:route_app/core/models/response_model.dart';
import 'package:route_app/core/services/interfaces/http.dart';
enum Method { get, post, put, delete, patch }
class Call {
Call(this.method, this.url, [this.body]);
final Method method;
fin... |
"use strict";
var _dosCommonJs = _interopRequireDefault(require("dos-common-js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* 引数のアイテムを削除
*/
_dosCommonJs.default.extendMethod(Array, "removeAt", function (item) {
return this.filter(v => {
return item !... |
require 'spec_helper'
describe AttachmentUploader do
let(:issue) { build(:issue) }
subject { described_class.new(issue) }
describe '#move_to_cache' do
it 'is true' do
expect(subject.move_to_cache).to eq(true)
end
end
describe '#move_to_store' do
it 'is true' do
expect(subject.move_t... |
package pw.cdmi.protocol.cap;
public class SimplePacketHeaderFormat extends SimpleCapProtocolFormat {
public SimplePacketHeaderFormat(String pattern) {
super(pattern);
}
}
|
package io.quarkus.it.mongodb.panache.bugs
class NeedReflection {
var comment: String? = null
} |
package io.muun.apollo.domain.libwallet.errors
import io.muun.apollo.domain.errors.MuunError
class LibwalletVerificationError(cause: Throwable):
MuunError("Libwallet rejected the transaction during verification", cause)
|
from django.test import TestCase
from v1.models import (
BlogPage, EventPage, HomePage, NewsroomPage, SublandingFilterablePage
)
class TestHomePage(TestCase):
def setUp(self):
self.home_page = HomePage.objects.get(slug='cfgov')
# Set up a root for updates
self.updates_page = Subland... |
<div class="container">
<div class="card card-login mx-auto mt-5">
<div class="card-header text-center">Login</div>
<div class="card-body">
<?php if( $this->session->has_userdata('auth_message') ): ?>
<?php $message = $this->session->flashdata('auth_message'); ?>
<div class="alert alert-<?= $messag... |
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="{{ URL::asset('lib/jquery-3.2.1.js') }}"></script>
<script src="{{ URL::asset('js/carrega_disciplinas.js') }}"> </script>
<script src="{{ URL::asset('js/modal_horarios.js') }}"> </script>
<link rel="stylesheet" ... |
import 'package:flashcards/domain/interfaces/category.repository.dart';
import 'package:flashcards/domain/models/category.dart';
class DeleteCategoryUseCase {
final ICategoryRepository categoryRepository;
DeleteCategoryUseCase({
required this.categoryRepository,
});
Future<Category> call(Category tag) as... |
module PayWithMe
module Models
class Transfer < Response
def self.define_attr_methods_for(attribute)
self.class_eval <<-METHOD, __FILE__, __LINE__ + 1
def #{ attribute }!(value) # def payer_account(value)
@#{ attribute } = value # @payer_account = value
... |
// 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.
package swarming
import (
"infra/libs/skylab/inventory"
)
func init() {
converters = append(converters, poolsConverter)
converters = append(conver... |
#!/usr/bin/env bash
# Se mettre dans le répertoire d'output
# Lancer: "bash /chemin/du/script/dl_sirene.sh 71 25 21 etc.
# Pour télécharger et fusionner les fichiers des départements concernés
echo "$*"
for dep in "$@"
do
wget "http://data.cquest.org/geo_sirene/v2019/2019-06/dep/geo_siret_${dep}.csv.gz"
gzip -d "g... |
/**
A Transition takes the enter, exit and resolve states and normalizes
them:
* takes any passed in contexts into consideration
* adds in `initialState`s
@class Transition
@private
*/
export default class Transition {
constructor(raw) {
this.enterStates = raw.enterStates.slice();
this.exitState... |
package update
import (
"fmt"
"io/ioutil"
)
type channelSource int
const (
csCommandLine channelSource = iota
csChannelFile channelSource = iota
csDefault channelSource = iota
)
const defaultChannel string = "soul3"
var channelFilePath = "/etc/protonet/system/channel"
func getChannel(commandLineChannel s... |
//
// Created by 86759 on 2022-01-14.
//
#include "SystemAddressRegister.h"
#include <cstring>
uint64_t SystemAddressRegister::GDTR_r = 0;
uint64_t SystemAddressRegister::IDTR_r = 0;
//uint64_t SystemAddressRegister::LDTR_r = 0;
uint32_t* SystemAddressRegister::GDT = nullptr;
uint32_t* SystemAddressRegis... |
# Sample IPC for LIMS Messenger
This is a sample project that demonstrates the use IPC - Inter Portlet Communication used in
[LIMS Messenger for Liferay](http://marcelmika.com/lims).
If you want to build the project insert it into portlets folder in liferay plugins repository.
For more info visit: [https://github.co... |
package Compiladores.MiniPascal.Tokens;
import Compiladores.CompilerBase.*;
import Compiladores.MiniPascal.*;
public class Token extends AbstractToken {
protected Token(AbstractTag tag) {
super(tag);
}
public static Token
// DEF = new Token(Tag.vt_0), // ::=
// PT = n... |
package kr.co.bootpay.model;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import kr.co.bootpay.enums.PushType;
public class SMSPayload {
private final int REMOTE_ORDER_TYPE_FORM = 1;
private final int REMOTE_ORDER_TYPE_PRE = 2;
private String... |
#/bin/bash
export HOME=/home/sigvisa
source /home/sigvisa/.bash_profile
source /home/sigvisa/.virtualenvs/sigvisa/bin/activate
cd $SIGVISA_HOME
python $@
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// this contains the data of a single traversal to another <see cref="Tile"/>
/// </summary>
public class Traversal {
public TraversalType Type;
public Tile TileFrom;
public Tile TileTo;
public int Cost;
... |
require 'test_helper'
class Sword < Asha::Model
attribute :title
attribute :description
set :abilities
set :owners do |e|
e.sorted = true
end
end
class Ability < Asha::Model
attribute :name
end
class Owner < Asha::Model
attribute :name
end
describe Asha::Set do
let(:params) do
{tit... |
-- chadd williams
SELECT *
FROM Professors LEFT JOIN CurrentlyTeaching
ON (Professors.ProfID = CurrentlyTeaching.ProfID)
WHERE CourseID is NULL;
SELECT *
FROM Professors, CurrentlyTeaching
WHERE (Professors.ProfID = CurrentlyTeaching.ProfID);
-- find all the course people are IN
-- exclude bart
Select People.FNam... |
## Problem Statement
Create class Associate with below attributes:
id - int
name - String
technology - String
experienceInYears - int
Create class Solution and implement static method "associatesForGivenTechnology" in the Solution class.
This method will take array of Associate objects and a searchTechnology String a... |
package com.hunabsys.gamezone.services.rest
import android.content.Context
import android.util.Log
import com.hunabsys.gamezone.R
import com.hunabsys.gamezone.services.delegates.IEvidenceDelegate
import com.hunabsys.gamezone.services.delegates.IHttpClientDelegate
import com.hunabsys.gamezone.services.mappers.Evidences... |
<?php
/*
* MIT License
*
* Copyright (c) 2017 Deasil Works, Inc
*
* 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 us... |
using System;
namespace UnityHeapDumper
{
public class ArrayFieldData : IFieldData
{
private static NullInstanceData nullInstanceData = new NullInstanceData();
private IInstanceData instanceData;
private int index;
public ArrayFieldData(IDumpContext dumpContext, Array parent,... |
package display
import (
"github.com/wdevore/Ranger-Go-IGE/api"
"github.com/wdevore/Ranger-Go-IGE/engine/maths"
)
// Projection provides an orthographic projection
type Projection struct {
near, far float32
left, right, bottom, top float32
Width, Height float32
ratioCorrection ... |
import Data.List
import Control.Monad
import Data.Maybe
import System.Random
data SM s a = SM (s -> (s, a))
instance Functor (SM s) where
fmap f (SM a) = SM $ \s -> let (s', a') = a s in (s', f a')
instance Applicative (SM s) where
pure a = SM (\s -> (s,a))
SM f <*> (SM a) = SM $ \s ->
let (s',f') = f s
... |
package lc
// Time: O(n)
// Benchmark: 0ms 2.1mb | 100%
func tribonacci(n int) int {
seq := []int{0, 1, 1}
if n <= 2 {
return seq[n]
}
for i := 2; i < n; i++ {
seq[0], seq[1], seq[2] = seq[1], seq[2], seq[0]+seq[1]+seq[2]
}
return seq[2]
}
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Specific Screen Saver -- Eyes
FILE: eyes.asm
AUTHOR: Mark Hirayama, July 23, 1993
REVISION HISTORY:
Name Date Description
---- ---- ----... |
module Soumu.Main where
import Codec.Xlsx
import qualified Codec.Xlsx as Xlsx
import Control.Lens
import Control.Monad.Except (ExceptT (..), runExceptT, throwError)
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (ToJSON)
import qualified Data.ByteString.Lazy as ByteString
import Data.Maybe (catMaybes)
import... |
export interface IToken {
subject: string;
payload: ITokenPayload;
iat: Date;
exp: Date;
}
export interface ITokenPayload {
id: string;
firstName: string;
lastName: string;
email: string;
}
|
const math = require("math-expression-evaluator");
const Discord = require("discord.js");
module.exports = {
name: "calculate",
run: (client, message, args) => {
if (args.length < 1) return message.channel.send("Please input an equation")
const q = args.join(" ");
let answer;
... |
import 'dart:convert';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:taste/taste_backend_client/backend.dart';
import 'package:taste/utils/extensions.dart';
import 'package:taste/utils/memoize.dart';
import 'package:taste_protos/taste_protos.dart' as $pb;
mixin TasteNotificationMixin implemen... |
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace InteropSample
{
partial class InteropTest
{
public InteropTest()
{
//DLLHelper.EnsureDLL();
}
public InteropTest Test()
{
Console.WriteLine("GetVersion:" + GetVersi... |
---
layout: page
title: About
permalink: /about/
---
I am currently a computer science student at the Southern University of Denmark.
### Interests
- Algorithms and data structures
- Online optimization
- Getting things to run fast
- Mathematics related to computer science
### Email:
Feel free to email me questions,... |
import React from "react"
import { storiesOf } from "@storybook/react"
import { LUButton } from "./button"
const handleClick = () => {
alert("Hi, I'm LUButton")
}
storiesOf("LUButton", module)
.add("Simple button", () => (
<LUButton label="LUButton" onClick={handleClick} />
))
.add("LU app style button", ... |
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/opencv.hpp>
#include <iostream> // std::cout
#include <string> // std::string, std::to_string
using namespace cv;
using namespace std;
int main(int argc, char *argv[])
{
if (argc != 2)
std::cout << "Usage is grayImage.exe <image_file... |
// See LICENSE for license details.
package chiseltest.tests
import chisel3._
import chiseltest._
import chiseltest.experimental.TestOptionBuilder._
import chiseltest.internal.VerilatorBackendAnnotation
import firrtl.AnnotationSeq
import org.scalatest._
/**
* circuit that illustrates usage of async register
* @p... |
exports.stripHtml = function(html)
{
return html.replace(/<(?:.|\n)*?>/gm, '');
};
|
use sled::{IVec, Iter};
#[derive(Debug, Clone)]
pub struct InnerTree {
pub tree: sled::Tree,
}
impl InnerTree {
/// Get a value from the DB tree.
pub fn get<K: AsRef<[u8]>>(&self, key: K) -> Option<IVec> {
self.tree.get(key).unwrap()
}
/// Set a value in the DB tree.
pub fn set<K, V>(... |
module Y2017.D03 where
{- |
--- Day 3: Spiral Memory ---
You come across an experimental new kind of memory stored on an infinite
two-dimensional grid.
Each square on the grid is allocated in a spiral pattern starting at a location
marked 1 and then counting up while spiraling outward. For example, the first
few sq... |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Register;
class LoginController extends Controller
{
function registeration(Request $req){
$register = new Register;
$register->name = $req->name;
$register->email = $req->email;
$register->pass... |
module Hexagonly
class Point
# Adds Point methods to an object. Any Point bears x and y coordinates,
# returned by the #x and #y methods. You can either override these methods
# to output your desired coordinates or you can map coordinate readers to
# different method names by using the #x_y_coord_m... |
from markupsafe import Markup
from viewdom.h import Context, use_context, html, render
def functional_component(children, header="Functional components!"):
message = use_context("message")
return html("""
<h2>{header}</h2>
<span>{message}</span>
{children}
""")
def test_render_c... |
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema acompanha... |
var express = require('express');
var router = express.Router();
var db = require('../../config/db');
router.use('/api/users', require('./users'));
router.use('/api/events', require('./events'));
// route to handle all angular requests
router.get('/', function(req, res) {
// res.sendFile('./public/index.html... |
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
namespace Combinator
{
public static class CombinationProvider
{
public static IEnumerable<ICombination<T>> Combine<T>(
IEnumerable<T> nodes,
Func<T, double> valueSelector,
... |
using SharpDebug.Engine.Utility;
using DbgEng;
using System;
namespace SharpDebug.Engine.Debuggers.DbgEngDllHelpers
{
/// <summary>
/// Helper class for replacing debugger output callbacks - used when capturing command output. Example usage:
/// <para>using (var switcher = new OutputCallbacksSwitcher(outp... |
using StorageProviders.Abstractions.Models;
using System;
using UserManagement.Abstractions.Models;
namespace UserManagement.EntityResolvers
{
public class ProjectEntityResolver : IEntityResolver<ProjectTableEntity, Project>
{
public Project ToTargetType(ProjectTableEntity tableEntity)
{
... |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... |
# What is this?
`tailwindcss-class-combiner` is a simple utility for combining and overriding class names
in React components. On top of that, it also allows you to override existing Tailwind
CSS classes in the component.
# Installation
This utility can be installed using npm:
`npm i @robit-dev/tailwindcss-class-com... |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2
{
/// <summary>
/// Smb2Consts contains the const variable used by sdk
/// </summary... |
{% for lint in site.data.linter_rules %}
{% if lint.group == include.type %}
### {{lint.name}}
{{lint.description}}
{% if lint.maturity != "stable" %}
_This rule is currently **{{lint.maturity}}**._
{% endif %}
{% if lint.sets != empty %}
{% assign rule_sets = "" %}
{% for set in lint.sets %}
{% if set == "core... |
{ *********************************************************************************** }
{ * CryptoLib Library * }
{ * Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe * }
{ * Github Repository <https://github.co... |
using System.Collections.Generic;
using System.Threading.Tasks;
using RabbitMqHttpApiClient.Models.DefinitionModel;
using RabbitMqHttpApiClient.Utils;
using VirtualHost = RabbitMqHttpApiClient.Models.VirtualHostModel.VirtualHost;
namespace RabbitMqHttpApiClient.API
{
public partial class RabbitMqApi//.VirtualHost... |
<?php
namespace App\Http\Controllers\User\Upload;
use Exception;
class OutputFile
{
/**
* convert_utf8
* 文字コードをSISJIS→UTF8に変換する。
* @param Array csvAry
* @return Array cscAry
*
*/
public function convert_utf8(Array $csvAry){
//配列をカンマ区切りの文字列に変換
//$csv_line = implode(',', array_values($format_line));... |
use std::io::Read;
pub fn read_i16<R: Read>(mut reader: R) -> std::io::Result<i16> {
let mut buf = 0_i16.to_le_bytes();
reader.read_exact(&mut buf)?;
Ok(i16::from_le_bytes(buf))
}
pub fn read_i32<R: Read>(mut reader: R) -> std::io::Result<i32> {
let mut buf = 0_i32.to_le_bytes();
reader.read_exact... |
@testset "E" begin
@testset "edlimb" begin
viewpt = [2.0, 0.0, 0.0]
limb = edlimb(sqrt(2), 2.0 * sqrt(2), sqrt(2), viewpt)
expected_sminor = [0.0, 0.0, -1.0]
expected_smajor = [0.0, 2.0, 0.0]
expected_center = [1.0, 0.0, 0.0]
@test center(limb) ≈ expected_center
... |
package metrics
import (
"context"
"time"
"github.com/prometheus/client_golang/prometheus"
log "github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
... |
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Auth;
use App\Corporation;
use Illuminate\Http\Request;
class CorporationController extends Controller
{
public function admin()
{
$corporations = Corporation::all();
return view('corporations.admin', ['corporations' => ... |
; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
@var32 = global i32 0
@var64 = global i64 0
define void @test_lsl_arith(i32 %lhs32, i32 %rhs32, i64 %lhs64, i64 %rhs64) {
; CHECK-LABEL: test_lsl_arith:
%rhs1 = load volatile i32* @var32
%shift1 = shl i32 %rhs1, 18
%val1 = add... |
namespace Umbraco.Core.Models
{
public class ContentDataIntegrityReportEntry
{
public ContentDataIntegrityReportEntry(ContentDataIntegrityReport.IssueType issueType)
{
IssueType = issueType;
}
public ContentDataIntegrityReport.IssueType IssueType { get; }
pu... |
(ns gooreplacer.option.table
(:require [gooreplacer.common.i18n :as i18n]))
(def pagination {:show-size-changer true
:page-size-options ["5" "10" "20"]
:show-total i18n/tmpl-pagination})
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.IO;
namespace LocalisationAnalyser.Abstractions.IO.Default
{
internal class DefaultFileInfo : IFileInfo
{
public DefaultFileInfo(IFileSystem... |
package bin.gstalker.ring;
import android.util.Log;
import dalvik.system.BaseDexClassLoader;
public class ClassFinder {
private static Boolean ACTIVATE = false;
public static void setActivate(Boolean value){
ACTIVATE = value;
}
public static Class findClass(String name) throws ClassNotFound... |
* [Home](/)
* [Java](java/README.md)
* [FRC](frc/README.md)
* [Basics](frc/1-Basics/README.md)
* [Sensors and Shuffleboard](frc/2-Sensors_And_Shuffleboard/README.md)
* [Closed Loop Control](frc/3-Closed_Loop_Control/README.md)
* [Autonomous](frc/4-Autonomous/README.md)
* [Advanced & Misc.](frc/5-Advanc... |
class User < ApplicationRecord
has_secure_password
has_many :foods, dependent: :destroy
validates :username, length: { in: 3..32 }, presence: true
validates :password, length: { minimum: 8 }
validates_presence_of :email
validates_uniqueness_of :email, :username
before_save { username.downcase! }
end
|
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.transferobject.base.example.persistence;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import net.sf.mmm.util.entity.api.Persi... |
class UploadedFile < ApplicationRecord
belongs_to :allowsUpload, polymorphic: true
belongs_to :author, class_name: :User
def self.student_files
@files = []
all.each do |file|
if file.author.is_student
@files << file
end
end
@files
end
def self.lecturer_files
@files =... |
---
title: "Learning Task based parallelism"
teaching: 0
exercises: 10
questions:
objectives:
- Learn to implement nested parallelism with tasks
keypoints:
- Learn how to look at the code from a `task` perspective
- Learn how to implement nested parallelism
- Learn how to manage threads in nested parallelism
---
### O... |
export default function(seconds) {
// calculate Hours, Minutes, and Seconds
let hours = Math.floor(seconds / 3600);
seconds %= 3600;
let minutes = Math.floor(seconds / 60);
seconds %= 60;
return (
hours +
(hours == 1 ? ' hour, ' : ' hours, ') +
minutes +
(minutes == 1 ? ' minute, ' : ' minu... |
package org.kryptonmc.krypton.auth
import kotlinx.serialization.Serializable
@Serializable
data class ProfileProperty(
val name: String,
val value: String,
val signature: String
) |
package com.zoomcar.uikit.performancemeter
import android.content.Context
import android.graphics.Canvas
import android.graphics.CornerPathEffect
import android.graphics.Paint
import android.graphics.Path
import android.graphics.drawable.Drawable
import android.os.Build
import android.util.AttributeSet
import android.... |
#!/bin/bash
set -euo pipefail
. assert.inc.sh
run_suite() {
# single argument
assert_grep '7' '=> 7'
assert_grep '-5' '=> -5'
# single operation
assert_grep '1 2 +' '=> 3'
assert_grep '1 2 -' '=> -1'
assert_grep '1 2 *' '=> 2'
assert_grep '1 2 /' '=> 0'
assert_grep '2 1 /' '=> 2'
assert_grep '-1... |
# Introduction to Zend\\Dom
The `Zend\Dom` component provides tools for working with *DOM* documents and structures. Currently,
we offer `Zend\Dom\Query`, which provides a unified interface for querying *DOM* documents utilizing
both XPath and *CSS* selectors.
|
<?php
$config2 = include($_SERVER["DOCUMENT_ROOT"] . "/Common/siteConfig.php");
$conn = MYSQL_CONNECT($config2["DB_HOST"], $config2["DB_USER"], $config2["DB_PWD"]) OR DIE("连接数据库失败");
mysql_select_db($config2["DB_NAME"], $conn) or die("不能选择数据库");
mysql_query("SET NAMES UTF8");
?>
|
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Medium, type: :model do
it 'has a valid factory' do
expect(FactoryBot.build(:valid_medium)).to be_valid
end
# test validations - INCOMPLETE
it 'is invalid without a sort' do
medium = FactoryBot.build(:medium, sort: nil)
expect(m... |
(GL::AB-SUM)
(GL::AB-ALL-EQUAL)
(GL::AUTO-BIND-LEN)
(GL::AUTO-BIND-XLATE)
(GL::AUTO-BIND-GENERATE)
(GL::AUTO-BIND-SKIPS)
(GL::AUTO-BIND-INDEX-MAP)
(GL::AUTO-BIND-REMAP-INDICES-LIST)
(GL::AUTO-BIND-REMAP-INDICES-TABLE)
(GL::FLEX-BINDINGS-APPEND-AUTO-VARS)
(GL::FLEX-BINDINGS-ARRANGE1)
(GL::FLEX-BINDINGS-ARRANGE)
(GL::AUT... |
package service
import (
"fmt"
"net/http"
"go.uber.org/zap"
"github.com/tohjustin/aegis/pkg/badge"
"github.com/tohjustin/aegis/service/config"
)
type staticService struct {
name string
config *config.Config
logger *zap.Logger
}
// NewStaticService returns a HTTP handler for the static badge service
func ... |
/* New BSD License
-------------------------------------------------------------------------------
Copyright (c) 2006-2012, EntitySpaces, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redis... |
part of 'sync_text_field_bloc.dart';
class SyncTextFieldState {
const SyncTextFieldState({
@required this.fullName,
@required this.firstName,
@required this.lastName,
@required this.status,
});
final FullName? fullName;
final FirstName? firstName;
final LastName? lastName;
final FormzStat... |
using BenchmarkTools
using Printf
using Transducers
#### Types
struct Group
records::Array{Set{Char}, 1}
end
function questionsWithYesAnswers(group::Group)
reduce(union, group.records; init = Set{Char}())
end
function questionsEveryoneAnsweredYesTo(group::Group)
reduce(intersect, group.records; init = S... |
package at.shockbytes.dante.ui.viewmodel
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import at.shockbytes.dante.core.image.picker.ImagePicking
import at.shockbytes.dante.core.login.AuthenticationSource
import at.shockbytes.dante.core.login.... |
package de.otto.flummi.request;
import de.otto.flummi.RequestBuilderUtil;
import de.otto.flummi.util.HttpClientWrapper;
import org.asynchttpclient.Response;
import java.util.concurrent.ExecutionException;
import java.util.stream.Stream;
import static de.otto.flummi.request.RequestConstants.APPL_JSON;
import static d... |
cor = import('./cor')$cor
enrichment = import('./enrichment')$enrichment
frequencies = import('./frequencies')$frequencies
transitions = import('./transitions')$transitions
|
# coding=utf-8
# @Time : 2020/12/29 14:10
# @Auto : zzf-jeff
import torch
import torch.nn as nn
import torch.optim as optim
from torchtext.datasets import TranslationDataset, Multi30k
from torchtext.data import Field, BucketIterator
import spacy
import random
import math
import time
# 设定SEED,让之后随机... |
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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/li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.