text stringlengths 1 1.05M |
|---|
<filename>src/core/interceptors/transform.interceptor.ts
import {
NestInterceptor,
Injectable,
ExecutionContext,
CallHandler,
} from '@nestjs/common';
import { PaginateResult } from 'mongoose';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { Reflector } from '@nestjs/core';
imp... |
#!/bin/bash
# From https://github.com/kivy/kivy-ios
# Set up build locations
export RENIOSDEPROOT="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
export TMPROOT="$RENIOSDEPROOT/tmp"
export CACHEROOT="$RENIOSDEPROOT/cache"
# Set up path to include our gas-preprocessor.pl
export $PATH="$RENIOSDEPROOT/script... |
class Card:
def __init__(self, rarity):
valid_rarities = {"UR", "SSR", "SR"}
if rarity not in valid_rarities:
raise ValueError("Invalid rarity level")
self._rarity = rarity
def get_rarity(self):
return self._rarity
def set_rarity(self, new_rarity):
valid... |
#!/bin/bash
# Copyright (c) 2012 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.
FLAGS_HELP="
usage: ./bin/concat.sh -i FILE [-o FILE] [-f]
This script concatenates a list of files into a single file. The list of file... |
import { Player, uuid } from "@cph-scorer/model";
import { ApiProperty } from "@nestjs/swagger";
import { IsBoolean, IsNotEmpty, IsUUID } from "class-validator";
export class PlayerDTO extends Player {
@ApiProperty()
@IsNotEmpty()
@IsUUID("4")
public id: uuid;
@ApiProperty()
@IsNotEmpty()
public firstNa... |
<reponame>luisdiasdev/simple-social-network
package br.com.agateownz.foodsocial.modules.user.controller;
import br.com.agateownz.foodsocial.config.ApplicationProfiles;
import br.com.agateownz.foodsocial.modules.shared.annotations.MockMvcContextConfiguration;
import br.com.agateownz.foodsocial.modules.shared.controller... |
<gh_stars>10-100
package com.github.robindevilliers.welcometohell.ui.renderers;
import com.github.robindevilliers.welcometohell.ui.RendererUtilities;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.springframework.stereotype.Component;
import com.github.robindevill... |
package cyclops.container.immutable;
import cyclops.container.relational.Contains;
import cyclops.container.control.Try;
import cyclops.container.immutable.impl.Seq;
import cyclops.container.immutable.impl.Vector;
import cyclops.container.immutable.tuple.Tuple2;
import cyclops.container.immutable.tuple.Tuple3;
import... |
<filename>open-sphere-plugins/csv-common/src/main/java/io/opensphere/csvcommon/format/factory/CellFormatterFactory.java<gh_stars>10-100
package io.opensphere.csvcommon.format.factory;
import java.util.Map;
import io.opensphere.core.preferences.PreferencesRegistry;
import io.opensphere.core.util.collections.New;
... |
import { getLogger } from '../logger.ts';
import { pair, Pair } from '../types/mod.ts';
import { next_async } from '../lib/iterable/mod.ts';
import { scan } from './scan.ts';
const logger = await getLogger('methods/enumerate');
async function* _enumerate_impl_fn<T>(iter: AsyncIterable<T>): AsyncIterable<Pair<numbe... |
<filename>blingfirecompile.library/inc/FAPrintUtils.h
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
#ifndef _FA_PRINT_UTILS_H_
#define _FA_PRINT_UTILS_H_
#include "FAConfig.h"
#include <iostream>
namespace BlingFire
{
class FARegexpTree;
c... |
<filename>e2e/cypress/integration/ui/settings/data-feed/data-feed-create.spec.ts
describe('chef datafeed', () => {
const name = 'cytest',
url = 'http://test.com',
username = 'admin',
password = 'password',
tokenType = 'TestType',
token = '<PASSWORD>=',
endpoint = 'https://test.com',
bucke... |
def find_primes(n):
primes = []
for i in range(2, n+1):
is_prime = True
for j in range(2, i):
if i % j == 0:
is_prime = False
break
if is_prime:
primes.append(i)
return primes
print(find_primes(10)) # prints [2, 3, 5, 7] |
<reponame>cyberdevnet/mer-hacker
import React from "react";
import Dialog from '@material-ui/core/Dialog';
import "../../styles/CreateTemplateModal.css";
export default function GetAllClientsModal(ac) {
let ClientList = Number(ac.dc.clientListID)
const Cancel = () => {
ac.dc.setshowclientModal(fals... |
<filename>stardog/js/load.js
var loadState = {
preload: function() {
//logo
game.load.image('logo', 'assets/stardog.png');
game.load.spritesheet('bg', 'assets/titlescreen.png', 1200, 600);
//music
game.load.audio('music1', 'assets/audio/logoMusic.mp3');... |
conda list -p $PREFIX --canonical
# Test the build string. Should contain NumPy, but not the version
conda list -p $PREFIX --canonical | grep "conda-build-test-numpy-build-run-1\.0-py..h......._0"
|
<reponame>ArcheSpace/Arche.js<gh_stars>1000+
import { ColorSpace } from "./enums/ColorSpace";
/**
* Render settings.
*/
export interface EngineSettings {
/** Color space.*/
colorSpace?: ColorSpace;
}
|
// Autogenerated from library/channels.i
package ideal.library.channels;
import ideal.library.elements.*;
public interface readonly_output<element> extends readonly_closeable, readonly_syncable, any_output<element> { }
|
#!/bin/sh
####################
## Jib and deploy ##
####################
# Tool for building Docker container with Gradle and jib, and deploying to AWS ECS
#
# Requirements:
# * aws-cli
# * amazon-ecr-credential-helper
#
# Usage:
# $ ./jib-aws-deploy needToLogin serviceANR clusterANR checkPeriod [buildParams]
# * nee... |
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import requests
import urllib3
import traceback
# main URL to connect to
MAIN_URL = 'https://us-central1-yuce-8-v1.cloudfunctions.net/yuce_8_api_client'
# supported intervals by YUCE-8
INTERVAL_1D = '1d'
IN... |
//
// CreateOrderServiceCell.h
// allrichstore
//
// Created by zhaozhe on 16/11/16.
// Copyright © 2016年 allrich88. All rights reserved.
//
#import "BaseTableViewCell.h"
@class CreateOrderServiceModel;
@interface CreateOrderServiceCell : BaseTableViewCell
/** model */
@property(nonatomic,strong) CreateOrderServi... |
package com.infamous.framework.http.core;
import com.infamous.framework.converter.ObjectMapper;
import com.infamous.framework.http.HttpMethod;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
public interface HttpRequest<R extends HttpRequest> {
R queryParam(String key, Collection<?>... |
#!/bin/bash
# Attaches another terminal to an existing terminal
docker exec -i -t gazelle-front-end bash
|
<reponame>lananh265/social-network<gh_stars>1-10
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.alignCenter = void 0;
var alignCenter = {
"viewBox": "0 0 8 8",
"children": [{
"name": "path",
"attribs": {
"d": "M.09 0c-.06 0-.09.04-.09.09v1.91h2v-1.91c0-.06-.04-... |
#!/bin/bash
. "$(dirname $(readlink -f "$0"))/filenames.sh"
echo "Filename for app zip file will be: $FILENAME_APP"
(cd ./dist && zip -r $FILENAME_APP *)
(zip ./dist/$FILENAME_APP Staticfile)
|
#!/usr/bin/env bash
if [ -n "$DEBUG_DRUPALPOD" ]; then
set -x
fi
# Load env vars during prebuild using `gp env` command
if [ -n "$GITPOD_HEADLESS" ]; then
eval "$(gp env -e | grep DP_GOOGLE_ACCESS_KEY)"
eval "$(gp env -e | grep DP_GOOGLE_SECRET)"
fi
# Establish connection with Google Cloud through Minio c... |
const isMtrxLike = require('../src/isMtrxLike')
const assert = require('assert')
describe('isMtrxLike', function() {
it('return a bool', function() {
let a = [[1, 2, 3], [2, 3, 5]]
assert.strictEqual(isMtrxLike(a), true)
let b = [[1, 2, 4], [3, 2]]
assert.strictEqual(isMtrxLike(b), false)
let ... |
import { Injectable } from '@angular/core';
import { CanActivate, Router, ActivatedRouteSnapshot, RouterStateSnapshot} from '@angular/router';
import { UserLoginService } from '../user/user-login/user-login.service';
@Injectable()
export class AuthGuard implements CanActivate {
constructor(
private router: Rout... |
//
// KunAppDelegate.h
// CatogaryDemo
//
// Created by kunkunGit on 10/26/2018.
// Copyright (c) 2018 kunkunGit. All rights reserved.
//
@import UIKit;
@interface KunAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
import axios, { AxiosRequestConfig } from "axios";
import { useContext, useEffect, useRef } from "react";
import { useHistory } from "react-router-dom";
import { AuthTokenContext } from "../authorization/AuthTokenProvider";
import { isIDPEnabled, isLoginDisabled } from "../environment";
export const useApiUnauthorize... |
<reponame>jieyouxu/Functional-JavaScript-Snippets
/**
* Given:
* - An `options` object
* - A nullable `key`
* - A `defaultOption`
* Returns the associated value of `options[key]`, or if `options[key]` is
* falsy or undefined, return the `defaultOption` otherwise.
*/
const optionOrDefault = (defaultOption, opt... |
def check_solution_satisfiability(solution_precs, specs_to_add, specs_to_remove):
# Create a set of all package dependencies after adding and removing
updated_solution = solution_precs.union(specs_to_add).difference(specs_to_remove)
# Check if the updated solution is satisfiable
satisfiable = is_satisf... |
module.exports = function toReadable(number) {
let num = number.toString().split("");
function switcherOne(num) {
let phrase = "";
switch (num[0]) {
case "0":
phrase = "zero";
break;
case "1":
phrase = "one";
... |
/**
* Copyright 2021 <NAME> and the Contributors - https://github.com/ArnabXD/TGVCBot/graphs/contributors
*
* 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/L... |
#!/bin/bash
# Install jq
apt-get update
apt-get install -y jq
# Install Pip Packages
pip install captum torchvision matplotlib pillow pytorch-lightning flask flask-compress ipywidgets minio
# Install Yarn
npm install npm
npm install yarn
# Install Jupyter Notebook Widgets
jupyter nbextension install --py --symlink ... |
<filename>node_modules/@nivo/colors/dist/types/schemes/categorical.d.ts
export declare const categoricalColorSchemes: {
nivo: string[];
category10: readonly string[];
accent: readonly string[];
dark2: readonly string[];
paired: readonly string[];
pastel1: readonly string[];
pastel2: readonly... |
#! /bin/sh
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program ... |
#!/bin/bash
# Check if Ubuntu 18.04 or 16.04
if [ "$(lsb_release -r -s)" != "18.04" ] && [ "$(lsb_release -r -s)" != "16.04" ]; then
echo "WARNING: This operating system may not be supported by this script."
echo "Continue? (y/n)"
read PROMPT
if [ "$PROMPT" == "n" -o "$PROMPT" == "N" ]
then
... |
<filename>app/core/CoreOfWallet/control/profile.js
let facade = require('gamecloud');
/**
* 个人中心
* Create by gamegold Fuzhou on 2018-11-27
*/
class profile extends facade.Control
{
/**
* 提取VIP福利
* @param {*} user
* @param {*} params
*
* @todo 可以将提取日志写入邮件系统,记录诸如TXID等信息备查
*/
a... |
<reponame>ryurock/shizoo
/// <reference path="../../node_modules/electron/electron.d.ts" />
const electron = require('electron');
const ipcMain: typeof Electron.ipcMain = electron.ipcMain;
const BrowserWindow: typeof Electron.BrowserWindow = electron.BrowserWindow;
const app: Electron.App = electron.app;
import {OAuth... |
#!/bin/bash
set -e
node_modules/.bin/rimraf dist
mkdir dist
node_modules/.bin/tsc -p .
node_modules/.bin/rimraf dist-es6
mkdir dist-es6
node_modules/.bin/tsc -p . -t esnext -m commonjs --outDir dist-es6
node_modules/.bin/rollup dist-es6/browser.js --format cjs --output dist-browser.js
node_modules/.bin/rollup dis... |
<gh_stars>0
const banco = require('../helper/conection');
const playerRepository = require('../repository/PlayerRepository');
const { hash } = require('bcryptjs');
class CreateUserService{
async execute({ email,senha,nome,idade,sexo }){
const player = new playerRepository();
awa... |
/*
* Copyright 2019 Wultra s.r.o.
*
* 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... |
#!/bin/sh
#
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Fr... |
let scalarProduct = (2 * 4) + (-1 * 8) + (7 * -3);
scalarProduct = -26; |
<gh_stars>10-100
import Head from "next/head";
import debounce from "debounce";
import { useEffect } from "react";
import { ObjectId } from "mongodb";
import { GetServerSideProps } from "next";
import { withPageAuthRequired, getSession } from "@auth0/nextjs-auth0";
import { Grid, GridItem } from "@chakra-ui/react";
im... |
SELECT product_name
FROM products
ORDER BY product_name DESC; |
#!/bin/bash
set -e
export OMPI_MCA_plm=isolated
export OMPI_MCA_btl_vader_single_copy_mechanism=none
export OMPI_MCA_rmaps_base_oversubscribe=yes
python -c 'import shenfun'
|
/*
* Copyright 2019 <NAME>
*
* 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 ... |
<filename>demo22.solon_dubbo_provider/src/main/java/webapp/server/HelloServiceImpl.java<gh_stars>1-10
package webapp.server;
import org.apache.dubbo.config.annotation.Service;
import webapp.protocol.HelloService;
@Service(group = "hello")
public class HelloServiceImpl implements HelloService {
@Override
publi... |
<filename>back/routes/error.js<gh_stars>0
const express = require("express");
const router = express.Router();
router.get("/role", (req, res) => {
console.log("Error route role");
return res.json({ error: "You need permisions" });
});
module.exports = router;
|
/*
* Copyright (c) 2021 - <NAME> - https://www.yupiik.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.0
*
* Unless required by applica... |
#!/bin/sh
cnf_file="${1:-configs/openssl-server.cnf}"
openssl req -batch -config "${cnf_file}" -newkey rsa:2048 -sha256 -out csr/servercert.csr -outform PEM
|
def is_power_of_2(n):
if n == 0:
return False
else:
while n % 2 == 0:
n = n // 2
return n == 1
print(is_power_of_2(128)) |
<filename>guacamole-common-js/src/main/webapp/modules/StringReader.js
/*
* 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
*... |
#!/usr/bin/env bash
# Preprocess video dataset before training sound event detection model
export PYTHONPATH=/root/workspace/drama-graph
export PYTHONIOENCODING=utf-8
#evaluate sound event detection model
python sound_event_detection/src/evaluate.py |
#! /bin/bash
###########################################
#
###########################################
# constants
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto
export PATH=$PATH:$JAVA_HOME/bin
baseDir=$(cd `dirname "$0"`;pwd)
MVNNAME=maven.tgz
# functions
# main
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOUR... |
. $TESTSUITE/common.sh
OUTPUT=$(dub test -b unittest-cov --root=$(dirname "${BASH_SOURCE[0]}") --skip-registry=all --nodeps -q -- --no-colours --verbose 2>&1 || true)
echo "$OUTPUT" | grep -cE "✓ verbose 1 \(100[0-9]\.[0-9]{3} ms\)" > /dev/null
echo "$OUTPUT" | grep -cE "✓ verbose 2 \(50[0-9]\.[0-9]{3} ms\)" > /... |
<gh_stars>0
/*******************************************************************************
* Copyright 2019 <NAME>
*
* 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
*
* htt... |
<reponame>havocp/hwf
// |trace-test| TMFLAGS: full,fragprofile,treevis; valgrind
function testRegExpTest() {
var r = /abc/;
var flag = false;
for (var i = 0; i < 10; ++i)
flag = r.test("abc");
return flag;
}
assertEq(testRegExpTest(), true);
|
<gh_stars>1-10
import React, { useState } from 'react'
import { useRouter } from 'next/router'
import { Modal, Button, Row, Col, Alert } from 'react-bootstrap'
import PropTypes from 'prop-types'
import SearchUsers from '../../common/SearchUsers'
import MiniLoader from '../../common/MiniLoader'
import baseUrl from '../.... |
<reponame>rsuite/rsuite-icons
// Generated by script, don't edit it please.
import createSvgIcon from '../../createSvgIcon';
import ExclamationTriangleSvg from '@rsuite/icon-font/lib/legacy/ExclamationTriangle';
const ExclamationTriangle = createSvgIcon({
as: ExclamationTriangleSvg,
ariaLabel: 'exclamation triangl... |
<gh_stars>1000+
/*
Copyright (c) 2020-2021 Intel Corporation
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 ... |
<filename>elog/elog.go
// Copyright 2018 Cobaro Pty Ltd. All Rights Reserved.
// 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
... |
require('./check-versions')();
const config = require('./config');
const path = require('path');
const express = require('express');
const webpack = require('webpack');
const webpackConfig = require('./webpack.dev.conf');
// default port where dev server listens for incoming traffic
const { port } = config.dev;
cons... |
// Copyright (c) 2015-2016, ETH Zurich, <NAME>, Zurich Eye
// 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
// noti... |
#!/bin/bash
#SBATCH --exclude=hermes[1-4],trillian[1-3],artemis[1-7],qdata[1-8],nibbler[1-4],slurm[1-5]
#SBATCH --output=granger/80_nodes/script_23_72_75.out
#SBATCH --error=granger/80_nodes/script_23_72_75.err
#SBATCH --job-name="72-75"
hostname
date +%s%N
time blender -t 1 -b Star-collapse-ntsc.blend -s 72 -e 75 -a &... |
package com.tchocolat.kaanyagci.chocolat.Activities;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.tchocolat.kaanyagci.chocolat.R;
import com.tchocolat.kaanyagci.chocolat.Structures.Ad... |
#!/usr/bin/env bash
set -Eeuxo pipefail
here="$(dirname "${BASH_SOURCE[0]}")"
client_dir="$(git -C "$here" rev-parse --show-toplevel)"
source_commit="$(git -C "$here" log -1 --pretty=format:%h)"
tag="$(echo "$1" | tr "+" "-")"
# Clear the directory used for temporary, just in case a previous build failed
rm -r "$clie... |
def permutation(elements):
if len(elements) == 1:
yield elements
else:
for perm in permutation(elements[1:]):
for i in range(len(elements)):
yield perm[:i] + elements[0:1] + perm[i:]
permutation = list(permutation([1,2,3]))
for p in permutation:
print(p) |
<gh_stars>0
import ReactModal from "react-modal";
import React from "react";
import { Form, Button } from 'react-bootstrap'
import "../../../assests/sass/editVolunteerProfile.scss";
// import { Form, Button } from "react-bootstrap";
class ConsumerSignOffModal extends React.Component {
constructor (props) {
... |
<gh_stars>10-100
package testsubjects;
import testannotations.KindaInject;
import testinterfaces.ValueGetter;
public class ProtectedFieldCollaborator
{
@KindaInject
ProtectedField delegate;
public String getProtectedValue()
{
return delegate.protectedValue;
}
public void setProtected... |
import React, { Component } from 'react'
import { Alert, Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap'
import { translations } from '../../utils/_translations'
import PaymentModel from '../../models/PaymentModel'
import Refund from '../edit/Refund'
import BottomNavigationButtons from '../../common/Bott... |
import { Injectable } from '@angular/core';
import { constants } from 'src/constants';
import { BigQueryService } from '../big-query/big-query.service';
import { FormQueryResponse, FormQueryResultStats } from '../../home.models';
@Injectable({
providedIn: 'root'
})
export class HomeHelperService {
constructor(pri... |
set :ssh_options, {
user: 'deploy',
auth_methods: %w(publickey)
}
server '<ip/domain>', user: 'deploy', roles: %w{app web}
|
#!/usr/bin/env bash
#SBATCH --job-name extract_metadata
#SBATCH -N 1
#SBATCH -p opteron
# Use modules to set the software environment
java -jar target/code-1.0-SNAPSHOT-jar-with-dependencies.jar extract_metadata IntroClassJava
|
import random
import string
def generate_password(length):
password_characters = string.ascii_letters + string.digits
return ''.join(random.choice(password_characters) for i in range(length))
password = generate_password(8)
print("Password is:", password) |
<reponame>w-zengtao/ruby-rsa-verify
require "rsa/tools/version"
require "rsa/tools/utility"
require "rsa/tools/generator"
module Rsa::Tools
# 验签 & 用对方的公钥验签
def self.verify(public_key, data, original_data)
Utility.verify(public_key, data, original_data)
end
# 签名 & 用自己私钥签名 & RSAWithSha256 的签名
def self.sig... |
import { SET_ERROR, TOGGLE_DETAILS } from '~/actions/errors';
import { LOCATION_CHANGE } from 'react-router-redux';
const defaultState = {
json: null,
status: null,
statusText: null,
details: false,
};
export default function errors(state = defaultState, action) {
switch (action.type) {
case SET_ERROR: ... |
<reponame>gloriamutie/ColorApp
package com.gloria.GameKids.ui;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import android.os.Bundle;
import com.gloria.GameKids.R;
import com.gloria.GameKids.adapters.PlaylistPagerAdapt... |
budget -f 138 -l 171 -n MinistryofAgricultureAnimalIndustryFisheries 2014-15.pdf
budget -o -f 138 -l 139 -n MinistryofAgricultureAnimalIndustryFisheries-2 2014-15.pdf
budget -f 172 -l 175 -n DairyDevelopmentAuthority 2014-15.pdf
budget -o -f 172 -l 173 -n DairyDevelopmentAuthority-2 2014-15.pdf
budget -f 176 -l 179... |
def binaryToDecimal(binary):
decimal = 0
for i in range(0, len(binary)):
decimal += int(binary[i]) * 2**(len(binary)-1-i)
return decimal
testBinary = '1011'
result = binaryToDecimal(testBinary)
print(result) |
class TreeNode:
def __init__(self, value=0, left=None, right=None):
self.value = value
self.left = left
self.right = right
def sumOfNode(self, node):
if node is None:
return 0
return node.value + self.sumOfNode(node.left) + self.sumOfNode(node.right)
# Modif... |
// Copyright 2009 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... |
<reponame>chohra-med/mentorList<filename>src/Components/ListView.js<gh_stars>1-10
import React, {Component} from 'react';
import {
View,
ScrollView,
Image,
TouchableOpacity,
TextInput,
Text,
RefreshControl,
Switch,
I18nManager,
} from 'react-native';
import Icon from 'react-native-ve... |
from TestFxns import *
tester=PyTester("Testing the EnergyMethod module base type")
class FakeEnergyMethod(psr.EnergyMethod):
def __init__(self,myid):
"""Registers this module with ModuleManager. Internal use only!!!"""
super(FakeEnergyMethod,self).__init__(myid)
def deriv_(self,Order,wfn):... |
<filename>packages/core/decorator/interface/discord-pipe-transform.ts
import { ClientEvents } from 'discord.js';
import { ConstructorType } from '../../util/type/constructor-type';
/**
* Base pipe interface
*/
export interface DiscordPipeTransform<T = any, D = any> {
transform(
event: keyof ClientEvents,
c... |
#!/usr/bin/env bash
#
# filter_fastq_by_length.sh - Select reads to keep based on size range
#
# Version 1.0.0 (September 20, 2015)
#
# Copyright (c) 2015 Andrew Krohn
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# ar... |
#!/bin/bash
echo "" >> salida.dat
NUM=1
while [ $NUM -le 42 ]; do
./hanoi $NUM >> salida.dat
NUM=`expr $NUM + 1`
done
|
import React, { useEffect } from "react";
import { withStyles, makeStyles } from "@material-ui/core/styles";
import Paper from "@material-ui/core/Paper";
import Table from "@material-ui/core/Table";
import TableBody from "@material-ui/core/TableBody";
import TableCell from "@material-ui/core/TableCell";
import TableCon... |
// Custom exception class for insufficient funds
class InsufficientFundsException extends Exception {
public InsufficientFundsException(String message) {
super(message);
}
}
// BankAccount class
class BankAccount {
private double balance;
// Constructor
public BankAccount(double initialBal... |
#!/bin/sh
cd src
javac com/merjapp/*.java
jar cmf ../MANIFEST.MF ../merjapp.jar com/merjapp/*.class ../libs/*.jar
|
<filename>src/components/shared/MappedStakeholderForm.js<gh_stars>0
import Grid from '@material-ui/core/Grid'
import { makeStyles } from '@material-ui/core/styles'
import TextField from '@material-ui/core/TextField'
import Typography from '@material-ui/core/Typography'
import { Formik } from 'formik'
import PropTypes f... |
#!/bin/bash
$DOTS/unquoted_error
|
package serial
import (
"errors"
"fmt"
flatbuffers "github.com/google/flatbuffers/go"
"github.com/peterwilliams97/pdf-search/serial/pdf_index"
"github.com/unidoc/unidoc/common"
)
// table PdfIndex {
// num_files: uint32;
// num_pages: uint32;
// index : [byte];
// hipd: [HashIndexPathDoc];
//... |
# Create a LogFileInfo object
log_file1 = LogFileInfo("log1.txt", 1024, "2022-01-01 12:00:00")
log_file2 = LogFileInfo("log2.txt", 2048, "2022-01-02 09:30:00")
# Create a LogFileStorage instance
log_file_storage = LogFileStorage()
# Store log files
log_file_storage.store_log_file(log_file1)
log_file_storage.store_log... |
def remove_duplicates(string):
non_duplicate = ""
for char in string:
if char not in non_duplicate:
non_duplicate += char
return non_duplicate
res = remove_duplicates(string)
print(res) # Outputs "abrcd" |
import java.util.*;
public class FrequencySort {
// Function to print the frequency of words
static void frequencySort(String str)
{
HashMap<String, Integer> wordFreq = new HashMap<>();
String[] words = str.split(" ");
// Counting word frequency
for (String word : words) {
wordFreq.put(word, wordF... |
const error = require('../../error')('/server/options', {
url: ({ id }) => `https://serverjs.io/documentation/errors/#${id}`
});
error.notobject = `
Your options must be an object as required by the options definition.
If you are a developer and want to accept a single option, make sure
to use the '__root' pro... |
package acmd_test
import (
"bytes"
"context"
"flag"
"fmt"
"net/http"
"os"
"time"
"github.com/cristalhq/acmd"
)
var (
nopFunc = func(context.Context, []string) error { return nil }
nopUsage = func(cfg acmd.Config, cmds []acmd.Command) {}
)
func ExampleRunner() {
testOut := os.Stdout
testArgs := []string... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.