text:
package server

import (
	"crypto/tls"
	"testing"

	"github.com/miekg/dns"
	"github.com/stretchr/testify/assert"

	"github.com/natesales/doqd/pkg/client"
)

func TestServer(t *testing.T) {
	// Load the keypair for TLS
	cert, err := tls.LoadX509KeyPair("/tmp/cert.pem", "/tmp/key.pem")
	assert.Nil(t, err)

	// Create the QUIC listener
	doqServer, err := New("localhost:8853", cert, "1.1.1.1:53", false)
	assert.Nil(t, err)

	// Start the server
	go doqServer.Listen()

	// Create the DoQ client
	doqClient, err := client.New("localhost:8853", true, false)
	assert.Nil(t, err)

	// Create a test DNS query
	req := dns.Msg{
		Question: []dns.Question{{
			Name:   dns.Fqdn("example.com"),
			Qtype:  dns.StringToType["A"],
			Qclass: dns.ClassINET,
		}},
	}
	req.RecursionDesired = true

	// Send the query
	_, err = doqClient.SendQuery(req)
	assert.Nil(t, err)
}

repository: natesales/doqd

repo_name: natesales/doqd


text:
@InProceedings{PoseletsICCV09,
  author       = "Lubomir Bourdev and Jitendra Malik",
  title        = "Poselets: Body Part Detectors Trained Using 3D Human Pose Annotations",
  booktitle    = "Computer Vision, 2009 IEEE 12th International Conference on",
  month        = "Sept",
  year         = "2009",
  page		   = "1365-1372",
  url          = "http://www.eecs.berkeley.edu/~lbourdev/poselets",
  keywords     = {Clustering algorithms;Detectors;Face detection;Head;Humans;Image segmentation;Shoulder;Support vector machine classification;Support vector machines;Torso},
  doi          = {10.1109/ICCV.2009.5459303},
  ISSN         = {1550-5499}
}

license: MIT

repository: seonho/blog

license_type: permissive

repo_name: seonho/blog

branch_name: refs/heads/master

extension: bib


text:
# Copyright (c) 2018 Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: MIT

SUMMARY="Public mbed Cloud client for mbed Linux"
DESCRIPTION="Provides a mechanism to access ARM's mbed Cloud services from mbed Linux"
HOMEPAGE="https://github.com/ARMmbed/mbl-core/tree/master/cloud-services/mbl-cloud-client"

LICENSE="Apache-2.0"
LIC_FILES_CHKSUM = "file://${S}/LICENSE.Apache-2.0;md5=e3fc50a88d0a364313df4b21ef20c29e"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

S = "${WORKDIR}/git"

# common sources for mbl-cloud-client(public) and mbl-cloud-client-internal
SRC_URI_COMMON = "file://yocto-toolchain.cmake \
  file://arm_update_local_config.sh \
  file://mbl-cloud-client.service \
  "

# specific sources for the mbl-cloud-client public version
SRC_URI_MBL_CLOUD_CLIENT_PUBLIC = "${SRC_URI_MBL_CORE_REPO} \
  file://arg_too_long_fix_1.patch;patchdir=${S} \
  file://arg_too_long_fix_2.patch;patchdir=${S}/cloud-services/mbl-cloud-client/mbed-cloud-client \
  file://linux-paths-update-client-pal-filesystem.patch;patchdir=${S}/cloud-services/mbl-cloud-client/mbed-cloud-client \
  file://check-min-pthread-stack-size.patch;patchdir=${S}/cloud-services/mbl-cloud-client/mbed-cloud-client \
  "

# all sources for the mbl-cloud-client public version
SRC_URI = "${SRC_URI_COMMON} ${SRC_URI_MBL_CLOUD_CLIENT_PUBLIC}"

SRCREV = "${SRCREV_MBL_CORE_REPO}"

DEPENDS = " glibc jsoncpp xz util-linux"
RDEPENDS_${PN} += "${PN}-update"

RDEPENDS_${PN} = "\
    e2fsprogs-mke2fs \
    libgcc \
    libstdc++ \
    util-linux \
    mbl-dbus-cloud \
"

# Installed packages
PACKAGES = "${PN}-dbg ${PN} ${PN}-update"

FILES_${PN} += "\
    /opt/arm/mbl-cloud-client \
    /opt/arm/pelion-provisioning-util \
    ${sysconfdir}/logrotate.d/mbl-cloud-client-logrotate.conf \
"
FILES_${PN}-update = "\
    /opt/arm/arm_update_activate.sh \
    /opt/arm/arm_update_active_details.sh \
    /opt/arm/arm_update_cmdline.sh \
    /opt/arm/arm_update_common.sh \
    /opt/arm/arm_update_local_config.sh \
"

FILES_${PN}-dbg += "/opt/arm/.debug \
                    /usr/src/debug/mbl-cloud-client"

# !!!
# Note: currently, we use x86_x64 PC Linux PAL platform implementation that is intented
# for test purposes. That means, that we have test-quality code with possible defects
# and other non-production code issues.
TARGET = "x86_x64_NativeLinux_mbedtls"

export SSH_AUTH_SOCK

# Allowed [Debug|Release]
RELEASE_TYPE="Debug"

inherit pythonnative
inherit cmake
inherit systemd

SYSTEMD_SERVICE_${PN} = "mbl-cloud-client.service"

do_setup_pal_env() {
    echo "Setup pal env"
    CUR_DIR=$(pwd)

    cd "${S}/cloud-services/mbl-cloud-client/"

    # Clean the old build directory
    rm -rf "__${TARGET}"
    mbed deploy --protocol ssh
    python ./pal-platform/pal-platform.py -v deploy --target="${TARGET}" generate
    cd ${CUR_DIR}
}

addtask setup_pal_env after do_unpack before do_patch
do_setup_pal_env[depends] += "mbed-cli-native:do_populate_sysroot"
do_setup_pal_env[depends] += "python-click-native:do_populate_sysroot"
do_setup_pal_env[depends] += "python-requests-native:do_populate_sysroot"
do_setup_pal_env[depends] += "python-urllib3-native:do_populate_sysroot"
do_setup_pal_env[depends] += "python-chardet-native:do_populate_sysroot"
do_setup_pal_env[depends] += "python-certifi-native:do_populate_sysroot"
do_setup_pal_env[depends] += "python-idna-native:do_populate_sysroot"

do_configure() {
    CUR_DIR=$(pwd)
    cd "${S}/cloud-services/mbl-cloud-client/__${TARGET}"
    cp "${WORKDIR}/yocto-toolchain.cmake" "${S}/cloud-services/mbl-cloud-client/pal-platform/Toolchain/GCC"

    cmake -G "Unix Makefiles" \
          -DCMAKE_BUILD_TYPE="${RELEASE_TYPE}" \
          -DCMAKE_TOOLCHAIN_FILE="${S}/cloud-services/mbl-cloud-client/pal-platform/Toolchain/GCC/yocto-toolchain.cmake" \
          -DEXTARNAL_DEFINE_FILE="${S}/cloud-services/mbl-cloud-client/define.txt"

    cd ${CUR_DIR}
}

do_compile() {
    CUR_DIR=$(pwd)
    cd "${S}/cloud-services/mbl-cloud-client/__${TARGET}"
    oe_runmake mbl-cloud-client
    oe_runmake pelion-provisioning-util
    cd ${CUR_DIR}
}

do_install() {
    install -d "${D}/opt/arm"
    install "${S}/cloud-services/mbl-cloud-client/__${TARGET}/${RELEASE_TYPE}/mbl-cloud-client" "${D}/opt/arm"
    install "${S}/cloud-services/mbl-cloud-client/__${TARGET}/${RELEASE_TYPE}/pelion-provisioning-util" "${D}/opt/arm"

    install -m 755 "${S}/cloud-services/mbl-cloud-client/scripts/arm_update_activate.sh" "${D}/opt/arm"
    install -m 755 "${S}/cloud-services/mbl-cloud-client/scripts/arm_update_active_details.sh" "${D}/opt/arm"
    install -m 755 "${S}/cloud-services/mbl-cloud-client/scripts/arm_update_common.sh" "${D}/opt/arm"
    install -m 755 "${S}/cloud-services/mbl-cloud-client/mbed-cloud-client/update-client-hub/modules/pal-linux/scripts/arm_update_cmdline.sh" "${D}/opt/arm"
    install -m 755 "${WORKDIR}/arm_update_local_config.sh" "${D}/opt/arm"

    install -d "${D}${systemd_unitdir}/system/"
    install -m 0644 "${WORKDIR}/mbl-cloud-client.service" "${D}${systemd_unitdir}/system/"
}

# Add a logrotate config files
MBL_LOGROTATE_CONFIG_LOG_NAMES = "mbl-cloud-client arm_update_active_details arm_update_activate"

MBL_LOGROTATE_CONFIG_LOG_PATH[mbl-cloud-client] = "/var/log/mbl-cloud-client.log"
MBL_LOGROTATE_CONFIG_SIZE[mbl-cloud-client] ?= "1M"
MBL_LOGROTATE_CONFIG_ROTATE[mbl-cloud-client] ?= "4"
MBL_LOGROTATE_CONFIG_POSTROTATE[mbl-cloud-client] = "/usr/bin/killall -HUP mbl-cloud-client"

MBL_LOGROTATE_CONFIG_LOG_PATH[arm_update_active_details] = "/var/log/arm_update_active_details.log"
MBL_LOGROTATE_CONFIG_SIZE[arm_update_active_details] ?= "128k"
MBL_LOGROTATE_CONFIG_ROTATE[arm_update_active_details] ?= "4"

MBL_LOGROTATE_CONFIG_LOG_PATH[arm_update_activate] = "/var/log/arm_update_activate.log"
MBL_LOGROTATE_CONFIG_SIZE[arm_update_activate] ?= "128k"
MBL_LOGROTATE_CONFIG_ROTATE[arm_update_activate] ?= "4"

inherit mbl-logrotate-config

repository: lin-zeng-arm/meta-mbl

repo_name: lin-zeng-arm/meta-mbl

extension: bb


text:
@inproceedings{pimentel+al.arxiv22,
  title = {Cluster-based Evaluation of Automatically Generated Text},
  venue = {arXiv},
  year = {2022},
  arXiv = {https://arxiv.org/abs/2205.16001},
  author = {Pimentel, Tiago and
	Meister, Clara and
	Cotterell, Ryan},
  booktitle = {arXiv},
  abstract = {While probabilistic language generators have improved dramatically over the last few years, the automatic evaluation metrics used to assess them have not kept pace with this progress. In the domain of language generation, a good metric must correlate highly with human judgements. Yet, with few exceptions, there is a lack of such metrics in the literature. In this work, we analyse the general paradigm of language generator evaluation. We first discuss the computational and qualitative issues with using automatic evaluation metrics that operate on probability distributions over strings, the backbone of most language generators. We then propose the use of distributions over clusters instead, where we cluster strings based on their text embeddings (obtained from a pretrained language model). While we find the biases introduced by this substitution to be quite strong, we observe that, empirically, this methodology leads to metric estimators with higher correlation with human judgements, while simultaneously reducing estimator variance. We finish the paper with a probing analysis, which leads us to conclude that -- by encoding syntactic- and coherence-level features of text, while ignoring surface-level features -- these clusters may simply be better equipped to evaluate state-of-the-art language models.},
  url = {https://arxiv.org/abs/2205.16001},
}

repository: rycolab/website

repo_name: rycolab/website


text:
@misc{AddressingIllegalWildlife,
  title = {Addressing {{Illegal Wildlife Trade}} in the {{Philippines}}},
  publisher = {{Asian Development Bank}},
  url = {https://www.adb.org/sites/default/files/publication/490006/addressing-illegal-wildlife-trade-philippines.pdf},
  urldate = {2021-08-25},
  langid = {english}
}

@online{DefinitionNaturalResource,
  title = {Definition of Natural Resource - {{Merriam}}-{{Webster}}'s {{Student Dictionary}}},
  url = {http://wordcentral.com/cgi-bin/student?natural+resource},
  urldate = {2021-10-01},
  file = {C\:\\Users\\home\\Zotero\\storage\\6QD88MYD\\student.html}
}

@online{DefinitionWHISTLEBLOWER,
  title = {Definition of {{WHISTLEBLOWER}}},
  url = {https://www.merriam-webster.com/dictionary/whistleblower},
  urldate = {2021-10-11},
  abstract = {one who reveals something covert or who informs against another; especially : an employee who brings wrongdoing by an employer or by other employees to the attention of a government or law enforcement agency… See the full definition},
  langid = {english},
  file = {C\:\\Users\\home\\Zotero\\storage\\HT6AIFNI\\whistleblower.html}
}

@online{DepositionGeologyDefinition2019,
  title = {Deposition {{Geology}}: Definition, {{Examples}}, and {{Facts}}},
  shorttitle = {Deposition {{Geology}}},
  date = {2019-05-25T11:36:43+00:00},
  url = {https://geologydegree.org/deposition-geology/},
  urldate = {2021-10-01},
  abstract = {Deposition takes place due to the interference of natural phenomena such as wind and water into the surface of the Earth. See here facts about Deposition.},
  langid = {american},
  organization = {{Geology Degree}},
  file = {C\:\\Users\\home\\Zotero\\storage\\9JISACJS\\deposition-geology.html}
}

@online{frki2BlockReferenceAvailable2020,
  type = {Reddit Post},
  title = {Block Reference - Available},
  author = {Frki2},
  date = {2020-10-19T22:01:07},
  url = {www.reddit.com/r/ObsidianMD/comments/jebwix/block_reference_available/},
  urldate = {2021-10-05},
  organization = {{r/ObsidianMD}},
  file = {C\:\\Users\\home\\Zotero\\storage\\VH3PRZWM\\block_reference_available.html}
}

@online{KeyElementsReport,
  title = {The {{Key Elements}} of a {{Report}}, {{Student}} Resources, {{Department}} of {{Accountancy}} \& {{Finance}}, {{University}} of {{Otago}}, {{New Zealand}}},
  url = {https://www.otago.ac.nz/accountancyfinance/student-resources/otago01515115.html},
  urldate = {2021-10-05},
  file = {C\:\\Users\\home\\Zotero\\storage\\2WW88WQC\\otago01515115.html}
}

@video{linEP02ZettelkastenMethod20,
  title = {{{EP02}} - {{Zettelkasten Method}}},
  shorttitle = {Zettelkasten {{Method}}},
  editor = {Lin, Jingjing},
  date = {0020-07-03},
  location = {{Kyoto University}},
  url = {https://youtu.be/mtvVjNgDHrg},
  urldate = {2021-07-22},
  editortype = {director},
  langid = {english},
  keywords = {Notetaking,Zettelkasten},
  note = {The slides.
\par
\href{https://sites.google.com/view/rgm-kyotou/events/ep02-zettelkasten}{https://sites.google.com/view/rgm-kyotou/events/ep02-zettelkasten}
\par
Description of the video:
\par
Zettelkasten Method: Take Smart Notes along Scholarly Reading This is the second online sharing session of Kyoto University Research Methodology Group. It is dedicated to introducing how to use Niklas Luhmann's slip box system to take smart notes and build up contents for academic writing. The presentation slides are available here: \href{https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbVBIdDFqQm90V1h2cVFna3hXMGNyd0l4TjlRZ3xBQ3Jtc0tuZEdTQ1F1OF80VTl0TjFjc0lpcEc3bmpyYVVqejlSbW44NTU2T2tiOFBaTkpmVENNMTZFV21ORlpvejZtY3A1cl9Ra1R0ZmJSTWg2QVdqU2trSWpCOEJnTE1VMUw3VE5GRk9qR3pYZzRkY2Q1LWloNA&q=https%3A%2F%2Fsites.google.com%2Fview%2Frgm-kyotou%2Fevents%2Fep02-zettelkasten}{https://sites.google.com/view/rgm-kyo...} You can find the graphic of the knowledge map of Luhmann's notes on this page: \href{https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbmtTai1EbEJHMWFWbGxoekdaZjFFdGNETjREZ3xBQ3Jtc0ttbG82MWg5cWxhN0ZTRDJSdWMxdWpFcjJCRXZvMnJlZm1McW5ZN0ZPekJCbEFuR19DMHBUZFJWSm5FS1BIU3kybzZtU0t6ZVdBSXIxZkRmRjV2Zy1aZXNNelRmYjZLd3lmTGRyRDVWNU9NN3k0WWlrcw&q=https%3A%2F%2Fwww.yuque.com%2Fyichu%2Fselflearning%2Fsayuyw}{https://www.yuque.com/yichu/selflearn...} The link to the Slipbox system's note analysis work is here: \href{https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqa01mZkluaEFvWC1GSnBpN0dwNHVTQUcyNTVsZ3xBQ3Jtc0ttS3F0RW5rb0REWFBUMkktSXlfSl9aTmJ5Q2dNcEVZUGxjM0EtOHJvekthMHNNRDZBUUJqMnNQakp4SmJPNUdpd1IwQUxQZm5sWGNPaGZPSlpETVRmMEI5RXcxU3lwWmZrWG9fQ0FzUFVGa1RnSHZnOA&q=https%3A%2F%2Fniklas-luhmann-archiv.de%2F}{https://niklas-luhmann-archiv.de/}}
}

@online{LinkBlocks,
  title = {Link to Blocks},
  url = {https://help.obsidian.md/How+to/Link+to+blocks},
  urldate = {2021-10-05},
  file = {C\:\\Users\\home\\Zotero\\storage\\GVJ5FAZZ\\Link+to+blocks.html}
}

@video{mitopencoursewareHowSpeakPatrick2019,
  title = {How {{To Speak}} by {{Patrick Winston}}},
  editor = {{MIT OpenCourseWare}},
  date = {2019-12-20},
  url = {https://www.youtube.com/watch?v=Unzc731iCUY},
  urldate = {2021-10-11},
  abstract = {MIT How to Speak, IAP 2018 Instructor: Patrick Winston View the complete course: https://ocw.mit.edu/how\_to\_speak Patrick Winston's How to Speak talk has been an MIT tradition for over 40 years. Offered every January, the talk is intended to improve your speaking ability in critical situations by teaching you a few heuristic rules. 00:16 - Introduction 03:11 - Rules of Engagement 04:15 - How to Start 05:38 - Four Sample Heuristics 10:17 - The Tools: Time and Place 13:24 - The Tools: Boards, Props, and Slides 36:30 - Informing: Promise, Inspiration, How To Think 41:30 - Persuading: Oral Exams, Job Talks, Getting Famous 53:06  - How to Stop: Final Slide, Final Words 56:35 - Final Words: Joke, Thank You, Examples License: Creative Commons BY-NC-SA More information at https://ocw.mit.edu/terms More courses at https://ocw.mit.edu},
  editortype = {director}
}

@online{NoCollateralBusiness,
  title = {No {{Collateral Business Loan}}},
  url = {https://www.securitybank.com/business/loans/sme-business-express/},
  urldate = {2021-10-05},
  abstract = {Apply and enjoy a flexible and no collateral business loan.},
  langid = {american},
  organization = {{Security Bank Philippines}},
  file = {C\:\\Users\\home\\Zotero\\storage\\ZVEP3WX3\\sme-business-express.html}
}

@online{SMELoanInterest,
  title = {{{SME Loan Interest Rates}} | {{BDO Unibank}}, {{Inc}}.},
  url = {https://www.bdo.com.ph/personal/loans/sme-loan/interest-rate},
  urldate = {2021-10-05},
  file = {C\:\\Users\\home\\Zotero\\storage\\XLRRYWKD\\interest-rate.html}
}

@online{UNFCUNECE,
  title = {About {{UNFC}} | {{UNECE}}},
  url = {https://unece.org/sustainable-energyunfc-and-sustainable-resource-management/about-unfc},
  urldate = {2021-10-01},
  file = {C\:\\Users\\home\\Zotero\\storage\\JJTNF93I\\about-unfc.html}
}

@online{WEEK10Google,
  title = {{{WEEK}} 10 - {{Google Drive}}},
  url = {https://drive.google.com/drive/folders/1vtj1SzxXwS83vVaFwZtdX7iNEuIBvFIi},
  urldate = {2021-10-05},
  file = {C\:\\Users\\home\\Zotero\\storage\\GETMDLMP\\1vtj1SzxXwS83vVaFwZtdX7iNEuIBvFIi.html}
}

repository: Rekeii/collab

path: /09 References/note-taking.bib

repo_name: Rekeii/collab

branch_name: refs/heads/main


text:
% reference for information about hex-tiling

@article{vartak2014a,
   author = {Vartak, Manasi and Madden, Samuel and Parameswaran, Aditya and Polyzotis, Neoklis},
   title = {SeeDB: Automatically Generating Query Visualizations},
   year = {2014},
   journal = {Proceedings of the {VLDB Endowment}},
   volume = {7},
   number = {13},
   issn = {2150-8097},
   doi = {10.14778/2733004.2733035},
   month = aug,
   pages = {1581--1584},
   numpages = {4}
}

@web{uberh3-validhex-issue,
   Title       = "Q: Invalidity of Polygons in GeoJSON, GeoPandas",
   Author      = {Tony {\relax Abou Zeidan}},
   url         = "https://github.com/uber/h3-py/issues/187",
   AccessDate  = {July 2021},
   Year        = "2021"
}

@web{plotly-web,
   Title       = "Plotly Python Open Source Graphing Library",
   Key         = "Plotly Docs",
   Publisher   = "Plotly",
   Author	   = "Plotly",
   url         = "https://plotly.com/python/",
   AccessDate  = {March 2021},
   Year        = "2021"
}

@web{plotly-colorbar-issue,
   Title       = "[Feature Request | Bug Report] Plot Area / Colorbar Size Variance (Geos)",
   Author      = {Tony {\relax Abou Zeidan}},
   url         = "https://github.com/plotly/plotly.py/issues/3288",
   AccessDate  = {July 2021},
   Year        = "2021"
}

@article{bertazzon2013a,
   author = {Bertazzon, Stefania},
   year = {2013},
   month = {01},
   pages = {67--72},
   title = {Rethinking GIS teaching to bridge the gap between technical skills and geographic knowledge},
   volume = {1},
   journal = {Journal of Research and Didactics in Geography}
}

@web{dangermond2021a,
   Title       = "ArcGIS Online",
   Author      = {Ersi},
   url         = "https://www.arcgis.com/",
   AccessDate  = ma,
   Year        = "2021"
}

@Manual{qgis,
      title = {QGIS Geographic Information System},
      author = {{QGIS Development Team}},
      organization = {QGIS Association},
      year = {2021},
      url = {https://www.qgis.org},
}

@web{kaggle2021a,
  title = {Aerial Bombing Operations in {W}orld {W}ar II},
  author = {Jenns Robertson},
  url = {https://www.kaggle.com/usaf/world-war-ii},
  accessdate = {1 October 2021},
  year = {2017}
}

@ARTICLE{bostock2021a,
   author={Bostock, Michael and Ogievetsky, Vadim and Heer, Jeffrey},
   journal={IEEE Transactions on Visualization and Computer Graphics},
   title={D3 Data-Driven Documents},
   year={2011},
   volume={17},
   number={12},
   pages={2301--2309},
   doi={10.1109/TVCG.2011.185}
}

@web{arcgis-limits,
   Title       = "ArcGIS Review: Is ArcMap the Best GIS Software?",
   Author      = "GISGeography",
   url         = "https://gisgeography.com/esri-arcgis-software-review-guide/",
   AccessDate  = aug # " 2021",
   Year        = "2021"
}

% reference for discussing limits of D3
@web{d3-limits,
   Title       = "D3 in Depth: Geographic",
   Author	   = "Peter Cook",
   Key         = "D3 Concepts",
   url         = "https://www.d3indepth.com/geographic/",
   AccessDate  = may # " 2021",
   Year        = "2021"
}

% reference for discussing limits of QGIS
@web{qgis-limits,
   Title       = "Pros and Cons of QGIS",
   Author	   = "GrindGIS",
   url         = "https://grindgis.com/software/pros-and-cons-of-qgis",
   AccessDate  = may # " 2021",
   Year        = "2021"
}

% reference for discussing limits of gis systems as a whole
@article{sipe2003a,
   Author      = {Neil Sipe and Pat Dale},
   Title       = {Challenges in using geographic information systems {(GIS)} to understand and control malaria in Indonesia},
   Journal     = {Malaria Journal},
   Year        = {2003},
   volume      = 2,
   number      = 36,
   doi         = {10.1186/1475-2875-2-36},
}

@web{mckinney2021a,
   Title       = "pandas.DataFrame",
   Key         = "Pandas DataFrame Docs",
   Author      = "Wes McKinney",
   url         = "https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html",
   AccessDate  = mar # " 2021",
   Year        = "2021"
}

@web{naturalearth-data,
   Author      = "NaturalEarth",
   Title       = "Natural Earth---Free vector and raster map data at 1:10m, 1:50m, and 1:110m scales",
   url         = "https://www.naturalearthdata.com/",
   Year        = "2021",
   accessdate  = {September 2021}
}

@article{laskey2010a,
   title = {Envisioning uncertainty in geospatial information},
   journal = {International Journal of Approximate Reasoning},
   volume = {51},
   number = {2},
   pages = {209--223},
   year = {2010},
   issn = {0888-613X},
   doi = {10.1016/j.ijar.2009.05.011},
   author = {Laskey, {\relax Kathryn Blackmond} and Wright, Edward J. and {\relax da Costa}, {\relax Paulo C. G.}}
}

@article{carr1992a,
author = { Daniel B.   Carr  and  Anthony R.   Olsen  and  Denis   White },
title = {Hexagon Mosaic Maps for Display of Univariate and Bivariate Geographical Data},
journal = {Cartography and Geographic Information Systems},
volume = {19},
number = {4},
pages = {228--236},
year  = {1992},
publisher = {Taylor \& Francis},
doi = {10.1559/152304092783721231}
}

@techreport{goodrich2019a,
   title={Automated geospatial watershed assessment (AGWA) to aid in sustaining military mission and training},
   author={Goodrich, David C and Heilman, Philip and Guertin, DP and Levick, Lainie R and Burns, IS and Armendariz, Gerardo and Wei, Haiyan},
   year={2019},
   institution={USDA-ARS Southwest Watershed Research Center (SWRC) Tucson United States},
   url = {https://apps.dtic.mil/sti/citations/AD1092333}
}

@techreport{abouzeidan2021a,
  title = {Geo{H}ex{Viz}---{G}eospatial visualization using hexagonal binning software: {D}esign reference and instruction manual},
  author = {{Abou Zeidan}, T. and Rempel, M.},
  year = {2021},
  institution = {Defence Research and Development Canada},
  number = {DRDC-RDDC-2021-D183},
  url = {https://cradpdf.drdc-rddc.gc.ca/PDFS/unc381/p814091_A1b.pdf}
}

@article{feibush2000a,
   author = {Feibush, E. and Gagvani, N. and Williams, D.},
   journal = {IEEE Computer Graphics and Applications},
   title = {Visualization for situational awareness},
   year = {2000},
   volume = {20},
   number = {5},
   pages = {38--45},
   doi = {10.1109/38.865878}
}

@web{layer-definition,
   Title       = "What is a layer?",
   Publisher   = "Caliper Mapping and Transportation Glossary",
   Author	   = "Caliper",
   url         = "https://www.caliper.com/glossary/what-is-a-map-layer.htm",
   AccessDate  = oct # " 2021",
   Year        = "2021"
}

@web{jordahl2021a,
   Title       = "GeoPandas (0.9.0)",
   Author     = "Kelsey Jordahl",
   Key         = "GeoPandas Desc",
   url         = "https://geopandas.org/index.html",
   AccessDate  = mar # " 2021",
   Year        = "2021"
}

@web{gunviolence,
  title = {Standard reports},
  author = {Gun Violence Archive},
  url = {https://www.gunviolencearchive.org/reports},
  accessdate = {14 September 2021},
  year = 2021
}

@web{sinha2019a,
   Title       = "Spatial Modelling Tidbits: Honeycomb or Fishnets?",
   Author      = "Aditi Sinha",
   Publisher   = "Towards Data Science",
   url         = "https://towardsdatascience.com/spatial-modelling-tidbits-honeycomb-or-fishnets-7f0b19273aab",
   AccessDate  = mar # " 2021",
   Year        = "2019"
}

@article{rectangles,
   author = {Birch, Colin and Oom, Sander and Beecham, Jonathan},
   year = {2007},
   month = {08},
   pages = {347-359},
   title = {Rectangular and hexagonal grids used for observation, experiment and simulation in ecology},
   volume = {206},
   journal = {Ecological Modelling},
   doi = {10.1016/j.ecolmodel.2007.03.041}
}

@article{rectangles,
   author = {Birch, Colin and Oom, Sander and Beecham, Jonathan},
   year = {2007},
   month = {08},
   pages = {347-359},
   title = {Rectangular and hexagonal grids used for observation, experiment and simulation in ecology},
   volume = {206},
   journal = {Ecological Modelling},
   doi = {10.1016/j.ecolmodel.2007.03.041}
}

@web{binning2,
   Title       = "Using a binning technique for point-based multiscale web maps",
   Author      = "Kenneth Field",
   Key         = "Mapping",
   Publisher   = "ArcGIS Online",
   url         = "https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/using-a-binning-technique-for-point-based-multiscale-web-maps/",
   AccessDate  = apr # " 2021",
   Year        = "2012"
}

@article{battersby2017a,
   author = {Sarah E. Battersby and Strebe, Daniel and Michael P. Finn},
   title = {Shapes on a plane: evaluating the impact of projection distortion on spatial binning},
   journal = {Cartography and Geographic Information Science},
   volume = {44},
   number = {5},
   pages = {410--421},
   year  = {2017},
   publisher = {Taylor \& Francis},
   doi = {10.1080/15230406.2016.1180263},
   URL = {https://doi.org/10.1080/15230406.2016.1180263}
}

@misc{sinsha2019a,
   title={Spatial Modelling Tidbits: Honeycomb or Fishnets?},
   author={Aditi Sinha},
   publisher={Towards Data Science},
   url={https://towardsdatascience.com/spatial-modelling-tidbits-honeycomb-or-fishnets-7f0b19273aab},
   year={2019}
}
@article{rickles2017a,
author = {Rickles, Patrick and Ellul, Claire and Haklay, Muki},
title = {A suggested framework and guidelines for learning GIS in interdisciplinary research},
journal = {Geo: Geography and Environment},
volume = {4},
number = {2},
pages = {e00046},
doi = {10.1002/geo2.46},
year = {2017}
}

% reference for UberH3 github repo
@misc{uber-H3,
	author = {{Uber Technologies, Inc.}},
	title = {H3: A Hexagonal Hierarchical Geospatial Indexing System},
	year = {2020},
	url = {https://h3geo.org}
}

@inproceedings{shaito2021a,
author = {Shaito, Mohammad and Elmasri, Ramez},
title = {Map Visualization Using Spatial and Spatio-Temporal Data: Application to COVID-19 Data},
year = {2021},
isbn = {9781450387927},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
doi = {10.1145/3453892.3461336},
booktitle = {The 14th Prvasive Technologies Related to Assistive Environments Conference},
pages = {284–-291},
numpages = {8},
location = {Corfu, Greece},
series = {PETRA 2021}
}

@techreport{hunter2021a,
   author      = {Gregory Hunter and Jim Chan and Mark Rempel},
   title       = {Assessing the Impact of Infrastructure on Arctic Operations},
   number      = {DRDC-RDDC-2021-R024},
   type        = {Scientific Report},
   year        = {2021},
   institution = {{Defence Research and Development Canada}},
   address = {Ottawa, Canada},
   url = {https://cradpdf.drdc-rddc.gc.ca/PDFS/unc356/p812844_A1b.pdf}
}

% reference for Plotly Python github repo
@misc{plotly-py,
	author = {A. M. Smith and K. Thaney and M. Hahnel},
	title = {plotly.py: The interactive graphing library for Python},
	year = {2020},
	publisher = {GitHub},
	journal = {GitHub repository},
	url = {https://github.com/plotly/plotly.py}
}

% reference for GeoPandas github repo
@misc{geopandas,
	author = {A. M. Smith and K. Thaney and M. Hahnel},
	title = {GeoPandas: Python tools for geographic data},
	year = {2020},
	publisher = {GitHub},
	journal = {GitHub repository},
	url = {https://github.com/geopandas/geopandas}
}

% reference for ArcGIS website
@misc{arcgis,
	title={ArcGIS Online},
	url={https://www.arcgis.com/},
	journal={ArcGIS}
}

% reference for D3 website
@misc{d3,
	title={Data-Driven Documents},
	url={https://d3js.org/},
	journal={D3.js},
	author={Bostock, Mike}
}

% the reference for describing the limitations of ArcGIS
@misc{arcgis_limits,
	title={Pros and Cons of ArcGIS},
	url={https://grindgis.com/software/pros-and-cons-of-arcgis},
	journal={Grind GIS},
	year={2019},
	month={Sep}
}

% the reference for describing the limitations of QGIS
@misc{qgis_limits,
	title={Pros and Cons of QGIS},
	url={https://grindgis.com/software/pros-and-cons-of-qgis},
	journal={Grind GIS},
	year={2019},
	month={Dec}
}

% the reference for describing the limitations of D3
@misc{d3_limits,
	title={D3 in Depth - Geographic},
	url={https://www.d3indepth.com/geographic/},
	journal={D3 in Depth},
	year={2021},
	month={May}
}

% the reference for describing the overall limitations of most GIS software
@article{gis_limits,
   author={Neil G. Sipe and Pat Dale},
   title={Challenges in using geographic information systems (GIS) to understand and control malaria in {I}ndonesia},
   journal={Malaria Journal},
   year={2003}
}

% reference for describing a little background information of binning
@misc{binning_info,
	title={Binning in GIS},
	url={https://www.gislounge.com/binning-gis/},
	journal={GIS Lounge},
	author={Briney, Amanda and Newcomb, Doug},
	year={2017},
	month={Nov}
}

% reference for the 180th meridian issue
@misc{macwright2016a,
	title={The 180th Meridian},
	url={https://macwright.com/2016/09/26/the-180th-meridian.html},
	journal={macwright.com},
	author={MacWright, Tom},
   year = {2016}
}

repository: mrempel/geohexviz

repo_name: mrempel/geohexviz

gha_license_id: MIT

gha_language: Python


text:
require xorg-driver-video.inc

DESCRIPTION = "I740 for X11"

PE = "1"
SRC_URI[archive.md5sum] = "57302e225060a7286ae1a970c87a589b"
SRC_URI[archive.sha256sum] = "b8f2144c987d8a14f8b477ee3aa43fc1c76d040a77e40938c3c97c8e34e2b7c5"


text:
@inproceedings{yao2019stfnets,
 author = {Yao, Shuochao and Piao, Ailing and Jiang, Wenjun and Zhao, Yiran and Shao, Huajie and Liu, Shengzhong and Liu, Dongxin and Li, Jinyang and Wang, Tianshi and Hu, Shaohan and others},
 booktitle = {The World Wide Web Conference},
 month = {5},
 organization = {ACM},
 pages = {2192--2202},
 title = {STFNets: Learning sensing signals from the time-frequency perspective with short-time fourier neural networks},
 year = {2019}
}

repository: aiot-cps/aiot-cps-assembly

repo_name: aiot-cps/aiot-cps-assembly


text:
package privval

import (
	"fmt"
	"net"
	"sync"
	"time"

	"github.com/tendermint/tendermint/crypto"
	cmn "github.com/tendermint/tendermint/libs/common"
	"github.com/tendermint/tendermint/libs/log"
	"github.com/tendermint/tendermint/types"
)

const (
	defaultHeartbeatSeconds = 2
	defaultMaxDialRetries   = 10
)

var (
	heartbeatPeriod = time.Second * defaultHeartbeatSeconds
)

// SignerValidatorEndpointOption sets an optional parameter on the SocketVal.
type SignerValidatorEndpointOption func(*SignerValidatorEndpoint)

// SignerValidatorEndpointSetHeartbeat sets the period on which to check the liveness of the
// connected Signer connections.
func SignerValidatorEndpointSetHeartbeat(period time.Duration) SignerValidatorEndpointOption {
	return func(sc *SignerValidatorEndpoint) { sc.heartbeatPeriod = period }
}

// SocketVal implements PrivValidator.
// It listens for an external process to dial in and uses
// the socket to request signatures.
type SignerValidatorEndpoint struct {
	cmn.BaseService

	listener net.Listener

	// ping
	cancelPingCh    chan struct{}
	pingTicker      *time.Ticker
	heartbeatPeriod time.Duration

	// signer is mutable since it can be reset if the connection fails.
	// failures are detected by a background ping routine.
	// All messages are request/response, so we hold the mutex
	// so only one request/response pair can happen at a time.
	// Methods on the underlying net.Conn itself are already goroutine safe.
	mtx sync.Mutex

	// TODO: Signer should encapsulate and hide the endpoint completely. Invert the relation
	signer *SignerRemote
}

// Check that SignerValidatorEndpoint implements PrivValidator.
var _ types.PrivValidator = (*SignerValidatorEndpoint)(nil)

// NewSignerValidatorEndpoint returns an instance of SignerValidatorEndpoint.
func NewSignerValidatorEndpoint(logger log.Logger, listener net.Listener) *SignerValidatorEndpoint {
	sc := &SignerValidatorEndpoint{
		listener:        listener,
		heartbeatPeriod: heartbeatPeriod,
	}

	sc.BaseService = *cmn.NewBaseService(logger, "SignerValidatorEndpoint", sc)

	return sc
}

//--------------------------------------------------------
// Implement PrivValidator

// GetPubKey implements PrivValidator.
func (ve *SignerValidatorEndpoint) GetPubKey() crypto.PubKey {
	ve.mtx.Lock()
	defer ve.mtx.Unlock()
	return ve.signer.GetPubKey()
}

// SignVote implements PrivValidator.
func (ve *SignerValidatorEndpoint) SignVote(chainID string, vote *types.Vote) error {
	ve.mtx.Lock()
	defer ve.mtx.Unlock()
	return ve.signer.SignVote(chainID, vote)
}

func (ve *SignerValidatorEndpoint) SigCrossMerkleRoot(SigCrossMerkleRoot []byte, Blockhash []byte, vote *types.Vote) error {
	ve.mtx.Lock()
	defer ve.mtx.Unlock()
	return ve.signer.SigCrossMerkleRoot(SigCrossMerkleRoot, Blockhash, vote)
}

// SignProposal implements PrivValidator.
func (ve *SignerValidatorEndpoint) SignProposal(chainID string, proposal *types.Proposal) error {
	ve.mtx.Lock()
	defer ve.mtx.Unlock()
	return ve.signer.SignProposal(chainID, proposal)
}

//--------------------------------------------------------
// More thread safe methods proxied to the signer

// Ping is used to check connection health.
func (ve *SignerValidatorEndpoint) Ping() error {
	ve.mtx.Lock()
	defer ve.mtx.Unlock()
	return ve.signer.Ping()
}

// Close closes the underlying net.Conn.
func (ve *SignerValidatorEndpoint) Close() {
	ve.mtx.Lock()
	defer ve.mtx.Unlock()
	if ve.signer != nil {
		if err := ve.signer.Close(); err != nil {
			ve.Logger.Error("OnStop", "err", err)
		}
	}

	if ve.listener != nil {
		if err := ve.listener.Close(); err != nil {
			ve.Logger.Error("OnStop", "err", err)
		}
	}
}

//--------------------------------------------------------
// Service start and stop

// OnStart implements cmn.Service.
func (ve *SignerValidatorEndpoint) OnStart() error {
	if closed, err := ve.reset(); err != nil {
		ve.Logger.Error("OnStart", "err", err)
		return err
	} else if closed {
		return fmt.Errorf("listener is closed")
	}

	// Start a routine to keep the connection alive
	ve.cancelPingCh = make(chan struct{}, 1)
	ve.pingTicker = time.NewTicker(ve.heartbeatPeriod)
	go func() {
		for {
			select {
			case <-ve.pingTicker.C:
				err := ve.Ping()
				if err != nil {
					ve.Logger.Error("Ping", "err", err)
					if err == ErrUnexpectedResponse {
						return
					}

					closed, err := ve.reset()
					if err != nil {
						ve.Logger.Error("Reconnecting to remote signer failed", "err", err)
						continue
					}
					if closed {
						ve.Logger.Info("listener is closing")
						return
					}

					ve.Logger.Info("Re-created connection to remote signer", "impl", ve)
				}
			case <-ve.cancelPingCh:
				ve.pingTicker.Stop()
				return
			}
		}
	}()

	return nil
}

// OnStop implements cmn.Service.
func (ve *SignerValidatorEndpoint) OnStop() {
	if ve.cancelPingCh != nil {
		close(ve.cancelPingCh)
	}
	ve.Close()
}

//--------------------------------------------------------
// Connection and signer management

// waits to accept and sets a new connection.
// connection is closed in OnStop.
// returns true if the listener is closed
// (ie. it returns a nil conn).
func (ve *SignerValidatorEndpoint) reset() (closed bool, err error) {
	ve.mtx.Lock()
	defer ve.mtx.Unlock()

	// first check if the conn already exists and close it.
	if ve.signer != nil {
		if tmpErr := ve.signer.Close(); tmpErr != nil {
			ve.Logger.Error("error closing socket val connection during reset", "err", tmpErr)
		}
	}

	// wait for a new conn
	conn, err := ve.acceptConnection()
	if err != nil {
		return false, err
	}

	// listener is closed
	if conn == nil {
		return true, nil
	}

	ve.signer, err = NewSignerRemote(conn)
	if err != nil {
		// failed to fetch the pubkey. close out the connection.
		if tmpErr := conn.Close(); tmpErr != nil {
			ve.Logger.Error("error closing connection", "err", tmpErr)
		}
		return false, err
	}
	return false, nil
}

// Attempt to accept a connection.
// Times out after the listener's timeoutAccept
func (ve *SignerValidatorEndpoint) acceptConnection() (net.Conn, error) {
	conn, err := ve.listener.Accept()
	if err != nil {
		if !ve.IsRunning() {
			return nil, nil // Ignore error from listener closing.
		}
		return nil, err
	}
	return conn, nil
}

repository: RucBlockchain/shardingBC

repo_name: RucBlockchain/shardingBC

gha_license_id: NOASSERTION

gha_language: Go

extension: go


text:
@incollection{MR824075,
 author = {Ros, Antonio and Verheyen, Paul and Verstraelen, Leopold},
 booktitle = {Global differential geometry and global analysis 1984
(Berlin, 1984)},
 doi = {10.1007/BFb0075099},
 mrclass = {53C40},
 mrnumber = {824075},
 mrreviewer = {Bang-yen Chen},
 pages = {280--295},
 publisher = {Springer, Berlin},
 series = {Lecture Notes in Math.},
 title = {Positively curved minimal submanifolds},
 url = {https://doi.org/10.1007/BFb0075099},
 volume = {1156},
 year = {1985}
}

repository: torralbofco/geometric-analysis-fork

repo_name: torralbofco/geometric-analysis-fork


text:
package discord_cmd

import (
    "encoding/json"
    "fmt"
    "net/http"
    "io/ioutil"
    "time"

    // fpmodel "fpbot/pkg/model"

    "github.com/spf13/cobra"
    dgo "github.com/bwmarrin/discordgo"
)

const dadJokeBaseURL = "https://icanhazdadjoke.com/"

type jokeCommand struct {
    DiscordCommand
}

func (c *jokeCommand) run() {
    if time.Since(c.BotData.LastRateLimitedCommandTime).Seconds() < 5 {
        c.Session.ChannelMessageSend(c.Message.ChannelID, "Slow down on the jokes!")
        return
    }
    client := &http.Client{}

    req, err := http.NewRequest("GET", dadJokeBaseURL, nil)
    if err != nil {
        c.Session.ChannelMessageSend(c.Message.ChannelID, fmt.Sprintf("Cannot create GET request: %s", err.Error()))
        return
    }
    req.Header.Set("User-Agent", "Friendly Potato Discord Bot (https://github.com/you-win/fpbot)")
    req.Header.Set("Accept", "application/json")

    res, err := client.Do(req)
    if err != nil {
        c.Session.ChannelMessageSend(c.Message.ChannelID, fmt.Sprintf("Error when sending GET request: %s", err.Error()))
        return
    }

    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    var jsonBody map[string]interface{}
    err = json.Unmarshal(body, &jsonBody)
    if err != nil {
        c.Session.ChannelMessageSend(c.Message.ChannelID, fmt.Sprintf("Error when unmarshalling response: %s", err.Error()))
        return
    }

    if jsonBody["status"].(float64) != 200 {
        c.Session.ChannelMessageSend(c.Message.ChannelID, fmt.Sprintf("Non-200 response code: %s", jsonBody))
        return
    }

    c.Session.ChannelMessageSend(c.Message.ChannelID, fmt.Sprintf("```%s```", jsonBody["joke"].(string)))

    c.BotData.LastRateLimitedCommandTime = time.Now()
}

func NewJokeCommand(s *dgo.Session, m *dgo.Message, b *BotData) *cobra.Command {
    dc := &jokeCommand{
        DiscordCommand: DiscordCommand{
            Session: s,
            Message: m,
            BotData: b,
        },
    }

    c := &cobra.Command{
        Use: "joke",
        Short: "Have the bot tell a joke",
        Run: func(cmd *cobra.Command, args []string){
            dc.run()
        },
    }

    modifyUsageFunc(c, s, m)

    return c
}


text:
package main

import (
	"flag"
	"io/ioutil"
)

func main() {

	directoryPtr := flag.String("dir", "./files", "Path to the directory containing all servers sub-directories")
	dbPtr := flag.String("db", "lshw-xml", "Database name")
	flag.Parse()

	files, _ := ioutil.ReadDir(*directoryPtr)

	for _, f := range files {
		// Needed to avoid MacOS .DS_Store file to be saved
		if f.Name() != ".DS_Store" {
			SaveServerFromXML(*directoryPtr, f.Name(), *dbPtr)
		}
	}

}

repository: lucchmielowski/lshw-xml-saver

repo_name: lucchmielowski/lshw-xml-saver


text:
package main

import (
	"log"
	"strings"
	"sync"
	"time"

	"github.com/ecix/alice-lg/backend/api"
)

type RoutesStore struct {
	routesMap map[int]api.RoutesResponse
	statusMap map[int]StoreStatus
	configMap map[int]SourceConfig

	rwlock *sync.RWMutex
}

func NewRoutesStore(config *Config) *RoutesStore {

	// Build mapping based on source instances
	routesMap := make(map[int]api.RoutesResponse)
	statusMap := make(map[int]StoreStatus)
	configMap := make(map[int]SourceConfig)

	for _, source := range config.Sources {
		id := source.Id

		configMap[id] = source
		routesMap[id] = api.RoutesResponse{}
		statusMap[id] = StoreStatus{
			State: STATE_INIT,
		}
	}

	store := &RoutesStore{
		routesMap: routesMap,
		statusMap: statusMap,
		configMap: configMap,

		rwlock: &sync.RWMutex{},
	}
	return store
}

func (self *RoutesStore) Start() {
	log.Println("Starting local routes store")
	go self.init()
}

// Service initialization
func (self *RoutesStore) init() {
	// Initial refresh
	self.update()

	// Initial stats
	self.Stats().Log()

	// Periodically update store
	for {
		// TODO: Add config option
		time.Sleep(5 * time.Minute)
		self.update()
	}
}

// Update all routes
func (self *RoutesStore) update() {
	for sourceId, _ := range self.routesMap {
		source := self.configMap[sourceId].getInstance()

		// Get current update state
		if self.statusMap[sourceId].State == STATE_UPDATING {
			continue // nothing to do here
		}

		// Set update state
		self.rwlock.Lock()
		self.statusMap[sourceId] = StoreStatus{
			State: STATE_UPDATING,
		}
		self.rwlock.Unlock()

		routes, err := source.AllRoutes()
		if err != nil {
			self.rwlock.Lock()
			self.statusMap[sourceId] = StoreStatus{
				State:       STATE_ERROR,
				LastError:   err,
				LastRefresh: time.Now(),
			}
			self.rwlock.Unlock()

			continue
		}

		self.rwlock.Lock()
		// Update data
		self.routesMap[sourceId] = routes
		// Update state
		self.statusMap[sourceId] = StoreStatus{
			LastRefresh: time.Now(),
			State:       STATE_READY,
		}
		self.rwlock.Unlock()
	}
}

// Calculate store insights
func (self *RoutesStore) Stats() RoutesStoreStats {
	totalImported := 0
	totalFiltered := 0

	rsStats := []RouteServerRoutesStats{}

	self.rwlock.RLock()
	for sourceId, routes := range self.routesMap {
		status := self.statusMap[sourceId]

		totalImported += len(routes.Imported)
		totalFiltered += len(routes.Filtered)

		serverStats := RouteServerRoutesStats{
			Name: self.configMap[sourceId].Name,

			Routes: RoutesStats{
				Filtered: len(routes.Filtered),
				Imported: len(routes.Imported),
			},

			State:     stateToString(status.State),
			UpdatedAt: status.LastRefresh,
		}

		rsStats = append(rsStats, serverStats)
	}
	self.rwlock.RUnlock()

	// Make stats
	storeStats := RoutesStoreStats{
		TotalRoutes: RoutesStats{
			Imported: totalImported,
			Filtered: totalFiltered,
		},
		RouteServers: rsStats,
	}
	return storeStats
}

// Lookup routes transform
func routeToLookupRoute(source SourceConfig, state string, route api.Route) api.LookupRoute {

	// Get neighbour
	neighbour := AliceNeighboursStore.GetNeighbourAt(source.Id, route.NeighbourId)

	// Make route
	lookup := api.LookupRoute{
		Id: route.Id,

		NeighbourId: route.NeighbourId,
		Neighbour:   neighbour,

		Routeserver: api.Routeserver{
			Id:   source.Id,
			Name: source.Name,
		},

		State: state,

		Network:   route.Network,
		Interface: route.Interface,
		Gateway:   route.Gateway,
		Metric:    route.Metric,
		Bgp:       route.Bgp,
		Age:       route.Age,
		Type:      route.Type,
	}

	return lookup
}

// Routes filter
func filterRoutesByPrefix(
	source SourceConfig,
	routes []api.Route,
	prefix string,
	state string,
) []api.LookupRoute {

	results := []api.LookupRoute{}
	for _, route := range routes {
		// Naiive filtering:
		if strings.HasPrefix(route.Network, prefix) {
			lookup := routeToLookupRoute(source, state, route)
			results = append(results, lookup)
		}
	}
	return results
}

func filterRoutesByNeighbourIds(
	source SourceConfig,
	routes []api.Route,
	neighbourIds []string,
	state string,
) []api.LookupRoute {

	results := []api.LookupRoute{}
	for _, route := range routes {
		// Filtering:
		if MemberOf(neighbourIds, route.NeighbourId) == true {
			lookup := routeToLookupRoute(source, state, route)
			results = append(results, lookup)
		}
	}
	return results
}

// Single RS lookup by neighbour id
func (self *RoutesStore) LookupNeighboursPrefixesAt(
	sourceId int,
	neighbourIds []string,
) chan []api.LookupRoute {
	response := make(chan []api.LookupRoute)

	go func() {
		self.rwlock.RLock()
		source := self.configMap[sourceId]
		routes := self.routesMap[sourceId]
		self.rwlock.RUnlock()

		filtered := filterRoutesByNeighbourIds(
			source,
			routes.Filtered,
			neighbourIds,
			"filtered")
		imported := filterRoutesByNeighbourIds(
			source,
			routes.Imported,
			neighbourIds,
			"imported")

		var result []api.LookupRoute
		result = append(filtered, imported...)

		response <- result
	}()

	return response
}

// Single RS lookup
func (self *RoutesStore) LookupPrefixAt(
	sourceId int,
	prefix string,
) chan []api.LookupRoute {

	response := make(chan []api.LookupRoute)

	go func() {
		self.rwlock.RLock()
		config := self.configMap[sourceId]
		routes := self.routesMap[sourceId]
		self.rwlock.RUnlock()

		filtered := filterRoutesByPrefix(
			config,
			routes.Filtered,
			prefix,
			"filtered")
		imported := filterRoutesByPrefix(
			config,
			routes.Imported,
			prefix,
			"imported")

		var result []api.LookupRoute
		result = append(filtered, imported...)

		response <- result
	}()

	return response
}

func (self *RoutesStore) LookupPrefix(prefix string) []api.LookupRoute {
	result := []api.LookupRoute{}
	responses := []chan []api.LookupRoute{}

	// Dispatch
	self.rwlock.RLock()
	for sourceId, _ := range self.routesMap {
		res := self.LookupPrefixAt(sourceId, prefix)
		responses = append(responses, res)
	}
	self.rwlock.RUnlock()

	// Collect
	for _, response := range responses {
		routes := <-response
		result = append(result, routes...)
		close(response)
	}

	return result
}

func (self *RoutesStore) LookupPrefixForNeighbours(
	neighbours api.NeighboursLookupResults,
) []api.LookupRoute {

	result := []api.LookupRoute{}
	responses := []chan []api.LookupRoute{}

	// Dispatch
	for sourceId, locals := range neighbours {
		lookupNeighbourIds := []string{}
		for _, n := range locals {
			lookupNeighbourIds = append(lookupNeighbourIds, n.Id)
		}

		res := self.LookupNeighboursPrefixesAt(sourceId, lookupNeighbourIds)
		responses = append(responses, res)
	}

	// Collect
	for _, response := range responses {
		routes := <-response
		result = append(result, routes...)
		close(response)
	}

	return result
}

repository: ecix/alice-lg

repo_name: ecix/alice-lg

gha_language: JavaScript


text:
SUMMARY = "Tools for working with sysfs"
DESCRIPTION = "Tools for working with the sysfs virtual filesystem.  The tool 'systool' can query devices by bus, class and topology."
HOMEPAGE = "http://linux-diag.sourceforge.net/Sysfsutils.html"

LICENSE = "GPLv2 & LGPLv2.1"
LICENSE_${PN} = "GPLv2"
LICENSE_libsysfs = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=3d06403ea54c7574a9e581c6478cc393 \
                    file://cmd/GPL;md5=d41d4e2e1e108554e0388ea4aecd8d27 \
                    file://lib/LGPL;md5=b75d069791103ffe1c0d6435deeff72e"
PR = "r5"

#SRC_URI = "${SOURCEFORGE_MIRROR}/linux-diag/sysfsutils-${PV}.tar.gz \
#           file://obsolete_automake_macros.patch \
#           file://separatebuild.patch"

SRC_URI[md5sum] = "14e7dcd0436d2f49aa403f67e1ef7ddc"
SRC_URI[sha256sum] = "e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a"
S = "${WORKDIR}/sysfsutils-${PV}"

inherit autotools

PACKAGES =+ "libsysfs libsysfs-dev libsysfs-staticdev"
FILES_libsysfs = "${libdir}/lib*${SOLIBS}"
FILES_libsysfs-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}"
FILES_libsysfs-staticdev = "${libdir}/lib*.a"

export libdir = "${base_libdir}"

#
# Meta-debian
#

inherit debian-package
DEBIAN_SECTION = "utils"
DPR = "0"

SRC_URI += " \
	file://obsolete_automake_macros.patch \
	file://separatebuild.patch \
"

do_compile() {
	echo ${S}
	oe_runmake -I${S}/include
}

repository: takuya-t/meta-debian

repo_name: takuya-t/meta-debian

branch_name: refs/heads/daisy


text:
package database

// Migrate migrates the database
func (db *Database) Migrate() {

	var schema = `
	CREATE TABLE IF NOT EXISTS users (
		id INTEGER PRIMARY KEY,
		email VARCHAR(255) UNIQUE NOT NULL,
		password VARCHAR(255) NOT NULL
	);

	CREATE TABLE IF NOT EXISTS tokens (
		id INTEGER PRIMARY KEY,
		user_id INTEGER NOT NULL,
		token VARCHAR(255) NOT NULL
	);
	FOREIGN KEY (user_id) REFERENCES users (id);
	`
	db.Exec(schema)

}


text:
require samba.inc
require samba-basic.inc
LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://../COPYING;md5=d32239bcb673463ab874e80d47fae504"

PR = "r1"

SRC_URI += "file://config-h.patch \
            file://tdbheaderfix.patch;patchdir=.."

SRC_URI[md5sum] = "bf6c09ea497a166df8bd672db1d8da8f"
SRC_URI[sha256sum] = "466410868375d19a286ac3fc5d9f3c267ce359189f8e0d76e72ec10bd54247da"

S = "${WORKDIR}/samba-${PV}/source3"

EXTRA_OECONF += "\
	ac_cv_path_PYTHON=/not/exist \
	ac_cv_path_PYTHON_CONFIG=/not/exist \
	SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes \
	samba_cv_CC_NEGATIVE_ENUM_VALUES=yes \
	linux_getgrouplist_ok=no \
	samba_cv_HAVE_BROKEN_GETGROUPS=no \
	samba_cv_HAVE_FTRUNCATE_EXTEND=yes \
	samba_cv_have_setresuid=yes \
	samba_cv_have_setresgid=yes \
	samba_cv_HAVE_WRFILE_KEYTAB=yes \
	samba_cv_linux_getgrouplist_ok=yes \
	"

do_configure() {
	oe_runconf
}

do_compile () {
	base_do_compile
}


text:
set(CMAKE_SYSTEM_NAME "Android")
set(CMAKE_SYSTEM_VERSION 21)
set(CMAKE_ANDROID_ARCH_ABI "x86")
set(ANDROID_PLATFORM "android-${CMAKE_SYSTEM_VERSION}")
set(ANDROID_ABI "${CMAKE_ANDROID_ARCH_ABI}")

include("${CMAKE_CURRENT_LIST_DIR}/android-common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/android.toolchain.cmake")

repository: Devolutions/CBake

repo_name: Devolutions/CBake

gha_language: CMake

extension: cmake


text:
SECTION = "x11/libs"
LICENSE = "X-BSD"
PRIORITY = "optional"
MAINTAINER = "Greg Gilbert <greg@treke.net>"
DEPENDS = "xproto virtual/libx11"
PROVIDES = "xpm"
DESCRIPTION = "X Pixmap library."
PR = "r1"

SRC_URI = "${XLIBS_MIRROR}/libXpm-${PV}.tar.bz2 \
	   file://autofoo.patch;patch=1"
S = "${WORKDIR}/libXpm-${PV}"

inherit autotools pkgconfig

do_stage () {
	install -m 0644 ${S}/lib/xpm.h ${STAGING_INCDIR}/X11/xpm.h
	oe_libinstall -a -so -C lib libXpm ${STAGING_LIBDIR}
}


text:
@article{sebe2013regulated,
 author = {Sebé-Pedrós, Arnau and Irimia, Manuel and del Campo, Javier and Parra-Acero, Helena and Russ, Carsten and Nusbaum, Chad and Blencowe, Benjamin J and Ruiz-Trillo, Iñaki},
 journal = {eLife},
 title = {Regulated aggregative multicellularity in a close unicellular relative of metazoa},
 volume = {2},
 year = {2013}
}

repository: delCampoLab/academic-kickstart

repo_name: delCampoLab/academic-kickstart


text:
SUMMARY = "Engine.IO server"
HOMEPAGE = "https://github.com/miguelgrinberg/python-engineio/"
SECTION = "devel/python"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=42d0a9e728978f0eeb759c3be91536b8"

inherit pypi python_setuptools_build_meta

PYPI_PACKAGE = "python-engineio"

RDEPENDS:${PN} += " \
	python3-netclient \
	python3-json \
	python3-logging \
	python3-compression \
	python3-asyncio \
"

SRC_URI[sha256sum] = "b167a1b208fcdce5dbe96a61a6ca22391cfa6715d796c22de93e3adf9c07ae0c"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake


text:
package cmd

import (
	"os"
	"strings"
)

type CmdOptions interface {
}

func FileExists(name string) bool {
	if _, err := os.Stat(name); os.IsNotExist(err) {
		return false
	}
	return true
}

func FlagName(prefix, name string) string {
	return strings.Join([]string{prefix, name}, "-")
}

repository: messiaen/rolles

repo_name: messiaen/rolles


text:
package controller

import (
	"log"
	"os"
	"testing"
)

func TestListGithubPRs(t *testing.T) {
	owner := "kube-ci"
	repo := "kubeci-gpig"
	token := ""

	prs, err := fetchGithubPRs(owner, repo, token)
	if err != nil {
		t.Error(err)
	}

	for _, pr := range prs {
		log.Println("PullRequest", *pr.Title)
	}
}

func testListGithubPRsWithAuth(t *testing.T) {
	owner := "tamalsaha"
	repo := "private-test-repo"
	token := os.Getenv("github-access-token")

	prs, err := fetchGithubPRs(owner, repo, token)
	if err != nil {
		t.Error(err)
	}

	for _, pr := range prs {
		log.Println("PullRequest", *pr.Title)
	}
}

repository: kube-ci/git-apiserver

repo_name: kube-ci/git-apiserver


text:
SUMMARY = "Library for reading and writing Jcat files"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1803fa9c2c3ce8cb06b4861d75310742"

DEPENDS = "\
    glib-2.0 \
    json-glib \
"

SRC_URI = "\
    git://github.com/hughsie/libjcat.git;branch=main;protocol=https \
    file://run-ptest \
"
SRCREV = "d9cf9ebc4237252a82f88d9e99bea0c4b398c08a"
S = "${WORKDIR}/git"

inherit gobject-introspection gtk-doc meson ptest-gnome vala lib_package

PACKAGECONFIG ??= "\
    gpg \
    pkcs7 \
    ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
"
PACKAGECONFIG[gpg] = "-Dgpg=true,-Dgpg=false,gpgme"
PACKAGECONFIG[pkcs7] = "-Dpkcs7=true,-Dpkcs7=false,gnutls gnutls-native"
PACKAGECONFIG[tests] = "-Dtests=true,-Dtests=false"

# manpage generation is broken because help2man needs to run the target binary on the host...
EXTRA_OEMESON = "-Dman=false"
GTKDOC_MESON_OPTION = "gtkdoc"

RDEPENDS:${PN}:class-target = "\
    ${@bb.utils.contains('PACKAGECONFIG', 'gpg', 'gnupg', '', d)} \
"


text:
package main

import (
	"fmt"
	"math"
	"os"
	"time"

	"github.com/zono-dev/withings-go/withings"
)

const (
	tokenFile = "access_token.json"
	layout    = "2006-01-02"
	layout2   = "2006-01-02 15:04:05"
	isnotify  = false
)

var (
	jst        *time.Location
	t          time.Time
	adayago    time.Time
	lastupdate time.Time
	ed         string
	sd         string
	client     *(withings.Client)
	settings   map[string]string
)

func auth(settings map[string]string) {
	var err error
	client, err = withings.New(settings["CID"], settings["Secret"], settings["RedirectURL"])

	if err != nil {
		fmt.Println("Failed to create New client")
		fmt.Println(err)
		return
	}

	if _, err := os.Open(tokenFile); err != nil {
		var e error

		client.Token, e = withings.AuthorizeOffline(client.Conf)
		client.Client = withings.GetClient(client.Conf, client.Token)

		if e != nil {
			fmt.Println("Failed to authorize offline.")
		}
		fmt.Println("~~ authorized. Let's check the token file!")
	} else {
		_, err = client.ReadToken(tokenFile)

		if err != nil {
			fmt.Println("Failed to read token file.")
			fmt.Println(err)
			return
		}
	}
}

func tokenFuncs() {
	// Show token
	client.PrintToken()

	// Refresh Token if you need
	_, rf, err := client.RefreshToken()
	if err != nil {
		fmt.Println("Failed to RefreshToken")
		fmt.Println(err)
		return
	}
	if rf {
		fmt.Println("You got new token!")
		client.PrintToken()
	}

	// Save Token if you need
	err = client.SaveToken(tokenFile)
	if err != nil {
		fmt.Println("Failed to RefreshToken")
		fmt.Println(err)
		return
	}
}

func mainSetup() {
	jst = time.FixedZone("Asis/Tokyo", 9*60*60)
	t = time.Now()
	// to get sample data from 2 days ago to now
	adayago = t.Add(-48 * time.Hour)
	ed = t.Format(layout)
	sd = adayago.Format(layout)
	lastupdate = withings.OffsetBase
	//lastupdate = time.Date(2020, 12, 20, 0, 0, 0, 0, time.UTC)
}

func printMeas(v withings.MeasureData, name, unit string) {
	fmt.Printf("%s(Grpid:%v, Category:%v, Attrib: %v, DeviceID:%v)\n", name, v.GrpID, v.Category, v.Attrib, v.DeviceID)
	fmt.Printf("%v, %.1f %s\n", v.Date.In(jst).Format(layout2), v.Value, unit)
}

func testGetmeas() {

	fmt.Println("========== Getmeas[START] ========== ")
	mym, err := client.GetMeas(withings.Real, adayago, t, lastupdate, 0, false, true, withings.Weight, withings.Height, withings.FatFreeMass, withings.BoneMass, withings.FatRatio, withings.FatMassWeight, withings.Temp, withings.HeartPulse, withings.Hydration)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Printf("Status: %d\n", mym.Status)

	for _, v := range mym.SerializedData.Weights {
		printMeas(v, "Weight", "Kg")
	}
	for _, v := range mym.SerializedData.FatFreeMass {
		printMeas(v, "FatFreeMass", "Kg")
	}
	for _, v := range mym.SerializedData.FatRatios {
		printMeas(v, "FatRatio", "%%")
	}
	for _, v := range mym.SerializedData.FatMassWeights {
		printMeas(v, "FatMassWeight", "Kg")
	}
	for _, v := range mym.SerializedData.BoneMasses {
		printMeas(v, "BoneMass", "Kg")
	}

	for _, v := range mym.SerializedData.UnknowVals {
		printMeas(v, "UnknownVal", "N/A")
	}

	// Raw data should be provided from mym.Body.Measuregrps
	for _, v := range mym.Body.Measuregrps {
		weight := float64(v.Measures[0].Value) * math.Pow10(v.Measures[0].Unit)
		fmt.Printf("Weight:%.1f Kgs\n", weight)
	}
	fmt.Printf("More:%d, Offset:%d\n", mym.Body.More, mym.Body.Offset)

	fmt.Println("========== Getmeas[END] ========== ")
}

func testGetactivity() {

	fmt.Println("========== Getactivity[START] ========== ")

	act, err := client.GetActivity(sd, ed, 0, 0, withings.Steps, withings.Calories, withings.HrAverage, withings.HrMin, withings.HrMax)

	if err != nil {
		fmt.Println("getActivity Error.")
		fmt.Println(err)
		return
	}

	//fmt.Println(act)
	for _, v := range act.Body.Activities {
		fmt.Printf("Date:%s, Steps:%d, BurnedCalories: %g, HRAverage: %d, HRMinimum: %d, HRMax:%d \n", v.Date, v.Steps, v.Calories, v.HrAverage, v.HrMin, v.HrMax)
	}
	fmt.Println("========== Getactivity[END] ========== ")
}

func testGetworkouts() {

	fmt.Println("========== Getworkouts[START] ========== ")

	workouts, err := client.GetWorkouts(sd, ed, 0, 0, withings.WTCalories, withings.WTEffduration, withings.WTSteps, withings.WTDistance)

	if err != nil {
		fmt.Println("getWorkouts Error.")
		fmt.Println(err)
		return
	}

	for _, v := range workouts.Body.Series {
		fmt.Printf("Date:%s, Category: %d, Duration: %d, Steps:%d, Distance:%.1f, Calories: %.1f\n", v.Date, v.Category, v.Data.Effduration, v.Data.Steps, v.Data.Distance, v.Data.Calories)
	}
	fmt.Println("========== Getworkouts[END] ========== ")
}

func testGetsleep() {
	fmt.Println("========== Getsleep[START] ========== ")

	slp, err := client.GetSleep(adayago, t, withings.HrSleep, withings.RrSleep, withings.SnoringSleep)
	if err != nil {
		fmt.Println("getSleep Error!")
		fmt.Println(err)
		return
	}
	for _, v := range slp.Body.Series {
		st := ""
		switch v.State {
		case int(withings.Awake):
			st = "Awake"
		case int(withings.LightSleep):
			st = "LightSleep"
		case int(withings.DeepSleep):
			st = "DeepSleep"
		case int(withings.REM):
			st = "REM"
		default:
			st = "Unknown"
		}
		stimeUnix := time.Unix(v.Startdate, 0)
		etimeUnix := time.Unix(v.Enddate, 0)

		stime := (stimeUnix.In(jst)).Format(layout2)
		etime := (etimeUnix.In(jst)).Format(layout2)
		message := fmt.Sprintf("%s to %s: %s, Hr:%d, Rr:%d, Snoring:%d\n", stime, etime, st, v.Hr, v.Rr, v.Snoring)
		fmt.Printf(message)
	}
	//fmt.Println(slp)
	fmt.Println("========== Getsleep[END] ========== ")

}

func testGetsleepsummary() {
	fmt.Println("========== Getsleepsummary[START] ========== ")

	slpsum, err := client.GetSleepSummary(sd, ed, 0, withings.SSBdi, withings.SSDsd, withings.SSD2s, withings.SSD2w, withings.SSHrAvr, withings.SSHrMax, withings.SSHrMin, withings.SSLsd, withings.SSRsd, withings.SSRRAvr, withings.SSRRMax, withings.SSRRMin, withings.SSSS,
		withings.SSSng, withings.SSSngEC, withings.SSWupC, withings.SSWupD)

	if err != nil {
		fmt.Println("getSleepSummary Error!")
		fmt.Println(err)
		return
	}
	for _, v := range slpsum.Body.Series {
		stimeUnix := time.Unix(v.Startdate, 0)
		etimeUnix := time.Unix(v.Enddate, 0)

		stime := (stimeUnix.In(jst)).Format(layout2)
		etime := (etimeUnix.In(jst)).Format(layout2)
		message := fmt.Sprintf(
			"%s-%s: BDI:%d, duration to deep sleep(sec):%d, duration to sleep(sec):%d, duration to wakeup(sec):%d, HrAverage:%d, Max:%d, Min:%d, WakeupCounts:%d",
			stime, etime, v.Data.BreathingDisturbancesIntensity, v.Data.Deepsleepduration, v.Data.Durationtosleep, v.Data.Durationtowakeup, v.Data.HrAverage, v.Data.HrMax, v.Data.HrMin, v.Data.Wakeupcount)
		fmt.Println(message)
	}
	//fmt.Println(slpsum)
	fmt.Println("========== Getsleepsummary[END] ========== ")
}

func main() {

	settings = withings.ReadSettings(".test_settings.yaml")

	auth(settings)
	tokenFuncs()
	mainSetup()

	testGetmeas()
	testGetactivity()
	testGetworkouts()
	testGetsleep()
	testGetsleepsummary()
}

repository: zono-dev/withings-go

repo_name: zono-dev/withings-go


text:
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package profilesmanager_test

import (
	"flag"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"

	"v.io/jiri"
	"v.io/jiri/profiles"
	"v.io/jiri/profiles/profilesmanager"
	"v.io/jiri/tool"
)

type myNewProfileMgr struct {
	installer, name, root string
	versionInfo           *profiles.VersionInfo
	profile               *profiles.Profile
}

func newProfileMgr(installer, name string) *myNewProfileMgr {
	supported := map[string]interface{}{
		"2": nil,
		"4": nil,
		"3": nil,
	}
	return &myNewProfileMgr{
		installer:   installer,
		name:        name,
		versionInfo: profiles.NewVersionInfo("test", supported, "3"),
	}
}

func (p *myNewProfileMgr) Name() string {
	return p.name
}

func (p *myNewProfileMgr) Installer() string {
	return p.installer
}

func (p *myNewProfileMgr) Info() string {
	return `
The myNewProfile is for testing purposes only
`
}

func (p *myNewProfileMgr) VersionInfo() *profiles.VersionInfo {
	return p.versionInfo
}

func (p *myNewProfileMgr) String() string {
	if p.profile == nil {
		return fmt.Sprintf("Profile: %s: not installed\n", p.name)
	}
	return fmt.Sprintf("Profile: %s: installed\n%s\n", p.name, p.profile.Targets())
}

func (p *myNewProfileMgr) AddFlags(*flag.FlagSet, profiles.Action) {
}

func (p *myNewProfileMgr) OSPackages(jirix *jiri.X, pdb *profiles.DB, root jiri.RelPath, target profiles.Target) ([]string, error) {
	return nil, nil
}

func (p *myNewProfileMgr) Install(jirix *jiri.X, pdb *profiles.DB, root jiri.RelPath, target profiles.Target) error {
	p.profile = pdb.InstallProfile(p.name, "", "root")
	return pdb.AddProfileTarget(p.name, "", target)
}

func (p *myNewProfileMgr) Uninstall(jirix *jiri.X, pdb *profiles.DB, root jiri.RelPath, target profiles.Target) error {
	if pdb.RemoveProfileTarget(p.name, "", target) {
		p.profile = nil
	}
	return nil
}

func tmpFile() string {
	dirname, err := ioutil.TempDir("", "pdb")
	if err != nil {
		panic(err)
	}
	return filepath.Join(dirname, "manifest")
}

func ExampleManager() {
	pdb := profiles.NewDB()
	myInstaller := "myProject"
	myProfile := "myNewProfile"
	profileName := profiles.QualifiedProfileName(myInstaller, myProfile)
	var target profiles.Target

	init := func() {
		mgr := newProfileMgr(myInstaller, myProfile)
		profilesmanager.Register(mgr)
		flags := flag.NewFlagSet("example", flag.ContinueOnError)
		profiles.RegisterTargetAndEnvFlags(flags, &target)
		flags.Parse([]string{"--target=arm-linux@1", "--env=A=B,C=D", "--env=E=F"})
	}
	init()

	profileRoot := jiri.NewRelPath("profiles")
	mgr := profilesmanager.LookupManager(profileName)
	if mgr == nil {
		panic("manager not found for: " + profileName)
	}

	jirix := &jiri.X{Context: tool.NewDefaultContext()}
	// Install myNewProfile for target.
	if err := mgr.Install(jirix, pdb, profileRoot, target); err != nil {
		panic("failed to find manager for: " + profileName)
	}

	fmt.Println(mgr.String())

	filename := tmpFile()
	defer os.RemoveAll(filepath.Dir(filename))

	if err := pdb.Write(jirix, "test", filename); err != nil {
		panic(err)
	}

	// Start with a new profile data base.
	pdb = profiles.NewDB()
	// Read the profile database.
	pdb.Read(jirix, filename)

	mgr = profilesmanager.LookupManager(profileName)
	if mgr == nil {
		panic("manager not found for: " + profileName)
	}
	fmt.Println(mgr.String())
	mgr.Uninstall(jirix, pdb, profileRoot, target)
	fmt.Println(mgr.String())
	fmt.Println(mgr.VersionInfo().Supported())
	fmt.Println(mgr.VersionInfo().Default())

	// Output:
	// Profile: myNewProfile: installed
	// [arm-linux@1]
	//
	// Profile: myNewProfile: installed
	// [arm-linux@1]
	//
	// Profile: myNewProfile: not installed
	//
	// [4 3 2]
	// 3
}


text:
@article{MR1447419,
 author = {Ros, Antonio and Souam, Rabah},
 doi = {10.2140/pjm.1997.178.345},
 fjournal = {Pacific Journal of Mathematics},
 issn = {0030-8730},
 journal = {Pacific J. Math.},
 mrclass = {58E12 (53A10 76D45)},
 mrnumber = {1447419},
 mrreviewer = {João Lucas Marques Barbosa},
 number = {2},
 pages = {345--361},
 title = {On stability of capillary surfaces in a ball},
 url = {https://doi.org/10.2140/pjm.1997.178.345},
 volume = {178},
 year = {1997}
}


text:
// Package typedef has type definitions used throughout the hclust package.
package typedef

// SubCluster stores the node, distance and names of leafs for a subcluster.
type SubCluster struct {
	Leafa   int
	Leafb   int
	Lengtha float64
	Lengthb float64
	Node    int
}

repository: knightjdr/hclust

repo_name: knightjdr/hclust


text:
@online{noauthor_microsoft_nodate,
	title = {Microsoft Remote Desktop},
	url = {https://apps.apple.com/us/app/microsoft-remote-desktop/id1295203466?mt=12},
	titleaddon = {Mac App Store},
	urldate = {2020-10-24},
	langid = {english},

}

@online{deland-han_understanding_nodate,
	title = {Understanding Remote Desktop Protocol ({RDP}) - Windows Server},
	url = {https://docs.microsoft.com/en-us/troubleshoot/windows-server/remote/understanding-remote-desktop-protocol},
	abstract = {This article introduces the Remote Desktop Protocol ({RDP}).},
	author = {Deland-Han},
	urldate = {2020-11-07},
	langid = {english},

}

@online{openspecs-office_ms-rdpbcgr_nodate,
	title = {[{MS}-{RDPBCGR}]: Remote Desktop Protocol: Basic Connectivity and Graphics Remoting},
	url = {https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/5073f4ed-1e93-45e1-b039-6e30c385867c},
	shorttitle = {[{MS}-{RDPBCGR}]},
	abstract = {Specifies the Remote Desktop Protocol: Basic Connectivity and Graphics Remoting, designed to facilitate user interaction with a remote computer},
	author = {openspecs-office},
	urldate = {2020-11-07},
	langid = {english},

}

@online{noauthor_about_nodate,
	title = {About App Sandbox},
	url = {https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AboutAppSandbox/AboutAppSandbox.html},
	urldate = {2020-11-07},

}

@online{king-of-spades_upload_nodate,
	title = {Upload crashes via {API} - Visual Studio App Center},
	url = {https://docs.microsoft.com/en-us/appcenter/diagnostics/upload-crashes},
	abstract = {Post a crash report, for example, if you don't want to use our {SDK} or develop for a custom platform.},
	author = {King-of-Spades},
	urldate = {2020-11-07},
	langid = {english},

}

@online{king-of-spades_understanding_nodate,
	title = {Understanding App Center Events Metrics - Visual Studio App Center},
	url = {https://docs.microsoft.com/en-us/appcenter/analytics/event-metrics},
	abstract = {Help using the Events Metrics on App Center},
	author = {King-of-Spades},
	urldate = {2020-11-07},
	langid = {english},

}

@online{king-of-spades_app_nodate,
	title = {App Center Crashes for {macOS} - Visual Studio App Center},
	url = {https://docs.microsoft.com/en-us/appcenter/sdk/crashes/macos},
	abstract = {App Center Crashes for {macOS}},
	author = {King-of-Spades},
	urldate = {2020-11-07},
	langid = {english},

}

@online{noauthor_iso_nodate,
	title = {{ISO} - {ISO} 8601 — Date and time format},
	url = {https://www.iso.org/iso-8601-date-and-time-format.html},
	abstract = {{ISO} 8601 is the internationally accepted way to represent dates and times.},
	titleaddon = {{ISO}},
	urldate = {2020-11-07},
	langid = {english},

}

@online{noauthor_nskeyedarchiver_nodate,
	title = {{NSKeyedArchiver} {\textbar} Apple Developer Documentation},
	url = {https://developer.apple.com/documentation/foundation/nskeyedarchiver},
	urldate = {2020-11-12}
}

@online{noauthor_jholtmannmrdpf_nodate,
	title = {jholtmann/mrdpf},
	url = {https://github.com/jholtmann/mrdpf},
	abstract = {Mac {RDP} Forensics - Python module for parsing artifacts of the Microsoft {RDP} client for {macOS} - jholtmann/mrdpf},
	titleaddon = {{GitHub}},
	urldate = {2020-11-12},
	langid = {english},

}

@online{noauthor_frame_nodate,
	title = {frame {\textbar} Apple Developer Documentation},
	url = {https://developer.apple.com/documentation/appkit/nswindow/1419697-frame},
	urldate = {2020-11-12}
}

@online{noauthor_sqlite_nodate,
	title = {{SQLite} Documentation},
	url = {https://sqlite.org/docs.html},
	urldate = {2020-11-12}
}

@online{noauthor_what_nodate,
	title = {What is Keychain Access on Mac?},
	url = {https://support.apple.com/guide/keychain-access/what-is-keychain-access-kyca1083/mac},
	abstract = {On your Mac, you can use a keychain to keep track of passwords and other sensitive information.},
	titleaddon = {Apple Support},
	urldate = {2020-11-12},
	langid = {english}
}

@online{heidilohr_whats_nodate,
	title = {What's new in the {macOS} client},
	url = {https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/mac-whatsnew},
	abstract = {Learn about recent changes to the Remote Desktop client for Mac},
	author = {Heidilohr},
	urldate = {2020-11-13},
	langid = {english}
}

@online{lizap_get_nodate,
	title = {Get started with the {macOS} client},
	url = {https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-mac},
	abstract = {Learn how to set up the Remote Desktop client for Mac},
	author = {lizap},
	urldate = {2020-11-13},
	langid = {english},

}

@misc{nas_dpia_2019,
	title = {{DPIA} report diagnostic data processing in Microsoft Office 365 Online and mobile Office apps (June 2019)},
	url = {https://www.government.nl/binaries/government/documents/publications/2019/07/23/dpia-microsoft-office-365-online-and-mobile-slm-rijk-23-july/DPIA+Microsoft+Office+365+Online+and+Mobile+SLM+Rijk+23+july.pdf},
	publisher = {Ministry of Justice and Security},
	author = {Nas, Sjoera and Terra, Floor and Baehring, Jill},
	urldate = {2020-11-15},
	date = {2019-07-23}
}

repository: jholtmann/mrdpf

repo_name: jholtmann/mrdpf