text stringlengths 1 1.05M |
|---|
<reponame>dinhtuyen/PRML01
import numpy as np
class HiddenMarkovModel(object):
"""
Base class of Hidden Markov models
"""
def __init__(self, initial_proba, transition_proba):
"""
construct hidden markov model
Parameters
----------
initial_proba : (n_hidden,) n... |
def search(num, arr):
for i in range(len(arr)):
if arr[i] == num:
return i
arr = [1, 6, 5, 4, 3]
result = search(5, arr)
if result:
print("Number found at index %d" %(result))
else:
print("Number not found") |
# 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 writing, software
# distributed under t... |
<gh_stars>0
import React from 'react';
import PropTypes from 'prop-types';
import Includes from './includes';
import Header from './header';
import Footer from './footer';
import './layout.css';
const Layout = ({ siteTitle, parks, children }) => (
<>
<Includes />
<Header siteTitle={siteTitle} parks={parks}... |
def standardize(data):
mean = data.mean()
std = data.std()
z_score = (data - mean) / std
return z_score |
# const.py
DOMAIN = "energy_usage"
DOMAIN_DATA = "domain_data"
ATTRIBUTION = "Data provided by the smart meter"
# DailyUsageSensor.py
from .const import DOMAIN, DOMAIN_DATA, ATTRIBUTION
class FplDailyUsageSensor:
def __init__(self, data):
self.data = data
def get_daily_usage(self):
# Process ... |
#!/bin/bash
set -e
rm -rf vendor
if [ -d "var/" ]; then
rm -rf var/cache/*
rm -rf var/logs/*
chown -R www-data:www-data var/
fi
composer install --prefer-dist --no-interaction --optimize-autoloader -v
php bin/console doctrine:database:create --no-interaction --if-not-exists
php bin/console doctrine:migr... |
<reponame>carlosmmarques/android-isel
package pt.isel.pdm.li51n.g4.tmdbisel.data.models.schema;
import android.util.Log;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import pt.isel.pdm.li51n.g4.tmdbisel.data.m... |
### M
python -u main_informer.py --model informer --data WTH --features M --attn prob --d_layers 2 --e_layers 3 --itr 3 --label_len 168 --pred_len 24 --seq_len 168 --des 'Exp'
python -u main_informer.py --model informer --data WTH --features M --attn prob --d_layers 1 --e_layers 2 --itr 3 --label_len 96 --pred_len 48 ... |
def calculate_molecular_weight(compound: str, atomic_weights: dict) -> float:
weight = 0.0
current_element = ""
current_count = 0
for char in compound:
if char.isalpha():
if current_element:
weight += atomic_weights.get(current_element, 0) * max(current_count, 1)
... |
// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "patchpanel/arc_service.h"
#include <fcntl.h>
#include <linux/rtnetlink.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/utsname.h... |
<gh_stars>1-10
/**
* tweaked forwardRef for supporting `as` prop
*
* All credit goes to chakra-ui, Reach UI, Reakit, fluentui for base types
* & forwardRef function
*/
import React from "react";
export type OmitCommonProps<Target, OmitAdditionalProps extends keyof any = never> = Omit<
Target,
"transition... |
<reponame>koksyn/hexagonal-java-report-generator<filename>application/src/main/java/com/report/application/entity/FilmCharacter.java<gh_stars>1-10
package com.report.application.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.... |
limit = 8
odds = []
for i in range(limit):
if i % 2 != 0 and i > limit:
odds.append(i) |
require 'sinatra/base'
require 'securerandom'
require 'json'
require 'open3'
module HaproxyHelper
def self.generate_names(config)
backend_title = ""
config["backends"].each do |backend|
backend["title"] = p SecureRandom.urlsafe_base64(6)
backend_title = backend["title"]
backend["servers"]... |
package affiliation
import "database/sql"
// Identity contains sortingHat user Identity
type Identity struct {
ID sql.NullString
UUID sql.NullString
Name sql.NullString
Username sql.NullString
Email sql.NullString
Domain sql.NullString
Gender sql.NullStri... |
<gh_stars>0
/*
* 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
* "Lic... |
<reponame>thadcsmith/koa-i18next-detector<filename>src/lookups/session.js
export default {
name: 'session',
lookup(ctx, options) {
let found;
if (options.lookupSession && ctx && ctx.session) {
found = ctx.session[options.lookupSession];
}
return found;
},
ca... |
class CardGame:
def __init__(self, nPlayers):
self.nPlayers = nPlayers
# Other initialization code for the card game
def dealCards(self, peopleSlap):
if some_condition: # Replace with the actual condition to check
self._whoDeals = k
else:
for k in range(... |
<gh_stars>1-10
export default function SelectFieldScript() {
// Elements
const selectWrapper = document.getElementById("iq-select-wrapper");
const selectElm = document.getElementById("iq-select-field");
selectElm.value = selectElm.getAttribute("defaultvalue");
if (selectElm.value === "")
selectWrapper.classList... |
#!/bin/sh
set -e
set -u
set -o pipefail
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
fi
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_P... |
#!/bin/sh
set -e
# export DISTRIBUTION to use something other than unstable (or whatever was
# last used in debian/changelog). see dch(1). can use a DEBVERSION exported
# in the process's environment.
usage() { echo "usage: `basename $0` version" ; }
[ $# -eq 1 ] || { usage >&2 ; exit 1 ; }
VERSION="$1"
if [ -z "$... |
python infer_signate.py --model ../../deploy.prototxt \
--weights ../../converted_from_pytorch.caffemodel |
// From https://medium.com/@faith__ngetich/locking-down-a-project-to-a-specific-node-version-using-nvmrc-and-or-engines-e5fd19144245
const semver = require ('semver');
const { engines } = require ('../package');
const version = engines.node;
if (!semver.satisfies(process.version, version)) {
throw new Error(`The cu... |
/// Specifies one member of D3D12_QUERY_HEAP_TYPE.
public var type: D3DQueryHeapType {
get {
return D3DQueryHeapType(rawValue: RawValue(Type: self.rawValue.Type)) // Assuming self is an instance of the enclosing type
}
set {
self.rawValue.Type = newValue.rawValue
}
} |
package commands
import (
"errors"
inventoryPkg "github.com/cbuschka/tfvm/internal/inventory"
"github.com/cbuschka/tfvm/internal/util"
"github.com/cbuschka/tfvm/internal/version"
workspacePkg "github.com/cbuschka/tfvm/internal/workspace"
)
// RunTfvmInstallCommand runs tfvm install command.
func RunTfvmInstallCo... |
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'filterPipe'
})
export class FilterPipe implements PipeTransform {
transform(items: any[], searchText: string): any {
if(!items) return [];
if(!searchText) return items;
searchText = searchText.toLowerCase();
return items.filter( item => {
r... |
<filename>src/client/reducers/uploadReducer.js
export default function(state = {uploading: false, error: false, replay: null}, action) {
switch (action.type) {
case 'UPLOAD_STARTED':
return {...state, uploading: true, error: false};
case 'UPLOAD_FAILURE':
return {...state, uploading: false, error:... |
#!/bin/bash
#Get Asset Chain Names from json file
echo -e "\e[91m WARNING: This script creates addresses to be use in pool config and payment processing"
echo " The address, privkey, and pubkey are stored in a owner read-only file"
echo -e " make sure to encrypt, backup, or delete as required \e[39m"
if [ ! -d ~/kmd_p... |
#!/usr/bin/env bash
#
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the... |
<reponame>petercunning/notebook
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
# -*- coding: utf-8 -*-
"""
Map tile acquisition
--------------------
Demonstrates cartopy's ability to draw map tiles which are downloaded on
demand from the MapQuest tile server. Internally these tiles are then combined... |
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { AuthGuard } from './auth/auth.guard';
import { ServicesComponent } from './services/services.component';
import { CompaniesListComponent } from './companies... |
export class UsersService {
constructor({
usersRepository,
}) {
this.usersRepository = usersRepository;
}
findOrCreate(options) {
return this.usersRepository.findOrCreate(options).then(users => users[0]);
}
} |
require 'spec_helper'
require 'rest_spec_helper'
require 'rhc/commands/setup'
# just test the command runner as we already have extensive wizard tests
describe RHC::Commands::Setup do
subject{ RHC::Commands::Setup }
let(:instance){ subject.new }
let!(:config){ base_config }
before{ described_class.send(:public... |
#!/bin/sh
python3 -m grpc_tools.protoc -I. --python_out=. --mypy_out=. --grpc_python_out=. spacy_grpc/spacy.proto
|
class DropSourceTags < ActiveRecord::Migration
class ::SourceTag < ActiveRecord::Base
has_many :source_taggings
has_many :links, :through => :source_taggings
end
class ::SourceTagging < ActiveRecord::Base
belongs_to :source_tag
belongs_to :link
end
class ::Link < ActiveRecord::Base
... |
<gh_stars>100-1000
import React from "react";
import { CookieConsent } from "@site/src/features/cookie-consent";
// Default implementation, that you can customize
// https://docusaurus.io/docs/using-themes#wrapper-your-site-with-root
function Root({ children }) {
return (
<>
{children}
... |
require 'test_helper'
class RestoresHelperTest < ActionView::TestCase
end
|
#import <stdio.h>
int main ()
{
int num, i, isPrime;
printf("Prime numbers between 1 and 50 are: \n");
for(num = 1; num <= 50; num++)
{
isPrime = 1;
for(i=2; i<=num/2; i++)
{
if(num%i==0)
{
isPrime = 0;
... |
<filename>components/layout/MainLayout.js
import Header from './Header';
import Footer from './Footer';
const MainLayout = props => {
return (
<div className='h-100 d-flex flex-column'>
<div>
<Header lang={props.lang} small={props.smallHeader} activePage={props.activePage} otherLangLink={props.othe... |
#!/bin/bash
# Configuration script for libpng 1.6.37
# Library release date: 2019/04/14
export FM_LIBPNG_NAME="libpng"
export FM_LIBPNG_VERSION="1.6.37"
export FM_LIBPNG_FULL_NAME="${FM_LIBPNG_NAME}-${FM_LIBPNG_VERSION}"
export FM_LIBPNG_TARBALL_NAME="${FM_LIBPNG_FULL_NAME}.tar.xz"
export FM_LIBPNG_TARBALL_DOWNLOAD_UR... |
<reponame>Ianwanarua/McJowells-Pizza<gh_stars>0
//Declaration
let type;
let crust;
let topping;
//constructor
function McPizza(type, size, crust, topping) {
this.type = type;
this.size = size;
this.crust = crust;
this.topping = topping;
}
//Crust prize
McPizza.prototype.getCrust = function () {
if ... |
<gh_stars>0
public class ControleRemoto implements Controlador {
// PROPRIETIES
private Integer volume;
private Boolean isOn, playing;
// CONSTRUCT
public ControleRemoto(){
this.volume = 50;
this.isOn = false;
this.playing = false;
}
// GETTERS
private Integer... |
#!/usr/bin/env bash
# Examples:
# export API="bootstrap=192.168.222.30:6443,master-0=192.168.222.31:6443,master-1=192.168.222.32:6443,master-3=192.168.222.33:6443"
# export API_LISTEN="127.0.0.1:6443,192.168.222.1:6443"
# export INGRESS_HTTP="master-0=192.168.222.31:80,master-1=192.168.222.32:80,master-3=192.168... |
<filename>src/main/java/br/com/alinesolutions/anotaai/model/produto/EntradaMercadoria.java
package br.com.alinesolutions.anotaai.model.produto;
import java.time.ZonedDateTime;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorVal... |
<reponame>OpenHosec/govici
// Copyright (C) 2019 Arroyo Networks, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to ... |
#!/bin/bash
set -e
export NODE_OPTIONS="--max-old-space-size=3000"
if [ -z "$VIRTUAL_ENV" ]; then
echo "This requires the melati python virtual environment."
echo "Execute '. ./activate' before running."
exit 1
fi
if [ "$(id -u)" = 0 ]; then
echo "The Melati Blockchain GUI can not be installed or run by the r... |
require 'tmpdir'
require 'digest/md5'
module Capistrano
module GitCopy
# Utility stuff to avoid cluttering of deploy.cap
class Utility
def initialize(context)
@context = context
end
# Check if repo cache exists
#
# @return [Boolean] indicates if repo cache exists
... |
#!/bin/sh
#----------------------------------------------------------------------------#
# OpenBSD client for Xymon #
# #
# Copyright (C) 2005-2010 Henrik Storner <henrik@hswn.dk> ... |
#!/usr/bin/env bash
echo -e "\e[1;33m This script will Setup Repositories and attempt the No-Nag fix. PVE7 ONLY \e[0m"
while true; do
read -p "Start the PVE7 Post Install Script (y/n)?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
if ... |
#!/bin/bash
function usage() {
echo " -t|--target-dir <dir> local target directory for prepare a Ray cluster deployment package"
echo " [-s|--source-dir] <dir> local source directory to prepare a Ray cluster deployment package"
}
while [ $# -gt 0 ];do
key=$1
case $key in
-h|--help)
... |
<filename>pd-for-ios/DispatcherSample/DispatcherSample/SampleListener.h
//
// SampleListener.h
// DispatcherSample
//
// Copyright (c) 2011 <NAME> (<EMAIL>)
//
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "LICENSE.txt," in this distribution.
//
#import <... |
import React, { Component } from 'react';
import { Paper, Typography } from '@material-ui/core';
import { storage } from '../../services/element';
export class Storage extends Component {
state = {};
async componentWillMount() {
const info = await storage.ipfs.version();
this.setState({
info,
... |
# Generated by Powerlevel10k configuration wizard on 2021-07-25 at 14:34 IDT.
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 19275.
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 24h time,
# 1 line, compact, few icons, concise, instant_prompt=verbose.
# Type `p10k configur... |
#set -x
# Authors:
# Eduardo Garcia (bidu@lncc.br)
# Diego Volpatto (volpatto@lncc.br)
dirPadrao="dirExp00"
dirNew="dirExp01"
dirExp="$(pwd)"/${1:-${dirPadrao}}
dirExpNew="$(pwd)"/${2:-${dirNew}}
comandoRun="$(pwd)/rodarSimulador.sh $dirNew"
echo $comandoRun
eval $comandoRun
comando="diff $dirExp/disp.1 $dirExpNew... |
<reponame>mouchtaris/jleon
package gv
package isi
package io
import java.nio.channels.{ WritableByteChannel, ReadableByteChannel }
import java.nio.file.{ StandardOpenOption ⇒ opt, Files ⇒ JFiles, Path ⇒ JPath }
trait File extends Any {
@inline
final def exists(path: JPath): Boolean =
JFiles exists path
@i... |
<reponame>gavofyork/RipInPeace<gh_stars>1-10
#pragma once
#include <thread>
#include <vector>
#include <QSystemTrayIcon>
#include <QDialog>
#include <QTime>
#include "DiscInfo.h"
#include "Paranoia.h"
#include "ui_Info.h"
class QAction;
class QTableWidget;
class Settings;
struct cddb_conn_s;
struct cddb_disc_s;
cla... |
var fs = require("fs");
var statInfo = fs.statSync("let03.js");
console.log(statInfo);
var isFile = statInfo.isFile();
console.log("Is File: "+ isFile); // Is File: true
var isDir = statInfo.isDirectory();
console.log("Is Dir: "+ isDir); //Is Dir: false
|
def mostFrequentElement(arr):
max_count = 1;
res = arr[0];
curr_count = 1;
for i in range(1, len(arr)-1):
if arr[i] == arr[i+1]:
curr_count += 1;
else:
if curr_count > max_count:
max_count = curr_count
... |
#!/bin/bash
CUR=`pwd`
TOPDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
HOSTNAME=${1:-open4us.org}
DBNAME=${2:-wordpress}
DBUSER=${3:-dbuser}
DBPASS=${4:-}
cd ${TOPDIR}
#
# Git submodules
#
git submodule init
git submodule update
#
# Process substitutions in .in files
#
subst="s|@env_dir@|${TOPDIR}/p... |
#! /usr/bin/env ruby
# encoding: utf-8
# frozen-string-literal: true
require "fileutils"
require "json"
require "open-uri"
require "yaml"
class Object
def array_enclosed
[self]
end
end
class Array
def array_enclosed
self
end
end
DataInf = Struct.new(:seibetu, :nenrei, :sintyoo, :atai, :nendo, :taizy... |
$ ballerina run global-variables.bal
#Prints the value of the global variable 'total'.
98
#Prints the updated value of the global variable 'content'.
This is a sample text
|
#!/bin/bash
# Runs tests for a module using all harnesses and python versions.
#
# This is only relevant for your local device when suing VirtualBox VMs.
# It expects that you have created the VMs with Vagrant, waited for the
# to boot, and created Snapshots of them.
#
MODULE=$1
DIR="$( cd "$( dirname "${BASH_SOURCE[... |
/**
* This file is used to declare unit test for the exercises that are
* mainly bodyweight exercises (e.g. pullups)
*/
import 'react-native';
import {
getSingleExerciseStrengthScore,
getOneRepMaximumForBodyWeightExercise,
} from '../src/components/strengthScore';
import {isBodyweightExercise} from 'components/... |
<gh_stars>0
import { Button, TextInput } from 'evergreen-ui';
import React from 'react';
import Thread from './diamond-threads/Thread'
interface ThreadClientState {
lastSubmissionId: string | null,
}
export default class ThreadClient extends React.Component {
state: ThreadClientState = {
lastSubmissionId: null,... |
<reponame>Wiskey-farketmez/cerberus_research<gh_stars>100-1000
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.FormBody;
import okhttp3.RequestBody;
import java.io.File;
import java.io.FileWriter;
import java.io.FileNotFoundException;
import java.io.IOException;
import java... |
package search;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
*
* @author exponential-e
* 백준 20125번: 쿠키의 신체 측정
*
* @see https://www.acmicpc.net/problem/20125
*
*/
public class Boj20125 {
private static final String SPACE = " ";
private static final String NEW_LINE = "\n";
pr... |
export GOPATH=$GOPATH:`pwd`/src/go
export PATH=$PATH:${GOPATH//://bin:}/bin
echo "go path? ${GOPATH}"
gopherjs build github.com/eapearson/example -o src/plugin/iframe_root/apps/example.js |
<filename>sandbox/src/main/java/org/mammon/sandbox/objects/bank/BlindedIdentity.java
package org.mammon.sandbox.objects.bank;
import org.mammon.math.FiniteField;
import org.mammon.math.Group;
import org.mammon.messaging.FromPersistent;
import org.mammon.messaging.PersistAs;
import org.mammon.sandbox.objects.example.Ex... |
package com.littlejenny.gulimall.rabbitmq.config;
import com.littlejenny.common.constant.RabbitmqConstants;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframe... |
<gh_stars>1-10
export const PunctuationNovel = `year,exclam.year,quest.year,period.year,comma.year,semi.year,colon.year,total.year
1791,0.0023517012,0.0035255413,0.0422664336,0.0845731794,0.0122242124,0.0038474668,0.1522737553
1792,0.0058104946,0.0046323854,0.0433463537,0.0826068559,0.0137638736,0.001451127,0.152051616... |
/* ///////////////////////// LEGAL NOTICE ///////////////////////////////
This file is part of ZScripts,
a modular script framework for Pokemon Online server scripting.
Copyright (C) 2013 <NAME>, aka "ArchZombie" / "ArchZombie0x", <<EMAIL>>
This program is free software: you can redistribute it and/or modify
it un... |
/**
* Mnemonist HashedArrayTree Typings
* ==================================
*/
import {IArrayLikeConstructor} from './utils/types';
type HashedArrayTreeOptions = {
initialCapacity?: number;
initialLength?: number;
blockSize?: number;
}
export default class HashedArrayTree<T> {
// Members
blockSize: num... |
<gh_stars>1-10
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... |
import subprocess
def install_jupyter_kernel(kernel_name, sys_prefix):
subprocess.run(['jupyter', 'kernelspec', 'install', kernel_name, '--sys-prefix'], check=True)
def launch_jupyter_notebook(notebook_dir, token):
subprocess.run(['jupyter', 'notebook', f'--notebook-dir={notebook_dir}', f'--NotebookApp.token=... |
## ARGV and ARGF
ruby -e 'puts ARGV' f[1-3].txt greeting.txt
ruby -ne 'puts "#{ARGV.size}: " + ARGV * ","' f[12].txt table.txt
ruby -ne 'puts "--- #{ARGF.filename} ---" if $. == 1;
print;
ARGF.close if ARGF.eof' greeting.txt table.txt
ruby -ne 'print if ARGF.eof' greeting.txt table.txt
ruby -ne... |
package store;
public interface DataStore {
byte[] get(byte[] key);
void put(byte[] key, byte[] value);
void close();
}
|
#!/bin/bash
set -o nounset
set -o errexit
set -o pipefail
function read_shared_dir() {
local key="$1"
yq r "${SHARED_DIR}/cluster-config.yaml" "$key"
}
function populate_artifact_dir() {
set +e
echo "Copying log bundle..."
cp "${dir}"/log-bundle-*.tar.gz "${ARTIFACT_DIR}/" 2>/dev/null
echo "Removing REDA... |
class BaseModel:
item_type = None
computed_properties = []
def strip_computed_properties(self, data):
stripped_data = data.copy()
for prop in self.computed_properties:
if prop in stripped_data:
del stripped_data[prop]
return stripped_data |
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def divide(x, y):
if y != 0:
return x / y
else:
return "Error! Division by zero."
def hello_world():
print("Hello, World!")
def main():
while True:
print("1. Addition")
... |
TERMUX_PKG_HOMEPAGE=https://github.com/smxi/inxi
TERMUX_PKG_DESCRIPTION="Full featured CLI system information tool"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.3.00-1
TERMUX_PKG_SRCURL=https://github.com/smxi/inxi/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=1180dd8dc7169... |
<gh_stars>1-10
#include "volume/dsp_volume_agmu.h"
#include <QtCore/QVarLengthArray>
#include <QtCore/qmath.h>
#include "volume/dsp_helpers.h"
#include "volume/db.h"
#include "core/ts_logging_qt.h"
DspVolumeAGMU::DspVolumeAGMU(QObject *parent)
{
setParent(parent);
}
// Funcs
void DspVolumeAGMU::process(int16_t... |
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/add", methods=["GET"])
def add_numbers():
a = request.args.get("a")
b = request.args.get("b")
result = int(a) + int(b)
return jsonify(result) |
#!/bin/bash
# create subclasses for Milli, Micro, Nano, Pico from the Femto subclass
# The Units subclass should be done manually, because it has some minor optimizations
# replacement method. It expects 3 parameters: The class prefix, the number of decimals, and the unit
createFromFemtos() {
folder=src/main/java/... |
cd make/libmp4base/linux_amd64
make |
(function(){
var eModules = [],
eType = 'creator',
entities = getEntityNames(eType);
for(var i = 0; i < entities.length; i++){
var m = entities[i] + "." + eType + ".backend.calls";
eModules.push(m);
jQuery.sap.registerModulePath(m, registerPrefix + "/pcmapps/" + entities... |
Let x, y, and z represent the number of pips on each die of the three dice. Then the number of possible combinations of three dice rolls is equal to:
C(x,y,z) = (x * y * z) + (x * y * (z - 1)) + (x * (y - 1) * z) + (x * (y - 1) * (z - 1)) + ((x - 1) * y * z) + ((x - 1) * y * (z - 1)) + ((x - 1) * (y - 1) *... |
#!/bin/bash
find . -type f \( -iname \*.json \) -exec sed -i '' 's/\"owner\"/\"_owner\"/g' {} \;
find . -type f \( -iname \*.json \) -exec sed -i '' 's/\"modified\"/\"_modified\"/g' {} \;
find . -type f \( -iname \*.json \) -exec sed -i '' 's/\"modifier\"/\"_modifier\"/g' {} \;
find . -type f \( -iname \*.json \) -exe... |
echo "***************************"
echo "** Building jar ***********"
echo "***************************"
mvn -DskipTests clean install
|
#!/bin/bash
fw_depends php7 nginx composer
sed -i 's|localhost|'"${DBHOST}"'|g' index.php
sed -i 's|root .*/FrameworkBenchmarks/limonade|root '"${TROOT}"'|g' deploy/nginx.conf
sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
php-fpm --fpm-config $FWROOT/config/php-fpm.conf -g $TROOT/deploy/php-fp... |
#!/bin/bash
# Installs mailcatcher using RVM. RVM allows us to install all mailcatcher
# dependencies reliably.
mailcatcher_version="$(/usr/bin/env mailcatcher --version 2>&1 | grep 'mailcatcher ' | cut -d " " -f 2)"
if [[ -n "${mailcatcher_version}" ]]; then
pkg="Mailcatcher"
space_count="$(( 20 - ${#pkg}))" #11
... |
def create_crawler(self, base_name, role_arn, s3_script_bucket, script_path, db_name, table_name, s3_bucket_dst):
# Assuming the necessary AWS SDK (boto3) is imported and configured
# Construct the unique crawler name based on the base name
crawler_name = f"{base_name}_crawler"
# Create the web crawle... |
#include <iostream>
#include <algorithm>
#include <string>
int main() {
std::string arr[] = {"Hello", "World", "Cats", "Dogs"};
std::sort(arr, arr+4);
for (int i = 0; i < 4; i++)
std::cout << arr[i] << std::endl;
return 0;
}
/* Output:
Cats
Dogs
Hello
World
*/ |
<filename>src/utils/mp3.ts
import getMp3DurationBits from 'get-mp3-duration';
import { extractLast } from './funcs';
const SUPPORTED_FORMATS = ['mp3'];
const getTagsSize = (buffer: Buffer): number => {
/* eslint-disable no-bitwise, max-len */
// http://id3.org/d3v2.3.0
if (buffer[0] === 0x49 && buffer[1] === 0x... |
#include <iostream>
struct Data {
// Define the structure of the Data object
};
struct FrameGraphPassResources {
// Define the structure of the FrameGraphPassResources object
};
void BlurData(const Data &data, FrameGraphPassResources &resources, void *ctx) {
// Apply the blur effect to the input data usi... |
public class User {
private Long id;
private String firstName;
private String lastName;
private Integer age;
private String email;
public User(Long id, String firstName, String lastName, Integer age, String email) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
this.ema... |
import os
def get_absolute_path(root_path: str, relative_path: str) -> str:
return os.path.abspath(os.path.join(root_path, relative_path)) |
<filename>use-cases/Synthetic/t37/m1.js
var _;
_ = ArrayBuffer.length;
_ = ArrayBuffer.name;
_ = ArrayBuffer.prototype;
_ = ArrayBuffer.isView;
|
#!/bin/bash
pushd ~/piexperiments
git pull
stonks/stonkinstallscripts.sh
popd
|
from datetime import datetime
import pytz
def convert_timezone(dt, target_timezone):
"""
Converts the given datetime object to the target time zone.
Args:
dt: A datetime object representing the original date and time.
target_timezone: A string representing the target time zone (e.g., 'America/New_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.