text stringlengths 1 1.05M |
|---|
#!/usr/bin/env bash
stack build && \
echo "running ----" && \
stack exec haskell-diagrams-cellular-automata-exe -- -h 32 -w 1024 -o images/simple.gif
|
const regexp = new RegExp(/^t[a-z]*$/);
const strings = ['test', 'teststring', 'tower', 'tease'];
const matches = strings.filter(string => regexp.test(string));
console.log(matches); // ['test', 'tower', 'tease'] |
INSTALL_BUILDER_VERSION="18.10.0"
if [ "$(uname)" == "Darwin" ]; then
INSTALLBUILDERCLI="/Applications/Bitrock InstallBuilder Enterprise ${INSTALL_BUILDER_VERSION}/bin/Builder.app/Contents/MacOS/installbuilder.sh"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
if [[ $WERCKER = true ]]; then
INSTALL... |
"""
Creating an AI Chatbot in Python
"""
import re
import random
bot_greetings = ["Hi!", "Hey there!", "Good morning!", "Good afternoon!"]
# Define a function that responds to a user's message
def respond_to_message(message):
# If the message is a greeting, then return a random greeting response
if re.search... |
/// <reference types="ledgerhq__hw-transport" />
import Transport from '@ledgerhq/hw-transport';
export declare type LedgerTypes = 'hid' | 'u2f' | 'webusb';
export interface TransportDef {
create(): Promise<Transport>;
type: LedgerTypes;
}
|
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var diceImageView1: UIImageView!
@IBOutlet weak var diceImageView2: UIImageView!
let diceImages = ["dice1", "dice2", "dice3", "dice4", "dice5", "dice6"]
override func viewDidLoad() {
super.viewDidLoad()
// Ad... |
#...............................................................................
#
# This file is part of the Doxyrest toolkit.
#
# Doxyrest is distributed under the MIT license.
# For details see accompanying license.txt file,
# the public copy of which is also available at:
# http://tibbo.com/downloads/archive/d... |
cd data/untrimmed_fastq
#download raw data
if [ ! -f SRR2589044_1.fastq.gz ]; then
curl -O ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR258/004/SRR2589044/SRR2589044_1.fastq.gz
fi
if [ ! -f SRR2589044_2.fastq.gz ]; then
curl -O ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR258/004/SRR2589044/SRR2589044_2.fastq.gz
fi
if [ ! -f ... |
/*
* 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 Example2;
/**
*
* @author Adminfdf
*/
public class Example2 {
public int[] arrayA = {1, 5, 3, 12, 54, 7, 45, 8, 9, 32,... |
#!/bin/bash
#
# profiles = xccdf_org.ssgproject.content_profile_stig-rhel7-disa
SSSD_PAM_SERVICES_REGEX="^[\s]*\[sssd]([^\n]*\n+)+?[\s]*services.*pam.*$"
SSSD_PAM_SERVICES="[sssd]
services = pam"
SSSD_CONF="/etc/sssd/sssd.conf"
grep -q "$SSSD_PAM_SERVICES_REGEX" $SSSD_CONF && \
sed -i "s/$SSSD_PAM_SERVICES_REGEX/$SS... |
#!/bin/bash
dieharder -d 202 -g 3 -S 1928803870
|
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "pch.h"
#include "TestCommon.h"
#include <AppInstallerRuntime.h>
#include <AppInstallerVersions.h>
using namespace AppInstaller;
using namespace AppInstaller::Utility;
TEST_CASE("VersionParse", "[versions]")
{
Versio... |
#!/bin/sh
#
# Run dora in a container
set -e
VERSION="0.1.3"
IMAGE="lvfrazao/dora:$VERSION"
exec docker run --rm --network host $IMAGE "$@"
|
<reponame>acidburn0zzz/remo
var EventsLib = {};
EventsLib.markers_array = [];
EventsLib.request = undefined;
EventsLib.number_of_events = 0;
EventsLib.searchform_elm = $('#searchform');
EventsLib.searchfield_elm = $('#searchfield');
EventsLib.events_table_body_elm = $('#events-table-body');
EventsLib.eventsitem_tmpl_el... |
package com.thinkgem.jeesite.modules.yipan.web;
import com.thinkgem.jeesite.common.utils.wx.MapXmlUtil;
import com.thinkgem.jeesite.modules.yipan.entity.UnifiedorderResult;
import com.thinkgem.jeesite.modules.yipan.entity.YpUnifiedorder;
import com.thinkgem.jeesite.modules.yipan.service.YpBillService;
import com.think... |
#! /bin/bash
#
# Open Asset Import Library
# cross platform 3D model loader
# https://github.com/assimp/assimp
#
# uses CMake
# define the version
VER=3.1.1
# tools for git use
GIT_URL=
# GIT_URL=https://github.com/assimp/assimp.git
GIT_TAG=
FORMULA_TYPES=( "osx" "osx-clang-libc++" "ios" "android" "emscripten" "vs" ... |
package com.thinkaurelius.titan;
import com.thinkaurelius.titan.diskstorage.cassandra.embedded.CassandraEmbeddedStoreManager;
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration;
import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration... |
{ path: 'books/add', component: AddBookComponent },
{ path: 'books/edit/:bookId', component: EditBookComponent },
{ path: 'profile', component: UserProfileComponent }, |
<reponame>IanCassTwo/AkamaiOPEN-edgegrid-golang<filename>firewallrules-v1/firewallrules_test.go
package firewallrules
import (
"fmt"
"github.com/stretchr/testify/assert"
"gopkg.in/h2non/gock.v1"
"testing"
)
func TestListSubscriptions(t *testing.T) {
defer gock.Off()
mock := gock.New(fmt.Sprintf("https://akaa-... |
#!/bin/sh
# Copyright 2019 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 or ... |
'use strict';
self.onmessage = function (e) {
self.postMessage(e.data);
}; |
#!/bin/bash
set -eu
self="$(basename "${BASH_SOURCE[0]}")"
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
# get the most recent commit which modified any of "$@"
fileCommit() {
git log -1 --format='format:%H' HEAD -- "$@"
}
# get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$... |
# Define function to calculate cross-validation score
def calculate_score(model, hyperparameters):
# Make predictions
predictions = model.predict(X_validation)
# Calculate validation score
validation_score = model.score(X_prediction, y_prediction)
# Return validation score
return validation_score
# Initialize ... |
def operate(arr):
new_arr = [i+5 for i in arr]
new_arr = [i-2 for i in new_arr]
new_arr.sort()
return new_arr
arr = [1, 2, 0, 5, 2, 1]
result = operate(arr)
print(result)
# [2, 3, 4, 6, 7, 8] |
ret=0
read N
read line
for a in $line; do
ret=$[$ret^$a]
done
echo $ret
|
#ifndef COMMON_PUBLIC_PRIORITY_QUEUE_H__
#define COMMON_PUBLIC_PRIORITY_QUEUE_H__
#include <stdbool.h>
#include <stddef.h>
#include "iterator.h"
// A priority queue data structure.
typedef struct PriorityQueue PriorityQueue;
typedef enum {
PQ_MODE_INVALID,
PQ_MODE_SMALLEST_FIRST,
PQ_MODE_LARGEST_FIRST,
} Prio... |
# Create a Customer class
class Customer:
# Initialize the data attributes
def __init__(self, name, age):
self.name = name
self.age = age
self.books = {}
# Add a book to the customer's list
def addBook(self, bookName):
self.books[bookName] = True
# Remove a book f... |
import Post from 'models/Post'
import sendErrorMessage from 'utils/errorMessage'
import sendMessage from 'utils/message'
const ADD_COMMENT_MESSAGE = 'you have commented on this post'
const REMOVE_COMMENT_MESSAGE = 'you have removed comment from this post'
const resolver = {
Mutation: {
commentPost: async (_, { Inp... |
import React from 'react';
class Calculator extends React.Component {
state = {
num1: '',
num2: '',
result: ''
}
handleInputChange = (event) => {
this.setState({[event.target.name]: event.target.value});
}
handleSubmit = (event) => {
event.preventDefault();
this.setSt... |
#!/bin/bash
#
# Laucher batch script file for TACC systems (like Frontera, Stampede2, etc.)
# Si Liu
# July 13, 2020
#
# Simple SLURM script for submitting multiple serial
# jobs (e.g. parametric studies) using a script wrapper
# to launch the jobs.
#
# To use, build the launcher executable and your
# serial applicatio... |
#include "ArtistTree.h"
TreeNode::TreeNode(std::string name)
: artist{ name } {};
ArtistTree::ArtistTree() {};
ArtistTree::ArtistTree(TreeNode* first)
: root{ first } {};
ArtistTree::ArtistTree(std::string artist)
: root{ new TreeNode(artist) } {}
void ArtistTree::insert(TreeNode* new_artist)
{
TreeNode *temp ... |
<gh_stars>0
package BSP;
import java.util.*;
import org.json.JSONObject;
import static BSP.BSPConstant.*;
/**
* Created by nathan on 13/5/17.
*/
public class SystemController {
private List<Customer> customers = new ArrayList<Customer>();
private Customer customer;
private DataManager dataManager = new ... |
<reponame>NilsCoding/hierarchical-data<filename>src/com/nilscoding/datastruct/hierarchical/HierarchyStream.java
package com.nilscoding.datastruct.hierarchical;
import java.util.Iterator;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
... |
<gh_stars>1-10
//
// Licensed to Green Energy Corp (www.greenenergycorp.com) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. Green Enery Corp licenses this file
// to you under the Apache License, Versio... |
<reponame>LesterCerioli/Umbriel<gh_stars>100-1000
import { Tag } from '@modules/subscriptions/domain/tag/tag'
import { Title } from '@modules/subscriptions/domain/tag/title'
import { InMemoryTagsRepository } from '@modules/subscriptions/repositories/in-memory/InMemoryTagsRepository'
import { GetAllTags } from './GetAl... |
SELECT COUNT(DISTINCT column_name)
FROM table_name; |
class Review < ApplicationRecord
belongs_to :product
end
|
#!/bin/sh
TCP_SERVER_PORT="${DRACHTIO_PORT:-4000}"
nc -v -z localhost $TCP_SERVER_PORT
# if last command exited with non zero
if [ $? != 0 ]
then
exit 1
fi
HTTP_SERVER_PORT="${HTTP_PORT:-3000}"
printf 'GET /system-health HTTP/1.1\r\nHost: localhost\r\n\r\n' | nc -v localhost 3000 | grep calls
# grep will autom... |
/*
* Copyright 2017 Realm Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wr... |
<filename>packages/components/src/components/behavioural-components/keyboard-navigable/keyboard-navigation-listener.tsx
import { Component, h, Prop, Host, Listen } from '@stencil/core'
import { KeyboardNavigationHandler } from './keyboard-navigation-handler'
import { KeyboardNavigationAction } from './keyboard-navigabl... |
const initialState = {
miningBonus: 0,
researchSpeed: 1,
inserterTarget: 'default',
inserterCapacity: 5,
costFactor: 1.0,
costFactory: 100,
costInput: 10,
costIgnored: 0,
};
const settingsReducer = (state = initialState, action) => {
switch (action.type) {
case SettingsActionType.SET_MINING_BONUS... |
#!/bin/sh
# failure
../examples/test4 -Bs --Bs asdf > tmp.out 2>&1
if cmp -s tmp.out $srcdir/test18.out; then
exit 0
else
exit 1
fi
|
/*
* Created Date: Thu, 6th May 2021, 15:11:26 pm
* Author: <NAME>
* Email: <EMAIL>
* Copyright (c) 2021 The Distance
*/
import React, {useState} from 'react';
import {View, Text, Image, TouchableOpacity} from 'react-native';
import {ScaleHook} from 'react-native-design-to-component';
import useTheme from '../../... |
<filename>src/contexts/ThemeContext.tsx
import { createContext, FC, useContext, useEffect, useState } from 'react';
interface ThemeContextData {
isDark: boolean;
toggleDarkMode: () => void;
}
export const ThemeContext = createContext<ThemeContextData>({
isDark: false,
toggleDarkMode() {
return;
},
});
... |
#!/bin/bash
# Validates a CloudFromation stack
TEMPLATELOCATION=${1:-file://$(pwd)/rds.yml}
VALIDATE="aws cloudformation validate-template --template-body $TEMPLATELOCATION"
echo $VALIDATE
$VALIDATE
|
package api
// GatewayIntents is an extension of the Bit structure used when identifying with discord
type GatewayIntents int64
// Constants for the different bit offsets of GatewayIntents
const (
GatewayIntentsGuilds GatewayIntents = 1 << iota
GatewayIntentsGuildMembers
GatewayIntentsGuildBans
GatewayIntentsGuil... |
<filename>packager/react-packager/src/node-haste/crawlers/index.js
'use strict';
const nodeCrawl = require('./node');
const watchmanCrawl = require('./watchman');
function crawl(roots, options) {
const {fileWatcher} = options;
return (fileWatcher ? fileWatcher.isWatchman() : Promise.resolve(false)).then(
isWa... |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for CESA-2013:0522
#
# Security announcement date: 2013-03-09 00:40:29 UTC
# Script generation date: 2017-01-01 21:10:41 UTC
#
# Operating System: CentOS 6
# Architecture: i386
#
# Vulnerable packages fix on version:
# - gdb.i686:7.2-60.el6
# - gdb-gdbserver.i6... |
#!/bin/bash
# Install Dependencies and Prerequisites
./scripts/installDependencies.sh
|
from typing import List
class CombinedRelation:
def __init__(self, relation_type: str, relation_data):
self.relation_type = relation_type
self.relation_data = relation_data
def filter_and_sort_relations(relations: List[CombinedRelation]) -> List[CombinedRelation]:
filtered_relations = [rel for... |
#!/bin/bash
#bdereims@vmware.com
. ./env
[ "$1" == "" -o "$2" == "" ] && echo "usage: $0 <name_of_transportzone> <name_of_logicalswitch>" && exit 1
TZ_ID=$( ${NETWORK_DIR}/id_transportzone.sh ${1} )
[ "${TZ_ID}" == "" ] && echo "${1} doesn't exist!" && exit 1
#NEW_LOGICALSWITCH="<virtualWireCreateSpec><name>${2}<... |
#!/bin/bash
# Hosts the vocabularies.
# These files are pointed at by purl.org:
pushd /var/www/vocab
# http://purl.org/twc/vocab/datafaqs# redirects to:
sudo rm datafaqs.ttl
sudo wget https://raw.github.com/timrdf/DataFAQs/master/ontology/datafaqs.ttl
sudo wget https://raw.github.co... |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... |
// https://open.kattis.com/problems/evenup
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
typedef vector<int> vi;
typedef stack<int> si;
int main() {
int n;
cin >> n;
vi v(n);
for (int i = 0; i < n; i++) cin >> v[i];
int i = 0;
int c = n;
si s;
while (i < n) {
if (!s.... |
<filename>src/config/aws.s3.config.ts
import aws from 'aws-sdk'
import multer from 'multer'
import multerS3 from 'multer-s3'
import dotenv from 'dotenv'
dotenv.config()
aws.config.update({
apiVersion: '2006-03-01',
accessKeyId: process.env.AWSAccessKeyId,
secretAccessKey: process.env.AWSSecretKey,
region: pro... |
<?php
function isAnagram($string1, $string2) {
$string1 = preg_replace('/[^a-z ]/i', '', $string1);
$string2 = preg_replace('/[^a-z ]/i', '', $string2);
$charCount1 = array_count_values(str_split($string1));
$charCount2 = array_count_values(str_split($string2));
if (count(array_diff_assoc($charCount1, $charCoun... |
<reponame>RoCci/FrontendStarter-Boilerplate
'use strict';
var fs = require( 'fs' );
var path = require( 'path' );
var config = require( '../config' );
var exphbs = require( 'express-handlebars' );
var logger = require( '../logging' );
var include;
var handlebars = exphbs.create( {
helpers: { include: include }
} ... |
/*
* //******************************************************************
* //
* // Copyright 2016 Samsung Electronics All Rights Reserved.
* //
* //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
* //
* // Licensed under the Apache License, Version 2.0 (the "License");
* // you may not use thi... |
def is_anagram_of(string1, string2):
char_map = [0] * 26
for ch in string1:
char_map[ord(ch) - ord('a')] += 1
for ch in string2:
char_map[ord(ch) - ord('a')] -= 1
for freq in char_map:
if freq != 0:
return False
return True |
<filename>client/src/components/TicketComponent.tsx
import React from "react";
import { Ticket } from "../api";
export type TicketComponentProps = {
ticket: Ticket;
hideTicket: (id: string) => void;
fontSize: number;
};
export default class TicketComponent extends React.Component<TicketComponentProps> {
state... |
#!/usr/bin/env bash
ray_version=""
commit=""
ray_branch=""
usage() {
echo "Start one microbenchmark trial."
}
for i in "$@"
do
case $i in
--ray-version=*)
ray_version="${i#*=}"
;;
--commit=*)
commit="${i#*=}"
;;
--ray-branch=*)
ray_branch="${i#*=}"
;;
--help)
usage
... |
package api
import "database/sql"
// Ok interface is to be implemented by any object which can be validated
type Ok interface {
OK() error
}
// DatabaseErr is the error returned if an error occurs with database access
type DatabaseErr struct {
Msg string `json:"error"`
}
func (e DatabaseErr) Error() string {
ret... |
<reponame>DerSchmale/spirv4web
import { PlsFormat } from "./glsl";
export class PlsRemap
{
id: number;
format: PlsFormat;
constructor(id: number, format: PlsFormat)
{
this.id = id;
this.format = format;
}
} |
def reverse_string(input_str: str) -> str:
return input_str[::-1] |
import React from "react";
import { IconProps, withIcon } from "../withIcon";
import { ReactComponent as Icon } from "./spinner.svg";
import styles from "./styles.module.css";
export const IconSpinner: React.FC<IconProps> = (props) => (
<span className={styles.icon}>{withIcon(Icon)(props)}</span>
);
|
#!/usr/bin/env 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... |
<reponame>advatar/esp
require "spec_helper"
require "webmock/rspec"
require "ffaker"
if ENV['CF_V2_RUN_INTEGRATION']
describe 'A new user tries to use CF against v2 production', :ruby19 => true do
before(:all) do
WebMock.allow_net_connect!
end
after(:all) do
WebMock.disable_net_connect!
... |
def find_maximum(nums):
max = 0
for x in nums:
if x > max:
max = x
return max
nums = [5, 2, 4, 8, 9]
max_val = find_maximum(nums)
print(max_val) |
import random
def random_element(lst):
return random.choice(lst) |
<gh_stars>0
# Copyright (c) 2020, Pensando Systems
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR... |
//BSRR set and reset register
//5 set and 21 reset register
#include "stm32f4xx.h" // Device header
void delay(int seconds);
int main(void){
RCC->AHB1ENR |= 1;
GPIOA->MODER |= 0x400;
for(int i=0;i<5;i++){
GPIOA->BSRR |= 0x20; //Set register
delay(1000);
GPIOA->BS... |
export default function get<
T extends { [K in keyof T]: T[K] } | any[],
K1 extends keyof T = keyof T,
K2 extends keyof T[K1] = keyof T[K1],
K3 extends keyof T[K1][K2] = keyof T[K1][K2],
K4 extends keyof T[K1][K2][K3] = keyof T[K1][K3],
K5 extends keyof T[K1][K2][K3][K4] = keyof T[K1][K3][K4],
K6 extends keyof T... |
import React, { useState } from 'react';
import { View, Image, TextInput, Button } from 'react-native';
const PhotoAlbum = () => {
const [photos, setPhotos] = useState([]);
const [caption, setCaption] = useState('');
const addPhoto = () => {
const newPhotos = [...photos, { url, caption }];
setPhotos(newPhotos)... |
//
// BspTree.hpp
// walls3duino
//
// Created by <NAME> on 5/9/20.
// Copyright © 2020 <NAME>. All rights reserved.
//
#ifndef BspTree_hpp
#define BspTree_hpp
#include <stdint.h>
#include "Vec2.hpp"
#include "Wall.hpp"
// this class represents a binary space partitioning tree, and is a much-scaled-back version ... |
<reponame>kennethdavidbuck/ember-cli-path-inspector<gh_stars>1-10
export {default} from '../../base';
|
class MonoMdk327 < Cask
version '3.2.7'
sha256 '261a9ed737f2e8185149857c1a8238bf26a32e7e28ae412c668841fcd77ebfcb'
url 'http://download.mono-project.com/archive/3.2.7/macos-10-x86/MonoFramework-MDK-3.2.7.macos10.xamarin.x86.pkg'
homepage 'http://mono-project.com/'
pkg 'MonoFramework-MDK-3.2.7.macos10.xamarin... |
/*******************************************************************************
* Copyright (c) 2016 comtel 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.or... |
class Curl {
public function setOpt($option, $value) {
// Implementation of setOpt method
}
public function get($url) {
// Implementation of get method
// Make HTTP GET request using cURL and return the response body
}
}
class HttpHandler {
const PATH = '/api/data';
pu... |
<filename>tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Doctype.java
// Copyright 2011 The Apache Software Foundation
//
// 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... |
#!/bin/sh
python -u -c 'import torch; print(torch.__version__)'
CODE_PATH=codes
DATA_PATH=data
SAVE_PATH=models
#The first four parameters must be provided
MODE=$1
MODEL=$2
DATASET=$3
GPU_DEVICE=$4
SAVE_ID=$5
FULL_DATA_PATH=$DATA_PATH/$DATASET
SAVE=$SAVE_PATH/"$MODEL"_"$DATASET"_"$SAVE_ID"
#Only used in training
B... |
<reponame>ksh9241/java8_in_action<gh_stars>0
package java_8_in_action.stream_collector;
import static java.util.Comparator.comparing;
import static java.util.stream.Collectors.toList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
public class Practice {
publ... |
<filename>Algorithms_Training/Difficulty_Easy/Problem_8_Reverse_LinkedList/ts/Main.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
var ListNo... |
<filename>Documentation/SoftwareGuide/Cover/Source/ImageReadExtractWriteRGB.cxx
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Language: C++
Copyright (c) 2002 Insight Consortium. All rights reserved.
See ITKCopyright.txt or ... |
export const INCREMENT = 'counter/INCREMENT'
export const DECREMENT = 'counter/DECREMENT'
const initialState = {
count: 0
}
export default (state = initialState, action) => {
switch (action.type) {
case INCREMENT:
return {
...state,
count: state.count + 1,
}
case DECREMENT:
... |
<gh_stars>0
package core
import (
"encoding/json"
"errors"
"github.com/aws/aws-lambda-go/events"
)
type SwitchableAPIGatewayRequest struct {
v interface{} // v is Always nil, or a pointer of APIGatewayProxyRequest or APIGatewayV2HTTPRequest
}
// NewSwitchableAPIGatewayRequestV1 creates a new SwitchableAPIGateway... |
#!/bin/bash
cd
mkdir -p software
cd software
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si --noconfirm
cd ..
yay --builddir .
yay --save
|
<gh_stars>10-100
# -*- coding:utf-8 -*-
#
# Copyright (C) 2019 The Android Open Source Project
#
# 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-... |
var structarmnn_utils_1_1_csv_row =
[
[ "values", "structarmnn_utils_1_1_csv_row.xhtml#af80d24ad6806a497ec21dc835c28b7ce", null ]
]; |
<filename>app/controllers/storageBackends/AzureObjectBackend.scala
/*
* Copyright 2017 - Swiss Data Science Center (SDSC)
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
* Eidgenössische Technische Hochschule Zürich (ETHZ).
*
* Licensed under the Apache License, Version 2.0 (the "Licens... |
def substrings_freq(string):
result = {}
n = len(string)
for i in range(n):
for j in range(i+1, n+1):
substring = string[i:j]
if len(substring) == 3:
if substring in result:
result[substring] += 1
else:
... |
<filename>src/App.js
import React from "react"
import { BrowserRouter, Route, Redirect, Switch } from "react-router-dom";
// pages
import NucleoIcons from "views/NucleoIcons.js";
import LandingPage from "views/examples/LandingPage.js";
import ProfilePage from "views/examples/ProfilePage.js";
import RegisterPage from ... |
<gh_stars>0
// Copyright (c) 2017-2018 Tigera, 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 re... |
#include <tree.h>
#include <kstring.h>
void tree_node_init(tree_node_t* node) {
memset(node, 0, sizeof(tree_node_t));
}
void tree_add(tree_node_t* father, tree_node_t* node) {
if(father == NULL || node == NULL)
return;
node->father = father;
if(father->eChild == NULL) {
father->fChild = node;
}
else {
fa... |
<filename>webpack.mix.js<gh_stars>0
const { mix } = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpa... |
function resolveModuleDependencies(modules: ModuleMetadata[]): string[] {
const moduleMap = new Map<string, ModuleMetadata>();
// Populate module map for easy access
modules.forEach(module => {
moduleMap.set(module.declarations[0], module);
});
const visited = new Set<string>();
const result: string[]... |
<filename>reinvent-2020/RhythmCloud/analytics/rhythm-analyzer/flink-application/src/main/java/com/amazonaws/rhythmcloud/io/TimestreamDBSink.java
package com.amazonaws.rhythmcloud.io;
import org.apache.flink.api.common.state.ListState;
import org.apache.flink.api.common.state.ListStateDescriptor;
import org.apache.flin... |
<reponame>chlds/util<filename>lib/car/obj/src/encode_surrogate_w.c
/*
Encode a character into bytes based on UTF-8.
Remarks:
Return the number of encoded bytes.
*/
# define CAR
# include "../../../incl/config.h"
signed(__cdecl encode_surrogate_w(signed char(**di),signed short(second),signed short(first))) {
auto ... |
#!/usr/bin/env 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 "Lice... |
<gh_stars>0
/*
Copyright (c) 2011-2013 <NAME>, <NAME>
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, copy, modify, merge, publ... |
def calculate_accuracy(true_file, imputed_file, seed):
# Read true and imputed genetic data from files
true_data = read_genetic_data(true_file)
imputed_data = read_genetic_data(imputed_file)
# Calculate accuracy for HD markers
hd_accuracy = 1.0
# Calculate accuracy for LD markers with ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.