text:
in P or L and where to put a button in each layout for best findability and operability remains unclear. This research makes a first attempt to examine in which orientation a touch-operated interface is faster to use and whether certain "zones" can be identified that have a particularly good performance in either orientation. Our results indicate that such zones exist in both L and P, and that L is faster to use than P. However, the effects are only visible when the user has not been primed with the target name. We conclude our study with practical advice for designers to improve usability and efficiency of time-critical applications and dialogues.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {534–539},
numpages = {6},
keywords = {scanning pattern, mobile hci, device orientation},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494436,
author = {Mayer, Julia M. and Zach, Jelena},
title = {Lessons Learned from Participatory Design with and for People with Dementia},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494436},
doi = {10.1145/2493190.2494436},
abstract = {In this paper we describe challenges and lessons learned from developing a mobile touch screen based assistive tool for people with dementia. We focus not on features of the tool but the general participatory design process that was applied. Insights presented are gained from interviews, focus groups and observations. We found that projecting problems on imaginary characters and using simple games specifically customized for people with dementia ease the process of eliciting user needs and realistic prototypes allow design evaluations with people with dementia early on.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {540–545},
numpages = {6},
keywords = {participatory design, dementia, assistive technology},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494439,
author = {Kocielinski, Daniel and Brzostek-Paw\l{}owska, Jolanta},
title = {Linear Interface for Graphical Interface of Touch-Screen: A Pilot Study on Improving Accessibility of the Android-Based Mobile Devices},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494439},
doi = {10.1145/2493190.2494439},
abstract = {The article presents the idea of creating a blind-friendly Versatile Multimodal Linear Interface (VMLI) model for touchscreen-based devices as well as the results of pilot study and implementation of VMLI.VMLI enhances operation of touchscreen-based mobile devices and facilitates the use of a touchscreen by the blind. VMLI transforms a planar layout of objects into hierarchically structured linear lists that allow non-sequential access to items. List items are read by VMLI using installed text-to-speech software; users navigate through lists and select items using specific touchscreen gestures preferred by the blind. VMLI allows choosing user's preferred method of text input: using a virtual QWERTY keyboard, a virtual Braille keyboard or a physical one of a Braille notetaker. The results of preliminary research on pilot implementation of VMLI into the Android system, concerning functions like managing contacts and composing messages to selected recipients, give grounds for continuing works on VMLI.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {546–551},
numpages = {6},
keywords = {touch screen, mobile accessibility, blind users},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494423,
author = {Deru, Matthieu and Bergweiler, Simon},
title = {Milky: On-Product App for Emotional Product to Human Interactions},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494423},
doi = {10.1145/2493190.2494423},
abstract = {In this paper we present a new way of emotional interaction with products. Based on the rapid prototyping Microsoft Gadgeteer platform, we concretized our vision of an on-product app by implementing an anthropomorphic intelligent milk carton. The purpose of this realization is to give customers a better view of a product's life-cycle. This realization also demonstrates that the frontier between pure mobile applications development and the creation of tangible objects is very thin and opens new way to integrate the Internet of Things over an anthropomorphic user interface, thus leading to a new product to human interaction form.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {552–557},
numpages = {6},
keywords = {product to human interactions, gadgeteer, anthropomorphic, embedded platform, internet of things, tangible objects, emotion, product life-cycle},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494433,
author = {Matthies, Denys J.C. and Nguyen, Ngo Dieu Huong and Lucas, Shaunna Janine and Botz, Daniel},
title = {Moving Shapes: A Multiplayer Game Based on Color Detection Running on Public Displays},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494433},
doi = {10.1145/2493190.2494433},
abstract = {Over the past few years the use of public displays has increased drastically, with the most common public displays being flat surface LED walls or projections on walls. Presently interactive public displays often make use of depth cameras. This paper introduces a cheaper variant that allows people to interact with the display and each other by using the color detection abilities of an ordinary webcam. As proof of concept a simple game was created that demonstrates how people are able to control and interact with photographed shapes via their own smartphones. Alternately a special hardware interface was built for users who do not own a smartphone. Contrary to ordinary games, this game works without points; instead, the leading user is awarded the ability to make decisions about game speed and is able to influence the audio through his movements.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {558–563},
numpages = {6},
keywords = {game, camera tracking, public displays, physical interface, art, mobile devices, interactive installation},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494443,
author = {M\"{u}ller, Heiko and Fortmann, Jutta and Timmermann, Janko and Heuten, Wilko and Boll, Susanne},
title = {Proximity Sensor: Privacy-Aware Location Sharing},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494443},
doi = {10.1145/2493190.2494443},
abstract = {In this paper we report on a participatory design study with young girls. Our goal was to create a mobile phone app to display the spatial proximity of friends in an abstract and privacy-aware manner. A group of 16 girls worked along the user-centred design process to create initial paper-based designs of an app that respects one's friends privacy while displaying their proximity to allow for spontaneous meetings or re-grouping after separation. Our participants created very promising results which we intend to implement and evaluate further against a broader audience.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {564–569},
numpages = {6},
keywords = {smartphone, privacy, participatory design, navigation},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494442,
author = {Law, Effie Lai-Chong and Bedall-Hill, Nicola Louise and Parry, Ross and Richards, Adair and Hawker, Melissa},
title = {Representing and Interpreting Reformation in the Wild},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494442},
doi = {10.1145/2493190.2494442},
abstract = {A mobile educational app combining the strengths of sound pedagogical frameworks Generic Learning Outcomes and of interactive technologies Augmented Reality (AR) and Quick Response (QR) code to deliver the historical information of the Howard family in the Reformation is being developed by an interdisciplinary team. Visiting the relatively small archaeological site -- Thetford Priory- with the new technologies may contribute to resolving an age-old puzzle through interpretations from multiple perspectives and to fostering the sustainability of such a site.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {570–575},
numpages = {6},
keywords = {qr code, reformation, cultural heritage, generic learning outcomes, archaeological sites, augmented reality},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494425,
author = {B\"{o}hmer, Matthias and Gehring, Sven and Hempel, Jonas and Kr\"{u}ger, Antonio},
title = {Revisiting Phone Call UIs for Multipurpose Mobile Phones},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494425},
doi = {10.1145/2493190.2494425},
abstract = {While mobile phones made a significant evolution in recent years from single-purpose communication devices to multi-purpose devices, the fundamental design of phone call applications did not evolve accordingly. While its implementation leveraged from new hardware and software capabilities, the fundamental decisions people are able to make when they receive a call did not change. Currently, when a call comes in, a modal dialog opens where the callee can either decline or accept the call. A recent study found that the current user interfaces of phone call applications (phone UIs) often lead to an increased overhead when application usage is being interrupted by phone calls [6]. In this paper, we revisit phone call UIs for multipurpose smartphones. We contribute a new design space for mobile phone call UIs, going beyond the simple accept-or-decline dilemma. We present a prototype implementation and discuss open challenges.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {576–581},
numpages = {6},
keywords = {phone calls, smartphones, design space, interruptions},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494440,
author = {Lotito, Antonio and Spoto, Giovanni Luca and Frisiello, Antonella and Macchia, Vito and Bolognesi, Thomas and Ru\`{a}, Francesco},
title = {Smart2poster. Bridging Information and Locality},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494440},
doi = {10.1145/2493190.2494440},
abstract = {This paper presents the Smart2Poster concept, a solution proposing an interaction modality aimed at bridging the information and the surrounding physical world, by means of familiar objects (a poster, a smartphone and/or a TV screen) and based on the Near Field Communication technology (NFC) that enables a local Peer-to-Peer communication without requiring further connectivity. Moreover, the paper describes the usage scenarios that driven the design and the implementation of the first prototype.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {582–587},
numpages = {6},
keywords = {proximity, smart-poster, smart tags, nfc, gestural interaction, user interaction},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494426,
author = {Micallef, Nicholas and Just, Mike and Baillie, Lynne and Kayacik, Gunes},
title = {Stop Questioning Me! Towards Optimizing User Involvement during Data Collection on Mobile Devices},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494426},
doi = {10.1145/2493190.2494426},
abstract = {Current methods of behavioral data collection from mobile devices either require significant involvement from participants to verify the 'ground truth' of the data, or approximations that involve post-experiment comparisons to seed data. In this paper we argue that user involvement can be gracefully reduced by performing more intelligent seed comparisons. We aim to reduce the participant involvement to the 'most interesting' temporal slots, both during the experiment and in post-experiment verification. We carried out a 2 week study with 4 users, consisting of an initial opportunistic gathering of mobile sensor data. Our findings suggest that by using such a method we can significantly reduce user involvement.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {588–593},
numpages = {6},
keywords = {mobile, hci, sensing},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494438,
author = {Terrenghi, Lucia and Garcia-Barrio, Laura and Oshlyansky, Lidia},
title = {Tablets Use in Emerging Markets: An Exploration},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494438},
doi = {10.1145/2493190.2494438},
abstract = {Tablet sales are growing worldwide and changing the landscape of personal computing. This is true across mature markets as well as emerging ones. However, little research has been done on the influence of tablets in the emerging markets. This paper presents insights gained during an exploratory study on the use of tablets in four cities: Sao Paulo, Mexico City, Jakarta and Bangalore. The results uncover similarities and differences in the use of tablets in mature markets versus emerging markets and identify implications for design across markets.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {594–599},
numpages = {6},
keywords = {tablets, emerging markets, user study},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494424,
author = {Alce, G\"{u}nter and Hermodsson, Klas and Wallerg\r{a}rd, Mattias},
title = {WozARd: A Wizard of Oz Tool for Mobile AR},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494424},
doi = {10.1145/2493190.2494424},
abstract = {Wizard of Oz methodology is useful when conducting user studies of a system that is in early development. It is essential to be able to simulate part of the system and to collect feedback from potential users. Using a human to act as the system is one way to do this.The Wizard of Oz tool presented here is called WozARd and it aims at offering a set of tools that help the test leader control the visual, tactile and auditive output that is presented to the test participant. Additionally, it is suitable for using in an augmented reality environment where images are overlaid on the phone's camera view or on glasses.The main features that were identified as necessary include presentation of media such as images, video and sound, navigation and location based triggering, automatically taking photos, capability to log test results and visual feedback, and the integration of Sony SmartWatch for interaction possibilities.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {600–605},
numpages = {6},
keywords = {augmented reality, multimodal interaction, wizard of oz, multimodal user interface},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2494437,
author = {Humayoun, Shah Rukh and Hess, Steffen and Kiefer, Felix and Ebert, Achim},
title = {I2ME: A Framework for Building Interactive Mockups},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2494437},
doi = {10.1145/2493190.2494437},
abstract = {Providing interactive mockups of mobile applications in designing phases introduces new challenges for interaction designers compared to the traditional way of static mockups. In particular, the complexity of this process increases when it comes to enabling the user to actually explore the intended user experience of the mobile environment by enhancing traditional handmade sketches or tool-generated wireframes with concrete mobile interaction elements. We introduce a framework, called i2ME (interactive Mockup-Building for Mobile Environment), for building interactive mockups with concrete mobile interaction elements. The framework enhances the static mockups (handmade or tool-generated) with screen transitions and multi-touch gestures, and enables the deployment of the resulting HTML5+JavaScript based interactive mockups to multiple platforms and device classes.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {606–611},
numpages = {6},
keywords = {interactive mockups, interaction design, multi-touch gestures},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2499469,
author = {Rost, Mattias and Morrison, Alistair and Cramer, Henriette and Bentley, Frank},
title = {Informing Future Design via Large-Scale Research Methods and Big Data},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2499469},
doi = {10.1145/2493190.2499469},
abstract = {With the launch of 'app stores' on several mobile platforms and the great uptake of smartphones among the general population, researchers have begun utilising these distribution channels to deploy research software to large numbers of users. Previous Research In The Large workshops have sought to establish base-line practice in this area. We have seen the use of app stores as being successful as a methodology for gathering large amounts of data, leading to design implications, but we have yet to explore the full potential for this data's use and interpretation. How is it possible to leverage the practices of large-scale research, beyond the current approaches, to more directly inform future designs? We propose that the time is right to re-energise discussions on large-scale research, looking further than the basic methodological issues and assessing the potential for informing the design of new mobile software.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {612–615},
numpages = {4},
keywords = {large-scale mobile hci, research in the large, design, mass participation, user study, app stores},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2499472,
author = {Seichter, Hartmut and Grubert, Jens and Langlotz, Tobias},
title = {Designing Mobile Augmented Reality},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2499472},
doi = {10.1145/2493190.2499472},
abstract = {The development of mobile Augmented Reality application became increasingly popular over the last few years. However, many of the existing solutions build on the reuse of available standard metaphors for visualization and interaction without considering the manifold contextual factors of their use. Within this workshop we want to discuss theoretical design approaches and practical tools which should help developers to make more informed choices when exploring the design space of Augmented Reality interfaces in mobile contexts.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {616–621},
numpages = {6},
keywords = {design, adaptive user interfaces, mobile, augmented reality},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2499468,
author = {Wilfinger, David and Meschtscherjakov, Alexander and Tscheligi, Manfred and Sundstr\"{o}m, Petra and Szostak, Dalila and McCall, Roderick},
title = {Entertainment Technology in Transportation against Frustration, Aggression and Irrationality},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2499468},
doi = {10.1145/2493190.2499468},
abstract = {This workshop addresses two strong fields within the Mobile HCI community: games & entertainment and transportation user interfaces. Using transportation technology (e.g., a car, plane, or traveling in public transportation) can be frustrating due to crowded streets, delays, and other travelers. Frustration may lead to aggression and negative experiences of other road members and passengers [4] leading to irrational behaviors [6]. Games & entertainment technology offer potential to resolve these negative user experiences. This workshop brings together entertainment and transportation user interface experts, who are willing to understand mobile entertainment technology as a potential solution to improve the experience of all travelers, drivers, and workers within the transportation field. The overall aim of the workshop is to create a common understanding of the challenges of entertainment in transportation, as well as further extend the research agenda for entertainment in this context from both from a scientific and an industrial perspective.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {622–625},
numpages = {4},
keywords = {transportation, entertainment, user interfaces, games},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2499471,
author = {Nanavati, Amit A. and Rajput, Nitendra and Srivastava, Saurabh and Erkut, Cumhur and Jylh\"{a}, Antti and Rudnicky, Alexander I. and Serafin, Stefania and Turunen, Markku},
title = {SiMPE: 8th Workshop on Speech and Sound in Mobile and Pervasive Environments},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2499471},
doi = {10.1145/2493190.2499471},
abstract = {The SiMPE workshop series started in 2006 with the goal of enabling speech processing on mobile and embedded devices. The SiMPE 2012 workshop extended the notion of audio to non-speech "Sounds" and thus the expansion became "Speech and Sound". SiMPE 2010 and 2011 brought together researchers from the speech and the HCI communities. Speech User interaction in cars was a focus area in 2009. Multimodality got more attention in SiMPE 2008. In SiMPE 2007, the focus was on developing regions.With SiMPE 2013, the 8th in the series, we continue to explore the area of speech along with sound. Akin to language processing and text-to-speech synthesis in the voice-driven interaction loop, sensors can track continuous human activities such as singing, walking, or shaking the mobile phone, and non-speech audio can facilitate continuous interaction. The technologies underlying speech processing and sound processing are quite different and these communities have been working mostly independent of each other. And yet, for multimodal interactions on the mobile, it is perhaps natural to ask whether and how speech and sound can be mixed and used more effectively and naturally.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {626–629},
numpages = {4},
keywords = {sound and music computing, sonic interaction, speech processing, mobile computing, sound},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2499470,
author = {Chiasson, Sonia and Crawford, Heather and Egelman, Serge and Irani, Pourang},
title = {U-PriSM 2: The Second Usable Privacy and Security for Mobile Devices Workshop},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2499470},
doi = {10.1145/2493190.2499470},
abstract = {The Second Usable Privacy and Security for Mobile Devices Workshop (U-PriSM 2) was held with MobileHCI'13. The U-PriSM 2 workshop was an opportunity for researchers and practitioners to discuss research challenges and experiences around the usable privacy and security of mobile devices (smart phones and tablets). Security often involves having non-security experts, or even novice users, regularly making important security decisions while their main focus is on other primary tasks. This is especially true for mobile devices where users can quickly and easily install apps, where user interfaces are minimal due to space constraints, and where users are often distracted by their environment.Participants had a chance to explore mobile device usage and the unique usable security and privacy challenges that arise, discuss proposed systems and ideas that address these needs, and work towards the development of design principles to inform future development in the area.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {630–632},
numpages = {3},
keywords = {usable privacy, mobile devices, usable security, human-computer interaction},
location = {Munich, Germany},
series = {MobileHCI '13}
}

@inproceedings{10.1145/2493190.2499467,
author = {Humayoun, Shah Rukh and Hess, Steffen and Ebert, Achim},
title = {Workshop on Prototyping to Support the Interaction Designing in Mobile Application Development (PID-MAD 2013)},
year = {2013},
isbn = {9781450322737},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2493190.2499467},
doi = {10.1145/2493190.2499467},
abstract = {Recent changes in the mobile environment; such as the addition of multi-touch gestures, usage of sensors, or single-focused mobile apps; brought several challenges for interaction designers in communicating their ideas and thoughts enduring early design activities. Traditional prototyping techniques may not provide sufficient support due to the lack of current mobile interaction paradigms in them. Therefore, a shift is required in prototyping techniques and approaches in order to support properly the interaction design process of mobile application development for the current mobile environment.Targeting these concerns, the workshop envisions that the research must address the need for a change in existing prototyping techniques as well as focusing on novel prototyping approaches and frameworks that would support not only the interaction design process but the whole development process of mobile application development.},
booktitle = {Proceedings of the 15th International Conference on Human-Computer Interaction with Mobile Devices and Services},
pages = {633–636},
numpages = {4},
keywords = {interaction design, prototyping, mobile application development},
location = {Munich, Germany},
series = {MobileHCI '13}
}

license_type: permissive

extension: bib


text:
package cmd

import (
	"log"

	"github.com/spf13/cobra"
)

var (
	Verbose bool

	rootCmd = &cobra.Command{
		Use:   "graphql",
		Short: "Demo GraphQL application",
		Run:   func(cmd *cobra.Command, args []string) {},
	}
)

func Execute() {
	rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output")

	if err := rootCmd.Execute(); err != nil {
		log.Fatal(err)
	}
}

license: MIT

repository: seanpburke/graphql-api-demo

repo_name: seanpburke/graphql-api-demo

branch_name: refs/heads/master

extension: go


text:
# FIXME: Update to work with some other MD5 implementation.
# It's silly to pull in OpenSSL just for that.
DEPENDS = "openssl"
DESCRIPTION = "BSD-licensed equivalent of the popular versioning system CVS."
LICENSE = "BSD"
PRIORITY = "optional"
SECTION = "console/network"
SRCDATE = "20060814"
PV = "0.0+cvs${SRCDATE}"
PR = "r1"

SRC_URI = "cvs://anoncvs@anoncvs.ca.openbsd.org/cvs;module=src/usr.bin/cvs;method=ext \
	   file://linux.patch"
S = "${WORKDIR}/cvs"

inherit autotools

do_clean_tree () {
	rm -rf ${S}/cvs ${S}/cvsd
}
addtask clean_tree after do_patch before do_configure

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD

extension: bb


text:
// THIS FILE IS AUTO GENERATED BY GK-CLI DO NOT EDIT!!
package endpoint

import (
	service "github.com/faith/goKitAdvanced4/hello/pkg/service"
	endpoint "github.com/go-kit/kit/endpoint"
)

// Endpoints collects all of the endpoints that compose a profile service. It's
// meant to be used as a helper struct, to collect all of the endpoints into a
// single parameter.
type Endpoints struct {
	StatusEndpoint   endpoint.Endpoint
	GetEndpoint      endpoint.Endpoint
	ValidateEndpoint endpoint.Endpoint
}

// New returns a Endpoints struct that wraps the provided service, and wires in all of the
// expected endpoint middlewares
func New(s service.HelloService, mdw map[string][]endpoint.Middleware) Endpoints {
	eps := Endpoints{
		GetEndpoint:      MakeGetEndpoint(s),
		StatusEndpoint:   MakeStatusEndpoint(s),
		ValidateEndpoint: MakeValidateEndpoint(s),
	}
	for _, m := range mdw["Status"] {
		eps.StatusEndpoint = m(eps.StatusEndpoint)
	}
	for _, m := range mdw["Get"] {
		eps.GetEndpoint = m(eps.GetEndpoint)
	}
	for _, m := range mdw["Validate"] {
		eps.ValidateEndpoint = m(eps.ValidateEndpoint)
	}
	return eps
}


text:
// Copyright (c) 2017 The Decred developers
// Copyright (c) 2018-2019 The Hc developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

package main

import (
	"bufio"
	"bytes"
	"crypto/sha256"
	"encoding/hex"
	"encoding/json"
	"flag"
	"fmt"
	"net/http"
	"net/url"
	"os"
	"path/filepath"
	"regexp"
	"strconv"
	"strings"
	"time"

	"github.com/HcashOrg/hcd/hcutil"
	"github.com/HcashOrg/hctime/merkle"
	"github.com/HcashOrg/hcAutonomy/hcAutonomyd/api/v1"
	"github.com/HcashOrg/hcAutonomy/hcAutonomyd/api/v1/identity"
	"github.com/HcashOrg/hcAutonomy/util"
)

const allowInteractive = "i-know-this-is-a-bad-idea"

var (
	regexMD          = regexp.MustCompile(`^metadata[\d]{1,2}:`)
	regexMDID        = regexp.MustCompile(`[\d]{1,2}`)
	regexAppendMD    = regexp.MustCompile(`^appendmetadata[\d]{1,2}:`)
	regexOverwriteMD = regexp.MustCompile(`^overwritemetadata[\d]{1,2}:`)
	regexFileAdd     = regexp.MustCompile(`^add:`)
	regexFileDel     = regexp.MustCompile(`^del:`)
	regexToken       = regexp.MustCompile(`^token:`)

	defaultHomeDir          = hcutil.AppDataDir("hcAutonomy", false)
	defaultIdentityFilename = "identity.json"

	identityFilename = flag.String("-id", filepath.Join(defaultHomeDir,
		defaultIdentityFilename), "remote server identity file")
	testnet     = flag.Bool("testnet", false, "Use testnet port")
	printJson   = flag.Bool("json", false, "Print JSON")
	verbose     = flag.Bool("v", false, "Verbose")
	rpcuser     = flag.String("rpcuser", "", "RPC user name for privileged calls")
	rpcpass     = flag.String("rpcpass", "", "RPC password for privileged calls")
	rpchost     = flag.String("rpchost", "", "RPC host")
	rpccert     = flag.String("rpccert", "", "RPC certificate")
	interactive = flag.String("interactive", "", "Set to "+
		allowInteractive+" to to turn off interactive mode during "+
		"identity fetch")

	verify = false // Validate server TLS certificate
)

func usage() {
	fmt.Fprintf(os.Stderr, "usage: hcAutonomy [flags] <action> [arguments]\n")
	fmt.Fprintf(os.Stderr, " flags:\n")
	flag.PrintDefaults()
	fmt.Fprintf(os.Stderr, "\n actions:\n")
	fmt.Fprintf(os.Stderr, "  identity          - Retrieve server "+
		"identity\n")
	fmt.Fprintf(os.Stderr, "  plugins           - Retrieve plugin "+
		"inventory\n")
	fmt.Fprintf(os.Stderr, "  inventory         - Inventory records "+
		"<vetted count> <branches count>\n")
	fmt.Fprintf(os.Stderr, "  new               - Create new record "+
		"[metadata<id>]... <filename>...\n")
	fmt.Fprintf(os.Stderr, "  getunvetted       - Retrieve record "+
		"<id>\n")
	fmt.Fprintf(os.Stderr, "  setunvettedstatus - Set unvetted record "+
		"status <publish|censor> <id> [actionmdid:metadata]...\n")
	fmt.Fprintf(os.Stderr, "  updateunvetted    - Update unvetted record "+
		"[actionmdid:metadata]... <actionfile:filename>... "+
		"token:<token>\n")
	fmt.Fprintf(os.Stderr, "  updatevetted      - Update vetted record "+
		"[actionmdid:metadata]... <actionfile:filename>... "+
		"token:<token>\n")
	fmt.Fprintf(os.Stderr, "  updatevettedmd    - Update vetted record "+
		"metadata [actionmdid:metadata]... token:<token>\n")
	fmt.Fprintf(os.Stderr, "\n")
	fmt.Fprintf(os.Stderr, " metadata<id> is the word metadata followed "+
		"by digits. Example with 2 metadata records "+
		"metadata0:{\"moo\":\"12\",\"blah\":\"baz\"} "+
		"metadata1:{\"lala\":42}\n")
	fmt.Fprintf(os.Stderr, " actionmdid is an action + metadatastream id "+
		"E.g. appendmetadata0:{\"foo\":\"bar\"} or "+
		"overwritemetadata12:{\"bleh\":\"truff\"}\n")

	fmt.Fprintf(os.Stderr, "\n")
}

// cleanAndExpandPath expands environment variables and leading ~ in the
// passed path, cleans the result, and returns it.
func cleanAndExpandPath(path string) string {
	// Expand initial ~ to OS specific home directory.
	if strings.HasPrefix(path, "~") {
		homeDir := filepath.Dir(defaultHomeDir)
		path = strings.Replace(path, "~", homeDir, 1)
	}

	// NOTE: The os.ExpandEnv doesn't work with Windows-style %VARIABLE%,
	// but the variables can still be expanded via POSIX-style $VARIABLE.
	return filepath.Clean(os.ExpandEnv(path))
}

// getErrorFromResponse extracts a user-readable string from the response from
// hcAutonomyd, which will contain a JSON error.
func getErrorFromResponse(r *http.Response) (string, error) {
	var errMsg string
	decoder := json.NewDecoder(r.Body)
	if r.StatusCode == http.StatusInternalServerError {
		var e v1.ServerErrorReply
		if err := decoder.Decode(&e); err != nil {
			return "", err
		}
		errMsg = fmt.Sprintf("%v", e.ErrorCode)
	} else {
		var e v1.UserErrorReply
		if err := decoder.Decode(&e); err != nil {
			return "", err
		}
		errMsg = v1.ErrorStatus[e.ErrorCode] + " "
		if e.ErrorContext != nil && len(e.ErrorContext) > 0 {
			errMsg += strings.Join(e.ErrorContext, ", ")
		}
	}

	return errMsg, nil
}

func getIdentity() error {
	// Fetch remote identity
	id, err := util.RemoteIdentity(verify, *rpchost, *rpccert)
	if err != nil {
		return err
	}

	rf := filepath.Join(defaultHomeDir, defaultIdentityFilename)

	// Pretty print identity.
	fmt.Printf("Key        : %x\n", id.Key)
	fmt.Printf("Fingerprint: %v\n", id.Fingerprint())

	// Ask user if we like this identity
	if *interactive != allowInteractive {
		fmt.Printf("\nSave to %v or ctrl-c to abort ", rf)
		scanner := bufio.NewScanner(os.Stdin)
		scanner.Scan()
		if err = scanner.Err(); err != nil {
			return err
		}
		if len(scanner.Text()) != 0 {
			rf = scanner.Text()
		}
	} else {
		fmt.Printf("Saving identity to %v\n", rf)
	}
	rf = cleanAndExpandPath(rf)

	// Save identity
	err = os.MkdirAll(filepath.Dir(rf), 0700)
	if err != nil {
		return err
	}
	err = id.SavePublicIdentity(rf)
	if err != nil {
		return err
	}
	fmt.Printf("Identity saved to: %v\n", rf)

	return nil
}

func printCensorshipRecord(c v1.CensorshipRecord) {
	fmt.Printf("  Censorship record:\n")
	fmt.Printf("    Merkle   : %v\n", c.Merkle)
	fmt.Printf("    Token    : %v\n", c.Token)
	fmt.Printf("    Signature: %v\n", c.Signature)
}

func printRecord(header string, pr v1.Record) {
	// Pretty print record
	status, ok := v1.RecordStatus[pr.Status]
	if !ok {
		status = v1.RecordStatus[v1.RecordStatusInvalid]
	}
	fmt.Printf("%v:\n", header)
	fmt.Printf("  Status     : %v\n", status)
	fmt.Printf("  Timestamp  : %v\n", time.Unix(pr.Timestamp, 0).UTC())
	printCensorshipRecord(pr.CensorshipRecord)
	fmt.Printf("  Metadata   : %v\n", pr.Metadata)
	fmt.Printf("  Version    : %v\n", pr.Version)
	for k, v := range pr.Files {
		fmt.Printf("  File (%02v)  :\n", k)
		fmt.Printf("    Name     : %v\n", v.Name)
		fmt.Printf("    MIME     : %v\n", v.MIME)
		fmt.Printf("    Digest   : %v\n", v.Digest)
	}
}

func pluginInventory() (*v1.PluginInventoryReply, error) {
	challenge, err := util.Random(v1.ChallengeSize)
	if err != nil {
		return nil, err
	}
	b, err := json.Marshal(v1.PluginInventory{
		Challenge: hex.EncodeToString(challenge),
	})
	if err != nil {
		return nil, err
	}

	if *printJson {
		fmt.Println(string(b))
	}

	c, err := util.NewClient(verify, *rpccert)
	if err != nil {
		return nil, err
	}
	req, err := http.NewRequest("POST", *rpchost+v1.PluginInventoryRoute,
		bytes.NewReader(b))
	if err != nil {
		return nil, err
	}
	req.SetBasicAuth(*rpcuser, *rpcpass)
	r, err := c.Do(req)
	if err != nil {
		return nil, err
	}
	defer r.Body.Close()
	if r.StatusCode != http.StatusOK {
		e, err := getErrorFromResponse(r)
		if err != nil {
			return nil, fmt.Errorf("%v", r.Status)
		}
		return nil, fmt.Errorf("%v: %v", r.Status, e)
	}

	bodyBytes := util.ConvertBodyToByteArray(r.Body, *printJson)

	var ir v1.PluginInventoryReply
	err = json.Unmarshal(bodyBytes, &ir)
	if err != nil {
		return nil, fmt.Errorf("Could node unmarshal "+
			"PluginInventoryReply: %v", err)
	}

	// Fetch remote identity
	id, err := identity.LoadPublicIdentity(*identityFilename)
	if err != nil {
		return nil, err
	}

	err = util.VerifyChallenge(id, challenge, ir.Response)
	if err != nil {
		return nil, err
	}

	return &ir, nil
}

func plugin() error {
	flags := flag.Args()[1:] // Chop off action.

	if len(flags) != 4 {
		return fmt.Errorf("not enough parameters")
	}

	challenge, err := util.Random(v1.ChallengeSize)
	if err != nil {
		return err
	}
	b, err := json.Marshal(v1.PluginCommand{
		Challenge: hex.EncodeToString(challenge),
		ID:        flags[0],
		Command:   flags[1],
		CommandID: flags[2],
		Payload:   flags[3],
	})
	if err != nil {
		return err
	}

	if *printJson {
		fmt.Println(string(b))
	}

	c, err := util.NewClient(verify, *rpccert)
	if err != nil {
		return err
	}
	req, err := http.NewRequest("POST", *rpchost+v1.PluginCommandRoute,
		bytes.NewReader(b))
	if err != nil {
		return err
	}
	req.SetBasicAuth(*rpcuser, *rpcpass)
	r, err := c.Do(req)
	if err != nil {
		return err
	}
	defer r.Body.Close()
	if r.StatusCode != http.StatusOK {
		e, err := getErrorFromResponse(r)
		if err != nil {
			return fmt.Errorf("%v", r.Status)
		}
		return fmt.Errorf("%v: %v", r.Status, e)
	}

	bodyBytes := util.ConvertBodyToByteArray(r.Body, *printJson)

	var pcr v1.PluginCommandReply
	err = json.Unmarshal(bodyBytes, &pcr)
	if err != nil {
		return fmt.Errorf("Could node unmarshal "+
			"PluginCommandReply: %v", err)
	}

	// Fetch remote identity
	id, err := identity.LoadPublicIdentity(*identityFilename)
	if err != nil {
		return err
	}

	return util.VerifyChallenge(id, challenge, pcr.Response)
}

func getPluginInventory() error {
	pr, err := pluginInventory()
	if err != nil {
		return err
	}

	for _, v := range pr.Plugins {
		fmt.Printf("Plugin ID      : %v\n", v.ID)
		if len(v.Settings) > 0 {
			fmt.Printf("Plugin settings: %v = %v\n",
				v.Settings[0].Key,
				v.Settings[0].Value)
		}
		for _, vv := range v.Settings[1:] {
			fmt.Printf("                 %v = %v\n", vv.Key,
				vv.Value)
		}
	}

	return nil
}

func remoteInventory() (*v1.InventoryReply, error) {
	challenge, err := util.Random(v1.ChallengeSize)
	if err != nil {
		return nil, err
	}
	b, err := json.Marshal(v1.Inventory{
		Challenge: hex.EncodeToString(challenge),
	})
	if err != nil {
		return nil, err
	}

	if *printJson {
		fmt.Println(string(b))
	}

	c, err := util.NewClient(verify, *rpccert)
	if err != nil {
		return nil, err
	}
	req, err := http.NewRequest("POST", *rpchost+v1.InventoryRoute,
		bytes.NewReader(b))
	if err != nil {
		return nil, err
	}
	req.SetBasicAuth(*rpcuser, *rpcpass)
	r, err := c.Do(req)
	if err != nil {
		return nil, err
	}
	defer r.Body.Close()
	if r.StatusCode != http.StatusOK {
		e, err := getErrorFromResponse(r)
		if err != nil {
			return nil, fmt.Errorf("%v", r.Status)
		}
		return nil, fmt.Errorf("%v: %v", r.Status, e)
	}

	bodyBytes := util.ConvertBodyToByteArray(r.Body, *printJson)

	var ir v1.InventoryReply
	err = json.Unmarshal(bodyBytes, &ir)
	if err != nil {
		return nil, fmt.Errorf("Could node unmarshal "+
			"InventoryReply: %v", err)
	}

	// Fetch remote identity
	id, err := identity.LoadPublicIdentity(*identityFilename)
	if err != nil {
		return nil, err
	}

	err = util.VerifyChallenge(id, challenge, ir.Response)
	if err != nil {
		return nil, err
	}

	return &ir, nil
}

func inventory() error {
	flags := flag.Args()[1:] // Chop off action.
	if len(flags) < 2 {
		return fmt.Errorf("vetted and branches counts expected")
	}

	i, err := remoteInventory()
	if err != nil {
		return err
	}

	if !*printJson {
		for _, v := range i.Vetted {
			printRecord("Vetted record", v)
		}
		for _, v := range i.Branches {
			printRecord("Unvetted record", v)
		}
	}

	return nil
}

func getFile(filename string) (*v1.File, *[sha256.Size]byte, error) {
	var err error

	file := &v1.File{
		Name: filepath.Base(filename),
	}
	file.MIME, file.Digest, file.Payload, err = util.LoadFile(filename)
	if err != nil {
		return nil, nil, err
	}

	// Get digest
	digest, err := hex.DecodeString(file.Digest)
	if err != nil {
		return nil, nil, err
	}

	// Store for merkle root verification later
	var digest32 [sha256.Size]byte
	copy(digest32[:], digest)

	return file, &digest32, nil
}

func newRecord() error {
	flags := flag.Args()[1:] // Chop off action.

	// Fish out metadata records and filenames
	md := make([]v1.MetadataStream, 0, len(flags))
	filenames := make([]string, 0, len(flags))
	for _, v := range flags {
		mdRecord := regexMD.FindString(v)
		if mdRecord == "" {
			// Filename
			filenames = append(filenames, v)
			continue
		}

		id, err := strconv.ParseUint(regexMDID.FindString(mdRecord),
			10, 64)
		if err != nil {
			return err
		}
		md = append(md, v1.MetadataStream{
			ID:      id,
			Payload: v[len(mdRecord):],
		})
	}

	if len(filenames) == 0 {
		return fmt.Errorf("no filenames provided")
	}

	// Fetch remote identity
	id, err := identity.LoadPublicIdentity(*identityFilename)
	if err != nil {
		return err
	}

	// Create New command
	challenge, err := util.Random(v1.ChallengeSize)
	if err != nil {
		return err
	}
	n := v1.NewRecord{
		Challenge: hex.EncodeToString(challenge),
		Metadata:  md,
		Files:     make([]v1.File, 0, len(flags[1:])),
	}

	// Open all files, validate MIME type and digest them.
	hashes := make([]*[sha256.Size]byte, 0, len(flags[1:]))
	for i, a := range filenames {
		file, digest, err := getFile(a)
		if err != nil {
			return err
		}
		n.Files = append(n.Files, *file)
		hashes = append(hashes, digest)

		fmt.Printf("%02v: %v %v %v\n",
			i, file.Digest, file.Name, file.MIME)
	}
	fmt.Printf("Record submitted\n")

	// Convert Verify to JSON
	b, err := json.Marshal(n)
	if err != nil {
		return err
	}

	if *printJson {
		fmt.Println(string(b))
	}

	c, err := util.NewClient(verify, *rpccert)
	if err != nil {
		return err
	}
	r, err := c.Post(*rpchost+v1.NewRecordRoute, "application/json",
		bytes.NewReader(b))
	if err != nil {
		return err
	}
	defer r.Body.Close()

	if r.StatusCode != http.StatusOK {
		e, err := getErrorFromResponse(r)
		if err != nil {
			return fmt.Errorf("%v", r.Status)
		}
		return fmt.Errorf("%v: %v", r.Status, e)
	}

	bodyBytes := util.ConvertBodyToByteArray(r.Body, *printJson)

	var reply v1.NewRecordReply
	err = json.Unmarshal(bodyBytes, &reply)
	if err != nil {
		return fmt.Errorf("Could node unmarshal NewReply: %v", err)
	}

	// Verify challenge.
	err = util.VerifyChallenge(id, challenge, reply.Response)
	if err != nil {
		return err
	}

	// Convert merkle, token and signature to verify reply.
	root, err := hex.DecodeString(reply.CensorshipRecord.Merkle)
	if err != nil {
		return err
	}
	sig, err := hex.DecodeString(reply.CensorshipRecord.Signature)
	if err != nil {
		return err
	}
	var signature [identity.SignatureSize]byte
	copy(signature[:], sig)

	// Verify merkle root.
	if !bytes.Equal(merkle.Root(hashes)[:], root) {
		return fmt.Errorf("invalid merkle root")
	}

	// Verify record token signature.
	merkleToken := reply.CensorshipRecord.Merkle + reply.CensorshipRecord.Token
	if !id.VerifyMessage([]byte(merkleToken), signature) {
		return fmt.Errorf("verification failed")
	}

	if !*printJson {
		printCensorshipRecord(reply.CensorshipRecord)
	}

	return nil
}

func updateVettedMetadata() error {
	flags := flag.Args()[1:] // Chop off action.

	// Create New command
	challenge, err := util.Random(v1.ChallengeSize)
	if err != nil {
		return err
	}
	n := v1.UpdateVettedMetadata{
		Challenge: hex.EncodeToString(challenge),
	}

	// Fish out metadata records and filenames
	var tokenCount uint
	for _, v := range flags {
		switch {
		case regexAppendMD.MatchString(v):
			s := regexAppendMD.FindString(v)
			i, err := strconv.ParseUint(regexMDID.FindString(s),
				10, 64)
			if err != nil {
				return err
			}
			n.MDAppend = append(n.MDAppend, v1.MetadataStream{
				ID:      i,
				Payload: v[len(s):],
			})

		case regexOverwriteMD.MatchString(v):
			s := regexOverwriteMD.FindString(v)
			i, err := strconv.ParseUint(regexMDID.FindString(s),
				10, 64)
			if err != nil {
				return err
			}
			n.MDOverwrite = append(n.MDOverwrite, v1.MetadataStream{
				ID:      i,
				Payload: v[len(s):],
			})

		case regexToken.MatchString(v):
			if tokenCount != 0 {
				return fmt.Errorf("only 1 token allowed")
			}
			s := regexToken.FindString(v)
			n.Token = v[len(s):]
			tokenCount++

		default:
			return fmt.Errorf("invalid action %v", v)
		}
	}

	if tokenCount != 1 {
		return fmt.Errorf("must provide token")
	}

	// Fetch remote identity
	id, err := identity.LoadPublicIdentity(*identityFilename)
	if err != nil {
		return err
	}

	// Prety print
	if *verbose {
		fmt.Printf("Update vetted metadata: %v\n", n.Token)
		if len(n.MDOverwrite) > 0 {
			s := "  Metadata overwrite: "
			for _, v := range n.MDOverwrite {
				fmt.Printf("%s%v", s, v.ID)
				s = ", "
			}
			fmt.Printf("\n")
		}
		if len(n.MDAppend) > 0 {
			s := "  Metadata append   : "
			for _, v := range n.MDAppend {
				fmt.Printf("%s%v", s, v.ID)
				s = ", "
			}
			fmt.Printf("\n")
		}
	}

	// Convert Verify to JSON
	b, err := json.Marshal(n)
	if err != nil {
		return err
	}

	if *printJson {
		fmt.Println(string(b))
	}

	c, err := util.NewClient(verify, *rpccert)
	if err != nil {
		return err
	}
	req, err := http.NewRequest("POST", *rpchost+v1.UpdateVettedMetadataRoute,
		bytes.NewReader(b))
	if err != nil {
		return err
	}
	req.SetBasicAuth(*rpcuser, *rpcpass)
	r, err := c.Do(req)
	if err != nil {
		return err
	}
	defer r.Body.Close()

	if r.StatusCode != http.StatusOK {
		e, err := getErrorFromResponse(r)
		if err != nil {
			return fmt.Errorf("%v", r.Status)
		}
		return fmt.Errorf("%v: %v", r.Status, e)
	}

	bodyBytes := util.ConvertBodyToByteArray(r.Body, *printJson)

	var reply v1.UpdateVettedMetadataReply
	err = json.Unmarshal(bodyBytes, &reply)
	if err != nil {
		return fmt.Errorf("Could node unmarshal UpdateReply: %v", err)
	}

	// Verify challenge.
	return util.VerifyChallenge(id, challenge, reply.Response)
}
func updateRecord(vetted bool) error {
	flags := flag.Args()[1:] // Chop off action.

	// Create New command
	challenge, err := util.Random(v1.ChallengeSize)
	if err != nil {
		return err
	}
	n := v1.UpdateRecord{
		Challenge: hex.EncodeToString(challenge),
	}

	// Fish out metadata records and filenames
	var tokenCount uint
	for _, v := range flags {
		switch {
		case regexAppendMD.MatchString(v):
			s := regexAppendMD.FindString(v)
			i, err := strconv.ParseUint(regexMDID.FindString(s),
				10, 64)
			if err != nil {
				return err
			}
			n.MDAppend = append(n.MDAppend, v1.MetadataStream{
				ID:      i,
				Payload: v[len(s):],
			})

		case regexOverwriteMD.MatchString(v):
			s := regexOverwriteMD.FindString(v)
			i, err := strconv.ParseUint(regexMDID.FindString(s),
				10, 64)
			if err != nil {
				return err
			}
			n.MDOverwrite = append(n.MDOverwrite, v1.MetadataStream{
				ID:      i,
				Payload: v[len(s):],
			})

		case regexFileAdd.MatchString(v):
			s := regexFileAdd.FindString(v)
			f, _, err := getFile(v[len(s):])
			if err != nil {
				return err
			}
			n.FilesAdd = append(n.FilesAdd, *f)

		case regexFileDel.MatchString(v):
			s := regexFileDel.FindString(v)
			n.FilesDel = append(n.FilesDel, v[len(s):])

		case regexToken.MatchString(v):
			if tokenCount != 0 {
				return fmt.Errorf("only 1 token allowed")
			}
			s := regexToken.FindString(v)
			n.Token = v[len(s):]
			tokenCount++

		default:
			return fmt.Errorf("invalid action %v", v)
		}
	}

	if tokenCount != 1 {
		return fmt.Errorf("must provide token")
	}

	// Fetch remote identity
	id, err := identity.LoadPublicIdentity(*identityFilename)
	if err != nil {
		return err
	}

	// Prety print
	if *verbose {
		fmt.Printf("Update record: %v\n", n.Token)
		if len(n.FilesAdd) > 0 {
			s := "  Files add         : "
			ss := strings.Repeat(" ", len(s))
			for i, v := range n.FilesAdd {
				fmt.Printf("%s%02v: %v %v %v\n",
					s, i, v.Digest, v.Name, v.MIME)
				s = ss
			}
		}
		if len(n.FilesDel) > 0 {
			s := "  Files delete      : "
			ss := strings.Repeat(" ", len(s))
			for _, v := range n.FilesDel {
				fmt.Printf("%s%v\n", s, v)
				s = ss
			}
		}
		if len(n.MDOverwrite) > 0 {
			s := "  Metadata overwrite: "
			for _, v := range n.MDOverwrite {
				fmt.Printf("%s%v", s, v.ID)
				s = ", "
			}
			fmt.Printf("\n")
		}
		if len(n.MDAppend) > 0 {
			s := "  Metadata append   : "
			for _, v := range n.MDAppend {
				fmt.Printf("%s%v", s, v.ID)
				s = ", "
			}
			fmt.Printf("\n")
		}
	}

	// Convert Verify to JSON
	b, err := json.Marshal(n)
	if err != nil {
		return err
	}

	if *printJson {
		fmt.Println(string(b))
	}

	c, err := util.NewClient(verify, *rpccert)
	if err != nil {
		return err
	}
	route := *rpchost + v1.UpdateUnvettedRoute
	if vetted {
		route = *rpchost + v1.UpdateVettedRoute
	}
	r, err := c.Post(route, "application/json", bytes.NewReader(b))
	if err != nil {
		return err
	}
	defer r.Body.Close()

	if r.StatusCode != http.StatusOK {
		e, err := getErrorFromResponse(r)
		if err != nil {
			return fmt.Errorf("%v", r.Status)
		}
		return fmt.Errorf("%v: %v", r.Status, e)
	}

	bodyBytes := util.ConvertBodyToByteArray(r.Body, *printJson)

	var reply v1.UpdateRecordReply
	err = json.Unmarshal(bodyBytes, &reply)
	if err != nil {
		return fmt.Errorf("Could node unmarshal UpdateReply: %v", err)
	}

	// Verify challenge.
	err = util.VerifyChallenge(id, challenge, reply.Response)
	if err != nil {
		return err
	}

	// Decode signature to verify
	sig, err := hex.DecodeString(reply.Record.CensorshipRecord.Signature)
	if err != nil {
		return err
	}
	var signature [identity.SignatureSize]byte
	copy(signature[:], sig)

	// Verify record token signature.
	merkleToken := reply.Record.CensorshipRecord.Merkle +
		reply.Record.CensorshipRecord.Token
	if !id.VerifyMessage([]byte(merkleToken), signature) {
		return fmt.Errorf("verification failed")
	}

	// Verify that the files that were returned match the record.
	err = v1.Verify(*id, reply.Record.CensorshipRecord, reply.Record.Files)
	if err != nil {
		return err
	}

	if !*printJson {
		mode := "Unvetted record"
		if vetted {
			mode = "Vetted record"
		}
		printRecord(mode, reply.Record)
	}

	return nil
}

func getUnvetted() error {
	flags := flag.Args()[1:] // Chop off action.

	// Make sure we have the censorship token
	if len(flags) != 1 {
		return fmt.Errorf("must provide one and only one censorship " +
			"token")
	}

	// Validate censorship token
	_, err := util.ConvertStringToken(flags[0])
	if err != nil {
		return err
	}

	// Fetch remote identity
	id, err := identity.LoadPublicIdentity(*identityFilename)
	if err != nil {
		return err
	}

	// Create New command
	challenge, err := util.Random(v1.ChallengeSize)
	if err != nil {
		return err
	}
	n := v1.GetUnvetted{
		Challenge: hex.EncodeToString(challenge),
		Token:     flags[0],
	}

	// Convert to JSON
	b, err := json.Marshal(n)
	if err != nil {
		return err
	}

	if *printJson {
		fmt.Println(string(b))
	}

	c, err := util.NewClient(verify, *rpccert)
	if err != nil {
		return err
	}
	r, err := c.Post(*rpchost+v1.GetUnvettedRoute, "application/json",
		bytes.NewReader(b))
	if err != nil {
		return err
	}
	defer r.Body.Close()

	if r.StatusCode != http.StatusOK {
		e, err := getErrorFromResponse(r)
		if err != nil {
			return fmt.Errorf("%v", r.Status)
		}
		return fmt.Errorf("%v: %v", r.Status, e)
	}

	bodyBytes := util.ConvertBodyToByteArray(r.Body, *printJson)

	var reply v1.GetUnvettedReply
	err = json.Unmarshal(bodyBytes, &reply)
	if err != nil {
		return fmt.Errorf("Could not unmarshal GetUnvettedReply: %v",
			err)
	}

	// Verify challenge.
	err = util.VerifyChallenge(id, challenge, reply.Response)
	if err != nil {
		return err
	}

	// Verify status
	if reply.Record.Status == v1.RecordStatusInvalid ||
		reply.Record.Status == v1.RecordStatusNotFound {
		// Pretty print record
		status, ok := v1.RecordStatus[reply.Record.Status]
		if !ok {
			status = v1.RecordStatus[v1.RecordStatusInvalid]
		}
		fmt.Printf("Record       : %v\n", flags[0])
		fmt.Printf("  Status     : %v\n", status)
		return nil
	}

	// Verify content
	err = v1.Verify(*id, reply.Record.CensorshipRecord,
		reply.Record.Files)
	if err != nil {
		return err
	}

	if !*printJson {
		printRecord("Unvetted record", reply.Record)
	}
	return nil
}

func getVetted() error {
	flags := flag.Args()[1:] // Chop off action.

	// Make sure we have the censorship token
	if len(flags) != 1 {
		return fmt.Errorf("must provide one and only one censorship " +
			"token")
	}

	// Validate censorship token
	_, err := util.ConvertStringToken(flags[0])
	if err != nil {
		return err
	}

	// Fetch remote identity
	id, err := identity.LoadPublicIdentity(*identityFilename)
	if err != nil {
		return err
	}

	// Create New command
	challenge, err := util.Random(v1.ChallengeSize)
	if err != nil {
		return err
	}
	n := v1.GetVetted{
		Challenge: hex.EncodeToString(challenge),
		Token:     flags[0],
	}

	// Convert to JSON
	b, err := json.Marshal(n)
	if err != nil {
		return err
	}

	if *printJson {
		fmt.Println(string(b))
	}

	c, err := util.NewClient(verify, *rpccert)
	if err != nil {
		return err
	}
	r, err := c.Post(*rpchost+v1.GetVettedRoute, "application/json",
		bytes.NewReader(b))
	if err != nil {
		return err
	}
	defer r.Body.Close()

	if r.StatusCode != http.StatusOK {
		e, err := getErrorFromResponse(r)
		if err != nil {
			return fmt.Errorf("%v", r.Status)
		}
		return fmt.Errorf("%v: %v", r.Status, e)
	}

	bodyBytes := util.ConvertBodyToByteArray(r.Body, *printJson)

	var reply v1.GetVettedReply
	err = json.Unmarshal(bodyBytes, &reply)
	if err != nil {
		return fmt.Errorf("Could not unmarshal GetVettedReply: %v",
			err)
	}

	// Verify challenge.
	err = util.VerifyChallenge(id, challenge, reply.Response)
	if err != nil {
		return err
	}

	// Verify status
	if reply.Record.Status == v1.RecordStatusInvalid ||
		reply.Record.Status == v1.RecordStatusNotFound {
		// Pretty print record
		status, ok := v1.RecordStatus[reply.Record.Status]
		if !ok {
			status = v1.RecordStatus[v1.RecordStatusInvalid]
		}
		fmt.Printf("Record     : %v\n", flags[0])
		fmt.Printf("  Status   : %v\n", status)
		return nil
	}

	// Verify content
	err = v1.Verify(*id, reply.Record.CensorshipRecord,
		reply.Record.Files)
	if err != nil {
		return err
	}

	if !*printJson {
		printRecord("Vetted record", reply.Record)
	}
	return nil
}

func convertStatus(s string) (v1.RecordStatusT, error) {
	switch s {
	case "censor":
		return v1.RecordStatusCensored, nil
	case "publish":
		return v1.RecordStatusPublic, nil
	}

	return v1.RecordStatusInvalid, fmt.Errorf("invalid status")
}

func setUnvettedStatus() error {
	flags := flag.Args()[1:] // Chop off action.

	// Make sure we have the status and the censorship token
	if len(flags) < 2 {
		return fmt.Errorf("must at least provide status and " +
			"censorship token")
	}

	// Verify we got a valid status
	status, err := convertStatus(flags[0])
	if err != nil {
		return err
	}

	// Validate censorship token
	_, err = util.ConvertStringToken(flags[1])
	if err != nil {
		return err
	}

	// Fetch remote identity
	id, err := identity.LoadPublicIdentity(*identityFilename)
	if err != nil {
		return err
	}

	// Create New command
	challenge, err := util.Random(v1.ChallengeSize)
	if err != nil {
		return err
	}
	n := v1.SetUnvettedStatus{
		Challenge: hex.EncodeToString(challenge),
		Status:    status,
		Token:     flags[1],
	}

	// Optional metadata updates
	for _, v := range flags[2:] {
		switch {
		case regexAppendMD.MatchString(v):
			s := regexAppendMD.FindString(v)
			i, err := strconv.ParseUint(regexMDID.FindString(s),
				10, 64)
			if err != nil {
				return err
			}
			n.MDAppend = append(n.MDAppend, v1.MetadataStream{
				ID:      i,
				Payload: v[len(s):],
			})

		case regexOverwriteMD.MatchString(v):
			s := regexOverwriteMD.FindString(v)
			i, err := strconv.ParseUint(regexMDID.FindString(s),
				10, 64)
			if err != nil {
				return err
			}
			n.MDOverwrite = append(n.MDOverwrite, v1.MetadataStream{
				ID:      i,
				Payload: v[len(s):],
			})
		default:
			return fmt.Errorf("invalid metadata action %v", v)
		}
	}

	// Convert to JSON
	b, err := json.Marshal(n)
	if err != nil {
		return err
	}

	if *printJson {
		fmt.Println(string(b))
	}

	c, err := util.NewClient(verify, *rpccert)
	if err != nil {
		return err
	}
	req, err := http.NewRequest("POST", *rpchost+v1.SetUnvettedStatusRoute,
		bytes.NewReader(b))
	if err != nil {
		return err
	}
	req.SetBasicAuth(*rpcuser, *rpcpass)
	r, err := c.Do(req)
	if err != nil {
		return err
	}
	defer r.Body.Close()

	if r.StatusCode != http.StatusOK {
		e, err := getErrorFromResponse(r)
		if err != nil {
			return fmt.Errorf("%v", r.Status)
		}
		return fmt.Errorf("%v: %v", r.Status, e)
	}

	bodyBytes := util.ConvertBodyToByteArray(r.Body, *printJson)

	var reply v1.SetUnvettedStatusReply
	err = json.Unmarshal(bodyBytes, &reply)
	if err != nil {
		return fmt.Errorf("Could not unmarshal "+
			"SetUnvettedStatusReply: %v", err)
	}

	// Verify challenge.
	err = util.VerifyChallenge(id, challenge, reply.Response)
	if err != nil {
		return err
	}

	if !*printJson {
		// Pretty print record
		status, ok := v1.RecordStatus[reply.Record.Status]
		if !ok {
			status = v1.RecordStatus[v1.RecordStatusInvalid]
		}
		fmt.Printf("Set record status:\n")
		fmt.Printf("  Status   : %v\n", status)
	}

	return nil
}

func _main() error {
	flag.Parse()
	if len(flag.Args()) == 0 {
		usage()
		return fmt.Errorf("must provide action")
	}

	if *rpchost == "" {
		if *testnet {
			*rpchost = v1.DefaultTestnetHost
		} else {
			*rpchost = v1.DefaultMainnetHost
		}
	} else {
		// For now assume we can't verify server TLS certificate
		verify = true
	}

	port := v1.DefaultMainnetPort
	if *testnet {
		port = v1.DefaultTestnetPort
	}

	*rpchost = util.NormalizeAddress(*rpchost, port)

	// Set port if not specified.
	u, err := url.Parse("https://" + *rpchost)
	if err != nil {
		return err
	}
	*rpchost = u.String()

	// Scan through command line arguments.
	for i, a := range flag.Args() {
		// Select action
		if i == 0 {
			switch a {
			case "new":
				return newRecord()
			case "identity":
				return getIdentity()
			case "plugin":
				return plugin()
			case "plugininventory":
				return getPluginInventory()
			case "inventory":
				return inventory()
			case "getunvetted":
				return getUnvetted()
			case "getvetted":
				return getVetted()
			case "setunvettedstatus":
				return setUnvettedStatus()
			case "updateunvetted":
				return updateRecord(false)
			case "updatevetted":
				return updateRecord(true)
			case "updatevettedmd":
				return updateVettedMetadata()
			default:
				return fmt.Errorf("invalid action: %v", a)
			}
		}
	}

	return nil
}

func main() {
	err := _main()
	if err != nil {
		fmt.Fprintf(os.Stderr, "%v\n", err)
		os.Exit(1)
	}
}

license: ISC

repository: HcashOrg/hcAutonomy

repo_name: HcashOrg/hcAutonomy


text:
package config

import (
	"fmt"
	"os"
	"reflect"

	"github.com/pkg/errors"
	log "github.com/sirupsen/logrus"
)

func EnsureEnv(config interface{}) error {
	if reflect.ValueOf(config).Kind() == reflect.Ptr {
		return errors.WithStack(fmt.Errorf("can not reflect value of pointer"))
	}

	v := reflect.ValueOf(config)

	for i := 0; i < v.NumField(); i++ {
		tag := v.Type().Field(i).Tag.Get("env")

		if tag == "" {
			continue
		}

		if os.Getenv(tag) == "" {
			err := os.Setenv(tag, v.Field(i).String())
			if err != nil {
				return err
			}
			log.WithFields(log.Fields{
				"variable": tag,
				"value":    v.Field(i).String(),
			}).Debug("setting environment variable")
		}
	}

	return nil
}

repository: mittwald/brudi

repo_name: mittwald/brudi

gha_license_id: MIT

gha_language: Go


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ASF.Application.DTO;
using ASF.Domain.Entities;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace ASF.Infrastructure.Repositories
{
    public class CachingRoleRepository<T> : IRoleRepository where T : IRoleRepository
    {
        private readonly T _repository;
        private readonly ICache<Role> _roleCache;
        private readonly string _cacheKey = "GetList";
        private readonly ILogger<CachingRoleRepository<T>> _logger;
        private TimeSpan _duration = new TimeSpan(1000, 0, 0, 0);
        public CachingRoleRepository(T repository, ICache<Role> roleCache, ILogger<CachingRoleRepository<T>> logger)
        {
            _repository = repository;
            _roleCache = roleCache;
            _logger = logger;
        }
        public async Task<Role> AddAsync(Role entity)
        {
            return await _repository.AddAsync(entity);
        }

        public async Task<Role> GetAsync(int id)
        {
            var list = await _roleCache.GetAsync(_cacheKey, _duration, async () => await _repository.GetList(), _logger);
            return list.FirstOrDefault(w => w.Id == id);
        }

        public async Task<IList<Role>> GetList(IList<int> ids)
        {
            var list = await _roleCache.GetAsync(_cacheKey, _duration, async () => await _repository.GetList(), _logger);
            return list.Where(w => ids.Contains(w.Id)).ToList();
        }

        public async Task<IList<Role>> GetList()
        {
            return await _roleCache.GetAsync(_cacheKey, _duration, async () => await _repository.GetList(), _logger);
        }

        public async Task<(IList<Role> Roles, int TotalCount)> GetList(RoleListPagedRequestDto requestDto)
        {
            var list = await _roleCache.GetAsync(_cacheKey, _duration, async () => await _repository.GetList(), _logger);
            var queryable = list.Where(w => w.Id > 0);

            if (!string.IsNullOrEmpty(requestDto.Vague))
            {
                queryable = queryable
                    .Where(w => w.Id.ToString() == requestDto.Vague
                    || w.Name.Contains(requestDto.Vague));
            }
            if (requestDto.Enable == 1)
                queryable = queryable.Where(w => w.Enable == true);
            if (requestDto.Enable == 0)
                queryable = queryable.Where(w => w.Enable == false);

            return (queryable.Skip((requestDto.SkipPage - 1) * requestDto.PagedCount).Take(requestDto.PagedCount).ToList(), queryable.Count());
        }

        public async Task ModifyAsync(Role role)
        {
            await _repository.ModifyAsync(role);

            //更新缓存
            var list = await _roleCache.GetAsync(_cacheKey, _duration, async () => await _repository.GetList(), _logger);
            var entity = list.FirstOrDefault(f => f.Id == role.Id);
            if (entity != null)
            {
                list.Remove(entity);
                var model = await _repository.GetAsync(role.Id);
                if (model != null)
                    list.Add(model);
                await _roleCache.SetAsync(_cacheKey, list, _duration);
            }
        }

        public async Task ModifyAsync(int roleId, bool enable)
        {
            await _repository.ModifyAsync(roleId, enable);

            //更新缓存
            var list = await _roleCache.GetAsync(_cacheKey, _duration, async () => await _repository.GetList(), _logger);
            var entity = list.FirstOrDefault(f => f.Id == roleId);
            if (entity != null)
            {
                list.Remove(entity);
                var model = await _repository.GetAsync(roleId);
                if (model != null)
                    list.Add(model);
                await _roleCache.SetAsync(_cacheKey, list, _duration);
            }
        }

        public async Task RemoveAsync(int primaryKey)
        {
            await _repository.RemoveAsync(primaryKey);

            //更新缓存
            var list = await _roleCache.GetAsync(_cacheKey, _duration, async () => await _repository.GetList(), _logger);
            var entity = list.FirstOrDefault(f => f.Id == primaryKey);
            if (entity != null)
            {
                list.Remove(entity);
                await _roleCache.SetAsync(_cacheKey, list, _duration);
            }
        }
    }
}

repository: lanhouzi/ASF

repo_name: lanhouzi/ASF

extension: cs


text:
add_library(Qt5::QTiffPlugin MODULE IMPORTED)

_populate_Gui_plugin_properties(QTiffPlugin RELEASE "imageformats/qtiff.dll")
_populate_Gui_plugin_properties(QTiffPlugin DEBUG "imageformats/qtiffd.dll")

list(APPEND Qt5Gui_PLUGINS Qt5::QTiffPlugin)

repository: timi-liuliang/echo

repo_name: timi-liuliang/echo

extension: cmake


text:
@phdthesis{angiuli:2019,
  author = {Angiuli, Carlo},
  institution = {Carnegie Mellon University},
  date = {2019},
  title = {Computational Semantics of Cartesian Cubical Type Theory},
}

@online{abcfhl:2019,
  author = {Angiuli, Carlo and Brunerie, Guillaume and Coquand, Thierry and {Hou (Favonia)}, Kuen-Bang and Harper, Robert and Licata, Daniel R.},
  url = {https://github.com/dlicata335/cart-cube},
  date = {2019-02},
  note = {Preprint},
  title = {Syntax and Models of Cartesian Cubical Type Theory},
}

@inproceedings{orton-pitts:2016,
  author = {Orton, Ian and Pitts, Andrew M.},
  booktitle = {25th {EACSL} Annual Conference on Computer Science Logic, {CSL} 2016, August 29 - September 1, 2016, Marseille, France},
  date = {2016},
  pages = {24:1--24:19},
  title = {Axioms for Modelling Cubical Type Theory in a Topos},
}

repository: ecavallo/cooltt

repo_name: ecavallo/cooltt


text:
@PhdThesis{clas.thesis.goetz,
    Author = {John T. Goetz},
    School = {University of California Los Angeles},
    Title = {{Ξ Hyperon Photoproduction from Threshold to 5.4~GeV with the \texttt{CEBAF} Large Acceptance Spectrometer}},
    Year = {2010},
}

@PhdThesis{clas.thesis.bookwalter,
    Author = {Craig Bookwalter},
    School = {Florida State University},
    Title = {{A Search for Exotic Mesons in \mbox{γ p $\rightarrow$ π$^+$ π$^+$ π$^-$ n} with \texttt{CLAS} at Jefferson Lab}},
    Year = {2012},
}

@PhdThesis{clas.thesis.schott,
    Author = {Diane Schott},
    School = {Florida International University},
    Title = {{A Search for an Exotic Meson in the \mbox{γ p $\rightarrow$ Δ$^{++}$ π$^-$ η} Reaction}},
    Year = {2012},
}

@PhdThesis{clas.thesis.saini,
    Author = {Mukesh Saini},
    School = {Florida State University},
    Title = {{Search for New and Unusual Stangonia using CLAS}},
    Year = {2013},
}

@PhdThesis{clas.thesis.bono,
    Author = {Jason Bono},
    School = {Florida International University},
    Title = {{First Time Measurements of Polarization Observables for the Charged Cascade Hyperon in Photoproduction}},
    Year = {2014},
}

@PhdThesis{clas.thesis.kunkel,
    Author = {Michael C. Kunkel},
    School = {Old Dominion University},
    Title = {{Photoproduction of $\pi^0$ on hydrogen with CLAS from 1.1 GeV - 5.45 GeV using $\lowercase{e}^{+}\lowercase{e}^{-}\gamma$ decay}},
    Year = {2014},
}

@PhdThesis{clas.thesis.chandavar,
    Author = {Shloka Chandavar},
    School = {Ohio University},
    Title = {{Photoproduction of Scalar Mesons Using the CEBAF Large Acceptance Spectrometer (CLAS)}},
    Year = {2015},
}

@PhdThesis{clas.thesis.mckinnon,
    Author = {M\textsuperscript{c}Kinnon, Bryan},
    School = {University of Glasgow},
    Title = {{Search for the θ$^+$ Pentaquark in the Reaction \mbox{γ d $\rightarrow$ p K$^+$ K$^+$ n} with \texttt{CLAS}}},
    Year = {2006},
}

@PhdThesis{clas.thesis.williams,
    Author = {Williams, Mike},
    School = {Carnegie Mellon University},
    Title = {{Measurement of Differential Cross Sections and Spin Density Matrix Elements along with a Partial Wave Analysis for \mbox{γ p $\rightarrow$ p ω} using \texttt{CLAS} at Jefferson Lab}},
    Year = {2007},
}

license: Unlicense

gha_language: PostScript


text:
@article{oude_rengerink_improving_2010,
	title = {{IMproving} {PArticipation} of patients in Clinical Trials--rationale and design of {IMPACT}},
	volume = {10},
	issn = {1471-2288},
	url = {http://www.ncbi.nlm.nih.gov/pubmed/20875119},
	doi = {10.1186/1471-2288-10-85},
	abstract = {Abstract: "
{BACKGROUND}: One of the most commonly reported problems of randomised trials is that recruitment is usually slower than expected. Trials will cost more and take longer, thus delaying the use of the results in clinical practice, and incomplete samples imply decreased statistical power and usefulness of its results. We aim to identify barriers and facilitators for successful patient recruitment at the level of the patient, the doctor and the hospital organization as well as the organization and design of trials over a broad range of studies. {METHODS}/{DESIGN}: We will perform two cohort studies and a case-control study in The Netherlands. The first cohort study will report on a series of multicenter trials performed in a nationwide network of clinical trials in obstetrics and gynaecology. A questionnaire will be sent to all clinicians recruiting for these trials to identify determinants--aggregated at centre level--for the recruitment rate. In a case control-study nested in this cohort we will interview patients who refused or consented participation to identify factors associated with patients' consent or refusal. In a second cohort study, we will study trials that were prospectively registered in the Netherlands Trial Register. Using a questionnaire survey we will assess whether issues on hospital organization, trial organization, planning and trial design were associated with successful recruitment, i.e. 80% of the predefined number of patients recruited within the planned time. {DISCUSSION}: This study will provide insight in barriers and facilitators for successful patient recruitment in trials. The results will be used to provide recommendations and a checklist for individual trialists to identify potential pitfalls for recruitment and judge the feasibility prior to the start of the study. Identified barriers and motivators coupled to evidence-based interventions can improve recruitment of patients in clinical trials."},
	pages = {85},
	journaltitle = {{BMC} Medical Research Methodology},
	shortjournal = {{BMC} Med Res Methodol},
	author = {Oude Rengerink, Katrien and Opmeer, Brent C and Logtenberg, Sabine L M and Hooft, Lotty and Bloemenkamp, Kitty W M and Haak, Monique C and Oudijk, Martijn A and Spaanderman, Marc E and Duvekot, Johannes J and Willekes, Christine and van Pampus, Maria G and Porath, Martina M and van Eyck, Jim and Sikkema, Marko J and Mol, Ben Willem J},
	urldate = {2011-10-24},
	date = {2010},
	pmid = {20875119}
}

repository: pmean/build-website

repo_name: pmean/build-website


text:
/**********************************************************************
 * LeechCraft - modular cross-platform feature rich internet client.
 * Copyright (C) 2010-2012  Oleg Linkin
 *
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
 **********************************************************************/

#pragma once

#include <functional>
#include <QObject>
#include <QQueue>
#include <QPair>
#include <QDomElement>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <interfaces/core/icoreproxyfwd.h>
#include "profiletypes.h"
#include "ljaccount.h"

namespace LC
{
namespace Blogique
{
namespace Metida
{
	class LJFriendEntry;

	class LJXmlRPC : public QObject
	{
		Q_OBJECT

		LJAccount * const Account_;
		const ICoreProxy_ptr Proxy_;

		QQueue<std::function<void (const QString&)>> ApiCallQueue_;

		QHash<QNetworkReply*, int> Reply2Skip_;
		QHash<QNetworkReply*, Filter> Reply2Filter_;
		QHash<QNetworkReply*, QDate> Reply2Date_;

		enum class RequestType
		{
			Update,
			Post,
			RecentComments,
			Tags
		};

		QHash<QNetworkReply*, RequestType> Reply2RequestType_;
		QMap<QPair<int, int>, LJCommentEntry> Id2CommentEntry_;

	public:
		LJXmlRPC (LJAccount *acc, const ICoreProxy_ptr& proxy, QObject *parent = 0);

		void Validate (const QString& login, const QString& pass);

		void AddNewFriend (const QString& username,
				const QString& bgcolor, const QString& fgcolor, uint groupMask);
		void DeleteFriend (const QString& username);

		void AddGroup (const QString& name, bool isPublic, int id);
		void DeleteGroup (int id);

		void UpdateProfileInfo ();

		void Preview (const LJEvent& event);
		void Submit (const LJEvent& event);
		void GetEventsWithFilter (const Filter& filter);
		void GetLastEvents (int count);
		void GetMultiplyEvents (const QList<int>& ids, RequestType rt);
		void GetParticularEvent (int id, RequestType rt);
		void GetChangedEvents (const QDateTime& dt);
		void GetEventsByDate (const QDate& date, int skip = 0);

		void RemoveEvent (const LJEvent& event);
		void UpdateEvent (const LJEvent& event);

		void RequestStatistics ();

		void RequestLastInbox ();
		void SetMessagesAsRead (const QList<int>& ids);
		void SendMessage (const QStringList& addresses, const QString& subject,
				const QString& text);

		void RequestRecentCommments ();
		void DeleteComment (qint64 id, bool deleteThread = false);
		void AddComment (const CommentEntry& comment);

		void RequestTags ();

	private:
		std::shared_ptr<void> MakeRunnerGuard ();
		void CallNextFunctionFromQueue ();
		void GenerateChallenge () const;
		void ValidateAccountData (const QString& login,
				const QString& pass, const QString& challenge);
		void RequestFriendsInfo (const QString& login,
				const QString& pass, const QString& challenge);
		void AddNewFriendRequest (const QString& username,
				const QString& bgcolor, const QString& fgcolor,
				int groupMask, const QString& challenge);
		void DeleteFriendRequest (const QString& usernames,
				const QString& challenge);

		void AddGroupRequest (const QString& name, bool isPublic, int id,
				const QString& challenge);
		void DeleteGroupRequest (int id, const QString& challenge);

		void PreviewEventRequest (const LJEvent& event, const QString& challenge);
		void PostEventRequest (const LJEvent& event, const QString& challenge);
		void RemoveEventRequest (const LJEvent& event, const QString& challenge);
		void UpdateEventRequest (const LJEvent& event, const QString& challenge);

		void BackupEventsRequest (const Filter& filter, const QString& challenge);

		void GetLastEventsRequest (int count, const QString& challenge);
		void GetChangedEventsRequest (const QDateTime& dt, const QString& challenge);
		void GetEventsByDateRequest (const QDate& date, int skip = 0,
				const QString& challenge = QString ());
		void GetParticularEventRequest (int id, RequestType prt,
				const QString& challenge);
		void GetMultipleEventsRequest (const QList<int>& ids, RequestType rt,
				const QString& challenge);

		void BlogStatisticsRequest (const QString& challenge);

		void InboxRequest (const QString& challenge);
		void SetMessageAsReadRequest (const QList<int>& ids, const QString& challenge);
		void SendMessageRequest (const QStringList& addresses, const QString& subject,
				const QString& text, const QString& challenge);

		void RecentCommentsRequest (const QString& challenge);
		void DeleteCommentRequest (qint64 id, bool deleteThread, const QString& challenge);
		void AddCommentRequest (const CommentEntry& comment, const QString& challenge);

		void GetUserTagsRequest (const QString& challenge);

		void ParseForError (const QByteArray& content);
		void ParseFriends (const QDomDocument& doc);

	private slots:
		void handleChallengeReplyFinished ();
		void handleValidateReplyFinished ();
		void handleRequestFriendsInfoFinished ();
		void handleAddNewFriendReplyFinished ();
		void handleReplyWithProfileUpdate ();
		void handlePreviewEventReplyFinished ();
		void handlePostEventReplyFinished ();
		void handleBackupEventsReplyFinished ();
		void handleGotEventsReplyFinished ();
		void handleGotEventsByDateReplyFinished ();
		void handleRemoveEventReplyFinished ();
		void handleUpdateEventReplyFinished ();
		void handleGetParticularEventReplyFinished ();
		void handleGetMultipleEventsReplyFinished ();
		void handleBlogStatisticsReplyFinished ();
		void handleInboxReplyFinished ();
		void handleMessagesSetAsReadFinished ();
		void handleSendMessageRequestFinished ();
		void handleRecentCommentsReplyFinished ();
		void handleDeleteCommentReplyFinished ();
		void handleAddCommentReplyFinished ();
		void handleGetUserTagsReplyFinished ();

		void handleNetworkError (QNetworkReply::NetworkError error);

	signals:
		void validatingFinished (bool success);
		void profileUpdated (const LJProfileData& profile);
		void error (int code, const QString& msg,
				const QString& localizedMsg);
		void networkError (int code, const QString& msg);

		void eventPosted (const QList<LJEvent>& events);
		void eventUpdated (const QList<LJEvent>& events);
		void eventRemoved (int itemId);

		void gotFilteredEvents (const QList<LJEvent>& events);
		void gettingFilteredEventsFinished ();

		void gotEvents (const QList<LJEvent>& events);

		void gotStatistics (const QMap<QDate, int>& statistics);

		void unreadMessagesIds (const QList<int>& unreadIds);
		void messagesRead ();
		void messageSent ();

		void gotRecentComments (const QList<LJCommentEntry>& comments);
		void commentsDeleted (const QList<qint64>& ids);
		void commentSent (const QUrl& url);

		void gotTags (const QHash<QString, int>& tags);
	};
}
}
}

extension: h


text:
/**
 * @file
 * @copyright This code is licensed under the 3-clause BSD license.\n
 *            Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group.\n
 *            See LICENSE.txt for details.
 */

#include <Utils/Properties/Reactivity/ConceptualDft.h>
#include <gmock/gmock.h>
#include <Eigen/Core>
#include <memory>

using namespace testing;

namespace Scine {
namespace Utils {

/*
 * Reference calculation performed Multiwfn Version 3.7(dev)
 * http://sobereva.com/multiwfn
 * Tian Lu, Feiwu Chen, J. Comput. Chem. 33, 580-592 (2012).
 * ---
 *
 * Note: the E(HOMO) of TCE used for evaluating nucleophilicity index is the value evaluated at B3LYP/6-31G* level
 *
 * Hirshfeld charges, condensed Fukui functions and condensed dual descriptors
 * Units used below are "e" (elementary charge)
 *     Atom     q(N)    q(N+1)   q(N-1)     f-       f+       f0      CDD
 *     1(C )   0.1326  -0.0595   0.2626   0.1301   0.1921   0.1611   0.0621
 *     2(C )   0.1326  -0.0595   0.2624   0.1298   0.1921   0.1610   0.0623
 *     3(H )   0.0419  -0.0547   0.1615   0.1196   0.0966   0.1081  -0.0230
 *     4(O )  -0.1744  -0.3857   0.0751   0.2495   0.2113   0.2304  -0.0382
 *     5(O )  -0.1744  -0.3858   0.0769   0.2513   0.2113   0.2313  -0.0400
 *     6(H )   0.0419  -0.0547   0.1615   0.1197   0.0966   0.1081  -0.0231

 * Condensed local electrophilicity/nucleophilicity index (e*eV)
 *     Atom              Electrophilicity          Nucleophilicity
 *     1(C )                  0.27323                  0.39891
 *     2(C )                  0.27322                  0.39829
 *     3(H )                  0.13733                  0.36675
 *     4(O )                  0.30056                  0.76544
 *     5(O )                  0.30057                  0.77094
 *     6(H )                  0.13733                  0.36707

 * Condensed local softnesses (Hartree*e) and relative electrophilicity/nucleophilicity (dimensionless)
 *     Atom         s-          s+          s0        s+/s-       s-/s+
 *     1(C )      0.3785      0.5591      0.4688      1.4772      0.6770
 *     2(C )      0.3779      0.5591      0.4685      1.4795      0.6759
 *     3(H )      0.3480      0.2810      0.3145      0.8076      1.2383
 *     4(O )      0.7263      0.6151      0.6707      0.8469      1.1808
 *     5(O )      0.7315      0.6151      0.6733      0.8408      1.1893
 *     6(H )      0.3483      0.2810      0.3147      0.8069      1.2393

 * E(N):     -227.402193 Hartree
 * E(N+1):   -227.419914 Hartree
 * E(N-1):   -227.040885 Hartree
 * E_HOMO(N):     -0.222474 Hartree,   -6.0538 eV
 * E_HOMO(N+1):    0.116718 Hartree,    3.1761 eV
 * E_HOMO(N-1):   -0.538957 Hartree,  -14.6658 eV
 * Vertical IP:    0.361308 Hartree,    9.8317 eV
 * Vertical EA:    0.017722 Hartree,    0.4822 eV
 * Mulliken electronegativity:     0.189515 Hartree,    5.1570 eV
 * Chemical potential:            -0.189515 Hartree,   -5.1570 eV
 * Hardness (=fundamental gap):    0.343586 Hartree,    9.3495 eV
 * Softness:    2.910477 Hartree^-1,    0.1070 eV^-1
 * Electrophilicity index:    0.052266 Hartree,    1.4222 eV
 * Nucleophilicity index:     0.112724 Hartree,    3.0674 eV
 */

class AConceptualDftTest : public Test {
 protected:
  // All values in atomic units
  // Input data
  double energy = -227.402193;
  double energyPlus = -227.419914;
  double energyMinus = -227.040885;
  Eigen::VectorXd atomicCharges;
  Eigen::VectorXd atomicChargesPlus;
  Eigen::VectorXd atomicChargesMinus;
  // Multiwfn results
  double chemicalPotential = -0.189515;
  double electronegativity = 0.189515;
  double hardness = 0.343586;
  double softness = 2.910477;
  double electrophilicity = 0.052266;
  Eigen::VectorXd fukuiPlus;
  Eigen::VectorXd fukuiMinus;
  Eigen::VectorXd fukuiRadical;
  Eigen::VectorXd dualDescriptor;

  void SetUp() final {
    // Input data
    atomicCharges.resize(6);
    atomicCharges << 0.1326, 0.1326, 0.0419, -0.1744, -0.1744, 0.0419;
    atomicChargesPlus.resize(6);
    atomicChargesPlus << -0.0595, -0.0595, -0.0547, -0.3857, -0.3858, -0.0547;
    atomicChargesMinus.resize(6);
    atomicChargesMinus << 0.2626, 0.2624, 0.1615, 0.0751, 0.0769, 0.1615;
    // Multiwfn results
    fukuiPlus.resize(6);
    fukuiPlus << 0.1921, 0.1921, 0.0966, 0.2113, 0.2113, 0.0966;
    fukuiMinus.resize(6);
    fukuiMinus << 0.1301, 0.1298, 0.1196, 0.2495, 0.2513, 0.1197;
    fukuiRadical.resize(6);
    fukuiRadical << 0.1611, 0.1610, 0.1081, 0.2304, 0.2313, 0.1081;
    dualDescriptor.resize(6);
    dualDescriptor << 0.0621, 0.0623, -0.0230, -0.0382, -0.0400, -0.0231;
  }
};

TEST_F(AConceptualDftTest, CorrectlyCalculatesChemicalPotential) {
  double calculatedChemicalPotential = ConceptualDft::calculateChemicalPotential(energy, energyPlus, energyMinus);
  ASSERT_THAT(calculatedChemicalPotential, DoubleNear(chemicalPotential, 1e-5));
}
TEST_F(AConceptualDftTest, CorrectlyCalculatesElectronegativity) {
  double calculatedElectronegativity = ConceptualDft::calculateElectronegativity(energy, energyPlus, energyMinus);
  ASSERT_THAT(calculatedElectronegativity, DoubleNear(electronegativity, 1e-5));
}
TEST_F(AConceptualDftTest, CorrectlyCalculatesHardness) {
  double calculatedHardness = ConceptualDft::calculateHardness(energy, energyPlus, energyMinus);
  ASSERT_THAT(calculatedHardness, DoubleNear(hardness, 1e-5));
}
TEST_F(AConceptualDftTest, CorrectlyCalculatesSoftness) {
  double calculatedSoftness = ConceptualDft::calculateSoftness(energy, energyPlus, energyMinus);
  ASSERT_THAT(calculatedSoftness, DoubleNear(softness, 1e-5));
}
TEST_F(AConceptualDftTest, CorrectlyCalculatesElectrophilicity) {
  double calculatedElectrophilicity = ConceptualDft::calculateElectrophilicity(energy, energyPlus, energyMinus);
  ASSERT_THAT(calculatedElectrophilicity, DoubleNear(electrophilicity, 1e-5));
}

TEST_F(AConceptualDftTest, CorrectlyCalculatesFukuiPlus) {
  Eigen::VectorXd calculatedFukuiPlus =
      ConceptualDft::calculateFukuiPlus(atomicCharges, atomicChargesPlus, atomicChargesMinus);
  ASSERT_FALSE(((calculatedFukuiPlus - fukuiPlus).array().abs() > 1e-4).any());
}

TEST_F(AConceptualDftTest, CorrectlyCalculatesFukuiMinus) {
  Eigen::VectorXd calculatedFukuiMinus =
      ConceptualDft::calculateFukuiMinus(atomicCharges, atomicChargesPlus, atomicChargesMinus);
  ASSERT_FALSE(((calculatedFukuiMinus - fukuiMinus).array().abs() > 1e-4).any());
}

TEST_F(AConceptualDftTest, CorrectlyCalculatesFukuiRadical) {
  Eigen::VectorXd calculatedFukuiRadical =
      ConceptualDft::calculateFukuiRadical(atomicCharges, atomicChargesPlus, atomicChargesMinus);
  ASSERT_FALSE(((calculatedFukuiRadical - fukuiRadical).array().abs() > 1e-4).any());
}

TEST_F(AConceptualDftTest, CorrectlyCalculatesDualDescriptor) {
  Eigen::VectorXd calculatedDualDescriptor =
      ConceptualDft::calculateDualDescriptor(atomicCharges, atomicChargesPlus, atomicChargesMinus);
  ASSERT_FALSE(((calculatedDualDescriptor - dualDescriptor).array().abs() > 2e-4).any());
}

TEST_F(AConceptualDftTest, CorrectlyFillsGlobalContainer) {
  auto globalContainer = ConceptualDft::calculateGlobal(energy, energyPlus, energyMinus);
  ASSERT_THAT(globalContainer.chemicalPotential, DoubleNear(chemicalPotential, 1e-5));
  ASSERT_THAT(globalContainer.electronegativity, DoubleNear(electronegativity, 1e-5));
  ASSERT_THAT(globalContainer.hardness, DoubleNear(hardness, 1e-5));
  ASSERT_THAT(globalContainer.softness, DoubleNear(softness, 1e-5));
  ASSERT_THAT(globalContainer.electrophilicity, DoubleNear(electrophilicity, 1e-5));
}

TEST_F(AConceptualDftTest, CorrectlyFillsLocalContainer) {
  auto localContainer = ConceptualDft::calculateLocal(atomicCharges, atomicChargesPlus, atomicChargesMinus);
  ASSERT_FALSE(((localContainer.fukuiPlus - fukuiPlus).array().abs() > 1e-4).any());
  ASSERT_FALSE(((localContainer.fukuiMinus - fukuiMinus).array().abs() > 1e-4).any());
  ASSERT_FALSE(((localContainer.fukuiRadical - fukuiRadical).array().abs() > 1e-4).any());
  ASSERT_FALSE(((localContainer.dualDescriptor - dualDescriptor).array().abs() > 2e-4).any());
}

TEST_F(AConceptualDftTest, CorrectlyFillsOverallContainer) {
  auto overallContainer =
      ConceptualDft::calculate(energy, atomicCharges, energyPlus, atomicChargesPlus, energyMinus, atomicChargesMinus);
  ASSERT_THAT(overallContainer.global.chemicalPotential, DoubleNear(chemicalPotential, 1e-5));
  ASSERT_THAT(overallContainer.global.electronegativity, DoubleNear(electronegativity, 1e-5));
  ASSERT_THAT(overallContainer.global.hardness, DoubleNear(hardness, 1e-5));
  ASSERT_THAT(overallContainer.global.softness, DoubleNear(softness, 1e-5));
  ASSERT_THAT(overallContainer.global.electrophilicity, DoubleNear(electrophilicity, 1e-5));
  ASSERT_FALSE(((overallContainer.local.fukuiPlus - fukuiPlus).array().abs() > 1e-4).any());
  ASSERT_FALSE(((overallContainer.local.fukuiMinus - fukuiMinus).array().abs() > 1e-4).any());
  ASSERT_FALSE(((overallContainer.local.fukuiRadical - fukuiRadical).array().abs() > 1e-4).any());
  ASSERT_FALSE(((overallContainer.local.dualDescriptor - dualDescriptor).array().abs() > 2e-4).any());
}

} // namespace Utils
} // namespace Scine

repository: qcscine/utilities

repo_name: qcscine/utilities

extension: cpp


text:
SUMMARY = "ARM Trusted Firmware"
DESCRIPTION = "ARM Trusted Firmware provides a reference implementation of \
Secure World software for ARMv8-A, including Exception Level 3 (EL3) software. \
It provides implementations of various ARM interface standards such as the \
Power State Coordination Interface (PSCI), Trusted Board Boot Requirements \
(TBBR) and Secure monitor code."
HOMEPAGE = "http://infocenter.arm.com/help/topic/com.arm.doc.dui0928e/CJHIDGJF.html"

LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"

inherit deploy

DEPENDS += "dtc-native openssl-native"

PACKAGE_ARCH = "${MACHINE_ARCH}"

S = "${WORKDIR}/git"

PV_append = "+git${SRCPV}"

BRANCH = "ti-atf"
SRC_URI = "git://git.ti.com/atf/arm-trusted-firmware.git;branch=${BRANCH}"

SRCREV ?= "e516a389ac12fbe1597f61fea80ed3f230b9c5fd"

# Make ATF "aware" of OPTEE, no build dependency
PACKAGECONFIG[optee] = "SPD=opteed"

COMPATIBLE_MACHINE = "k3"
ATFPLATFORM_k3 = "k3"
ATFBOARD_k3 = "generic"

PACKAGECONFIG_k3 = "optee"

CFLAGS[unexport] = "1"
LDFLAGS[unexport] = "1"
AS[unexport] = "1"
LD[unexport] = "1"

do_configure[noexec] = "1"

EXTRA_OEMAKE = 'CROSS_COMPILE="${TARGET_PREFIX}" PLAT="${ATFPLATFORM}" TARGET_BOARD="${ATFBOARD}" ${PACKAGECONFIG_CONFARGS}'

do_compile() {
	oe_runmake all
}

do_compile_append_am65xx-hs-evm() {
	export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG}
	( cd ${S}/build/${ATFPLATFORM}/${ATFBOARD}/release/; \
		mv bl31.bin bl31.bin.unsigned; \
		${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh bl31.bin.unsigned bl31.bin; \
	)
}

do_install() {
	install -d ${D}/boot
	install -m 0644 ${S}/build/${ATFPLATFORM}/${ATFBOARD}/release/bl31.bin ${D}/boot/
	install -m 0644 ${S}/build/${ATFPLATFORM}/${ATFBOARD}/release/bl31/bl31.elf ${D}/boot/
}

do_deploy() {
	install -d ${DEPLOYDIR}
	install -m 0644 ${S}/build/${ATFPLATFORM}/${ATFBOARD}/release/bl31.bin ${DEPLOYDIR}/
	install -m 0644 ${S}/build/${ATFPLATFORM}/${ATFBOARD}/release/bl31/bl31.elf ${DEPLOYDIR}/
}
addtask deploy before do_build after do_compile

FILES_${PN} = "/boot"
SYSROOT_DIRS += "/boot"