text stringlengths 1 1.05M |
|---|
#!/bin/bash
# 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"); y... |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... |
#!/bin/bash
# Copyright 2014 Google Inc. All rights reserved.
#
# 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 applic... |
class UserModel {
// Other methods and properties
public function setDelete() {
// Implement the logic to delete the user details
// For example, using a database query or API call
// Return true if deletion is successful, false otherwise
// Example:
// if ($this->delete... |
<gh_stars>1-10
var util = require('util');
var EventEmitter = require('events').EventEmitter;
var requestHandler = require('dvp-ardscommon/RequestHandler.js');
var dbConn = require('dvp-dbmodels');
var messageFormatter = require('dvp-common/CommonMessageGenerator/ClientMessageJsonFormatter.js');
var logger = require('... |
#!/bin/bash
./build_ui.sh
./start_ui.sh
docker container logs --follow streamtagger_ui
|
<filename>app/controllers/admin/topics_controller.rb
class Admin::TopicsController < Admin::BaseController
before_action :set_topic, only: [:show, :edit, :update, :destroy]
def index
@topics = Topic.order(id: :desc).page(params[:page])
end
def show
end
def new
@topic = Topic.new
end
def crea... |
import math
# Faster loop implementation
def fast_loop(num):
result = 1
for i in range(int(num)):
result += math.sqrt(i*i + 1)
return result |
// Text parser to identify embedded IP addresses
string input = "172.16.254.1";
string pattern = @"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"; // Regex to match an IP address
Match match = Regex.Match(input, pattern);
if (match.Success)
{
Console.WriteLine("IP address embedded in text.");
} |
/*
* Copyright © 2020 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated... |
module.exports = [{
"layout": "./charts.hbs",
"filename": "./zoom_line.html",
"data": {
"title": "Zoom Line Chart",
"type": "zoom_line"
}
},{
"layout": "./charts.hbs",
"filename": "./zoom_line_multi.html",
"data": {
"title": "Zoom Line Multi Chart",
"type": "zoom_line_multi"
}
},{
"lay... |
#!/bin/sh
java -Dfile.encoding=UTF-8 -Xmx8G -jar /opt/spotlight/dbpedia-spotlight-1.0.0.jar /opt/spotlight/pt http://0.0.0.0:80/rest
|
import { Injectable } from '@angular/core';
import { Observable, of, throwError } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
import { Contact } from '../models/contact';
import { AuthService } from './auth.service';
import { HttpClient, HttpHeaders } from '@angular/common/http';
@Injectable({
pro... |
java -jar ./build/historyvalidation.jar -g ./config/ProtegeHistoryQA.properties -p file:///URI_of_previous_Thesaurus -u file:///URI_of_current_Thesaurus -c file:///URI_of_concept_history -e file:///URI_of_evs_history -o file:///URI_of_output_file |
<filename>lib/stak.rb
require 'stak/version'
require 'stak/helper'
require 'stak/router'
require 'stak/config'
require 'stak/controller'
require 'stak/mapper'
module Stak
class Application
attr_reader :router
def initialize
@router = Stak::Router.new
end
def call(env)
mapp(env).call(env)... |
set -x
redis-cli keys 'fr:*'
redis-cli xread streams fr:mystream:x 0
redis-cli xrange fr:mystream:x - +
|
<filename>fame-server/src/main/java/com/designre/blog/model/dto/SiteConfig.java
package com.designre.blog.model.dto;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class SiteConfig {
private String title;
private String description;
private String keywords;
private boolean emailSen... |
package sma.rhythmtapper.game.models;
import java.io.Serializable;
import sma.rhythmtapper.game.models.Skill.Skill;
public class Card implements Serializable {
int vocal;
int visual;
int dance;
CenterSkill centerSkill;
Skill skill;
ColorType colorType;
int life;
public Card(ColorType... |
#!/bin/sh
# This file was copied from the HBase source code, and slightly adapted
# by NGDATA.
# This file is used to generate the annotation of package info that
# records the user, url, revision and timestamp.
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. S... |
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/home"} / /mnt/Storage/Backups/asus_arch_04282016/
|
#pragma once
#include <cstdint>
#include <vector>
#include "capstone/capstone.h"
#include "analyzers_code/BaseCodeAnalyzer.hpp"
struct Block;
struct Symbol;
class RetpolineCA : public BaseCodeAnalyzer {
public:
RetpolineCA(cs_arch arch, cs_mode mode);
int run(cs_insn insn, const Block *block, const Symb... |
json.partial! "proposals/proposal", proposal: @proposal
|
#!/bin/bash
rm src/pometo_lexer.erl
rm src/pometo_parser.erl
rebar3 compile && erl -pa _build/default/lib/pometo/ebin/ -pa _build/default/lib/base16/ebin -s runner run
#rebar3 compile && erl -pa _build/default/lib/pometo/ebin/ -pa _build/default/lib/base16/ebin -s runner noodle
|
#!/bin/sh
npm i vscode-jsonrpc@6.0.0-next.5
npm i vscode-languageclient@7.0.0-next.9
npm i vscode-languageserver@7.0.0-next.7
npm i vscode-languageserver-protocol@3.16.0-next.7
npm i vscode-languageserver-types@3.16.0-next.3
cp -r ../Server/bin/Debug/net5.0 ./server
npm install
npm run compile
vsce package
|
#!/bin/sh
# $1==appVersion
# $2==tmpFolder, gets created before this script is called and deleted afterwards
wget -q "https://github.com/gopasspw/gopass/releases/download/v$1/gopass-$1-linux-amd64.tar.gz" -O "$2/gopass-$1-linux-amd64.tar.gz"
mkdir $2/extracted
sudo tar -xzf "$2/gopass-$1-linux-amd64.tar.gz" -C "$2/ex... |
import { Component, ElementRef } from '@angular/core';
/* tslint:disable:no-unused-variable */
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SfeirBadgeDirective } from './sfeir-badge.directive';
export class MockElementRef extends ElementRef {
constructor() {
super(null);
}
}
exp... |
'use strict';
// https://stackoverflow.com/a/14873282
var erf = function(x) {
// save the sign of x
var sign = x >= 0 ? 1 : -1;
x = Math.abs(x);
// constants
var a1 = 0.254829592;
var a2 = -0.284496736;
var a3 = 1.421413741;
var a4 = -1.453152027;
var a5 = 1.061405429;
var p = 0.3275911;
// A&S fo... |
<reponame>RoCci/FrontendStarter-Boilerplate<gh_stars>0
'use strict';
import gulp from 'gulp';
import del from 'del';
const config = require( 'rc' )( 'app' );
gulp.task( 'clean', function() {
return del( [
config.distDir
] );
} );
gulp.task( 'clean:test', function() {
return del( [
config... |
import React, { Component } from 'react';
import { getLedetekst } from '@navikt/digisyfo-npm';
export default class Lenke extends Component {
constructor(props) {
super(props);
this.state = {
ikon: 'utbetalinger.svg',
};
this.onMouseEnter = this.onMouseEnter.bind(this);
... |
#!/usr/bin/env bash
#
# Copyright 2017 Marco Vermeulen
#
# 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 a... |
// (C) Copyright <NAME> 2021
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for more information.
// MACRO: BOOST_NO_CXX20... |
/*
* Copyright (c) 2014 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,... |
import React from 'react';
import PropTypes from 'prop-types';
import FormStyle from './style';
export const Form = (props) => {
return (
<FormStyle id="form-group">{props.children}</FormStyle>
)
}
export default Form |
#!/usr/bin/env bash
#===============================================================================
# Combine multiple braches, which match the search criteria into one new brach.
#
# Requirements: gh (github-cli), git
#===============================================================================
set -o nounset # ... |
<filename>src/provisioner/provisioner/errors.go
package provisioner
type TimeoutError struct{}
func (t *TimeoutError) Error() string {
return "timeout error"
}
|
def wrap(func):
def call(*args, **kwargs):
return func(*args, **kwargs)
call.__doc__ == func.__doc__
call.__name__ == func.__name__
call.__dict__.update(func.__dict__)
return call
|
'use strict';
const { RuleTester } = require('eslint');
const rule = require('../../../lib/rules/no-branch-in-dependencies');
const preprocess = require('../../helpers/preprocess');
new RuleTester().run('no-branch-in-dependencies', rule, preprocess({
valid: [
{
code: '{ "dependencies": { "lodash": "1.2.3"... |
package org.gbif.converters.parser.xml.identifier;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
@EqualsAndHashCode
@Getter
@AllArgsConstructor
public class PublisherProvidedUniqueIdentifier implements UniqueIdentifier {
@Non... |
<filename>tests/testAPI.py<gh_stars>1-10
from zillowAPI import zillow
from zillowAPI import ZillowDataType
from zillowAPI import ZillowAPI
from zillowAPI import ZillowError
import unittest
import xml.etree.ElementTree as ET
class ZillowTest(unittest.TestCase):
def setUp(self):
with open('tests/apiKeys','r... |
/**
* Copyright 2014 isandlaTech
*
* 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... |
def generate_update_statement(params):
placeholders = [f"{param}=%({param})s" for param in params]
update_statement = "UPDATE table_name SET " + ", ".join(placeholders)
return update_statement |
#!/bin/bash -xe
# build nanomsg and install (this one is a lil tricky to build statically)
cd /_src/nanomsg
cmake \
-DNN_STATIC_LIB=ON \
-DNN_ENABLE_DOC=OFF \
-DNN_MAX_SOCKETS=4096 \
-DCMAKE_C_FLAGS="-fPIC -DPIC" \
-DCMAKE_INSTALL_PREFIX=/_install/nanomsg \
-DCMAKE_INSTALL_LIBDIR=lib \
.
make -j4
make install
... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package login;
import entities.User;
import java.io.IOException;
import java.io.PrintWriter;
import javax.persistence.EntityManager;
i... |
#! /bin/bash
# Start all tools to develop the website.
# Works on my machine (TM)
sudo docker run -i --rm --volume `pwd`:/srv/jekyll/ --name transit-api-frontend jekyll/jekyll:3.8 jekyll build --watch &
cd _site
webfsd -p 8081
firefox http://127.0.0.1:8081/index.html?debug=true
|
package kbasesearchengine.system;
import java.util.Comparator;
/** Orders {@link ObjectTypeParsingRules} such that parsing rules for subobjects are first in the
* order.
* @author <EMAIL>
*
*/
public class ParsingRulesSubtypeFirstComparator implements Comparator<ObjectTypeParsingRules> {
@Override
publi... |
package mezz.jei.api.recipe;
import java.util.Collection;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.IModRegistry;
/**
* Allows creation of vanilla recipes.
* Get the instance from {@link IJeiH... |
import subprocess
import logging
log = logging.getLogger(__name__)
ENVIRONMENT = {'rel-version': None}
def get_release_version(client_id: str) -> str:
try:
# Execute a command to retrieve the release version for the given client_id
command = f'get_release_version_command {client_id}' # Replace wi... |
// Show registration form
'use strict';
module.exports = function (N, apiPath) {
N.validate(apiPath, {});
// Kick logged-in members
//
N.wire.before(apiPath, function register_guest_only(env) {
return N.wire.emit('internal:users.redirect_not_guest', env);
});
// Fill page meta
//
N.wire.on(a... |
#!/usr/bin/env ruby
#
# Advent of Code day 2 part 1
# https://adventofcode.com/2019/day/2
require_relative 'lib/orbit_map'
map = OrbitMap.new(File.new('6.input').readlines.map(&:chomp))
puts map.total_orbits
|
<gh_stars>1-10
package com.upplication.cordova.config;
import com.upplication.cordova.*;
import com.upplication.cordova.internal.AndroidProject;
import com.upplication.cordova.internal.XCodeProject;
import com.upplication.cordova.junit.Condition;
import com.upplication.cordova.junit.CordovaCLIRule;
import com.upplicat... |
#!/bin/bash
#
# Copyright 2014 The Kubernetes Authors.
#
# 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... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^cryptocurrencyhistorical/', views.CryptoCurrencyHistoricalAPI.as_view(), name="update_de"),
url(r'^metalcurrency/', views.MetalCurrencyAPI.as_view(), name="update_de"),
url(r'^stockprice/', views.StockPriceAPI.as_view(), name="stoc... |
$namespace(1, '@', function (exports) {
var utils = $require('utils'),
internals = exports.__internals__ = exports.__internals__ || {};
internals.PlainObjectCloner = PlainObjectCloner;
/**
* Clonador de objetos
*
* @param {object} target - Object to clone
*/
function Plain... |
#!/usr/bin/env bash
#
# Copyright (c) 2018-2019 The Zenacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Check that all logs are terminated with '\n'
#
# Some logs are continued over multiple lines. They sho... |
#!/bin/bash
# Check if the required argument is provided
if [ -z "$1" ]; then
echo "Usage: $0 <number_of_repos>"
exit 1
fi
# Function to fetch repository data from GitHub API
fetch_github_data() {
local page=1
local per_page=100
local repos=()
while true; do
local response=$(curl -s "https://api.gi... |
<filename>simetra/artemis.py
import optparse, glob
import simetra as art
import numpy as np
import injection as inj
import logging
from astropy.time import Time
def main(opts):
# set up logging info
logging.basicConfig(filename=opts.outfile.split(".")[0]+".log", level=logging.INFO)
# define image section... |
<reponame>igrigorik/agent<filename>examples/producer-consumer.rb
project_lib_path = File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
$LOAD_PATH.unshift(project_lib_path)
require 'agent'
c = channel!(Integer)
go!(c) do |c|
i = 0
loop { c << i+= 1 }
end
p c.receive[0] # => 1
p c.receive[0] # => 2
... |
from functools import partial
from django.core.exceptions import ValidationError
from cyder.base.tests import ModelTestMixin
from cyder.core.ctnr.models import Ctnr
from cyder.core.system.models import System
from cyder.cydns.tests.utils import create_reverse_domain, create_zone, DNSTest
from cyder.cydns.ip.utils imp... |
#! /usr/bin/env bash
#
# Copyright (c) 2019 Nat! - Mulle kybernetiK
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright not... |
/* eslint-disable @typescript-eslint/no-var-requires */
import os from 'os';
import { command } from 'yargs'
const packageJson = require('../../package.json');
export = command('info', 'info/version information for cli',
() => {
// nothing
},
() => {
console.log(`project details: `, {
... |
package com.example.PromoLac.NotificationLogs;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.telephony.SmsManager;
import android.telephony.SmsMessage;
import and... |
package cucumber.api.rhino;
public class README {
}
|
#!/bin/bash
set -e
MINIO_ROOT_USER=admin
MINIO_ROOT_PASSWORD=password
MINIO_VOLUMES=/mnt/data
wget -nc https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
sudo cp minio /usr/local/bin
wget -nc https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
sudo cp mc /usr/local/bin
sudo mkdir -p ... |
#!/usr/bin/env bash
# MIT License
#
# Copyright (c) 2019 Collin Pasternack
#
# 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 ... |
def initialize_and_run_mapper(backbone: str, featureset: str, distance: str, onwhat: str, threshold: float, statistic: str, suffix: str, permfilter: bool, graph: str, network: str) -> str:
# Initialize and run the mapper using the parsed input values
# Example: Assuming the mapper is a hypothetical process, the... |
from flask import render_template, request, Blueprint, flash
from flask_login import login_required
from noteshare.models import Note
from noteshare.main.forms import ContactUsForm
from noteshare.main.utils import send_contact_email
main = Blueprint('main', __name__)
@main.route('/')
@main.route('/index')
def index()... |
use std::ops::{Add, Sub, Mul};
#[derive(Debug, PartialEq)]
struct Vec3 {
x: f64,
y: f64,
z: f64,
}
impl Vec3 {
fn new(x: f64, y: f64, z: f64) -> Vec3 {
Vec3 { x, y, z }
}
fn from_slice(slice: &[f64]) -> Vec3 {
assert_eq!(slice.len(), 3);
Vec3::new(slice[0], slice[1], s... |
public static boolean containsAllVowels(String str) {
String vowels = "aeiou";
for (int i = 0; i < 5; i++) {
if(!str.contains(vowels.charAt(i)+"")) {
return false;
}
}
return true;
}
System.out.println(containsAllVowels("Hello world!")); # will return false |
<reponame>fossabot/erxes
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import { OverlayTrigger, Popover } from 'react-bootstrap';
import classnames from 'classnames';
import { ChromePicker } from 'react-color';
import { uploadHandler } from 'modul... |
<reponame>HISPSA/data-visualizer-app
import { colors, theme } from '@dhis2/ui'
// Layout
export const LAYOUT_HEIGHT = '78px'
// Axis
export const AXIS_PADDING = '4px 4px 2px 6px'
export const AXIS_LABEL_PADDING = '2px 0px 0px 4px'
export const AXIS_BORDER_COLOR = colors.grey300
export const AXIS_BORDER_STYLE = 'solid... |
#!/bin/bash
set -e
set -u
tmp="${TMPDIR:-/tmp}"
name="dev_env"
dir="${HOME}/Programming/${name}"
output="${tmp}/${name}_setup"
apt_args="--no-install-recommends --yes"
cyan="$(tput setaf 6)"
red="$(tput setaf 1)"
yellow="$(tput setaf 3)"
green="$(tput setaf 2)"
function message {
echo "${*}$(tput sgr0)"
echo... |
#!/bin/bash
# Install a custom FFmpeg version - https://ffmpeg.org
#
# To run this script on Codeship, add the following
# command to your project's setup commands:
# \curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/ffmpeg.sh | bash -s
#
# Add the following environment variable to your proj... |
#!/bin/sh
if [ -n "$DESTDIR" ] ; then
case $DESTDIR in
/*) # ok
;;
*)
/bin/echo "DESTDIR argument must be absolute... "
/bin/echo "otherwise python's distutils will bork things."
exit 1
esac
DESTDIR_ARG="--root=$DESTDIR"
fi
echo_and_run() { e... |
package interactive.text;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import data.Texture;
public class Font {
private Texture texture;
private float lineHeight;
... |
#!/bin/bash -f
#*********************************************************************************************************
# Vivado (TM) v2020.1 (64-bit)
#
# Filename : clk_wiz_0.sh
# Simulator : Aldec Riviera-PRO Simulator
# Description : Simulation script for compiling, elaborating and verifying the project sourc... |
#!/usr/bin/env bash
# run with bash tests/test_pipeline -c /path/to/config_file
# import and check config
while getopts "c:e" opt; do
case $opt in
c)
CONFIG=$OPTARG
if [ ! -f "$CONFIG" -a "$CONFIG" != "test" ];then
echo "Config file "$CONFIG" does not exist." >&2
exit 1
elif [ $CONFIG = "te... |
#!/bin/bash
# Requires a running instance of https://github.com/kb-dk/ds-storage/
# with default test setup
: ${RECORD_FILES:="$@"}
: ${RECORD_FILES:="albert-einstein.xml hvidovre-teater.xml simonsen-brandes.xml tystrup-soroe.xml homiliae-super-psalmos.xml work_on_logic.xml joergen_hansens_visebog.xml responsa.xml"}
... |
package app.model;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component
public class AnimalsCage {
@Autowired
@Qualifier("d... |
// Function to reverse a given string using recursion
function reverseString(str) {
if (str === "") // This is the terminal case that will end the recursion
return "";
else
return reverseString(str.substr(1)) + str.charAt(0);
}
// Driver code
let str = "Hello World!";
console.log(reverseString(str)) // !dl... |
<gh_stars>0
import React, { useContext } from 'react';
import {
Table,
TableHeader,
TableCell,
TableFooter,
TableContainer,
Select,
Input,
Button,
Card,
CardBody,
Pagination,
} from '@windmill/react-ui';
import { FiPlus } from 'react-icons/fi';
import { CSVReader, CSVDownloader } from 'react-papap... |
#!/bin/bash
TASK=8
SHOT=1
LANG=tr
MODEL=ctrl_xuniter
MODEL_CONFIG=ctrl_xuniter_base
TASKS_CONFIG=iglue_test_tasks_boxes36.dtu
TRTASK=RetrievalxFlickrCO${LANG}_${SHOT}
TETASK=RetrievalxFlickrCO${LANG}
TEXT_PATH=/home/projects/ku_00062/data/xFlickrCO/annotations/${LANG}/test.jsonl
FEAT_PATH=/home/projects/ku_00062/data/... |
words = ["cat", "dog", "bird", "cat", "dog", "ant"]
# Create an empty dictionary to store the counts
wordCounts = {}
# Iterate over the words list
for word in words:
# Check if the word is already in the dictionary
if word in wordCounts:
# Increment the count for the word
wordCounts[word] += 1
else:
# Create a ... |
<filename>client/uni-app/mix-mall/pages/coupon/js/list.js
import {getUserList} from '@/api/coupon'
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
import empty from "@/components/empty";
import coolcCoupon from '../components/coolc-coupon.vue';
export default {
components: {
uniLoadMore,
em... |
<reponame>tomviner/maven
"""
Model-ready dataset for the United Kingdom's 2015 General Election.
Usage:
> import maven
> maven.get('general-election/UK/2015/model', data_directory='./data/')
"""
import os
from pathlib import Path
import shutil
import pandas as pd
import maven
class UK2015Model:
"""Gene... |
#!/bin/bash
set -eu
cyg() {
local IN=$1
case "$(uname)" in
CYGWIN*) cygpath --windows -a "$IN" ;;
*) echo "$IN" ;;
esac
}
AS_SOMEONE=$(dirname "$0")/../../..
AS_SOMEONE=$(cd "$AS_SOMEONE" && pwd)
CYG_AS_SOMEONE=$(cyg "$AS_SOMEONE")
# TODO how to define this only once:
CACHED=$(cyg "$AS_SOMEONE/.i-cach... |
#ifndef SRC_GOLDSCRIPT_LINKED_H
#define SRC_GOLDSCRIPT_LINKED_H
#include "gs-memory.h"
/**
* @file This file provides an inheritable interface of a singly linked list.
*/
#define GOLDSCRIPT_LINKED_SYMBOL __gs_link
#define GOLDSCRIPT_LINKED_HEAD \
int type; \
struct GOLDSCRIPT_LINKE... |
<filename>src/index.js<gh_stars>1-10
import init from './init';
import {
linkDeviceClientData,
geolocation,
saveKeyInDevice,
saveKeyInUser,
isRegistered,
} from './devices';
import { subscribe, unsubscribe } from './push';
import { registration } from './ServiceWorker';
import { store, clear } from './utils';... |
<reponame>kkoogqw/OpenItem<filename>review/controllers/submit.go
package controllers
import (
"net/http"
"review/logger"
"review/models"
"review/request"
"review/response"
)
// a part of project controller
// @Title GetOneSubmit
// @Description 获取一个submit的信息
// @Param token header string true "user token get ... |
package me.insidezhou.southernquiet.file.web.controller.advice;
import me.insidezhou.southernquiet.file.web.exception.NotFoundException;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org... |
<reponame>vrn-dev/ts-server-template<filename>src/index.ts
import { Config } from './types/config.types';
import { init, mongoConnect, errorPropsBuilder, errorDetails } from './utils';
import { json } from 'body-parser';
import express from 'express';
import cors from 'cors';
import { authMiddleWare } from './auth';
im... |
<filename>demos/omicron/src/omicron.cpp
#include "game.hpp"
#include <be/core/service_helpers.hpp>
#ifdef BE_DEBUG
#pragma comment(lib, "glew-debug")
#pragma comment(lib, "core-debug")
#pragma comment(lib, "core-id-with-names-debug")
#else
#pragma comment(lib, "glew")
#pragma comment(lib, "core")
#pragma comment(lib, ... |
.customClass {
&:hover {
opacity: 1 !important;
}
&.active {
&::after {
content: '';
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
}
}
} |
<gh_stars>0
package be.crydust.tokenreplacer;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers... |
<gh_stars>1-10
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.iosCheckmark = void 0;
var iosCheckmark = {
"viewBox": "0 0 512 512",
"children": [{
"name": "g",
"attribs": {},
"children": [{
"name": "path",
"attribs": {
"d": "M256,48C141.1,48,4... |
## 2. Head or Tail ##
/home/dq/rg_data$ tail 'Physical Sciences'
## 3. Option-arguments ##
/home/dq/rg_data$ tail -n +2 Arts
## 4. Counting Lines ##
/home/dq/rg_data$ answer 12 1469 20 737 17
## 5. Pretty Printing ##
/home/dq/rg_data$ column -s":" -t characters
## 6. File Sample ##
/home/dq/rg_data$ shuf -n 5 ... |
<reponame>OSWeDev/oswedev<gh_stars>0
import ServerAPIController from '../../../server/modules/API/ServerAPIController';
import APIControllerWrapper from '../../../shared/modules/API/APIControllerWrapper';
APIControllerWrapper.API_CONTROLLER = ServerAPIController.getInstance();
import { expect, assert } from 'chai';
im... |
def evaluate_integer(num):
if num < 0:
print(num, "is negative.")
elif num > 0:
print(num, "is positive.")
else:
print(num, "is zero.")
# Test the function with user input
num = int(input("Enter an integer: "))
evaluate_integer(num) |
<reponame>maurov/xraysloth
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
JupyX: Jupyter UI for X-ray data analysis
-----------------------------------------
"""
#################
# IPython utils #
#################
def ipythonAutoreload():
"""Force ipython to autoreload imported modules"""
from IPython i... |
#!/usr/bin/env bash
# Copyright 2017 The Kubernetes Authors.
#
# 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 applica... |
<filename>src/facade/evaluatorFacade.ts
import Evaluator, {Campaign, EvaluationContext, Page} from '../evaluator';
import {JsonObject, JsonValue} from '../json';
import Tab from '../tab';
import {optionsSchema} from '../schema/evaluationSchemas';
import {formatCause} from '../error';
export type EvaluationOptions = {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.