text
stringlengths
1
1.05M
<reponame>Vlady14/project3<filename>scripts/seedDB.js const mongoose = require("mongoose"); const db = require("../models"); mongoose.connect( process.env.MONGODB_URI || "mongodb://localhost/stock-up-users" ); const userSeed = [ { email: '<EMAIL>', username: 'mik2', firstName: 'Mike', lastName: 'B', password: '<PASSWORD>', date: new Date(Date.now()) }, { email: '<EMAIL>', username: 'mik2', firstName: 'Vlad', lastName: 'D', password: '<PASSWORD>', date: new Date(Date.now()) }, { email: '<EMAIL>', username: 'mik2', firstName: 'Josh', lastName: 'B', password: '<PASSWORD>', date: new Date(Date.now()) }, { email: '<EMAIL>', username: 'mik2', firstName: 'Jason', lastName: 'B', password: '<PASSWORD>', date: new Date(Date.now()) }, { email: '<EMAIL>', username: 'mik2', firstName: 'Luke', lastName: 'B', password: '<PASSWORD>', date: new Date(Date.now()) }, { email: '<EMAIL>', username: 'mik2', firstName: 'Trump', lastName: 'D', password: '<PASSWORD>', date: new Date(Date.now()) } ]; db.User .remove({}) .then(() => db.User.collection.insertMany(userSeed)) .then(data => { console.log(data.result.n + " records inserted!"); process.exit(0); }) .catch(err => { console.error(err); process.exit(1); });
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.fhwa.c2cri.infolayer; /** * Represents the specification of a value within a message. * * @author TransCore ITS, LLC * Last Updated: 1/8/2014 */ public class ValueSpecificationItem { /** The value name. */ private String valueName; /** The test type. */ private Integer testType; /** The num values. */ private Integer numValues; /** The values. */ private String[] values; /** * Instantiates a new value specification item. * * Pre-Conditions: N/A * Post-Conditions: N/A * * @param valueSpecEntry the value spec entry * @throws Exception the exception */ public ValueSpecificationItem(String valueSpecEntry) throws Exception{ if (valueSpecEntry.contains("=")){ int index = valueSpecEntry.indexOf("="); valueName = valueSpecEntry.substring(0, index).trim(); String[] specParts = valueSpecEntry.substring(index+1).split(","); if (specParts.length >= 3){ try{ testType = Integer.parseInt(specParts[0].trim()); } catch (Exception ex){ throw new Exception (valueSpecEntry + " is not valid. " + specParts[0] + " does not convert to an Integer.\n"+ex.getMessage()); } try{ numValues = Integer.parseInt(specParts[1].trim()); } catch (Exception ex){ throw new Exception (valueSpecEntry + " is not valid. " + specParts[1] + " does not convert to an Integer.\n"+ex.getMessage()); } values = new String[specParts.length-2]; for (int ii=2; ii<specParts.length; ii++){ values[ii-2] = specParts[ii]; } } } else { throw new Exception (valueSpecEntry + " is not valid. (Missing =)"); } } /* (non-Javadoc) * @see java.lang.Object#toString() */ public String toString(){ String result = ""; String valueList = ""; for (String thisItem : this.values) { if (valueList.isEmpty()) { valueList = valueList.concat(thisItem); } else { valueList = valueList.concat("," + thisItem); } } result = this.valueName + " = " + this.testType + "," + this.numValues + "," + valueList; return result; } /** * Gets the num values. * * @return the num values */ public Integer getNumValues() { return numValues; } /** * Sets the num values. * * @param numValues the new num values */ public void setNumValues(Integer numValues) { this.numValues = numValues; } /** * Gets the test type. * * @return the test type */ public Integer getTestType() { return testType; } /** * Sets the test type. * * @param testType the new test type */ public void setTestType(Integer testType) { this.testType = testType; } /** * Gets the value name. * * @return the value name */ public String getValueName() { return valueName; } /** * Sets the value name. * * @param valueName the new value name */ public void setValueName(String valueName) { this.valueName = valueName; } /** * Gets the values. * * @return the values */ public String[] getValues() { return values; } /** * Sets the values. * * @param values the new values */ public void setValues(String[] values) { this.values = values; } }
<reponame>rockenbf/ze_oss // 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 // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of the ETH Zurich, Wyss Zurich, Zurich Eye nor the // names of its contributors may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL ETH Zurich, Wyss Zurich, Zurich Eye BE LIABLE FOR ANY // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <ze/visualization/viz_ros.hpp> #include <ros/ros.h> #include <tf/transform_broadcaster.h> #include <visualization_msgs/Marker.h> #include <visualization_msgs/MarkerArray.h> #include <ze/ros/tf_bridge.hpp> #include <ze/visualization/viz_ros_utils.hpp> namespace ze { VisualizerRos::VisualizerRos() { // Inititialize ROS if it was not initialized before. if(!ros::isInitialized()) { VLOG(1) << "Initializting ROS"; int argc = 0; ros::init(argc, nullptr, std::string("ze_visualization")); } // Create node and subscribe. nh_.reset(new ros::NodeHandle("~")); pub_marker_.reset(new ros::Publisher(nh_->advertise<visualization_msgs::Marker>("markers", 100))); tf_broadcaster_.reset(new tf::TransformBroadcaster()); } VisualizerRos::VisualizerRos(const std::string& frame) : VisualizerRos::VisualizerRos() { world_frame = frame; } void VisualizerRos::drawPoint( const std::string& ns, const size_t id, const Position& point, const Color& color, const real_t size) { if(pub_marker_->getNumSubscribers() == 0) return; visualization_msgs::Marker m; m.header.frame_id = world_frame; m.header.stamp = ros::Time::now(); m.ns = ns; m.id = id; m.type = visualization_msgs::Marker::CUBE; m.action = 0; // add/modify real_t marker_scale = size * viz_scale_; m.scale.x = marker_scale; m.scale.y = marker_scale; m.scale.z = marker_scale; m.color = getRosColor(color); m.pose.position = getRosPoint(point); pub_marker_->publish(m); } void VisualizerRos::drawLine( const std::string& ns, const size_t id, const Position& line_from, const Position& line_to, const Color& color, const real_t size) { if(pub_marker_->getNumSubscribers() == 0) return; visualization_msgs::Marker m; m.header.frame_id = world_frame; m.header.stamp = ros::Time::now(); m.ns = ns; m.id = id; m.type = visualization_msgs::Marker::LINE_STRIP; m.action = 0; // 0 = add/modify m.scale.x = size * viz_scale_; m.scale.y = size * viz_scale_; m.scale.z = size * viz_scale_; m.color = getRosColor(color); m.points.reserve(2); m.points.push_back(getRosPoint(line_from)); m.points.push_back(getRosPoint(line_to)); pub_marker_->publish(m); } void VisualizerRos::drawCoordinateFrame( const std::string& ns, const size_t id, const Transformation& pose, // T_W_B const real_t size) { if(pub_marker_->getNumSubscribers() == 0) return; const Vector3& p = pose.getPosition(); visualization_msgs::Marker m; m.header.frame_id = world_frame; m.header.stamp = ros::Time::now(); m.ns = ns; m.id = id; m.type = visualization_msgs::Marker::LINE_LIST; m.action = 0; // 0 = add/modify m.scale.x = size * viz_scale_ * 0.05; m.colors.reserve(6); m.points.reserve(6); real_t length = size * viz_scale_; m.points.push_back(getRosPoint(Vector3::Zero())); m.colors.push_back(getRosColor(Colors::Red)); m.points.push_back(getRosPoint(Vector3::UnitX() * length)); m.colors.push_back(getRosColor(Colors::Red)); m.points.push_back(getRosPoint(Vector3::Zero())); m.colors.push_back(getRosColor(Colors::Green)); m.points.push_back(getRosPoint(Vector3::UnitY() * length)); m.colors.push_back(getRosColor(Colors::Green)); m.points.push_back(getRosPoint(Vector3::Zero())); m.colors.push_back(getRosColor(Colors::Blue)); m.points.push_back(getRosPoint(Vector3::UnitZ() * length)); m.colors.push_back(getRosColor(Colors::Blue)); m.pose = getRosPose(pose); pub_marker_->publish(m); } void VisualizerRos::drawRobot( const std::string& name, const Transformation& T_W_B) { tf::StampedTransform tf; tf.stamp_ = ros::Time::now(); tf.frame_id_ = world_frame; tf.child_frame_id_ = name; tf.setData(transformationToTF(T_W_B)); tf_broadcaster_->sendTransform(tf); } void VisualizerRos::drawPoints( const std::string& ns, const size_t id, const Positions& points, const Color& color, const real_t size) { if(pub_marker_->getNumSubscribers() == 0) return; visualization_msgs::Marker m; m.header.frame_id = world_frame; m.header.stamp = ros::Time::now(); m.ns = ns; m.id = id; m.type = visualization_msgs::Marker::POINTS; m.action = 0; // add/modify real_t marker_scale = size * viz_scale_; m.scale.x = marker_scale; m.scale.y = marker_scale; m.scale.z = marker_scale; m.color = getRosColor(color); m.points.reserve(points.cols()); for(int i = 0; i < points.cols(); ++i) { if(points.col(i).norm() > 1e4) { continue; } m.points.push_back(getRosPoint(points.col(i))); } pub_marker_->publish(m); } void VisualizerRos::drawLines( const std::string& ns, const size_t id, const LineMarkers& lines, const Color& color, const real_t size) { if(pub_marker_->getNumSubscribers() == 0) return; visualization_msgs::Marker m; m.header.frame_id = world_frame; m.header.stamp = ros::Time::now(); m.ns = ns; m.id = id; m.type = visualization_msgs::Marker::LINE_LIST; m.action = 0; // 0 = add/modify m.scale.x = size * viz_scale_; m.color = getRosColor(color); m.points.reserve(lines.size() * 2); for(size_t i = 0; i < lines.size(); ++i) { m.points.push_back(getRosPoint(lines[i].first)); m.points.push_back(getRosPoint(lines[i].second)); } pub_marker_->publish(m); } void VisualizerRos::drawCoordinateFrames( const std::string& ns, const size_t id, const TransformationVector& poses, const real_t size) { if(pub_marker_->getNumSubscribers() == 0) return; visualization_msgs::Marker m; m.header.frame_id = world_frame; m.header.stamp = ros::Time::now(); m.ns = ns; m.id = id; m.type = visualization_msgs::Marker::LINE_LIST; m.action = 0; // 0 = add/modify m.scale.x = size * viz_scale_ * 0.05; m.colors.reserve(poses.size() * 3); m.points.reserve(poses.size() * 3); real_t length = size * viz_scale_; for(const Transformation& T : poses) { const Vector3& p = T.getPosition(); const Matrix3 R = T.getRotationMatrix(); m.points.push_back(getRosPoint(p)); m.colors.push_back(getRosColor(Colors::Red)); m.points.push_back(getRosPoint(p + R.col(0) * length)); m.colors.push_back(getRosColor(Colors::Red)); m.points.push_back(getRosPoint(p)); m.colors.push_back(getRosColor(Colors::Green)); m.points.push_back(getRosPoint(p + R.col(1) * length)); m.colors.push_back(getRosColor(Colors::Green)); m.points.push_back(getRosPoint(p)); m.colors.push_back(getRosColor(Colors::Blue)); m.points.push_back(getRosPoint(p + R.col(2) * length)); m.colors.push_back(getRosColor(Colors::Blue)); } pub_marker_->publish(m); } void VisualizerRos::drawTrajectory( const std::string& topic, const size_t id, const std::vector<Position>& points, const Color& color, const real_t size) { if(pub_marker_->getNumSubscribers() == 0) return; visualization_msgs::Marker m; m.header.frame_id = world_frame; m.header.stamp = ros::Time::now(); m.ns = topic; m.id = id; m.type = visualization_msgs::Marker::LINE_STRIP; m.action = 0; // 0 = add/modify m.scale.x = size * viz_scale_ * 0.05; m.color = getRosColor(color); m.points.reserve(points.size()); for (size_t i = 0u; i < points.size(); ++i) { m.points.push_back(getRosPoint(points[i])); } pub_marker_->publish(m); } } // namespace ze
<filename>src/components/icon/assets/branch.tsx /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ // THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js import * as React from 'react'; interface SVGRProps { title?: string; titleId?: string; } const EuiIconBranch = ({ title, titleId, ...props }: React.SVGProps<SVGSVGElement> & SVGRProps) => ( <svg xmlns="http://www.w3.org/2000/svg" width={16} height={16} viewBox="0 0 16 16" aria-labelledby={titleId} {...props} > {title ? <title id={titleId}>{title}</title> : null} <path d="M5 10.038a3.49 3.49 0 012.5-1.05h2a2.5 2.5 0 002.462-2.061 2 2 0 111.008.017A3.5 3.5 0 019.5 9.987h-2a2.5 2.5 0 00-2.466 2.085A2 2 0 114 12.063V3.937a2 2 0 111 0v6.1zM4.5 3a1 1 0 100-2 1 1 0 000 2zm0 12a1 1 0 100-2 1 1 0 000 2zm8-9a1 1 0 100-2 1 1 0 000 2z" /> </svg> ); export const icon = EuiIconBranch;
package io.github.biezhi.wechat.api.response; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; /** * 附件响应体 * * @author biezhi * @date 2018/1/20 */ @Data @EqualsAndHashCode(callSuper = true) public class MediaResponse extends JsonResponse { @SerializedName("MediaId") private String mediaId; @SerializedName("StartPos") private Integer startPos; @SerializedName("CDNThumbImgHeight") private Integer cdnThumbImgHeight; @SerializedName("CDNThumbImgWidth") private Integer cdnThumbImgWidth; @SerializedName("EncryFileName") private String encryFileName; }
def extract_email_references(input_file): email_references = {} with open(input_file, 'r') as file: data = file.read() entries = data.split('##################################################') for entry in entries: if entry.strip(): email = entry.split('email: ')[1].split('\n')[0].strip() reference = entry.split('Reference: ')[1].split('\n')[0].strip() email_references[email] = reference for email, reference in email_references.items(): print(f"Email: {email}\nReference: {reference}\n") # Example usage extract_email_references('input.txt')
package com.taylak.wallpaper.universalimage; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.AbsListView; import com.nostra13.universalimageloader.core.listener.PauseOnScrollListener; import com.taylak.wallpaperhd.R; public class AbsListViewBaseActivity extends BaseActivity { protected static final String STATE_PAUSE_ON_SCROLL = "STATE_PAUSE_ON_SCROLL"; protected static final String STATE_PAUSE_ON_FLING = "STATE_PAUSE_ON_FLING"; protected AbsListView listView; protected boolean pauseOnScroll = false; protected boolean pauseOnFling = false; @Override public void onRestoreInstanceState(Bundle savedInstanceState) { pauseOnScroll = savedInstanceState.getBoolean(STATE_PAUSE_ON_SCROLL, false); pauseOnFling = savedInstanceState.getBoolean(STATE_PAUSE_ON_FLING, false); } @Override public void onResume() { super.onResume(); applyScrollListener(); } private void applyScrollListener() { listView.setOnScrollListener(new PauseOnScrollListener(imageLoader, pauseOnScroll, pauseOnFling)); } @Override public void onSaveInstanceState(Bundle outState) { outState.putBoolean(STATE_PAUSE_ON_SCROLL, pauseOnScroll); outState.putBoolean(STATE_PAUSE_ON_FLING, pauseOnFling); } @Override public boolean onPrepareOptionsMenu(Menu menu) { MenuItem pauseOnScrollItem = menu.findItem(R.id.item_pause_on_scroll); pauseOnScrollItem.setVisible(true); pauseOnScrollItem.setChecked(pauseOnScroll); MenuItem pauseOnFlingItem = menu.findItem(R.id.item_pause_on_fling); pauseOnFlingItem.setVisible(true); pauseOnFlingItem.setChecked(pauseOnFling); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.item_pause_on_scroll: pauseOnScroll = !pauseOnScroll; item.setChecked(pauseOnScroll); applyScrollListener(); return true; case R.id.item_pause_on_fling: pauseOnFling = !pauseOnFling; item.setChecked(pauseOnFling); applyScrollListener(); return true; default: return super.onOptionsItemSelected(item); } } }
<reponame>linyineng/mip2-extensions<filename>components/mip-story/mip-story-img.js /** * @file mip-story-img 子组件 * @description 创建和展现小故事中的图片 * @author wangqizheng */ import { getAttributeSet, getJsonString } from './utils' const { CustomElement, util } = MIP const { dom } = util export default class MIPStoryImg extends CustomElement { static get observedAttributes () { return ['preload'] } /** @override */ firstInviewCallback () { this.loaded = false } /** @override */ attributeChangedCallback () { if (this.element.hasAttribute('preload') && !this.loaded) { this.initStoryImg() this.loaded = true } } /** * 初始化 img 元素 */ initStoryImg () { this.attributes = getAttributeSet(this.element.attributes) const attrString = getJsonString(this.attributes) const imgHtml = '<mip-img ' + attrString + '></mip-img>' const storyImg = dom.create(imgHtml) this.element.parentNode.insertBefore(storyImg, this.element) } }
#!/bin/bash : ' The following script calculates the square value of the number, 5. ' ((area=5*5)) echo $area
package weixin.lottery.service.impl; import org.jeecgframework.core.common.service.impl.CommonServiceImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import weixin.lottery.entity.WeixinCommonforhdEntity; import weixin.lottery.service.WeixinCommonforhdI; import java.io.Serializable; /** * Created by aa on 2016/1/21. */ @Service("weixinCommonforhd") @Transactional public class WeixinCommonforhdImpl extends CommonServiceImpl implements WeixinCommonforhdI { public <T> void delete(T entity) { super.delete(entity); // 执行删除操作配置的sql增强 this.doDelSql((WeixinCommonforhdEntity) entity); } public <T> Serializable save(T entity) { Serializable t = super.save(entity); // 执行新增操作配置的sql增强 this.doAddSql((WeixinCommonforhdEntity) entity); return t; } public <T> void saveOrUpdate(T entity) { super.saveOrUpdate(entity); // 执行更新操作配置的sql增强 this.doUpdateSql((WeixinCommonforhdEntity) entity); } /** * 默认按钮-sql增强-新增操作 * * @param id * @return */ public boolean doAddSql(WeixinCommonforhdEntity t) { return true; } /** * 默认按钮-sql增强-更新操作 * * @param id * @return */ public boolean doUpdateSql(WeixinCommonforhdEntity t) { return true; } /** * 默认按钮-sql增强-删除操作 * * @param id * @return */ public boolean doDelSql(WeixinCommonforhdEntity t) { return true; } }
package word; public class Initialization { private Initialization() { } public static CommandImpl buildCommandInterface(StringBuilder text) { CommandImpl textHolder = new CommandImpl(text); textHolder.init(); return textHolder; } }
sum: 9
/* @jsx h */ import {theme} from '../theme/Theme'; import {css} from 'emotion'; import {h} from '../nori/Nori'; import Box from '../components/Box'; import Lorem from '../components/Lorem'; import Greeter from '../components/Greeter'; import Lister from '../components/Lister'; import {useState} from "../nori/Hooks"; import {InputControls} from "../components/InputControls"; import {Stepper} from "../components/Stepper"; import Nonpresentational from '../components/Nonpresentational'; import {createContext} from "../nori/Context"; import ColorSwatch from '../components/ColorSwatch'; import Ticker from '../components/Ticker'; const appContainer = css` position: absolute; overflow: auto; display: grid; grid-template: 1fr / 1fr; align-items: center; justify-items: center; width: 100%; height: 100%; background: #eee; border: 1rem solid rgb(255,255,255); box-shadow: 0 0 50px inset rgba(0,0,0,.1); `; const whiteBox = css` display: block; padding: 1rem; color: #000; overflow: hidden; background-image: ${theme.gradients['premium-white']}; box-shadow: ${theme.shadows.dropShadow.bigsoft}; `; const blackBox = css` display: block; padding: 1rem; color: #fff; overflow: hidden; background-image: ${theme.gradients['premium-dark']}; box-shadow: ${theme.shadows.dropShadow.bigsoft}; `; const Sfc = props => <span><h1>{props.message}</h1><Greeter/></span>; const SFCWithJuice = (props) => { const [buttonLabel, updateButton] = useState({label: 'JOICE!', count: 0}); const handleClick = () => { updateButton({label: 'You pushed me!', count: ++buttonLabel.count}); }; return ( <button onClick={handleClick}>SFC With Juice: {buttonLabel.label} {buttonLabel.count}</button> ); }; /* <Ticker/> <span><ColorSwatch/></span> */ let ContextComp = createContext(); export const TestPage = () => <Box key='main' className={appContainer}> <Box className={blackBox}> <Lorem mode={Lorem.TITLE}/> <Box className={whiteBox}> <Nonpresentational/> <Stepper/> <hr/> <InputControls/> <hr/> <Sfc message='IMA sfc'/> <SFCWithJuice/> <ColorSwatch/> <Greeter/> <Ticker/> <hr/> <ContextComp.Provider value={{fuz: 'number1'}}> <ContextComp.Consumer> {value => <p>This value is from a context: <strong>{value.fuz}</strong></p>} </ContextComp.Consumer> </ContextComp.Provider> <hr/> <Lister/> </Box> </Box> </Box>; /* let AnotherContextComp = createContext(); let contextTest = <div> <ContextComp.Provider value={{fuz: 'number1'}}> <ContextComp.Consumer> {value => <p>Context! {value.fuz}</p>} </ContextComp.Consumer> <ContextComp.Consumer> {value => <p>Context! {value.fuz}</p>} </ContextComp.Consumer> <ContextComp.Consumer> {value => <p>Context! {value.fuz}</p>} </ContextComp.Consumer> </ContextComp.Provider> <AnotherContextComp.Provider value={{bar:'number2!'}}> <AnotherContextComp.Consumer> {value => <p>Another context {value.bar}</p>} </AnotherContextComp.Consumer> </AnotherContextComp.Provider> </div>; */
ROOT="/orch/scratch/vishal_mirna_kidney/publish" mkdir -p $ROOT/results/FA-model mkdir -p $ROOT/results/UUO-model # Run FA rnaseq Rscript -e 'root_path="/orch/scratch/vishal_mirna_kidney/publish/FA-model/rnaseq/final/2016-02-05_mrna_bio";library(rmarkdown);render(FA-model/mrna-summary.Rmd)' mkdir -p $ROOT/results/FA-model/rnaseq cp -r $ROOT/FA-model/rnaseq/final/2016-02-05_mrna_bio/files_publish/* $ROOT/results/FA-model/rnaseq/. # Run FA srnaseq Rscript -e 'root_path="/orch/scratch/vishal_mirna_kidney/publish/FA-model/srnaseq/final";library(rmarkdown);render(FA-model/srna-summary.Rmd)' # Run seqcluster if [ ! -e /orch/scratch/vishal_mirna_kidney/publish/FA-model/srnaseq/final/files_publish/pairs ] ; then /usr/local/conda/bin/seqcluster target --input /orch/scratch/vishal_mirna_kidney/publish/FA-model/srnaseq/final/files_publish/mirna_sing.txt \ --sps mmu -o /orch/scratch/vishal_mirna_kidney/publish/FA-model/srnaseq/final/files_publish/pairs \ --annotation /orch/scratch/vishal_mirna_kidney/publish/srna-data fi # Run FA miRNA-mRNA interactome Rscript -e 'root_path="/orch/scratch/vishal_mirna_kidney/publish/FA-model";library(rmarkdown);render("FA-model/interactome.Rmd")' mkdir -p $ROOT/results/FA-model/srnaseq cp -r $ROOT/FA-model/srnaseq/final/files_publish/* $ROOT/results/FA-model/srnaseq/. # Run FA 3D omics Rscript -e 'root_path="/orch/scratch/vishal_mirna_kidney/publish/FA-model";library(rmarkdown);render("FA-model/omics.Rmd")' mkdir -p $ROOT/results/FA-model/protein cp -r $ROOT/FA-model/protein/files_publish/* $ROOT/results/FA-model/protein/. mkdir -p $ROOT/results/FA-model/omics cp -r $ROOT/FA-model/omics/files_publish/* $ROOT/results/FA-model/omics/. # Run UUO rnaseq Rscript -e 'root_path="/orch/scratch/vishal_mirna_kidney/publish/UUO-model/rnaseq/final/2016-02-03_mrna";library(rmarkdown);render("UUO-model/mrna-summary.Rmd")' mkdir -p $ROOT/results/UUO-model/rnaseq cp -r $ROOT/UUO-model/rnaseq/final/2016-02-03_mrna/files_publish/* $ROOT/results/UUO-model/rnaseq/. # Run UUO srnaseq Rscript -e 'root_path="/orch/scratch/vishal_mirna_kidney/publish/UUO-model/srnaseq/final";library(rmarkdown);render("UUO-model/srna-summary.Rmd")' # Run seqcluster if [ ! -e /orch/scratch/vishal_mirna_kidney/publish/FA-model/srnaseq/final/files_publish/pairs ] ; then /usr/local/conda/bin/seqcluster target --input /orch/scratch/vishal_mirna_kidney/publish/UUO-model/srnaseq/final/files_publish/mirna_sing.txt \ --sps mmu -o /orch/scratch/vishal_mirna_kidney/publish/UUO-model/srnaseq/final/files_publish/pairs \ --annotation /orch/scratch/vishal_mirna_kidney/publish/srna-data fi # Run UUO miRNA-mRNA interactome Rscript -e 'root_path="/orch/scratch/vishal_mirna_kidney/publish/UUO-model";library(rmarkdown);render("UUO-model/interactome.Rmd")' mkdir -p $ROOT/results/UUO-model/srnaseq cp -r $ROOT/UUO-model/srnaseq/final/files_publish/* $ROOT/results/UUO-model/srnaseq/. # Run UUO 3D omics Rscript -e 'root_path="/orch/scratch/vishal_mirna_kidney/publish/UUO-model";library(rmarkdown);render("UUO-model/omics.Rmd")' mkdir -p $ROOT/results/UUO-model/protein cp -r $ROOT/UUO-model/protein/files_publish/* $ROOT/results/UUO-model/protein/. mkdir -p $ROOT/results/UUO-model/omics cp -r $ROOT/UUO-model/omics/files_publish/* $ROOT/results/UUO-model/omics/. mkdir -p $ROOT/results/code_and_html/. cp -r * $ROOT/results/code_and_html/.
package me.hydos.blaze4d.mixin.vertices; import com.mojang.blaze3d.vertex.BufferBuilder; import com.mojang.blaze3d.vertex.BufferUploader; import com.mojang.datafixers.util.Pair; import it.unimi.dsi.fastutil.objects.ObjectIntPair; import me.hydos.blaze4d.Blaze4D; import me.hydos.blaze4d.api.GlobalRenderSystem; import me.hydos.blaze4d.api.util.ConversionUtils; import me.hydos.rosella.memory.ManagedBuffer; import org.lwjgl.system.MemoryUtil; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import java.nio.ByteBuffer; @Mixin(BufferUploader.class) public class BufferRendererMixin { /** * @author Blaze4D * @reason to draw */ @Overwrite public static void end(BufferBuilder bufferBuilder) { Pair<BufferBuilder.DrawState, ByteBuffer> drawData = bufferBuilder.popNextBuffer(); BufferBuilder.DrawState drawState = drawData.getFirst(); ByteBuffer originalBuffer = drawData.getSecond(); originalBuffer.clear(); // TODO: why were these format checks here? (ported from old code) drawState.format() != com.mojang.blaze3d.vertex.DefaultVertexFormat.BLIT_SCREEN && drawState.format() != com.mojang.blaze3d.vertex.DefaultVertexFormat.POSITION if (drawState.vertexCount() > 0 && drawState.indexCount() > 0) { ByteBuffer copiedBuffer = MemoryUtil.memAlloc(drawState.vertexBufferSize()); copiedBuffer.put(0, originalBuffer, 0, drawState.vertexBufferSize()); ManagedBuffer<ByteBuffer> rawIndexBuffer = GlobalRenderSystem.createIndices(drawState.mode(), drawState.indexCount()); GlobalRenderSystem.updateUniforms(); GlobalRenderSystem.uploadAsyncCreatableObject( new ManagedBuffer<>(copiedBuffer, true), rawIndexBuffer, drawState.indexCount(), GlobalRenderSystem.activeShader, ConversionUtils.mcDrawModeToRosellaTopology(drawState.mode()), GlobalRenderSystem.DEFAULT_POLYGON_MODE, ConversionUtils.FORMAT_CONVERSION_MAP.get(drawState.format().getElements()), GlobalRenderSystem.currentStateInfo.snapshot(), GlobalRenderSystem.getCurrentTextureMap(), Blaze4D.rosella ); } } /** * @author Blaze4D * @reason to draw */ @Overwrite public static void _endInternal(BufferBuilder builder) { end(builder); } }
import requests from bs4 import BeautifulSoup def scrape_flights(location_from, location_to, start_date, end_date): # make an HTTP request to retrieve the web page url = 'https://example.com/flights?from={}&to={}&start_date={}&end_date={}'.format(location_from, location_to, start_date, end_date) response = requests.get(url) # parse the page using BeautifulSoup soup = BeautifulSoup(response.text, 'html.parser') # retrieve the flight information flights = [] for row in soup.find_all('tr'): cells = row.find_all('td') if len(cells) == 5: flights.append({ 'date': cells[0].text, 'flight': cells[1].text, 'departure': cells[2].text, 'arrival': cells[3].text, 'price': cells[4].text }); # return the flight information return flights
<reponame>orangecms/lumina-desktop<filename>src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp #include <QVariant> #include <QSettings> #include <QGuiApplication> #include <QScreen> #include <QFont> #include <QPalette> #include <QTimer> #include <QIcon> #include <QRegExp> #ifdef QT_WIDGETS_LIB #include <QStyle> #include <QStyleFactory> #include <QApplication> #include <QWidget> #endif #include <QFile> #include <QFileSystemWatcher> #include <QDir> #include <QTextStream> #include <stdlib.h> #include <lthemeengine/lthemeengine.h> #include "lthemeengineplatformtheme.h" #if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) && !defined(QT_NO_DBUS) #include <private/qdbusmenubar_p.h> #endif #if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) #include <QDBusArgument> #include <private/qdbustrayicon_p.h> #endif #include <QX11Info> #include <QCursor> //Need access to the private QCursor header so we can refresh the mouse cursor cache //#include <private/qcursor_p.h> //Does not work - looks like we need to use X11 stuff instead #include <X11/Xcursor/Xcursor.h> Q_LOGGING_CATEGORY(llthemeengine, "lthemeengine") //QT_QPA_PLATFORMTHEME=lthemeengine lthemeenginePlatformTheme::lthemeenginePlatformTheme(){ if(QGuiApplication::desktopSettingsAware()){ readSettings(); #ifdef QT_WIDGETS_LIB QMetaObject::invokeMethod(this, "createFSWatcher", Qt::QueuedConnection); #endif QMetaObject::invokeMethod(this, "applySettings", Qt::QueuedConnection); QGuiApplication::setFont(m_generalFont); } //qCDebug(llthemeengine) << "using lthemeengine plugin"; #ifdef QT_WIDGETS_LIB if(!QStyleFactory::keys().contains("lthemeengine-style")) qCCritical(llthemeengine) << "unable to find lthemeengine proxy style"; #endif } lthemeenginePlatformTheme::~lthemeenginePlatformTheme(){ if(m_customPalette) delete m_customPalette; } #if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) && !defined(QT_NO_DBUS) QPlatformMenuBar *lthemeenginePlatformTheme::createPlatformMenuBar() const{ if(m_checkDBusGlobalMenu){ QDBusConnection conn = QDBusConnection::sessionBus(); m_dbusGlobalMenuAvailable = conn.interface()->isServiceRegistered("com.canonical.AppMenu.Registrar"); //qCDebug(llthemeengine) << "D-Bus global menu:" << (m_dbusGlobalMenuAvailable ? "yes" : "no"); } return (m_dbusGlobalMenuAvailable ? new QDBusMenuBar() : nullptr); } #endif #if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) QPlatformSystemTrayIcon *lthemeenginePlatformTheme::createPlatformSystemTrayIcon() const{ if(m_checkDBusTray){ QDBusMenuConnection conn; m_dbusTrayAvailable = conn.isStatusNotifierHostRegistered(); m_checkDBusTray = false; //qCDebug(llthemeengine) << "D-Bus system tray:" << (m_dbusTrayAvailable ? "yes" : "no"); } return (m_dbusTrayAvailable ? new QDBusTrayIcon() : nullptr); } #endif const QPalette *lthemeenginePlatformTheme::palette(QPlatformTheme::Palette type) const{ Q_UNUSED(type); return (m_usePalette ? m_customPalette : nullptr); } const QFont *lthemeenginePlatformTheme::font(QPlatformTheme::Font type) const{ if(type == QPlatformTheme::FixedFont){ return &m_fixedFont; } return &m_generalFont; } QVariant lthemeenginePlatformTheme::themeHint(QPlatformTheme::ThemeHint hint) const{ switch (hint){ case QPlatformTheme::CursorFlashTime: return m_cursorFlashTime; case MouseDoubleClickInterval: return m_doubleClickInterval; case QPlatformTheme::ToolButtonStyle: return m_toolButtonStyle; case QPlatformTheme::SystemIconThemeName: return m_iconTheme; case QPlatformTheme::StyleNames: return QStringList() << "lthemeengine-style"; case QPlatformTheme::IconThemeSearchPaths: return lthemeengine::iconPaths(); case DialogButtonBoxLayout: return m_buttonBoxLayout; case QPlatformTheme::UiEffects: return m_uiEffects; #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) case QPlatformTheme::WheelScrollLines: return m_wheelScrollLines; #endif default: return QPlatformTheme::themeHint(hint); } } void lthemeenginePlatformTheme::applySettings(){ if(!QGuiApplication::desktopSettingsAware()){ return; } #if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)) if(!m_update){ //do not override application palette if(QCoreApplication::testAttribute(Qt::AA_SetPalette)){ m_usePalette = false; qCDebug(llthemeengine) << "palette support is disabled"; } } #endif #ifdef QT_WIDGETS_LIB if(hasWidgets()){ qApp->setFont(m_generalFont); //Qt 5.6 or higher should be use themeHint function on application startup. //So, there is no need to call this function first time. #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) if(m_update) qApp->setWheelScrollLines(m_wheelScrollLines); #else qApp->setWheelScrollLines(m_wheelScrollLines); #endif if(m_update && qApp->style()->objectName() == "lthemeengine-style") /* ignore application style */ { qApp->setStyle("lthemeengine-style"); } //recreate style object if(m_update && m_usePalette){ if(m_customPalette){ qApp->setPalette(*m_customPalette); } else{ qApp->setPalette(qApp->style()->standardPalette()); } } //do not override application style if one is already set by the app itself QString orig = qApp->styleSheet(); if(orig.startsWith(m_oldStyleSheet)){ orig = orig.remove(m_oldStyleSheet); } qApp->setStyleSheet(m_userStyleSheet+orig); //make sure the app style has higher priority than ours m_oldStyleSheet = m_userStyleSheet; } #endif QGuiApplication::setFont(m_generalFont); //apply font bool ithemechange = m_iconTheme != QIcon::themeName(); QIcon::setThemeName(m_iconTheme); //apply icons //See if we need to reload the application icon from the new theme if(ithemechange){ QString appIcon = qApp->windowIcon().name(); if(!appIcon.isEmpty() && QIcon::hasThemeIcon(appIcon)){ qApp->setWindowIcon(QIcon::fromTheme(appIcon)); } QWindowList wins = qApp->topLevelWindows(); for(int i=0; i<wins.length(); i++){ QString winIcon = wins[i]->icon().name(); if(!winIcon.isEmpty() && QIcon::hasThemeIcon(winIcon)){ wins[i]->setIcon(QIcon::fromTheme(winIcon)); } } } bool cthemechange = m_cursorTheme != QString(getenv("X_CURSOR_THEME")); setenv("X_CURSOR_THEME", m_cursorTheme.toLocal8Bit().data(), 1); //qDebug() << "Icon Theme Change:" << m_iconTheme << QIcon::themeSearchPaths(); if(m_customPalette && m_usePalette){ QGuiApplication::setPalette(*m_customPalette); } //apply palette #ifdef QT_WIDGETS_LIB if(hasWidgets()){ QEvent et(QEvent::ThemeChange); QEvent ec(QEvent::CursorChange); foreach (QWidget *w, qApp->allWidgets()){ if(ithemechange){ QApplication::sendEvent(w, &et); } if(cthemechange){ QApplication::sendEvent(w, &ec); } } } #endif if(!m_update){ m_update = true; } //Mouse Cursor syncronization QString mthemefile = QDir::homePath()+"/.icons/default/index.theme"; if(!watcher->files().contains(mthemefile) && QFile::exists(mthemefile)){ watcher->addPath(mthemefile); //X11 mouse cursor theme file //qDebug() << "Add Mouse Cursor File to Watcher"; syncMouseCursorTheme(mthemefile); } } #ifdef QT_WIDGETS_LIB void lthemeenginePlatformTheme::createFSWatcher(){ watcher = new QFileSystemWatcher(this); watcher->addPath(lthemeengine::configPath()); //theme engine settings directory watcher->addPath(QDir::homePath()+"/.icons/default/index.theme"); //X11 mouse cursor theme file QTimer *timer = new QTimer(this); timer->setSingleShot(true); timer->setInterval(500); connect(watcher, SIGNAL(directoryChanged(QString)), timer, SLOT(start())); connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(fileChanged(QString)) ); connect(timer, SIGNAL(timeout()), SLOT(updateSettings())); } void lthemeenginePlatformTheme::updateSettings(){ //qCDebug(llthemeengine) << "updating settings.."; readSettings(); applySettings(); } #endif void lthemeenginePlatformTheme::fileChanged(QString path){ if(path.endsWith("default/index.theme")){ //qDebug() << "Mouse Cursor File Changed"; syncMouseCursorTheme(path); } } void lthemeenginePlatformTheme::readSettings(){ if(m_customPalette){ delete m_customPalette; m_customPalette = 0; } QSettings settings(lthemeengine::configFile(), QSettings::IniFormat); settings.beginGroup("Appearance"); m_style = settings.value("style", "Fusion").toString(); if(settings.value("custom_palette", false).toBool()){ QString schemePath = settings.value("color_scheme_path","airy").toString(); m_customPalette = new QPalette(loadColorScheme(schemePath)); } m_cursorTheme = settings.value("cursor_theme","").toString(); m_iconTheme = settings.value("icon_theme", "material-design-light").toString(); settings.endGroup(); settings.beginGroup("Fonts"); m_generalFont = settings.value("general", QPlatformTheme::font(QPlatformTheme::SystemFont)).value<QFont>(); m_fixedFont = settings.value("fixed", QPlatformTheme::font(QPlatformTheme::FixedFont)).value<QFont>(); settings.endGroup(); settings.beginGroup("Interface"); m_doubleClickInterval = QPlatformTheme::themeHint(QPlatformTheme::MouseDoubleClickInterval).toInt(); m_doubleClickInterval = settings.value("double_click_interval", m_doubleClickInterval).toInt(); m_cursorFlashTime = QPlatformTheme::themeHint(QPlatformTheme::CursorFlashTime).toInt(); m_cursorFlashTime = settings.value("cursor_flash_time", m_cursorFlashTime).toInt(); m_buttonBoxLayout = QPlatformTheme::themeHint(QPlatformTheme::DialogButtonBoxLayout).toInt(); m_buttonBoxLayout = settings.value("buttonbox_layout", m_buttonBoxLayout).toInt(); QCoreApplication::setAttribute(Qt::AA_DontShowIconsInMenus, !settings.value("menus_have_icons", true).toBool()); m_toolButtonStyle = settings.value("toolbutton_style", Qt::ToolButtonFollowStyle).toInt(); m_wheelScrollLines = settings.value("wheel_scroll_lines", 3).toInt(); //load effects m_uiEffects = QPlatformTheme::themeHint(QPlatformTheme::UiEffects).toInt(); if(settings.childKeys().contains("gui_effects")){ QStringList effectList = settings.value("gui_effects").toStringList(); m_uiEffects = 0; if(effectList.contains("General")){ m_uiEffects |= QPlatformTheme::GeneralUiEffect; } if(effectList.contains("AnimateMenu")){ m_uiEffects |= QPlatformTheme::AnimateMenuUiEffect; } if(effectList.contains("FadeMenu")){ m_uiEffects |= QPlatformTheme::FadeMenuUiEffect; } if(effectList.contains("AnimateCombo")){ m_uiEffects |= QPlatformTheme::AnimateComboUiEffect; } if(effectList.contains("AnimateTooltip")){ m_uiEffects |= QPlatformTheme::AnimateTooltipUiEffect; } if(effectList.contains("FadeTooltip")){ m_uiEffects |= QPlatformTheme::FadeTooltipUiEffect; } if(effectList.contains("AnimateToolBox")){ m_uiEffects |= QPlatformTheme::AnimateToolBoxUiEffect; } } //load style sheets #ifdef QT_WIDGETS_LIB QStringList qssPaths; if(qApp->applicationFilePath().section("/",-1).startsWith("lumina-desktop") ){ qssPaths << settings.value("desktop_stylesheets").toStringList(); } qssPaths << settings.value("stylesheets").toStringList(); //qDebug() << "Loaded Stylesheets:" << qApp->applicationName() << qssPaths; m_userStyleSheet = loadStyleSheets(qssPaths); #endif settings.endGroup(); } #ifdef QT_WIDGETS_LIB bool lthemeenginePlatformTheme::hasWidgets(){ return qobject_cast<QApplication *> (qApp) != nullptr; } #endif QString lthemeenginePlatformTheme::loadStyleSheets(const QStringList &paths){ //qDebug() << "Loading Stylesheets:" << paths; QString content; foreach (QString path, paths){ if(!QFile::exists(path)){ continue; } QFile file(path); file.open(QIODevice::ReadOnly); content.append(file.readAll()); } QRegExp regExp("//.*(\\n|$)"); regExp.setMinimal(true); content.remove(regExp); return content; } QPalette lthemeenginePlatformTheme::loadColorScheme(QString filePath){ if(!filePath.contains("/") && !filePath.endsWith(".conf") && !filePath.isEmpty()){ //relative theme name, auto-complete it QStringList dirs; dirs << getenv("XDG_CONFIG_HOME"); dirs << QString(getenv("XDG_CONFIG_DIRS")).split(":"); dirs << QString(getenv("XDG_DATA_DIRS")).split(":"); QString relpath = "/lthemeengine/colors/%1.conf"; relpath = relpath.arg(filePath); for(int i=0; i<dirs.length(); i++){ if(QFile::exists(dirs[i]+relpath)){ filePath = dirs[i]+relpath; break; } } } QPalette customPalette; QSettings settings(filePath, QSettings::IniFormat); settings.beginGroup("ColorScheme"); QStringList activeColors = settings.value("active_colors").toStringList(); QStringList inactiveColors = settings.value("inactive_colors").toStringList(); QStringList disabledColors = settings.value("disabled_colors").toStringList(); settings.endGroup(); if(activeColors.count() == QPalette::NColorRoles && inactiveColors.count() == QPalette::NColorRoles && disabledColors.count() == QPalette::NColorRoles){ for (int i = 0; i < QPalette::NColorRoles; i++){ QPalette::ColorRole role = QPalette::ColorRole(i); customPalette.setColor(QPalette::Active, role, QColor(activeColors.at(i))); customPalette.setColor(QPalette::Inactive, role, QColor(inactiveColors.at(i))); customPalette.setColor(QPalette::Disabled, role, QColor(disabledColors.at(i))); } } else{ customPalette = *QPlatformTheme::palette(SystemPalette); } //load fallback palette return customPalette; } void lthemeenginePlatformTheme::syncMouseCursorTheme(QString indexfile){ //Read the index file and pull out the theme name QFile file(indexfile); QString newtheme; if(file.open(QIODevice::ReadOnly)){ QTextStream stream(&file); QString tmp; while(!stream.atEnd()){ tmp = stream.readLine().simplified(); if(tmp.startsWith("Inherits=")){ newtheme = tmp.section("=",1,-1).simplified(); break; } } file.close(); } if(newtheme.isEmpty()){ return; } //nothing to do QString curtheme = QString(XcursorGetTheme(QX11Info::display()) ); //currently-used theme //qDebug() << "Sync Mouse Cursur Theme:" << curtheme << newtheme; if(curtheme!=newtheme){ qDebug() << " - Setting new cursor theme:" << newtheme; XcursorSetTheme(QX11Info::display(), newtheme.toLocal8Bit().data()); //save the new theme name }else{ return; } //qDebug() << "Qt Stats:"; //qDebug() << " TopLevelWindows:" << QGuiApplication::topLevelWindows().length(); //qDebug() << " AllWindows:" << QGuiApplication::allWindows().length(); //qDebug() << " AllWidgets:" << QApplication::allWidgets().length(); //XcursorSetThemeCore( QX11Info::display(), XcursorGetThemeCore(QX11Info::display()) ); //reset the theme core //Load the cursors from the new theme int defsize = XcursorGetDefaultSize(QX11Info::display()); //qDebug() << "Default cursor size:" << defsize; XcursorImages *imgs = XcursorLibraryLoadImages("left_ptr", NULL, defsize); //qDebug() << "imgs:" << imgs << imgs->nimage; XcursorCursors *curs = XcursorImagesLoadCursors(QX11Info::display(), imgs); if(curs==0){ return; } //not found //qDebug() << "Got Cursors:" << curs->ncursor; //Now re-set the cursors for the current top-level X windows QWindowList wins = QGuiApplication::allWindows(); //QGuiApplication::topLevelWindows(); //qDebug() << "Got Windows:" << wins.length(); for(int i=0; i<curs->ncursor; i++){ for(int w=0; w<wins.length(); w++){ XDefineCursor(curs->dpy, wins[w]->winId(), curs->cursors[i]); } } XcursorCursorsDestroy(curs); //finished with this temporary structure /*QWidgetList wlist = QApplication::allWidgets(); qDebug() << "Widget List:" << wlist.length(); for(int i=0; i<wlist.length(); i++){ QCursor cur(wlist[i]->cursor().shape()); wlist[i]->cursor().swap( cur ); }*/ }
cm._lang = 'ru'; cm._locale = 'ru-IN'; cm._config.displayDateFormatCase = 'genitive'; cm._config.displayDateFormat = '%j %F %Y'; cm._config.displayDateTimeFormat = '%j %F %Y в %H:%i'; cm._messages = { common: { 'server_error': 'Произошла непредвиденная ошибка. Пожалуйста, повторите попытку позже.', }, months: { nominative: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентярь', 'Октябрь', 'Ноябрь', 'Декабрь'], genitive: ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентяря', 'октября', 'ноября', 'декабря'], }, days: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'], daysAbbr: ['В', 'П', 'В', 'С', 'Ч', 'П', 'С'], };
#include <fstream> #include <iostream> #include <string> #include <cmath> #include <emscripten/bind.h> #include <emscripten/emscripten.h> #define GLFW_INCLUDE_ES3 #if defined(_MSC_VER) #include <windows.h> #endif #include <GLFW/glfw3.h> #include "delfem2/msh_io_obj.h" #include "delfem2/msh_primitive.h" #include "delfem2/msh_affine_transformation.h" #include "delfem2/glfw/viewer3.h" #include "delfem2/glfw/util.h" #include "delfem2/opengl/new/drawer_mshtri.h" namespace dfm2 = delfem2; // --------------------------- struct MyData { std::vector<float> aXYZ; std::vector<unsigned int> aTri; dfm2::opengl::CShader_TriMesh shdr; delfem2::glfw::CViewer3 viewer; }; // --------------------------- void draw(MyData* data) { ::glClearColor(0.8, 1.0, 1.0, 1.0); ::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); ::glEnable(GL_DEPTH_TEST); ::glDepthFunc(GL_LESS); ::glEnable(GL_POLYGON_OFFSET_FILL ); ::glPolygonOffset( 1.1f, 4.0f ); data->shdr.Draw( data->viewer.GetProjectionMatrix().data(), data->viewer.GetModelViewMatrix().data()); data->viewer.SwapBuffers(); glfwPollEvents(); } // ====================== MyData data; void hoge (const std::string& fname) { std::cout << "opening file in C++" << std::endl; std::cout << " file_name: " << fname << std::endl; delfem2::Read_Obj3( data.aXYZ, data.aTri, fname); delfem2::Normalize_Points3(data.aXYZ); std::cout << " " << data.aXYZ.size()/3 << " " << data.aTri.size() /3 << std::endl; data.shdr.Initialize(data.aXYZ, 3, data.aTri); } EMSCRIPTEN_BINDINGS(wabc) { emscripten::function("hoge", &hoge); } int main() { delfem2::MeshTri3_Torus( data.aXYZ, data.aTri, 1.f, 0.2f, 32, 18); data.viewer.projection = std::make_unique<delfem2::Projection_LookOriginFromZplus>(2, false); // ------ dfm2::glfw::InitGLNew(); data.viewer.OpenWindow(); data.shdr.InitGL(); data.shdr.Initialize(data.aXYZ, 3, data.aTri); emscripten_set_main_loop_arg((em_arg_callback_func) draw, &data, 0, 1); glfwDestroyWindow(data.viewer.window); glfwTerminate(); exit(EXIT_SUCCESS); }
package google import ( "fmt" "io/ioutil" "net/http" "os" "cloud.google.com/go/storage" "golang.org/x/net/context" "golang.org/x/oauth2" googleOauth2 "golang.org/x/oauth2/google" "golang.org/x/oauth2/jwt" "google.golang.org/api/option" "github.com/lytics/cloudstorage" ) const ( // Authentication Source's // AuthJWTKeySource is for a complete string representing json of JWT AuthJWTKeySource cloudstorage.AuthMethod = "LyticsJWTkey" // AuthGoogleJWTKeySource is a string representing path to a file of JWT AuthGoogleJWTKeySource cloudstorage.AuthMethod = "GoogleJWTFile" // AuthGCEMetaKeySource is flag saying to use gcemetadata AuthGCEMetaKeySource cloudstorage.AuthMethod = "gcemetadata" // AuthGCEDefaultOAuthToken means use local auth where it (google client) // checks variety of locations for local auth tokens. AuthGCEDefaultOAuthToken cloudstorage.AuthMethod = "gcedefaulttoken" ) // GoogleOAuthClient An interface so we can return any of the // 3 Google transporter wrapper as a single interface. type GoogleOAuthClient interface { Client() *http.Client } type gOAuthClient struct { httpclient *http.Client } func (g *gOAuthClient) Client() *http.Client { return g.httpclient } func gcsCommonClient(client *http.Client, conf *cloudstorage.Config) (cloudstorage.Store, error) { gcs, err := storage.NewClient(context.Background(), option.WithHTTPClient(client)) if err != nil { return nil, err } store, err := NewGCSStore(gcs, conf.Bucket, conf.TmpDir, cloudstorage.MaxResults) if err != nil { return nil, err } return store, nil } // BuildGoogleJWTTransporter create a GoogleOAuthClient from jwt config. func BuildGoogleJWTTransporter(jwtConf *cloudstorage.JwtConf) (GoogleOAuthClient, error) { key, err := jwtConf.KeyBytes() if err != nil { return nil, err } conf := &jwt.Config{ Email: jwtConf.ClientEmail, PrivateKey: key, Scopes: jwtConf.Scopes, TokenURL: googleOauth2.JWTTokenURL, } client := conf.Client(oauth2.NoContext) return &gOAuthClient{ httpclient: client, }, nil } // BuildGoogleFileJWTTransporter creates a Google Storage Client using a JWT file for the jwt config. func BuildGoogleFileJWTTransporter(keyPath string, scope string) (GoogleOAuthClient, error) { jsonKey, err := ioutil.ReadFile(os.ExpandEnv(keyPath)) if err != nil { return nil, err } conf, err := googleOauth2.JWTConfigFromJSON(jsonKey, scope) if err != nil { return nil, err } client := conf.Client(oauth2.NoContext) return &gOAuthClient{ httpclient: client, }, nil } /* The account may be empty or the string "default" to use the instance's main account. */ func BuildGCEMetadatTransporter(serviceAccount string) (GoogleOAuthClient, error) { client := &http.Client{ Transport: &oauth2.Transport{ Source: googleOauth2.ComputeTokenSource(""), }, } return &gOAuthClient{ httpclient: client, }, nil } // BuildDefaultGoogleTransporter builds a transpoter that wraps the google DefaultClient: // Ref https://github.com/golang/oauth2/blob/master/google/default.go#L33 // DefaultClient returns an HTTP Client that uses the // DefaultTokenSource to obtain authentication credentials // Ref : https://github.com/golang/oauth2/blob/master/google/default.go#L41 // DefaultTokenSource is a token source that uses // "Application Default Credentials". // // It looks for credentials in the following places, // preferring the first location found: // // 1. A JSON file whose path is specified by the // GOOGLE_APPLICATION_CREDENTIALS environment variable. // 2. A JSON file in a location known to the gcloud command-line tool. // On other systems, $HOME/.config/gcloud/credentials. // 3. On Google App Engine it uses the appengine.AccessToken function. // 4. On Google Compute Engine, it fetches credentials from the metadata server. // (In this final case any provided scopes are ignored.) // // For more details, see: // https://developers.google.com/accounts/docs/application-default-credentials // // Samples of possible scopes: // Google Cloud Storage : https://github.com/GoogleCloudPlatform/gcloud-golang/blob/69098363d921fa3cf80f930468a41a33edd9ccb9/storage/storage.go#L51 // BigQuery : https://github.com/GoogleCloudPlatform/gcloud-golang/blob/522a8ceb4bb83c2def27baccf31d646bce11a4b2/bigquery/bigquery.go#L52 func BuildDefaultGoogleTransporter(scope ...string) (GoogleOAuthClient, error) { client, err := googleOauth2.DefaultClient(context.Background(), scope...) if err != nil { return nil, err } return &gOAuthClient{ httpclient: client, }, nil } // NewGoogleClient create new Google Storage Client. func NewGoogleClient(conf *cloudstorage.Config) (client GoogleOAuthClient, err error) { switch conf.AuthMethod { case AuthGCEDefaultOAuthToken: // This token method uses the default OAuth token with GCS created by tools like gsutils, gcloud, etc... // See github.com/lytics/lio/src/ext_svcs/google/google_transporter.go : BuildDefaultGoogleTransporter client, err = BuildDefaultGoogleTransporter("") if err != nil { return nil, err } case AuthGCEMetaKeySource: client, err = BuildGCEMetadatTransporter("") if err != nil { return nil, err } case AuthJWTKeySource: if conf.JwtConf == nil { return nil, fmt.Errorf("invalid config: missing jwt config struct") } // used if you are providing string of json client, err = BuildGoogleJWTTransporter(conf.JwtConf) if err != nil { return nil, err } case AuthGoogleJWTKeySource: switch conf.Scope { case "": // See the list here: https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/storage/storage.go#L58-L68 return nil, fmt.Errorf("invalid config: missing devstorage scope") } client, err = BuildGoogleFileJWTTransporter(conf.JwtFile, conf.Scope) if err != nil { return nil, err } default: return nil, fmt.Errorf("bad AuthMethod: %v", conf.AuthMethod) } return client, err }
<reponame>Lamburger/PlexRequests AutoForm.hooks({ updateGeneralSettingsForm: { onSuccess: function(formType, result) { if (result) { Bert.alert('Updated successfully', 'success'); Meteor.call("settingsUpdate"); } this.event.preventDefault(); return false; }, onError: function(formType, error) { console.error(error); Bert.alert('Update failed, please try again', 'danger'); } }, updateAuthenticationSettingsForm: { onSuccess: function(formType, result) { if (result) { Bert.alert('Updated successfully', 'success'); Meteor.call("settingsUpdate"); } this.event.preventDefault(); return false; }, onError: function(formType, error) { console.error(error); Bert.alert('Update failed, please try again', 'danger'); } }, updateCouchPotatoSettingsForm: { onSuccess: function(formType, result) { if (result) { Bert.alert('Updated successfully', 'success'); Meteor.call("settingsUpdate"); } this.event.preventDefault(); return false; }, onError: function(formType, error) { console.error(error); Bert.alert('Update failed, please try again', 'danger'); } }, updateSickRageSettingsForm: { onSuccess: function(formType, result) { if (result) { Bert.alert('Updated successfully', 'success'); Meteor.call("settingsUpdate"); } this.event.preventDefault(); return false; }, onError: function(formType, error) { console.error(error); Bert.alert('Update failed, please try again', 'danger'); } }, updateSonarrSettingsForm: { onSuccess: function(formType, result) { if (result) { Bert.alert('Updated successfully', 'success'); Meteor.call("settingsUpdate"); } this.event.preventDefault(); return false; }, onError: function(formType, error) { console.error(error); Bert.alert('Update failed, please try again', 'danger'); } }, updateRadarrSettingsForm: { onSuccess: function(formType, result) { if (result) { Bert.alert('Updated successfully', 'success'); Meteor.call("settingsUpdate"); } this.event.preventDefault(); return false; }, onError: function(formType, error) { console.error(error); Bert.alert('Update failed, please try again', 'danger'); } }, updateNotificationsSettingsForm: { onSuccess: function(formType, result) { if (result) { Bert.alert('Updated successfully', 'success'); Meteor.call("settingsUpdate"); } this.event.preventDefault(); return false; }, onError: function(formType, error) { console.error(error); Bert.alert('Update failed, please try again', 'danger'); } } }); Template.admin.helpers({ settings: function(){ return Settings.findOne({}); }, branch: function () { return Template.instance().branch.get(); }, sonarrProfiles: function () { return Template.instance().sonarrProfiles.get().map(function (profile) { return { label: profile.name, value: profile.id }; }); }, radarrProfiles: function () { return Template.instance().radarrProfiles.get().map(function (profile) { return { label: profile.name, value: profile.id }; }); }, version: function () { return Template.instance().version.get(); }, update: function () { return Template.instance().update.get(); }, latestVersion: function () { return Template.instance().latestVersion.get(); }, latestNotes: function () { return Template.instance().latestNotes.get(); }, previousVersion: function () { return Template.instance().previousVersion.get(); }, previousNotes: function () { return Template.instance().previousNotes.get(); }, permissionUser: function () { return Permissions.find({}).fetch(); }, makeUniqueID: function () { return "update-each-" + this._id; } }); Template.admin.onCreated(function(){ var instance = this; instance.branch = new ReactiveVar(""); instance.version = new ReactiveVar(""); instance.update = new ReactiveVar(false); instance.sonarrProfiles = new ReactiveVar([]); instance.radarrProfiles = new ReactiveVar([]); instance.latestVersion = new ReactiveVar(""); instance.latestNotes = new ReactiveVar(""); instance.previousVersion = new ReactiveVar(""); instance.previousNotes = new ReactiveVar(""); Meteor.call("getBranch", function (error, result) { if (result) { instance.branch.set(result); } }); Meteor.call("getVersion", function (error, result) { if (result) { instance.version.set(result); } }); Meteor.call("checkForUpdate", function (error, result) { if (result) { instance.update.set(result) } }); HTTP.get('https://api.github.com/repos/lokenx/plexrequests-meteor/releases', function (error, result) { if (error) { console.error('Error retrieving release notes: ' + error) } instance.latestVersion.set(result.data[0].name); var notesArray = result.data[0].body.split("- "); instance.latestNotes.set(notesArray.filter(Boolean)); instance.previousVersion.set(result.data[1].name); notesArray = result.data[1].body.split("- "); instance.previousNotes.set(notesArray.filter(Boolean)); }); }); Template.admin.events({ 'click .list-group-item' : function (event) { var target = $(event.target); //Update permissions collection if(target.text() == "Users") { Meteor.call("permissionsUpdateUsers"); } $('.list-group-item').removeClass("active"); target.toggleClass("active"); $('.settings-pane').hide(); $('#Settings' + target.text()).show(); }, 'submit #updateSettingsForm' : function (event) { event.preventDefault(); return false; }, 'click #usersSettingsSubmit' : function (event) { event.preventDefault(); try { $('*[id^="update-each-"]').submit(); Bert.alert('Updated successfully', 'success'); } catch(error) { console.error(error); Bert.alert('Update failed, please try again', 'danger'); } }, 'click #couchPotatoTest' : function (event) { event.preventDefault(); var btn = $(event.target); btn.html("Testing... <i class='fa fa-spin fa-refresh'></i>").removeClass().addClass("btn btn-info-outline"); Meteor.call("testCouchPotato", function (error, result) { if (error || !result) { btn.removeClass("btn-info-outline").addClass("btn-danger-outline"); btn.html("Error!"); } else { btn.removeClass("btn-info-outline").addClass("btn-success-outline"); btn.html("Success!"); } }) }, 'click #sickRageTest' : function (event) { event.preventDefault(); var btn = $(event.target); btn.html("Testing... <i class='fa fa-spin fa-refresh'></i>").removeClass().addClass("btn btn-info-outline"); Meteor.call("testSickRage", function (error, result) { if (error || !result) { btn.removeClass("btn-info-outline").addClass("btn-danger-outline"); btn.html("Error!"); } else { btn.removeClass("btn-info-outline").addClass("btn-success-outline"); btn.html("Success!"); } }) }, 'click #sonarrTest' : function (event) { event.preventDefault(); var btn = $(event.target); btn.html("Testing... <i class='fa fa-spin fa-refresh'></i>").removeClass().addClass("btn btn-info-outline"); Meteor.call("testSonarr", function (error, result) { if (error || !result) { btn.removeClass("btn-info-outline").addClass("btn-danger-outline"); btn.html("Error!"); } else { btn.removeClass("btn-info-outline").addClass("btn-success-outline"); btn.html("Success!"); } }) }, 'click #radarrTest' : function (event) { event.preventDefault(); var btn = $(event.target); btn.html("Testing... <i class='fa fa-spin fa-refresh'></i>").removeClass().addClass("btn btn-info-outline"); Meteor.call("testRadarr", function (error, result) { if (error || !result) { btn.removeClass("btn-info-outline").addClass("btn-danger-outline"); btn.html("Error!"); } else { btn.removeClass("btn-info-outline").addClass("btn-success-outline"); btn.html("Success!"); } }) }, 'click #iftttTest' : function (event) { event.preventDefault(); var btn = $(event.target); btn.html("Testing... <i class='fa fa-spin fa-refresh'></i>").removeClass().addClass("btn btn-info-outline"); Meteor.call("testIFTTT", function (error, result) { if (error || !result) { btn.removeClass("btn-info-outline").addClass("btn-danger-outline"); btn.html("Error!"); Bert.alert(error.reason, "danger"); } else if (result) { btn.removeClass("btn-info-outline").addClass("btn-success-outline"); btn.html("Success!"); } }) }, 'click #pushbulletTest' : function (event) { event.preventDefault(); var btn = $(event.target); btn.html("Testing... <i class='fa fa-spin fa-refresh'></i>").removeClass().addClass("btn btn-info-outline"); Meteor.call("testPushbulllet", function (error, result) { if (error || !result) { btn.removeClass("btn-info-outline").addClass("btn-danger-outline"); btn.html("Error!"); Bert.alert(error.reason, "danger"); } else if (result) { btn.removeClass("btn-info-outline").addClass("btn-success-outline"); btn.html("Success!"); } }) }, 'click #pushoverTest' : function (event) { event.preventDefault(); var btn = $(event.target); btn.html("Testing... <i class='fa fa-spin fa-refresh'></i>").removeClass().addClass("btn btn-info-outline"); Meteor.call("testPushover", function (error, result) { if (error || !result) { btn.removeClass("btn-info-outline").addClass("btn-danger-outline"); btn.html("Error!"); Bert.alert(error.reason, "danger"); } else if (result) { btn.removeClass("btn-info-outline").addClass("btn-success-outline"); btn.html("Success!"); } }) }, 'click #slackTest' : function (event) { event.preventDefault(); var btn = $(event.target); btn.html("Testing... <i class='fa fa-spin fa-refresh'></i>").removeClass().addClass("btn btn-info-outline"); Meteor.call("testSlack", function (error, result) { if (error || !result) { btn.removeClass("btn-info-outline").addClass("btn-danger-outline"); btn.html("Error!"); Bert.alert(error.reason, "danger"); } else if (result) { btn.removeClass("btn-info-outline").addClass("btn-success-outline"); btn.html("Success!"); } }) }, 'click #plexsubmit' : function (event) { event.preventDefault(); $('#plexsubmit').html("Getting Token... <i class='fa fa-spin fa-refresh'></i>"); var username = $('#plexuser').val(); var password = $('#<PASSWORD>').val(); Meteor.call("getPlexToken", username, password, function (error, result) { if (error) { $("#plexsubmit").html('Get token <i class="fa fa-key"></i>'); Bert.alert(error.reason, "danger"); } else if (result) { $("#plexsubmit").html('Get token <i class="fa fa-key"></i>'); Bert.alert("Successfully got token!", "success"); } }); return false; }, 'click #getSonarrProfiles': function (event, template) { event.preventDefault(); var btn = $(event.target); btn.html("Get Profiles <i class='fa fa-spin fa-refresh'></i>").removeClass().addClass("btn btn-info-outline"); Meteor.call('SonarrProfiles', function (error, result) { if (result.length) { template.sonarrProfiles.set(result); Bert.alert('Retrieved Sonarr Profiles!', "success"); } else { Bert.alert('Unable to retrieve Sonarr Profiles!', "danger"); } btn.html("Get Profiles"); }); }, 'click #getRadarrProfiles': function (event, template) { event.preventDefault(); var btn = $(event.target); btn.html("Get Profiles <i class='fa fa-spin fa-refresh'></i>").removeClass().addClass("btn btn-info-outline"); Meteor.call("RadarrProfiles", function (error, result) { if (result.length) { template.radarrProfiles.set(result); Bert.alert('Retrieved Radarr Profiles!', "success"); } else { Bert.alert('Unable to retrieve Radarr Profiles!', "danger"); } btn.html("Get Profiles"); }); } });
<filename>hello.java<gh_stars>0 # tomandjerry developed by devika class sample { public static void main (string a[]) { system.out.println("hello world"); } }
def tobin(num): bin_list = [] while num != 0: bin_list.append(num % 2) num //= 2 return ''.join([str(x) for x in bin_list[::-1]]) num = int(input('Enter a number: ')) print(tobin(num))
import numpy as np import matplotlib.pyplot as plt from deap import base, creator, tools, algorithms from ....Classes.ImportMatrixVal import ImportMatrixVal from ....Classes.ImportGenVectLin import ImportGenVectLin from ....Classes.OptiGenAlgNsga2Deap import OptiGenAlgNsga2Deap # Define the ZDT3 problem evaluation function def zdt3_eval(individual): f1 = individual[0] g = 1 + 9 * (np.sum(individual[1:]) / (len(individual) - 1))**0.25 h = 1 - np.sqrt(f1 / g) - (f1 / g) * np.sin(10 * np.pi * f1) f2 = g * h return f1, f2 # Create the NSGA-II optimization framework creator.create("FitnessMin", base.Fitness, weights=(-1.0, -1.0)) creator.create("Individual", list, fitness=creator.FitnessMin) toolbox = base.Toolbox() toolbox.register("attr_float", random.random) toolbox.register("individual", tools.initRepeat, creator.Individual, toolbox.attr_float, n=30) toolbox.register("population", tools.initRepeat, list, toolbox.individual) toolbox.register("evaluate", zdt3_eval) toolbox.register("mate", tools.cxSimulatedBinaryBounded, eta=20.0, low=0, up=1) toolbox.register("mutate", tools.mutPolynomialBounded, eta=20.0, low=0, up=1, indpb=1.0/30) toolbox.register("select", tools.selNSGA2) # Run the NSGA-II optimization algorithm pop = toolbox.population(n=300) hof = tools.ParetoFront() stats = tools.Statistics(lambda ind: ind.fitness.values) stats.register("avg", np.mean, axis=0) stats.register("std", np.std, axis=0) stats.register("min", np.min, axis=0) stats.register("max", np.max, axis=0) pop, logbook = algorithms.eaMuPlusLambda(pop, toolbox, mu=300, lambda_=300, cxpb=0.9, mutpb=0.1, ngen=100, stats=stats, halloffame=hof) # Visualize the Pareto front front = np.array([ind.fitness.values for ind in hof]) plt.scatter(front[:,0], front[:,1], c="b") plt.xlabel("Objective 1") plt.ylabel("Objective 2") plt.title("Pareto Front for ZDT3 Problem") plt.show()
# General alias ll="ls -lAFh --color" alias dedup="awk '!visited[$0]++'" # Git alias ga="git add -u; git add .; git status -sb" alias gb="git branch -v" alias gc="git ci --allow-empty -m" alias gd="git diff" alias gdc="git diff --cached" alias gl="git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all" alias gp="git push" alias gs="git status -sb" alias gu="git up" alias gcl="git co -" alias gml="git merge - --no-edit" # Ruby alias bd="bundle install --jobs=8" alias bdc="bundle config set path 'vendor/bundle'" alias b="bundle exec" alias br="bundle exec rails" # Go alias goi="go install ./..." alias gg='rg -g "*.go"' alias ytdl="youtube-dl -f 'bestvideo+bestaudio'" alias cr="cargo run --quiet --"
# Testbench for top-level (opentdc_wb) # # SPDX-FileCopyrightText: (c) 2020 Tristan Gingold <tgingold@free.fr> # SPDX-License-Identifier: Apache-2.0 ${GHDL:-ghdl} -c --std=08 \ ../rtl/opendelay_comps.vhdl \ delaylines.vhdl \ ../rtl/opentdc_pkg.vhdl \ ../rtl/opentdc_delay.vhdl \ ../rtl/opentdc_delay-sim.vhdl \ ../rtl/opentdc_sync.vhdl \ ../rtl/opentdc_time.vhdl \ ../rtl/opentdc_tapline.vhdl \ ../rtl/openfd_delayline.vhdl \ ../rtl/counter.vhdl \ ../rtl/opentdc_core2.vhdl \ ../rtl/openfd_core2.vhdl \ ../rtl/openfd_comps.vhdl \ ../rtl/opentdc_comps.vhdl \ ../rtl/fd_hs.vhdl \ ../rtl/fd_hd.vhdl \ ../rtl/fd_ms.vhdl \ ../rtl/fd_hd_25_1.vhdl \ ../rtl/fd_inline.vhdl \ ../rtl/fd_inline_1.vhdl \ ../rtl/tdc_inline.vhdl \ ../rtl/tdc_inline_1.vhdl \ ../rtl/tdc_inline_2.vhdl \ ../rtl/tdc_inline_3.vhdl \ ../rtl/wb_interface.vhdl \ ../rtl/rescue.vhdl \ ../rtl/rescue_top.vhdl \ ../rtl/wb_extender.vhdl \ zero.vhdl \ ../rtl/user_project_wrapper.vhdl \ tb_proj.vhdl \ -r tb_proj --wave=tb_proj.ghw --stop-time=10us #--backtrace-severity=warning
#!/bin/bash python scripts/travis_skip.py if [ "$?" -eq "0" ] then pip install coverage coveralls django-nose pip install --editable . pip install $DJANGO else echo "Skipping" fi
<reponame>sntsabode/react-native-walletconnect import { createContext } from 'react' const createErrorThunk = () => () => Promise.reject( new Error('It looks like you\'ve forgotten to wrap your App with the <WalletConnectProvider />.') ) export const defaultContext = Object.freeze({ createSession: createErrorThunk() as () => Promise<void>, killSession: createErrorThunk() as () => Promise<void>, session: [], sendTransaction: createErrorThunk() as () => Promise<void>, signTransaction: createErrorThunk() as () => Promise<void>, signPersonalMessage: createErrorThunk() as () => Promise<void>, signMessage: createErrorThunk() as () => Promise<void>, signTypedData: createErrorThunk() as () => Promise<void>, sendCustomRequest: createErrorThunk() as () => Promise<void> }) const WalletConnectContext = createContext(defaultContext) export default WalletConnectContext
function checkAnswers(answers) { const answerMap = {}; for (let i = 0; i < answers.length; i++) { const answer = answers[i]; if(answerMap[answer]) { return false; } else { answerMap[answer] = true; } } return true; }
#!/bin/bash run_sys_bench_test() { MYSQL_HOST=$1 MYSQL_ROOT_PASSWORD=$2 DOCKER_NETWORK=$3 USE_MYSQL_NATIVE_PASSWORD_PLUGIN=$4 # create schema docker run --rm -i --network="${DOCKER_NETWORK}" rapidfort/mysql:latest \ -- mysql -h "${MYSQL_HOST}" -uroot -p"${MYSQL_ROOT_PASSWORD}" -e "CREATE SCHEMA sbtest;" # create user CREATE_USER_STR= if [[ "${USE_MYSQL_NATIVE_PASSWORD_PLUGIN}" = "yes" ]]; then CREATE_USER_STR="CREATE USER sbtest@'%' IDENTIFIED WITH mysql_native_password BY 'password';" else CREATE_USER_STR="CREATE USER sbtest@'%' IDENTIFIED BY 'password';" fi docker run --rm -i --network="${DOCKER_NETWORK}" rapidfort/mysql:latest \ -- mysql -h "${MYSQL_HOST}" -uroot -p"$MYSQL_ROOT_PASSWORD" -e "${CREATE_USER_STR}" # grant privelege docker run --rm -i --network="${DOCKER_NETWORK}" rapidfort/mysql:latest \ -- mysql -h "${MYSQL_HOST}" -uroot -p"${MYSQL_ROOT_PASSWORD}" -e "GRANT ALL PRIVILEGES ON sbtest.* to sbtest@'%';" # run sys bench prepare docker run --rm \ --rm=true \ --network="${DOCKER_NETWORK}" \ severalnines/sysbench \ sysbench \ --db-driver=mysql \ --oltp-table-size=100000 \ --oltp-tables-count=24 \ --threads=1 \ --mysql-host="${MYSQL_HOST}" \ --mysql-port=3306 \ --mysql-user=sbtest \ --mysql-password=password \ /usr/share/sysbench/tests/include/oltp_legacy/parallel_prepare.lua \ run # run sys bench test docker run --rm \ --network="${DOCKER_NETWORK}" \ severalnines/sysbench \ sysbench \ --db-driver=mysql \ --report-interval=2 \ --mysql-table-engine=innodb \ --oltp-table-size=100000 \ --oltp-tables-count=24 \ --threads=64 \ --time=30 \ --mysql-host="${MYSQL_HOST}" \ --mysql-port=3306 \ --mysql-user=sbtest \ --mysql-password=password \ /usr/share/sysbench/tests/include/oltp_legacy/oltp.lua \ run }
#!/usr/bin/env bash set -eu cargo +nightly contract build --manifest-path util/Cargo.toml cargo +nightly contract build --manifest-path asset/Cargo.toml cargo +nightly contract build --manifest-path oracle/Cargo.toml cargo +nightly contract build --manifest-path distributor/Cargo.toml cargo +nightly contract build --manifest-path boardroom/Cargo.toml cargo +nightly contract build --manifest-path treasury/Cargo.toml
#!/bin/bash # Runs the docker-compose project ################################################################################################### # CONFIGURATION ################################################################################################### PROJECT_NAME="greeter" ################################################################################################### # DEFINES ################################################################################################### HERE="$(pwd)/$(dirname $0)" ################################################################################################### # MAIN ################################################################################################### SUDO="" if [ $(uname) == Linux ]; then SUDO="sudo" fi cd ${HERE}/../docker ${SUDO} docker-compose -p ${PROJECT_NAME} up -d
#!/bin/bash #This file is to download pretrained model file and associate synset.txt file. It is assumed that these two files are already in a blob #container, if you want to use a pretrained image classification model and associated synset file, you can download them from the links below # and put them in storage container # wget http://data.dmlc.ml/mxnet/models/imagenet/synset.txt # wget https://www.cntk.ai/resnet/ResNet_152.model # Downloading Azure CLI on the VSTS build agent machine apt-get update -y && apt-get install -y python libssl-dev libffi-dev python-dev build-essential #curl -L https://azurecliprod.blob.core.windows.net/install.py -o install.py #printf "/usr/azure-cli\n/usr/bin" | python install.py #az #Setting environment variables to access the blob container export AZURE_STORAGE_ACCOUNT=$1 export AZURE_STORAGE_KEY=$2 export container_name=$3 export blob_name1=$4 export blob_name2=$5 # Downloading Blob if [ ! d flaskwebapp ]; then mkdir flaskwebapp fi az storage blob download --container-name $container_name --name $blob_name1 --file flaskwebapp/$blob_name1 --output table az storage blob download --container-name $container_name --name $blob_name2 --file flaskwebapp/$blob_name2 --output table az storage blob list --container-name $container_name --output table
# Function to swap two numbers def swap_nums(num1, num2): # Swapping the two numbers num1, num2 = num2, num1 return num1, num2 # Main code num1 = 5 num2 = 10 # Printing the values before swapping print("Before swapping: ") print("Number 1 = ", num1) print("Number 2 = ", num2) # Calling the swap function num1, num2 = swap_nums(num1, num2) # Printing the values after swapping print("\nAfter swapping: ") print("Number 1 = ", num1) print("Number 2 = ", num2)
# Dataset: market1501 # imagesize: 256x128 # batchsize: 16x4 # warmup_step 10 # random erase prob 0.5 # last stride 1 # with center loss # weight regularized triplet loss # generalized mean pooling # non local blocks # without re-ranking: add TEST.RE_RANKING "('on')" for re-ranking python3 tools/main.py --config_file='configs/AGW_baseline.yml' MODEL.DEVICE_ID "('1')" \ DATASETS.NAMES "('market1501')" MODEL.PRETRAIN_CHOICE "('self')" \ TEST.WEIGHT "('./pretrained/market1501_AGW.pth')" TEST.EVALUATE_ONLY "('on')" OUTPUT_DIR "('./log/Test')"
/// <reference path="../../typings/tsd.d.ts"/> var gulp = require('gulp'); var concat = require('gulp-concat'); //var gulpIf = require('gulp-if'); //var ngAnnotate = require('gulp-ng-annotate'); var ts = require('gulp-typescript'); //var uglify = require('gulp-uglify'); //var srcGlob = ['app/assets/**/*.ts', '!**/*.spec.ts']; var srcGlob = ['Chokaigi2015/html/js/**/*.ts']; gulp.task('typescript:compile:js:develop', () => { return compile(false); }); gulp.task('typescript:compile:js:release', () => { return compile(true); }); gulp.task('typescript:watch', ['typescript:compile:js:develop'], () => { gulp.watch(srcGlob, ['typescript:compile:js:develop']); }); function compile(isRelease: boolean) { var tsProject = ts.createProject({ removeComments: true, // Do not emit comments to output. //noImplicitAny: false, // Warn on expressions and declarations with an implied 'any' type. //noLib: false, // Don't include the default lib (with definitions for - Array, Date etc) //noEmitOnError: false, // Do not emit outputs if any type checking errors were reported. //target: "ES3", // Specify ECMAScript target version: 'ES3' (default), 'ES5' or 'ES6'. //module: "", // Specify module code generation: 'commonjs' or 'amd' //sourceRoot: "", // Specifies the location where debugger should locate TypeScript files instead of source locations. declarationFiles: false, // Generates corresponding .d.ts files. noExternalResolve: false, // Do not resolve files that are not in the input. Explanation below. sortOutput: true, // Sort output files. Usefull if you want to concatenate files (see below). }); var tsResult = gulp.src(srcGlob) .pipe(ts(tsProject, { referencedFrom: ['Application.ts'] })); return tsResult.js .pipe(concat('app.js')) //.pipe(ngAnnotate()) //.pipe(gulpIf(isRelease, uglify())) //.pipe(uglify()) .pipe(gulp.dest('Chokaigi2015/html/js')); }
import matplotlib.pyplot as plt import numpy as np import pandas as pd import tensorflow as tf import tensorflow.contrib.learn.python.learn as learn import csv import json import math import random random.seed() def read_data(path): df = pd.read_csv('data/type-inference+vars.csv') label_names = [c for c in df.columns if c[0] == 'L'] feature_names = [c for c in df.columns if c[0] == 'F'] print df.shape # filter out vectors with no predictions criteria = (df[l] == 1.0 for l in label_names) df = df[reduce(lambda x, acc: x | acc, criteria)] print df.shape return (df, feature_names, label_names) def plot_weights(w, x_labels, y_labels): plt.matshow(w, cmap='hot', interpolation='nearest') plt.xticks(np.arange(len(x_labels)), x_labels, rotation=90) plt.yticks(np.arange(len(y_labels)), y_labels) # plt.legend() plt.show() df, feature_names, label_names = read_data('data/type-inference+vars.csv') N_CATS = len(feature_names) N_OUTS = len(label_names) N_FOLDS = 1 # select an equal number of good and bad samples # N_SAMPLES = 100000 # good=0 # bad=0 # samples = [] # for l in orig: # try: # d = json.loads(l) # # if d['kind'] == 'Good': # # good+=1 # # if good > N_SAMPLES: # # continue # # else: # # bad+=1 # # if bad > N_SAMPLES: # # continue # fs = [float(f) for f in d['features']] # ls = [float(l) for l in d['kind']] # if ls == [0. for l in d['kind']]: # #print 'skipping expr with unknown type' # continue # # if N_OUTS == 1: # # l = [1.] if d['kind'] == 'Bad' else [-1.] # # else: # # l = [1., 0.] if d['kind'] == 'Bad' else [0., 1.] # except: # continue # samples.append((fs, ls)) # # shuffle the samples again # random.shuffle(samples) # # and extract the data/labels # data=[] # labels=[] # for d, l in samples: # data.append(d) # labels.append(l) # data = np.array(data) # labels = np.array(labels) # print (data.shape, labels.shape) def variable_summaries(var, name): """Attach a lot of summaries to a Tensor.""" with tf.name_scope('summaries'): mean = tf.reduce_mean(var) tf.summary.scalar('mean/' + name, mean) with tf.name_scope('stddev'): stddev = tf.sqrt(tf.reduce_mean(tf.square(var - mean))) tf.summary.scalar('stddev/' + name, stddev) tf.summary.scalar('max/' + name, tf.reduce_max(var)) tf.summary.scalar('min/' + name, tf.reduce_min(var)) tf.summary.histogram(name, var) N_HIDDEN = 30 N_HIDDEN_2 = 100 x = tf.placeholder(tf.float32, [None, N_CATS], name='x') #with tf.name_scope('hidden_1'): # h_W = tf.Variable(tf.truncated_normal([N_CATS, N_HIDDEN], stddev=1.0 / math.sqrt(float(N_CATS))), # name='W') # ## initializing hidden weights to 0 seems to make everything except # ## final biases go to 0, why?? # # h_W = tf.Variable(tf.zeros([N_CATS, N_HIDDEN]), # # name='W') # h_b = tf.Variable(tf.zeros([N_HIDDEN]), name='b') # variable_summaries(h_W,'h_W') # variable_summaries(h_b,'h_b') # # h = tf.nn.relu(tf.matmul(x, h_W) + h_b) # #with tf.name_scope('hidden_2'): # h2_W = tf.Variable(tf.truncated_normal([N_HIDDEN, N_HIDDEN_2], stddev=1.0 / math.sqrt(float(N_HIDDEN))), # name='W') # ## initializing hidden weights to 0 seems to make everything except # ## final biases go to 0, why?? # # h_W = tf.Variable(tf.zeros([N_CATS, N_HIDDEN]), # # name='W') # h2_b = tf.Variable(tf.zeros([N_HIDDEN_2]), name='b') # variable_summaries(h2_W,'h2_W') # variable_summaries(h2_b,'h2_b') # # h2 = tf.nn.relu(tf.matmul(h, h2_W) + h2_b) with tf.name_scope('linear'): #W = tf.Variable(tf.truncated_normal([N_HIDDEN_2, N_OUTS], stddev=1.0 / math.sqrt(float(N_CATS))), # name='W') W = tf.Variable(tf.truncated_normal([N_CATS, N_OUTS], stddev=1.0 / math.sqrt(float(N_CATS))), name='W') # W = tf.Variable(tf.zeros([N_HIDDEN, N_OUTS]), # name='W') b = tf.Variable(tf.zeros([N_OUTS]), name='b') variable_summaries(W,'W') variable_summaries(b,'b') #y = tf.matmul(h2, W) + b y = tf.matmul(x, W) + b y_ = tf.placeholder(tf.float32, [None, N_OUTS], name='y_') with tf.name_scope('cross_entropy'): cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=y, labels=y_), name='xentropy_mean') tf.summary.scalar('cross_entropy', cross_entropy) with tf.name_scope('train'): train_step = tf.train.GradientDescentOptimizer(5).minimize(cross_entropy) #train_step = tf.train.AdamOptimizer(0.001).minimize(cross_entropy) # def chunks(l, n): # """Yield successive n-sized chunks from l.""" # for i in range(0, len(l), n): # yield l[i:i + n] # from itertools import cycle # fold_size = len(data) / N_FOLDS # folds = cycle(chunks(data, fold_size)) # fold_labels = cycle(chunks(labels, fold_size)) for k in range(N_FOLDS): print('fold %d' % k) # data_test = folds.next() # labels_test = fold_labels.next() # # print data_test.shape # n_good=0 # n_bad=0 # for l in labels_test: # if l[0] == 1.: # and l[1] == 0.: # n_bad+=1 # else: # n_good+=1 # print n_good, n_bad # data_train = np.array([v for v in folds.next() for i in range(N_FOLDS-1)]) # labels_train = np.array([v for v in fold_labels.next() for i in range(N_FOLDS-1)]) df_test = df.sample(frac=0.1) features_test = df_test[feature_names] labels_test = df_test[label_names] df_train = df.sample(frac=0.9) features_train = df_train[feature_names] labels_train = df_train[label_names] sess = tf.InteractiveSession() merged = tf.summary.merge_all() summary_writer = tf.summary.FileWriter('/tmp', sess.graph) tf.global_variables_initializer().run() if N_OUTS >= 2: correct_prediction = tf.equal(tf.argmax(y,1), tf.argmax(y_,1)) else: correct_prediction = tf.equal(tf.sign(y), y_) accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32)) for i in range(1000): batch_xs = features_train[i*100 : i*100 + 100] batch_ys = labels_train[i*100 : i*100 + 100] summary_str, _, acc = sess.run([merged, train_step, accuracy], feed_dict={x: batch_xs, y_: batch_ys}) summary_writer.add_summary(summary_str, i) #if i % 10 == 0: # print('Accuracy at step %s: %s' % (i, acc)) #print(data.shape) print('accuracy %f' % sess.run(accuracy, feed_dict={x: features_test, y_: labels_test})) # print(sess.run(y, feed_dict={x: [data[10001]], y_: [labels[10001]]})) # print('h_W') # for c, w in zip(CATEGORICAL_COLS, sess.run(h_W)): # print c, w # print('h_b', sess.run(h_b)) # print('W') # for c, w in zip(CATEGORICAL_COLS, sess.run(W)): # print c, w # print(LABELS) # print(sess.run(tf.transpose(W))) # print(sess.run(b)) w_learned = sess.run(tf.transpose(W)) plot_weights(w_learned, feature_names, label_names) print("") # drop next set of data/labels to move to next fold # folds.next() # fold_labels.next()
#!/usr/bin/env bash CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # shellcheck source=../shell_config.sh . "$CURDIR"/../shell_config.sh printf "PROXY TCP4 255.255.255.255 255.255.255.255 65535 65535\r\n\0\21ClickHouse client\24\r\253\251\3\0\7default\0\4\1\0\1\0\0\t0.0.0.0:0\1\tmilovidov\21milovidov-desktop\vClickHouse \24\r\253\251\3\0\1\0\0\0\2\1\25SELECT 'Hello, world'\2\0\247\203\254l\325\\z|\265\254F\275\333\206\342\24\202\24\0\0\0\n\0\0\0\240\1\0\2\377\377\377\377\0\0\0" | nc "${CLICKHOUSE_HOST}" "${CLICKHOUSE_PORT_TCP_WITH_PROXY}" | head -c150 | grep --text -o -F 'Hello, world'
/* Retrieve information about the specified console screen buffer. Remarks: Refer at fn. cli_init_ty_beta. */ # define CBR # define CLI_W32 # include <stdio.h> # include "../../../incl/config.h" signed(__cdecl cli_get_csbi_beta(CLI_W32_STAT(*argp))) { auto signed i,r; if(!argp) return(0x00); if(!(*(CLI_OUT+((*argp).device)))) { printf("%s\n","<< Get a handle to the specified standard output device."); return(0x00); } r = GetConsoleScreenBufferInfo(*(CLI_OUT+((*argp).device)),&((*argp).csbi)); if(!r) { r = GetLastError(); printf("%s%d%s%X\n","<< Error at fn. GetConsoleScreenBufferInfo() with error no. ",r," or ",r); return(0x00); } return(0x01); }
SELECT AVG(TIMESTAMPDIFF(HOUR, customers.in_time, customers.out_time)) FROM store_visits WHERE DAYOFWEEK(customers.in_time) NOT IN (1, 7);
#!/bin/sh cat materialize-go-prejoined-views.mysql cat materialize-go-graph-views.mysql cat materialize-go-obd-bridge.mysql cat materialize-go-annotation-reports.mysql cat materialize-go-evidence-views.mysql cat materialize-go-taxon-views.mysql cat materialize-go-refgenomes-views.mysql #cat go-term-motif-correlation.mysql #cat go-uniq-assoc.mysql #cat new-views.mysql
""" Build a Python program that includes a function to add two given numbers. """ def add(a, b): return a + b if __name__ == '__main__': result = add(2, 3) print(f'The sum of 2 and 3 is {result}')
<gh_stars>0 package org.firstinspires.ftc.teamcode.autonomous; import org.firstinspires.ftc.teamcode.game.Alliance; /** * Created by <NAME> on 09/28/2019 * <p> * Here's our approach for the autonomous period * Steps * 1. Find Sky-stone in top section of quarry * 2. Approach top sky-stone * 3. Capture sky-stone * 3. Navigate to foundation * 5. Place stone * 6. Approach bottom sky-stone * 7. Capture second sky-stone * 8. Navigate to foundation * 9. Place stone * 10. Move foundation * 11. Park */ @com.qualcomm.robotcore.eventloop.opmode.Autonomous(name="Red Foundation", group="Phoebe") //@Disabled public class RedFoundation extends AutonomousHelperFoundation { @Override public void init() { super.init(Alliance.Color.RED); } }
<reponame>p3d-in/react-babylonjs<filename>src/customComponents/VRExperienceHelperLifecycleListener.ts import { LifecycleListener } from "../LifecycleListener" import { CreatedInstance } from "../CreatedInstance" export default class VRExperienceHelperLifecycleListener implements LifecycleListener { private props: any constructor(props: any) { this.props = props } onParented(parent: CreatedInstance<any>, child: CreatedInstance<any>): any {} onChildAdded(child: CreatedInstance<any>, parent: CreatedInstance<any>): any {} onMount(instance: CreatedInstance<any>): void { if (this.props.enableInteractions) { if (typeof instance.hostInstance.enableInteractions === "function") { instance.hostInstance.enableInteractions() } } } }
import React from 'react'; import profile from '../images/profile-picture.jpg' import swal from 'sweetalert'; function SweetAlert() { swal("What is your favourite taco? Hint: type in fish, veggi, choriso, al pastor, arabes or barbacoa", { content: "input", }) .then((value) => { if (value === "choriso") { swal(`Hell yeah! ${value} is my favourite taco!`); } else { swal(`Sorry ${value} is not my favourite taco!`); } }); } export default function Header() { return ( <main className="mt-10 mx-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"> <div className="flex xl:flex-row lg:flex-row md: flex-col-reverse"> <div className="sm:text-center lg:text-left"> <h1 className="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"> <span className="block xl:inline">Hi, I am Katharina</span>{' '} <span className="block text-indigo-600 xl:inline-block max-w-screen-sm">taco-lover and passionate coder</span> </h1> <p className="mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:max-w-xl sm:mx-auto md:mt-5 md:text-xl lg:mx-0"> A career changer with a success story: quit advertising for IT. Both strategic and creative thinker, self-motivated flexible multitasker and a passionate coder. Throughout my career I have been working in different fields and roles. I therefore truly believe, that a career is not a straight path and consider myself being a lively illustration of how different experiences are shaping individuals with a broad skillset, unconventional approches to a problem solving and flexible mindset. </p> <div className="mt-5 sm:mt-8 sm:flex sm:justify-center lg:justify-start"> <div className="rounded-md shadow"> <a role="button" tabIndex={0} className="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 md:py-4 md:text-lg md:px-10" onClick={SweetAlert} > Am I your taco-match? </a> </div> <div className="mt-3 sm:mt-0 sm:ml-3"> <a href="/about" className="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-indigo-700 bg-indigo-100 hover:bg-indigo-200 md:py-4 md:text-lg md:px-10" > Am I your code-match? </a> </div> </div> </div> <div > <img className=" mx-auto my-5 xl:h-1/2 lg:h-1/2 rounded-full object-cover md: h-96" src={profile} alt="" /> </div> </div> </main> ) }
<gh_stars>0 import { Controller, Get, Post, Body, Param, Delete, Patch, Query, UsePipes, ValidationPipe, ParseIntPipe, UseGuards } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; import { Usuario } from 'src/auth/usuario.entity'; import { GetUsuario } from 'src/auth/get-usuario.decorator'; import { TiposOpcoesService } from './tipos-opcoes.service'; import { TipoOpcao } from './tipo-opcao.entity'; import { GetTipoOpcaoDto } from './dto/get-tipo-opcao.dto'; @Controller('tiposopcoes') @UseGuards(AuthGuard()) export class TiposOpcoesController { constructor(private tiposOpcoesService: TiposOpcoesService) {} @Get() getTiposOpcoes(): Promise<TipoOpcao[]> { return this.tiposOpcoesService.getTiposOpcoes(); } @Get('/:id') getTipoOpcaoById(@Param('id', ParseIntPipe) id: number, @GetUsuario() usuario: Usuario): Promise<GetTipoOpcaoDto> { return this.tiposOpcoesService.getTipoOpcaoById(id); } @Post() @UsePipes(ValidationPipe) createTipoOpcao(@Body() tipoOpcao: TipoOpcao): Promise<TipoOpcao> { return this.tiposOpcoesService.createTipoOpcao(tipoOpcao); } }
angular.module('bookkeeping.accounts', ['ui.router', 'ngResource', 'bookkeeping.date', 'bookkeeping.error', 'bookkeeping.stringarray.directive']) .config(['$stateProvider', function ($stateProvider) { $stateProvider .state('accounts', { url: '/accounts', templateUrl: 'modules/accounts/accounts.html', controller: 'AccountsCtrl' }) .state('accountDetail', { url: '/accounts/:accountId', templateUrl: 'modules/accounts/form.html', controller: 'AccountCtrl' }); }]) .value('accountTypes', ['asset', 'liability', 'expense', 'revenue']) .filter('translateTypes', function () { var typeTranslations = { asset: 'Aktiv', liability: 'Passiv', expense: 'Aufwand', revenue: 'Ertrag' }; return function (type) { return typeTranslations[type] || 'unbekannt'; }; }) .service('Account', ['$resource', function ($resource) { return $resource('/api/v1/accounts/:accountId', {accountId: '@_id'}); }]) .controller('AccountsCtrl', ['$scope', 'Account', '$state', function ($scope, Account, $state) { $scope.accounts = Account.query(); $scope.showDetail = function (account) { $state.go('accountDetail', {accountId: account._id}); }; }]) .controller('AccountCtrl', ['$scope', '$stateParams', 'Account', '$state', 'accountTypes', 'errorTooltipHandler', function ($scope, $stateParams, Account, $state, accountTypes, errorTooltipHandler) { if ($stateParams.accountId) { $scope.account = Account.get($stateParams); } else { $scope.account = new Account(); $scope.account.freezed = moment().toDate(); } $scope.accountTypes = accountTypes; var success = function() { $state.go('accounts'); }; $scope.remove = function (event) { $scope.account.$remove(success, errorTooltipHandler(event.target)); }; $scope.save = function() { $scope.account.$save(success, errorTooltipHandler(event.target)); }; }]);
<filename>api/modules/system/controllers/info.system.controller.js 'use strict'; const PKG = require('../../../package'); module.exports = (request, reply) => { return reply({ 'name': PKG.name, 'version': PKG.version, 'description': PKG.description }); };
#!/bin/bash #SBATCH --gres=gpu:2 #SBATCH --cpus-per-task=4 #SBATCH --ntasks=2 #SBATCH --mem=12G #SBATCH --time=0-00:19 #SBATCH --output=logdnn.out module load cuda cudnn python/3.5.2 source tensorflow/bin/activate python3 SimBoost/xgboost/DNN_est.py
// Copyright (c) 2016-2019 <NAME>. All rights reserved. // Copyright (c) 2016-2019 <NAME>. All rights reserved. // Copyright (c) 2020-2021 Oasis Labs Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the copyright holder nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package curve import "github.com/oasisprotocol/curve25519-voi/curve/scalar" func edwardsMul(out, point *EdwardsPoint, scalar *scalar.Scalar) *EdwardsPoint { switch supportsVectorizedEdwards { case true: return edwardsMulVector(out, point, scalar) default: return edwardsMulGeneric(out, point, scalar) } } func edwardsMulGeneric(out, point *EdwardsPoint, scalar *scalar.Scalar) *EdwardsPoint { // Construct a lookup table of [P,2P,3P,4P,5P,6P,7P,8P] lookupTable := newProjectiveNielsPointLookupTable(point) // Setting s = scalar, compute // // s = s_0 + s_1*16^1 + ... + s_63*16^63, // // with `-8 <= s_i < 8` for `0 <= i < 63` and `-8 <= s_63 <= 8`. scalarDigits := scalar.ToRadix16() // Compute s*P as // // s*P = P*(s_0 + s_1*16^1 + s_2*16^2 + ... + s_63*16^63) // s*P = P*s_0 + P*s_1*16^1 + P*s_2*16^2 + ... + P*s_63*16^63 // s*P = P*s_0 + 16*(P*s_1 + 16*(P*s_2 + 16*( ... + P*s_63)...)) // // We sum right-to-left. // Unwrap first loop iteration to save computing 16*identity var ( tmp3 EdwardsPoint tmp2 projectivePoint tmp1 completedPoint ) tmp3.Identity() tmp := lookupTable.Lookup(scalarDigits[63]) tmp1.AddEdwardsProjectiveNiels(&tmp3, &tmp) // Now tmp1 = s_63*P in P1xP1 coords for i := 62; i >= 0; i-- { tmp2.SetCompleted(&tmp1) // tmp2 = (prev) in P2 coords tmp1.Double(&tmp2) // tmp1 = 2*(prev) in P1xP1 coords tmp2.SetCompleted(&tmp1) // tmp2 = 2*(prev) in P2 coords tmp1.Double(&tmp2) // tmp1 = 4*(prev) in P1xP1 coords tmp2.SetCompleted(&tmp1) // tmp2 = 4*(prev) in P2 coords tmp1.Double(&tmp2) // tmp1 = 8*(prev) in P1xP1 coords tmp2.SetCompleted(&tmp1) // tmp2 = 8*(prev) in P2 coords tmp1.Double(&tmp2) // tmp1 = 16*(prev) in P1xP1 coords tmp3.setCompleted(&tmp1) // tmp3 = 16*(prev) in P3 coords tmp = lookupTable.Lookup(scalarDigits[i]) tmp1.AddEdwardsProjectiveNiels(&tmp3, &tmp) // Now tmp1 = s_i*P + 16*(prev) in P1xP1 coords } return out.setCompleted(&tmp1) } func edwardsMulVector(out, point *EdwardsPoint, scalar *scalar.Scalar) *EdwardsPoint { lookupTable := newCachedPointLookupTable(point) scalarDigits := scalar.ToRadix16() var ( q extendedPoint tmp cachedPoint ) q.Identity() for i := 63; i >= 0; i-- { q.MulByPow2(&q, 4) tmp = lookupTable.Lookup(scalarDigits[i]) q.AddExtendedCached(&q, &tmp) } return out.setExtended(&q) }
#!/usr/bin/env sh # https://helm.sh/docs/topics/plugins/#downloader-plugins # It's always the 4th parameter file=$(printf '%s' "${4}" | sed -e 's!.*://!!') exec sops --decrypt --input-type "yaml" --output-type "yaml" "${file}"
#!/bin/bash # # Author: Sarven Capadisli <info@csarven.ca> # Author URI: http://csarven.ca/#i # . $HOME/lodstats-env/bin/activate . ./bfs.config.sh rm "$data"import/*stats* #lodstats -val "$data"import/graph.meta.nt > "$data"import/graph.meta.nt.stats.ttl #find "$data" -name "*[!Structure|prov].rdf" | while read i ; do file=$(basename "$i"); dataSetCode=${file%.*}; # lodstats -val "$data"import/graph.data.nt > "$data"import/graph.data.nt.stats.ttl # done; for i in "$data"import/*.nt ; do lodstats -val "$i" > "$i".stats.ttl echo "Created $i.stats.ttl" done; #real 2m48.002s #user 2m47.366s #sys 0m0.292s echo "Fixing URI for meta stats" ; find "$data"import/*stats.ttl -name "*[!Structure|prov]" | while read i ; do sed -ri 's/<file:\/\/\/data\/'"$agency"'-linked-data\/data'"$state"'\/import\/([^\.]*)\.nt/<http:\/\/'"$agency"'.270a.info\/dataset\/\1/g' "$i" ; done ;
import numpy as np import pytest from numpy.testing import assert_almost_equal, assert_raises from sklearn.metrics import pairwise_distances from sklearn.metrics.pairwise import pairwise_kernels from ...tools import linear from .. import MaxMargin class TestMaxMarginStat: @pytest.mark.parametrize( "n, obs_stat", [(100, 0.6983550238795532), (200, 0.7026459581729386)] ) @pytest.mark.parametrize("obs_pvalue", [1 / 1000]) def test_linear_oned(self, n, obs_stat, obs_pvalue): np.random.seed(123456789) x, y = linear(n, 5) stat, pvalue = MaxMargin("Dcorr").test(x, y) assert_almost_equal(stat, obs_stat, decimal=2) assert_almost_equal(pvalue, obs_pvalue, decimal=2) def test_kernstat(self): np.random.seed(123456789) x, y = linear(100, 1) stat, pvalue = MaxMargin("Hsic").test(x, y, auto=False) assert_almost_equal(stat, 0.1072, decimal=2) assert_almost_equal(pvalue, 1 / 1000, decimal=2) class TestMaxMarginErrorWarn: """Tests errors and warnings.""" def test_no_indeptest(self): # raises error if not indep test assert_raises(ValueError, MaxMargin, "abcd")
import React, {Component} from 'react'; import { StyleSheet, View, Text, } from 'react-native'; export default class App extends Component { state = {}; render(){ return ( <View style={styles.container}> <Text>HomePage</Text> </View> ); } } const styles = StyleSheet.create({ container:{ flex: 1, justifyContent: 'center', alignItems: 'center', }, }); // SettingsPage.js import React, {Component} from 'react'; import { StyleSheet, View, Text, } from 'react-native'; export default class App extends Component { state = {}; render(){ return ( <View style={styles.container}> <Text>SettingsPage</Text> </View> ); } } const styles = StyleSheet.create({ container:{ flex: 1, justifyContent: 'center', alignItems: 'center', }, });
package de.aitools.ie.segmentation; import java.io.ObjectInputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; import java.util.Locale; import edu.stanford.nlp.io.IOUtils; import edu.stanford.nlp.ling.CoreLabel; import edu.stanford.nlp.parser.lexparser.LexicalizedParser; import edu.stanford.nlp.process.CoreLabelTokenFactory; import edu.stanford.nlp.process.PTBTokenizer; import edu.stanford.nlp.process.Tokenizer; import edu.stanford.nlp.process.TokenizerFactory; import edu.stanford.nlp.process.WhitespaceTokenizer.WhitespaceTokenizerFactory; import edu.stanford.nlp.process.WordToSentenceProcessor; import edu.stanford.nlp.trees.Tree; /** * Wrapper for the StanfordParser to provide simple access to the needed * functionalities. * * @author <EMAIL> * */ public class StanfordParser { private static final String PARSER_MODEL_PATH = "edu/stanford/nlp/models/lexparser/"; private static final String[] PARSER_MODEL_VARIANTS = { "PCFG.ser.gz", "Factored.ser.gz" }; private final Locale locale; private TokenizerFactory<CoreLabel> tokenizerFactory; private LexicalizedParser lexicalizedParser; /** * Creates a parser for given locale. * <p> * Will load the internal classes when they are required. This can then throw * an IllegalArgumentException when no parser model is found for given locale. * </p> * @param locale The locale of the texts to be processed * @throws NullPointerException If given locale is null */ public StanfordParser(final Locale locale) throws NullPointerException { if (locale == null) { throw new NullPointerException(); } this.locale = locale; this.lexicalizedParser = null; this.tokenizerFactory = null; } /** * Segments given segment into sentences. * @param segment The input segment * @return A list of the sentences spanned by given segment */ public List<Segment> toSentences(final Segment segment) { // Adapted from http://stackoverflow.com/a/30926661 final List<CoreLabel> tokens = this.toTokens(segment.text); final WordToSentenceProcessor<CoreLabel> sentenceProcessor = new WordToSentenceProcessor<CoreLabel>(); final List<List<CoreLabel>> sentenceTokens = sentenceProcessor.process(tokens); int end; int start = 0; final List<Segment> sentences = new ArrayList<>(); for (final List<CoreLabel> sentence: sentenceTokens) { end = sentence.get(sentence.size()-1).endPosition(); sentences.add(Segment.fromSegment(segment, start, end, true)); start = end; } return sentences; } /** * Tokenizes the provided text. * @param string The text * @return The tokens */ public List<CoreLabel> toTokens(final String string) { final List<CoreLabel> tokens = new ArrayList<CoreLabel>(); final Tokenizer<CoreLabel> tokenizer = this.getTokenizer(string); while (tokenizer.hasNext()) { tokens.add(tokenizer.next()); } return tokens; } /** * Tokenizes the provided text, adding punctuation marks to the previous * token. * @param segment The text * @return The tokens */ public List<Segment> toWords(final Segment segment) { final List<Segment> words = new ArrayList<Segment>(); int start = 0; final ListIterator<CoreLabel> tokenIterator = this.toTokens(segment.text).listIterator(); while (tokenIterator.hasNext()) { CoreLabel token = tokenIterator.next(); start += token.before().length(); final StringBuilder wordTextBuilder = new StringBuilder(); wordTextBuilder.append(token.originalText()); while (token.after().isEmpty() && tokenIterator.hasNext()) { token = tokenIterator.next(); if (StanfordParser.isCompleteWord(wordTextBuilder.toString()) && StanfordParser.isWordStart(token)) { tokenIterator.previous(); // the first element of next segment tokenIterator.previous(); // the last element of current segment // and again the last element of current segment token = tokenIterator.next(); break; } else { wordTextBuilder.append(token.before()); wordTextBuilder.append(token.originalText()); } } final int end = start + wordTextBuilder.length(); words.add(Segment.fromSegment(segment, start, end, true)); start = end; } return words; } /** * Parses the constituency tree from given sentence. * @param sentence The input sentence * @return The tree */ public Tree toTree(final String sentence) { final Tokenizer<CoreLabel> tokenizer = this.getTokenizer(sentence); final Tree tree = this.getLexicalizedParser().apply(tokenizer.tokenize()); tree.setSpans(); return tree; } private static boolean isWordStart(final CoreLabel token) { final String value = token.value(); if (Character.isLetterOrDigit(value.charAt(0))) { return true; } else if (value.matches("-L.B-")) { return true; } return false; } private static boolean isCompleteWord(final String word) { if (word.matches(".*[\\(\\[\\{]")) { return false; } else if (word.matches("[\"']")) { return false; } return true; } private LexicalizedParser getLexicalizedParser() { synchronized (this) { if (this.lexicalizedParser == null) { this.lexicalizedParser = StanfordParser.loadLexicalizedParser(this.locale); } } return this.lexicalizedParser; } private Tokenizer<CoreLabel> getTokenizer(final String string) { synchronized (this) { if (this.tokenizerFactory == null) { this.tokenizerFactory = StanfordParser.loadTokenizerFactory(this.locale); } } return this.tokenizerFactory.getTokenizer(new StringReader(string)); } private static TokenizerFactory<CoreLabel> loadTokenizerFactory( final Locale locale) { if (locale.equals(Locale.ENGLISH)) { return PTBTokenizer.factory( new CoreLabelTokenFactory(), ",invertible=true"); } else { return new WhitespaceTokenizerFactory<CoreLabel>( new CoreLabelTokenFactory(), ",invertible=true"); } } private static LexicalizedParser loadLexicalizedParser(final Locale locale) throws IllegalArgumentException { for (final String path : StanfordParser.getLexicalizedParserPaths(locale)) { try { final ObjectInputStream parserStream = IOUtils.readStreamFromString(path); try { return LexicalizedParser.loadModel(parserStream); } finally { parserStream.close(); } } catch (final Exception e) { // Path not found... still okay... try next } } throw new IllegalArgumentException("No model found for locale " + locale); } private static String[] getLexicalizedParserPaths(final Locale locale) { final int numVariants = StanfordParser.PARSER_MODEL_VARIANTS.length; final String[] paths = new String[numVariants]; for (int v = 0; v < numVariants; ++v) { paths[v] = StanfordParser.PARSER_MODEL_PATH + locale.getDisplayName(Locale.ENGLISH).toLowerCase() + StanfordParser.PARSER_MODEL_VARIANTS[v]; } return paths; } }
/** * Gets the repositories of the user from Github */ import { put, takeLatest, all } from 'redux-saga/effects'; import { Auth, API, graphqlOperation } from 'aws-amplify'; import { selectCurrentUser, selectCurrentUserContainer, } from 'utils/selectUserInfo'; import { createUserContainer, updateUserContainer } from 'graphql/mutations'; import { getUserContainer } from 'graphql/queries'; import { currentUserLoaded, currentUserError, currentUserContainer, currentUserContainerLoaded, currentUserContainerError, updateCurrentUserContainerSuccess, updateCurrentUserContainerError, logoutSuccess, logoutError, } from './actions'; import { LOAD_CURRENT_USER, UPDATE_CURRENT_USER_CONTAINER, LOGOUT, } from './constants'; export function* loadCurrentUser() { try { const currentUser = yield Auth.currentAuthenticatedUser(); yield put(currentUserLoaded(selectCurrentUser(currentUser))); yield loadCurrentUserContainer(selectCurrentUserContainer(currentUser)); } catch (error) { yield put(currentUserError(error)); } } export function* loadCurrentUserContainer(userContainer) { try { yield put(currentUserContainer(userContainer)); const request = yield API.graphql( graphqlOperation(getUserContainer, userContainer), ); if (request.data.getUserContainer) { yield put(currentUserContainerLoaded(request)); return; } yield createCurrentUserContainer(userContainer); } catch (error) { yield createCurrentUserContainer(userContainer); yield put(currentUserContainerError(error)); } } export function* createCurrentUserContainer(userContainer) { try { const creating = yield API.graphql( graphqlOperation(createUserContainer, { input: userContainer, }), ); yield put(currentUserContainerLoaded(creating)); } catch (error) { yield put(currentUserContainerError(error)); } } export function* updateCurrentUserContainer(userContainer) { try { const updating = yield API.graphql( graphqlOperation(updateUserContainer, { input: userContainer, }), ); yield put(updateCurrentUserContainerSuccess(updating)); } catch (error) { yield put(updateCurrentUserContainerError(error)); } } export function* logout() { try { yield Auth.signOut({ global: true }); yield put(logoutSuccess()); } catch (error) { // Network has error occurred yield put(logoutError(error)); } } export default function* appSaga() { yield all([ takeLatest(LOAD_CURRENT_USER, loadCurrentUser), takeLatest(UPDATE_CURRENT_USER_CONTAINER, updateCurrentUserContainer), takeLatest(LOGOUT, logout), ]); }
package org.amplecode.staxwax.factory; /* * Copyright (c) 2008, the original author or authors. * 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 * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the AmpleCode project nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ import java.io.InputStream; import java.io.OutputStream; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.amplecode.staxwax.reader.DefaultXMLEventReader; import org.amplecode.staxwax.reader.DefaultXMLStreamReader; import org.amplecode.staxwax.reader.XMLReader; import org.amplecode.staxwax.writer.DefaultIndentingXMLStreamWriter; import org.amplecode.staxwax.writer.DefaultLineBreakingXMLStreamWriter; import org.amplecode.staxwax.writer.DefaultXMLStreamWriter; import org.amplecode.staxwax.writer.XMLWriter; import org.codehaus.stax2.XMLEventReader2; import org.codehaus.stax2.XMLInputFactory2; import org.codehaus.stax2.XMLStreamReader2; import com.ctc.wstx.stax.WstxOutputFactory; /** * This is a factory class which produces XMLWriter and XMLReader instances. * Woodstox is used as implementation classes for the underlying XMLOutputFactory * and XMLInputFactory interfaces. * * @author <NAME> * @version $Id: XMLFactory.java 151 2009-10-28 15:33:31Z larshelg $ */ public class XMLFactory { /** * Creates an XMLWriter from a StAX-based XMLStreamWriter. The generated XML * will be indented. * * @param outputStream the OutputStream to write to. * @return an XMLWriter. */ public static XMLWriter getXMLWriter( OutputStream outputStream ) { try { XMLOutputFactory factory = new WstxOutputFactory(); XMLStreamWriter streamWriter = factory.createXMLStreamWriter( outputStream ); XMLWriter xmlWriter = new DefaultXMLStreamWriter( streamWriter ); XMLWriter indentingWriter = new DefaultIndentingXMLStreamWriter( xmlWriter ); return indentingWriter; } catch ( XMLStreamException ex ) { throw new RuntimeException( "Failed to create XMLWriter", ex ); } } /** * Creates an XMLWriter from a StAX-based XMLStreamWriter. The generated XML * will have a line break after each natural line end and not be indented. * * @param outputStream the OutputStream to write to. * @return an XMLWriter. */ public static XMLWriter getPlainXMLWriter( OutputStream outputStream ) { try { XMLOutputFactory factory = new WstxOutputFactory(); XMLStreamWriter streamWriter = factory.createXMLStreamWriter( outputStream ); XMLWriter xmlWriter = new DefaultXMLStreamWriter( streamWriter ); XMLWriter lineBreakingWriter = new DefaultLineBreakingXMLStreamWriter( xmlWriter ); return lineBreakingWriter; } catch ( XMLStreamException ex ) { throw new RuntimeException( "Failed to create XMLWriter", ex ); } } /** * Creates an XMLReader from a StAX-based XMLStreamReader2. * * @param inputStream the InputStream to read from. * @return an XMLReader. */ public static XMLReader getXMLReader( InputStream inputStream ) { try { XMLInputFactory2 factory = (XMLInputFactory2)XMLInputFactory.newInstance(); XMLStreamReader2 streamReader = (XMLStreamReader2)factory.createXMLStreamReader( inputStream ); XMLReader xmlReader = new DefaultXMLStreamReader( streamReader ); return xmlReader; } catch ( XMLStreamException ex ) { throw new RuntimeException( "Failed to create XMLStreamReader", ex ); } } /** * Creates an XMLReader from a StAX-based XMLStreamReader2. * * @param inputStreamReader the XMLStreamReader to read from. * @return an XMLReader. */ public static XMLReader getXMLReader( XMLStreamReader2 inputStreamReader ) { XMLReader xmlReader = new DefaultXMLStreamReader( inputStreamReader ); return xmlReader; } /** * Creates an XMLReader from a StAX-based XMLEventReader. * * @param inputStream the InputStream to read from. * @return an XMLReader. */ public static XMLReader getXMLEventReader( InputStream inputStream ) { try { XMLInputFactory2 factory = (XMLInputFactory2) XMLInputFactory.newInstance(); XMLStreamReader2 streamReader = (XMLStreamReader2) factory.createXMLStreamReader( inputStream ); XMLEventReader2 eventReader = (XMLEventReader2) factory.createXMLEventReader(streamReader); return new DefaultXMLEventReader( eventReader ); } catch ( XMLStreamException ex ) { throw new RuntimeException( "Failed to create XMLStreamReader", ex ); } } }
package ff.camaro; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.gradle.api.Project; public class Configurator extends Store { protected Map<String, Object> config; protected Project project; public ArtifactInfo getArtifactInfo() { final Map<String, ?> properties = project.getProperties(); return new ArtifactInfo((String) properties.get("project_name"), (String) properties.get("project_group"), (String) properties.get("project_version")); } public HashMap<String, String> getManifestAttributes(final String suffix) { final ArtifactInfo info = getArtifactInfo(); final HashMap<String, String> jarAttributes = new HashMap<>(); jarAttributes.put("Implementation-Title", info.getGroup() + "@" + info.getName() + suffix); jarAttributes.put("Implementation-Version", info.getVersion()); jarAttributes.put("Generated", new SimpleDateFormat("yyyy/MMM/dd HH:mm:ss").format(new Date())); return jarAttributes; } @Override public Object getValue(final String key) { return config.get(key); } public void init(final Project project, final Map<String, Object> config) { this.config = config; this.project = project; } public boolean test(final Object object) { if (object == null) { return false; } return "true".equals(String.valueOf(object)); } @Override public String toString() { return ConfigLoader.plugin.toYaml(config); } }
<gh_stars>0 /* * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The OpenAirInterface Software Alliance licenses this file to You 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 the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *------------------------------------------------------------------------------- * For more information about the OpenAirInterface (OAI) Software Alliance: * <EMAIL> */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include "ProtocolDiscriminator.h" #include "EpsBearerIdentity.h" #include "ProcedureTransactionIdentity.h" #include "MessageType.h" #include "NasRequestType.h" #include "PdnType.h" #include "EsmInformationTransferFlag.h" #include "AccessPointName.h" #include "ProtocolConfigurationOptions.h" #ifndef PDN_CONNECTIVITY_REQUEST_H_ #define PDN_CONNECTIVITY_REQUEST_H_ /* Minimum length macro. Formed by minimum length of each mandatory field */ #define PDN_CONNECTIVITY_REQUEST_MINIMUM_LENGTH ( \ PDN_TYPE_MINIMUM_LENGTH ) /* Maximum length macro. Formed by maximum length of each field */ #define PDN_CONNECTIVITY_REQUEST_MAXIMUM_LENGTH ( \ PDN_TYPE_MAXIMUM_LENGTH + \ ESM_INFORMATION_TRANSFER_FLAG_MAXIMUM_LENGTH + \ ACCESS_POINT_NAME_MAXIMUM_LENGTH + \ PROTOCOL_CONFIGURATION_OPTIONS_MAXIMUM_LENGTH ) /* If an optional value is present and should be encoded, the corresponding * Bit mask should be set to 1. */ # define PDN_CONNECTIVITY_REQUEST_ESM_INFORMATION_TRANSFER_FLAG_PRESENT (1<<0) # define PDN_CONNECTIVITY_REQUEST_ACCESS_POINT_NAME_PRESENT (1<<1) # define PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT (1<<2) typedef enum pdn_connectivity_request_iei_tag { PDN_CONNECTIVITY_REQUEST_ESM_INFORMATION_TRANSFER_FLAG_IEI = 0xD0, /* 0xD0 = 208 */ PDN_CONNECTIVITY_REQUEST_ACCESS_POINT_NAME_IEI = 0x28, /* 0x28 = 40 */ PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_IEI = 0x27, /* 0x27 = 39 */ } pdn_connectivity_request_iei; /* * Message name: PDN connectivity request * Description: This message is sent by the UE to the network to initiate establishment of a PDN connection. See table 8.3.20.1. * Significance: dual * Direction: UE to network */ typedef struct pdn_connectivity_request_msg_tag { /* Mandatory fields */ ProtocolDiscriminator protocoldiscriminator:4; EpsBearerIdentity epsbeareridentity:4; ProcedureTransactionIdentity proceduretransactionidentity; MessageType messagetype; RequestType requesttype; PdnType pdntype; /* Optional fields */ uint32_t presencemask; EsmInformationTransferFlag esminformationtransferflag; AccessPointName accesspointname; ProtocolConfigurationOptions protocolconfigurationoptions; } pdn_connectivity_request_msg; int decode_pdn_connectivity_request(pdn_connectivity_request_msg *pdnconnectivityrequest, uint8_t *buffer, uint32_t len); int encode_pdn_connectivity_request(pdn_connectivity_request_msg *pdnconnectivityrequest, uint8_t *buffer, uint32_t len); #endif /* ! defined(PDN_CONNECTIVITY_REQUEST_H_) */
package com.linkedin.datahub.graphql.types.dataplatform.mappers; import com.linkedin.common.urn.Urn; import com.linkedin.datahub.graphql.generated.DataPlatform; import com.linkedin.datahub.graphql.generated.EntityType; import com.linkedin.datahub.graphql.types.common.mappers.util.MappingHelper; import com.linkedin.datahub.graphql.types.mappers.ModelMapper; import com.linkedin.dataplatform.DataPlatformInfo; import com.linkedin.entity.EntityResponse; import com.linkedin.entity.EnvelopedAspectMap; import com.linkedin.metadata.key.DataPlatformKey; import com.linkedin.metadata.utils.EntityKeyUtils; import javax.annotation.Nonnull; import static com.linkedin.metadata.Constants.*; public class DataPlatformMapper implements ModelMapper<EntityResponse, DataPlatform> { public static final DataPlatformMapper INSTANCE = new DataPlatformMapper(); public static DataPlatform map(@Nonnull final EntityResponse platform) { return INSTANCE.apply(platform); } @Override public DataPlatform apply(@Nonnull final EntityResponse entityResponse) { final DataPlatform result = new DataPlatform(); final DataPlatformKey dataPlatformKey = (DataPlatformKey) EntityKeyUtils.convertUrnToEntityKey(entityResponse.getUrn(), new DataPlatformKey().schema()); result.setType(EntityType.DATA_PLATFORM); Urn urn = entityResponse.getUrn(); result.setUrn(urn.toString()); result.setName(dataPlatformKey.getPlatformName()); EnvelopedAspectMap aspectMap = entityResponse.getAspects(); MappingHelper<DataPlatform> mappingHelper = new MappingHelper<>(aspectMap, result); mappingHelper.mapToResult(DATA_PLATFORM_KEY_ASPECT_NAME, (dataPlatform, dataMap) -> dataPlatform.setName(new DataPlatformKey(dataMap).getPlatformName())); mappingHelper.mapToResult(DATA_PLATFORM_INFO_ASPECT_NAME, (dataPlatform, dataMap) -> dataPlatform.setProperties(DataPlatformPropertiesMapper.map(new DataPlatformInfo(dataMap)))); return mappingHelper.getResult(); } }
import tensorflow as tf def concat(dest, src, stride=1, activation=True, name=None, config=config.Config()): def conv(input_tensor, kernel_size, stride, bias, name, config): # Implementation of the convolution operation pass # Replace with actual convolution operation def norm(input_tensor, name, config): # Implementation of the normalization operation pass # Replace with actual normalization operation def act(input_tensor, config): # Implementation of the activation operation pass # Replace with actual activation operation def join(name1, name2): # Implementation of joining two names pass # Replace with actual name joining logic if stride > 1: src = conv(src, kernel_size=1, stride=stride, bias=False, name=join(name, "conv"), config=config) src = norm(src, name=join(name, "norm"), config=config) if activation: src = act(src, config=config) return tf.concat([dest, src], axis=-1)
<reponame>TikhomirovSergei/simpleAppWithHooks export const getWeatherImage = (icon: string) => { switch (icon) { case "01d": return require(`../assets/01d.png`); case "01n": return require(`../assets/01n.png`); case "02d": return require(`../assets/02d.png`); case "02n": return require(`../assets/02n.png`); case "03d": return require(`../assets/03d.png`); case "03n": return require(`../assets/03n.png`); case "04d": return require(`../assets/04d.png`); case "04n": return require(`../assets/04n.png`); case "09d": return require(`../assets/09d.png`); case "09n": return require(`../assets/09n.png`); case "10d": return require(`../assets/10d.png`); case "10n": return require(`../assets/10n.png`); case "11d": return require(`../assets/11d.png`); case "11n": return require(`../assets/11n.png`); case "13d": return require(`../assets/13d.png`); case "13n": return require(`../assets/13n.png`); case "50d": return require(`../assets/50d.png`); case "50n": return require(`../assets/50n.png`); default: return require(`../assets/01d.png`); } };
export const data = [ { title: 'Principal Developer', guid: 'oakvkx94htkgyhboaamzh', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€206,000', totalCompensationNumber: 206000, totalCompensationDetails: '€132K salary, €34K bonus, €40K equity/year', baseSalary: '€10,961/month', baseSalaryNumber: 131532, oldYearForData: '2020', otherContext: '' }, { title: 'Graduate Software Engineer', guid: 'nskww8lizlfzmg7lip3lg', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Optiver', totalCompensation: '€125,000', totalCompensationNumber: 125000, totalCompensationDetails: '€75K salary, €0K bonus, €50K sign-on, €5K benefits, €8K relocation', baseSalary: '€6,250/month', baseSalaryNumber: 75000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Manager', guid: 'efkwj5nw7fi8t1dhixlbg', specialization: '', city: 'Flexible days', companyName: 'Booking.com', totalCompensation: '€155,000', totalCompensationNumber: 155000, totalCompensationDetails: '€120K salary, €24K bonus, €11K equity/year', baseSalary: '€10,000/month', baseSalaryNumber: 120000, oldYearForData: '', otherContext: '' }, { title: 'Senior Machine Learning Engineer', guid: 'ozkwnry796j3pqtxvf3zr', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€156,000', totalCompensationNumber: 156000, totalCompensationDetails: '€119K salary, €24K bonus, €13K equity/year, €2K benefits', baseSalary: '€9,875/month', baseSalaryNumber: 118500, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: '8hkwkg3hibnc51q4psxs', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€143,000', totalCompensationNumber: 143000, totalCompensationDetails: '€110K salary, €22K bonus, €11K equity/year', baseSalary: '€9,167/month', baseSalaryNumber: 110000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: '6okvtkkg3llv69xq8w9dp', specialization: '', city: 'Amsterdam', companyName: 'Uber', totalCompensation: '€151,000', totalCompensationNumber: 151000, totalCompensationDetails: '€97K salary, €14K bonus, €41K equity/year', baseSalary: '€8,113/month', baseSalaryNumber: 97350, oldYearForData: '', otherContext: '' }, { title: 'Senior Data Scientist ', guid: 'ltksoiuzlzpsvwkeec4mt', specialization: '', city: '', companyName: 'Booking.com ', totalCompensation: '€136,000', totalCompensationNumber: 136000, totalCompensationDetails: '€104K salary, €21K bonus, €11K equity/year', baseSalary: '€8,667/month', baseSalaryNumber: 104000, oldYearForData: '', otherContext: '' }, { title: 'Senior Solutions Architect', guid: 'x5kutkg756de5jm9a4tsd', specialization: '', city: 'Remote from anywhere', companyName: '🔒 Data company pre-ipo', totalCompensation: '€217,000', totalCompensationNumber: 217000, totalCompensationDetails: '€152K salary, €25K bonus, €40K equity/year, €5K benefits', baseSalary: '€12,667/month', baseSalaryNumber: 152000, oldYearForData: '', otherContext: 'Freelance' }, { title: 'Staff Software Engineer', guid: '0lkwx78bygwx2ifsixdvf', specialization: '', city: 'Remote within country', companyName: '🔒 FinTech company', totalCompensation: '€434,000', totalCompensationNumber: 434000, totalCompensationDetails: '€153K salary, €31K bonus, €50K sign-on, €200K equity/year', baseSalary: '€12,750/month', baseSalaryNumber: 153000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Lead', guid: 'y7kwx7oaleigs8aj06y2i', specialization: '', city: 'Amsterdam', companyName: '🔒 Travel industry', totalCompensation: '€455,000', totalCompensationNumber: 455000, totalCompensationDetails: '€130K salary, €325K equity/year, €6K benefits', baseSalary: '€10,833/month', baseSalaryNumber: 130000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer Intern ', guid: 'g3kwyx9zfg9wx1haq88ra', specialization: '', city: 'Amsterdam Zuid', companyName: 'Optiver ', totalCompensation: '€120,000', totalCompensationNumber: 120000, totalCompensationDetails: '', baseSalary: '€10,000/month', baseSalaryNumber: 120000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer Intern', guid: 'p5kwgfplmq2wnjrfm5o0m', specialization: '', city: 'Amsterdam', companyName: 'Optiver ', totalCompensation: '€130,000', totalCompensationNumber: 130000, totalCompensationDetails: '', baseSalary: '€10,800/month', baseSalaryNumber: 129600, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: '60kvkuo9syftry7je3yjh', specialization: '', city: 'Amsterdam (hybrid option)', companyName: 'Elastic', totalCompensation: '€139,000', totalCompensationNumber: 139000, totalCompensationDetails: '€108K salary, €8K sign-on, €23K equity/year, €15K benefits', baseSalary: '€9,000/month', baseSalaryNumber: 108000, oldYearForData: '', otherContext: '' }, { title: 'Graduate Software Engineer', guid: 'klkw6mxytweziba873mbm', specialization: '', city: 'Amsterdam', companyName: '<NAME>', totalCompensation: '€165,000', totalCompensationNumber: 165000, totalCompensationDetails: '€100K salary, €35K bonus, €30K sign-on, €3K relocation', baseSalary: '€8,333/month', baseSalaryNumber: 100000, oldYearForData: '', otherContext: '' }, { title: 'Senior Data Engineer', guid: 'fqkwxy2aeyi5880qs2qc', specialization: '', city: 'Amsterdam (hybrid option)', companyName: 'Spotify', totalCompensation: '€137,000', totalCompensationNumber: 137000, totalCompensationDetails: '€107K salary, €30K equity/year', baseSalary: '€8,917/month', baseSalaryNumber: 107000, oldYearForData: '', otherContext: '' }, { title: '🔒 Senior-level position within software engineering', guid: 'fkkt8ccunr24zei6hlcs8', specialization: '', city: 'Amsterdam (remote within country)', companyName: 'Microsoft ', totalCompensation: '€154,000', totalCompensationNumber: 154000, totalCompensationDetails: '€119K salary, €30K bonus, €5K equity/year, €30K benefits', baseSalary: '€9,950/month', baseSalaryNumber: 119394, oldYearForData: '', otherContext: '' }, { title: 'Solution Architect', guid: 'kwkwwa4i2zhqo23784tr', specialization: '', city: 'Flexible days', companyName: 'Stripe', totalCompensation: '€200,000', totalCompensationNumber: 200000, totalCompensationDetails: '€114K salary, €29K bonus, €0K sign-on, €58K equity/year, €10K benefits', baseSalary: '€9,531/month', baseSalaryNumber: 114372, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'zckwatp59wpcvxjowlen', specialization: '', city: 'Amsterdam (hybrid option)', companyName: 'Amazon', totalCompensation: '€165,000', totalCompensationNumber: 165000, totalCompensationDetails: '€117K salary, €48K equity/year', baseSalary: '€9,720/month', baseSalaryNumber: 116640, oldYearForData: '', otherContext: '' }, { title: 'Principal Software Engineer I', guid: '4xkw21uqw0wfh0fyevov', specialization: '', city: 'Amsterdam (hybrid option)', companyName: 'Elastic', totalCompensation: '€159,000', totalCompensationNumber: 159000, totalCompensationDetails: '€125K salary, $20K sign-on, €17K equity/year', baseSalary: '€10,417/month', baseSalaryNumber: 125000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'l5kvku4r7hv2zbz4ct9rm', specialization: '', city: 'Amsterdam', companyName: 'Optiver', totalCompensation: '€240,000', totalCompensationNumber: 240000, totalCompensationDetails: '€75K salary, €165K bonus', baseSalary: '€6,250/month', baseSalaryNumber: 75000, oldYearForData: '2020', otherContext: '' }, { title: 'Software Engineer', guid: 'mpkvku1fwhp22tvov3hg', specialization: '', city: 'Amsterdam', companyName: 'Optiver', totalCompensation: '€180,000', totalCompensationNumber: 180000, totalCompensationDetails: '€75K salary, €105K bonus', baseSalary: '€6,250/month', baseSalaryNumber: 75000, oldYearForData: '', otherContext: '' }, { title: 'New Grad Software Engineer', guid: 'qukvktzaw0sfey8aictt', specialization: '', city: 'Amsterdam', companyName: 'Optiver', totalCompensation: '€100,000', totalCompensationNumber: 100000, totalCompensationDetails: '€60K salary, €40K bonus', baseSalary: '€5,000/month', baseSalaryNumber: 60000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'cvksujld8jf68usaqshz', specialization: '', city: '', companyName: 'GitLab', totalCompensation: '€181,000', totalCompensationNumber: 181000, totalCompensationDetails: '€95K salary, €2K bonus, €84K equity/year', baseSalary: '€7,917/month', baseSalaryNumber: 95000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'kshlu9coqcpyw6ullq', specialization: '', city: 'Remote (remote from anywhere)', companyName: 'GitLab', totalCompensation: '€110,000', totalCompensationNumber: 110000, totalCompensationDetails: '€80K salary, €30K equity/year', baseSalary: '€6,667/month', baseSalaryNumber: 80000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Developer', guid: 'xuktw0w156mvuzufh53s8', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€132,000', totalCompensationNumber: 132000, totalCompensationDetails: '€101K salary, €20K bonus, €11K equity/year', baseSalary: '€8,417/month', baseSalaryNumber: 101000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'yikuwuolxjfh5zsfgn17s', specialization: '', city: 'Flexible days', companyName: '🔒 Proprietary trading firm', totalCompensation: '€125,000', totalCompensationNumber: 125000, totalCompensationDetails: '€75K salary, €0K bonus, €50K sign-on, €5K benefits, €8K relocation', baseSalary: '€6,250/month', baseSalaryNumber: 75000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'emkunw70f6v9w4ylqfsd8', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Optiver', totalCompensation: '€196,000', totalCompensationNumber: 196000, totalCompensationDetails: '€81K salary, €65K bonus, €50K sign-on, €5K benefits, €8K relocation', baseSalary: '€6,750/month', baseSalaryNumber: 81000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Manager ', guid: '2gkvdjuze1rssmb3ydzcp', specialization: '', city: 'Hybrid option', companyName: 'Booking.com ', totalCompensation: '€150,000', totalCompensationNumber: 150000, totalCompensationDetails: '€110K salary, €22K bonus, €5K sign-on, €13K equity/year, €1K benefits, €5K relocation', baseSalary: '€9,167/month', baseSalaryNumber: 110000, oldYearForData: '', otherContext: '' }, { title: 'Solutions Architect', guid: '71kvfh13x8yplhvjol8r', specialization: '', city: 'Amsterdam (hybrid option)', companyName: 'Amazon', totalCompensation: '€150,000', totalCompensationNumber: 150000, totalCompensationDetails: '€97K salary, €40K sign-on, €13K equity/year', baseSalary: '€8,100/month', baseSalaryNumber: 97200, oldYearForData: '', otherContext: '' }, { title: 'Senior Engineering Manager', guid: 'fdktebn3s6fz115cmwr4', specialization: '', city: '', companyName: 'Booking.com', totalCompensation: '€159,000', totalCompensationNumber: 159000, totalCompensationDetails: '€114K salary, €29K bonus, €17K equity/year', baseSalary: '€9,500/month', baseSalaryNumber: 114000, oldYearForData: '', otherContext: '' }, { title: 'Machine Learning Scientist', guid: 'kshcsp0y0umkfcmst9y9', specialization: '', city: 'Amsterdam (hybrid option)', companyName: 'Booking.com', totalCompensation: '€125,000', totalCompensationNumber: 125000, totalCompensationDetails: '€95K salary, €10K bonus, €20K equity/year, €1K benefits, €8K relocation', baseSalary: '€7,917/month', baseSalaryNumber: 95000, oldYearForData: '', otherContext: '' }, { title: 'Senior Product Manager', guid: 'n6ksqkjcj0kipktb9oxaq', specialization: '', city: 'Amsterdam (hybrid option)', companyName: 'Booking.com', totalCompensation: '€130,000', totalCompensationNumber: 130000, totalCompensationDetails: '€100K salary, €17K bonus, €13K equity/year', baseSalary: '€8,333/month', baseSalaryNumber: 100000, oldYearForData: '', otherContext: '' }, { title: 'Staff Engineer', guid: 'svkv0okrqlzr8h48kl2gq', specialization: 'Full Stack', city: 'Amsterdam (remote from anywhere)', companyName: 'GitLab', totalCompensation: '€210,000', totalCompensationNumber: 210000, totalCompensationDetails: '€135K salary, €75K equity/year', baseSalary: '€11,250/month', baseSalaryNumber: 135000, oldYearForData: '', otherContext: '' }, { title: 'Principal Engineer', guid: 'zqkureve0xbryayq9nbjt', specialization: '', city: '', companyName: 'Booking.com', totalCompensation: '€254,000', totalCompensationNumber: 254000, totalCompensationDetails: '€155K salary, €39K bonus, €60K equity/year, €3K benefits', baseSalary: '€12,917/month', baseSalaryNumber: 155000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Developer', guid: 'xxktekp5dafh0pdcv1ka', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€142,000', totalCompensationNumber: 142000, totalCompensationDetails: '€107K salary, €21K bonus, €2K sign-on, €11K equity/year, €5K relocation', baseSalary: '€8,917/month', baseSalaryNumber: 107000, oldYearForData: '', otherContext: '' }, { title: 'Lead Software Developer', guid: 'ouksr8josgqp04w45rpn', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€141,000', totalCompensationNumber: 141000, totalCompensationDetails: '€108K salary, €22K bonus, €11K equity/year', baseSalary: '€9,000/month', baseSalaryNumber: 108000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer in Test', guid: 'igksneqn8bfrpe9gz54j6', specialization: '', city: 'Amsterdam', companyName: 'ServiceNow', totalCompensation: '€145,000', totalCompensationNumber: 145000, totalCompensationDetails: '€70K salary, €5K bonus, €70K equity/year', baseSalary: '€5,833/month', baseSalaryNumber: 70000, oldYearForData: '', otherContext: '' }, { title: 'Product Development Manager', guid: 'xyksukcnzz4aanhut5ryq', specialization: '', city: 'Amsterdam', companyName: '🔒 US Company', totalCompensation: '€173,000', totalCompensationNumber: 173000, totalCompensationDetails: '', baseSalary: '€14,400/month', baseSalaryNumber: 172800, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'slkt480w1tx050webuf6c', specialization: '', city: 'Amsterdam (hybrid option)', companyName: 'Netflix', totalCompensation: '€147,000', totalCompensationNumber: 147000, totalCompensationDetails: '€140K salary, €7K equity/year, €10K benefits', baseSalary: '€11,700/month', baseSalaryNumber: 140400, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'mhksq9x5zwqnrilh3h89', specialization: '', city: 'Amsterdam (remote within country)', companyName: '🔒 US Company, Entertainment Industry', totalCompensation: '€151,000', totalCompensationNumber: 151000, totalCompensationDetails: '', baseSalary: '€12,600/month', baseSalaryNumber: 151200, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksaaj0jsxqn52jihra', specialization: '', city: 'Amsterdam (remote within country)', companyName: '🔒 FinTech Startup', totalCompensation: '€159,000', totalCompensationNumber: 159000, totalCompensationDetails: '€119K salary, €40K equity/year, €5K benefits', baseSalary: '€9,917/month', baseSalaryNumber: 119000, oldYearForData: '', otherContext: '' }, { title: '🔒 Mid-level position within software engineering', guid: 'kslkgquwy3o52qjt6xq', specialization: '', city: 'Amsterdam', companyName: 'Databricks', totalCompensation: '€161,000', totalCompensationNumber: 161000, totalCompensationDetails: '€92K salary, €9K bonus, €60K equity/year', baseSalary: '€7,650/month', baseSalaryNumber: 91800, oldYearForData: '', otherContext: '' }, { title: 'Principal Engineer', guid: '8iksuid2np5axbrvhdeov', specialization: '', city: 'Remote from anywhere', companyName: '🔒 Healthcare Company', totalCompensation: '€166,000', totalCompensationNumber: 166000, totalCompensationDetails: '€138K salary, €28K bonus, €13K benefits', baseSalary: '€11,500/month', baseSalaryNumber: 138000, oldYearForData: '', otherContext: '' }, { title: 'Principal Solutions Engineer', guid: 'mmku8dq4prqtjsdcyrqkl', specialization: '', city: 'Amsterdam (remote from anywhere)', companyName: '🔒 FinTech industry', totalCompensation: '€221,000', totalCompensationNumber: 221000, totalCompensationDetails: '€162K salary, €49K bonus, €10K sign-on, €9K benefits', baseSalary: '€13,500/month', baseSalaryNumber: 162000, oldYearForData: '', otherContext: '' }, { title: 'Design Manager', guid: '3jktckyzw5896ghfchpoy', specialization: '', city: 'Amsterdam', companyName: '🔒 Travel sector company', totalCompensation: '€174,000', totalCompensationNumber: 174000, totalCompensationDetails: '€112K salary, €22K bonus, €40K equity/year', baseSalary: '€9,333/month', baseSalaryNumber: 112000, oldYearForData: '', otherContext: '' }, { title: 'Principal Engineer', guid: 'mlksuhyouxmpk1nkwzpt', specialization: '', city: 'Remote from anywhere', companyName: '🔒 Enterprise Software Company', totalCompensation: '€222,000', totalCompensationNumber: 222000, totalCompensationDetails: '€145K salary, €29K bonus, €48K equity/year, €18K benefits', baseSalary: '€12,083/month', baseSalaryNumber: 145000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Manager', guid: 'ksbgvty6bu1lp0ccsd4', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€176,000', totalCompensationNumber: 176000, totalCompensationDetails: '€110K salary, €28K bonus, €25K sign-on, €13K equity/year, €5K benefits, €10K relocation', baseSalary: '€9,167/month', baseSalaryNumber: 110000, oldYearForData: '', otherContext: '' }, { title: 'Senior Engineering Manager', guid: 'nnktwxj7g4smace3nz24f', specialization: '', city: '', companyName: '🔒 Travel sector company', totalCompensation: '€202,000', totalCompensationNumber: 202000, totalCompensationDetails: '€121K salary, €30K bonus, €51K equity/year', baseSalary: '€10,083/month', baseSalaryNumber: 121000, oldYearForData: '', otherContext: '' }, { title: 'Group Product Manager', guid: 'ksg92vvoemfp08oaujk', specialization: '', city: 'Amsterdam', companyName: '🔒 Travel sector company', totalCompensation: '€279,000', totalCompensationNumber: 279000, totalCompensationDetails: '€150K salary, €38K bonus, €75K sign-on, €17K equity/year', baseSalary: '€12,500/month', baseSalaryNumber: 150000, oldYearForData: '', otherContext: '' }, { title: 'Principal Product Manager', guid: 'e1ktdzbeohfj056yxzspv', specialization: '', city: 'Hybrid option', companyName: 'Microsoft', totalCompensation: '€190,000', totalCompensationNumber: 190000, totalCompensationDetails: '€135K salary, €30K bonus, €25K equity/year, €10K benefits', baseSalary: '€11,250/month', baseSalaryNumber: 135000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksh6i1po6fq4km1p3vo', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Miro', totalCompensation: '€135,000', totalCompensationNumber: 135000, totalCompensationDetails: '€95K salary, €40K equity/year, €20K benefits', baseSalary: '€7,917/month', baseSalaryNumber: 95000, oldYearForData: '', otherContext: '' }, { title: 'Senior Developer ', guid: 'ksitdz95ixwx8j9962m', specialization: '', city: '', companyName: 'Booking.com', totalCompensation: '€142,000', totalCompensationNumber: 142000, totalCompensationDetails: '€101K salary, €20K bonus, €10K sign-on, €11K equity/year, €2K benefits', baseSalary: '€8,417/month', baseSalaryNumber: 101000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksix2vtcmwkmgpebu9l', specialization: 'Android', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€145,000', totalCompensationNumber: 145000, totalCompensationDetails: '€102K salary, €20K bonus, €12K sign-on, €11K equity/year, €1K benefits, €10K relocation', baseSalary: '€8,458/month', baseSalaryNumber: 101500, oldYearForData: '', otherContext: '' }, { title: 'Data Science Manager', guid: '8dktog1klowgdbwrj6me', specialization: '', city: 'Amsterdam (flexible days)', companyName: '<NAME>', totalCompensation: '€151,000', totalCompensationNumber: 151000, totalCompensationDetails: '€120K salary, €16K bonus, €15K equity/year', baseSalary: '€10,000/month', baseSalaryNumber: 120000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: '4zkt7javko3d3m4w40lae', specialization: '', city: 'Amsterdam', companyName: 'GitLab', totalCompensation: '€161,000', totalCompensationNumber: 161000, totalCompensationDetails: '€96K salary, €2K bonus, €63K equity/year', baseSalary: '€8,000/month', baseSalaryNumber: 96000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: '3lksr3cm25ecyt186xfj4', specialization: '', city: 'Amsterdam', companyName: '🔒 Cloud data platform', totalCompensation: '€158,000', totalCompensationNumber: 158000, totalCompensationDetails: '€85K salary, €10K bonus, €63K equity/year, $7K relocation', baseSalary: '€7,083/month', baseSalaryNumber: 85000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: '1vksunlds5jpj2r0h51c8', specialization: '', city: '', companyName: 'Uber', totalCompensation: '€167,000', totalCompensationNumber: 167000, totalCompensationDetails: '€110K salary, €17K bonus, €40K equity/year', baseSalary: '€9,167/month', baseSalaryNumber: 110000, oldYearForData: '2018', otherContext: '' }, { title: '🔒 Senior-level position within product management', guid: 'qhksqlm0rjp4k1czci8zf', specialization: '', city: 'Amsterdam', companyName: 'Uber ', totalCompensation: '€200,000', totalCompensationNumber: 200000, totalCompensationDetails: '€115K salary, €23K bonus, €15K sign-on, €47K equity/year, €6K benefits, $13K relocation', baseSalary: '€9,583/month', baseSalaryNumber: 115000, oldYearForData: '2019', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksham0xo2obdffvd8no', specialization: 'Fullstack', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€165,000', totalCompensationNumber: 165000, totalCompensationDetails: '€111K salary, €37K bonus, €17K equity/year', baseSalary: '€9,250/month', baseSalaryNumber: 111000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Manager I', guid: 'ksbiwlyn8zdcmadmgti', specialization: '', city: 'Amsterdam', companyName: '🔒 Ride sharing company', totalCompensation: '€170,000', totalCompensationNumber: 170000, totalCompensationDetails: '€105K salary, €23K bonus, €43K equity/year, €10K relocation', baseSalary: '€8,750/month', baseSalaryNumber: 105000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'pfksr9yflk570wolsvo23', specialization: '', city: 'Amsterdam', companyName: 'Uber', totalCompensation: '€171,000', totalCompensationNumber: 171000, totalCompensationDetails: '€102K salary, €23K bonus, €46K equity/year', baseSalary: '€8,500/month', baseSalaryNumber: 102000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: '13ktbvh9a926yppfn6dtp', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Uber', totalCompensation: '€192,000', totalCompensationNumber: 192000, totalCompensationDetails: '€110K salary, €25K bonus, €15K sign-on, €42K equity/year', baseSalary: '€9,167/month', baseSalaryNumber: 110000, oldYearForData: '', otherContext: '' }, { title: '🔒 Mid-level position within data science', guid: 'lwktvztwpibchso53fui', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€115,000', totalCompensationNumber: 115000, totalCompensationDetails: '€94K salary, €14K bonus, €7K equity/year', baseSalary: '€7,833/month', baseSalaryNumber: 94000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'v8ktzxhbaqnkcar5tzzgj', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€160,000', totalCompensationNumber: 160000, totalCompensationDetails: '€100K salary, €20K bonus, €40K equity/year', baseSalary: '€8,325/month', baseSalaryNumber: 99900, oldYearForData: '', otherContext: '' }, { title: '🔒 Senior-level position within design', guid: 'ozkty58oh2d46a3djmx0u', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€132,000', totalCompensationNumber: 132000, totalCompensationDetails: '€99K salary, €20K bonus, €13K equity/year', baseSalary: '€8,250/month', baseSalaryNumber: 99000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Manager', guid: '1wku34rc5jcwpxfzf89xj', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Booking.com', totalCompensation: '€142,000', totalCompensationNumber: 142000, totalCompensationDetails: '€109K salary, €22K bonus, €11K equity/year, €5K relocation', baseSalary: '€9,083/month', baseSalaryNumber: 109000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Manager', guid: 'ksa6arz1hb3j7zja1zr', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€143,000', totalCompensationNumber: 143000, totalCompensationDetails: '€110K salary, €22K bonus, €11K equity/year', baseSalary: '€9,167/month', baseSalaryNumber: 110000, oldYearForData: '', otherContext: '' }, { title: 'SDE II', guid: '5ykuci1xmjyi3r3lgieij', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Amazon', totalCompensation: '€124,000', totalCompensationNumber: 124000, totalCompensationDetails: '€97K salary, €22K sign-on, €5K equity/year', baseSalary: '€8,100/month', baseSalaryNumber: 97200, oldYearForData: '', otherContext: '' }, { title: 'Graduate Software Engineer', guid: '0lkuhgj8hc6tma8axo9vw', specialization: '', city: 'Amsterdam', companyName: 'IMC Trading', totalCompensation: '€110,000', totalCompensationNumber: 110000, totalCompensationDetails: '€70K salary, €25K bonus, €15K sign-on, €4K relocation', baseSalary: '€5,833/month', baseSalaryNumber: 70000, oldYearForData: '2020', otherContext: '' }, { title: 'Senior Engineer', guid: '0ykt0hxn3yk0s2nbubfvk', specialization: '', city: 'Amsterdam', companyName: 'GitHub', totalCompensation: '€225,000', totalCompensationNumber: 225000, totalCompensationDetails: '€120K salary, €30K bonus, €75K equity/year', baseSalary: '€10,000/month', baseSalaryNumber: 120000, oldYearForData: '2020', otherContext: '' }, { title: 'Software Engineer', guid: 'lekt17krfzms0bn4p808', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€107,000', totalCompensationNumber: 107000, totalCompensationDetails: '€90K salary, €7K bonus, €10K equity/year, €4K benefits, €20K relocation', baseSalary: '€7,500/month', baseSalaryNumber: 90000, oldYearForData: '', otherContext: '' }, { title: '🔒 Senior-level position within software engineering', guid: 'pekt4nldkwtlzzk4jjjs', specialization: '', city: 'Amsterdam', companyName: 'Amazon', totalCompensation: '€150,000', totalCompensationNumber: 150000, totalCompensationDetails: '€104K salary, €40K sign-on, €6K equity/year', baseSalary: '€8,667/month', baseSalaryNumber: 104000, oldYearForData: '', otherContext: '' }, { title: 'Data Engineer', guid: 'qukt6srag8any9jaqsfjm', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€110,000', totalCompensationNumber: 110000, totalCompensationDetails: '€90K salary, €14K bonus, €7K equity/year, €6K relocation', baseSalary: '€7,500/month', baseSalaryNumber: 90000, oldYearForData: '', otherContext: '' }, { title: 'Principal Solutions Engineer', guid: '84ksyhssp14duoh8yo1o9', specialization: 'L7', city: 'Amsterdam', companyName: 'Amazon', totalCompensation: '€198,000', totalCompensationNumber: 198000, totalCompensationDetails: '€130K salary, €60K bonus, €8K equity/year', baseSalary: '€10,833/month', baseSalaryNumber: 130000, oldYearForData: '', otherContext: '' }, { title: 'SDE2', guid: 'kgksye3foqi7mp0sg8h1q', specialization: 'L5', city: 'Amsterdam', companyName: 'Amazon', totalCompensation: '€97,000', totalCompensationNumber: 97000, totalCompensationDetails: '€75K salary, €17K sign-on, €5K equity/year', baseSalary: '€6,250/month', baseSalaryNumber: 75000, oldYearForData: '', otherContext: '' }, { title: 'Senior Solutions Architect', guid: 'ksk8uleq6cx7bdrrrtl', specialization: '', city: 'Amsterdam (flexible days)', companyName: '🔒 US e-commerce company', totalCompensation: '€143,000', totalCompensationNumber: 143000, totalCompensationDetails: '€115K salary, €22K sign-on, €6K equity/year', baseSalary: '€9,583/month', baseSalaryNumber: 115000, oldYearForData: '2020', otherContext: '' }, { title: 'Software Development Engineer', guid: '0vksvr1ktnv3jdwiqa55n', specialization: 'L4', city: 'Amsterdam (hybrid option)', companyName: 'Amazon', totalCompensation: '€110,000', totalCompensationNumber: 110000, totalCompensationDetails: '€80K salary, €30K equity/year, €5K benefits', baseSalary: '€6,667/month', baseSalaryNumber: 80000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'gpksuu1poanxrbe8l5u9', specialization: 'L6', city: 'Amsterdam (flexible days)', companyName: 'Amazon', totalCompensation: '€225,000', totalCompensationNumber: 225000, totalCompensationDetails: '€90K salary, €135K equity/year, €3K benefits', baseSalary: '€7,500/month', baseSalaryNumber: 90000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'w7ksobvybo753y2vso6ch', specialization: '', city: '', companyName: 'Booking.com', totalCompensation: '€101,000', totalCompensationNumber: 101000, totalCompensationDetails: '€85K salary, €10K bonus, €6K equity/year', baseSalary: '€7,110/month', baseSalaryNumber: 85320, oldYearForData: '', otherContext: '' }, { title: '🔒 Intern-level position within software engineering', guid: 'csksmtrxmwhmioh8r8y4q', specialization: '', city: 'Amsterdam (flexible days)', companyName: '🔒 Trading company', totalCompensation: '€75,000', totalCompensationNumber: 75000, totalCompensationDetails: '', baseSalary: '€6,250/month', baseSalaryNumber: 75000, oldYearForData: '', otherContext: '' }, { title: '🔒 Mid-level position within product management', guid: 't3ksoe1z07nah2jfrg39n', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€105,000', totalCompensationNumber: 105000, totalCompensationDetails: '€84K salary, €13K bonus, €5K sign-on, €4K equity/year, €10K relocation', baseSalary: '€7,000/month', baseSalaryNumber: 84000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer Intern', guid: 'ksccpkfvsxtvsdjw0ug', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'IMC Trading', totalCompensation: '€75,000', totalCompensationNumber: 75000, totalCompensationDetails: '', baseSalary: '€6,250/month', baseSalaryNumber: 75000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'ksiuibn96oi79nyhpvk', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€97,500', totalCompensationNumber: 97500, totalCompensationDetails: '€80K salary, €12K bonus, €6K equity/year, €5K relocation', baseSalary: '€6,667/month', baseSalaryNumber: 80000, oldYearForData: '', otherContext: '' }, { title: 'Software Developer', guid: 'ksa62vfdc59z8ou9swh', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€101,000', totalCompensationNumber: 101000, totalCompensationDetails: '€83K salary, €13K bonus, €6K equity/year', baseSalary: '€6,917/month', baseSalaryNumber: 83000, oldYearForData: '', otherContext: '' }, { title: 'Senior Data Scientist', guid: 'ksivuxg5qk0mah1v3f9', specialization: 'Insights', city: 'Amsterdam (flexible days)', companyName: 'Booking.com', totalCompensation: '€138,000', totalCompensationNumber: 138000, totalCompensationDetails: '€106K salary, €21K bonus, €11K equity/year, €5K relocation', baseSalary: '€8,833/month', baseSalaryNumber: 106000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksg3etvbixm8e8pgur9', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Uber', totalCompensation: '€169,000', totalCompensationNumber: 169000, totalCompensationDetails: '€107K salary, €23K bonus, €13K sign-on, €26K equity/year, €5K benefits', baseSalary: '€8,946/month', baseSalaryNumber: 107350, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: '00ksorjhegev2rv6qpr8e', specialization: '', city: 'Amsterdam', companyName: 'ServiceNow', totalCompensation: '€149,000', totalCompensationNumber: 149000, totalCompensationDetails: '€90K salary, €9K bonus, €50K equity/year, €1K benefits', baseSalary: '€7,500/month', baseSalaryNumber: 90000, oldYearForData: '2019', otherContext: '' }, { title: 'Lead Developer', guid: '86ksoqmth7mttop40dle', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€159,000', totalCompensationNumber: 159000, totalCompensationDetails: '€121K salary, €24K bonus, €13K equity/year, €4K benefits', baseSalary: '€10,083/month', baseSalaryNumber: 121000, oldYearForData: '2020', otherContext: '' }, { title: '🔒 Above senior-level position within software engineering', guid: 'y0ksoqxjjlo4reqxuizb', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€181,000', totalCompensationNumber: 181000, totalCompensationDetails: '€131K salary, €33K bonus, €17K equity/year, €1K benefits', baseSalary: '€10,917/month', baseSalaryNumber: 131000, oldYearForData: '', otherContext: '' }, { title: 'Quantitative Technologist', guid: 'ksayohozw2fdmi4vh8', specialization: '', city: 'Amsterdam', companyName: '🔒 Proprietary Trading Firm ', totalCompensation: '€190,000', totalCompensationNumber: 190000, totalCompensationDetails: '€150K salary, €40K bonus', baseSalary: '€12,500/month', baseSalaryNumber: 150000, oldYearForData: '', otherContext: '' }, { title: 'Senior Developer', guid: '9vkspeprmhw1wf6ehqfba', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€172,000', totalCompensationNumber: 172000, totalCompensationDetails: '€116K salary, €23K bonus, €33K equity/year, €1K benefits, €3K relocation', baseSalary: '€9,667/month', baseSalaryNumber: 116000, oldYearForData: '', otherContext: '' }, { title: '🔒 Senior-level position within software engineering', guid: 'ksixqgam492tzyib3mg', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Databricks', totalCompensation: '€227,000', totalCompensationNumber: 227000, totalCompensationDetails: '€124K salary, €19K bonus, €84K equity/year', baseSalary: '€10,333/month', baseSalaryNumber: 124000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'kshgkiw94gx4n4jxem6', specialization: 'L4', city: 'Amsterdam', companyName: 'Databricks', totalCompensation: '€158,000', totalCompensationNumber: 158000, totalCompensationDetails: '€82K salary, €10K bonus, €5K sign-on, €60K equity/year, €3K relocation', baseSalary: '€6,858/month', baseSalaryNumber: 82296, oldYearForData: '', otherContext: '' }, { title: 'Solutions Architect', guid: 'ksj6mihnfawpcxkjnp4', specialization: 'L5', city: 'Amsterdam', companyName: 'Databricks', totalCompensation: '€181,000', totalCompensationNumber: 181000, totalCompensationDetails: '€104K salary, €18K bonus, €59K equity/year', baseSalary: '€8,667/month', baseSalaryNumber: 104000, oldYearForData: '', otherContext: '' }, { title: 'Product Designer I', guid: 'ksdjpaxellwnj5a6g3', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Uber', totalCompensation: '€76,000', totalCompensationNumber: 76000, totalCompensationDetails: '€60K salary, €6K bonus, €10K equity/year', baseSalary: '€5,000/month', baseSalaryNumber: 60000, oldYearForData: '', otherContext: '' }, { title: 'Product Manager II', guid: 'ksd2ovtbvpvntdu827', specialization: '', city: 'Amsterdam (hybrid option)', companyName: 'Uber', totalCompensation: '€112,000', totalCompensationNumber: 112000, totalCompensationDetails: '€89K salary, €16K bonus, €8K equity/year, €9K benefits', baseSalary: '€7,375/month', baseSalaryNumber: 88500, oldYearForData: '', otherContext: '' }, { title: 'Principal Solution Engineer', guid: 'ksemu0wodgp3ysm6lf', specialization: '', city: 'Hybrid option', companyName: 'Salesforce', totalCompensation: '€166,000', totalCompensationNumber: 166000, totalCompensationDetails: '€118K salary, €39K bonus, €10K equity/year, €25K benefits', baseSalary: '€9,792/month', baseSalaryNumber: 117500, oldYearForData: '', otherContext: '' }, { title: '🔒 Senior-level position within software engineering', guid: 'ksc1xxsyd0di8afxcqu', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€149,000', totalCompensationNumber: 149000, totalCompensationDetails: '€102K salary, €20K bonus, €10K sign-on, €17K equity/year', baseSalary: '€8,500/month', baseSalaryNumber: 102000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksek31mr7wzw0qs73z', specialization: '', city: 'Amsterdam (hybrid option)', companyName: 'GitHub', totalCompensation: '€141,000', totalCompensationNumber: 141000, totalCompensationDetails: '€116K salary, €17K bonus, €7K equity/year, €4K benefits', baseSalary: '€9,667/month', baseSalaryNumber: 116000, oldYearForData: '2020', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksekol5b04tkvu3ddaaa', specialization: '', city: 'Rotterdam (remote from anywhere)', companyName: 'Shopify', totalCompensation: '€134,000', totalCompensationNumber: 134000, totalCompensationDetails: '€108K salary, €26K equity/year, €5K benefits', baseSalary: '€9,000/month', baseSalaryNumber: 108000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksdpv09wv7jy93y1k9', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€131,000', totalCompensationNumber: 131000, totalCompensationDetails: '€100K salary, €20K bonus, €11K equity/year', baseSalary: '€8,333/month', baseSalaryNumber: 100000, oldYearForData: '', otherContext: '' }, { title: 'Software engineer', guid: 'ksdde6t6ab2svj50urn', specialization: 'Data Engineer', city: 'Remote within country', companyName: 'Twilio', totalCompensation: '€210,000', totalCompensationNumber: 210000, totalCompensationDetails: '€85K salary, €125K equity/year, €12K benefits', baseSalary: '€7,056/month', baseSalaryNumber: 84672, oldYearForData: '', otherContext: '' }, { title: 'Solutions Architect', guid: 'ksd7ley4ve3ew0bvvio', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Databricks', totalCompensation: '€214,000', totalCompensationNumber: 214000, totalCompensationDetails: '€120K salary, €24K bonus, €70K equity/year', baseSalary: '€10,000/month', baseSalaryNumber: 120000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineering Manager', guid: 'ksa4pjb3aw70vai1ej9', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€149,000', totalCompensationNumber: 149000, totalCompensationDetails: '€111K salary, €25K bonus, €13K equity/year', baseSalary: '€9,225/month', baseSalaryNumber: 110700, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'ksb33ufgjuoqlrhr648', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€105,000', totalCompensationNumber: 105000, totalCompensationDetails: '€86K salary, €13K bonus, €6K equity/year', baseSalary: '€7,200/month', baseSalaryNumber: 86400, oldYearForData: '', otherContext: '' }, { title: 'Software Engineering Intern', guid: 'ksb30luba5knh4obcub', specialization: '', city: 'Amsterdam', companyName: 'Uber', totalCompensation: '€57,500', totalCompensationNumber: 57500, totalCompensationDetails: '', baseSalary: '€4,800/month', baseSalaryNumber: 57600, oldYearForData: '', otherContext: '' }, { title: 'Senior Developer', guid: 'ksb6excewpdpbij0ypq', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€145,000', totalCompensationNumber: 145000, totalCompensationDetails: '€102K salary, €14K bonus, €29K equity/year', baseSalary: '€8,500/month', baseSalaryNumber: 102000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'ksb6g0yvv7wkgo0j7q', specialization: 'L3', city: 'Amsterdam', companyName: 'Uber', totalCompensation: '€82,500', totalCompensationNumber: 82500, totalCompensationDetails: '€69K salary, €8K bonus, €6K equity/year', baseSalary: '€5,750/month', baseSalaryNumber: 69000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'ksb5hxfpnmoflz4kkq', specialization: 'Frontend', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€129,000', totalCompensationNumber: 129000, totalCompensationDetails: '€90K salary, €15K bonus, €24K equity/year', baseSalary: '€7,500/month', baseSalaryNumber: 90000, oldYearForData: '', otherContext: '' }, { title: 'Network engineer', guid: 'ksb4rio2rfbu00uglkl', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€96,500', totalCompensationNumber: 96500, totalCompensationDetails: '€78K salary, €12K bonus, €7K equity/year', baseSalary: '€6,500/month', baseSalaryNumber: 78000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksafyuioh3v78e4cbb5', specialization: '', city: 'Amsterdam (flexible days)', companyName: '🔒 Travel company with Dutch HQ', totalCompensation: '€131,000', totalCompensationNumber: 131000, totalCompensationDetails: '€100K salary, €20K bonus, €11K equity/year', baseSalary: '€8,333/month', baseSalaryNumber: 100000, oldYearForData: '', otherContext: '' }, { title: 'Senior Developer', guid: 'ksakk6j7hqiont14ng4', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€162,000', totalCompensationNumber: 162000, totalCompensationDetails: '€110K salary, €17K bonus, €35K equity/year', baseSalary: '€9,167/month', baseSalaryNumber: 110000, oldYearForData: '', otherContext: '' }, { title: 'Principal Developer', guid: 'ksa6c78kvndmzlv2iu', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€192,000', totalCompensationNumber: 192000, totalCompensationDetails: '€135K salary, €35K bonus, €22K equity/year', baseSalary: '€11,250/month', baseSalaryNumber: 135000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Manager ', guid: 'ksa82ckwe2d6s4b0ymf', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€161,000', totalCompensationNumber: 161000, totalCompensationDetails: '€125K salary, €25K bonus, €11K equity/year', baseSalary: '€10,417/month', baseSalaryNumber: 125000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Manager', guid: 'ksa5up9v2g684bbm0nr', specialization: '', city: 'Amsterdam', companyName: 'GitLab', totalCompensation: '€179,000', totalCompensationNumber: 179000, totalCompensationDetails: '€104K salary, €75K equity/year', baseSalary: '€8,667/month', baseSalaryNumber: 104000, oldYearForData: '', otherContext: '' }, { title: 'Senior Developer', guid: 'ksa6riidvtv74otghec', specialization: 'iOS', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€144,000', totalCompensationNumber: 144000, totalCompensationDetails: '€104K salary, €23K bonus, €17K equity/year', baseSalary: '€8,667/month', baseSalaryNumber: 104000, oldYearForData: '', otherContext: '' }, { title: '🔒 Senior-level position within software engineering', guid: 'ksaa7lj1uvsgxx9eryi', specialization: '', city: 'Amsterdam (remote within country)', companyName: 'Booking.com', totalCompensation: '€150,000', totalCompensationNumber: 150000, totalCompensationDetails: '€107K salary, €21K bonus, €10K sign-on, €11K equity/year, €3K benefits', baseSalary: '€8,917/month', baseSalaryNumber: 107000, oldYearForData: '', otherContext: '' }, { title: 'Staff Software Engineer', guid: 'ksa5wky5jzjonqam3l', specialization: '', city: 'Remote', companyName: 'GitLab', totalCompensation: '€140,000', totalCompensationNumber: 140000, totalCompensationDetails: '€110K salary, €30K equity/year', baseSalary: '€9,167/month', baseSalaryNumber: 110000, oldYearForData: '', otherContext: '' }, { title: 'Senior Backend Developer', guid: 'ksayv3pv23q9ibn92pt', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€150,000', totalCompensationNumber: 150000, totalCompensationDetails: '€105K salary, €20K bonus, €25K equity/year', baseSalary: '€8,750/month', baseSalaryNumber: 105000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'ksahy5nd0zwdifs59i7', specialization: '', city: 'Amsterdam', companyName: '<NAME>', totalCompensation: '€200,000', totalCompensationNumber: 200000, totalCompensationDetails: '€80K salary, €120K bonus', baseSalary: '€6,667/month', baseSalaryNumber: 80000, oldYearForData: '2020', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksb4skl2x0txpnmzn6m', specialization: '', city: 'Amsterdam', companyName: 'Uber', totalCompensation: '€170,000', totalCompensationNumber: 170000, totalCompensationDetails: '€110K salary, €20K bonus, €40K equity/year', baseSalary: '€9,167/month', baseSalaryNumber: 110000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer ', guid: 'ksaw2vsuzx3d9e3iyx', specialization: '', city: 'Amsterdam', companyName: '🔒 Trading company', totalCompensation: '€130,000', totalCompensationNumber: 130000, totalCompensationDetails: '€110K salary, €20K bonus', baseSalary: '€9,167/month', baseSalaryNumber: 110000, oldYearForData: '', otherContext: '' }, { title: 'Software Developer', guid: 'ksa810a2eozo9wcbqlg', specialization: '', city: 'Amsterdam', companyName: 'IMC Trading', totalCompensation: '€162,000', totalCompensationNumber: 162000, totalCompensationDetails: '€112K salary, €50K bonus', baseSalary: '€9,333/month', baseSalaryNumber: 112000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'ksakovde4eb9ikqcr5e', specialization: '', city: 'Amsterdam', companyName: 'IMC Trading', totalCompensation: '€187,000', totalCompensationNumber: 187000, totalCompensationDetails: '€107K salary, €80K bonus', baseSalary: '€8,917/month', baseSalaryNumber: 107000, oldYearForData: '', otherContext: '' }, { title: 'FPGA Engineer ', guid: 'ksb34nthl2sot2pp6x', specialization: '', city: 'Amsterdam', companyName: 'IMC Trading', totalCompensation: '€135,000', totalCompensationNumber: 135000, totalCompensationDetails: '€85K salary, €50K bonus', baseSalary: '€7,083/month', baseSalaryNumber: 85000, oldYearForData: '2020', otherContext: '' }, { title: 'Quantitative Technologist', guid: 'ksaymu8stf59jmif6ci', specialization: '', city: 'Amsterdam', companyName: '🔒 Proprietary Trading Firm ', totalCompensation: '€195,000', totalCompensationNumber: 195000, totalCompensationDetails: '€140K salary, €55K bonus', baseSalary: '€11,667/month', baseSalaryNumber: 140000, oldYearForData: '', otherContext: '' }, { title: 'Lead Software Engineer', guid: 'ksai2ss3xojhmnponld', specialization: '', city: 'Amsterdam', companyName: 'Salesforce', totalCompensation: '€149,000', totalCompensationNumber: 149000, totalCompensationDetails: '€104K salary, €16K bonus, €29K equity/year', baseSalary: '€8,667/month', baseSalaryNumber: 104000, oldYearForData: '', otherContext: '' }, { title: 'Team Lead', guid: 'ksay8lad1x9f44votrti', specialization: '', city: 'Amsterdam', companyName: 'Booking.<EMAIL>', totalCompensation: '€120,000', totalCompensationNumber: 120000, totalCompensationDetails: '€90K salary, €14K bonus, €17K equity/year', baseSalary: '€7,500/month', baseSalaryNumber: 90000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'ksayzmhrsenomhza0g', specialization: '', city: 'Amsterdam', companyName: '<NAME>', totalCompensation: '€100,000', totalCompensationNumber: 100000, totalCompensationDetails: '€65K salary, €35K bonus', baseSalary: '€5,417/month', baseSalaryNumber: 65000, oldYearForData: '2020', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'ksayshn88y07tpbf45g', specialization: '', city: 'Remote (remote within country)', companyName: 'GoDaddy', totalCompensation: '€153,000', totalCompensationNumber: 153000, totalCompensationDetails: '€118K salary, €11K bonus, €24K equity/year', baseSalary: '€9,833/month', baseSalaryNumber: 118000, oldYearForData: '', otherContext: '' }, { title: 'Software Development Engineer 2', guid: 'ksaz1og0a8uds2aojl', specialization: 'L5', city: 'Amsterdam', companyName: 'Amazon', totalCompensation: '€143,000', totalCompensationNumber: 143000, totalCompensationDetails: '€71K salary, €72K equity/year', baseSalary: '€5,917/month', baseSalaryNumber: 71000, oldYearForData: '', otherContext: '' }, { title: 'Site Reliability Engineer', guid: 'ks74zrn52pdyg22dw75', specialization: '', city: 'Amsterdam', companyName: '🔒 Travel company with Dutch HQ', totalCompensation: '€131,000', totalCompensationNumber: 131000, totalCompensationDetails: '€92K salary, €14K bonus, €20K sign-on, €6K equity/year, €2K benefits, €8K relocation', baseSalary: '€7,667/month', baseSalaryNumber: 92000, oldYearForData: '', otherContext: '' }, { title: 'Senior Front End Developer', guid: 'ks7imlaxfnwa4v3z37', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Booking.com', totalCompensation: '€134,000', totalCompensationNumber: 134000, totalCompensationDetails: '€101K salary, €20K bonus, €13K equity/year, €5K relocation', baseSalary: '€8,375/month', baseSalaryNumber: 100500, oldYearForData: '', otherContext: '' }, { title: 'Software Developer', guid: 'ks7dvtm6xg266e16qn', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Booking.com', totalCompensation: '€106,000', totalCompensationNumber: 106000, totalCompensationDetails: '€82K salary, €12K bonus, €6K sign-on, €6K equity/year', baseSalary: '€6,833/month', baseSalaryNumber: 82000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer ', guid: 'ks79sp1dc5hyex1wna8', specialization: '', city: 'Hybrid option', companyName: 'Elastic', totalCompensation: '€208,000', totalCompensationNumber: 208000, totalCompensationDetails: '€108K salary, €100K equity/year', baseSalary: '€9,000/month', baseSalaryNumber: 108000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Manager', guid: 'ks7o417032czjfqyp41', specialization: '', city: 'Amsterdam (flexible days)', companyName: 'Booking.com', totalCompensation: '€156,000', totalCompensationNumber: 156000, totalCompensationDetails: '€112K salary, €22K bonus, €10K sign-on, €11K equity/year, €3K benefits', baseSalary: '€9,333/month', baseSalaryNumber: 112000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer 2', guid: 'ks8u0qnlazumd11eh7v', specialization: 'L5', city: 'null (flexible days)', companyName: 'Amazon', totalCompensation: '€116,000', totalCompensationNumber: 116000, totalCompensationDetails: '€101K salary, €15K sign-on, €2K benefits, €5K relocation', baseSalary: '€8,417/month', baseSalaryNumber: 101000, oldYearForData: '', otherContext: '' }, { title: 'Senior Developer', guid: 'ks8i9epfmtf1buvfpq8', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€127,000', totalCompensationNumber: 127000, totalCompensationDetails: '€102K salary, €12K bonus, €13K equity/year', baseSalary: '€8,458/month', baseSalaryNumber: 101500, oldYearForData: '', otherContext: '' }, { title: 'Lead Software Engineer', guid: 'kqkn0srvycr22cdf7p8', specialization: '', city: 'Amsterdam (remote within country)', companyName: '🔒 US cryptocurrency startup, Series C stage', totalCompensation: '€260,000', totalCompensationNumber: 260000, totalCompensationDetails: '€115K salary, €15K bonus, €15K sign-on, €115K equity/year', baseSalary: '€9,583/month', baseSalaryNumber: 115000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'kqkmrzv652m0gk534df', specialization: '', city: 'Amsterdam', companyName: '🔒 Cryptocurrency company', totalCompensation: '€120,000', totalCompensationNumber: 120000, totalCompensationDetails: '€70K salary, €50K bonus', baseSalary: '€5,833/month', baseSalaryNumber: 70000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer ', guid: 'kqjquzvsx3w71a1q19', specialization: '', city: 'Amsterdam', companyName: 'GitHub', totalCompensation: '€156,000', totalCompensationNumber: 156000, totalCompensationDetails: '€93K salary, €12K bonus, €51K equity/year, €6K benefits', baseSalary: '€7,750/month', baseSalaryNumber: 93000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Developer', guid: 'kqkxyi20ywukdor8le', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€156,000', totalCompensationNumber: 156000, totalCompensationDetails: '€102K salary, €20K bonus, €34K equity/year', baseSalary: '€8,500/month', baseSalaryNumber: 102000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'kqjsnzdd4qk67ufpvhp', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€134,000', totalCompensationNumber: 134000, totalCompensationDetails: '€93K salary, €19K bonus, €22K equity/year', baseSalary: '€7,750/month', baseSalaryNumber: 93000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer 2', guid: 'kqjr2hr5rh1f2eeaxzn', specialization: '', city: 'Amsterdam', companyName: 'Uber', totalCompensation: '€135,000', totalCompensationNumber: 135000, totalCompensationDetails: '€90K salary, €11K bonus, €34K equity/year, €7K benefits', baseSalary: '€7,500/month', baseSalaryNumber: 90000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'kqjjayw9t2kkyzc9ta', specialization: '', city: 'Amsterdam', companyName: '🔒 FinTech company with Dutch HQ', totalCompensation: '€117,000', totalCompensationNumber: 117000, totalCompensationDetails: '€71K salary, €46K equity/year', baseSalary: '€5,917/month', baseSalaryNumber: 71000, oldYearForData: '', otherContext: '' }, { title: 'Software Development Engineer 2', guid: 'kqjivq4dt3xf2x1ayae', specialization: 'L5', city: 'Amsterdam', companyName: 'Amazon', totalCompensation: '€123,000', totalCompensationNumber: 123000, totalCompensationDetails: '€95K salary, €8K bonus, €20K equity/year', baseSalary: '€7,917/month', baseSalaryNumber: 95000, oldYearForData: '', otherContext: '' }, { title: 'Senior Developer', guid: 'kqjj4ps522147l840xe', specialization: '', city: 'Amsterdam', companyName: '🔒 FinTech company with Dutch HQ', totalCompensation: '€140,000', totalCompensationNumber: 140000, totalCompensationDetails: '€92K salary, €48K equity/year', baseSalary: '€7,667/month', baseSalaryNumber: 92000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'kqjny37bmsgzptrgli', specialization: 'Level 6', city: 'Amsterdam', companyName: 'Elastic', totalCompensation: '€136,000', totalCompensationNumber: 136000, totalCompensationDetails: '€98K salary, €38K equity/year', baseSalary: '€8,167/month', baseSalaryNumber: 98000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer 2', guid: 'kqjregz4xj4k76nsdmc', specialization: '', city: 'Amsterdam', companyName: 'Uber', totalCompensation: '€110,000', totalCompensationNumber: 110000, totalCompensationDetails: '€82K salary, €12K bonus, €16K equity/year', baseSalary: '€6,833/month', baseSalaryNumber: 82000, oldYearForData: '', otherContext: '' }, { title: 'Principal Developer', guid: 'kqif6d6933qm3628e0g', specialization: '', city: 'Amsterdam', companyName: '🔒 Travel company with Dutch HQ', totalCompensation: '€238,000', totalCompensationNumber: 238000, totalCompensationDetails: '€126K salary, €45K bonus, €67K equity/year', baseSalary: '€10,500/month', baseSalaryNumber: 126000, oldYearForData: '', otherContext: '' }, { title: 'Staff Software Engineer', guid: 'kqi6tgv66r2vi3rgfit', specialization: '', city: 'Amsterdam', companyName: '🔒 Dutch FinTech company', totalCompensation: '€145,000', totalCompensationNumber: 145000, totalCompensationDetails: '€105K salary, €40K equity/year', baseSalary: '€8,750/month', baseSalaryNumber: 105000, oldYearForData: '', otherContext: '' }, { title: 'Senior Machine Learning Engineer ', guid: 'kqjqt7bopema6s09swj', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€159,000', totalCompensationNumber: 159000, totalCompensationDetails: '€105K salary, €20K bonus, €34K equity/year', baseSalary: '€8,750/month', baseSalaryNumber: 105000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'kqifxmzapw7qdwjip4', specialization: '', city: 'Amsterdam', companyName: '🔒 Ride sharing company', totalCompensation: '€170,000', totalCompensationNumber: 170000, totalCompensationDetails: '€115K salary, €20K bonus, €35K equity/year', baseSalary: '€9,583/month', baseSalaryNumber: 115000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'kqifb6g03gep7w36r0t', specialization: '', city: 'Amsterdam', companyName: 'Elastic', totalCompensation: '€149,000', totalCompensationNumber: 149000, totalCompensationDetails: '€115K salary, €34K equity/year', baseSalary: '€9,583/month', baseSalaryNumber: 115000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'kqif7hepa6s0kuo587w', specialization: '', city: 'Amsterdam', companyName: 'Uber', totalCompensation: '€178,000', totalCompensationNumber: 178000, totalCompensationDetails: '€120K salary, €20K bonus, €38K equity/year, €10K benefits', baseSalary: '€10,000/month', baseSalaryNumber: 120000, oldYearForData: '', otherContext: '' }, { title: 'Engineering Manager', guid: 'kqievo5oqw8jau41of', specialization: '', city: 'Amsterdam', companyName: 'Booking.<EMAIL>', totalCompensation: '€130,000', totalCompensationNumber: 130000, totalCompensationDetails: '€100K salary, €20K bonus, €10K equity/year, €1K benefits', baseSalary: '€8,333/month', baseSalaryNumber: 100000, oldYearForData: '', otherContext: '' }, { title: 'Site Reliability Engineer', guid: 'kqi6xthvl3njn0m3hi', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€120,000', totalCompensationNumber: 120000, totalCompensationDetails: '€90K salary, €14K bonus, €17K equity/year', baseSalary: '€7,500/month', baseSalaryNumber: 90000, oldYearForData: '', otherContext: '' }, { title: 'Software Developer', guid: 'kqkxxtt942amec1gmrq', specialization: 'Core', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€121,000', totalCompensationNumber: 121000, totalCompensationDetails: '€88K salary, €13K bonus, €20K equity/year', baseSalary: '€7,333/month', baseSalaryNumber: 88000, oldYearForData: '', otherContext: '' }, { title: 'Product Manager', guid: 'kqhzfuwgeym8xq0q29', specialization: '', city: 'Amsterdam', companyName: '🔒 Travel company with Dutch HQ', totalCompensation: '€99,000', totalCompensationNumber: 99000, totalCompensationDetails: '€82K salary, €12K bonus, €5K equity/year', baseSalary: '€6,833/month', baseSalaryNumber: 82000, oldYearForData: '', otherContext: '' }, { title: 'Principal Engineer', guid: 'kqjila51hb3wq4txhlv', specialization: 'L7', city: 'Amsterdam', companyName: 'Amazon ', totalCompensation: '€190,000', totalCompensationNumber: 190000, totalCompensationDetails: '€135K salary, €55K equity/year', baseSalary: '€11,250/month', baseSalaryNumber: 135000, oldYearForData: '', otherContext: '' }, { title: 'Principal Software Engineer', guid: 'kqjab9n6mr1gno550q', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€219,000', totalCompensationNumber: 219000, totalCompensationDetails: '€128K salary, €40K bonus, €51K equity/year', baseSalary: '€10,667/month', baseSalaryNumber: 128000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Engineer', guid: 'kqj9s12908lfa2tvgwp9', specialization: '', city: 'Flexible days', companyName: 'Uber', totalCompensation: '€155,000', totalCompensationNumber: 155000, totalCompensationDetails: '€113K salary, €20K bonus, €22K equity/year', baseSalary: '€9,417/month', baseSalaryNumber: 113000, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'kqjr1nltk8g65auv53k', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€125,000', totalCompensationNumber: 125000, totalCompensationDetails: '€83K salary, €22K bonus, €20K equity/year', baseSalary: '€6,917/month', baseSalaryNumber: 83000, oldYearForData: '', otherContext: '' }, { title: 'Senior Software Developer', guid: 'krnxbmjq76o7tuto4w', specialization: '', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€132,000', totalCompensationNumber: 132000, totalCompensationDetails: '€103K salary, €19K bonus, €11K equity/year', baseSalary: '€8,542/month', baseSalaryNumber: 102500, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer', guid: 'kqkwrt4jwelo24h1k08', specialization: 'Intern', city: 'Amsterdam', companyName: 'Amazon', totalCompensation: '€45,900', totalCompensationNumber: 45900, totalCompensationDetails: '€46K salary, €10K benefits', baseSalary: '€3,825/month', baseSalaryNumber: 45900, oldYearForData: '', otherContext: '' }, { title: 'Software Engineer 1', guid: 'krnx80tjlbpex2lf2np', specialization: '', city: 'Amsterdam', companyName: 'Uber', totalCompensation: '€103,000', totalCompensationNumber: 103000, totalCompensationDetails: '€78K salary, €9K bonus, €17K equity/year', baseSalary: '€6,483/month', baseSalaryNumber: 77800, oldYearForData: '2020', otherContext: '' }, { title: 'Senior Analyst', guid: 'krnxirp28aghsssd3o5', specialization: '', city: 'Amsterdam', companyName: 'Uber', totalCompensation: '€143,000', totalCompensationNumber: 143000, totalCompensationDetails: '€80K salary, €13K bonus, €50K equity/year', baseSalary: '€6,667/month', baseSalaryNumber: 80000, oldYearForData: '', otherContext: '' }, { title: 'SDE 1', guid: 'krpdbmknypxnaoqolm', specialization: 'L4', city: 'Amsterdam', companyName: 'Amazon', totalCompensation: '€86,000', totalCompensationNumber: 86000, totalCompensationDetails: '€66K salary, €16K sign-on, €4K equity/year', baseSalary: '€5,535/month', baseSalaryNumber: 66420, oldYearForData: '', otherContext: '' }, { title: 'Senior Developer', guid: 'kqku9gaxwmc67zs4uqm', specialization: 'Frontend', city: 'Amsterdam', companyName: 'Booking.com', totalCompensation: '€141,000', totalCompensationNumber: 141000, totalCompensationDetails: '€104K salary, €16K bonus, €21K equity/year', baseSalary: '€8,667/month', baseSalaryNumber: 104000, oldYearForData: '', otherContext: '' }, ]
import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core'; import { WorkbasketSummaryResource } from 'app/models/workbasket-summary-resource'; @Component({ selector: 'taskana-pagination', templateUrl: './pagination.component.html', styleUrls: ['./pagination.component.scss'] }) export class PaginationComponent implements OnInit, OnChanges { @Input() workbasketsResource: WorkbasketSummaryResource; @Output() workbasketsResourceChange = new EventEmitter<WorkbasketSummaryResource>(); @Output() changePage = new EventEmitter<number>(); previousPageSelected = 1; pageSelected = 1; maxPagesAvailable = 8; constructor() { } ngOnChanges(changes: SimpleChanges): void { if (changes.workbasketsResource.currentValue && changes.workbasketsResource.currentValue.page) { this.pageSelected = changes.workbasketsResource.currentValue.page.number; } } ngOnInit() { } changeToPage(page) { if (page < 1) { page = this.pageSelected = 1; } if (page > this.workbasketsResource.page.totalPages) { page = this.workbasketsResource.page.totalPages; } if (this.previousPageSelected !== page) { this.changePage.emit(page); this.previousPageSelected = page; } } getPagesTextToShow(): string { if (!this.workbasketsResource) { return ''; } let text = this.workbasketsResource.page.totalElements + ''; if (this.workbasketsResource.page && this.workbasketsResource.page.totalElements && this.workbasketsResource.page.totalElements >= this.workbasketsResource.page.size) { text = this.workbasketsResource.page.size + ''; } return `${text} of ${this.workbasketsResource.page.totalElements} workbaskets`; } }
import argparse def main(): parser = argparse.ArgumentParser(description="FPGA Configuration Tool") parser.add_argument('-g', '--gap', required=False, type=int, default=1, dest="gap", metavar="<gap>", help="Gap in seconds (or ticks) between glitches") parser.add_argument('-m', '--mhz', required=False, type=int, default=100, dest="mhz", metavar="<mhz>", help="Speed in MHz of FPGA clock") parser.add_argument('-p', '--port', required=False, type=int, default=100, dest="port", metavar="<port>", help="Port number for communication") args = parser.parse_args() print("Gap:", args.gap) print("MHz:", args.mhz) print("Port:", args.port) if __name__ == "__main__": main()
import { TransactionPage } from '../../features/transactions/ui/pages/TransactionPage'; export default TransactionPage;
<filename>Documentation/_space_to_depth_8cpp.js<gh_stars>0 var _space_to_depth_8cpp = [ [ "SpaceToDepth", "_space_to_depth_8cpp.xhtml#a5e1dc69443b64ad16b669388a6023f7a", null ] ];
func findLargestNumber(num1: Int, num2: Int, num3: Int) -> Int { var largestNumber = num1 if(num2 > largestNumber){ largestNumber = num2 } if(num3 > largestNumber){ largestNumber = num3 } return largestNumber } let num1 = 5 let num2 = 10 let num3 = 8 let result = findLargestNumber(num1: num1, num2: num2, num3: num3) print("The largest number is: \(result)")
<gh_stars>0 package com.example.android.miwok; import android.app.Activity; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; public class WordAdapter extends ArrayAdapter<word> { private static final String LOG_TAG = WordAdapter.class.getSimpleName(); private int color; public WordAdapter(Activity context, ArrayList<word> words,int colorId) { // Here, we initialize the ArrayAdapter's internal storage for the context and the list. // the second argument is used when the ArrayAdapter is populating a single TextView. // Because this is a custom adapter for two TextViews and an ImageView, the adapter is not // going to use this second argument, so it can be any value. Here, we used 0. super(context, 0, words); color=colorId; } @Override public View getView(int position, View convertView, ViewGroup parent) { // Check if the existing view is being reused, otherwise inflate the view View listItemView = convertView; if(listItemView == null) { listItemView = LayoutInflater.from(getContext()).inflate( R.layout.list_item, parent, false); } word currentPair = getItem(position); TextView mivokTextView = (TextView) listItemView.findViewById(R.id.mivok); mivokTextView.setText(currentPair.getMivokTranslation()); TextView englishTextView = (TextView) listItemView.findViewById(R.id.english); englishTextView.setText(currentPair.getEnglishTranslation()); View textContainer=listItemView.findViewById((R.id.text_container)); int color1=ContextCompat.getColor(getContext(),color); textContainer.setBackgroundColor(color1); boolean HasImage=currentPair.hasImage(); ImageView imgview = (ImageView) listItemView.findViewById(R.id.image); if(HasImage==true){ imgview.setImageResource(currentPair.getResourceId()); imgview.setVisibility(View.VISIBLE);} else { imgview.setVisibility(View.GONE); } return listItemView; } }
import * as path from "https://deno.land/std@0.87.0/path/mod.ts"; export function pathResolver(meta: ImportMeta): (p: string) => string { return (p) => path.fromFileUrl(new URL(p, meta.url)); }
for dir in `ls src` do if [ -d src/$dir ] then echo src/$dir cd src/$dir chmod +x build.sh ./build.sh cd ../../ fi done
class ElectricPower: def __init__(self, voltage): self.voltage = voltage class PowerWire: pass # Placeholder for PowerWire class implementation class SystemTask: def __init__(self, name, value): self.name = name self.value = value class Function: TASKED = 'TASKED' POWERED = 'POWERED' class TaskName: SET_POWER = 'SET_POWER' class TypeList: def __init__(self, type_class): self.type_class = type_class class PowerComponent: def __init__(self, parent): self.parent = parent self.power = ElectricPower(voltage=0) self.power_wires = TypeList(PowerWire) def set_power(self, power=ElectricPower(voltage=0)): self.power = power if self.parent.has_function(Function.TASKED): self.parent.send_task(SystemTask(name=TaskName.SET_POWER, value={'power': power})) else: if self.power.voltage in self.parent.get_function(Function.POWERED).input_power_ratings: self.active = True else: self.active = False
/* * Copyright (C) 2012 Sony Mobile Communications AB * * This file is part of ApkAnalyser. * * 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 the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package analyser.gui.actions.lookup; import gui.actions.AbstractCanceableAction; import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; import javax.swing.Icon; import javax.swing.tree.TreePath; import analyser.gui.ClassTree; import analyser.gui.MainFrame; import analyser.gui.ProgressReporter; import analyser.gui.Selection; import analyser.logic.InvSnooper; import analyser.logic.RefInvokation; import analyser.logic.RefMethod; import analyser.logic.Reference; public class LocalLookUpCallsAction extends AbstractCanceableAction { private static final long serialVersionUID = 7174910122020609082L; protected static LocalLookUpCallsAction m_inst = null; protected int m_count; protected int m_curRefs; public static LocalLookUpCallsAction getInstance(MainFrame mainFrame) { if (m_inst == null) { m_inst = new LocalLookUpCallsAction("Look up local calls", null); m_inst.setMainFrame(mainFrame); } return m_inst; } protected LocalLookUpCallsAction(String arg0, Icon arg1) { super(arg0, arg1); } @Override public void run(ActionEvent e) throws Throwable { MainFrame mainFrame = (MainFrame) getMainFrame(); Object oRef = Selection.getSelectedObject(); if (oRef == null || !(oRef instanceof RefMethod)) { return; } ClassTree tree = mainFrame.getSelectedTree(); List<InvSnooper.Invokation> invokations = InvSnooper.findCalls((RefMethod) oRef, false, true, this, new ProgressReporter() { int total; @Override public void reportStart(int total) { this.total = total; } @Override public void reportWork(int finished) { getMainFrame().actionReportWork(LocalLookUpCallsAction.this, finished * 100 / total); } @Override public void reportEnd() { } }); if (isRunning()) { List<RefInvokation> refInvs = InvSnooper.toRefInvokations(invokations); RefInvokation[] invs = refInvs.toArray(new RefInvokation[refInvs.size()]); selectPathsInTree(tree, invs, RefMethod.class, false); } mainFrame.setBottomInfo(invokations.size() + " reference(s) found"); mainFrame.actionFinished(this); } @SuppressWarnings("unchecked") public void selectPathsInTree(ClassTree tree, RefInvokation[] invs, Class<? extends Reference> level, boolean opposite) { List<TreePath> paths = new ArrayList<TreePath>(); tree.clearSelection(); for (int i = 0; i < invs.length; i++) { RefInvokation inv = opposite ? invs[i].getOppositeInvokation() : invs[i]; TreePath path = tree.getPath(inv, level); if (path != null) { if (!paths.contains(path)) { paths.add(path); } } else { System.err.println("No path found for " + inv); } } if (isRunning()) { TreePath[] treePaths = paths.toArray(new TreePath[paths.size()]); synchronized (tree.getTreeLock()) { tree.markPaths(treePaths, true); tree.setSelectionPaths(treePaths); if (treePaths.length > 0) { tree.scrollPathToVisible(treePaths[0]); } } } } @Override public void handleThrowable(Throwable t) { t.printStackTrace(); getMainFrame().showError("Error during local call look up", t); } @Override public String getWorkDescription() { return "Looking up local references"; } }
import psutil import time def monitor_cpu_utilization(threshold, monitoring_duration): utilization_values = [] start_time = time.time() while True: cpu_utilization = psutil.cpu_percent(interval=1) utilization_values.append(cpu_utilization) if cpu_utilization > threshold: print(f"CPU utilization exceeded {threshold}%") if time.time() - start_time >= monitoring_duration: average_utilization = sum(utilization_values) / len(utilization_values) print(f"Average CPU utilization over {monitoring_duration} seconds: {average_utilization}%") break if __name__ == "__main__": threshold = 80 # Define the CPU utilization threshold monitoring_duration = 300 # Define the monitoring duration in seconds (e.g., 5 minutes) monitor_cpu_utilization(threshold, monitoring_duration)
<filename>projects/ngx-grid-core/src/lib/ui/cell/cell-types/value-multi-editing/text-append.ts<gh_stars>1-10 import { TCellTypeName } from '../../../../typings/types/cell-type-name.type' import { StringParser } from '../value-parsing/parsers/string.parser' import { BaseMultiEdit } from './base-multi-edit.abstract' export class TextAppend extends BaseMultiEdit { constructor(cellValue: any, cellType: TCellTypeName) { super(cellValue, cellType) } public label = 'locAppendText' public run = (input: any) => { const valueTest = new StringParser(this.cellValue).run() const valueString = valueTest.isValid ? valueTest.transformedValue : '' const inputTest = new StringParser(input).run() const inputString = inputTest.isValid ? inputTest.transformedValue : '' let newValue = '' if (valueString === '') { this.setCellValue(inputString) return } if (!inputString) return if (this.cellType === 'RichText') { const node = document.createElement('div') node.innerHTML = valueString if (node.childElementCount > 0) { node.lastElementChild!.append(inputString) newValue = node.innerHTML } } if (!newValue) newValue = `${valueString}${inputString}` this.setCellValue(newValue) } }
#ifndef __PERFTIMER_H__ #define __PERFTIMER_H__ class PerfTimer { public: // Constructor PerfTimer(); void Start(); double ReadMs() const; int ReadTicks() const; private: int started_at; static int frequency; }; #endif //__PERFTIMER_H__
#!/usr/bin/env bash catkin_ws=${1:-"$HOME/catkin_ws"} ros_version=${2:-"$(rosversion -d)"} script_dir="$(dirname "$(readlink -e "${BASH_SOURCE[0]}")" && echo X)" && script_dir="${script_dir%$'\nX'}" source "/opt/ros/${ros_version}/setup.bash" source "${catkin_ws}/devel/setup.bash" "${script_dir}/a_dependencies.sh" ${ros_version} echo -e "\n\n" echo "--------------------------------------------------------------------" echo "--- Installing remaining dependencies" cd "${catkin_ws}" rosdep update rosdep check --from-paths src --ignore-src --rosdistro=${ros_version} rosdep install --from-paths src --ignore-src --rosdistro=${ros_version} echo -e "\n\n" echo "--------------------------------------------------------------------" echo "--- Dependencies that must be manually checked" rosdep check --from-paths src --ignore-src --rosdistro=${ros_version} echo -e "\n\n" echo "####################################################################################################" echo "##### Building catkin workspace" echo "####################################################################################################" cd "${catkin_ws}" find ./src -name "*.bash" -exec chmod +x {} \; find ./src -name "*.cfg" -exec chmod +x {} \; find ./src -name "*.sh" -exec chmod +x {} \; catkin_make echo -e "\n\n" echo "----------------------------------------------------------------------------------------------------" echo ">>>>> Finished building catkin workspace" echo "----------------------------------------------------------------------------------------------------"
<gh_stars>1-10 /* * Copyright (C) 2005-2015 <NAME> (<EMAIL>). * * 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 the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "3rdparty/catch/catch.hpp" #include "utils.h" #include "os.hpp" #include "2device/device.h" #include "4env/env_local.h" using namespace hamsterdb; struct DeviceFixture { ham_db_t *m_db; ham_env_t *m_env; Device *m_dev; DeviceFixture(bool inmemory) { (void)os::unlink(Utils::opath(".test")); REQUIRE(0 == ham_env_create(&m_env, Utils::opath(".test"), inmemory ? HAM_IN_MEMORY : 0, 0644, 0)); REQUIRE(0 == ham_env_create_db(m_env, &m_db, 1, 0, 0)); m_dev = ((LocalEnvironment *)m_env)->device(); } ~DeviceFixture() { REQUIRE(0 == ham_env_close(m_env, HAM_AUTO_CLEANUP)); } void newDeleteTest() { } void createCloseTest() { REQUIRE(true == m_dev->is_open()); m_dev->close(); REQUIRE(false == m_dev->is_open()); m_dev->open(); REQUIRE(true == m_dev->is_open()); } void openCloseTest() { REQUIRE(true == m_dev->is_open()); m_dev->close(); REQUIRE(false == m_dev->is_open()); m_dev->open(); REQUIRE(true == m_dev->is_open()); m_dev->close(); REQUIRE(false == m_dev->is_open()); m_dev->open(); REQUIRE(true == m_dev->is_open()); } void allocTest() { int i; uint64_t address; REQUIRE(true == m_dev->is_open()); for (i = 0; i < 10; i++) { address = m_dev->alloc(1024); REQUIRE(address == (((LocalEnvironment *)m_env)->config().page_size_bytes * 2) + 1024 * i); } } void allocFreeTest() { Page page(((LocalEnvironment *)m_env)->device()); page.set_db((LocalDatabase *)m_db); REQUIRE(true == m_dev->is_open()); m_dev->alloc_page(&page); REQUIRE(page.get_data()); m_dev->free_page(&page); } void flushTest() { REQUIRE(true == m_dev->is_open()); m_dev->flush(); REQUIRE(true == m_dev->is_open()); } void mmapUnmapTest() { int i; Page *pages[10]; for (int i = 0; i < 10; i++) pages[i] = new Page(m_dev, (LocalDatabase *)m_db); uint32_t ps = HAM_DEFAULT_PAGE_SIZE; uint8_t *temp = (uint8_t *)malloc(ps); REQUIRE(true == m_dev->is_open()); m_dev->truncate(ps * 10); for (i = 0; i < 10; i++) { pages[i]->set_address(i * ps); m_dev->read_page(pages[i], i * ps); } for (i = 0; i < 10; i++) { ::memset(pages[i]->get_raw_payload(), i, ps); pages[i]->set_dirty(true); } for (i = 0; i < 10; i++) Page::flush(m_dev, pages[i]->get_persisted_data()); for (i = 0; i < 10; i++) { uint8_t *buffer; memset(temp, i, ps); m_dev->free_page(pages[i]); m_dev->read_page(pages[i], i * ps); buffer = (uint8_t *)pages[i]->get_payload(); REQUIRE(0 == memcmp(buffer, temp, ps - Page::kSizeofPersistentHeader)); } for (i = 0; i < 10; i++) { m_dev->free_page(pages[i]); delete pages[i]; } free(temp); } void readWriteTest() { int i; uint8_t *buffer[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; uint32_t ps = HAM_DEFAULT_PAGE_SIZE; uint8_t *temp = (uint8_t *)malloc(ps); EnvironmentConfiguration &cfg = const_cast<EnvironmentConfiguration &>(((LocalEnvironment *)m_env)->config()); cfg.flags |= HAM_DISABLE_MMAP; REQUIRE(true == m_dev->is_open()); m_dev->truncate(ps * 10); for (i = 0; i < 10; i++) { buffer[i] = (uint8_t *)malloc(ps); m_dev->read(i * ps, buffer[i], ps); } for (i = 0; i < 10; i++) memset(buffer[i], i, ps); for (i = 0; i < 10; i++) m_dev->write(i * ps, buffer[i], ps); for (i = 0; i < 10; i++) { m_dev->read(i * ps, buffer[i], ps); memset(temp, i, ps); REQUIRE(0 == memcmp(buffer[i], temp, ps)); free(buffer[i]); } free(temp); } void readWritePageTest() { int i; Page *pages[2]; uint32_t ps = HAM_DEFAULT_PAGE_SIZE; EnvironmentConfiguration &cfg = const_cast<EnvironmentConfiguration &>(((LocalEnvironment *)m_env)->config()); cfg.flags |= HAM_DISABLE_MMAP; REQUIRE(1 == m_dev->is_open()); m_dev->truncate(ps * 2); for (i = 0; i < 2; i++) { pages[i] = new Page(((LocalEnvironment *)m_env)->device()); pages[i]->set_address(ps * i); pages[i]->set_dirty(true); m_dev->read_page(pages[i], ps * i); } for (i = 0; i < 2; i++) { REQUIRE(pages[i]->is_allocated()); memset(pages[i]->get_payload(), i + 1, ps - Page::kSizeofPersistentHeader); Page::flush(m_dev, pages[i]->get_persisted_data()); delete pages[i]; } for (i = 0; i < 2; i++) { char temp[HAM_DEFAULT_PAGE_SIZE]; memset(temp, i + 1, sizeof(temp)); REQUIRE((pages[i] = new Page(((LocalEnvironment *)m_env)->device()))); pages[i]->set_address(ps * i); m_dev->read_page(pages[i], ps * i); REQUIRE(0 == memcmp(pages[i]->get_payload(), temp, ps - Page::kSizeofPersistentHeader)); delete pages[i]; } } }; TEST_CASE("Device/newDelete", "") { DeviceFixture f(false); f. newDeleteTest(); } TEST_CASE("Device/createClose", "") { DeviceFixture f(false); f. createCloseTest(); } TEST_CASE("Device/openClose", "") { DeviceFixture f(false); f. openCloseTest(); } TEST_CASE("Device/alloc", "") { DeviceFixture f(false); f. allocTest(); } TEST_CASE("Device/allocFree", "") { DeviceFixture f(false); f. allocFreeTest(); } TEST_CASE("Device/flush", "") { DeviceFixture f(false); f. flushTest(); } TEST_CASE("Device/mmapUnmap", "") { DeviceFixture f(false); f. mmapUnmapTest(); } TEST_CASE("Device/readWrite", "") { DeviceFixture f(false); f. readWriteTest(); } TEST_CASE("Device/readWritePage", "") { DeviceFixture f(false); f. readWritePageTest(); } TEST_CASE("Device-inmem/newDelete", "") { DeviceFixture f(true); f. newDeleteTest(); } TEST_CASE("Device-inmem/allocFree", "") { DeviceFixture f(true); f. allocFreeTest(); } TEST_CASE("Device-inmem/flush", "") { DeviceFixture f(true); f. flushTest(); }
#include <iostream> #include <string> int main() { std::string user_input; while (true) { std::cout << "User: "; std::getline(std::cin, user_input); if (user_input == "hello") { std::cout << "Chatbot: Hello there!" << std::endl; } else if (user_input == "how are you?") { std::cout << "Chatbot: I'm doing well, thank you!" << std::endl; } else if (user_input == "what's your name?") { std::cout << "Chatbot: I'm just a chatbot." << std::endl; } else if (user_input == "quit") { std::cout << "Chatbot: Goodbye!" << std::endl; break; } else { std::cout << "Chatbot: I'm sorry, I didn't understand that." << std::endl; } } return 0; }
#!/usr/bin/env bash cat <<'EOF' | docker build --force-rm -t githooks:windows-lfs -f - . FROM mcr.microsoft.com/windows/servercore:2004 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) RUN choco install -y git RUN choco install -y jq RUN choco install -y curl # ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows ENV GOPATH C:\\gopath # PATH isn't actually set in the Docker image, so we have to set it from within the container RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \ Write-Host ('Updating PATH: {0}' -f $newPath); \ [Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); # doing this first to share cache across versions more aggressively ENV GOLANG_VERSION 1.17 RUN $url = ('https://golang.org/dl/go{0}.windows-amd64.zip' -f $env:GOLANG_VERSION); \ Write-Host ('Downloading {0} ...' -f $url); \ $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ \ $sha256 = '2a18bd65583e221be8b9b7c2fbe3696c40f6e27c2df689bbdcc939d49651d151'; \ Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \ if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ \ Write-Host 'Expanding ...'; \ $ProgressPreference = 'SilentlyContinue'; Expand-Archive go.zip -DestinationPath C:\; \ \ Write-Host 'Removing ...'; \ Remove-Item go.zip -Force; \ \ Write-Host 'Verifying install ("go version") ...'; \ go version; \ \ Write-Host 'Complete.'; ENV GH_TESTS="c:/githooks-tests/tests" ENV GH_TEST_TMP="c:/githooks-tests/tmp" ENV GH_TEST_REPO="c:/githooks-tests/githooks" ENV GH_TEST_BIN="c:/githooks-tests/githooks/githooks/bin" ENV GH_TEST_GIT_CORE="c:/Program Files/Git/mingw64/share/git-core" ENV GH_ON_WINDOWS="true" # Add sources COPY githooks "$GH_TEST_REPO/githooks" ADD .githooks/README.md "$GH_TEST_REPO/.githooks/README.md" ADD examples "$GH_TEST_REPO/examples" ADD tests/setup-githooks.sh "$GH_TESTS/" RUN & "'C:/Program Files/Git/bin/sh.exe'" "C:/githooks-tests/tests/setup-githooks.sh" ADD tests "$GH_TESTS" WORKDIR C:/githooks-tests/tests EOF docker run --rm \ -a stdout \ -a stderr "githooks:windows-lfs" \ "C:/Program Files/Git/bin/sh.exe" ./exec-steps.sh --skip-docker-check "$@" RESULT=$? docker rmi "githooks:windows-lfs" exit $RESULT
from typing import List def check_winner(board: List[List[str]], label: str) -> str: # Check rows, columns, and diagonals for a winner for i in range(3): # Check rows and columns if board[i][0] == board[i][1] == board[i][2] != 'nan' or \ board[0][i] == board[1][i] == board[2][i] != 'nan': return board[i][0] # Check diagonals if board[0][0] == board[1][1] == board[2][2] != 'nan' or \ board[0][2] == board[1][1] == board[2][0] != 'nan': return board[1][1] # If no winner, check for a draw or ongoing game if label == 'won': return 'ongoing' # Incorrect label, game should be ongoing elif any('nan' in row for row in board): return 'ongoing' else: return 'draw'
import { NextFunction, Request, Response } from 'express'; import { SUCCESS } from '../../consts'; export const booking = async (req: Request, res: Response, next: NextFunction) => { res.customSuccess(SUCCESS, null, { evidenceId: 'bookingEvidenceId', }); };
// Copyright (c) 2015, the Dart GL extension authors. All rights reserved. // Please see the AUTHORS file for details. Use of this source code is governed // by a BSD-style license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd // This file is auto-generated by scripts in the tools/ directory. #ifndef DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_ #define DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_ #include "dart_api.h" // Header file for generated GL function bindings. void glActiveTexture_native(Dart_NativeArguments arguments); void glAttachShader_native(Dart_NativeArguments arguments); void glBindAttribLocation_native(Dart_NativeArguments arguments); void glBindBuffer_native(Dart_NativeArguments arguments); void glBindFramebuffer_native(Dart_NativeArguments arguments); void glBindRenderbuffer_native(Dart_NativeArguments arguments); void glBindTexture_native(Dart_NativeArguments arguments); void glBlendColor_native(Dart_NativeArguments arguments); void glBlendEquation_native(Dart_NativeArguments arguments); void glBlendEquationSeparate_native(Dart_NativeArguments arguments); void glBlendFunc_native(Dart_NativeArguments arguments); void glBlendFuncSeparate_native(Dart_NativeArguments arguments); void glBufferData_native(Dart_NativeArguments arguments); void glBufferSubData_native(Dart_NativeArguments arguments); void glCheckFramebufferStatus_native(Dart_NativeArguments arguments); void glClear_native(Dart_NativeArguments arguments); void glClearColor_native(Dart_NativeArguments arguments); void glClearDepthf_native(Dart_NativeArguments arguments); void glClearStencil_native(Dart_NativeArguments arguments); void glColorMask_native(Dart_NativeArguments arguments); void glCompileShader_native(Dart_NativeArguments arguments); void glCompressedTexImage2D_native(Dart_NativeArguments arguments); void glCompressedTexSubImage2D_native(Dart_NativeArguments arguments); void glCopyTexImage2D_native(Dart_NativeArguments arguments); void glCopyTexSubImage2D_native(Dart_NativeArguments arguments); void glCreateProgram_native(Dart_NativeArguments arguments); void glCreateShader_native(Dart_NativeArguments arguments); void glCullFace_native(Dart_NativeArguments arguments); void glDeleteBuffers_native(Dart_NativeArguments arguments); void glDeleteFramebuffers_native(Dart_NativeArguments arguments); void glDeleteProgram_native(Dart_NativeArguments arguments); void glDeleteRenderbuffers_native(Dart_NativeArguments arguments); void glDeleteShader_native(Dart_NativeArguments arguments); void glDeleteTextures_native(Dart_NativeArguments arguments); void glDepthFunc_native(Dart_NativeArguments arguments); void glDepthMask_native(Dart_NativeArguments arguments); void glDepthRangef_native(Dart_NativeArguments arguments); void glDetachShader_native(Dart_NativeArguments arguments); void glDisable_native(Dart_NativeArguments arguments); void glDisableVertexAttribArray_native(Dart_NativeArguments arguments); void glDrawArrays_native(Dart_NativeArguments arguments); void glDrawElements_native(Dart_NativeArguments arguments); void glEnable_native(Dart_NativeArguments arguments); void glEnableVertexAttribArray_native(Dart_NativeArguments arguments); void glFinish_native(Dart_NativeArguments arguments); void glFlush_native(Dart_NativeArguments arguments); void glFramebufferRenderbuffer_native(Dart_NativeArguments arguments); void glFramebufferTexture2D_native(Dart_NativeArguments arguments); void glFrontFace_native(Dart_NativeArguments arguments); void glGenBuffers_native(Dart_NativeArguments arguments); void glGenerateMipmap_native(Dart_NativeArguments arguments); void glGenFramebuffers_native(Dart_NativeArguments arguments); void glGenRenderbuffers_native(Dart_NativeArguments arguments); void glGenTextures_native(Dart_NativeArguments arguments); void glGetAttribLocation_native(Dart_NativeArguments arguments); void glGetError_native(Dart_NativeArguments arguments); void glGetString_native(Dart_NativeArguments arguments); void glGetUniformLocation_native(Dart_NativeArguments arguments); void glHint_native(Dart_NativeArguments arguments); void glIsBuffer_native(Dart_NativeArguments arguments); void glIsEnabled_native(Dart_NativeArguments arguments); void glIsFramebuffer_native(Dart_NativeArguments arguments); void glIsProgram_native(Dart_NativeArguments arguments); void glIsRenderbuffer_native(Dart_NativeArguments arguments); void glIsShader_native(Dart_NativeArguments arguments); void glIsTexture_native(Dart_NativeArguments arguments); void glLineWidth_native(Dart_NativeArguments arguments); void glLinkProgram_native(Dart_NativeArguments arguments); void glPixelStorei_native(Dart_NativeArguments arguments); void glPolygonOffset_native(Dart_NativeArguments arguments); void glReleaseShaderCompiler_native(Dart_NativeArguments arguments); void glRenderbufferStorage_native(Dart_NativeArguments arguments); void glSampleCoverage_native(Dart_NativeArguments arguments); void glScissor_native(Dart_NativeArguments arguments); void glStencilFunc_native(Dart_NativeArguments arguments); void glStencilFuncSeparate_native(Dart_NativeArguments arguments); void glStencilMask_native(Dart_NativeArguments arguments); void glStencilMaskSeparate_native(Dart_NativeArguments arguments); void glStencilOp_native(Dart_NativeArguments arguments); void glStencilOpSeparate_native(Dart_NativeArguments arguments); void glTexImage2D_native(Dart_NativeArguments arguments); void glTexParameterf_native(Dart_NativeArguments arguments); void glTexParameteri_native(Dart_NativeArguments arguments); void glTexSubImage2D_native(Dart_NativeArguments arguments); void glUniform1f_native(Dart_NativeArguments arguments); void glUniform1fv_native(Dart_NativeArguments arguments); void glUniform1i_native(Dart_NativeArguments arguments); void glUniform1iv_native(Dart_NativeArguments arguments); void glUniform2f_native(Dart_NativeArguments arguments); void glUniform2fv_native(Dart_NativeArguments arguments); void glUniform2i_native(Dart_NativeArguments arguments); void glUniform2iv_native(Dart_NativeArguments arguments); void glUniform3f_native(Dart_NativeArguments arguments); void glUniform3fv_native(Dart_NativeArguments arguments); void glUniform3i_native(Dart_NativeArguments arguments); void glUniform3iv_native(Dart_NativeArguments arguments); void glUniform4f_native(Dart_NativeArguments arguments); void glUniform4fv_native(Dart_NativeArguments arguments); void glUniform4i_native(Dart_NativeArguments arguments); void glUniform4iv_native(Dart_NativeArguments arguments); void glUniformMatrix2fv_native(Dart_NativeArguments arguments); void glUniformMatrix3fv_native(Dart_NativeArguments arguments); void glUniformMatrix4fv_native(Dart_NativeArguments arguments); void glUseProgram_native(Dart_NativeArguments arguments); void glValidateProgram_native(Dart_NativeArguments arguments); void glVertexAttrib1f_native(Dart_NativeArguments arguments); void glVertexAttrib1fv_native(Dart_NativeArguments arguments); void glVertexAttrib2f_native(Dart_NativeArguments arguments); void glVertexAttrib2fv_native(Dart_NativeArguments arguments); void glVertexAttrib3f_native(Dart_NativeArguments arguments); void glVertexAttrib3fv_native(Dart_NativeArguments arguments); void glVertexAttrib4f_native(Dart_NativeArguments arguments); void glVertexAttrib4fv_native(Dart_NativeArguments arguments); void glViewport_native(Dart_NativeArguments arguments); void glBlendBarrierKHR_native(Dart_NativeArguments arguments); void glDebugMessageInsertKHR_native(Dart_NativeArguments arguments); void glPushDebugGroupKHR_native(Dart_NativeArguments arguments); void glPopDebugGroupKHR_native(Dart_NativeArguments arguments); void glObjectLabelKHR_native(Dart_NativeArguments arguments); void glObjectPtrLabelKHR_native(Dart_NativeArguments arguments); void glGetGraphicsResetStatusKHR_native(Dart_NativeArguments arguments); void glCopyImageSubDataOES_native(Dart_NativeArguments arguments); void glEnableiOES_native(Dart_NativeArguments arguments); void glDisableiOES_native(Dart_NativeArguments arguments); void glBlendEquationiOES_native(Dart_NativeArguments arguments); void glBlendEquationSeparateiOES_native(Dart_NativeArguments arguments); void glBlendFunciOES_native(Dart_NativeArguments arguments); void glBlendFuncSeparateiOES_native(Dart_NativeArguments arguments); void glColorMaskiOES_native(Dart_NativeArguments arguments); void glIsEnablediOES_native(Dart_NativeArguments arguments); void glDrawElementsBaseVertexOES_native(Dart_NativeArguments arguments); void glDrawRangeElementsBaseVertexOES_native(Dart_NativeArguments arguments); void glDrawElementsInstancedBaseVertexOES_native( Dart_NativeArguments arguments); void glFramebufferTextureOES_native(Dart_NativeArguments arguments); void glProgramBinaryOES_native(Dart_NativeArguments arguments); void glUnmapBufferOES_native(Dart_NativeArguments arguments); void glPrimitiveBoundingBoxOES_native(Dart_NativeArguments arguments); void glMinSampleShadingOES_native(Dart_NativeArguments arguments); void glPatchParameteriOES_native(Dart_NativeArguments arguments); void glTexImage3DOES_native(Dart_NativeArguments arguments); void glTexSubImage3DOES_native(Dart_NativeArguments arguments); void glCopyTexSubImage3DOES_native(Dart_NativeArguments arguments); void glCompressedTexImage3DOES_native(Dart_NativeArguments arguments); void glCompressedTexSubImage3DOES_native(Dart_NativeArguments arguments); void glFramebufferTexture3DOES_native(Dart_NativeArguments arguments); void glTexBufferOES_native(Dart_NativeArguments arguments); void glTexBufferRangeOES_native(Dart_NativeArguments arguments); void glTexStorage3DMultisampleOES_native(Dart_NativeArguments arguments); void glTextureViewOES_native(Dart_NativeArguments arguments); void glBindVertexArrayOES_native(Dart_NativeArguments arguments); void glDeleteVertexArraysOES_native(Dart_NativeArguments arguments); void glGenVertexArraysOES_native(Dart_NativeArguments arguments); void glIsVertexArrayOES_native(Dart_NativeArguments arguments); void glViewportArrayvOES_native(Dart_NativeArguments arguments); void glViewportIndexedfOES_native(Dart_NativeArguments arguments); void glViewportIndexedfvOES_native(Dart_NativeArguments arguments); void glScissorArrayvOES_native(Dart_NativeArguments arguments); void glScissorIndexedOES_native(Dart_NativeArguments arguments); void glScissorIndexedvOES_native(Dart_NativeArguments arguments); void glDepthRangeArrayfvOES_native(Dart_NativeArguments arguments); void glDepthRangeIndexedfOES_native(Dart_NativeArguments arguments); void glGenPerfMonitorsAMD_native(Dart_NativeArguments arguments); void glDeletePerfMonitorsAMD_native(Dart_NativeArguments arguments); void glBeginPerfMonitorAMD_native(Dart_NativeArguments arguments); void glEndPerfMonitorAMD_native(Dart_NativeArguments arguments); void glBlitFramebufferANGLE_native(Dart_NativeArguments arguments); void glRenderbufferStorageMultisampleANGLE_native( Dart_NativeArguments arguments); void glDrawArraysInstancedANGLE_native(Dart_NativeArguments arguments); void glDrawElementsInstancedANGLE_native(Dart_NativeArguments arguments); void glVertexAttribDivisorANGLE_native(Dart_NativeArguments arguments); void glCopyTextureLevelsAPPLE_native(Dart_NativeArguments arguments); void glRenderbufferStorageMultisampleAPPLE_native( Dart_NativeArguments arguments); void glResolveMultisampleFramebufferAPPLE_native( Dart_NativeArguments arguments); void glDrawArraysInstancedBaseInstanceEXT_native( Dart_NativeArguments arguments); void glDrawElementsInstancedBaseInstanceEXT_native( Dart_NativeArguments arguments); void glDrawElementsInstancedBaseVertexBaseInstanceEXT_native( Dart_NativeArguments arguments); void glBindFragDataLocationIndexedEXT_native(Dart_NativeArguments arguments); void glBindFragDataLocationEXT_native(Dart_NativeArguments arguments); void glGetProgramResourceLocationIndexEXT_native( Dart_NativeArguments arguments); void glGetFragDataIndexEXT_native(Dart_NativeArguments arguments); void glBufferStorageEXT_native(Dart_NativeArguments arguments); void glClearTexImageEXT_native(Dart_NativeArguments arguments); void glClearTexSubImageEXT_native(Dart_NativeArguments arguments); void glCopyImageSubDataEXT_native(Dart_NativeArguments arguments); void glLabelObjectEXT_native(Dart_NativeArguments arguments); void glInsertEventMarkerEXT_native(Dart_NativeArguments arguments); void glPushGroupMarkerEXT_native(Dart_NativeArguments arguments); void glPopGroupMarkerEXT_native(Dart_NativeArguments arguments); void glGenQueriesEXT_native(Dart_NativeArguments arguments); void glDeleteQueriesEXT_native(Dart_NativeArguments arguments); void glIsQueryEXT_native(Dart_NativeArguments arguments); void glBeginQueryEXT_native(Dart_NativeArguments arguments); void glEndQueryEXT_native(Dart_NativeArguments arguments); void glQueryCounterEXT_native(Dart_NativeArguments arguments); void glEnableiEXT_native(Dart_NativeArguments arguments); void glDisableiEXT_native(Dart_NativeArguments arguments); void glBlendEquationiEXT_native(Dart_NativeArguments arguments); void glBlendEquationSeparateiEXT_native(Dart_NativeArguments arguments); void glBlendFunciEXT_native(Dart_NativeArguments arguments); void glBlendFuncSeparateiEXT_native(Dart_NativeArguments arguments); void glColorMaskiEXT_native(Dart_NativeArguments arguments); void glIsEnablediEXT_native(Dart_NativeArguments arguments); void glDrawElementsBaseVertexEXT_native(Dart_NativeArguments arguments); void glDrawRangeElementsBaseVertexEXT_native(Dart_NativeArguments arguments); void glDrawElementsInstancedBaseVertexEXT_native( Dart_NativeArguments arguments); void glDrawArraysInstancedEXT_native(Dart_NativeArguments arguments); void glDrawElementsInstancedEXT_native(Dart_NativeArguments arguments); void glDrawTransformFeedbackEXT_native(Dart_NativeArguments arguments); void glDrawTransformFeedbackInstancedEXT_native(Dart_NativeArguments arguments); void glFramebufferTextureEXT_native(Dart_NativeArguments arguments); void glVertexAttribDivisorEXT_native(Dart_NativeArguments arguments); void glFlushMappedBufferRangeEXT_native(Dart_NativeArguments arguments); void glDeleteMemoryObjectsEXT_native(Dart_NativeArguments arguments); void glIsMemoryObjectEXT_native(Dart_NativeArguments arguments); void glMultiDrawArraysIndirectEXT_native(Dart_NativeArguments arguments); void glMultiDrawElementsIndirectEXT_native(Dart_NativeArguments arguments); void glRenderbufferStorageMultisampleEXT_native(Dart_NativeArguments arguments); void glFramebufferTexture2DMultisampleEXT_native( Dart_NativeArguments arguments); void glReadBufferIndexedEXT_native(Dart_NativeArguments arguments); void glPolygonOffsetClampEXT_native(Dart_NativeArguments arguments); void glPrimitiveBoundingBoxEXT_native(Dart_NativeArguments arguments); void glRasterSamplesEXT_native(Dart_NativeArguments arguments); void glGetGraphicsResetStatusEXT_native(Dart_NativeArguments arguments); void glGenSemaphoresEXT_native(Dart_NativeArguments arguments); void glDeleteSemaphoresEXT_native(Dart_NativeArguments arguments); void glIsSemaphoreEXT_native(Dart_NativeArguments arguments); void glImportSemaphoreFdEXT_native(Dart_NativeArguments arguments); void glImportSemaphoreWin32NameEXT_native(Dart_NativeArguments arguments); void glActiveShaderProgramEXT_native(Dart_NativeArguments arguments); void glBindProgramPipelineEXT_native(Dart_NativeArguments arguments); void glDeleteProgramPipelinesEXT_native(Dart_NativeArguments arguments); void glGenProgramPipelinesEXT_native(Dart_NativeArguments arguments); void glIsProgramPipelineEXT_native(Dart_NativeArguments arguments); void glProgramParameteriEXT_native(Dart_NativeArguments arguments); void glProgramUniform1fEXT_native(Dart_NativeArguments arguments); void glProgramUniform1fvEXT_native(Dart_NativeArguments arguments); void glProgramUniform1iEXT_native(Dart_NativeArguments arguments); void glProgramUniform1ivEXT_native(Dart_NativeArguments arguments); void glProgramUniform2fEXT_native(Dart_NativeArguments arguments); void glProgramUniform2fvEXT_native(Dart_NativeArguments arguments); void glProgramUniform2iEXT_native(Dart_NativeArguments arguments); void glProgramUniform2ivEXT_native(Dart_NativeArguments arguments); void glProgramUniform3fEXT_native(Dart_NativeArguments arguments); void glProgramUniform3fvEXT_native(Dart_NativeArguments arguments); void glProgramUniform3iEXT_native(Dart_NativeArguments arguments); void glProgramUniform3ivEXT_native(Dart_NativeArguments arguments); void glProgramUniform4fEXT_native(Dart_NativeArguments arguments); void glProgramUniform4fvEXT_native(Dart_NativeArguments arguments); void glProgramUniform4iEXT_native(Dart_NativeArguments arguments); void glProgramUniform4ivEXT_native(Dart_NativeArguments arguments); void glProgramUniformMatrix2fvEXT_native(Dart_NativeArguments arguments); void glProgramUniformMatrix3fvEXT_native(Dart_NativeArguments arguments); void glProgramUniformMatrix4fvEXT_native(Dart_NativeArguments arguments); void glUseProgramStagesEXT_native(Dart_NativeArguments arguments); void glValidateProgramPipelineEXT_native(Dart_NativeArguments arguments); void glProgramUniform1uiEXT_native(Dart_NativeArguments arguments); void glProgramUniform2uiEXT_native(Dart_NativeArguments arguments); void glProgramUniform3uiEXT_native(Dart_NativeArguments arguments); void glProgramUniform4uiEXT_native(Dart_NativeArguments arguments); void glProgramUniformMatrix2x3fvEXT_native(Dart_NativeArguments arguments); void glProgramUniformMatrix3x2fvEXT_native(Dart_NativeArguments arguments); void glProgramUniformMatrix2x4fvEXT_native(Dart_NativeArguments arguments); void glProgramUniformMatrix4x2fvEXT_native(Dart_NativeArguments arguments); void glProgramUniformMatrix3x4fvEXT_native(Dart_NativeArguments arguments); void glProgramUniformMatrix4x3fvEXT_native(Dart_NativeArguments arguments); void glFramebufferPixelLocalStorageSizeEXT_native( Dart_NativeArguments arguments); void glGetFramebufferPixelLocalStorageSizeEXT_native( Dart_NativeArguments arguments); void glTexPageCommitmentEXT_native(Dart_NativeArguments arguments); void glPatchParameteriEXT_native(Dart_NativeArguments arguments); void glTexBufferEXT_native(Dart_NativeArguments arguments); void glTexBufferRangeEXT_native(Dart_NativeArguments arguments); void glTexStorage1DEXT_native(Dart_NativeArguments arguments); void glTexStorage2DEXT_native(Dart_NativeArguments arguments); void glTexStorage3DEXT_native(Dart_NativeArguments arguments); void glTextureStorage1DEXT_native(Dart_NativeArguments arguments); void glTextureStorage2DEXT_native(Dart_NativeArguments arguments); void glTextureStorage3DEXT_native(Dart_NativeArguments arguments); void glTextureViewEXT_native(Dart_NativeArguments arguments); void glFramebufferTexture2DDownsampleIMG_native(Dart_NativeArguments arguments); void glFramebufferTextureLayerDownsampleIMG_native( Dart_NativeArguments arguments); void glRenderbufferStorageMultisampleIMG_native(Dart_NativeArguments arguments); void glFramebufferTexture2DMultisampleIMG_native( Dart_NativeArguments arguments); void glApplyFramebufferAttachmentCMAAINTEL_native( Dart_NativeArguments arguments); void glBeginPerfQueryINTEL_native(Dart_NativeArguments arguments); void glDeletePerfQueryINTEL_native(Dart_NativeArguments arguments); void glEndPerfQueryINTEL_native(Dart_NativeArguments arguments); void glBlendParameteriNV_native(Dart_NativeArguments arguments); void glBlendBarrierNV_native(Dart_NativeArguments arguments); void glBeginConditionalRenderNV_native(Dart_NativeArguments arguments); void glEndConditionalRenderNV_native(Dart_NativeArguments arguments); void glSubpixelPrecisionBiasNV_native(Dart_NativeArguments arguments); void glConservativeRasterParameteriNV_native(Dart_NativeArguments arguments); void glCopyBufferSubDataNV_native(Dart_NativeArguments arguments); void glCoverageMaskNV_native(Dart_NativeArguments arguments); void glCoverageOperationNV_native(Dart_NativeArguments arguments); void glDrawArraysInstancedNV_native(Dart_NativeArguments arguments); void glDrawElementsInstancedNV_native(Dart_NativeArguments arguments); void glDeleteFencesNV_native(Dart_NativeArguments arguments); void glGenFencesNV_native(Dart_NativeArguments arguments); void glIsFenceNV_native(Dart_NativeArguments arguments); void glTestFenceNV_native(Dart_NativeArguments arguments); void glFinishFenceNV_native(Dart_NativeArguments arguments); void glSetFenceNV_native(Dart_NativeArguments arguments); void glFragmentCoverageColorNV_native(Dart_NativeArguments arguments); void glBlitFramebufferNV_native(Dart_NativeArguments arguments); void glCoverageModulationTableNV_native(Dart_NativeArguments arguments); void glCoverageModulationNV_native(Dart_NativeArguments arguments); void glRenderbufferStorageMultisampleNV_native(Dart_NativeArguments arguments); void glVertexAttribDivisorNV_native(Dart_NativeArguments arguments); void glUniformMatrix2x3fvNV_native(Dart_NativeArguments arguments); void glUniformMatrix3x2fvNV_native(Dart_NativeArguments arguments); void glUniformMatrix2x4fvNV_native(Dart_NativeArguments arguments); void glUniformMatrix4x2fvNV_native(Dart_NativeArguments arguments); void glUniformMatrix3x4fvNV_native(Dart_NativeArguments arguments); void glUniformMatrix4x3fvNV_native(Dart_NativeArguments arguments); void glGenPathsNV_native(Dart_NativeArguments arguments); void glDeletePathsNV_native(Dart_NativeArguments arguments); void glIsPathNV_native(Dart_NativeArguments arguments); void glPathCoordsNV_native(Dart_NativeArguments arguments); void glPathSubCommandsNV_native(Dart_NativeArguments arguments); void glPathSubCoordsNV_native(Dart_NativeArguments arguments); void glPathStringNV_native(Dart_NativeArguments arguments); void glPathGlyphsNV_native(Dart_NativeArguments arguments); void glPathGlyphRangeNV_native(Dart_NativeArguments arguments); void glCopyPathNV_native(Dart_NativeArguments arguments); void glInterpolatePathsNV_native(Dart_NativeArguments arguments); void glPathParameterivNV_native(Dart_NativeArguments arguments); void glPathParameteriNV_native(Dart_NativeArguments arguments); void glPathParameterfvNV_native(Dart_NativeArguments arguments); void glPathParameterfNV_native(Dart_NativeArguments arguments); void glPathStencilFuncNV_native(Dart_NativeArguments arguments); void glPathStencilDepthOffsetNV_native(Dart_NativeArguments arguments); void glStencilFillPathNV_native(Dart_NativeArguments arguments); void glStencilStrokePathNV_native(Dart_NativeArguments arguments); void glPathCoverDepthFuncNV_native(Dart_NativeArguments arguments); void glCoverFillPathNV_native(Dart_NativeArguments arguments); void glCoverStrokePathNV_native(Dart_NativeArguments arguments); void glIsPointInFillPathNV_native(Dart_NativeArguments arguments); void glIsPointInStrokePathNV_native(Dart_NativeArguments arguments); void glGetPathLengthNV_native(Dart_NativeArguments arguments); void glStencilThenCoverFillPathNV_native(Dart_NativeArguments arguments); void glStencilThenCoverStrokePathNV_native(Dart_NativeArguments arguments); void glPathGlyphIndexArrayNV_native(Dart_NativeArguments arguments); void glPathMemoryGlyphIndexArrayNV_native(Dart_NativeArguments arguments); void glPolygonModeNV_native(Dart_NativeArguments arguments); void glReadBufferNV_native(Dart_NativeArguments arguments); void glFramebufferSampleLocationsfvNV_native(Dart_NativeArguments arguments); void glNamedFramebufferSampleLocationsfvNV_native( Dart_NativeArguments arguments); void glResolveDepthValuesNV_native(Dart_NativeArguments arguments); void glViewportArrayvNV_native(Dart_NativeArguments arguments); void glViewportIndexedfNV_native(Dart_NativeArguments arguments); void glViewportIndexedfvNV_native(Dart_NativeArguments arguments); void glScissorArrayvNV_native(Dart_NativeArguments arguments); void glScissorIndexedNV_native(Dart_NativeArguments arguments); void glScissorIndexedvNV_native(Dart_NativeArguments arguments); void glDepthRangeArrayfvNV_native(Dart_NativeArguments arguments); void glDepthRangeIndexedfNV_native(Dart_NativeArguments arguments); void glEnableiNV_native(Dart_NativeArguments arguments); void glDisableiNV_native(Dart_NativeArguments arguments); void glIsEnablediNV_native(Dart_NativeArguments arguments); void glViewportSwizzleNV_native(Dart_NativeArguments arguments); void glFramebufferTextureMultiviewOVR_native(Dart_NativeArguments arguments); void glFramebufferTextureMultisampleMultiviewOVR_native( Dart_NativeArguments arguments); void glAlphaFuncQCOM_native(Dart_NativeArguments arguments); void glEnableDriverControlQCOM_native(Dart_NativeArguments arguments); void glDisableDriverControlQCOM_native(Dart_NativeArguments arguments); void glExtTexObjectStateOverrideiQCOM_native(Dart_NativeArguments arguments); void glExtIsProgramBinaryQCOM_native(Dart_NativeArguments arguments); void glFramebufferFoveationParametersQCOM_native( Dart_NativeArguments arguments); void glFramebufferFetchBarrierQCOM_native(Dart_NativeArguments arguments); void glStartTilingQCOM_native(Dart_NativeArguments arguments); void glEndTilingQCOM_native(Dart_NativeArguments arguments); #endif // DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_
<reponame>sander-adhese/prebid-server-java<filename>src/main/java/org/prebid/server/settings/CachingApplicationSettings.java package org.prebid.server.settings; import io.vertx.core.Future; import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; import org.apache.commons.lang3.StringUtils; import org.prebid.server.exception.PreBidException; import org.prebid.server.execution.Timeout; import org.prebid.server.settings.helper.StoredDataFetcher; import org.prebid.server.settings.helper.StoredItemResolver; import org.prebid.server.settings.model.Account; import org.prebid.server.settings.model.StoredDataResult; import org.prebid.server.settings.model.StoredItem; import org.prebid.server.settings.model.StoredResponseDataResult; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.function.BiFunction; /** * Adds caching functionality for {@link ApplicationSettings} implementation. */ public class CachingApplicationSettings implements ApplicationSettings { private static final Logger logger = LoggerFactory.getLogger(CachingApplicationSettings.class); private final ApplicationSettings delegate; private final Map<String, Account> accountCache; private final Map<String, String> accountToErrorCache; private final Map<String, String> adUnitConfigCache; private final SettingsCache cache; private final SettingsCache ampCache; private final SettingsCache videoCache; public CachingApplicationSettings(ApplicationSettings delegate, SettingsCache cache, SettingsCache ampCache, SettingsCache videoCache, int ttl, int size) { if (ttl <= 0 || size <= 0) { throw new IllegalArgumentException("ttl and size must be positive"); } this.delegate = Objects.requireNonNull(delegate); this.accountCache = SettingsCache.createCache(ttl, size); this.accountToErrorCache = SettingsCache.createCache(ttl, size); this.adUnitConfigCache = SettingsCache.createCache(ttl, size); this.cache = Objects.requireNonNull(cache); this.ampCache = Objects.requireNonNull(ampCache); this.videoCache = Objects.requireNonNull(videoCache); } /** * Retrieves account from cache or delegates it to original fetcher. */ @Override public Future<Account> getAccountById(String accountId, Timeout timeout) { return getFromCacheOrDelegate(accountCache, accountToErrorCache, accountId, timeout, delegate::getAccountById); } /** * Retrieves adUnit config from cache or delegates it to original fetcher. */ @Override public Future<String> getAdUnitConfigById(String adUnitConfigId, Timeout timeout) { return getFromCacheOrDelegate(adUnitConfigCache, accountToErrorCache, adUnitConfigId, timeout, delegate::getAdUnitConfigById); } /** * Retrieves stored data from cache or delegates it to original fetcher. */ @Override public Future<StoredDataResult> getStoredData(String accountId, Set<String> requestIds, Set<String> impIds, Timeout timeout) { return getFromCacheOrDelegate(cache, accountId, requestIds, impIds, timeout, delegate::getStoredData); } /** * Retrieves amp stored data from cache or delegates it to original fetcher. */ @Override public Future<StoredDataResult> getAmpStoredData(String accountId, Set<String> requestIds, Set<String> impIds, Timeout timeout) { return getFromCacheOrDelegate(ampCache, accountId, requestIds, impIds, timeout, delegate::getAmpStoredData); } @Override public Future<StoredDataResult> getVideoStoredData(String accountId, Set<String> requestIds, Set<String> impIds, Timeout timeout) { return getFromCacheOrDelegate(videoCache, accountId, requestIds, impIds, timeout, delegate::getVideoStoredData); } /** * Delegates stored response retrieve to original fetcher, as caching is not supported fot stored response. */ @Override public Future<StoredResponseDataResult> getStoredResponses(Set<String> responseIds, Timeout timeout) { return delegate.getStoredResponses(responseIds, timeout); } private static <T> Future<T> getFromCacheOrDelegate(Map<String, T> cache, Map<String, String> accountToErrorCache, String key, Timeout timeout, BiFunction<String, Timeout, Future<T>> retriever) { final T cachedValue = cache.get(key); if (cachedValue != null) { return Future.succeededFuture(cachedValue); } final String preBidExceptionMessage = accountToErrorCache.get(key); if (preBidExceptionMessage != null) { return Future.failedFuture(new PreBidException(preBidExceptionMessage)); } return retriever.apply(key, timeout) .map(value -> { cache.put(key, value); return value; }) .recover(throwable -> cacheAndReturnFailedFuture(throwable, key, accountToErrorCache)); } /** * Retrieves stored data from cache and collects ids which were absent. For absent ids makes look up to original * source, combines results and updates cache with missed stored item. In case when origin source returns failed * {@link Future} propagates its result to caller. In successive call return {@link Future&lt;StoredDataResult&gt;} * with all found stored items and error from origin source id call was made. */ private static Future<StoredDataResult> getFromCacheOrDelegate( SettingsCache cache, String accountId, Set<String> requestIds, Set<String> impIds, Timeout timeout, StoredDataFetcher<String, Set<String>, Set<String>, Timeout, Future<StoredDataResult>> retriever) { // empty string account ID doesn't make sense final String normalizedAccountId = StringUtils.stripToNull(accountId); // search in cache final Map<String, Set<StoredItem>> requestCache = cache.getRequestCache(); final Map<String, Set<StoredItem>> impCache = cache.getImpCache(); final Set<String> missedRequestIds = new HashSet<>(); final Map<String, String> storedIdToRequest = getFromCacheOrAddMissedIds(normalizedAccountId, requestIds, requestCache, missedRequestIds); final Set<String> missedImpIds = new HashSet<>(); final Map<String, String> storedIdToImp = getFromCacheOrAddMissedIds(normalizedAccountId, impIds, impCache, missedImpIds); if (missedRequestIds.isEmpty() && missedImpIds.isEmpty()) { return Future.succeededFuture( StoredDataResult.of(storedIdToRequest, storedIdToImp, Collections.emptyList())); } // delegate call to original source for missed ids and update cache with it return retriever.apply(normalizedAccountId, missedRequestIds, missedImpIds, timeout).map(result -> { final Map<String, String> storedIdToRequestFromDelegate = result.getStoredIdToRequest(); storedIdToRequest.putAll(storedIdToRequestFromDelegate); for (Map.Entry<String, String> entry : storedIdToRequestFromDelegate.entrySet()) { cache.saveRequestCache(normalizedAccountId, entry.getKey(), entry.getValue()); } final Map<String, String> storedIdToImpFromDelegate = result.getStoredIdToImp(); storedIdToImp.putAll(storedIdToImpFromDelegate); for (Map.Entry<String, String> entry : storedIdToImpFromDelegate.entrySet()) { cache.saveImpCache(normalizedAccountId, entry.getKey(), entry.getValue()); } return StoredDataResult.of(storedIdToRequest, storedIdToImp, result.getErrors()); }); } private static <T> Future<T> cacheAndReturnFailedFuture(Throwable throwable, String key, Map<String, String> cache) { if (throwable instanceof PreBidException) { cache.put(key, throwable.getMessage()); } return Future.failedFuture(throwable); } private static Map<String, String> getFromCacheOrAddMissedIds(String accountId, Set<String> ids, Map<String, Set<StoredItem>> cache, Set<String> missedIds) { final Map<String, String> idToStoredItem = new HashMap<>(ids.size()); for (String id : ids) { try { final StoredItem resolvedStoredItem = StoredItemResolver.resolve(null, accountId, id, cache.get(id)); idToStoredItem.put(id, resolvedStoredItem.getData()); } catch (PreBidException e) { missedIds.add(id); } } return idToStoredItem; } public void invalidateAccountCache(String accountId) { accountCache.remove(accountId); logger.debug("Account with id {0} was invalidated", accountId); } }
<reponame>brunofurquimc/back<filename>models/payment_method.js const { Schema } = require('mongoose'); var { mongoose } = require('../database/db'); /** * Modelo de método de pagamento */ const PaymentMethod = mongoose.model('PaymentMethod', Schema({ _id: Schema.Types.ObjectId, name: String, }, { collection: 'payment_methods' })) module.exports = PaymentMethod;
AUTHOR='@xer0dayz' VULN_NAME='Directory Listing Enabled' URI='/' METHOD='GET' MATCH="<title>Index\ of|To\ Parent\ Directory" SEVERITY='P4 - LOW' CURL_OPTS="--user-agent '' -s -L --insecure" SECONDARY_COMMANDS='' GREP_OPTIONS='-i'
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(os.path.realpath(__file__))), '..'))) from h4l_minitree_reader.sample import Sample from h4l_minitree_reader.sample import Category from h4l_minitree_reader import helper from collections import namedtuple Option = namedtuple("Option", 'wName lumi poi') import ROOT gg_zz = Sample('ggZZ') mc_dir = "/afs/cern.ch/atlas/groups/HSG2/H4l/run2/2016/MiniTrees/Prod_v12/mc/Nominal/" gg_zz.file_list.append(mc_dir + 'mc15_13TeV.361073.Sherpa_CT10_ggllll.root') gg_zz.sys_dic = helper.get_sys('.', 'norm_ggllll.txt') options = Option(wName="weight", lumi=36.1, poi="m4l_constrained_HM") mass_cut = "pass_vtx4lCut==1 && 200 < "+options.poi+"&&"+options.poi+"< 1500 && " category = Category(name="2mu2e", cut=mass_cut+"event_type==2") gg_zz.get_yield(category, options) print gg_zz.yields[category.name]
package com.ride.myride.firebase; public class UserReview { private String userName; private Boolean verification; private String reviewText; private float userReviewInFloat; private RideTime time; public UserReview(){} public UserReview(String userName, Boolean verification, String reviewText, float userReviewInFloat,RideTime time) { this.userName = userName; this.verification = verification; this.reviewText = reviewText; this.userReviewInFloat = userReviewInFloat; this.time= time; } public float getUserReviewInFloat() { return userReviewInFloat; } public void setUserReviewInFloat(float userReviewInFloat) { this.userReviewInFloat = userReviewInFloat; } public String getReviewText() { return reviewText; } public void setReviewText(String reviewText) { this.reviewText = reviewText; } public Boolean getVerification() { return verification; } public void setVerification(Boolean verification) { this.verification = verification; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public RideTime getTime() { return time; } public void setTime(RideTime time) { this.time = time; } }
#!/bin/bash # Check for dependencies read -d '' DEPS <<EOT bc gperf bison flex texi2html texinfo help2man gawk libtool libtool-bin build-essential automake libncurses5-dev libglib2.0-dev device-tree-compiler qemu-user-static binfmt-support multistrap git lib32z1 lib32ncurses5 libbz2-1.0 lib32stdc++6 libssl-dev kpartx zerofree u-boot-tools rpm2cpio libsdl1.2-dev rsync python3-pip gcc-multilib libidn11 curl EOT read -d '' PYTHON_DEPS <<EOT numpy cffi EOT if [ $(lsb_release -rs) == "16.04" ]||[ $(lsb_release -rs) == "18.04" ]; then echo "Pass: Current OS is supported." else echo "Error: Please use Ubuntu 16.04 or Ubuntu 18.04." exit 1 fi if [ "$EUID" -eq 0 ] ; then echo "Error: Please do not run as root." exit 1 fi if [ ! -f /run/systemd/resolve/stub-resolv.conf ]; then sudo mkdir -p /run/systemd/resolve sudo cp -L /etc/resolv.conf /run/systemd/resolve/stub-resolv.conf fi echo "Checking system for installed $DEPS" failed=false for i in $DEPS ; do dpkg-query -W -f='${Package}\n' | grep ^$i$ > /dev/null if [ $? != 0 ] ; then echo "Error: Package not found -" $i failed=true fi done for i in $PYTHON_DEPS ; do found=$(sudo -H pip3 freeze | grep $i) if [ -z $found ]; then echo "Error: Package not found -" $i failed=true fi done if [ "$failed" = true ] ; then echo "Run setup_host.sh" exit 1 fi if [ $(cat /proc/sys/fs/inotify/max_user_watches) -lt 524288 ]; then sudo sysctl -n -w fs.inotify.max_user_watches=524288 echo "Set inotify max_user_watches to 524288" fi
<reponame>PanRagon/HS-Pack-Simulator<filename>src/server/routes/collection-api.js const express = require("express"); const Collection = require("../db/collection"); const Users = require("../db/users"); const Cards = require("../db/cards/cards"); const router = express.Router(); router.get("/collection/:id", function (req, res) { if(!req.user) { res.status(401).json( "401: Unauthenticated - Please log in" ); return; } if(req.user.id !== req.params["id"]) { res.status(403).json( "403: Forbidden" ) } const cards = Collection.getUserCards(req.user.id); if(!cards) { res.status(404).send(); } res.status(200).json(cards); }); router.delete("/collection/:id/mill", function (req, res) { if(!req.user) { res.status(401).json( "401: Unauthenticated - Please log in" ) } if(req.user.id !== req.params["id"]) { res.status(403).json( "403: Forbidden" ) } const milled = Collection.millCard(req.params["id"], req.body.cardId); if(!milled) { res.status(404).send(); } res.status(200).send(); }); router.post("/collection/:id/buy", function (req, res) { if(!req.user) { res.status(401).json( "401: Unauthenticatd - Please log in" ) } if(req.user.id !== req.params["id"]) { res.status(403).json( "403: Forbidden" ); } const bought = Collection.buyCard(req.params["id"], req.body.cardId); if(!bought) { res.status(404).send(); } res.status(201).send(); }); module.exports = router;
#!/bin/sh set -e set -u set -o pipefail function on_error { echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" } trap 'on_error $LINENO' ERR 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_PATH}" mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" # Used as a return value for each invocation of `strip_invalid_archs` function. STRIP_BINARY_RETVAL=0 # This protects against multiple targets copying the same framework dependency at the same time. The solution # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") # Copies and strips a vendored framework install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then local source="${BUILT_PRODUCTS_DIR}/$1" elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" elif [ -r "$1" ]; then local source="$1" fi local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" if [ -L "${source}" ]; then echo "Symlinked..." source="$(readlink "${source}")" fi # Use filter instead of exclude so missing patterns don't throw errors. echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" binary="${destination}/${basename}.framework/${basename}" if ! [ -r "$binary" ]; then binary="${destination}/${basename}" elif [ -L "${binary}" ]; then echo "Destination binary is symlinked..." dirname="$(dirname "${binary}")" binary="${dirname}/$(readlink "${binary}")" fi # Strip invalid architectures so "fat" simulator / device frameworks work on device if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then strip_invalid_archs "$binary" fi # Resign the code if required by the build settings to avoid unstable apps code_sign_if_enabled "${destination}/$(basename "$1")" # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then local swift_runtime_libs swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) for lib in $swift_runtime_libs; do echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" code_sign_if_enabled "${destination}/${lib}" done fi } # Copies and strips a vendored dSYM install_dsym() { local source="$1" if [ -r "$source" ]; then # Copy the dSYM into a the targets temp dir. echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" local basename basename="$(basename -s .framework.dSYM "$source")" binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" # Strip invalid architectures so "fat" simulator / device frameworks work on device if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then strip_invalid_archs "$binary" fi if [[ $STRIP_BINARY_RETVAL == 1 ]]; then # Move the stripped file into its final destination. echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" else # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" fi fi } # Copies the bcsymbolmap files of a vendored framework install_bcsymbolmap() { local bcsymbolmap_path="$1" local destination="${BUILT_PRODUCTS_DIR}" echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" } # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identity echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then code_sign_cmd="$code_sign_cmd &" fi echo "$code_sign_cmd" eval "$code_sign_cmd" fi } # Strip invalid architectures strip_invalid_archs() { binary="$1" # Get architectures for current target binary binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" # Intersect them with the architectures we are building for intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" # If there are no archs supported by this binary then warn the user if [[ -z "$intersected_archs" ]]; then echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." STRIP_BINARY_RETVAL=0 return fi stripped="" for arch in $binary_archs; do if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" stripped="$stripped $arch" fi done if [[ "$stripped" ]]; then echo "Stripped $binary of architectures:$stripped" fi STRIP_BINARY_RETVAL=1 } if [[ "$CONFIGURATION" == "Debug" ]]; then install_framework "${BUILT_PRODUCTS_DIR}/CalmParametricAnimations/CalmParametricAnimations.framework" install_framework "${BUILT_PRODUCTS_DIR}/Kingfisher/Kingfisher.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then install_framework "${BUILT_PRODUCTS_DIR}/CalmParametricAnimations/CalmParametricAnimations.framework" install_framework "${BUILT_PRODUCTS_DIR}/Kingfisher/Kingfisher.framework" fi if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then wait fi
<filename>src/global_setting.h #ifndef _GLOBAL_SETTING_H_ #define _GLOBAL_SETTING_H_ #include <M5EPD.h> #include <nvs.h> #define WALLPAPER_NUM 3 enum { LANGUAGE_EN = 0, // default, English LANGUAGE_JA, // Japanese LANGUAGE_ZH // Simplified Chinese }; void SetLanguage(uint8_t language); uint8_t GetLanguage(void); void SetWallpaper(uint16_t wallpaper_id); uint16_t GetWallpaperID(void); const uint8_t *GetWallpaper(void); const char *GetWallpaperName(uint16_t wallpaper_id); esp_err_t LoadSetting(void); esp_err_t SaveSetting(void); void SetWifi(String ssid, String password); String GetWifiSSID(void); String GetWifiPassword(void); uint8_t isWiFiConfiged(void); bool SyncNTPTime(void); int8_t GetTimeZone(void); void SetTimeZone(int8_t time_zone); uint16_t GetTextSize(); void SetTextSize(uint16_t size); const uint8_t *GetLoadingIMG_32x32(uint8_t id); void LoadingAnime_32x32_Start(uint16_t x, uint16_t y); void LoadingAnime_32x32_Stop(); uint8_t isTimeSynced(void); void SetTimeSynced(uint8_t val); void SetTTFLoaded(uint8_t val); uint8_t isTTFLoaded(void); void SetInitStatus(uint8_t idx, uint8_t val); uint8_t GetInitStatus(uint8_t idx); #endif //_GLOBAL_SETTING_H_
#!/bin/bash git submodule update --init --recursive exec ./kbash/shell.sh
#!/usr/bin/env sh # generated from catkin/cmake/template/setup.sh.in # Sets various environment variables and sources additional environment hooks. # It tries it's best to undo changes from a previously sourced setup file before. # Supported command line options: # --extend: skips the undoing of changes from a previously sourced setup file # since this file is sourced either use the provided _CATKIN_SETUP_DIR # or fall back to the destination set at configure time : ${_CATKIN_SETUP_DIR:=/catkin_ws/install} _SETUP_UTIL="$_CATKIN_SETUP_DIR/_setup_util.py" unset _CATKIN_SETUP_DIR if [ ! -f "$_SETUP_UTIL" ]; then echo "Missing Python script: $_SETUP_UTIL" return 22 fi # detect if running on Darwin platform _UNAME=`uname -s` _IS_DARWIN=0 if [ "$_UNAME" = "Darwin" ]; then _IS_DARWIN=1 fi unset _UNAME # make sure to export all environment variables export CMAKE_PREFIX_PATH export CPATH if [ $_IS_DARWIN -eq 0 ]; then export LD_LIBRARY_PATH else export DYLD_LIBRARY_PATH fi unset _IS_DARWIN export PATH export PKG_CONFIG_PATH export PYTHONPATH # remember type of shell if not already set if [ -z "$CATKIN_SHELL" ]; then CATKIN_SHELL=sh fi # invoke Python script to generate necessary exports of environment variables # use TMPDIR if it exists, otherwise fall back to /tmp if [ -d "${TMPDIR}" ]; then _TMPDIR="${TMPDIR}" else _TMPDIR=/tmp fi _SETUP_TMP=`mktemp "${_TMPDIR}/setup.sh.XXXXXXXXXX"` unset _TMPDIR if [ $? -ne 0 -o ! -f "$_SETUP_TMP" ]; then echo "Could not create temporary file: $_SETUP_TMP" return 1 fi CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ >> "$_SETUP_TMP" _RC=$? if [ $_RC -ne 0 ]; then if [ $_RC -eq 2 ]; then echo "Could not write the output of '$_SETUP_UTIL' to temporary file '$_SETUP_TMP': may be the disk if full?" else echo "Failed to run '\"$_SETUP_UTIL\" $@': return code $_RC" fi unset _RC unset _SETUP_UTIL rm -f "$_SETUP_TMP" unset _SETUP_TMP return 1 fi unset _RC unset _SETUP_UTIL . "$_SETUP_TMP" rm -f "$_SETUP_TMP" unset _SETUP_TMP # source all environment hooks _i=0 while [ $_i -lt $_CATKIN_ENVIRONMENT_HOOKS_COUNT ]; do eval _envfile=\$_CATKIN_ENVIRONMENT_HOOKS_$_i unset _CATKIN_ENVIRONMENT_HOOKS_$_i eval _envfile_workspace=\$_CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE unset _CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE # set workspace for environment hook CATKIN_ENV_HOOK_WORKSPACE=$_envfile_workspace . "$_envfile" unset CATKIN_ENV_HOOK_WORKSPACE _i=$((_i + 1)) done unset _i unset _CATKIN_ENVIRONMENT_HOOKS_COUNT
import numpy as np def is_prime(nums): is_prime = np.ones(len(nums), dtype=bool) for i, num in enumerate(nums): if num > 1: # Check if any number in the range 2 to num-1 can divide num for j in range(2, num): if (num % j) == 0: is_prime[i] = False return is_prime is_prime([2, 4, 7, 11, 19]) #=> [ True False True True True]
from typing import List def getActions(getCamera: bool, getPhotos: bool, getVideos: bool, getFiles: bool) -> List[str]: actions = [] if getCamera: actions.append("actionCamera") if getPhotos: actions.append("actionPhotoLibrary") if getVideos: actions.append("actionVideo") if getFiles: actions.append("actionFile") return actions
#!/bin/bash # Copyright 2015 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 agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ## Contains configuration values for the Openstack cluster # Stack name STACK_NAME=${STACK_NAME:-KubernetesStack} # Keypair for kubernetes stack KUBERNETES_KEYPAIR_NAME=${KUBERNETES_KEYPAIR_NAME:-kubernetes_keypair} # Kubernetes release tar file KUBERNETES_RELEASE_TAR=${KUBERNETES_RELEASE_TAR:-kubernetes-server-linux-amd64.tar.gz} NUMBER_OF_MINIONS=${NUMBER_OF_MINIONS-3} MAX_NUMBER_OF_MINIONS=${MAX_NUMBER_OF_MINIONS:-3} MASTER_FLAVOR=${MASTER_FLAVOR:-m1.medium} MINION_FLAVOR=${MINION_FLAVOR:-m1.medium} EXTERNAL_NETWORK=${EXTERNAL_NETWORK:-public} LBAAS_VERSION=${LBAAS_VERSION:-} FIXED_NETWORK_CIDR=${FIXED_NETWORK_CIDR:-10.0.0.0/24} SERVICE_CLUSTER_IP_RANGE=${SERVICE_CLUSTER_IP_RANGE:-10.0.0.0/16} CLUSTER_IP_RANGE=${CLUSTER_IP_RANGE:-10.244.0.0/16} SWIFT_SERVER_URL=${SWIFT_SERVER_URL:-} # Flag indicates if new image must be created. If 'false' then image with IMAGE_ID will be used. # If 'true' then new image will be created from file config-image.sh CREATE_IMAGE=${CREATE_IMAGE:-true} # use "true" for devstack # Flag indicates if image should be downloaded DOWNLOAD_IMAGE=${DOWNLOAD_IMAGE:-true} # Image id which will be used for kubernetes stack IMAGE_ID=${IMAGE_ID:-f0f394b1-5546-4b68-b2bc-8abe8a7e6b8b} # DNS server address DNS_SERVER=${DNS_SERVER:-8.8.8.8} # Public RSA key path CLIENT_PUBLIC_KEY_PATH=${CLIENT_PUBLIC_KEY_PATH:-~/.ssh/id_rsa.pub} # Max time period for stack provisioning. Time in minutes. STACK_CREATE_TIMEOUT=${STACK_CREATE_TIMEOUT:-60} # Enable Proxy, if true kube-up will apply your current proxy settings(defined by *_PROXY environment variables) to the deployment. ENABLE_PROXY=${ENABLE_PROXY:-false} # Per-protocol proxy settings. FTP_PROXY=${FTP_PROXY:-} HTTP_PROXY=${HTTP_PROXY:-} HTTPS_PROXY=${HTTPS_PROXY:-} SOCKS_PROXY=${SOCKS_PROXY:-} # IPs and Domains that bypass the proxy. NO_PROXY=${NO_PROXY:-}
<reponame>topolr/ada-pack<filename>bin/lib/process.js let helper = require("../../src/util/helper"); let DevServer = require("./../lib/server"); let appInfo = helper.getAppInfo(process.cwd(), false); return new DevServer(appInfo).start().then(() => { process.send({type: "done"}); });
#!/bin/bash # Start Soda Fountain main server set -e REALPATH=$(python -c "import os; print(os.path.realpath('$0'))") BINDIR=$(dirname "$REALPATH") CONFIG="$BINDIR/../configs/application.conf" JARFILE=$("$BINDIR"/build.sh "$@") "$BINDIR"/run_migrations.sh java -Djava.net.preferIPv4Stack=true -Dconfig.file="$CONFIG" -jar "$JARFILE"
<gh_stars>0 require 'rails_helper' require 'dirty_change_wrapper' RSpec.describe DirtyChangeWrapper do let(:base) { OpenStruct.new(foo: 'bar') } let(:changes) { { baz: %w[bar bat] } } subject { DirtyChangeWrapper.new(base, changes) } context 'for changes' do it 'should provide a _was method to access the previous value' do expect(subject).to respond_to(:baz_was) expect(subject.baz_was).to eq('bar') end it 'should provide a method to access the current value' do expect(subject).to respond_to(:baz) expect(subject.baz).to eq('bat') end it 'should provide a _changed? method which returns true' do expect(subject).to respond_to(:baz_changed?) expect(subject.baz_changed?).to be_truthy end it 'should provide a _changes method to expose the raw change array' do expect(subject).to respond_to(:baz_changes) expect(subject.baz_changes).to eq(%w[bar bat]) end end context 'for missing properties' do it 'should provide a _changed? method which returns false' do expect(subject).to respond_to(:nope_changed?) expect(subject.nope_changed?).to be_falsey end it 'should provide a _changes method which returns nil' do expect(subject).to respond_to(:nope_changes) expect(subject.nope_changes).to be_nil end end context 'for the base' do it 'should delegate any methods it does not know' do expect(subject).to respond_to(:foo) expect(subject.foo).to eq('bar') end end end