text:
@article{Adam:2016acv,
      author         = "Adam, Jaroslav and others",
      title          = "{Particle identification in ALICE: a Bayesian approach}",
      collaboration  = "ALICE",
      journal        = "Eur. Phys. J. Plus",
      volume         = "131",
      year           = "2016",
      number         = "5",
      pages          = "168",
      doi            = "10.1140/epjp/i2016-16168-5",
      eprint         = "1602.01392",
      archivePrefix  = "arXiv",
      primaryClass   = "physics.data-an",
      reportNumber   = "CERN-EP-2016-023",
      SLACcitation   = "%%CITATION = ARXIV:1602.01392;%%"
}
@inproceedings{Belikov:2005zz,
      author         = "Belikov, I. and Hristov, P. and Ivanov, M. and Kuhr, T.
                        and Safarik, K.",
      title          = "{Bayesian approach for combined particle identification
                        in ALICE experiment at LHC}",
      booktitle      = "{Computing in high energy physics and nuclear physics.
                        Proceedings, Conference, CHEP'04, Interlaken, Switzerland,
                        September 27-October 1, 2004}",
      url            = "http://doc.cern.ch/yellowrep/2005/2005-002/p423.pdf",
      year           = "2005",
      pages          = "423-426",
      SLACcitation   = "%%CITATION = INSPIRE-707321;%%"
}
@misc{Pulvermacher:SuperKEKBDetectorComponents,
      author       = {Pulvermacher, Christian},
      title        = {dE/dx particle identification and pixel detector data reduction for the Belle II experiment},
      school       = {KIT},
      type         = {Dipl. ; Dipl.},
      reportid     = {IEKP-KA/2012-09},
      year         = {2012},
      keywords     = {Unveröffentlichte Hochschulschrift (GND)},
      cin          = {Belle2},
      cid          = {I:(DE-IEKP)Belle2-20121205},
      typ          = {PUB:(DE-HGF)10},
      url          = {https://ekp-invenio.physik.uni-karlsruhe.de/record/48263},
}
@misc{Pulvermacher:AnalysisSoftware,
      author       = {Pulvermacher, Christian},
      title        = {Analysis Software and Full Event Interpretation for the Belle~\RN{2} Experiment},
      school       = {KIT},
      type         = {{PhD} dissertation},
      reportid     = {IEKP-KA/2015-16},
      year         = {2015},
      cin          = {Belle2},
      url          = {https://docs.belle2.org/record/336/files/BELLE2-PTHESIS-2016-003.pdf},
}
@article{Dawson:2017rsp,
      author         = "Dawson, B. R. and Fukushima, M. and Sokolsky, P.",
      title          = "{Past, Present and Future of UHECR Observations}",
      journal        = "PTEP",
      volume         = "2017",
      year           = "2017",
      number         = "12",
      pages          = "12A101",
      doi            = "10.1093/ptep/ptx054",
      eprint         = "1703.07897",
      archivePrefix  = "arXiv",
      primaryClass   = "astro-ph.HE",
      SLACcitation   = "%%CITATION = ARXIV:1703.07897;%%"
}
@article{Abe:2010gxa,
      author         = "Abe, T. and others",
      title          = "{Belle II Technical Design Report}",
      collaboration  = "Belle-II",
      year           = "2010",
      eprint         = "1011.0352",
      archivePrefix  = "arXiv",
      primaryClass   = "physics.ins-det",
      reportNumber   = "KEK-REPORT-2010-1",
      SLACcitation   = "%%CITATION = ARXIV:1011.0352;%%"
}
@article{Belle2Collaboration:B2TiP,
      author         = "Belle~\RN{2} Theory Interface Platform",
      title          = "{The Belle 2 Physics Book}",
      journal        = "Progress of Theoretical and Experimental Physics",
      year           = "to be published",
      pages          = "721",
}
@article{Patrignani:2016xqp,
      author         = "Patrignani, C. and others",
      title          = "{Review of Particle Physics}",
      collaboration  = "Particle Data Group",
      journal        = "Chin. Phys.",
      volume         = "C40",
      year           = "2016",
      number         = "10",
      pages          = "100001",
      doi            = "10.1088/1674-1137/40/10/100001",
      SLACcitation   = "%%CITATION = CHPHD,C40,100001;%%"
}
@article{DBLP:journals/corr/abs-1212-5701,
  author    = {Matthew D. Zeiler},
  title     = {{ADADELTA:} An Adaptive Learning Rate Method},
  journal   = {CoRR},
  volume    = {abs/1212.5701},
  year      = {2012},
  archivePrefix = {arXiv},
  eprint    = {1212.5701},
  timestamp = {Wed, 07 Jun 2017 14:43:02 +0200}
}
@article{DBLP:journals/corr/KingmaB14,
  author    = {Diederik P. Kingma and
               Jimmy Ba},
  title     = {Adam: {A} Method for Stochastic Optimization},
  journal   = {CoRR},
  volume    = {abs/1412.6980},
  year      = {2014},
  archivePrefix = {arXiv},
  eprint    = {1412.6980},
  timestamp = {Wed, 07 Jun 2017 14:40:52 +0200}
}
@misc{chollet2015keras,
  title={Keras},
  author={Chollet, Fran\c{c}ois and others},
  year={2015},
  howpublished={\url{https://keras.io}},
}
@misc{tensorflow2015-whitepaper,
title={ {TensorFlow}: Large-Scale Machine Learning on Heterogeneous Systems},
url={https://www.tensorflow.org/},
author={
    Martín~Abadi and
    Ashish~Agarwal and
    Paul~Barham and
    Eugene~Brevdo and
    Zhifeng~Chen and
    Craig~Citro and
    Greg~S.~Corrado and
    Andy~Davis and
    Jeffrey~Dean and
    Matthieu~Devin and
    Sanjay~Ghemawat and
    Ian~Goodfellow and
    Andrew~Harp and
    Geoffrey~Irving and
    Michael~Isard and
    Yangqing Jia and
    Rafal~Jozefowicz and
    Lukasz~Kaiser and
    Manjunath~Kudlur and
    Josh~Levenberg and
    Dandelion~Man\'{e} and
    Rajat~Monga and
    Sherry~Moore and
    Derek~Murray and
    Chris~Olah and
    Mike~Schuster and
    Jonathon~Shlens and
    Benoit~Steiner and
    Ilya~Sutskever and
    Kunal~Talwar and
    Paul~Tucker and
    Vincent~Vanhoucke and
    Vijay~Vasudevan and
    Fernanda~Vi\'{e}gas and
    Oriol~Vinyals and
    Pete~Warden and
    Martin~Wattenberg and
    Martin~Wicke and
    Yuan~Yu and
    Xiaoqiang~Zheng},
  year={2015},
}
@article{Pearson:LinesAndPlanes,
  author = { Karl~Pearson~F.R.S. },
  title = {\RN{53}. On lines and planes of closest fit to systems of points in space},
  journal = {The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science},
  volume = {2},
  number = {11},
  pages = {559-572},
  year  = {1901},
  publisher = {Taylor & Francis},
  doi = {10.1080/14786440109462720},
}
@book{Goodfellow:DeepLearning,
  title = {Deep Learning},
  author = {Goodfellow, I. and Bengio, Y. and Courville, A.},
  isbn = {9780262035613},
  lccn = {2016022992},
  series = {Adaptive computation and machine learning},
  url = {https://books.google.de/books?id=Np9SDQAAQBAJ},
  year = {2016},
  publisher = {MIT Press}
}
@ARTICLE{Hahnloser:NeuralComputation,
  author = {R.~H.~R.~Hahnloser and H.~S.~Seung and J.~J.~Slotine},
  journal = {Neural Computation},
  title = {Permitted and Forbidden Sets in Symmetric Threshold-Linear Networks},
  year = {2003},
  volume = {15},
  number = {3},
  pages = {621-638},
  doi = {10.1162/089976603321192103},
  month = {March}
}
@inproceedings{Ester:1996:DAD:3001460.3001507,
  author = {Ester, Martin and Kriegel, Hans-Peter and Sander, J\"{o}rg and Xu, Xiaowei},
  title = {A Density-based Algorithm for Discovering Clusters a Density-based Algorithm for Discovering Clusters in Large Spatial Databases with Noise},
  booktitle = {Proceedings of the Second International Conference on Knowledge Discovery and Data Mining},
  series = {KDD'96},
  year = {1996},
  location = {Portland, Oregon},
  pages = {226--231},
  numpages = {6},
  url = {http://www.dbs.ifi.lmu.de/Publikationen/Papers/KDD-96.final.frame.pdf},
  acmid = {3001507},
  publisher = {AAAI Press},
  keywords = {arbitrary shape of clusters, clustering algorithms, efficiency on large spatial databases, handling nlj4-275oise},
}
@INPROCEEDINGS{Ankerst99optics:ordering,
    author = {Mihael Ankerst and Markus M. Breunig and Hans-peter Kriegel and Jörg Sander},
    title = {OPTICS: Ordering Points To Identify the Clustering Structure},
    year = {1999},
    pages = {49--60},
    publisher = {ACM Press},
    url = {http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.129.6542&rep=rep1&type=pdf}
}
@misc{MachineLearning:NeuralNetworks,
  author        = {Volker~Tresp},
  title         = {Lecture notes in Machine Learning: Neural Networks},
  month         = {April},
  year          = {2017},
  publisher     = {Fakultät für Informatik der Universität München},
  url           = {http://www.dbs.ifi.lmu.de/Lehre/MaschLernen/SS2017/Skript/03-NeuralNetworks2017.pdf}
}
@misc{MachineLearning:DeepLearning,
  author        = {Volker~Tresp},
  title         = {Lecture notes in Machine Learning: Deep Learning},
  month         = {April},
  year          = {2017},
  publisher     = {Fakultät für Informatik der Universität München}
}
@misc{MachineLearning:LinearClassification,
  author        = {Volker~Tresp},
  title         = {Lecture notes in Machine Learning: Linear Classification},
  month         = {Juni},
  year          = {2017},
  publisher     = {Fakultät für Informatik der Universität München}
}
@misc{BigDataManagementAndAnalytics:TextProcessingAndHigh-DimensionalData,
  author        = {Matthias~Schubert},
  title         = {Lecture notes in Big Data Management and Analytics: Text Processing and High-Dimensional Data},
  month         = {December},
  year          = {2017},
  publisher     = {Fakultät für Informatik der Universität München}
}
@misc{KnowledgeDiscoveryInDatabases1:Clustering,
  author        = {Peer~Kröger},
  title         = {Lecture notes in Knowledge Discovery in Databases~\RN{1}: Clustering},
  month         = {December},
  year          = {2017},
  publisher     = {Fakultät für Informatik der Universität München}
}
@misc{NeuralNetwork:UniversalApproximation,
  author        = {George~Cybenko},
  title         = {Approximations by superpositions of sigmoidal functions},
  month         = {February},
  year          = {1989},
  publisher     = {Springer-Verlag New York Inc.},
  journal       = {Mathematics of Control, Signals, and Systems},
  volume        = {2},
  pages         = "303-314",
  year          = {1989},
  url           = {https://web.eecs.umich.edu/~cscott/smlrg/approx_by_superposition.pdf}
}
@article{LANGE2001152,
  title = "The EvtGen particle decay simulation package",
  journal = "Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment",
  volume = "462",
  number = "1",
  pages = "152 - 155",
  year = "2001",
  doi = "10.1016/S0168-9002(01)00089-4",
  author = "David J. Lange",
  keywords = "Monte Carlo, Event generator"
}
@article{AGOSTINELLI2003250,
  title = "GEANT4 -- a simulation toolkit",
  journal = "Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment",
  volume = "506",
  number = "3",
  pages = "250 - 303",
  year = "2003",
  doi = "10.1016/S0168-9002(03)01368-8",
  author = "S. Agostinelli and J. Allison and K. Amako and J. Apostolakis and H. Araujo and P. Arce and M. Asai and D. Axen and S. Banerjee and G. Barrand and F. Behner and L. Bellagamba and J. Boudreau and L. Broglia and A. Brunengo and H. Burkhardt and S. Chauvie and J. Chuma and R. Chytracek and G. Cooperman and G. Cosmo and P. Degtyarenko and A. Dell'Acqua and G. Depaola and D. Dietrich and R. Enami and A. Feliciello and C. Ferguson and H. Fesefeldt and G. Folger and F. Foppiano and A. Forti and S. Garelli and S. Giani and R. Giannitrapani and D. Gibin and J.J. Gómez Cadenas and I. González and G. Gracia Abril and G. Greeniaus and W. Greiner and V. Grichine and A. Grossheim and S. Guatelli and P. Gumplinger and R. Hamatsu and K. Hashimoto and H. Hasui and A. Heikkinen and A. Howard and V. Ivanchenko and A. Johnson and F.W. Jones and J. Kallenbach and N. Kanaya and M. Kawabata and Y. Kawabata and M. Kawaguti and S. Kelner and P. Kent and A. Kimura and T. Kodama and R. Kokoulin and M. Kossov and H. Kurashige and E. Lamanna and T. Lampén and V. Lara and V. Lefebure and F. Lei and M. Liendl and W. Lockman and F. Longo and S. Magni and M. Maire and E. Medernach and K. Minamimoto and P. Mora de Freitas and Y. Morita and K. Murakami and M. Nagamatu and R. Nartallo and P. Nieminen and T. Nishimura and K. Ohtsubo and M. Okamura and S. O'Neale and Y. Oohata and K. Paech and J. Perl and A. Pfeiffer and M.G. Pia and F. Ranjard and A. Rybin and S. Sadilov and E. Di Salvo and G. Santin and T. Sasaki and N. Savvas and Y. Sawada and S. Scherer and S. Sei and V. Sirotenko and D. Smith and N. Starkov and H. Stoecker and J. Sulkimo and M. Takahata and S. Tanaka and E. Tcherniaev and E. Safai Tehrani and M. Tropeano and P. Truscott and H. Uno and L. Urban and P. Urban and M. Verderi and A. Walkden and W. Wander and H. Weber and J.P. Wellisch and T. Wenaus and D.C. Williams and D. Wright and T. Yamada and H. Yoshida and D. Zschiesche",
  keywords = "Simulation, Particle interactions, Geometrical modelling, Software engineering, Object-oriented technology, Distributed software development"
}
@misc{Belle2Collaboration:SuperKEKBSketch,
    title={Super KEKB and Belle II},
    url={https://www.belle2.org/project/super_kekb_and_belle_ii},
    journal={Belle 2},
    author={Belle 2 Collaboration}
}
@misc{Belle2Collaboration:Belle2as3DSketch,
    title={Belle II detector as 3D sketch},
    url={https://www.belle2.org/imprint/},
    journal={Belle 2},
    author={Belle 2 Collaboration}
}
@misc{Belle2Collaboration:Belle2CollisionSketch,
    title={Sketch of a collision at Belle II},
    url={https://www.kek.jp/en/Facility/IPNS/Belle2/},
    journal={Belle 2},
    author={Belle 2 Collaboration}
}
@misc{BelleCollaboration:CollisionDecaySketch,
    title={Belle discovers new heavy `exotic hadrons'},
    url={https://www.kek.jp/en/Facility/IPNS/Belle2/},
    journal={Physical Review Letters (PRL)},
    year={2012},
    author={High Energy Accelerator Research Organization (KEK)}
}

repository: Edenhofer/PID-boost

repo_name: Edenhofer/PID-boost


text:
package main

import (
	"context"
	"errors"
	"strings"
	"time"

	"github.com/OpenPeeDeeP/chessclock/chessclock"
	"github.com/spf13/cobra"
)

var reasons = make(map[string]chessclock.StopRequest_Reason)

var stopLogger = mainLogger.With().Str("cmd", "stop").Logger()
var stopCmd = &cobra.Command{
	Use:      "stop [eod|break|lunch]",
	Short:    "Stop all tasks for the specified reasons",
	Args:     validateStopCmdArgs,
	RunE:     stopCmdRun,
	PreRunE:  startClient(stopLogger),
	PostRunE: stopClient,
}

func init() {
	reasons["eod"] = chessclock.StopRequest_EndOfDay
	reasons["break"] = chessclock.StopRequest_Break
	reasons["lunch"] = chessclock.StopRequest_Lunch
}

func stopCmdRun(cmd *cobra.Command, args []string) error {
	_, err := client.Stop(context.Background(), &chessclock.StopRequest{
		Timestamp: time.Now().Unix(),
		Reason:    reasons[strings.ToLower(args[0])],
	})
	if err != nil {
		stopLogger.Error().Err(err).Msg("Could not stop the previous task")
		return err
	}
	return nil
}

func validateStopCmdArgs(cmd *cobra.Command, args []string) (err error) {
	switch {
	case len(args) > 1:
		err = errors.New("Too many arguments")
		stopLogger.Error().Err(err).Msg("Incorrect Arguments")
		return err
	case len(args) < 1:
		err = errors.New("Must sepcify a reason for stopping (eod, break, lunch)")
		stopLogger.Error().Err(err).Msg("Incorrect Arguments")
		return err
	}
	if _, ok := reasons[strings.ToLower(args[0])]; !ok {
		err = errors.New("Reason given is not a valid reason (eod, break, lunch)")
		stopLogger.Error().Err(err).Msg("Incorrect Arguments")
		return err
	}
	return nil
}

repository: OpenPeeDeeP/ChessClock

license_type: permissive

repo_name: OpenPeeDeeP/ChessClock

branch_name: refs/heads/master

extension: go


text:
SUMMARY = "Dependency management tool for Golang"
HOMEPAGE = "https://github.com/golang/dep"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=1bad315647751fab0007812f70d42c0d"

GO_IMPORT = "github.com/golang/dep"
SRC_URI = "git://${GO_IMPORT}"

# Points to 0.3.0 tag
SRCREV = "7a91b794bbfbf1f3b8b79823799316451127801b"

inherit go

GO_INSTALL = "${GO_IMPORT}/cmd/dep"

RDEPENDS_${PN}-dev += "bash"

repository: sailfishdell/sailfish

repo_name: sailfishdell/sailfish

gha_language: Go

extension: bb


text:
package controllers

import (
	models "github.com/liujianping/scaffold/demo/app/models"
	routes "github.com/liujianping/scaffold/demo/app/routes"
	"github.com/revel/revel"
)

type UserPostController struct {
	DBController
}

func (c UserPostController) Index() revel.Result {
	revel.TRACE.Printf("GET >> user.post.index ...")

	total, items, err := models.DefaultUserPost.Search(db,
		models.DefaultUserPostQuery,
		models.DefaultUserPostSortBy,
		models.DefaultUserPostPage)
	if err != nil {
		c.Flash.Error(err.Error())
		return c.RenderTemplate("user.post/index.html")
	}

	pagination := Pagination("pagination", "user.post",
		total,
		models.DefaultUserPostPage.Size,
		models.DefaultUserPostPage.No)

	c.RenderArgs["total"] = total
	c.RenderArgs["items"] = items
	c.RenderArgs["pagination"] = pagination
	return c.RenderTemplate("user.post/index.html")
}

func (c UserPostController) Query(query models.UserPostQuery,
	sort models.UserPostSortBy,
	page models.UserPostPage) revel.Result {
	revel.TRACE.Printf("POST >> user.post.query ...(query: %v) (sort: %v) (page: %v)",
		query, sort, page)

	total, items, err := models.DefaultUserPost.Search(db,
		query, sort, page)
	if err != nil {
		c.Flash.Error(err.Error())
		return c.RenderTemplate("user.post/query.html")
	}

	pagination := Pagination("pagination", "user.post", total, page.Size, page.No)

	c.RenderArgs["total"] = total
	c.RenderArgs["items"] = items
	c.RenderArgs["pagination"] = pagination
	return c.RenderTemplate("user.post/query.html")
}

func (c UserPostController) Detail(id int64) revel.Result {
	revel.TRACE.Printf("GET >> user.post.detail ... (%d)", id)

	obj, err := db.Get(models.UserPost{}, id)
	if err != nil {
		c.Flash.Error(err.Error())
		return c.Redirect(routes.UserPostController.Index())
	}

	c.RenderArgs["obj"] = obj
	return c.RenderTemplate("user.post/detail.html")
}

func (c UserPostController) Create() revel.Result {
	revel.TRACE.Printf("GET >> user.post.create ...")
	return c.RenderTemplate("user.post/create.html")
}

func (c UserPostController) CreatePost(obj models.UserPost) revel.Result {
	revel.TRACE.Printf("POST >> user.post.create create ... (%v)", obj)

	obj.Validate(c.Validation)
	if c.Validation.HasErrors() {
		c.Validation.Keep()
		c.FlashParams()
		return c.Redirect(UserPostController.Create)
	}

	c.Begin()
	if err := c.Txn.Insert(&obj); err != nil {
		c.Rollback()
		c.Flash.Error(err.Error())
		return c.Redirect(routes.UserPostController.Index())
	}
	c.Commit()

	c.Flash.Success("user.post (%d) create succeed.", obj.ID)
	return c.Redirect(routes.UserPostController.Index())
}

func (c UserPostController) Update(id int64) revel.Result {
	revel.TRACE.Printf("GET >> user.post.update ... (%d)", id)

	obj, err := db.Get(models.UserPost{}, id)
	if err != nil {
		c.Flash.Error(err.Error())
		return c.Redirect(routes.UserPostController.Index())
	}

	c.RenderArgs["obj"] = obj
	return c.RenderTemplate("user.post/update.html")
}

func (c UserPostController) UpdatePost(obj models.UserPost) revel.Result {
	revel.TRACE.Printf("POST >> user.post.update ... (%v)", obj)

	obj.Validate(c.Validation)
	if c.Validation.HasErrors() {
		c.Validation.Keep()
		c.FlashParams()
		return c.Redirect(routes.UserPostController.Update(obj.ID))
	}

	c.Begin()
	if _, err := c.Txn.Update(&obj); err != nil {
		c.Rollback()
		c.Flash.Error(err.Error())
		return c.Redirect(routes.UserPostController.Index())
	}
	c.Commit()

	c.Flash.Success("user.post (%d) updated success.", obj.ID)
	return c.Redirect(routes.UserPostController.Index())
}

func (c UserPostController) Remove(id int64) revel.Result {
	revel.TRACE.Printf("GET >> user.post.remove ... (%d)", id)

	c.Begin()
	var obj models.UserPost
	obj.ID = id

	count, err := c.Txn.Delete(&obj)
	if err != nil {
		c.Rollback()
		c.Flash.Error(err.Error())
		return c.Redirect(routes.UserPostController.Index())
	}
	c.Commit()

	if count == 0 {
		c.Flash.Error("user.post (%d) not exist.", id)
	} else {
		c.Flash.Success("user.post (%d) remove succeed.", id)
	}

	return c.Redirect(routes.UserPostController.Index())
}

func (c UserPostController) FinderIndex() revel.Result {
	revel.TRACE.Printf("GET >> user.post.finder.index ...")

	total, items, err := models.DefaultUserPost.Search(db,
		models.DefaultUserPostQuery,
		models.DefaultUserPostSortBy,
		models.DefaultUserPostPage)
	if err != nil {
		c.Flash.Error(err.Error())
		return c.RenderTemplate("user.post/finder.index.html")
	}

	pagination := Pagination("finder.pagination", "user.post", total,
		models.DefaultUserPostPage.Size,
		models.DefaultUserPostPage.No)

	c.RenderArgs["total"] = total
	c.RenderArgs["items"] = items
	c.RenderArgs["pagination"] = pagination
	return c.RenderTemplate("user.post/finder.index.html")
}

func (c UserPostController) FinderQuery(query models.UserPostQuery,
	sort models.UserPostSortBy,
	page models.UserPostPage) revel.Result {
	revel.TRACE.Printf("POST >> user.post.finder.query ...(query: %v) (sort: %v) (page: %v)",
		query, sort, page)

	total, items, err := models.DefaultUserPost.Search(db,
		query, sort, page)
	if err != nil {
		c.Flash.Error(err.Error())
		return c.RenderTemplate("user.post/finder.query.html")
	}

	pagination := Pagination("finder.pagination", "user.post", total, page.Size, page.No)

	c.RenderArgs["total"] = total
	c.RenderArgs["items"] = items
	c.RenderArgs["pagination"] = pagination
	return c.RenderTemplate("user.post/finder.query.html")
}

func UserPostCount() int64 {
	return models.DefaultUserPost.Count(db)
}

func init() {
	revel.TemplateFuncs["UserPostCount"] = UserPostCount
}

license: MIT


text:
import React from 'react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import { Primary } from './Button.stories';

it('renders the button in the primary state', () => {
  render(<Primary {...Primary.args} />);
  expect(screen.getByRole('button')).toHaveTextContent('Primary');
});

gha_license_id: MIT

gha_language: JavaScript

extension: js


text:
require cornucopia.inc
DESCRIPTION = "freesmartphone.org system library"
SRCREV = "${FSO_CORNUCOPIA_SRCREV}"
PV = "0.1.0+gitr${SRCPV}"
PE = "1"
PR = "${INC_PR}.0"

repository: balister/openembedded

repo_name: balister/openembedded


text:
require recipes-graphics/xorg-driver/xorg-driver-video.inc

DESCRIPTION = "X.Org X server -- MGA display driver"

LIC_FILES_CHKSUM = "file://COPYING;md5=bc1395d2cd32dfc5d6c57d2d8f83d3fc"

# Patch from https://bugs.freedesktop.org/show_bug.cgi?id=57606
SRC_URI += "file://xf86-video-mga-cross-compile.patch "

SRC_URI[md5sum] = "a53b5ce166e31c181aaa4c3816d8babb"
SRC_URI[sha256sum] = "7704b1ea35098769787a9c93e903b827be97a99facfb1696aa5236a58ff1c7d7"

EXTRA_OECONF += " --enable-dri"

repository: gitter-badger/meta-cocon

repo_name: gitter-badger/meta-cocon


text:
package github

import (
	"log"
	"net/http"

	"github.com/jenkins-zh/wechat-backend/pkg/config"
	"gopkg.in/go-playground/webhooks.v5/github"
)

func WebhookHandler(w http.ResponseWriter, r *http.Request, weConfig *config.WeChatConfig, initCheck func(*config.WeChatConfig)) {
	hook, _ := github.New(github.Options.Secret("secret"))

	payload, err := hook.Parse(r, github.PushEvent)
	if err != nil {
		if err == github.ErrEventNotFound {
			// ok event wasn;t one of the ones asked to be parsed
			return
		}
	}

	switch payload.(type) {
	case github.PushPayload:
		push := payload.(github.PushPayload)
		// Do whatever you want from here...
		log.Printf("push ref is %s.\n", push.Ref)

		if push.Ref != "refs/heads/master" {
			return
		}
	}

	log.Println("Going to update wechat config.")
	initCheck(weConfig)
}

repository: XUZHOUWANG/wechat-backend

repo_name: XUZHOUWANG/wechat-backend


text:
/*
 * Copyright (c) 2013, 2014 Conformal Systems LLC <info@conformal.com>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

// This file implements the notification handlers for btcd-side notifications.

package main

import (
	"encoding/hex"
	"github.com/conformal/btcjson"
	"github.com/conformal/btcutil"
	"github.com/conformal/btcwallet/tx"
	"github.com/conformal/btcwallet/wallet"
	"github.com/conformal/btcwire"
	"github.com/conformal/btcws"
	"sync"
	"time"
)

type notificationHandler func(btcjson.Cmd)

var notificationHandlers = map[string]notificationHandler{
	btcws.BlockConnectedNtfnMethod:    NtfnBlockConnected,
	btcws.BlockDisconnectedNtfnMethod: NtfnBlockDisconnected,
	btcws.ProcessedTxNtfnMethod:       NtfnProcessedTx,
	btcws.TxMinedNtfnMethod:           NtfnTxMined,
	btcws.TxSpentNtfnMethod:           NtfnTxSpent,
}

// NtfnProcessedTx handles the btcws.ProcessedTxNtfn notification.
func NtfnProcessedTx(n btcjson.Cmd) {
	ptn, ok := n.(*btcws.ProcessedTxNtfn)
	if !ok {
		log.Errorf("%v handler: unexpected type", n.Method())
		return
	}

	// Create useful types from the JSON strings.
	receiver, err := btcutil.DecodeAddr(ptn.Receiver)
	if err != nil {
		log.Errorf("%v handler: error parsing receiver: %v", n.Method(), err)
		return
	}
	txID, err := btcwire.NewShaHashFromStr(ptn.TxID)
	if err != nil {
		log.Errorf("%v handler: error parsing txid: %v", n.Method(), err)
		return
	}
	blockHash, err := btcwire.NewShaHashFromStr(ptn.BlockHash)
	if err != nil {
		log.Errorf("%v handler: error parsing block hash: %v", n.Method(), err)
		return
	}
	pkscript, err := hex.DecodeString(ptn.PkScript)
	if err != nil {
		log.Errorf("%v handler: error parsing pkscript: %v", n.Method(), err)
		return
	}

	// Lookup account for address in result.
	aname, err := LookupAccountByAddress(ptn.Receiver)
	if err == ErrNotFound {
		log.Warnf("Received rescan result for unknown address %v", ptn.Receiver)
		return
	}
	a, err := AcctMgr.Account(aname)
	if err == ErrNotFound {
		log.Errorf("Missing account for rescaned address %v", ptn.Receiver)
	}

	// Create RecvTx to add to tx history.
	t := &tx.RecvTx{
		TxID:         *txID,
		TxOutIdx:     ptn.TxOutIndex,
		TimeReceived: time.Now().Unix(),
		BlockHeight:  ptn.BlockHeight,
		BlockHash:    *blockHash,
		BlockIndex:   int32(ptn.BlockIndex),
		BlockTime:    ptn.BlockTime,
		Amount:       ptn.Amount,
		ReceiverHash: receiver.ScriptAddress(),
	}

	// For transactions originating from this wallet, the sent tx history should
	// be recorded before the received history.  If wallet created this tx, wait
	// for the sent history to finish being recorded before continuing.
	req := SendTxHistSyncRequest{
		txid:     *txID,
		response: make(chan SendTxHistSyncResponse),
	}
	SendTxHistSyncChans.access <- req
	resp := <-req.response
	if resp.ok {
		// Wait until send history has been recorded.
		<-resp.c
		SendTxHistSyncChans.remove <- *txID
	}

	// Record the tx history.
	a.TxStore.InsertRecvTx(t)
	AcctMgr.ds.ScheduleTxStoreWrite(a)
	// Notify frontends of tx.  If the tx is unconfirmed, it is always
	// notified and the outpoint is marked as notified.  If the outpoint
	// has already been notified and is now in a block, a txmined notifiction
	// should be sent once to let frontends that all previous send/recvs
	// for this unconfirmed tx are now confirmed.
	recvTxOP := btcwire.NewOutPoint(txID, ptn.TxOutIndex)
	previouslyNotifiedReq := NotifiedRecvTxRequest{
		op:       *recvTxOP,
		response: make(chan NotifiedRecvTxResponse),
	}
	NotifiedRecvTxChans.access <- previouslyNotifiedReq
	if <-previouslyNotifiedReq.response {
		NotifyMinedTx <- t
		NotifiedRecvTxChans.remove <- *recvTxOP
	} else {
		// Notify frontends of new recv tx and mark as notified.
		NotifiedRecvTxChans.add <- *recvTxOP
		NotifyNewTxDetails(frontendNotificationMaster, a.Name(), t.TxInfo(a.Name(),
			ptn.BlockHeight, a.Wallet.Net())[0])
	}

	if !ptn.Spent {
		u := &tx.Utxo{
			Amt:       uint64(ptn.Amount),
			Height:    ptn.BlockHeight,
			Subscript: pkscript,
		}
		copy(u.Out.Hash[:], txID[:])
		u.Out.Index = uint32(ptn.TxOutIndex)
		copy(u.AddrHash[:], receiver.ScriptAddress())
		copy(u.BlockHash[:], blockHash[:])
		a.UtxoStore.Insert(u)
		AcctMgr.ds.ScheduleUtxoStoreWrite(a)

		// If this notification came from mempool, notify frontends of
		// the new unconfirmed balance immediately.  Otherwise, wait until
		// the blockconnected notifiation is processed.
		if u.Height == -1 {
			bal := a.CalculateBalance(0) - a.CalculateBalance(1)
			NotifyWalletBalanceUnconfirmed(frontendNotificationMaster,
				a.name, bal)
		}
	}

	// Notify frontends of new account balance.
	confirmed := a.CalculateBalance(1)
	unconfirmed := a.CalculateBalance(0) - confirmed
	NotifyWalletBalance(frontendNotificationMaster, a.name, confirmed)
	NotifyWalletBalanceUnconfirmed(frontendNotificationMaster, a.name, unconfirmed)
}

// NtfnBlockConnected handles btcd notifications resulting from newly
// connected blocks to the main blockchain.
//
// TODO(jrick): Send block time with notification.  This will be used
// to mark wallet files with a possibly-better earliest block height,
// and will greatly reduce rescan times for wallets created with an
// out of sync btcd.
func NtfnBlockConnected(n btcjson.Cmd) {
	bcn, ok := n.(*btcws.BlockConnectedNtfn)
	if !ok {
		log.Errorf("%v handler: unexpected type", n.Method())
		return
	}
	hash, err := btcwire.NewShaHashFromStr(bcn.Hash)
	if err != nil {
		log.Errorf("%v handler: invalid hash string", n.Method())
		return
	}

	// Update the blockstamp for the newly-connected block.
	bs := &wallet.BlockStamp{
		Height: bcn.Height,
		Hash:   *hash,
	}
	curBlock.Lock()
	curBlock.BlockStamp = *bs
	curBlock.Unlock()

	// btcd notifies btcwallet about transactions first, and then sends
	// the new block notification.  New balance notifications for txs
	// in blocks are therefore sent here after all tx notifications
	// have arrived and finished being processed by the handlers.
	workers := NotifyBalanceRequest{
		block: *hash,
		wg:    make(chan *sync.WaitGroup),
	}
	NotifyBalanceSyncerChans.access <- workers
	if wg := <-workers.wg; wg != nil {
		wg.Wait()
		NotifyBalanceSyncerChans.remove <- *hash
	}
	AcctMgr.BlockNotify(bs)

	// Pass notification to frontends too.
	marshaled, _ := n.MarshalJSON()
	frontendNotificationMaster <- marshaled
}

// NtfnBlockDisconnected handles btcd notifications resulting from
// blocks disconnected from the main chain in the event of a chain
// switch and notifies frontends of the new blockchain height.
func NtfnBlockDisconnected(n btcjson.Cmd) {
	bdn, ok := n.(*btcws.BlockDisconnectedNtfn)
	if !ok {
		log.Errorf("%v handler: unexpected type", n.Method())
		return
	}
	hash, err := btcwire.NewShaHashFromStr(bdn.Hash)
	if err != nil {
		log.Errorf("%v handler: invalid hash string", n.Method())
		return
	}

	// Rollback Utxo and Tx data stores.
	AcctMgr.Rollback(bdn.Height, hash)

	// Pass notification to frontends too.
	marshaled, _ := n.MarshalJSON()
	frontendNotificationMaster <- marshaled
}

// NtfnTxMined handles btcd notifications resulting from newly
// mined transactions that originated from this wallet.
func NtfnTxMined(n btcjson.Cmd) {
	tmn, ok := n.(*btcws.TxMinedNtfn)
	if !ok {
		log.Errorf("%v handler: unexpected type", n.Method())
		return
	}

	txid, err := btcwire.NewShaHashFromStr(tmn.TxID)
	if err != nil {
		log.Errorf("%v handler: invalid hash string", n.Method())
		return
	}
	blockhash, err := btcwire.NewShaHashFromStr(tmn.BlockHash)
	if err != nil {
		log.Errorf("%v handler: invalid block hash string", n.Method())
		return
	}

	err = AcctMgr.RecordMinedTx(txid, blockhash,
		tmn.BlockHeight, tmn.Index, tmn.BlockTime)
	if err != nil {
		log.Errorf("%v handler: %v", n.Method(), err)
		return
	}

	// Remove mined transaction from pool.
	UnminedTxs.Lock()
	delete(UnminedTxs.m, TXID(*txid))
	UnminedTxs.Unlock()
}

// NtfnTxSpent handles btcd txspent notifications resulting from a block
// transaction being processed that spents a wallet UTXO.
func NtfnTxSpent(n btcjson.Cmd) {
	// TODO(jrick): This might actually be useless and maybe it shouldn't
	// be implemented.
}

license: ISC

repository: kawalgrover/btcwallet

repo_name: kawalgrover/btcwallet


text:
@incollection{SteinerEtAl2015,
  author = {Steiner, J. and Ruprecht, Daniel and Speck, Robert and Krause, Rolf},
  booktitle = {Numerical Mathematics and Advanced Applications - {ENUMATH} 2013},
  editor = {Abdulle, Assyr and Deparis, Simone and Kressner, Daniel and Nobile, Fabio and Picasso, Marco},
  pages = {195--202},
  publisher = {Springer International Publishing},
  series = {{Lecture Notes in Computational Science and Engineering}},
  title = {{Convergence of {P}arareal for the {N}avier-{S}tokes equations depending on the {R}eynolds number}},
  url = {http://dx.doi.org/10.1007/978-3-319-10705-9_19},
  doi = {10.1007/978-3-319-10705-9_19},
  volume = {103},
  year = {2015}
}

repository: comp-maths/website

repo_name: comp-maths/website

extension: bib


text:
@book{bishop2006Pattern,
  title = {Pattern Recognition and Machine Learning},
  author = {Bishop, Christopher M.},
  year = {2006},
  publisher = {{Springer}},
  address = {{New York}},
  file = {/home/vmvu/Dropbox/Zotero-attachments/Bishop_2006_Pattern recognition and machine learning.pdf},
  isbn = {978-0-387-31073-2},
  keywords = {bishop,Machine learning,Pattern perception},
  language = {en},
  lccn = {Q327 .B52 2006},
  series = {Information Science and Statistics}
}

@article{mathewson2019HumanCentered,
  title = {A {{Human}}-{{Centered Approach}} to {{Interactive Machine Learning}}},
  author = {Mathewson, Kory W.},
  year = {2019},
  month = may,
  abstract = {The interactive machine learning (IML) community aims to augment humans' ability to learn and make decisions over time through the development of automated decision-making systems. This interaction represents a collaboration between multiple intelligent systems---humans and machines. A lack of appropriate consideration for the humans involved can lead to problematic system behaviour, and issues of fairness, accountability, and transparency. This work presents a human-centred thinking approach to applying IML methods. This guide is intended to be used by AI practitioners who incorporate human factors in their work. These practitioners are responsible for the health, safety, and well-being of interacting humans. An obligation of responsibility for public interaction means acting with integrity, honesty, fairness, and abiding by applicable legal statutes. With these values and principles in mind, we as a research community can better achieve the collective goal of augmenting human ability. This practical guide aims to support many of the responsible decisions necessary throughout iterative design, development, and dissemination of IML systems.},
  archivePrefix = {arXiv},
  eprint = {1905.06289},
  eprinttype = {arxiv},
  file = {/home/vmvu/Dropbox/Zotero-attachments/Mathewson_2019_A Human-Centered Approach to Interactive Machine Learning.pdf},
  journal = {arXiv:1905.06289 [cs]},
  keywords = {human-ML,IML},
  primaryClass = {cs}
}

@article{tipping1999Mixtures,
  title = {Mixtures of {{Probabilistic Principal Component Analysers}}},
  author = {Tipping, Michael E and Bishop, Christopher M},
  year = {1999},
  volume = {11},
  pages = {443--482},
  file = {/home/vmvu/Dropbox/Zotero-attachments/Tipping_Bishop_1999_Mixtures of Probabilistic Principal Component Analysers.pdf},
  journal = {MIT Press},
  keywords = {mixture,mppca,pca,probabilistic model},
  language = {en},
  number = {2}
}

repository: vu-minh/thesisdown

repo_name: vu-minh/thesisdown


text:
package main

import (
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"net"
	"net/http"
	"os"
	"os/exec"
	"os/user"
	"path/filepath"
	"runtime"
	"text/template"
	"time"

	_ "embed"

	"github.com/progrium/macdriver/cocoa"
	"github.com/progrium/macdriver/core"
	"github.com/progrium/macdriver/objc"
	"github.com/progrium/macdriver/webkit"
	"github.com/progrium/watcher"
)

var (
	flagEdit  bool
	flagAgent bool

	dir string

	//go:embed index.html
	defaultIndex []byte

	//go:embed agent.plist
	plist string
)

func init() {
	runtime.LockOSThread()
	flag.BoolVar(&flagEdit, "edit", false, "edit your topframe")
	flag.BoolVar(&flagAgent, "agent", false, "generate agent plist")
}

func edit() {
	editor := os.Getenv("EDITOR")
	if editor == "" {
		log.Println("unable to edit, no value for EDITOR")
		return
	}
	if err := exec.Command(editor, dir).Run(); err != nil {
		log.Println(err)
	}
}

func main() {
	flag.Parse()

	var err error
	usr, err := user.Current()
	if err != nil {
		log.Fatal(err)
	}

	dir = filepath.Join(usr.HomeDir, ".topframe")
	os.MkdirAll(dir, 0755)

	if _, err := os.Stat(filepath.Join(dir, "index.html")); os.IsNotExist(err) {
		ioutil.WriteFile(filepath.Join(dir, "index.html"), defaultIndex, 0644)
	}

	if flagAgent {
		tmpl, err := template.New("plist").Parse(plist)
		if err != nil {
			log.Fatal(err)
		}
		bin, _ := filepath.Abs(os.Args[0])
		err = tmpl.Execute(os.Stdout, struct {
			Dir, Bin string
		}{
			Dir: dir,
			Bin: bin,
		})
		if err != nil {
			log.Fatal(err)
		}
		return
	}

	if flagEdit {
		go edit()
	}

	srv := http.Server{
		Handler: http.FileServer(http.Dir(dir)),
	}

	ln, err := net.Listen("tcp", ":0")
	if err != nil {
		log.Fatal(err)
	}

	go srv.Serve(ln)

	fw := watcher.New()
	if err := fw.AddRecursive(dir); err != nil {
		log.Fatal(err)
	}

	go fw.Start(400 * time.Millisecond)

	cocoa.TerminateAfterWindowsClose = false
	app := cocoa.NSApp_WithDidLaunch(func(notification objc.Object) {
		config := webkit.WKWebViewConfiguration_New()
		config.Preferences().SetValueForKey(core.True, core.String("developerExtrasEnabled"))

		wv := webkit.WKWebView_Init(cocoa.NSScreen_Main().Frame(), config)
		wv.SetOpaque(false)
		wv.SetBackgroundColor(cocoa.NSColor_Clear())
		wv.SetValueForKey(core.False, core.String("drawsBackground"))

		url := core.URL(fmt.Sprintf("http://localhost:%d", ln.Addr().(*net.TCPAddr).Port))
		req := core.NSURLRequest_Init(url)
		wv.LoadRequest(req)

		w := cocoa.NSWindow_Init(cocoa.NSScreen_Main().Frame(), cocoa.NSClosableWindowMask,
			cocoa.NSBackingStoreBuffered, false)
		w.SetContentView(wv)
		w.SetBackgroundColor(cocoa.NSColor_Clear())
		w.SetOpaque(false)
		w.SetTitleVisibility(cocoa.NSWindowTitleHidden)
		w.SetTitlebarAppearsTransparent(true)
		w.SetIgnoresMouseEvents(true)
		w.SetLevel(cocoa.NSMainMenuWindowLevel + 2)
		w.MakeKeyAndOrderFront(w)
		w.SetCollectionBehavior(cocoa.NSWindowCollectionBehaviorCanJoinAllSpaces)

		statusBar := cocoa.NSStatusBar_System().StatusItemWithLength(cocoa.NSVariableStatusItemLength)
		statusBar.Retain()
		statusBar.Button().SetTitle("🔲")

		itemInteract := cocoa.NSMenuItem_New()
		itemInteract.Retain()
		itemInteract.SetTitle("Interactive")
		itemInteract.SetAction(objc.Sel("interact:"))
		cocoa.DefaultDelegateClass.AddMethod("interact:", func(_ objc.Object) {
			if w.IgnoresMouseEvents() {
				fmt.Println("Mouse events on")
				w.SetLevel(cocoa.NSMainMenuWindowLevel - 1)
				w.SetIgnoresMouseEvents(false)
				itemInteract.SetState(1)
			} else {
				fmt.Println("Mouse events off")
				w.SetIgnoresMouseEvents(true)
				w.SetLevel(cocoa.NSMainMenuWindowLevel + 2)
				itemInteract.SetState(0)
			}
		})

		itemEnabled := cocoa.NSMenuItem_New()
		itemEnabled.Retain()
		itemEnabled.SetTitle("Enabled")
		itemEnabled.SetState(1)
		itemEnabled.SetAction(objc.Sel("enabled:"))
		cocoa.DefaultDelegateClass.AddMethod("enabled:", func(_ objc.Object) {
			if w.IsVisible() {
				w.Send("orderOut:", w)
				itemInteract.SetEnabled(false)
				itemEnabled.SetState(0)
			} else {
				w.Send("orderFront:", w)
				itemInteract.SetEnabled(true)
				itemEnabled.SetState(1)
			}
		})

		itemQuit := cocoa.NSMenuItem_New()
		itemQuit.SetTitle("Quit")
		itemQuit.SetAction(objc.Sel("terminate:"))

		menu := cocoa.NSMenu_New()
		menu.SetAutoenablesItems(false)
		menu.AddItem(itemEnabled)
		menu.AddItem(itemInteract)

		if os.Getenv("EDITOR") != "" {
			itemEdit := cocoa.NSMenuItem_New()
			itemEdit.SetTitle("Edit Source...")
			itemEdit.SetAction(objc.Sel("edit:"))
			cocoa.DefaultDelegateClass.AddMethod("edit:", func(_ objc.Object) {
				edit()
			})
			menu.AddItem(itemEdit)
		}

		menu.AddItem(cocoa.NSMenuItem_Separator())
		menu.AddItem(itemQuit)
		statusBar.SetMenu(menu)

		go func() {
			for {
				select {
				case event := <-fw.Event:
					if event.IsDir() {
						continue
					}
					wv.Reload(nil)
				case <-fw.Closed:
					return
				}
			}
		}()
	})
	app.ActivateIgnoringOtherApps(true)

	log.Printf("topframe 0.2.0 by progrium\n")
	app.Run()
}

repository: jpf/topframe

repo_name: jpf/topframe

branch_name: refs/heads/main


text:
@inproceedings{Du2020Query-efficient,
title={Query-efficient Meta Attack to Deep Neural Networks},
author={Jiawei Du and Hu Zhang and Joey Tianyi Zhou and Yi Yang and Jiashi Feng},
booktitle={International Conference on Learning Representations},
year={2020},
url={https://openreview.net/forum?id=Skxd6gSYDS}
}

url: https://raw.githubusercontent.com/Hugh-Shi/DL-NLP-Readings/924e4d189e5660c5b5d4854278f3df755ae2231d/Bibtex/Query-Efficient Meta Attack to Deep Neural Networks.bib

repository: Hugh-Shi/DL-NLP-Readings

repo_name: Hugh-Shi/DL-NLP-Readings