text stringlengths 27 775k |
|---|
import { Injectable } from '@angular/core';
import { HttpHeaders, HttpRequest, HttpResponse, HttpErrorResponse } from '@angular/common/http';
import { map, catchError } from 'rxjs/operators';
import { Observable, of, Subject, BehaviorSubject } from 'rxjs';
import { HttpClientService } from './http-client.service';
imp... |
# frozen_string_literal: true
class ApplicationSerializer
def initialize(resource, options = {})
@resource = resource
@options = options || {}
end
def self.serialize(resource, meta = {}, options = {})
new(resource, meta).serializable_hash(options)
end
def self.serialized_attributes
@serial... |
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Services\SendNotification\SmsSendNotification;
use App\User;
use Hash;
class AuthController extends Controller {
protected $sendNotification;
function __construct(SmsSendNotification $sendNotification, User $user) {
$this->sen... |
import IJob from "./IJob";
import IRun from "./IRun";
import ITask from "./ITask";
import { TaskType } from "./ITask";
import Run from "./Run";
import Task from "./Task";
export default class Job implements IJob {
protected id: string;
protected task: ITask;
protected lastRun: IRun;
protected interval... |
ALTER TABLE `task`
DROP COLUMN err_log,
DROP COLUMN out_log;
-- @UNDO
# TBD |
import * as test from 'tape';
import { isNumber } from '../../src/is';
test('isNumber:true', (t) => {
t.true(isNumber(-1));
t.true(isNumber(0));
t.true(isNumber(-0));
t.true(isNumber(1));
t.true(isNumber(Number(-1)));
t.true(isNumber(Number(0)));
t.true(isNumber(Number(-0)));
t.true(isNumber(Number(-1)));
t... |
import { Component, Output, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { EmployeeListAddDialogComponent } from './employee-list-add-dialog/employee-list-add-dialog.component';
import { Employee } from '../../shared/employee.model';
import {MatSort} from '@angular/mate... |
<?php
namespace bbaga\BuildkiteApi\Api\Rest;
interface EmojiInterface
{
public function list(string $organizationSlug): array;
}
|
require 'spec_helper'
describe 'code_on_top_scope' do
describe 'comments outside class block' do
let(:code) { "
# Baz
class foo:bar {
}"
}
its(:problems) { should be_empty }
end
describe 'new lines outside of class-define block' do
let(:code) { "
class foo:bar {
}... |
package Mojolicious::Plugin::Wordpress;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::DOM;
use Mojo::UserAgent;
use Mojo::Util 'trim';
use constant DEBUG => $ENV{MOJO_WORDPRESS_DEBUG} || 0;
our $VERSION = '0.03';
has base_url => 'http://localhost/wp-json'; # Will become a Mojo::URL obj... |
#![allow(non_snake_case)]
// Error messages for EXXXX errors.
// Each message should start and end with a new line, and be wrapped to 80 characters.
// In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use `:set tw=0` to disable.
register_long_diagnostics! {
E0038: r##"
Trait objects like `Box<Trait>` can o... |
package main
import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/big"
. "github.com/filecoin-project/test-vectors/gen/builders"
)
type actorCreationOnTransferParams s... |
<?php
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* This schema validator validates a time interval between two ... |
import { gridDimensions } from '../config/config';
import { window } from './browser';
function getCurrentScreenSize() {
return (
Object.keys(gridDimensions).find(size => {
const { minScreenWidth, maxScreenWidth } = gridDimensions[size];
return (
window.innerWidth >= minScreenWidth &&
... |
package com.lu.platform.app.config;
import android.content.Context;
import java.util.HashMap;
/**
* @Author: luqihua
* @Time: 2018/5/23
* @Description: 用于配置第三方平台的一些参数
*/
public class PlatformConfigurator {
private HashMap<String, Object> configurationMap = new HashMap<>();
private Pl... |
/**
* Entry point for all actions
*
*/
export * from './types'
export * from './discord'
export * from './bot'
export * from './utils'
|
package kpn.core.db
import kpn.core.database.doc.RouteDoc
case class RouteDocViewResultRow(
key: String,
id: Option[String],
value: Option[ViewResultRowValue],
error: Option[String],
doc: Option[RouteDoc]
)
|
package com.charlag.promind.app
import android.content.Context
import android.location.LocationManager
import dagger.Module
import dagger.Provides
import javax.inject.Singleton
/**
* Created by charlag on 25/03/2017.
*/
@Module
class AppModule(private val application: App) {
@Provides
// TODO: add qualifie... |
package blockchain
import (
"github.com/cfromknecht/certcoin/crypto"
"encoding/json"
"log"
)
type TxnType uint8
const (
Generation TxnType = iota
Payment
Register
Update
Revoke
)
type Txn struct {
Type TxnType `json:"txn_type"`
Inputs []Input `json:"inputs"`
Outputs []Output `json:"outputs"`
}
ty... |
#!/usr/bin/env bash
set -e
set -o pipefail
IFS=$'\n'
# run dotfiles
"./directories.sh"
"./templates.sh"
"./macos.sh"
"./brew.sh"
"./oh_my_zsh.sh"
"./dotfiles.sh"
"./preferences.sh"
|
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mvvm_builder/mvvm_builder.dart';
P getMvvmPagePresenter<P extends Presenter, M extends MVVMModel>(WidgetTester tester, Key key) {
var pageFinder = find.byKey(key);
var page = pageFinder.evaluate().first.widget... |
## Salidas de funciones
# En esta lección vamos a explorar las diferentes opciones de salida que podemos
# darle a una función, desde un valor sencillo sin ningún detalle hasta salidas
# listadas más complejas.
v <- 15:25 # Vamos a necesitar un objeto 'v' para los ejemplos.
# Salidas simples
# Si recordamos la lecc... |
import 'dart:io';
import 'package:args/command_runner.dart';
import 'package:codemod/codemod.dart';
import 'package:glob/glob.dart';
import 'package:pubspec_parse/pubspec_parse.dart';
import 'migrate/errors.dart';
import 'migrate/imports.dart';
import 'migrate/notifiers.dart';
import 'migrate/unified_syntax.dart';
im... |
fun main(){
println(compararPalavra("casa","camelo"))
}
fun compararPalavra(wordA:String,wordB:String):Boolean{
return wordA != wordB
} |
import Vue from 'vue'
import dayjs from "~/utils/_dayjs";
Vue.filter('time', stamp => {
const dayOld = dayjs.utc(stamp);
const dayNew = dayjs.utc();
const subDay = dayNew.diff(dayOld, 'day');
const subWeek = dayNew.diff(dayOld, 'week');
const subMonth = dayNew.diff(dayOld, 'month');
const subYear = dayNew.... |
import {Modal} from '@material-ui/core';
import {ReactChild, ReactChildren} from 'react';
import './modal.css';
export interface ModalProps {
children: ReactChild | ReactChildren;
isOpen: boolean;
onClose: any;
}
const MyModal = ({children, isOpen, onClose}: ModalProps) => {
return (
<Modal op... |
# frozen_string_literal: true
module CMSScanner
module Finders
module InterestingFindings
# SearchReplaceDB2 finder
class SearchReplaceDB2 < Finder
# @return [ InterestingFinding ]
def aggressive(_opts = {})
path = 'searchreplacedb2.php'
return unless /by intercon... |
# This file is part of snmpsim software.
#
# Copyright (c) 2010-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/snmpsim/license.html
#
# SNMP Agent Simulator: lightweight SNMP v1/v2c command responder
#
import argparse
import os
import sys
import traceback
from pyasn1 import debug as pyasn1_debu... |
export const obj = {
preventDefault: function () {
var e = this.originalEvent;
this.isDefaultPrevented = returnTrue;
if (!e) {
return;
}
// If preventDefault exists, run it on the original event
if (e.preventDefault) {
e.preventDefault();
... |
namespace Purebyuu
{
public enum CommandType
{
Stitch,
Jump,
Stop,
ColorChange,
SequinMode,
SequinEject,
WilcomEnd,
}
}
|
from husteblume import api
from husteblume.user import User
class Stations(object):
@staticmethod
def fetch():
r = api('get', 'https://api.husteblume-app.de/locations?locationType=STATIONS')
json = r.json()
result = Stations(json=json)
return result
def __init__(self, json... |
package emmy.autodiff
import emmy.autodiff.ContainerOps.Aux
import emmy.distribution.{ Factor, Observation }
trait Visitor[R] {
def visitParameter[U[_], S](o: Parameter[U, S]): R =
visitNode(o)
def visitObservation[U[_], V, S](o: Observation[U, V, S]): R =
visitFactor(o)
def visitContinuousVariable[U... |
Param(
[Parameter(Mandatory=$true)]
$Image,
$DistroName = "ArchLinux"
)
wsl --import ArchLinux C:\wslDistroStorage\ArchLinux $Image
wsl -d $DistroName -e bash -- ./1-arch.sh
wsl --terminate $DistroName
wsl --export $DistroName .\install.tar
& "$env:ProgramFiles\7-Zip\7z.exe" a .\install.tar.gz .\install.ta... |
---
layout: page
title: About me
subtitle: Why you'd want to go on a date with me
---
My name is Wai Yan Win Htain. And I have the following qualities:
- I'm working as DevOps Engineer.
- I love Open Source.
- Contributor of local Linux Community
- Contributor of local DevOps Community
What else do you need?<br>
Jus... |
class HomeController < ApplicationController
def index
@active_top_nav_link = :home
@posts = Post.blog_posts.viewable
render layout: "community"
end
end
|
# Copyright notice:
# Copyright CERN, 2015.
#
# 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 ... |
package EPPlication::Role::Step::Util::DateTime;
use Moose::Role;
use DateTime;
use DateTime::Format::ISO8601;
use DateTime::Format::Strptime;
use DateTime::Format::Duration;
sub parse_datetime {
my ( $self, $value ) = @_;
return DateTime->now(time_zone => 'UTC')
if $value eq 'now()';
my $formatter... |
import Transaction from "#SRC/js/structs/Transaction";
import Batch from "#SRC/js/structs/Batch";
import { ADD_ITEM, REMOVE_ITEM, SET } from "#SRC/js/constants/TransactionTypes";
import * as Residency from "../Residency";
describe("Residency", () => {
describe("#JSONReducer", () => {
it("returns undefined as de... |
require "thor/actions"
require "thor/group"
module Prez
class New < Thor::Group
include Thor::Actions
argument :name, type: :string
def check_file!
if File.exists? filename
raise Prez::Error.new("There is already a presentation file named '#{filename}'")
end
end
def generate... |
#!/usr/bin/env perl
# $Id: fmtutil.pl 56682 2020-10-17 06:08:28Z preining $
# fmtutil - utility to maintain format files.
# (Maintained in TeX Live:Master/texmf-dist/scripts/texlive.)
#
# Copyright 2014-2020 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.... |
# Copyright 2010-present Basho Technologies, 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 a... |
require 'rails_helper'
RSpec.describe Transforms do
let(:expected_transform_count) { 8 }
describe ".names" do
subject { Transforms.names }
it "should return the transforms names" do
is_expected.to be_present
is_expected.to have_attributes(:size => expected_transform_count)
is_expected.to include("iden... |
package com.kneelawk.cmpdl2.net
import org.apache.http.impl.client.CloseableHttpClient
import org.apache.http.impl.client.HttpClients
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager
import tornadofx.Rest
/**
* Sets up TornatoFX's Rest client to use Apache HttpClient.
*/
fun setupRestEngine() {
... |
# Akka Cluster Tests
Basic tests for Akka Cluster and friends on Kubernetes
For each pull requests from this repository (not forks) and commits to master the following happens in travis:
* Docker image is published to https://hub.docker.com/r/kubakka/akka-kubernetes/
* A deployment is triggered to Lightbend's intern... |
Oboj \(\frac{1}{2}\) svih krugova na različite načine:
@vspace@
@center@ @lib.select_objects(4, 3, "circle", "sum(result) == 6", style, solution)@
@center@ @lib.select_objects(4, 3, "circle", "sum(result) == 6", style, solution)@
@center@ @lib.select_objects(4, 3, "circle", "sum(result) == 6", style, solution)@
... |
import os
import logging
import flask
from library.config import config
from flask_cors import CORS
app = flask.Flask(__name__)
# Add logger
script_path = os.path.join(os.path.dirname(__file__), '..')
app_path = os.path.abspath(script_path)
log_path = os.path.join(app_path, 'log')
if not os.path.exists(log_path):
... |
import React from "react"
import Skjaldborgarhatidin from "../pageComponents/Skjaldborgarhatidin"
import Footer from "../layouts/Footer"
const Hatidin = () => {
return (
<>
<Skjaldborgarhatidin></Skjaldborgarhatidin>
<Footer></Footer>
</>
)
}
export default Hatidin
|
{-# LANGUAGE Arrows #-}
{-# LANGUAGE Rank2Types #-}
-- | 'MSF's in the 'ExceptT' monad are monadic stream functions
-- that can throw exceptions,
-- i.e. return an exception value instead of a continuation.
-- This module gives ways to throw exceptions in various ways,
-- and to handle the... |
/*
* Copyright (C) 2016 Richtek Technology Corp.
*
* Author: TH <tsunghan_tsai@richtek.com>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in t... |
# frozen_string_literal: true
require 'rails_helper'
RSpec::Matchers.define :string_excluding do |regex|
match { |actual| (regex =~ actual).blank? }
end
RSpec.describe HacktoberfestProjectFetcher do
describe '#fetch!' do
it 'returns query results in the correct format' do
repo_topic_name = 'hacktoberfe... |
<?php
interface RecursiveIterator extends \Iterator
{
/** @return bool */
public function hasChildren();
/** @return RecursiveIterator */
public function getChildren();
} |
# frozen_string_literal: true
class Document < ActiveRecord::Base
scope :with_error, -> { where(status: :error) }
scope :with_success, -> { where(status: :success) }
scope :type_a, -> { where(doc_type: :a) }
scope :type_b, -> { where(doc_type: :b) }
scope :type_c, -> { where(doc_type: :c)... |
```
RewriteEngine On
RewriteRule ^phpcms/ - [R=404,L]
RewriteRule ^bin/ - [R=404,L]
RewriteRule ^caches/ - [R=404,L]
RewriteRule ^.git/ - [R=404,L]
RewriteRule ^.gitignore - [R=404,L]
RewriteRule ^html/ - [R=404,L]
RewriteRule ^phpsso_server/ - [R=404,L]
``` |
import { Dispatch } from 'redux';
import { IStore } from 'app/istore';
import { notificationActions } from 'app/Notifications';
import { acceptEntitySuggestion } from 'app/MetadataExtraction/SuggestionsAPI';
import { RequestParams } from 'app/utils/RequestParams';
import { EntitySuggestionType } from 'shared/types/sugg... |
Describe "Azure Data Lake Generation 2 Resource Manager Integration" -Tags Integration {
BeforeAll {
# Create test environment
Write-Host "Creating test environment $ResourceGroupName, cleanup..."
# Create a unique ResourceGroup
# `unique` string base on the date
# e.g. 20... |
using System.Numerics;
using Myre.Entities;
using Myre.Entities.Behaviours;
using Myre.Entities.Extensions;
using Myre.Extensions;
using Color = Microsoft.Xna.Framework.Color;
namespace Myre.Graphics.Lighting
{
public class AmbientLight
: Behaviour
{
public static readonly TypedName<Vector3> S... |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
namespace OrLog.Controllers
{
[Route("/")]
public... |
require File.expand_path(File.dirname(__FILE__) + '/../spec/spec_helper')
describe Pickler do
before do
@pickler = Pickler.new(File.dirname(__FILE__))
end
it "should detect the project" do
expect(@pickler.project.name).to eq "Sample Project"
end
end
|
package com.github.gnx.automate.event;
import org.springframework.context.ApplicationEvent;
/**
* Created with IntelliJ IDEA.
* Description:
* @author genx
* @date 2020/3/19 16:28
*/
public interface IEventPublisher {
void publishEvent(ApplicationEvent event);
}
|
#!/usr/bin/env zsh
# View the demo site on any local devices by binding the local IP on port 1315.
# Run this script from the root Academic dir.
HUGO_THEME=academic hugo \
--source exampleSite --themesDir ../../ \
--bind=0.0.0.0 -p 1315 --baseURL=http://0.0.0.0:1315 \
--i18n-warnings --minify -e "development" \... |
require 'spec_helper'
module Bosh::Director
module DeploymentPlan
module Steps
describe DetachInstanceDisksStep do
subject(:step) { DetachInstanceDisksStep.new(instance) }
let(:instance) { Models::Instance.make }
let!(:vm) { Models::Vm.make(instance: instance, active: true, cpi: 'v... |
---
title: "Reserve, A Natual ORM"
layout: post
date: 2016-06-02 22:15
tag: Smalltalk
headerImage: false
projects: true
hidden: true # don't count this post in blog pagination
description: "A Squeak ORM that treats your RDMS like a polymorphic object database"
---
A Squeak ORM that treats your RDMS like a polymorphic o... |
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| ... |
# Build settings for ibm compiler
F90=xlf2003_r
CC=xlc
CFLAGS="-O3"
# Ideally would specify -qlanglvl=2003std but GungHo/src/utils/utils.F90
# won't build with that option :-(
F90FLAGS="-qcheck -g -O0"
#F90FLAGS="-O3"
LDFLAGS=
AR=ar
export F90
export F90FLAGS
export CC
export CFLAGS
export LDFLAGS
export AR
|
import React from "react";
import { Button, Modal } from "reactstrap";
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
import htmlbars from "react-syntax-highlighter/dist/esm/languages/hljs/htmlbars";
import { monokai } from "react-syntax-highlighter/dist/esm/styles/hljs";
SyntaxHighlighter.regi... |
<?php
declare(strict_types=1);
/**
* Copyright (c) 2020 Daniel Bannert
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/narrowspark/exception-inspector
*/
namespace Narrowspark\ExceptionInspector\Contr... |
class Vote < ApplicationRecord
belongs_to :user
belongs_to :article
validates_uniqueness_of :user, scope: :article
validates_presence_of :user_id, :article_id
scope :most_voted_article, lambda {
if Article.all.present? && all.present?
Article.f... |
# Sorting-Visualizer
This sorting visualizer is developed in python using tinkter library.
The sorting algorithms visualized are:
* Selection Sort
* Bubble Sort
* Merge Sort
* Quick Sort
## Technology Stack
* Python
* [tkinter](https://docs.python.org/3/library/tkinter.html)
## Local Installation
1. Drop a ⭐ on th... |
using System;
namespace Decorator.Domain
{
public class Margherita : BasePizza
{
public Margherita()
{
price = 6.99;
}
}
}
|
require_relative '../../lib/application_defs'
class ApplicationController < ActionController::Base
protect_from_forgery
helper :layout
def self.report_error_request_message
"please report this incident on the issue tracker, #{ApplicationDefs::ISSUE_TRACKER}"
end
end
|
#pragma once
#include <iostream>
#include <map>
#include <string>
#include "ins_types.hpp"
#include "x86.hpp"
namespace tana {
enum RegType {
FULL = 0, // eax, ebx, ecx, edx, esi, edi, esp, ebp
HALF = 1, // ax, bx, cx, dx
QHIGH = 2, // ah, bh, ch, dh
QLOW = 3, // al, bl, cl, dl
INVA... |
import { routes, segments, worlds } from "zwift-data";
import { createUrl } from "./createUrl";
const worldLondon = worlds.find((w) => w.slug === "london")!;
const routeLondonLoop = routes.find((r) => r.slug === "london-loop")!;
const segmentBoxHill = segments.find((s) => s.slug === "box-hill")!;
const segmentLondonLo... |
require 'mkmf'
# override normal build configuration to build debug friendly library
# if installed via 'gem install oops-null -- --enable-debug'
if enable_config('debug')
puts '[INFO] enabling debug library build configuration.'
if RUBY_VERSION < '1.9'
$CFLAGS = CONFIG['CFLAGS'].gsub(/\s\-O\d?\s/, ' -O0 ')
... |
/*
* Copyright 2019 Felix Seifert <mail@felix-seifert.com> (https://felix-seifert.com)
*
* 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.... |
---
layout: post
title: "부스트캠프 AI Tech 1주차 필수과제 3"
date: 2021-08-06
excerpt: "Text Processing 2"
tags: [AI_Tech,1주차,AI Math,과제]
comments: true
---
# Assignment 3. Text Processing 2
---
### **개요**
본 과제에서는 이전 과제에 이어서 string 다루는 방법을 학습합니다. 다른 자료구조를 필요시에 사용하시면 됩니다. 본 과제에서 풀어야 할 문제는 아래 2가지가 있습니다.
**함수 리스트**
- `digit... |
import { BigNumber } from 'bignumber.js'
import { LengthTypes, UnitTypes, WeightTypes } from './types'
import { isOfTypeLength, LengthUnit } from './lengths'
import { isOfTypeWeight, WeightUnit } from './weights'
import { BaseUnit } from './baseUnit'
abstract class Unit {
static create(value: BigNumber | number, ki... |
#!/bin/bash
echo "Be sure to start docker.app first"
docker rmi kineticsquid/simple-soe-base:latest
docker build --rm --no-cache --pull -t kineticsquid/simple-soe-base:latest -f Dockerfile-base .
docker push kineticsquid/simple-soe-base:latest
# list the current images
echo "Docker Images..."
docker images |
#include <stdio.h>
#define rows 4
#define cols 10
void printStrings(int n, int len, char list[n][len]);
int main()
{
char m[rows][cols] = {"Oi", "Breno", "Farias", "Adeus"};
printStrings(rows, cols, m);
return 0;
}
void printStrings(int n, int len, char list[n][len])
{
for (int... |
import json
import requests
from rcbu.common.constants import IDENTITY_TOKEN_URL
def authenticate(username, apikey=None, password=None):
assert password or apikey
if apikey:
return _auth(username=username, apikey=apikey)
else:
return _auth(username=username, password=password)
def get... |
module asteroids.systems {
import Animation = asteroids.components.Animation;
import Mapper = artemis.annotations.Mapper;
import ImmutableBag = artemis.utils.ImmutableBag;
import GroupManager = artemis.managers.GroupManager;
import TagManager = artemis.managers.TagManager;
import EntitySystem = artemis.E... |
using System.Collections.Specialized;
namespace ITfoxtec.Identity.Saml2.Http
{
public class HttpRequest
{
/// <summary>
/// Gets or set the HTTP Method.
/// </summary>
public string Method { get; set; }
/// <summary>
/// Gets or set the Raw Query String.
... |
---
layout: post.njk
title: "Temporal-JavaScript's new Date API"
summary: "Finally, a date object an API that makes sense. The upcoming JavaScript temporal API. Here's a write-up from Axel Raushmayer."
thumb: "https://2ality.com/img/deep-js.jpg"
links:
- website: "https://go.raybo.org/4uU_"
category: shorts
tags:
- e... |
# cloud-functions-exporter
Exports Google Cloud Functions with scale in mind.
This package was inspired by a discussion started on Medium:
https://codeburst.io/organizing-your-firebase-cloud-functions-67dc17b3b0da
## Conventions
The purpose is to keep each function source code isolated in its own file to
ease mai... |
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using starsky.feature.geolookup.Interfaces;
using starsky.feature.geolookup.Models;
using starsky.feature.geolookup.Services;
using star... |
#pragma once
#ifdef SYN_PLATFORM_WINDOWS
#ifdef SYN_BUILD_DLL
#define SYN_API __declspec(dllexport)
#else
#define SYN_API __declspec(dllimport)
#endif
#endif |
class User < ActiveRecord::Base
has_many :campaigns
has_many :donations
before_save { self.mail = mail.downcase }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
attr_accessible :firstname, :lastname, :mail, :password, :password_confirmation, :money
validates :mail, presence: true,
... |
import { Express } from 'express'
import catalog from '../../routes/catalog'
import dashboard from '../../routes/dashboard'
import house from '../../routes/house'
import image from '../../routes/image'
import index from '../../routes/index'
import login from '../../routes/login'
// Functions
const configure = (app: Ex... |
# map
list_x = [1,2,3,4,5]
def square(x):
return x * x
# list_y = map(square, list_x)
list_y = map(lambda x: x * x, list_x)
print(list_y) # <map object at 0x101fcc4d0>
print(list(list_y)) # [1, 4, 9, 16, 25]
|
// Copyright 2013 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.
#ifndef CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_ENCODE_ACCELERATOR_H_
#define CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_ENCODE_ACCELERATOR_H_
#include <list>
#... |
#!/usr/bin/env node
const { join } = require('path');
const dllPath = join(__dirname, '../dotnet/PrincipleStudios.OpenApiCodegen.Client.TypeScript.dll');
const [,, ...args] = process.argv;
require("child_process").
spawn( `dotnet`, [dllPath, ...args] , {
argv0:"dotnet" , stdio :'inherit'
}).on('close' , code... |
using System.Linq;
namespace GraphQL.Conventions.Types.Descriptors.Extensions
{
public static class DescriptorExtensions
{
public static bool HasField(this GraphTypeInfo typeInfo, string fieldName) =>
typeInfo.Fields.Any(field => field.Name == fieldName);
}
}
|
using MessagePack.Resolvers;
using Xunit;
namespace MessagePack.Altseed2.Tests.Utils
{
public class ResolverFixture
{
public ResolverFixture()
{
var resolver = CompositeResolver.Create(
Altseed2Resolver.Instance,
StandardResolver.Instance
... |
import React from 'react'
import {
ACCEPTED_UPLOAD_IMAGE_TYPES,
COLOR,
UPLOAD_IMAGE_SIZE_LIMIT,
} from '../../enums/common'
import { Texts } from '../../enums/text'
import SVGSpinner from '../../icons/Spinner'
import SVGToolbarUploadImage from '../../icons/ToolbarUploadImage'
/**
* This component is a image up... |
package Bank;
public class MainApplication {
String customerName;
Double billAmount;
String fundName;
Double newTotal;
public void getCustomerInfo(){}
public void printConsole(){}
public boolean transferYorN(){
return false;
}
}
|
import org.scalatest._
import GameOfLife.{Grid,Cell,Alive,Dead}
class NeighboursSpec extends FlatSpec with Matchers {
val grid4x4 = Grid(4, 4, Set[Cell](
Cell(0,0,Dead), Cell(1,0,Dead), Cell(2,0,Dead), Cell(3,0,Dead),
Cell(0,1,Dead), Cell(1,1,Dead), Cell(2,1,Dead), Cell(3,1,Dead),
Cell(0,2,Dead), Cell(... |
//
// NSStringAttributes.cs: strongly typed AppKit-specific NSAttributedString attributes
//
// Authors:
// Aaron Bockover (abock@xamarin.com)
//
// Copyright 2013 Xamarin Inc
#if !__MACCATALYST__
using System;
using ObjCRuntime;
using CoreFoundation;
using Foundation;
namespace AppKit
{
public partial class NSS... |
#include "ASTtoXMLVisitor.h"
ASTtoXMLVisitor::ASTtoXMLVisitor() {
// when the ASTtoXMLVisitor is initialised, set the indentation to no indentation at all
indentation = "";
}
void ASTtoXMLVisitor::indent() {
// add another tab (\t) to the indentation string
indentation += "\t";
}
void ASTtoXMLVisitor... |
---
id: 587d8254367417b2b2512c71
title: Remove items from a set in ES6
challengeType: 1
forumTopicId: 301713
dashedName: remove-items-from-a-set-in-es6
---
# --description--
Let's practice removing items from an ES6 Set using the `delete` method.
First, create an ES6 Set:
```js
var set = new Set([1,2,3]);
```
Now ... |
#!/bin/bash
ep /usr/local/etc/php/php.ini
ep /usr/local/etc/php-fpm.conf
ep /usr/local/etc/php-fpm.d/* |
CREATE TABLE IF NOT EXISTS raw_daily_data (
id SERIAL,
ts TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
rec_dt DATE NOT NULL,
rec_territory TEXT NOT NULL,
rec_value NUMERIC,
CONSTRAINT unique_entry UNIQUE(rec_dt, rec_territory, rec_value)
)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.