text
stringlengths
2
1.04M
meta
dict
/* * Cell.h * * Created on: Sep 13, 2015 * Author: lurker */ #ifndef CELL_H_ #define CELL_H_ #include <cstdlib> #include <vector> #include <queue> #include <cmath> #include <iostream> #include <iterator> #include <string.h> #include <mexplus.h> #include <pprint.h> #include "utils.h" using namespace std; using namespace mexplus; class Integral { }; class Photon { public: Photon(double _x, double _y, double _intensity) : position {_x, _y}, intensity(_intensity), id(0){}; virtual ~Photon() { }; std::vector<double> position; double intensity; int id; }; enum class CellStatus { ROOT, BRANCH, LEAF, EMPTY, UNSET }; class Cell { public: Cell(const std::vector<double>& pos, double sz); virtual ~Cell(); void deleteParticles() noexcept; void split() noexcept; size_t getNumParticles() const noexcept; void addParticle(Photon* p) noexcept; CellStatus getStatus() const noexcept; void setStatus(CellStatus status) noexcept; void clearParticles() noexcept; void updateCenterIntensity() noexcept; double getIntensity() noexcept; std::vector<double>& getCenter() noexcept; void setSize(double size) noexcept; double getSize() const noexcept; Cell* getParent() const noexcept; std::vector<Cell*>& getChildren() noexcept; void setParent(Cell* parent) noexcept; friend void buildmatrix(Cell* cell) noexcept; std::vector<Photon*> particles; std::vector<double> position; private: double size; std::vector<Cell*> children; CellStatus status; double intensity; std::vector<double> center; Cell* parent; }; #endif /* CELL_H_ */
{ "content_hash": "831869510813ec4d5c0aca60b9a4ba46", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 50, "avg_line_length": 14.990654205607477, "alnum_prop": 0.6976309226932669, "repo_name": "GaZ3ll3/femex", "id": "6f3d8532a7fcb060ebffa2c6cce2994d6997c57a", "size": "1604", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/FMM/private/Cell.h", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "4450660" }, { "name": "C++", "bytes": "3354227" }, { "name": "Forth", "bytes": "221" }, { "name": "Fortran", "bytes": "361181" }, { "name": "Makefile", "bytes": "87972" }, { "name": "Matlab", "bytes": "267626" }, { "name": "Shell", "bytes": "69610" } ], "symlink_target": "" }
@interface UILabel (DDHitEdgeInsets) @end
{ "content_hash": "e2e10a8f4da29c81751b197bbaa97cd5", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 36, "avg_line_length": 14.333333333333334, "alnum_prop": 0.7906976744186046, "repo_name": "393385724/DDCategoryDemo", "id": "4a8b525dbe4f766ff0e52fc4226906ce3a003e91", "size": "223", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DDCategory/HitEdgeInsets/UILabel+DDHitEdgeInsets.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "59371" }, { "name": "Ruby", "bytes": "1387" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_20) on Mon May 02 10:23:15 CEST 2011 --> <TITLE> Uses of Class play.mvc.Scope.Session (Play! API) </TITLE> <META NAME="date" CONTENT="2011-05-02"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class play.mvc.Scope.Session (Play! API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?play/mvc//class-useScope.Session.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Scope.Session.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>play.mvc.Scope.Session</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc">Scope.Session</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#play.mvc"><B>play.mvc</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="play.mvc"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc">Scope.Session</A> in <A HREF="../../../play/mvc/package-summary.html">play.mvc</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Fields in <A HREF="../../../play/mvc/package-summary.html">play.mvc</A> declared as <A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc">Scope.Session</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected static&nbsp;<A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc">Scope.Session</A></CODE></FONT></TD> <TD><CODE><B>WebSocketController.</B><B><A HREF="../../../play/mvc/WebSocketController.html#session">session</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected static&nbsp;<A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc">Scope.Session</A></CODE></FONT></TD> <TD><CODE><B>Controller.</B><B><A HREF="../../../play/mvc/Controller.html#session">session</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The current HTTP session.</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Fields in <A HREF="../../../play/mvc/package-summary.html">play.mvc</A> with type parameters of type <A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc">Scope.Session</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;java.lang.ThreadLocal&lt;<A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc">Scope.Session</A>&gt;</CODE></FONT></TD> <TD><CODE><B>Scope.Session.</B><B><A HREF="../../../play/mvc/Scope.Session.html#current">current</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../play/mvc/package-summary.html">play.mvc</A> that return <A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc">Scope.Session</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc">Scope.Session</A></CODE></FONT></TD> <TD><CODE><B>Scope.Session.</B><B><A HREF="../../../play/mvc/Scope.Session.html#current()">current</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../play/mvc/Scope.Session.html" title="class in play.mvc"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?play/mvc//class-useScope.Session.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Scope.Session.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <a href="http://guillaume.bort.fr">Guillaume Bort</a> &amp; <a href="http://www.zenexity.fr">zenexity</a> - Distributed under <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache 2 licence</a>, without any warrantly </BODY> </HTML>
{ "content_hash": "2de52161e90c3f0a9b84c4c423a6ea8c", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 232, "avg_line_length": 43.66818181818182, "alnum_prop": 0.6307900489226606, "repo_name": "lafayette/JBTT", "id": "229d2dc2384c5f2314347932f6f8253c45afb1b4", "size": "9607", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "framework/documentation/api/play/mvc/class-use/Scope.Session.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "76128" }, { "name": "C++", "bytes": "30518" }, { "name": "Java", "bytes": "1882568" }, { "name": "JavaScript", "bytes": "1326008" }, { "name": "Python", "bytes": "8682515" }, { "name": "Shell", "bytes": "1977" } ], "symlink_target": "" }
#include "config.h" #include "SearchableSearchUnit.h" #include "SearchableStringSearch.h" #include "ModuleMap.h" #include "DataBuffer.h" #include "MapPacket.h" #include "SearchMatch.h" #include "SearchQuery.h" #include "SearchResult.h" #include "SearchSorting.h" #include "GfxUtility.h" #include "CountryCodeStringTable.h" #include "StringSearchUtility.h" #include "STLStrComp.h" #include "DeleteHelpers.h" #include "STLUtility.h" SearchableSearchUnit::SearchableSearchUnit() : SearchUnit() { // Nothing yet } void SearchableSearchUnit::createMultiStringSearch() { m_multiSearch = new SearchableMultiStringSearch(m_searchMap); m_ownedMultiStringSearch = m_multiSearch; } bool SearchableSearchUnit::loadFromMapModule(uint32 mapID) { char handshake[1024]; sprintf(handshake, "Please send map number %d", mapID); // One try only Readable* sock = ModuleMap::getMapLoadingReadable(mapID, MapRequestPacket::MAPREQUEST_SEARCH, handshake); if ( sock == NULL ) { return false; } // Read the size of the real databuffer DataBuffer length(4); if (sock->read(length.getBufferAddress(), 4) != 4 ) { delete sock; return false; } int mapSize = length.readNextLong(); DataBuffer bigBuf(mapSize); if ( sock->read(bigBuf.getBufferAddress(), mapSize) != mapSize ) { delete sock; return false; } delete sock; return load(bigBuf); } int SearchableSearchUnit:: expandIDs(vector<pair<uint32, OverviewMatch*> >& expandedMatches, const vector<pair<uint32,IDPair_t> >& idsToExpand, bool expand) const { // Expand the id:s vector<pair<uint32, IDPair_t> > expandedIDs; m_searchMap->expandIDs(expandedIDs, idsToExpand, expand); // Convert the IDPair_t:s to matches. // Fill in the most important features for( vector<pair<uint32, IDPair_t> >::const_iterator it = expandedIDs.begin(); it != expandedIDs.end(); ++it ) { // Look up the item const SearchMapItem* item = m_searchMap->getItemByItemID(it->second); if ( item == NULL ) { // Oj. Translated item = m_searchMap->getItemByItemID( m_searchMap->translateToHigher(it->second)); if ( item == NULL ) { mc2log << fatal << "[SSU]: Item not found and not higher level " << "either: ID: " << it->second << endl; continue; } } OverviewMatch* ov = new OverviewMatch(it->second); ov->setRadiusMeters(item->getRadiusMeters(m_searchMap)); // Set coordinates - mostly to avoid error codes when sorting. ov->setCoords(item->getCoordinate(m_searchMap)); // Also set the name. It can be nice when debugging. ov->setName(item->getBestName(m_searchMap, LangTypes::swedish).first); expandedMatches.push_back(make_pair(it->first, ov)); } return expandedMatches.size(); } VanillaRegionMatch* SearchableSearchUnit::createRegionMatch(uint32 itemIdx, const SearchQuery& query) const { const SearchMapItem* item = m_searchMap->getItemByIndex(itemIdx); const LangTypes::language_t lang = query.getParams().getRequestedLanguage(); // FIXME: Remove this from constuctor const SearchMatchPoints points; VanillaRegionMatch* regionMatch = new VanillaRegionMatch(item->getBestName(m_searchMap, lang).first, 0, // nameinfo item->getID(m_searchMap).getMapID(), item->getID(m_searchMap).getItemID(), item->getSearchType(m_searchMap), points, // Not important, really. 0, // Source item->getBestName(m_searchMap, lang).first, 0, // Location 0, // Restrictions item->getItemType(m_searchMap), 0); // ItemSubtype - FIXME. return regionMatch; } void SearchableSearchUnit::addRegionsToMatch(SearchMatch* match, uint32 itemIdx, const SearchQuery& query, int level) const { // Example // Our item is in A, B, C and D // A and B are in C and C is in D // Foreach region // if region is inside other region -> remove _other_ region // or if no region is inside a region -> keep region // After this call this function for every remaining region. // FIXME: Move this functionality to the SearchUnitBuilder. // WARNING: There is code similar to this in MapProcessor. Change it // too if you do something useful here. const SearchMapItem* item = m_searchMap->getItemByIndex(itemIdx); uint32 returnRegionTypes = query.getParams().getReturnRegionTypes(); for( SearchMapRegionIterator it = item->getRegionBegin(m_searchMap); it != item->getRegionEnd(m_searchMap); ++it ) { mc2dbg8 << "SearchableSearchUnit::addRegionsToMatch regionID:" << (*it) << endl; if ( REGION_SHOULD_NOT_BE_DISPLAYED( *it ) ) { // The item should only be found in the region. continue; } // Update the points for the match if ( query.isOriginalRegionIdx(*it) ) { match->getPointsForWriting().setCorrectLocation(true); } // Add points if the name of the location is the same as the // item itself (Lund, Lund) if ( item->oneNameSameCase(m_searchMap, m_searchMap->getItemByIndex(*it))) { match->getPointsForWriting().setCorrectLocation(true); } bool noRegionInside = true; // Check type if it-item. Skip it if it is not among the allowed. if ( ! (m_searchMap->getItemByIndex(*it)->getSearchType(m_searchMap) & returnRegionTypes ) ) { continue; } for( SearchMapRegionIterator jt = item->getRegionBegin(m_searchMap); jt != item->getRegionEnd(m_searchMap); ++jt ) { if ( it == jt ) continue; if ( REGION_SHOULD_NOT_BE_DISPLAYED(*jt) ) continue; // Check type if jt-item if ( ! (m_searchMap->getItemByIndex(*jt)->getSearchType(m_searchMap) & returnRegionTypes ) ) { continue; } if ( m_searchMap->isInsideRegion(m_searchMap->getItemByIndex(*jt), *it) ) { // A region was inside it noRegionInside = false; break; } } if ( noRegionInside ) { // No other region was inside this region, means lowest level. if ( m_searchMap->getItemByIndex(*it)->getSearchType(m_searchMap) & query.getParams().getReturnRegionTypes() ) { // This type of region should be added VanillaRegionMatch* regionMatch = createRegionMatch(*it, query); mc2dbg4 << "[SSU]: Created region " << regionMatch->getName() << " at level = " << level << endl; // Add the regions to that match too. addRegionsToMatch(regionMatch, *it, query, level+1); // Add our region to the original match. match->addRegion(regionMatch, true); } else { // The type of region was not wanted. // Add regions to our old match, but from the region // Will not work very well because of the zip-codes // E.g. 22220 is in the citypart Väster. // Spolegatan is in Innerstaden and 22220, if we just // skip the 22220 we will end up with both Innerstaden and // Väster. //addRegionsToMatch(match, *it, query, level + 1); } } } } inline pair<const char*, LangTypes::language_t> SearchableSearchUnit::getNameToUse(const SearchQuery& query, const SearchResultElement* curElement) const { const SearchMapItem* const curItem = curElement->getItem(); // Get the matched name int matchedName = curElement->getNameNbr(); if ( curItem->getNameType( m_searchMap, matchedName ) == ItemTypes::synonymName ) { if ( curItem->getSearchType( m_searchMap) & SEARCH_ALL_REGION_TYPES ) { // Keep synonym names for regions. E.g. Göteborg->Frölunda return pair<const char*, LangTypes::language_t> (curItem->getName(m_searchMap, matchedName), LangTypes::invalidLanguage); // No language available } else { // Find the best name instead return curItem->getBestName(m_searchMap, query.getParams().getRequestedLanguage(), matchedName); } } else { // Keep name return pair<const char*, LangTypes::language_t> (curItem->getName(m_searchMap, matchedName), LangTypes::invalidLanguage); // No language available } } inline bool SearchableSearchUnit::addSynonymNameTo( VanillaCompanyMatch* poi, const SearchQuery& query, const SearchMapItem* item, const SearchMapPOIInfo* poiInfo ) const { if ( item->getItemType( m_searchMap ) != ItemTypes::pointOfInterestItem ) { return false; } // Select when to add. switch ( ItemTypes::pointOfInterest_t ( poiInfo->getItemSubType ( m_searchMap ) ) ) { case ItemTypes::busStation: case ItemTypes::cityCentre: case ItemTypes::commuterRailStation: case ItemTypes::ferryTerminal: case ItemTypes::railwayStation: case ItemTypes::postOffice: case ItemTypes::tramStation: break; default: // Don't add. // RETURN !! return false; break; } // Get the best synonym name given the requested language. const char* synonymName = item->getBestNameOfType( m_searchMap, query.getReqLang(), ItemTypes::synonymName); if ( synonymName == NULL ) { // No synonym name could be found. return false; } // AVOID SHOUTING! MC2String lowerString = MC2String(StringUtility::copyLower(synonymName)); MC2String capitalString = StringUtility::makeFirstInWordCapital(lowerString); // Now add the name poi->setName((MC2String(poi->getName()) + "(" + capitalString + ")").c_str()); return true; } inline SearchMatch* SearchableSearchUnit::createSearchMatch(const SearchResultElement* curElement, const SearchQuery& query) const { SearchMatch* curMatch = NULL; const SearchMapItem* curItem = curElement->getItem(); // Extract some variables from the element const IDPair_t id(curItem->getID(m_searchMap)); // FIXME: Choose a name if it is a synonym name. pair<const char*, LangTypes::language_t> name = getNameToUse(query, curElement); const char* alphaSortingName = name.first; const char* locationName = "LOCATION"; // Adds the matching string (mostly synonymname) to result // if not returning matching string. const char* matchedName = curItem->getName( m_searchMap, curElement->getNameNbr() ); MC2String nameAndMatched( name.first ); bool addSynonymNameToPois = query.getParams().getAddSynonymNameToPOIs(); if ( matchedName != name.first ) { // STRCMP!!!? Works as is! nameAndMatched.append( " (" ); // AVOID SHOUTING! MC2String lowerString = StringUtility::copyLower( matchedName ); lowerString = StringUtility::makeFirstInWordCapital( lowerString ); nameAndMatched.append( lowerString ); nameAndMatched.append( ")" ); name.first = nameAndMatched.c_str(); // Don't add the synonyme to the poi since it is probably added // already. A check is really needed to see if the extra name // added here really is a synonym name. addSynonymNameToPois = false; } const SearchMatchPoints& points = curElement->getPoints(); LangTypes::language_t language = LangTypes::invalidLanguage; if( name.second == LangTypes::invalidLanguage ) { uint32 stringIndex = curElement->getNameInfo(); language = GET_STRING_LANGUAGE(stringIndex); } else { language = name.second; } switch ( curItem->getSearchType(m_searchMap) ) { case SEARCH_STREETS: curMatch = new VanillaStreetMatch( id, name.first, locationName, 0, // offset 0, // house number CountryCodeStringTable::streetNumberFirst(m_searchMap->getCountryCode(), language), CountryCodeStringTable::streetNumberComma(m_searchMap->getCountryCode(), language) ); break; case SEARCH_COMPANIES: curMatch = new VanillaCompanyMatch( id, name.first, locationName, 0, // offset 0 ); // house number break; case SEARCH_MISC: curMatch = new VanillaMiscMatch( id, name.first, locationName); break; case SEARCH_CATEGORIES: curMatch = new VanillaCategoryMatch( id, name.first, locationName); break; case SEARCH_MUNICIPALS: case SEARCH_BUILT_UP_AREAS: case SEARCH_CITY_PARTS: case SEARCH_ZIP_CODES: case SEARCH_ZIP_AREAS: // All these will be the same in the packet and will // be correctly typed when read from the packet in the // server. curMatch = new VanillaRegionMatch( name.first, 0, // nameInfo id.getMapID(), id.getItemID(), curItem->getSearchType(m_searchMap), points, 0, // source alphaSortingName, 0, // location 0, // restrictions curItem->getItemType(m_searchMap), MAX_UINT16 ); // itemsubtype, // only companies. break; } if ( curMatch == NULL ) { return curMatch; } // Set some variables // Set the points curMatch->setPoints(curElement->getPoints()); // Set the map rights curMatch->setMapRights( curElement->getMapRights() ); // Add the regions. addRegionsToMatch(curMatch, curItem->getIndex(m_searchMap), query); // And set a location name curMatch->updateLocationName(query.getParams().getReturnRegionTypes()); // Set itemtype curMatch->setItemType(curItem->getItemType(m_searchMap)); // Set cordinates curMatch->setCoords(curItem->getCoordinate(m_searchMap)); mc2dbg8 << "[SSU]: Setting coordinate = " << curMatch->getCoords() << " for " << *curMatch << endl; // Set distance if ( query.getParams().getSortOrigin().isValid() ) { mc2dbg8 << "[SSU]: Sort origin is valid" << endl; const MC2Coordinate& origin(query.getParams().getSortOrigin()); if ( curMatch->getCoords().isValid() ) { double distanceSq = GfxUtility::squareP2Pdistance_linear(origin.lat, origin.lon, curMatch->getCoords().lat, curMatch->getCoords().lon); double distance = ::sqrt(distanceSq); uint32 intDist = uint32(distance); curMatch->setDistance(intDist); mc2dbg8 << "[SSU]: Set distance = " << intDist << endl; } else { curMatch->setDistance(MAX_UINT32); } } if ( curItem->getSearchType(m_searchMap) & SEARCH_COMPANIES ) { // We must find out some more information about companies. // Side wasn't set by the old module, so I will not set it // here const SearchMapPOIInfo* poiInfo = m_searchMap->getPOIInfoFor(curItem); if ( poiInfo ) { mc2dbg8 << "[SSU]: Found poiinfo for " << curItem->getID(m_searchMap) << endl; VanillaCompanyMatch* company = static_cast<VanillaCompanyMatch*>(curMatch); // Set itemsubtype company->setItemSubType(poiInfo->getItemSubType(m_searchMap)); // Add synonym name if it is not added already. if ( addSynonymNameToPois ) { addSynonymNameTo( company, query, curItem, poiInfo ); } company->setSpecialImage( poiInfo->getSpecialImage() ); company->setCategories( poiInfo->getCategories() ); if ( query.getParams().getAddSSINameToCompanies() ) { // Save the clean company name company->setCleanCompanyName( company->getName() ); if ( poiInfo->getNbrAddresses(m_searchMap) != 0 ) { // Set this to 0 because otherwise maybe the gfxclient // will write the streetnumber twice. // The street number is included if not zero later. company->setStreetNbr( 0 ); mc2dbg8 << "[SSU]: Number on street = " << poiInfo->getNumberOnStreet(m_searchMap) << endl; const char* oldName = curMatch->getName(); pair<const char*, LangTypes::language_t> addressPair = poiInfo->getBestAddress( m_searchMap, query.getParams().getRequestedLanguage() ); char* bestAddress = StringUtility::newStrDup(addressPair.first); const char* commaSpace = ", "; // Remove commas(',') from bestAddress char* pos = bestAddress; while ( *pos != '\0' ) { if ( *pos == ',' ) { *pos = ' '; } ++pos; } char* newName = new char[strlen(oldName)+1 + strlen(bestAddress) + 1 + strlen(commaSpace) + 1 + 20]; if ( poiInfo->getNumberOnStreet(m_searchMap) != 0 ) { bool streetNumberFirst = CountryCodeStringTable::streetNumberFirst(m_searchMap->getCountryCode(), addressPair.second); bool streetNumberComma = CountryCodeStringTable::streetNumberComma(m_searchMap->getCountryCode(), addressPair.second); if( streetNumberFirst ) { if( streetNumberComma ) { sprintf( newName, "%s%s%u, %s", oldName, commaSpace, poiInfo->getNumberOnStreet(m_searchMap), bestAddress); } else { sprintf( newName, "%s%s%u %s", oldName, commaSpace, poiInfo->getNumberOnStreet(m_searchMap), bestAddress); } } else { if( streetNumberComma ) { sprintf( newName, "%s%s%s, %u", oldName, commaSpace, bestAddress, poiInfo->getNumberOnStreet(m_searchMap)); } else { sprintf( newName, "%s%s%s %u", oldName, commaSpace, bestAddress, poiInfo->getNumberOnStreet(m_searchMap)); } } } else { sprintf( newName, "%s%s%s", oldName, commaSpace, bestAddress ); } company->setName(newName); delete [] newName; delete [] bestAddress; } else { // else remove , from name // TODO: Remove comma from companyname if // AddStreetNamesToCompanies is true and // no address was added to name. Wayfinder(Nav2) extracts // address by looking for ','. 20030711 const char* oldName = curMatch->getName(); if ( strchr( oldName, ',' ) != NULL ) { char* newName = new char[ strlen( oldName ) + 1 ]; strcpy( newName, oldName ); char* cPos = strchr( newName, ',' ); while ( cPos != NULL ) { cPos[ 0 ] = ' '; // Removing ',' cPos = strchr( cPos, ',' ); } company->setName( newName ); delete [] newName; } // Else no ',' to remove do nothing } // End else remove comma } } } if ( curItem->getSearchType(m_searchMap) & SEARCH_STREETS ) { // Set the house number so that the server can send it to // MapModule for expansion. VanillaStreetMatch* street = static_cast<VanillaStreetMatch*>(curMatch); // Some special searches doesn't have parts, like proximity so check if ( curElement->getQueryPart() < query.getNbrParts() ) { street->setStreetNbr( query.getHouseNumber( curElement->getQueryPart() ) ); } street->setStreetSegmentID(id.getItemID()); } return curMatch; } void SearchableSearchUnit:: convertInternalResultToMatches(SearchUnitSearchResult& result, const SearchQuery& query, const SearchResult& internalResult) const { for( SearchResult::const_iterator it = internalResult.begin(); it != internalResult.end(); ++it ) { const SearchResultElement* curElement = *it; const SearchMapItem* curItem = curElement->getItem(); mc2dbg8 << "[SSU]: Hit has id = " << curItem->getID(m_searchMap) << " and index " << curItem->getIndex(m_searchMap) << endl; result.push_back( static_cast<VanillaMatch*>(createSearchMatch(curElement,query))); } } int SearchableSearchUnit:: sortMatchesRemovingUnsorted( SearchUnitSearchResult& result, const UserSearchParameters& params) const { // Sort the result. uint32 nbrSorted = SearchSorting::sortSearchMatches(result, params.getSorting()); // Remove the matches that are not sorted. if ( nbrSorted < result.size() ) { for ( SearchUnitSearchResult::iterator it = result.begin() + nbrSorted; it != result.end(); ++it ) { delete *it; *it = NULL; } result.resize( nbrSorted ); } return nbrSorted; } int SearchableSearchUnit::search( SearchUnitSearchResult& result, const UserSearchParameters& params) const { SearchResult internalResult(m_searchMap); SearchQuery query(m_searchMap, params); // Search m_multiSearch->search(internalResult, query); // Convert the result convertInternalResultToMatches(result, query, internalResult); // Sort the result. int nbrSorted = sortMatchesRemovingUnsorted( result, params ); mc2dbg << "[SSU]: nbrSorted = " << nbrSorted << endl; return result.size(); } int SearchableSearchUnit:: overviewSearch(SearchUnitSearchResult& result, const UserSearchParameters& params) const { // Add everything that does not have to do with // converting matches to overview matches in this function. // Start by doing a normal search. search(result, params); int nbrRemoved = 0; // Try a new method. // Insert all the uppercase names in a map and then n² will have // a much smaller n. The disappointing thing is that the map can // take some time to build. // The time for 1700 hits for "a" in France has been reduced from // 10 seconds to 1 second, though (whopper). mc2dbg8 << "[SSU]: START building name removal map" << endl; typedef map<const char*, set<SearchUnitSearchResult::iterator>, strNoCaseCompareLess > nameMap_t; nameMap_t nameMap; for ( SearchUnitSearchResult::iterator it = result.begin(); it != result.end(); ++it ) { const SearchMapItem* searchItem = m_searchMap->getItemByItemID( (*it)->getID() ); int nbrNames = searchItem->getNbrNames( m_searchMap ); for ( int i = 0; i < nbrNames; ++i ) { // Do not add synonyms! if ( searchItem->getNameType( m_searchMap, i ) != ItemTypes::synonymName ) { const char* curName = searchItem->getName( m_searchMap, i ); nameMap[ curName ].insert( it ); } } } mc2dbg8 << "[SSU]: DONE building name removal map" << endl; // Some interesting values. uint32 maxNameMapSize = 0; const char* maxName = ""; // The old searchmodule used to remove the municipal // if there was a match with the same for a builtup area. // We will also do that for municipals inside builtup areas. mc2dbg8 << "[SSU]: START Removing areas with same names" << endl; // Must store the matches that are going to be deleted since // we might use their names in the name map. vector<SearchUnitSearchResult::value_type> toDelete; // First loop over the map with common names. for ( nameMap_t::iterator nit = nameMap.begin(); nit != nameMap.end(); ++nit ) { if( nit->second.size() < 2 ) { // Nothing to compare. continue; } if ( nit->second.size() > maxNameMapSize ) { maxName = nit->first; maxNameMapSize = nit->second.size(); } // Here the number of matches shouldn't be very high. for( set<SearchUnitSearchResult::iterator>::iterator xit = nit->second.begin(); xit != nit->second.end(); ++xit ) { SearchUnitSearchResult::iterator it = *xit; for( set<SearchUnitSearchResult::iterator>::iterator xjt = nit->second.begin(); xjt != nit->second.end(); ++xjt ) { SearchUnitSearchResult::iterator jt = *xjt; if ( (it == jt) || (*it == NULL) || (*jt == NULL) ) { // Same position or already removed continue; } const SearchMatch* munOrBua = *it; if ( ! ( munOrBua->getType() & (SEARCH_MUNICIPALS | SEARCH_BUILT_UP_AREAS ) ) ) { // No, it wasn't a municipal / bua continue; } // Also get the other item const SearchMatch* other = *jt; if ( munOrBua->getType() == other->getType() ) { // Same type continue; } // Get the item const SearchMapItem* munOrBuaItem = m_searchMap->getItemByItemID( munOrBua->getID() ); const SearchMapItem* otherItem = m_searchMap->getItemByItemID( other->getID() ); // Check if the other region is inside the outer area // and if they have the same names. if ( m_searchMap-> isInsideRegion(otherItem, munOrBuaItem->getIndex(m_searchMap)) && otherItem->oneNameSameCase(m_searchMap, munOrBuaItem) ) { // Remove it /*mc2dbg << "[SSSU]: Removing outer area " << munOrBuaItem->getID(m_searchMap) << MC2CITE(munOrBuaItem->getBestName( m_searchMap, LangTypes::english).first) << endl; delete *it; *it = NULL;*/ mc2dbg8 << "[SSSU]: Removing inner area " << otherItem->getID(m_searchMap) << MC2CITE(otherItem->getBestName( m_searchMap, LangTypes::english).first) << endl; // Since this item was in an item with the same name // we will add some points to it. (*it)->getPointsForWriting().setCorrectLocation(true); toDelete.push_back( *jt ); *jt = NULL; ++nbrRemoved; } } } } mc2dbg8 << "[SSU]: DONE Removing " << nbrRemoved << " areas with same names" << endl; mc2dbg8 << "[SSU]: Size of name map = " << nameMap.size() << endl; mc2dbg8 << "[SSU]: Max size of entry = " << maxNameMapSize << endl; mc2dbg8 << "[SSU]: Most common name = " << maxName << endl; STLUtility::deleteValues( toDelete ); // Check for zipcodes that are full matches - remove the others. bool fullZipFound = false; for( SearchUnitSearchResult::iterator it = result.begin(); it != result.end(); ++it ) { const SearchMatch* zipCode = *it; if ( zipCode == NULL ) { continue; } if ( ! ( zipCode->getType() & SEARCH_ZIP_CODES ) ) { continue; } if ( zipCode->getPoints().isFullMatch() ) { fullZipFound = true; break; } } if ( fullZipFound ) { // Remove the zipcodes that weren't full and not inside another zipcode // which is full // FIXME: Some kind of check if the zips have similar names? for( SearchUnitSearchResult::iterator it = result.begin(); it != result.end(); ++it ) { const SearchMatch* zipCode = *it; if ( zipCode == NULL ) { continue; } if ( ! ( zipCode->getType() & SEARCH_ZIP_CODES ) ) { continue; } if ( ! zipCode->getPoints().isFullMatch() ) { for( SearchUnitSearchResult::iterator itt = result.begin(); itt != result.end(); ++itt ) { const SearchMatch* currSearchMatch = *itt; if( currSearchMatch != NULL ) { if( currSearchMatch->getPoints().isFullMatch() ) { for( const SearchMatch* curReg = currSearchMatch; curReg != NULL; curReg = curReg->getRegion(0)) { if( curReg->getID().second == currSearchMatch->getID().second ) { // Remove not full zipcode mc2dbg << "[SSSU]: Removing zipcode " << zipCode->getID() << endl; delete *it; *it = NULL; ++nbrRemoved; break; } } } if( *it == NULL ) break; } } } } } return result.size() - nbrRemoved; } void SearchableSearchUnit:: convertMatchesToOverviewMatches(vector<OverviewMatch*>& result, const SearchUnitSearchResult& tempRes, uint8 nbrRemovedCharacters) const { for( SearchUnitSearchResult::const_iterator it = tempRes.begin(); it != tempRes.end(); ++it ) { const SearchMatch* vanilla = *it; if ( vanilla == NULL ) { continue; } // Create the overviewMatch - copy the stuff in the // other match. OverviewMatch* om = new OverviewMatch( *vanilla ); // Also look up the radius const SearchMapItem* searchItem = m_searchMap->getItemByItemID( om->getID() ); om->setRadiusMeters( searchItem->getRadiusMeters( m_searchMap ) ); om->setNbrRemovedCharacters(nbrRemovedCharacters); IDPair_t higherID( om->getID() ); IDPair_t lowerID( m_searchMap->translateToLower(higherID) ); // If the lower id cannot be found it should be an item // that consists of several other items, but where we only // want one hit. Send the overview id and let the server // expand the id later. if ( lowerID.isValid() ) { // It was possible to translate -> change the id of the // overview match. om->setMapID(lowerID.getMapID()); om->setItemID(lowerID.getItemID()); } // The overview id should always be overview ID. om->setOverviewID( higherID ); // Give the regions the same treatment as the match // itself. const int nbrRegions = om->getNbrRegions(); for( int i = 0; i < nbrRegions; ++i ) { VanillaRegionMatch* region = om->getRegion(i); // Original map ID uint32 raddMapID = region->getMapID(); uint32 raddItemID = region->getItemID(); // Lookup the overview id IDPair_t rhigher(raddMapID, raddItemID); IDPair_t rlower( m_searchMap->translateToLower(rhigher)); // If the lower id cannot be found it should be an item // that consists of several other items, but where we only // want one hit. Send the overview id and let the server // expand the id later. if ( rlower.isValid() ) { raddMapID = rlower.getMapID(); raddItemID = rlower.getItemID(); } region->setMapID(raddMapID); region->setItemID(raddItemID); } result.push_back(om); } } bool SearchableSearchUnit::okForMoreZipCodeSearching( const MC2String& str ) { // Minimum length 3 when removing characters and 2 when there is // a digit in the string. const uint ZIP_CODE_MIN_LENGTH = 3; char* close = StringUtility::newStrDup( StringSearchUtility::convertIdentToExact( str ).c_str()); const bool lengthOK = strlen(close) > ZIP_CODE_MIN_LENGTH; bool res = lengthOK || ( ( strlen(close) > (ZIP_CODE_MIN_LENGTH - 1 ) ) && StringUtility::containsDigit(close) ); delete [] close; return res; } int SearchableSearchUnit:: overviewSearch(vector<OverviewMatch*>& result, const UserSearchParameters& params, uint8 nbrRemovedCharacters) const { // FIXME: Use TopRegions to remove some of the matches. SearchUnitSearchResult tempRes; // Use the other search function overviewSearch(tempRes, params); // Tricks for Zip codes. The zipcodes in e.g. GB do not have // complete names so we have to remove the end of the codes // until we find something. if ( params.getRequestedTypes() & SEARCH_ZIP_CODES ) { if ( tempRes.empty () && okForMoreZipCodeSearching( params.getString() ) ) { // Copy the parameters, allow only zips and remove a character from // the string UserSearchParameters paramsCopy(params); paramsCopy.setRequestedTypes( SEARCH_ZIP_CODES ); // Set restrictions so that the server will sort out the // ones that are worst. paramsCopy.setRestriction(0x80); // Remove last character MC2String newStr( params.getSearchString(), params.getString().size() - 1 ); paramsCopy.setSearchString( newStr ); mc2dbg << "[SSU]: " << MC2CITE(params.getString()) << "->" << MC2CITE(newStr) << endl; MC2_ASSERT ( newStr.size() < params.getString().size() ); // Do the searching. overviewSearch( result, paramsCopy, nbrRemovedCharacters+1 ); } } // Now convert the SearchMatches to OverviewMatches. convertMatchesToOverviewMatches(result, tempRes, nbrRemovedCharacters); return result.size(); } int SearchableSearchUnit::proximitySearch(SearchUnitSearchResult& result, const UserSearchParameters& params, const vector<IDPair_t>& itemIDs) const { mc2dbg << "[SSU]: prox - nbrItems = " << itemIDs.size() << endl; // Create the query. SearchQuery query(m_searchMap, params); // Create fake matches for the items (as if they were found when searching) SearchResult internalResult(m_searchMap); for( vector<IDPair_t>::const_iterator it = itemIDs.begin(); it != itemIDs.end(); ++it ) { const SearchMapItem* curItem = m_searchMap->getItemByItemID(*it); if ( curItem == NULL ) { mc2log << warn << "[SSU]: prox - Item " << *it << " not found in map" << endl; continue; } // filter out specific pois if ( params.isPOIRequest() ) { const SearchMapPOIInfo* poiInfo = m_searchMap->getPOIInfoFor( curItem ); if ( poiInfo && ! STLUtility::has( params.getPOITypes(), poiInfo->getItemSubType( m_searchMap ) ) ) { // skip this poi type since it's not in our // requested poi types continue; } } SearchMatchPoints* points = new SearchMatchPoints; const int nameNbr = curItem->getBestNameNbr(m_searchMap, query.getParams().getRequestedLanguage()); SearchResultElement* curElement = new SearchResultElement(curItem, 0, points, nameNbr, curItem->getNameInfo(m_searchMap, nameNbr), m_searchMap->getRights( curItem ) ); internalResult.addResult(curElement, query.getReqLang() ); } // Convert the result to matches convertInternalResultToMatches(result, query, internalResult); // Sort the result. int nbrSorted = sortMatchesRemovingUnsorted( result, params ); mc2dbg << "[SSU]: nbrSorted = " << nbrSorted << endl; // Done! return result.size(); }
{ "content_hash": "030ecd04265e384203c8cf55ee2ca447", "timestamp": "", "source": "github", "line_count": 1036, "max_line_length": 129, "avg_line_length": 37.80984555984556, "alnum_prop": 0.5436930382170483, "repo_name": "wayfinder/Wayfinder-Server", "id": "cee2347abd81497cf9d8d6f311fc0f1e7c095c47", "size": "40699", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Server/Modules/SearchModule/src/SearchableSearchUnit.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "305133" }, { "name": "C++", "bytes": "31013369" }, { "name": "Java", "bytes": "398162" }, { "name": "Perl", "bytes": "1192824" }, { "name": "Python", "bytes": "28913" }, { "name": "R", "bytes": "712964" }, { "name": "Shell", "bytes": "388202" } ], "symlink_target": "" }
Version 0.95 (in development) ------------ - Issue #25: Standardize the API for image encoders - Issue #85: Detailed package overview - Issue #129: Request for StringUtil.contains method - Issue #152: Fixed ASDocs for the project to be generated - Issue #153: Fixed ASDocs for the project to be generated - Issue #160: Fix for URI class - Issue #161: Added another test for StringUtil - Issue #162: Add unit test required for StringUtil - Issue #164: Adding substitute method for variable injections - Issue #166: URI.isDirectory is broken - Issue #182: JSON encoding support for __HTMLScriptObjects / __HTMLScriptArrays - Issue #184: JSONEncoder bug on UTF-8 chars - Added release and packaging targets for the library - Added license file - Added generation of DEBUG swc as well - Fixed bugs in DateUtilTest.as pertaining to time zone issues Version 0.93 ------------ - Original release of the project at https://github.com/mikechambers/as3corelib
{ "content_hash": "53c8bed1277ac43cc6d15fe90476e78c", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 80, "avg_line_length": 39.791666666666664, "alnum_prop": 0.7518324607329843, "repo_name": "sangupta/as3corelib", "id": "df0666d1f0774c9fb46d42ee2a07d236051e2993", "size": "955", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ReleaseNotes.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ActionScript", "bytes": "573313" } ], "symlink_target": "" }
package org.sparkcommerce.common.email.domain; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Index; import org.hibernate.annotations.Parameter; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * @author jdasari * */ @Entity @Table(name = "SC_EMAIL_TRACKING_CLICKS") public class EmailTrackingClicksImpl implements EmailTrackingClicks { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; @Id @GeneratedValue(generator = "ClickId") @GenericGenerator( name="ClickId", strategy="org.sparkcommerce.common.persistence.IdOverrideTableGenerator", parameters = { @Parameter(name="segment_value", value="EmailTrackingClicksImpl"), @Parameter(name="entity_name", value="org.sparkcommerce.common.email.domain.EmailTrackingClicksImpl") } ) @Column(name = "CLICK_ID") protected Long id; @ManyToOne(optional=false, targetEntity = EmailTrackingImpl.class) @JoinColumn(name = "EMAIL_TRACKING_ID") @Index(name="TRACKINGCLICKS_TRACKING_INDEX", columnNames={"EMAIL_TRACKING_ID"}) protected EmailTracking emailTracking; @Column(nullable=false, name = "DATE_CLICKED") protected Date dateClicked; @Column(name = "CUSTOMER_ID") @Index(name="TRACKINGCLICKS_CUSTOMER_INDEX", columnNames={"CUSTOMER_ID"}) protected String customerId; @Column(name = "DESTINATION_URI") protected String destinationUri; @Column(name = "QUERY_STRING") protected String queryString; /* (non-Javadoc) * @see org.sparkcommerce.common.email.domain.EmailTrackingClicks#getId() */ @Override public Long getId() { return id; } /* (non-Javadoc) * @see org.sparkcommerce.common.email.domain.EmailTrackingClicks#setId(java.lang.Long) */ @Override public void setId(Long id) { this.id = id; } /* (non-Javadoc) * @see org.sparkcommerce.common.email.domain.EmailTrackingClicks#getDateClicked() */ @Override public Date getDateClicked() { return dateClicked; } /* (non-Javadoc) * @see org.sparkcommerce.common.email.domain.EmailTrackingClicks#setDateClicked(java.util.Date) */ @Override public void setDateClicked(Date dateClicked) { this.dateClicked = dateClicked; } /* (non-Javadoc) * @see org.sparkcommerce.common.email.domain.EmailTrackingClicks#getDestinationUri() */ @Override public String getDestinationUri() { return destinationUri; } /* (non-Javadoc) * @see org.sparkcommerce.common.email.domain.EmailTrackingClicks#setDestinationUri(java.lang.String) */ @Override public void setDestinationUri(String destinationUri) { this.destinationUri = destinationUri; } /* (non-Javadoc) * @see org.sparkcommerce.common.email.domain.EmailTrackingClicks#getQueryString() */ @Override public String getQueryString() { return queryString; } /* (non-Javadoc) * @see org.sparkcommerce.common.email.domain.EmailTrackingClicks#setQueryString(java.lang.String) */ @Override public void setQueryString(String queryString) { this.queryString = queryString; } /* (non-Javadoc) * @see org.sparkcommerce.common.email.domain.EmailTrackingClicks#getEmailTracking() */ @Override public EmailTracking getEmailTracking() { return emailTracking; } /* (non-Javadoc) * @see org.sparkcommerce.common.email.domain.EmailTrackingClicks#setEmailTracking(org.sparkcommerce.common.email.domain.EmailTrackingImpl) */ @Override public void setEmailTracking(EmailTracking emailTracking) { this.emailTracking = emailTracking; } /** * @return the customer */ @Override public String getCustomerId() { return customerId; } /** * @param customerId the customer to set */ @Override public void setCustomerId(String customerId) { this.customerId = customerId; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((customerId == null) ? 0 : customerId.hashCode()); result = prime * result + ((dateClicked == null) ? 0 : dateClicked.hashCode()); result = prime * result + ((destinationUri == null) ? 0 : destinationUri.hashCode()); result = prime * result + ((emailTracking == null) ? 0 : emailTracking.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!getClass().isAssignableFrom(obj.getClass())) return false; EmailTrackingClicksImpl other = (EmailTrackingClicksImpl) obj; if (id != null && other.id != null) { return id.equals(other.id); } if (customerId == null) { if (other.customerId != null) return false; } else if (!customerId.equals(other.customerId)) return false; if (dateClicked == null) { if (other.dateClicked != null) return false; } else if (!dateClicked.equals(other.dateClicked)) return false; if (destinationUri == null) { if (other.destinationUri != null) return false; } else if (!destinationUri.equals(other.destinationUri)) return false; if (emailTracking == null) { if (other.emailTracking != null) return false; } else if (!emailTracking.equals(other.emailTracking)) return false; return true; } }
{ "content_hash": "fb2cc489e9f2ed60c0a05d7e9fac1b3b", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 143, "avg_line_length": 29.627450980392158, "alnum_prop": 0.6436135009927201, "repo_name": "akdasari/SparkCommon", "id": "181049328d87de673b4d494b7f62496cef6e0a7b", "size": "6141", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/main/java/org/sparkcommerce/common/email/domain/EmailTrackingClicksImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "711" }, { "name": "Java", "bytes": "1572346" }, { "name": "JavaScript", "bytes": "13740" } ], "symlink_target": "" }
var errorObject_1 = require('./errorObject'); var tryCatchTarget; function tryCatcher() { try { return tryCatchTarget.apply(this, arguments); } catch (e) { errorObject_1.errorObject.e = e; return errorObject_1.errorObject; } } function tryCatch(fn) { tryCatchTarget = fn; return tryCatcher; } Object.defineProperty(exports, "__esModule", { value: true }); exports.default = tryCatch; ; //# sourceMappingURL=tryCatch.js.map
{ "content_hash": "6c39a372a6fca93bd70e70f995ae712c", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 62, "avg_line_length": 24.736842105263158, "alnum_prop": 0.6680851063829787, "repo_name": "iproduct/low-latency-high-throughput", "id": "665877340163ee4506e0fda2db4d6abd80bb20c2", "size": "470", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "IPT_Reactor_Demo_JUG_Wishes_1_0/src/main/webapp/node_modules/angular2/node_modules/@reactivex/rxjs/src/util/tryCatch.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2446" }, { "name": "HTML", "bytes": "3499" }, { "name": "Java", "bytes": "425345" }, { "name": "JavaScript", "bytes": "154699" }, { "name": "TypeScript", "bytes": "8674" } ], "symlink_target": "" }
(function() { tabris.registerWidget = function(type, members) { members = util.clone(members); members._listen = util.extend({}, tabris.registerWidget._defaultListen, members._listen || {}); members._trigger = util.extend({}, tabris.registerWidget._defaultTrigger, members._trigger || {}); if (members._checkProperty !== true) { members._checkProperty = util.extend({}, tabris.registerWidget._defaultCheckProperty, members._checkProperty || {}); } tabris.registerType(type, members); }; util.extend(tabris.registerWidget, { _defaultListen: { touchstart: true, touchmove: true, touchend: true, touchcancel: true, longpress: true, dispose: function() {}, "change:bounds": "Resize" }, _defaultTrigger: { Resize: "change:bounds" }, _defaultCheckProperty: { enabled: true, visibility: true, layoutData: true, font: true, backgroundImage: true, bounds: true, background: true, foreground: true, opacity: true, transform: true, highlightOnTouch: true } }); tabris.registerWidget("Button", { _type: "rwt.widgets.Button", _properties: {style: ["PUSH"]}, _listen: {selection: "Selection"}, _trigger: {Selection: "selection"}, _checkProperty: {alignment: true, image: true, text: true, style: true} }); tabris.registerWidget("Canvas", { _type: "rwt.widgets.Canvas", _supportsChildren: true }); tabris.registerWidget("CheckBox", { _type: "rwt.widgets.Button", _properties: {style: ["CHECK"]}, _listen: {"change:selection": "Selection"}, _trigger: {Selection: "change:selection"}, _checkProperty: {text: true, selection: true, style: true} }); tabris.registerWidget("Combo", { _type: "rwt.widgets.Combo", _listen: {"change:selection": "Selection"}, _trigger: {Selection: "change:selection"}, _checkProperty: {items: true, text: true, selectionIndex: true} }); tabris.registerWidget("Composite", { _type: "rwt.widgets.Composite", _supportsChildren: true }); tabris.registerWidget("ImageView", { _type: "tabris.ImageView", _checkProperty: {image: true, scaleMode: true} }); tabris.registerWidget("Label", { _type: "rwt.widgets.Label", _properties: {style: ["WRAP"]}, _checkProperty: {alignment: true, markupEnabled: true, text: true, style: true} }); tabris.registerWidget("ProgressBar", { _type: "rwt.widgets.ProgressBar", _checkProperty: {minimum: true, maximum: true, selection: true, state: true} }); tabris.registerWidget("RadioButton", { _type: "rwt.widgets.Button", _properties: {style: ["RADIO"]}, _listen: {"change:selection": "Selection"}, _trigger: {Selection: "change:selection"}, _checkProperty: {text: true, selection: true, style: true} }); tabris.registerWidget("Slider", { _type: "rwt.widgets.Scale", _listen: {"change:selection": "Selection"}, _trigger: {Selection: "change:selection"}, _checkProperty: {minimum: true, maximum: true, selection: true} }); tabris.registerWidget("Text", { _type: "rwt.widgets.Text", _create: function(properties) { var style = textTypeToStyle[properties.type] || textTypeToStyle["default"]; return this.super("_create", util.extend({style: style}, properties)); }, _listen: {focus: "FocusIn", blur: "FocusOut", accept: "DefaultSelection"}, _trigger: {FocusIn: "focus", FocusOut: "blur", DefaultSelection: "accept"}, _checkProperty: {type: true, text: true, message: true, editable: true, textLimit: true, style: true} }); var textTypeToStyle = { password: ["BORDER", "SINGLE", "PASSWORD"], search: ["BORDER", "SINGLE", "SEARCH"], multiline: ["BORDER", "MULTI"], default: ["BORDER", "SINGLE"] }; tabris.registerWidget("ToggleButton", { _type: "rwt.widgets.Button", _properties: {style: ["TOGGLE"]}, _listen: {"change:selection": "Selection"}, _trigger: {Selection: "change:selection"}, _checkProperty: {text: true, image: true, selection: true, alignment: true, style: true} }); tabris.registerWidget("Video", { _type: "tabris.widgets.Video", _properties: {controls_visible: true, repeat: false}, _checkProperty: {url: true} }); tabris.registerWidget("WebView", { _type: "rwt.widgets.Browser", _listen: {load: "Progress"}, _trigger: {Progress: "load"}, _checkProperty: {url: true} }); }());
{ "content_hash": "674311774bcc9a6721cccb5a7ebdd594", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 122, "avg_line_length": 30.931506849315067, "alnum_prop": 0.6313108945969885, "repo_name": "paulvi/tabris-js", "id": "65a8d6ed97d3193737dafe8e6a3398a311aaed4e", "size": "4584", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/js/Widgets.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "4233" }, { "name": "JavaScript", "bytes": "585340" } ], "symlink_target": "" }
package org.valkyriercp.command.config; import org.springframework.core.style.ToStringCreator; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; import org.valkyriercp.core.ButtonConfigurer; import org.valkyriercp.core.support.LabelInfo; import javax.swing.*; /** * An immutable parameter object consisting of the text, mnemonic character, mnemonic character * index and keystroke accelerator that may be associated with a labeled command button. * * <p> * This class also acts as a factory for creating instances of itself based on a string descriptor. * The syntax used for this descriptor is described in the javadoc for the {@link #valueOf(String)} * method. * * * @author Keith Donald * @author Kevin Stembridge * * @see LabelInfo * @see javax.swing.KeyStroke */ public final class CommandButtonLabelInfo implements ButtonConfigurer { /** A default instance to be used for command buttons with no label information. */ public static final CommandButtonLabelInfo BLANK_BUTTON_LABEL = new CommandButtonLabelInfo(""); private final LabelInfo labelInfo; private final KeyStroke accelerator; /** * Return an instance of this class, created by parsing the information in the given label * descriptor string. The expected format of this descriptor is the same as that used by * the {@link LabelInfo} class, with the following additions: * * <ul> * <li>The @ symbol is an escapable character.</li> * <li>Everything after the first unescaped @ symbol will be treated as the textual representation * of the keystroke accelerator.</li> * </ul> * * The expected format of the keystroke accelerator string is as described in the javadocs for the * {@link KeyStroke#getKeyStroke(String)} method. * * * @param labelDescriptor The label descriptor. May be null or empty, in which case, a default * blank label info will be returned. * @return A CommandButtonLabelInfo instance, never null. * * @throws IllegalArgumentException if {@code labelDescriptor} contains invalid syntax. * * @see LabelInfo * @see KeyStroke */ public static CommandButtonLabelInfo valueOf(String labelDescriptor) { if (!StringUtils.hasText(labelDescriptor)) { return BLANK_BUTTON_LABEL; } StringBuffer labelInfoBuffer = new StringBuffer(); char currentChar; KeyStroke keyStroke = null; for (int i = 0, textCharsIndex = 0; i < labelDescriptor.length(); i++, textCharsIndex++) { currentChar = labelDescriptor.charAt(i); if (currentChar == '\\') { int nextCharIndex = i + 1; //if this backslash is escaping an @ symbol, we remove the backslash and //continue with the next char if (nextCharIndex < labelDescriptor.length()) { char nextChar = labelDescriptor.charAt(nextCharIndex); if (nextChar == '@') { labelInfoBuffer.append(nextChar); i++; } else { labelInfoBuffer.append(currentChar); labelInfoBuffer.append(nextChar); i++; } } } else if (currentChar == '@') { //we've found the accelerator indicator if (i + 1 == labelDescriptor.length()) { throw new IllegalArgumentException( "The label descriptor [" + labelDescriptor + "] does not specify a valid accelerator after the last " + "non-espaced @ symbol."); } String acceleratorStr = labelDescriptor.substring(i + 1); keyStroke = KeyStroke.getKeyStroke(acceleratorStr); if (keyStroke == null) { throw new IllegalArgumentException( "The keystroke accelerator string [" + acceleratorStr + "] from the label descriptor [" + labelDescriptor + "] is not a valid keystroke format."); } break; } else { labelInfoBuffer.append(currentChar); } } LabelInfo info = LabelInfo.valueOf(labelInfoBuffer.toString()); return new CommandButtonLabelInfo(info, keyStroke); } /** * Creates a new {@code CommandButtonLabelInfo} that will display the given text on its label. * There will be no associated mnemonic character and no keystroke accelerator. * * @param text The label text to be displayed. Must not be null. * * @throws IllegalArgumentException if {@code text} is null. */ public CommandButtonLabelInfo(String text) { this(new LabelInfo(text), null); } /** * Creates a new {@code CommandButtonLabelInfo} with the given label information and keystroke * accelerator. * * @param labelInfo The label information. Must not be null. * @param accelerator The keystroke accelerator. May be null. * * @throws IllegalArgumentException if {@code labelInfo} is null. */ public CommandButtonLabelInfo(LabelInfo labelInfo, KeyStroke accelerator) { Assert.notNull(labelInfo, "labelInfo"); this.labelInfo = labelInfo; this.accelerator = accelerator; } /** * Returns the displayable text. * * @return The label text. Maybe an empty string but never null. */ public String getText() { return this.labelInfo.getText(); } /** * Returns the mnemonic for the label. * * @return The mnemonic for the label. */ public int getMnemonic() { return this.labelInfo.getMnemonic(); } /** * Returns the zero-based index for the mnemonic character within the label text. * * @return The mnemonic index or -1 to indicate that there is no associated mnemonic character. */ public int getMnemonicIndex() { return this.labelInfo.getMnemonicIndex(); } /** * Returns the keystroke accelerator for the label. * * @return The keystroke accelerator, or null. */ public KeyStroke getAccelerator() { return this.accelerator; } /** * {@inheritDoc} */ public int hashCode() { return this.labelInfo.hashCode() + (this.accelerator != null ? this.accelerator.hashCode() : 0); } /** * {@inheritDoc} */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CommandButtonLabelInfo)) { return false; } CommandButtonLabelInfo other = (CommandButtonLabelInfo)obj; if (!this.labelInfo.equals(other.labelInfo)) { return false; } if (!ObjectUtils.nullSafeEquals(this.accelerator, other.accelerator)) { return false; } return true; } /** * Configures an existing button appropriately based on this label info's * properties. * * @param button */ public AbstractButton configure(AbstractButton button) { Assert.notNull(button); button.setText(this.labelInfo.getText()); button.setMnemonic(this.labelInfo.getMnemonic()); button.setDisplayedMnemonicIndex(this.labelInfo.getMnemonicIndex()); configureAccelerator(button, getAccelerator()); return button; } /** * Sets the given keystroke accelerator on the given button. * * @param button The button. May be null. * @param keystrokeAccelerator The accelerator. May be null. */ protected void configureAccelerator(AbstractButton button, KeyStroke keystrokeAccelerator) { if ((button instanceof JMenuItem) && !(button instanceof JMenu)) { ((JMenuItem)button).setAccelerator(keystrokeAccelerator); } } /** * {@inheritDoc} */ public String toString() { return new ToStringCreator(this) .append("labelInfo", this.labelInfo) .append("accelerator", this.accelerator) .toString(); } }
{ "content_hash": "de0e704c0b6f6cfe75df1b928f18b3a4", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 104, "avg_line_length": 32.10112359550562, "alnum_prop": 0.6033134990082838, "repo_name": "lievendoclo/Valkyrie-RCP", "id": "1077ef7c098a89229d3272c36f66c98f2fae0312", "size": "9167", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "valkyrie-rcp-core/src/main/java/org/valkyriercp/command/config/CommandButtonLabelInfo.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2414" }, { "name": "CSS", "bytes": "40021" }, { "name": "Groovy", "bytes": "54472" }, { "name": "HTML", "bytes": "12312" }, { "name": "Haskell", "bytes": "756" }, { "name": "Java", "bytes": "3752679" }, { "name": "Shell", "bytes": "5183" } ], "symlink_target": "" }
using UnityEngine.EventSystems; namespace HoloToolkit.Unity.InputModule { /// <summary> /// Interface to implement to react to simple click input. /// </summary> public interface IInputClickHandler : IEventSystemHandler { void OnInputClicked(InputClickedEventData eventData); } }
{ "content_hash": "4b33d3261750c300f527ed2cb0f7491e", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 62, "avg_line_length": 26.083333333333332, "alnum_prop": 0.7124600638977636, "repo_name": "AllBecomesGood/Share-UpdateHolograms", "id": "bdcdd8fa02cce97df5beaf086ef77efc222b1b5e", "size": "315", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "ShareAndKeepSynced/Assets/HoloToolKit/Input/Scripts/InputEvents/IInputClickHandler.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "3132436" }, { "name": "FLUX", "bytes": "275" }, { "name": "HLSL", "bytes": "54233" }, { "name": "ShaderLab", "bytes": "125597" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>hammer-tactics: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1+2 / hammer-tactics - 1.3.1+8.12</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> hammer-tactics <small> 1.3.1+8.12 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-05 10:47:20 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-05 10:47:20 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.1+2 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.03.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.03.0 Official 4.03.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;palmskog@gmail.com&quot; homepage: &quot;https://github.com/lukaszcz/coqhammer&quot; dev-repo: &quot;git+https://github.com/lukaszcz/coqhammer.git&quot; bug-reports: &quot;https://github.com/lukaszcz/coqhammer/issues&quot; license: &quot;LGPL-2.1-only&quot; synopsis: &quot;Reconstruction tactics for the hammer for Coq&quot; description: &quot;&quot;&quot; Collection of tactics that are used by the hammer for Coq to reconstruct proofs found by automated theorem provers. When the hammer has been successfully applied to a project, only this package needs to be installed; the hammer plugin is not required. &quot;&quot;&quot; build: [make &quot;-j%{jobs}%&quot; &quot;tactics&quot;] install: [ [make &quot;install-tactics&quot;] [make &quot;test-tactics&quot;] {with-test} ] depends: [ &quot;ocaml&quot; { &gt;= &quot;4.08&quot; } &quot;coq&quot; {&gt;= &quot;8.12&quot; &amp; &lt; &quot;8.13~&quot;} ] conflicts: [ &quot;coq-hammer&quot; {!= version} ] tags: [ &quot;keyword:automation&quot; &quot;keyword:hammer&quot; &quot;keyword:tactics&quot; &quot;logpath:Hammer.Tactics&quot; &quot;date:2021-05-20&quot; ] authors: [ &quot;Lukasz Czajka &lt;lukaszcz@mimuw.edu.pl&gt;&quot; ] url { src: &quot;https://github.com/lukaszcz/coqhammer/archive/refs/tags/v1.3.1-coq8.12.tar.gz&quot; checksum: &quot;sha512=8b55bf002636614d87f80dd12b7ce2831be28c3de1aef36eb94daf57effa9c815fdcd270b382473628ee9f17bf0d7a66a6c9c524b31d50ccc977ddd395d3188e&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-hammer-tactics.1.3.1+8.12 coq.8.7.1+2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+2). The following dependencies couldn&#39;t be met: - coq-hammer-tactics -&gt; ocaml &gt;= 4.08 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-hammer-tactics.1.3.1+8.12</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "7c371f754cc1d4a9342ea9be79149f13", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 159, "avg_line_length": 40.522222222222226, "alnum_prop": 0.5525089114340553, "repo_name": "coq-bench/coq-bench.github.io", "id": "be7f5065da6bcb0c45a28aa410d704af0ac408c4", "size": "7319", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.03.0-2.0.5/released/8.7.1+2/hammer-tactics/1.3.1+8.12.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", { value: true }); const childProcess = __importStar(require("child_process")); const util_1 = require("util"); const error_1 = require("../commands/error"); const exec = util_1.promisify(childProcess.exec); var Scripts; (function (Scripts) { Scripts["After"] = "After"; Scripts["Token"] = "Token"; })(Scripts = exports.Scripts || (exports.Scripts = {})); const EXEC_TIMEOUT = 5000; // ms function runScript(script, configPath, type) { return __awaiter(this, void 0, void 0, function* () { const scriptWithCD = `cd ${configPath}; ${script}`; const { stdout } = yield exec(scriptWithCD, { timeout: EXEC_TIMEOUT }).catch(err => { const { stderr = '' } = err; const firstStdErrLine = stderr.split('\n')[0]; // This child process will be SIGTERM-ed if it times out. throw error_1.wrapError(err.signal === 'SIGTERM' ? `${type} script timed out` : `${type} script failed`, err, `Tried running: '${script}'`, firstStdErrLine); }); return stdout; }); } exports.runScript = runScript; //# sourceMappingURL=scripts.js.map
{ "content_hash": "7c11add0cbc04aeb83de6d00f5574ef0", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 169, "avg_line_length": 49.951219512195124, "alnum_prop": 0.61865234375, "repo_name": "ykumawat/ykumawat.github.io", "id": "5009a5876eca86f6832df767c555cd5cac418883", "size": "2048", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/typewriter/dist/src/cli/config/scripts.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "21000" }, { "name": "HTML", "bytes": "16797" }, { "name": "JavaScript", "bytes": "53812" }, { "name": "PHP", "bytes": "1242" }, { "name": "Ruby", "bytes": "104" } ], "symlink_target": "" }
package org.apache.hive.hcatalog.streaming; public class PartitionCreationFailed extends StreamingException { public PartitionCreationFailed(HiveEndPoint endPoint, Exception cause) { super("Failed to create partition " + endPoint, cause); } }
{ "content_hash": "c23935a6ed26b6b90840195181b4eaea", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 74, "avg_line_length": 28.22222222222222, "alnum_prop": 0.7874015748031497, "repo_name": "alanfgates/hive", "id": "1913d33542634b945331f6600eda339a3aed5a55", "size": "1059", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/PartitionCreationFailed.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "54376" }, { "name": "Batchfile", "bytes": "845" }, { "name": "C", "bytes": "28218" }, { "name": "C++", "bytes": "45308" }, { "name": "CSS", "bytes": "5157" }, { "name": "GAP", "bytes": "172907" }, { "name": "HTML", "bytes": "58711" }, { "name": "HiveQL", "bytes": "7025058" }, { "name": "Java", "bytes": "50295783" }, { "name": "JavaScript", "bytes": "43855" }, { "name": "M4", "bytes": "2276" }, { "name": "PHP", "bytes": "148097" }, { "name": "PLSQL", "bytes": "8724" }, { "name": "PLpgSQL", "bytes": "311787" }, { "name": "Perl", "bytes": "319842" }, { "name": "PigLatin", "bytes": "12333" }, { "name": "Python", "bytes": "406889" }, { "name": "Roff", "bytes": "5379" }, { "name": "SQLPL", "bytes": "4773" }, { "name": "Shell", "bytes": "299376" }, { "name": "Thrift", "bytes": "141153" }, { "name": "XSLT", "bytes": "20199" }, { "name": "q", "bytes": "608417" } ], "symlink_target": "" }
constexpr char kApplicationName[] = "chromoting"; namespace remoting { namespace { WORD SeverityToEventLogType(logging::LogSeverity severity) { // The Windows event log only has 3 log levels so some severity levels will // need to be combined (info and verbose, error and fatal). switch (severity) { case logging::LOG_WARNING: return EVENTLOG_WARNING_TYPE; case logging::LOG_FATAL: case logging::LOG_ERROR: // Fatal or Error event. return EVENTLOG_ERROR_TYPE; case logging::LOG_INFO: default: // Info or Verbose event. return EVENTLOG_INFORMATION_TYPE; } } } // namespace HostEventWindowsEventLogger::HostEventWindowsEventLogger( WindowsEventLogger event_logger) : event_logger_(std::move(event_logger)) {} HostEventWindowsEventLogger::~HostEventWindowsEventLogger() = default; void HostEventWindowsEventLogger::LogEvent(const EventTraceData& data) { DCHECK(event_logger_.IsRegistered()); // The first message will be displayed in the general tab in EventViewer. The // additional fields will be logged as part of the EventData which can be // viewed in 'details' or queried for in Powershell. // Note: The Data elements logged will not have a 'Name' attribute so any // scripts which query for these events will need to be updated if the order // changes. This is due to the event logging mechanism we are using. // If having a stable query is important in the future, then we will need to // change from a MOF based provider to a manifest based provider and define an // event schema. std::vector<std::string> payload( {data.message.c_str(), base::StringPrintf("pid: %d", data.process_id), base::StringPrintf("tid: %d", data.thread_id), EventTraceData::SeverityToString(data.severity), base::StringPrintf("%s(%d)", data.file_name.c_str(), data.line), base::StringPrintf("%4d-%02d-%02d - %02d:%02d:%02d.%03d", data.time_stamp.year, data.time_stamp.month, data.time_stamp.day_of_month, data.time_stamp.hour, data.time_stamp.minute, data.time_stamp.second, data.time_stamp.millisecond)}); WORD type = SeverityToEventLogType(data.severity); if (!event_logger_.Log(type, MSG_HOST_LOG_EVENT, payload)) { // Don't log a write error more than once. We don't want to create a // loopback effect and fill up the log for other active event loggers. static bool logged_once = false; // The LOG statement below should get pushed to the Windows ETW queue and // will be delivered to the event trace consumer asynchronously. Just to be // safe, we store and then update the static value to prevent any potential // reentrancy issues. bool local_logged_once = logged_once; logged_once = true; PLOG_IF(ERROR, !local_logged_once) << "Failed to write to the event log"; } } // static. std::unique_ptr<HostEventLogger> HostEventWindowsEventLogger::Create() { WindowsEventLogger event_logger(kApplicationName); if (!event_logger.IsRegistered()) { return nullptr; } return std::make_unique<HostEventWindowsEventLogger>(std::move(event_logger)); } } // namespace remoting
{ "content_hash": "570b826443c8efcbead1369c7ef7cbd9", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 80, "avg_line_length": 40.24691358024691, "alnum_prop": 0.6904907975460123, "repo_name": "scheib/chromium", "id": "7ceb747abf56f1b2fc75b71fcd9ca69fd7688126", "size": "3678", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "remoting/host/win/host_event_windows_event_logger.cc", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
{% extends "horizon/common/_modal_form.html" %} {% load i18n %} {% load url from future %} {% block form_id %}update_reachability_test_form{% endblock %} {% block form_action %}{% url 'horizon:project:connections:reachability_tests:update' reachability_test.name%}{% endblock %} {% block modal-header %}{% trans "Update Reachability Test" %}{% endblock %} {% block modal_id %}update_security_group_modal{% endblock %} {% block modal-body %} <div class="left"> <fieldset> {% include "horizon/common/_form_fields.html" %} </fieldset> </div> <div class="right"> <h3>{% trans "Description" %}:</h3> <p>{% trans "From here you can modify a reachability test." %}</p> </div> {% endblock %} {% block modal-footer %} <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Test" %}" /> <a href="{% url 'horizon:project:connections:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> {% endblock %}
{ "content_hash": "cc0800ce42b50fab7d0c004729a3c454", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 124, "avg_line_length": 35.629629629629626, "alnum_prop": 0.6476091476091476, "repo_name": "xinwu/horizon", "id": "1a201f87bccae258751bd633d99f0f2838859fda", "size": "962", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "openstack_dashboard/dashboards/project/connections/templates/connections/reachability_tests/_update.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "173137" }, { "name": "HTML", "bytes": "518040" }, { "name": "JavaScript", "bytes": "1879111" }, { "name": "Makefile", "bytes": "588" }, { "name": "Python", "bytes": "4900312" }, { "name": "Shell", "bytes": "19593" } ], "symlink_target": "" }
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // test_class_info_save.cpp: test implementation level trait // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // test implementation level "object_class_info" // should pass compilation and execution #include <fstream> #include <string> #include <boost/static_assert.hpp> #include <boost/archive/tmpdir.hpp> #include <boost/preprocessor/stringize.hpp> #include "test_tools.hpp" #include <boost/serialization/level.hpp> #include <boost/serialization/tracking.hpp> #include <boost/serialization/nvp.hpp> // first case : serialize WITHOUT class information class A { friend class boost::serialization::access; template<class Archive> void serialize(Archive & /*ar*/, const unsigned int file_version){ // class that don't save class info always have a version number of 0 BOOST_CHECK(file_version == 0); BOOST_STATIC_ASSERT(0 == ::boost::serialization::version<A>::value); ++count; } public: unsigned int count; A() : count(0) {} }; BOOST_CLASS_IMPLEMENTATION(A, ::boost::serialization::object_serializable) BOOST_CLASS_TRACKING(A, ::boost::serialization::track_never) // second case : serialize WITH class information // note: GCC compile fails if this is after the class declaration class B; BOOST_CLASS_VERSION(B, 2) class B { friend class boost::serialization::access; template<class Archive> void serialize(Archive & /*ar*/, const unsigned int file_version){ // verify at execution that correct version number is passed on save BOOST_CHECK( static_cast<const int>(file_version) == ::boost::serialization::version<B>::value ); ++count; } public: unsigned int count; B() : count(0) {} }; BOOST_CLASS_IMPLEMENTATION(B, ::boost::serialization::object_class_info) BOOST_CLASS_TRACKING(B, boost::serialization::track_always) #include <iostream> void out(const char *testfile, const A & a, const B & b) { test_ostream os(testfile, TEST_STREAM_FLAGS); test_oarchive oa(os, TEST_ARCHIVE_FLAGS); // write object twice to check tracking oa << BOOST_SERIALIZATION_NVP(a); oa << BOOST_SERIALIZATION_NVP(a); BOOST_CHECK(a.count == 2); // no tracking => redundant saves std::cout << "a.count=" << a.count << '\n' ; oa << BOOST_SERIALIZATION_NVP(b); oa << BOOST_SERIALIZATION_NVP(b); BOOST_CHECK(b.count == 1); // tracking => no redundant saves std::cout << "b.count=" << b.count << '\n' ; } int test_main( int /* argc */, char* /* argv */[] ) { A a; B b; std::string filename; filename += boost::archive::tmpdir(); filename += '/'; filename += BOOST_PP_STRINGIZE(testfile_); filename += BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST); out(filename.c_str(), a, b); return EXIT_SUCCESS; } // EOF
{ "content_hash": "294de1760a9515ae338bcf104735d31f", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 80, "avg_line_length": 31.13131313131313, "alnum_prop": 0.6518494484101233, "repo_name": "davehorton/drachtio-server", "id": "7254cbbcfef97d9485da935eedc7a28700d3c58d", "size": "3082", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "deps/boost_1_77_0/libs/serialization/test/test_class_info_save.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "662596" }, { "name": "Dockerfile", "bytes": "1330" }, { "name": "JavaScript", "bytes": "60639" }, { "name": "M4", "bytes": "35273" }, { "name": "Makefile", "bytes": "5960" }, { "name": "Shell", "bytes": "47298" } ], "symlink_target": "" }
import mysql.connector ''' (C)2015 chenbingfeng@TurnroGame.com ''' class Dmdb: """ DB operation of drinking running server""" #class variables USER = "root" PASSWORD = "123456" DATABASE = "db_drinking_man" ADD_DRINK = ''' INSERT INTO `db_drinking_man`.`drinks` ( `id_string`, `name`, `image`, `score`, `gold`, `config`, `cost_rmb`, `pass_md5`) VALUES (%(id_string)s,%(name)s,%(image)s,%(score)s,%(gold)s,%(config)s,%(cost_rmb)s,%(pass_md5)s) ''' SELECT_BY_ID = ''' SELECT id, id_string, name, image, score, gold, config, cost_rmb, pass_md5 FROM `db_drinking_man`.`drinks` WHERE id=%s ''' SELECT_BY_ID_STR = ''' SELECT id, id_string, name, image, score, gold, config, cost_rmb, pass_md5 FROM `db_drinking_man`.`drinks` WHERE id_string=%s ''' SELECT_TOP_3 = ''' SELECT id, id_string, name, image, score, gold, config, cost_rmb, pass_md5 FROM `db_drinking_man`.`drinks` ORDER BY score DESC LIMIT 0,3 ''' COUNT_SCORE_RANK = ''' SELECT count(*) as co FROM `db_drinking_man`.`drinks` WHERE score>%s ''' SELECT_A_B = ''' SELECT id, id_string, name, image, score, gold, config, cost_rmb, pass_md5 FROM `db_drinking_man`.`drinks` ORDER BY score DESC LIMIT %s,%s ''' UPDATE = ''' UPDATE `db_drinking_man`.`drinks` SET id_string = %s, name = %s, image = %s, score = %s, gold = %s, config = %s, cost_rmb = %s, pass_md5 = %s WHERE id = %s ''' IS_STRING_EXIST = ''' SELECT id_string, name FROM db_drinking_man.drinks WHERE id_string = %s ''' def __init__(self): #connect to DB print("connect to DB") self.context = mysql.connector.connect(user=self.USER, password=self.PASSWORD, database=self.DATABASE) def __del__(self): print("disconnect to DB") self.context.close() def insert(self, dict): ''' insert may raise exception because of duplicate id_string ''' try: cursor = self.context.cursor() cursor.execute(self.ADD_DRINK, dict) self.context.commit() cursor.close() return True except mysql.connector.errors.IntegrityError: return False def update(self, dict): cursor = self.context.cursor() print dict cursor.execute(self.UPDATE, ( dict["id_string"], dict["name"], dict["image"], dict["score"], dict["gold"], dict["config"], dict["cost_rmb"], dict["pass_md5"], dict["id"] )) cursor.close() self.context.commit() def turple2dict(self, turp): if (turp == None): return None else: res = {} res["id"] = turp[0] res["id_string"] = turp[1] res["name"] = turp[2] res["image"] = turp[3] res["score"] = turp[4] res["gold"] = turp[5] res["config"] = turp[6] res["cost_rmb"] = turp[7] res["pass_md5"] = turp[8] return res def getById(self, id): ''' get data by Id, if not exist, return None ''' cursor = self.context.cursor() cursor.execute(self.SELECT_BY_ID, (id,)) res = None for turp in cursor: res = self.turple2dict(turp) break cursor.close() return res def getByIdstring(self, id_string): cursor = self.context.cursor() cursor.execute(self.SELECT_BY_ID_STR, (id_string,)) res = None for turp in cursor: res = self.turple2dict(turp) break cursor.close() return res def isIdStringExist(self, id_string): ''' check if id_string exist ''' cursor = self.context.cursor() cursor.execute(self.IS_STRING_EXIST, (id_string,)) res = False for tp in cursor: res = True break cursor.close() return res def getTopAB(self, a, b): ''' get limit a, b ''' cursor = self.context.cursor() cursor.execute(self.SELECT_A_B, (a, b)) res = [] for turp in cursor: res.append(self.turple2dict(turp)) cursor.close() return res def getTopScore3(self): ''' get top 3 record ''' return self.getTopAB(0, 3) def countScoreRank(self, score): ''' count (record > score) ''' cursor = self.context.cursor() cursor.execute(self.COUNT_SCORE_RANK, (score,)) res = 0 for turp in cursor: res = turp[0] break cursor.close() return res def getNear6ByScore(self, score): rank = self.countScoreRank(score) if rank < 3: rank = 3 return self.getTopAB(rank-3, rank+3) if __name__ == "__main__": ''' TEST CODE ''' db = Dmdb() drink = { "id_string":"my_id_string", "name":"my_name", "image":"image", "score":3243, "gold":23432, "config":'{"sdfsdgijoi324325":23432}', "cost_rmb":"2343", "pass_md5":"sdfsdfs234" } ''' for i in xrange(100): drink["score"] = i drink["id_string"] = "id_string_%s" % (i,) #db.insert(drink) ''' #db.insert(drink) #db.insert(drink) #print db.getById(1) # print db.isIdStringExist("my_id_string") # a = db.getById(1) # print a # a["name"] = "abc" # print a # db.update(a) # print db.getById(1) del db
{ "content_hash": "581aca09864eb40ad31c039fe9d42999", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 110, "avg_line_length": 27.10900473933649, "alnum_prop": 0.5145104895104895, "repo_name": "arisecbf/dringkingrun_server", "id": "4358527f67dc285c170fdab4c13650d14b43fffa", "size": "5720", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "db.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "17169" } ], "symlink_target": "" }
package com.google.cloud.automl.v1beta1; public final class ModelEvaluationOuterClass { private ModelEvaluationOuterClass() {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_automl_v1beta1_ModelEvaluation_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_automl_v1beta1_ModelEvaluation_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n2google/cloud/automl/v1beta1/model_eval" + "uation.proto\022\033google.cloud.automl.v1beta" + "1\032\034google/api/annotations.proto\0320google/" + "cloud/automl/v1beta1/classification.prot" + "o\032-google/cloud/automl/v1beta1/translati" + "on.proto\032\037google/protobuf/timestamp.prot" + "o\"\350\002\n\017ModelEvaluation\022i\n!classification_" + "evaluation_metrics\030\010 \001(\0132<.google.cloud." + "automl.v1beta1.ClassificationEvaluationM" + "etricsH\000\022c\n\036translation_evaluation_metri" + "cs\030\t \001(\01329.google.cloud.automl.v1beta1.T" + "ranslationEvaluationMetricsH\000\022\014\n\004name\030\001 " + "\001(\t\022\032\n\022annotation_spec_id\030\002 \001(\t\022/\n\013creat" + "e_time\030\005 \001(\0132\032.google.protobuf.Timestamp" + "\022\037\n\027evaluated_example_count\030\006 \001(\005B\t\n\007met" + "ricsB\204\001\n\037com.google.cloud.automl.v1beta1" + "P\001ZAgoogle.golang.org/genproto/googleapi" + "s/cloud/automl/v1beta1;automl\312\002\033Google\\C" + "loud\\AutoMl\\V1beta1b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; return null; } }; com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.AnnotationsProto.getDescriptor(), com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(), com.google.cloud.automl.v1beta1.TranslationProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }, assigner); internal_static_google_cloud_automl_v1beta1_ModelEvaluation_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_google_cloud_automl_v1beta1_ModelEvaluation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_automl_v1beta1_ModelEvaluation_descriptor, new java.lang.String[] { "ClassificationEvaluationMetrics", "TranslationEvaluationMetrics", "Name", "AnnotationSpecId", "CreateTime", "EvaluatedExampleCount", "Metrics", }); com.google.api.AnnotationsProto.getDescriptor(); com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(); com.google.cloud.automl.v1beta1.TranslationProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) }
{ "content_hash": "f27b346b59573c5f797af02cc91aeb07", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 97, "avg_line_length": 48.397590361445786, "alnum_prop": 0.7010206621857107, "repo_name": "vam-google/google-cloud-java", "id": "76d2414bf3144a865354f90e65d93c762d1445ae", "size": "4140", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationOuterClass.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "128" }, { "name": "CSS", "bytes": "23036" }, { "name": "Dockerfile", "bytes": "127" }, { "name": "Go", "bytes": "9641" }, { "name": "HTML", "bytes": "16158" }, { "name": "Java", "bytes": "47356483" }, { "name": "JavaScript", "bytes": "989" }, { "name": "Python", "bytes": "110799" }, { "name": "Shell", "bytes": "9162" } ], "symlink_target": "" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace _01.ASP.NET_Web_Forms.Account { public partial class ResetPasswordConfirmation { /// <summary> /// login control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.HyperLink login; } }
{ "content_hash": "46a78b6dc4dbadb69eaaad05856f0b78", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 84, "avg_line_length": 32.625, "alnum_prop": 0.4776500638569604, "repo_name": "StefanSinapov/TelerikAcademy", "id": "8b32405fcf59ebcc05c6abcf4cf1097b161616bf", "size": "785", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "16. ASP.NET Web Forms/01. Introduction to ASP.NET/01. ASP.NET Web Forms/Account/ResetPasswordConfirmation.aspx.designer.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP.NET", "bytes": "366155" }, { "name": "Batchfile", "bytes": "174" }, { "name": "C", "bytes": "1487" }, { "name": "C#", "bytes": "6534646" }, { "name": "C++", "bytes": "32601" }, { "name": "CSS", "bytes": "372478" }, { "name": "CoffeeScript", "bytes": "14486" }, { "name": "HTML", "bytes": "1242490" }, { "name": "Java", "bytes": "11797" }, { "name": "JavaScript", "bytes": "6374608" }, { "name": "Less", "bytes": "106505" }, { "name": "PHP", "bytes": "5957" }, { "name": "Pug", "bytes": "78294" }, { "name": "SCSS", "bytes": "24196" }, { "name": "Shell", "bytes": "148" }, { "name": "Stylus", "bytes": "3188" }, { "name": "TSQL", "bytes": "2219288" }, { "name": "TypeScript", "bytes": "14385" }, { "name": "Vim Snippet", "bytes": "49568" }, { "name": "XSLT", "bytes": "6879" } ], "symlink_target": "" }
title: Pon tu corazón date: 12/12/2021 --- **inTerioriza** Los cantos nos ayudan a recordar y reflexionar sobre la Palabra de Dios. Los cantos también nos ayudan a cambiar nuestros corazones. Cuando Moisés terminó de hablar las palabras del canto al pueblo, hizo esta afirmación: «Piensen bien en todo lo que hoy les he dicho, y ordenen a sus hijos que pongan en práctica todos los términos de esta ley» (Deut. 32: 46). Por supuesto, se refiere también a toda la Torá, pero es significativo que estas palabras vengan inmediatamente después del canto. Poner el corazón en algo implica reflexión, intencionalidad y repetición. El pueblo no solo debía oír, sino examinar, analizar y reflexionar en la razón de las palabras de la Torá, especialmente de este canto, que los iba a impactar personalmente. Asimismo, debían tener la intención de hablar y cantar las palabras de la Torá y del canto. Debían transmitirlas a sus hijos y pensar en cómo y con quién podían compartirlas. La versión Reina-Valera de 1995 traduce el principio del versículo así: «Aplicad vuestro corazón», lo cual indica que la repetición también forma parte del proceso. Esto no es algo que debían hacer una vez, sino algo que llegaría a ser parte de ellos; lo harían con frecuencia y con alegría. El canto también es una advertencia al pueblo de lo que sucedería si no permanecían fieles a Dios y seguían en sus caminos de rebelión. Mientras pusieran su corazón en el canto, les iba a servir, ya que los protegería de apartarse de Dios. Moisés concluye esta amonestación de guardar la Torá y el canto en sus corazones resaltando por qué es crucial: «Porque no os es cosa vana; es vuestra vida» (vers. 47, RV95). La tentación sería pensar que estas eran solo palabras vanas y" vacías; pero en realidad, las palabras traen vida, ino son inútiles! De hecho, espe..,. cialmente a la luz de Deuteronomio 30, la Torá señala a Dios, que es la vida (vers . Ir) 19). Y la Palabra debe ser pasada a la siguiente generación para continuar con este poder vivificante que aporta una relación con Dios. Por último, este canto brinda esperanza. Si bien habrá consecuencias por sus pecados, Dios perdonará, traerá expiación y destruirá a sus enemigos. Mientras el pueblo pusiera sus corazones en la Palabra y en el canto, el Señor era capaz de obrar mediante estos dos elementos para alcanzar y cambiar sus corazones, como prometió hacer en Deuteronomio 30: 6. **Escríbelo aquí** Regresa al texto que has copiado o parafraseado y analiza lo detenidamente. - Encierra en un círculo las palabras, frases e ideas que se repiten. - Subraya las palabras y frases que consideras más relevantes y que te resultan más significativas. - Utiliza flechas para conectar algunas palabras y frases que se relacionan con otros conceptos similares. `A qué parece apuntar lo que marcaste y relacionaste?` Memoriza tu versículo favorito. Escríbelo varias veces para que te sea más fácil recordarlo. `¿Cómo te ha ayudado la música en tu caminar con Dios?` `¿Qué cantos te son más significativos para entender el amor de Dios por ti?`
{ "content_hash": "e1a8b0eab8c083c3118f1335436bd964", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 791, "avg_line_length": 99.51612903225806, "alnum_prop": 0.7902755267423015, "repo_name": "imasaru/sabbath-school-lessons", "id": "bccea9ade709f04a3f88e61a74d470e060ce4020", "size": "3172", "binary": false, "copies": "2", "ref": "refs/heads/stage", "path": "src/es/2021-04-cq/12/02.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "160533" }, { "name": "HTML", "bytes": "20725" }, { "name": "JavaScript", "bytes": "54661" } ], "symlink_target": "" }
// Copyright (c) The Perspex Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using System; using System.Reactive; using System.Reactive.Linq; using Perspex.Controls; using ReactiveUI; namespace Perspex.Diagnostics.ViewModels { internal class TreeNode : ReactiveObject { private string _classes; public TreeNode(Control control) { Control = control; Type = control.GetType().Name; control.Classes.Changed.Select(_ => Unit.Default) .StartWith(Unit.Default) .Subscribe(_ => { if (control.Classes.Count > 0) { Classes = "(" + string.Join(" ", control.Classes) + ")"; } else { Classes = string.Empty; } }); } public IReadOnlyReactiveList<TreeNode> Children { get; protected set; } public string Classes { get { return _classes; } private set { this.RaiseAndSetIfChanged(ref _classes, value); } } public string Type { get; private set; } public Control Control { get; private set; } } }
{ "content_hash": "e6c8d4e930d1a9362ffcc9f8d42ad3b2", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 104, "avg_line_length": 24.683333333333334, "alnum_prop": 0.4841323430114787, "repo_name": "danwalmsley/Perspex", "id": "837930aadbe99416a8d72aeb2ddfff6166a2ea18", "size": "1483", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "src/Perspex.Diagnostics/ViewModels/TreeNode.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "2286538" }, { "name": "PowerShell", "bytes": "3922" }, { "name": "Smalltalk", "bytes": "57480" } ], "symlink_target": "" }
package conf const PropertityFileName = "config.json"
{ "content_hash": "3114f077da54df438e29c83238aeadfc", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 40, "avg_line_length": 18.333333333333332, "alnum_prop": 0.8, "repo_name": "ChamPly/quick-mock", "id": "176eb4760813b3e4a21e35871f6ab017258d501b", "size": "55", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "conf/conf.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "3218" } ], "symlink_target": "" }
=============================== GEOparse =============================== .. image:: https://img.shields.io/pypi/v/GEOparse.svg :target: https://pypi.python.org/pypi/GEOparse .. image:: https://img.shields.io/travis/guma44/GEOparse.svg :target: https://travis-ci.org/guma44/GEOparse Python library to access Gene Expression Omnibus Database (GEO). GEOparse is python package that can be used to query and retrieve data from Gene Expression Omnibus database (GEO). The inspiration and the base for it is great R library GEOquery. * Free software: BSD license * Documentation: https://GEOparse.readthedocs.org. Features -------- * Download GEO series, datasets etc. as SOFT files * Download supplementary files for GEO series to use them locally * Load GEO SOFT as easy to use and manipulate objects * Prepare your data for GEO upload Installation ------------ At the command line:: $ pip install GEOparse TODO ---- There is still work to do so any contribution is welcome. Any bug/error that you report will improve the library. The main issues are: * add checking for compatibility with SOFT files * expand GEOTypes objects with useful functions for differential expression analysis * share your idea * add more tests - that's always good idea :)
{ "content_hash": "2599193e3a5370b43d03e62ee5983ea1", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 115, "avg_line_length": 27.847826086956523, "alnum_prop": 0.7088212334113974, "repo_name": "guma44/GEOparse", "id": "ebab4d3d8f587b55a282bad85e344823c1effc3c", "size": "1281", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.rst", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Jupyter Notebook", "bytes": "162654" }, { "name": "Makefile", "bytes": "1961" }, { "name": "Python", "bytes": "121671" } ], "symlink_target": "" }
from decimal import * import getpass import math import os import os.path import platform import sys import time from jsonrpc import ServiceProxy, json BASE_FEE=Decimal("0.001") def check_json_precision(): """Make sure json library being used does not lose precision converting BTC values""" n = Decimal("20000000.00000003") satoshis = int(json.loads(json.dumps(float(n)))*1.0e8) if satoshis != 2000000000000003: raise RuntimeError("JSON encode/decode loses precision") def determine_db_dir(): """Return the default location of the bitcoin data directory""" if platform.system() == "Darwin": return os.path.expanduser("~/Library/Application Support/Bitcoin/") elif platform.system() == "Windows": return os.path.join(os.environ['APPDATA'], "Bitcoin") return os.path.expanduser("~/.bitcoin") def read_bitcoin_config(dbdir): """Read the bitcoin.conf file from dbdir, returns dictionary of settings""" from ConfigParser import SafeConfigParser class FakeSecHead(object): def __init__(self, fp): self.fp = fp self.sechead = '[all]\n' def readline(self): if self.sechead: try: return self.sechead finally: self.sechead = None else: s = self.fp.readline() if s.find('#') != -1: s = s[0:s.find('#')].strip() +"\n" return s config_parser = SafeConfigParser() config_parser.readfp(FakeSecHead(open(os.path.join(dbdir, "bitcoin.conf")))) return dict(config_parser.items("all")) def connect_JSON(config): """Connect to a bitcoin JSON-RPC server""" testnet = config.get('testnet', '0') testnet = (int(testnet) > 0) # 0/1 in config file, convert to True/False if not 'rpcport' in config: config['rpcport'] = 14342 if testnet else 4342 connect = "http://%s:%s@127.0.0.1:%s"%(config['rpcuser'], config['rpcpassword'], config['rpcport']) try: result = ServiceProxy(connect) # ServiceProxy is lazy-connect, so send an RPC command mostly to catch connection errors, # but also make sure the bitcoind we're talking to is/isn't testnet: if result.getmininginfo()['testnet'] != testnet: sys.stderr.write("RPC server at "+connect+" testnet setting mismatch\n") sys.exit(1) return result except: sys.stderr.write("Error connecting to RPC server at "+connect+"\n") sys.exit(1) def unlock_wallet(bitcoind): info = bitcoind.getinfo() if 'unlocked_until' not in info: return True # wallet is not encrypted t = int(info['unlocked_until']) if t <= time.time(): try: passphrase = getpass.getpass("Wallet is locked; enter passphrase: ") bitcoind.walletpassphrase(passphrase, 5) except: sys.stderr.write("Wrong passphrase\n") info = bitcoind.getinfo() return int(info['unlocked_until']) > time.time() def list_available(bitcoind): address_summary = dict() address_to_account = dict() for info in bitcoind.listreceivedbyaddress(0): address_to_account[info["address"]] = info["account"] unspent = bitcoind.listunspent(0) for output in unspent: # listunspent doesn't give addresses, so: rawtx = bitcoind.getrawtransaction(output['txid'], 1) vout = rawtx["vout"][output['vout']] pk = vout["scriptPubKey"] # This code only deals with ordinary pay-to-bitcoin-address # or pay-to-script-hash outputs right now; anything exotic is ignored. if pk["type"] != "pubkeyhash" and pk["type"] != "scripthash": continue address = pk["addresses"][0] if address in address_summary: address_summary[address]["total"] += vout["value"] address_summary[address]["outputs"].append(output) else: address_summary[address] = { "total" : vout["value"], "outputs" : [output], "account" : address_to_account.get(address, "") } return address_summary def select_coins(needed, inputs): # Feel free to improve this, this is good enough for my simple needs: outputs = [] have = Decimal("0.0") n = 0 while have < needed and n < len(inputs): outputs.append({ "txid":inputs[n]["txid"], "vout":inputs[n]["vout"]}) have += inputs[n]["amount"] n += 1 return (outputs, have-needed) def create_tx(bitcoind, fromaddresses, toaddress, amount, fee): all_coins = list_available(bitcoind) total_available = Decimal("0.0") needed = amount+fee potential_inputs = [] for addr in fromaddresses: if addr not in all_coins: continue potential_inputs.extend(all_coins[addr]["outputs"]) total_available += all_coins[addr]["total"] if total_available < needed: sys.stderr.write("Error, only %f BTC available, need %f\n"%(total_available, needed)); sys.exit(1) # # Note: # Python's json/jsonrpc modules have inconsistent support for Decimal numbers. # Instead of wrestling with getting json.dumps() (used by jsonrpc) to encode # Decimals, I'm casting amounts to float before sending them to bitcoind. # outputs = { toaddress : float(amount) } (inputs, change_amount) = select_coins(needed, potential_inputs) if change_amount > BASE_FEE: # don't bother with zero or tiny change change_address = fromaddresses[-1] if change_address in outputs: outputs[change_address] += float(change_amount) else: outputs[change_address] = float(change_amount) rawtx = bitcoind.createrawtransaction(inputs, outputs) signed_rawtx = bitcoind.signrawtransaction(rawtx) if not signed_rawtx["complete"]: sys.stderr.write("signrawtransaction failed\n") sys.exit(1) txdata = signed_rawtx["hex"] return txdata def compute_amount_in(bitcoind, txinfo): result = Decimal("0.0") for vin in txinfo['vin']: in_info = bitcoind.getrawtransaction(vin['txid'], 1) vout = in_info['vout'][vin['vout']] result = result + vout['value'] return result def compute_amount_out(txinfo): result = Decimal("0.0") for vout in txinfo['vout']: result = result + vout['value'] return result def sanity_test_fee(bitcoind, txdata_hex, max_fee): class FeeError(RuntimeError): pass try: txinfo = bitcoind.decoderawtransaction(txdata_hex) total_in = compute_amount_in(bitcoind, txinfo) total_out = compute_amount_out(txinfo) if total_in-total_out > max_fee: raise FeeError("Rejecting transaction, unreasonable fee of "+str(total_in-total_out)) tx_size = len(txdata_hex)/2 kb = tx_size/1000 # integer division rounds down if kb > 1 and fee < BASE_FEE: raise FeeError("Rejecting no-fee transaction, larger than 1000 bytes") if total_in < 0.01 and fee < BASE_FEE: raise FeeError("Rejecting no-fee, tiny-amount transaction") # Exercise for the reader: compute transaction priority, and # warn if this is a very-low-priority transaction except FeeError as err: sys.stderr.write((str(err)+"\n")) sys.exit(1) def main(): import optparse parser = optparse.OptionParser(usage="%prog [options]") parser.add_option("--from", dest="fromaddresses", default=None, help="addresses to get bitcoins from") parser.add_option("--to", dest="to", default=None, help="address to get send bitcoins to") parser.add_option("--amount", dest="amount", default=None, help="amount to send") parser.add_option("--fee", dest="fee", default="0.0", help="fee to include") parser.add_option("--datadir", dest="datadir", default=determine_db_dir(), help="location of bitcoin.conf file with RPC username/password (default: %default)") parser.add_option("--testnet", dest="testnet", default=False, action="store_true", help="Use the test network") parser.add_option("--dry_run", dest="dry_run", default=False, action="store_true", help="Don't broadcast the transaction, just create and print the transaction data") (options, args) = parser.parse_args() check_json_precision() config = read_bitcoin_config(options.datadir) if options.testnet: config['testnet'] = True bitcoind = connect_JSON(config) if options.amount is None: address_summary = list_available(bitcoind) for address,info in address_summary.iteritems(): n_transactions = len(info['outputs']) if n_transactions > 1: print("%s %.8f %s (%d transactions)"%(address, info['total'], info['account'], n_transactions)) else: print("%s %.8f %s"%(address, info['total'], info['account'])) else: fee = Decimal(options.fee) amount = Decimal(options.amount) while unlock_wallet(bitcoind) == False: pass # Keep asking for passphrase until they get it right txdata = create_tx(bitcoind, options.fromaddresses.split(","), options.to, amount, fee) sanity_test_fee(bitcoind, txdata, amount*Decimal("0.01")) if options.dry_run: print(txdata) else: txid = bitcoind.sendrawtransaction(txdata) print(txid) if __name__ == '__main__': main()
{ "content_hash": "b0843ed2cdcd8a68577844e6f899a6a2", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 111, "avg_line_length": 38.392857142857146, "alnum_prop": 0.6155038759689923, "repo_name": "GENESISCOIN/GENESISCOIN_SCRYPT", "id": "758889b8c6ea37f183b7393492cdeea5633e8b24", "size": "10053", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "contrib/spendfrom/spendfrom.py", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "32092" }, { "name": "C++", "bytes": "2606911" }, { "name": "CSS", "bytes": "1127" }, { "name": "Groff", "bytes": "18284" }, { "name": "HTML", "bytes": "50615" }, { "name": "Makefile", "bytes": "102375" }, { "name": "NSIS", "bytes": "6022" }, { "name": "Objective-C", "bytes": "1052" }, { "name": "Objective-C++", "bytes": "5864" }, { "name": "Python", "bytes": "69729" }, { "name": "QMake", "bytes": "14726" }, { "name": "Shell", "bytes": "13173" } ], "symlink_target": "" }
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * ProposalLineItemMakegoodErrorReason.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.admanager.axis.v202205; public class ProposalLineItemMakegoodErrorReason implements java.io.Serializable { private java.lang.String _value_; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected ProposalLineItemMakegoodErrorReason(java.lang.String value) { _value_ = value; _table_.put(_value_,this); } public static final java.lang.String _ORIGINAL_ALREADY_HAS_MAKEGOOD = "ORIGINAL_ALREADY_HAS_MAKEGOOD"; public static final java.lang.String _ORIGINAL_IS_MAKEGOOD = "ORIGINAL_IS_MAKEGOOD"; public static final java.lang.String _ORIGINAL_NOT_YET_SOLD = "ORIGINAL_NOT_YET_SOLD"; public static final java.lang.String _LINE_ITEM_IS_NOT_STANDARD = "LINE_ITEM_IS_NOT_STANDARD"; public static final java.lang.String _LINE_ITEM_IS_NOT_CPM = "LINE_ITEM_IS_NOT_CPM"; public static final java.lang.String _MAKEGOODS_NOT_SUPPORTED_FOR_COST_TYPE = "MAKEGOODS_NOT_SUPPORTED_FOR_COST_TYPE"; public static final java.lang.String _ORIGINAL_TOO_FAR_IN_PAST = "ORIGINAL_TOO_FAR_IN_PAST"; public static final java.lang.String _RATE_DIFFERENT_THAN_ORIGINAL = "RATE_DIFFERENT_THAN_ORIGINAL"; public static final java.lang.String _UNITS_MORE_THAN_ORIGINAL = "UNITS_MORE_THAN_ORIGINAL"; public static final java.lang.String _MAKEGOODS_NOT_SUPPORTED_FOR_NON_DV360_BUYERS = "MAKEGOODS_NOT_SUPPORTED_FOR_NON_DV360_BUYERS"; public static final java.lang.String _UNKNOWN = "UNKNOWN"; public static final ProposalLineItemMakegoodErrorReason ORIGINAL_ALREADY_HAS_MAKEGOOD = new ProposalLineItemMakegoodErrorReason(_ORIGINAL_ALREADY_HAS_MAKEGOOD); public static final ProposalLineItemMakegoodErrorReason ORIGINAL_IS_MAKEGOOD = new ProposalLineItemMakegoodErrorReason(_ORIGINAL_IS_MAKEGOOD); public static final ProposalLineItemMakegoodErrorReason ORIGINAL_NOT_YET_SOLD = new ProposalLineItemMakegoodErrorReason(_ORIGINAL_NOT_YET_SOLD); public static final ProposalLineItemMakegoodErrorReason LINE_ITEM_IS_NOT_STANDARD = new ProposalLineItemMakegoodErrorReason(_LINE_ITEM_IS_NOT_STANDARD); public static final ProposalLineItemMakegoodErrorReason LINE_ITEM_IS_NOT_CPM = new ProposalLineItemMakegoodErrorReason(_LINE_ITEM_IS_NOT_CPM); public static final ProposalLineItemMakegoodErrorReason MAKEGOODS_NOT_SUPPORTED_FOR_COST_TYPE = new ProposalLineItemMakegoodErrorReason(_MAKEGOODS_NOT_SUPPORTED_FOR_COST_TYPE); public static final ProposalLineItemMakegoodErrorReason ORIGINAL_TOO_FAR_IN_PAST = new ProposalLineItemMakegoodErrorReason(_ORIGINAL_TOO_FAR_IN_PAST); public static final ProposalLineItemMakegoodErrorReason RATE_DIFFERENT_THAN_ORIGINAL = new ProposalLineItemMakegoodErrorReason(_RATE_DIFFERENT_THAN_ORIGINAL); public static final ProposalLineItemMakegoodErrorReason UNITS_MORE_THAN_ORIGINAL = new ProposalLineItemMakegoodErrorReason(_UNITS_MORE_THAN_ORIGINAL); public static final ProposalLineItemMakegoodErrorReason MAKEGOODS_NOT_SUPPORTED_FOR_NON_DV360_BUYERS = new ProposalLineItemMakegoodErrorReason(_MAKEGOODS_NOT_SUPPORTED_FOR_NON_DV360_BUYERS); public static final ProposalLineItemMakegoodErrorReason UNKNOWN = new ProposalLineItemMakegoodErrorReason(_UNKNOWN); public java.lang.String getValue() { return _value_;} public static ProposalLineItemMakegoodErrorReason fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { ProposalLineItemMakegoodErrorReason enumeration = (ProposalLineItemMakegoodErrorReason) _table_.get(value); if (enumeration==null) throw new java.lang.IllegalArgumentException(); return enumeration; } public static ProposalLineItemMakegoodErrorReason fromString(java.lang.String value) throws java.lang.IllegalArgumentException { return fromValue(value); } public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return _value_;} public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.EnumSerializer( _javaType, _xmlType); } public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.EnumDeserializer( _javaType, _xmlType); } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(ProposalLineItemMakegoodErrorReason.class); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202205", "ProposalLineItemMakegoodError.Reason")); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } }
{ "content_hash": "4c9d5fd278f76410961def781351e6f6", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 194, "avg_line_length": 59.372549019607845, "alnum_prop": 0.7531373844121533, "repo_name": "googleads/googleads-java-lib", "id": "18ce0910291a00e774644e39f9ae5a2b8a71fa59", "size": "6056", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v202205/ProposalLineItemMakegoodErrorReason.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "81068791" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>traffic_router</artifactId> <groupId>com.comcast.cdn.traffic_control.traffic_router</groupId> <version>1.6.0</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>traffic_router_config</artifactId> </project>
{ "content_hash": "40d0da277fb7842db12d4e0dddf581f6", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 102, "avg_line_length": 33.666666666666664, "alnum_prop": 0.7188118811881188, "repo_name": "smalenfant/traffic_control", "id": "3f26150f4c2bd097c7421a3901204993125d3843", "size": "505", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "traffic_router/configuration/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "23354" }, { "name": "CSS", "bytes": "167137" }, { "name": "Go", "bytes": "688589" }, { "name": "HTML", "bytes": "119086" }, { "name": "Java", "bytes": "970883" }, { "name": "JavaScript", "bytes": "1194744" }, { "name": "Makefile", "bytes": "1047" }, { "name": "Perl", "bytes": "2304689" }, { "name": "Perl 6", "bytes": "619353" }, { "name": "Python", "bytes": "11116" }, { "name": "Ruby", "bytes": "3540" }, { "name": "Shell", "bytes": "100219" } ], "symlink_target": "" }
using System; using Skybrud.Social.Json; namespace Skybrud.Social.Google.YouTube.Objects.Videos { /// <see> /// <cref>https://developers.google.com/youtube/v3/docs/videos#snippet</cref> /// </see> public class YouTubeVideoSnippet : GoogleApiObject { #region Properties /// <summary> /// Gets or sets the publish date of the video. /// </summary> public DateTime PublishedAt { get; private set; } /// <summary> /// Gets or sets the ID of the parent channel. /// </summary> public string ChannelId { get; private set; } /// <summary> /// Gets or sets the title of the YouTube video. /// </summary> public string Title { get; private set; } /// <summary> /// Gets or sets the description of the video. /// </summary> public string Description { get; private set; } /// <summary> /// Gets or set information about the thumbnails available for the video. /// </summary> public YouTubeVideoThumbnails Thumbnails { get; private set; } /// <summary> /// Gets or sets the title of the parent channel. /// </summary> public string ChannelTitle { get; private set; } /// <summary> /// Gets an array with all tags of the video. /// </summary> public string[] Tags { get; private set; } public string CategoryId { get; private set; } /// <summary> /// Gets or sets the "liveBroadcastContent" property. /// </summary> public YouTubeVideoLiveBroadcastContent LiveBroadcastContent { get; private set; } #endregion #region Constructors private YouTubeVideoSnippet(JsonObject obj) : base(obj) { } #endregion #region Static methods /// <summary> /// Gets an instance of <code>YouTubeVideoSnippet</code> from the specified <code>JsonObject</code>. /// </summary> /// <param name="obj">The instance of <code>JsonObject</code> to parse.</param> public static YouTubeVideoSnippet Parse(JsonObject obj) { // Check whether "obj" is NULL if (obj == null) return null; // Parse the "liveBroadcastContent" property YouTubeVideoLiveBroadcastContent broadcast; string strBroadcast = obj.GetString("liveBroadcastContent"); if (!Enum.TryParse(strBroadcast, true, out broadcast)) { throw new Exception("Unknown value for liveBroadcastContent \"" + strBroadcast + "\" - please create an issue so it can be fixed https://github.com/abjerner/Skybrud.Social/issues/new"); } // Get the array of tags (may not be present) JsonArray tags = obj.GetArray("tags"); // Initialize the snippet object YouTubeVideoSnippet snippet = new YouTubeVideoSnippet(obj) { PublishedAt = obj.GetDateTime("publishedAt"), ChannelId = obj.GetString("channelId"), Title = obj.GetString("title"), Description = obj.GetString("description"), Thumbnails = obj.GetObject("thumbnails", YouTubeVideoThumbnails.Parse), ChannelTitle = obj.GetString("channelTitle"), Tags = tags == null ? new string[0] : obj.GetArray("tags").Cast<string>(), CategoryId = obj.GetString("categoryId"), LiveBroadcastContent = broadcast }; return snippet; } #endregion } }
{ "content_hash": "3647c1c0f39655bb1b2bd24c60a9bab6", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 201, "avg_line_length": 34.82857142857143, "alnum_prop": 0.5775225594749795, "repo_name": "digiogo/Skybrud.Social", "id": "9db27d6668734e359054f78cc0e0f1b91b784888", "size": "3657", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Skybrud.Social/Google/YouTube/Objects/Videos/YouTubeVideoSnippet.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "268" }, { "name": "C#", "bytes": "1430138" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_08) on Fri Jan 05 15:06:08 PST 2007 --> <TITLE> Uses of Class org.apache.hadoop.streaming.MuxOutputFormat (Hadoop 0.10.0 API) </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Uses of Class org.apache.hadoop.streaming.MuxOutputFormat (Hadoop 0.10.0 API)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/streaming/MuxOutputFormat.html" title="class in org.apache.hadoop.streaming"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/streaming//class-useMuxOutputFormat.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MuxOutputFormat.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.hadoop.streaming.MuxOutputFormat</B></H2> </CENTER> No usage of org.apache.hadoop.streaming.MuxOutputFormat <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/streaming/MuxOutputFormat.html" title="class in org.apache.hadoop.streaming"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/streaming//class-useMuxOutputFormat.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MuxOutputFormat.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &copy; 2006 The Apache Software Foundation </BODY> </HTML>
{ "content_hash": "94a820b0bdb687c34f088a5649feeccb", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 227, "avg_line_length": 42.371428571428574, "alnum_prop": 0.6207012811867836, "repo_name": "moreus/hadoop", "id": "8888a6518f640ba5dc586d7d9676f4d712e3decf", "size": "5932", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hadoop-0.10.0/docs/api/org/apache/hadoop/streaming/class-use/MuxOutputFormat.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "31146" }, { "name": "C", "bytes": "1067911" }, { "name": "C++", "bytes": "521803" }, { "name": "CSS", "bytes": "157107" }, { "name": "Erlang", "bytes": "232" }, { "name": "Java", "bytes": "43984644" }, { "name": "JavaScript", "bytes": "87848" }, { "name": "Perl", "bytes": "18992" }, { "name": "Python", "bytes": "32767" }, { "name": "Shell", "bytes": "1369281" }, { "name": "TeX", "bytes": "19322" }, { "name": "XSLT", "bytes": "185841" } ], "symlink_target": "" }
// PowerPlant : Feature classes #include <LSharable.h> // PowerPlant : CA : Array classes #include <LSharableArray.h> // PowerPlant : CA : Feature classes #include <LSharable.h> // =========================================================================== // * Forward class declarations // =========================================================================== class CTModelObject; class CTTypeList; typedef TSharablePtr<CTTypeList> CTTypeListPtr; // =========================================================================== // * Public exception codes // =========================================================================== const ExceptionCode err_CantMakePrototype = 'xpro'; // =========================================================================== // * CTTypeList // =========================================================================== class CTTypeList : public LSharable { public: CTTypeList(); virtual ~CTTypeList(); // singleton accessor static CTTypeList* GetTypeList(); // type entry lookup virtual CTModelObject* FindPrototype(ClassIDT inObjectType) const; const LSharableArray& GetPrototypes() const { return mPrototypes; } // type specification builders protected: virtual void ScanAtLaunch(); virtual void MakeSpecFromDSPC(LStream& inStream); // data members protected: LSharableArray mPrototypes; // class variables protected: static CTTypeList* sTypeList; };
{ "content_hash": "958f7e8ffc5c4298a1931134a1894ea5", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 22.692307692307693, "alnum_prop": 0.4928813559322034, "repo_name": "mbert/mulberry-main", "id": "3145e72fe6918df67e1ff6cd7e429dd59999d0c5", "size": "2649", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Libraries/open-powerplant/constructor/Constructor_Pro/Constructor/Source files/H1- MacOS/Editors/Custom types/CTTypeList.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "569106" }, { "name": "Batchfile", "bytes": "80126" }, { "name": "C", "bytes": "13996926" }, { "name": "C++", "bytes": "36795816" }, { "name": "Component Pascal", "bytes": "63931" }, { "name": "DIGITAL Command Language", "bytes": "273849" }, { "name": "Emacs Lisp", "bytes": "1639" }, { "name": "Groff", "bytes": "5" }, { "name": "HTML", "bytes": "219178" }, { "name": "Logos", "bytes": "108920" }, { "name": "Makefile", "bytes": "11884" }, { "name": "Objective-C", "bytes": "129690" }, { "name": "Perl", "bytes": "1749015" }, { "name": "Perl6", "bytes": "27602" }, { "name": "Prolog", "bytes": "29177" }, { "name": "Python", "bytes": "8651" }, { "name": "R", "bytes": "741731" }, { "name": "Rebol", "bytes": "179366" }, { "name": "Scheme", "bytes": "4249" }, { "name": "Shell", "bytes": "172439" }, { "name": "XS", "bytes": "4319" }, { "name": "eC", "bytes": "4568" } ], "symlink_target": "" }
<?php echo serialize($_POST);
{ "content_hash": "5b3dc1222d61d0013cf3a7f10925e607", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 23, "avg_line_length": 8, "alnum_prop": 0.625, "repo_name": "hottern/test_loc", "id": "d9b31ca6c8086c886c00ddbdd4b5f24718dbe2c8", "size": "801", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "tests/Zend/Http/Client/_files/testPostData.php", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "ActionScript", "bytes": "19954" }, { "name": "Groovy", "bytes": "64" }, { "name": "Java", "bytes": "123492" }, { "name": "JavaScript", "bytes": "8051584" }, { "name": "PHP", "bytes": "31936924" }, { "name": "Perl", "bytes": "255834" }, { "name": "PowerShell", "bytes": "1028" }, { "name": "Puppet", "bytes": "770" }, { "name": "Racket", "bytes": "149800" }, { "name": "Ruby", "bytes": "4284" }, { "name": "Shell", "bytes": "23641" } ], "symlink_target": "" }
Copyright (c) 2017 Felix Erdmann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{ "content_hash": "d9edcca6308c42eba356ffff6eb917f5", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 70, "avg_line_length": 52.85, "alnum_prop": 0.8060548722800378, "repo_name": "felixerdy/touchbar", "id": "4c7d5564b09319ac70ddebfd67c27cfa43f549c0", "size": "1057", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LICENSE.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "740" }, { "name": "JavaScript", "bytes": "21036" } ], "symlink_target": "" }
import React from 'react'; import { Box, DataTable } from 'grommet'; // Source code for the data can be found here // https://github.com/grommet/grommet/blob/master/src/js/components/DataTable/stories/data.js import { columns, DATA } from './data'; export const TunableDataTable = () => ( // Uncomment <Grommet> lines when using outside of storybook // <Grommet theme={grommet}> <Box align="center" pad="large"> <DataTable columns={columns.map((c) => ({ ...c, search: c.property === 'name' || c.property === 'location', }))} data={DATA} sortable resizeable /> </Box> // </Grommet> ); TunableDataTable.storyName = 'Tunable'; export default { title: 'Visualizations/DataTable/Tunable', };
{ "content_hash": "633c9b02985b2cc959274af0fc1d0769", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 93, "avg_line_length": 26.103448275862068, "alnum_prop": 0.6327608982826949, "repo_name": "grommet/grommet", "id": "edc12bb850e4e7285387760951c09eef456864da", "size": "757", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/js/components/DataTable/stories/Tunable.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "1013" }, { "name": "JavaScript", "bytes": "2020318" }, { "name": "TypeScript", "bytes": "434002" } ], "symlink_target": "" }
using content::PageNavigator; using content::UserMetricsAction; BookmarkContextMenuController::BookmarkContextMenuController( gfx::NativeWindow parent_window, BookmarkContextMenuControllerDelegate* delegate, Browser* browser, Profile* profile, PageNavigator* navigator, const BookmarkNode* parent, const std::vector<const BookmarkNode*>& selection) : parent_window_(parent_window), delegate_(delegate), browser_(browser), profile_(profile), navigator_(navigator), parent_(parent), selection_(selection), model_(BookmarkModelFactory::GetForProfile(profile)) { DCHECK(profile_); DCHECK(model_->loaded()); menu_model_.reset(new ui::SimpleMenuModel(this)); model_->AddObserver(this); BuildMenu(); } BookmarkContextMenuController::~BookmarkContextMenuController() { if (model_) model_->RemoveObserver(this); } void BookmarkContextMenuController::BuildMenu() { if (selection_.size() == 1 && selection_[0]->is_url()) { AddItem(IDC_BOOKMARK_BAR_OPEN_ALL, IDS_BOOKMARK_BAR_OPEN_IN_NEW_TAB); AddItem(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW, IDS_BOOKMARK_BAR_OPEN_IN_NEW_WINDOW); AddItem(IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO, IDS_BOOKMARK_BAR_OPEN_INCOGNITO); } else { AddItem(IDC_BOOKMARK_BAR_OPEN_ALL, IDS_BOOKMARK_BAR_OPEN_ALL); AddItem(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW, IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW); AddItem(IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO, IDS_BOOKMARK_BAR_OPEN_ALL_INCOGNITO); } AddSeparator(); if (selection_.size() == 1 && selection_[0]->is_folder()) { AddItem(IDC_BOOKMARK_BAR_RENAME_FOLDER, IDS_BOOKMARK_BAR_RENAME_FOLDER); } else { AddItem(IDC_BOOKMARK_BAR_EDIT, IDS_BOOKMARK_BAR_EDIT); } AddSeparator(); AddItem(IDC_CUT, IDS_CUT); AddItem(IDC_COPY, IDS_COPY); AddItem(IDC_PASTE, IDS_PASTE); AddSeparator(); AddItem(IDC_BOOKMARK_BAR_REMOVE, IDS_BOOKMARK_BAR_REMOVE); AddSeparator(); AddItem(IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK, IDS_BOOKMARK_BAR_ADD_NEW_BOOKMARK); AddItem(IDC_BOOKMARK_BAR_NEW_FOLDER, IDS_BOOKMARK_BAR_NEW_FOLDER); AddSeparator(); AddItem(IDC_BOOKMARK_MANAGER, IDS_BOOKMARK_MANAGER); if (chrome::IsAppsShortcutEnabled(profile_)) { AddCheckboxItem(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT, IDS_BOOKMARK_BAR_SHOW_APPS_SHORTCUT); } AddCheckboxItem(IDC_BOOKMARK_BAR_ALWAYS_SHOW, IDS_SHOW_BOOKMARK_BAR); } void BookmarkContextMenuController::AddItem(int id, int localization_id) { menu_model_->AddItemWithStringId(id, localization_id); } void BookmarkContextMenuController::AddSeparator() { menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); } void BookmarkContextMenuController::AddCheckboxItem(int id, int localization_id) { menu_model_->AddCheckItemWithStringId(id, localization_id); } void BookmarkContextMenuController::ExecuteCommand(int id, int event_flags) { if (delegate_) delegate_->WillExecuteCommand(id, selection_); if (ExecutePlatformCommand(id, event_flags)) { if (delegate_) delegate_->DidExecuteCommand(id); return; } switch (id) { case IDC_BOOKMARK_BAR_OPEN_ALL: case IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO: case IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW: { WindowOpenDisposition initial_disposition; if (id == IDC_BOOKMARK_BAR_OPEN_ALL) { initial_disposition = NEW_BACKGROUND_TAB; content::RecordAction( UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { initial_disposition = NEW_WINDOW; content::RecordAction( UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); } else { initial_disposition = OFF_THE_RECORD; content::RecordAction( UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); } chrome::OpenAll(parent_window_, navigator_, selection_, initial_disposition, profile_); break; } case IDC_BOOKMARK_BAR_RENAME_FOLDER: case IDC_BOOKMARK_BAR_EDIT: content::RecordAction( UserMetricsAction("BookmarkBar_ContextMenu_Edit")); if (selection_.size() != 1) { NOTREACHED(); break; } BookmarkEditor::Show( parent_window_, profile_, BookmarkEditor::EditDetails::EditNode(selection_[0]), selection_[0]->is_url() ? BookmarkEditor::SHOW_TREE : BookmarkEditor::NO_TREE); break; case IDC_BOOKMARK_BAR_REMOVE: { content::RecordAction( UserMetricsAction("BookmarkBar_ContextMenu_Remove")); for (size_t i = 0; i < selection_.size(); ++i) { int index = selection_[i]->parent()->GetIndexOf(selection_[i]); if (index > -1) model_->Remove(selection_[i]->parent(), index); } selection_.clear(); break; } case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK: { content::RecordAction( UserMetricsAction("BookmarkBar_ContextMenu_Add")); int index; const BookmarkNode* parent = bookmark_utils::GetParentForNewNodes(parent_, selection_, &index); GURL url; string16 title; chrome::GetURLAndTitleToBookmark( browser_->tab_strip_model()->GetActiveWebContents(), &url, &title); BookmarkEditor::Show(parent_window_, profile_, BookmarkEditor::EditDetails::AddNodeInFolder( parent, index, url, title), BookmarkEditor::SHOW_TREE); break; } case IDC_BOOKMARK_BAR_NEW_FOLDER: { content::RecordAction( UserMetricsAction("BookmarkBar_ContextMenu_NewFolder")); int index; const BookmarkNode* parent = bookmark_utils::GetParentForNewNodes(parent_, selection_, &index); BookmarkEditor::Show( parent_window_, profile_, BookmarkEditor::EditDetails::AddFolder(parent, index), BookmarkEditor::SHOW_TREE); break; } case IDC_BOOKMARK_BAR_ALWAYS_SHOW: chrome::ToggleBookmarkBarWhenVisible(profile_); break; case IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT: { PrefService* prefs = profile_->GetPrefs(); prefs->SetBoolean( prefs::kShowAppsShortcutInBookmarkBar, !prefs->GetBoolean(prefs::kShowAppsShortcutInBookmarkBar)); break; } case IDC_BOOKMARK_MANAGER: { content::RecordAction(UserMetricsAction("ShowBookmarkManager")); if (selection_.size() != 1) chrome::ShowBookmarkManager(browser_); else if (selection_[0]->is_folder()) chrome::ShowBookmarkManagerForNode(browser_, selection_[0]->id()); else if (parent_) chrome::ShowBookmarkManagerForNode(browser_, parent_->id()); else chrome::ShowBookmarkManager(browser_); break; } case IDC_CUT: bookmark_utils::CopyToClipboard(model_, selection_, true); break; case IDC_COPY: bookmark_utils::CopyToClipboard(model_, selection_, false); break; case IDC_PASTE: { int index; const BookmarkNode* paste_target = bookmark_utils::GetParentForNewNodes(parent_, selection_, &index); if (!paste_target) return; bookmark_utils::PasteFromClipboard(model_, paste_target, index); break; } default: NOTREACHED(); } if (delegate_) delegate_->DidExecuteCommand(id); } bool BookmarkContextMenuController::IsCommandIdChecked(int command_id) const { PrefService* prefs = user_prefs::UserPrefs::Get(profile_); if (command_id == IDC_BOOKMARK_BAR_ALWAYS_SHOW) return prefs->GetBoolean(prefs::kShowBookmarkBar); DCHECK_EQ(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT, command_id); return prefs->GetBoolean(prefs::kShowAppsShortcutInBookmarkBar); } bool BookmarkContextMenuController::IsCommandIdEnabled(int command_id) const { bool enabled; if (IsPlatformCommandIdEnabled(command_id, &enabled)) return enabled; PrefService* prefs = user_prefs::UserPrefs::Get(profile_); bool is_root_node = selection_.size() == 1 && selection_[0]->parent() == model_->root_node(); bool can_edit = prefs->GetBoolean(prefs::kEditBookmarksEnabled); IncognitoModePrefs::Availability incognito_avail = IncognitoModePrefs::GetAvailability(profile_->GetPrefs()); switch (command_id) { case IDC_BOOKMARK_BAR_OPEN_INCOGNITO: return !profile_->IsOffTheRecord() && incognito_avail != IncognitoModePrefs::DISABLED; case IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO: return chrome::HasBookmarkURLsAllowedInIncognitoMode(selection_, profile_) && !profile_->IsOffTheRecord() && incognito_avail != IncognitoModePrefs::DISABLED; case IDC_BOOKMARK_BAR_OPEN_ALL: return chrome::HasBookmarkURLs(selection_); case IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW: return chrome::HasBookmarkURLs(selection_) && incognito_avail != IncognitoModePrefs::FORCED; case IDC_BOOKMARK_BAR_RENAME_FOLDER: case IDC_BOOKMARK_BAR_EDIT: return selection_.size() == 1 && !is_root_node && can_edit; case IDC_BOOKMARK_BAR_REMOVE: return !selection_.empty() && !is_root_node && can_edit; case IDC_BOOKMARK_BAR_NEW_FOLDER: case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK: return can_edit && bookmark_utils::GetParentForNewNodes( parent_, selection_, NULL) != NULL; case IDC_BOOKMARK_BAR_ALWAYS_SHOW: return !prefs->IsManagedPreference(prefs::kShowBookmarkBar); case IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT: return !prefs->IsManagedPreference(prefs::kShowAppsShortcutInBookmarkBar); case IDC_COPY: case IDC_CUT: return !selection_.empty() && !is_root_node && (command_id == IDC_COPY || can_edit); case IDC_PASTE: // Paste to selection from the Bookmark Bar, to parent_ everywhere else return can_edit && ((!selection_.empty() && bookmark_utils::CanPasteFromClipboard(selection_[0])) || bookmark_utils::CanPasteFromClipboard(parent_)); } return true; } bool BookmarkContextMenuController::GetAcceleratorForCommandId( int command_id, ui::Accelerator* accelerator) { return false; } #if !defined(OS_WIN) bool BookmarkContextMenuController::IsPlatformCommandIdEnabled( int command_id, bool* enabled) const { // By default, there are no platform-specific enabled or disabled commands. return false; } bool BookmarkContextMenuController::ExecutePlatformCommand(int id, int event_flags) { // By default, there are no platform-specific commands. return false; } #endif // OS_WIN void BookmarkContextMenuController::BookmarkModelChanged() { if (delegate_) delegate_->CloseMenu(); }
{ "content_hash": "f5ecc081a32a5680716a12a424845cf9", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 80, "avg_line_length": 32.913690476190474, "alnum_prop": 0.6533140428610181, "repo_name": "hujiajie/pa-chromium", "id": "d2703c39d779232228bb727eb6c3986ebc56ea5f", "size": "12191", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "853" }, { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "1176000" }, { "name": "Awk", "bytes": "9519" }, { "name": "C", "bytes": "74909991" }, { "name": "C#", "bytes": "1132" }, { "name": "C++", "bytes": "174451678" }, { "name": "DOT", "bytes": "1559" }, { "name": "F#", "bytes": "381" }, { "name": "Java", "bytes": "3787983" }, { "name": "JavaScript", "bytes": "19649328" }, { "name": "Logos", "bytes": "4517" }, { "name": "M", "bytes": "2190" }, { "name": "Matlab", "bytes": "3044" }, { "name": "Objective-C", "bytes": "7600008" }, { "name": "PHP", "bytes": "97817" }, { "name": "Perl", "bytes": "1473407" }, { "name": "Python", "bytes": "10022969" }, { "name": "R", "bytes": "262" }, { "name": "Shell", "bytes": "1590292" }, { "name": "Tcl", "bytes": "277077" }, { "name": "XSLT", "bytes": "13493" } ], "symlink_target": "" }
'use strict' module.exports = function(bookshelf) { const Geography = bookshelf.Model.extend({ tableName: 'geography' }) return bookshelf.model('Geography', Geography) }
{ "content_hash": "2cfd3f621782fb6955dc88513bf39a00", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 48, "avg_line_length": 16.727272727272727, "alnum_prop": 0.7010869565217391, "repo_name": "stanzheng/okcandidate", "id": "8958e01f99db9933e213d6292ae4262632439476", "size": "184", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "api/models/Geography.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "493" }, { "name": "JavaScript", "bytes": "234708" } ], "symlink_target": "" }
// Visual Studio Shared Project // Copyright(c) Microsoft Corporation // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the License); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at http://www.apache.org/licenses/LICENSE-2.0 // // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS // OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY // IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABLITY OR NON-INFRINGEMENT. // // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. using System; using System.Collections.Concurrent; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Text; using System.Threading; using System.Windows.Forms.Design; using System.Windows.Threading; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using Microsoft.VisualStudio; using Microsoft.VisualStudio.Settings; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.Shell.Settings; using Microsoft.Win32; using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; namespace Microsoft.VisualStudioTools.Project { /// <summary> /// This class implements an MSBuild logger that output events to VS outputwindow and tasklist. /// </summary> internal class IDEBuildLogger : Logger, IDisposable { #region fields private const string GeneralCollection = @"General"; private const string BuildVerbosityProperty = "MSBuildLoggerVerbosity"; private int currentIndent; private IVsOutputWindowPane outputWindowPane; private string errorString = SR.GetString(SR.Error); private string warningString = SR.GetString(SR.Warning); private TaskProvider taskProvider; private IVsHierarchy hierarchy; private IServiceProvider serviceProvider; private Dispatcher dispatcher; private bool haveCachedVerbosity = false; // Queues to manage Tasks and Error output plus message logging private ConcurrentQueue<Func<ErrorTask>> taskQueue; private ConcurrentQueue<OutputQueueEntry> outputQueue; #endregion #region properties public IServiceProvider ServiceProvider { get { return this.serviceProvider; } } public string WarningString { get { return this.warningString; } set { this.warningString = value; } } public string ErrorString { get { return this.errorString; } set { this.errorString = value; } } /// <summary> /// When the build is not a "design time" (background or secondary) build this is True /// </summary> /// <remarks> /// The only known way to detect an interactive build is to check this.outputWindowPane for null. /// </remarks> protected bool InteractiveBuild { get { return this.outputWindowPane != null; } } /// <summary> /// Set to null to avoid writing to the output window /// </summary> internal IVsOutputWindowPane OutputWindowPane { get { return this.outputWindowPane; } set { this.outputWindowPane = value; } } #endregion #region ctors /// <summary> /// Constructor. Inititialize member data. /// </summary> public IDEBuildLogger(IVsOutputWindowPane output, TaskProvider taskProvider, IVsHierarchy hierarchy) { Utilities.ArgumentNotNull("taskProvider", taskProvider); Utilities.ArgumentNotNull("hierarchy", hierarchy); Trace.WriteLineIf(Thread.CurrentThread.GetApartmentState() != ApartmentState.STA, "WARNING: IDEBuildLogger constructor running on the wrong thread."); IOleServiceProvider site; Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(hierarchy.GetSite(out site)); this.taskProvider = taskProvider; this.outputWindowPane = output; this.hierarchy = hierarchy; this.serviceProvider = new ServiceProvider(site); serviceProvider.GetUIThread().MustBeCalledFromUIThread(); this.dispatcher = Dispatcher.CurrentDispatcher; } #endregion #region IDisposable public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { var sp = this.serviceProvider as ServiceProvider; this.serviceProvider = null; if (sp != null) { sp.Dispose(); } } } #endregion #region overridden methods /// <summary> /// Overridden from the Logger class. /// </summary> public override void Initialize(IEventSource eventSource) { Utilities.ArgumentNotNull("eventSource", eventSource); this.taskQueue = new ConcurrentQueue<Func<ErrorTask>>(); this.outputQueue = new ConcurrentQueue<OutputQueueEntry>(); eventSource.BuildStarted += new BuildStartedEventHandler(BuildStartedHandler); eventSource.BuildFinished += new BuildFinishedEventHandler(BuildFinishedHandler); eventSource.ProjectStarted += new ProjectStartedEventHandler(ProjectStartedHandler); eventSource.ProjectFinished += new ProjectFinishedEventHandler(ProjectFinishedHandler); eventSource.TargetStarted += new TargetStartedEventHandler(TargetStartedHandler); eventSource.TargetFinished += new TargetFinishedEventHandler(TargetFinishedHandler); eventSource.TaskStarted += new TaskStartedEventHandler(TaskStartedHandler); eventSource.TaskFinished += new TaskFinishedEventHandler(TaskFinishedHandler); eventSource.CustomEventRaised += new CustomBuildEventHandler(CustomHandler); eventSource.ErrorRaised += new BuildErrorEventHandler(ErrorRaisedHandler); eventSource.WarningRaised += new BuildWarningEventHandler(WarningHandler); eventSource.MessageRaised += new BuildMessageEventHandler(MessageHandler); } #endregion #region event delegates /// <summary> /// This is the delegate for BuildStartedHandler events. /// </summary> protected virtual void BuildStartedHandler(object sender, BuildStartedEventArgs buildEvent) { // NOTE: This may run on a background thread! ClearCachedVerbosity(); ClearQueuedOutput(); ClearQueuedTasks(); QueueOutputEvent(MessageImportance.Low, buildEvent); } /// <summary> /// This is the delegate for BuildFinishedHandler events. /// </summary> /// <param name="sender"></param> /// <param name="buildEvent"></param> protected virtual void BuildFinishedHandler(object sender, BuildFinishedEventArgs buildEvent) { // NOTE: This may run on a background thread! MessageImportance importance = buildEvent.Succeeded ? MessageImportance.Low : MessageImportance.High; QueueOutputText(importance, Environment.NewLine); QueueOutputEvent(importance, buildEvent); // flush output and error queues ReportQueuedOutput(); ReportQueuedTasks(); } /// <summary> /// This is the delegate for ProjectStartedHandler events. /// </summary> protected virtual void ProjectStartedHandler(object sender, ProjectStartedEventArgs buildEvent) { // NOTE: This may run on a background thread! QueueOutputEvent(MessageImportance.Low, buildEvent); } /// <summary> /// This is the delegate for ProjectFinishedHandler events. /// </summary> protected virtual void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs buildEvent) { // NOTE: This may run on a background thread! QueueOutputEvent(buildEvent.Succeeded ? MessageImportance.Low : MessageImportance.High, buildEvent); } /// <summary> /// This is the delegate for TargetStartedHandler events. /// </summary> protected virtual void TargetStartedHandler(object sender, TargetStartedEventArgs buildEvent) { // NOTE: This may run on a background thread! QueueOutputEvent(MessageImportance.Low, buildEvent); IndentOutput(); } /// <summary> /// This is the delegate for TargetFinishedHandler events. /// </summary> protected virtual void TargetFinishedHandler(object sender, TargetFinishedEventArgs buildEvent) { // NOTE: This may run on a background thread! UnindentOutput(); QueueOutputEvent(MessageImportance.Low, buildEvent); } /// <summary> /// This is the delegate for TaskStartedHandler events. /// </summary> protected virtual void TaskStartedHandler(object sender, TaskStartedEventArgs buildEvent) { // NOTE: This may run on a background thread! QueueOutputEvent(MessageImportance.Low, buildEvent); IndentOutput(); } /// <summary> /// This is the delegate for TaskFinishedHandler events. /// </summary> protected virtual void TaskFinishedHandler(object sender, TaskFinishedEventArgs buildEvent) { // NOTE: This may run on a background thread! UnindentOutput(); QueueOutputEvent(MessageImportance.Low, buildEvent); } /// <summary> /// This is the delegate for CustomHandler events. /// </summary> /// <param name="sender"></param> /// <param name="buildEvent"></param> protected virtual void CustomHandler(object sender, CustomBuildEventArgs buildEvent) { // NOTE: This may run on a background thread! QueueOutputEvent(MessageImportance.High, buildEvent); } /// <summary> /// This is the delegate for error events. /// </summary> protected virtual void ErrorRaisedHandler(object sender, BuildErrorEventArgs errorEvent) { // NOTE: This may run on a background thread! QueueOutputText(GetFormattedErrorMessage(errorEvent.File, errorEvent.LineNumber, errorEvent.ColumnNumber, false, errorEvent.Code, errorEvent.Message)); QueueTaskEvent(errorEvent); } /// <summary> /// This is the delegate for warning events. /// </summary> protected virtual void WarningHandler(object sender, BuildWarningEventArgs warningEvent) { // NOTE: This may run on a background thread! QueueOutputText(MessageImportance.High, GetFormattedErrorMessage(warningEvent.File, warningEvent.LineNumber, warningEvent.ColumnNumber, true, warningEvent.Code, warningEvent.Message)); QueueTaskEvent(warningEvent); } /// <summary> /// This is the delegate for Message event types /// </summary> protected virtual void MessageHandler(object sender, BuildMessageEventArgs messageEvent) { // NOTE: This may run on a background thread! // Special-case this event type. It's reported by tasks derived from ToolTask, and prints out the command line used // to invoke the tool. It has high priority for some unclear reason, but we really don't want to be showing it for // verbosity below normal (https://nodejstools.codeplex.com/workitem/693). The check here is taken directly from the // standard MSBuild console logger, which does the same thing. if (messageEvent is TaskCommandLineEventArgs && !IsVerbosityAtLeast(LoggerVerbosity.Normal)) { return; } QueueOutputEvent(messageEvent.Importance, messageEvent); } #endregion #region output queue protected void QueueOutputEvent(MessageImportance importance, BuildEventArgs buildEvent) { // NOTE: This may run on a background thread! if (LogAtImportance(importance) && !string.IsNullOrEmpty(buildEvent.Message)) { StringBuilder message = new StringBuilder(this.currentIndent + buildEvent.Message.Length); if (this.currentIndent > 0) { message.Append('\t', this.currentIndent); } message.AppendLine(buildEvent.Message); QueueOutputText(message.ToString()); } } protected void QueueOutputText(MessageImportance importance, string text) { // NOTE: This may run on a background thread! if (LogAtImportance(importance)) { QueueOutputText(text); } } protected void QueueOutputText(string text) { // NOTE: This may run on a background thread! if (this.OutputWindowPane != null) { // Enqueue the output text this.outputQueue.Enqueue(new OutputQueueEntry(text, OutputWindowPane)); // We want to interactively report the output. But we dont want to dispatch // more than one at a time, otherwise we might overflow the main thread's // message queue. So, we only report the output if the queue was empty. if (this.outputQueue.Count == 1) { ReportQueuedOutput(); } } } private void IndentOutput() { // NOTE: This may run on a background thread! this.currentIndent++; } private void UnindentOutput() { // NOTE: This may run on a background thread! this.currentIndent--; } private void ReportQueuedOutput() { // NOTE: This may run on a background thread! // We need to output this on the main thread. We must use BeginInvoke because the main thread may not be pumping events yet. BeginInvokeWithErrorMessage(this.serviceProvider, this.dispatcher, FlushBuildOutput); } internal void FlushBuildOutput() { OutputQueueEntry output; while (this.outputQueue.TryDequeue(out output)) { ErrorHandler.ThrowOnFailure(output.Pane.OutputString(output.Message)); } } private void ClearQueuedOutput() { // NOTE: This may run on a background thread! this.outputQueue = new ConcurrentQueue<OutputQueueEntry>(); } #endregion output queue #region task queue class NavigableErrorTask : ErrorTask { private readonly IServiceProvider _serviceProvider; public NavigableErrorTask(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; } protected override void OnNavigate(EventArgs e) { VsUtilities.NavigateTo( _serviceProvider, Document, Guid.Empty, Line, Column - 1 ); base.OnNavigate(e); } } protected void QueueTaskEvent(BuildEventArgs errorEvent) { this.taskQueue.Enqueue(() => { var task = new NavigableErrorTask(serviceProvider); if (errorEvent is BuildErrorEventArgs) { BuildErrorEventArgs errorArgs = (BuildErrorEventArgs)errorEvent; task.Document = errorArgs.File; task.ErrorCategory = TaskErrorCategory.Error; task.Line = errorArgs.LineNumber - 1; // The task list does +1 before showing this number. task.Column = errorArgs.ColumnNumber; task.Priority = TaskPriority.High; } else if (errorEvent is BuildWarningEventArgs) { BuildWarningEventArgs warningArgs = (BuildWarningEventArgs)errorEvent; task.Document = warningArgs.File; task.ErrorCategory = TaskErrorCategory.Warning; task.Line = warningArgs.LineNumber - 1; // The task list does +1 before showing this number. task.Column = warningArgs.ColumnNumber; task.Priority = TaskPriority.Normal; } task.Text = errorEvent.Message; task.Category = TaskCategory.BuildCompile; task.HierarchyItem = hierarchy; return task; }); // NOTE: Unlike output we dont want to interactively report the tasks. So we never queue // call ReportQueuedTasks here. We do this when the build finishes. } private void ReportQueuedTasks() { // NOTE: This may run on a background thread! // We need to output this on the main thread. We must use BeginInvoke because the main thread may not be pumping events yet. BeginInvokeWithErrorMessage(this.serviceProvider, this.dispatcher, () => { this.taskProvider.SuspendRefresh(); try { Func<ErrorTask> taskFunc; while (this.taskQueue.TryDequeue(out taskFunc)) { // Create the error task ErrorTask task = taskFunc(); // Log the task this.taskProvider.Tasks.Add(task); } } finally { this.taskProvider.ResumeRefresh(); } }); } private void ClearQueuedTasks() { // NOTE: This may run on a background thread! this.taskQueue = new ConcurrentQueue<Func<ErrorTask>>(); if (this.InteractiveBuild) { // We need to clear this on the main thread. We must use BeginInvoke because the main thread may not be pumping events yet. BeginInvokeWithErrorMessage(this.serviceProvider, this.dispatcher, () => { this.taskProvider.Tasks.Clear(); }); } } #endregion task queue #region helpers /// <summary> /// This method takes a MessageImportance and returns true if messages /// at importance i should be loggeed. Otherwise return false. /// </summary> private bool LogAtImportance(MessageImportance importance) { // If importance is too low for current settings, ignore the event bool logIt = false; this.SetVerbosity(); switch (this.Verbosity) { case LoggerVerbosity.Quiet: logIt = false; break; case LoggerVerbosity.Minimal: logIt = (importance == MessageImportance.High); break; case LoggerVerbosity.Normal: // Falling through... case LoggerVerbosity.Detailed: logIt = (importance != MessageImportance.Low); break; case LoggerVerbosity.Diagnostic: logIt = true; break; default: Debug.Fail("Unknown Verbosity level. Ignoring will cause nothing to be logged"); break; } return logIt; } /// <summary> /// Format error messages for the task list /// </summary> private string GetFormattedErrorMessage( string fileName, int line, int column, bool isWarning, string errorNumber, string errorText) { string errorCode = isWarning ? this.WarningString : this.ErrorString; StringBuilder message = new StringBuilder(); if (!string.IsNullOrEmpty(fileName)) { message.AppendFormat(CultureInfo.CurrentCulture, "{0}({1},{2}):", fileName, line, column); } message.AppendFormat(CultureInfo.CurrentCulture, " {0} {1}: {2}", errorCode, errorNumber, errorText); message.AppendLine(); return message.ToString(); } /// <summary> /// Sets the verbosity level. /// </summary> private void SetVerbosity() { if (!this.haveCachedVerbosity) { this.Verbosity = LoggerVerbosity.Normal; try { var settings = new ShellSettingsManager(serviceProvider); var store = settings.GetReadOnlySettingsStore(SettingsScope.UserSettings); if (store.CollectionExists(GeneralCollection) && store.PropertyExists(GeneralCollection, BuildVerbosityProperty)) { this.Verbosity = (LoggerVerbosity)store.GetInt32(GeneralCollection, BuildVerbosityProperty, (int)LoggerVerbosity.Normal); } } catch (Exception ex) { var message = string.Format( "Unable to read verbosity option from the registry.{0}{1}", Environment.NewLine, ex.ToString() ); this.QueueOutputText(MessageImportance.High, message); } this.haveCachedVerbosity = true; } } /// <summary> /// Clear the cached verbosity, so that it will be re-evaluated from the build verbosity registry key. /// </summary> private void ClearCachedVerbosity() { this.haveCachedVerbosity = false; } #endregion helpers #region exception handling helpers /// <summary> /// Call Dispatcher.BeginInvoke, showing an error message if there was a non-critical exception. /// </summary> /// <param name="serviceProvider">service provider</param> /// <param name="dispatcher">dispatcher</param> /// <param name="action">action to invoke</param> private static void BeginInvokeWithErrorMessage(IServiceProvider serviceProvider, Dispatcher dispatcher, Action action) { dispatcher.BeginInvoke(new Action(() => CallWithErrorMessage(serviceProvider, action))); } /// <summary> /// Show error message if exception is caught when invoking a method /// </summary> /// <param name="serviceProvider">service provider</param> /// <param name="action">action to invoke</param> private static void CallWithErrorMessage(IServiceProvider serviceProvider, Action action) { try { action(); } catch (Exception ex) { if (ex.IsCriticalException()) { throw; } ShowErrorMessage(serviceProvider, ex); } } /// <summary> /// Show error window about the exception /// </summary> /// <param name="serviceProvider">service provider</param> /// <param name="exception">exception</param> private static void ShowErrorMessage(IServiceProvider serviceProvider, Exception exception) { IUIService UIservice = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (UIservice != null && exception != null) { UIservice.ShowError(exception); } } #endregion exception handling helpers class OutputQueueEntry { public readonly string Message; public readonly IVsOutputWindowPane Pane; public OutputQueueEntry(string message, IVsOutputWindowPane pane) { Message = message; Pane = pane; } } } }
{ "content_hash": "5b6ba84bd279fb9fb5ae2193a38beb5f", "timestamp": "", "source": "github", "line_count": 597, "max_line_length": 196, "avg_line_length": 40.802345058626464, "alnum_prop": 0.6080709388726959, "repo_name": "adamdriscoll/poshtools", "id": "7a58cb0aaef291f6cec7e7ead1a45c5459890574", "size": "24361", "binary": false, "copies": "2", "ref": "refs/heads/dev", "path": "PowerShellTools/Project/SharedProject/IDEBuildLogger.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "360" }, { "name": "C#", "bytes": "5389210" }, { "name": "PowerShell", "bytes": "165053" } ], "symlink_target": "" }
package jj.minimal; import jj.webdriver.By; import jj.webdriver.Page; import jj.webdriver.URL; /** * @author jason * */ @URL("/") public interface IndexPage extends Page { @By("say") IndexPage setSay(String say); @By("submit") IndexPage clickSubmit(); @By("line-%d") String readLine(int index); }
{ "content_hash": "32296cf8ef0e3af5d29e3fe02d711469", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 41, "avg_line_length": 13.652173913043478, "alnum_prop": 0.6719745222929936, "repo_name": "heinousjay/JibbrJabbr", "id": "4f4aadfbee97f4196316b3004e112e5f0c4b024b", "size": "912", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/src/test/java/jj/minimal/IndexPage.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "22391" }, { "name": "HTML", "bytes": "10972" }, { "name": "Java", "bytes": "1483097" }, { "name": "JavaScript", "bytes": "702814" } ], "symlink_target": "" }
package org.locationtech.geowave.core.geotime.store; import org.locationtech.geowave.core.store.adapter.InternalDataAdapter; import org.opengis.feature.simple.SimpleFeature; public interface InternalGeotoolsFeatureDataAdapter<T extends SimpleFeature> extends InternalDataAdapter<T>, GeotoolsFeatureDataAdapter<T> { }
{ "content_hash": "5f4da9552b8e9bd64453ca1fe880c613", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 84, "avg_line_length": 29.90909090909091, "alnum_prop": 0.8328267477203647, "repo_name": "ngageoint/geowave", "id": "ce0526ae8b137fce2a07936068619447bf882fbc", "size": "764", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/geotime/src/main/java/org/locationtech/geowave/core/geotime/store/InternalGeotoolsFeatureDataAdapter.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "5073" }, { "name": "CMake", "bytes": "2032" }, { "name": "FreeMarker", "bytes": "2879" }, { "name": "Gnuplot", "bytes": "57750" }, { "name": "Groovy", "bytes": "1323" }, { "name": "HTML", "bytes": "1903" }, { "name": "Java", "bytes": "7103026" }, { "name": "Protocol Buffer", "bytes": "1525" }, { "name": "Puppet", "bytes": "4039" }, { "name": "Scala", "bytes": "26507" }, { "name": "Scheme", "bytes": "20491" }, { "name": "Shell", "bytes": "68381" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <title>Leaflet debug page</title> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.2/leaflet.css" /> <!--[if lte IE 8]><link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.2/leaflet.ie.css" /><![endif]--> <script src="http://cdn.leafletjs.com/leaflet-0.6.2/leaflet.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="screen.css" /> <link rel="stylesheet" href="../dist/MarkerCluster.css" /> <link rel="stylesheet" href="../dist/MarkerCluster.Default.css" /> <!--[if lte IE 8]><link rel="stylesheet" href="../dist/MarkerCluster.Default.ie.css" /><![endif]--> <script src="../dist/leaflet.markercluster-src.js"></script> <script src="realworld.10000.js"></script> </head> <body> <div id="map"></div> <span>Mouse over a cluster to see the bounds of its children and click a cluster to zoom to those bounds</span> <script type="text/javascript"> var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png', cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade, Points &copy 2012 LINZ', cloudmade = L.tileLayer(cloudmadeUrl, {maxZoom: 17, attribution: cloudmadeAttribution}), latlng = L.latLng(-37.89, 175.46); var map = L.map('map', {center: latlng, zoom: 13, layers: [cloudmade]}); var markers = L.markerClusterGroup(); for (var i = 0; i < addressPoints.length; i++) { var a = addressPoints[i]; var title = a[2]; var marker = L.marker(L.latLng(a[0], a[1]), { title: title }); marker.bindPopup(title); markers.addLayer(marker); } map.addLayer(markers); </script> </body> </html>
{ "content_hash": "43ad767236c2d0fae0e683e2a03b4b20", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 131, "avg_line_length": 38.23913043478261, "alnum_prop": 0.6765207504263786, "repo_name": "luisfbmelo/sismodoitenta", "id": "9a67ea178d7cfdb27c7308310a53ca5e2e483918", "size": "1759", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "scripts/leaflet_cluster/example/marker-clustering-realworld.10000.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "67869" }, { "name": "HTML", "bytes": "132258" }, { "name": "Hack", "bytes": "4695" }, { "name": "JavaScript", "bytes": "3204429" }, { "name": "PHP", "bytes": "109806" } ], "symlink_target": "" }
FROM balenalib/vab820-quad-debian:buster-run # remove several traces of debian python RUN apt-get purge -y python.* # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # install python dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/* # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --batch --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 ENV PYTHON_VERSION 3.8.12 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 21.3.1 ENV SETUPTOOLS_VERSION 60.5.4 RUN set -x \ && buildDeps=' \ curl \ ' \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-armv7hf-libffi3.2.tar.gz" \ && echo "1caf0609337bf86be785a9a5d17893b06499db0acd992d9cbf3ce61e7bf92eb2 Python-$PYTHON_VERSION.linux-armv7hf-libffi3.2.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.linux-armv7hf-libffi3.2.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.linux-armv7hf-libffi3.2.tar.gz" \ && ldconfig \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \ && echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ && ln -sf pip3 pip \ && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ && ln -sf idle3 idle \ && ln -sf pydoc3 pydoc \ && ln -sf python3 python \ && ln -sf python3-config python-config # set PYTHONPATH to point to dist-packages ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Debian Buster \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.8.12, Pip v21.3.1, Setuptools v60.5.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "content_hash": "d665a4ac2fa009d5042779d3ec2e2dea", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 709, "avg_line_length": 52.19230769230769, "alnum_prop": 0.707442888725129, "repo_name": "resin-io-library/base-images", "id": "93cbdbae70a32cbbb809b997e519c358521a1cbb", "size": "4092", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/python/vab820-quad/debian/buster/3.8.12/run/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "71234697" }, { "name": "JavaScript", "bytes": "13096" }, { "name": "Shell", "bytes": "12051936" }, { "name": "Smarty", "bytes": "59789" } ], "symlink_target": "" }
package de.marhan.craps.game.round; import de.marhan.craps.Player; import de.marhan.craps.util.Message; public interface Round extends Message { int getSum(); Round play(Player shooter); default ComeOutResult getComeOutResult() { return ComeOutResult.NOT_DEFINED; } default ShootingResult getShootingResult() { return ShootingResult.NOT_DEFINED; } }
{ "content_hash": "7e58588fc35eae6c1583db8ed44e6cc7", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 48, "avg_line_length": 19.85, "alnum_prop": 0.7103274559193955, "repo_name": "marhan/craps", "id": "fa92e9c0d78e6608488c75faa9720fc17c52cef3", "size": "397", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/de/marhan/craps/game/round/Round.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "18611" }, { "name": "Java", "bytes": "28627" } ], "symlink_target": "" }
<resources> <!-- Default screen margins, per the Android Design guidelines. --> <dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen> <dimen name="rdo1">0dp</dimen> <dimen name="rdo2">100dp</dimen> <dimen name="rdo3">200dp</dimen> <dimen name="rdo4">300dp</dimen> <dimen name="rdo5">400dp</dimen> <dimen name="wheel_radius">3dp</dimen> <dimen name="wheel_stroke_width">1px</dimen> <dimen name="wheel_inner_line_padding">2dp</dimen> <dimen name="wheel_inner_line_margin">-2dp</dimen> <dimen name="wheel_inner_line_width">1dp</dimen> <dimen name="line_width">1dp</dimen> </resources>
{ "content_hash": "5726c2e63eb3198a80da9a686a80d809", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 71, "avg_line_length": 33.04761904761905, "alnum_prop": 0.6628242074927954, "repo_name": "amar19860330/amar-android-demo", "id": "a6a6ee1524bb273c0799b9614c95cc4ade82808f", "size": "694", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hello/src/main/res/values/dimens.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "478122" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.neo4j.nlp</groupId> <artifactId>graphify</artifactId> <version>1.0.0</version> <properties> <neo4j.version>2.2.1</neo4j.version> </properties> <dependencies> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j</artifactId> <version>${neo4j.version}</version> <exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-kernel</artifactId> <version>${neo4j.version}</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-io</artifactId> <version>${neo4j.version}</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>org.neo4j</groupId> <artifactId>server-api</artifactId> <version>${neo4j.version}</version> <exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-client</artifactId> <version>1.9</version> </dependency> <dependency> <groupId>javax.ws.rs</groupId> <artifactId>javax.ws.rs-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>16.0.1</version> </dependency> <dependency> <groupId>org.apache.xmlrpc</groupId> <artifactId>xmlrpc-client</artifactId> <version>3.1.3</version> </dependency> <dependency> <groupId>org.apache.xmlrpc</groupId> <artifactId>xmlrpc-common</artifactId> <version>3.1.3</version> </dependency> <dependency> <groupId>org.mapdb</groupId> <artifactId>mapdb</artifactId> <version>0.9.3</version> </dependency> <dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.7.3</version> </dependency> <dependency> <groupId>org.javalite</groupId> <artifactId>javalite-common</artifactId> <version>1.4.8</version> </dependency> <dependency> <groupId>org.jetbrains</groupId> <artifactId>annotations</artifactId> <version>13.0</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.2.4</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.8.5</version> </dependency> <dependency> <groupId>com.rabbitmq</groupId> <artifactId>amqp-client</artifactId> <version>3.3.4</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.1.1</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-math</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>net.sf.jung</groupId> <artifactId>jung-algorithms</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>net.sf.jung</groupId> <artifactId>jung-graph-impl</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>org.apache.spark</groupId> <artifactId>spark-core_2.10</artifactId> <version>1.1.0</version> </dependency> <dependency> <groupId>org.scalatest</groupId> <artifactId>scalatest_2.10</artifactId> <version>2.0</version> <scope>test</scope> </dependency> <dependency> <groupId>com.github.mdr</groupId> <artifactId>ascii-graphs_2.10</artifactId> <version>0.0.6</version> </dependency> <dependency> <groupId>com.jsuereth</groupId> <artifactId>scala-arm_2.10</artifactId> <version>1.4</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.scala-tools</groupId> <artifactId>maven-scala-plugin</artifactId> <version>2.15.2</version> <executions> <!-- Run scala compiler in the process-resources phase, so that dependencies on scala classes can be resolved later in the (Java) compile phase --> <execution> <id>scala-compile-first</id> <phase>process-resources</phase> <goals> <goal>compile</goal> </goals> </execution> <!-- Run scala compiler in the process-test-resources phase, so that dependencies on scala classes can be resolved later in the (Java) test-compile phase --> <execution> <id>scala-test-compile</id> <phase>process-test-resources</phase> <goals> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> </project>
{ "content_hash": "ad54b69b3a8e17dcd6453970058c1733", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 108, "avg_line_length": 36.02020202020202, "alnum_prop": 0.5117779024116658, "repo_name": "Graphify/graphify", "id": "a327684bc372f77d39d0fe8be55f41bacbac2693", "size": "7132", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/extension/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "167546" }, { "name": "Scala", "bytes": "13667" } ], "symlink_target": "" }
var botname = require('../'); var colors = require('colors'); var name = botname(); var str = (process.argv[2] == '-n') ? '' : 'You could name your printer: ' ; console.log(str + name.red);
{ "content_hash": "1b4b1ec4772631a3906c39863560b00a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 35, "avg_line_length": 21.88888888888889, "alnum_prop": 0.583756345177665, "repo_name": "makerbot/botname", "id": "42b2f4e99f64d41b10f293bc176d3207ca7dbdeb", "size": "218", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bin/run.js", "mode": "33261", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "5441" } ], "symlink_target": "" }
package org.apache.hyracks.control.cc.scheduler; import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.commons.lang3.tuple.Pair; import org.apache.hyracks.api.constraints.expressions.LValueConstraintExpression; import org.apache.hyracks.api.constraints.expressions.PartitionCountExpression; import org.apache.hyracks.api.dataflow.ActivityId; import org.apache.hyracks.api.dataflow.ConnectorDescriptorId; import org.apache.hyracks.api.dataflow.IConnectorDescriptor; import org.apache.hyracks.api.dataflow.OperatorDescriptorId; import org.apache.hyracks.api.dataflow.TaskId; import org.apache.hyracks.api.dataflow.connectors.IConnectorPolicy; import org.apache.hyracks.api.dataflow.connectors.IConnectorPolicyAssignmentPolicy; import org.apache.hyracks.api.dataflow.connectors.PipeliningConnectorPolicy; import org.apache.hyracks.api.exceptions.HyracksException; import org.apache.hyracks.api.job.ActivityCluster; import org.apache.hyracks.api.job.ActivityClusterGraph; import org.apache.hyracks.api.partitions.PartitionId; import org.apache.hyracks.control.cc.job.ActivityClusterPlan; import org.apache.hyracks.control.cc.job.ActivityPlan; import org.apache.hyracks.control.cc.job.JobRun; import org.apache.hyracks.control.cc.job.Task; import org.apache.hyracks.control.cc.job.TaskCluster; import org.apache.hyracks.control.cc.job.TaskClusterId; public class ActivityClusterPlanner { private static final Logger LOGGER = Logger.getLogger(ActivityClusterPlanner.class.getName()); private final JobScheduler scheduler; private final Map<PartitionId, TaskCluster> partitionProducingTaskClusterMap; public ActivityClusterPlanner(JobScheduler newJobScheduler) { this.scheduler = newJobScheduler; partitionProducingTaskClusterMap = new HashMap<PartitionId, TaskCluster>(); } public ActivityClusterPlan planActivityCluster(ActivityCluster ac) throws HyracksException { JobRun jobRun = scheduler.getJobRun(); Map<ActivityId, ActivityPartitionDetails> pcMap = computePartitionCounts(ac); Map<ActivityId, ActivityPlan> activityPlanMap = buildActivityPlanMap(ac, jobRun, pcMap); assignConnectorPolicy(ac, activityPlanMap); TaskCluster[] taskClusters = computeTaskClusters(ac, jobRun, activityPlanMap); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Plan for " + ac); LOGGER.info("Built " + taskClusters.length + " Task Clusters"); for (TaskCluster tc : taskClusters) { LOGGER.info("Tasks: " + Arrays.toString(tc.getTasks())); } } return new ActivityClusterPlan(taskClusters, activityPlanMap); } private Map<ActivityId, ActivityPlan> buildActivityPlanMap(ActivityCluster ac, JobRun jobRun, Map<ActivityId, ActivityPartitionDetails> pcMap) { Map<ActivityId, ActivityPlan> activityPlanMap = new HashMap<ActivityId, ActivityPlan>(); Set<ActivityId> depAnIds = new HashSet<ActivityId>(); for (ActivityId anId : ac.getActivityMap().keySet()) { depAnIds.clear(); getDependencyActivityIds(depAnIds, anId, ac); ActivityPartitionDetails apd = pcMap.get(anId); Task[] tasks = new Task[apd.getPartitionCount()]; ActivityPlan activityPlan = new ActivityPlan(apd); for (int i = 0; i < tasks.length; ++i) { TaskId tid = new TaskId(anId, i); tasks[i] = new Task(tid, activityPlan); for (ActivityId danId : depAnIds) { ActivityCluster dAC = ac.getActivityClusterGraph().getActivityMap().get(danId); ActivityClusterPlan dACP = jobRun.getActivityClusterPlanMap().get(dAC.getId()); assert dACP != null : "IllegalStateEncountered: Dependent AC is being planned without a plan for dependency AC: Encountered no plan for ActivityID " + danId; Task[] dATasks = dACP.getActivityPlanMap().get(danId).getTasks(); assert dATasks != null : "IllegalStateEncountered: Dependent AC is being planned without a plan for dependency AC: Encountered no plan for ActivityID " + danId; assert dATasks.length == tasks.length : "Dependency activity partitioned differently from dependent: " + dATasks.length + " != " + tasks.length; Task dTask = dATasks[i]; TaskId dTaskId = dTask.getTaskId(); tasks[i].getDependencies().add(dTaskId); dTask.getDependents().add(tid); } } activityPlan.setTasks(tasks); activityPlanMap.put(anId, activityPlan); } return activityPlanMap; } private TaskCluster[] computeTaskClusters(ActivityCluster ac, JobRun jobRun, Map<ActivityId, ActivityPlan> activityPlanMap) { Set<ActivityId> activities = ac.getActivityMap().keySet(); Map<TaskId, List<Pair<TaskId, ConnectorDescriptorId>>> taskConnectivity = computeTaskConnectivity(jobRun, activityPlanMap, activities); TaskCluster[] taskClusters = ac.getActivityClusterGraph().isUseConnectorPolicyForScheduling() ? buildConnectorPolicyAwareTaskClusters( ac, activityPlanMap, taskConnectivity) : buildConnectorPolicyUnawareTaskClusters(ac, activityPlanMap); for (TaskCluster tc : taskClusters) { Set<TaskCluster> tcDependencyTaskClusters = tc.getDependencyTaskClusters(); for (Task ts : tc.getTasks()) { TaskId tid = ts.getTaskId(); List<Pair<TaskId, ConnectorDescriptorId>> cInfoList = taskConnectivity.get(tid); if (cInfoList != null) { for (Pair<TaskId, ConnectorDescriptorId> p : cInfoList) { Task targetTS = activityPlanMap.get(p.getLeft().getActivityId()).getTasks()[p.getLeft() .getPartition()]; TaskCluster targetTC = targetTS.getTaskCluster(); if (targetTC != tc) { ConnectorDescriptorId cdId = p.getRight(); PartitionId pid = new PartitionId(jobRun.getJobId(), cdId, tid.getPartition(), p.getLeft() .getPartition()); tc.getProducedPartitions().add(pid); targetTC.getRequiredPartitions().add(pid); partitionProducingTaskClusterMap.put(pid, tc); } } } for (TaskId dTid : ts.getDependencies()) { TaskCluster dTC = getTaskCluster(dTid); dTC.getDependentTaskClusters().add(tc); tcDependencyTaskClusters.add(dTC); } } } return taskClusters; } private TaskCluster[] buildConnectorPolicyUnawareTaskClusters(ActivityCluster ac, Map<ActivityId, ActivityPlan> activityPlanMap) { List<Task> taskStates = new ArrayList<Task>(); for (ActivityId anId : ac.getActivityMap().keySet()) { ActivityPlan ap = activityPlanMap.get(anId); Task[] tasks = ap.getTasks(); for (Task t : tasks) { taskStates.add(t); } } TaskCluster tc = new TaskCluster(new TaskClusterId(ac.getId(), 0), ac, taskStates.toArray(new Task[taskStates .size()])); for (Task t : tc.getTasks()) { t.setTaskCluster(tc); } return new TaskCluster[] { tc }; } private Map<TaskId, List<Pair<TaskId, ConnectorDescriptorId>>> computeTaskConnectivity(JobRun jobRun, Map<ActivityId, ActivityPlan> activityPlanMap, Set<ActivityId> activities) { Map<TaskId, List<Pair<TaskId, ConnectorDescriptorId>>> taskConnectivity = new HashMap<TaskId, List<Pair<TaskId, ConnectorDescriptorId>>>(); ActivityClusterGraph acg = jobRun.getActivityClusterGraph(); BitSet targetBitmap = new BitSet(); for (ActivityId ac1 : activities) { ActivityCluster ac = acg.getActivityMap().get(ac1); Task[] ac1TaskStates = activityPlanMap.get(ac1).getTasks(); int nProducers = ac1TaskStates.length; List<IConnectorDescriptor> outputConns = ac.getActivityOutputMap().get(ac1); if (outputConns != null) { for (IConnectorDescriptor c : outputConns) { ConnectorDescriptorId cdId = c.getConnectorId(); ActivityId ac2 = ac.getConsumerActivity(cdId); Task[] ac2TaskStates = activityPlanMap.get(ac2).getTasks(); int nConsumers = ac2TaskStates.length; if (c.allProducersToAllConsumers()) { List<Pair<TaskId, ConnectorDescriptorId>> cInfoList = new ArrayList<Pair<TaskId, ConnectorDescriptorId>>(); for (int j = 0; j < nConsumers; j++) { TaskId targetTID = ac2TaskStates[j].getTaskId(); cInfoList.add(Pair.<TaskId, ConnectorDescriptorId> of(targetTID, cdId)); } for (int i = 0; i < nProducers; ++i) { taskConnectivity.put(ac1TaskStates[i].getTaskId(), cInfoList); } } else { for (int i = 0; i < nProducers; ++i) { c.indicateTargetPartitions(nProducers, nConsumers, i, targetBitmap); List<Pair<TaskId, ConnectorDescriptorId>> cInfoList = taskConnectivity.get(ac1TaskStates[i] .getTaskId()); if (cInfoList == null) { cInfoList = new ArrayList<Pair<TaskId, ConnectorDescriptorId>>(); taskConnectivity.put(ac1TaskStates[i].getTaskId(), cInfoList); } for (int j = targetBitmap.nextSetBit(0); j >= 0; j = targetBitmap.nextSetBit(j + 1)) { TaskId targetTID = ac2TaskStates[j].getTaskId(); cInfoList.add(Pair.<TaskId, ConnectorDescriptorId> of(targetTID, cdId)); } } } } } } return taskConnectivity; } private TaskCluster[] buildConnectorPolicyAwareTaskClusters(ActivityCluster ac, Map<ActivityId, ActivityPlan> activityPlanMap, Map<TaskId, List<Pair<TaskId, ConnectorDescriptorId>>> taskConnectivity) { Map<TaskId, Set<TaskId>> taskClusterMap = new HashMap<TaskId, Set<TaskId>>(); for (ActivityId anId : ac.getActivityMap().keySet()) { ActivityPlan ap = activityPlanMap.get(anId); Task[] tasks = ap.getTasks(); for (Task t : tasks) { Set<TaskId> cluster = new HashSet<TaskId>(); TaskId tid = t.getTaskId(); cluster.add(tid); taskClusterMap.put(tid, cluster); } } JobRun jobRun = scheduler.getJobRun(); Map<ConnectorDescriptorId, IConnectorPolicy> connectorPolicies = jobRun.getConnectorPolicyMap(); for (Map.Entry<TaskId, List<Pair<TaskId, ConnectorDescriptorId>>> e : taskConnectivity.entrySet()) { Set<TaskId> cluster = taskClusterMap.get(e.getKey()); for (Pair<TaskId, ConnectorDescriptorId> p : e.getValue()) { IConnectorPolicy cPolicy = connectorPolicies.get(p.getRight()); if (cPolicy.requiresProducerConsumerCoscheduling()) { cluster.add(p.getLeft()); } } } /* * taskClusterMap contains for every TID x, x -> { coscheduled consumer TIDs U x } * We compute the transitive closure of this relation to find the largest set of * tasks that need to be co-scheduled */ int counter = 0; TaskId[] ordinalList = new TaskId[taskClusterMap.size()]; Map<TaskId, Integer> ordinalMap = new HashMap<TaskId, Integer>(); for (TaskId tid : taskClusterMap.keySet()) { ordinalList[counter] = tid; ordinalMap.put(tid, counter); ++counter; } int n = ordinalList.length; BitSet[] paths = new BitSet[n]; for (Map.Entry<TaskId, Set<TaskId>> e : taskClusterMap.entrySet()) { int i = ordinalMap.get(e.getKey()); BitSet bsi = paths[i]; if (bsi == null) { bsi = new BitSet(n); paths[i] = bsi; } for (TaskId ttid : e.getValue()) { int j = ordinalMap.get(ttid); paths[i].set(j); BitSet bsj = paths[j]; if (bsj == null) { bsj = new BitSet(n); paths[j] = bsj; } bsj.set(i); } } for (int k = 0; k < n; ++k) { for (int i = paths[k].nextSetBit(0); i >= 0; i = paths[k].nextSetBit(i + 1)) { for (int j = paths[i].nextClearBit(0); j < n && j >= 0; j = paths[i].nextClearBit(j + 1)) { paths[i].set(j, paths[k].get(j)); paths[j].set(i, paths[i].get(j)); } } } BitSet pending = new BitSet(n); pending.set(0, n); List<List<TaskId>> clusters = new ArrayList<List<TaskId>>(); for (int i = pending.nextSetBit(0); i >= 0; i = pending.nextSetBit(i)) { List<TaskId> cluster = new ArrayList<TaskId>(); for (int j = paths[i].nextSetBit(0); j >= 0; j = paths[i].nextSetBit(j + 1)) { cluster.add(ordinalList[j]); pending.clear(j); } clusters.add(cluster); } List<TaskCluster> tcSet = new ArrayList<TaskCluster>(); counter = 0; for (List<TaskId> cluster : clusters) { List<Task> taskStates = new ArrayList<Task>(); for (TaskId tid : cluster) { taskStates.add(activityPlanMap.get(tid.getActivityId()).getTasks()[tid.getPartition()]); } TaskCluster tc = new TaskCluster(new TaskClusterId(ac.getId(), counter++), ac, taskStates.toArray(new Task[taskStates.size()])); tcSet.add(tc); for (TaskId tid : cluster) { activityPlanMap.get(tid.getActivityId()).getTasks()[tid.getPartition()].setTaskCluster(tc); } } TaskCluster[] taskClusters = tcSet.toArray(new TaskCluster[tcSet.size()]); return taskClusters; } private TaskCluster getTaskCluster(TaskId tid) { JobRun run = scheduler.getJobRun(); ActivityCluster ac = run.getActivityClusterGraph().getActivityMap().get(tid.getActivityId()); ActivityClusterPlan acp = run.getActivityClusterPlanMap().get(ac.getId()); Task[] tasks = acp.getActivityPlanMap().get(tid.getActivityId()).getTasks(); Task task = tasks[tid.getPartition()]; assert task.getTaskId().equals(tid); return task.getTaskCluster(); } private void getDependencyActivityIds(Set<ActivityId> depAnIds, ActivityId anId, ActivityCluster ac) { Set<ActivityId> blockers = ac.getBlocked2BlockerMap().get(anId); if (blockers != null) { depAnIds.addAll(blockers); } } private void assignConnectorPolicy(ActivityCluster ac, Map<ActivityId, ActivityPlan> taskMap) { Map<ConnectorDescriptorId, IConnectorPolicy> cPolicyMap = new HashMap<ConnectorDescriptorId, IConnectorPolicy>(); Set<ActivityId> activities = ac.getActivityMap().keySet(); BitSet targetBitmap = new BitSet(); for (ActivityId a1 : activities) { Task[] ac1TaskStates = taskMap.get(a1).getTasks(); int nProducers = ac1TaskStates.length; List<IConnectorDescriptor> outputConns = ac.getActivityOutputMap().get(a1); if (outputConns != null) { for (IConnectorDescriptor c : outputConns) { ConnectorDescriptorId cdId = c.getConnectorId(); ActivityId a2 = ac.getConsumerActivity(cdId); Task[] ac2TaskStates = taskMap.get(a2).getTasks(); int nConsumers = ac2TaskStates.length; int[] fanouts = new int[nProducers]; if (c.allProducersToAllConsumers()) { for (int i = 0; i < nProducers; ++i) { fanouts[i] = nConsumers; } } else { for (int i = 0; i < nProducers; ++i) { c.indicateTargetPartitions(nProducers, nConsumers, i, targetBitmap); fanouts[i] = targetBitmap.cardinality(); } } IConnectorPolicy cp = assignConnectorPolicy(ac, c, nProducers, nConsumers, fanouts); cPolicyMap.put(cdId, cp); } } } scheduler.getJobRun().getConnectorPolicyMap().putAll(cPolicyMap); } private IConnectorPolicy assignConnectorPolicy(ActivityCluster ac, IConnectorDescriptor c, int nProducers, int nConsumers, int[] fanouts) { IConnectorPolicyAssignmentPolicy cpap = ac.getConnectorPolicyAssignmentPolicy(); if (cpap != null) { return cpap.getConnectorPolicyAssignment(c, nProducers, nConsumers, fanouts); } cpap = ac.getActivityClusterGraph().getConnectorPolicyAssignmentPolicy(); if (cpap != null) { return cpap.getConnectorPolicyAssignment(c, nProducers, nConsumers, fanouts); } return new PipeliningConnectorPolicy(); } private Map<ActivityId, ActivityPartitionDetails> computePartitionCounts(ActivityCluster ac) throws HyracksException { PartitionConstraintSolver solver = scheduler.getSolver(); Set<LValueConstraintExpression> lValues = new HashSet<LValueConstraintExpression>(); for (ActivityId anId : ac.getActivityMap().keySet()) { lValues.add(new PartitionCountExpression(anId.getOperatorDescriptorId())); } solver.solve(lValues); Map<OperatorDescriptorId, Integer> nPartMap = new HashMap<OperatorDescriptorId, Integer>(); for (LValueConstraintExpression lv : lValues) { Object value = solver.getValue(lv); if (value == null) { throw new HyracksException("No value found for " + lv); } if (!(value instanceof Number)) { throw new HyracksException("Unexpected type of value bound to " + lv + ": " + value.getClass() + "(" + value + ")"); } int nParts = ((Number) value).intValue(); if (nParts <= 0) { throw new HyracksException("Unsatisfiable number of partitions for " + lv + ": " + nParts); } nPartMap.put(((PartitionCountExpression) lv).getOperatorDescriptorId(), Integer.valueOf(nParts)); } Map<ActivityId, ActivityPartitionDetails> activityPartsMap = new HashMap<ActivityId, ActivityPartitionDetails>(); for (ActivityId anId : ac.getActivityMap().keySet()) { int nParts = nPartMap.get(anId.getOperatorDescriptorId()); int[] nInputPartitions = null; List<IConnectorDescriptor> inputs = ac.getActivityInputMap().get(anId); if (inputs != null) { nInputPartitions = new int[inputs.size()]; for (int i = 0; i < nInputPartitions.length; ++i) { ConnectorDescriptorId cdId = inputs.get(i).getConnectorId(); ActivityId aid = ac.getProducerActivity(cdId); Integer nPartInt = nPartMap.get(aid.getOperatorDescriptorId()); nInputPartitions[i] = nPartInt; } } int[] nOutputPartitions = null; List<IConnectorDescriptor> outputs = ac.getActivityOutputMap().get(anId); if (outputs != null) { nOutputPartitions = new int[outputs.size()]; for (int i = 0; i < nOutputPartitions.length; ++i) { ConnectorDescriptorId cdId = outputs.get(i).getConnectorId(); ActivityId aid = ac.getConsumerActivity(cdId); Integer nPartInt = nPartMap.get(aid.getOperatorDescriptorId()); nOutputPartitions[i] = nPartInt; } } ActivityPartitionDetails apd = new ActivityPartitionDetails(nParts, nInputPartitions, nOutputPartitions); activityPartsMap.put(anId, apd); } return activityPartsMap; } public Map<? extends PartitionId, ? extends TaskCluster> getPartitionProducingTaskClusterMap() { return partitionProducingTaskClusterMap; } }
{ "content_hash": "65f82e3c5f5094489b580596c95b062d", "timestamp": "", "source": "github", "line_count": 431, "max_line_length": 171, "avg_line_length": 50.15313225058004, "alnum_prop": 0.5920151739452257, "repo_name": "kisskys/incubator-asterixdb-hyracks", "id": "30008e9ca8480573ce46cc3c8c417563acebac8a", "size": "22423", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/scheduler/ActivityClusterPlanner.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2606" }, { "name": "CSS", "bytes": "893" }, { "name": "HTML", "bytes": "8762" }, { "name": "Java", "bytes": "8406768" }, { "name": "JavaScript", "bytes": "24904" }, { "name": "Shell", "bytes": "16545" } ], "symlink_target": "" }
package com.thoughtworks.go.plugin.access.common; import com.thoughtworks.go.plugin.access.common.settings.PluginSettingsConfiguration; import com.thoughtworks.go.plugin.api.config.Configuration; import com.thoughtworks.go.plugin.api.config.Property; import com.thoughtworks.go.plugin.domain.common.*; import com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; public interface PluginInfoBuilder<T extends PluginInfo> { Logger LOGGER = LoggerFactory.getLogger(PluginInfoBuilder.class); T pluginInfoFor(GoPluginDescriptor descriptor); default List<PluginConfiguration> configurations(Configuration config) { ArrayList<PluginConfiguration> pluginConfigurations = new ArrayList<>(); for (Property property : config.list()) { Metadata metadata = new Metadata(property.getOption(Property.REQUIRED), property.getOption(Property.SECURE)); pluginConfigurations.add(new PluginConfiguration(property.getKey(), metadata)); } return pluginConfigurations; } default PluggableInstanceSettings getPluginSettingsAndView(GoPluginDescriptor descriptor, AbstractExtension extension) { PluggableInstanceSettings pluggableInstanceSettings = null; try { String pluginSettingsView = extension.getPluginSettingsView(descriptor.id()); PluginSettingsConfiguration pluginSettingsConfiguration = extension.getPluginSettingsConfiguration(descriptor.id()); if (pluginSettingsConfiguration == null || pluginSettingsView == null) { throw new RuntimeException("The plugin does not provide plugin settings or view."); } pluggableInstanceSettings = new PluggableInstanceSettings(configurations(pluginSettingsConfiguration), new PluginView(pluginSettingsView)); } catch (Exception e) { LOGGER.error("Failed to fetch Plugin Settings metadata for plugin {}. Maybe the plugin does not implement plugin settings and view?", descriptor.id()); LOGGER.debug(null, e); } return pluggableInstanceSettings; } }
{ "content_hash": "07d0589d496c2eb0f55188ecd7dca098", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 163, "avg_line_length": 49.17777777777778, "alnum_prop": 0.7478535924084952, "repo_name": "arvindsv/gocd", "id": "c2fa1fbff7eec9ba6bd5fa8714b1972f79a01540", "size": "2814", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "plugin-infra/go-plugin-access/src/main/java/com/thoughtworks/go/plugin/access/common/PluginInfoBuilder.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "466" }, { "name": "CSS", "bytes": "797200" }, { "name": "FreeMarker", "bytes": "9764" }, { "name": "Groovy", "bytes": "2240189" }, { "name": "HTML", "bytes": "640932" }, { "name": "Java", "bytes": "21023083" }, { "name": "JavaScript", "bytes": "2539209" }, { "name": "NSIS", "bytes": "23526" }, { "name": "PowerShell", "bytes": "691" }, { "name": "Ruby", "bytes": "1888167" }, { "name": "Shell", "bytes": "169149" }, { "name": "TSQL", "bytes": "200114" }, { "name": "TypeScript", "bytes": "3070898" }, { "name": "XSLT", "bytes": "203240" } ], "symlink_target": "" }
A chess program using React and related technologies
{ "content_hash": "5dcbf7851c75e6edecbe118e17cacf22", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 52, "avg_line_length": 53, "alnum_prop": 0.8490566037735849, "repo_name": "afyzendo/re-chess", "id": "0d9fd34e07b3d13878758e63f8086d718e6c9e88", "size": "64", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "216" }, { "name": "JavaScript", "bytes": "258" }, { "name": "TypeScript", "bytes": "327" } ], "symlink_target": "" }
namespace Aardvark.Base { /// <summary> /// Editable edge that can be splitted. /// </summary> public interface IBehaviorSplittableEdge2d : IBehavior { /// <summary> /// Splits edge at position nearest to given split position. /// </summary> void Split(V2d splitPosition); } }
{ "content_hash": "775322c54ac8cbd94fc63dc51dd1ae5e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 68, "avg_line_length": 26.692307692307693, "alnum_prop": 0.5734870317002881, "repo_name": "vrvis/aardvark", "id": "52db18905717716fc85485a5677f28db62e340ee", "size": "349", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Aardvark.Base.Essentials/Editing/IBehaviorSplittableEdge2d.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "323" }, { "name": "C#", "bytes": "28064466" }, { "name": "F#", "bytes": "1970843" }, { "name": "Shell", "bytes": "172" } ], "symlink_target": "" }
**Summary:** Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/animation-delay)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-delay)** **Syntax:** Default value: 0 .animation-delay(<time>, …) **Tips and tricks:** If you omit units after time argument, `animation-delay` is trying to be smart and add properly value. if (time > 10) { time += 'ms'; } else { time += 's'; } **Example:** div { .animation-delay(2, 200); } // Result div { -webkit-animation-delay: 2s, 200ms; -moz-animation-delay: 2s, 200ms; -opera-animation-delay: 2s, 200ms; animation-delay: 2s, 200ms; }
{ "content_hash": "cad9928c5d42fad97e9e4169670942d8", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 170, "avg_line_length": 23.027027027027028, "alnum_prop": 0.6267605633802817, "repo_name": "crisdb/angBoot", "id": "86568f9dc28267752cb9edcc3a2fc6dd6f3e03d8", "size": "913", "binary": false, "copies": "14", "ref": "refs/heads/master", "path": "node_modules/lesshat/mixins/animation-delay/animation-delay.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2981" }, { "name": "HTML", "bytes": "6339" }, { "name": "JavaScript", "bytes": "128862" } ], "symlink_target": "" }
/*---------------------------- LANG: ENUMERABLE ----------------------------*/ fuse.Class.mixins.enumerable = { }; (function(mixin) { var $break = function $break() { }; mixin.contains = function contains(value) { var result = 0; this.each(function(item) { // basic strict match if (item === value && result++) return false; // match String and Number object instances try { if (item.valueOf() === value.valueOf() && result++) return false; } catch (e) { } }); return !!result; }; mixin.each = function each(callback, thisArg) { try { this._each(function(value, index, iterable) { if (callback.call(thisArg, value, index, iterable) === false) throw $break; }); } catch (e) { if (e != $break) throw e; } return this; }; mixin.eachSlice = function eachSlice(size, callback, thisArg) { var index = -size, slices = fuse.Array(), list = this.toArray(); if (size < 1) return list; while ((index += size) < list.length) { slices[slices.length] = list.slice(index, index + size); } return callback ? slices.map(callback, thisArg) : slices; }; mixin.every = function every(callback, thisArg) { callback || (callback = IDENTITY); var result = true; this.each(function(value, index, iterable) { if (!callback.call(thisArg, value, index, iterable)) { return (result = false); } }); return result; }; mixin.filter = function filter(callback, thisArg) { var result = fuse.Array(); callback = callback || function(value) { return value != null; }; this._each(function(value, index, iterable) { if (callback.call(thisArg, value, index, iterable)) result.push(value); }); return result; }; mixin.first = function first(callback, thisArg) { if (callback == null) { var result; this.each(function(value) { result = value; return false; }); return result; } return this.toArray().first(callback, thisArg); }; mixin.inGroupsOf = function inGroupsOf(size, filler) { filler = typeof filler == 'undefined' ? null : filler; return this.eachSlice(size, function(slice) { while (slice.length < size) slice.push(filler); return slice; }); }; mixin.inject = function inject(accumulator, callback, thisArg) { this._each(function(value, index, iterable) { accumulator = callback.call(thisArg, accumulator, value, index, iterable); }); return accumulator; }; mixin.invoke = function invoke(method) { var args = slice.call(arguments, 1), funcProto = Function.prototype; return this.map(function(value) { return funcProto.apply.call(value[method], value, args); }); }; mixin.last = function last(callback, thisArg) { return this.toArray().last(callback, thisArg); }; mixin.map = function map(callback, thisArg) { if (!callback) return this.toArray(); var result = fuse.Array(); if (thisArg) { this._each(function(value, index, iterable) { result.push(callback.call(thisArg, value, index, iterable)); }); } else { this._each(function(value, index, iterable) { result.push(callback(value, index, iterable)); }); } return result; }; mixin.max = function max(callback, thisArg) { callback || (callback = IDENTITY); var comparable, max, result; this._each(function(value, index, iterable) { comparable = callback.call(thisArg, value, index, iterable); if (max == null || comparable > max) { max = comparable; result = value; } }); return result; }; mixin.min = function min(callback, thisArg) { callback || (callback = IDENTITY); var comparable, min, result; this._each(function(value, index, iterable) { comparable = callback.call(thisArg, value, index, iterable); if (min == null || comparable < min) { min = comparable; result = value; } }); return result; }; mixin.partition = function partition(callback, thisArg) { callback || (callback = IDENTITY); var trues = fuse.Array(), falses = fuse.Array(); this._each(function(value, index, iterable) { (callback.call(thisArg, value, index, iterable) ? trues : falses).push(value); }); return fuse.Array(trues, falses); }; mixin.pluck = function pluck(property) { return this.map(function(value) { return value[property]; }); }; mixin.size = function size() { return fuse.Number(this.toArray().length); }; mixin.some = function some(callback, thisArg) { callback || (callback = IDENTITY); var result = false; this.each(function(value, index, iterable) { if (callback.call(thisArg, value, index, iterable)) { return !(result = true); } }); return result; }; mixin.sortBy = function sortBy(callback, thisArg) { return this.map(function(value, index, iterable) { return { 'value': value, 'criteria': callback.call(thisArg, value, index, iterable) }; }).sort(function(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; }).pluck('value'); }; mixin.toArray = function toArray() { var result = fuse.Array(); this._each(function(value, index) { result[index] = value; }); return result; }; mixin.zip = function zip() { var j, length, lists, plucked, callback = IDENTITY, args = slice.call(arguments, 0); // if last argument is a function it is the callback if (typeof args[args.length-1] == 'function') { callback = args.pop(); } lists = prependList(args, this.toArray()); length = lists.length; return this.map(function(value, index, iterable) { j = -1; plucked = fuse.Array(); while (++j < length) { if (j in lists) plucked[j] = lists[j][index]; } return callback(plucked, index, iterable); }); }; // prevent JScript bug with named function expressions var contains = null, each = null, eachSlice = null, every = null, filter = null, first = null, inject = null, inGroupsOf = null, invoke = null, last = null, map = null, max = null, min = null, partition = null, pluck = null, size = null, some = null, sortBy = null, toArray = null, zip = null; })(fuse.Class.mixins.enumerable);
{ "content_hash": "af3027401fa42f47c5b94a9a22e69315", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 82, "avg_line_length": 30.350649350649352, "alnum_prop": 0.5524176294394523, "repo_name": "kensnyder/fusejs", "id": "3f428dbd579c1778c3d119a433d43dc4f3d09111", "size": "7011", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/lang/enumerable.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "758449" }, { "name": "Ruby", "bytes": "7548" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Class: GameMachine::sWriteBehindCac &mdash; Documentation by YARD 0.8.7 </title> <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" /> <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" /> <script type="text/javascript" charset="utf-8"> hasFrames = window.top.frames.main ? true : false; relpath = '../'; framesUrl = "../frames.html#!" + escape(window.location.href); </script> <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script> <script type="text/javascript" charset="utf-8" src="../js/app.js"></script> </head> <body> <div id="header"> <div id="menu"> <a href="../_index.html">Index (s)</a> &raquo; <span class='title'><span class='object_link'><a href="../GameMachine.html" title="GameMachine (module)">GameMachine</a></span></span> &raquo; <span class="title">sWriteBehindCac</span> <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div> </div> <div id="search"> <a class="full_list_link" id="class_list_link" href="../class_list.html"> Class List </a> <a class="full_list_link" id="method_list_link" href="../method_list.html"> Method List </a> <a class="full_list_link" id="file_list_link" href="../file_list.html"> File List </a> </div> <div class="clear"></div> </div> <iframe id="search_frame"></iframe> <div id="content"><h1>Class: GameMachine::sWriteBehindCac </h1> <dl class="box"> <dt class="r1">Inherits:</dt> <dd class="r1"> <span class="inheritName">GameMachine.&lt; Actor&lt; Actor::Ba</span> <ul class="fullTree"> <li>Object</li> <li class="next">GameMachine.&lt; Actor&lt; Actor::Ba</li> <li class="next">GameMachine::sWriteBehindCac</li> </ul> <a href="#" class="inheritanceTree">show all</a> </dd> <dt class="r2 last">Defined in:</dt> <dd class="r2 last">lib/game_machine/write_behind_cache.rb</dd> </dl> <div class="clear"></div> <h2>Constant Summary</h2> <dl class="constants"> <dt id="MAX_WRITES_PER_SECOND-constant" class="">MAX_WRITES_PER_SECOND = </dt> <dd><pre class="code">= Settings.write_behind_cache.max_writes_per_seco</pre></dd> <dt id="WRITE_INTERVAL-constant" class="">WRITE_INTERVAL = </dt> <dd><pre class="code"><span class='const'>VAL</span> <span class='op'>=</span> <span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_write_behind_cache'>write_behind_cache</span><span class='period'>.</span><span class='id identifier rubyid_write_in'>write_in</span></pre></dd> </dl> <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="#r_rea-instance_method" title="#r_rea (instance method)">- (Object) <strong>r_rea</strong> </a> </span> <span class="note title readonly">readonly</span> <span class="summary_desc"><div class='inline'> <p>Returns the value of attribute r_rea.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#ssor+%3Awrite_in-instance_method" title="#ssor :write_in (instance method)">- (Object) <strong>ssor :write_in</strong> </a> </span> <span class="summary_desc"><div class='inline'> <p>Returns the value of attribute ssor :write_in.</p> </div></span> </li> </ul> <h2> Instance Method Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small> </h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="#on_receive-instance_method" title="#on_receive (instance method)">- (Object) <strong>on_receive</strong>(1 ) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#post_init-instance_method" title="#post_init (instance method)">- (Object) <strong>post_init</strong>(*ost_) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> </ul> <div id="instance_attr_details" class="attr_details"> <h2>Instance Attribute Details</h2> <span id=""></span> <div class="method_details first"> <h3 class="signature first" id="r_rea-instance_method"> - (<tt>Object</tt>) <strong>r_rea</strong> <span class="extras">(readonly)</span> </h3><div class="docstring"> <div class="discussion"> <p>Returns the value of attribute r_rea</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 8 9 10</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/game_machine/write_behind_cache.rb', line 8</span> <span class='kw'>def</span> <span class='id identifier rubyid_r_rea'>r_rea</span> <span class='ivar'>@r_rea</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <span id="ssor :write_in=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="ssor :write_in-instance_method"> - (<tt>Object</tt>) <strong>ssor :write_in</strong> </h3><div class="docstring"> <div class="discussion"> <p>Returns the value of attribute ssor :write_in</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 7 8 9</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/game_machine/write_behind_cache.rb', line 7</span> def ssor :write_in @ssor :write_in end</pre> </td> </tr> </table> </div> </div> <div id="instance_method_details" class="method_details_list"> <h2>Instance Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="on_receive-instance_method"> - (<tt>Object</tt>) <strong>on_receive</strong>(1 ) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 27 28 29 30 31 32 33 34 35 36 37 38</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/game_machine/write_behind_cache.rb', line 27</span> per_second == -1 schedule_queue_run schedule_queue_stats end end def on_receive(message) if message.is_a?(String) handle_scheduled_message(message) else set_message(message) if new_message?(me</pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="post_init-instance_method"> - (<tt>Object</tt>) <strong>post_init</strong>(*ost_) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 10 11 12 13 14 15 16 17 18 19 20 21 22 23</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/game_machine/write_behind_cache.rb', line 10</span> ueue def post_init(*args) @write_interval = WRITE_INTERVAL @max_writes_per_second = MAX_WRITES_PER_SECOND @store = DataStore.instance @cache = {} @updates = {} @queue = [] @queue_map = {} @last_write = current_time - (120 * 1000) @scheduler = get_context.system.scheduler @dispatcher = get_context.system.dispatcher unless @write_interval == -1 &amp;&amp; @max_w</pre> </td> </tr> </table> </div> </div> </div> <div id="footer"> Generated on Wed Sep 04 22:55:13 2013 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.8.7 (ruby-1.9.3). </div> </body> </html>
{ "content_hash": "68ca6a379c264bd0485facac3a037285", "timestamp": "", "source": "github", "line_count": 454, "max_line_length": 329, "avg_line_length": 18.788546255506606, "alnum_prop": 0.5735052754982415, "repo_name": "cnsoft/game_machine", "id": "8263cb3099487e3318e43da4526beb2689eee07b", "size": "8530", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "doc/GameMachine/sWriteBehindCac.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
class ProfilesController < BaseController before_filter :get_user_projects def show @user = @current_user end def edit end def update if params[:user][:old_password].empty? @current_user.name = params[:user][:name] @current_user.surname = params[:user][:surname] @current_user.email = params[:user][:email] @current_user.username = params[:user][:username] if @current_user.save flash[:success] = "Succesfully updated profile" redirect_to profile_path(@current_user) and return else @current_user.errors.messages.each {|k, v| flash[:error] = "#{k.to_s.capitalize} #{v[0]}" } redirect_to edit_profile_path(@current_user) and return end end if @current_user.try(:authenticate, params[:user][:old_password]) if @current_user.update(user_params) flash[:success] = "Succesfully updated profile" redirect_to profile_path(@current_user) and return else @current_user.errors.messages.each {|k, v| flash[:error] = "#{k.to_s.capitalize} #{v[0]}" } redirect_to edit_profile_path(@current_user) and return end else flash[:error] = "Invalid old password" redirect_to edit_profile_path(@current_user) and return end end end
{ "content_hash": "2a6d58dadf98039b75a94ad2ca6c858d", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 95, "avg_line_length": 30.82051282051282, "alnum_prop": 0.6871880199667221, "repo_name": "ssuljic/pmtool", "id": "465754e78462fcb35ae1c93c2f13401f13bbc0f6", "size": "1202", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/profiles_controller.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "21562" }, { "name": "JavaScript", "bytes": "73151" }, { "name": "Ruby", "bytes": "49895" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Skin support example</title> <!-- TinyMCE --> <script type="text/javascript" src="./jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> // Default skin tinyMCE.init({ // General options mode : "exact", elements : "elm1", theme : "advanced", plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/content.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); // O2k7 skin tinyMCE.init({ // General options mode : "exact", elements : "elm2", theme : "advanced", skin : "o2k7", plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/content.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); // O2k7 skin (silver) tinyMCE.init({ // General options mode : "exact", elements : "elm3", theme : "advanced", skin : "o2k7", skin_variant : "silver", plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/content.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); // O2k7 skin (silver) tinyMCE.init({ // General options mode : "exact", elements : "elm4", theme : "advanced", skin : "o2k7", skin_variant : "black", plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/content.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <!-- /TinyMCE --> </head> <body> <form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true"> <h3>Skin support example</h3> <p> This page displays the two skins that TinyMCE comes with. You can make your own by creating a CSS file in themes/advanced/skins/<yout skin>/ui.css There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>. </p> <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded --> <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%"> &lt;p&gt; This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;. &lt;/p&gt; &lt;p&gt; Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros. &lt;/p&gt; </textarea> <br /> <textarea id="elm2" name="elm2" rows="15" cols="80" style="width: 80%"> &lt;p&gt; This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;. &lt;/p&gt; &lt;p&gt; Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros. &lt;/p&gt; </textarea> <br /> <textarea id="elm3" name="elm3" rows="15" cols="80" style="width: 80%"> &lt;p&gt; This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;. &lt;/p&gt; &lt;p&gt; Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros. &lt;/p&gt; </textarea> <br /> <textarea id="elm4" name="elm4" rows="15" cols="80" style="width: 80%"> &lt;p&gt; This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;. &lt;/p&gt; &lt;p&gt; Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros. &lt;/p&gt; </textarea> <br /> <input type="submit" name="save" value="Submit" /> <input type="reset" name="reset" value="Reset" /> </form> <script type="text/javascript"> if (document.location.protocol == 'file:') { alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver."); } </script> </body> </html>
{ "content_hash": "86b110719b90dea441dd7b6c9df89e96", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 852, "avg_line_length": 60.18055555555556, "alnum_prop": 0.758519886145088, "repo_name": "johnfelipe/open-genghis", "id": "2090830dd53f3aef6af512f9feba7c80f808cb9a", "size": "12999", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/javascript/tinymce/index.php", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
/** * Roomrtc media server * Export extension with definition */ module.exports = function (kites, definition) { kites.msg = 'hello kites.js!'; }
{ "content_hash": "7cc8f249f4e0e0edc0b8aecab3cfcc66", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 47, "avg_line_length": 21.571428571428573, "alnum_prop": 0.6821192052980133, "repo_name": "roomrtc/mediaserver", "id": "a89d70f75f5295313c721af3526e6c665ac1e7ba", "size": "151", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "main.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "44723" }, { "name": "HTML", "bytes": "10912" }, { "name": "JavaScript", "bytes": "47522" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2013 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <resources> <string name="app_name">ElevationBasic</string> <string name="intro_message"> <![CDATA[ This sample demonstrates two alternative ways to move a view in the z-axis. The first view has a fixed elevation using XML and the second one is raised when the user taps on it, using setTranslationZ(). ]]> </string> </resources>
{ "content_hash": "1fd293a66ca53ecebdb9f7fb3a5bf6ae", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 97, "avg_line_length": 34.483870967741936, "alnum_prop": 0.6819457436856876, "repo_name": "googlearchive/android-ElevationBasic", "id": "a690552c4befbeb45c5b1a1166318eefbf930a00", "size": "1069", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "Application/src/main/res/values/base-strings.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "34317" } ], "symlink_target": "" }
package audio // A Filter takes an input audio and returns some new Audio from them. // This usage implies that Audios can be copied, and that Audios have // available information to be generically modified by a Filter. The // functions for these capabilities are yet fleshed out. It's worth // considering whether a Filter modifies in place. The answer is // probably yes: // a.Filter(fs) would modify a in place // a.Copy().Filter(fs) would return a new audio // Specific audio implementations could not follow this, however. type Filter interface { Apply(Audio) (Audio, error) } // CanLoop offers composable looping type CanLoop struct { Loop bool } // GetLoop allows CanLoop to satisfy the SupportsLoop interface func (cl *CanLoop) GetLoop() *bool { return &cl.Loop }
{ "content_hash": "88ff0af6e5628c2a200ff31fd03012aa", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 70, "avg_line_length": 32.416666666666664, "alnum_prop": 0.7544987146529563, "repo_name": "200sc/klangsynthese", "id": "d41af91e5d13a34c57bb573e7cf54704aa897368", "size": "778", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "audio/filter.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "104628" } ], "symlink_target": "" }
#ifndef RELFILENODE_H #define RELFILENODE_H /* * The physical storage of a relation consists of one or more forks. The * main fork is always created, but in addition to that there can be * additional forks for storing various metadata. ForkNumber is used when * we need to refer to a specific fork in a relation. */ typedef enum ForkNumber { InvalidForkNumber = -1, MAIN_FORKNUM = 0, FSM_FORKNUM, VISIBILITYMAP_FORKNUM /* * NOTE: if you add a new fork, change MAX_FORKNUM below and update the * forkNames array in catalog.c */ } ForkNumber; #define MAX_FORKNUM VISIBILITYMAP_FORKNUM /* * RelFileNode must provide all that we need to know to physically access * a relation. Note, however, that a "physical" relation is comprised of * multiple files on the filesystem, as each fork is stored as a separate * file, and each fork can be divided into multiple segments. See md.c. * * spcNode identifies the tablespace of the relation. It corresponds to * pg_tablespace.oid. * * dbNode identifies the database of the relation. It is zero for * "shared" relations (those common to all databases of a cluster). * Nonzero dbNode values correspond to pg_database.oid. * * relNode identifies the specific relation. relNode corresponds to * pg_class.relfilenode (NOT pg_class.oid, because we need to be able * to assign new physical files to relations in some situations). * Notice that relNode is only unique within a particular database. * * Note: spcNode must be GLOBALTABLESPACE_OID if and only if dbNode is * zero. We support shared relations only in the "global" tablespace. * * Note: in pg_class we allow reltablespace == 0 to denote that the * relation is stored in its database's "default" tablespace (as * identified by pg_database.dattablespace). However this shorthand * is NOT allowed in RelFileNode structs --- the real tablespace ID * must be supplied when setting spcNode. */ typedef struct RelFileNode { Oid spcNode; /* tablespace */ Oid dbNode; /* database */ Oid relNode; /* relation */ } RelFileNode; /* * Note: RelFileNodeEquals compares relNode first since that is most likely * to be different in two unequal RelFileNodes. It is probably redundant * to compare spcNode if the other two fields are found equal, but do it * anyway to be sure. */ #define RelFileNodeEquals(node1, node2) \ ((node1).relNode == (node2).relNode && \ (node1).dbNode == (node2).dbNode && \ (node1).spcNode == (node2).spcNode) #endif /* RELFILENODE_H */
{ "content_hash": "a4e19e1ec2275abd34ec194642c067be", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 75, "avg_line_length": 35.478873239436616, "alnum_prop": 0.7320365224295355, "repo_name": "athiercelin/FPPostgreSQL", "id": "9f77ef9470dc2ccc2b31bfd68831defd9320b468", "size": "2996", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Headers/postgresql84/server/storage/relfilenode.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "3788542" }, { "name": "C++", "bytes": "1354066" }, { "name": "Objective-C", "bytes": "172014" } ], "symlink_target": "" }
docker logs --follow=true --tail=25 redis-service
{ "content_hash": "48c6f8bc3bec42e2c949e8d11e268c4c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 49, "avg_line_length": 50, "alnum_prop": 0.76, "repo_name": "kurron/docker-monitor-redis", "id": "d611b3733b66b68912ccff1ffbef5da17772366b", "size": "63", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "logs.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Shell", "bytes": "679" } ], "symlink_target": "" }
direct_links = r'meta property="og:image" content="(.+?)"' # same_filename (default=False): if True, uses filename specified on remote link. Otherwise, creates own filename with incremental index.
{ "content_hash": "7ee9b0be6688549fac525e44c2e16e3e", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 139, "avg_line_length": 66.66666666666667, "alnum_prop": 0.74, "repo_name": "regosen/gallery_get", "id": "1a448621d4b418cb598fdeecb0d893637a5db8a9", "size": "1032", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gallery_plugins/plugin_imagebam.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "66870" } ], "symlink_target": "" }
/*************************************************************************/ /* syslog_logger.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifdef UNIX_ENABLED #include "syslog_logger.h" #include "core/print_string.h" #include <syslog.h> void SyslogLogger::logv(const char *p_format, va_list p_list, bool p_err) { if (!should_log(p_err)) { return; } vsyslog(p_err ? LOG_ERR : LOG_INFO, p_format, p_list); } void SyslogLogger::print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type) { if (!should_log(true)) { return; } const char *err_type = "**ERROR**"; switch (p_type) { case ERR_ERROR: err_type = "**ERROR**"; break; case ERR_WARNING: err_type = "**WARNING**"; break; case ERR_SCRIPT: err_type = "**SCRIPT ERROR**"; break; case ERR_SHADER: err_type = "**SHADER ERROR**"; break; default: ERR_PRINT("Unknown error type"); break; } const char *err_details; if (p_rationale && *p_rationale) { err_details = p_rationale; } else { err_details = p_code; } syslog(p_type == ERR_WARNING ? LOG_WARNING : LOG_ERR, "%s: %s\n At: %s:%i:%s() - %s", err_type, err_details, p_file, p_line, p_function, p_code); } SyslogLogger::~SyslogLogger() { } #endif
{ "content_hash": "1b482bc26b428fb080acf25152559254", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 151, "avg_line_length": 40.890243902439025, "alnum_prop": 0.5064121682075753, "repo_name": "ex/godot", "id": "b11c87c676047af55b9ac0d2eb51f23c228eca29", "size": "3353", "binary": false, "copies": "1", "ref": "refs/heads/3.5", "path": "drivers/unix/syslog_logger.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "AIDL", "bytes": "1633" }, { "name": "Batchfile", "bytes": "26" }, { "name": "C", "bytes": "1045182" }, { "name": "C#", "bytes": "1061492" }, { "name": "C++", "bytes": "39315087" }, { "name": "CMake", "bytes": "606" }, { "name": "GAP", "bytes": "62" }, { "name": "GDScript", "bytes": "323212" }, { "name": "GLSL", "bytes": "836846" }, { "name": "Java", "bytes": "595274" }, { "name": "JavaScript", "bytes": "194742" }, { "name": "Kotlin", "bytes": "84098" }, { "name": "Makefile", "bytes": "1421" }, { "name": "Objective-C", "bytes": "20550" }, { "name": "Objective-C++", "bytes": "365306" }, { "name": "PowerShell", "bytes": "2713" }, { "name": "Python", "bytes": "475722" }, { "name": "Shell", "bytes": "30899" } ], "symlink_target": "" }
<style> img.incomeimage{position:absolute;bottom:30px;left:0} {%- if layout.monitor.orientation == 0 %} {# landscape mode #} p.incomeheader{font-size:5em;text-align:center;margin-top:200px;} {%- else %} {# portrait mode #} p.incomeheader{font-size:4em;text-align:center;margin-top:400px;} {%- endif %} </style> <p class="incomeheader">Alarmeingang</p> <img class="incomeimage" src="/alarms/inc/bee-do.png"/>
{ "content_hash": "3a3dbf84adc7ef8b1604dd4a9a953f75", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 69, "avg_line_length": 42, "alnum_prop": 0.6952380952380952, "repo_name": "digifant/eMonitor", "id": "78fef1fe917de30e21cca0550fa630c3bfd59cd1", "size": "420", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "emonitor/modules/alarms/templates/widget.income.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "2392" }, { "name": "CSS", "bytes": "73342" }, { "name": "HTML", "bytes": "527895" }, { "name": "JavaScript", "bytes": "282583" }, { "name": "Mako", "bytes": "413" }, { "name": "Python", "bytes": "788596" } ], "symlink_target": "" }
package util import ( "compress/gzip" "fmt" "io" "io/ioutil" "net/http" "time" ) const ( accHeader = "Accept-Encoding" typeHeader = "Content-Type" encHeader = "Content-Encoding" gzipHeader = "gzip" ) // TODO (iantw): Consider creating the Duration objects up front... May just need an all around // refactor if we want to support other types of backoff etc. var sleepIntervals = []int{1, 1, 2, 3, 5, 8, 10} // Sleeper exposes a Sleep func which causes the current goroutine to sleep for the requested // duration. type Sleeper interface { Sleep(d time.Duration) } type sleeper struct { } func (s sleeper) Sleep(d time.Duration) { time.Sleep(d) } // NewSleeper returns a new Sleeper. func NewSleeper() Sleeper { return sleeper{} } // HTTPDoer is an interface for something that can 'Do' an http.Request and return an http.Response // and error. type HTTPDoer interface { Do(req *http.Request) (resp *http.Response, err error) } // HTTPClient is a higher level HTTP client which takes a URL and returns the response body as a // string, along with the resulting status code and any errors. type HTTPClient interface { Get(url string) (body string, code int, err error) } type httpClient struct { retries uint client HTTPDoer sleep Sleeper } // DefaultHTTPClient returns a default http client. func DefaultHTTPClient() HTTPClient { return NewHTTPClient(3, http.DefaultClient, NewSleeper()) } // NewHTTPClient returns a new HTTPClient. func NewHTTPClient(retries uint, c HTTPDoer, s Sleeper) HTTPClient { ret := httpClient{} ret.client = c ret.sleep = s ret.retries = retries return ret } func readBody(b io.ReadCloser, ctype string, encoding string) (body string, err error) { defer b.Close() var r io.Reader if encoding == gzipHeader { gr, err := gzip.NewReader(b) if err != nil { return "", err } r = gr defer gr.Close() } else if encoding == "" { r = b } else { return "", fmt.Errorf("Unknown %s: %s", encHeader, encoding) } // TODO(iantw): If we find a need, allow character set conversions... // Unlikely to be an issue for now. // if ctype != "" { // r, err = charset.NewReader(r, ctype) // // if err != nil { // return "", err // } // } bytes, err := ioutil.ReadAll(r) return string(bytes), err } // Get does an HTTP GET on the receiver. func (client httpClient) Get(url string) (body string, code int, err error) { retryCount := client.retries numRetries := uint(0) shouldRetry := true for shouldRetry { body = "" code = 0 err = nil var req *http.Request req, err = http.NewRequest("GET", url, nil) if err != nil { return "", 0, err } req.Header.Add(accHeader, gzipHeader) var r *http.Response r, err = client.client.Do(req) if err == nil { body, err = readBody(r.Body, r.Header.Get(typeHeader), r.Header.Get(encHeader)) if err == nil { code = r.StatusCode } } if code != 200 { if numRetries < retryCount { numRetries = numRetries + 1 sleepIndex := int(numRetries) if numRetries >= uint(len(sleepIntervals)) { sleepIndex = len(sleepIntervals) - 1 } d, _ := time.ParseDuration(string(sleepIntervals[sleepIndex]) + "s") client.sleep.Sleep(d) } else { shouldRetry = false } } else { shouldRetry = false } } return }
{ "content_hash": "9a0ae20a53fe359bcf39dbebbff36ebf", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 99, "avg_line_length": 22.33108108108108, "alnum_prop": 0.6692889561270802, "repo_name": "sparkprime/helm", "id": "43b3ff4dedeb9520a0373acde67467f1d37065e5", "size": "3894", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "pkg/util/httpclient.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "443319" }, { "name": "HTML", "bytes": "11038" }, { "name": "Makefile", "bytes": "9330" }, { "name": "Python", "bytes": "85426" }, { "name": "Ruby", "bytes": "1755" }, { "name": "Shell", "bytes": "20475" } ], "symlink_target": "" }
package containerdisk import ( "fmt" "os" "path" "path/filepath" "strconv" "kubevirt.io/client-go/log" kubev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" ephemeraldisk "kubevirt.io/kubevirt/pkg/ephemeral-disk" v1 "kubevirt.io/client-go/api/v1" diskutils "kubevirt.io/kubevirt/pkg/ephemeral-disk-utils" "kubevirt.io/kubevirt/pkg/util" ) var containerDiskOwner = "qemu" var podsBaseDir = util.KubeletPodsDir var mountBaseDir = filepath.Join(util.VirtShareDir, "/container-disks") type SocketPathGetter func(vmi *v1.VirtualMachineInstance, volumeIndex int) (string, error) type KernelBootSocketPathGetter func(vmi *v1.VirtualMachineInstance) (string, error) const KernelBootName = "kernel-boot" const KernelBootVolumeName = KernelBootName + "-volume" const ephemeralStorageOverheadSize = "50M" func GetLegacyVolumeMountDirOnHost(vmi *v1.VirtualMachineInstance) string { return filepath.Join(mountBaseDir, string(vmi.UID)) } func GetVolumeMountDirOnGuest(vmi *v1.VirtualMachineInstance) string { return filepath.Join(mountBaseDir, string(vmi.UID)) } func GetVolumeMountDirOnHost(vmi *v1.VirtualMachineInstance) (string, bool, error) { basepath := "" foundEntries := 0 foundBasepath := "" for podUID := range vmi.Status.ActivePods { basepath = fmt.Sprintf("%s/%s/volumes/kubernetes.io~empty-dir/container-disks", podsBaseDir, string(podUID)) exists, err := diskutils.FileExists(basepath) if err != nil { return "", false, err } else if exists { foundEntries++ foundBasepath = basepath } } if foundEntries == 1 { return foundBasepath, true, nil } else if foundEntries > 1 { // Don't mount until outdated pod environments are removed // otherwise we might stomp on a previous cleanup return "", false, fmt.Errorf("Found multiple pods active for vmi %s/%s. Waiting on outdated pod directories to be removed", vmi.Namespace, vmi.Name) } return "", false, nil } func GetDiskTargetDirFromHostView(vmi *v1.VirtualMachineInstance) (string, error) { basepath, found, err := GetVolumeMountDirOnHost(vmi) if err != nil { return "", err } else if !found { return "", fmt.Errorf("container disk volume for vmi not found") } return basepath, nil } func GetDiskTargetPathFromHostView(vmi *v1.VirtualMachineInstance, volumeIndex int) (string, error) { basepath, err := GetDiskTargetDirFromHostView(vmi) if err != nil { return "", err } return fmt.Sprintf("%s/disk_%d.img", basepath, volumeIndex), nil } func GetDiskTargetPathFromLauncherView(volumeIndex int) string { return filepath.Join(mountBaseDir, fmt.Sprintf("disk_%d.img", volumeIndex)) } func GetKernelBootArtifactPathFromLauncherView(artifact string) string { artifactBase := filepath.Base(artifact) return filepath.Join(mountBaseDir, KernelBootName, artifactBase) } func SetLocalDirectory(dir string) error { mountBaseDir = dir return os.MkdirAll(dir, 0750) } func SetKubeletPodsDirectory(dir string) { podsBaseDir = dir } // used for testing - we don't want to MkdirAll on a production host mount func setPodsDirectory(dir string) error { podsBaseDir = dir return os.MkdirAll(dir, 0750) } // The unit test suite uses this function func setLocalDataOwner(user string) { containerDiskOwner = user } // GetDiskTargetPartFromLauncherView returns (path to disk image, image type, and error) func GetDiskTargetPartFromLauncherView(volumeIndex int) (string, error) { path := GetDiskTargetPathFromLauncherView(volumeIndex) exists, err := diskutils.FileExists(path) if err != nil { return "", err } else if exists { return path, nil } return "", fmt.Errorf("no supported file disk found for volume with index %d", volumeIndex) } // NewSocketPathGetter get the socket pat of a containerDisk. For testing a baseDir // can be provided which can for instance point to /tmp. func NewSocketPathGetter(baseDir string) SocketPathGetter { return func(vmi *v1.VirtualMachineInstance, volumeIndex int) (string, error) { for podUID := range vmi.Status.ActivePods { basePath := getContainerDiskSocketBasePath(baseDir, string(podUID)) socketPath := filepath.Join(basePath, fmt.Sprintf("disk_%d.sock", volumeIndex)) exists, _ := diskutils.FileExists(socketPath) if exists { return socketPath, nil } } return "", fmt.Errorf("container disk socket path not found for vmi \"%s\"", vmi.Name) } } // NewKernelBootSocketPathGetter get the socket pat of the kernel-boot containerDisk. For testing a baseDir // can be provided which can for instance point to /tmp. func NewKernelBootSocketPathGetter(baseDir string) KernelBootSocketPathGetter { return func(vmi *v1.VirtualMachineInstance) (string, error) { for podUID := range vmi.Status.ActivePods { basePath := getContainerDiskSocketBasePath(baseDir, string(podUID)) socketPath := filepath.Join(basePath, KernelBootName+".sock") exists, _ := diskutils.FileExists(socketPath) if exists { return socketPath, nil } } return "", fmt.Errorf("kernel boot socket path not found for vmi \"%s\"", vmi.Name) } } func GetImage(root string, imagePath string) (string, error) { fallbackPath := filepath.Join(root, DiskSourceFallbackPath) if imagePath != "" { imagePath = filepath.Join(root, imagePath) if _, err := os.Stat(imagePath); err != nil { if os.IsNotExist(err) { return "", fmt.Errorf("No image on path %s", imagePath) } else { return "", fmt.Errorf("Failed to check if an image exists at %s", imagePath) } } } else { files, err := os.ReadDir(fallbackPath) if err != nil { return "", fmt.Errorf("Failed to check %s for disks: %v", fallbackPath, err) } if len(files) > 1 { return "", fmt.Errorf("More than one file found in folder %s, only one disk is allowed", DiskSourceFallbackPath) } imagePath = filepath.Join(fallbackPath, files[0].Name()) } return imagePath, nil } func GenerateInitContainers(vmi *v1.VirtualMachineInstance, podVolumeName string, binVolumeName string) []kubev1.Container { return generateContainersHelper(vmi, podVolumeName, binVolumeName, true) } func GenerateContainers(vmi *v1.VirtualMachineInstance, podVolumeName string, binVolumeName string) []kubev1.Container { return generateContainersHelper(vmi, podVolumeName, binVolumeName, false) } func GenerateKernelBootContainer(vmi *v1.VirtualMachineInstance, podVolumeName string, binVolumeName string) *kubev1.Container { if !util.HasKernelBootContainerImage(vmi) { return nil } kernelBootContainer := vmi.Spec.Domain.Firmware.KernelBoot.Container kernelBootVolume := v1.Volume{ Name: KernelBootVolumeName, VolumeSource: v1.VolumeSource{ ContainerDisk: &v1.ContainerDiskSource{ Image: kernelBootContainer.Image, ImagePullSecret: kernelBootContainer.ImagePullSecret, Path: "/", ImagePullPolicy: kernelBootContainer.ImagePullPolicy, }, }, } const fakeVolumeIdx = 0 // volume index makes no difference for kernel-boot container return generateContainerFromVolume(vmi, podVolumeName, binVolumeName, false, true, &kernelBootVolume, fakeVolumeIdx) } // The controller uses this function to generate the container // specs for hosting the container registry disks. func generateContainersHelper(vmi *v1.VirtualMachineInstance, podVolumeName string, binVolumeName string, isInit bool) []kubev1.Container { var containers []kubev1.Container // Make VirtualMachineInstance Image Wrapper Containers for index, volume := range vmi.Spec.Volumes { if volume.Name == KernelBootVolumeName { continue } if container := generateContainerFromVolume(vmi, podVolumeName, binVolumeName, isInit, false, &volume, index); container != nil { containers = append(containers, *container) } } return containers } func generateContainerFromVolume(vmi *v1.VirtualMachineInstance, podVolumeName, binVolumeName string, isInit, isKernelBoot bool, volume *v1.Volume, volumeIdx int) *kubev1.Container { if volume.ContainerDisk == nil { return nil } volumeMountDir := GetVolumeMountDirOnGuest(vmi) diskContainerName := fmt.Sprintf("volume%s", volume.Name) diskContainerImage := volume.ContainerDisk.Image resources := kubev1.ResourceRequirements{} resources.Limits = make(kubev1.ResourceList) resources.Requests = make(kubev1.ResourceList) resources.Limits[kubev1.ResourceMemory] = resource.MustParse("40M") resources.Requests[kubev1.ResourceCPU] = resource.MustParse("10m") resources.Requests[kubev1.ResourceEphemeralStorage] = resource.MustParse(ephemeralStorageOverheadSize) var mountedDiskName string if isKernelBoot { mountedDiskName = KernelBootName } else { mountedDiskName = "disk_" + strconv.Itoa(volumeIdx) } if vmi.IsCPUDedicated() || vmi.WantsToHaveQOSGuaranteed() { resources.Limits[kubev1.ResourceCPU] = resource.MustParse("10m") resources.Requests[kubev1.ResourceMemory] = resource.MustParse("40M") } else { resources.Limits[kubev1.ResourceCPU] = resource.MustParse("100m") resources.Requests[kubev1.ResourceMemory] = resource.MustParse("1M") } var args []string var name string if isInit { name = diskContainerName + "-init" args = []string{"--no-op"} } else { name = diskContainerName copyPathArg := path.Join(volumeMountDir, mountedDiskName) args = []string{"--copy-path", copyPathArg} log.Log.Object(vmi).Infof("arguments for container-disk \"%s\": --copy-path %s", name, copyPathArg) } container := &kubev1.Container{ Name: name, Image: diskContainerImage, ImagePullPolicy: volume.ContainerDisk.ImagePullPolicy, Command: []string{"/usr/bin/container-disk"}, Args: args, VolumeMounts: []kubev1.VolumeMount{ { Name: podVolumeName, MountPath: volumeMountDir, }, { Name: binVolumeName, MountPath: "/usr/bin", }, }, Resources: resources, } return container } func CreateEphemeralImages(vmi *v1.VirtualMachineInstance, diskCreator ephemeraldisk.EphemeralDiskCreatorInterface) error { // The domain is setup to use the COW image instead of the base image. What we have // to do here is only create the image where the domain expects it (GetDiskTargetPartFromLauncherView) // for each disk that requires it. for i, volume := range vmi.Spec.Volumes { if volume.VolumeSource.ContainerDisk != nil { if backingFile, err := GetDiskTargetPartFromLauncherView(i); err != nil { return err } else if err := diskCreator.CreateBackedImageForVolume(volume, backingFile); err != nil { return err } } } return nil } func getContainerDiskSocketBasePath(baseDir, podUID string) string { return fmt.Sprintf("%s/pods/%s/volumes/kubernetes.io~empty-dir/container-disks", baseDir, podUID) }
{ "content_hash": "dd015a1d4cd31a4391ecd6dc99965d22", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 182, "avg_line_length": 33.271028037383175, "alnum_prop": 0.7436329588014982, "repo_name": "stu-gott/kubevirt", "id": "bd801a7e8585e6003538cb420776beca64113caf", "size": "11327", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "pkg/container-disk/container-disk.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "5369" }, { "name": "Dockerfile", "bytes": "5039" }, { "name": "Go", "bytes": "7601719" }, { "name": "Makefile", "bytes": "6787" }, { "name": "Python", "bytes": "2743" }, { "name": "Shell", "bytes": "198706" }, { "name": "Starlark", "bytes": "851325" } ], "symlink_target": "" }
@implementation ACDetailsForm //because we want to rearrange how this form //is displayed, we've implemented the fields array //which lets us dictate exactly which fields appear //and in what order they appear - (NSArray *)fields { return @[ //we want to add a group header for the field set of fields //we do that by adding the header key to the first field in the group @{FXFormFieldKey: @"type", FXFormFieldOptions: @[@"Нарушение ПДД", @"ДТП", @"Действия ГАИ"], FXFormFieldTitle: @"Происшествие"}, @{FXFormFieldKey: @"carPlateNumber", FXFormFieldTitle: @"Номер авто", @"textField.autocapitalizationType": @(UITextAutocapitalizationTypeAllCharacters) }, @{FXFormFieldKey: @"about", FXFormFieldTitle: @"Подробности", FXFormFieldType: FXFormFieldTypeLongText}, //we want to add a section header here, so we use another config dictionary @{FXFormFieldKey: @"termsAndConditions", FXFormFieldTitle: @"Правила использования", FXFormFieldHeader: @"Подтверждение"}, //the automatically generated title (Agreed To Terms) and cell (FXFormSwitchCell) //don't really work for this field, so we'll override them both (a type of //FXFormFieldTypeOption will use an checkmark instead of a switch by default) @{FXFormFieldKey: @"agreedToTerms", FXFormFieldTitle: @"Я согласен с правилами", FXFormFieldType: FXFormFieldTypeOption}, //this field doesn't correspond to any property of the form //it's just an action button. the action will be called on first //object in the responder chain that implements the submitForm //method, which in this case would be the AppDelegate @{FXFormFieldTitle: @"Отправить", FXFormFieldHeader: @"", FXFormFieldAction: @"submitDetailsForm:"}, ]; } @end
{ "content_hash": "02f3409631434aa820f7b7a9431d46fe", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 113, "avg_line_length": 45.680851063829785, "alnum_prop": 0.6022356776897997, "repo_name": "latemic/autocultura.ios", "id": "4139f04b7c4b22d3fb2dea3101f0ba82125f18d8", "size": "2449", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "YouTube Direct Lite for iOS/ACDetailsForm.m", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Objective-C", "bytes": "59835" } ], "symlink_target": "" }
<!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <project> <modelVersion>4.0.0</modelVersion> <groupId>groupId</groupId> <artifactId>artifactId</artifactId> <version>1.0</version> <packaging>pom</packaging> <scm> <connection>scm:git:ssh://git@bitbucket.org/tmp/basic-pom.git</connection> <developerConnection>scm:git:ssh://git@bitbucket.org/tmp/basic-pom.git</developerConnection> <url>https://bitbucket.org/tmp/basic-pom</url> </scm> <modules> <module>subproject1</module> </modules> </project>
{ "content_hash": "691aff794525b93c0bf0ee7dde309e0d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 98, "avg_line_length": 34.18181818181818, "alnum_prop": 0.7092198581560284, "repo_name": "CenturylinkTechnology/jgit-flow", "id": "115139bf02701c59a5d10f334f227d1857f90eb1", "size": "1128", "binary": false, "copies": "8", "ref": "refs/heads/develop", "path": "jgitflow-maven-plugin/src/test/resources/projects/rewrite-for-hotfix/pom-with-parent/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1070" }, { "name": "Groovy", "bytes": "17010" }, { "name": "Java", "bytes": "824843" } ], "symlink_target": "" }
import turtle def draw_square(): window = turtle.Screen() window.bgcolor('red') joe = turtle.Turtle() joe.shape('turtle') joe.color('green') joe.speed(1) # on a scale of 1 to 10, where 10 is fastest for i in range(0,4): joe.forward(100) joe.right(90) window.exitonclick() draw_square()
{ "content_hash": "97cd87cc45765fea54c1a2cb56e8748a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 61, "avg_line_length": 18.77777777777778, "alnum_prop": 0.6035502958579881, "repo_name": "tai271828/courses", "id": "c547dc9b49e43f325d6faf9ec0ddb3b0bb68dec8", "size": "338", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "software-development/udacity/ud036-python-foundations/code/lesson2/square.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2692" }, { "name": "HTML", "bytes": "9304" }, { "name": "JavaScript", "bytes": "312081" }, { "name": "Python", "bytes": "151460" } ], "symlink_target": "" }
#ifndef DIMENSIONIDENTIFIER_H_ #define DIMENSIONIDENTIFIER_H_ #include <QString> #include <QList> #include <QHash> #include <QDir> class QMenu; class QAction; class QActionGroup; class JSONArray; class DimensionInfo { public: DimensionInfo(QString path, int scale, QString name) : path(path), scale(scale), name(name) {} QString path; int scale; QString name; }; class DimensionDef; class DimensionIdentifier : public QObject { Q_OBJECT public: DimensionIdentifier(); ~DimensionIdentifier(); int addDefinitions(JSONArray *, int pack = -1); void enableDefinitions(int id); void disableDefinitions(int id); void getDimensions(QDir path, QMenu *menu, QObject *parent); void removeDimensions(QMenu *menu); signals: void dimensionChanged(const DimensionInfo &dim); private slots: void viewDimension(); private: void addDimension(QDir path, QString dir, QString name, int scale, QObject *parent); QList<QAction *> items; QList<DimensionInfo> dimensions; QList<DimensionDef*> definitions; QList<QList<DimensionDef*> > packs; QActionGroup *group; QHash<QString, bool> foundDimensions; }; #endif // DIMENSIONIDENTIFIER_H_
{ "content_hash": "76d7e26cc7c58a52ddfe3d05df557972", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 68, "avg_line_length": 21.375, "alnum_prop": 0.7251461988304093, "repo_name": "Metibor/minutor", "id": "2df49e40696c180e8a67b67c9f2e4c1b404ec68d", "size": "1234", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dimensionidentifier.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "295" }, { "name": "C", "bytes": "470320" }, { "name": "C++", "bytes": "199171" }, { "name": "CSS", "bytes": "3155" }, { "name": "HTML", "bytes": "311" }, { "name": "JavaScript", "bytes": "62285" }, { "name": "Makefile", "bytes": "378" }, { "name": "QMake", "bytes": "1902" }, { "name": "Shell", "bytes": "472" } ], "symlink_target": "" }
package org.apache.camel.component.zookeeper.springboot.cloud; import java.util.Map; import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties(prefix = "camel.component.zookeeper.service-registry") public class ZooKeeperServiceRegistryConfiguration extends org.apache.camel.component.zookeeper.cloud.ZooKeeperServiceRegistryConfiguration { /** * Sets if the zookeeper service registry should be enabled or not, default is false. */ private boolean enabled; /** * Service Registry ID */ private String id; /** * Custom service attributes. */ private Map<String, Object> attributes; /** * Service lookup order/priority. */ private Integer order; public boolean isEnabled() { return enabled; } public void setEnabled(boolean enabled) { this.enabled = enabled; } public String getId() { return id; } public void setId(String id) { this.id = id; } public Map<String, Object> getAttributes() { return attributes; } public void setAttributes(Map<String, Object> attributes) { this.attributes = attributes; } public Integer getOrder() { return order; } public void setOrder(Integer order) { this.order = order; } }
{ "content_hash": "5026c9be7eea880bf17997c46d522698", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 141, "avg_line_length": 22.442622950819672, "alnum_prop": 0.6544923301680059, "repo_name": "Fabryprog/camel", "id": "67b543f3150996845b830b4d749ffde17f435050", "size": "2171", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "platforms/spring-boot/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryConfiguration.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Apex", "bytes": "6521" }, { "name": "Batchfile", "bytes": "2353" }, { "name": "CSS", "bytes": "17204" }, { "name": "Elm", "bytes": "10852" }, { "name": "FreeMarker", "bytes": "8015" }, { "name": "Groovy", "bytes": "14479" }, { "name": "HTML", "bytes": "909437" }, { "name": "Java", "bytes": "82182194" }, { "name": "JavaScript", "bytes": "102432" }, { "name": "Makefile", "bytes": "513" }, { "name": "Shell", "bytes": "17240" }, { "name": "TSQL", "bytes": "28835" }, { "name": "Tcl", "bytes": "4974" }, { "name": "Thrift", "bytes": "6979" }, { "name": "XQuery", "bytes": "546" }, { "name": "XSLT", "bytes": "271473" } ], "symlink_target": "" }
""" Created on Sun May 28 14:51:28 2017 @author: azkei Using lxml library to read XML data """ # We want to take the data structure inside the XML file and convert it into # a DataFrame. # For that, we need objectify. from lxml import objectify # Now we can do the parser of the XML file using parse() xml = objectify.parse('books.xml') xml # Define a root structure root = xml.getroot() # Access different nodes in the root structure root.Book.Author # Access various elements corresponding to a node root.Book.getchildren() # Get the various tags in the structure [child.tag for child in root.Book.getchildren()] # Get the corresponding value [child.text for child in root.Book.getchildren()] # Converting the Tree Structure into a DataFrame def etree2df(root): column_names=[] for i in range(0,len(root.getchildren()[0].getchildren())): column_names.append(root.getchildren()[0].getchildren()[i].tag) xmlframe = pd.DataFrame(columns=column_names) for j in range(0,len(root.getchildren())): obj = root.getchildren()[j].getchildren() texts = [] for k in range(0,len(column_names)): texts.append(obj[k].text) row = dict(zip(column_names,texts)) row_s = pd.Series(row) row_s.name = j xmlframe = xmlframe.append(row_s) return xmlframe # Running the function etree2df(root)
{ "content_hash": "b6087e4ca55112694d2b608d1157b0ef", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 76, "avg_line_length": 32.57142857142857, "alnum_prop": 0.6944444444444444, "repo_name": "jjsalomon/python-analytics", "id": "b3307ae810705dd8b51397264612c60b8c7642cf", "size": "1392", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pandas2 - Reading & Writing Data/pandas3 - Reading Data from XML.py", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "835" }, { "name": "Python", "bytes": "75839" } ], "symlink_target": "" }
search_result['3053']=["topic_0000000000000758.html","QuestionVideoModel.QuestionId Property",""];
{ "content_hash": "dd478384de9ab36787336a690cf24236", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 98, "avg_line_length": 98, "alnum_prop": 0.7857142857142857, "repo_name": "asiboro/asiboro.github.io", "id": "2ff77a2ce3d4872ccc2d9878203869ab1f5490bb", "size": "98", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vsdoc/search--/s_3053.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "310000" }, { "name": "HTML", "bytes": "135195" }, { "name": "JavaScript", "bytes": "621923" } ], "symlink_target": "" }
<?php $I = new FluxCtrl\App\Test\Api\ApiTester($scenario); $I->wantTo('viewing an unread item gets it marked as read'); call_user_func(new \FluxCtrl\App\Test\Factory\FeedFactory(), 1); $item = call_user_func(new \FluxCtrl\App\Test\Factory\ItemFactory(), function ($entity) { $entity->is_read = false; }, 1); $I->sendGET('/items/' . $item->id . '.json'); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); $I->seeResponseContainsJson(['success' => true]); $I->seeResponseJsonMatchesXpath('//data//title'); $I->seeRecord('Items', ['id' => $item->id, 'is_read' => true]);
{ "content_hash": "22ea44d1101beecb1a84f4a2a8a10ffa", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 122, "avg_line_length": 44.07692307692308, "alnum_prop": 0.6736474694589878, "repo_name": "FluxCTRL/FluxCTRL", "id": "2fe19c18db0f1e234f0724cee55c79fe6baa335c", "size": "573", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/Api/Items/ViewUnreadSuccessCept.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "270" }, { "name": "Batchfile", "bytes": "925" }, { "name": "PHP", "bytes": "76845" }, { "name": "PLpgSQL", "bytes": "979" }, { "name": "Shell", "bytes": "1350" } ], "symlink_target": "" }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* 15.10.4.1 new RegExp(pattern, flags) If F contains any character other than "g", "i", or" m", or if it contains the same one more than once, then throw a SyntaxError exception. */ //----------------------------------------------------------------------------- var BUGNUMBER = 476940; var summary = 'Section 15.10.4.1 - RegExp with invalid flags'; var actual = ''; var expect = ''; //----------------------------------------------------------------------------- test(); //----------------------------------------------------------------------------- function test() { enterFunc ('test'); printBugNumber(BUGNUMBER); printStatus (summary); var invalidflags = ['ii', 'gg', 'mm', 'a']; for (var i = 0; i < invalidflags.length; i++) { var flag = invalidflags[i]; expect = 'SyntaxError: invalid regular expression flag ' + flag.charAt(0); actual = ''; try { new RegExp('bar', flag); } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': new RegExp("bar", "' + flag + '")'); actual = ''; try { eval("/bar/" + flag); } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': /bar/' + flag + ')'); } exitFunc ('test'); }
{ "content_hash": "ec1344bf4720f26eae7919d1577845fe", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 79, "avg_line_length": 25.64516129032258, "alnum_prop": 0.48427672955974843, "repo_name": "sergecodd/FireFox-OS", "id": "5f0453dc2ca72a062df8d8f9687fef47de854ed1", "size": "1590", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "B2G/gecko/js/src/tests/ecma_3/RegExp/15.10.4.1-6.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ada", "bytes": "443" }, { "name": "ApacheConf", "bytes": "85" }, { "name": "Assembly", "bytes": "5123438" }, { "name": "Awk", "bytes": "46481" }, { "name": "Batchfile", "bytes": "56250" }, { "name": "C", "bytes": "101720951" }, { "name": "C#", "bytes": "38531" }, { "name": "C++", "bytes": "148896543" }, { "name": "CMake", "bytes": "23541" }, { "name": "CSS", "bytes": "2758664" }, { "name": "DIGITAL Command Language", "bytes": "56757" }, { "name": "Emacs Lisp", "bytes": "12694" }, { "name": "Erlang", "bytes": "889" }, { "name": "FLUX", "bytes": "34449" }, { "name": "GLSL", "bytes": "26344" }, { "name": "Gnuplot", "bytes": "710" }, { "name": "Groff", "bytes": "447012" }, { "name": "HTML", "bytes": "43343468" }, { "name": "IDL", "bytes": "1455122" }, { "name": "Java", "bytes": "43261012" }, { "name": "JavaScript", "bytes": "46646658" }, { "name": "Lex", "bytes": "38358" }, { "name": "Logos", "bytes": "21054" }, { "name": "Makefile", "bytes": "2733844" }, { "name": "Matlab", "bytes": "67316" }, { "name": "Max", "bytes": "3698" }, { "name": "NSIS", "bytes": "421625" }, { "name": "Objective-C", "bytes": "877657" }, { "name": "Objective-C++", "bytes": "737713" }, { "name": "PHP", "bytes": "17415" }, { "name": "Pascal", "bytes": "6780" }, { "name": "Perl", "bytes": "1153180" }, { "name": "Perl6", "bytes": "1255" }, { "name": "PostScript", "bytes": "1139" }, { "name": "PowerShell", "bytes": "8252" }, { "name": "Protocol Buffer", "bytes": "26553" }, { "name": "Python", "bytes": "8453201" }, { "name": "Ragel in Ruby Host", "bytes": "3481" }, { "name": "Ruby", "bytes": "5116" }, { "name": "Scilab", "bytes": "7" }, { "name": "Shell", "bytes": "3383832" }, { "name": "SourcePawn", "bytes": "23661" }, { "name": "TeX", "bytes": "879606" }, { "name": "WebIDL", "bytes": "1902" }, { "name": "XSLT", "bytes": "13134" }, { "name": "Yacc", "bytes": "112744" } ], "symlink_target": "" }
Joomla is a free and open-source content management system (CMS) for publishing web content. It is built on a model–view–controller web application framework that can be used independently of the CMS. Joomla is written in PHP, uses object-oriented programming (OOP) techniques and software design patterns, stores data in a MySQL, MS SQL, or PostgreSQL database, and includes features such as page caching, RSS feeds, printable versions of pages, news flashes, blogs, search, and support for language internationalization. > [wikipedia.org/wiki/Joomla](https://en.wikipedia.org/wiki/Joomla) %%LOGO%% # How to use this image ```console $ docker run --name some-%%REPO%% --link some-mysql:mysql -d %%IMAGE%% ``` The following environment variables are also honored for configuring your Joomla instance: - `-e JOOMLA_DB_HOST=...` (defaults to the IP and port of the linked `mysql` container) - `-e JOOMLA_DB_USER=...` (defaults to "root") - `-e JOOMLA_DB_PASSWORD=...` (defaults to the value of the `MYSQL_ROOT_PASSWORD` environment variable from the linked `mysql` container) - `-e JOOMLA_DB_NAME=...` (defaults to "joomla") If the `JOOMLA_DB_NAME` specified does not already exist on the given MySQL server, it will be created automatically upon startup of the `%%REPO%%` container, provided that the `JOOMLA_DB_USER` specified has the necessary permissions to create it. If you'd like to be able to access the instance from the host without the container's IP, standard port mappings can be used: ```console $ docker run --name some-%%REPO%% --link some-mysql:mysql -p 8080:80 -d %%IMAGE%% ``` Then, access it via `http://localhost:8080` or `http://host-ip:8080` in a browser. If you'd like to use an external database instead of a linked `mysql` container, specify the hostname and port with `JOOMLA_DB_HOST` along with the password in `JOOMLA_DB_PASSWORD` and the username in `JOOMLA_DB_USER` (if it is something other than `root`): ```console $ docker run --name some-%%REPO%% -e JOOMLA_DB_HOST=10.1.2.3:3306 \ -e JOOMLA_DB_USER=... -e JOOMLA_DB_PASSWORD=... -d %%REPO%% ``` ## %%STACK%% Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker-compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate). ## Adding additional libraries / extensions This image does not provide any additional PHP extensions or other libraries, even if they are required by popular plugins. There are an infinite number of possible plugins, and they potentially require any extension PHP supports. Including every PHP extension that exists would dramatically increase the image size. If you need additional PHP extensions, you'll need to create your own image `FROM` this one. The [documentation of the `php` image](https://github.com/docker-library/docs/blob/master/php/README.md#how-to-install-more-php-extensions) explains how to compile additional extensions. Additionally, the [`%%REPO%%` Dockerfile](https://github.com/joomla/docker-joomla/blob/966275ada2148e343a68c8c03870f11cc7f5b89c/apache/Dockerfile#L7-L11) has an example of doing this. The following Docker Hub features can help with the task of keeping your dependent images up-to-date: - [Automated Builds](https://docs.docker.com/docker-hub/builds/) let Docker Hub automatically build your Dockerfile each time you push changes to it. - [Repository Links](https://docs.docker.com/docker-hub/builds/#repository-links) can ensure that your image is also rebuilt any time `%%REPO%%` is updated.
{ "content_hash": "6f2fc36a15db2dd3e4588545c13fd700", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 522, "avg_line_length": 71.5, "alnum_prop": 0.753006993006993, "repo_name": "docker-flink/docs", "id": "ab825e406a62cf71a554602e1c7e2ed818c72b78", "size": "3598", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "joomla/content.md", "mode": "33188", "license": "mit", "language": [ { "name": "Perl", "bytes": "4869" }, { "name": "Shell", "bytes": "19365" } ], "symlink_target": "" }
using System; using System.Net.Http; namespace CompaniesHouse { public interface ICompaniesHouseSettings { Uri BaseUri { get; } string ApiKey { get; } Func<HttpMessageHandler> HttpMessageHandlerCreator { get; } } }
{ "content_hash": "76da0ea7637a3df079c086c2a8233858", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 67, "avg_line_length": 18.071428571428573, "alnum_prop": 0.6640316205533597, "repo_name": "LiberisLabs/CompaniesHouse.NET", "id": "b9b88ee827503d346ba05c81e17c4737b77ba968", "size": "253", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/CompaniesHouse/ICompaniesHouseSettings.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "145521" }, { "name": "PowerShell", "bytes": "353" } ], "symlink_target": "" }
import React, { Component, PropTypes } from 'react' import { formatSongTitle } from '../utils/FormatUtils' import {Link} from '.' const propTypes = { dispatch: PropTypes.func.isRequired, songId: PropTypes.number, title: PropTypes.string.isRequired, userId: PropTypes.number, username: PropTypes.string.isRequired } class SongDetails extends Component { render () { const { dispatch, songId, title, userId, username } = this.props return ( <div className='song-card-details'> <Link className='song-card-title' dispatch={dispatch} route={{ path: ['songs', songId] }} title={title} > {formatSongTitle(title)} </Link> <Link className='song-card-user-username' dispatch={dispatch} route={{ path: ['users', userId] }} title={username} > {username} </Link> </div> ) } } SongDetails.propTypes = propTypes export default SongDetails
{ "content_hash": "e8f1ed7159e4bdc7f6e656c13500a0b6", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 68, "avg_line_length": 24.73170731707317, "alnum_prop": 0.5986193293885601, "repo_name": "dearfrankg/soundio", "id": "2500f9a301464fb3b276e556dd33f6eb3c1059c0", "size": "1014", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/components/SongDetails.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "89538" }, { "name": "HTML", "bytes": "227" }, { "name": "JavaScript", "bytes": "171776" } ], "symlink_target": "" }
package com.rgu5android.application.locker.common.database; import java.util.ArrayList; import java.util.List; import com.rgu5android.application.locker.common.Constants; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; public class AppLockerDatabaseController { private AppLockerOpenHelper appLockerOpenHelper; private SQLiteDatabase sqLiteDatabase; public void openDatabase(Context context) throws SQLException, Exception { appLockerOpenHelper = AppLockerOpenHelper .getAppLockerOpenHelperInstance(context); sqLiteDatabase = appLockerOpenHelper.getWritableDatabase(); } public void closeDatabase() throws SQLException, Exception { if (sqLiteDatabase != null) { sqLiteDatabase = null; } if (appLockerOpenHelper != null) { appLockerOpenHelper = null; } } public void insertPackage(Context context, String packageName) throws SQLException, Exception { this.openDatabase(context); ContentValues contentValues = new ContentValues(); contentValues.put(Constants.COLUMN_PACKAGE_NAME, packageName); sqLiteDatabase.insert(Constants.TABLENAME, null, contentValues); this.closeDatabase(); } public void deletePackage(Context context, String packageName) throws SQLException, Exception { this.openDatabase(context); String whereClause = Constants.COLUMN_PACKAGE_NAME + "=?"; String[] whereArgs = new String[] { packageName }; sqLiteDatabase.delete(Constants.TABLENAME, whereClause, whereArgs); this.closeDatabase(); } public List<String> getLockedPackages(Context context) throws SQLException, Exception { this.openDatabase(context); List<String> lockedApplicationList = null; Cursor cursor = sqLiteDatabase.rawQuery("select * from " + Constants.TABLENAME, null); if (cursor.moveToFirst()) { lockedApplicationList = new ArrayList<String>(); while (cursor.isAfterLast() == false) { lockedApplicationList.add(cursor.getString(0)); cursor.moveToNext(); } } cursor.close(); this.closeDatabase(); return lockedApplicationList; } }
{ "content_hash": "3c380a4f97a4036bd4f03d4c929f56f8", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 76, "avg_line_length": 30.928571428571427, "alnum_prop": 0.7722863741339492, "repo_name": "RGU5Android/Mini-Project-Workspace", "id": "e14a131584a70c60842ddb006b70c15992a84262", "size": "2165", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AppLocker/src/com/rgu5android/application/locker/common/database/AppLockerDatabaseController.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "2" }, { "name": "C++", "bytes": "2" }, { "name": "Java", "bytes": "98765" } ], "symlink_target": "" }
#ifndef __LodListener_H__ #define __LodListener_H__ #include "OgrePrerequisites.h" namespace Ogre { /** \addtogroup Core * @{ */ /** \addtogroup LOD * @{ */ /// Struct containing information about a lod change event for movable objects. struct MovableObjectLodChangedEvent { /// The movable object whose level of detail has changed. MovableObject *movableObject; /// The camera with respect to which the level of detail has changed. Camera *camera; }; /// Struct containing information about a mesh lod change event for entities. struct EntityMeshLodChangedEvent { /// The entity whose level of detail has changed. Entity *entity; /// The camera with respect to which the level of detail has changed. Camera *camera; /// Lod value as determined by lod strategy. Real lodValue; /// Previous level of detail index. ushort previousLodIndex; /// New level of detail index. ushort newLodIndex; }; /// Struct containing information about a material lod change event for entities. struct EntityMaterialLodChangedEvent { /// The sub-entity whose material's level of detail has changed. SubEntity *subEntity; /// The camera with respect to which the level of detail has changed. Camera *camera; /// Lod value as determined by lod strategy. Real lodValue; /// Previous level of detail index. ushort previousLodIndex; /// New level of detail index. ushort newLodIndex; }; /** A interface class defining a listener which can be used to receive notifications of lod events. @remarks A 'listener' is an interface designed to be called back when particular events are called. This class defines the interface relating to lod events. In order to receive notifications of lod events, you should create a subclass of LodListener and override the methods for which you would like to customise the resulting processing. You should then call SceneManager::addLodListener passing an instance of this class. There is no limit to the number of lod listeners you can register, allowing you to register multiple listeners for different purposes. For some uses, it may be advantageous to also subclass RenderQueueListener as this interface makes available information regarding render queue invocations. It is important not to modify the scene graph during rendering, so, for each event, there are two methods, a prequeue method and a postqueue method. The prequeue method is invoked during rendering, and as such should not perform any changes, but if the event is relevant, it may return true indicating the postqueue method should also be called. The postqueue method is invoked at an appropriate time after rendering and scene changes may be safely made there. */ class _OgreExport LodListener { public: virtual ~LodListener() {} /** Called before a movable object's lod has changed. @remarks Do not change the Ogre state from this method, instead return true and perform changes in postqueueMovableObjectLodChanged. @return True to indicate the event should be queued and postqueueMovableObjectLodChanged called after rendering is complete. */ virtual bool prequeueMovableObjectLodChanged(const MovableObjectLodChangedEvent& evt) { (void)evt; return false; } /** Called after a movable object's lod has changed. @remarks May be called even if not requested from prequeueMovableObjectLodChanged as only one event queue is maintained per SceneManger instance. */ virtual void postqueueMovableObjectLodChanged(const MovableObjectLodChangedEvent& evt) { (void)evt; } /** Called before an entity's mesh lod has changed. @remarks Do not change the Ogre state from this method, instead return true and perform changes in postqueueEntityMeshLodChanged. It is possible to change the event notification and even alter the newLodIndex field (possibly to prevent the lod from changing, or to skip an index). @return True to indicate the event should be queued and postqueueEntityMeshLodChanged called after rendering is complete. */ virtual bool prequeueEntityMeshLodChanged(EntityMeshLodChangedEvent& evt) { (void)evt; return false; } /** Called after an entity's mesh lod has changed. @remarks May be called even if not requested from prequeueEntityMeshLodChanged as only one event queue is maintained per SceneManger instance. */ virtual void postqueueEntityMeshLodChanged(const EntityMeshLodChangedEvent& evt) { (void)evt; } /** Called before an entity's material lod has changed. @remarks Do not change the Ogre state from this method, instead return true and perform changes in postqueueMaterialLodChanged. It is possible to change the event notification and even alter the newLodIndex field (possibly to prevent the lod from changing, or to skip an index). @return True to indicate the event should be queued and postqueueMaterialLodChanged called after rendering is complete. */ virtual bool prequeueEntityMaterialLodChanged(EntityMaterialLodChangedEvent& evt) { (void)evt; return false; } /** Called after an entity's material lod has changed. @remarks May be called even if not requested from prequeueEntityMaterialLodChanged as only one event queue is maintained per SceneManger instance. */ virtual void postqueueEntityMaterialLodChanged(const EntityMaterialLodChangedEvent& evt) { (void)evt; } }; /** @} */ /** @} */ } #endif
{ "content_hash": "efd672828cb8c92b3365e2fd3da3b33f", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 96, "avg_line_length": 35.828729281767956, "alnum_prop": 0.6407093292212799, "repo_name": "Kanma/Ogre", "id": "d82b249d962bf6e0adf0e98d17b81c5bc7c38218", "size": "7848", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/Ogre/OgreLodListener.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2141984" }, { "name": "C++", "bytes": "13610649" }, { "name": "CSS", "bytes": "24100" }, { "name": "Objective-C", "bytes": "86240" }, { "name": "Objective-C++", "bytes": "79422" }, { "name": "Shell", "bytes": "701" }, { "name": "TeX", "bytes": "43359" } ], "symlink_target": "" }
package au.edu.uts.eng.remotelabs.schedserver.logger; /** * Logger interface. */ public interface Logger { /** Fatal messages. */ public int FATAL = 0; /** Priority messages. */ public int PRIORITY = 1; /** Error messages. */ public int ERROR = 2; /** Warning messages. */ public int WARN = 3; /** Informational messages. */ public int INFO = 4; /** Debugging messages. */ public int DEBUG = 5; /** * Logs fatal messages. * * @param message message to log */ public void fatal(String message); /** * Logs priority messages. * * @param message message to log */ public void priority(String message); /** * Logs error messages. * * @param message message to log */ public void error(String message); /** * Logs warning messages. * * @param message message to log */ public void warn(String message); /** * Logs informational messages. * * @param message message to log */ public void info(String message); /** * Logs debugging messages. * * @param message message to log */ public void debug(String message); /** * Logs a message to the specified level. * * @param level logging level * @param message message to log */ public void log(final int level, String message); }
{ "content_hash": "ef35b94b048105f08ecc37888e94034f", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 53, "avg_line_length": 19.103896103896105, "alnum_prop": 0.5540448674371176, "repo_name": "jeking3/scheduling-server", "id": "f6dba4338c76a7ccc39a8d7e55a7b400c5b3c219", "size": "3331", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Logger/src/au/edu/uts/eng/remotelabs/schedserver/logger/Logger.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "51816" }, { "name": "C++", "bytes": "67831" }, { "name": "CSS", "bytes": "36224" }, { "name": "HTML", "bytes": "11489" }, { "name": "Java", "bytes": "7952577" }, { "name": "JavaScript", "bytes": "105192" }, { "name": "Makefile", "bytes": "2195" }, { "name": "NSIS", "bytes": "59496" }, { "name": "Shell", "bytes": "8386" } ], "symlink_target": "" }
diff between today and yesterday #### python * [heroku/django-heroku](https://github.com/heroku/django-heroku): A Django library for Heroku apps. * [geek-ai/MAgent](https://github.com/geek-ai/MAgent): A Platform for Many-agent Reinforcement Learning * [leehomyc/mixup_pytorch](https://github.com/leehomyc/mixup_pytorch): A PyTorch implementation of the paper Mixup: Beyond Empirical Risk Minimization in PyTorch * [pallets/flask](https://github.com/pallets/flask): A microframework based on Werkzeug, Jinja2 and good intentions * [ansible/ansible](https://github.com/ansible/ansible): Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications automate in a language that approaches plain English, using SSH, with no agents to install on remote systems. * [ageitgey/face_recognition](https://github.com/ageitgey/face_recognition): The world's simplest facial recognition api for Python and the command line * [python/cpython](https://github.com/python/cpython): The Python programming language * [donnemartin/system-design-primer](https://github.com/donnemartin/system-design-primer): Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards. #### go * [matthewmueller/joy](https://github.com/matthewmueller/joy): A delightful Go to Javascript compiler * [goodrain/rainbond](https://github.com/goodrain/rainbond): Rainbond, Production-Grade Serverless PaaS * [gen2brain/beeep](https://github.com/gen2brain/beeep): Go cross-platform library for sending desktop notifications and beeps * [moby/moby](https://github.com/moby/moby): Moby Project - a collaborative project for the container ecosystem to assemble container-based systems * [istio/istio](https://github.com/istio/istio): An open platform to connect, manage, and secure microservices. * [openfaas/faas](https://github.com/openfaas/faas): OpenFaaS - Serverless Functions Made Simple for Docker & Kubernetes * [tensorflow/k8s](https://github.com/tensorflow/k8s): Tools for ML/Tensorflow on Kubernetes. * [kubeless/kubeless](https://github.com/kubeless/kubeless): Kubernetes Native Serverless Framework #### cpp * [mbasso/asm-dom](https://github.com/mbasso/asm-dom): A minimal WebAssembly virtual DOM to build C++ SPA (Single page applications) * [ApolloAuto/apollo](https://github.com/ApolloAuto/apollo): An open autonomous driving platform * [google/googletest](https://github.com/google/googletest): Google Test * [radareorg/cutter](https://github.com/radareorg/cutter): A Qt and C++ GUI for radare2 reverse engineering framework * [godotengine/godot](https://github.com/godotengine/godot): Godot Engine Multi-platform 2D and 3D game engine * [caffe2/caffe2](https://github.com/caffe2/caffe2): Caffe2 is a lightweight, modular, and scalable deep learning framework. * [ethereum-mining/ethminer](https://github.com/ethereum-mining/ethminer): Ethereum miner with OpenCL, CUDA and stratum support #### javascript * [Chalarangelo/30-seconds-of-code](https://github.com/Chalarangelo/30-seconds-of-code): Curated collection of useful Javascript snippets that you can understand in 30 seconds or less. * [egoist/poi](https://github.com/egoist/poi): Delightful web development. * [dvdciri/daggraph](https://github.com/dvdciri/daggraph): Dagger dependency graph generator for Android Developers * [youzan/vant](https://github.com/youzan/vant): A Vue.js 2.0 Mobile UI at YouZan * [sindresorhus/on-change](https://github.com/sindresorhus/on-change): Watch an object or array for changes * [LibreRead/server](https://github.com/LibreRead/server): Self-hosted Free(Libre) Ebook Reader * [Popmotion/popmotion](https://github.com/Popmotion/popmotion): The JavaScript motion engine. Create unique animations and interactions with tweens, physics and input tracking. #### coffeescript * [lukefx/hubot-telegram](https://github.com/lukefx/hubot-telegram): Hubot adapter for Telegram * [jacogr/atom-git-control](https://github.com/jacogr/atom-git-control): Provides a GUI interface to manage all commonly-used git commands. * [RocketChat/hubot-natural](https://github.com/RocketChat/hubot-natural): Natural Language Processing Chatbot for RocketChat * [hiddentao/squel](https://github.com/hiddentao/squel): SQL query string builder for Javascript
{ "content_hash": "3ae896115b6ee040420d7e5a78f411e5", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 354, "avg_line_length": 97.11111111111111, "alnum_prop": 0.7837528604118993, "repo_name": "larsbijl/trending_archive", "id": "773297aad7d1b81c75f32f449719f3040a685c2b", "size": "4385", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "2017/2017-12/2017-12-12_short.md", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "2423" } ], "symlink_target": "" }
<?php namespace System\Models; use Admin\Models\Customers_model; use Admin\Models\Staffs_model; use Carbon\Carbon; use DB; use Igniter\Flame\Database\Traits\NestedTree; use Igniter\Flame\Database\Traits\Purgeable; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Mail\Message; use Mail; use Model; /** * Messages Model Class * @package System */ class Messages_model extends Model { use SoftDeletes; use NestedTree; use Purgeable; const DELETED_AT = 'date_deleted'; const CREATED_AT = 'date_added'; const UPDATED_AT = 'date_updated'; /** * @var string The database table name */ protected $table = 'messages'; /** * @var string The database table primary key */ protected $primaryKey = 'message_id'; public $timestamps = TRUE; protected $fillable = []; public $relation = [ 'belongsTo' => [ 'layout' => ['System\Models\Mail_layouts_model'], ], 'hasMany' => [ 'recipients' => ['System\Models\Message_meta_model'], ], 'morphTo' => [ 'sender' => [], ], ]; public $purgeable = [ 'customers', 'customer_group', 'staff', 'staff_group', 'respond', ]; public static $allowedSortingColumns = [ 'date_added asc', 'date_added desc', 'subject asc', 'subject desc', ]; public static function findRecipients($type, array $ids = []) { $model = str_contains($type, 'customer') ? Customers_model::class : Staffs_model::class; if (ends_with($type, '_group')) { return $model::whereHas('group', function ($query) use ($ids) { $query->whereKey($ids); })->get(); } if ($type == 'all_newsletters') return $model::where('newsletter', 1)->get(); return $model::findMany($ids); } public static function getSendTypeOptions() { return [ 'email' => lang('system::lang.messages.text_email'), 'account' => lang('system::lang.messages.text_account'), ]; } public static function countUnread($messagable) { if (!$messagable instanceof Model) return null; return self::whereHas('recipients', function ($query) use ($messagable) { $query->whereMessagable($messagable)->whereIsUnread(); })->whereIsSent()->count(); } public static function listMenuMessages($menu, $item, $user) { $query = self::listMessages([ 'context' => 'inbox', 'recipient' => $user->staff, 'state' => 'unread', ])->orderBy('date_updated', 'desc'); return [ 'total' => $query->toBase()->getCountForPagination(), 'items' => $query->get(), ]; } public static function listReceivers() { return [ 'all_newsletters' => 'lang:system::lang.messages.text_all_newsletters', 'customers' => 'lang:system::lang.messages.text_customers', 'customer_group' => 'lang:system::lang.messages.text_customer_group', 'staff' => 'lang:system::lang.messages.text_staff', 'staff_group' => 'lang:system::lang.messages.text_staff_group', ]; } public static function listFolders() { return [ 'inbox' => [ 'title' => 'lang:system::lang.messages.text_inbox', 'icon' => 'fa-inbox', 'url' => 'messages', ], 'draft' => [ 'title' => 'lang:system::lang.messages.text_draft', 'icon' => 'fa-file-text-o', 'url' => 'messages/draft', ], 'sent' => [ 'title' => 'lang:system::lang.messages.text_sent', 'icon' => 'fa-paper-plane-o', 'url' => 'messages/sent', ], 'archive' => [ 'title' => 'lang:system::lang.messages.text_archive', 'icon' => 'fa-archive', 'url' => 'messages/archive', ], ]; } // // Events // public function afterSave() { $this->performAfterSave(); } // // Accessors & Mutators // public function getSummaryAttribute($value) { return str_limit(strip_tags($this->body), 120); } public function getRecipientAttribute($value) { // Backward compatibility $replace = ['all_customers' => 'customers', 'all_staffs' => 'staff']; if (array_key_exists($value, $replace)) return $replace[$value]; return $value; } public function getRecipientLabelAttribute($value) { return array_get(self::listReceivers(), $this->recipient); } // // Scopes // public function scopeListFrontEnd($query, array $options = []) { $options = array_merge([ 'page' => 1, 'pageLimit' => 20, 'sort' => null, ], $options); $options['context'] = 'inbox'; $query->whereSentToInbox()->listMessages($options); return $query->paginate($options['pageLimit'], $options['page']); } public function scopeListMessages($query, array $options = []) { extract(array_merge([ 'sort' => null, 'context' => 'inbox', 'state' => null, 'recipient' => null, ], $options)); switch ($context) { case 'inbox': $query->whereNull('parent_id') ->where('status', 1) ->whereHas('recipients', function ($q) use ($recipient, $state) { $q->whereMessagable($recipient); if ($state == 'read') { $q->whereIsRead(); } else if ($state == 'unread') { $q->whereIsUnread(); } }); break; case 'draft': $query->where('status', '!=', 1)->orWhereNull('status')->whereSender($recipient); break; case 'sent': $query->where('status', 1)->whereSender($recipient); break; case 'archive': $query->whereNull('parent_id')->whereSender($recipient)->onlyTrashed(); break; } if (!is_array($sort)) { $sort = [$sort]; } foreach ($sort as $_sort) { if (in_array($_sort, self::$allowedSortingColumns)) { $parts = explode(' ', $_sort); if (count($parts) < 2) { array_push($parts, 'desc'); } list($sortField, $sortDirection) = $parts; $query->orderBy($sortField, $sortDirection); } } return $query; } public function scopeViewConversation($query, array $options = []) { extract(array_merge([ 'recipient' => null, ], $options)); $query->whereNull('parent_id')->where('status', 1); if (!is_null($recipient)) { $query->whereHas('recipients', function ($q) use ($recipient) { $q->whereMessagable($recipient); }); $query->orWhere(function ($q) use ($recipient) { $q->whereSender($recipient); }); } return $query; } public function scopeWhereSender($query, $sender) { return $query->where('sender_id', $sender->getKey()) ->where('sender_type', $sender->getMorphClass()); } public function scopeSelectRecipientStatus($query) { return $query->selectRaw('*, '.DB::prefix('message_meta').'.status AS recipient_status'); } public function scopeFilterState($query, $state) { return $query->whereHas('recipients', function ($q) use ($state) { $q->where('state', $state); }); } public function scopeWhereIsSent($query) { return $query->where('status', 1); } public function scopeWhereSentToInbox($query) { return $query->where('send_type', 'account'); } public function scopeWhereSentToEmail($query) { return $query->where('send_type', 'email'); } // // Helpers // public function send($recipients) { if ($this->status !== -1) return; $subject = $this->subject; Mail::sendToMany( $recipients, [ 'html' => $this->body, 'raw' => TRUE, ], $this->toArray(), function (Message $message) use ($subject) { $message->subject($subject) ->replyTo(config('mail.from.address'), config('mail.from.name')); }, ['bcc' => TRUE] ); } public function sent() { $this->status = 1; $this->setUpdatedAt(Carbon::now()); $this->save(); // Mark as unread $this->recipients()->update(['status' => 1, 'state' => 0]); } public function isSent() { return $this->status > 0; } public function sendToEmail() { return $this->send_type == 'email'; } public function sendToInbox() { return $this->send_type == 'account'; } /** * Return all recipients of a message * * @param int $message_id * * @return array */ public function listRecipients() { $recipients = $this->recipients; if (!count($recipients)) return null; $recipients->transform(function ($recipient) { if (!$recipient->messagable) return FALSE; if (!$recipient->messagable->staff) return FALSE; return $recipient->messagable->staff; }); return $recipients; } public function getRecipient($messagable) { if (!$messagable instanceof Model OR !$this->recipients) return null; return $this->recipients->where('messagable_id', $messagable->getKey()) ->where('messagable_type', $messagable->getMorphClass())->first(); } public function isMarkedAsRead($messagable) { if (!$meta = $this->getRecipient($messagable)) return null; return $meta->state == 1; } public function markAsRead($messagable) { if (!$meta = $this->getRecipient($messagable)) return null; $meta->state = 1; $meta->save(); } public function markAsUnread($messagable) { if (!$meta = $this->getRecipient($messagable)) return null; $meta->state = 0; $meta->save(); } public function addRecipients($recipients) { if ($recipients->isEmpty()) return; $this->recipients()->forceDelete(); $recipients->each(function ($model) { $this->recipients()->create([ 'messagable_id' => $model->getKey(), 'messagable_type' => $model->getMorphClass(), ]); }); } protected function performAfterSave() { $this->restorePurgedValues(); if (!empty($this->attributes[$this->recipient]) AND is_array($this->attributes[$this->recipient])) { $recipientList = self::findRecipients($this->recipient, $this->attributes[$this->recipient]); unset($this->attributes[$this->recipient]); if ($this->sendToEmail()) { $this->send($recipientList); } else { $this->addRecipients($recipientList); } } } }
{ "content_hash": "88e748728deee8ac703906bcb98b46b8", "timestamp": "", "source": "github", "line_count": 453, "max_line_length": 108, "avg_line_length": 26.47019867549669, "alnum_prop": 0.4985405720957385, "repo_name": "sampoyigi/TastyIgniter", "id": "0623c1bd1b25c3b4ceee27caaf1b291b2cf7ff18", "size": "11991", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/system/models/Messages_model.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "1741" }, { "name": "C", "bytes": "42660" }, { "name": "CSS", "bytes": "181399" }, { "name": "HTML", "bytes": "17765" }, { "name": "JavaScript", "bytes": "459848" }, { "name": "PHP", "bytes": "4616063" } ], "symlink_target": "" }
FROM python:3.7-bullseye LABEL maintainer="Sebastian Ramirez <tiangolo@gmail.com>" COPY install-nginx-debian.sh / RUN bash /install-nginx-debian.sh # Install requirements COPY requirements.txt /tmp/requirements.txt RUN pip install --no-cache-dir -r /tmp/requirements.txt EXPOSE 80 # Expose 443, in case of LTS / HTTPS EXPOSE 443 # Remove default configuration from Nginx RUN rm /etc/nginx/conf.d/default.conf # Copy the base uWSGI ini file to enable default dynamic uwsgi process number COPY uwsgi.ini /etc/uwsgi/ # Install Supervisord RUN apt-get update && apt-get install -y supervisor \ && rm -rf /var/lib/apt/lists/* # Custom Supervisord config COPY supervisord-debian.conf /etc/supervisor/conf.d/supervisord.conf # Copy stop-supervisor.sh to kill the supervisor and substasks on app failure COPY stop-supervisor.sh /etc/supervisor/stop-supervisor.sh RUN chmod +x /etc/supervisor/stop-supervisor.sh # Which uWSGI .ini file should be used, to make it customizable ENV UWSGI_INI /app/uwsgi.ini # By default, run 2 processes ENV UWSGI_CHEAPER 2 # By default, when on demand, run up to 16 processes ENV UWSGI_PROCESSES 16 # By default, allow unlimited file sizes, modify it to limit the file sizes # To have a maximum of 1 MB (Nginx's default) change the line to: # ENV NGINX_MAX_UPLOAD 1m ENV NGINX_MAX_UPLOAD 0 # By default, Nginx will run a single worker process, setting it to auto # will create a worker for each CPU core ENV NGINX_WORKER_PROCESSES 1 # By default, Nginx listens on port 80. # To modify this, change LISTEN_PORT environment variable. # (in a Dockerfile or with an option for `docker run`) ENV LISTEN_PORT 80 # Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app COPY start.sh /start.sh RUN chmod +x /start.sh # Copy the entrypoint that will generate Nginx additional configs COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] # Add demo app COPY ./app /app WORKDIR /app # Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"]
{ "content_hash": "74218400fdf2085ebc4cfa6583bd532e", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 103, "avg_line_length": 30.36111111111111, "alnum_prop": 0.7634949679780421, "repo_name": "tiangolo/uwsgi-nginx-docker", "id": "d74d2151e5753ff11499065e80243b26297717ac", "size": "2186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docker-images/python3.7.dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "13183" }, { "name": "Python", "bytes": "26641" }, { "name": "Shell", "bytes": "13274" } ], "symlink_target": "" }
/** * CustomFieldService.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.google.api.ads.dfp.v201308; public interface CustomFieldService extends javax.xml.rpc.Service { public java.lang.String getCustomFieldServiceInterfacePortAddress(); public com.google.api.ads.dfp.v201308.CustomFieldServiceInterface getCustomFieldServiceInterfacePort() throws javax.xml.rpc.ServiceException; public com.google.api.ads.dfp.v201308.CustomFieldServiceInterface getCustomFieldServiceInterfacePort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; }
{ "content_hash": "51020b3a5bf6c23bdc59339a57d011ca", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 169, "avg_line_length": 41, "alnum_prop": 0.8033536585365854, "repo_name": "google-code-export/google-api-dfp-java", "id": "0f0ade62f46bd48dc15d54787134c887b765d8db", "size": "656", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/google/api/ads/dfp/v201308/CustomFieldService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "39950935" } ], "symlink_target": "" }
package com.azure.cosmos.rx; import com.azure.cosmos.ClientUnderTestBuilder; import com.azure.cosmos.CosmosAsyncClient; import com.azure.cosmos.CosmosAsyncContainer; import com.azure.cosmos.CosmosAsyncDatabase; import com.azure.cosmos.CosmosBridgeInternal; import com.azure.cosmos.CosmosClientBuilder; import com.azure.cosmos.implementation.InternalObjectNode; import com.azure.cosmos.implementation.RxDocumentClientUnderTest; import com.azure.cosmos.implementation.TestUtils; import com.azure.cosmos.models.CosmosContainerProperties; import com.azure.cosmos.models.CosmosContainerRequestOptions; import com.azure.cosmos.models.FeedResponse; import com.azure.cosmos.models.IncludedPath; import com.azure.cosmos.models.IndexingPolicy; import com.azure.cosmos.models.PartitionKeyDefinition; import com.azure.cosmos.models.CosmosQueryRequestOptions; import com.azure.cosmos.util.CosmosPagedFlux; import io.reactivex.subscribers.TestSubscriber; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Factory; import org.testng.annotations.Test; import reactor.core.publisher.Flux; import reactor.core.scheduler.Schedulers; import reactor.util.concurrent.Queues; import java.util.ArrayList; import java.util.List; import java.util.UUID; import java.util.concurrent.TimeUnit; import static org.assertj.core.api.Assertions.assertThat; public class BackPressureCrossPartitionTest extends TestSuiteBase { private final Logger log = LoggerFactory.getLogger(BackPressureCrossPartitionTest.class); private static final int TIMEOUT = 1800000; private static final int SETUP_TIMEOUT = 60000; private int numberOfDocs = 1000; private CosmosAsyncDatabase createdDatabase; private CosmosAsyncContainer createdCollection; private List<InternalObjectNode> createdDocuments; private CosmosAsyncClient client; private int numberOfPartitions; public String getCollectionLink() { return TestUtils.getCollectionNameLink(createdDatabase.getId(), createdCollection.getId()); } static protected CosmosContainerProperties getCollectionDefinition() { PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); ArrayList<String> paths = new ArrayList<>(); paths.add("/mypk"); partitionKeyDef.setPaths(paths); IndexingPolicy indexingPolicy = new IndexingPolicy(); List<IncludedPath> includedPaths = new ArrayList<>(); IncludedPath includedPath = new IncludedPath("/*"); includedPaths.add(includedPath); indexingPolicy.setIncludedPaths(includedPaths); CosmosContainerProperties collectionDefinition = new CosmosContainerProperties( UUID.randomUUID().toString(), partitionKeyDef); collectionDefinition.setIndexingPolicy(indexingPolicy); return collectionDefinition; } // RxDocumentClientUnderTest spy used in this test only has support for GW request capturing // So only running the test against GW is relevant @Factory(dataProvider = "simpleClientBuilderGatewaySession") public BackPressureCrossPartitionTest(CosmosClientBuilder clientBuilder) { super(clientBuilder); } private void warmUp() { CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); // ensure collection is cached createdCollection.queryItems("SELECT * FROM r", options, InternalObjectNode.class).byPage().blockFirst(); } @DataProvider(name = "queryProvider") public Object[][] queryProvider() { return new Object[][] { // query, maxItemCount, max expected back pressure buffered, total number of expected query results { "SELECT * FROM r", 1, Queues.SMALL_BUFFER_SIZE, numberOfDocs}, { "SELECT * FROM r", 100, Queues.SMALL_BUFFER_SIZE, numberOfDocs}, { "SELECT * FROM r ORDER BY r.prop", 100, Queues.SMALL_BUFFER_SIZE + 3 * numberOfPartitions, numberOfDocs}, { "SELECT TOP 500 * FROM r", 1, Queues.SMALL_BUFFER_SIZE, 500}, { "SELECT TOP 500 * FROM r", 100, Queues.SMALL_BUFFER_SIZE, 500}, { "SELECT TOP 500 * FROM r ORDER BY r.prop", 100, Queues.SMALL_BUFFER_SIZE + 3 * numberOfPartitions , 500}, }; } @Test(groups = { "long" }, dataProvider = "queryProvider", timeOut = 2 * TIMEOUT) public void queryPages(String query, int maxItemCount, int maxExpectedBufferedCountForBackPressure, int expectedNumberOfResults) throws Exception { CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); options.setMaxDegreeOfParallelism(2); CosmosPagedFlux<InternalObjectNode> queryObservable = createdCollection.queryItems(query, options, InternalObjectNode.class); RxDocumentClientUnderTest rxClient = (RxDocumentClientUnderTest) CosmosBridgeInternal.getAsyncDocumentClient(client); rxClient.httpRequests.clear(); log.info("instantiating subscriber ..."); TestSubscriber<FeedResponse<InternalObjectNode>> subscriber = new TestSubscriber<>(1); queryObservable.byPage(maxItemCount).publishOn(Schedulers.boundedElastic(), 1).subscribe(subscriber); int sleepTimeInMillis = 10000; int i = 0; // use a test subscriber and request for more result and sleep in between while (subscriber.completions() == 0 && subscriber.errorCount() == 0) { log.debug("loop " + i); TimeUnit.MILLISECONDS.sleep(sleepTimeInMillis); sleepTimeInMillis /= 2; if (sleepTimeInMillis > 4000) { // validate that only one item is returned to subscriber in each iteration assertThat(subscriber.valueCount() - i).isEqualTo(1); } log.debug("subscriber.getValueCount(): " + subscriber.valueCount()); log.debug("client.httpRequests.size(): " + rxClient.httpRequests.size()); // validate that the difference between the number of requests to backend // and the number of returned results is always less than a fixed threshold assertThat(rxClient.httpRequests.size() - subscriber.valueCount()) .isLessThanOrEqualTo(maxExpectedBufferedCountForBackPressure); log.debug("requesting more"); subscriber.requestMore(1); i++; } subscriber.assertNoErrors(); subscriber.assertComplete(); assertThat(subscriber.values().stream().mapToInt(p -> p.getResults().size()).sum()).isEqualTo(expectedNumberOfResults); } @Test(groups = { "long" }, dataProvider = "queryProvider", timeOut = 2 * TIMEOUT) public void queryItems(String query, int maxItemCount, int maxExpectedBufferedCountForBackPressure, int expectedNumberOfResults) throws Exception { CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); options.setMaxDegreeOfParallelism(2); CosmosPagedFlux<InternalObjectNode> queryObservable = createdCollection.queryItems(query, options, InternalObjectNode.class); RxDocumentClientUnderTest rxClient = (RxDocumentClientUnderTest) CosmosBridgeInternal.getAsyncDocumentClient(client); rxClient.httpRequests.clear(); log.info("instantiating subscriber ..."); TestSubscriber<InternalObjectNode> subscriber = new TestSubscriber<>(1); queryObservable.publishOn(Schedulers.boundedElastic(), 1).subscribe(subscriber); int sleepTimeInMillis = 10000; int i = 0; // use a test subscriber and request for more result and sleep in between while (subscriber.completions() == 0 && subscriber.errorCount() == 0) { log.debug("loop " + i); TimeUnit.MILLISECONDS.sleep(sleepTimeInMillis); sleepTimeInMillis /= 2; if (sleepTimeInMillis > 4000) { // validate that only one item is returned to subscriber in each iteration assertThat(subscriber.valueCount() - i).isEqualTo(1); } log.debug("subscriber.getValueCount(): " + subscriber.valueCount()); log.debug("client.httpRequests.size(): " + rxClient.httpRequests.size()); // validate that the difference between the number of requests to backend // and the number of returned results is always less than a fixed threshold assertThat(rxClient.httpRequests.size() - subscriber.valueCount()) .isLessThanOrEqualTo(maxExpectedBufferedCountForBackPressure); log.debug("requesting more"); subscriber.requestMore(1); i++; } subscriber.assertNoErrors(); subscriber.assertComplete(); assertThat(Integer.valueOf(subscriber.values().size())).isEqualTo(expectedNumberOfResults); } @BeforeClass(groups = { "long" }, timeOut = SETUP_TIMEOUT) public void before_BackPressureCrossPartitionTest() { CosmosContainerRequestOptions options = new CosmosContainerRequestOptions(); client = new ClientUnderTestBuilder(getClientBuilder()).buildAsyncClient(); createdDatabase = getSharedCosmosDatabase(client); createdCollection = createCollection(createdDatabase, getCollectionDefinition(), options, 20000); ArrayList<InternalObjectNode> docDefList = new ArrayList<>(); for(int i = 0; i < numberOfDocs; i++) { docDefList.add(getDocumentDefinition(i)); } createdDocuments = bulkInsertBlocking( createdCollection, docDefList); numberOfPartitions = CosmosBridgeInternal.getAsyncDocumentClient(client).readPartitionKeyRanges(getCollectionLink(), null) .flatMap(p -> Flux.fromIterable(p.getResults())).collectList().single().block().size(); waitIfNeededForReplicasToCatchUp(getClientBuilder()); warmUp(); } @AfterClass(groups = { "long" }, timeOut = 2 * SHUTDOWN_TIMEOUT, alwaysRun = true) public void afterClass() { safeDeleteCollection(createdCollection); safeClose(client); } private static InternalObjectNode getDocumentDefinition(int cnt) { String uuid = UUID.randomUUID().toString(); InternalObjectNode doc = new InternalObjectNode(String.format("{ " + "\"id\": \"%s\", " + "\"prop\" : %d, " + "\"mypk\": \"%s\", " + "\"sgmts\": [[6519456, 1471916863], [2498434, 1455671440]]" + "}" , uuid, cnt, uuid)); return doc; } }
{ "content_hash": "e8b4f50cfc2730fd391507107d918d75", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 151, "avg_line_length": 46.268398268398265, "alnum_prop": 0.6980726047904192, "repo_name": "Azure/azure-sdk-for-java", "id": "4d602c65e5a44cb87dc6b2ce8e73e08e3f621ba9", "size": "10784", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/BackPressureCrossPartitionTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "8762" }, { "name": "Bicep", "bytes": "15055" }, { "name": "CSS", "bytes": "7676" }, { "name": "Dockerfile", "bytes": "2028" }, { "name": "Groovy", "bytes": "3237482" }, { "name": "HTML", "bytes": "42090" }, { "name": "Java", "bytes": "432409546" }, { "name": "JavaScript", "bytes": "36557" }, { "name": "Jupyter Notebook", "bytes": "95868" }, { "name": "PowerShell", "bytes": "737517" }, { "name": "Python", "bytes": "240542" }, { "name": "Scala", "bytes": "1143898" }, { "name": "Shell", "bytes": "18488" }, { "name": "XSLT", "bytes": "755" } ], "symlink_target": "" }
The BadWolf query language is built around a low-level abstraction to manage and retrieve triples from a fairly arbitrary store. All access to the data goes through the interfaces defined in the [storage.go](../storage/storage.go) file of the ```storage``` package. One example of a simple naive implementation of those interfaces can be found on the ```storage/memory``` package. It provides a volatile memory-only implementation of both ```storage.Store``` and ```storage.Graph``` interfaces. The BQL planner that is described here focuses on what happens after the a ```select``` query is properly parsed and it is ready to go. It mostly focuses on explaining how the data is accessed given a graph pattern. As described in the [BQL](./bql.md) introduction, the graph is queried using graph patterns. The graph pattern is a collection of clauses separated by '.' . Each clause takes the form of a generalized triple, where parts of it can be replaced by 'bindings'. You can interpret them as variables that adopt a non-mutable value during the course of a graph traversal. ## Resolving single clause patterns Some examples of a graph pattern defined by a single clause are shown below. To keep it simple only immutable predicates will be used. * ```/user<Joe> "parent-of"@[] /user<Mary>``` is a fully specified clause with no bindings. * ```/user<Joe> "parent-of"@[] ?child``` is a clause that will match all the objects ```?child``` that satisfy having ```/user<Joe>``` as subject and ```"parent-of"@[]``` as a predicate. Resolving clauses with no bindings is equivalent to checking if that fact exists in the store. The first clause will be ```true``` if there is a triple supporting that fact in the graph being queried on the store. It will return ```false``` otherwise. It is important to keep this part of the evaluation in mind. When we get to how patterns with multiple clauses are evaluated, intuitively you can think of them as follows: a composed pattern will be ```true``` if all its clauses are ```true```, it will be ```false``` otherwise. This first clause would translate into planning to execute a simple call to the interface method ```Exist``` to satisfy it. The second clause is not as specific as the first one. In the example, what would be the object has been replaced by the binding ```?child```. This indicates that we care about the objects that satisfy having ```/user<Joe>``` as subject and ```"parent-of"@[]``` as a predicate. If such triples exist on the queried graph, the clause would be ```true```. If there are no triples that would match such a clause, it will evaluate to ```false```. The binding will take all the possible values available on the graph. This means that for a given matching iteration ```?child``` will only have one value across the pattern. The planner will decide that to resolve such a clause, it will require to use the ```TriplesForSubjectAndPredicate``` interface method. Let's assume that for the rest of this document our graph will contain the following triples: ``` /user<Joe> "parent-of"@[] /user<Mary> /user<Joe> "parent-of"@[] /user<Peter> /user<Peter> "parent-of"@[] /user<Jane> /user<Peter> "parent-of"@[] /user<Mary Anne> ``` Given the above data, the clause ```/user<Joe> "parent-of"@[] ?child``` is ```true```. Also, resolving the clause triggered two binding iterations where ```?child``` would be bound to ```/user<Mary>``` and ```/user<Peter>``` in each iteration. ## Specificity of a clause. Given a clause, we define its specificity by the number of bindings present. The _specificity_ of a clause, or _S(c)_, can only take 4 possible values: 0, 1, 2, 3. Below you have a table of all the possible specificity values based on the bindings present. | Clause _c_ | _S(c)_ | |:--------------------------------------------|:------:| | ```/user<Joe> "parent-of"@[] /user<Mary>``` | 3 | | ```?s "parent-of"@[] /user<Mary>``` | 2 | | ```/user<Joe> ?p /user<Mary>``` | 2 | | ```/user<Joe> "parent-of"@[] ?o``` | 2 | | ```?s ?p /user<Mary>``` | 1 | | ```?s "parent-of"@[] ?o``` | 1 | | ```/user<Joe> ?p ?o``` | 1 | | ```?s ?p ?o``` | 0 | Clauses with _S(c)_= 0 indicate clauses that would match the entire graph. ## Resolving multi clause patterns Imagine that, given the previous example graph, you would like to know who the grandchildren of Joe are. You can express that query by using a compound pattern form with two clauses. ``` /user<Joe> "parent-of"@[] ?child . ?child "parent-of"@[] ?grand_child ``` This pattern contains two clauses. Both need to be satisfied in order to satisfy the pattern. Another interesting point is that these clauses have a binding dependency. The first and the second clause in the pattern share the ```?child``` binding. Remember that a binding takes a non mutable value during a binding iteration. This means that we have a few options on how we plan to query the graph at hand to see if we can satisfy this pattern: 1. We get all the children that we can find for Joe, then for each child we try to see if they are the parent of any other person. 2. We look for all children to get the list of parents, then for each of those parents we try to see if they are a child of Joe. 3. We get all the children of Joe. We also get all parents and correspondent children in the graph. We take both sets of data and filter out any children in the graph whose parent is not a child of Joe. All three options are valid options that the planner could choose to try to satisfy the given graph pattern. The first one has the benefits of trying to narrow the amount of data to sift through. The second option would likely yield large amounts of data on parents, and then use all that data to find which of those parents is a child of Joe. Finally, the third option would allow us to concurrently get the data to satisfy both clauses, but we will then have to reduce it to find the final answer. If we look a bit more into each of the two clauses, we can see that _S(c)_ of the first one is 2, whereas the specificity of the second one is 1. It is reasonable to assume that more specific clauses will return less data. This assumption may not always hold true, since it depends on the branching factor of our graph, but it is a good intuition on which to build the planner. ## Naive Specificity-Based Query planner BQL uses a pretty simple planner. It does not use any statistics about the graph queried. The main reason for it is that they may not be available. Remember that the details of the storage are abstracted away by the ```storage``` package. However, even with such constraints, we can build a pretty efficient planner that will work efficiently across a wide variety of reasonable connected graphs. The planner (P) will try to satisfy a pattern following the steps described below: 1. P will create a graph based on the WHERE clauses. 2. P will add an edge between two clauses if they share a binding. The edge will be directed if and only if the two clauses have different specificity. The direction will go from higher specificity clause to lower specificity one. 3. It will start with a specificity level set to 3. 4. Using the constructed graph, it will concurrently attempt to satisfy all clauses with _S(c)_ equal to the current specificity level. 5. Collect all the binding values. 6. If any of the clauses could not be satisfied, the planner will dictate query finalization and pattern unsatisfiability. 7. If multiple bindings are available, all possible combinations will be considered during the binding iteration process. 8. The specificity level will be decreased by 1. 9. If the specificity level is greater than or equal to 0, the planner will proceed to step 5. If the process is not aborted in the middle, the pattern is satisfied and the query will return all the values that were bound in the process as a simple table.
{ "content_hash": "5deb9ab3a70e36633e86edf6c61e6f6e", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 92, "avg_line_length": 52.91503267973856, "alnum_prop": 0.7197381422924901, "repo_name": "google/badwolf", "id": "af48eb6a2aa206e930707dad7fb4f91247f339e3", "size": "8130", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/bql_query_planner.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "914549" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset=utf-8> <title>1 nips-2004-A Cost-Shaping LP for Bellman Error Minimization with Performance Guarantees</title> </head> <body> <p><a title="nips" href="../nips_home.html">nips</a> <a title="nips-2004" href="../home/nips2004_home.html">nips2004</a> <a title="nips-2004-1" href="../nips2004/nips-2004-A_Cost-Shaping_LP_for_Bellman_Error_Minimization_with_Performance_Guarantees.html">nips2004-1</a> <a title="nips-2004-1-reference" href="#">nips2004-1-reference</a> knowledge-graph by maker-knowledge-mining</p><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- maker adsense --> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-5027806277543591" data-ad-slot="4192012269"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <h1>1 nips-2004-A Cost-Shaping LP for Bellman Error Minimization with Performance Guarantees</h1> <br/><p>Source: <a title="nips-2004-1-pdf" href="http://papers.nips.cc/paper/2621-a-cost-shaping-lp-for-bellman-error-minimization-with-performance-guarantees.pdf">pdf</a></p><p>Author: Daniela D. Farias, Benjamin V. Roy</p><p>Abstract: We introduce a new algorithm based on linear programming that approximates the differential value function of an average-cost Markov decision process via a linear combination of pre-selected basis functions. The algorithm carries out a form of cost shaping and minimizes a version of Bellman error. We establish an error bound that scales gracefully with the number of states without imposing the (strong) Lyapunov condition required by its counterpart in [6]. We propose a path-following method that automates selection of important algorithm parameters which represent counterparts to the “state-relevance weights” studied in [6]. 1</p><br/> <h2>reference text</h2><p>[1] D. Adelman, “A Price-Directed Approach to Stochastic Inventory/Routing,” preprint, 2002, to appear in Operations Research.</p> <p>[2] L. C. Baird, “Residual Algorithms: Reinforcement Learning with Function Approximation,” ICML, 1995.</p> <p>[3] D. P. Bertsekas and J. N. Tsitsiklis, Neuro-Dynamic Programming, Athena Scientific, Bellmont, MA, 1996.</p> <p>[4] D. P. Bertsekas, Dynamic Programming and Optimal Control, second edition, Athena Scientific, Bellmont, MA, 2001.</p> <p>[5] J. A. Boyan and A. W. Moore, “Generalization in Reinforcement Learning: Safely Approximating the Value Function,” NIPS, 1995.</p> <p>[6] D. P. de Farias and B. Van Roy, “The Linear Programming Approach to Approximate Dynamic Programming,” Operations Research, Vol. 51, No. 6, November-December 2003, pp. 850-865. Preliminary version appeared in NIPS, 2001.</p> <p>[7] D. P. de Farias and B. Van Roy, “On Constraint Sampling in the Linear Programming Approach to Approximate Dynamic Programming,” Mathematics of Operations Research, Vol. 29, No. 3, 2004, pp. 462–478.</p> <p>[8] D.P. de Farias and B. Van Roy, “Approximate Linear Programming for Average-Cost Dynamic Programming,” NIPS, 2003.</p> <p>[9] C. B. Garcia and W. I. Zangwill, Pathways to Solutions, Fixed Points, and Equilibria, Prentice-Hall, Englewood Cliffs, NJ, 1981.</p> <p>[10] G. J. Gordon, “Stable Function Approximation in Dynamic Programming,” ICML, 1995.</p> <p>[11] C. Guestrin, D. Koller, R. Parr, and S. Venkataraman, “Efficient Solution Algorithms for Factored MDPs,” Journal of Artificial Intelligence Research, Volume 19, 2003, pp. 399-468. Preliminary version appeared in NIPS, 2001.</p> <p>[12] M. E. Harmon, L. C. Baird, and A. H. Klopf, “Advantage Updating Applied to a Differential Game,” NIPS 1995.</p> <p>[13] R. Munos, “Error Bounds for Approximate Policy Iteration,” ICML, 2003.</p> <p>[14] J. N. Tsitsiklis and B. Van Roy, “Feature-Based Methods for Large Scale Dynamic Programming,” Machine Learning, Vol. 22, 1996, pp. 59-94.</p> <p>[15] D. Schuurmans and R. Patrascu, “Direct Value Approximation for Factored MDPs,” NIPS, 2001.</p> <p>[16] P. J. Schweitzer and A. Seidman, “Generalized Polynomial Approximation in Markovian Decision Processes,” Journal of Mathematical Analysis and Applications, Vol. 110, ‘985, pp. 568-582.</p> <br/> <br/><br/><br/> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-48522588-1', 'makerhacker.github.io'); ga('send', 'pageview'); </script> </body> </html>
{ "content_hash": "af517d78dd724491df50e9ab3c47bb73", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 879, "avg_line_length": 93.14, "alnum_prop": 0.7335194331114452, "repo_name": "makerhacker/makerhacker.github.io", "id": "c614bb541b1186cdd2369e3dad515e3b68b8ffc4", "size": "4731", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "paper-mining/nips/nips2004_reference/nips-2004-A_Cost-Shaping_LP_for_Bellman_Error_Minimization_with_Performance_Guarantees_reference.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "13017" }, { "name": "JavaScript", "bytes": "2091" } ], "symlink_target": "" }
<?php namespace CultuurNet\UDB3\Label\ValueObjects; use ValueObjects\StringLiteral\StringLiteral; /** * Class LabelName * @package CultuurNet\UDB3\Label\ValueObjects */ class LabelName extends StringLiteral { /** * @param string $value */ public function __construct($value) { if (is_string($value)) { $value = trim($value); } parent::__construct($value); if (false !== strpos($value, ';')) { throw new \InvalidArgumentException( "Value for argument $value should not contain semicolons." ); } $length = mb_strlen($value); if ($length < 2) { throw new \InvalidArgumentException( "Value for argument $value should not be shorter than 2 chars." ); } if ($length > 255) { throw new \InvalidArgumentException( "Value for argument $value should not be longer than 255 chars." ); } } }
{ "content_hash": "6e98413a84a1a5ce62d9441bab841702", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 80, "avg_line_length": 23.906976744186046, "alnum_prop": 0.546692607003891, "repo_name": "cultuurnet/udb3-php", "id": "10be520517153f9815030e9c69b83b2baa3dfbb3", "size": "1028", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Label/ValueObjects/LabelName.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "2774366" } ], "symlink_target": "" }
/* Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012 */ .select2-container { position: relative; display: inline-block; /* inline-block for ie7 */ zoom: 1; *display: inline; vertical-align: top; padding: 0; border: 0; } /* To override styles found in Bootstrap3 */ .select2-container:hover { border: 0; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .select2-container, .select2-drop, .select2-search, .select2-search input{ /* Force border-box so that % widths fit the parent container without overlap because of margin/padding. More Info : http://www.quirksmode.org/css/box.html */ -moz-box-sizing: border-box; /* firefox */ -ms-box-sizing: border-box; /* ie */ -webkit-box-sizing: border-box; /* webkit */ -khtml-box-sizing: border-box; /* konqueror */ box-sizing: border-box; /* css3 */ } .select2-container .select2-choice { display: block; /* ? */ overflow: hidden; text-decoration: none; padding: 4px 12px; margin: 0; color: #333; text-shadow: 0 1px 0 #fff; white-space: nowrap; font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 13px; cursor: default; height: 18px; background-color: #f3f3f3; background-image: -moz-linear-gradient(top, #f5f5f5, #f1f1f1); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f1f1f1)); background-image: -webkit-linear-gradient(top, #f5f5f5, #f1f1f1); background-image: -o-linear-gradient(top, #f5f5f5, #f1f1f1); background-image: linear-gradient(to bottom, #f5f5f5, #f1f1f1); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff1f1f1', GradientType=0); -webkit-background-clip: padding; -moz-background-clip: padding; background-clip: padding; border: 1px solid #dcdcdc; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; -moz-box-sizing: content-box; /* firefox */ -ms-box-sizing: content-box; /* ie */ -webkit-box-sizing: content-box; /* webkit */ -khtml-box-sizing: content-box; /* konqueror */ box-sizing: content-box; /* css3 */ } .select2-container .select2-choice:hover { color: #333; text-shadow: none; border-color: #c6c6c6; background-color: #f5f5f5; background-image: -moz-linear-gradient(top, #f8f8f8, #f1f1f1); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f8f8f8), to(#f1f1f1)); background-image: -webkit-linear-gradient(top, #f8f8f8, #f1f1f1); background-image: -o-linear-gradient(top, #f8f8f8, #f1f1f1); background-image: linear-gradient(to bottom, #f8f8f8, #f1f1f1); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff8f8f8', endColorstr='#fff1f1f1', GradientType=0); -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); background-position: 0 0; -webkit-transition: none; -moz-transition: none; -o-transition: none; transition: none; z-index: 2; } .select2-container-active .select2-choice:hover { border: 1px solid #4D90FE; } .select2-container.select2-drop-above .select2-choice { background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white)); background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%); background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%); background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%); background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%); } .select2-container .select2-choice span { margin-right: 26px; display: block; overflow: hidden; white-space: nowrap; -o-text-overflow: ellipsis; -ms-text-overflow: ellipsis; text-overflow: ellipsis; } .select2-container .select2-choice abbr { display: block; position: absolute; right: 26px; top: 8px; width: 12px; height: 12px; font-size: 17px; line-height: 16px; color: #595959; font-weight: 700; cursor: pointer; text-decoration: none; border:0; outline: 0; } .select2-container .select2-choice abbr:hover { color: #222; cursor: pointer; } .select2-drop-mask { position: absolute; left: 0; top: 0; z-index: 9998; opacity: 0; } .select2-drop { background: #fff; color: #000; border: 1px solid #aaa; position: absolute; top: 100%; -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, .2); -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, .2); -o-box-shadow: 0 2px 4px rgba(0, 0, 0, .2); box-shadow: 0 2px 4px rgba(0, 0, 0, .2); z-index: 9999; width:100%; margin-top:1px; } .select2-drop.select2-drop-above { margin-top: -1px; -webkit-box-shadow: 0 -2px 4px rgba(0, 0, 0, .2); -moz-box-shadow: 0 -2px 4px rgba(0, 0, 0, .2); -o-box-shadow: 0 -2px 4px rgba(0, 0, 0, .2); box-shadow: 0 -2px 4px rgba(0, 0, 0, .2); } .select2-container .select2-choice div { -webkit-border-radius: 0 2px 2px 0; -moz-border-radius: 0 2px 2px 0; border-radius: 0 2px 2px 0; -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box; position: absolute; right: 0; top: 0; display: block; height: 100%; width: 18px; } .select2-container .select2-choice div b { background: url('../img/select2.png') no-repeat -30px 2px; display: block; width: 100%; height: 100%; } .select2-search { display: inline-block; white-space: nowrap; z-index: 10000; min-height: 26px; width: 100%; margin: 0; padding: 4px 4px 0 4px; } .select2-search-hidden { display: block; position: absolute; left: -10000px; } .select2-search input { background: #fff url('../img/select2.png') no-repeat 100% -22px; background: url('../img/select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); background: url('../img/select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); background: url('../img/select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); background: url('../img/select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); background: url('../img/select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); background: url('../img/select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%); padding: 4px 20px 4px 5px; outline: 0; border: 1px solid #aaa; font-family: sans-serif; font-size: 1em; width:100%; margin:0; height:auto !important; min-height: 26px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; } .select2-drop.select2-drop-above .select2-search input { margin-top:4px; } .select2-search input.select2-active { background: #fff url('../img/spinner.gif') no-repeat 100%; background: url('../img/spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); background: url('../img/spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); background: url('../img/spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); background: url('../img/spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); background: url('../img/spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); background: url('../img/spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%); } .select2-container-active .select2-choice, .select2-container-active .select2-choices { border: 1px solid #4D90FE; outline: none; } .select2-dropdown-open .select2-choice, .select2-dropdown-open .select2-choice:hover { /* border: 1px solid #aaa; border-bottom-color: transparent; -webkit-border-bottom-left-radius : 0; -webkit-border-bottom-right-radius: 0; -moz-border-radius-bottomleft : 0; -moz-border-radius-bottomright: 0; border-bottom-left-radius : 0; border-bottom-right-radius: 0; */ background-color: #f4f4f4; background-image: -moz-linear-gradient(top, #f6f6f6, #f1f1f1); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#f1f1f1)); background-image: -webkit-linear-gradient(top, #f6f6f6, #f1f1f1); background-image: -o-linear-gradient(top, #f6f6f6, #f1f1f1); background-image: linear-gradient(to bottom, #f6f6f6, #f1f1f1); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff6f6f6', endColorstr='#fff1f1f1', GradientType=0); -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .select2-dropdown-open .select2-choice div { background: transparent; border-left: none; } .select2-dropdown-open .select2-choice div b { } /* results */ .select2-results { margin: 4px 1px 4px 0; padding: 0; position: relative; overflow-x: hidden; overflow-y: auto; max-height: 200px; } .select2-results ul.select2-result-sub { margin: 0 0 0 0; } .select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px } .select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px } .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px } .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px } .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px } .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px } .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px } .select2-results li { list-style: none; display: list-item; } .select2-results li.select2-result-with-children > .select2-result-label { font-weight: bold; } .select2-results .select2-result-label { padding: 3px 7px 4px; margin: 0; cursor: pointer; } .select2-results .select2-highlighted { background: #eee; /*color: #fff;*/ } .select2-results li em { background: #feffde; font-style: normal; } .select2-results .select2-highlighted em { background: transparent; } .select2-results .select2-no-results, .select2-results .select2-searching, .select2-results .select2-selection-limit { background: #f4f4f4; display: list-item; padding-left: 4px; } /* disabled look for already selected choices in the results dropdown .select2-results .select2-disabled.select2-highlighted { color: #666; background: #f4f4f4; display: list-item; cursor: default; } .select2-results .select2-disabled { background: #f4f4f4; display: list-item; cursor: default; } */ .select2-results .select2-disabled { display: none; } .select2-more-results.select2-active { background: #f4f4f4 url('../img/spinner.gif') no-repeat 100%; } .select2-more-results { background: #f4f4f4; display: list-item; } /* disabled styles */ .select2-container.select2-container-disabled .select2-choice { color: #b3b3b3; border-color: #d9d9d9; background-color: #e6e6e6; background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; text-shadow: none; cursor: default; } .select2-container.select2-container-disabled .select2-choice div { opacity: 0.5; filter:alpha(opacity=50); } /* multiselect */ .select2-container-multi .select2-choices { background-color: #fff; border: 1px solid #d9d9d9; border-top: 1px solid #c0c0c0; -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px; margin: 0; padding: 0; cursor: text; overflow: hidden; height: auto !important; height: 1%; position: relative; } .select2-container-multi .select2-choices:hover { border: 1px solid #b9b9b9; border-top: 1px solid #a0a0a0; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .select2-container-multi .select2-choices { min-height: 26px; } .select2-container-multi.select2-container-active .select2-choices { border: 1px solid #4D90FE; outline: none; } .select2-container-multi .select2-choices li { float: left; list-style: none; } .select2-container-multi .select2-choices .select2-search-field { white-space: nowrap; margin: 0; padding: 0; } .select2-container-multi .select2-choices .select2-search-field input { color: #666; background: transparent !important; font-family: sans-serif; font-size: 100%; height: 23px; padding: 5px; margin: 1px 0; outline: 0; border: 0; -webkit-box-shadow: none; -moz-box-shadow : none; -o-box-shadow : none; box-shadow : none; } .select2-container-multi .select2-choices .select2-search-field input.select2-active { background: #fff url('../img/spinner.gif') no-repeat 100% !important; } .select2-default { color: #999 !important; } .select2-container-multi .select2-choices .select2-search-choice { -webkit-border-radius: 2px; -moz-border-radius : 2px; border-radius : 2px; -moz-background-clip : padding; -webkit-background-clip: padding-box; background-clip : padding-box; background-color: #DAE4F6; color: #222; font-family: Arial; border: 1px solid #DAE4F6; line-height: 23px; padding: 0 19px 0 5px; margin: 1px; position: relative; cursor: default; } .select2-container-multi .select2-choices .select2-search-choice span { cursor: default; } .select2-container-multi .select2-choices .select2-search-choice-focus { background: #A6D7F5; } .select2-search-choice-close { display: block; position: absolute; right: 3px; top: 4px; width: 12px; height: 13px; font-size: 17px; line-height: 16px; color: #444; font-weight: 700; outline: none; } .select2-search-choice-close:hover { text-decoration: none; color: #222; cursor: pointer; } /* disabled styles */ .select2-container-multi.select2-container-disabled .select2-choices{ background-color: #f4f4f4; background-image: none; border: 1px solid #ddd; cursor: default; } .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice { background-image: none; background-color: #f4f4f4; border: 1px solid #ddd; padding: 3px 5px 3px 5px; } .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none; } /* end multiselect */ .select2-result-selectable .select2-match, .select2-result-unselectable .select2-result-selectable .select2-match { font-weight: bold; /*text-decoration: underline;*/ } .select2-result-unselectable .select2-match { text-decoration: none; } .select2-offscreen { position: absolute; left: -10000px; } /** Scrollbars */ .select2-results::-webkit-scrollbar { height: 16px; width: 10px; } .select2-results::-webkit-scrollbar-button:start:decrement, .select2-results::-webkit-scrollbar-button:end:increment { background-color: transparent; display: block; height: 0; } .select2-results::-webkit-scrollbar-track { background-clip: padding-box; border: solid transparent; border-width: 0 0 0 4px; } .select2-results::-webkit-scrollbar-track-piece { background-color: transparent; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .select2-results::-webkit-scrollbar:hover { background-color: #f3f3f3; border: 1px solid #dbdbdb; } .select2-results::-webkit-scrollbar-thumb:vertical, .select2-results::-webkit-scrollbar-thumb:horizontal { background-color: #c6c6c6; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .select2-results::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.2); border: solid transparent; border-width: 0; -webkit-box-shadow: inset 1px 1px 0 rgba(0,0,0,0.10),inset 0 -1px 0 rgba(0,0,0,0.07); -moz-box-shadow: inset 1px 1px 0 rgba(0,0,0,0.10),inset 0 -1px 0 rgba(0,0,0,0.07); box-shadow: inset 1px 1px 0 rgba(0,0,0,0.10),inset 0 -1px 0 rgba(0,0,0,0.07); background-clip: padding-box; } .select2-results::-webkit-scrollbar-thumb:hover { background-color: #949494; } .select2-results::-webkit-scrollbar-thumb:active { background-color: rgba(0, 0, 0, 0.5); -webkit-box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.35); -moz-box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.35); box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.35); } /* Retina-ize icons */ @media only screen and (-webkit-min-device-pixel-ratio: 1.5) { .select2-search input, .select2-container .select2-choice div b { background-image: url('../img/select2x2.png') !important; background-repeat: no-repeat !important; background-size: 60px 40px !important; } .select2-search input { background-position: 100% -21px !important; } }
{ "content_hash": "d6473a146a5226a22c6b0e21a0c83322", "timestamp": "", "source": "github", "line_count": 605, "max_line_length": 221, "avg_line_length": 30.06611570247934, "alnum_prop": 0.6817482133040131, "repo_name": "tommycuang/Tugas-Proyek", "id": "98e8ee901873cf1302d472fa0df3d48dd4e8937d", "size": "18190", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "public/bower_components/todc-bootstrap-main/docs-assets/css/select2.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "18437" }, { "name": "HTML", "bytes": "45606" }, { "name": "JavaScript", "bytes": "20833" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="http://www.knime.org/2008/09/XMLConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.knime.org/2008/09/XMLConfig http://www.knime.org/XMLConfig_2008_09.xsd" key="spec.xml"> <entry key="spec_name" type="xstring" value="Output data"/> <entry key="number_columns" type="xint" value="3"/> <config key="column_spec_0"> <entry key="column_name" type="xstring" value="Drug"/> <config key="element_names"> <entry key="array-size" type="xint" value="0"/> </config> <config key="column_type"> <entry key="cell_class" type="xstring" value="org.knime.core.data.def.StringCell"/> </config> <config key="column_domain"> <config key="possible_values"> <entry key="array-size" type="xint" value="5"/> <config key="0"> <entry key="datacell" type="xstring" value="org.knime.core.data.def.StringCell"/> <config key="org.knime.core.data.def.StringCell"> <entry key="StringCell" type="xstring" value="Clozapine"/> </config> </config> <config key="1"> <entry key="datacell" type="xstring" value="org.knime.core.data.def.StringCell"/> <config key="org.knime.core.data.def.StringCell"> <entry key="StringCell" type="xstring" value="Dasatinib"/> </config> </config> <config key="2"> <entry key="datacell" type="xstring" value="org.knime.core.data.def.StringCell"/> <config key="org.knime.core.data.def.StringCell"> <entry key="StringCell" type="xstring" value="Lumiracoxib"/> </config> </config> <config key="3"> <entry key="datacell" type="xstring" value="org.knime.core.data.def.StringCell"/> <config key="org.knime.core.data.def.StringCell"> <entry key="StringCell" type="xstring" value="Omeprazol"/> </config> </config> <config key="4"> <entry key="datacell" type="xstring" value="org.knime.core.data.def.StringCell"/> <config key="org.knime.core.data.def.StringCell"> <entry key="StringCell" type="xstring" value="Phenol"/> </config> </config> </config> </config> <config key="column_properties"/> </config> <config key="column_spec_1"> <entry key="column_name" type="xstring" value="smiles"/> <config key="element_names"> <entry key="array-size" type="xint" value="0"/> </config> <config key="column_type"> <entry key="cell_class" type="xstring" value="org.knime.chem.types.SmilesCell"/> </config> <config key="column_domain"/> <config key="column_properties"/> </config> <config key="column_spec_2"> <entry key="column_name" type="xstring" value="RDKit molecule"/> <config key="element_names"> <entry key="array-size" type="xint" value="0"/> </config> <config key="column_type"> <entry key="cell_class" type="xstring" value="org.rdkit.knime.types.RDKitAdapterCell"/> <config key="adapter_classes"> <entry key="array-size" type="xint" value="7"/> <entry key="0" type="xstring" value="org.rdkit.knime.types.RDKitMolValue"/> <entry key="1" type="xstring" value="org.knime.core.data.DataValue"/> <entry key="2" type="xstring" value="org.knime.chem.types.SdfValue"/> <entry key="3" type="xstring" value="org.knime.chem.types.SmilesValue"/> <entry key="4" type="xstring" value="org.knime.core.data.StringValue"/> <entry key="5" type="xstring" value="org.knime.core.data.RWAdapterValue"/> <entry key="6" type="xstring" value="org.knime.core.data.AdapterValue"/> </config> </config> <config key="column_domain"/> <config key="column_properties"/> </config> </config>
{ "content_hash": "924b612d270b32b4ef1225ee1d579e97", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 227, "avg_line_length": 40.670731707317074, "alnum_prop": 0.7112443778110945, "repo_name": "3D-e-Chem/knime-silicos-it", "id": "6cdef9d7abb16fcdb569865f8541504dacbddea3", "size": "3335", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "examples/strip-it/strip-it_example/RDKit From Molecule (#3)/port_1/spec.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "21292" } ], "symlink_target": "" }
package example.dagger; import dagger.Lazy; import javax.inject.Inject; /** A coffee maker to brew the coffee. */ public class CoffeeMaker { private final CoffeeLogger logger; private final Lazy<Heater> heater; // Create a possibly costly heater only when we use it. private final Pump pump; @Inject CoffeeMaker(CoffeeLogger logger, Lazy<Heater> heater, Pump pump) { this.logger = logger; this.heater = heater; this.pump = pump; } public void brew() { heater.get().on(); pump.pump(); logger.log(" [_]P coffee! [_]P "); heater.get().off(); } }
{ "content_hash": "7a0b3a0d3a00fb842d748370cda3bfe8", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 92, "avg_line_length": 21.962962962962962, "alnum_prop": 0.6627318718381113, "repo_name": "ze-pequeno/dagger", "id": "20c1f27a87cbf8adf67bc1f118376bbfb43d5878", "size": "1195", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "examples/maven/coffee/src/main/java/example/dagger/CoffeeMaker.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "5750471" }, { "name": "Kotlin", "bytes": "370075" }, { "name": "Python", "bytes": "409" }, { "name": "Shell", "bytes": "22477" }, { "name": "Starlark", "bytes": "411395" } ], "symlink_target": "" }
{% extends "base.html" %} {% block tag_header_additional_content %} <h1 class="title">{{ training_announcement.title }}</h1> <h2 class="subtitle">Get your friends to attend and avail discounts!</h2> {% endblock %} {% block tag_trunk_content %} <div class="info"> <table border="0" cellspacing="0" cellpadding="0"> <thead> <tr> <th>Faculty</th> <th>Venue</th> <th>From</th> <th>To</th> <th>Registration Closes</th> <th>Fee Structure</th> </tr> </thead> <tbody> <tr> <td>{{ training_announcement.faculty }}</td> <td>{{ training_announcement.venue }}</td> <td>{{ training_announcement.when_from|datetimeformat('%Y, %b %d, %H:%M') }}</td> <td>{{ training_announcement.when_to|datetimeformat('%Y, %b %d, %H:%M') }}</td> <td>{{ training_announcement.when_registration_ends|datetimeformat('%Y, %b %d') }}</td> <td> <ul> {% for fee in training_announcement.fees %} <li>{{ fee.fee }} for {{ fee.for_participant_count }} participants</li> {% endfor %} </ul> </td> </tr> </tbody> </table> <img src="{{ training_announcement.brochure_url }}" /> <form id="form_training_registration" class="decorated-fields table" method="post" action="/announcement/{{ training_announcement.key() }}/register/" key="{{ training_announcement.key() }}"> <input type="hidden" name="nominations_count" value="1" /> <fieldset id="nomination_1"> <legend>Nomination 1</legend> <label for="full_name_1"> <span class="prefix">full name</span> <input type="text" name="full_name_1" value="{{ user.nickname }}" class="required capitalize" /> <span class="suffix"></span> </label> <label for="company_1"> <span class="prefix">company</span> <input type="text" name="company_1" value="{{ person.company }}" class="required capitalize" /> <span class="suffix"></span> </label> <label for="designation_1"> <span class="prefix">designation</span> <input type="text" name="designation_1" value="{{ person.designation }}" class="required capitalize" /> <span class="suffix"></span> </label> <label for="email_1"> <span class="prefix">email</span> <input type="text" name="email_1" value="{{ user.email }}" class="required email" /> <span class="suffix"></span> </label> <label for="phone_number_1"> <span class="prefix">phone</span> <input type="text" name="phone_number_1" value="{{ phone_number }}" class="required phone" /> <span class="suffix"><a href="#add_nomination">Add nomination</a></span> </label> </fieldset> #*<label for="current_fee"> <span class="prefix">current fee</span> <input type="text" name="current_fee" readonly="readonly" value="" /> <span class="suffix"></span> </label> <label for="total_amount"> <span class="prefix">total amount</span> <input type="text" name="total_amount" readonly="readonly" value="" /> <span class="suffix"></span> </label>*# <label for="submit"> <span class="prefix"></span> <input type="submit" name="submit" value="&#10004; Complete Registration" /> <span class="suffix"></span> </label> </form> </div> {% endblock %} {% block tag_scripts %} <script type="text/javascript"> window.scripts.push( "{{ TEXT_MEDIA_URL }}script/page/training_announcement_registration{{ JS_MINIFIED }}.js" ); </script> {% endblock %}
{ "content_hash": "fdc090bf81c9f9b3defa12e52b602ca9", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 196, "avg_line_length": 38.78431372549019, "alnum_prop": 0.531850353892821, "repo_name": "yesudeep/mils-secure", "id": "17431ade40755e5df9488d321794f56af759e4f9", "size": "3956", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "templates/training_announcement_registration.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "5795" }, { "name": "D", "bytes": "336977" }, { "name": "Emacs Lisp", "bytes": "8399" }, { "name": "JavaScript", "bytes": "498456" }, { "name": "Python", "bytes": "2504408" }, { "name": "Ruby", "bytes": "294" }, { "name": "Shell", "bytes": "246" }, { "name": "VimL", "bytes": "5813" } ], "symlink_target": "" }
#include "third_party/libjingle_xmpp/xmllite/xmlelement.h" #include <ostream> #include <sstream> #include <string> #include <vector> #include "base/check.h" #include "third_party/libjingle_xmpp/xmllite/qname.h" #include "third_party/libjingle_xmpp/xmllite/xmlbuilder.h" #include "third_party/libjingle_xmpp/xmllite/xmlconstants.h" #include "third_party/libjingle_xmpp/xmllite/xmlparser.h" #include "third_party/libjingle_xmpp/xmllite/xmlprinter.h" namespace jingle_xmpp { XmlChild::~XmlChild() { } bool XmlText::IsTextImpl() const { return true; } XmlElement* XmlText::AsElementImpl() const { return NULL; } XmlText* XmlText::AsTextImpl() const { return const_cast<XmlText *>(this); } void XmlText::SetText(const std::string& text) { text_ = text; } void XmlText::AddParsedText(const char* buf, int len) { text_.append(buf, len); } void XmlText::AddText(const std::string& text) { text_ += text; } XmlText::~XmlText() { } XmlElement::XmlElement(const QName& name) : name_(name), first_attr_(NULL), last_attr_(NULL), first_child_(NULL), last_child_(NULL), cdata_(false) { } XmlElement::XmlElement(const XmlElement& elt) : XmlChild(), name_(elt.name_), first_attr_(NULL), last_attr_(NULL), first_child_(NULL), last_child_(NULL), cdata_(false) { // copy attributes XmlAttr* attr; XmlAttr ** plast_attr = &first_attr_; XmlAttr* newAttr = NULL; for (attr = elt.first_attr_; attr; attr = attr->NextAttr()) { newAttr = new XmlAttr(*attr); *plast_attr = newAttr; plast_attr = &(newAttr->next_attr_); } last_attr_ = newAttr; // copy children XmlChild* pChild; XmlChild ** ppLast = &first_child_; XmlChild* newChild = NULL; for (pChild = elt.first_child_; pChild; pChild = pChild->NextChild()) { if (pChild->IsText()) { newChild = new XmlText(*(pChild->AsText())); } else { newChild = new XmlElement(*(pChild->AsElement())); } *ppLast = newChild; ppLast = &(newChild->next_child_); } last_child_ = newChild; cdata_ = elt.cdata_; } XmlElement::XmlElement(const QName& name, bool useDefaultNs) : name_(name), first_attr_(useDefaultNs ? new XmlAttr(QN_XMLNS, name.Namespace()) : NULL), last_attr_(first_attr_), first_child_(NULL), last_child_(NULL), cdata_(false) { } bool XmlElement::IsTextImpl() const { return false; } XmlElement* XmlElement::AsElementImpl() const { return const_cast<XmlElement *>(this); } XmlText* XmlElement::AsTextImpl() const { return NULL; } const std::string XmlElement::BodyText() const { if (first_child_ && first_child_->IsText() && last_child_ == first_child_) { return first_child_->AsText()->Text(); } return std::string(); } void XmlElement::SetBodyText(const std::string& text) { if (text.empty()) { ClearChildren(); } else if (first_child_ == NULL) { AddText(text); } else if (first_child_->IsText() && last_child_ == first_child_) { first_child_->AsText()->SetText(text); } else { ClearChildren(); AddText(text); } } const QName XmlElement::FirstElementName() const { const XmlElement* element = FirstElement(); if (element == NULL) return QName(); return element->Name(); } XmlAttr* XmlElement::FirstAttr() { return first_attr_; } const std::string XmlElement::Attr(const StaticQName& name) const { XmlAttr* attr; for (attr = first_attr_; attr; attr = attr->next_attr_) { if (attr->name_ == name) return attr->value_; } return std::string(); } const std::string XmlElement::Attr(const QName& name) const { XmlAttr* attr; for (attr = first_attr_; attr; attr = attr->next_attr_) { if (attr->name_ == name) return attr->value_; } return std::string(); } bool XmlElement::HasAttr(const StaticQName& name) const { XmlAttr* attr; for (attr = first_attr_; attr; attr = attr->next_attr_) { if (attr->name_ == name) return true; } return false; } bool XmlElement::HasAttr(const QName& name) const { XmlAttr* attr; for (attr = first_attr_; attr; attr = attr->next_attr_) { if (attr->name_ == name) return true; } return false; } void XmlElement::SetAttr(const QName& name, const std::string& value) { XmlAttr* attr; for (attr = first_attr_; attr; attr = attr->next_attr_) { if (attr->name_ == name) break; } if (!attr) { attr = new XmlAttr(name, value); if (last_attr_) last_attr_->next_attr_ = attr; else first_attr_ = attr; last_attr_ = attr; return; } attr->value_ = value; } void XmlElement::ClearAttr(const QName& name) { XmlAttr* attr; XmlAttr* last_attr = NULL; for (attr = first_attr_; attr; attr = attr->next_attr_) { if (attr->name_ == name) break; last_attr = attr; } if (!attr) return; if (!last_attr) first_attr_ = attr->next_attr_; else last_attr->next_attr_ = attr->next_attr_; if (last_attr_ == attr) last_attr_ = last_attr; delete attr; } XmlChild* XmlElement::FirstChild() { return first_child_; } XmlElement* XmlElement::FirstElement() { XmlChild* pChild; for (pChild = first_child_; pChild; pChild = pChild->next_child_) { if (!pChild->IsText()) return pChild->AsElement(); } return NULL; } XmlElement* XmlElement::NextElement() { XmlChild* pChild; for (pChild = next_child_; pChild; pChild = pChild->next_child_) { if (!pChild->IsText()) return pChild->AsElement(); } return NULL; } XmlElement* XmlElement::FirstWithNamespace(const std::string& ns) { XmlChild* pChild; for (pChild = first_child_; pChild; pChild = pChild->next_child_) { if (!pChild->IsText() && pChild->AsElement()->Name().Namespace() == ns) return pChild->AsElement(); } return NULL; } XmlElement * XmlElement::NextWithNamespace(const std::string& ns) { XmlChild* pChild; for (pChild = next_child_; pChild; pChild = pChild->next_child_) { if (!pChild->IsText() && pChild->AsElement()->Name().Namespace() == ns) return pChild->AsElement(); } return NULL; } XmlElement * XmlElement::FirstNamed(const QName& name) { XmlChild* pChild; for (pChild = first_child_; pChild; pChild = pChild->next_child_) { if (!pChild->IsText() && pChild->AsElement()->Name() == name) return pChild->AsElement(); } return NULL; } XmlElement * XmlElement::FirstNamed(const StaticQName& name) { XmlChild* pChild; for (pChild = first_child_; pChild; pChild = pChild->next_child_) { if (!pChild->IsText() && pChild->AsElement()->Name() == name) return pChild->AsElement(); } return NULL; } XmlElement * XmlElement::NextNamed(const QName& name) { XmlChild* pChild; for (pChild = next_child_; pChild; pChild = pChild->next_child_) { if (!pChild->IsText() && pChild->AsElement()->Name() == name) return pChild->AsElement(); } return NULL; } XmlElement * XmlElement::NextNamed(const StaticQName& name) { XmlChild* pChild; for (pChild = next_child_; pChild; pChild = pChild->next_child_) { if (!pChild->IsText() && pChild->AsElement()->Name() == name) return pChild->AsElement(); } return NULL; } XmlElement* XmlElement::FindOrAddNamedChild(const QName& name) { XmlElement* child = FirstNamed(name); if (!child) { child = new XmlElement(name); AddElement(child); } return child; } const std::string XmlElement::TextNamed(const QName& name) const { XmlChild* pChild; for (pChild = first_child_; pChild; pChild = pChild->next_child_) { if (!pChild->IsText() && pChild->AsElement()->Name() == name) return pChild->AsElement()->BodyText(); } return std::string(); } void XmlElement::InsertChildAfter(XmlChild* predecessor, XmlChild* next) { if (predecessor == NULL) { next->next_child_ = first_child_; first_child_ = next; } else { next->next_child_ = predecessor->next_child_; predecessor->next_child_ = next; } } void XmlElement::RemoveChildAfter(XmlChild* predecessor) { XmlChild* next; if (predecessor == NULL) { next = first_child_; first_child_ = next->next_child_; } else { next = predecessor->next_child_; predecessor->next_child_ = next->next_child_; } if (last_child_ == next) last_child_ = predecessor; delete next; } void XmlElement::AddAttr(const QName& name, const std::string& value) { DCHECK(!HasAttr(name)); XmlAttr ** pprev = last_attr_ ? &(last_attr_->next_attr_) : &first_attr_; last_attr_ = (*pprev = new XmlAttr(name, value)); } void XmlElement::AddAttr(const QName& name, const std::string& value, int depth) { XmlElement* element = this; while (depth--) { element = element->last_child_->AsElement(); } element->AddAttr(name, value); } void XmlElement::AddParsedText(const char* cstr, int len) { if (len == 0) return; if (last_child_ && last_child_->IsText()) { last_child_->AsText()->AddParsedText(cstr, len); return; } XmlChild ** pprev = last_child_ ? &(last_child_->next_child_) : &first_child_; last_child_ = *pprev = new XmlText(cstr, len); } void XmlElement::AddCDATAText(const char* buf, int len) { cdata_ = true; AddParsedText(buf, len); } void XmlElement::AddText(const std::string& text) { if (text == STR_EMPTY) return; if (last_child_ && last_child_->IsText()) { last_child_->AsText()->AddText(text); return; } XmlChild ** pprev = last_child_ ? &(last_child_->next_child_) : &first_child_; last_child_ = *pprev = new XmlText(text); } void XmlElement::AddText(const std::string& text, int depth) { // note: the first syntax is ambigious for msvc 6 // XmlElement* pel(this); XmlElement* element = this; while (depth--) { element = element->last_child_->AsElement(); } element->AddText(text); } void XmlElement::AddElement(XmlElement *child) { if (child == NULL) return; XmlChild ** pprev = last_child_ ? &(last_child_->next_child_) : &first_child_; *pprev = child; last_child_ = child; child->next_child_ = NULL; } void XmlElement::AddElement(XmlElement *child, int depth) { XmlElement* element = this; while (depth--) { element = element->last_child_->AsElement(); } element->AddElement(child); } void XmlElement::ClearNamedChildren(const QName& name) { XmlChild* prev_child = NULL; XmlChild* next_child; XmlChild* child; for (child = FirstChild(); child; child = next_child) { next_child = child->NextChild(); if (!child->IsText() && child->AsElement()->Name() == name) { RemoveChildAfter(prev_child); continue; } prev_child = child; } } void XmlElement::ClearAttributes() { XmlAttr* attr; for (attr = first_attr_; attr; ) { XmlAttr* to_delete = attr; attr = attr->next_attr_; delete to_delete; } first_attr_ = last_attr_ = NULL; } void XmlElement::ClearChildren() { XmlChild* pchild; for (pchild = first_child_; pchild; ) { XmlChild* to_delete = pchild; pchild = pchild->next_child_; delete to_delete; } first_child_ = last_child_ = NULL; } std::string XmlElement::Str() const { std::stringstream ss; XmlPrinter::PrintXml(&ss, this); return ss.str(); } XmlElement* XmlElement::ForStr(const std::string& str) { XmlBuilder builder; XmlParser::ParseXml(&builder, str); return builder.CreateElement(); } XmlElement::~XmlElement() { XmlAttr* attr; for (attr = first_attr_; attr; ) { XmlAttr* to_delete = attr; attr = attr->next_attr_; delete to_delete; } XmlChild* pchild; for (pchild = first_child_; pchild; ) { XmlChild* to_delete = pchild; pchild = pchild->next_child_; delete to_delete; } } } // namespace jingle_xmpp
{ "content_hash": "8f422f3de3667d40a246b99ef98b23e0", "timestamp": "", "source": "github", "line_count": 488, "max_line_length": 80, "avg_line_length": 23.92827868852459, "alnum_prop": 0.6363792069880962, "repo_name": "ric2b/Vivaldi-browser", "id": "490069449e554e06026e42f9244625b9c5001426", "size": "12085", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "chromium/third_party/libjingle_xmpp/xmllite/xmlelement.cc", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
module ActionDispatch module Routing class RouteSet if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR == 1 def url_for_with_storytime(options = {}) Storytime::PostUrlHandler.handle_url(options) url_for_without_storytime(options) end else def url_for_with_storytime(options, route_name = nil, url_strategy = UNKNOWN) Storytime::PostUrlHandler.handle_url(options) url_for_without_storytime(options, route_name, url_strategy) end end alias_method_chain :url_for, :storytime end end end
{ "content_hash": "5d1d5f897e7ba0f5d60d7f9efc735fc6", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 85, "avg_line_length": 28.523809523809526, "alnum_prop": 0.6360601001669449, "repo_name": "braindeaf/storytime", "id": "1e8b13ddf7fa8ec0167132c1171277be91adddd5", "size": "599", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/initializers/url_for_patch.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "16734" }, { "name": "CoffeeScript", "bytes": "25911" }, { "name": "HTML", "bytes": "99252" }, { "name": "JavaScript", "bytes": "2573" }, { "name": "Ruby", "bytes": "263744" } ], "symlink_target": "" }
__author__="Ashish Hunnargikar" __date__ ="$Jun 13, 2014 12:33:33 PM$" import time import os import subprocess from datetime import date, timedelta from elasticsearch.transport import Transport from elasticsearch import (Elasticsearch, RoundRobinSelector, ImproperlyConfigured, ElasticsearchException, SerializationError, TransportError, NotFoundError, ConflictError, RequestError, ConnectionError) import simplejson as json from kazoo.client import KazooClient from kazoo.exceptions import (KazooException) os.environ['DEBUG'] = 'true' #os.environ['CRON'] = '180' #os.environ['DAYS'] = '1' # ##Zookeeper #os.environ['ZK_ADDRESS'] = 'zookeeper1:2181,zookeeper2:2181,zookeeper3:2181' # ##Elasticsearch #os.environ['ES_CLUSTER'] = 'elasticsearch' #os.environ['ES_ANALYTICS_INDEX'] = 'analytics' #os.environ['ES_ANALYTICS_TYPE'] = 'data' #os.environ['ES_REGISTRY_INDEX'] = 'docker_registry' #os.environ['ES_REGISTRY_TAG_TYPE'] = 'tags' #os.environ['ES_REGISTRY_IMAGE_TYPE'] = 'images' swift_env={ "OS_TENANT_ID":os.environ["OS_TENANT_ID"], "OS_USERNAME": os.environ["OS_USERNAME"], "OS_AUTH_URL": os.environ["OS_AUTH_URL"], "OS_TENANT_NAME": os.environ["OS_TENANT_NAME"], "OS_CONTAINER": os.environ["OS_CONTAINER"], "OS_REGION_NAME": os.environ["OS_REGION_NAME"], "OS_PASSWORD": os.environ["OS_PASSWORD"], "STORAGE_PATH": os.environ["STORAGE_PATH"] } es = None import traceback def log(data): """ Print debug output """ if (os.environ['DEBUG'] == 'true'): print(data + '\n') def multi_get_from_es_index(index, doc_type, body, _source, fields): """ Get the Elasticsearch index data for multiple ids @type documentList: List @param documentList: List of image layer JSON documents """ response = None #Try 3 times to read the document from ES, each time picking a random ES node address in case of failure for retries in range(3): try: response = es.mget(index=index, doc_type=doc_type, body=body, _source=_source, fields=fields) #log("ES Get Response :: " + json.dumps(response)) except ImproperlyConfigured: log("ES ImproperlyConfigured!" + traceback.format_exc()) continue except ElasticsearchException: log("ES ElasticsearchException!" + traceback.format_exc()) continue except TransportError: log("ES TransportError!" + traceback.format_exc()) continue except NotFoundError: log("ES NotFoundError!" + traceback.format_exc()) continue except ConflictError: log("ES ConflictError!" + traceback.format_exc()) continue except RequestError: log("ES RequestError!" + traceback.format_exc()) continue except SerializationError: log("ES SerializationError!" + traceback.format_exc()) continue except ConnectionError: log("ES ConnectionError!" + traceback.format_exc()) continue except Exception: log("ES Exception!" + traceback.format_exc()) continue finally: log("Total number of ES read attempts: " + str(retries + 1)) #Exit for loop if ES transaction is successful otherwise pick another node and continue retrying break return response def set_in_index(es, document, index, type): """ Store the list of documents in the Elasticsearch index via HTTP APIs @type document: List @param document: JSON document """ response = None #Try 3 times to store the document in ES, each time picking a random ES node address in case of failure for retries in range(3): try: document['epoch'] = int(time.time()) log('ES Set Request :: ' + json.dumps(document) + ' : ' + index + ':' + type) response = es.index(index=index, doc_type=type, id=document['id'], body=document) log("ES Set Response :: " + json.dumps(response)) except ImproperlyConfigured: log("ES ImproperlyConfigured!" + traceback.format_exc()) continue except ElasticsearchException: log("ES ElasticsearchException!" + traceback.format_exc()) continue except TransportError: log("ES TransportError!" + traceback.format_exc()) continue except NotFoundError: log("ES NotFoundError!" + traceback.format_exc()) continue except ConflictError: log("ES ConflictError!" + traceback.format_exc()) continue except RequestError: log("ES RequestError!" + traceback.format_exc()) continue except SerializationError: log("ES SerializationError!" + traceback.format_exc()) continue except ConnectionError: log("ES ConnectionError!" + traceback.format_exc()) continue except Exception: log("ES Exception!" + traceback.format_exc()) continue finally: log("Total number of ES write attempts: " + str(retries + 1)) #Exit for loop if ES transaction is successful otherwise pick another node and continue retrying break if response is None or response == '': log('Failed to store document ' + document['id'] + ' into the ES index') return 'false' else: log('Successfully stored document ' + document['id'] + ' into the ES index') return 'true' def get_es_node_addresses(): """ Get the Elasticsearch node addresses via Zookeeper @return List of Elasticsearch node ip addresses and ports """ zk = KazooClient(hosts=os.environ['ZK_ADDRESS'], timeout=10.0, randomize_hosts=True) zk.start() esNodes = [] try: #Fetch the list of ES cluster node names from Zookeeper zkPath = '/es/clusters/' + os.environ['ES_CLUSTER'] + '/json' children = zk.get_children(zkPath) #Retrieve the JSON metadata associated with each ephemeral ES node for node in children: zookeeperAddr = zkPath + '/' + node esNodeInfo = zk.get(zookeeperAddr) jsonData = json.loads(esNodeInfo[0]) #Collect each node ip address and port esNodes.append(jsonData['address'] + ':' + jsonData['port']) except KazooException: log('Kazoo Exception: Unable to fetch Zookeeper data from ' + zkPath + ' : ' + traceback.format_exc()); zk.stop() zk.close() log('ES Node list retrieved from Zookeeper :: ' + json.dumps(esNodes)) return esNodes def get_image_checksums_from_swift(namespace, repository): """ Get the registry image layer checksums JSON from Swift @return Image layer JSON object """ #swift download community-registry registry/images/09690291212c69ac94df172ed35634b5cacd8b52e015e9e81c974cecb8ecde05/json --output - swiftCommand = 'swift download ' + swift_env['OS_CONTAINER'] + ' ' + os.environ['SWIFT_REGISTRY_PREFIX'] + '/repositories/' + namespace + '/' + repository + '/_index_images --output -' p = subprocess.Popen([swiftCommand], stdout=subprocess.PIPE, shell=True, env=swift_env) output, error = p.communicate() log('Checksums json from Swift for image ' + namespace + '/' + repository + ' received....' + output) return json.loads(output) def get_image_json_from_swift(checksum): """ Get the registry image layer JSON from Swift @return Image layer JSON object """ #swift download community-registry registry/images/09690291212c69ac94df172ed35634b5cacd8b52e015e9e81c974cecb8ecde05/json --output - swiftCommand = 'swift download ' + swift_env['OS_CONTAINER'] + ' ' + os.environ['SWIFT_REGISTRY_PREFIX'] + '/images/' + checksum + '/json --output -' p = subprocess.Popen([swiftCommand], stdout=subprocess.PIPE, shell=True, env=swift_env) output, error = p.communicate() log('Image json from Swift for checksum ' + checksum + ' received....') return json.loads(output) def get_tag_checksum_from_swift(namespace, repository, tag): """ Get the registry Tag checksum from Swift @return Tag JSON object """ #swift download community-registry registry/repositories/paas/fe15c3d73f634f59904cde910500958b/tag_1408139458.3264 --output - swiftCommand = 'swift download ' + swift_env['OS_CONTAINER'] + ' ' + os.environ['SWIFT_REGISTRY_PREFIX'] + '/repositories/' + namespace + '/' + repository + '/tag_' + tag + ' --output -' p = subprocess.Popen([swiftCommand], stdout=subprocess.PIPE, shell=True, env=swift_env) output, error = p.communicate() log('Tag from Swift for ' + namespace + '/' + repository + '/' + tag + ' received....') return output def find_missing_tags_in_es_via_swift(es, days): """ Get the registry Tag names that are present in Swift but absent in the registry ES index @return List of Tag names """ #Get the list of tag paths in Swift created N days ago tagsList = get_swift_tags(es, days) #Now extract the namespace, repository and tag from each path into a JSON document docs = generate_tag_docs(tagsList) docsNotFound = {} if len(docs) > 0: #Get all the corresponding Tag ids available in the ES registry index #response = es.mget(index=os.environ['ES_REGISTRY_INDEX'], doc_type=os.environ['ES_REGISTRY_TAG_TYPE'], body={"ids" : docs.keys()}, _source=False, fields=[]) response = multi_get_from_es_index(index=os.environ['ES_REGISTRY_INDEX'], doc_type=os.environ['ES_REGISTRY_TAG_TYPE'], body={"ids" : docs.keys()}, _source=False, fields=[]) #Iterate over the ES response docs and find the registry tags that haven't been located in the ES index #ES sends us a "found=true/false" response attribute per doc so we only need the false ones for item in response['docs']: if item['found'] == False: docsNotFound[item['_id']] = docs.get(item['_id']) log(str(len(docsNotFound)) + ' missing tags identified in ES....') return docsNotFound def find_missing_images_in_es_via_swift(es, days): """ Get the registry Image names that are present in Swift but absent in the registry ES index @return List of image ids """ #Get the list of tag paths in Swift created N days ago imageList = get_swift_images(es, days) #Now extract the namespace and repository from each image path into a JSON document docs = generate_image_docs(imageList) docsNotFound = {} if len(docs) > 0: #Get all the corresponding image ids available in the ES registry index #response = es.mget(index=os.environ['ES_REGISTRY_INDEX'], doc_type=os.environ['ES_REGISTRY_IMAGE_TYPE'], body={"ids" : docs.keys()}, _source=False) response = multi_get_from_es_index(index=os.environ['ES_REGISTRY_INDEX'], doc_type=os.environ['ES_REGISTRY_IMAGE_TYPE'], body={"ids" : docs.keys()}, _source=False, fields=[]) #Iterate over the ES response docs and find the registry images that haven't been located in the ES index #ES sends us a "found=true/false" response attribute per doc so we only need the false ones for item in response['docs']: if item['found'] == False: docsNotFound[item['_id']] = docs.get(item['_id']) log(str(len(docsNotFound)) + ' missing images identified in ES....') return docsNotFound def generate_tag_docs(tagsList): """ Extract the registry tag names from the list of Swift tag paths. Ex. #"paas_c71ffca6470f4f1495d17c729459c8a3_1408369211.39146": {"tag": "1408369211.39146", "namespace": "paas", "repository": "c71ffca6470f4f1495d17c729459c8a3"}, #"paas_453873689c51492c88341ffea425b3ac_1408322491.23110": {"tag": "1408322491.23110", "namespace": "paas", "repository": "453873689c51492c88341ffea425b3ac"}, #........ @return List of JSON documents with the namespace, repository and tag info """ docs = {} for item in tagsList: if (item != ''): temp = item.split('/') #Generate a document for the missing Tag doc = {} doc['namespace'] = temp[2] doc['repository'] = temp[3] doc['tag'] = temp[4].replace('tag_', '') #Add the missing tag info to the ids list and docs dict resp. docs[temp[2] + '_' + temp[3] + '_' + doc['tag']] = doc log('Documents generated for ' + str(len(docs)) + ' tags....') return docs def generate_image_docs(imageList): """ Extract the registry image docs from the list of Swift image paths. Ex. #"paas_c71ffca6470f4f1495d17c729459c8a3": {"namespace": "paas", "repository": "c71ffca6470f4f1495d17c729459c8a3"}, #"paas_453873689c51492c88341ffea425b3ac": {"namespace": "paas", "repository": "453873689c51492c88341ffea425b3ac"}, #........ @return List of JSON documents with the namespace, repository and tag info """ docs = {} for item in imageList: if (item != ''): temp = item.split('/') #Generate a document for the missing Tag doc = {} doc['namespace'] = temp[2] doc['repository'] = temp[3] #Add the missing tag info to the ids list and docs dict resp. docs[temp[2] + '_' + temp[3]] = doc log('Documents generated for ' + str(len(docs)) + ' images....') return docs def get_swift_tags(es, days): """ Get all the registry Tags created in Swift during the past N days #registry/repositories/paas/01a66295ebd74d9199817940531c1d46/tag_1408320061.71133 #........ #........ @return List of Swift Tag location paths """ #Generate the date to grep for in yyyy-mm-dd format in the Swift output dateString=str(date.today()-timedelta(days=days)) #Get the list of tag paths from Swift via the Swift cli swiftCommand = 'swift list ' + swift_env['OS_CONTAINER'] + ' --prefix "' + os.environ['SWIFT_REGISTRY_PREFIX'] + '/repositories" --long | grep "tag_" | grep "' + dateString + '" | sed "s#.* ##g"' p = subprocess.Popen([swiftCommand], stdout=subprocess.PIPE, shell=True, env=swift_env) output, error = p.communicate() #Convert the Tag list string into an array tagsList = output.split('\n') tagsList = filter(None, tagsList) log(str(len(tagsList)) + ' tags created in Swift ' + str(days) + ' days ago on that date ' + dateString + '....') return tagsList def get_swift_images(es, days): """ Get all the registry images created in Swift during the past N days. Ex. # registry/repositories/paas/0782049940714c6f9269b2879073d707/_index_images # registry/repositories/paas/10bad43969474fec80ba5465bec62412/_index_images # ........ # ........ @return List of Swift image location paths """ #Generate the date to grep for in yyyy-mm-dd format in the Swift output dateString=str(date.today()-timedelta(days=days)) #Get the list of tag paths from Swift via the Swift cli swiftCommand = 'swift list ' + swift_env['OS_CONTAINER'] + ' --prefix "' + os.environ['SWIFT_REGISTRY_PREFIX'] + '/repositories" --long | grep "_index_images" | grep "' + dateString + '" | sed "s#.* ##g"' p = subprocess.Popen([swiftCommand], stdout=subprocess.PIPE, shell=True, env=swift_env) output, error = p.communicate() #Convert the image list string into an array imageList = output.split('\n') imageList = filter(None, imageList) log(str(len(imageList)) + ' images/repos created in Swift ' + str(days) + ' days ago....') return imageList def generate_tag_document(namespace, repository, tag, checksum, author): """ Creates a Tag in the registry index """ #Manufacture the tag document to be writen into the index document={} #Concatenate the <namespace>_<repository>_imageid to generate a unique primary key id document['id'] = namespace + '_' + repository + '_' + tag document['namespace'] = namespace document['tag'] = tag document['checksum'] = checksum document['repository'] = repository document['description'] = author log('Generated ES document for Tag ' + document['id'] + '....') return document def generate_image_document(namespace, repository, checksums): """ Creates an Image document in the registry index """ #Manufacture the image document to be writen into the index document={} #Concatenate the <namespace>_<repository> to generate a unique primary key id document['id'] = namespace + '_' + repository document['namespace'] = namespace document['imageLayers'] = checksums document['repository'] = repository log('Generated ES document for Image ' + document['id'] + '....') return document #Overriding the default ES Sniffing mechanism with Zookeeper class ZookeeperTransport(Transport): def get_es_node_addresses(self): """ Get the Elasticsearch node addresses via Zookeeper @return List of Elasticsearch node ip addresses and ports """ esNodes = [] #Initlate the Zookeeper Kazoo connection #kz_retry = KazooRetry(max_tries=3, delay=0.5, backoff=2) zk = KazooClient(hosts=os.environ['ZK_ADDRESS'], timeout=10.0, randomize_hosts=True) zk.start() try: #Fetch the list of ES cluster node names from Zookeeper zkPath = '/es/clusters/' + os.environ['ES_CLUSTER'] + '/json' children = zk.get_children(zkPath) #Retrieve the JSON metadata associated with each ephemeral ES node for node in children: zookeeperAddr = zkPath + '/' + node esNodeInfo = zk.get(zookeeperAddr) jsonData = json.loads(esNodeInfo[0]) #Collect each node ip address and port host = {'host':jsonData['address'], 'port': int(jsonData['port'])} esNodes.append(host) except KazooException: log('Kazoo Exception: Unable to fetch Zookeeper data from ' + zkPath + ' : ' + traceback.format_exc()); #Close and Zookeeper connection zk.stop() zk.close() return esNodes def sniff_hosts(self): """ Obtain a list of nodes from the cluster and create a new connection pool using the information retrieved. To extract the node connection parameters use the `nodes_to_host_callback`. """ previous_sniff = self.last_sniff hosts = [] try: # reset last_sniff timestamp self.last_sniff = time.time() try: hosts = self.get_es_node_addresses() except Exception: raise TransportError("N/A", "Unable to sniff hosts." + traceback.format_exc()) except: # keep the previous value on error self.last_sniff = previous_sniff raise # we weren't able to get any nodes, maybe using an incompatible # transport_schema or host_info_callback blocked all - raise error. if not hosts: raise TransportError("N/A", "Unable to sniff hosts - no viable hosts found." + traceback.format_exc()) self.set_connections(hosts) if __name__ == "__main__": #Initiate the ES connection pool es = Elasticsearch(get_es_node_addresses(), sniff_on_start=True, sniff_on_connection_fail=True, max_retries=3, sniffer_timeout=180, selector_class=RoundRobinSelector, sniff_timeout=1, transport_class=ZookeeperTransport) while True: #Find missing tags missingTagDocs = find_missing_tags_in_es_via_swift(es, int(os.environ['DAYS'])) #Iterate over the missing tag docs and restore them in the ES index counter = 1 total = len(missingTagDocs.items()) for key, value in missingTagDocs.items(): log('**** Restoring Tag ' + str(counter) + '/' + str(total) + ' --> ' + value['namespace'] + '/' + value['repository'] + '/' + value['tag'] + ' ****\n') checksum = get_tag_checksum_from_swift(value['namespace'], value['repository'], value['tag']) data = get_image_json_from_swift(checksum) document = generate_tag_document(value['namespace'], value['repository'], value['tag'], data.get('id'), data.get('author', '')) set_in_index(es, document, os.environ['ES_REGISTRY_INDEX'], os.environ['ES_REGISTRY_TAG_TYPE']) counter = counter + 1 log('************************************************************************************************************\n') #Find missing images from Swift missingImageDocs = find_missing_images_in_es_via_swift(es, int(os.environ['DAYS'])) #Iterate over the missing image docs and restore them in the ES index counter = 1 total = len(missingImageDocs.items()) for key, value in missingImageDocs.items(): log('**** Restoring Image' + str(counter) + '/' + str(total) + ' --> ' + value['namespace'] + '/' + value['repository'] + ' ****\n') checksumDict = get_image_checksums_from_swift(value['namespace'], value['repository']) checksumList = [] for checksum in checksumDict: checksumList.append(checksum['id']) document = generate_image_document(value['namespace'], value['repository'], checksumList) set_in_index(es, document, os.environ['ES_REGISTRY_INDEX'], os.environ['ES_REGISTRY_IMAGE_TYPE']) counter = counter + 1 log('**********************************************************************************************\n') log('Sleeping for ' + os.environ['CRON'] + ' secs.....\n') time.sleep(int(os.environ['CRON']))
{ "content_hash": "9750582c0e19524d8991ff3342513d28", "timestamp": "", "source": "github", "line_count": 529, "max_line_length": 223, "avg_line_length": 41.54253308128544, "alnum_prop": 0.6260921004732435, "repo_name": "misho-kr/elasticsearchindex", "id": "98b260ed06c14414edfe4f282aeb420ebf5156b0", "size": "21996", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "loadtest/restore_tags.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "95411" } ], "symlink_target": "" }
<?php declare(strict_types=1); /* * This file is part of the RollerworksSearch package. * * (c) Sebastiaan Stok <s.stok@rollerscapes.net> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace Rollerworks\Component\Search\Tests\Doctrine\Dbal\Functional; use Doctrine\DBAL\Schema\Schema as DbSchema; use Rollerworks\Component\Search\Doctrine\Dbal\ColumnConversion; use Rollerworks\Component\Search\Doctrine\Dbal\ConditionGenerator; use Rollerworks\Component\Search\Doctrine\Dbal\ValueConversion; use Rollerworks\Component\Search\Extension\Core\Type\BirthdayType; use Rollerworks\Component\Search\Extension\Core\Type\IntegerType; use Rollerworks\Component\Search\SearchConditionBuilder; use Rollerworks\Component\Search\Value\Compare; use Rollerworks\Component\Search\Value\ExcludedRange; use Rollerworks\Component\Search\Value\PatternMatch; use Rollerworks\Component\Search\Value\Range; use Rollerworks\Component\Search\Value\ValuesGroup; /** * Functional ConditionGeneratorTest, ensures queries are executable. * This tests does not ensure the correct result is returned, * this handled by another test-class. * * @group functional */ final class SqlConditionGeneratorTest extends FunctionalDbalTestCase { protected function setUpDbSchema(DbSchema $schema) { $invoiceTable = $schema->createTable('invoice'); $invoiceTable->addColumn('id', 'integer'); $invoiceTable->addColumn('status', 'integer'); $invoiceTable->addColumn('label', 'string'); $invoiceTable->addColumn('customer', 'integer'); $invoiceTable->setPrimaryKey(['id']); $customerTable = $schema->createTable('customer'); $customerTable->addColumn('id', 'integer'); $customerTable->addColumn('name', 'string'); $customerTable->addColumn('birthday', 'date'); $customerTable->setPrimaryKey(['id']); } protected function getQuery() { return 'SELECT i.*, c.* FROM invoice AS i JOIN customer AS c ON (c.id = i.customer) WHERE '; } /** * Configure fields of the ConditionGenerator. * * @param ConditionGenerator $conditionGenerator */ protected function configureConditionGenerator(ConditionGenerator $conditionGenerator) { $conditionGenerator->setField('customer', 'customer', 'i', 'integer'); $conditionGenerator->setField('customer_name', 'name', 'c', 'string'); $conditionGenerator->setField('customer_birthday', 'birthday', 'c', 'string'); // don't use date as this breaks the binding $conditionGenerator->setField('status', 'status', 'i', 'integer'); $conditionGenerator->setField('label', 'label', 'i', 'string'); } public function testSimpleQuery() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->addSimpleValue(2) ->addSimpleValue(5) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testQueryWithEmbeddedValues() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->addSimpleValue(2) ->addSimpleValue(5) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testExcludes() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->addExcludedSimpleValue(2) ->addExcludedSimpleValue(5) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testIncludesAndExcludes() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->addSimpleValue(2) ->addExcludedSimpleValue(5) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testRanges() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->add(new Range(2, 5)) ->add(new Range(10, 20)) ->add(new Range(60, 70, false)) ->add(new Range(100, 150, true, false)) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testExcludedRanges() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->add(new ExcludedRange(2, 5)) ->add(new ExcludedRange(10, 20)) ->add(new ExcludedRange(60, 70, false)) ->add(new ExcludedRange(100, 150, true, false)) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testSingleComparison() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->add(new Compare(2, '>')) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testMultipleComparisons() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->add(new Compare(2, '>')) ->add(new Compare(10, '<')) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testMultipleComparisonsWithGroups() { // Use two subgroups here as the comparisons are AND to each other // but applying them in the head group would ignore subgroups $condition = SearchConditionBuilder::create($this->getFieldSet()) ->group() ->field('customer') ->add(new Compare(2, '>')) ->add(new Compare(10, '<')) ->end() ->end() ->group() ->field('customer') ->add(new Compare(30, '>')) ->end() ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testExcludingComparisons() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->add(new Compare(2, '<>')) ->add(new Compare(5, '<>')) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testExcludingComparisonsWithNormal() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->add(new Compare(2, '<>')) ->add(new Compare(5, '<>')) ->add(new Compare(30, '>')) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testPatternMatchers() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer_name') ->add(new PatternMatch('foo', PatternMatch::PATTERN_STARTS_WITH)) ->add(new PatternMatch('fo\\\'o', PatternMatch::PATTERN_STARTS_WITH)) ->add(new PatternMatch('bar', PatternMatch::PATTERN_NOT_ENDS_WITH, true)) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testSubGroups() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->group() ->field('customer')->addSimpleValue(2)->end() ->end() ->group() ->field('customer')->addSimpleValue(3)->end() ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testSubGroupWithRootCondition() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->field('customer') ->addSimpleValue(2) ->end() ->group() ->field('customer_name') ->add(new PatternMatch('foo', PatternMatch::PATTERN_STARTS_WITH)) ->end() ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testOrGroupRoot() { $condition = SearchConditionBuilder::create($this->getFieldSet(), ValuesGroup::GROUP_LOGICAL_OR) ->field('customer') ->addSimpleValue(2) ->end() ->field('customer_name') ->add(new PatternMatch('foo', PatternMatch::PATTERN_STARTS_WITH)) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testSubOrGroup() { $condition = SearchConditionBuilder::create($this->getFieldSet()) ->group() ->group(ValuesGroup::GROUP_LOGICAL_OR) ->field('customer') ->addSimpleValue(2) ->end() ->field('customer_name') ->add(new PatternMatch('foo', PatternMatch::PATTERN_STARTS_WITH)) ->end() ->end() ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testColumnConversion() { $type = $this->conn->getDatabasePlatform()->getName() === 'mysql' ? 'SIGNED' : 'INTEGER'; $converter = $this->createMock(ColumnConversion::class); $converter ->expects($this->atLeastOnce()) ->method('convertColumn') ->will($this->returnCallback(function ($column) use ($type) { return "CAST($column AS $type)"; })) ; $fieldSetBuilder = $this->getFieldSet(false); $fieldSetBuilder->add('customer', IntegerType::class, ['grouping' => true, 'doctrine_dbal_conversion' => $converter]); $condition = SearchConditionBuilder::create($fieldSetBuilder->getFieldSet()) ->field('customer') ->addSimpleValue(2) ->addSimpleValue(5) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testValueConversion() { $type = $this->conn->getDatabasePlatform()->getName() === 'mysql' ? 'SIGNED' : 'INTEGER'; $converter = $this->createMock(ValueConversion::class); $converter ->expects($this->atLeastOnce()) ->method('convertValue') ->will($this->returnCallback(function ($input) use ($type) { return "CAST($input AS $type)"; })) ; $fieldSetBuilder = $this->getFieldSet(false); $fieldSetBuilder->add('customer', IntegerType::class, ['grouping' => true, 'doctrine_dbal_conversion' => $converter]); $condition = SearchConditionBuilder::create($fieldSetBuilder->getFieldSet()) ->field('customer') ->addSimpleValue(2) ->addSimpleValue(5) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } public function testConversionStrategy() { $date = new \DateTime('2001-01-15', new \DateTimeZone('UTC')); $fieldSet = $this->getFieldSet(false); $fieldSet->add('customer_birthday', BirthdayType::class); $fieldSet = $fieldSet->getFieldSet(); $condition = SearchConditionBuilder::create($fieldSet) ->field('customer_birthday') ->addSimpleValue(18) ->addSimpleValue($date) ->end() ->getSearchCondition(); $this->assertQueryIsExecutable($condition); } }
{ "content_hash": "2ebd9600ede15127ec3e1a101b8d5f3e", "timestamp": "", "source": "github", "line_count": 361, "max_line_length": 131, "avg_line_length": 33.822714681440445, "alnum_prop": 0.5768222768222768, "repo_name": "rollerworks/rollerworks-search-doctrine-dbal", "id": "e718aa254f1c4f6018d474c2d47053dc39421f04", "size": "12210", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Tests/Functional/SqlConditionGeneratorTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "156211" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_45) on Wed May 07 11:32:20 PDT 2014 --> <title>Uses of Package edu.ucla.wise.admin</title> <meta name="date" content="2014-05-07"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package edu.ucla.wise.admin"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?edu/ucla/wise/admin/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Uses of Package edu.ucla.wise.admin" class="title">Uses of Package<br>edu.ucla.wise.admin</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../edu/ucla/wise/admin/package-summary.html">edu.ucla.wise.admin</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#edu.ucla.wise.admin.healthmon">edu.ucla.wise.admin.healthmon</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#edu.ucla.wise.client.web">edu.ucla.wise.client.web</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="edu.ucla.wise.admin.healthmon"> <!-- --> </a> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../edu/ucla/wise/admin/package-summary.html">edu.ucla.wise.admin</a> used by <a href="../../../../edu/ucla/wise/admin/healthmon/package-summary.html">edu.ucla.wise.admin.healthmon</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../edu/ucla/wise/admin/class-use/AdminUserSession.html#edu.ucla.wise.admin.healthmon">AdminUserSession</a>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="edu.ucla.wise.client.web"> <!-- --> </a> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../edu/ucla/wise/admin/package-summary.html">edu.ucla.wise.admin</a> used by <a href="../../../../edu/ucla/wise/client/web/package-summary.html">edu.ucla.wise.client.web</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../edu/ucla/wise/admin/class-use/AdminUserSession.html#edu.ucla.wise.client.web">AdminUserSession</a>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?edu/ucla/wise/admin/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "966cb17a902ffde954fa2bc1767afeb6", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 278, "avg_line_length": 35.8562874251497, "alnum_prop": 0.6314295257181028, "repo_name": "ctsidev/SecureWise", "id": "b9745c064e829505b871ccb889fac68d49c23824", "size": "5988", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Wise/doc/javadocs/edu/ucla/wise/admin/package-use.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "183170" }, { "name": "Java", "bytes": "2535003" }, { "name": "JavaScript", "bytes": "93810" }, { "name": "Perl", "bytes": "368" }, { "name": "Shell", "bytes": "4875" }, { "name": "XSLT", "bytes": "2048" } ], "symlink_target": "" }
var ui = {}; $().ready(function(){ ui.init(); }); (function ($) { ui.init = function(){ var mapInit = maps(); google.maps.event.addDomListener(window, 'load', mapInit); twitterStream(); }, twitterStream = function(){ var socket = io.connect(window.location.host); socket.on('loadedtweets', function(data){ $.each(data, function(index, value){ addToMap(JSON.parse(value)); }); }); //Load Tweets on first connect socket.emit('loadtweets'); socket.on('connect', function(data){ console.log('Connected to: ' + window.location.host) showMessage('Connected!', 2000); }); socket.on('reconnecting', function(data){ console.log('Reconnecting'); showMessage('Disconnected. Trying a Reconnect...', 2000); }); socket.on('disconnect', function(data){ socket.emit('disconnect'); }); socket.on('message', function (data) { addToMap(data); //OnClick Add Tweet details }); }, addToMap = function(data){ var coords = data.coordinates; map.setOptions(); var marker = new google.maps.Marker({ animation: google.maps.Animation.DROP, position: new google.maps.LatLng(coords.latitude, coords.longitude), map: map, title:data.text }); } showMessage = function(message, timeout){ $('#connectionstatus').html(message).fadeIn('slow'); if(timeout > 0) { window.setInterval(function(){ $('#connectionstatus').fadeOut('slow'); }, timeout); } } maps = function(){ var mapOptions = { zoom: 3, center: new google.maps.LatLng(47.6842897, 17.3434897), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } } (jQuery));
{ "content_hash": "b2c883853bafda0b9a95b9bf4fe8763a", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 85, "avg_line_length": 26.4390243902439, "alnum_prop": 0.5087638376383764, "repo_name": "frangilbert/RealtimeTwitter", "id": "07599f15d067e29dc5f0f35dcb18532cfda2aea1", "size": "2168", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/javascripts/clientapp.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "9637" } ], "symlink_target": "" }
salt.modules.zfs ================ .. automodule:: salt.modules.zfs :members:
{ "content_hash": "e1f94af5d125cb597fcf17cffeea79bb", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 32, "avg_line_length": 16.2, "alnum_prop": 0.5555555555555556, "repo_name": "saltstack/salt", "id": "6569894a5e3026a2d7bd798af8066b5ea99058a5", "size": "81", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/ref/modules/all/salt.modules.zfs.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "14911" }, { "name": "C", "bytes": "1571" }, { "name": "Cython", "bytes": "1458" }, { "name": "Dockerfile", "bytes": "184" }, { "name": "Groovy", "bytes": "12318" }, { "name": "HCL", "bytes": "257" }, { "name": "HTML", "bytes": "8031" }, { "name": "Jinja", "bytes": "45598" }, { "name": "Makefile", "bytes": "713" }, { "name": "NSIS", "bytes": "76572" }, { "name": "PowerShell", "bytes": "75891" }, { "name": "Python", "bytes": "41444811" }, { "name": "Rich Text Format", "bytes": "6242" }, { "name": "Roff", "bytes": "191" }, { "name": "Ruby", "bytes": "961" }, { "name": "SaltStack", "bytes": "35856" }, { "name": "Scheme", "bytes": "895" }, { "name": "Scilab", "bytes": "1147" }, { "name": "Shell", "bytes": "524917" } ], "symlink_target": "" }
The Over The Air (OTA) Software Update functionality can be added to any of the Infineon PSoC6 example applications by passing the `chip_enable_ota_requestor=true` option to the build script. ## Running the OTA Download scenario - An OTA Provider is a node that can respond to the OTA Requestors' queries about available software updates and share the update packages with them. An OTA Requestor is any node that needs to be updated and can communicate with the OTA Provider to fetch applicable software updates. In the procedure described below, the OTA Provider will be a Linux application and the example running on the Infineon PSoC6 board will work as the OTA Requestor. - On a Linux or Darwin platform build the chip-tool and the ota-provider-app as follows: ``` scripts/examples/gn_build_example.sh examples/chip-tool out/ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false ``` - Build the PSoC6 OTA Requestor application from the chip root dir: ``` $ scripts/build/build_examples.py --enable-flashbundle --target infineon-psoc6-lock-ota build $ third_party/infineon/psoc6/psoc6_sdk/ota/ota_base_build.sh out/infineon-psoc6-lock-ota chip-psoc6-lock-example ``` - Build the PSoC6 OTA Update application from the chip root dir and create OTA file ``` $ scripts/build/build_examples.py --enable-flashbundle --no-log-timestamps --target infineon-psoc6-lock-ota-updateimage build $ third_party/infineon/psoc6/psoc6_sdk/ota/ota_update_build.sh out/infineon-psoc6-lock-ota-updateimage chip-psoc6-lock-example ``` * Additionally a pre-compiled bootloader must be flashed to the board using [Cypress Programmer](https://softwaretools.infineon.com/tools/com.ifx.tb.tool.cypressprogrammer). This image can be found at: $ ./third_party/infineon/psoc6/psoc6_sdk/ota/matter-psoc6-mcuboot-bootloader.hex * In a terminal start the Provider app passing to it the path to the Matter OTA file created in the previous step:(output of ota_update_build step) ``` rm -r /tmp/chip_* ./out/debug/chip-ota-provider-app -f chip-psoc6-lock-example.ota ``` * In a separate terminal run the chip-tool commands to provision the Provider: ``` ./out/chip-tool pairing onnetwork 1 20202021 ./out/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0 ``` * If the application device had been previously commissioned press USER Button 2 to factory-reset the device. * In the chip-tool terminal enter: ``` ./out/chip-tool pairing ble-wifi 2 <WIFI_SSID> <WIFI_PASSWORD> 20202021 3840 ``` * Once the commissioning process completes enter: ``` ./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0 ``` * The application device will connect to the Provider and start the image download. Status of the transfer can be monitored in the OTA Provider terminal. Once the image is downloaded the device will reboot into the downloaded image. In order for the Provider to successfully serve the image to a device during the OTA Software Update process the softwareVersion parameter in the Provider config file must be greater than the CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION parameter set in the application's CHIPProjectConfig.h file.
{ "content_hash": "db943819cb18b0eb71360ad812e4c3c6", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 233, "avg_line_length": 46.20987654320987, "alnum_prop": 0.6991717873363612, "repo_name": "project-chip/connectedhomeip", "id": "713b0b1409b25482291350609c5f5223cb3f7b79", "size": "3810", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/guides/infineon_psoc6_software_update.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1759301" }, { "name": "C++", "bytes": "19104548" }, { "name": "CMake", "bytes": "140510" }, { "name": "Dockerfile", "bytes": "50353" }, { "name": "Emacs Lisp", "bytes": "1042" }, { "name": "Java", "bytes": "167719" }, { "name": "JavaScript", "bytes": "2106" }, { "name": "Jinja", "bytes": "22322" }, { "name": "Objective-C", "bytes": "930838" }, { "name": "Objective-C++", "bytes": "435348" }, { "name": "Python", "bytes": "1931007" }, { "name": "Shell", "bytes": "195843" }, { "name": "Tcl", "bytes": "311" }, { "name": "ZAP", "bytes": "584219" } ], "symlink_target": "" }
<template name="GlobalVoicesInfo"> <p> Global Voices has been leading the conversation on citizen media reporting since 2005. Global Voices curates, verifies, and translates trending news and stories you might be missing on the Internet from blogs, independent press, and social media in 167 countries. </p> <hr /> {{> DefaultAttribution }} </template>
{ "content_hash": "ca50f8ba7dc1fda7e24a70e4a965d152", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 79, "avg_line_length": 35.3, "alnum_prop": 0.7818696883852692, "repo_name": "rebekahheacock/internet_dashboard", "id": "72d92754ae620ad9349cc0066d7f834d3ef2b274", "size": "353", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "packages/global-voices/client/info.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "106546" }, { "name": "HTML", "bytes": "62816" }, { "name": "JavaScript", "bytes": "632838" } ], "symlink_target": "" }
#ifndef NETPGPDIGEST_H_ #define NETPGPDIGEST_H_ /* header file to define the sizes for various digest arrays */ #ifdef HAVE_OPENSSL_MD5_H #include <openssl/md5.h> #endif #ifdef HAVE_OPENSSL_SHA_H #include <openssl/sha.h> #endif /* Apple */ #ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H #undef MD5_DIGEST_LENGTH #undef SHA_DIGEST_LENGTH #define COMMON_DIGEST_FOR_OPENSSL 1 #include <CommonCrypto/CommonDigest.h> #endif /* SHA1 Hash Size */ #define OPS_SHA1_HASH_SIZE SHA_DIGEST_LENGTH #define OPS_SHA256_HASH_SIZE SHA256_DIGEST_LENGTH #define OPS_CHECKHASH_SIZE OPS_SHA256_HASH_SIZE #endif /* NETPGPDIGEST_H_ */
{ "content_hash": "50e9f6569ddb5f9d1239c4f93d8724b5", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 63, "avg_line_length": 21.892857142857142, "alnum_prop": 0.7553017944535073, "repo_name": "FAU-Inf2/unnetpgp", "id": "8b5dd0bc4d46fc86d73d4bc50b4f6653e10e3fc7", "size": "2119", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "netpgp/lib/netpgpdigest.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "710404" }, { "name": "C++", "bytes": "2359" }, { "name": "Objective-C", "bytes": "43913" }, { "name": "Ruby", "bytes": "1377" } ], "symlink_target": "" }
namespace Fixtures.DateTimeOffset { using System; using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.Rest; using Models; /// <summary> /// Extension methods for SwaggerDateTimeOffsetClient. /// </summary> public static partial class SwaggerDateTimeOffsetClientExtensions { /// <summary> /// Product Types /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='responseCode'> /// The desired returned status code /// </param> /// <param name='product'> /// The only parameter /// </param> public static Product GetProduct(this ISwaggerDateTimeOffsetClient operations, string responseCode = default(string), Product product = default(Product)) { return Task.Factory.StartNew(s => ((ISwaggerDateTimeOffsetClient)s).GetProductAsync(responseCode, product), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// <summary> /// Product Types /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='responseCode'> /// The desired returned status code /// </param> /// <param name='product'> /// The only parameter /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<Product> GetProductAsync(this ISwaggerDateTimeOffsetClient operations, string responseCode = default(string), Product product = default(Product), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetProductWithHttpMessagesAsync(responseCode, product, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// <summary> /// Product Types /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='responseCode'> /// The desired returned status code /// </param> /// <param name='product'> /// The only parameter /// </param> public static Product PutProduct(this ISwaggerDateTimeOffsetClient operations, string responseCode = default(string), Product product = default(Product)) { return Task.Factory.StartNew(s => ((ISwaggerDateTimeOffsetClient)s).PutProductAsync(responseCode, product), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// <summary> /// Product Types /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='responseCode'> /// The desired returned status code /// </param> /// <param name='product'> /// The only parameter /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<Product> PutProductAsync(this ISwaggerDateTimeOffsetClient operations, string responseCode = default(string), Product product = default(Product), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PutProductWithHttpMessagesAsync(responseCode, product, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// <summary> /// Product Types /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='responseCode'> /// The desired returned status code /// </param> /// <param name='product'> /// The only parameter /// </param> public static Product PostProduct(this ISwaggerDateTimeOffsetClient operations, string responseCode = default(string), Product product = default(Product)) { return Task.Factory.StartNew(s => ((ISwaggerDateTimeOffsetClient)s).PostProductAsync(responseCode, product), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// <summary> /// Product Types /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='responseCode'> /// The desired returned status code /// </param> /// <param name='product'> /// The only parameter /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<Product> PostProductAsync(this ISwaggerDateTimeOffsetClient operations, string responseCode = default(string), Product product = default(Product), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PostProductWithHttpMessagesAsync(responseCode, product, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// <summary> /// Product Types /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='responseCode'> /// The desired returned status code /// </param> /// <param name='product'> /// The only parameter /// </param> public static Product PatchProduct(this ISwaggerDateTimeOffsetClient operations, string responseCode = default(string), Product product = default(Product)) { return Task.Factory.StartNew(s => ((ISwaggerDateTimeOffsetClient)s).PatchProductAsync(responseCode, product), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// <summary> /// Product Types /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='responseCode'> /// The desired returned status code /// </param> /// <param name='product'> /// The only parameter /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<Product> PatchProductAsync(this ISwaggerDateTimeOffsetClient operations, string responseCode = default(string), Product product = default(Product), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PatchProductWithHttpMessagesAsync(responseCode, product, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } } }
{ "content_hash": "4e84c73d420a28b28b41f584329b49ca", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 250, "avg_line_length": 45.92655367231639, "alnum_prop": 0.5624308032968385, "repo_name": "jkonecki/autorest", "id": "f80671b6403ec673fb7c206b5fefa47286416251", "size": "8442", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "AutoRest/Generators/CSharp/CSharp.Tests/Expected/DateTimeOffset/SwaggerDateTimeOffsetClientExtensions.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "270" }, { "name": "C#", "bytes": "6404226" }, { "name": "CSS", "bytes": "110" }, { "name": "HTML", "bytes": "589" }, { "name": "Java", "bytes": "52197" }, { "name": "JavaScript", "bytes": "2844345" }, { "name": "PowerShell", "bytes": "16348" }, { "name": "Ruby", "bytes": "121623" } ], "symlink_target": "" }