text:
as 4B (hereafter referred to KRas) on the cell membrane under various signaling conditions. We found that at endogenous expression levels KRas forms dimers, and KRas(G12D), a mutant that constitutively binds GTP, activates MAPK. Overexpression of KRas leads to formation of higher order Ras nanoclusters. Conversely, at lower expression levels, KRas(G12D) is monomeric and activates MAPK only when artificially dimerized. Moreover, dimerization and signaling of KRas are both dependent on an intact CAAX (C, cysteine; A, aliphatic; X, any amino acid) motif that is also known to mediate membrane localization. These results reveal a new, dimerization-dependent signaling mechanism of Ras, and suggest Ras dimers as a potential therapeutic target in mutant Ras-driven tumors.},
author = {Nan, Xiaolin and Tamg{\"{u}}ney, Tanja M and Collisson, Eric A and Lin, Li-Jung and Pitt, Cameron and Galeas, Jacqueline and Lewis, Sophia and Gray, Joe W and McCormick, Frank and Chu, Steven},
doi = {10.1073/pnas.1509123112},
file = {:Users/dangeles/Documents/Mendeley Desktop/Nan et al. - 2015 - Ras-GTP dimers activate the Mitogen-Activated Protein Kinase (MAPK) pathway.pdf:pdf},
issn = {1091-6490},
journal = {Proceedings of the National Academy of Sciences of the United States of America},
keywords = {MAPK signaling,Ras dimer,cancer,single molecule imaging,superresolution microscopy},
month = {jun},
number = {26},
pages = {7996--8001},
pmid = {26080442},
publisher = {National Academy of Sciences},
title = {{Ras-GTP dimers activate the Mitogen-Activated Protein Kinase (MAPK) pathway.}},
volume = {112},
year = {2015}
}

@article{Chang2000,
abstract = {Vulval induction in  \emph{Caenorhabditis~elegans} has helped define an evolutionarily conserved signal transduction pathway from receptor tyrosine kinases (RTKs) through the adaptor protein SEM-5 to RAS. One component present in other organisms, a guanine nucleotide exchange factor for Ras, has been missing in C.ELEGANS: To understand the regulation of this pathway it is crucial to have all positive-acting components in hand. Here we describe the identification, cloning and genetic characterization of C.ELEGANS: SOS-1, a putative guanine nucleotide exchanger for LET-60 RAS. RNA interference experiments suggest that SOS-1 participates in RAS-dependent signaling events downstream of LET-23 EGFR, EGL-15 FGFR and an unknown RTK. We demonstrate that the previously identified let-341 gene encodes SOS-1. Analyzing vulval development in a let-341 null mutant, we find an SOS-1-independent pathway involved in the activation of RAS signaling. This SOS-1-independent signaling is not inhibited by SLI-1/Cbl and is not mediated by PTP-2/SHP, raising the possibility that there could be another RasGEF.},
author = {Chang, C and Hopper, N a and Sternberg, P W},
doi = {10.1093/emboj/19.13.3283},
isbn = {0261-4189 (Print)$\backslash$n0261-4189 (Linking)},
issn = {0261-4189},
journal = {The EMBO journal},
keywords = {Alleles,Amino Acid,Amino Acid Sequence,Animals,Base Sequence,Caenorhabditis elegans,Caenorhabditis elegans: embryology,Caenorhabditis elegans: genetics,DNA Primers,Double-Stranded,Double-Stranded: administration {\&} dosage,Female,Fibroblast Growth Factor,Fibroblast Growth Factor: metabolism,GTPase-Activating Proteins,GTPase-Activating Proteins: metabolism,Ligands,Molecular Sequence Data,Phenotype,RNA,Receptors,SOS1 Protein,SOS1 Protein: genetics,SOS1 Protein: physiology,Sequence Homology,Signal Transduction,Vulva,Vulva: embryology,Vulva: metabolism,ras Proteins,ras Proteins: metabolism},
number = {13},
pages = {3283--94},
pmid = {10880441},
title = {{Caenorhabditis elegans SOS-1 is necessary for multiple RAS-mediated developmental signals.}},
volume = {19},
year = {2000}
}

@article{Schutzman2001,
abstract = {EGL-15 is a fibroblast growth factor receptor in the nematode  \emph{Caenorhabditis~elegans}  . Components that mediate EGL-15 signaling have been identified via mutations that confer a Clear (Clr) phenotype, indicative of hyperactivity of this pathway, or a suppressor-of-Clr (Soc) phenotype, indicative of reduced pathway activity. We have isolated a gain-of-function allele of let-60 ras that confers a Clr phenotype and implicated both let-60 ras and components of a mitogen-activated protein kinase cascade in EGL-15 signaling by their Soc phenotype. Epistasis analysis indicates that the gene soc-1 functions in EGL-15 signaling by acting either upstream of or independently of LET-60 RAS. soc-1 encodes a multisubstrate adaptor protein with an amino-terminal pleckstrin homology domain that is structurally similar to the DOS protein in Drosophila and mammalian GAB1. DOS is known to act with the cytoplasmic tyrosine phosphatase Corkscrew (CSW) in signaling pathways in Drosophila. Similarly, the \emph{C.~elegans}  CSW ortholog PTP-2 was found to be involved in EGL-15 signaling. Structure-function analysis of SOC-1 and phenotypic analysis of single and double mutants are consistent with a model in which SOC-1 and PTP-2 act together in a pathway downstream of EGL-15 and the Src homology domain 2 (SH2)/SH3-adaptor protein SEM-5/GRB2 contributes to SOC-1-independent activities of EGL-15.},
author = {Schutzman, J L and Borland, C Z and Newman, J C and Robinson, M K and Kokel, M and Stern, M J},
doi = {10.1128/MCB.21.23.8104-8116.2001},
file = {:Users/dangeles/Documents/Mendeley Desktop/Schutzman et al. - 2001 - The  \emph{Caenorhabditis~elegans} EGL-15 signaling pathway implicates a DOS-like multisubstrate adaptor protein in(2).pdf:pdf},
issn = {0270-7306},
journal = {Molecular and cellular biology},
month = {dec},
number = {23},
pages = {8104--16},
pmid = {11689700},
publisher = {American Society for Microbiology},
title = {{The  \emph{Caenorhabditis~elegans} EGL-15 signaling pathway implicates a DOS-like multisubstrate adaptor protein in fibroblast growth factor signal transduction.}},
volume = {21},
year = {2001}
}

@article{Howell2010,
author = {Howell, Kelly and Arur, Swathi and Schedl, Tim and Sundaram, Meera V.},
journal = {Genetics},
number = {4},
title = {{EOR-2 Is an Obligate Binding Partner of the BTB–Zinc Finger Protein EOR-1 in  \emph{Caenorhabditis~elegans}  }},
volume = {184},
year = {2010}
}

@article{Yochem1997,
abstract = {Experiments with mammalian tissue culture cells have implicated the small GTPase Ras in the control of cellular proliferation. Evidence is presented here that this is not the case for a living animal, the nematode  \emph{Caenorhabditis~elegans}  : proliferation late in embryogenesis and throughout the four larval stages is not noticeably affected in animals lacking Ras in various parts of their cell lineages. Instead, genetic mosaic analysis of the let-60 gene suggests that Ras is required only, at least later in development (a maternal effect cannot be excluded), for establishment of a few temporally and spatially distinct cell fates. Only one of these, the duct cell fate, appears to be essential for viability.},
author = {Yochem, J and Sundaram, M and Han, M},
isbn = {0270-7306},
issn = {0270-7306},
journal = {Molecular and cellular biology},
keywords = {Animals,Caenorhabditis elegans,Caenorhabditis elegans Proteins,Caenorhabditis elegans: cytology,Caenorhabditis elegans: embryology,Cell Division,Cell Survival,Helminth Proteins,Helminth Proteins: genetics,Helminth Proteins: physiology,Models, Biological,Mosaicism,ras Proteins,ras Proteins: physiology},
number = {5},
pages = {2716--22},
pmid = {9111342},
title = {{Ras is required for a limited number of cell fates and not for general proliferation in  \emph{Caenorhabditis~elegans}  .}},
volume = {17},
year = {1997}
}

@article{Ohmachi2002,
author = {Ohmachi, Mitsue and Rocheleau, Christian E and Church, Diane and Lambie, Eric and Schedl, Tim and Sundaram, Meera V},
doi = {10.1016/S0960-9822(02)00690-5},
issn = {09609822},
journal = {Current Biology},
month = {mar},
number = {5},
pages = {427--433},
title = {{\emph{C.~elegans} ksr-1 and ksr-2 Have Both Unique and Redundant Functions and Are Required for MPK-1 ERK Phosphorylation}},
volume = {12},
year = {2002}
}

@article{Inouye2000,
abstract = {Although it is well established that Ras requires membrane localization for activation of its target molecule, Raf-1, the reason for this requirement is not fully understood. In this study, we found that modified Ras, which is purified from Sf9 cells, could activate Raf-1 in a cell-free system, when incorporated into liposome. Using a bifunctional cross-linker and a protein-fragmentation complementation assay, we detected dimer formation of Ras in the liposome and in the intact cells, respectively. These results suggest that dimerization of Ras in the lipid membrane is essential for activation of Raf-1. To support this, we found that, when fused to glutathione S-transferase (GST), unprocessed Ras expressed in Escherichia coli could bypass the requirement for liposome. A Ras-dependent Raf-1 activator, which we previously reported (Mizutani, S., Koide, H., and Kaziro, Y. (1998) Oncogene 16, 2781-2786), was still required for Raf-1 activation by GST-Ras. Furthermore, an enforced dimerization of unmodified oncogenic Ras mutant in human embryonic kidney (HEK) 293 cells, using a portion of gyrase B or estrogen receptor, also resulted in activation of Raf-1. From these results, we conclude that membrane localization allows Ras to form a dimer, which is essential, although not sufficient, for Raf-1 activation.},
author = {Inouye, K and Mizutani, S and Koide, H and Kaziro, Y},
doi = {10.1074/JBC.275.6.3737},
file = {:Users/dangeles/Documents/Mendeley Desktop/Inouye et al. - 2000 - Formation of the Ras dimer is essential for Raf-1 activation.pdf:pdf},
issn = {0021-9258},
journal = {The Journal of biological chemistry},
month = {Feb},
number = {6},
pages = {3737--40},
pmid = {10660519},
publisher = {American Society for Biochemistry and Molecular Biology},
title = {{Formation of the Ras dimer is essential for Raf-1 activation.}},
volume = {275},
year = {2000}
}

@article{Wu1994a,
abstract = {The let-60 ras gene of  \emph{Caenorhabditis~elegans} is one of the key players in a signal transduction pathway that controls the choice between vulval and epidermal differentiation in response to extracellular signals. To identify components acting downstream of let-60 ras in the vulval signaling pathway, we have identified a reduction-of-function mutation in the sur-1 gene that completely suppresses the multivulva phenotype of a hyperactive let-60 ras mutation. About 10{\%} of animals homozygous for the sur-1 mutation also display a specific and intriguing vulval cell lineage defect. In addition, the sur-1 mutation results in a cold-sensitive egg-laying defective phenotype and a partial larval lethal phenotype. We have cloned the sur-1 gene by DNA-mediated transformation and have shown that it encodes a protein similar in overall structure to mammalian MAP kinases (ERKs). The functional homology between Sur-1 MAP kinase and mammalian MAP kinases was also demonstrated by the ability of a rat ERK2 kinase to rescue the sur-1 mutant phenotypes. Genetic double-mutant analyses place sur-1 downstream of let-60 ras but upstream of lin-1 in the vulval signaling pathway. Our results provide further evidence for the extreme conservation of Ras-mediated signaling pathway between worms and humans and for the function of MAP kinases in cell signaling processes that control cell differentiation and animal development.},
author = {Wu, Yan and Han, Min},
doi = {10.1101/gad.8.2.147},
isbn = {0890-9369 (Print)},
issn = {08909369},
journal = {Genes and Development},
keywords = {C. elegans,MAP kinase,ras,signal transduction,sur-1,vulval development},
number = {2},
pages = {147--159},
pmid = {8299935},
title = {{Suppression of activated let-60 ras protein defines a role of  \emph{Caenorhabditis~elegans} sur-1 MAP kinase in vulval differentiation}},
volume = {8},
year = {1994}
}

@article{Ceol2006,
author = {Ceol, Craig J. and Stegmeier, Frank and Harrison, Melissa M. and Horvitz, H. Robert},
journal = {Genetics},
number = {2},
title = {{Identification and Classification of Genes That Act Antagonistically to let-60 Ras Signaling in  \emph{Caenorhabditis~elegans} Vulval Development}},
volume = {173},
year = {2006}
}

@article{Shemer2000,
abstract = {Directed cell rearrangements occur during gastrulation, neurulation, and organ formation. Despite the identification of developmental processes in which invagination is a critical component of pattern formation, little is known regarding the underlying cellular and molecular details.  \emph{Caenorhabditis~elegans} vulval epithelial cells undergo morphological changes that generate an invagination through the formation of seven stacked rings. Here, we study the dynamics of ring formation during multivulva morphogenesis of a let-60/ras gain-of-function mutant as a model system to explore the cellular mechanisms that drive invagination. The behavior of individual cells was analyzed in a let-60/ras mutant by three-dimensional confocal microscopy. We showed that stereotyped cell fusion events occur within the rings that form functional and nonfunctional vulvae in a let-60/ras mutant. Expression of let-60/ras gain-of-function results in abnormal cell migration, ectopic cell fusion, and structural fate transformation. Within each developing vulva the anterior and posterior halves develop autonomously. Contrary to prevailing hypotheses which proposed three cell fates (1°, 2°, and 3°), we found that each of the seven rings is a product of a discrete structural pathway that is derived from arrays of seven distinct cell fates (A, B, C, D, E, F, and H). We have also shown how autonomous ring formation is the morphogenetic force that drives invagination of the vulva.},
author = {Shemer, Gidi and Kishore, Ranjana and Podbilewicz, Benjamin},
doi = {10.1006/dbio.2000.9657},
issn = {00121606},
journal = {Developmental Biology},
number = {1},
pages = {233--248},
title = {{Ring Formation Drives Invagination of the Vulva in  \emph{Caenorhabditis~elegans}  : Ras, Cell Fusion, and Cell Migration Determine Structural Fates}},
volume = {221},
year = {2000}
}

@article{Chen1997,
abstract = {The migrations of the sex myoblasts inCaenorhabditis eleganshermaphrodites involve two guidance mechanisms: a gonad-dependent attraction that confers precise positioning of the sex myoblasts and a gonad-independent mechanism that is sufficient for coarse positioning in the absence of the gonad (Thomaset al.,1990). Here we show that mutations inunc-53, unc-71,andunc-73disrupt sex myoblast positioning in the absence of the gonad, while they do not affect positioning in the presence of the gonad. Thus, mutations in these genes appear to compromise the gonad-independent mechanism without affecting motility or the gonad-dependent attraction. Mutations insem-5confer dramatic sex myoblast positioning defects in double mutant combinations withunc-53, unc-71,orunc-73mutations, even in the presence of the gonad. This suggests thatsem-5is required for the gonad-dependent attractive mechanism. Mutations inlet-60 rasandlet-341also confer sex myoblast migration defects in anunc-53background, implicating these genes in gonad-dependent positioning as well.},
author = {Chen, Estella B. and Branda, Catherine S. and Stern, Michael J.},
doi = {10.1006/dbio.1996.8473},
issn = {00121606},
journal = {Developmental Biology},
number = {1},
pages = {88--100},
title = {{Genetic Enhancers of sem-5 Define Components of the Gonad-Independent Guidance Mechanism Controlling Sex Myoblast Migration in  \emph{Caenorhabditis~elegans} Hermaphrodites}},
volume = {182},
year = {1997}
}

@article{Nakdimon2012,
author = {Nakdimon, Itay and Walser, Michael and Fr{\"{o}}hli, Erika and Hajnal, Alex and Durbin, R},
doi = {10.1371/journal.pgen.1002881},
editor = {Kim, Stuart K.},
file = {:Users/dangeles/Documents/Mendeley Desktop/Nakdimon et al. - 2012 - PTEN Negatively Regulates MAPK Signaling during  \emph{Caenorhabditis~elegans} Vulval Development.pdf:pdf},
issn = {1553-7404},
journal = {PLoS Genetics},
month = {aug},
number = {8},
pages = {e1002881},
publisher = {Public Library of Science},
title = {{PTEN Negatively Regulates MAPK Signaling during  \emph{Caenorhabditis~elegans} Vulval Development}},
volume = {8},
year = {2012}
}

@article{Sundaram2006,
abstract = {Receptor Tyrosine Kinase (RTK)/Ras GTPase/MAP kinase (MAPK) signaling pathways are used repeatedly during metazoan development to control many different biological processes. In the nematode  \emph{Caenorhabditis~elegans}  , two different RTKs (LET-23/EGFR and EGL-15/FGFR) are known to stimulate LET-60/Ras and a MAPK cascade consisting of the kinases LIN-45/Raf, MEK-2/MEK and MPK-1/ERK. This Ras/MAPK cascade is required for multiple developmental events, including induction of vulval, uterine, spicule, P12 and excretory duct cell fates, control of sex myoblast migration and axon guidance, and promotion of germline meiosis. Studies in \emph{C.~elegans}  have provided much insight into the basic framework of this RTK/Ras/MAPK signaling pathway, its regulation, how it elicits cell-type specific responses, and how it interacts with other signaling pathways such as the Wnt and Notch pathways.},
author = {Sundaram, Meera},
doi = {10.1895/wormbook.1.80.1},
isbn = {1551-8507 (Electronic)},
issn = {15518507},
journal = {WormBook},
pmid = {18050474},
title = {{RTK/Ras/MAPK signaling}},
year = {2006}
}

@article{Han1993,
abstract = {Vulval differentiation in  \emph{Caenorhabditis~elegans} is controlled by intercellular signalling mediated by a receptor tyrosine kinase and a ras gene product. The lin-45 gene encodes a homologue of the raf family of serine/threonine kinases and is necessary for vulval differentiation. The lin-45 raf gene product appears to act downstream of the ras protein in this pathway. A proto-oncogene-mediated signalling pathway may be a common feature of metazoan development.},
author = {Han, Min and Golden, Andy and Han, Yuming and Sternberg, Paul W.},
doi = {10.1038/363133a0},
isbn = {0028-0836 (Print)$\backslash$r0028-0836 (Linking)},
issn = {0028-0836},
journal = {Nature},
month = {may},
number = {6425},
pages = {133--140},
pmid = {8483497},
publisher = {Nature Publishing Group},
title = {{\emph{C.~elegans} lin-45 raf gene participates in let-60 ras-stimulated vulval differentiation}},
volume = {363},
year = {1993}
}

@article{Gu1998a,
abstract = {The let-60 ras gene acts in a signal transduction pathway to control vulval differentiation in  \emph{Caenorhabditis~elegans}  . By screening suppressors of a dominant negative let-60 ras allele, we isolated three loss-of-function mutations in the sur-5 gene which appear to act as negative regulators of let-60 ras during vulval induction. sur-5 mutations do not cause an obvious mutant phenotype of their own, and they appear to specifically suppress only one of the two groups of let-60 ras dominant negative mutations, suggesting that the gene may be involved in a specific aspect of Ras activation. Consistent with its negative function, overexpressing sur-5 from an extragenic array partially suppresses the Multivulva phenotype of an activated let-60 ras mutation and causes synergistic phenotypes with a lin-45 raf mutation. We have cloned sur-5 and shown that it encodes a novel protein. We have also identified a potential mammalian SUR-5 homolog that is about 35{\%} identical to the worm protein. SUR-5 also has some sequence similarity to acetyl coenzyme A synthetases and is predicted to contain ATP/GTP and AMP binding sites. Our results suggest that sur-5 gene function may be conserved through evolution.},
author = {Gu, T and Orita, S and Han, M},
doi = {10.1128/MCB.18.8.4556},
isbn = {0270-7306 (Print)},
issn = {0270-7306},
journal = {Molecular and cellular biology},
number = {8},
pages = {4556--4564},
pmid = {9671465},
title = {{Caenorhabditis elegans SUR-5, a novel but conserved protein, negatively regulates LET-60 Ras activity during vulval induction.}},
volume = {18},
year = {1998}
}

@article{Parry2014,
author = {Parry, Jean M. and Sundaram, Meera V.},
journal = {Development},
number = {22},
title = {{A non-cell-autonomous role for Ras signaling in \emph{C.~elegans}  neuroblast delamination}},
volume = {141},
year = {2014}
}

@article{Iino2000,
author = {Iino, Yuichi and Hirotsu, Takaaki and Saeki, Satoshi and Yamamoto, Masayuki},
doi = {10.1038/35005101},
issn = {00280836},
journal = {Nature},
month = {mar},
number = {6775},
pages = {289--293},
publisher = {Nature Publishing Group},
title = {{The Ras-MAPK pathway is important for olfaction in Caenorhabditis
elegans}},
volume = {404},
year = {2000}
}

@article{Han1990a,
abstract = {Genetic analysis previously suggested that the let-60 gene controls the switch between vulval and hypodermal cell fates during \emph{C.~elegans}  vulval induction. We have cloned the let-60 gene, and shown that it encodes a gene product identical in 84{\%} of its first 164 amino acids to ras gene products from other vertebrate and invertebrate species. This conservation suggests that the let-60 product contains all the biochemical functions of ras proteins. Extrachromosomal arrays of let-60 ras DNA cause cell-type misspecification (extra vulval fates) phenotypically opposite to that caused by let-60 ras loss-of-function mutations (no vulval fates), and suppress the vulvaless phenotype of mutations in two other genes necessary for vulval induction. Thus, the level and pattern of let-60 ras expression may be under strict regulation; increase in let-60 ras activity bypasses or reduces the need for upstream genes in the vulval induction pathway. ? 1990.},
author = {Han, Min and Sternberg, Paul W.},
doi = {10.1016/0092-8674(90)90495-Z},
isbn = {0092-8674 (Print)},
issn = {00928674},
journal = {Cell},
month = {nov},
number = {5},
pages = {921--931},
pmid = {2257629},
title = {{let-60, a gene that specifies cell fates during \emph{C.~elegans}  vulval induction, encodes a ras protein}},
volume = {63},
year = {1990}
}

@article{Eastburn2005,
abstract = {An RTK-Ras-mitogen-activated protein kinase (MAPK) signaling pathway plays a key role in vulval induction in  \emph{Caenorhabditis~elegans}  . We have previously carried out screens for suppressors of activated Ras to identify factors that play critical roles in the regulation of the pathway. ku258 was isolated as a semidominant allele that suppresses the Multivulva phenotype caused by activated let-60 ras. Our genetic and molecular analyses indicate that ku258 is a gain-of-function allele resulting from two point mutations in the \emph{C.~elegans}  homolog of the transcriptional coactivator p300/CBP, cbp-1. Genetic data also suggest that cbp-1 may act downstream of the Ras signaling pathway, but not primarily downstream of the Wnt signaling pathway, to negatively regulate vulval cell fate specification. cbp-1 may function in concert with LIN-1, an Ets transcription factor family member that is one of the targets of MAPK. In vitro histone acetylation assays have revealed that together, the two point mutations cause a sevenfold increase in the histone acetyltransferase (HAT) activity of recombinant CBP-1. To our knowledge, this is the only such HAT activity mutation isolated in a CBP/p300 family protein, and this mutation may define a negative role of the HAT activity in antagonizing Ras function in a specific developmental event.},
author = {Eastburn, Dennis J and Han, Min},
doi = {10.1128/MCB.25.21.9427-9434.2005},
file = {:Users/dangeles/Documents/Mendeley Desktop/Eastburn, Han - 2005 - A gain-of-function allele of cbp-1, the  \emph{Caenorhabditis~elegans} ortholog of the mammalian CBPp300 gene, causes an.pdf:pdf},
issn = {0270-7306},
journal = {Molecular and cellular biology},
month = {nov},
number = {21},
pages = {9427--34},
pmid = {16227593},
publisher = {American Society for Microbiology},
title = {{A gain-of-function allele of cbp-1, the  \emph{Caenorhabditis~elegans} ortholog of the mammalian CBP/p300 gene, causes an increase in histone acetyltransferase activity and antagonism of activated Ras.}},
volume = {25},
year = {2005}
}

@article{Singh1995,
abstract = {We describe here a new gene acting downstream of let-60 ras in the vulval signaling pathway of  \emph{Caenorhabditis~elegans}  . The sur-2 (suppressor of ras) gene is defined by eight mutations identified in a genetic screen for suppressors of the Multivulva phenotype of let-60(n1046), an activated let-60 ras mutation. sur-2 mutations result in pleiotropic, incompletely penetrant phenotypes that include a Vulvaless phenotype in hermaphrodites, defects in development of the male tail, gonadal abnormalities, and larval lethality, indicating a role for the sur-2 gene product in multiple developmental events. Genetic epistasis analyses suggest that sur-2 is required late in the vulval signaling pathway, downstream of let-60 Ras, and is likely to act downstream of the Raf/MAP Kinase cascade. We cloned the sur-2 gene by DNA-mediated transformation and have shown that it encodes a novel protein. We also show that a sur-2::lacZ transgene is expressed in the vulval precursor cells at the time of vulval determination.},
author = {Singh, N and Han, M},
doi = {10.1101/GAD.9.18.2251},
file = {:Users/dangeles/Documents/Mendeley Desktop/Singh, Han - 1995 - sur-2, a novel gene, functions late in the let-60 ras-mediated signaling pathway during  \emph{Caenorhabditis~elegans} vulva.pdf:pdf},
issn = {0890-9369},
journal = {Genes {\&} development},
month = {sep},
number = {18},
pages = {2251--65},
pmid = {7557379},
publisher = {Cold Spring Harbor Laboratory Press},
title = {{sur-2, a novel gene, functions late in the let-60 ras-mediated signaling pathway during  \emph{Caenorhabditis~elegans} vulval induction.}},
volume = {9},
year = {1995}
}

@article{Lackner1994,
abstract = {During development of the  \emph{Caenorhabditis~elegans} hermaphrodite, the gonadal anchor cell induces nearby Pn.p cells to adopt vulval fates. The response to this signal is mediated by a receptor tyrosine kinase signal transduction pathway that has been remarkably well conserved during metazoan evolution. Because mitogen-activated protein (MAP) kinases are activated by receptor tyrosine kinase pathways in vertebrate cells, we hypothesized that \emph{C.~elegans}  MAP kinase homologs may play a role in vulval induction. Two \emph{C.~elegans}  MAP kinase genes, mpk-1 and mpk-2 (mpk, MAP kinase), were cloned using degenerate oligonucleotide primers and PCR amplification; in parallel, genes involved in vulval induction were identified by screening for mutations that suppress the vulval defects caused by an activated let-60 ras gene. One such suppressor mutation is an allele of mpk-1. We used a new type of mosaic analysis to show that mpk-1 acts cell autonomously in the Pn.p cells. Our results show that mpk-1 plays an important functional role as an activator in ras-mediated cell signaling in vivo.},
author = {Lackner, Mark R. and Kornfeld, Kerry and Miller, Leilani M. and {Robert Horvitz}, H. and Kim, Stuart K.},
doi = {10.1101/gad.8.2.160},
isbn = {0890-9369 (Print)},
issn = {08909369},
journal = {Genes and Development},
keywords = {Caenorhabditis elegans,ERK,MAP kinase,Ras,mpk-1,vulval development},
number = {2},
pages = {160--173},
pmid = {8299936},
title = {{A MAP kinase homolog, mpk-1, is involved in ras-mediated induction of vulval cell fates in  \emph{Caenorhabditis~elegans}  }},
volume = {8},
year = {1994}
}
@misc{Beitel1990,
abstract = {The  \emph{Caenorhabditis~elegans} locus lin-15 negatively regulates an intercellular signaling process that induces formation of the hermaphrodite vulva. The lin-15 locus controls two separate genetic activities. Mutants that lack both activities have multiple, ectopic pseudo-vulvae resulting from the overproduction of vulval cells, whereas mutants defective in only one lin-15 activity appear wild-type. lin-15 acts non-cell-autonomously to prevent the activation of a receptor tyrosine kinase/ras signaling pathway. We report here the molecular characterization of the lin-15 locus. The two lin-15 activities are encoded by contiguous genomic regions and by two distinct, non-overlapping transcripts that may be processed from a single mRNA precursor by trans-splicing. Based on the DNA sequence, the 719- and 1,440-amino acid lin-15 proteins are not similar to each other or to known proteins. lin-15 multivulva mutants, which are defective in both lin-15 activities, contain deletions and insertions that affect the lin-15 genomic region.},
author = {Clark, S. G. and Lu, X. and Horvitz, H. R.},
booktitle = {Genetics},
doi = {10.1038/348503a0},
isbn = {0016-6731 (Print)$\backslash$r0016-6731 (Linking)},
issn = {00166731},
number = {4},
pages = {987--997},
pmid = {7982579},
title = {{The  \emph{Caenorhabditis~elegans} locus lin-15, a negative regulator of a tyrosine kinase signaling pathway, encodes two different proteins}},
volume = {137},
year = {1994}
}
@article{Sundaram1995,
abstract = {Vulval induction in \emph{C.~elegans}  is controlled by a highly conserved signaling pathway similar to the RTK-RasMAPKcascade in mammals. By screening forsuppressors of the Multivulva phenotype caused by an activated let-60 ras allele, we isolated mutations in a gene, ksr-1, that acts as a positive modifier of vulval induction and is required for at least two other let-60 ras-mediated processes. Although ksr-1 mutations do not perturb vulval induction in an otherwise wild-type background, they have very strong effects on vulval induction in genetic backgrounds where Ras pathway activity is constitutively activated or compromised, suggesting that ksr-1 activity is required for maximal stimulation of vulval fates by the Ras pathway. Genetic epistasis analysis suggests that ksr-1 acts downstream of or in parallel to let-60 ras. We cloned ksr-1 and have shown that it encodes a novel putative protein kinase related to the Raf family of Ser/The kinases. ?? 1995.},
author = {Sundaram, Meera and Han, Min},
doi = {10.1016/0092-8674(95)90205-8},
isbn = {0092-8674 (Print)},
issn = {00928674},
journal = {Cell},
month = {dec},
number = {6},
pages = {889--901},
pmid = {8521513},
title = {{The \emph{C.~elegans}  ksr-1 gene encodes a novel raf-related kinase involved in Ras-mediated signal transduction}},

volume = {83},
year = {1995}
}
@article{Kim1995,
abstract = {Proteins that define a new family, termed membrane-associated guanylate kinases, have recently been identified as structural components of epithelial tight junctions and neuronal synapses, and as cell signaling proteins in Drosophila and  \emph{Caenorhabditis~elegans}  . In particular, the lin-2 gene has been shown to encode a membrane-associated guanylate kinase and to act in the let-23 receptor tyrosine kinase/let-60 ras signaling pathway that controls vulval induction in \emph{C.~elegans} . The combined data from recent biochemical and genetic analyses of membrane-associated guanylate kinases suggest that certain tight junction proteins can play an important role in cell signaling pathways. One possibility is that asymmetric segregation of signaling receptors to the basolateral membrane domain of polarized epithelial cells is crucial for proper cell signaling, and that membrane-associated guanylate kinases may be required for this localization. ?? 1995.},
author = {Kim, Stuart K.},
doi = {10.1016/0955-0674(95)80105-7},
issn = {09550674},
journal = {Current Opinion in Cell Biology},
number = {5},
pages = {641--649},
pmid = {8573338},
title = {{Tight junctions, membrane-associated guanylate kinases and cell signaling}},
volume = {7},
year = {1995}
}
@article{Beitel1990a,
author = {Beitel, Greg J. and Clark, Scott G. and Horvitz, H. Robert},
doi = {10.1038/348503a0},
issn = {0028-0836},
journal = {Nature},
month = {dec},
number = {6301},
pages = {503--509},
publisher = {Nature Publishing Group},
title = {{\emph{Caenorhabditis~elegans} ras gene \emph{let-60} acts as a switch in the pathway of vulval induction}},
volume = {348},
year = {1990}
}

@article{Lopez2013,
abstract = {Coupling the production of mature gametes and fertilized zygotes to favorable nutritional conditions improves reproductive success. In invertebrates, the proliferation of female germline stem cells is regulated by nutritional status. However, in mammals, the number of female germline stem cells is set early in development, with oocytes progressing through meiosis later in life. Mechanisms that couple later steps of oogenesis to environmental conditions remain largely undefined. We show that, in the presence of food, the DAF-2 insulin-like receptor signals through the RAS-ERK pathway to drive meiotic prophase I progression and oogenesis; in the absence of food, the resultant inactivation of insulin-like signaling leads to downregulation of the RAS-ERK pathway, and oogenesis is stalled. Thus, the insulin-like signaling pathway couples nutrient sensing to meiotic I progression and oocyte production in C. elegans, ensuring that oocytes are only produced under conditions favorable for the survival of the resulting zygotes.},
author = {Lopez, Andrew L. and Chen, Jessica and Joo, Hyoe-Jin and Drake, Melanie and Shidate, Miri and Kseib, Cedric and Arur, Swathi},
doi = {10.1016/j.devcel.2013.09.008},
issn = {15345807},
journal = {Developmental Cell},
number = {2},
pages = {227--240},
title = {{DAF-2 and ERK Couple Nutrient Availability to Meiotic Progression during  \emph{Caenorhabditis~elegans} Oogenesis}},
volume = {27},
year = {2013}
}

@article{Tiensuu2005,
abstract = {lin-1 encodes an ETS domain transcription factor that functions downstream of a Ras/MAP kinase pathway mediating induction of the 1° cell fate during vulval development in the \emph{C.~elegans}  hermaphrodite. Mutants lacking lin-1 activity display a phenotype similar to that caused by mutations that constitutively activate let-60 Ras consistent with a model in which lin-1 is a repressor of the 1° fate whose activity is inhibited by phosphorylation by MPK-1 MAP kinase. Here, we show that, contrary the current model, lin-1 is required positively for the proper expression of several genes regulated by the pathway in cells adopting the 1° cell fate. We show that the positive requirement for lin-1 is downstream of let-60 Ras and mpk-1 MAP kinase, and that it has a focus in the vulval precursor cells themselves. lin-1 alleles encoding proteins lacking a docking site for MPK-1 MAP kinase are defective in the positive function. We also show that lin-1 apparently has both positive and negative functions during the specification of the fates of other cells in the worm requiring Ras/MAP kinase signaling.},
author = {Tiensuu, Teresa and Larsen, Morten Krog and Vernersson, Emma and Tuck, Simon},
doi = {10.1016/j.ydbio.2005.08.007},
issn = {00121606},
journal = {Developmental Biology},
number = {1},
pages = {338--351},
title = {{lin-1 has both positive and negative functions in specifying multiple cell fates induced by Ras/MAP kinase signaling in \emph{C.~elegans} }},
volume = {286},
year = {2005}
}

@article{Yoon1995,
abstract = {Vulval induction during  \emph{Caenorhabditis~elegans} development is mediated by LET-23, a homolog of the mammalian epidermal growth factor receptor tyrosine kinase. The sli-1 gene is a negative regulator of LET-23 and is shown here to encode a protein similar to c-Cbl, a mammalian proto-oncoprotein. SLI-1 and c-Cbl share approximately 55 percent amino acid identity over a stretch of 390 residues, which includes a C3HC4 zinc-binding motif known as the RING finger, and multiple consensus binding sites for Src homology 3 (SH3) domains. SLI-1 and c-Cbl may define a new class of proteins that modify receptor tyrosine kinase-mediated signal transduction.},
author = {Yoon, C H and Lee, J and Jongeward, G D and Sternberg, P W and Giardina, G. and Gutkind, S. and Bjarnegard, M. and Betsholtz, C. and Fiore, PP. Di},
doi = {10.1126/SCIENCE.7652556},
file = {:Users/dangeles/Documents/Mendeley Desktop/Yoon et al. - 1995 - Similarity of sli-1, a regulator of vulval development in \emph{C.~elegans} , to the mammalian proto-oncogene c-cbl.pdf:pdf},
issn = {0036-8075},
journal = {Science (New York, N.Y.)},
month = {aug},
number = {5227},
pages = {1102--5},
pmid = {7652556},
publisher = {EMBO Press},
title = {{Similarity of sli-1, a regulator of vulval development in \emph{C.~elegans} , to the mammalian proto-oncogene c-cbl.}},
volume = {269},
year = {1995}
}

@article{Villani2017,
abstract = {Dendritic cells (DCs) and monocytes play a central role in pathogen sensing, phagocytosis, and antigen presentation and consist of multiple specialized subtypes. However, their identities and interrelationships are not fully understood. Using unbiased single-cell RNA sequencing (RNA-seq) of {\~{}}2400 cells, we identified six human DCs and four monocyte subtypes in human blood. Our study reveals a new DC subset that shares properties with plasmacytoid DCs (pDCs) but potently activates T cells, thus redefining pDCs; a new subdivision within the CD1C(+) subset of DCs; the relationship between blastic plasmacytoid DC neoplasia cells and healthy DCs; and circulating progenitor of conventional DCs (cDCs). Our revised taxonomy will enable more accurate functional and developmental analyses as well as immune monitoring in health and disease.},
author = {Villani, Alexandra-Chlo{\'{e}} and Satija, Rahul and Reynolds, Gary and Sarkizova, Siranush and Shekhar, Karthik and Fletcher, James and Griesbeck, Morgane and Butler, Andrew and Zheng, Shiwei and Lazo, Suzan and Jardine, Laura and Dixon, David and Stephenson, Emily and Nilsson, Emil and Grundberg, Ida and McDonald, David and Filby, Andrew and Li, Weibo and {De Jager}, Philip L. and Rozenblatt-Rosen, Orit and Lane, Andrew A. and Haniffa, Muzlifah and Regev, Aviv and Hacohen, Nir},
doi = {10.1126/science.aah4573},
issn = {0036-8075},
journal = {Science},
number = {6335},
pmid = {28428369},
title = {{Single-cell RNA-seq reveals new types of human blood dendritic cells, monocytes, and progenitors}},
volume = {356},
year = {2017}
}

@article{Kornfeld1995,
abstract = {By screening for mutations that suppress the vulval defects caused by a constitutively active let-60 ras gene, we identified six loss-of-function al leles of ksr-1, a novel \emph{C.~elegans}  gene. Our genetic analysis showed ksr-1 positively mediates Ras signaling and functions downstream of or in parallel to let-60. In the absence of ksr-1 function, normal Ras signaling is impaired only slightly, suggesting ksr-1 may act to modulate, or in a branch that diverges from, the main signaling pathway. The predicted KSR-1 protein has a protein kinase domain and is most similar to a recently identified Drosophila protein involved in Ras signaling. We propose that the function of ksr-1 is evolutionarily conserved.},
author = {Kornfeld, Kerry and Hom, Dennis B. and Horvitz, H.Robert},
doi = {10.1016/0092-8674(95)90206-6},
issn = {00928674},
journal = {Cell},
month = {dec},
number = {6},
pages = {903--913},
pmid = {8521514},
title = {{The ksr-1 gene encodes a novel protein kinase involved in Ras-mediated signaling in \emph{C.~elegans} }},
volume = {83},
year = {1995}
}

@article{Lin2014,
abstract = {The lipid-anchored small GTPase Ras is an important signaling node in mammalian cells. A number of observations suggest that Ras is laterally organized within the cell membrane, and this may play a regulatory role in its activation. Lipid anchors composed of palmitoyl and farnesyl moieties in H-, N-, and K-Ras are widely suspected to be responsible for guiding protein organization in membranes. Here, we report that H-Ras forms a dimer on membrane surfaces through a protein-protein binding interface. A Y64A point mutation in the switch II region, known to prevent Son of sevenless and PI3K effector interactions, abolishes dimer formation. This suggests that the switch II region, near the nucleotide binding cleft, is either part of, or allosterically coupled to, the dimer interface. By tethering H-Ras to bilayers via a membrane-miscible lipid tail, we show that dimer formation is mediated by protein interactions and does not require lipid anchor clustering. We quantitatively characterize H-Ras dimerization in supported membranes using a combination of fluorescence correlation spectroscopy, photon counting histogram analysis, time-resolved fluorescence anisotropy, single-molecule tracking, and step photobleaching analysis. The 2D dimerization Kd is measured to be ∼1 × 10(3) molecules/µm(2), and no higher-order oligomers were observed. Dimerization only occurs on the membrane surface; H-Ras is strictly monomeric at comparable densities in solution. Analysis of a number of H-Ras constructs, including key changes to the lipidation pattern of the hypervariable region, suggest that dimerization is a general property of native H-Ras on membrane surfaces.},
author = {Lin, Wan-Chen and Iversen, Lars and Tu, Hsiung-Lin and Rhodes, Christopher and Christensen, Sune M and Iwig, Jeffrey S and Hansen, Scott D and Huang, William Y C and Groves, Jay T},
doi = {10.1073/pnas.1321155111},
file = {:Users/dangeles/Documents/Mendeley Desktop/Lin et al. - 2014 - H-Ras forms dimers on membrane surfaces via a protein-protein interface.pdf:pdf},
issn = {1091-6490},
journal = {Proceedings of the National Academy of Sciences of the United States of America},
keywords = {Ras assay,Ras signaling},
month = {Feb},
number = {8},
pages = {2996--3001},
pmid = {24516166},
publisher = {National Academy of Sciences},
title = {{H-Ras forms dimers on membrane surfaces via a protein-protein interface.}},
volume = {111},
year = {2014}
}

license: MIT

license_type: permissive

branch_name: refs/heads/master

gha_license_id: MIT

extension: bib


text:
package capi

import "fmt"

type CDA struct {
	Api string
	client
}

func NewCDA(config Config) CDA {
	bearer := fmt.Sprintf("Bearer %s", config.AccessToken)
	var cda CDA
	cda.SpaceID = config.SpaceID
	cda.AccessToken = config.AccessToken
	cda.Environment = config.Environment
	cda.OrganisationID = config.OrganisationID
	cda.baseUrl = "https://cdn.contentful.com"
	cda.Api = "CDA"

	cda.client.addHeader("Authorization", bearer)
	return cda
}

repository: coffeepunk/capi

repo_name: coffeepunk/capi

extension: go


text:
package _0658

import (
	. "github.com/godcong/leetcode/common"
)

func findClosestElements(arr []int, k int, x int) []int {

}

repository: godcong/leetcode

repo_name: godcong/leetcode

gha_language: Go


text:
package wapc_test

import (
	"context"
	"io/ioutil"
	"strings"
	"testing"

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

	"github.com/wapc/wapc-go"
)

func TestModule(t *testing.T) {
	ctx := context.Background()
	code, err := ioutil.ReadFile("testdata/hello.wasm")
	require.NoError(t, err)

	consoleLogInvoked := false
	hostCallInvoked := false

	consoleLog := func(msg string) {
		assert.Equal(t, "logging something", msg)
		consoleLogInvoked = true
	}

	hostCall := func(ctx context.Context, binding, namespace, operation string, payload []byte) ([]byte, error) {
		assert.Equal(t, "myBinding", binding)
		assert.Equal(t, "sample", namespace)
		assert.Equal(t, "hello", operation)
		assert.Equal(t, "Simon", string(payload))
		hostCallInvoked = true
		return []byte("test"), nil
	}

	module, err := wapc.New(code, hostCall)
	module.SetLogger(consoleLog)
	require.NoError(t, err)
	defer module.Close()

	instance, err := module.Instantiate()
	require.NoError(t, err)
	defer instance.Close()

	result, err := instance.Invoke(ctx, "hello", []byte("waPC"))
	require.NoError(t, err)

	assert.Equal(t, "Hello, waPC", string(result))
	assert.True(t, consoleLogInvoked)
	assert.True(t, hostCallInvoked)

	_, err = instance.Invoke(ctx, "error", []byte("waPC"))
	require.Error(t, err)

	msg := err.Error()
	index := strings.IndexByte(msg, ';')
	if index != -1 {
		msg = msg[:index]
	}
	assert.Equal(t, "error occurred", msg)
}

repository: Horki/wapc-go

repo_name: Horki/wapc-go


text:
package main

import (
	"fmt"
	"math"
	"time"
)

type nullAdjuster struct {
}

func (adjuster *nullAdjuster) adjust(response *Response) {
}

type boundAdjuster struct {
	boundTo *int
	boundBy *int
	state   *OPState
}

func (a *boundAdjuster) adjust(response *Response) {
	a.state.concurrency = *a.boundTo * *a.boundBy
	if a.state.concurrency > config.maxChannels {
		a.state.concurrency = config.maxChannels
	}
	return
}

const arrowUp = `↗`
const arrowDown = `↘`

type latencyAdjuster struct {
	movingCount            int
	movingTotalTime        time.Duration
	movingAvgTime          time.Duration
	state                  *OPState
	barrier                int
	errorTolerationPercent float64
	errorRequestCount      int
	errorCount             int
}

func newLatencyAdjuster(state *OPState) *latencyAdjuster {
	a := latencyAdjuster{state: state, errorTolerationPercent: 3}
	return &a
}

var logbase = 1 / math.Log(1.3)

const thresholdPercent = 5

func (a *latencyAdjuster) decrease() {
	if a.state.concurrency > 1 {
		p(a.state.colored(arrowDown))
		a.state.concurrency--
		a.movingCount = 0
		a.movingTotalTime = 0
	}
}

func (a *latencyAdjuster) increase() {
	p(a.state.colored(arrowUp))
	a.state.concurrency++
	a.movingCount = 0
	a.movingTotalTime = 0
}

func (a *latencyAdjuster) setBarrier(barrier int) {
	a.barrier = barrier
	p(fmt.Sprintf("[%d]", a.barrier))
}

func (a *latencyAdjuster) adjust(response *Response) {
	a.movingCount++
	a.errorRequestCount++
	if a.errorRequestCount > int(a.errorTolerationPercent)*100 { // resetting window
		a.errorRequestCount = int(a.errorTolerationPercent) * 33 // keeping correct moving window is more expensive, raw estimate is good enough
		a.errorCount = a.errorCount / 3
	}
	barrierPenalty := (a.state.concurrency + 1) - a.barrier
	sample := int(math.Log(float64(a.state.concurrency)) * logbase)
	if barrierPenalty > 0 && a.barrier > 0 {
		sample += a.state.concurrency * barrierPenalty
	}

	if config.adjustOnErrors && response.err != nil {
		a.errorCount++
		if float64(a.errorCount)/float64(a.errorRequestCount)*100 > a.errorTolerationPercent {
			a.errorRequestCount = 0
			a.errorCount = 0
			if a.barrier > a.state.concurrency || a.barrier == 0 {
				a.setBarrier(a.state.concurrency)
			}
			a.decrease()
			return
		} else {
			a.movingTotalTime += config.maxLatency // Not downscaling, but treating error as max latency
		}
	} else {
		a.movingTotalTime += response.latency
	}

	if a.movingCount >= sample {
		a.movingAvgTime = a.movingTotalTime / time.Duration(a.movingCount)
		if a.movingAvgTime >= config.maxLatency/100*(100+thresholdPercent) {
			a.decrease()
		} else if a.movingAvgTime <= config.maxLatency/100*(100-thresholdPercent) {
			if a.state.concurrency < config.maxChannels {
				a.increase()
				if a.barrier != 0 {
					if a.state.concurrency-a.barrier > 4 {
						a.setBarrier(0)
					}
				}
			}
		}
	}
}

repository: tigrawap/goader

repo_name: tigrawap/goader

gha_license_id: NOASSERTION


text:
package types

// WithCognateCrossReferences is a compositing type for parsing the `cxs` property
type WithCognateCrossReferences struct {
	CognateCrossReferences []CognateCrossReference `json:"cxs,omitempty"`
}

// CognateCrossReference https://dictionaryapi.com/products/json#sec-2.cxs
type CognateCrossReference struct {
	Label   string                        `json:"cxl,omitempty"`
	Targets []CognateCrossReferenceTarget `json:"cxtis,omitempty"`
}

// CognateCrossReferenceTarget https://dictionaryapi.com/products/json#sec-2.cxs
type CognateCrossReferenceTarget struct {
	Label         string `json:"cxl,omitempty"`
	TargetID      string `json:"cxr,omitempty"`
	HyperlinkText string `json:"cxt,omitempty"`
	SenseNumber   string `json:"cxn,omitempty"`
}

repository: fsufitch/merriam-webster-api

repo_name: fsufitch/merriam-webster-api


text:
# This recipe is originally from meta-openstack:
# https://git.yoctoproject.org/cgit/cgit.cgi/meta-cloud-services/tree/meta-openstack/recipes-devtools/python/python-lockfile_0.12.2.bb

SUMMARY = "Platform-independent file locking module"
HOMEPAGE = "https://pypi.org/project/lockfile/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2340dffbbfea534b58f1349984eeef72"

SRC_URI[md5sum] = "a6a1a82957a23afdf44cfdd039b65ff9"
SRC_URI[sha256sum] = "6aed02de03cba24efabcd600b30540140634fc06cfa603822d508d5361e9f799"

inherit pypi setuptools3

DEPENDS += "python3-distutils-extra-native python3-pbr-native"
RDEPENDS:${PN} += " \
    python3-io \
    python3-sqlite3 \
"

BBCLASSEXTEND = "native nativesdk"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake

extension: bb


text:
/**
 *  @file
 *  @copyright defined in aergo/LICENSE.txt
 */

package p2p

import (
	"fmt"
	"io"
	"time"

	"github.com/aergoio/aergo-lib/log"
	"github.com/aergoio/aergo/message"
	"github.com/aergoio/aergo/types"
	peer "github.com/libp2p/go-libp2p-peer"
	protocol "github.com/libp2p/go-libp2p-protocol"
	"github.com/multiformats/go-multicodec/protobuf"
)

const aergoP2PSub protocol.ID = "/aergop2p/0.2"

// PeerHandshaker works to handshake to just connected peer
type PeerHandshaker struct {
	pm        PeerManager
	actorServ ActorService
	logger    *log.Logger
	peerID    peer.ID

	localStatus  *types.Status
	remoteStatus *types.Status
}

type hsResult struct {
	statusMsg *types.Status
	err       error
}

func newHandshaker(pm PeerManager, actorServ ActorService, log *log.Logger, peerID peer.ID) *PeerHandshaker {
	return &PeerHandshaker{pm: pm, actorServ: actorServ, logger: log, peerID: peerID}
}

func (h *PeerHandshaker) handshakeOutboundPeerTimeout(rw MsgReadWriter, ttl time.Duration) (*types.Status, error) {
	ret, err := runFuncTimeout(func(doneChan chan<- interface{}) {
		statusMsg, err := h.handshakeOutboundPeer(rw)
		doneChan <- &hsResult{statusMsg: statusMsg, err: err}
	}, ttl)
	if err != nil {
		return nil, err
	}
	return ret.(*hsResult).statusMsg, ret.(*hsResult).err
}

func (h *PeerHandshaker) handshakeInboundPeerTimeout(rw MsgReadWriter, ttl time.Duration) (*types.Status, error) {
	ret, err := runFuncTimeout(func(doneChan chan<- interface{}) {
		statusMsg, err := h.handshakeInboundPeer(rw)
		doneChan <- &hsResult{statusMsg: statusMsg, err: err}
	}, ttl)
	if err != nil {
		return nil, err
	}
	return ret.(*hsResult).statusMsg, ret.(*hsResult).err
}

type targetFunc func(chan<- interface{})
type timeoutErr error

func runFuncTimeout(m targetFunc, ttl time.Duration) (interface{}, error) {
	done := make(chan interface{})
	go m(done)
	select {
	case hsResult := <-done:
		return hsResult, nil
	case <-time.NewTimer(ttl).C:
		return nil, fmt.Errorf("timeout").(timeoutErr)
	}
}

// handshakeOutboundPeer start handshake with outbound peer
func (h *PeerHandshaker) handshakeOutboundPeer(rw MsgReadWriter) (*types.Status, error) {
	peerID := h.peerID

	h.logger.Debug().Str(LogPeerID, peerID.Pretty()).Msg("Starting Handshake")
	// send status
	statusMsg, err := createStatusMsg(h.pm, h.actorServ)
	if err != nil {
		return nil, err
	}
	h.localStatus = statusMsg
	container := newP2PMessage("", false, statusRequest, statusMsg)
	if container == nil {
		// h.logger.Warn().Str(LogPeerID, peerID.Pretty()).Err(err).Msg("failed to create p2p message")
		return nil, fmt.Errorf("failed to craete container message")
	}
	if err = rw.WriteMsg(container); err != nil {
		return nil, err
	}

	// and wait to response status
	data, err := rw.ReadMsg()
	if err != nil {
		// h.logger.Info().Err(err).Msg("fail to decode")
		return nil, err
	}

	if err := h.checkProtocolVersion("0.2"); err != nil {
		// h.logger.Info().Err(err).Str(LogPeerID, peerID.Pretty()).Msg("invalid protocol version of peer")
		return nil, err
	}

	if data.Header.GetSubprotocol() != statusRequest.Uint32() {
		// TODO: parse message and return
		// h.logger.Info().Str(LogPeerID, peerID.Pretty()).Str("expected", statusRequest.String()).Str("actual", SubProtocol(data.Header.GetSubprotocol()).String()).Msg("Unexpected handshake response")
		return nil, fmt.Errorf("Unexpected message type")
	}
	statusResp := &types.Status{}
	err = unmarshalMessage(data.Data, statusResp)
	if err != nil {
		// h.logger.Warn().Err(err).Msg("Failed to decode status message")
		return nil, err
	}

	h.remoteStatus = statusResp
	// check status message
	return statusResp, nil
}

// onHandshake is handle handshake from inbound peer
func (h *PeerHandshaker) handshakeInboundPeer(rw MsgReadWriter) (*types.Status, error) {
	peerID := h.peerID

	// first message must be status
	data, err := rw.ReadMsg()
	if err != nil {
		h.logger.Warn().Str(LogPeerID, peerID.Pretty()).Err(err).Msg("failed to create p2p message")
		return nil, err
	}

	if err := h.checkProtocolVersion("0.2"); err != nil {
		h.logger.Info().Err(err).Str(LogPeerID, peerID.Pretty()).Msg("invalid protocol version of peer")
		return nil, err
	}

	if data.Header.GetSubprotocol() != statusRequest.Uint32() {
		// TODO: parse message and return
		h.logger.Info().Str(LogPeerID, peerID.Pretty()).Str("expected", statusRequest.String()).Str("actual", SubProtocol(data.Header.GetSubprotocol()).String()).Msg("Unexpected message type")
		return nil, fmt.Errorf("Unexpected message type")
	}

	statusMsg := &types.Status{}
	if err := unmarshalMessage(data.Data, statusMsg); err != nil {
		h.logger.Warn().Str(LogPeerID, peerID.Pretty()).Err(err).Msg("Failed to decode status message")
		return nil, err
	}
	h.remoteStatus = statusMsg

	// send my status message as response
	statusResp, err := createStatusMsg(h.pm, h.actorServ)
	if err != nil {
		h.logger.Warn().Err(err).Msg("failed to create status message")
		return nil, err
	}
	container := newP2PMessage("", false, statusRequest, statusResp)
	if container == nil {
		h.logger.Warn().Str(LogPeerID, peerID.Pretty()).Msg("failed to create p2p message")
		return nil, fmt.Errorf("failed to create p2p message")
	}
	if err = rw.WriteMsg(container); err != nil {
		h.logger.Warn().Str(LogPeerID, peerID.Pretty()).Err(err).Msg("failed to send response status ")
		return nil, err
	}
	h.localStatus = statusResp
	return statusMsg, nil

}

// doPostHandshake is additional work after peer is added.
func (h *PeerHandshaker) doInitialSync() {

	// sync block infos
	h.actorServ.SendRequest(message.ChainSvc, &message.SyncBlockState{PeerID: h.peerID, BlockNo: h.remoteStatus.BestHeight, BlockHash: h.remoteStatus.BestBlockHash})

	// sync mempool tx infos
	// TODO add tx handling
}

func createStatusMsg(pm PeerManager, actorServ ActorService) (*types.Status, error) {
	// find my best block
	bestBlock, err := extractBlockFromRequest(actorServ.CallRequest(message.ChainSvc, &message.GetBestBlock{}))
	if err != nil {
		return nil, err
	}
	selfAddr := pm.SelfMeta().ToPeerAddress()
	// create message data
	statusMsg := &types.Status{
		Sender:        &selfAddr,
		BestBlockHash: bestBlock.BlockHash(),
		BestHeight:    bestBlock.GetHeader().GetBlockNo(),
	}

	return statusMsg, nil
}

func (h *PeerHandshaker) checkProtocolVersion(versionStr string) error {
	// TODO modify interface and put check code here
	return nil
}

func readP2PMessage(rd io.Reader) (*types.P2PMessage, error) {
	containerMsg := &types.P2PMessage{}
	decoder := mc_pb.Multicodec(nil).Decoder(rd)
	if err := decoder.Decode(containerMsg); err != nil {
		return nil, err
	}
	return containerMsg, nil
}


text:
//go:generate go run github.com/vektah/dataloaden RuntimeContextLoader ParamRuntimeContext *github.com/kyma-incubator/compass/components/director/pkg/graphql.RuntimeContextPage

package dataloader

import (
	"context"
	"net/http"
	"time"

	"github.com/kyma-incubator/compass/components/director/pkg/graphql"
)

const loadersKeyRuntimeContext contextKey = "dataloadersRuntimeContext"

// RuntimeContextLoaders missing godoc
type RuntimeContextLoaders struct {
	RuntimeContextByID RuntimeContextLoader
}

// ParamRuntimeContext missing godoc
type ParamRuntimeContext struct {
	ID    string
	First *int
	After *graphql.PageCursor
	Ctx   context.Context
}

// HandlerRuntimeContext missing godoc
func HandlerRuntimeContext(fetchFunc func(keys []ParamRuntimeContext) ([]*graphql.RuntimeContextPage, []error), maxBatch int, wait time.Duration) func(next http.Handler) http.Handler {
	return func(next http.Handler) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			ctx := context.WithValue(r.Context(), loadersKeyRuntimeContext, &RuntimeContextLoaders{
				RuntimeContextByID: RuntimeContextLoader{
					maxBatch: maxBatch,
					wait:     wait,
					fetch:    fetchFunc,
				},
			})
			r = r.WithContext(ctx)
			next.ServeHTTP(w, r)
		})
	}
}

// RuntimeContextFor missing godoc
func RuntimeContextFor(ctx context.Context) *RuntimeContextLoaders {
	return ctx.Value(loadersKeyRuntimeContext).(*RuntimeContextLoaders)
}

repository: kyma-incubator/compass

repo_name: kyma-incubator/compass

branch_name: refs/heads/main


text:
package types

import (
	"crypto/x509"
	"encoding/base64"
	fmt "fmt"
	"strings"

	commons "github.com/commercionetwork/commercionetwork/x/common/types"
	sdk "github.com/cosmos/cosmos-sdk/types"
	sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
	"github.com/pkg/errors"
)

func Validate(did string) error {

	if !strings.HasPrefix(did, "did:com:") {
		return errors.Errorf("invalid ID address (%s), must have 'did:com:' prefix", did)
	}

	if _, err := sdk.AccAddressFromBech32(did); err != nil {
		return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid ID address (%s), %e", did, err)
	}

	return nil
}

func (s *Service) Validate() error {
	if s == nil {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "service is not defined")
	}

	// validate id
	// Required
	// A string that conforms to the rules of RFC3986 for URIs.
	if IsEmpty(s.ID) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "service field \"id\" is required")
	}
	if !IsValidRFC3986Uri(s.ID) {
		return sdkerrors.Wrap(ErrInvalidRFC3986UriFormat, "service field \"id\" must conform to the rules of RFC3986 for URIs")
	}
	if len(s.ID) > serviceLenghtLimitID {
		return sdkerrors.Wrap(ErrInvalidRFC3986UriFormat, fmt.Sprint("service field \"id\" must be smaller than ", serviceLenghtLimitID, " characters"))
	}

	// validate type
	// Required
	// A string.
	// W3C recommendation: In order to maximize interoperability, the service type and its associated properties SHOULD be registered in the DID Specification Registries
	if IsEmpty(s.Type) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "service field \"type\" is required")
	}
	if len(s.Type) > serviceLenghtLimitType {
		return sdkerrors.Wrap(ErrInvalidRFC3986UriFormat, fmt.Sprint("service field \"type\" must be smaller than ", serviceLenghtLimitType, " characters"))
	}

	// validate serviceEndpoint
	// Required
	// A string that conforms to the rules of RFC3986 for URIs.
	if IsEmpty(s.ServiceEndpoint) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "service field \"serviceEndpoint\" is required")
	}
	if !IsValidRFC3986Uri(s.ServiceEndpoint) {
		return sdkerrors.Wrap(ErrInvalidRFC3986UriFormat, "service field \"serviceEndpoint\" must conform to the rules of RFC3986 for URIs")
	}
	if len(s.ServiceEndpoint) > serviceLenghtLimitServiceEndpoint {
		return sdkerrors.Wrap(ErrInvalidRFC3986UriFormat, fmt.Sprint("service field \"serviceEndpoint\" must be smaller than ", serviceLenghtLimitServiceEndpoint, " characters"))
	}

	return nil
}

func (v *VerificationMethod) Validate(subject string) error {
	if v == nil {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "verificationMethod is not defined")
	}

	// validate ID
	// Required
	// A string that conforms to the rules for DID URL.
	if IsEmpty(v.ID) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "verificationMethod field \"id\" is required")
	}
	if !IsValidDIDURL(v.ID) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "verificationMethod field \"id\" must conform to the rules for DID URL")
	}

	// validate type
	// Required
	// A string that references exactly one verification method type.
	// W3C recommendation: In order to maximize global interoperability, the verification method type SHOULD be registered in the DID Specification Registries -> https://www.w3.org/TR/did-spec-registries/#verification-method-types
	if IsEmpty(v.Type) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "verificationMethod field \"type\" is required")
	}
	if !commons.Strings(verificationMethodTypes).Contains(v.Type) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "verificationMethod field \"type\" is not supported")
	}

	// validate controller
	// Required
	// A string that conforms to the rules of DID Syntax.
	// commercionetwork: same as the subject i.e. the ID field of DID document
	if IsEmpty(v.Controller) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "verificationMethod field \"controller\" is required")
	}
	if !IsValidDID(v.Controller) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "verificationMethod field \"controller\" must conform to the rules of DID Syntax")
	}
	if v.Controller != subject {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "verificationMethod field \"controller\" must be equal to the subject i.e. the ID field of DID document")
	}

	// validate publicKeyMultibase
	// A verification method MUST NOT contain multiple verification material properties for the same material. For example, expressing key material in a verification method using both publicKeyJwk and publicKeyMultibase at the same time is prohibited.
	// -> using only publicKeyMultibase
	if IsEmpty(v.PublicKeyMultibase) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "verificationMethod field \"publicKeyMultibase\" is required")
	}

	// commercionetwork: keys of type RsaVerificationKey2018 must be with suffix #keys-1, and must be a valid RSA PKIX public key
	if v.Type == RsaVerificationKey2018 {
		if !strings.HasSuffix(v.ID, RsaVerificationKey2018NameSuffix) {
			return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid fields \"type\" and \"id\": keys of type "+RsaVerificationKey2018+" must be with suffix "+RsaVerificationKey2018NameSuffix)
		}
	}
	// commercionetwork: keys of type RsaSignatureKey2018 must be with suffix #keys-2, and must be a valid RSA PKIX public key
	if v.Type == RsaSignature2018 {
		if !strings.HasSuffix(v.ID, RsaSignature2018NameSuffix) {
			return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid fields \"type\" and \"id\": keys of type "+RsaSignature2018+" must be with suffix "+RsaSignature2018NameSuffix)
		}
	}

	if v.Type == RsaVerificationKey2018 || v.Type == RsaSignature2018 {
		if v.PublicKeyMultibase[0] != MultibaseCodeBase64NoPadding && v.PublicKeyMultibase[0] != MultibaseCodeBase64Padded {
			return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid field \"publicKeyMultibase\" must start with multibase code "+string(MultibaseCodeBase64NoPadding)+" or "+string(MultibaseCodeBase64Padded))
		}
		if err := validateRSAPubkey(string(v.PublicKeyMultibase[0]), []byte(v.PublicKeyMultibase[1:])); err != nil {
			return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("invalid field \"publicKeyMultibase\" must be a valid RSA public key: %e", err))
		}
	}

	return nil
}

func validateRSAPubkey(multibaseCode string, key []byte) error {
	var decodeBase64Fn func(string) ([]byte, error)

	switch multibaseCode {
	case string(MultibaseCodeBase64NoPadding):
		decodeBase64Fn = base64.RawStdEncoding.DecodeString
	case string(MultibaseCodeBase64Padded):
		decodeBase64Fn = base64.StdEncoding.DecodeString
	default:
		return fmt.Errorf("unsupported multibase key with code %s", multibaseCode)
	}

	pemBytes, err := decodeBase64Fn(string(key))
	if err != nil {
		return err
	}
	_, err = x509.ParsePKIXPublicKey(pemBytes)
	if err != nil {
		return fmt.Errorf("invalid public key: %w", err)
	}
	return nil
}

repository: commercionetwork/commercionetwork

repo_name: commercionetwork/commercionetwork


text:
package model

import "time"

type Admin struct {
	ID int64
	Name string `sql:"comment:'管理员账户'"`
	Passwd string `sql:"comment:'密码'"`
	CreatedAt *time.Time
	UpdatedAt *time.Time
}

repository: spkinger/speaker-server

repo_name: spkinger/speaker-server


text:
package gofakeit

import (
	"fmt"
	"testing"
)

func ExampleLetter() {
	Seed(11)
	fmt.Println(Letter())
	// Output: g
}

func BenchmarkLetter(b *testing.B) {
	for i := 0; i < b.N; i++ {
		Letter()
	}
}

func ExampleLexify() {
	Seed(11)
	fmt.Println(Lexify("?????"))
	// Output: gbrma
}

func BenchmarkLexify(b *testing.B) {
	for i := 0; i < b.N; i++ {
		Lexify("??????")
	}
}

func ExampleShuffleStrings() {
	Seed(11)
	strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"}
	ShuffleStrings(strings)
	fmt.Println(strings)
	// Output: [everyone a for good have times happy day]
}

func BenchmarkShuffleStrings(b *testing.B) {
	for i := 0; i < b.N; i++ {
		ShuffleStrings([]string{"happy", "times", "for", "everyone", "have", "a", "good", "day"})
	}
}

repository: mingrammer/gofakeit

repo_name: mingrammer/gofakeit


text:
#
# base recipe: meta/recipes-support/sqlite/sqlite3_3.27.2.bb
# base branch: warrior
#
SUMMARY = "Command line interface for SQLite 3"
DESCRIPTION = "Command line interface for SQLite 3 \
SQLite is a C library that implements an SQL database engine. \
Programs that link with the SQLite library can have SQL database \
access without running a separate RDBMS process. \
"
require recipes-support/sqlite/sqlite3.inc

inherit debian-package
require recipes-debian/sources/sqlite3.inc

LICENSE = "PD"
LIC_FILES_CHKSUM = "file://src/sqlite.h.in;endline=11;md5=786d3dc581eff03f4fd9e4a77ed00c66"

DEPENDS =+ "tcl-native"

# Base on meta-debian branch morty, required to avoid a compile error
SRC_URI += "file://fix-hardcode-libtool.patch"

# Remove config of dynamic extension and disable-static-shell
# because these features are not available in configure file
PACKAGECONFIG_remove = "dyn_ext"
PACKAGECONFIG_class-native_remove = "dyn_ext"
PACKAGECONFIG[dyn_ext] = ""

EXTRA_OECONF_remove = "--disable-static-shell"

EXTRA_OEMAKE_class-target = "CROSS_BUILDING=yes"
EXTRA_OEMAKE_class-nativesdk = "CROSS_BUILDING=yes"

repository: emlinuxci/meta-debian

repo_name: emlinuxci/meta-debian

branch_name: refs/heads/warrior


text:
package solution

func search(nums []int, target int) int {
	lo := 0
	hi := len(nums) - 1

	for lo < hi {
		mid := (lo + hi) / 2

		if nums[mid] > nums[hi] {
			lo = mid + 1
		} else {
			hi = mid
		}
	}

	rot := lo
	lo = 0
	hi = len(nums) - 1

	for lo <= hi {
		mid := (lo + hi) / 2
		realMid := (mid + rot) % len(nums)

		if nums[realMid] == target {
			return realMid
		}
		if nums[realMid] < target {
			lo = mid + 1
		} else {
			hi = mid - 1
		}
	}

	return -1
}

repository: yukisato/algorithms

repo_name: yukisato/algorithms

gha_language: TypeScript


text:
package dht

import (
	"bytes"
	"crypto/rand"
	"errors"
	"fmt"
	"sync"
	"time"

	inet "github.com/jbenet/go-ipfs/net"
	msg "github.com/jbenet/go-ipfs/net/message"
	peer "github.com/jbenet/go-ipfs/peer"
	kb "github.com/jbenet/go-ipfs/routing/kbucket"
	u "github.com/jbenet/go-ipfs/util"

	context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
	ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
	ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"

	"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
)

// TODO. SEE https://github.com/jbenet/node-ipfs/blob/master/submodules/ipfs-dht/index.js

// IpfsDHT is an implementation of Kademlia with Coral and S/Kademlia modifications.
// It is used to implement the base IpfsRouting module.
type IpfsDHT struct {
	// Array of routing tables for differently distanced nodes
	// NOTE: (currently, only a single table is used)
	routingTables []*kb.RoutingTable

	// the network interface. service
	network inet.Network
	sender  inet.Sender

	// Local peer (yourself)
	self *peer.Peer

	// Other peers
	peerstore peer.Peerstore

	// Local data
	datastore ds.Datastore
	dslock    sync.Mutex

	providers *ProviderManager

	// When this peer started up
	birth time.Time

	//lock to make diagnostics work better
	diaglock sync.Mutex
}

// NewDHT creates a new DHT object with the given peer as the 'local' host
func NewDHT(p *peer.Peer, ps peer.Peerstore, net inet.Network, sender inet.Sender, dstore ds.Datastore) *IpfsDHT {
	dht := new(IpfsDHT)
	dht.network = net
	dht.sender = sender
	dht.datastore = dstore
	dht.self = p
	dht.peerstore = ps

	dht.providers = NewProviderManager(p.ID)

	dht.routingTables = make([]*kb.RoutingTable, 3)
	dht.routingTables[0] = kb.NewRoutingTable(20, kb.ConvertPeerID(p.ID), time.Millisecond*30)
	dht.routingTables[1] = kb.NewRoutingTable(20, kb.ConvertPeerID(p.ID), time.Millisecond*100)
	dht.routingTables[2] = kb.NewRoutingTable(20, kb.ConvertPeerID(p.ID), time.Hour)
	dht.birth = time.Now()
	return dht
}

// Connect to a new peer at the given address, ping and add to the routing table
func (dht *IpfsDHT) Connect(ctx context.Context, npeer *peer.Peer) (*peer.Peer, error) {
	u.DOut("Connect to new peer: %s\n", npeer.ID.Pretty())

	// TODO(jbenet,whyrusleeping)
	//
	// Connect should take in a Peer (with ID). In a sense, we shouldn't be
	// allowing connections to random multiaddrs without knowing who we're
	// speaking to (i.e. peer.ID). In terms of moving around simple addresses
	// -- instead of an (ID, Addr) pair -- we can use:
	//
	//   /ip4/10.20.30.40/tcp/1234/ipfs/Qxhxxchxzcncxnzcnxzcxzm
	//
	err := dht.network.DialPeer(npeer)
	if err != nil {
		return nil, err
	}

	// Ping new peer to register in their routing table
	// NOTE: this should be done better...
	err = dht.Ping(ctx, npeer)
	if err != nil {
		return nil, fmt.Errorf("failed to ping newly connected peer: %s\n", err)
	}

	dht.Update(npeer)

	return npeer, nil
}

// HandleMessage implements the inet.Handler interface.
func (dht *IpfsDHT) HandleMessage(ctx context.Context, mes msg.NetMessage) msg.NetMessage {

	mData := mes.Data()
	if mData == nil {
		// TODO handle/log err
		return nil
	}

	mPeer := mes.Peer()
	if mPeer == nil {
		// TODO handle/log err
		return nil
	}

	// deserialize msg
	pmes := new(Message)
	err := proto.Unmarshal(mData, pmes)
	if err != nil {
		// TODO handle/log err
		return nil
	}

	// update the peer (on valid msgs only)
	dht.Update(mPeer)

	// Print out diagnostic
	u.DOut("[peer: %s] Got message type: '%s' [from = %s]\n",
		dht.self.ID.Pretty(),
		Message_MessageType_name[int32(pmes.GetType())], mPeer.ID.Pretty())

	// get handler for this msg type.
	handler := dht.handlerForMsgType(pmes.GetType())
	if handler == nil {
		// TODO handle/log err
		return nil
	}

	// dispatch handler.
	rpmes, err := handler(mPeer, pmes)
	if err != nil {
		// TODO handle/log err
		return nil
	}

	// if nil response, return it before serializing
	if rpmes == nil {
		return nil
	}

	// serialize response msg
	rmes, err := msg.FromObject(mPeer, rpmes)
	if err != nil {
		// TODO handle/log err
		return nil
	}

	return rmes
}

// sendRequest sends out a request using dht.sender, but also makes sure to
// measure the RTT for latency measurements.
func (dht *IpfsDHT) sendRequest(ctx context.Context, p *peer.Peer, pmes *Message) (*Message, error) {

	mes, err := msg.FromObject(p, pmes)
	if err != nil {
		return nil, err
	}

	start := time.Now()

	// Print out diagnostic
	u.DOut("[peer: %s] Sent message type: '%s' [to = %s]\n",
		dht.self.ID.Pretty(),
		Message_MessageType_name[int32(pmes.GetType())], p.ID.Pretty())

	rmes, err := dht.sender.SendRequest(ctx, mes)
	if err != nil {
		return nil, err
	}
	if rmes == nil {
		return nil, errors.New("no response to request")
	}

	rtt := time.Since(start)
	rmes.Peer().SetLatency(rtt)

	rpmes := new(Message)
	if err := proto.Unmarshal(rmes.Data(), rpmes); err != nil {
		return nil, err
	}

	return rpmes, nil
}

func (dht *IpfsDHT) putValueToNetwork(ctx context.Context, p *peer.Peer,
	key string, value []byte) error {

	pmes := newMessage(Message_PUT_VALUE, string(key), 0)
	pmes.Value = value
	rpmes, err := dht.sendRequest(ctx, p, pmes)
	if err != nil {
		return err
	}

	if !bytes.Equal(rpmes.Value, pmes.Value) {
		return errors.New("value not put correctly")
	}
	return nil
}

func (dht *IpfsDHT) putProvider(ctx context.Context, p *peer.Peer, key string) error {

	pmes := newMessage(Message_ADD_PROVIDER, string(key), 0)
	rpmes, err := dht.sendRequest(ctx, p, pmes)
	if err != nil {
		return err
	}

	u.DOut("[%s] putProvider: %s for %s\n", dht.self.ID.Pretty(), p.ID.Pretty(), key)
	if *rpmes.Key != *pmes.Key {
		return errors.New("provider not added correctly")
	}

	return nil
}

func (dht *IpfsDHT) getValueOrPeers(ctx context.Context, p *peer.Peer,
	key u.Key, level int) ([]byte, []*peer.Peer, error) {

	pmes, err := dht.getValueSingle(ctx, p, key, level)
	if err != nil {
		return nil, nil, err
	}

	u.DOut("pmes.GetValue() %v\n", pmes.GetValue())
	if value := pmes.GetValue(); value != nil {
		// Success! We were given the value
		u.DOut("getValueOrPeers: got value\n")
		return value, nil, nil
	}

	// TODO decide on providers. This probably shouldn't be happening.
	if prv := pmes.GetProviderPeers(); prv != nil && len(prv) > 0 {
		val, err := dht.getFromPeerList(ctx, key, prv, level)
		if err != nil {
			return nil, nil, err
		}
		u.DOut("getValueOrPeers: get from providers\n")
		return val, nil, nil
	}

	// Perhaps we were given closer peers
	var peers []*peer.Peer
	for _, pb := range pmes.GetCloserPeers() {
		if peer.ID(pb.GetId()).Equal(dht.self.ID) {
			continue
		}

		addr, err := ma.NewMultiaddr(pb.GetAddr())
		if err != nil {
			u.PErr("%v\n", err.Error())
			continue
		}

		// check if we already have this peer.
		pr, _ := dht.peerstore.Get(peer.ID(pb.GetId()))
		if pr == nil {
			pr = &peer.Peer{ID: peer.ID(pb.GetId())}
			dht.peerstore.Put(pr)
		}
		pr.AddAddress(addr) // idempotent
		peers = append(peers, pr)
	}

	if len(peers) > 0 {
		u.DOut("getValueOrPeers: peers\n")
		return nil, peers, nil
	}

	u.DOut("getValueOrPeers: u.ErrNotFound\n")
	return nil, nil, u.ErrNotFound
}

// getValueSingle simply performs the get value RPC with the given parameters
func (dht *IpfsDHT) getValueSingle(ctx context.Context, p *peer.Peer,
	key u.Key, level int) (*Message, error) {

	pmes := newMessage(Message_GET_VALUE, string(key), level)
	return dht.sendRequest(ctx, p, pmes)
}

// TODO: Im not certain on this implementation, we get a list of peers/providers
// from someone what do we do with it? Connect to each of them? randomly pick
// one to get the value from? Or just connect to one at a time until we get a
// successful connection and request the value from it?
func (dht *IpfsDHT) getFromPeerList(ctx context.Context, key u.Key,
	peerlist []*Message_Peer, level int) ([]byte, error) {

	for _, pinfo := range peerlist {
		p, err := dht.ensureConnectedToPeer(pinfo)
		if err != nil {
			u.DErr("getFromPeers error: %s\n", err)
			continue
		}

		pmes, err := dht.getValueSingle(ctx, p, key, level)
		if err != nil {
			u.DErr("getFromPeers error: %s\n", err)
			continue
		}

		if value := pmes.GetValue(); value != nil {
			// Success! We were given the value
			dht.providers.AddProvider(key, p)
			return value, nil
		}
	}
	return nil, u.ErrNotFound
}

func (dht *IpfsDHT) getLocal(key u.Key) ([]byte, error) {
	dht.dslock.Lock()
	defer dht.dslock.Unlock()
	v, err := dht.datastore.Get(ds.NewKey(string(key)))
	if err != nil {
		return nil, err
	}

	byt, ok := v.([]byte)
	if !ok {
		return byt, errors.New("value stored in datastore not []byte")
	}
	return byt, nil
}

func (dht *IpfsDHT) putLocal(key u.Key, value []byte) error {
	return dht.datastore.Put(ds.NewKey(string(key)), value)
}

// Update signals to all routingTables to Update their last-seen status
// on the given peer.
func (dht *IpfsDHT) Update(p *peer.Peer) {
	removedCount := 0
	for _, route := range dht.routingTables {
		removed := route.Update(p)
		// Only close the connection if no tables refer to this peer
		if removed != nil {
			removedCount++
		}
	}

	// Only close the connection if no tables refer to this peer
	// if removedCount == len(dht.routingTables) {
	// 	dht.network.ClosePeer(p)
	// }
	// ACTUALLY, no, let's not just close the connection. it may be connected
	// due to other things. it seems that we just need connection timeouts
	// after some deadline of inactivity.
}

// Find looks for a peer with a given ID connected to this dht and returns the peer and the table it was found in.
func (dht *IpfsDHT) Find(id peer.ID) (*peer.Peer, *kb.RoutingTable) {
	for _, table := range dht.routingTables {
		p := table.Find(id)
		if p != nil {
			return p, table
		}
	}
	return nil, nil
}

func (dht *IpfsDHT) findPeerSingle(ctx context.Context, p *peer.Peer, id peer.ID, level int) (*Message, error) {
	pmes := newMessage(Message_FIND_NODE, string(id), level)
	return dht.sendRequest(ctx, p, pmes)
}

func (dht *IpfsDHT) printTables() {
	for _, route := range dht.routingTables {
		route.Print()
	}
}

func (dht *IpfsDHT) findProvidersSingle(ctx context.Context, p *peer.Peer, key u.Key, level int) (*Message, error) {
	pmes := newMessage(Message_GET_PROVIDERS, string(key), level)
	return dht.sendRequest(ctx, p, pmes)
}

// TODO: Could be done async
func (dht *IpfsDHT) addProviders(key u.Key, peers []*Message_Peer) []*peer.Peer {
	var provArr []*peer.Peer
	for _, prov := range peers {
		p, err := dht.peerFromInfo(prov)
		if err != nil {
			u.PErr("error getting peer from info: %v\n", err)
			continue
		}

		u.DOut("[%s] adding provider: %s for %s", dht.self.ID.Pretty(), p, key)

		// Dont add outselves to the list
		if p.ID.Equal(dht.self.ID) {
			continue
		}

		// TODO(jbenet) ensure providers is idempotent
		dht.providers.AddProvider(key, p)
		provArr = append(provArr, p)
	}
	return provArr
}

// nearestPeerToQuery returns the routing tables closest peers.
func (dht *IpfsDHT) nearestPeerToQuery(pmes *Message) *peer.Peer {
	level := pmes.GetClusterLevel()
	cluster := dht.routingTables[level]

	key := u.Key(pmes.GetKey())
	closer := cluster.NearestPeer(kb.ConvertKey(key))
	return closer
}

// betterPeerToQuery returns nearestPeerToQuery, but iff closer than self.
func (dht *IpfsDHT) betterPeerToQuery(pmes *Message) *peer.Peer {
	closer := dht.nearestPeerToQuery(pmes)

	// no node? nil
	if closer == nil {
		return nil
	}

	// == to self? nil
	if closer.ID.Equal(dht.self.ID) {
		u.DOut("Attempted to return self! this shouldnt happen...\n")
		return nil
	}

	// self is closer? nil
	key := u.Key(pmes.GetKey())
	if kb.Closer(dht.self.ID, closer.ID, key) {
		return nil
	}

	// ok seems like a closer node.
	return closer
}

func (dht *IpfsDHT) peerFromInfo(pbp *Message_Peer) (*peer.Peer, error) {

	id := peer.ID(pbp.GetId())

	// continue if it's ourselves
	if id.Equal(dht.self.ID) {
		return nil, errors.New("found self")
	}

	p, _ := dht.peerstore.Get(id)
	if p == nil {
		p, _ = dht.Find(id)
		if p != nil {
			panic("somehow peer not getting into peerstore")
		}
	}

	if p == nil {
		maddr, err := ma.NewMultiaddr(pbp.GetAddr())
		if err != nil {
			return nil, err
		}

		// create new Peer
		p = &peer.Peer{ID: id}
		p.AddAddress(maddr)
		dht.peerstore.Put(p)
	}
	return p, nil
}

func (dht *IpfsDHT) ensureConnectedToPeer(pbp *Message_Peer) (*peer.Peer, error) {
	p, err := dht.peerFromInfo(pbp)
	if err != nil {
		return nil, err
	}

	// dial connection
	err = dht.network.DialPeer(p)
	return p, err
}

func (dht *IpfsDHT) loadProvidableKeys() error {
	kl, err := dht.datastore.KeyList()
	if err != nil {
		return err
	}
	for _, k := range kl {
		dht.providers.AddProvider(u.Key(k.Bytes()), dht.self)
	}
	return nil
}

// Bootstrap builds up list of peers by requesting random peer IDs
func (dht *IpfsDHT) Bootstrap(ctx context.Context) {
	id := make([]byte, 16)
	rand.Read(id)
	dht.FindPeer(ctx, peer.ID(id))
}

repository: llSourcell/go-ipfs

repo_name: llSourcell/go-ipfs


text:
package impl

import (
	"github.com/vitesse-ftian/dggo/vitessedata/proto/xdrive"
	"fmt"
	"io"
	"strconv"
	"strings"
	"errors"
	"vitessedata/plugin"
//        "github.com/tsuna/gohbase"
        "github.com/tsuna/gohbase/hrpc"
        "github.com/tsuna/gohbase/filter"
//        "github.com/tsuna/gohbase/region"
)

func DoRead(req xdrive.ReadRequest, hbasehost, user, field_separator, token_separator string) error {
	var err error

	if req.FragCnt <= 0 || req.FragId < 0 || req.FragId >= req.FragCnt {
		plugin.DbgLog("Invalid read req %v", req)
		plugin.DataReply(-3, fmt.Sprintf("Read request frag (%d, %d) is not valid.", req.FragId, req.FragCnt))
		return fmt.Errorf("Invalid read request")
	}

	idx := strings.LastIndex(req.Filespec.Path, "/")
	table := req.Filespec.Path[idx+1:]

	var hbase HBClient
	hbase.Init(hbasehost, user, table, field_separator, token_separator)

	regions := hbase.GetRegions(req.FragId, req.FragCnt)

	/*
	{"COLUMNS" : ["cf:a", "cf:b"], "FILTERS": [{"PrefixFilter": ["row2"]}, {"QualifierFilter" : [">=", "binary:xyz"] } , { "TimestampsFilter": [123, 456]}],
	  "LIMIT" : 5, "STARTROW": "row1", "ENDROW": "rowN", "TIMERANGE" : [123, 456]}

        column=cf:a&column=cf:b&limit=5&startrow=row1&endrow=rowN&timerange=starttime,endtime&prefixfilter=row2&qualifierfilter=ge,binary:xyz&timestampsfilter=123,456
        */
	families := make(map[string][]string)
	filters := filter.NewList(filter.MustPassAll)
	//filters := filter.NewList(filter.MustPassOne)
	filtercnt := 0

	var rowrangelist []*filter.RowRange
	var srow, erow []byte
	var stime, etime int64
	var query string
	var limit, offset int

	for _, f := range req.Filter {
		// f cannot be nil
		if f.Op == "QUERY" {
			query = f.Args[0]
		}
	}

	if query != "" {
		p := strings.Split(query, TOKEN_SEPARATOR)
		for _, pp := range p {
			plugin.DbgLog(pp)
			ppp := strings.SplitN(pp, "=", 2)
			if len(ppp) == 2 {
				switch ppp[0] {
				case "column":
					cc := strings.SplitN(ppp[1], ":", 2)
					if len(cc) != 2 {
						plugin.DataReply(-100, "Invalid column. Family + Qualifier. " + ppp[1])
						return fmt.Errorf("Invalid column. Family + Qualifier. " + ppp[1])
					}
					a := families[cc[0]]
					families[cc[0]] = append(a, cc[1])
					plugin.DbgLog("families %v ", families)
				case "offset":
					offset, err = strconv.Atoi(ppp[1])
					if err != nil {
						plugin.DataReply(-100, "Invalid offset datatype.  integer is required. " + ppp[1])
						return err
					}
					plugin.DbgLog("offset = %d", offset)
				case "limit":
					limit, err = strconv.Atoi(ppp[1])
					if err != nil {
						plugin.DataReply(-100, "Invalid limit datatype.  integer is required. " + ppp[1])
						return err
					}
					plugin.DbgLog("limit = %d", limit)
				case "startrow":
					srow = []byte(ppp[1])
					plugin.DbgLog("startrow = %s", string(srow))
				case "stoprow":
					erow = []byte(ppp[1])
					plugin.DbgLog("stoprow = %s", string(erow))
				case "timerange":
					tt := strings.SplitN(ppp[1], FIELD_SEPARATOR, 2)
					if len(tt) != 2 {
						plugin.DataReply(-100, "Invalid timerange. format: starttime,endtime. " + ppp[1])
						return errors.New("Invalid timerange")
					}
					stime, err = strconv.ParseInt(tt[0], 10, 64)
					if err != nil {
						plugin.DataReply(-100, "Invalid timerange. starttime invalid. " + ppp[1])
						return err
					}
					etime, err = strconv.ParseInt(tt[1], 10, 64)
					if err != nil {
						plugin.DataReply(-100, "Invalid timerange. endtime invalid. " + ppp[1])
						return err
					}
					plugin.DbgLog("stime = %d, etime = %d", stime, etime)
				default:
					if strings.HasSuffix(ppp[0], "Filter") {
						plugin.DbgLog("filter %s = %s", ppp[0], ppp[1])

						if ppp[0] == "RowRangeFilter" {
							rowrange, err := hbase.NewRowRange(ppp[1])
							if err != nil {
								plugin.DataReply(-100, err.Error())
								return err
							}
							rowrangelist = append(rowrangelist, rowrange)
						} else {

							filter, err := hbase.NewFilter(ppp[0], ppp[1])
							if err != nil {
								plugin.DataReply(-100, err.Error())
								return err
							}
							if filter != nil {
								filters.AddFilters(filter)
								filtercnt++
							}
						}
					} else {
						plugin.DataReply(-100, "Invalid argument. " + ppp[0] + ": " + ppp[1])
						return errors.New("Invalid argument " + ppp[0] + ": " + ppp[1])
					}
				}
			}
		}
	}

	// families
	plugin.DbgLog("Families %v", families)
	// filter
	// rowrange
	if len(rowrangelist)  > 0 {
		filters.AddFilters(filter.NewMultiRowRangeFilter(rowrangelist))
		filtercnt++
	}

	plugin.DbgLog("Filters %v", filters)

	var writer HBWriter
	writer.Init(req.Filespec, req.Columndesc, req.Columnlist)

	for _, rg := range regions {
		var scanner hrpc.Scanner
		if filtercnt == 0  {
			scanner, err = hbase.Scan(rg, srow, erow, families, nil, uint64(stime), uint64(etime), uint32(limit), uint32(offset))
		} else {
			scanner, err = hbase.Scan(rg, srow, erow, families, filters, uint64(stime), uint64(etime), uint32(limit), uint32(offset))
		}

		if err != nil {
			plugin.DataReply(-100, err.Error())
			return err
		}

		if scanner == nil {
			// skip this region
			plugin.DbgLog("Scanner skipped. Skip this region")
			continue
		}

		for {
			r, err := scanner.Next()
			if err != nil {
				if err == io.EOF {
					break
				} else {
					plugin.DbgLog("scan next failed. %v", err)
					plugin.DataReply(-100, err.Error())
					return err
				}
			}
			writer.Write(r)
		}
	}

	err = writer.Close()
	if err != nil {
		plugin.DataReply(-100, err.Error())
		return err
	}
	plugin.DataReply(0, "")
	return nil
}

repository: vitesse-ftian/dgtools

repo_name: vitesse-ftian/dgtools


text:
package path

import (
	"os"
	"testing"
)

var test = "test"

func TestHistory(t *testing.T) {
	if err := os.Setenv("CRANE_PATH", test); err != nil {
		t.Fatal("setenv error")
	}

	want := test + "/history"
	got := History()
	if got != want {
		t.Error("want", want, "got", got)
	}
}

repository: WinDaLex/crane

repo_name: WinDaLex/crane


text:
DESCRIPTION = "Custom .bashrc and .qtenv files"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

S = "${WORKDIR}"

PR = "r8"

SRC_URI = " \
	   file://.qtenv \
	   file://.bashrc \
	   file://.profile \
	   "

do_install() {
	install -d -m 0644 ${D}/home/root
	install -m 0644 .bashrc ${D}/home/root/.bashrc
	install -m 0644 .qtenv ${D}/home/root/.qtenv
	install -m 0644 .profile ${D}/home/root/.profile
}

FILES_${PN} += " \
		/home/root/.qtenv \
		/home/root/.bashrc \
		/home/root/.profile \
		"


text:
# Copyright (C) 2019, MYIR - All Rights Reserved

inherit systemd

DESCRIPTION = "emmc_mount"
LICENSE = "MIT"
PV = "1"
PR = "r0"

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = " \
	    file://emmc_mount.sh \
		file://profile \
	    file://emmc_mount.service \
          "
S_G = "${WORKDIR}"

do_install () {
      install -d ${D}/lib/systemd/system/
      install -d ${D}/etc/
      install -d ${D}/usr/bin/

      install -m 0644 ${S_G}/profile ${D}/etc/
      install -m 0644 ${S_G}/emmc_mount.service ${D}/lib/systemd/system/
      install -m 0777 ${S_G}/emmc_mount.sh ${D}/usr/bin/
}

FILES_${PN} = "/lib/systemd/system/ \
		 /etc \
	     /usr/bin/ \
             "

#For dev packages only
INSANE_SKIP_${PN}-dev = "ldflags"
INSANE_SKIP_${PN} = "${ERROR_QA} ${WARN_QA}"
SYSTEMD_SERVICE_${PN} = "emmc_mount.service"
SYSTEMD_AUTO_ENABLE_${PN} = "enable"

repository: MYiR-Dev/meta-myir-st-tiny

repo_name: MYiR-Dev/meta-myir-st-tiny


text:
SUMMARY = "bitbake-layers recipe"
DESCRIPTION = "Demo: a recipe within 'meta-myapps' layer; builds a C prg named 'react' (try it!)"
SECTION = "apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "\
	file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \
	"

# Location of files
#  Tip: append '; unpack=0 \' to not unpack the file
SRC_URI = " file://common.c \
            file://common.h \
            file://Makefile \
            file://react.c \
   "

# The FILE_${PN} addition below is required to avoid the 'installed but not shipped in any package'
# error; it's left commented out by default
# (Note- honister 3.4 onwards, the syntax is of the form x:y not x_y !
#FILES:${PN} += "${base_prefix}/ helloworld_loops.c \"

S = "${WORKDIR}"

#do_compile () {
#   echo "$(pwd); ls: $(ls)"
#}
do_install () {
    bbplain "********* myreactapp recipe: do_install() *********"
	# Specify install commands here; examples below:
	# (1) create a dir /etc/init.d with:
	#  install -d -m 0755 ${D}/etc/init.d
	# (2) Tip: to generate a soft link, first cd to the dir
    #     and then create it;
	#  cd /etc/rc5.d
	#  ln -s ../init.d/myprg_install.sh S99myprg
	echo "S = ${S}; ls:  $(ls $S)"
	install -d -m 0755 ${D}${bindir}
	install -m 0755 ${S}/react ${D}${bindir}
		# $bindir = /usr/bin/
}


text:
package state

import (
	"../luavalue"
)

// CreateTable s
func (me *LuaState) CreateTable(nArr, nRec int) {
	me.stack.Push(luavalue.NewLuaTable(nArr, nRec))
}

// NewTable s
func (me *LuaState) NewTable() {
	me.CreateTable(0, 0)
}

// tableGet s
func (me *LuaState) tableGet(table, key luavalue.ILuaValue) luavalue.ILuaValue {
	if table.Type() == luavalue.LuaTypeTable {
		return table.(*luavalue.LuaTable).Get(key)
	}
	panic("LuaState TableGet: 指定索引处的值并非LuaTable")
}

// TableGet 表Get
// 弹出栈顶的key，并从索引为index的表中获取值后推入栈顶 返回值的类型
func (me *LuaState) TableGet(index int) luavalue.ELuaType {
	value := me.tableGet(me.stack.Get(index), me.stack.Pop())
	me.stack.Push(value)
	return value.Type()
}

// TableGetField 表Get
func (me *LuaState) TableGetField(index int, key string) luavalue.ELuaType {
	value := me.tableGet(me.stack.Get(index), luavalue.NewLuaString(key))
	me.stack.Push(value)
	return value.Type()
}

// TableGetIndex 表Get
func (me *LuaState) TableGetIndex(index int, elIndex int64) luavalue.ELuaType {
	value := me.tableGet(me.stack.Get(index), luavalue.NewLuaInteger(elIndex))
	me.stack.Push(value)
	return value.Type()
}

// tableGet s
func (me *LuaState) tableSet(table, key, value luavalue.ILuaValue) {
	if table.Type() == luavalue.LuaTypeTable {
		table.(*luavalue.LuaTable).Put(key, value)
	}
	panic("LuaState tableSet: 指定索引处的值并非LuaTable")
}

// TableSet s
func (me *LuaState) TableSet(index int) {
	table := me.stack.Get(index)
	value := me.stack.Pop()
	key := me.stack.Pop()
	me.tableSet(table, key, value)
}

// TableSetField s
func (me *LuaState) TableSetField(index int, key string) {
	me.tableSet(
		me.stack.Get(index),
		luavalue.NewLuaString(key),
		me.stack.Pop(),
	)
}

// TableSetIndex s
func (me *LuaState) TableSetIndex(index int, elIndex int64) {
	me.tableSet(
		me.stack.Get(index),
		luavalue.NewLuaInteger(elIndex),
		me.stack.Pop(),
	)
}

repository: my-lua/lua-vm

repo_name: my-lua/lua-vm


text:
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
  "CXX"
  )
# The set of files for implicit dependencies of each language:
set(CMAKE_DEPENDS_CHECK_CXX
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/active_test.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/active_test.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/all_sensors.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/all_sensors.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/channels_signals_setup.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/channels_signals_setup.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/electrodes_cont.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/electrodes_cont.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/end_of_stim.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/end_of_stim.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/main_scr.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/main_scr.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/passive_test.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/passive_test.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/pattern.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/pattern.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/printing_functions.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/printing_functions.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/self_test.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/self_test.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/setup.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/setup.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/square_pulses.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/square_pulses.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/stimulation.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/stimulation.cpp.o"
  "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/test_main.cpp" "/home/b-rain/PycharmProjects/memristive-spinal-cord/screens/tmp/CMakeFiles/main.dir/test_main.cpp.o"
  )
set(CMAKE_CXX_COMPILER_ID "GNU")

# The include file search paths:
set(CMAKE_CXX_TARGET_INCLUDE_PATH
  )

# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
  )

# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")

repository: research-team/memristive-spinal-cord

repo_name: research-team/memristive-spinal-cord

gha_language: Python

extension: cmake


text:
@InProceedings{li16c,
  supplementary = {Supplementary:li16c-supp.pdf},
  title = {An Improved Convergence Analysis of Cyclic Block Coordinate Descent-type Methods for Strongly Convex Minimization},
  author = {Li, Xingguo and Zhao, Tuo and Arora, Raman and Liu, Han and Hong, Mingyi},
  pages = {491-499},
  abstract = {The cyclic block coordinate descent-type (CBCD-type) methods have shown remarkable computational performance for solving strongly convex minimization problems. Typical applications include many popular statistical machine learning methods such as elastic-net regression, ridge penalized logistic regression, and sparse additive regression. Existing optimization literature has shown that the CBCD-type methods attain iteration complexity of $O(p\cdot\log(1/\epsilon))$,  where $\epsilon$ is a pre-specified accuracy of the objective value, and $p$ is the number of blocks. However, such iteration complexity explicitly depends on $p$, and therefore is at least $p$ times worse than those of gradient descent methods. To bridge this theoretical gap, we propose an improved convergence analysis for the CBCD-type methods. In particular, we first show that for a family of quadratic minimization problems, the iteration complexity of the CBCD-type methods matches that of the GD methods in term of dependency on $p$ (up to a $\log^2 p$ factor). Thus our complexity bounds are sharper than the existing bounds by at least a factor of $p/\log^2p$. We also provide a lower bound to confirm that our improved complexity bounds are tight (up to a $\log^2 p$ factor) if the largest and smallest eigenvalues of the Hessian matrix do not scale with $p$. Finally, we generalize our analysis to other strongly convex minimization problems beyond quadratic ones.},
}

repository: mreid/papersite

repo_name: mreid/papersite

gha_language: TeX