text:
@InCollection{DEPAMPHILIS2019471,
  title = {Chapter 17 - Alternative Exit and Restructuring Strategies: Bankruptcy, Reorganization, and Liquidation},
  editor = {Donald M. DePamphilis},
  booktitle = {Mergers, Acquisitions, and Other Restructuring Activities (Tenth Edition)},
  publisher = {Academic Press},
  edition = {Tenth Edition},
  pages = {471 - 491},
  year = {2019},
  isbn = {978-0-12-815075-7},
  doi = {https://doi.org/10.1016/B978-0-12-815075-7.00017-6},
  url = {http://www.sciencedirect.com/science/article/pii/B9780128150757000176},
  author = {Donald M. DePamphilis},
  keywords = {Corporate bankruptcy, Reorganization, Corporate liquidation, Chapter 11, Chapter 7, Chapter 15, Bankruptcy prediction models, Business failure, Voluntary settlements, Section 363 sales, Prepackaged bankruptcies, Deal structuring, Form of payment, Form of acquisition, Political and economic risks, Segmented markets, Tax rates, Corporate inversions, Debt for equity swaps, Hedge funds, Private equity funds, Financial distress, Out of court settlements, Involuntary settlements, Voluntary liquidation, Involuntary liquidation, Financial distress, Compositions, Extensions, Default prediction, Bankruptcy prediction models, Default prediction models, Default, Bankruptcy, Bankruptcy filing},
  abstract = {The focus of this chapter is on bankruptcy and liquidation as alternative restructuring or exit strategies for failing firms, on the characteristics of such firms, and the bankruptcy process. This chapter discusses in detail the major motivations for bankruptcy and the conditions under which a firm is considered to be bankrupt. Bankruptcy enables a failing firm to reorganize, while protected from its creditors, or to cease operation by selling its assets to satisfy all or a portion of the firm’s outstanding debt. How reorganization and liquidation take place both inside and outside the protection of the bankruptcy court are examined in detail, as are Section 363 sales, prepackaged bankruptcy, and cross-border bankruptcy. Common tactics, such as debt for equity swaps, compositions, and extensions, used by debtor firms to negotiate with creditors and the circumstances in which they are used are analyzed. This chapter also discusses the advantages and disadvantages of strategic options for failing firms ranging from merging with another firm to reaching an out-of-court voluntary settlement to voluntary and involuntary liquidations. The chapter also describes the increasing role of hedge funds in the bankruptcy process. The current state of bankruptcy prediction models and their limitations as well as the results of recent empirical studies of the performance of firms experiencing financial distress also are addressed.},
}

@Article{AHAD20161,
  title = {Neural networks in wireless networks: Techniques, applications and guidelines},
  journal = {Journal of Network and Computer Applications},
  volume = {68},
  pages = {1 - 27},
  year = {2016},
  issn = {1084-8045},
  doi = {https://doi.org/10.1016/j.jnca.2016.04.006},
  url = {http://www.sciencedirect.com/science/article/pii/S1084804516300492},
  author = {Nauman Ahad and Junaid Qadir and Nasir Ahsan},
  keywords = {Wireless networks, Neural networks, Computational intelligence, Artificial intelligence},
  abstract = {The design of modern wireless networks, which involves decision making and parameter optimization, is quite challenging due to the highly dynamic, and often unknown, environmental conditions that characterize wireless networks. There is a common trend in modern networks to incorporate artificial intelligence (AI) techniques to cope with this design complexity. While a number of AI techniques have been profitably employed in the wireless networks community, the well-established AI framework of neural networks (NNs), well known for their remarkable generality and versatility, has been applied in a wide variety of settings in wireless networks. In particular, NNs are especially popular for tasks involving classification, learning, or optimization. In this paper, we provide both an exposition of common NN models and a comprehensive survey of the applications of NNs in wireless networks. We also identify pitfalls and challenges of implementing NNs especially when we consider alternative AI models and techniques. While various surveys on NNs exist in the literature, our paper is the first paper, to the best of our knowledge, which focuses on the applications of NNs in wireless networks.},
}

@Book{bidgoli_encyclopedia_2002,
  address = {Amsterdam ; Boston},
  edition = {1st Edition},
  title = {Encyclopedia of {Information} {Systems}},
  isbn = {978-0-12-227240-0},
  abstract = {The Encyclopedia of Information Systems provides essential answers to questions increasingly asked by people in all walks of life. People can no longer claim that information about computer viruses, for example, is unimportant to their work, or that advances in speech recognition and encryption will leave them unaffected. The Encyclopedia is therefore more useful than one might suspect to people well beyond the walls of information systems departments. Offering both general and technical information about major elements, issues, opinions, and key studies, as well as cross-references to related subjects, it captures the dynamic growth and complexity unique to our era.},
  language = {English},
  publisher = {Academic Press},
  editor = {Hossein Bidgoli},
  month = {aug},
  year = {2002},
}

@InCollection{KOTU201563,
  title = {Chapter 4 - Classification},
  editor = {Vijay Kotu and Bala Deshpande},
  booktitle = {Predictive Analytics and Data Mining},
  publisher = {Morgan Kaufmann},
  address = {Boston},
  pages = {63 - 163},
  year = {2015},
  isbn = {978-0-12-801460-8},
  doi = {https://doi.org/10.1016/B978-0-12-801460-8.00004-5},
  url = {http://www.sciencedirect.com/science/article/pii/B9780128014608000045},
  author = {Vijay Kotu and Bala Deshpande},
  keywords = {Classification, decision trees, rule induction, k-nearest neighbors, naïve Bayesian, artificial neural networks, support vector machines, ensemble, bagging, boosting, random forests},
  abstract = {In classification or class prediction, we try to use the information from the predictors or independent variables to sort the data samples into two or more distinct classes or buckets. Classification is the most widely used data mining task in business. There are several ways to build classification models. In this chapter, we will discuss and show the implementation of six of the most commonly used classification algorithms: decision trees, rule induction, k-nearest neighbors, naïve Bayesian, artificial neural networks, and support vector machines. We conclude this chapter with building ensemble classification models and a discussion on bagging, boosting, and random forests.},
}

@Article{SHARMA2015243,
  title = {Contextual motivation in physical activity by means of association rule mining},
  journal = {Egyptian Informatics Journal},
  volume = {16},
  number = {3},
  pages = {243 - 251},
  year = {2015},
  issn = {1110-8665},
  doi = {https://doi.org/10.1016/j.eij.2015.06.003},
  url = {http://www.sciencedirect.com/science/article/pii/S1110866515000328},
  author = {Sugam Sharma and Udoyara Sunday Tim and Marinelle Payton and Hari Cohly and Shashi Gadia and Johnny Wong and Sudharshanam Karakala},
  keywords = {Association rule mining, Physical activity, Regularity},
  abstract = {The primary thrust of this work is to demonstrate the applicability of association rule mining in public health domain, focusing on physical activity and exercising. In this paper, the concept of association rule mining is shown assisting to promote the physical exercise as regular human activity. Specifically, similar to the prototypical example of association rule mining, market basket analysis, our proposed novel approach considers two events – exercise (sporadic) and sleep (regular) as the two items of the frequent set; and associating the former, exercise event, with latter, the daily occurring activity sleep at night, helps strengthening the frequency of the exercise patterns. The regularity can further be enhanced, if the exercising instruments are kept in the vicinity of the bed and are within easy reach.},
}

@InCollection{KOTU201965,
  title = {Chapter 4 - Classification},
  editor = {Vijay Kotu and Bala Deshpande},
  booktitle = {Data Science (Second Edition)},
  publisher = {Morgan Kaufmann},
  edition = {Second Edition},
  pages = {65 - 163},
  year = {2019},
  isbn = {978-0-12-814761-0},
  doi = {https://doi.org/10.1016/B978-0-12-814761-0.00004-6},
  url = {http://www.sciencedirect.com/science/article/pii/B9780128147610000046},
  author = {Vijay Kotu and Bala Deshpande},
  keywords = {Classification, decision trees, rule induction, -nearest neighbors, naïve Bayesian, artificial neural networks, support vector machines, ensemble, bagging, boosting, random forests},
  abstract = {In classification or class prediction, it’s best to try to use the information from the predictors or independent variables to sort a data sample into two or more distinct classes or buckets. Classification is the most widely used data science task in business. There are several ways to build classification models. In this chapter, six of the most commonly used classification algorithms will be discussed and demonstrated: decision trees, rule induction, k-nearest neighbors (k-NNs), naïve Bayesian, artificial neural networks, and support vector machines. This chapter is concluded by building ensemble classification models and a discussion on bagging, boosting, and random forests.},
}

@Article{REHMAN2019171,
  title = {Unsupervised pre-trained filter learning approach for efficient convolution neural network},
  journal = {Neurocomputing},
  volume = {365},
  pages = {171 - 190},
  year = {2019},
  issn = {0925-2312},
  doi = {https://doi.org/10.1016/j.neucom.2019.06.084},
  url = {http://www.sciencedirect.com/science/article/pii/S0925231219309981},
  author = {Sadaqat {ur Rehman} and Shanshan Tu and Muhammad Waqas and Yongfeng Huang and Obaid {ur Rehman} and Basharat Ahmad and Salman Ahmad},
  keywords = {Convolution neural networks, ConvNet application, ConvNet optimization, Learning methodologies},
  abstract = {The concept of Convolution Neural Network (ConvNet or CNN) is evaluated from the animal visual cortex. Since humans can learn through experience, similarly, ConvNet changes its weight accordingly to accomplish the desired output through backpropagation. In this paper, we provide a comprehensive survey of the relationship between ConvNet with different pre-trained learning methodologies and its optimization effects. These hybrid networks further develop the state-of-the-art algorithms in recognition, classification, and detection of images, speeches, texts, and videos. Furthermore, some task-specific applications of ConvNet have been introduced in computer vision. To validate the survey, we also perform some experiments on a public face and skin detection dataset to provide an authentic solution. The experimental results on the benchmark dataset highlight the merit of efficient pre-trained learning algorithms for optimized ConvNet. To motivate the follow-up research, we identify open problems and present future directions with regards to optimized ConvNet system design parameters and unsupervised learning.},
}

@Article{CASTELL2018739,
  title = {The future decisions of RoboJudge HHJ Arthur Ian Blockchain: Dread, delight or derision?,},
  journal = {Computer Law & Security Review},
  volume = {34},
  number = {4},
  pages = {739 - 753},
  year = {2018},
  issn = {0267-3649},
  doi = {https://doi.org/10.1016/j.clsr.2018.05.011},
  url = {http://www.sciencedirect.com/science/article/pii/S026736491830195X},
  author = {Stephen Castell},
  keywords = {Intelligence, Blockchain, Robot, Ethic, Algorithm, Crypto},
  abstract = {Steve Saxby's prescient founding of CLSR, two hundred issues ago, encouraged and resonated with my own digital visionary thinking and professional activity in the evolving field of ICT and the Law. From Infolex, the UK's first commercially-available computer-assisted legal information retrieval service, and my APPEAL Report (on the admissibility of computer evidence in court and the legal reliability/security of IT systems), via my Forensic Systems Analysis expert methodology, to the nascent CryptoBlockTV, Steve's scholarly foresight in promoting adventurous exploration of ‘digilaw’ high-ground topics and issues has presented me with opportunities to generate a stream of prescient material, for which I am immensely grateful. And what is beyond prescient today is that the Coming of the Robots is unstoppable. The Artificial Intelligence (AI) Age is upon us; RoboJudge has all but already arrived. While many are concerned about defining and developing Machine Ethics, Castell's Second Dictum: “You cannot construct an algorithm that will reliably decide whether or not any algorithm is ethical” reveals that this is a futile exercise. Algorithms are also pivotal to the current mania for Crypto-Algorithmic Blockchain Technology Initial Coin Offerings (ICOs), with a ‘Crypto Tribe’ of Millennials relentlessly raising billions in real money thereby, to the extent that I have dubbed Crypto the Millennials’ Rock'n’Roll. The seasoned ICT expert professional however bears in mind that there are as yet no ISO standards for blockchain, and there is far more to creating and delivering a complete quality-assured system than just the blockchain component. Furthermore, the legal status of cryptocurrency, smart contract and distributed ledger technology is not clear or uncontentious – and there is already ICO litigation on foot. Nevertheless, taking my limerick-writing Castell GhostWriteBot’s advice, it is perhaps time for my own asset-linked ICO, to launch my CapChere.com concept designed to reboot Capitalism and achieve ubiquitous universal share and wealth ownership. Look out for Castell GhostWriteBot’s account (with or without limericks) of how I fared, in the 400th issue of CLSR.},
}

@InCollection{LUCA2015563,
  title = {Chapter 12 - User-Generated Content and Social Media},
  editor = {Simon P. Anderson and Joel Waldfogel and David Strömberg},
  series = {Handbook of Media Economics},
  publisher = {North-Holland},
  volume = {1},
  pages = {563 - 592},
  year = {2015},
  booktitle = {Handbook of Media Economics},
  issn = {2213-6630},
  doi = {https://doi.org/10.1016/B978-0-444-63685-0.00012-7},
  url = {http://www.sciencedirect.com/science/article/pii/B9780444636850000127},
  author = {Michael Luca},
  keywords = {User-generated content, Social media, Economics of information, Design economics, D8, L1, L86},
  abstract = {This chapter documents what economists have learned about user-generated content (UGC) and social media. A growing body of evidence suggests that UGC on platforms ranging from Yelp to Facebook has a large causal impact on economic and social outcomes ranging from restaurant decisions to voting behavior. These findings often leverage unique datasets and methods ranging from regression discontinuity to field experiments, and researchers often work directly with the companies they study. I then survey the factors that influence the quality of UGC. Quality is influenced by factors including promotional content, peer effects between contributors, biases of contributors, and self-selection into the decision to contribute. Non-pecuniary incentives, such as “badges” and social status on a platform, are often used to encourage and steer contributions. I then discuss other issues including business models, network effects, and privacy. Throughout the chapter, I discuss open questions in this area.},
}

@Article{TAYLOR20171039,
  title = {The next stage of U.S. communications policy: The emerging embedded infosphere},
  journal = {Telecommunications Policy},
  volume = {41},
  number = {10},
  pages = {1039 - 1055},
  year = {2017},
  note = {Celebrating 40 Years of Telecommunications Policy – A Retrospective and Prospective View},
  issn = {0308-5961},
  doi = {https://doi.org/10.1016/j.telpol.2016.11.007},
  url = {http://www.sciencedirect.com/science/article/pii/S0308596116302488},
  author = {Richard D. Taylor},
  keywords = {Internet of Things, Big data, Intercloud, Artificial Intelligence, DIGIT Act, ICANN, Embedded Infosphere},
  abstract = {The United States needs to reimagine the basic principles of its telecommunications and information policy to fit an emerging society in which networking and intelligence are embedded into an increasing number of everyday things which constantly monitor and measure our lives. This emerging environment is an always-on, ubiquitous, integrated system comprised of the Internet of Things, Big Data, Artificial Intelligence/Intelligent Systems and the Intercloud, which act together as a single system, referred to here as the “Embedded Infosphere” (EI). This development is driving the latest stage – the third – in the evolution of U.S. communications policy. Each of the components of the EI presents unique challenges, but the greater concern is all of them acting in concert. These developments bring into focus many topics that have been outside the traditional communications policy envelope, and exceed the portfolios of existing agencies and institutions. This article envisions a new “EI policy space,” grounded in established societal values, and built on the experience of the previous stages. There are appropriate policy responses to each of the challenges, but these responses need to be seen in a holistic perspective, as they are all interconnected. Many of the issues such as privacy, security, consumer protection, and data stewardship are common across several elements. The larger goal is to establish a framework for an integrated policy structure which can address unpredictable emergent conditions, while allowing markets to flourish without unduly burdensome regulations, restrictions or uncertainties. This articles suggests a high-level analytical framework of criteria against which proposed EI policies can be measured. While there may be no “perfect” policies, some may be better (or worse) than others. It also offers a political process designed to incorporate the concept of the EI into national policy thinking. This approach should be implemented through a series of steps and should provide flexibility for development. The initial step is a process by which the EI can be acknowledged, its development analyzed, and the national interests institutionalized. The U.S. Senate has already initiated this process with the pending “DIGIT” Act, designed to bring together the core federal stakeholders and open a policy discourse which will be expanded over time to other key stakeholders. This should lead to the development of a national EI strategy. Since the EI is progressively global, the article suggests how both the normative and regulatory dimensions can be approached in the global context. It raises the possibility of a restructured ICANN “Empowered Community” as a possible venue for developing policies and recommendations in this area. It notes that since global unanimity is unlikely, non-governmental regimes will likely develop to address the unresolved policy interstices.},
}

@Book{witten_data_2011,
  address = {Burlington, MA},
  edition = {3rd Edition},
  title = {Data {Mining}: {Practical} {Machine} {Learning} {Tools} and {Techniques}},
  isbn = {978-0-12-374856-0},
  shorttitle = {Data {Mining}},
  abstract = {Data Mining: Practical Machine Learning Tools and Techniques, Third Edition, offers a thorough grounding in machine learning concepts as well as practical advice on applying machine learning tools and techniques in real-world data mining situations. This highly anticipated third edition of the most acclaimed work on data mining and machine learning will teach you everything you need to know about preparing inputs, interpreting outputs, evaluating results, and the algorithmic methods at the heart of successful data mining. Thorough updates reflect the technical changes and modernizations that have taken place in the field since the last edition, including new material on Data Transformations, Ensemble Learning, Massive Data Sets, Multi-instance Learning, plus a new version of the popular Weka machine learning software developed by the authors. Witten, Frank, and Hall include both tried-and-true techniques of today as well as methods at the leading edge of contemporary research.  The book is targeted at information systems practitioners, programmers, consultants, developers, information technology managers, specification writers, data analysts, data modelers, database R\&D professionals, data warehouse engineers, data mining professionals. The book will also be useful for professors and students of upper-level undergraduate and graduate-level data mining and machine learning courses who want to incorporate data mining as part of their data management knowledge base and expertise.},
  language = {English},
  publisher = {Morgan Kaufmann},
  author = {Ian H. Witten and Eibe Frank and Mark A. Hall},
  month = {jan},
  year = {2011},
}

@InCollection{CHILDS201975,
  title = {3 - Ideation},
  editor = {Peter R.N. Childs},
  booktitle = {Mechanical Design Engineering Handbook (Second Edition)},
  publisher = {Butterworth-Heinemann},
  edition = {Second Edition},
  pages = {75 - 144},
  year = {2019},
  isbn = {978-0-08-102367-9},
  doi = {https://doi.org/10.1016/B978-0-08-102367-9.00003-2},
  url = {http://www.sciencedirect.com/science/article/pii/B9780081023679000032},
  author = {Peter R.N. Childs},
  keywords = {Analysis, Brainstorming, Creative, Creativity, Engine, Evaluation, Morphological, Problem, Solving, Tools, TRIZ},
  abstract = {Engineering design relies upon the generation of alternative ideas and their effective evaluation to ensure that attention is directed in a worthwhile manner. This chapter explores a number of creativity tools that are widely used for the generation of ideas including flip chart; post-it notes; alphabet and grid brainstorming; the creative problem solving process, also known as CPS; morphological analysis, a matrix combinational creativity tool; and TRIZ the theory of inventive problem solving. The chapter includes consideration of group dynamics and the evaluation of ideas as well as approaches for encouraging the realisation of value from creativity through innovation.},
}

@Article{GROUMPOS2016180,
  title = {Deep Learning vs. Wise Learning: A Critical and Challenging Overview},
  journal = {IFAC-PapersOnLine},
  volume = {49},
  number = {29},
  pages = {180 - 189},
  year = {2016},
  note = {17th IFAC Conference on International Stability, Technology and Culture TECIS 2016},
  issn = {2405-8963},
  doi = {https://doi.org/10.1016/j.ifacol.2016.11.099},
  url = {http://www.sciencedirect.com/science/article/pii/S240589631632537X},
  author = {Peter P. Groumpos},
  keywords = {Learning, Knowledge, Wisdom, Deep Learning, Wise Learning, Fuzzy Cognitive Maps},
  abstract = {Abstract:
Learning is the most important thing that living creatures do. An organism cannot properly animate itself without first learning how to. Knowledge is the basis for all natural and human made systems. Using knowledge to model and control a complex dynamic system (CDS) is considered. Wisdom is carefully reviewed and related to knowledge. Deep Learning (DL) and Wise Learning (WL) are presented and analyzed as two approaches to address the challenging problem of modelling and controlling CDS. Strong and weak issues of both methods are discussed. Future research directions are provided.},
}

@InCollection{HALEVI200159,
  title = {5 - 110 manufacturing methods},
  editor = {Gideon Halevi},
  booktitle = {Handbook of Production Management Methods},
  publisher = {Butterworth-Heinemann},
  address = {Oxford},
  pages = {59 - 310},
  year = {2001},
  isbn = {978-0-7506-5088-5},
  doi = {https://doi.org/10.1016/B978-075065088-5/50005-4},
  url = {http://www.sciencedirect.com/science/article/pii/B9780750650885500054},
  author = {Gideon Halevi},
  abstract = {Publisher Summary
This chapter briefly describes each of the 110 manufacturing methods, such as agent-driven approach, activity-based costing (ABC), agile manufacturing, and so on. Activity-based costing is an information system that maintains and processes data on a firm's activities and products/services. It identifies the activities performed, traces costs to these activities, and then uses various cost drivers to trace the cost of activities to the final products/services. Agent-driven manufacturing systems are designed to solve shop-floor-control problems in manufacturing systems. Agile manufacturing can be defined as the capability of reacting quickly to changing markets, to produce high quality products, to reduce lead times, and to provide superior service. These are achieved by improving enterprise communications among all disciplines engaged in the manufacturing process.},
}

@Article{SEIFERT2004461,
  title = {Data mining and the search for security: Challenges for connecting the dots and databases},
  journal = {Government Information Quarterly},
  volume = {21},
  number = {4},
  pages = {461 - 480},
  year = {2004},
  issn = {0740-624X},
  doi = {https://doi.org/10.1016/j.giq.2004.08.006},
  url = {http://www.sciencedirect.com/science/article/pii/S0740624X04000590},
  author = {Jeffrey W. Seifert},
  abstract = {Data mining is emerging as one of the key features of many homeland security initiatives. Often used as a means for detecting fraud, assessing risk, and product retailing, data mining involves the use of data analysis tools to discover previously unknown, valid patterns and relationships in large data sets. In the context of homeland security, data mining is often viewed as a potential means to identify terrorist activities, such as money transfers and communications, and to identify and track individual terrorists themselves, such as through travel and immigration records. However, compared to earlier uses of data mining by government, some of the homeland security data mining applications represent a significant expansion in the quantity and scope of data to be analyzed. Three of the higher profile initiatives include the now defunct Terrorism Information Awareness (TIA) project, the recently canceled Computer-Assisted Passenger Prescreening System II (CAPPS II), and the Multistate Anti-Terrorism Information Exchange (MATRIX) pilot project. This article examines the evolving nature of data mining for homeland security purposes, the limitations of data mining, and some of the issues raised by its expanding use, including data quality, interoperability, mission creep, and privacy.},
}

@Article{SHARMA201663,
  title = {Expanded cloud plumes hiding Big Data ecosystem},
  journal = {Future Generation Computer Systems},
  volume = {59},
  pages = {63 - 92},
  year = {2016},
  issn = {0167-739X},
  doi = {https://doi.org/10.1016/j.future.2016.01.003},
  url = {http://www.sciencedirect.com/science/article/pii/S0167739X16000054},
  author = {Sugam Sharma},
  keywords = {Cloud, Big Data, Smart Data and Lakes, IoT, XCLOUDX, as-a-Service},
  abstract = {Today, a paradigm shift is being observed in science, where the focus is gradually shifting away from operation to data, which is greatly influencing the decision making also. The data is being inundated proactively from several sources in various forms; especially social media and in modern data science vocabulary is being recognized as Big Data. Today, Big Data is permeating through the bigger aspect of human life for scientific and commercial dependencies, especially for massive scale data analytics of beyond the exabyte magnitude. As the footprint of Big Data applications is continuously expanding, the reliability on cloud environments is also increasing to obtain appropriate, robust and affordable services to deal with Big Data challenges. Cloud computing avoids any need to locally maintain the overly scaled computing infrastructure that include not only dedicated space, but the expensive hardware and software also. Several data models to process Big Data are already developed and a number of such models are still emerging, potentially relying on heterogeneous underlying storage technologies, including cloud computing. In this paper, we investigate the growing role of cloud computing in Big Data ecosystem. Also, we propose a novel XCLOUDX {XCloudX, X…X}classification to zoom in to gauge the intuitiveness of the scientific name of the cloud-assisted NoSQL Big Data models and analyze whether XCloudX always uses cloud computing underneath or vice versa. XCloudX symbolizes those NoSQL Big Data models that embody the term “cloud” in their name, where X is any alphanumeric variable. The discussion is strengthen by a set of important case studies. Furthermore, we study the emergence of as-a-Service era, motivated by cloud computing drive and explore the new members beyond traditional cloud computing stack, developed in the past couple of years.},
}

@Article{BILAL2020113194,
  title = {Big Data with deep learning for benchmarking profitability performance in project tendering},
  journal = {Expert Systems with Applications},
  volume = {147},
  pages = {113194},
  year = {2020},
  issn = {0957-4174},
  doi = {https://doi.org/10.1016/j.eswa.2020.113194},
  url = {http://www.sciencedirect.com/science/article/pii/S0957417420300208},
  author = {Muhammad Bilal and Lukumon O. Oyedele},
  keywords = {Big Data, Project tendering, Text mining, Deep learning, Benchmarking KPIs},
  abstract = {A reliable benchmarking system is crucial for the contractors to evaluate the profitability performance of project tenders. Existing benchmarks are ineffective in the tender evaluation task for three reasons. Firstly, these benchmarks are mostly based on the profit margins as the only key performance indicator (KPI) while there are other KPIs fit to drive the evaluation process. Secondly, these benchmarks don’t take project context into account, thereby restricts their predictive accuracy. And finally, these benchmarks are obtained from small subsets of data, making it hard to generalise. As a result, estimators cannot probe into tenders to judge the strengths and weaknesses of their bids. This advancement is critical for not only choosing more lucrative opportunities but also driving negotiations during the tendering process. This study aims to develop a benchmarking system for tender evaluation using Big Data of 1.2 terabytes, comprising 5.7 million cells. A holistic list of seventeen (17) KPIs is identified from the email data using Text Mining approaches. Besides, eight (8) key project attributes are chosen for ensuring context-aware benchmarking using Focused Group Interviews (FGIs). At the crux of this work lies the proposition of a deep ensemble learner based on the decomposition-integration methodology. In the decomposition stage, the model predicts several attribute-specific benchmarks for each KPI using our proposed context-aware algorithm. In the integration stage, deep neural network-based learners are trained to generate final project-sensitive KPI benchmark. The learner is deployed in the Spring tool to support the tender evaluation of power infrastructure projects. A tender of 60km underground cabling project is evaluated using the proposed learner. The system spontaneously identified KPIs in the tender that require further attention to achieve greater profitability performance.},
}

@Article{KAUSHAL2018423,
  title = {Soft Computing based object detection and tracking approaches: State-of-the-Art survey},
  journal = {Applied Soft Computing},
  volume = {70},
  pages = {423 - 464},
  year = {2018},
  issn = {1568-4946},
  doi = {https://doi.org/10.1016/j.asoc.2018.05.023},
  url = {http://www.sciencedirect.com/science/article/pii/S1568494618302965},
  author = {Manisha Kaushal and Baljit S. Khehra and Akashdeep Sharma},
  keywords = {Soft computing, Object detection and tracking, Neural network and deep learning, Fuzzy logic, Evolutionary algorithms},
  abstract = {In recent years, analysis and interpretation of video sequences to detect and track objects of interest had become an active research field in computer vision and image processing. Detection and tracking includes extraction of moving object from frames and continuous tracking it thereafter forming persistent object trajectories over time. There are some really smart techniques proposed by researchers for efficient and robust detection or tracking of objects in videos. A comprehensive coverage of such innovative techniques for which solutions have been motivated by theories of soft computing approaches is proposed. The main objective of this research investigation is to study and highlight efforts of researchers who had conducted some brilliant work on soft computing based detection and tracking approaches in video sequence. The study is novel as it traces rise of soft computing methods in field of object detection and tracking in videos which has been neglected over the years. The survey is compilation of studies on neural network, deep learning, fuzzy logic, evolutionary algorithms, hybrid and recent innovative approaches that have been applied to field of detection and tracking. The paper also highlights benchmark datasets available to researchers for experimentation and validation of their own algorithms. Major research challenges in the field of detection and tracking along with some recommendations are also provided. The paper provides number of analyses to guide future directions of research and advocates for more applications of soft computing approaches for object detection and tracking approaches in videos. The paper is targeted at young researchers who will like to see it as platform for introduction to a mature and relatively complex field. The study will be helpful in appropriate use of an existing method for systematically designing a new approach or improving performance of existing approaches.},
}

repository: pesobreiro/SLRDropout

repo_name: pesobreiro/SLRDropout


text:
@inproceedings{li2011iedm,
 author = {Jing Li and Binquan Luan and T. H. Hsu and Y. Zhu and G. Martyna and D. Newns and H. Y. Cheng and S. Raoux and H. L. Lung and C. Lam},
 booktitle = {2011 International Electron Devices Meeting (**IEDM**)},
 doi = {10.1109/IEDM.2011.6131541},
 issn = {0163-1918},
 keywords = {conference, amorphous semiconductors,antimony alloys,atomic structure,germanium alloys,phase change materials,phase change memories,tellurium alloys,Ge,Sb,Te,amorphous germanium,atomic structure,drift-insensitive phase change material,electrical characteristics,first principle ab initio method,material-device characterization,phase change memory,resistance drift,tellurium ternary alloys,Conductivity,Phase change materials,Phase change memory,Programming,Resistance,Temperature measurement},
 month = {Dec},
 note = {(Acceptance Rate*: \underline{33\%})},
 number = {},
 pages = {12.5.1--12.5.4},
 title = {Explore physical origins of resistance drift in phase change memory and its implication for drift-insensitive materials},
 volume = {},
 year = {2011}
}

license: MIT

license_type: permissive

branch_name: refs/heads/master

extension: bib


text:
@inproceedings{DBLP:conf/icse/LienhardtDJM20,
 author = {Michael Lienhardt and
Ferruccio Damiani and
Einar Broch Johnsen and
Jacopo Mauro},
 bibsource = {dblp computer science bibliography, https://dblp.org},
 biburl = {https://dblp.org/rec/conf/icse/LienhardtDJM20.bib},
 booktitle = {ICSE '20: 42nd International Conference on Software Engineering,
Seoul, South Korea, 27 June - 19 July, 2020},
 crossref = {DBLP:conf/icse/2020},
 doi = {10.1145/3377811.3380372},
 pages = {1509--1521},
 timestamp = {Fri, 16 Oct 2020 10:56:00 +0200},
 title = {Lazy product discovery in huge configuration spaces},
 url = {https://doi.org/10.1145/3377811.3380372},
 year = {2020}
}

repository: jacopoMauro/website

repo_name: jacopoMauro/website


text:
package main

import (
	"fmt"
	"math"
)

const s string = "constant"

const (
	Pi    = 3.14
	Truth = false
	Big   = 1 << 62
	Small = Big >> 61
)

func main() {
	fmt.Println("_main()")
	fmt.Println("----------------------------")
	fmt.Println("INICIO")

	_constants()

	fmt.Println("FIM")
	fmt.Println("----------------------------")
}

// functions
func _constants() {
	fmt.Println("_constants()")

	fmt.Println(s)

	const n = 500000000
	const d = 3e20 / n
	fmt.Println(d)

	fmt.Println(int64(d))
	fmt.Println(math.Sin(n))

	// SECOND EXAMPLE
	const Greeting = ""
	fmt.Println(Greeting)
	fmt.Println(Pi)
	fmt.Println(Truth)
	fmt.Println(Big)

}

repository: ktaf/go-learn

repo_name: ktaf/go-learn

extension: go


text:
@article{porr2019r,
  title={R-peak detector stress test with a new noisy ECG database reveals significant performance differences amongst popular detectors},
  author={Porr, Bernd and Howell, Luis},
  journal={bioRxiv},
  pages={722397},
  year={2019},
  publisher={Cold Spring Harbor Laboratory}
}

@article{kalyakulina2018lu,
  title={LU electrocardiography database: a new open-access validation tool for delineation algorithms},
  author={Kalyakulina, Alena I and Yusipov, Igor I and Moskalenko, Victor A and Nikolskiy, Alexander V and Kozlov, Artem A and Kosonogov, Konstantin A and Zolotykh, Nikolay Yu and Ivanchenko, Mikhail V},
  journal={arXiv preprint arXiv:1809.03393},
  year={2018}
}

@article{howell2018high,
  title={High precision ECG Database with annotated R peaks, recorded and filmed under realistic conditions},
  author={Howell, Luis and Porr, Bernd},
  year={2018},
  publisher={University of Glasgow}
}

@article{moody2001impact,
  title={The impact of the MIT-BIH arrhythmia database},
  author={Moody, George B and Mark, Roger G},
  journal={IEEE Engineering in Medicine and Biology Magazine},
  volume={20},
  number={3},
  pages={45--50},
  year={2001},
  publisher={IEEE}
}

@article{iyengar1996age,
  title={Age-related alterations in the fractal scaling of cardiac interbeat interval dynamics},
  author={Iyengar, Nikhil and Peng, CK and Morin, Raymond and Goldberger, Ary L and Lipsitz, Lewis A},
  journal={American Journal of Physiology-Regulatory, Integrative and Comparative Physiology},
  volume={271},
  number={4},
  pages={R1078--R1084},
  year={1996},
  publisher={American Physiological Society Bethesda, MD}
}

@article{moody1984bih,
  title={The MIT-BIH noise stress test database},
  author={Moody, G and Muldrow, W and Mark, R},
  journal={Computers in Cardiology},
  pages={381--384},
  year={1984}
}

repository: neuropsychology/NeuroKit

repo_name: neuropsychology/NeuroKit

gha_license_id: MIT

gha_language: Python


text:
%%% -*-BibTeX-*-
@article{TSGB2022TIP,
title   = {{TSGB}: Target-selective gradient backprop for probing {CNN} visual saliency},
author  = {Lin Cheng and Pengfei Fang  and  Yanjie Liang and  Liao Zhang and  Chunhua Shen and  Hanzi Wang},
journal = {IEEE Transactions on Image Processing},
year    = {2022},
eprint  = {},
project = {},
venue   = {TIP},
}


text:
@inproceedings{Krammer2020,
author = {Krammer, Martin and Kater, Christian and Schiffer, Clemens and Benedikt, Martin},
booktitle = {Proceedings of Asian Modelica Conference 2020, Tokyo, Japan, October 08-09, 2020},
doi = {10.3384/ecp2020174133},
file = {:C$\backslash$:/work/Mendeley Papers/amc2020.pdf:pdf},
keywords = {co-simulation,real-time,simulation,test},
pages = {133--142},
title = {{A Protocol-Based Verification Approach for Standard-Compliant Distributed Co-Simulation}},
volume = {174},
year = {2020}
}

@inproceedings{Krammer2019,
author = {Krammer, Martin and Schuch, Klaus and Kater, Christian and Alekeish, Khaled and Blochwitz, Torsten and Materne, Stefan and Soppa, Andreas and Benedikt, Martin},
booktitle = {Proceedings of the 13th International Modelica Conference, Regensburg, Germany, March 4-6, 2019},
doi = {10.3384/ecp1915787},
file = {:C$\backslash$:/work/Mendeley Papers/ecp19157009.pdf:pdf},
month = {feb},
pages = {87--96},
publisher = {Link{\"{o}}ping University Electronic Press, Link{\"{o}}pings universitet},
title = {{Standardized Integration of Real-Time and Non-Real-Time Systems: The Distributed Co-Simulation Protocol}},
url = {http://www.ep.liu.se/ecp/article.asp?issue=157{\%}26article=9},
volume = {157},
year = {2019}
}
@misc{Krammer2018,
author = {Krammer, Martin and Benedikt, Martin and Blochwitz, Torsten and Alekeish, Khaled and Amringer, Nicolas and Kater, Christian and Materne, Stefan and Ruvalcaba, Roberto and Schuch, Klaus and Zehetner, Josef and Damm-Norwig, Micha and Schreiber, Viktor and Nagarajan, Natarajan and Corral, Isidro and Sparber, Tommy and Klein, Serge and Andert, Jakob},
booktitle = {Proceedings of the 50th Computer Simulation Conference},
file = {:C$\backslash$:/work/Mendeley Papers/alp.pdf:pdf},
keywords = {DCP,co-simulation,integration,real-time,standard},
pages = {1},
publisher = {Society for Computer Simulation International},
title = {{The Distributed Co-simulation Protocol for the integration of real-time systems and simulation environments}},
url = {https://dl.acm.org/citation.cfm?id=3275383},
year = {2018}
}

repository: modelica/DCPTester

repo_name: modelica/DCPTester


text:
# This is part of the Findosg* suite used to find OpenSceneGraph components.
# Each component is separate and you must opt in to each module. You must
# also opt into OpenGL and OpenThreads (and Producer if needed) as these
# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
#
# Locate osg
# This module defines
# osg_FOUND, if false, do not try to link to osg
# OSG_LIBRARY
# OSG_INCLUDE_DIR, where to find the headers
# osg target will be created for cmake 3.0.0 and newer
#
# $OSGDIR is an environment variable that would
# correspond to the ./configure --prefix=$OSGDIR
# used in building osg.
#
# Created by Eric Wing.
#
# Modified by PCJohn (Jan Peciva):
# Look for config file first. Create SDL2 target. Print GPUEngine style message.
# Updated code formatting to match the one used in GPUEngine.

# try config-based find first
find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG QUIET)

# use regular old-style approach
if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)

   # search paths
   if(!WIN32)
      set(SEARCH_PATHS
         ~/Library/Frameworks
         /Library/Frameworks
         /usr/local
         /usr
         /sw # Fink
         /opt/local # DarwinPorts
         /opt/csw # Blastwave
         /opt)
   else()
      set(SEARCH_PATHS)
   endif()

   # try the user's environment request before anything else
   find_path(OSG_INCLUDE_DIR osg/PositionAttitudeTransform
      HINTS
      $ENV{OSG_DIR}
      $ENV{OSGDIR}
      PATH_SUFFIXES include
      PATHS
         ${SEARCH_PATHS}
         [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]
         [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]
   )

   find_library(OSG_LIBRARY_RELEASE
      NAMES osg
      HINTS
      $ENV{OSG_DIR}
      $ENV{OSGDIR}
      PATH_SUFFIXES lib64 lib
      PATHS
         ${SEARCH_PATHS}
   )

   find_library(OSG_LIBRARY_DEBUG
      NAMES osgd
      HINTS
      $ENV{OSG_DIR}
      $ENV{OSGDIR}
      PATH_SUFFIXES lib64 lib
      PATHS
         ${SEARCH_PATHS}
   )

   # set *_FOUND flag
   if(OSG_INCLUDE_DIR AND (OSG_LIBRARY_RELEASE OR OSG_LIBRARY_DEBUG))
      set(${CMAKE_FIND_PACKAGE_NAME}_FOUND True)
   endif()

   # substitute RELEASE and DEBUG libraries if one is missing
   if(NOT OSG_LIBRARY_RELEASE AND OSG_LIBRARY_DEBUG)
      set(OSG_LIBRARY_RELEASE ${OSG_LIBRARY_DEBUG})
   endif()
   if(NOT OSG_LIBRARY_DEBUG AND OSG_LIBRARY_RELEASE)
      set(OSG_LIBRARY_DEBUG ${OSG_LIBRARY_RELEASE})
   endif()

   # set OSG_LIBRARY
   set(OSG_LIBRARY optimized ${OSG_LIBRARY_RELEASE} debug ${OSG_LIBRARY_DEBUG})

   # target for cmake 3.0.0 and newer
   if(${CMAKE_FIND_PACKAGE_NAME}_FOUND)
      if(NOT ${CMAKE_MAJOR_VERSION} LESS 3)
         if(NOT TARGET ${CMAKE_FIND_PACKAGE_NAME})
            add_library(${CMAKE_FIND_PACKAGE_NAME} SHARED IMPORTED)
            set_target_properties(${CMAKE_FIND_PACKAGE_NAME} PROPERTIES
               INTERFACE_INCLUDE_DIRECTORIES "${OSG_INCLUDE_DIR}"
               IMPORTED_LOCATION_DEBUG "${OSG_LIBRARY_DEBUG}"
               IMPORTED_LOCATION_RELEASE "${OSG_LIBRARY_RELEASE}"
               IMPORTED_IMPLIB_DEBUG "${OSG_LIBRARY_DEBUG}"
               IMPORTED_IMPLIB_RELEASE "${OSG_LIBRARY_RELEASE}"
            )
         endif()
      endif()
   endif()

endif()

# message
include(GEMacros)
if(OSG_LIBRARY_RELEASE)
   ge_report_find_status("${OSG_LIBRARY_RELEASE}")
elseif(OSG_LIBRARY_DEBUG)
   ge_report_find_status("${OSG_LIBRARY_DEBUG}")
else()
   ge_report_find_status("")
endif()

repository: paveon/VGE-SurfaceReconstruction

repo_name: paveon/VGE-SurfaceReconstruction

extension: cmake


text:
package storage

import (
	"bytes"
	"context"
	"database/sql/driver"
	"encoding/gob"
	"fmt"
	"strconv"
	"time"

	"github.com/go-redis/redis/v8"
	"github.com/gofrs/uuid"
	"github.com/jmoiron/sqlx"
	"github.com/lib/pq"
	"github.com/pkg/errors"
	log "github.com/sirupsen/logrus"

	"github.com/brocaar/chirpstack-network-server/v3/internal/logging"
	"github.com/brocaar/lorawan"
)

// template used for generating Redis keys
const (
	gatewayMetaKeyTempl = "lora:ns:gw:meta:%s"
)

// GPSPoint contains a GPS point.
type GPSPoint struct {
	Latitude  float64
	Longitude float64
}

// Value implements the driver.Valuer interface.
func (l GPSPoint) Value() (driver.Value, error) {
	return fmt.Sprintf("(%s,%s)", strconv.FormatFloat(l.Latitude, 'f', -1, 64), strconv.FormatFloat(l.Longitude, 'f', -1, 64)), nil
}

// Scan implements the sql.Scanner interface.
func (l *GPSPoint) Scan(src interface{}) error {
	b, ok := src.([]byte)
	if !ok {
		return fmt.Errorf("expected []byte, got %T", src)
	}

	_, err := fmt.Sscanf(string(b), "(%f,%f)", &l.Latitude, &l.Longitude)
	return err
}

// Gateway represents a gateway.
type Gateway struct {
	GatewayID        lorawan.EUI64  `db:"gateway_id"`
	RoutingProfileID uuid.UUID      `db:"routing_profile_id"`
	ServiceProfileID *uuid.UUID     `db:"service_profile_id"`
	GatewayProfileID *uuid.UUID     `db:"gateway_profile_id"`
	CreatedAt        time.Time      `db:"created_at"`
	UpdatedAt        time.Time      `db:"updated_at"`
	FirstSeenAt      *time.Time     `db:"first_seen_at"`
	LastSeenAt       *time.Time     `db:"last_seen_at"`
	Location         GPSPoint       `db:"location"`
	Altitude         float64        `db:"altitude"`
	TLSCert          []byte         `db:"tls_cert"`
	Boards           []GatewayBoard `db:"-"`
}

// GatewayBoard holds the gateway board configuration.
type GatewayBoard struct {
	FPGAID           *lorawan.EUI64     `db:"fpga_id"`
	FineTimestampKey *lorawan.AES128Key `db:"fine_timestamp_key"`
}

// GatewayMeta represents the gateway meta-data.
// This is used for adding additional context to received uplinks.
type GatewayMeta struct {
	GatewayID        lorawan.EUI64  `db:"gateway_id"`
	RoutingProfileID uuid.UUID      `db:"routing_profile_id"`
	GatewayProfileID *uuid.UUID     `db:"gateway_profile_id"`
	ServiceProfileID *uuid.UUID     `db:"service_profile_id"`
	Location         GPSPoint       `db:"location"`
	Altitude         float64        `db:"altitude"`
	IsPrivate        bool           `db:"is_private"`
	Boards           []GatewayBoard `db:"-"`
}

// CreateGateway creates the given gateway.
func CreateGateway(ctx context.Context, db sqlx.Execer, gw *Gateway) error {
	now := time.Now()
	gw.CreatedAt = now
	gw.UpdatedAt = now

	_, err := db.Exec(`
		insert into gateway (
			gateway_id,
			created_at,
			updated_at,
			first_seen_at,
			last_seen_at,
			location,
			altitude,
			gateway_profile_id,
			routing_profile_id,
			tls_cert,
			service_profile_id
		) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)`,
		gw.GatewayID[:],
		gw.CreatedAt,
		gw.UpdatedAt,
		gw.FirstSeenAt,
		gw.LastSeenAt,
		gw.Location,
		gw.Altitude,
		gw.GatewayProfileID,
		gw.RoutingProfileID,
		gw.TLSCert,
		gw.ServiceProfileID,
	)
	if err != nil {
		return handlePSQLError(err, "insert error")
	}

	for i, board := range gw.Boards {
		_, err := db.Exec(`
			insert into gateway_board (
				id,
				gateway_id,
				fpga_id,
				fine_timestamp_key
			) values ($1, $2, $3, $4)`,
			i,
			gw.GatewayID,
			board.FPGAID,
			board.FineTimestampKey,
		)
		if err != nil {
			return handlePSQLError(err, "insert error")
		}
	}

	log.WithFields(log.Fields{
		"gateway_id": gw.GatewayID,
		"ctx_id":     ctx.Value(logging.ContextIDKey),
	}).Info("storage: gateway created")
	return nil
}

// CreateGatewayMetaCache caches the given gateway meta in Redis.
// The TTL of the gateway is the same as that of the device-sessions.
func CreateGatewayMetaCache(ctx context.Context, gw GatewayMeta) error {
	key := GetRedisKey(gatewayMetaKeyTempl, gw.GatewayID)

	var buf bytes.Buffer
	if err := gob.NewEncoder(&buf).Encode(gw); err != nil {
		return errors.Wrap(err, "gob encode gateway meta error")
	}

	err := RedisClient().Set(ctx, key, buf.Bytes(), deviceSessionTTL).Err()
	if err != nil {
		return errors.Wrap(err, "set gateway meta error")
	}

	return nil
}

// GetGatewayMetaCache returns a cached gateway meta.
func GetGatewayMetaCache(ctx context.Context, gatewayID lorawan.EUI64) (GatewayMeta, error) {
	var gw GatewayMeta
	key := GetRedisKey(gatewayMetaKeyTempl, gatewayID)

	val, err := RedisClient().Get(ctx, key).Bytes()
	if err != nil {
		if err == redis.Nil {
			return gw, ErrDoesNotExist
		}
		return gw, errors.Wrap(err, "get error")
	}

	err = gob.NewDecoder(bytes.NewReader(val)).Decode(&gw)
	if err != nil {
		return gw, errors.Wrap(err, "gob decode error")
	}

	return gw, nil
}

// FlushGatewayMetaCache flushes the gateway meta cache.
func FlushGatewayMetaCache(ctx context.Context, gatewayID lorawan.EUI64) error {
	key := GetRedisKey(gatewayMetaKeyTempl, gatewayID)

	err := RedisClient().Del(ctx, key).Err()
	if err != nil {
		return errors.Wrap(err, "delete error")
	}

	return nil
}

// FlushGatewayMetaCacheForServiceProfile flushes the gateway meta-cache for
// gateways using the given service-profile ID.
func FlushGatewayMetaCacheForServiceProfile(ctx context.Context, db sqlx.Queryer, serviceProfileID uuid.UUID) error {
	var gwIDs []lorawan.EUI64

	err := sqlx.Select(db, &gwIDs, `
		select
			g.gateway_id
		from
			gateway g
		where
			g.service_profile_id = $1`,
		serviceProfileID,
	)
	if err != nil {
		return handlePSQLError(err, "select error")
	}

	for _, gwID := range gwIDs {
		if err := FlushGatewayMetaCache(ctx, gwID); err != nil {
			return errors.Wrap(err, "flush gateway meta cache error")
		}
	}

	log.WithFields(log.Fields{
		"ctx_id":             ctx.Value(logging.ContextIDKey),
		"service_profile_id": serviceProfileID,
	}).Info("storage: gateway meta cache flushed for service-profile id")

	return nil
}

// GetAndCacheGatewayMeta returns a gateway meta from the cache in case it is available.
// In case the gateway meta is not cached, it will be retrieved from the database
// and then cached.
func GetAndCacheGatewayMeta(ctx context.Context, db sqlx.Queryer, gatewayID lorawan.EUI64) (GatewayMeta, error) {
	gw, err := GetGatewayMetaCache(ctx, gatewayID)
	if err == nil {
		return gw, nil
	}

	if err != ErrDoesNotExist {
		log.WithFields(log.Fields{
			"ctx_id":     ctx.Value(logging.ContextIDKey),
			"gateway_id": gatewayID,
		}).WithError(err).Error("storage: get gateway meta cache error")
		// we don't return the error as we can still fall-back onto db retrieval
	}

	gw, err = GetGatewayMeta(ctx, db, gatewayID)
	if err != nil {
		return gw, errors.Wrap(err, "get gateway error")
	}

	err = CreateGatewayMetaCache(ctx, gw)
	if err != nil {
		log.WithFields(log.Fields{
			"ctx_id":     ctx.Value(logging.ContextIDKey),
			"gateway_id": gatewayID,
		}).WithError(err).Error("storage: create gateway meta cache error")
	}

	return gw, nil
}

// GetGateway returns the gateway for the given Gateway ID.
func GetGateway(ctx context.Context, db sqlx.Queryer, id lorawan.EUI64) (Gateway, error) {
	var gw Gateway
	err := sqlx.Get(db, &gw, "select * from gateway where gateway_id = $1", id[:])
	if err != nil {
		return gw, handlePSQLError(err, "select error")
	}

	err = sqlx.Select(db, &gw.Boards, `
		select
			fpga_id,
			fine_timestamp_key
		from
			gateway_board
		where
			gateway_id = $1
		order by
			id
		`,
		id,
	)
	if err != nil {
		return gw, handlePSQLError(err, "select error")
	}

	return gw, nil
}

// UpdateGateway updates the given gateway.
func UpdateGateway(ctx context.Context, db sqlx.Execer, gw *Gateway) error {
	now := time.Now()
	gw.UpdatedAt = now

	res, err := db.Exec(`
		update gateway set
			updated_at = $2,
			first_seen_at = $3,
			last_seen_at = $4,
			location = $5,
			altitude = $6,
			gateway_profile_id = $7,
			routing_profile_id = $8,
			tls_cert = $9,
			service_profile_id = $10
		where gateway_id = $1`,
		gw.GatewayID[:],
		gw.UpdatedAt,
		gw.FirstSeenAt,
		gw.LastSeenAt,
		gw.Location,
		gw.Altitude,
		gw.GatewayProfileID,
		gw.RoutingProfileID,
		gw.TLSCert,
		gw.ServiceProfileID,
	)
	if err != nil {
		return handlePSQLError(err, "update error")
	}
	ra, err := res.RowsAffected()
	if err != nil {
		return errors.Wrap(err, "get rows affected error")
	}
	if ra == 0 {
		return ErrDoesNotExist
	}

	_, err = db.Exec(`
		delete from gateway_board where gateway_id = $1`,
		gw.GatewayID,
	)
	if err != nil {
		return handlePSQLError(err, "delete error")
	}

	for i, board := range gw.Boards {
		_, err := db.Exec(`
			insert into gateway_board (
				id,
				gateway_id,
				fpga_id,
				fine_timestamp_key
			) values ($1, $2, $3, $4)`,
			i,
			gw.GatewayID,
			board.FPGAID,
			board.FineTimestampKey,
		)
		if err != nil {
			return handlePSQLError(err, "insert error")
		}
	}

	if err := FlushGatewayMetaCache(ctx, gw.GatewayID); err != nil {
		return errors.Wrap(err, "flush gateway cache error")
	}

	log.WithFields(log.Fields{
		"gateway_id": gw.GatewayID,
		"ctx_id":     ctx.Value(logging.ContextIDKey),
	}).Info("storage: gateway updated")
	return nil
}

// UpdateGatewayState updates the location of the gateway and last seen ts.
func UpdateGatewayState(ctx context.Context, db sqlx.Execer, id lorawan.EUI64, lat, lon, alt float64) error {
	var loc *GPSPoint
	var altt *float64

	if lat != 0 && lon != 0 && alt != 0 {
		loc = &GPSPoint{
			Latitude:  lat,
			Longitude: lon,
		}
		altt = &alt
	}

	now := time.Now()

	// * only update first_seen_at when the current value is NULL
	// * only update the location when the given value is not NULL
	// * only update the altitude when the given value is not NULL
	res, err := db.Exec(`
		update gateway set
			first_seen_at = coalesce(first_seen_at, $2),
			last_seen_at = $3,
			location = coalesce($4, location),
			altitude = coalesce($5, altitude)
		where
			gateway_id = $1`,
		id,
		now,
		now,
		loc,
		altt,
	)
	if err != nil {
		return handlePSQLError(err, "update error")
	}
	ra, err := res.RowsAffected()
	if err != nil {
		return errors.Wrap(err, "get rows affected error")
	}
	if ra == 0 {
		return ErrDoesNotExist
	}

	if err := FlushGatewayMetaCache(ctx, id); err != nil {
		return err
	}

	log.WithFields(log.Fields{
		"gateway_id": id,
		"ctx_id":     ctx.Value(logging.ContextIDKey),
	}).Info("storage: gateway state updated")

	return nil
}

// DeleteGateway deletes the gateway matching the given Gateway ID.
func DeleteGateway(ctx context.Context, db sqlx.Execer, id lorawan.EUI64) error {
	res, err := db.Exec("delete from gateway where gateway_id = $1", id[:])
	if err != nil {
		return handlePSQLError(err, "delete error")
	}
	ra, err := res.RowsAffected()
	if err != nil {
		return errors.Wrap(err, "get rows affected error")
	}
	if ra == 0 {
		return ErrDoesNotExist
	}

	if err := FlushGatewayMetaCache(ctx, id); err != nil {
		return errors.Wrap(err, "flush gateway cache error")
	}

	log.WithFields(log.Fields{
		"gateway_id": id,
		"ctx_id":     ctx.Value(logging.ContextIDKey),
	}).Info("storage: gateway deleted")
	return nil
}

// GetGatewaysForIDs returns a map of gateways given a slice of IDs.
func GetGatewaysForIDs(ctx context.Context, db sqlx.Queryer, ids []lorawan.EUI64) (map[lorawan.EUI64]Gateway, error) {
	out := make(map[lorawan.EUI64]Gateway)
	var idsB [][]byte
	for i := range ids {
		idsB = append(idsB, ids[i][:])
	}

	var gws []Gateway
	err := sqlx.Select(db, &gws, "select * from gateway where gateway_id = any($1)", pq.ByteaArray(idsB))
	if err != nil {
		return nil, handlePSQLError(err, "select error")
	}

	if len(gws) != len(ids) {
		return nil, fmt.Errorf("expected %d gateways, got %d", len(ids), len(out))
	}

	for i := range gws {
		out[gws[i].GatewayID] = gws[i]
	}

	return out, nil
}

// GetGatewayMeta returns the GatewayMeta object for the given gateway ID.
func GetGatewayMeta(ctx context.Context, db sqlx.Queryer, id lorawan.EUI64) (GatewayMeta, error) {
	var gw GatewayMeta
	err := sqlx.Get(db, &gw, `
		select
			g.gateway_id,
			g.location,
			g.altitude,
			g.service_profile_id,
			g.gateway_profile_id,
			g.routing_profile_id,
			coalesce(sp.gws_private, false) as is_private
		from
			gateway g
		left join service_profile sp
			on g.service_profile_id = sp.service_profile_id
		where
			g.gateway_id = $1`,
		id,
	)
	if err != nil {
		return gw, handlePSQLError(err, "select error")
	}

	err = sqlx.Select(db, &gw.Boards, `
		select
			fpga_id,
			fine_timestamp_key
		from
			gateway_board
		where
			gateway_id = $1
		order by
			id`,
		id,
	)
	if err != nil {
		return gw, handlePSQLError(err, "select error")
	}

	return gw, nil
}

repository: brocaar/chirpstack-network-server

repo_name: brocaar/chirpstack-network-server

gha_language: Go


text:
@misc{idc_storage,
  author = {IDC},
  title = {Where in the World is Storage},
  year = {2013},
  note = {\url{http://www.idc.com/downloads/where_is_storage_infographic_243338.pdf}}
}

@misc{carlson_curves,
author = {Rob Carlson},
title = {Time for New DNA Synthesis and Sequencing Cost Curves},
year = {2014},
note = {\url{https://synbiobeta.com/time-new-dna-synthesis-sequencing-cost-curves-rob-carlson}},
}

@article{opendrop, crossref = {alistar2017opendrop}}
@article{alistar2017opendrop,
  title={OpenDrop: An Integrated Do-It-Yourself Platform for Personal Use of Biochips},
  author={Alistar, Mirela and Gaudenz, Urs},
  journal={Bioengineering},
  volume={4},
  number={2},
  pages={45},
  year={2017},
  publisher={Multidisciplinary Digital Publishing Institute}
}

@article{dmf-review, crossref = {doi:10.1146/annurev-anchem-062011-143028}}
@article{doi:10.1146/annurev-anchem-062011-143028,
  author = {Kihwan Choi and Alphonsus H.C. Ng and Ryan Fobel and Aaron R. Wheeler},
  title = {Digital Microfluidics},
  journal = {Annual Review of Analytical Chemistry},
  volume = {5},
  number = {1},
  pages = {413-440},
  year = {2012},
  doi = {10.1146/annurev-anchem-062011-143028},
}

@article{dmf-vision,
  author = "Vo, Philippe Q. N. and Husser, Mathieu C. and Ahmadi, Fatemeh and Sinha, Hugo and Shih, Steve C. C.",
  title = "Image-based feedback and analysis system for digital microfluidics",
  year = "2017",
  publisher = "The Royal Society of Chemistry",
  doi = "10.1039/C7LC00826K",
}

@unpublished{molecularelectronic,
  title={Architecting Hybrid Molecular-Electronic Systems},
  author={Kendall Stewart and Max Willsey and Yuan-Jyue Chen and Luis Ceze and Karin Strauss},
  notes={Under Submission},
  year={2017}
}

@misc{bioprotocols,
  Author = {Alessandro Abate and Luca Cardelli and Marta Kwiatkowska and Luca Laurenti and Boyan Yordanov},
  Title = {Experimental Biological Protocols with Formal Semantics},
  Year = {2017},
  Eprint = {arXiv:1710.08016},
}

@Inbook{Honda1993,
  author="Honda, Kohei",
  title="Types for dyadic interaction",
  bookTitle="CONCUR'93",
  year="1993",
  pages="509--523",
  isbn="978-3-540-47968-0",
  doi="10.1007/3-540-57208-2_35",
}

repository: thequicksort/puddle

repo_name: thequicksort/puddle


text:
SUMMARY = "Phosphor OEM IPMI Ethernet Stats Implementation"
DESCRIPTION = "This package handles receiving OEM IPMI commands to provide ethernet device statistics."
HOMEPAGE = "http://github.com/openbmc/phosphor-ipmi-ethstats"
PR = "r1"
PV = "0.1+git${SRCPV}"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"

inherit autotools pkgconfig
inherit obmc-phosphor-ipmiprovider-symlink

DEPENDS += "autoconf-archive-native"
DEPENDS += "phosphor-ipmi-host"

S = "${WORKDIR}/git"
SRC_URI = "git://github.com/openbmc/phosphor-ipmi-ethstats"
SRCREV = "c8894c55f5d58862f266aebedc43e2652f529a41"

FILES:${PN}:append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
FILES:${PN}:append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
FILES:${PN}:append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
FILES:${PN}-dev:append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"

HOSTIPMI_PROVIDER_LIBRARY += "libethstatscmd.so"

EXTRA_OECONF += "--disable-tests"

repository: Intel-BMC/openbmc

repo_name: Intel-BMC/openbmc

gha_license_id: NOASSERTION

extension: bb


text:
DESCRIPTION = "A minimal version of the Mozilla web browser"
HOMEPAGE="http://www.mozilla.org/projects/minimo/"
SRC_URI = "cvs://anonymous@cvs-mirror.mozilla.org/cvsroot;module=mozilla \
	   file://no-xmb.patch;patch=1 \
	   file://host_ldflags_fix.patch;patch=1 \
	   file://minimo.png file://minimo.desktop"
S = "${WORKDIR}/mozilla"
MAINTAINER = "Phil Blundell <pb@handhelds.org>"
SECTION = "x11"
PRIORITY = "optional"
PV = "0.0+cvs${SRCDATE}"
FILES_${PN} += "${libdir}/mozilla-minimo"
PR = "r8"
LICENSE = "MPL/LGPL/GPL"

inherit mozilla

EXTRA_OECONF += "--enable-application=minimo --disable-native-uconv"
export MOZ_CO_PROJECT="minimo"

export MINIMO=1
export MOZ_OBJDIR="${WORKDIR}/build-${TARGET_SYS}"

include mozilla-cvs.inc

do_compile () {
	mozilla_do_compile
}

mozdir="${D}${libdir}/mozilla-minimo"

do_install () {
	cd $MOZ_OBJDIR/minimo/base
	oe_runmake package
	cd ${S}
	mkdir -p ${mozdir}
	cp -rL $MOZ_OBJDIR/dist/minimo/* ${mozdir}/
	mkdir -p ${D}${datadir}/applications
	install -m 0644 ${WORKDIR}/minimo.desktop ${D}${datadir}/applications/minimo.desktop
	mkdir -p ${D}${datadir}/pixmaps
	install -m 0644 ${WORKDIR}/minimo.png ${D}${datadir}/pixmaps/minimo.png
	mkdir -p ${D}${bindir}
	echo "#!/bin/sh" > ${D}${bindir}/Minimo
	cat >>${D}${bindir}/Minimo << EOF
cd ${libdir}/mozilla-minimo
export LD_LIBRARY_PATH=${libdir}/mozilla-minimo
exec ./minimo
EOF
	chmod 755 ${D}${bindir}/Minimo
}

repository: BackupTheBerlios/openslug-svn

repo_name: BackupTheBerlios/openslug-svn


text:
package dsp

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestFBComb_Tick(t *testing.T) {
	c := NewFBComb(10)
	for i := 0; i < 10; i++ {
		c.Tick(float64(i), 0.5)
	}
	out := []float64{}
	for i := 0; i < 10; i++ {
		out = append(out, c.Tick(float64(i), 0.5))
	}
	require.Equal(t, []float64{0, 1.5, 3, 4.5, 6, 7.5, 9, 10.5, 12, 13.5}, out)
}

func TestFBComb_TickAbsolute(t *testing.T) {
	c := NewFBComb(10)
	out := []float64{}
	for i := 0; i < 10; i++ {
		out = append(out, c.TickAbsolute(float64(i), 0.5, 1))
	}
	require.Equal(t, []float64{0, 1, 2.5, 4, 5.5, 7, 8.5, 10, 11.5, 13}, out)
}

func TestFFComb_Tick(t *testing.T) {
	c := NewFFComb(10)
	for i := 0; i < 10; i++ {
		c.Tick(float64(i), 0.5)
	}
	out := []float64{}
	for i := 0; i < 10; i++ {
		out = append(out, c.Tick(float64(i), 0.5))
	}
	require.Equal(t, []float64{1, 2.5, 4, 5.5, 7, 8.5, 10, 11.5, 8, 9.5}, out)
}

func TestFFComb_TickAbsolute(t *testing.T) {
	c := NewFFComb(10)
	out := []float64{}
	for i := 0; i < 10; i++ {
		out = append(out, c.TickAbsolute(float64(i), 0.5, 1))
	}
	require.Equal(t, []float64{0, 1.5, 3, 4.5, 6, 7.5, 9, 10.5, 12, 13.5}, out)
}

repository: brettbuddin/shaden

repo_name: brettbuddin/shaden


text:
DESCRIPTION = "Implementation of the Service Availability Forum Application Interface Specification (AIS)"
LICENSE = "BSD"
DEPENDS = "cluster-glue corosync"

SRC_URI = " \
	ftp://ftp@openais.org/downloads/openais-${PV}/openais-${PV}.tar.gz;name=tar \
	file://fix-lcrso-linkage.patch \
	"
SRC_URI[tar.md5sum] = "f94ccb867358ac54ab24bc54def27335"
SRC_URI[tar.sha256sum] = "7ba87dc480a9dd224fe3a3732c966d6fdf6ec5f192bb184d586afa3703f808f2"

inherit autotools_stage

FILES_${PN}-dbg += "${libexecdir}/lcrso/.debug"


text:
package linux

import (
	"io/ioutil"
	"log"
	"strconv"
	"strings"

	promm "github.com/prometheus/client_golang/prometheus"
)

func readIntFileIntoGauge(ctr promm.Gauge, path string) {
	value, err := readIntFile(path)
	if err != nil {
		log.Printf("Unable to read integer from file %q for counter %v: %v",
			path, *ctr.Desc(), err)
		return
	}
	ctr.Set(float64(value))
}

// Read a text file containing a single decimal integer. The number is assumed
// to end at the first of: nul-zero byte, newline, or EOF. The file is read
// into memory so should be short.
func readIntFile(path string) (int64, error) {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		return 0, nil
	}
	s := string(data)
	end := strings.IndexAny(s, intFileEnding)
	if end < 0 {
		end = len(s)
	}
	return strconv.ParseInt(s[0:end], 10, 64)
}

repository: huin/warren

repo_name: huin/warren


text:
@ARTICLE{Ye2000,
  author = {Huilin Ye and Bruce W. Lo},
  title = {A Visualised Software Library: Nested Self-Organising Maps for Retrieving and Browsing Reusable Software Assets},
  journal = {Neural Computing \& Applications},
  year = {2000},
  volume = {9},
  pages = {266--279},
  number = {4},
  abstract = {This paper presents an approach to self-structuring software libraries. The authors developed a representation scheme to construct a feature space over a collection of software assets. The feature space is represented and classified by a variety of the self-organising map, called the Nested Software Self-Organising Map (NSSOM), consisting of a top map and a set of sub-maps nested in the top map. The clustering on the top map provides general improvements in retrieval recall, while the lower-level nested maps further elaborate the clusters into more specific groups enhancing retrieval precision. The results of preliminary evaluation showed that NSSOM is capable of enhancing precision without sacrificing recall. In addition, a user-friendly browsing facility has also been developed which helps users predict the desired components by providing an intelligible search space. The present approach attempts to achieve an optimal combination of efficiency, accuracy and user-friendliness, which is not offered by the existing software retrieval systems.},
  doi = {10.1007/s005210070004}
}

repository: vis-au/treevisnet

repo_name: vis-au/treevisnet

gha_language: TeX


text:
@article{RN968,
 author = {Chierakul, W. and Anunnatsiri, S. and Short, J. M. and Maharjan, B. and Mootsikapun, P. and Simpson, A. J. H. and Limmathurotsakul, D. and Cheng, A. C. and Stepniewska, K. and Newton, P. N. and Chaowagul, W. and White, N. J. and Peacock, S. J. and Day, N. P. and Chetchotisakd, P.},
 doi = {10.1086/444456},
 journal = {Clinical Infectious Diseases},
 number = {8},
 pages = {1105-1113},
 title = {Two randomized controlled trials of ceftazidime alone versus ceftazidime in combination with trimethoprim-sulfamethoxazole for the treatment of severe melioidosis},
 type = {Journal Article},
 url = {https://www.scopus.com/inward/record.uri?eid=2-s2.0-26444505890&doi=10.1086%2f444456&partnerID=40&md5=aba154ccd7192936d7a76bace9b12a70
http://cid.oxfordjournals.org/content/41/8/1105.full.pdf},
 volume = {41},
 year = {2005}
}


text:
package main

import "fmt"

/**
# Go For
for循环是Go语言唯一的循环结构

## 1.单一条件循环
	类似其他语言的while循环
## 2.初始/条件/循环
	初始化/条件判断/循环后条件变化
## 3.无条件for循环
	死循环，除非break跳出，或return返回
*/
func main() {

	//1.单一条件循环
	i := 1
	for i <= 3 {
		fmt.Println(i)
		i = i + 1
	}

	//2.初始/条件/循环
	for j := 7; j <= 9; j++ {
		fmt.Println(j)
	}

	//3.无条件for循环
	for {
		fmt.Println("loop")
		break
	}
}

repository: isgasho/go-case

repo_name: isgasho/go-case


text:
SUMMARY = "Qt wrapper for ModemManager API"
LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"

inherit kde-kf5 pkgconfig cmake_auto_align_paths cmake_lib

DEPENDS += "modemmanager"

PV = "${KF5_VERSION}"
SRC_URI[md5sum] = "3a18f1b5eb357a16a786b30f12b16028"
SRC_URI[sha256sum] = "e29e1a4c3a8dda3a02727667b7b0c46b6060fdb01f9cd3049c24af2d4ad9c3f1"

CMAKE_ALIGN_SYSROOT[1] = "KF5ModemManagerQt, -S${includedir}, -s${_IMPORT_PREFIX}/include"

RPROVIDES_${PN} += "libmm-qt"
RREPLACES_${PN} += "libmm-qt"
RCONFLICTS_${PN} += "libmm-qt"


text:
SUMMARY = "Temp placeholder for skeleton function"
DESCRIPTION = "Temp placeholder for skeleton repository"
HOMEPAGE = "http://github.com/openbmc/skeleton"
PR = "r1"

inherit obmc-phosphor-license
inherit obmc-phosphor-systemd
inherit obmc-phosphor-chassis-mgmt
inherit obmc-phosphor-fan-mgmt
inherit obmc-phosphor-flash-mgmt
inherit obmc-phosphor-policy-mgmt
inherit obmc-phosphor-sensor-mgmt
inherit obmc-phosphor-system-mgmt

DEPENDS += "glib-2.0 systemd"
RDEPENDS_${PN} += "python-subprocess python-compression libsystemd"
SRC_URI += "git://github.com/openbmc/skeleton"

# RDEPEND on pflash if the openpower-pflash machine feature is set.
PACKAGECONFIG ??= "${@bb.utils.contains('MACHINE_FEATURES', 'openpower-pflash', 'openpower-pflash', '', d)}"
PACKAGECONFIG[openpower-pflash] = ",,,pflash"

SRCREV = "2f9ee83356fba3f6f843bf2584f3e7e95763ec98"

S = "${WORKDIR}"

do_compile() {
        oe_runmake -C git

        # Remove deprecated files.
        rm ${S}/git/bin/pflash
}

do_install() {
        source=${S}/git

        install -d ${D}/${sbindir} ${D}${libdir}
        for i in ${source}/bin/*; do
                install $i ${D}/${sbindir}
        done
        for i in ${source}/lib/*; do
                install $i ${D}/${libdir}
        done
}

repository: cbostic/openbmc

repo_name: cbostic/openbmc


text:
package message

type Event int

const (
	PFCPMessage Event = iota
	PDUSessionSMContextCreate
	PDUSessionSMContextUpdate
	PDUSessionSMContextRelease
	SMPolicyUpdateNotify
	OAMGetUEPDUSessionInfo
)


text:
// Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package list

import (
	"context"
	"encoding/json"
	"fmt"
	"strconv"

	"github.com/sirupsen/logrus"

	orgpb "github.com/erda-project/erda-proto-go/core/org/pb"
	"github.com/erda-project/erda/apistructs"
	"github.com/erda-project/erda/internal/core/org"
	"github.com/erda-project/erda/pkg/common/apis"
	"github.com/erda-project/erda/pkg/discover"

	protocol "github.com/erda-project/erda/internal/core/openapi/legacy/component-protocol"
)

const defaultOrgImage = "frontImg_default_org_icon"

func (i *ComponentList) unmarshal(c *apistructs.Component) error {
	stateValue, err := json.Marshal(c.State)
	if err != nil {
		return err
	}
	var state State
	err = json.Unmarshal(stateValue, &state)
	if err != nil {
		return err
	}
	i.State = state
	return nil
}

func (i *ComponentList) marshal(c *apistructs.Component) error {
	stateValue, err := json.Marshal(i.State)
	if err != nil {
		return err
	}
	var state map[string]interface{}
	err = json.Unmarshal(stateValue, &state)
	if err != nil {
		return err
	}

	c.Data = map[string]interface{}{
		"list": i.Data,
	}
	c.State = state
	c.Props = i.Props
	c.Operations = i.Operations
	return nil
}

func (i *ComponentList) SetCtxBundle(b protocol.ContextBundle) error {
	if b.Bdl == nil || b.I18nPrinter == nil {
		err := fmt.Errorf("invalie context bundle")
		return err
	}
	logrus.Infof("inParams:%+v, identity:%+v", b.InParams, b.Identity)
	i.CtxBdl = b
	return nil
}

func (i *ComponentList) Render(ctx context.Context, c *apistructs.Component, _ apistructs.ComponentProtocolScenario, event apistructs.ComponentEvent, gs *apistructs.GlobalStateData) (err error) {
	if event.Operation != apistructs.InitializeOperation {
		err = i.unmarshal(c)
		if err != nil {
			return err
		}
	}

	defer func() {
		fail := i.marshal(c)
		if err == nil && fail != nil {
			err = fail
		}
	}()

	bdl := ctx.Value(protocol.GlobalInnerKeyCtxBundle.String()).(protocol.ContextBundle)

	if err := i.SetCtxBundle(bdl); err != nil {
		return err
	}

	i.initProperty()
	switch event.Operation {
	case apistructs.InitializeOperation, apistructs.RenderingOperation, apistructs.ChangeOrgsPageNoOperationKey, apistructs.ChangeOrgsPageSizeOperationKey:
		if err := i.RenderMyOrgs(); err != nil {
			return err
		}
	case apistructs.ExitOrgOperationKey:
		if err := i.ExitOrg(event); err != nil {
			return err
		}
		if err := i.RenderMyOrgs(); err != nil {
			return err
		}
	}
	return nil
}

func (i *ComponentList) RenderMyOrgs() error {
	if i.State.PageSize == 0 {
		i.State.PageSize = 10
		i.State.PageNo = 1
	}
	if i.State.SearchRefresh {
		i.State.PageNo = 1
	}
	req := orgpb.ListOrgRequest{
		PageNo:   int64(i.State.PageNo),
		PageSize: int64(i.State.PageSize),
	}
	orgs, err := org.MustGetOrg().ListOrg(apis.WithUserIDContext(apis.WithInternalClientContext(context.Background(), discover.SvcOpenapi), i.CtxBdl.Identity.UserID), &req)
	if err != nil {
		return err
	}
	if orgs.Total == 0 {
		i.State.IsEmpty = true
		i.Props.Visible = false
	}

	if i.State.SearchEntry != "" {
		req.Q = i.State.SearchEntry
		orgs, err = org.MustGetOrg().ListOrg(apis.WithUserIDContext(apis.WithInternalClientContext(context.Background(), discover.SvcOpenapi), i.CtxBdl.Identity.UserID), &req)
		if err != nil {
			return err
		}
	}

	i.State.Total = int(orgs.Total)
	id, err := strconv.Atoi(i.CtxBdl.Identity.OrgID)
	if err != nil {
		id = 0
	}
	curId := uint64(id)
	var first *Org
	data := []Org{}
	for _, org := range orgs.List {
		item := Org{
			Id:          org.ID,
			Title:       org.DisplayName,
			Description: org.Desc,
			PrefixImg:   defaultOrgImage,
			ExtraInfos: []ExtraInfo{
				{
					Icon: "lock2",
					Text: "私有组织",
				},
			},
		}
		if org.Logo != "" {
			item.PrefixImg = org.Logo
		}
		if org.IsPublic {
			item.ExtraInfos[0].Icon = "earth"
			item.ExtraInfos[0].Text = "公开组织"
		}

		item.Operations = map[string]interface{}{
			"click": ClickOperation{
				Key:    "click",
				Show:   false,
				Reload: false,
				Command: Command{
					Key:    "goto",
					Target: "https://" + org.Domain + "/dop/projects",
				},
			},
		}
		// permission, err := i.CtxBdl.Bdl.ScopeRoleAccess(i.CtxBdl.Identity.UserID, &apistructs.ScopeRoleAccessRequest{
		// 	Scope: apistructs.Scope{
		// 		Type: apistructs.OrgScope,
		// 		ID:   strconv.FormatUint(org.ID, 10),
		// 	},
		// })
		permission, err := i.CtxBdl.Bdl.CheckPermission(&apistructs.PermissionCheckRequest{
			UserID:   i.CtxBdl.Identity.UserID,
			Scope:    apistructs.OrgScope,
			ScopeID:  org.ID,
			Resource: apistructs.OrgResource,
			Action:   apistructs.UpdateAction,
		})
		if err != nil {
			return err
		}
		if permission.Access {
			item.Operations["toManage"] = ManageOperation{
				Key:    "toManage",
				Text:   "管理",
				Reload: false,
				Command: Command{
					Key:    "goto",
					Target: "https://" + org.Domain + "/orgCenter/setting/detail",
				},
			}
		}

		item.Operations["exit"] = ExitOperation{
			Key:     "exit",
			Text:    "退出",
			Reload:  true,
			Confirm: "退出当前组织后，将不在有参与组织工作的权限，如要再次加入需要组织管理员受邀加入，请确认是否退出？",
			Meta:    Meta{Id: org.ID},
		}

		if org.ID == curId {
			first = &item
			continue
		}
		data = append(data, item)
	}
	if first != nil {
		i.Data = append([]Org{*first}, data...)
	} else {
		i.Data = data
	}
	i.State.SearchRefresh = false
	return nil
}

func (i *ComponentList) ExitOrg(event apistructs.ComponentEvent) error {
	var operationData ExitOperation
	if err := getOperation(&operationData, event); err != nil {
		return err
	}
	req := apistructs.MemberRemoveRequest{
		Scope: apistructs.Scope{
			Type: apistructs.OrgScope,
			ID:   strconv.Itoa(int(operationData.Meta.Id)),
		},
		UserIDs: []string{i.CtxBdl.Identity.UserID},
	}
	req.UserID = i.CtxBdl.Identity.UserID
	return i.CtxBdl.Bdl.DeleteMember(req)
}

func getOperation(operationData *ExitOperation, event apistructs.ComponentEvent) error {
	if event.OperationData == nil {
		return nil
	}
	b, err := json.Marshal(event.OperationData)
	if err != nil {
		return err
	}
	if err := json.Unmarshal(b, &operationData); err != nil {
		return err
	}
	return nil
}

func (i *ComponentList) initProperty() {
	i.Operations = map[string]interface{}{
		"changePageNo": OperationBase{
			Key:    "changePageNo",
			Reload: true,
		},
		"changePageSize": OperationBase{
			Key:    "changePageSize",
			Reload: true,
		},
	}

	i.Props = Props{
		PageSizeOptions: []string{"10", "20", "50", "100"},
		Visible:         true,
	}
}

func RenderCreator() protocol.CompRender {
	return &ComponentList{}
}

repository: erda-project/erda

repo_name: erda-project/erda


text:
DESCRIPTION = "RSM (Reverse SSH Manager) client"
SECTION = "console/utils"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${RESIN_COREBASE}/COPYING.Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

SRC_URI = " \
    file://hl-rsm \
    file://hl-rsm.service \
    file://hl-rsm.timer \
    "

inherit allarch systemd

SYSTEMD_SERVICE_${PN} = " \
    hl-rsm.service \
    hl-rsm.timer \
    "
SYSTEMD_AUTO_ENABLE = "enable"

RDEPENDS_${PN} = " \
    bash \
    jq \
    "

FILES_${PN} += " \
     ${systemd_unitdir} \
     ${bindir} \
     "

do_install() {
    install -d ${D}${bindir}
    install -m 0755 ${WORKDIR}/hl-rsm ${D}${bindir}/hl-rsm

    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
        install -d ${D}${systemd_unitdir}/system
        install -c -m 0644 ${WORKDIR}/hl-rsm.service ${D}${systemd_unitdir}/system
        install -c -m 0644 ${WORKDIR}/hl-rsm.timer ${D}${systemd_unitdir}/system
        sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
            -e 's,@SBINDIR@,${sbindir},g' \
            -e 's,@BINDIR@,${bindir},g' \
            ${D}${systemd_unitdir}/system/*.service
    fi
}

repository: helioslite/resin-raspberrypi

repo_name: helioslite/resin-raspberrypi


text:
package qbiface

import (
	"github.com/cpliakas/quickbase-do-query/qb"
)

// ClientAPI provides an interface to enable mocking the Quick Base service
// client's API calls.
type ClientAPI interface {
	Config() qb.Config

	AddRecord(*qb.AddRecordInput) (qb.AddRecordOutput, error)
	Authenticate(*qb.AuthenticateInput) (qb.AuthenticateOutput, error)
	DoQuery(*qb.DoQueryInput) (qb.DoQueryOutput, error)
	EditRecord(*qb.EditRecordInput) (qb.EditRecordOutput, error)
	GetSchema(*qb.GetSchemaInput) (qb.GetSchemaOutput, error)
	ImportFromCSV(*qb.ImportFromCSVInput) (qb.ImportFromCSVOutput, error)
	SetVariable(*qb.SetVariableInput) (qb.SetVariableOutput, error)
	UploadFile(*qb.UploadFileInput) (qb.UploadFileOutput, error)
}

repository: cpliakas/quickbase-do-query

repo_name: cpliakas/quickbase-do-query


text:
// Copyright 2015 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the License. See the AUTHORS file
// for names of contributors.
//
// Author: Vivek Menezes (vivek.menezes@gmail.com)

package main

import (
	"bytes"
	"fmt"
	"math/rand"
	"strconv"
	"sync/atomic"
	"time"

	"github.com/cockroachdb/cockroach/client"
	"github.com/cockroachdb/cockroach/proto"
	"github.com/cockroachdb/cockroach/security"
	"github.com/cockroachdb/cockroach/security/securitytest"
	"github.com/cockroachdb/cockroach/server"
	"github.com/cockroachdb/cockroach/storage"
	"github.com/cockroachdb/cockroach/testutils"
	"github.com/cockroachdb/cockroach/util/log"
)

// Makes an id string from an id int.
func makeAccountID(id int) []byte {
	return []byte(fmt.Sprintf("%09d", id))
}

// Bank stores all the bank related state.
type Bank struct {
	kvClient        *client.KV
	numAccounts     int
	numTransactions int32
}

// moveMoney() moves an amount between two accounts if the amount
// is available in the from account. Returns true on success.
func (bank *Bank) moveMoney(from, to []byte, amount int64) bool {
	// Early exit when from == to
	if bytes.Compare(from, to) == 0 {
		return true
	}
	txnOpts := &client.TransactionOptions{Name: fmt.Sprintf("Transferring %s-%s-%d", from, to, amount)}
	err := bank.kvClient.RunTransaction(txnOpts, func(txn *client.Txn) error {
		fromGet := client.Get(proto.Key(from))
		fromResp := fromGet.Reply.(*proto.GetResponse)
		toGet := client.Get(proto.Key(to))
		toResp := toGet.Reply.(*proto.GetResponse)
		if err := txn.Run(fromGet, toGet); err != nil {
			return err
		}
		// Read from value.
		var fromValue int64
		if fromResp.Value != nil && fromResp.Value.Bytes != nil {
			readValue, err := strconv.ParseInt(string(fromResp.Value.Bytes), 10, 64)
			if err != nil {
				return err
			}
			fromValue = readValue
		}
		// Ensure there is enough cash.
		if fromValue < amount {
			return nil
		}
		// Read to value.
		var toValue int64
		if toResp.Value != nil && toResp.Value.Bytes != nil {
			readValue, err := strconv.ParseInt(string(toResp.Value.Bytes), 10, 64)
			if err != nil {
				return err
			}
			toValue = readValue
		}
		// Update both accounts.
		txn.Prepare(client.Put(proto.Key(from), []byte(fmt.Sprintf("%d", fromValue-amount))))
		txn.Prepare(client.Put(proto.Key(to), []byte(fmt.Sprintf("%d", toValue+amount))))
		return nil
	})
	if err != nil {
		log.Fatal(err)
	}
	atomic.AddInt32(&bank.numTransactions, 1)
	return true
}

// Read the balances in all the accounts and return them.
func (bank *Bank) readAllAccounts() []int64 {
	balances := make([]int64, bank.numAccounts)
	calls := make([]client.Call, bank.numAccounts)
	txnOpts := &client.TransactionOptions{Name: "Reading all balances"}
	err := bank.kvClient.RunTransaction(txnOpts, func(txn *client.Txn) error {
		for i := 0; i < bank.numAccounts; i++ {
			calls[i] = client.Get(proto.Key(makeAccountID(i)))
		}
		if err := txn.Run(calls...); err != nil {
			log.Fatal(err)
		}
		// Copy responses into balances.
		for i := 0; i < bank.numAccounts; i++ {
			gr := calls[i].Reply.(*proto.GetResponse)
			if gr.Value != nil && gr.Value.Bytes != nil {
				balance, err := strconv.ParseInt(string(gr.Value.Bytes), 10, 64)
				if err != nil {
					log.Fatal(err)
				}
				balances[i] = balance
			}
		}
		return nil
	})
	if err != nil {
		log.Fatal(err)
	}
	return balances
}

// continuouslyTransferMoney() keeps moving random amounts between
// random accounts.
func (bank *Bank) continuousMoneyTransfer() {
	for {
		from := makeAccountID(rand.Intn(bank.numAccounts))
		to := makeAccountID(rand.Intn(bank.numAccounts))
		exchange := rand.Int63n(100)
		bank.moveMoney(from, to, exchange)
	}
}

// Initialize all the bank accounts with cash.
func (bank *Bank) initBankAccounts(cash int64) {
	calls := make([]client.Call, bank.numAccounts)
	for i := 0; i < bank.numAccounts; i++ {
		calls[i] = client.Put(proto.Key(makeAccountID(i)), []byte(fmt.Sprintf("%d", cash)))
	}
	if err := bank.kvClient.Run(calls...); err != nil {
		log.Fatal(err)
	}
}

func (bank *Bank) periodicallyCheckBalances(initCash int64) {
	for {
		// Sleep for a bit to allow money transfers to happen in the background.
		time.Sleep(time.Second)
		fmt.Printf("%d transactions were executed\n\n", bank.numTransactions)
		// Check that all the money is accounted for.
		balances := bank.readAllAccounts()
		var totalAmount int64
		for i := 0; i < bank.numAccounts; i++ {
			// fmt.Printf("Account %d contains %d$\n", i, balances[i])
			totalAmount += balances[i]
		}
		if totalAmount != int64(bank.numAccounts)*initCash {
			err := fmt.Sprintf("\nTotal cash in the bank = %d\n", totalAmount)
			log.Fatal(err)
		}
		fmt.Printf("\nThe bank is in good order\n\n")
	}
}

func main() {
	fmt.Printf("A simple program that keeps moving money between bank accounts\n\n")
	// Run a test cockroach instance to represent the bank.
	security.SetReadFileFn(securitytest.Asset)
	serv := server.StartTestServer(nil)
	defer serv.Stop()
	// Initialize the bank.
	var bank Bank
	bank.numAccounts = 1000
	// Key Value Client initialization.
	sender, err := client.NewHTTPSender(serv.ServingAddr(), testutils.NewTestBaseContext())
	if err != nil {
		log.Fatal(err)
	}
	bank.kvClient = client.NewKV(nil, sender)
	bank.kvClient.User = storage.UserRoot
	// Initialize all the bank accounts.
	const initCash = 1000
	bank.initBankAccounts(initCash)

	// Start all the money transfer routines.
	const numTransferRoutines = 10
	for i := 0; i < numTransferRoutines; i++ {
		go bank.continuousMoneyTransfer()
	}

	bank.periodicallyCheckBalances(initCash)
}

repository: rtrag/cockroach

repo_name: rtrag/cockroach


text:
macro(project_add_all_folders)
    list_folders(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
    foreach(subdir ${SUBDIRS})
        add_subdirectory(${subdir})
    endforeach()
endmacro()

repository: bmgandre/hackerrank-cpp

repo_name: bmgandre/hackerrank-cpp


text:
DESCRIPTION = "Pythonware Fast SGML Parser for Python"
SECTION = "devel/python"
PRIORITY = "optional"
SRCNAME = "sgmlop"
LICENSE = "${PN}"

inherit distutils

SRC_URI = "http://www.vanille.de/mirror/${SRCNAME}-${PV}.tar.bz2"
S = "${WORKDIR}/${SRCNAME}-${PV}"

SRC_URI[md5sum] = "45f77f33a6b2a5c09c28511ebb733b87"
SRC_URI[sha256sum] = "7fd6495d6c3e8dac7ba086c68abed4930c958a94afc15359223074614559e462"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
@article{johannesRelationshipOnlineVigilance2020,
 abstract = {Through communication technology, users find themselves constantly connected to others to such an extent that they routinely develop a mind-set of connectedness. This mind-set has been defined as online vigilance. Although there is a large body of research on media use and well-being, the question of how online vigilance impacts well-being remains unanswered. In this preregistered study, we combine experience sampling and smartphone logging to address the relation of online vigilance and affective well-being in everyday life. Seventy-five Android users answered eight daily surveys over five days (N = 1,615) whilst having their smartphone use logged. Thinking about smartphone-mediated social interactions (i.e., the salience dimension of online vigilance) was negatively related to affective well-being. However, it was far more important whether those thoughts were positive or negative. No other dimension of online vigilance was robustly related to affective well-being. Taken together, our results suggest that online vigilance does not pose a serious threat to affective well-being in everyday life.},
 author = {Johannes, Niklas and Meier, Adrian and Reinecke, Leonard and Ehlert, Saara and Setiawan, Dinda Nuranissa and Walasek, Nicole and Dienlin, Tobias and Buijzen, Moniek and Veling, Harm},
 copyright = {All rights reserved},
 doi = {10.1080/15213269.2020.1768122},
 file = {Johannes et al. - 2020 - The relationship between online vigilance and affe.pdf:C\:\\Users\∋kla\\Zotero\\storage\\6W34U5MZ\\Johannes et al. - 2020 - The relationship between online vigilance and affe.pdf:application/pdf},
 issn = {1521-3269},
 journal = {Media Psychology},
 month = {May},
 note = {Publisher: Routledge
_eprint: https://doi.org/10.1080/15213269.2020.1768122},
 pages = {1--25},
 shorttitle = {The relationship between online vigilance and affective well-being in everyday life},
 title = {The relationship between online vigilance and affective well-being in everyday life: Combining smartphone logging with experience sampling},
 url = {https://doi.org/10.1080/15213269.2020.1768122},
 urldate = {2020-05-27},
 year = {2020}
}

repository: niklasjohannes/website

repo_name: niklasjohannes/website

branch_name: refs/heads/main


text:
@inproceedings{allain:hal-00675824,
 address = {Shenzen, China},
 author = {Allain, Pierre and Courty, Nicolas and Corpetti, Thomas},
 booktitle = {3rd International Asia Conference on Informatics in Control, Automation and Robotics (CAR 2011)},
 hal_id = {hal-00675824},
 hal_version = {v2},
 month = {December},
 pages = {307-310},
 pdf = {https://hal.archives-ouvertes.fr/hal-00675824/file/car_411.pdf},
 publisher = {Springer},
 series = {Lecture Notes in Electrical Engineering},
 title = {Continuous Control of Lagrangian Data},
 url = {https://hal.archives-ouvertes.fr/hal-00675824},
 volume = {132},
 year = {2011}
}

repository: ncourty/academic-kickstart

repo_name: ncourty/academic-kickstart


text:
package petstoreserver

import (
	"net/http"
)

type User struct {

}

func CreateUser(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "application/json; charset=UTF-8")
		w.WriteHeader(http.StatusOK)
}

func CreateUsersWithArrayInput(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "application/json; charset=UTF-8")
		w.WriteHeader(http.StatusOK)
}

func CreateUsersWithListInput(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "application/json; charset=UTF-8")
		w.WriteHeader(http.StatusOK)
}

func DeleteUser(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "application/json; charset=UTF-8")
		w.WriteHeader(http.StatusOK)
}

func GetUserByName(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "application/json; charset=UTF-8")
		w.WriteHeader(http.StatusOK)
}

func LoginUser(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "application/json; charset=UTF-8")
		w.WriteHeader(http.StatusOK)
}

func LogoutUser(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "application/json; charset=UTF-8")
		w.WriteHeader(http.StatusOK)
}

func UpdateUser(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "application/json; charset=UTF-8")
		w.WriteHeader(http.StatusOK)
}

repository: elastic/swagger-codegen

repo_name: elastic/swagger-codegen

gha_language: Mustache


text:
package utils

import (
	"fmt"
	"github.com/streadway/amqp"
	"gopkg.in/yaml.v2"
	"io/ioutil"
	"log"
	"path/filepath"
	"time"
)

type Amqp struct {
	Connect struct {
		Host     string `yaml:"host"`
		Port     string `yaml:"port"`
		Username string `yaml:"username"`
		Password string `yaml:"password"`
	} `yaml:"connect"`

	Exchange struct {
		Default map[string]string `yaml:"default"`
		Kline   map[string]string `yaml:"kline"`
		Ticker  map[string]string `yaml:"ticker"`
	} `yaml:"exchange"`

	Queue struct {
		Kline  map[string]string `yaml:"kline"`
		Ticker map[string]string `yaml:"ticker"`
	} `yaml:"queue"`
}

var (
	AmqpGlobalConfig Amqp
	RabbitMqConnect  *amqp.Connection
)

// 初始化AMQP配置
func InitializeAmqpConfig() {
	path_str, _ := filepath.Abs("config/amqp.yml")
	content, err := ioutil.ReadFile(path_str)
	if err != nil {
		log.Fatal(err)
		return
	}
	err = yaml.Unmarshal(content, &AmqpGlobalConfig)
	if err != nil {
		log.Fatal(err)
		return
	}
	InitializeAmqpConnection()
}

// 初始化AMQP连接
func InitializeAmqpConnection() {
	var err error
	RabbitMqConnect, err = amqp.Dial("amqp://" + AmqpGlobalConfig.Connect.Username + ":" + AmqpGlobalConfig.Connect.Password + "@" + AmqpGlobalConfig.Connect.Host + ":" + AmqpGlobalConfig.Connect.Port + "/")
	if err != nil {
		time.Sleep(5000)
		InitializeAmqpConnection()
		return
	}
	go func() {
		<-RabbitMqConnect.NotifyClose(make(chan *amqp.Error))
		InitializeAmqpConnection()
	}()
}

// 关闭AMQP连接
func CloseAmqpConnection() {
	RabbitMqConnect.Close()
}

// 获取AMQP连接
func GetRabbitMqConnect() *amqp.Connection {
	return RabbitMqConnect
}

func PublishMessageWithRouteKey(exchange, routeKey, contentType string, message *[]byte, arguments amqp.Table, deliveryMode uint8) error {
	channel, err := RabbitMqConnect.Channel()
	defer channel.Close()
	if err != nil {
		return fmt.Errorf("Channel: %s", err)
	}

	if err = channel.Publish(
		exchange, //交换机
		routeKey, //交换机与队列的路由key
		false,
		false,
		amqp.Publishing{
			Headers:         amqp.Table{},
			ContentType:     contentType,
			ContentEncoding: "",
			DeliveryMode:    deliveryMode,
			Priority:        0,
			Body:            *message,
		},
	); err != nil {
		return fmt.Errorf("发送队列消息失败: %s", err)
	}
	return nil
}

// declare RabbitMQ exchange
func DeclareExchange() error {
	channel, err := RabbitMqConnect.Channel()
	if err != nil {
		return fmt.Errorf("获取队列通道失败: %s", err)
	}

	err = channel.ExchangeDeclare(AmqpGlobalConfig.Exchange.Default["key"],
		AmqpGlobalConfig.Exchange.Default["type"],
		true,
		false,
		false,
		false,
		nil)
	if err != nil {
		return fmt.Errorf("创建交换机 [default] 失败: %s", err)
	}
	log.Printf("创建交换机 [%s] 成功\n", AmqpGlobalConfig.Exchange.Default["key"])

	err = channel.ExchangeDeclare(AmqpGlobalConfig.Exchange.Kline["key"],
		AmqpGlobalConfig.Exchange.Kline["type"],
		true,
		false,
		false,
		false,
		nil)
	if err != nil {
		return fmt.Errorf("创建交换机 [kline] 失败: %s", err)
	}

	log.Printf("创建交换机 [%s] 成功\n", AmqpGlobalConfig.Exchange.Kline["key"])

	err = channel.ExchangeDeclare(AmqpGlobalConfig.Exchange.Ticker["key"],
		AmqpGlobalConfig.Exchange.Ticker["type"],
		true,
		false,
		false,
		false,
		nil)
	if err != nil {
		return fmt.Errorf("创建交换机 [ticker] 失败: %s", err)
	}
	log.Printf("创建交换机 [%s] 成功\n", AmqpGlobalConfig.Exchange.Ticker["key"])
	DeclareQueue(channel)
	return nil
}

func DeclareQueue(channel *amqp.Channel) error {
	var err error
	_, err = channel.QueueDeclare(AmqpGlobalConfig.Queue.Kline["key"], true, false, false, false, nil)
	if err != nil {
		return fmt.Errorf("创建队列 [kline] 失败: %s", err)
	}

	log.Printf("创建队列 [%s] 成功\n", AmqpGlobalConfig.Queue.Kline["key"])

	_, err = channel.QueueDeclare(AmqpGlobalConfig.Queue.Ticker["key"], true, false, false, false, nil)
	if err != nil {
		return fmt.Errorf("创建队列 [ticker] 失败: %s", err)
	}
	log.Printf("创建队列 [%s] 成功\n", AmqpGlobalConfig.Queue.Ticker["key"])
	BindQueue(channel)
	return nil
}

//  bind queue with exchange by routeKey
func BindQueue(channel *amqp.Channel) {
	channel.QueueBind(AmqpGlobalConfig.Queue.Kline["key"], "kline", AmqpGlobalConfig.Exchange.Kline["key"], false, nil)
	channel.QueueBind(AmqpGlobalConfig.Queue.Ticker["key"], "ticker", AmqpGlobalConfig.Exchange.Ticker["key"], false, nil)
}

repository: BitExchanges/peak-exchange

repo_name: BitExchanges/peak-exchange


text:
--- cmake/toolchain-gcc.cmake.orig	2021-01-28 12:41:41 UTC
+++ cmake/toolchain-gcc.cmake
@@ -12,8 +12,8 @@ option(GCC_USE_GOLD "Use the gold linker instead of th
 option(GCC_GENERATE_GDB_INDEX "Adds linker option to generate the gdb index for debug builds" OFF)

 # These are the default values
-set(C_BASE_FLAGS "-march=native -pipe")
-set(CXX_BASE_FLAGS "-march=native -pipe")
+set(C_BASE_FLAGS "${CMAKE_C_FLAGS_RELEASE}")
+set(CXX_BASE_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}")

 # For C and C++, the values can be overwritten independently
 if(DEFINED ENV{CFLAGS})

repository: freebsd/freebsd-ports

repo_name: freebsd/freebsd-ports


text:
SUMMARY = "Attribute::Handlers - Simpler definition of attribute handlers"
AUTHOR = "Steffen Müller <smueller@cpan.org>"
HOMEPAGE = "https://metacpan.org/module/Attribute::Handlers"
SECTION = "libs"
LICENSE = "Artistic-1.0 | GPL-1.0+"
LIC_FILES_CHKSUM = "file://README;md5=3c1b86c36af6017808844c12b29c737f"

SRC_URI = "http://cpan.metacpan.org/authors/id/S/SM/SMUELLER/Attribute-Handlers-0.93.tar.gz"
SRC_URI[md5sum] = "5658992d2bc52ee5a5547425c1bec074"
SRC_URI[sha256sum] = "1d2a1ae00f54bc65c4aefda58ac52ea1b0fb9346ac4c612f5dd40192be7df04c"

S = "${WORKDIR}/Attribute-Handlers-${PV}"

inherit cpan

BBCLASSEXTEND = "native"


text:
require qt5-git.inc
require ${PN}.inc

PR = "${INC_PR}.0"

SRC_URI += "file://0001-Fix-wrong-calculation-of-viewPort-for-transitions.patch \
            file://0002-Fix-null-pointer-access-in-QQuickVisualDataModelPriv.patch \
"

SRCREV = "1d594c4e10caa9258f00bb7bcf61c307d027633b"


text:
// filter_slice.go
package main

import (
	"fmt"
)

func main() {
	s := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
	s = Filter(s, even)
	fmt.Println(s)
}

// Filter returns a new slice holding only
// the elements of s that satisfy f()
func Filter(s []int, fn func(int) bool) []int {
	var p []int // == nil
	for _, i := range s {
		if fn(i) {
			p = append(p, i)
		}
	}
	return p
}

func even(n int) bool {
	if n%2 == 0 {
		return true
	}
	return false
}
/* [0 2 4 6 8] */

repository: harkhuang/harkcode

repo_name: harkhuang/harkcode

gha_language: C


text:
DESCRIPTION = "USB Networking"
HOMEPAGE = "http://dev.openbossa.org/trac/mamona/"
SECTION = "utils"
LICENSE = "GPL"
RDEPENDS_${PN} = "module-init-tools busybox"
PR = "r2"

PACKAGES = "${PN}"

SRC_URI = 	"file://usbnet \
             file://default/usbnet \
             file://interfaces.usbnet"

inherit update-rc.d

INITSCRIPT_NAME = "usbnet"
INITSCRIPT_PARAMS = "defaults"

# Skipping...
do_configure () {
}

# Skipping...
do_stage () {
}

# Skipping...
do_compile () {
}

do_install () {
    install -d ${D}${sysconfdir}/init.d
    install -d ${D}${sysconfdir}/default
    install -d ${D}${sysconfdir}/network
    install -m 0755 ${WORKDIR}/usbnet ${D}${sysconfdir}/init.d
    install -m 0644 ${WORKDIR}/default/usbnet ${D}${sysconfdir}/default
    install -m 0644 ${WORKDIR}/interfaces.usbnet ${D}${sysconfdir}/network
}