text
stringlengths
2
1.04M
meta
dict
(function () { var basePackage = "atplugins.lightWidgets"; var basePath = basePackage + "."; var nspace = Aria.nspace(basePackage, true); Aria.classDefinition({ $classpath : "atplugins.lightWidgets.calendar.CalendarController", $dependencies : ["aria.utils.Date", "aria.utils.environment.Date", "aria.utils.Array", "aria.utils.Json", "atplugins.lightWidgets.calendar.CalendarCfgBeans"], $events : { "focusChanged" : { description : "Raised when the focus changed.", properties : { "focus" : "Contains the current value of the focus property.", "cancelDefault" : "If true, prevent the default focus visual notification." } }, "update" : { description : "Raised when one or more calendar settings have changed and the data model has been updated.", properties : { "properties" : "Map of properties which have changed in the settings. This map must stay read-only.", "propertiesNbr" : "Number of properties which have changed in the settings." } }, "dateClick" : { description : "Raised when the user clicked on a date in the calendar.", properties : { "date" : "Date which the user clicked on.", "cancelDefault" : "" } }, "keyevent" : { description : "Raised when the keyevent method is called, which is normally when the user has pressed a key. A listener of this event can change some of the event properties to change the default behavior.", properties : { "charCode" : "", "keyCode" : "", "increment" : "", "incrementUnit" : "", "refDate" : "", "date" : "", "cancelDefault" : "Set this property to true if some action is done on this key when receiving this event, so that the key propagation and the default action of the browser on this key is canceled." } } }, /** * @param {aria.widgets.calendar.CfgBeans.CalendarModel} */ $constructor : function (data) { /** * Shortcut to the json utility * @type aria.utils.Json */ this.json = aria.utils.Json; this._changedSettings = { "value" : {}, "minValue" : {}, "maxValue" : {}, "startDate" : {}, "displayUnit" : {}, "numberOfUnits" : {}, "firstDayOfWeek" : {}, "monthLabelFormat" : {}, "dayOfWeekLabelFormat" : {}, "dateLabelFormat" : {}, "completeDateLabelFormat" : {} }; this._changedSettingsNbr = 11; this.init(data); }, $destructor : function () { if (this._jsonListener) { this.json.removeListener(this._calendarSettings, null, this._jsonListener); this._jsonListener = null; } this._calendarData = null; this._calendarSettings = null; }, $prototype : { /** * Map of properties inside this._calendarSettings. */ _settingsProperties : { "value" : { isDate : true }, "minValue" : { isDate : true }, "maxValue" : { isDate : true }, "startDate" : { isDate : true }, "displayUnit" : {}, "numberOfUnits" : {}, "firstDayOfWeek" : {}, "monthLabelFormat" : {}, "dayOfWeekLabelFormat" : {}, "dateLabelFormat" : {}, "completeDateLabelFormat" : {} }, _defaultKeyActions : { 33 : {/* KC_PAGE_UP */ increment : -1, incrementUnit : "M" }, 34 : {/* KC_PAGE_DOWN */ increment : 1, incrementUnit : "M" }, 35 : {/* KC_END */ refDate : "maxValue" }, 36 : {/* KC_HOME */ refDate : "minValue" }, 37 : {/* KC_ARROW_LEFT */ increment : -1, incrementUnit : "D" }, 38 : {/* KC_ARROW_UP */ increment : -7, incrementUnit : "D" }, 39 : {/* KC_ARROW_RIGHT */ increment : 1, incrementUnit : "D" }, 40 : {/* KC_ARROW_DOWN */ increment : 7, incrementUnit : "D" } }, _jsonDataChanged : function (args) { var dateUtils = aria.utils.Date; var dataName = args.dataName; var property = this._settingsProperties[dataName]; if (property) { var changeInfo = this._changedSettings[dataName]; if (changeInfo == null) { changeInfo = { oldValue : args.oldValue, newValue : args.newValue }; this._changedSettingsNbr++; } if (changeInfo.oldValue === args.newValue || (property.isDate && dateUtils.isSameDay(changeInfo.oldValue, args.newValue))) { changeInfo = null; this._changedSettingsNbr--; } this._changedSettings[dataName] = changeInfo; } }, init : function (data, cb) { if (!data) { data = {}; } data.calendar = {}; if (!data.settings) { data.settings = {}; } var settings = data.settings; this._data = data; this._calendarSettings = settings; this._calendarData = data.calendar; if (!settings.startDate) { settings.startDate = new Date(); } if (!settings.completeDateLabelFormat) { settings.completeDateLabelFormat = aria.utils.environment.Date.getDateFormats().longFormat; } if (settings.firstDayOfWeek == null) { // compare to null because 0 is a valid value settings.firstDayOfWeek = aria.utils.environment.Date.getFirstDayOfWeek(); } aria.core.JsonValidator.normalize({ json : this._calendarSettings, beanName : "atplugins.lightWidgets.calendar.CalendarCfgBeans.Properties" }); this.update(); this._jsonListener = { fn : this._jsonDataChanged, scope : this }; this.json.addListener(settings, null, this._jsonListener, true); if (cb) { this.$callback(cb); } }, /** * Notify the calendar controller that the focus changed, and give the new value of the focus. * @param {Boolean} calendarFocused new value of the focus. * @return {Boolean} if true, the default focus visual notification should not be displayed */ notifyFocusChanged : function (calendarFocused) { var evt = { name : "focusChanged", focus : calendarFocused, cancelDefault : false }; this.json.setValue(this._data.settings, "focus", calendarFocused); this.$raiseEvent(evt); return evt.cancelDefault; }, /** * Notify the calendar controller that a key has been pressed. The controller reacts by sending a keyevent * event. Upon receiving that event, listeners can either ignore it, which leads to the default action being * executed when returning from the event, or they can override the default action by changing event * properties. * @param {Object} Any object with the charCode and keyCode properties which specify which key has been * pressed. Any other property in this object is ignored. * @return {Boolean} true if the default action should be canceled, false otherwise */ keyevent : function (evtInfo) { var evt = { name : "keyevent", charCode : evtInfo.charCode, keyCode : evtInfo.keyCode, cancelDefault : false }; var defActions = this._defaultKeyActions[evt.keyCode]; if (defActions != null) { evt.cancelDefault = true; // if there is a default action from _defaultKeyActions, browser action // should be canceled this.json.inject(defActions, evt, false); } this.$raiseEvent(evt); var newValue = this._transformDate(this._calendarSettings.value, evt); if (newValue) { this.selectDay({ date : newValue }); } return (evt.cancelDefault === true); }, /** * Return information about the position of the given JavaScript date in the calendar data model. * @param {Date} JavaScript date * @return {aria.widgets.calendar.CfgBeans.DatePosition} position of the date in the calendar data model, or * null if the date cannot be found in the current calendar data model. */ getDatePosition : function (jsDate) { var arrayUtils = aria.utils.Array; var dateUtils = aria.utils.Date; var calendar = this._calendarData; var diff = dateUtils.dayDifference(this._realStartDate, jsDate); var weekIndex = Math.floor(diff / 7); if (weekIndex < 0 || weekIndex >= calendar.weeks.length) { return null; } var week = calendar.weeks[weekIndex]; var dayInWeekIndex = diff % 7; var day = week.days[dayInWeekIndex]; this.$assert(228, dateUtils.isSameDay(jsDate, day.jsDate)); var weekInMonthIndex = null; var monthIndex = null; var month = calendar.months[day.monthKey]; if (month != null) { // the month may not be present (e.g.: for a day at the end of the last week, which is in the month // after the last month) monthIndex = arrayUtils.indexOf(calendar.months, month); this.$assert(239, month == calendar.months[monthIndex]); if (day.monthKey == week.month || day.monthKey == week.monthEnd) { weekInMonthIndex = week.indexInMonth; } else { weekInMonthIndex = 0; // first week in the month } this.$assert(245, month.weeks[weekInMonthIndex] == week); } return { weekIndex : weekIndex, monthIndex : monthIndex, weekInMonthIndex : weekInMonthIndex, dayInWeekIndex : dayInWeekIndex, month : month, week : week, day : day }; }, /** * Notify the calendar controller that the user has clicked on a date. */ dateClick : function (args) { var evt = { name : "dateClick", date : args.date }; if (this._data) { // we check this._data because because in the click event, the calendar controller // may have been disposed (e.g. in the datePicker) this.selectDay({ date : evt.date }); } this.$raiseEvent(evt); }, /** * Navigate to the next page, the previous page or to a specific date. */ navigate : function (evt, args) { var dateUtils = aria.utils.Date; if (evt && evt.preventDefault) { // Don't follow the link evt.preventDefault(); } var curStartDate = this._calendarData.startDate; var newStartDate = this._transformDate(curStartDate, args); if (newStartDate == null) { return; } if (dateUtils.isSameDay(curStartDate, newStartDate) || dateUtils.isSameDay(this._calendarSettings.startDate, newStartDate)) return; this.json.setValue(this._calendarSettings, "startDate", newStartDate); this.update(); }, selectDay : function (args) { var newValue = args.date; if (!newValue || this._isSelectable(newValue)) { this.json.setValue(this._calendarSettings, "value", newValue); this._ensureDateVisible(newValue); this.update(); } }, /** * Ensure the date given as a parameter is visible on the active page, otherwise, changes the start date * @private */ _ensureDateVisible : function (jsDate) { var dateUtils = aria.utils.Date; if (jsDate) { var calendar = this._calendarData; if (dateUtils.dayDifference(jsDate, calendar.startDate) > 0 || dateUtils.dayDifference(jsDate, calendar.endDate) < 0 || this._changedSettings["startDate"]) { this.json.setValue(this._calendarSettings, "startDate", jsDate); } } }, _getMonthKey : function (jsDate) { return [jsDate.getMonth(), jsDate.getFullYear()].join("-"); }, /** * */ update : function () { var dateUtils = aria.utils.Date; if (this._changedSettingsNbr === 0) { // no need to update if no property changed return; } var json = this.json; var changed = this._changedSettings; var calendar = this._calendarData; var settings = this._calendarSettings; if (changed["minValue"]) { // remove time, so that comparisons with current value are correct json.setValue(settings, "minValue", dateUtils.removeTime(settings.minValue)); } if (changed["maxValue"]) { // remove time, so that comparisons with current value are correct json.setValue(settings, "maxValue", dateUtils.removeTime(settings.maxValue)); } if (changed["value"] || changed["minValue"] || changed["maxValue"]) { // calling the following method can change the value this._checkValue(); } if (changed["value"] && this._changedSettingsNbr == 1) { // only the value changed, optimize that very frequent case var valueChanged = changed["value"]; var oldDate = changed["value"].oldValue; var newDate = settings.value; if (oldDate) { // unselect old date var oldPosition = this.getDatePosition(oldDate); if (oldPosition) { oldPosition.day.isSelected = false; valueChanged.oldValuePosition = oldPosition; } } if (newDate) { // select new date var newPosition = this.getDatePosition(newDate); if (newPosition) { newPosition.day.isSelected = true; valueChanged.newValuePosition = newPosition; } } } else { if (changed["firstDayOfWeek"] || changed["dayOfWeekLabelFormat"]) { json.setValue(calendar, "daysOfWeek", this._createDaysOfWeek()); } // TODO: do less things according to the properties in changed and the already computed properties json.setValue(calendar, "today", new Date()); var startDate = new Date(settings.startDate); // must be the first day of the time unit (either // the // first day of a week or the first day of a month) var realStartDate; // must be the first day of a week, and must include the whole month containing // startDate var endDate; // must be the last day of the time unit (either the last day of a week or the last // day // of a month) var realEndDate; // must be the first day of a week and must include the whole month containing // endDate if (settings.displayUnit == "W") { startDate = dateUtils.getStartOfWeek(startDate, settings.firstDayOfWeek); realStartDate = new Date(startDate.getFullYear(), startDate.getMonth(), 1); realStartDate = dateUtils.getStartOfWeek(realStartDate, settings.firstDayOfWeek); endDate = new Date(startDate.getTime()); endDate.setDate(endDate.getDate() + 7 * settings.numberOfUnits - 1); realEndDate = new Date(endDate.getTime()); realEndDate.setDate(32); realEndDate.setDate(1); } else /* if (settings.displayUnit == "M") */{ startDate = new Date(startDate.getFullYear(), startDate.getMonth(), 1); realStartDate = dateUtils.getStartOfWeek(startDate, settings.firstDayOfWeek); endDate = new Date(startDate.getTime()); endDate.setMonth(endDate.getMonth() + settings.numberOfUnits); endDate.setDate(endDate.getDate() - 1); // last day of the month realEndDate = new Date(endDate.getTime()); realEndDate.setDate(realEndDate.getDate() + 1); } // currently, we never reuse existing data; we do not cache calendar data, which could be a good // optimization var weeks = []; var months = []; this._createMonthsAndWeeks(realStartDate, realEndDate, weeks, months); json.setValue(calendar, "startDate", startDate); json.setValue(calendar, "endDate", endDate); json.setValue(calendar, "weeks", weeks); json.setValue(calendar, "months", months); json.setValue(calendar, "startMonthIndex", 0); // if changing this, also change getDatePosition() json.setValue(calendar, "endMonthIndex", months.length - 1); json.setValue(calendar, "startWeekIndex", Math.floor(dateUtils.dayDifference(realStartDate, startDate) / 7)); json.setValue(calendar, "endWeekIndex", Math.floor(dateUtils.dayDifference(realStartDate, endDate) / 7)); this.$assert(128, calendar.endMonthIndex < months.length); this.$assert(129, calendar.endWeekIndex < weeks.length); var minValue = settings.minValue; var maxValue = settings.maxValue; json.setValue(calendar, "previousPageEnabled", !minValue || minValue < startDate); json.setValue(calendar, "nextPageEnabled", !maxValue || maxValue > endDate); this._realStartDate = realStartDate; // save the start date for future use } /* * aria.core.JsonValidator.normalize({ json : this._data, beanName : this._dataBeanName }); */ var oldChangedSettings = this._changedSettings; var oldChangedSettingsNbr = this._changedSettingsNbr; this._changedSettings = {}; this._changedSettingsNbr = 0; this.$raiseEvent({ name : "update", properties : oldChangedSettings, propertiesNbr : oldChangedSettingsNbr, propertyshowShortcuts : settings.showShortcuts }); }, _transformDate : function (oldDate, changeInfo) { var newValue; if (changeInfo.increment != null) { if (oldDate == null) { oldDate = this._calendarSettings.startDate; } newValue = new Date(oldDate); if (changeInfo.incrementUnit == "M") { var oldMonth = newValue.getMonth(); newValue.setMonth(oldMonth + changeInfo.increment); if ((24 + oldMonth + changeInfo.increment) % 12 != newValue.getMonth()) { // the previous month does not have enough days, go to its last day newValue.setDate(0); } } else if (changeInfo.incrementUnit == "D") { newValue.setDate(newValue.getDate() + changeInfo.increment); } else /* if (incrementUnit == "W") */{ newValue.setDate(newValue.getDate() + 7 * changeInfo.increment); } } else if (changeInfo.refDate) { var refDate = changeInfo.refDate; if (refDate == "minValue") { if (this._calendarSettings.minValue) { newValue = this._calendarSettings.minValue; } } else if (refDate == "maxValue") { if (this._calendarSettings.maxValue) { newValue = this._calendarSettings.maxValue; } } } else if (changeInfo.date) { newValue = new Date(changeInfo.date); } return newValue; }, _createDaysOfWeek : function () { var dateUtils = aria.utils.Date; var days = []; var dayOfWeekLabelFormat = this._calendarSettings.dayOfWeekLabelFormat; var date = dateUtils.getStartOfWeek(new Date(), this._calendarSettings.firstDayOfWeek); for (var i = 0; i < 7; i++) { days.push({ label : dateUtils.format(date, dayOfWeekLabelFormat), day : date.getDay() }); date.setDate(date.getDate() + 1); } return days; }, _createMonthsAndWeeks : function (startDate, endDate, weeks, months) { var curDate = new Date(startDate.getTime()); var curMonth = (curDate.getDate() == 1 ? curDate.getMonth() : null); while (curDate < endDate) { var week = this._createWeek(curDate); // this also changes curDate weeks.push(week); if (curDate.getMonth() != curMonth) { // the first day of the new week is in a different month than the first day // of the previous week, so a month has just ended if (curMonth != null) { // create the month only if all the weeks of the month have been created var month = this._createMonth(weeks, weeks.length - 1); months.push(month); months[month.monthKey] = month; } curMonth = curDate.getMonth(); // set curMonth so that, at the end of the month, the month will // be created } } }, _createWeek : function (currentDate) { var dateUtils = aria.utils.Date; var overlappingDays = 0; var monthKey; var days = []; var res = { days : days, indexInMonth : 1 + Math.floor((currentDate.getDate() - 2) / 7), weekNumber : dateUtils.dayOfWeekNbrSinceStartOfYear(currentDate) }; for (var i = 0; i < 7; i++) { var day = this._createDay(currentDate); days.push(day); if (!monthKey) { monthKey = day.monthKey; } else if (overlappingDays === 0 && monthKey != day.monthKey) { overlappingDays = i; } if (currentDate.getDate() == 1) { res.monthStart = day.monthKey; day.isFirstOfMonth = true; } currentDate.setDate(currentDate.getDate() + 1); if (currentDate.getDate() == 1) { // the next day is the first of a month, so "day" is the last of the month res.monthEnd = day.monthKey; day.isLastOfMonth = true; } } res.overlappingDays = overlappingDays; if (overlappingDays === 0) { res.month = monthKey; } return res; }, _isSelectable : function (jsDate) { var settings = this._calendarSettings; var minValue = settings.minValue; var maxValue = settings.maxValue; return (!minValue || jsDate >= minValue) && (!maxValue || jsDate <= maxValue); }, _checkValue : function () { var settings = this._calendarSettings; var value = settings.value; var minValue = settings.minValue; var maxValue = settings.maxValue; var newValue = value; if (value == null) { return; } if (minValue && minValue > value) { newValue = minValue; } if (maxValue && maxValue < value) { newValue = maxValue; } if (newValue != value) { if (minValue > maxValue) { newValue = null; } this.json.setValue(settings, "value", newValue); } }, _createDay : function (jsDate) { var dateUtils = aria.utils.Date; var settings = this._calendarSettings; var date = new Date(jsDate.getFullYear(), jsDate.getMonth(), jsDate.getDate()); // copying the date // object var day = jsDate.getDay(); var res = { jsDate : date, label : dateUtils.format(date, settings.dateLabelFormat), monthKey : this._getMonthKey(jsDate) }; if (day === 0 || day === 6) { res.isWeekend = true; } if (dateUtils.isSameDay(date, this._calendarData.today)) { res.isToday = true; } if (dateUtils.isSameDay(date, settings.value)) { res.isSelected = true; } res.isSelectable = this._isSelectable(date); // isFirstOfMonth and isLastOfMonth are defined in _createWeek() return res; }, _createMonth : function (weeksArray, lastWeekIndex) { var dateUtils = aria.utils.Date; var lastWeek = weeksArray[lastWeekIndex]; var monthKey = lastWeek.days[0].monthKey; // the first day of the last week in the month var weeks = []; var res = { monthKey : monthKey, weeks : weeks }; for (var i = lastWeekIndex; i >= 0; i--) { var week = weeksArray[i]; weeks.unshift(week); if (week.monthStart == monthKey) { // we have reached the begining of the month break; } } var firstWeek = weeks[0]; this.$assert(260, firstWeek.monthStart == monthKey); var firstOfMonth = firstWeek.days[firstWeek.overlappingDays].jsDate; res.firstOfMonth = firstOfMonth; res.label = dateUtils.format(firstOfMonth, this._calendarSettings.monthLabelFormat); res.weeksInMonth = weeks.length; res.daysBeforeStartOfMonth = firstWeek.overlappingDays; res.daysAfterEndOfMonth = (lastWeek.overlappingDays > 0 ? 7 - lastWeek.overlappingDays : 0); res.daysInMonth = weeks.length * 7 - res.daysBeforeStartOfMonth - res.daysAfterEndOfMonth; res.wholeWeeksInMonth = weeks.length - (firstWeek.overlappingDays > 0 ? 1 : 0) - (lastWeek.overlappingDays > 0 ? 1 : 0); return res; } } }); })();
{ "content_hash": "bc757d17989d7ed4d4caf2cf775eaa5c", "timestamp": "", "source": "github", "line_count": 668, "max_line_length": 223, "avg_line_length": 47.27994011976048, "alnum_prop": 0.46480701643289113, "repo_name": "lsimone/ariatemplates", "id": "3377997d0295db6380706357a044fd8ebb45562b", "size": "32176", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "test/nodeTestResources/testProject/src/atplugins/lightWidgets/calendar/CalendarController.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "202050" }, { "name": "JavaScript", "bytes": "9574450" }, { "name": "Shell", "bytes": "2112" } ], "symlink_target": "" }
Number Formatter ========= A small library that adds commas to numbers ## Installation `npm install @bird-cage/number-formatter` ## Usage var numFormatter = require('@bird-cage/number-formatter'); var formattedNum = numFormatter(35666); Output should be `35,666` ## Tests `npm test` ## Contributing In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code. [![Build Status](https://travis-ci.org/bird-cage/number-formatter.svg?branch=master)](https://travis-ci.org/bird-cage/number-formatter) [![Coverage Status](https://coveralls.io/repos/github/bird-cage/number-formatter/badge.svg?branch=master)](https://coveralls.io/github/bird-cage/number-formatter?branch=master)
{ "content_hash": "4385904438220fe9196337c54255817b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 176, "avg_line_length": 26, "alnum_prop": 0.7357320099255583, "repo_name": "bird-cage/number-formatter", "id": "e01987207f130ab801e18b6e5eb5e8f34c399709", "size": "806", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1482" } ], "symlink_target": "" }
import * as moveService from "./moveService.js" let totalTimeSpend = 0; moveService.empaquetar() .then( (time) => { totalTimeSpend += time; return moveService.desmontar() } ) .then( (time) => { totalTimeSpend += time; return moveService.traslado() } ) .then( (time) => { totalTimeSpend += time; return moveService.montar() } ) .then( (time) => { totalTimeSpend += time; return moveService.colocar() } ) .then( (time) => { totalTimeSpend += time; console.log( `Con promesas he tardado en mudarme ${totalTimeSpend} seg. en mudarme` ); } )
{ "content_hash": "6d1a319941cd0b00e3271e0df9fca751", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 90, "avg_line_length": 23.96, "alnum_prop": 0.6143572621035058, "repo_name": "carlosvillu-com/generator-promises", "id": "caac265bb701376c70b2601cb19c901461f3e9c8", "size": "599", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "promises.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1518" } ], "symlink_target": "" }
#ifndef MA_EDGESWAP_H #define MA_EDGESWAP_H #include "maMesh.h" namespace ma { class Adapt; class EdgeSwap { public: virtual ~EdgeSwap() {}; virtual bool run(Entity* edge) = 0; }; EdgeSwap* makeEdgeSwap(Adapt* a); } #endif
{ "content_hash": "c515e52ba5ee63c11a6c2dacd1617517", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 39, "avg_line_length": 10.954545454545455, "alnum_prop": 0.6597510373443983, "repo_name": "yangf4/core", "id": "de89aad733ed200727f2555ab08fe37e13101213", "size": "672", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "ma/maEdgeSwap.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "230891" }, { "name": "C++", "bytes": "2035016" }, { "name": "CMake", "bytes": "87920" }, { "name": "HTML", "bytes": "248" }, { "name": "Objective-C", "bytes": "1787" }, { "name": "Python", "bytes": "8314" }, { "name": "Shell", "bytes": "4798" }, { "name": "TeX", "bytes": "114042" } ], "symlink_target": "" }
module Google module Ads module GoogleAds module V11 module Services module BiddingSeasonalityAdjustmentService # Path helper methods for the BiddingSeasonalityAdjustmentService API. module Paths ## # Create a fully-qualified BiddingSeasonalityAdjustment resource string. # # The resource will be in the following format: # # `customers/{customer_id}/biddingSeasonalityAdjustments/{seasonality_event_id}` # # @param customer_id [String] # @param seasonality_event_id [String] # # @return [::String] def bidding_seasonality_adjustment_path customer_id:, seasonality_event_id: raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" "customers/#{customer_id}/biddingSeasonalityAdjustments/#{seasonality_event_id}" end ## # Create a fully-qualified Campaign resource string. # # The resource will be in the following format: # # `customers/{customer_id}/campaigns/{campaign_id}` # # @param customer_id [String] # @param campaign_id [String] # # @return [::String] def campaign_path customer_id:, campaign_id: raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" "customers/#{customer_id}/campaigns/#{campaign_id}" end extend self end end end end end end end
{ "content_hash": "5cf0b5069ae107db905cef4ddaa0c7a8", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 102, "avg_line_length": 35.24, "alnum_prop": 0.5317820658342792, "repo_name": "googleads/google-ads-ruby", "id": "d59a44b95fabeb93ae24bb8c3691ae49706ce92e", "size": "2426", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "lib/google/ads/google_ads/v11/services/bidding_seasonality_adjustment_service/paths.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "12358" }, { "name": "Ruby", "bytes": "10304247" }, { "name": "Shell", "bytes": "1082" } ], "symlink_target": "" }
#import <AppKit/AppKit.h> @interface ActAsyncView : NSView @end
{ "content_hash": "c00748e64db49b5a5c6ec7bfc6a2258c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 32, "avg_line_length": 11.166666666666666, "alnum_prop": 0.7313432835820896, "repo_name": "jsh1/activity_log", "id": "e162b19243c4111a6ee1b3b9496d32bc6269ddcb", "size": "1224", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mac/ActAsyncView.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2063" }, { "name": "C++", "bytes": "316918" }, { "name": "Makefile", "bytes": "3470" }, { "name": "Objective-C", "bytes": "178700" }, { "name": "Objective-C++", "bytes": "470963" }, { "name": "Perl", "bytes": "7048" }, { "name": "Shell", "bytes": "313" } ], "symlink_target": "" }
import sys import os import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'django-reclass' copyright = u'2015, Michael Kuty' author = u'Michael Kuty' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0' # The full version, including alpha/beta/rc tags. release = '0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' #html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # Now only 'ja' uses this config value #html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration directory) that # implements a search results scorer. If empty, the default will be used. #html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. htmlhelp_basename = 'hrCMSdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', # Latex figure (float) alignment #'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'django_reclass.tex', u'django-reclass', u'Michael Kuty', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'django_reclass', u'django-reclass Documentation', [author], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'django_reclass', u'django-reclass', author, 'django_reclass', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'https://docs.python.org/': None}
{ "content_hash": "18922a8843eeb606417a2f36f01e12ea", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 79, "avg_line_length": 32.20640569395018, "alnum_prop": 0.7048618784530387, "repo_name": "michaelkuty/django-reclass", "id": "e170c2dcf062501f36e91a5920a3f71f5114ea42", "size": "9468", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/source/conf.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "24758" }, { "name": "Shell", "bytes": "102" } ], "symlink_target": "" }
<?php require_once ("../models/db-settings.php"); require_once ("../models/funcs.php"); require_once ("../functions.php"); function update_3() { global $db_table_prefix; $db_issue = false; $kanban_versions_entry = " INSERT INTO `" . $db_table_prefix . "versions` (`version_type`, `version_number`) VALUES ('application',3), ('db schema', 3); "; $kanban_generator_types_sql = " CREATE TABLE IF NOT EXISTS `" . $db_table_prefix . "generator_types` ( `id` int(11) NOT NULL AUTO_INCREMENT, `generator_name` varchar(50) NOT NULL, `display_name` varchar(50) NOT NULL, `active` tinyint(1) NOT NULL, `action` varchar(32) NOT NULL, `generator_js` longtext NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; "; $boards_sql = "ALTER TABLE " . $db_table_prefix . "boards ADD board_gens TEXT;"; $db_issue = $db_issue | install_basic_settings($kanban_versions_entry, "versions"); $db_issue = $db_issue | install_table($kanban_generator_types_sql, "generator_types"); $generator_types_path = "../install/generator_types"; $db_issue = $db_issue | import_generator_types($generator_types_path); $db_issue = $db_issue | update_table($boards_sql, "boards"); return $db_issue; } ?>
{ "content_hash": "044b0bdf7f00a1c4eb826eb470fbf013", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 92, "avg_line_length": 32.973684210526315, "alnum_prop": 0.6624102154828412, "repo_name": "benohead/kanban_board", "id": "7f8a83579438a2e8a5c5b4f288d800d58cd9458c", "size": "1253", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "updates/3/update.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "83610" }, { "name": "JavaScript", "bytes": "95419" }, { "name": "PHP", "bytes": "740453" } ], "symlink_target": "" }
package org.biopax.paxtools.pattern.constraint; import org.biopax.paxtools.pattern.Match; import java.util.Set; /** * Checks if the element has the desired ID. This is a separate class (not reusing FieldConstraint) * because PathAccessor cannot access to RDFIDs. * * @author Ozgun Babur */ public class IDConstraint extends ConstraintAdapter { /** * Desired IDs. */ Set<String> ids; /** * Constructor with desired IDs. * @param ids desired IDs for valid elements to have */ public IDConstraint(Set<String> ids) { this.ids = ids; } /** * Returns 1. * @return 1 */ @Override public int getVariableSize() { return 1; } /** * Checks if the element has one of the desired IDs. * @param match current pattern match * @param ind mapped indices * @return true if the ID is in the list */ @Override public boolean satisfies(Match match, int... ind) { return ids.contains(match.get(ind[0]).getRDFId()); } }
{ "content_hash": "7b92acdf7f65f80a1832d7b0c82b41df", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 99, "avg_line_length": 19.12, "alnum_prop": 0.6841004184100419, "repo_name": "CreativeCodingLab/PathwayMatrix", "id": "065bdec957744b08c405720e579b37ced2ed13de", "size": "956", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/org/biopax/paxtools/pattern/constraint/IDConstraint.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2014" }, { "name": "Java", "bytes": "1896846" }, { "name": "Shell", "bytes": "131" }, { "name": "Web Ontology Language", "bytes": "111607786" } ], "symlink_target": "" }
package org.apache.sshd.common; /** * Represents an interface receiving Session events. * * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public interface SessionListener { enum Event { KeyEstablished, Authenticated } /** * A new session just been created * @param session */ void sessionCreated(Session session); /** * An event has been triggered * @param sesssion * @param event */ void sessionEvent(Session sesssion, Event event); /** * A session has been closed * @param session */ void sessionClosed(Session session); }
{ "content_hash": "3a724191a738fa8e174ebb3846ed1bfe", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 76, "avg_line_length": 19.323529411764707, "alnum_prop": 0.6255707762557078, "repo_name": "kohsuke/mina-sshd", "id": "dd30b48523676591a92c68233adaec41b0302250", "size": "1464", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "sshd-core/src/main/java/org/apache/sshd/common/SessionListener.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
// © 2017 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html #include "unicode/utypes.h" #if !UCONFIG_NO_FORMATTING #ifndef __NUMBER_MICROPROPS_H__ #define __NUMBER_MICROPROPS_H__ // TODO: minimize includes #include "unicode/numberformatter.h" #include "number_types.h" #include "number_decimalquantity.h" #include "number_scientific.h" #include "number_patternstring.h" #include "number_modifiers.h" #include "number_multiplier.h" #include "number_roundingutils.h" #include "decNumber.h" #include "charstr.h" U_NAMESPACE_BEGIN namespace number { namespace impl { struct MicroProps : public MicroPropsGenerator { // NOTE: All of these fields are properly initialized in NumberFormatterImpl. RoundingImpl rounder; Grouper grouping; Padder padding; IntegerWidth integerWidth; UNumberSignDisplay sign; UNumberDecimalSeparatorDisplay decimal; bool useCurrency; char nsName[9]; // Note: This struct has no direct ownership of the following pointers. const DecimalFormatSymbols* symbols; const Modifier* modOuter; const Modifier* modMiddle; const Modifier* modInner; // The following "helper" fields may optionally be used during the MicroPropsGenerator. // They live here to retain memory. struct { ScientificModifier scientificModifier; EmptyModifier emptyWeakModifier{false}; EmptyModifier emptyStrongModifier{true}; MultiplierFormatHandler multiplier; } helpers; MicroProps() = default; MicroProps(const MicroProps& other) = default; MicroProps& operator=(const MicroProps& other) = default; void processQuantity(DecimalQuantity&, MicroProps& micros, UErrorCode& status) const U_OVERRIDE { (void) status; if (this == &micros) { // Unsafe path: no need to perform a copy. U_ASSERT(!exhausted); micros.exhausted = true; U_ASSERT(exhausted); } else { // Safe path: copy self into the output micros. micros = *this; } } private: // Internal fields: bool exhausted = false; }; } // namespace impl } // namespace number U_NAMESPACE_END #endif // __NUMBER_MICROPROPS_H__ #endif /* #if !UCONFIG_NO_FORMATTING */
{ "content_hash": "589f3f9a3c1dd0af7b8d62fa6e58c384", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 101, "avg_line_length": 27.80722891566265, "alnum_prop": 0.6867417677642981, "repo_name": "wiltonlazary/arangodb", "id": "d2393aea50c098792345fc3b85b6e9d4db56191a", "size": "2309", "binary": false, "copies": "5", "ref": "refs/heads/devel", "path": "3rdParty/V8/v7.9.317/third_party/icu/source/i18n/number_microprops.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "61827" }, { "name": "C", "bytes": "309788" }, { "name": "C++", "bytes": "34723629" }, { "name": "CMake", "bytes": "383904" }, { "name": "CSS", "bytes": "210549" }, { "name": "EJS", "bytes": "231166" }, { "name": "HTML", "bytes": "23114" }, { "name": "JavaScript", "bytes": "33741286" }, { "name": "LLVM", "bytes": "14975" }, { "name": "NASL", "bytes": "269512" }, { "name": "NSIS", "bytes": "47138" }, { "name": "Pascal", "bytes": "75391" }, { "name": "Perl", "bytes": "9811" }, { "name": "PowerShell", "bytes": "7869" }, { "name": "Python", "bytes": "184352" }, { "name": "SCSS", "bytes": "255542" }, { "name": "Shell", "bytes": "134504" }, { "name": "TypeScript", "bytes": "179074" }, { "name": "Yacc", "bytes": "79620" } ], "symlink_target": "" }
package org.zstack.header.configuration; import org.zstack.header.message.APIEvent; import org.zstack.header.rest.RestResponse; import org.zstack.header.storage.primary.PrimaryStorageConstant; @RestResponse(allTo = "inventory") public class APICreateDiskOfferingEvent extends APIEvent { private DiskOfferingInventory inventory; public APICreateDiskOfferingEvent() { super(null); } public APICreateDiskOfferingEvent(String apiId) { super(apiId); } public DiskOfferingInventory getInventory() { return inventory; } public void setInventory(DiskOfferingInventory inventory) { this.inventory = inventory; } public static APICreateDiskOfferingEvent __example__() { APICreateDiskOfferingEvent event = new APICreateDiskOfferingEvent(); DiskOfferingInventory inventory = new DiskOfferingInventory(); inventory.setName("diskOffering1"); inventory.setDiskSize(100); inventory.setUuid(uuid()); inventory.setAllocatorStrategy(PrimaryStorageConstant.DEFAULT_PRIMARY_STORAGE_ALLOCATION_STRATEGY_TYPE); inventory.setType("DefaultDiskOfferingType"); inventory.setState("Enabled"); event.setInventory(inventory); return event; } }
{ "content_hash": "45af7879169ee8079f73ff48afd6b73b", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 112, "avg_line_length": 30.5, "alnum_prop": 0.7236533957845434, "repo_name": "zsyzsyhao/zstack", "id": "525054f2338a7532db8d3e7d774acd5aec82b746", "size": "1281", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "header/src/main/java/org/zstack/header/configuration/APICreateDiskOfferingEvent.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "59213" }, { "name": "Batchfile", "bytes": "1132" }, { "name": "Groovy", "bytes": "1757693" }, { "name": "Java", "bytes": "15315975" }, { "name": "Shell", "bytes": "154382" } ], "symlink_target": "" }
IXCoin version 0.7.2 is now available from: http://sourceforge.net/projects/ixcoin/files/IXCoin/ixcoin-0.7.2 This is a bug-fix minor release. Please report bugs using the issue tracker at github: https://github.com/ixcoin/ixcoin/issues How to Upgrade -------------- If you are running an older version, shut it down. Wait until it has completely shut down (which might take a few minutes for older versions), then run the installer (on Windows) or just copy over /Applications/IXCoin-Qt (on Mac) or ixcoind/ixcoin-qt (on Linux). If you were running on Linux with a version that might have been compiled with a different version of Berkeley DB (for example, if you were using an Ubuntu PPA version), then run the old version again with the -detachdb argument and shut it down; if you do not, then the new version will not be able to read the database files and will exit with an error. Explanation of -detachdb (and the new "stop true" RPC command): The Berkeley DB database library stores data in both ".dat" and "log" files, so the database is always in a consistent state, even in case of power failure or other sudden shutdown. The format of the ".dat" files is portable between different versions of Berkeley DB, but the "log" files are not-- even minor version differences may have incompatible "log" files. The -detachdb option moves any pending changes from the "log" files to the "blkindex.dat" file for maximum compatibility, but makes shutdown much slower. Note that the "wallet.dat" file is always detached, and versions prior to 0.6.0 detached all databases at shutdown. Bug fixes --------- * Prevent RPC 'move' from deadlocking. This was caused by trying to lock the database twice. * Fix use-after-free problems in initialization and shutdown, the latter of which caused IXCoin-Qt to crash on Windows when exiting. * Correct library linking so building on Windows natively works. * Avoid a race condition and out-of-bounds read in block creation/mining code. * Improve platform compatibility quirks, including fix for 100% CPU utilization on FreeBSD 9. * A few minor corrections to error handling, and updated translations. * OSX 10.5 supported again ---------------------------------------------------- Thanks to everybody who contributed to this release: Alex dansmith Gavin Andresen Gregory Maxwell Jeff Garzik Luke Dashjr Philip Kaufmann Pieter Wuille Wladimir J. van der Laan grimd34th
{ "content_hash": "f12bcbb576008aa36cd68e8220a1e322", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 79, "avg_line_length": 35.75, "alnum_prop": 0.7568901686548746, "repo_name": "vladroberto/IXCoin", "id": "01def72178daf096b6372619e96763b083b80176", "size": "2431", "binary": false, "copies": "1", "ref": "refs/heads/iXcoin", "path": "doc/release-notes/release-notes-0.7.2.md", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "50195" }, { "name": "C++", "bytes": "3202411" }, { "name": "CSS", "bytes": "1127" }, { "name": "HTML", "bytes": "50620" }, { "name": "M4", "bytes": "130331" }, { "name": "Makefile", "bytes": "31936" }, { "name": "NSIS", "bytes": "6504" }, { "name": "Objective-C", "bytes": "1052" }, { "name": "Objective-C++", "bytes": "6328" }, { "name": "Python", "bytes": "123889" }, { "name": "QMake", "bytes": "2773" }, { "name": "Roff", "bytes": "36220" }, { "name": "Shell", "bytes": "57003" } ], "symlink_target": "" }
Param( [Parameter(Position=0, Mandatory=$false, ValueFromPipeline=$true)][string] $CSV, [Parameter(Position=1, Mandatory=$false, ValueFromPipeline=$true)][string] $Count ) #Main Function Main { ""; Write-Host " Office 365: Get Cluttered Mailboxes" -f "green" Write-Host " ------------------------------------------" Write-Host " ATTENZIONE:" -f "red" Write-Host " L'operazione può richiedere MOLTO tempo, dipende dal numero di utenti" -f "red" Write-Host " da verificare e modificare all'interno della Directory, porta pazienza!" -f "red"; "" Write-Host "-------------------------------------------------------------------------------------------------"; "" Function Pause($M="Premi un tasto continuare (CTRL+C per annullare)") { If($psISE) { $S=New-Object -ComObject "WScript.Shell" $B=$S.Popup("Fai clic su OK per continuare.",0,"In attesa dell'amministratore",0) Return } Write-Host -NoNewline $M; $I=16,17,18,20,91,92,93,144,145,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183; While($K.VirtualKeyCode -Eq $Null -Or $I -Contains $K.VirtualKeyCode) { $K=$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") } } Pause try { ""; Write-Host " A long time left, grab a Snickers!" -f yellow Write-Progress -Activity "Download dati da Exchange" -Status "Ricerco tutte le caselle registrate nel sistema..." if ([string]::IsNullOrEmpty($CSV) -eq $true) { #CSV non dichiarato, output a video ""; Write-Host " NESSUN CSV SPECIFICATO" -f "red" if ([string]::IsNullOrEmpty($Count) -eq $true) { $Mailboxes = Get-Mailbox -ResultSize Unlimited } else { Write-Host " Numero mailbox da analizzare: $Count" -f "green"; "" $Mailboxes = Get-Mailbox -ResultSize $Count "" } Write-Host "Hanno la funzione Messaggi Secondari attiva: " -f yellow $Mailboxes | Foreach { $DN = $_.WindowsEmailAddress Write-Progress -Activity "Download dati da Exchange" -Status "Analizzo stato clutter di $DN" -PercentComplete (($i / $Mailboxes.count)*100) $StatoClutter = Get-Clutter -Identity $DN | Select -ExpandProperty isEnabled if ( $StatoClutter -eq "True" ) { Write-Host " - " $DN } } } else { #CSV dichiarato, output in file ""; Write-Host " File CSV di output: $CSV" -f "green" if ([string]::IsNullOrEmpty($Count) -eq $true) { $Mailboxes = Get-Mailbox -ResultSize Unlimited } else { Write-Host " Numero mailbox da analizzare: $Count" -f "green"; "" $Mailboxes = Get-Mailbox -ResultSize $Count "" } Write-Host "Hanno la funzione Messaggi Secondari attiva: " -f yellow $Mailboxes | Foreach { $DN = $_.WindowsEmailAddress Write-Progress -Activity "Download dati da Exchange" -Status "Analizzo stato clutter di $DN" -PercentComplete (($i / $Mailboxes.count)*100) $StatoClutter = Get-Clutter -Identity $DN | Select -ExpandProperty isEnabled if ( $StatoClutter -eq "True" ) { Write-Host " - " $DN Out-File -FilePath $CSV -InputObject "$DN" -Encoding UTF8 -append } } Invoke-Item $CSV } "" } catch { Write-Host "Errore nell'operazione, riprovare." -f "red" write-host $error[0] return "" } } # Start script . Main
{ "content_hash": "aafc4e7331de610ee577a4debf959719", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 147, "avg_line_length": 40.43529411764706, "alnum_prop": 0.5935408786732616, "repo_name": "gioxx/o365", "id": "bc4c5252ed344fb33e1265a405cf6cb841740746", "size": "4717", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ListClutteredMailboxes.ps1", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "138" }, { "name": "PowerShell", "bytes": "233873" }, { "name": "VBScript", "bytes": "742831" } ], "symlink_target": "" }
namespace System.IO { internal static partial class PathHelpers { // Trim trailing white spaces, tabs etc but don't be aggressive in removing everything that has UnicodeCategory of trailing space. // String.WhitespaceChars will trim more aggressively than what the underlying FS does (for ex, NTFS, FAT). internal static readonly char[] TrimEndChars = { (char)0x9, (char)0xA, (char)0xB, (char)0xC, (char)0xD, (char)0x20, (char)0x85, (char)0xA0 }; internal static readonly char[] TrimStartChars = { ' ' }; // Gets the length of the root DirectoryInfo or whatever DirectoryInfo markers // are specified for the first part of the DirectoryInfo name. // internal static int GetRootLength(String path) { CheckInvalidPathChars(path); int i = 0; int length = path.Length; if (length >= 1 && (IsDirectorySeparator(path[0]))) { // handles UNC names and directories off current drive's root. i = 1; if (length >= 2 && (IsDirectorySeparator(path[1]))) { i = 2; int n = 2; while (i < length && (!IsDirectorySeparator(path[i]) || --n > 0)) i++; } } else if (length >= 2 && path[1] == Path.VolumeSeparatorChar) { // handles A:\foo. i = 2; if (length >= 3 && (IsDirectorySeparator(path[2]))) i++; } return i; } internal static bool ShouldReviseDirectoryPathToCurrent(string path) { // In situations where this method is invoked, "<DriveLetter>:" should be special-cased // to instead go to the current directory. return path.Length == 2 && path[1] == ':'; } // ".." can only be used if it is specified as a part of a valid File/Directory name. We disallow // the user being able to use it to move up directories. Here are some examples eg // Valid: a..b abc..d // Invalid: ..ab ab.. .. abc..d\abc.. // internal static void CheckSearchPattern(String searchPattern) { for (int index = 0; (index = searchPattern.IndexOf("..", index, StringComparison.Ordinal)) != -1; index += 2) { // Terminal ".." or "..\". File and directory names cannot end in "..". if (index + 2 == searchPattern.Length || IsDirectorySeparator(searchPattern[index + 2])) { throw new ArgumentException(SR.Arg_InvalidSearchPattern, "searchPattern"); } } } internal static bool IsDirectorySeparator(char c) { return (c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar); } internal static string GetFullPathInternal(string path) { if (path == null) throw new ArgumentNullException("path"); string pathTrimmed = path.TrimStart(TrimStartChars).TrimEnd(TrimEndChars); return Path.GetFullPath(Path.IsPathRooted(pathTrimmed) ? pathTrimmed : path); } // this is a lightweight version of GetDirectoryName that doesn't renormalize internal static string GetDirectoryNameInternal(string path) { string directory, file; SplitDirectoryFile(path, out directory, out file); // file is null when we reach the root return (file == null) ? null : directory; } internal static void SplitDirectoryFile(string path, out string directory, out string file) { directory = null; file = null; // assumes a validated full path if (path != null) { int length = path.Length; int rootLength = GetRootLength(path); // ignore a trailing slash if (length > rootLength && EndsInDirectorySeparator(path)) length--; // find the pivot index between end of string and root for (int pivot = length - 1; pivot >= rootLength; pivot--) { if (IsDirectorySeparator(path[pivot])) { directory = path.Substring(0, pivot); file = path.Substring(pivot + 1, length - pivot - 1); return; } } // no pivot, return just the trimmed directory directory = path.Substring(0, length); } } } }
{ "content_hash": "faedd8635a502ca39fbcc536e64ccc88", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 149, "avg_line_length": 39.203252032520325, "alnum_prop": 0.527789299046039, "repo_name": "chenxizhang/corefx", "id": "a3fbe627c1fc635c9108e88f47d189ad09ee1bd5", "size": "4974", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "src/System.IO.FileSystem/src/System/IO/PathHelpers.Windows.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1555" }, { "name": "C#", "bytes": "83891971" }, { "name": "C++", "bytes": "17218" }, { "name": "Shell", "bytes": "10997" }, { "name": "Visual Basic", "bytes": "827616" } ], "symlink_target": "" }
namespace DotNetNuke.Modules.Reports.Extensions { using System.Collections.Generic; /// ----------------------------------------------------------------------------- /// <summary> /// The IReportsSettingsControl class provides an interface to a Reports Module Settings Control /// </summary> /// <history> /// [anurse] 08/02/2007 Created /// </history> /// ----------------------------------------------------------------------------- public interface IReportsSettingsControl : IReportsControl { /// ----------------------------------------------------------------------------- /// <summary> /// Loads settings from the specified settings dictionary into the /// settings UI /// </summary> /// <param name="Settings">The settings dictionary to load into the UI</param> /// <history> /// [anurse] 08/02/2007 Created /// </history> /// ----------------------------------------------------------------------------- void LoadSettings(Dictionary<string, string> Settings); /// ----------------------------------------------------------------------------- /// <summary> /// Save settings to the specified settings dictionary from the /// settings UI /// </summary> /// <param name="Settings">The settings dictionary to save from the UI</param> /// <history> /// [anurse] 08/02/2007 Created /// </history> /// ----------------------------------------------------------------------------- void SaveSettings(Dictionary<string, string> Settings); } }
{ "content_hash": "6b3aa8a7b188e9d8c0c7b1ef3884b0a2", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 104, "avg_line_length": 44.07692307692308, "alnum_prop": 0.3990692262943572, "repo_name": "DNNCommunity/DNN.Reports", "id": "064608d0b69b69b7f656eff0d102efd2fc2a5125", "size": "2933", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Components/Extensions/IReportsSettingsControl.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP.NET", "bytes": "30664" }, { "name": "C#", "bytes": "331170" }, { "name": "JavaScript", "bytes": "2827" }, { "name": "XSLT", "bytes": "1082" } ], "symlink_target": "" }
 using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; namespace XPFriend.FixtureTest { class ExceptionEditors { public void Dummy1(ApplicationException e) {} static void Dummy2(ApplicationException e) { } public static object Dummy3(object o) { return null; } public static object Dummy4() { return null; } public static object Dummy5(ApplicationException e, object o) { return null; } public static object EditApplicationException(ApplicationException e) { Console.WriteLine(e); Assert.AreEqual("app", e.Message); return new Dictionary<string, string>() { { "Message", "zzz" } }; } public static object EditSystemException(SystemException e) { Console.WriteLine(e); Assert.AreEqual("sys", e.Message); return new Dictionary<string, string>() { { "Message", "zzz" } }; } } }
{ "content_hash": "962d0953cddf801d4e5c66880825217d", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 86, "avg_line_length": 34.233333333333334, "alnum_prop": 0.611489776046738, "repo_name": "ototadana/FixtureBook", "id": "28b1e3e11a92242d81499c48eaaad77d801e787f", "size": "1645", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "FixtureBookTest/FixtureTest/ExceptionEditors.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "657879" } ], "symlink_target": "" }
#include "pnacl.h" #include <assert.h> #include <errno.h> #include <fcntl.h> #include <getopt.h> #include <inttypes.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/time.h> #include <time.h> #include <unistd.h> /* Some crazy system where this isn't true? */ PN_STATIC_ASSERT(sizeof(float) == sizeof(uint32_t)); PN_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t)); /* These asserts allow us to ensure that for all atomic ops, the types are * consecutive and the types are ordered i8, i16, i32, i64. We can then safely * do basic arithmetic on the enum value. */ #define PN_ASSERT_ATOMIC_SEQUENTIAL_TYPES(opcode) \ PN_STATIC_ASSERT( \ PN_OPCODE_INTRINSIC_LLVM_NACL_ATOMIC_##opcode##_I8 < \ PN_OPCODE_INTRINSIC_LLVM_NACL_ATOMIC_##opcode##_I16 && \ PN_OPCODE_INTRINSIC_LLVM_NACL_ATOMIC_##opcode##_I16 < \ PN_OPCODE_INTRINSIC_LLVM_NACL_ATOMIC_##opcode##_I32 && \ PN_OPCODE_INTRINSIC_LLVM_NACL_ATOMIC_##opcode##_I32 < \ PN_OPCODE_INTRINSIC_LLVM_NACL_ATOMIC_##opcode##_I64 && \ PN_OPCODE_INTRINSIC_LLVM_NACL_ATOMIC_##opcode##_I64 - \ PN_OPCODE_INTRINSIC_LLVM_NACL_ATOMIC_##opcode##_I8 == \ 3) /* no semicolon */ PN_ASSERT_ATOMIC_SEQUENTIAL_TYPES(RMW); PN_ASSERT_ATOMIC_SEQUENTIAL_TYPES(ADD); PN_ASSERT_ATOMIC_SEQUENTIAL_TYPES(SUB); PN_ASSERT_ATOMIC_SEQUENTIAL_TYPES(AND); PN_ASSERT_ATOMIC_SEQUENTIAL_TYPES(OR); PN_ASSERT_ATOMIC_SEQUENTIAL_TYPES(XOR); PN_ASSERT_ATOMIC_SEQUENTIAL_TYPES(EXCHANGE); #undef PN_ASSERT_ATOMIC_SEQUENTIAL_TYPES /**** GLOBAL VARIABLES ********************************************************/ static int g_pn_verbose; static const char* g_pn_filename; static char** g_pn_argv; static char** g_pn_environ; static uint32_t g_pn_memory_size = PN_DEFAULT_MEMORY_SIZE; static PNBool g_pn_dedupe_phi_nodes = PN_TRUE; static PNBool g_pn_print_named_functions; #if PN_CALCULATE_PRED_BBS static char* g_pn_print_block_graph_function; #endif /* PN_CALCULATE_PRED_BBS */ static PNBool g_pn_print_stats; static PNBool g_pn_print_opcode_counts; static PNBool g_pn_run = PN_TRUE; static uint32_t g_pn_opcode_count[PN_MAX_OPCODE]; static PNBool g_pn_repeat_load_times = 1; #if PN_PPAPI static PNBool g_pn_ppapi = PN_FALSE; #endif /* PN_PPAPI */ static PNBool g_pn_filesystem_access = PN_FALSE; #if PN_TRACING static const char* g_pn_trace_function_filter; static int g_pn_trace_indent; #define PN_TRACE_DEFINE(name, flag) static PNBool g_pn_trace_##name; PN_FOREACH_TRACE(PN_TRACE_DEFINE) #undef PN_TRACE_DEFINE #endif /* PN_TRACING */ #if PN_TIMERS static struct timespec g_pn_timer_times[PN_NUM_TIMERS]; static PNBool g_pn_print_time; static PNBool g_pn_print_time_as_zero; #endif /* PN_TIMERS */ static const char* g_pn_opcode_names[] = { #define PN_OPCODE(e) #e, PN_FOREACH_OPCODE(PN_OPCODE) #undef PN_OPCODE #define PN_INTRINSIC_OPCODE(e, name) "INTRINSIC_" #e, PN_FOREACH_INTRINSIC(PN_INTRINSIC_OPCODE) #undef PN_INTRINSIC_OPCODE #define PN_ATOMIC_RMW_INTRINSIC_OPCODE(e) "INTRINSIC_" #e, PN_FOREACH_ATOMIC_RMW_INTRINSIC_OPCODE(PN_ATOMIC_RMW_INTRINSIC_OPCODE) #undef PN_ATOMIC_RMW_INTRINSIC_OPCODE }; /**** SOURCES *****************************************************************/ #include "pn_bits.h" #include "pn_malloc.h" #include "pn_timespec.h" #include "pn_allocator.h" #include "pn_bitset.h" #include "pn_bitstream.h" #include "pn_record.h" #include "pn_abbrev.h" #include "pn_memory.h" #include "pn_module.h" #include "pn_function.h" #include "pn_trace.h" #include "pn_calculate_result_value_types.h" #include "pn_calculate_opcodes.h" #include "pn_calculate_uses.h" #include "pn_calculate_pred_bbs.h" #include "pn_calculate_phi_assigns.h" #include "pn_calculate_loops.h" #include "pn_calculate_liveness.h" #include "pn_read.h" #include "pn_executor.h" #include "pn_filesystem.h" #include "pn_builtins.h" #include "pn_ppapi.h" /* Option parsing, environment variables */ enum { PN_FLAG_VERBOSE, PN_FLAG_HELP, PN_FLAG_MEMORY_SIZE, PN_FLAG_NO_RUN, PN_FLAG_FILESYSTEM_ACCESS, #if PN_PPAPI PN_FLAG_PPAPI, #endif /* PN_PPAPI */ PN_FLAG_ENV, PN_FLAG_USE_HOST_ENV, PN_FLAG_NO_DEDUPE_PHI_NODES, #if PN_TRACING PN_FLAG_TRACE_ALL, PN_FLAG_TRACE_BLOCK, PN_FLAG_TRACE_BCDIS, #define PN_TRACE_FLAGS(name, flag) PN_FLAG_TRACE_##name, PN_FOREACH_TRACE(PN_TRACE_FLAGS) #undef PN_TRACE_FLAGS PN_FLAG_TRACE_FUNCTION_FILTER, #endif /* PN_TRACING */ PN_FLAG_PRINT_ALL, PN_FLAG_PRINT_NAMED_FUNCTIONS, #if PN_CALCULATE_PRED_BBS PN_FLAG_PRINT_BLOCK_GRAPH, #endif /* PN_CALCULATE_PRED_BBS */ #if PN_TIMERS PN_FLAG_PRINT_TIME, PN_FLAG_PRINT_TIME_AS_ZERO, #endif /* PN_TIMERS */ PN_FLAG_PRINT_OPCODE_COUNTS, PN_FLAG_PRINT_STATS, PN_FLAG_REPEAT_LOAD, PN_NUM_FLAGS }; static struct option g_pn_long_options[] = { {"verbose", no_argument, NULL, 'v'}, {"help", no_argument, NULL, 'h'}, {"memory-size", required_argument, NULL, 'm'}, {"no-run", no_argument, NULL, 'n'}, {"filesystem-access", no_argument, NULL, 'a'}, #if PN_PPAPI {"ppapi", no_argument, NULL, 0}, #endif /* PN_PPAPI */ {"env", required_argument, NULL, 'e'}, {"use-host-env", no_argument, NULL, 'E'}, {"no-dedupe-phi-nodes", no_argument, NULL, 0}, #if PN_TRACING {"trace-all", no_argument, NULL, 't'}, {"trace-block", no_argument, NULL, 0}, {"trace-bcdis", no_argument, NULL, 0}, #define PN_TRACE_FLAGS(name, flag) \ {"trace-" flag, no_argument, NULL, 0}, PN_FOREACH_TRACE(PN_TRACE_FLAGS) #undef PN_TRACE_FLAGS {"trace-function-filter", required_argument, NULL, 0}, #endif /* PN_TRACING */ {"print-all", no_argument, NULL, 'p'}, {"print-named-functions", no_argument, NULL, 0}, #if PN_CALCULATE_PRED_BBS {"print-block-graph", required_argument, NULL, 0}, #endif /* PN_CALCULATE_PRED_BBS */ #if PN_TIMERS {"print-time", no_argument, NULL, 0}, {"print-time-as-zero", no_argument, NULL, 0}, #endif /* PN_TIMERS */ {"print-opcode-counts", no_argument, NULL, 0}, {"print-stats", no_argument, NULL, 0}, {"repeat-load", required_argument, NULL, 0}, {NULL, 0, NULL, 0}, }; PN_STATIC_ASSERT(PN_NUM_FLAGS + 1 == PN_ARRAY_SIZE(g_pn_long_options)); typedef struct PNOptionHelp { int flag; const char* metavar; const char* help; } PNOptionHelp; static PNOptionHelp g_pn_option_help[] = { {PN_FLAG_MEMORY_SIZE, "SIZE", "size of runtime memory. suffixes k=1024, m=1024*1024"}, {PN_FLAG_ENV, "KEY=VALUE", "set runtime environment variable KEY to VALUE"}, {PN_FLAG_FILESYSTEM_ACCESS, NULL, "allow access to host filesystem"}, #if PN_TRACING {PN_FLAG_TRACE_FUNCTION_FILTER, "NAME", "only trace function with given name or id"}, #endif /* PN_TRACING */ #if PN_CALCULATE_PRED_BBS {PN_FLAG_PRINT_BLOCK_GRAPH, "NAME", "print the basic-block graph of a function with given name or id"}, #endif /* PN_CALCULATE_PRED_BBS */ {PN_FLAG_REPEAT_LOAD, "TIMES", "number of times to repeat loading. Useful for profiling"}, {PN_NUM_FLAGS, NULL}, }; static void pn_usage(const char* prog) { PN_PRINT("usage: %s [option] filename\n", prog); PN_PRINT("options:\n"); struct option* opt = &g_pn_long_options[0]; int i = 0; for (; opt->name; ++i, ++opt) { PNOptionHelp* help = NULL; int n = 0; while (g_pn_option_help[n].help) { if (i == g_pn_option_help[n].flag) { help = &g_pn_option_help[n]; break; } n++; } if (opt->val) { PN_PRINT(" -%c, ", opt->val); } else { PN_PRINT(" "); } if (help && help->metavar) { char buf[100]; snprintf(buf, 100, "%s=%s", opt->name, help->metavar); PN_PRINT("--%-30s", buf); } else { PN_PRINT("--%-30s", opt->name); } if (help) { PN_PRINT("%s", help->help); } PN_PRINT("\n"); } exit(0); } static char** pn_environ_copy(char** environ) { char** env; int num_keys = 0; for (env = environ; *env; ++env) { num_keys++; } char** result = pn_calloc(num_keys + 1, sizeof(char*)); int i = 0; for (env = environ; *env; ++env, ++i) { result[i] = pn_strdup(*env); } return result; } static void pn_environ_free(char** environ) { char** env; for (env = environ; *env; ++env) { pn_free(*env); } pn_free(environ); } static void pn_environ_put(char*** environ, char* value) { char* equals = strchr(value, '='); int count = equals ? equals - value : strlen(value); PNBool remove = equals == NULL; int num_keys = 0; if (*environ) { char** env; for (env = *environ; *env; ++env, ++num_keys) { if (strncasecmp(value, *env, count) != 0) { continue; } pn_free(*env); if (remove) { for (; *env; ++env) { *env = *(env + 1); } } else { *env = pn_strdup(value); } return; } } if (!remove) { *environ = pn_realloc(*environ, (num_keys + 2) * sizeof(char*)); (*environ)[num_keys] = pn_strdup(value); (*environ)[num_keys + 1] = 0; } } static void pn_environ_put_all(char*** environ, char** environ_to_put) { char** env; for (env = environ_to_put; *env; ++env) { pn_environ_put(environ, *env); } } static void pn_environ_print(char** environ) { if (environ) { char** env; for (env = environ; *env; ++env) { PN_PRINT(" %s\n", *env); } } } static void pn_options_parse(int argc, char** argv, char** env) { int c; int option_index; char** environ_copy = pn_environ_copy(env); while (1) { c = getopt_long(argc, argv, "vm:nae:Ehtp", g_pn_long_options, &option_index); if (c == -1) { break; } redo_switch: switch (c) { case 0: c = g_pn_long_options[option_index].val; if (c) { goto redo_switch; } switch (option_index) { case PN_FLAG_VERBOSE: case PN_FLAG_HELP: case PN_FLAG_MEMORY_SIZE: case PN_FLAG_NO_RUN: case PN_FLAG_ENV: case PN_FLAG_USE_HOST_ENV: #if PN_TRACING case PN_FLAG_TRACE_ALL: #endif /* PN_TRACING */ case PN_FLAG_PRINT_ALL: /* Handled above by goto */ PN_UNREACHABLE(); #if PN_PPAPI case PN_FLAG_PPAPI: g_pn_ppapi = PN_TRUE; break; #endif /* PN_PPAPI */ case PN_FLAG_NO_DEDUPE_PHI_NODES: g_pn_dedupe_phi_nodes = PN_FALSE; break; #if PN_TRACING case PN_FLAG_TRACE_BCDIS: #define PN_TRACE_UNSET(name, flag) g_pn_trace_##name = PN_FALSE; PN_FOREACH_TRACE(PN_TRACE_UNSET) #undef PN_TRACE_UNSET g_pn_trace_ABBREV = PN_TRUE; g_pn_trace_BLOCKINFO_BLOCK = PN_TRUE; g_pn_trace_TYPE_BLOCK = PN_TRUE; g_pn_trace_GLOBALVAR_BLOCK = PN_TRUE; g_pn_trace_VALUE_SYMTAB_BLOCK = PN_TRUE; g_pn_trace_CONSTANTS_BLOCK = PN_TRUE; g_pn_trace_FUNCTION_BLOCK = PN_TRUE; g_pn_trace_MODULE_BLOCK = PN_TRUE; g_pn_trace_INSTRUCTIONS = PN_TRUE; break; case PN_FLAG_TRACE_BLOCK: g_pn_trace_BLOCKINFO_BLOCK = PN_TRUE; g_pn_trace_TYPE_BLOCK = PN_TRUE; g_pn_trace_GLOBALVAR_BLOCK = PN_TRUE; g_pn_trace_VALUE_SYMTAB_BLOCK = PN_TRUE; g_pn_trace_CONSTANTS_BLOCK = PN_TRUE; g_pn_trace_FUNCTION_BLOCK = PN_TRUE; g_pn_trace_MODULE_BLOCK = PN_TRUE; break; #define PN_TRACE_OPTIONS(name, flag) \ case PN_FLAG_TRACE_##name: \ g_pn_trace_##name = PN_TRUE; \ break; PN_FOREACH_TRACE(PN_TRACE_OPTIONS); #undef PN_TRACE_OPTIONS case PN_FLAG_TRACE_FUNCTION_FILTER: g_pn_trace_function_filter = optarg; break; #endif /* PN_TRACING */ case PN_FLAG_PRINT_NAMED_FUNCTIONS: g_pn_print_named_functions = PN_TRUE; break; #if PN_CALCULATE_PRED_BBS case PN_FLAG_PRINT_BLOCK_GRAPH: g_pn_print_block_graph_function = optarg; break; #endif /* PN_CALCULATE_PRED_BBS */ #if PN_TIMERS case PN_FLAG_PRINT_TIME: g_pn_print_time = PN_TRUE; break; case PN_FLAG_PRINT_TIME_AS_ZERO: g_pn_print_time_as_zero = PN_TRUE; break; #endif /* PN_TIMERS */ case PN_FLAG_PRINT_STATS: g_pn_print_stats = PN_TRUE; break; case PN_FLAG_PRINT_OPCODE_COUNTS: g_pn_print_opcode_counts = PN_TRUE; break; case PN_FLAG_REPEAT_LOAD: { char* endptr; errno = 0; long int times = strtol(optarg, &endptr, 10); size_t optarg_len = strlen(optarg); if (errno != 0 || optarg_len != (endptr - optarg)) { PN_FATAL("Unable to parse repeat-times flag \"%s\".\n", optarg); } g_pn_repeat_load_times = times; break; } } break; case 'v': g_pn_verbose++; break; case 'm': { char* endptr; errno = 0; long int size = strtol(optarg, &endptr, 10); size_t optarg_len = strlen(optarg); if (errno != 0) { PN_FATAL("Unable to parse memory-size flag \"%s\".\n", optarg); } if (endptr == optarg + optarg_len - 1) { if (*endptr == 'k' || *endptr == 'K') { size *= 1024; } else if (*endptr == 'm' || *endptr == 'M') { size *= 1024 * 1024; } else { PN_FATAL("Unknown suffix on memory-size \"%s\".\n", optarg); } } else if (endptr == optarg + optarg_len) { /* Size in bytes, do nothing */ } else { PN_FATAL("Unable to parse memory-size flag \"%s\".\n", optarg); } if (size < PN_MEMORY_GUARD_SIZE) { PN_FATAL( "Cannot set memory-size (%ld) smaller than guard size (%d).\n", size, PN_MEMORY_GUARD_SIZE); } size = pn_align_up(size, PN_PAGESIZE); PN_TRACE(FLAGS, "Setting memory-size to %ld\n", size); g_pn_memory_size = size; break; } case 'n': g_pn_run = PN_FALSE; break; case 'e': pn_environ_put(&g_pn_environ, optarg); break; case 'E': pn_environ_put_all(&g_pn_environ, environ_copy); break; case 't': #if PN_TRACING #define PN_TRACE_OPTIONS(name, flag) g_pn_trace_##name = PN_TRUE; PN_FOREACH_TRACE(PN_TRACE_OPTIONS); #undef PN_TRACE_OPTIONS #else PN_ERROR("PN_TRACING not enabled.\n"); #endif break; case 'p': #if PN_TIMERS g_pn_print_time = PN_TRUE; #endif /* PN_TIMERS */ g_pn_print_stats = PN_TRUE; break; case 'a': g_pn_filesystem_access = PN_TRUE; break; case 'h': pn_usage(argv[0]); case '?': break; default: PN_ERROR("getopt_long returned '%c' (%d)\n", c, c); break; } } if (optind < argc) { g_pn_filename = argv[optind]; } else { PN_ERROR("No filename given.\n"); pn_usage(argv[0]); } g_pn_argv = argv + optind; #if PN_TRACING /* Handle flag dependencies */ if (g_pn_trace_INSTRUCTIONS) { g_pn_trace_BASIC_BLOCKS = PN_TRUE; } if (g_pn_trace_BASIC_BLOCK_EXTRAS) { g_pn_trace_BASIC_BLOCKS = PN_TRUE; } if (g_pn_trace_BASIC_BLOCKS) { g_pn_trace_FUNCTION_BLOCK = PN_TRUE; } if (g_pn_trace_EXECUTE) { g_pn_trace_IRT = PN_TRUE; g_pn_trace_INTRINSICS = PN_TRUE; } #endif /* PN_TRACING */ pn_environ_free(environ_copy); #if PN_TRACING if (g_pn_trace_FLAGS) { PN_PRINT("*** ARGS:\n"); if (g_pn_argv) { char** p; int i = 0; for (p = g_pn_argv; *p; ++p, ++i) { PN_PRINT(" [%d] %s\n", i, *p); } } PN_PRINT("*** ENVIRONMENT:\n"); pn_environ_print(g_pn_environ); } #endif /* PN_TRACING */ } #define PN_MAX_NUM(name) \ static uint32_t pn_max_num_##name(PNModule* module) { \ uint32_t result = 0; \ uint32_t n; \ for (n = 0; n < module->num_functions; ++n) { \ if (module->functions[n].num_##name > result) { \ result = module->functions[n].num_##name; \ } \ } \ return result; \ } #define PN_TOTAL_NUM(name) \ static uint32_t pn_total_num_##name(PNModule* module) { \ uint32_t result = 0; \ uint32_t n; \ for (n = 0; n < module->num_functions; ++n) { \ result += module->functions[n].num_##name; \ } \ return result; \ } PN_MAX_NUM(constants) PN_MAX_NUM(values) PN_MAX_NUM(bbs) PN_MAX_NUM(instructions) PN_TOTAL_NUM(constants) PN_TOTAL_NUM(values) PN_TOTAL_NUM(bbs) PN_TOTAL_NUM(instructions) #undef PN_MAX_NUM #undef PN_TOTAL_NUM static const char* pn_human_readable_size_leaky(size_t size) { const size_t gig = 1024 * 1024 * 1024; const size_t meg = 1024 * 1024; const size_t kilo = 1024; char buffer[100]; if (size >= gig) { snprintf(buffer, 100, "%.1fG", (size + gig - 1) / (double)gig); } else if (size >= meg) { snprintf(buffer, 100, "%.1fM", (size + meg - 1) / (double)meg); } else if (size >= kilo) { snprintf(buffer, 100, "%.1fK", (size + kilo - 1) / (double)kilo); } else { snprintf(buffer, 100, "%" PRIdPTR, size); } return pn_strdup(buffer); } static void pn_allocator_print_stats_leaky(PNAllocator* allocator) { PN_PRINT("%12s allocator: used: %7s frag: %7s\n", allocator->name, pn_human_readable_size_leaky(allocator->total_used), pn_human_readable_size_leaky(allocator->internal_fragmentation)); } typedef struct PNOpcodeCountPair { PNOpcode opcode; uint32_t count; } PNOpcodeCountPair; static int pn_opcode_count_pair_compare(const void* a, const void* b) { return ((PNOpcodeCountPair*)b)->count - ((PNOpcodeCountPair*)a)->count; } typedef struct PNFileData { void* data; size_t size; } PNFileData; static PNFileData pn_read_file(const char* filename) { PNFileData result = {}; PN_BEGIN_TIME(FILE_READ); FILE* f = fopen(g_pn_filename, "r"); if (!f) { PN_FATAL("unable to read %s\n", g_pn_filename); } fseek(f, 0, SEEK_END); size_t fsize = ftell(f); fseek(f, 0, SEEK_SET); result.data = pn_malloc(fsize); result.size = fread(result.data, 1, fsize, f); if (result.size != fsize) { PN_FATAL("unable to read data from file\n"); } fclose(f); PN_END_TIME(FILE_READ); return result; } #if PN_CALCULATE_PRED_BBS static void pn_print_basic_block_graph(PNModule* module) { if (!g_pn_print_block_graph_function || !g_pn_print_block_graph_function[0]) { return; } PNFunctionId index = PN_INVALID_FUNCTION_ID; int i; char first = g_pn_print_block_graph_function[0]; if (first >= '0' && first <= '9') { /* Filter based on function id */ index = atoi(g_pn_print_block_graph_function); if (index >= module->num_functions) { PN_FATAL("Invalid function id: %d\n", index); } } else { for (i = 0; i < module->num_functions; ++i) { PNFunction* function = &module->functions[i]; if (function->name) { if (strcmp(function->name, g_pn_print_block_graph_function) == 0) { index = i; break; } } } if (index == -1) { PN_FATAL("Invalid function name: \"%s\"\n", g_pn_print_block_graph_function); } } PNFunction* function = &module->functions[index]; /* Print graph in dot format */ PN_PRINT("digraph {\n"); for (i = 0; i < function->num_bbs; ++i) { PN_PRINT(" B%d", i); #if PN_CALCULATE_LOOPS PNBasicBlock* bb = &function->bbs[i]; if (bb->is_loop_header) { PN_PRINT(" [style = bold]"); } #endif PN_PRINT(";\n"); } for (i = 0; i < function->num_bbs; ++i) { PNBasicBlock* bb = &function->bbs[i]; int j; for (j = 0; j < bb->num_succ_bbs; ++j) { PN_PRINT(" B%d -> B%d", i, bb->succ_bb_ids[j]); #if PN_CALCULATE_LOOPS if (bb->succ_bb_ids[j] == bb->loop_header_id) { PN_PRINT(" [style = dotted]"); } #endif PN_PRINT(";\n"); } } PN_PRINT("}\n"); } #endif /* PN_CALCULATE_PRED_BBS */ static void pn_print_stats(PNModule* module) { #if PN_TIMERS if (g_pn_print_time) { PN_PRINT("-----------------\n"); double time = 0; double percent = 0; #define PN_PRINT_TIMER(name) \ struct timespec* timer_##name = &g_pn_timer_times[PN_TIMER_##name]; \ if (!g_pn_print_time_as_zero) { \ time = pn_timespec_to_double(timer_##name); \ percent = 100 * pn_timespec_to_double(timer_##name) / \ pn_timespec_to_double(timer_TOTAL); \ } \ PN_PRINT("timer %-30s: %f sec (%%%.0f)\n", #name, time, percent); PN_FOREACH_TIMER(PN_PRINT_TIMER); #undef PN_PRINT_TIMER } #endif /* PN_TIMERS */ if (g_pn_print_named_functions) { PN_PRINT("-----------------\n"); uint32_t i; for (i = 0; i < module->num_functions; ++i) { PNFunction* function = &module->functions[i]; if (function->name) { PN_PRINT("%d. %s\n", i, function->name); } } } if (g_pn_print_stats) { PN_PRINT("-----------------\n"); PN_PRINT("num_types: %u\n", module->num_types); PN_PRINT("num_functions: %u\n", module->num_functions); PN_PRINT("num_global_vars: %u\n", module->num_global_vars); PN_PRINT("max num_constants: %u\n", pn_max_num_constants(module)); PN_PRINT("max num_values: %u\n", pn_max_num_values(module)); PN_PRINT("max num_bbs: %u\n", pn_max_num_bbs(module)); PN_PRINT("max num_instructions: %u\n", pn_max_num_instructions(module)); PN_PRINT("total num_constants: %u\n", pn_total_num_constants(module)); PN_PRINT("total num_values: %u\n", pn_total_num_values(module)); PN_PRINT("total num_bbs: %u\n", pn_total_num_bbs(module)); PN_PRINT("total num_instructions: %u\n", pn_total_num_instructions(module)); PN_PRINT("global_var size : %s\n", pn_human_readable_size_leaky(module->memory->globalvar_end - module->memory->globalvar_start)); PN_PRINT("startinfo size : %s\n", pn_human_readable_size_leaky(module->memory->startinfo_end - module->memory->startinfo_start)); pn_allocator_print_stats_leaky(&module->allocator); pn_allocator_print_stats_leaky(&module->value_allocator); pn_allocator_print_stats_leaky(&module->instruction_allocator); } if (g_pn_print_opcode_counts) { PNOpcodeCountPair pairs[PN_MAX_OPCODE]; uint32_t n; for (n = 0; n < PN_MAX_OPCODE; ++n) { pairs[n].opcode = n; pairs[n].count = g_pn_opcode_count[n]; } qsort(&pairs, PN_MAX_OPCODE, sizeof(PNOpcodeCountPair), pn_opcode_count_pair_compare); PN_PRINT("-----------------\n"); for (n = 0; n < PN_MAX_OPCODE; ++n) { if (pairs[n].count > 0) { PN_PRINT("%40s %d\n", g_pn_opcode_names[pairs[n].opcode], pairs[n].count); } } } } void pn_read_context_init(PNReadContext* read_context) { memset(read_context, 0, sizeof(*read_context)); #if PN_TRACING read_context->define_abbrev = pn_trace_define_abbrev; read_context->before_blockinfo_block = pn_trace_before_blockinfo_block; read_context->blockinfo_setbid = pn_trace_blockinfo_setbid; read_context->blockinfo_blockname = pn_trace_blockinfo_blockname; read_context->blockinfo_setrecordname = pn_trace_blockinfo_setrecordname; read_context->after_blockinfo_block = pn_trace_after_blockinfo_block; read_context->before_type_block = pn_trace_before_type_block; read_context->type_num_entries = pn_trace_type_num_entries; read_context->type_entry = pn_trace_type_entry; read_context->after_type_block = pn_trace_after_type_block; read_context->before_globalvar_block = pn_trace_before_globalvar_block; read_context->globalvar_before_var = pn_trace_globalvar_before_var; read_context->globalvar_compound = pn_trace_globalvar_compound; read_context->globalvar_zerofill = pn_trace_globalvar_zerofill; read_context->globalvar_data = pn_trace_globalvar_data; read_context->globalvar_reloc = pn_trace_globalvar_reloc; read_context->globalvar_count = pn_trace_globalvar_count; read_context->globalvar_after_var = pn_trace_globalvar_after_var; read_context->after_globalvar_block = pn_trace_after_globalvar_block; read_context->before_value_symtab_block = pn_trace_before_value_symtab_block; read_context->value_symtab_entry = pn_trace_value_symtab_entry; read_context->value_symtab_intrinsic = pn_trace_value_symtab_intrinsic; read_context->after_value_symtab_block = pn_trace_after_value_symtab_block; read_context->before_constants_block = pn_trace_before_constants_block; read_context->constants_settype = pn_trace_constants_settype; read_context->constants_value = pn_trace_constants_value; read_context->after_constants_block = pn_trace_after_constants_block; read_context->before_function_block = pn_trace_before_function_block; read_context->function_numblocks = pn_trace_function_numblocks; read_context->after_function_block = pn_trace_after_function_block; read_context->before_module_block = pn_trace_before_module_block; read_context->module_version = pn_trace_module_version; read_context->module_function = pn_trace_module_function; read_context->after_module_block = pn_trace_after_module_block; #endif } int main(int argc, char** argv, char** envp) { PN_BEGIN_TIME(TOTAL); pn_options_parse(argc, argv, envp); PNFileData file_data = pn_read_file(g_pn_filename); PNReadContext read_context; PNMemory memory; PNModule module; PNBitStream bs; pn_read_context_init(&read_context); pn_memory_init(&memory, g_pn_memory_size); pn_module_init(&module, &memory); pn_bitstream_init(&bs, file_data.data, file_data.size); uint32_t load_count; for (load_count = 0; load_count < g_pn_repeat_load_times; ++load_count) { pn_module_read(&read_context, &module, &bs); /* Reset the state so everything can be reloaded */ if (g_pn_repeat_load_times > 1 && load_count != g_pn_repeat_load_times - 1) { pn_bitstream_seek_bit(&bs, 0); pn_memory_reset(&memory); pn_module_reset(&module); } } if (g_pn_run) { PN_BEGIN_TIME(EXECUTE); PNExecutor executor = {}; pn_memory_init_startinfo(&memory, g_pn_argv, g_pn_environ); #if PN_PPAPI if (g_pn_ppapi) { pn_memory_init_ppapi(&memory); } #endif /* PN_PPAPI */ pn_executor_init(&executor, &module); pn_executor_run(&executor); PN_END_TIME(EXECUTE); if (g_pn_verbose) { PN_PRINT("Exit code: %d\n", executor.exit_code); } } PN_END_TIME(TOTAL); #if PN_CALCULATE_PRED_BBS pn_print_basic_block_graph(&module); #endif /* PN_CALCULATE_PRED_BBS */ pn_print_stats(&module); return 0; }
{ "content_hash": "00243216582a12823d0eb9ac9a6f0362", "timestamp": "", "source": "github", "line_count": 928, "max_line_length": 80, "avg_line_length": 29.842672413793103, "alnum_prop": 0.5834837871018993, "repo_name": "binji/pnacl.c", "id": "0c8d2afb79220404ea02a52a0d46d32fbdfcff98", "size": "27866", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/pnacl.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "457887" }, { "name": "C++", "bytes": "52151" }, { "name": "Makefile", "bytes": "4645" }, { "name": "Python", "bytes": "21921" } ], "symlink_target": "" }
example ======= Note consuming code must call `load` before accessing the `env` map. usage ----- From this directory, run ```sh $ dart run example.dart ``` ###### setup Define variables in a `.env` file. ```sh $ cp .env.example .env ```
{ "content_hash": "f19de98758e7ff32ac07d10330475f69", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 68, "avg_line_length": 11.619047619047619, "alnum_prop": 0.6229508196721312, "repo_name": "mockturtl/dotenv", "id": "da5a495118d5c66936b0048717ad07976f242a6e", "size": "244", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "example/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Dart", "bytes": "18821" }, { "name": "Shell", "bytes": "1775" } ], "symlink_target": "" }
<?php /** * @namespace */ namespace ZendTest\Db\Adapter\TestAsset\Testnamespace; /** * @see Zend_Db_Adapter_Static */ /** * Class for connecting to SQL databases and performing common operations. * * @category Zend * @package Zend_Db * @subpackage UnitTests * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class StaticAdapter extends \ZendTest\Db\Adapter\TestAsset\StaticAdapter { }
{ "content_hash": "41c18e061c486c1f4257088c8a6d1ea9", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 87, "avg_line_length": 20.92, "alnum_prop": 0.7017208413001912, "repo_name": "rgarro/zf2", "id": "45f2e372ca9aa3cf9ef222cb3e755f28e2b8a7d6", "size": "1216", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/Zend/Db/Adapter/TestAsset/Testnamespace/StaticAdapter.php", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
{ "content_hash": "acabc60e39919986784f958ec92cbf56", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 23, "avg_line_length": 9.076923076923077, "alnum_prop": 0.6779661016949152, "repo_name": "mdoering/backbone", "id": "d7f5398ae002e622d1087b6786576c9007350164", "size": "176", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Solanales/Convolvulaceae/Ipomoea/Ipomoea abutilodes/Ipomoea abutilodes abutilodes/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package daemon // import "github.com/docker/docker/daemon" import ( "fmt" "io/ioutil" "os" "github.com/docker/docker/container" "github.com/docker/docker/pkg/system" "github.com/docker/libnetwork" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) func (daemon *Daemon) setupLinkedContainers(container *container.Container) ([]string, error) { return nil, nil } func (daemon *Daemon) setupConfigDir(c *container.Container) (setupErr error) { if len(c.ConfigReferences) == 0 { return nil } localPath := c.ConfigsDirPath() logrus.Debugf("configs: setting up config dir: %s", localPath) // create local config root if err := system.MkdirAllWithACL(localPath, 0, system.SddlAdministratorsLocalSystem); err != nil { return errors.Wrap(err, "error creating config dir") } defer func() { if setupErr != nil { if err := os.RemoveAll(localPath); err != nil { logrus.Errorf("error cleaning up config dir: %s", err) } } }() if c.DependencyStore == nil { return fmt.Errorf("config store is not initialized") } for _, configRef := range c.ConfigReferences { // TODO (ehazlett): use type switch when more are supported if configRef.File == nil { logrus.Error("config target type is not a file target") continue } fPath := c.ConfigFilePath(*configRef) log := logrus.WithFields(logrus.Fields{"name": configRef.File.Name, "path": fPath}) log.Debug("injecting config") config, err := c.DependencyStore.Configs().Get(configRef.ConfigID) if err != nil { return errors.Wrap(err, "unable to get config from config store") } if err := ioutil.WriteFile(fPath, config.Spec.Data, configRef.File.Mode); err != nil { return errors.Wrap(err, "error injecting config") } } return nil } func (daemon *Daemon) setupIpcDirs(container *container.Container) error { return nil } // TODO Windows: Fix Post-TP5. This is a hack to allow docker cp to work // against containers which have volumes. You will still be able to cp // to somewhere on the container drive, but not to any mounted volumes // inside the container. Without this fix, docker cp is broken to any // container which has a volume, regardless of where the file is inside the // container. func (daemon *Daemon) mountVolumes(container *container.Container) error { return nil } func (daemon *Daemon) setupSecretDir(c *container.Container) (setupErr error) { if len(c.SecretReferences) == 0 { return nil } localMountPath, err := c.SecretMountPath() if err != nil { return err } logrus.Debugf("secrets: setting up secret dir: %s", localMountPath) // create local secret root if err := system.MkdirAllWithACL(localMountPath, 0, system.SddlAdministratorsLocalSystem); err != nil { return errors.Wrap(err, "error creating secret local directory") } defer func() { if setupErr != nil { if err := os.RemoveAll(localMountPath); err != nil { logrus.Errorf("error cleaning up secret mount: %s", err) } } }() if c.DependencyStore == nil { return fmt.Errorf("secret store is not initialized") } for _, s := range c.SecretReferences { // TODO (ehazlett): use type switch when more are supported if s.File == nil { logrus.Error("secret target type is not a file target") continue } // secrets are created in the SecretMountPath on the host, at a // single level fPath, err := c.SecretFilePath(*s) if err != nil { return err } logrus.WithFields(logrus.Fields{ "name": s.File.Name, "path": fPath, }).Debug("injecting secret") secret, err := c.DependencyStore.Secrets().Get(s.SecretID) if err != nil { return errors.Wrap(err, "unable to get secret from secret store") } if err := ioutil.WriteFile(fPath, secret.Spec.Data, s.File.Mode); err != nil { return errors.Wrap(err, "error injecting secret") } } return nil } func killProcessDirectly(container *container.Container) error { return nil } func isLinkable(child *container.Container) bool { return false } func enableIPOnPredefinedNetwork() bool { return true } func (daemon *Daemon) isNetworkHotPluggable() bool { return true } func (daemon *Daemon) setupPathsAndSandboxOptions(container *container.Container, sboxOptions *[]libnetwork.SandboxOption) error { return nil } func (daemon *Daemon) initializeNetworkingPaths(container *container.Container, nc *container.Container) error { if nc.HostConfig.Isolation.IsHyperV() { return fmt.Errorf("sharing of hyperv containers network is not supported") } container.NetworkSharedContainerID = nc.ID if nc.NetworkSettings != nil { for n := range nc.NetworkSettings.Networks { sn, err := daemon.FindNetwork(n) if err != nil { continue } ep, err := getEndpointInNetwork(nc.Name, sn) if err != nil { continue } data, err := ep.DriverInfo() if err != nil { continue } if data["GW_INFO"] != nil { gwInfo := data["GW_INFO"].(map[string]interface{}) if gwInfo["hnsid"] != nil { container.SharedEndpointList = append(container.SharedEndpointList, gwInfo["hnsid"].(string)) } } if data["hnsid"] != nil { container.SharedEndpointList = append(container.SharedEndpointList, data["hnsid"].(string)) } } } return nil }
{ "content_hash": "c4532f3c5065a07b61ee5a0e32b49fb9", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 130, "avg_line_length": 26.472081218274113, "alnum_prop": 0.6970278044103547, "repo_name": "laijs/moby", "id": "10bfd53d6e2f22fd3ec79aa37d26469b3629bd50", "size": "5215", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "daemon/container_operations_windows.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "81" }, { "name": "C", "bytes": "4815" }, { "name": "Dockerfile", "bytes": "12338" }, { "name": "Go", "bytes": "7321116" }, { "name": "Makefile", "bytes": "8988" }, { "name": "PowerShell", "bytes": "78271" }, { "name": "Shell", "bytes": "125358" }, { "name": "Vim script", "bytes": "1369" } ], "symlink_target": "" }
# encoding: utf-8 """ This script tests ``GitWildMatchPattern``. """ from __future__ import unicode_literals import re import sys import unittest import pathspec.patterns.gitwildmatch import pathspec.util from pathspec.patterns.gitwildmatch import GitWildMatchPattern if sys.version_info[0] >= 3: unichr = chr class GitWildMatchTest(unittest.TestCase): """ The ``GitWildMatchTest`` class tests the ``GitWildMatchPattern`` implementation. """ def test_00_empty(self): """ Tests an empty pattern. """ regex, include = GitWildMatchPattern.pattern_to_regex('') self.assertIsNone(include) self.assertIsNone(regex) def test_01_absolute(self): """ Tests an absolute path pattern. This should match: an/absolute/file/path an/absolute/file/path/foo This should NOT match: foo/an/absolute/file/path """ regex, include = GitWildMatchPattern.pattern_to_regex('/an/absolute/file/path') self.assertTrue(include) self.assertEqual(regex, '^an/absolute/file/path(?:/.*)?$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match([ 'an/absolute/file/path', 'an/absolute/file/path/foo', 'foo/an/absolute/file/path', ])) self.assertEqual(results, { 'an/absolute/file/path', 'an/absolute/file/path/foo', }) def test_01_absolute_root(self): """ Tests a single root absolute path pattern. This should NOT match any file (according to git check-ignore (v2.4.1)). """ regex, include = GitWildMatchPattern.pattern_to_regex('/') self.assertIsNone(include) self.assertIsNone(regex) def test_01_relative(self): """ Tests a relative path pattern. This should match: spam spam/ foo/spam spam/foo foo/spam/bar """ regex, include = GitWildMatchPattern.pattern_to_regex('spam') self.assertTrue(include) self.assertEqual(regex, '^(?:.+/)?spam(?:/.*)?$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match([ 'spam', 'spam/', 'foo/spam', 'spam/foo', 'foo/spam/bar', ])) self.assertEqual(results, { 'spam', 'spam/', 'foo/spam', 'spam/foo', 'foo/spam/bar', }) def test_01_relative_nested(self): """ Tests a relative nested path pattern. This should match: foo/spam foo/spam/bar This should **not** match (according to git check-ignore (v2.4.1)): bar/foo/spam """ regex, include = GitWildMatchPattern.pattern_to_regex('foo/spam') self.assertTrue(include) self.assertEqual(regex, '^foo/spam(?:/.*)?$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match([ 'foo/spam', 'foo/spam/bar', 'bar/foo/spam', ])) self.assertEqual(results, { 'foo/spam', 'foo/spam/bar', }) def test_02_comment(self): """ Tests a comment pattern. """ regex, include = GitWildMatchPattern.pattern_to_regex('# Cork soakers.') self.assertIsNone(include) self.assertIsNone(regex) def test_02_ignore(self): """ Tests an exclude pattern. This should NOT match (according to git check-ignore (v2.4.1)): temp/foo """ regex, include = GitWildMatchPattern.pattern_to_regex('!temp') self.assertIsNotNone(include) self.assertFalse(include) self.assertEqual(regex, '^(?:.+/)?temp$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match(['temp/foo'])) self.assertEqual(results, set()) def test_03_child_double_asterisk(self): """ Tests a directory name with a double-asterisk child directory. This should match: spam/bar This should **not** match (according to git check-ignore (v2.4.1)): foo/spam/bar """ regex, include = GitWildMatchPattern.pattern_to_regex('spam/**') self.assertTrue(include) self.assertEqual(regex, '^spam/.*$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match([ 'spam/bar', 'foo/spam/bar', ])) self.assertEqual(results, {'spam/bar'}) def test_03_inner_double_asterisk(self): """ Tests a path with an inner double-asterisk directory. This should match: left/bar/right left/foo/bar/right left/bar/right/foo This should **not** match (according to git check-ignore (v2.4.1)): foo/left/bar/right """ regex, include = GitWildMatchPattern.pattern_to_regex('left/**/right') self.assertTrue(include) self.assertEqual(regex, '^left(?:/.+)?/right(?:/.*)?$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match([ 'left/bar/right', 'left/foo/bar/right', 'left/bar/right/foo', 'foo/left/bar/right', ])) self.assertEqual(results, { 'left/bar/right', 'left/foo/bar/right', 'left/bar/right/foo', }) def test_03_only_double_asterisk(self): """ Tests a double-asterisk pattern which matches everything. """ regex, include = GitWildMatchPattern.pattern_to_regex('**') self.assertTrue(include) self.assertEqual(regex, '^.+$') def test_03_parent_double_asterisk(self): """ Tests a file name with a double-asterisk parent directory. This should match: foo/spam foo/spam/bar """ regex, include = GitWildMatchPattern.pattern_to_regex('**/spam') self.assertTrue(include) self.assertEqual(regex, '^(?:.+/)?spam(?:/.*)?$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match([ 'foo/spam', 'foo/spam/bar', ])) self.assertEqual(results, { 'foo/spam', 'foo/spam/bar', }) def test_04_infix_wildcard(self): """ Tests a pattern with an infix wildcard. This should match: foo--bar foo-hello-bar a/foo-hello-bar foo-hello-bar/b a/foo-hello-bar/b """ regex, include = GitWildMatchPattern.pattern_to_regex('foo-*-bar') self.assertTrue(include) self.assertEqual(regex, '^(?:.+/)?foo\\-[^/]*\\-bar(?:/.*)?$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match([ 'foo--bar', 'foo-hello-bar', 'a/foo-hello-bar', 'foo-hello-bar/b', 'a/foo-hello-bar/b', ])) self.assertEqual(results, { 'foo--bar', 'foo-hello-bar', 'a/foo-hello-bar', 'foo-hello-bar/b', 'a/foo-hello-bar/b', }) def test_04_postfix_wildcard(self): """ Tests a pattern with a postfix wildcard. This should match: ~temp- ~temp-foo ~temp-foo/bar foo/~temp-bar foo/~temp-bar/baz """ regex, include = GitWildMatchPattern.pattern_to_regex('~temp-*') self.assertTrue(include) self.assertEqual(regex, '^(?:.+/)?\\~temp\\-[^/]*(?:/.*)?$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match([ '~temp-', '~temp-foo', '~temp-foo/bar', 'foo/~temp-bar', 'foo/~temp-bar/baz', ])) self.assertEqual(results, { '~temp-', '~temp-foo', '~temp-foo/bar', 'foo/~temp-bar', 'foo/~temp-bar/baz', }) def test_04_prefix_wildcard(self): """ Tests a pattern with a prefix wildcard. This should match: bar.py bar.py/ foo/bar.py foo/bar.py/baz """ regex, include = GitWildMatchPattern.pattern_to_regex('*.py') self.assertTrue(include) self.assertEqual(regex, '^(?:.+/)?[^/]*\\.py(?:/.*)?$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match([ 'bar.py', 'bar.py/', 'foo/bar.py', 'foo/bar.py/baz', ])) self.assertEqual(results, { 'bar.py', 'bar.py/', 'foo/bar.py', 'foo/bar.py/baz', }) def test_05_directory(self): """ Tests a directory pattern. This should match: dir/ foo/dir/ foo/dir/bar This should **not** match: dir """ regex, include = GitWildMatchPattern.pattern_to_regex('dir/') self.assertTrue(include) self.assertEqual(regex, '^(?:.+/)?dir/.*$') pattern = GitWildMatchPattern(re.compile(regex), include) results = set(pattern.match([ 'dir/', 'foo/dir/', 'foo/dir/bar', 'dir', ])) self.assertEqual(results, { 'dir/', 'foo/dir/', 'foo/dir/bar', }) def test_06_registered(self): """ Tests that the pattern is registered. """ self.assertIs(pathspec.util.lookup_pattern('gitwildmatch'), GitWildMatchPattern) def test_06_access_deprecated(self): """ Tests that the pattern is accessible from the root module using the deprecated alias. """ self.assertTrue(hasattr(pathspec, 'GitIgnorePattern')) self.assertTrue(issubclass(pathspec.GitIgnorePattern, GitWildMatchPattern)) def test_06_registered_deprecated(self): """ Tests that the pattern is registered under the deprecated alias. """ self.assertIs(pathspec.util.lookup_pattern('gitignore'), pathspec.GitIgnorePattern) def test_07_encode_bytes(self): """ Test encoding bytes. """ encoded = "".join(map(unichr, range(0,256))).encode(pathspec.patterns.gitwildmatch._BYTES_ENCODING) expected = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" self.assertEqual(encoded, expected) def test_07_decode_bytes(self): """ Test decoding bytes. """ decoded = bytes(bytearray(range(0,256))).decode(pathspec.patterns.gitwildmatch._BYTES_ENCODING) expected = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" self.assertEqual(decoded, expected) def test_07_match_bytes_and_bytes(self): """ Test byte string patterns matching byte string paths. """ pattern = GitWildMatchPattern(b'*.py') results = set(pattern.match([b'a.py'])) self.assertEqual(results, {b'a.py'}) def test_07_match_bytes_and_bytes_complete(self): """ Test byte string patterns matching byte string paths. """ encoded = bytes(bytearray(range(0,256))) escaped = b"".join(b"\\" + encoded[i:i+1] for i in range(len(encoded))) pattern = GitWildMatchPattern(escaped) results = set(pattern.match([encoded])) self.assertEqual(results, {encoded}) @unittest.skipIf(sys.version_info[0] >= 3, "Python 3 is strict") def test_07_match_bytes_and_unicode(self): """ Test byte string patterns matching byte string paths. """ pattern = GitWildMatchPattern(b'*.py') results = set(pattern.match(['a.py'])) self.assertEqual(results, {'a.py'}) @unittest.skipIf(sys.version_info[0] == 2, "Python 2 is lenient") def test_07_match_bytes_and_unicode_fail(self): """ Test byte string patterns matching byte string paths. """ pattern = GitWildMatchPattern(b'*.py') with self.assertRaises(TypeError): for _ in pattern.match(['a.py']): pass @unittest.skipIf(sys.version_info[0] >= 3, "Python 3 is strict") def test_07_match_unicode_and_bytes(self): """ Test unicode patterns with byte paths. """ pattern = GitWildMatchPattern('*.py') results = set(pattern.match([b'a.py'])) self.assertEqual(results, {b'a.py'}) @unittest.skipIf(sys.version_info[0] == 2, "Python 2 is lenient") def test_07_match_unicode_and_bytes_fail(self): """ Test unicode patterns with byte paths. """ pattern = GitWildMatchPattern('*.py') with self.assertRaises(TypeError): for _ in pattern.match([b'a.py']): pass def test_07_match_unicode_and_unicode(self): """ Test unicode patterns with unicode paths. """ pattern = GitWildMatchPattern('*.py') results = set(pattern.match(['a.py'])) self.assertEqual(results, {'a.py'}) def test_08_escape(self): """ Test escaping a string with meta-characters """ fname = "file!with*weird#naming_[1].t?t" escaped = r"file\!with\*weird\#naming_\[1\].t\?t" result = GitWildMatchPattern.escape(fname) self.assertEqual(result, escaped)
{ "content_hash": "e79fcf34292d53bbc2b2df8602ac5f6d", "timestamp": "", "source": "github", "line_count": 474, "max_line_length": 751, "avg_line_length": 26.974683544303797, "alnum_prop": 0.669169404035664, "repo_name": "TeamSPoon/logicmoo_workspace", "id": "e552d5ef5398f47f6f90f27c8360be4f63a2fe82", "size": "12786", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "packs_web/butterfly/lib/python3.7/site-packages/pathspec/tests/test_gitwildmatch.py", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "342" }, { "name": "C", "bytes": "1" }, { "name": "C++", "bytes": "1" }, { "name": "CSS", "bytes": "126627" }, { "name": "HTML", "bytes": "839172" }, { "name": "Java", "bytes": "11116" }, { "name": "JavaScript", "bytes": "238700" }, { "name": "PHP", "bytes": "42253" }, { "name": "Perl 6", "bytes": "23" }, { "name": "Prolog", "bytes": "440882" }, { "name": "PureBasic", "bytes": "1334" }, { "name": "Rich Text Format", "bytes": "3436542" }, { "name": "Roff", "bytes": "42" }, { "name": "Shell", "bytes": "61603" }, { "name": "TeX", "bytes": "99504" } ], "symlink_target": "" }
package execution import ( "context" "errors" "flag" "fmt" "os" "os/exec" "sync" "sync/atomic" "time" log "github.com/golang/glog" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" "github.com/google/fleetspeak/fleetspeak/src/client/channel" "github.com/google/fleetspeak/fleetspeak/src/client/daemonservice/command" "github.com/google/fleetspeak/fleetspeak/src/client/internal/monitoring" intprocess "github.com/google/fleetspeak/fleetspeak/src/client/internal/process" "github.com/google/fleetspeak/fleetspeak/src/client/service" fcpb "github.com/google/fleetspeak/fleetspeak/src/client/channel/proto/fleetspeak_channel" dspb "github.com/google/fleetspeak/fleetspeak/src/client/daemonservice/proto/fleetspeak_daemonservice" fspb "github.com/google/fleetspeak/fleetspeak/src/common/proto/fleetspeak" mpb "github.com/google/fleetspeak/fleetspeak/src/common/proto/fleetspeak_monitoring" ) // We flush the output when either of these thresholds are met. const ( maxFlushBytes = 1 << 20 // 1MB defaultFlushTimeSeconds = int32(60) ) var ( // ErrShuttingDown is returned once an execution has started shutting down and // is no longer accepting messages. ErrShuttingDown = errors.New("shutting down") stdForward = flag.Bool("std_forward", false, "If set attaches the dependent service to the client's stdin, stdout, stderr. Meant for testing individual daemonservice integrations.") // How long to wait for the daemon service to send startup data before starting to // monitor resource-usage. startupDataTimeout = 10 * time.Second ) type atomicString struct { v atomic.Value } func (s *atomicString) Set(val string) { s.v.Store(val) } func (s *atomicString) Get() string { stored := s.v.Load() if stored == nil { return "" } return stored.(string) } type atomicBool struct { v atomic.Value } func (b *atomicBool) Set(val bool) { b.v.Store(val) } func (b *atomicBool) Get() bool { stored := b.v.Load() if stored == nil { return false } return stored.(bool) } type atomicTime struct { v atomic.Value } func (t *atomicTime) Set(val time.Time) { t.v.Store(val) } func (t *atomicTime) Get() time.Time { stored := t.v.Load() if stored == nil { return time.Unix(0, 0).UTC() } return stored.(time.Time) } // An Execution represents a specific execution of a daemonservice. type Execution struct { daemonServiceName string memoryLimit int64 samplePeriod time.Duration sampleSize int Done chan struct{} // Closed when this execution is dead or dying - essentially when Shutdown has been called. Out chan<- *fspb.Message // Messages to send to the process go here. User should close when finished. sc service.Context channel *channel.Channel cmd *command.Command StartTime time.Time outData *dspb.StdOutputData // The next output data to send, once full. lastOut time.Time // Time of most recent output of outData. outLock sync.Mutex // Protects outData, lastOut outFlushBytes int // How many bytes trigger an output. Constant. outServiceName string // The service to send StdOutput messages to. Constant. shutdown sync.Once lastActive int64 // Time of the last message input or output in seconds since epoch (UTC), atomic access only. dead chan struct{} // closed when the underlying process has died. waitResult error // result of Wait call - should only be read after dead is closed inProcess sync.WaitGroup // count of active goroutines startupData chan *fcpb.StartupData // Startup data sent by the daemon process. heartbeat atomicTime // Time when the last message was received from the daemon process. monitorHeartbeats bool // Whether to monitor the daemon process's hearbeats, killing it if it doesn't heartbeat often enough. initialHeartbeatDeadlineSecs int // How long to wait for the initial heartbeat. heartbeatDeadlineSecs int // How long to wait for subsequent heartbeats. sending atomicBool // Indicates whether a message-send operation is in progress. serviceVersion atomicString // Version reported by the daemon process. } // New creates and starts an execution of the command described in cfg. Messages // received from the resulting process are passed to sc, as are StdOutput and // ResourceUsage messages. func New(daemonServiceName string, cfg *dspb.Config, sc service.Context) (*Execution, error) { cfg = proto.Clone(cfg).(*dspb.Config) ret := Execution{ daemonServiceName: daemonServiceName, memoryLimit: cfg.MemoryLimit, sampleSize: int(cfg.ResourceMonitoringSampleSize), samplePeriod: time.Duration(cfg.ResourceMonitoringSamplePeriodSeconds) * time.Second, Done: make(chan struct{}), sc: sc, cmd: &command.Command{Cmd: *exec.Command(cfg.Argv[0], cfg.Argv[1:]...)}, StartTime: time.Now(), outData: &dspb.StdOutputData{}, lastOut: time.Now(), dead: make(chan struct{}), startupData: make(chan *fcpb.StartupData, 1), monitorHeartbeats: cfg.MonitorHeartbeats, initialHeartbeatDeadlineSecs: int(cfg.HeartbeatUnresponsiveGracePeriodSeconds), heartbeatDeadlineSecs: int(cfg.HeartbeatUnresponsiveKillPeriodSeconds), } var err error ret.channel, err = ret.cmd.SetupCommsChannel() if err != nil { return nil, fmt.Errorf("failed to setup a comms channel: %v", err) } ret.Out = ret.channel.Out if cfg.StdParams != nil && cfg.StdParams.ServiceName == "" { log.Errorf("std_params is set, but service_name is empty. Ignoring std_params: %v", cfg.StdParams) cfg.StdParams = nil } if *stdForward { log.Warningf("std_forward is set, connecting std... to %s", cfg.Argv[0]) ret.cmd.Stdin = os.Stdin ret.cmd.Stdout = os.Stdout ret.cmd.Stderr = os.Stderr } else if cfg.StdParams != nil { if cfg.StdParams.FlushBytes <= 0 || cfg.StdParams.FlushBytes > maxFlushBytes { cfg.StdParams.FlushBytes = maxFlushBytes } if cfg.StdParams.FlushTimeSeconds <= 0 { cfg.StdParams.FlushTimeSeconds = defaultFlushTimeSeconds } ret.outServiceName = cfg.StdParams.ServiceName ret.outFlushBytes = int(cfg.StdParams.FlushBytes) ret.cmd.Stdout = stdoutWriter{&ret} ret.cmd.Stderr = stderrWriter{&ret} } else { ret.cmd.Stdout = nil ret.cmd.Stderr = nil } if err := ret.cmd.Start(); err != nil { close(ret.Done) return nil, err } if cfg.StdParams != nil { ret.inProcess.Add(1) go ret.stdFlushRoutine(time.Second * time.Duration(cfg.StdParams.FlushTimeSeconds)) } ret.inProcess.Add(2) go ret.inRoutine() if !cfg.DisableResourceMonitoring { ret.inProcess.Add(1) go ret.statsRoutine() } go func() { defer func() { ret.Shutdown() ret.inProcess.Done() }() ret.waitResult = ret.cmd.Wait() close(ret.dead) if ret.waitResult != nil { log.Warningf("subprocess ended with error: %v", ret.waitResult) } startTime, err := ptypes.TimestampProto(ret.StartTime) if err != nil { log.Errorf("Failed to convert process start time: %v", err) return } if !cfg.DisableResourceMonitoring { rud := &mpb.ResourceUsageData{ Scope: ret.daemonServiceName, Pid: int64(ret.cmd.Process.Pid), ProcessStartTime: startTime, DataTimestamp: ptypes.TimestampNow(), ResourceUsage: &mpb.AggregatedResourceUsage{}, ProcessTerminated: true, } if err := monitoring.SendProtoToServer(rud, "ResourceUsage", ret.sc); err != nil { log.Errorf("Failed to send final resource-usage proto: %v", err) } } }() return &ret, nil } // Wait waits for all aspects of this execution to finish. This should happen // soon after shutdown is called. // // Note that while it is a bug for this to take more than some seconds, the // method isn't needed in normal operation - it exists primarily for tests to // ensure that resources are not leaked. func (e *Execution) Wait() { <-e.Done e.channel.Wait() e.inProcess.Wait() } // LastActive returns the last time that a message was sent or received, to the // nearest second. func (e *Execution) LastActive() time.Time { return time.Unix(atomic.LoadInt64(&e.lastActive), 0).UTC() } func (e *Execution) setLastActive(t time.Time) { atomic.StoreInt64(&e.lastActive, t.Unix()) } func dataSize(o *dspb.StdOutputData) int { return len(o.Stdout) + len(o.Stderr) } // flushOut flushes e.outData. It assumes that e.outLock is already held. func (e *Execution) flushOut() { // set lastOut before the blocking call to sc.Send, so the next flush // has an accurate sense of how stale the data might be. n := time.Now() e.lastOut = n if dataSize(e.outData) == 0 { return } e.setLastActive(n) e.outData.Pid = int64(e.cmd.Process.Pid) d, err := ptypes.MarshalAny(e.outData) if err != nil { log.Errorf("unable to marshal StdOutputData: %v", err) } else { e.sc.Send(context.Background(), service.AckMessage{ M: &fspb.Message{ Destination: &fspb.Address{ServiceName: e.outServiceName}, MessageType: "StdOutput", Data: d, }}) } e.outData = &dspb.StdOutputData{ MessageIndex: e.outData.MessageIndex + 1, } } func (e *Execution) writeToOut(p []byte, isErr bool) { e.outLock.Lock() defer e.outLock.Unlock() for { currSize := dataSize(e.outData) // If it all fits, write it and return. if currSize+len(p) <= e.outFlushBytes { if isErr { e.outData.Stderr = append(e.outData.Stderr, p...) } else { e.outData.Stdout = append(e.outData.Stdout, p...) } return } // Write what does fit, flush, continue. toWrite := e.outFlushBytes - currSize if isErr { e.outData.Stderr = append(e.outData.Stderr, p[:toWrite]...) } else { e.outData.Stdout = append(e.outData.Stdout, p[:toWrite]...) } p = p[toWrite:] e.flushOut() } } type stdoutWriter struct { e *Execution } func (w stdoutWriter) Write(p []byte) (int, error) { w.e.writeToOut(p, false) return len(p), nil } type stderrWriter struct { e *Execution } func (w stderrWriter) Write(p []byte) (int, error) { w.e.writeToOut(p, true) return len(p), nil } func (e *Execution) stdFlushRoutine(flushTime time.Duration) { defer e.inProcess.Done() t := time.NewTicker(flushTime) defer t.Stop() for { select { case <-t.C: e.outLock.Lock() if e.lastOut.Add(flushTime).Before(time.Now()) { e.flushOut() } e.outLock.Unlock() case <-e.dead: e.outLock.Lock() e.flushOut() e.outLock.Unlock() return } } } func (e *Execution) waitForDeath(d time.Duration) bool { t := time.NewTimer(d) defer t.Stop() select { case <-e.dead: return true case <-t.C: return false } } // Shutdown shuts down this execution. func (e *Execution) Shutdown() { e.shutdown.Do(func() { // First we attempt a gentle shutdown. Closing e.Done tells our // user not to give us any more data, in response they should // close e.Out a.k.a e.channel.Out. Closing e.channel.Out will // cause channel to close the pipe to the dependent process, // which then causes it to clean up nicely. close(e.Done) if e.waitForDeath(time.Second) { return } // This pattern is technically racy - the process could end and the process // id could be recycled since the end of waitForDeath and before we SoftKill // or Kill using the process id. // // A formally correct way to implement this is to spawn a wrapper process // which does not die in response to SIGTERM but forwards the signal to the // wrapped process - its child. This would ensure that the process is still // around all the way to the SIGKILL. if err := e.cmd.SoftKill(); err != nil { log.Errorf("SoftKill [%d] returned error: %v", e.cmd.Process.Pid, err) } if e.waitForDeath(time.Second) { return } if err := e.cmd.Kill(); err != nil { log.Errorf("Kill [%d] returned error: %v", e.cmd.Process.Pid, err) } if e.waitForDeath(time.Second) { return } // It is hard to imagine how we might end up here - maybe the process is // somehow stuck in a system call or there is some other OS level weirdness. // One possibility is that cmd is a zombie process now. log.Errorf("Subprocess [%d] appears to have survived SIGKILL.", e.cmd.Process.Pid) }) } // inRoutine reads messages from the dependent process and passes them to // fleetspeak. func (e *Execution) inRoutine() { defer func() { e.Shutdown() e.inProcess.Done() }() var startupDone bool for { m := e.readMsg() if m == nil { return } e.setLastActive(time.Now()) e.heartbeat.Set(time.Now()) if m.Destination != nil && m.Destination.ServiceName == "system" { switch m.MessageType { case "StartupData": if startupDone { log.Warning("Received spurious startup message, ignoring.") break } startupDone = true sd := &fcpb.StartupData{} if err := ptypes.UnmarshalAny(m.Data, sd); err != nil { log.Warningf("Failed to parse startup data from initial message: %v", err) } else { if sd.Version != "" { e.serviceVersion.Set(sd.Version) } e.startupData <- sd } close(e.startupData) // No more values to send through the channel. case "Heartbeat": // Pass, handled above. default: log.Warningf("Unknown system message type: %s", m.MessageType) } } else { e.sending.Set(true) // sc.Send() buffers the message locally for sending to the Fleetspeak server. It will // block if the buffer is full. if err := e.sc.Send(context.Background(), service.AckMessage{M: m}); err != nil { log.Errorf("error sending message to server: %v", err) } e.sending.Set(false) } } } // readMsg blocks until a message is available from the channel. func (e *Execution) readMsg() *fspb.Message { select { case m, ok := <-e.channel.In: if !ok { return nil } return m case err := <-e.channel.Err: log.Errorf("channel produced error: %v", err) return nil } } // statsRoutine monitors the daemon process's resource usage, sending reports to the server // at regular intervals. func (e *Execution) statsRoutine() { defer e.inProcess.Done() pid := e.cmd.Process.Pid var version string select { case sd, ok := <-e.startupData: if ok { if int(sd.Pid) != pid { log.Infof("%s's self-reported PID (%d) is different from that of the process launched by Fleetspeak (%d)", e.daemonServiceName, sd.Pid, pid) pid = int(sd.Pid) } version = sd.Version } else { log.Warningf("%s startup data not received", e.daemonServiceName) } case <-time.After(startupDataTimeout): log.Warningf("%s startup data not received after %v", e.daemonServiceName, startupDataTimeout) case <-e.Done: return } if e.monitorHeartbeats { e.inProcess.Add(1) go e.heartbeatMonitorRoutine(pid) } rum, err := monitoring.New(e.sc, monitoring.ResourceUsageMonitorParams{ Scope: e.daemonServiceName, Pid: pid, MemoryLimit: e.memoryLimit, ProcessStartTime: e.StartTime, Version: version, MaxSamplePeriod: e.samplePeriod, SampleSize: e.sampleSize, Done: e.Done, }) if err != nil { log.Errorf("Failed to create resource-usage monitor: %v", err) return } // This blocks until the daemon process terminates. rum.Run() } // busySleep sleeps for a given number of seconds, not counting the time // when the Fleetspeak process is suspended. Returns true if execution // should continue (i.e if the daemon process is still alive). func (e *Execution) busySleep(sleepSecs int) bool { for i := 0; i < sleepSecs; i++ { select { // With very high probability, if the system gets suspended, it will occur // while waiting for this channel. case <-time.After(time.Second): case <-e.dead: return false } } return true } // heartbeatMonitorRoutine monitors the daemon process's hearbeats and kills // unresponsive processes. func (e *Execution) heartbeatMonitorRoutine(pid int) { defer e.inProcess.Done() // Give the child process some time to start up. During boot it sometimes // takes significantly more time than the unresponsive_kill_period to start // the child so we disable checking for heartbeats for a while. e.heartbeat.Set(time.Now()) if !e.busySleep(e.initialHeartbeatDeadlineSecs) { return } for { if e.sending.Get() { // Blocked trying to buffer a message for sending to the FS server. if e.busySleep(e.heartbeatDeadlineSecs) { continue } else { return } } secsSinceLastHB := int(time.Now().Sub(e.heartbeat.Get()).Seconds()) if secsSinceLastHB > e.heartbeatDeadlineSecs { // There is a very unlikely race condition if the machine gets suspended // for longer than unresponsive_kill_period seconds so we give the client // some time to catch up. if !e.busySleep(2) { return } secsSinceLastHB = int(time.Now().Sub(e.heartbeat.Get()).Seconds()) if secsSinceLastHB > e.heartbeatDeadlineSecs && !e.sending.Get() { // We have not received a heartbeat in a while, kill the child. log.Warningf("No heartbeat received from %s (pid %d), killing.", e.daemonServiceName, pid) // For consistency with MEMORY_EXCEEDED kills, send a notification before attempting to // kill the process. startTime, err := ptypes.TimestampProto(e.StartTime) if err != nil { log.Errorf("Failed to convert process start time: %v", err) startTime = nil } kn := &mpb.KillNotification{ Service: e.daemonServiceName, Pid: int64(pid), ProcessStartTime: startTime, KilledWhen: ptypes.TimestampNow(), Reason: mpb.KillNotification_HEARTBEAT_FAILURE, } if version := e.serviceVersion.Get(); version != "" { kn.Version = version } if err := monitoring.SendProtoToServer(kn, "KillNotification", e.sc); err != nil { log.Errorf("Failed to send kill notification to server: %v", err) } if err := intprocess.KillProcessByPid(pid); err != nil { log.Errorf("Error while killing a process that doesn't heartbeat - %s (pid %d): %v", e.daemonServiceName, pid, err) continue // Keep retrying. } return } } // Sleep until when the next heartbeat is due. if !e.busySleep(e.heartbeatDeadlineSecs - secsSinceLastHB) { return } } }
{ "content_hash": "f97d94a8d8131a704ebc8d670c57e969", "timestamp": "", "source": "github", "line_count": 615, "max_line_length": 145, "avg_line_length": 29.87317073170732, "alnum_prop": 0.6840844763770956, "repo_name": "google/fleetspeak", "id": "7ce72db91783f39bddac399e6028bfbb4cf269f5", "size": "19081", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fleetspeak/src/client/daemonservice/execution/execution.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "978158" }, { "name": "HCL", "bytes": "8464" }, { "name": "Makefile", "bytes": "383" }, { "name": "PowerShell", "bytes": "3209" }, { "name": "Python", "bytes": "49683" }, { "name": "Shell", "bytes": "20526" } ], "symlink_target": "" }
<?php namespace Sylius\Component\Core\Model; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Sylius\Component\Channel\Model\ChannelInterface as BaseChannelInterface; use Sylius\Component\Payment\Model\PaymentMethod as BasePaymentMethod; use Sylius\Component\Payment\Model\PaymentMethodTranslation; /** * @author Mateusz Zalewski <[email protected]> */ class PaymentMethod extends BasePaymentMethod implements PaymentMethodInterface { /** * @var Collection */ protected $channels; public function __construct() { parent::__construct(); $this->channels = new ArrayCollection(); } /** * {@inheritdoc} */ public function getChannels() { return $this->channels; } /** * {@inheritdoc} */ public function hasChannel(BaseChannelInterface $channel) { return $this->channels->contains($channel); } /** * {@inheritdoc} */ public function addChannel(BaseChannelInterface $channel) { if (!$this->hasChannel($channel)) { $this->channels->add($channel); } } /** * {@inheritdoc} */ public function removeChannel(BaseChannelInterface $channel) { if ($this->hasChannel($channel)) { $this->channels->removeElement($channel); } } /** * {@inheritdoc} */ public static function getTranslationClass() { return PaymentMethodTranslation::class; } }
{ "content_hash": "1919f89062d89846155dc575aa73aef6", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 79, "avg_line_length": 21.273972602739725, "alnum_prop": 0.627173213135866, "repo_name": "nakashu/Sylius", "id": "dd1e5234b5447ca39d2ab6c1ca9c913052ed33b1", "size": "1764", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/Sylius/Component/Core/Model/PaymentMethod.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "601" }, { "name": "CSS", "bytes": "1792" }, { "name": "Cucumber", "bytes": "719106" }, { "name": "HTML", "bytes": "251425" }, { "name": "JavaScript", "bytes": "50121" }, { "name": "PHP", "bytes": "6009314" }, { "name": "Shell", "bytes": "27681" } ], "symlink_target": "" }
'use strict' import React from 'react' import classnames from 'classnames' import { substitute } from './utils/strings' import TableHeader from './TableHeader' import { requireCss } from './themes' requireCss('tables') class Table extends React.Component { static displayName = 'Table' static propTypes = { bordered: React.PropTypes.bool, children: React.PropTypes.array, className: React.PropTypes.string, data: React.PropTypes.oneOfType([ React.PropTypes.array, React.PropTypes.func ]).isRequired, filters: React.PropTypes.array, headers: React.PropTypes.array, height: React.PropTypes.oneOfType([ React.PropTypes.number, React.PropTypes.string ]), onSort: React.PropTypes.func, pagination: React.PropTypes.object, selectAble: React.PropTypes.bool, striped: React.PropTypes.bool, style: React.PropTypes.object, width: React.PropTypes.oneOfType([ React.PropTypes.number, React.PropTypes.string ]) } componentWillMount () { this.fetchData(this.props.data) } componentDidMount () { this.setHeaderWidth() } componentWillReceiveProps (nextProps) { if (nextProps.data !== this.props.data) { this.fetchData(nextProps.data) } /* if (nextProps.children !== this.props.children) { this.setHeaderProps(nextProps.children) } */ } componentDidUpdate () { this.setHeaderWidth() } componentWillUnmount () { this.unmounted = true } unmounted = false state = { index: this.props.pagination ? this.props.pagination.props.index : 1, data: [], sort: {}, total: null } setHeaderWidth () { let body = this.refs.body let tr = body.querySelector('tr') if (!tr) { return } let ths = this.refs.header.querySelectorAll('th') let tds = tr.querySelectorAll('td') for (let i = 0, count = tds.length; i < count; i++) { if (ths[i]) { ths[i].style.width = tds[i].offsetWidth + 'px' } } } /* setHeaderProps (children) { let headers = [] if (children) { if (children.constructor === Array) { children.forEach(child => { if (child.type === TableHeader) { headers.push(child) } }) } else if (children.type === TableHeader) { headers.push(children) } } this.setState({headers}) } */ fetchData (data) { if (typeof data === 'function') { data.then(res => { this.fetchData(res) })() } else { if (!this.unmounted) { this.setState({ data }) } } } sortData (key, asc) { let data = this.state.data data = data.sort(function(a, b) { var x = a[key] var y = b[key] if (asc) { return ((x < y) ? -1 : ((x > y) ? 1 : 0)) } else { return ((x > y) ? -1 : ((x < y) ? 1 : 0)) } }) this.setState({ data }) } onCheck (i, e) { let checked = typeof e === 'boolean' ? e : e.target.checked, data = this.state.data, index = this.state.index, size = this.props.pagination ? this.props.pagination.props.size : data.length, start = 0, end = 0 if (i === 'all') { start = (index - 1) * size end = index * size } else { start = (index - 1) * size + i end = start + 1 } for (; start < end; start++) { data[start].$checked = checked } this.setState({data}) } getChecked (name) { let values = [] this.state.data.forEach(d => { if (d.$checked) { values.push(name ? d[name] : d) } }) return values } onBodyScroll (e) { let hc = this.refs.headerContainer hc.style.marginLeft = (0 - e.target.scrollLeft) + 'px' } getData () { let page = this.props.pagination, filters = this.props.filters, data = [] if (filters) { let filterCount = filters.length this.state.data.forEach(d => { let checked = true for (let i = 0; i < filterCount; i++) { let f = filters[i].func checked = f(d) if (!checked) { break } } if (checked) { data.push(d) } }) } else { data = this.state.data } let total = data.length if (!page) { return { total, data } } let size = page.props.size if (data.length <= size) { return { total, data } } let index = this.state.index data = data.slice((index - 1) * size, index * size) return { total, data } } renderBody (data) { let selectAble = this.props.selectAble let trs = data.map((d, i) => { let tds = [] if (selectAble) { tds.push( <td style={{width: 13}} key="checkbox"> <input checked={d.$checked} onChange={this.onCheck.bind(this, i)} type="checkbox" /> </td> ) } this.props.headers.map((h, j) => { if (h.hidden) { return } let content = h.content, tdStyle = {} if (typeof content === 'string') { content = substitute(content, d) } else if (typeof content === 'function') { content = content(d) } else { content = d[h.name] } if (h.width) { tdStyle.width = h.width } tds.push(<td style={tdStyle} key={j}>{content}</td>) }) return <tr key={i}>{tds}</tr> }) return <tbody>{trs}</tbody> } renderHeader () { let headers = [] if (this.props.selectAble) { headers.push( <TableHeader key="checkbox" name="$checkbox" header={ <input onClick={this.onCheck.bind(this, 'all')} type="checkbox" /> } /> ) } this.props.headers.map((header, i) => { if (header.hidden) { return } let props = { key: i, onSort: (name, asc) => { this.setState({sort: { name, asc }}) if (this.props.onSort) { this.props.onSort(name, asc) } else { this.sortData(name, asc) } }, sort: this.state.sort } headers.push( <TableHeader {...header} {...props} /> ) }) return <tr>{headers}</tr> } renderPagination (total) { if (!this.props.pagination) { return null } let props = { total: total, onChange: (index) => { let data = this.state.data data.forEach(d => { d.$checked = false }) this.setState({index, data}) } } return React.cloneElement(this.props.pagination, props) } render () { let bodyStyle = {}, headerStyle = {}, tableStyle = {}, onBodyScroll = null, { total, data } = this.getData() if (this.props.height) { bodyStyle.height = this.props.height bodyStyle.overflow = 'auto' } if (this.props.width) { headerStyle.width = this.props.width if (typeof headerStyle.width === 'number') { headerStyle.width += 20 } tableStyle.width = this.props.width bodyStyle.overflow = 'auto' onBodyScroll = this.onBodyScroll.bind(this) } let className = classnames( this.props.className, 'rct-table', { 'rct-bordered': this.props.bordered, 'rct-scrolled': this.props.height, 'rct-striped': this.props.striped } ) return ( <div style={this.props.style} className={className}> <div className="header-container"> <div ref="headerContainer" style={headerStyle}> <table ref="header"> <thead>{this.renderHeader()}</thead> </table> </div> </div> <div onScroll={onBodyScroll} style={bodyStyle} className="body-container"> <table style={tableStyle} className="rct-table-body" ref="body"> {this.renderBody(data)} </table> </div> {this.renderPagination(total)} </div> ) } } export default Table
{ "content_hash": "c582de88136d9869ec28677b9c215516", "timestamp": "", "source": "github", "line_count": 351, "max_line_length": 96, "avg_line_length": 23.173789173789174, "alnum_prop": 0.5322104745512662, "repo_name": "pandoraui/react-ui", "id": "e390c89f01122b3b13d2c27971e4f7335ba32aeb", "size": "8134", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Table.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "36050" }, { "name": "HTML", "bytes": "998" }, { "name": "JavaScript", "bytes": "145873" } ], "symlink_target": "" }
namespace onnxruntime { namespace cuda { namespace { template <typename T> struct GetRatioDataImpl { void operator()(const Tensor* ratio, float& ratio_data) const { ratio_data = static_cast<float>(*(ratio->template Data<T>())); ORT_ENFORCE(ratio_data >= 0.0f && ratio_data < 1.0f, "ratio_data is outside range [0, 1)"); } }; template <typename T> struct DropoutGradComputeImpl { void operator()(cudaStream_t stream, const int64_t N, const Tensor& dY, const void* mask_data, const float ratio_data, Tensor& dX, bool use_bitmask) const { typedef typename ToCudaType<T>::MappedType CudaT; const CudaT* dY_data = reinterpret_cast<const CudaT*>(dY.template Data<T>()); CudaT* dX_data = reinterpret_cast<CudaT*>(dX.template MutableData<T>()); DropoutGradientKernelImpl<CudaT>(stream, N, dY_data, mask_data, ratio_data, dX_data, use_bitmask); } }; } // namespace ONNX_OPERATOR_KERNEL_EX(DropoutGrad, kMSDomain, 1, kCudaExecutionProvider, (*KernelDefBuilder::Create()) .TypeConstraint("T", BuildKernelDefConstraints<MLFloat16, float, double, BFloat16>()) .TypeConstraint("T1", BuildKernelDefConstraints<MLFloat16, float, double, BFloat16>()) .TypeConstraint("T2", DataTypeImpl::GetTensorType<bool>()) .InputMemoryType(OrtMemTypeCPUInput, 2), DropoutGrad<false>); ONNX_OPERATOR_KERNEL_EX(BitmaskDropoutGrad, kMSDomain, 1, kCudaExecutionProvider, (*KernelDefBuilder::Create()) .TypeConstraint("T", BuildKernelDefConstraints<MLFloat16, float, double, BFloat16>()) .TypeConstraint("T1", BuildKernelDefConstraints<MLFloat16, float, double, BFloat16>()) .TypeConstraint("T2", DataTypeImpl::GetTensorType<bool>()) .TypeConstraint("T3", DataTypeImpl::GetTensorType<BitmaskElementType>()) .InputMemoryType(OrtMemTypeCPUInput, 2) .InputMemoryType(OrtMemTypeCPUInput, 3), DropoutGrad<true>); template <bool UseBitmask> Status DropoutGrad<UseBitmask>::ComputeInternal(OpKernelContext* context) const { auto dY = context->Input<Tensor>(0); const TensorShape& shape = dY->Shape(); const int64_t N = shape.Size(); auto mask = context->Input<Tensor>(1); if (UseBitmask) { ORT_ENFORCE(mask->Shape().Size() == (N + kNumBitsPerBitmaskElement - 1) / kNumBitsPerBitmaskElement); } else { ORT_ENFORCE(mask->Shape().Size() == N); } const void* mask_data = mask->DataRaw(); // Get the ratio_data float ratio_data = default_ratio_; auto ratio = context->Input<Tensor>(2); if (ratio) { utils::MLTypeCallDispatcher<float, MLFloat16, double, BFloat16> t_disp(ratio->GetElementType()); t_disp.Invoke<GetRatioDataImpl>(ratio, ratio_data); } auto dX = context->Output(0, shape); utils::MLTypeCallDispatcher<float, MLFloat16, double, BFloat16> t_disp(dY->GetElementType()); t_disp.Invoke<DropoutGradComputeImpl>(Stream(), N, *dY, mask_data, ratio_data, *dX, UseBitmask); return Status::OK(); } } // namespace cuda } // namespace onnxruntime
{ "content_hash": "78e8977d4198db28ef1d6dede0835764", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 120, "avg_line_length": 42.77922077922078, "alnum_prop": 0.6390406800242866, "repo_name": "microsoft/onnxruntime", "id": "cb4d6687b1e2bc93bc078e9fa3041b1d33b0963e", "size": "3651", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "orttraining/orttraining/training_ops/cuda/nn/dropout_grad.cc", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "1763425" }, { "name": "Batchfile", "bytes": "17040" }, { "name": "C", "bytes": "955390" }, { "name": "C#", "bytes": "2304597" }, { "name": "C++", "bytes": "39435305" }, { "name": "CMake", "bytes": "514764" }, { "name": "CSS", "bytes": "138431" }, { "name": "Cuda", "bytes": "1104338" }, { "name": "Dockerfile", "bytes": "8089" }, { "name": "HLSL", "bytes": "11234" }, { "name": "HTML", "bytes": "5933" }, { "name": "Java", "bytes": "418665" }, { "name": "JavaScript", "bytes": "212575" }, { "name": "Jupyter Notebook", "bytes": "218327" }, { "name": "Kotlin", "bytes": "4653" }, { "name": "Liquid", "bytes": "5457" }, { "name": "NASL", "bytes": "2628" }, { "name": "Objective-C", "bytes": "151027" }, { "name": "Objective-C++", "bytes": "107084" }, { "name": "Pascal", "bytes": "9597" }, { "name": "PowerShell", "bytes": "16419" }, { "name": "Python", "bytes": "5041661" }, { "name": "Roff", "bytes": "27539" }, { "name": "Ruby", "bytes": "3545" }, { "name": "Shell", "bytes": "116513" }, { "name": "Swift", "bytes": "115" }, { "name": "TypeScript", "bytes": "973087" } ], "symlink_target": "" }
class DeletedCommitVersion < CommitVersion end
{ "content_hash": "b5510ceae1e72047ad27e32221c40c0e", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 42, "avg_line_length": 23.5, "alnum_prop": 0.8723404255319149, "repo_name": "ShengLiu/ProjectChanged", "id": "45c7c5709999a3f6601abea83c3a501314cfd90b", "size": "47", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/deleted_commit_version.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "463" }, { "name": "Ruby", "bytes": "93681" } ], "symlink_target": "" }
using System.Collections.Generic; using System.Linq; namespace Kazyx.RemoteApi { /// <summary> /// Response of getMethodTypes API. /// </summary> public class MethodType { /// <summary> /// Name of API /// </summary> public string Name { set; get; } /// <summary> /// Request parameter types. /// </summary> public List<string> ReqTypes { set; get; } /// <summary> /// Response parameter types. /// </summary> public List<string> ResTypes { set; get; } /// <summary> /// Version of API /// </summary> public string Version { set; get; } } /// <summary> /// Set of current value and its candidates. /// </summary> /// <typeparam name="T"></typeparam> public class Capability<T> { /// <summary> /// Current value of the specified parameter. /// </summary> public virtual T Current { set; get; } /// <summary> /// Candidate values of the specified parameter. /// </summary> public virtual List<T> Candidates { set; get; } public override bool Equals(object o) { if (o == null) { return false; } if (!(o is Capability<T>)) { return false; } var other = o as Capability<T>; if (!Current.Equals(other.Current)) { return false; } if (Candidates?.Count != other.Candidates?.Count) { return false; } return Candidates.SequenceEqual(other.Candidates); } public override int GetHashCode() { return Current.GetHashCode() + Candidates.GetHashCode(); } public static bool operator ==(Capability<T> x, Capability<T> y) { if (ReferenceEquals(x, null)) { return ReferenceEquals(y, null); } return x.Equals(y); } public static bool operator !=(Capability<T> x, Capability<T> y) { if (ReferenceEquals(x, null)) { return !ReferenceEquals(y, null); } return !x.Equals(y); } } }
{ "content_hash": "5e36a7c641cd08f64e2cb6d98292521c", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 79, "avg_line_length": 28.423076923076923, "alnum_prop": 0.510148849797023, "repo_name": "kazyx/kz-remote-api", "id": "67d2072d873dcb000dad1c2a57f8265b64c62c99", "size": "2219", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Project/Util/SharedStructures.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "117082" } ], "symlink_target": "" }
define([ // "uiBootstrap", // "less!app/less/bootstrap", // "less!app/less/bootstrap-theme" ], function () { //File used to do some custom action before angular app bootstraping. Such as including custom things... return [ // "ui.bootstrap" ]; });
{ "content_hash": "ca0ef5fdf2397128099595b058cffae7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 108, "avg_line_length": 27.5, "alnum_prop": 0.6181818181818182, "repo_name": "ArcanisCz/angular-requirejs-seed", "id": "cca5c353a147a1a8f960d774fef1eb6249e788d7", "size": "275", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/App.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "154701" }, { "name": "JavaScript", "bytes": "721790" } ], "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 (1.8.0_151) on Mon Jul 29 22:15:55 UTC 2019 --> <title>PositionFunctions (tensorics-core API)</title> <meta name="date" content="2019-07-29"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="PositionFunctions (tensorics-core API)"; } } catch(err) { } //--> var methods = {"i0":9,"i1":9}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <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="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/tensorics/core/tensor/operations/OngoingMapOut.html" title="class in org.tensorics.core.tensor.operations"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/tensorics/core/tensor/operations/SingleValueTensorCreationOperation.html" title="class in org.tensorics.core.tensor.operations"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/tensorics/core/tensor/operations/PositionFunctions.html" target="_top">Frames</a></li> <li><a href="PositionFunctions.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.tensorics.core.tensor.operations</div> <h2 title="Class PositionFunctions" class="title">Class PositionFunctions</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.tensorics.core.tensor.operations.PositionFunctions</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public final class <span class="typeNameLabel">PositionFunctions</span> extends java.lang.Object</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>static &lt;V&gt;&nbsp;java.util.function.Function&lt;<a href="../../../../../org/tensorics/core/tensor/Position.html" title="class in org.tensorics.core.tensor">Position</a>,V&gt;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/tensorics/core/tensor/operations/PositionFunctions.html#constant-V-">constant</a></span>(V&nbsp;value)</code>&nbsp;</td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>static &lt;V&gt;&nbsp;java.util.function.Function&lt;<a href="../../../../../org/tensorics/core/tensor/Position.html" title="class in org.tensorics.core.tensor">Position</a>,V&gt;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/tensorics/core/tensor/operations/PositionFunctions.html#forSupplier-java.util.function.Supplier-">forSupplier</a></span>(java.util.function.Supplier&lt;V&gt;&nbsp;supplier)</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="constant-java.lang.Object-"> <!-- --> </a><a name="constant-V-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>constant</h4> <pre>public static final&nbsp;&lt;V&gt;&nbsp;java.util.function.Function&lt;<a href="../../../../../org/tensorics/core/tensor/Position.html" title="class in org.tensorics.core.tensor">Position</a>,V&gt;&nbsp;constant(V&nbsp;value)</pre> </li> </ul> <a name="forSupplier-java.util.function.Supplier-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>forSupplier</h4> <pre>public static final&nbsp;&lt;V&gt;&nbsp;java.util.function.Function&lt;<a href="../../../../../org/tensorics/core/tensor/Position.html" title="class in org.tensorics.core.tensor">Position</a>,V&gt;&nbsp;forSupplier(java.util.function.Supplier&lt;V&gt;&nbsp;supplier)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <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="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/tensorics/core/tensor/operations/OngoingMapOut.html" title="class in org.tensorics.core.tensor.operations"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/tensorics/core/tensor/operations/SingleValueTensorCreationOperation.html" title="class in org.tensorics.core.tensor.operations"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/tensorics/core/tensor/operations/PositionFunctions.html" target="_top">Frames</a></li> <li><a href="PositionFunctions.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "6719fdeb2730d7801ae8decc9cef6171", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 389, "avg_line_length": 38.196, "alnum_prop": 0.6414284218242748, "repo_name": "tensorics/tensorics.github.io", "id": "da4276c80b52a5523566f05650cac163a5391db0", "size": "9549", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "projects/tensorics-core/javadoc/org/tensorics/core/tensor/operations/PositionFunctions.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "34298" }, { "name": "HTML", "bytes": "74670" }, { "name": "Java", "bytes": "1663226" }, { "name": "JavaScript", "bytes": "3136" } ], "symlink_target": "" }
using Carbon.Data; namespace Amazon.DynamoDb; internal sealed class EnumConverter : IDbValueConverter { public static readonly EnumConverter Default = new(); // ulong? public DbValue FromObject(object value, IMember member) { return new DbValue(Convert.ToInt32(value)); } public object ToObject(DbValue item, IMember member) { return item.Kind is DbValueType.S ? Enum.Parse(member.Type, item.ToString()) : Enum.ToObject(member.Type, item.ToInt()); } }
{ "content_hash": "1279d711276a63e74f236861bd08a5ed", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 59, "avg_line_length": 25.09090909090909, "alnum_prop": 0.6358695652173914, "repo_name": "carbon/Amazon", "id": "4c414dec8c52bcd6c450d5757c8691af02ffa6e5", "size": "554", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Amazon.DynamoDb/Converters/EnumConverter.cs", "mode": "33261", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "228" }, { "name": "C#", "bytes": "1031471" }, { "name": "PowerShell", "bytes": "1533" } ], "symlink_target": "" }
package com.reactnativenavigation.presentation; import android.content.*; import android.graphics.drawable.*; import android.support.annotation.*; import android.support.v4.content.*; import com.reactnativenavigation.parse.*; import com.reactnativenavigation.utils.*; import com.reactnativenavigation.viewcontrollers.*; import com.reactnativenavigation.viewcontrollers.bottomtabs.*; import com.reactnativenavigation.views.*; import com.reactnativenavigation.views.Component; import java.util.*; public class BottomTabPresenter { private final Context context; private ImageLoader imageLoader; private Options defaultOptions; private final BottomTabFinder bottomTabFinder; private BottomTabs bottomTabs; private final int defaultSelectedTextColor; private final int defaultTextColor; private final List<ViewController> tabs; public BottomTabPresenter(Context context, List<ViewController> tabs, ImageLoader imageLoader, Options defaultOptions) { this.tabs = tabs; this.context = context; this.bottomTabFinder = new BottomTabFinder(tabs); this.imageLoader = imageLoader; this.defaultOptions = defaultOptions; defaultSelectedTextColor = defaultOptions.bottomTabOptions.selectedIconColor.get(ContextCompat.getColor(context, com.aurelhubert.ahbottomnavigation.R.color.colorBottomNavigationAccent)); defaultTextColor = defaultOptions.bottomTabOptions.iconColor.get(ContextCompat.getColor(context, com.aurelhubert.ahbottomnavigation.R.color.colorBottomNavigationInactive)); } public void setDefaultOptions(Options defaultOptions) { this.defaultOptions = defaultOptions; } public void bindView(BottomTabs bottomTabs) { this.bottomTabs = bottomTabs; } public void applyOptions() { for (int i = 0; i < tabs.size(); i++) { BottomTabOptions tab = tabs.get(i).resolveCurrentOptions(defaultOptions).bottomTabOptions; bottomTabs.setBadge(i, tab.badge.get("")); bottomTabs.setBadgeColor(tab.badgeColor.get(null)); bottomTabs.setTitleTypeface(i, tab.fontFamily); bottomTabs.setIconActiveColor(i, tab.selectedIconColor.get(null)); bottomTabs.setIconInactiveColor(i, tab.iconColor.get(null)); bottomTabs.setTitleActiveColor(i, tab.selectedTextColor.get(null)); bottomTabs.setTitleInactiveColor(i, tab.textColor.get(null)); bottomTabs.setTitleInactiveTextSizeInSp(i, tab.fontSize.hasValue() ? Float.valueOf(tab.fontSize.get()) : null); bottomTabs.setTitleActiveTextSizeInSp(i, tab.selectedFontSize.hasValue() ? Float.valueOf(tab.selectedFontSize.get()) : null); bottomTabs.setTag(i, tab.testId.get(null)); } } public void mergeChildOptions(Options options, Component child) { int index = bottomTabFinder.findByComponent(child); if (index >= 0) { BottomTabOptions bto = options.bottomTabOptions; if (bto.badge.hasValue()) bottomTabs.setBadge(index, bto.badge.get()); if (bto.badgeColor.hasValue()) bottomTabs.setBadgeColor(bto.badgeColor.get()); if (bto.fontFamily != null) bottomTabs.setTitleTypeface(index, bto.fontFamily); if (bto.selectedIconColor.hasValue()) bottomTabs.setIconActiveColor(index, bto.selectedIconColor.get()); if (bto.iconColor.hasValue()) bottomTabs.setIconInactiveColor(index, bto.iconColor.get()); if (bto.selectedTextColor.hasValue()) bottomTabs.setTitleActiveColor(index, bto.selectedTextColor.get()); if (bto.textColor.hasValue()) bottomTabs.setTitleInactiveColor(index, bto.textColor.get()); if (bto.text.hasValue()) bottomTabs.setText(index, bto.text.get()); if (bto.icon.hasValue()) imageLoader.loadIcon(context, bto.icon.get(), new ImageLoadingListenerAdapter() { @Override public void onComplete(@NonNull Drawable drawable) { bottomTabs.setIcon(index, drawable); } }); if (bto.testId.hasValue()) bottomTabs.setTag(index, bto.testId.get()); } } }
{ "content_hash": "e0cd27907cbeed05b4e7d795b0276d2f", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 194, "avg_line_length": 51.146341463414636, "alnum_prop": 0.7079160705770148, "repo_name": "Jpoliachik/react-native-navigation", "id": "18b953d8be3d1b8f63381611a70127e084a085cb", "size": "4194", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabPresenter.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "485" }, { "name": "Java", "bytes": "827783" }, { "name": "JavaScript", "bytes": "182470" }, { "name": "Objective-C", "bytes": "699819" }, { "name": "Ruby", "bytes": "704" }, { "name": "Shell", "bytes": "674" }, { "name": "TypeScript", "bytes": "143524" } ], "symlink_target": "" }
#ifndef SRC_TRANSFORMS_FORK_H_ #define SRC_TRANSFORMS_FORK_H_ #include "src/formats/array_format.h" #include "src/transform_base.h" namespace sound_feature_extraction { namespace transforms { class Fork : public UniformFormatTransform<formats::ArrayFormatF> { friend class FrequencyBands; public: Fork(); TRANSFORM_INTRO("Fork", "Clones the windows, increasing their number by " "a factor of \"factor\".", Fork) TP(factor, int, kDefaultFactor, "Windows number multiplier value.") protected: static constexpr int kDefaultFactor = 4; virtual size_t OnFormatChanged(size_t buffersCount) override; virtual void Do(const BuffersBase<float*>& in, BuffersBase<float*>* out) const noexcept override; }; } // namespace transforms } // namespace sound_feature_extraction #endif // SRC_TRANSFORMS_FORK_H_
{ "content_hash": "a278f9cd000695dc89633ba7b4b74be1", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 75, "avg_line_length": 26.058823529411764, "alnum_prop": 0.6930022573363431, "repo_name": "Samsung/veles.sound_feature_extraction", "id": "5977d16a89ec177fd981299c024e2212c3dd0044", "size": "2079", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/transforms/fork.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "25931" }, { "name": "C", "bytes": "24693" }, { "name": "C++", "bytes": "13951283" }, { "name": "Makefile", "bytes": "785443" }, { "name": "Python", "bytes": "37485" }, { "name": "Shell", "bytes": "41420" } ], "symlink_target": "" }
package v1alpha1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( // DataExportResourceName is name for the DataExport resource. DataExportResourceName = "dataexport" // DataExportResourcePlural is the name for list of DataExport resources. DataExportResourcePlural = "dataexports" ) // DataExportType defines a method of achieving data transfer. type DataExportType string const ( // DataExportRsync means that data will be copied between two PVCs directly. // Rsync supports both local and remote file copy. DataExportRsync DataExportType = "rsync" // DataExportRestic means that data will be backed up to or restored from a restic // repository. DataExportRestic DataExportType = "restic" // DataExportKopia means that data will be backed up to or restored from a kopia // repository. DataExportKopia DataExportType = "kopia" ) // DataExportStatus defines a status of DataExport. type DataExportStatus string const ( // DataExportStatusInitial is the initial status of DataExport. It indicates // that a volume export request has been received. DataExportStatusInitial DataExportStatus = "Initial" // DataExportStatusPending when data export is pending and not started yet. DataExportStatusPending DataExportStatus = "Pending" // DataExportStatusInProgress when data is being transferred. DataExportStatusInProgress DataExportStatus = "InProgress" // DataExportStatusFailed when data transfer is failed. DataExportStatusFailed DataExportStatus = "Failed" // DataExportStatusSuccessful when data has been transferred. DataExportStatusSuccessful DataExportStatus = "Successful" ) // DataExportStage defines different stages for DataExport when its Status changes // from Initial to Failed/Successful. type DataExportStage string const ( // DataExportStageInitial is the starting point for DataExport. DataExportStageInitial DataExportStage = "Initial" // DataExportStageSnapshotScheduled if a driver support this stage, it means a snapshot // is being taken of the source PVC which will be used to transfer data with rsync. DataExportStageSnapshotScheduled DataExportStage = "SnapshotScheduled" // DataExportStageSnapshotInProgress if a driver supports this stage, it means a data // is processing. DataExportStageSnapshotInProgress DataExportStage = "SnapshotInProgress" // DataExportStageSnapshotRestore if a driver supports this stage, it means a PVC // creation from a snapshot is scheduled DataExportStageSnapshotRestore DataExportStage = "SnapshotRestore" // DataExportStageSnapshotRestoreInProgress if a driver supports this stage, it means a PVC is // being restored from a snapshot DataExportStageSnapshotRestoreInProgress DataExportStage = "SnapshotRestoreInProgress" // DataExportStageLocalSnapshotRestore if a driver supports this stage, it means schedule a restore // from a snapshot before doing kdmp restore DataExportStageLocalSnapshotRestore DataExportStage = "LocalSnapshotRestore" // DataExportStageLocalSnapshotRestoreInProgress if a driver supports this stage, it means check for // status of the restore from snapshot DataExportStageLocalSnapshotRestoreInProgress DataExportStage = "LocalSnapshotRestoreInProgress" // DataExportStageTransferScheduled when the rsync daemon and pod are currently being // scheduled by Kubernetes. DataExportStageTransferScheduled DataExportStage = "TransferScheduled" // DataExportStageTransferInProgress when rsync is in progress and is transferring data // between the two PVCs. DataExportStageTransferInProgress DataExportStage = "TransferInProgress" // DataExportStageCleanup cleanup stage to remove resources created DataExportStageCleanup DataExportStage = "Cleanup" // DataExportStageFinal when rsync is completed. DataExportStageFinal DataExportStage = "Final" ) // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // DataExport defines a spec for importing of application data from a non Portworx PVC // (source) to a PVC backed by Portworx. type DataExport struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec DataExportSpec `json:"spec"` Status ExportStatus `json:"status"` } // DataExportSpec defines configuration parameters for DataExport. type DataExportSpec struct { Type DataExportType `json:"type,omitempty"` ClusterPair string `json:"clusterPair,omitempty"` SnapshotStorageClass string `json:"snapshotStorageClass,omitempty"` // TriggeredFrom is to know which module is created the dataexport CR. // The use-case is to know from where to get the kopia executor image TriggeredFrom string `json:"triggerFrom,omitempty"` TriggeredFromNs string `json:"triggerFromNs,omitempty"` Source DataExportObjectReference `json:"source,omitempty"` Destination DataExportObjectReference `json:"destination,omitempty"` } // DataExportObjectReference contains enough information to let you inspect the referred object. type DataExportObjectReference struct { // API version of the referent. APIVersion string `json:"apiVersion,omitempty"` // Kind of the referent. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds Kind string `json:"kind,omitempty"` // Namespace of the referent. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ Namespace string `json:"namespace,omitempty"` // Name of the referent. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names Name string `json:"name,omitempty"` } // ExportStatus indicates a current state of the data transfer. type ExportStatus struct { Stage DataExportStage `json:"stage,omitempty"` Status DataExportStatus `json:"status,omitempty"` Reason string `json:"reason,omitempty"` SnapshotID string `json:"snapshotID,omitempty"` SnapshotNamespace string `json:"snapshotNamespace,omitempty"` SnapshotPVCName string `json:"snapshotPVCName,omitempty"` SnapshotPVCNamespace string `json:"snapshotPVCNamespace,omitempty"` TransferID string `json:"transferID,omitempty"` ProgressPercentage int `json:"progressPercentage,omitempty"` Size uint64 `json:"size,omitempty"` VolumeSnapshot string `json:"volumeSnapshot,omitempty"` RestorePVC *v1.PersistentVolumeClaim `json:"restorePVC,omitempty"` LocalSnapshotRestore bool `json:"localSnapshotRestore,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // DataExportList is a list of DataExport resources. type DataExportList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []DataExport `json:"items"` }
{ "content_hash": "39f3723e85ec4400a100257b4771a634", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 110, "avg_line_length": 47.80536912751678, "alnum_prop": 0.7560016846834199, "repo_name": "libopenstorage/stork", "id": "5a9fe418afcdb89d631ce755a44c463e590fabdb", "size": "7123", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/github.com/portworx/kdmp/pkg/apis/kdmp/v1alpha1/dataexport.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "4062" }, { "name": "Dockerfile", "bytes": "2876" }, { "name": "Go", "bytes": "2000601" }, { "name": "Makefile", "bytes": "5218" }, { "name": "Shell", "bytes": "11343" } ], "symlink_target": "" }
macro(_list_append_deduplicate listname) if(NOT "${ARGN}" STREQUAL "") if(${listname}) list(REMOVE_ITEM ${listname} ${ARGN}) endif() list(APPEND ${listname} ${ARGN}) endif() endmacro() # append elements to a list if they are not already in the list # copied from catkin/cmake/list_append_unique.cmake to keep pkgConfig # self contained macro(_list_append_unique listname) foreach(_item ${ARGN}) list(FIND ${listname} ${_item} _index) if(_index EQUAL -1) list(APPEND ${listname} ${_item}) endif() endforeach() endmacro() # pack a list of libraries with optional build configuration keywords # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig # self contained macro(_pack_libraries_with_build_configuration VAR) set(${VAR} "") set(_argn ${ARGN}) list(LENGTH _argn _count) set(_index 0) while(${_index} LESS ${_count}) list(GET _argn ${_index} lib) if("${lib}" MATCHES "^(debug|optimized|general)$") math(EXPR _index "${_index} + 1") if(${_index} EQUAL ${_count}) message(FATAL_ERROR "_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") endif() list(GET _argn ${_index} library) list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}") else() list(APPEND ${VAR} "${lib}") endif() math(EXPR _index "${_index} + 1") endwhile() endmacro() # unpack a list of libraries with optional build configuration keyword prefixes # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig # self contained macro(_unpack_libraries_with_build_configuration VAR) set(${VAR} "") foreach(lib ${ARGN}) string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}") list(APPEND ${VAR} "${lib}") endforeach() endmacro() if(hector_imu_attitude_to_tf_CONFIG_INCLUDED) return() endif() set(hector_imu_attitude_to_tf_CONFIG_INCLUDED TRUE) # set variables for source/devel/install prefixes if("FALSE" STREQUAL "TRUE") set(hector_imu_attitude_to_tf_SOURCE_PREFIX /home/trevor/ROS/catkin_ws/src/hector_slam/hector_imu_attitude_to_tf) set(hector_imu_attitude_to_tf_DEVEL_PREFIX /home/trevor/ROS/catkin_ws/devel) set(hector_imu_attitude_to_tf_INSTALL_PREFIX "") set(hector_imu_attitude_to_tf_PREFIX ${hector_imu_attitude_to_tf_DEVEL_PREFIX}) else() set(hector_imu_attitude_to_tf_SOURCE_PREFIX "") set(hector_imu_attitude_to_tf_DEVEL_PREFIX "") set(hector_imu_attitude_to_tf_INSTALL_PREFIX /home/trevor/ROS/catkin_ws/install) set(hector_imu_attitude_to_tf_PREFIX ${hector_imu_attitude_to_tf_INSTALL_PREFIX}) endif() # warn when using a deprecated package if(NOT "" STREQUAL "") set(_msg "WARNING: package 'hector_imu_attitude_to_tf' is deprecated") # append custom deprecation text if available if(NOT "" STREQUAL "TRUE") set(_msg "${_msg} ()") endif() message("${_msg}") endif() # flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project set(hector_imu_attitude_to_tf_FOUND_CATKIN_PROJECT TRUE) if(NOT " " STREQUAL " ") set(hector_imu_attitude_to_tf_INCLUDE_DIRS "") set(_include_dirs "") foreach(idir ${_include_dirs}) if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir}) set(include ${idir}) elseif("${idir} " STREQUAL "include ") get_filename_component(include "${hector_imu_attitude_to_tf_DIR}/../../../include" ABSOLUTE) if(NOT IS_DIRECTORY ${include}) message(FATAL_ERROR "Project 'hector_imu_attitude_to_tf' specifies '${idir}' as an include dir, which is not found. It does not exist in '${include}'. Ask the maintainer 'Johannes Meyer <[email protected]>' to fix it.") endif() else() message(FATAL_ERROR "Project 'hector_imu_attitude_to_tf' specifies '${idir}' as an include dir, which is not found. It does neither exist as an absolute directory nor in '/home/trevor/ROS/catkin_ws/install/${idir}'. Ask the maintainer 'Johannes Meyer <[email protected]>' to fix it.") endif() _list_append_unique(hector_imu_attitude_to_tf_INCLUDE_DIRS ${include}) endforeach() endif() set(libraries "") foreach(library ${libraries}) # keep build configuration keywords, target names and absolute libraries as-is if("${library}" MATCHES "^(debug|optimized|general)$") list(APPEND hector_imu_attitude_to_tf_LIBRARIES ${library}) elseif(TARGET ${library}) list(APPEND hector_imu_attitude_to_tf_LIBRARIES ${library}) elseif(IS_ABSOLUTE ${library}) list(APPEND hector_imu_attitude_to_tf_LIBRARIES ${library}) else() set(lib_path "") set(lib "${library}-NOTFOUND") # since the path where the library is found is returned we have to iterate over the paths manually foreach(path /home/trevor/ROS/catkin_ws/install/lib;/home/trevor/ROS/catkin_ws/devel/lib;/opt/ros/indigo/lib) find_library(lib ${library} PATHS ${path} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) if(lib) set(lib_path ${path}) break() endif() endforeach() if(lib) _list_append_unique(hector_imu_attitude_to_tf_LIBRARY_DIRS ${lib_path}) list(APPEND hector_imu_attitude_to_tf_LIBRARIES ${lib}) else() # as a fall back for non-catkin libraries try to search globally find_library(lib ${library}) if(NOT lib) message(FATAL_ERROR "Project '${PROJECT_NAME}' tried to find library '${library}'. The library is neither a target nor built/installed properly. Did you compile project 'hector_imu_attitude_to_tf'? Did you find_package() it before the subdirectory containing its code is included?") endif() list(APPEND hector_imu_attitude_to_tf_LIBRARIES ${lib}) endif() endif() endforeach() set(hector_imu_attitude_to_tf_EXPORTED_TARGETS "") # create dummy targets for exported code generation targets to make life of users easier foreach(t ${hector_imu_attitude_to_tf_EXPORTED_TARGETS}) if(NOT TARGET ${t}) add_custom_target(${t}) endif() endforeach() set(depends "") foreach(depend ${depends}) string(REPLACE " " ";" depend_list ${depend}) # the package name of the dependency must be kept in a unique variable so that it is not overwritten in recursive calls list(GET depend_list 0 hector_imu_attitude_to_tf_dep) list(LENGTH depend_list count) if(${count} EQUAL 1) # simple dependencies must only be find_package()-ed once if(NOT ${hector_imu_attitude_to_tf_dep}_FOUND) find_package(${hector_imu_attitude_to_tf_dep} REQUIRED) endif() else() # dependencies with components must be find_package()-ed again list(REMOVE_AT depend_list 0) find_package(${hector_imu_attitude_to_tf_dep} REQUIRED ${depend_list}) endif() _list_append_unique(hector_imu_attitude_to_tf_INCLUDE_DIRS ${${hector_imu_attitude_to_tf_dep}_INCLUDE_DIRS}) # merge build configuration keywords with library names to correctly deduplicate _pack_libraries_with_build_configuration(hector_imu_attitude_to_tf_LIBRARIES ${hector_imu_attitude_to_tf_LIBRARIES}) _pack_libraries_with_build_configuration(_libraries ${${hector_imu_attitude_to_tf_dep}_LIBRARIES}) _list_append_deduplicate(hector_imu_attitude_to_tf_LIBRARIES ${_libraries}) # undo build configuration keyword merging after deduplication _unpack_libraries_with_build_configuration(hector_imu_attitude_to_tf_LIBRARIES ${hector_imu_attitude_to_tf_LIBRARIES}) _list_append_unique(hector_imu_attitude_to_tf_LIBRARY_DIRS ${${hector_imu_attitude_to_tf_dep}_LIBRARY_DIRS}) list(APPEND hector_imu_attitude_to_tf_EXPORTED_TARGETS ${${hector_imu_attitude_to_tf_dep}_EXPORTED_TARGETS}) endforeach() set(pkg_cfg_extras "") foreach(extra ${pkg_cfg_extras}) if(NOT IS_ABSOLUTE ${extra}) set(extra ${hector_imu_attitude_to_tf_DIR}/${extra}) endif() include(${extra}) endforeach()
{ "content_hash": "a567831b6e4e60babce3a63020aa70c5", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 300, "avg_line_length": 42.82795698924731, "alnum_prop": 0.6992216921918152, "repo_name": "siketh/ASR", "id": "40890044e80a074d946c730ff75fec031bd43605", "size": "8190", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "catkin_ws/build/hector_slam/hector_imu_attitude_to_tf/catkin_generated/installspace/hector_imu_attitude_to_tfConfig.cmake", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "11935" }, { "name": "C++", "bytes": "569516" }, { "name": "CMake", "bytes": "1336057" }, { "name": "Common Lisp", "bytes": "110778" }, { "name": "Makefile", "bytes": "814522" }, { "name": "NewLisp", "bytes": "23003" }, { "name": "Python", "bytes": "309810" }, { "name": "Shell", "bytes": "11688" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <users type="array"> <user> <id>24253645</id> <name>Debian Project</name> <screen_name>debian</screen_name> <location>Here, there and everywhere!</location> <description>The Universal Operating System</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/198666897/guinness-debian-open_normal.gif</profile_image_url> <url>http://twitter.debian.net/</url> <protected>false</protected> <followers_count>1040</followers_count> <profile_background_color>171717</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>554d25</profile_link_color> <profile_sidebar_fill_color>ffffff</profile_sidebar_fill_color> <profile_sidebar_border_color>ffffff</profile_sidebar_border_color> <friends_count>936</friends_count> <created_at>Fri Mar 13 21:03:58 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>-18000</utc_offset> <time_zone>Eastern Time (US &amp; Canada)</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>35</statuses_count> <notifications/> <following/> <status> <created_at>Fri Jun 05 17:10:51 +0000 2009</created_at> <id>2045061171</id> <text>We are now @debian! Thanks to @macwarlock for handing over the username! (from damog)</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>15199440</id> <name>George Cochrane, Esq</name> <screen_name>georgecochrane</screen_name> <location>San Francisco, CA, USA</location> <description>Like a musical octopus, with a few less arms.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/220920559/NewPromoPhotoTwitter_normal.jpg</profile_image_url> <url>http://www.georgecochrane.com</url> <protected>false</protected> <followers_count>173</followers_count> <profile_background_color>0DD788</profile_background_color> <profile_text_color>530000</profile_text_color> <profile_link_color>134104</profile_link_color> <profile_sidebar_fill_color>718F3D</profile_sidebar_fill_color> <profile_sidebar_border_color>3A6208</profile_sidebar_border_color> <friends_count>111</friends_count> <created_at>Sun Jun 22 18:20:13 +0000 2008</created_at> <favourites_count>6</favourites_count> <utc_offset>-28800</utc_offset> <time_zone>Pacific Time (US &amp; Canada)</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/2681784/stupid_c_O_logo2.jpg</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>1206</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Sat Jun 06 02:30:23 +0000 2009</created_at> <id>2050905196</id> <text>Opera at the park! http://twitpic.com/6puup</text> <source>&lt;a href="http://www.atebits.com/"&gt;Tweetie&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>15333055</id> <name>CGenie</name> <screen_name>CGenie</screen_name> <location/> <description>CG news site bring you exclusive content every week</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/98576724/cgenie_normal.jpg</profile_image_url> <url>http://www.cgenie.com</url> <protected>false</protected> <followers_count>55</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>50</friends_count> <created_at>Sun Jul 06 14:41:50 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>0</utc_offset> <time_zone>Edinburgh</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>97</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Fri Jun 05 16:57:43 +0000 2009</created_at> <id>2044895950</id> <text>Disney offers HD downloads for first time http://tinyurl.com/m9edyy</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>15621893</id> <name>phaus</name> <screen_name>phaus</screen_name> <location/> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/240829007/me_normal.png</profile_image_url> <url/> <protected>false</protected> <followers_count>25</followers_count> <profile_background_color>1A1B1F</profile_background_color> <profile_text_color>666666</profile_text_color> <profile_link_color>2FC2EF</profile_link_color> <profile_sidebar_fill_color>252429</profile_sidebar_fill_color> <profile_sidebar_border_color>181A1E</profile_sidebar_border_color> <friends_count>25</friends_count> <created_at>Sun Jul 27 17:40:02 +0000 2008</created_at> <favourites_count>1</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Berlin</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/4185240/Texture17.gif</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>147</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Sat Jun 06 16:21:25 +0000 2009</created_at> <id>2055460340</id> <text>using virtualbox some apps while burning songs on a cd... 10 years ago you couldn't even think about this ;-). #technological #improvement</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>14811486</id> <name>Dan Tell</name> <screen_name>quantumdriver</screen_name> <location>Grand Rapids, Michigan</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/83159016/tehgoggles2_normal.jpg</profile_image_url> <url/> <protected>false</protected> <followers_count>20</followers_count> <profile_background_color>9AE4E8</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>0084B4</profile_link_color> <profile_sidebar_fill_color>DDFFCC</profile_sidebar_fill_color> <profile_sidebar_border_color>BDDCAD</profile_sidebar_border_color> <friends_count>7</friends_count> <created_at>Sat May 17 14:58:28 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>-18000</utc_offset> <time_zone>Eastern Time (US &amp; Canada)</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/6758040/watermoonnew2.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>96</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Thu Jun 04 23:05:24 +0000 2009</created_at> <id>2035794168</id> <text>Got through the raytracing chapter in blender basics today. Slowed myself down a bunch trying out some additional tricks.</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>22685108</id> <name>Jérôme Françoisse</name> <screen_name>JeromeFr</screen_name> <location/> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/209925458/n562249715_7307_normal.jpg</profile_image_url> <url/> <protected>false</protected> <followers_count>12</followers_count> <profile_background_color>9AE4E8</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>0084B4</profile_link_color> <profile_sidebar_fill_color>DDFFCC</profile_sidebar_fill_color> <profile_sidebar_border_color>BDDCAD</profile_sidebar_border_color> <friends_count>14</friends_count> <created_at>Tue Mar 03 21:43:50 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>14</statuses_count> <notifications/> <following/> <status> <created_at>Mon Jun 01 13:46:40 +0000 2009</created_at> <id>1991296094</id> <text>wants to buy a Tmobile G1...</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>14231151</id> <name>csswg</name> <screen_name>csswg</screen_name> <location>We're Cascading with Style...</location> <description>CSS working group Twitter</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/52124215/css_normal.png</profile_image_url> <url>http://www.w3.org/Style/CSS/</url> <protected>false</protected> <followers_count>398</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>12</friends_count> <created_at>Thu Mar 27 00:00:38 +0000 2008</created_at> <favourites_count>1</favourites_count> <utc_offset>-28800</utc_offset> <time_zone>Pacific Time (US &amp; Canada)</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>109</statuses_count> <notifications/> <following/> <status> <created_at>Fri Jun 05 14:07:57 +0000 2009</created_at> <id>2042952039</id> <text>&amp;lt;br type="ADJOURN MEETING"/&amp;gt;</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>21842284</id> <name>Caustic Graphics</name> <screen_name>causticgraphics</screen_name> <location>San Francisco</location> <description>Caustic Graphics is reinventing ray tracing and changing how interactive cinema-quality 3D graphics are produced, used, and enjoyed</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/94252845/caustic_logo_v_stylized_lr_normal.png</profile_image_url> <url>http://www.caustic.com</url> <protected>false</protected> <followers_count>197</followers_count> <profile_background_color>444444</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>b41b00</profile_link_color> <profile_sidebar_fill_color>ffffff</profile_sidebar_fill_color> <profile_sidebar_border_color>ffffff</profile_sidebar_border_color> <friends_count>46</friends_count> <created_at>Wed Feb 25 06:14:51 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>-28800</utc_offset> <time_zone>Pacific Time (US &amp; Canada)</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/5593342/caustic_twitter_bg.gif</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>43</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Fri Jun 05 23:47:50 +0000 2009</created_at> <id>2049390151</id> <text>AMD demos world’s first DirectX 11 GPU - http://tinyurl.com/ojwrfn</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>16448555</id> <name>mimidatabase</name> <screen_name>mimidatabase</screen_name> <location>Tours</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/60693402/6a00cdf7e7cd01094f00cdf7e7d253094f-320pi_normal.jpg</profile_image_url> <url>http://mimisblog.free.fr</url> <protected>false</protected> <followers_count>35</followers_count> <profile_background_color>9AE4E8</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>0084B4</profile_link_color> <profile_sidebar_fill_color>DDFFCC</profile_sidebar_fill_color> <profile_sidebar_border_color>BDDCAD</profile_sidebar_border_color> <friends_count>30</friends_count> <created_at>Thu Sep 25 08:50:04 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>-10800</utc_offset> <time_zone>Greenland</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>772</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Fri Jun 05 15:09:42 +0000 2009</created_at> <id>2043617863</id> <text>L'iPhone v3 n'étant même pas confirmé (réponse dans 3 jours), la question de l'exclusivité se pose déjà -&amp;gt; http://twurl.nl/giappw</text> <source>&lt;a href="http://www.twhirl.org/"&gt;twhirl&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>18526606</id> <name>Louvain-Li-Nux</name> <screen_name>louvainlinux</screen_name> <location>Louvain-la-Neuve, Belgium</location> <description>The Linux User Group (LUG) of Louvain-la-Neuve.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/69219048/logo_normal.png</profile_image_url> <url>http://louvainlinux.org</url> <protected>false</protected> <followers_count>15</followers_count> <profile_background_color>8B542B</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>9D582E</profile_link_color> <profile_sidebar_fill_color>EADEAA</profile_sidebar_fill_color> <profile_sidebar_border_color>D9B17E</profile_sidebar_border_color> <friends_count>8</friends_count> <created_at>Thu Jan 01 10:35:54 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme8/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>5</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Thu Apr 23 08:00:04 +0000 2009</created_at> <id>1592539855</id> <text>Thank you all for coming @ the 1st "Foire du Libre"! Hope to see you there next year!</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>22911116</id> <name>Julien Marlair</name> <screen_name>jmarlair</screen_name> <location/> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/91812178/1fe0571_normal.jpg</profile_image_url> <url/> <protected>false</protected> <followers_count>12</followers_count> <profile_background_color>C6E2EE</profile_background_color> <profile_text_color>663B12</profile_text_color> <profile_link_color>1F98C7</profile_link_color> <profile_sidebar_fill_color>DAECF4</profile_sidebar_fill_color> <profile_sidebar_border_color>C6E2EE</profile_sidebar_border_color> <friends_count>15</friends_count> <created_at>Thu Mar 05 12:06:02 +0000 2009</created_at> <favourites_count>1</favourites_count> <utc_offset/> <time_zone/> <profile_background_image_url>http://static.twitter.com/images/themes/theme2/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>55</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Wed May 27 09:07:01 +0000 2009</created_at> <id>1934102656</id> <text>Il est trop fort! http://www.akinator.com/aki_fr/#</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>15269080</id> <name>Kozlika</name> <screen_name>Kozlika</screen_name> <location>Paris</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/56039749/twit_normal.jpg</profile_image_url> <url>http://www.kozlika.org/kozeries/</url> <protected>true</protected> <followers_count>106</followers_count> <profile_background_color>EBEBEB</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>990000</profile_link_color> <profile_sidebar_fill_color>F3F3F3</profile_sidebar_fill_color> <profile_sidebar_border_color>DFDFDF</profile_sidebar_border_color> <friends_count>72</friends_count> <created_at>Sun Jun 29 07:29:52 +0000 2008</created_at> <favourites_count>2</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme7/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>1062</statuses_count> <notifications/> <following/> </user> <user> <id>15132395</id> <name>Guyhom</name> <screen_name>Guyhom</screen_name> <location>iPhone: 48.869191,2.334704</location> <description>Pas encore trentenaire, citoyen de l'Internet</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/74403929/DSC_0088_normal.jpg</profile_image_url> <url>http://www.guyhom.net</url> <protected>false</protected> <followers_count>81</followers_count> <profile_background_color>352726</profile_background_color> <profile_text_color>3E4415</profile_text_color> <profile_link_color>D02B55</profile_link_color> <profile_sidebar_fill_color>99CC33</profile_sidebar_fill_color> <profile_sidebar_border_color>829D5E</profile_sidebar_border_color> <friends_count>31</friends_count> <created_at>Mon Jun 16 09:07:17 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/4581121/mandolux-phelps-r-1600.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>471</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Thu Jun 04 06:57:49 +0000 2009</created_at> <id>2026815477</id> <text>Toy Story : jamais deux sans trois http://disney.go.com/toystory/</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>18551865</id> <name>Nimwendil</name> <screen_name>Nimwendil</screen_name> <location>Paris, France</location> <description>Developper on big graph systems, GIS and web. I like to think I can also be someone else than a geek : a drawing/music/redhead/ivy/walking/life-loving guy :)</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/69446061/5f3a9a67f00b27b5bbdfa2c4103c44c0_normal.jpeg</profile_image_url> <url>http://www.nimwendil.net</url> <protected>false</protected> <followers_count>37</followers_count> <profile_background_color>EDECE9</profile_background_color> <profile_text_color>634047</profile_text_color> <profile_link_color>088253</profile_link_color> <profile_sidebar_fill_color>E3E2DE</profile_sidebar_fill_color> <profile_sidebar_border_color>D3D2CF</profile_sidebar_border_color> <friends_count>36</friends_count> <created_at>Fri Jan 02 13:30:07 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme3/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>358</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Fri Jun 05 16:23:30 +0000 2009</created_at> <id>2044460806</id> <text>@CoffeePint ouais, ça déchire !! Très très bon les associations animaux / partis ^^ ! 2 mains c'est pas assez pour applaudir !</text> <source>&lt;a href="https://launchpad.net/gwibber/"&gt;Gwibber&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id>2043928741</in_reply_to_status_id> <in_reply_to_user_id>19510878</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>CoffeePint</in_reply_to_screen_name> </status> </user> <user> <id>15187757</id> <name>jeromerenard</name> <screen_name>jeromerenard</screen_name> <location/> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/55721304/Photo_3_normal.jpg</profile_image_url> <url/> <protected>true</protected> <followers_count>19</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>16</friends_count> <created_at>Sat Jun 21 05:43:48 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>-10800</utc_offset> <time_zone>Greenland</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>292</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Sat Jun 06 13:52:46 +0000 2009</created_at> <id>2054229215</id> <text>since it can not stop raining it is time to read my two new Calvin &amp; Hobbes albums</text> <source>&lt;a href="http://twitterrific.com"&gt;Twitterrific&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>17349856</id> <name>Sinmaniphel</name> <screen_name>Sinmaniphel</screen_name> <location>Paris, Ile-de-France, France</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/125238240/200x200_Aggelos_normal.jpg</profile_image_url> <url/> <protected>false</protected> <followers_count>43</followers_count> <profile_background_color>1A1B1F</profile_background_color> <profile_text_color>666666</profile_text_color> <profile_link_color>2FC2EF</profile_link_color> <profile_sidebar_fill_color>252429</profile_sidebar_fill_color> <profile_sidebar_border_color>181A1E</profile_sidebar_border_color> <friends_count>31</friends_count> <created_at>Wed Nov 12 21:54:36 +0000 2008</created_at> <favourites_count>2</favourites_count> <utc_offset/> <time_zone/> <profile_background_image_url>http://static.twitter.com/images/themes/theme9/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>507</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Sat Jun 06 14:15:01 +0000 2009</created_at> <id>2054391279</id> <text>http://tinyurl.com/l52s7d AAAAAAAAAAAH ! Buvons de la #biere mes frères</text> <source>&lt;a href="http://www.netvibes.com/subscribe.php?module=Twitter"&gt;Netvibes&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>17422018</id> <name>Khalid Yagoubi</name> <screen_name>kernity</screen_name> <location>Brussel</location> <description>Computer Engineer - Born too curious - Web 2.0 - KnowledgePlaza</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/70764373/Jaguar_Aqua_Graphite_normal.jpg</profile_image_url> <url>http://www.kernity.be</url> <protected>false</protected> <followers_count>46</followers_count> <profile_background_color>1A1B1F</profile_background_color> <profile_text_color>666666</profile_text_color> <profile_link_color>2FC2EF</profile_link_color> <profile_sidebar_fill_color>252429</profile_sidebar_fill_color> <profile_sidebar_border_color>181A1E</profile_sidebar_border_color> <friends_count>40</friends_count> <created_at>Sun Nov 16 13:04:22 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme9/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>175</statuses_count> <notifications/> <following/> <status> <created_at>Fri Jun 05 14:50:30 +0000 2009</created_at> <id>2043404381</id> <text>Alfresco is coming back in my life...is it a good thing or I'm going to rewrite this monster...</text> <source>&lt;a href="http://www.twhirl.org/"&gt;twhirl&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>19923474</id> <name>fluidIA</name> <screen_name>fluidIA</screen_name> <location>Toronto, Canada</location> <description>Hi. FluidIA is an agile UI prototyping tool. This online open source + open design project is led by Jakub Linowski. Want to get involved? Please get in touch.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/74851755/fluidiaLogo76_normal.png</profile_image_url> <url>http://www.fluidia.org</url> <protected>false</protected> <followers_count>115</followers_count> <profile_background_color>ffffff</profile_background_color> <profile_text_color>4a4a4a</profile_text_color> <profile_link_color>5967AF</profile_link_color> <profile_sidebar_fill_color>eaecf6</profile_sidebar_fill_color> <profile_sidebar_border_color>ffffff</profile_sidebar_border_color> <friends_count>40</friends_count> <created_at>Mon Feb 02 19:09:54 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>-18000</utc_offset> <time_zone>Eastern Time (US &amp; Canada)</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>65</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Sat Jun 06 14:04:54 +0000 2009</created_at> <id>2054316841</id> <text>@flayoo beautiful movie!</text> <source>&lt;a href="http://www.tweetdeck.com/"&gt;TweetDeck&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id>2053646301</in_reply_to_status_id> <in_reply_to_user_id>15138905</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>flayoo</in_reply_to_screen_name> </status> </user> <user> <id>18780641</id> <name>Wireframes Magazine</name> <screen_name>wireframes</screen_name> <location>Toronto, Canada</location> <description>Because every IA has something funky up their sleeve</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/70334121/73x73icon_normal.jpg</profile_image_url> <url>http://wireframes.linowski.ca</url> <protected>false</protected> <followers_count>976</followers_count> <profile_background_color>ffffff</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>0084B4</profile_link_color> <profile_sidebar_fill_color>daecea</profile_sidebar_fill_color> <profile_sidebar_border_color>ffffff</profile_sidebar_border_color> <friends_count>1</friends_count> <created_at>Thu Jan 08 21:41:14 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>-18000</utc_offset> <time_zone>Eastern Time (US &amp; Canada)</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>106</statuses_count> <notifications/> <following/> <status> <created_at>Thu Jun 04 21:52:38 +0000 2009</created_at> <id>2035008637</id> <text>Just moved to using www.shadowbox-js.com for all the lightboxes and image zoom effects.</text> <source>&lt;a href="http://www.twhirl.org/"&gt;twhirl&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>15308469</id> <name>McKinsey Quarterly</name> <screen_name>McKQuarterly</screen_name> <location/> <description>We are the business journal of McKinsey &amp; Company. Our goal is to offer new ways of thinking about management in the private, public, and nonprofit sect</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/58066104/TwitterQ_normal.jpg</profile_image_url> <url>http://www.mckinseyquarterly.com</url> <protected>false</protected> <followers_count>9848</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>696969</profile_text_color> <profile_link_color>6467CD</profile_link_color> <profile_sidebar_fill_color>CDCD99</profile_sidebar_fill_color> <profile_sidebar_border_color>996633</profile_sidebar_border_color> <friends_count>1204</friends_count> <created_at>Thu Jul 03 14:03:46 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>-18000</utc_offset> <time_zone>Eastern Time (US &amp; Canada)</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/2864961/twitterbackground_final2.jpg</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>306</statuses_count> <notifications/> <following/> <status> <created_at>Fri Jun 05 20:50:10 +0000 2009</created_at> <id>2047560372</id> <text>What&amp;rsquo;s next for US banks? http://bit.ly/6pMSN</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>18935593</id> <name>franckpaul</name> <screen_name>franckpaul</screen_name> <location>Paris, Île-de-France</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/182928640/twitter_normal.png</profile_image_url> <url>http://open-time.net/</url> <protected>false</protected> <followers_count>138</followers_count> <profile_background_color>333333</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>ff871f</profile_link_color> <profile_sidebar_fill_color>ffffff</profile_sidebar_fill_color> <profile_sidebar_border_color>6eff24</profile_sidebar_border_color> <friends_count>169</friends_count> <created_at>Tue Jan 13 11:32:39 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/3887265/fond.png</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>944</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Sat Jun 06 09:13:15 +0000 2009</created_at> <id>2052838349</id> <text>@gilda_f on peut dire ça oui ;-) ceci dit elle me donne matière, petit à petit à un billet rigolo !</text> <source>&lt;a href="http://www.nambu.com"&gt;Nambu&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id>2052656870</in_reply_to_status_id> <in_reply_to_user_id>15872615</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>gilda_f</in_reply_to_screen_name> </status> </user> <user> <id>1814051</id> <name>Benoît Octave</name> <screen_name>benoitoctave</screen_name> <location>Brussels, Brussels-Capital Reg</location> <description>Wireless Evangelist WPP, Mac user since 1984</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/104709331/IMG_0115_normal.jpg</profile_image_url> <url>http://profile.to/benoitoctave/</url> <protected>false</protected> <followers_count>651</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>621</friends_count> <created_at>Wed Mar 21 23:52:17 +0000 2007</created_at> <favourites_count>1</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/2554187/wallpaper1440_900.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>818</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Sat Jun 06 12:21:00 +0000 2009</created_at> <id>2053674723</id> <text>RT @beaercolini: is seal the deal http://bit.ly/wBeJU</text> <source>&lt;a href="http://www.tweetdeck.com/"&gt;TweetDeck&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>20130220</id> <name>Feed Jockey</name> <screen_name>feedjockey</screen_name> <location>Louvain-la-Neuve</location> <description>Enterprise Social Search news</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/75687337/feedj7_normal.png</profile_image_url> <url>http://www.enterprisesocialsearch.com?tw</url> <protected>false</protected> <followers_count>18</followers_count> <profile_background_color>f8f6fd</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>445566</profile_link_color> <profile_sidebar_fill_color>ffffcc</profile_sidebar_fill_color> <profile_sidebar_border_color>445566</profile_sidebar_border_color> <friends_count>28</friends_count> <created_at>Thu Feb 05 09:03:40 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/4272253/feedj3.png</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>15</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Fri Jun 05 08:47:05 +0000 2009</created_at> <id>2040813501</id> <text>Bing launches. It's awful. http://cli.gs/qhdMJM</text> <source>&lt;a href="http://www.joedolson.com/articles/wp-to-twitter/"&gt;WP to Twitter&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>20988933</id> <name>Laura Guiot</name> <screen_name>lguiot</screen_name> <location>Belgium</location> <description>Geek girl and student in PR, enjoying all web 2.0 and social media stuff</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/78818722/laura_normal.jpg</profile_image_url> <url>http://www.linkedin.com/in/lauraguiot</url> <protected>false</protected> <followers_count>57</followers_count> <profile_background_color>222222</profile_background_color> <profile_text_color>112D2D</profile_text_color> <profile_link_color>e8056e</profile_link_color> <profile_sidebar_fill_color>f2dcb1</profile_sidebar_fill_color> <profile_sidebar_border_color>ffc9f3</profile_sidebar_border_color> <friends_count>50</friends_count> <created_at>Mon Feb 16 14:29:30 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/4523196/bg_twittergallery.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>13</statuses_count> <notifications/> <following/> <status> <created_at>Wed Apr 29 08:35:00 +0000 2009</created_at> <id>1647344112</id> <text>Attending a really not interesting class about internal communication writing :(</text> <source>&lt;a href="http://www.atebits.com/"&gt;Tweetie&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>19160577</id> <name>MicroPlaza</name> <screen_name>microplaza</screen_name> <location/> <description>Stay tuned to MicroPlaza features &amp; service status. Discover relevant information filtered by people you follow. Get our scoop, share your news.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/75711966/logo_1_normal.png</profile_image_url> <url>http://www.microplaza.com</url> <protected>false</protected> <followers_count>1983</followers_count> <profile_background_color>ECF3FF</profile_background_color> <profile_text_color>707070</profile_text_color> <profile_link_color>2557F8</profile_link_color> <profile_sidebar_fill_color>f7f7f7</profile_sidebar_fill_color> <profile_sidebar_border_color>707070</profile_sidebar_border_color> <friends_count>105</friends_count> <created_at>Sun Jan 18 22:29:36 +0000 2009</created_at> <favourites_count>30</favourites_count> <utc_offset>-36000</utc_offset> <time_zone>Hawaii</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/4274388/logo_1.png</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>733</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Sat Jun 06 14:28:00 +0000 2009</created_at> <id>2054489783</id> <text>Why wikis should be a standard workplace tool. - http://tinyurl.com/pv3lpj (by @CommunispaceCEO)</text> <source>&lt;a href="http://www.cotweet.com"&gt;CoTweet&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>20085237</id> <name>Sophie Berque</name> <screen_name>soph1980</screen_name> <location/> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/113708649/soph1980_hotmail_com_d5547ce6_normal.jpg</profile_image_url> <url/> <protected>false</protected> <followers_count>18</followers_count> <profile_background_color>BADFCD</profile_background_color> <profile_text_color>0C3E53</profile_text_color> <profile_link_color>FF0000</profile_link_color> <profile_sidebar_fill_color>FFF7CC</profile_sidebar_fill_color> <profile_sidebar_border_color>F2E195</profile_sidebar_border_color> <friends_count>14</friends_count> <created_at>Wed Feb 04 19:50:29 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset/> <time_zone/> <profile_background_image_url>http://static.twitter.com/images/themes/theme12/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>0</statuses_count> <notifications/> <following/> </user> <user> <id>6182842</id> <name>Laura</name> <screen_name>lowett</screen_name> <location>Belgium</location> <description>Le quotidien d'une geekette belge passionnée par le web 2.0</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/142292053/sticker_avatar_pink_normal.jpg</profile_image_url> <url>http://www.geeketteandgreluche.fr</url> <protected>false</protected> <followers_count>712</followers_count> <profile_background_color>d13f76</profile_background_color> <profile_text_color>464d58</profile_text_color> <profile_link_color>d13f76</profile_link_color> <profile_sidebar_fill_color>fcfcfc</profile_sidebar_fill_color> <profile_sidebar_border_color>ffffff</profile_sidebar_border_color> <friends_count>324</friends_count> <created_at>Sun May 20 18:16:42 +0000 2007</created_at> <favourites_count>1</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/4588118/twitter_background_4.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>4501</statuses_count> <notifications/> <following/> <status> <created_at>Sat Jun 06 14:06:07 +0000 2009</created_at> <id>2054326193</id> <text>@Zetura @matgerard On n'en a pas pris finalement parce qu'on a un petit budget, et on préfère attendre d'en avoir un plus gros</text> <source>&lt;a href="http://www.tweetdeck.com/"&gt;TweetDeck&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id>2053717585</in_reply_to_status_id> <in_reply_to_user_id>22243445</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>Zetura</in_reply_to_screen_name> </status> </user> <user> <id>19281623</id> <name>DE JAER Charlotte</name> <screen_name>charlottedejaer</screen_name> <location>Mons</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/200271311/charlotte_normal.gif</profile_image_url> <url>http://charlottedejaer.ecoloj.be</url> <protected>false</protected> <followers_count>68</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>56</friends_count> <created_at>Wed Jan 21 09:11:54 +0000 2009</created_at> <favourites_count>0</favourites_count> <utc_offset>-10800</utc_offset> <time_zone>Greenland</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>73</statuses_count> <notifications/> <following/> <status> <created_at>Sat Jun 06 15:57:46 +0000 2009</created_at> <id>2055240506</id> <text>Dernier tour de collage...</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>18939392</id> <name>Caroline</name> <screen_name>Celinora</screen_name> <location>Eindhoven</location> <description>French student in Human Technology Interaction, living in the Netherlands. Happy, funny, busy!</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/70931638/avatar6192_18.gif_normal.png</profile_image_url> <url>http://www.celinora.net</url> <protected>false</protected> <followers_count>24</followers_count> <profile_background_color>EBEBEB</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>990000</profile_link_color> <profile_sidebar_fill_color>F3F3F3</profile_sidebar_fill_color> <profile_sidebar_border_color>DFDFDF</profile_sidebar_border_color> <friends_count>24</friends_count> <created_at>Tue Jan 13 14:35:53 +0000 2009</created_at> <favourites_count>1</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Amsterdam</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme7/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>147</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Wed Jun 03 18:47:38 +0000 2009</created_at> <id>2019610604</id> <text>Just realise that today was Bing live! Looks pretty much like Google, I do'nt see the difference (yet?). www.bing.com</text> <source>&lt;a href="http://twitterfox.net/"&gt;TwitterFox&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>18449574</id> <name>fabiennev</name> <screen_name>fabiennev</screen_name> <location>Brussels</location> <description/> <profile_image_url>http://static.twitter.com/images/default_profile_normal.png</profile_image_url> <url/> <protected>false</protected> <followers_count>16</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>6</friends_count> <created_at>Mon Dec 29 13:48:21 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>0</statuses_count> <notifications/> <following/> </user> <user> <id>13434222</id> <name>Alexis Metaireau</name> <screen_name>ametaireau</screen_name> <location>Toulouse, France</location> <description>web developer and student</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/62300879/Photos-0076_normal.jpg</profile_image_url> <url>http://notmyidea.org</url> <protected>false</protected> <followers_count>83</followers_count> <profile_background_color>352726</profile_background_color> <profile_text_color>3E4415</profile_text_color> <profile_link_color>D02B55</profile_link_color> <profile_sidebar_fill_color>99CC33</profile_sidebar_fill_color> <profile_sidebar_border_color>829D5E</profile_sidebar_border_color> <friends_count>20</friends_count> <created_at>Wed Feb 13 15:25:04 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme5/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>750</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Sun May 31 00:25:56 +0000 2009</created_at> <id>1976478367</id> <text>viens de se rendre compte qu'il avait loupé #pyconfr.</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>625063</id> <name>Gregory Culpin</name> <screen_name>gculpin</screen_name> <location>Belgium</location> <description>People and technology enthusiast. Knowledge Plaza and MicroPlaza evangelist.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/62515380/n530890069_2965_normal.jpg</profile_image_url> <url>http://www.linkedin.com/in/gregoryculpin</url> <protected>false</protected> <followers_count>366</followers_count> <profile_background_color>EBEBEB</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>990000</profile_link_color> <profile_sidebar_fill_color>F3F3F3</profile_sidebar_fill_color> <profile_sidebar_border_color>DFDFDF</profile_sidebar_border_color> <friends_count>184</friends_count> <created_at>Thu Jan 11 10:12:44 +0000 2007</created_at> <favourites_count>3</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/3862880/sawhorse_flickr_twitter_3184680781.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>1143</statuses_count> <notifications/> <following/> <status> <created_at>Sat Jun 06 14:51:55 +0000 2009</created_at> <id>2054677866</id> <text>@rondon just stumbled upon this pic of your speech last year – "Who lives in a yurt like this?" ;-) http://twitpic.com/6qu48 #KCUK09</text> <source>&lt;a href="http://www.tweetdeck.com/"&gt;TweetDeck&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id>14541004</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>rondon</in_reply_to_screen_name> </status> </user> <user> <id>10226522</id> <name>EricFederici</name> <screen_name>EricFederici</screen_name> <location>Lyon, France</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/67878207/avatar_normal.jpg</profile_image_url> <url>http://www.federici.fr</url> <protected>false</protected> <followers_count>38</followers_count> <profile_background_color>EBEBEB</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>990000</profile_link_color> <profile_sidebar_fill_color>F3F3F3</profile_sidebar_fill_color> <profile_sidebar_border_color>DFDFDF</profile_sidebar_border_color> <friends_count>76</friends_count> <created_at>Tue Nov 13 20:45:28 +0000 2007</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/3639117/bg_twitter.png</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>64</statuses_count> <notifications/> <following/> <status> <created_at>Fri Jun 05 21:03:16 +0000 2009</created_at> <id>2047705949</id> <text>@fvsch : le déluge est passé par Montchat; désolé pour ta chambre...</text> <source>&lt;a href="http://twitterfox.net/"&gt;TwitterFox&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id>14587759</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>fvsch</in_reply_to_screen_name> </status> </user> <user> <id>13334762</id> <name>GitHub</name> <screen_name>github</screen_name> <location>San Francisco, CA</location> <description>Social coding? Pretty awesome.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53128678/octocat_fluid_normal.png</profile_image_url> <url>http://github.com</url> <protected>false</protected> <followers_count>3795</followers_count> <profile_background_color>eeeeee</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>dddddd</profile_sidebar_fill_color> <profile_sidebar_border_color>bbbbbb</profile_sidebar_border_color> <friends_count>7</friends_count> <created_at>Mon Feb 11 04:41:50 +0000 2008</created_at> <favourites_count>12</favourites_count> <utc_offset>-32400</utc_offset> <time_zone>Alaska</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/4229589/header_bg.png</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>805</statuses_count> <notifications/> <following/> <status> <created_at>Thu Jun 04 19:11:43 +0000 2009</created_at> <id>2033084061</id> <text>@roidrage don't go trying to dig up repressed memories...</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id>2032596770</in_reply_to_status_id> <in_reply_to_user_id>14658472</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>roidrage</in_reply_to_screen_name> </status> </user> <user> <id>15428188</id> <name>Mitternacht</name> <screen_name>Mitternacht</screen_name> <location>Paris</location> <description>Type, design and music lover in constant exploration.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/61311170/gravatar_normal.png</profile_image_url> <url>http://inspireme.lasoeurkaramazov.net/</url> <protected>false</protected> <followers_count>232</followers_count> <profile_background_color>fff</profile_background_color> <profile_text_color>624528</profile_text_color> <profile_link_color>94A834</profile_link_color> <profile_sidebar_fill_color>fff</profile_sidebar_fill_color> <profile_sidebar_border_color>fff</profile_sidebar_border_color> <friends_count>98</friends_count> <created_at>Mon Jul 14 15:57:29 +0000 2008</created_at> <favourites_count>3</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/6631521/inspireme.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>1029</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Sat Jun 06 11:05:05 +0000 2009</created_at> <id>2053310103</id> <text>@retinart I'm really really looking forward to having a look at the new design :)</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id>2053267715</in_reply_to_status_id> <in_reply_to_user_id>23735929</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>retinart</in_reply_to_screen_name> </status> </user> <user> <id>6063782</id> <name>neolao</name> <screen_name>neolao</screen_name> <location>iPhone: 48.848155,2.661610</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/16812872/neo_avatar_60x60_normal.png</profile_image_url> <url/> <protected>false</protected> <followers_count>123</followers_count> <profile_background_color>7F7F8E</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>FF3300</profile_link_color> <profile_sidebar_fill_color>A0C5C7</profile_sidebar_fill_color> <profile_sidebar_border_color>7F7F8E</profile_sidebar_border_color> <friends_count>63</friends_count> <created_at>Tue May 15 14:19:26 +0000 2007</created_at> <favourites_count>7</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/13167792/twitter_background.png</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>775</statuses_count> <notifications>0</notifications> <following>0</following> <status> <created_at>Fri Jun 05 21:11:14 +0000 2009</created_at> <id>2047791893</id> <text>@inini http://bit.ly/2P8yLH</text> <source>&lt;a href="http://code.google.com/p/tircd/"&gt;tircd&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id>13674402</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>inini</in_reply_to_screen_name> </status> </user> <user> <id>17100479</id> <name>dotclear</name> <screen_name>dotclear</screen_name> <location>iPhone: 47.393281,0.684993</location> <description>Blog management made easy - Free, open source blogging software</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/65268762/dotclear_logo_normal.png</profile_image_url> <url>http://www.dotclear.org</url> <protected>false</protected> <followers_count>140</followers_count> <profile_background_color>1a2d52</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>eba31f</profile_link_color> <profile_sidebar_fill_color>eee</profile_sidebar_fill_color> <profile_sidebar_border_color>ccc</profile_sidebar_border_color> <friends_count>45</friends_count> <created_at>Sat Nov 01 13:54:23 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>-36000</utc_offset> <time_zone>Hawaii</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/3431318/DC_twit.png</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>42</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Wed Jun 03 08:20:13 +0000 2009</created_at> <id>2014379853</id> <text>[ACTU] Salut, et encore merci pour le poisson http://tinyurl.com/ohpz3l</text> <source>&lt;a href="http://twitterfeed.com"&gt;twitterfeed&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>17062121</id> <name>theClimber157</name> <screen_name>theClimber157</screen_name> <location>LLN, Belgium</location> <description>IT engineer, rock climbing lover and slackline lover, tweeting over ton's of different things</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/77264332/62_normal.jpg</profile_image_url> <url>http://www.theclimber.be</url> <protected>false</protected> <followers_count>178</followers_count> <profile_background_color>859cbc</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>FF3300</profile_link_color> <profile_sidebar_fill_color>A0C5C7</profile_sidebar_fill_color> <profile_sidebar_border_color>86A4A6</profile_sidebar_border_color> <friends_count>226</friends_count> <created_at>Thu Oct 30 08:40:54 +0000 2008</created_at> <favourites_count>3</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/4399008/pelvouxTrans2.png</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>309</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Thu Jun 04 10:17:07 +0000 2009</created_at> <id>2027904027</id> <text>nice Twitter tshirt: http://site.despair.com/socialmediatee/</text> <source>&lt;a href="http://identi.ca/"&gt;Identica&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>14587759</id> <name>Florent V.</name> <screen_name>fvsch</screen_name> <location>Lyon, France</location> <description>Web professional</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53497070/portrait-parisweb_normal.jpg</profile_image_url> <url>http://fvsch.com</url> <protected>false</protected> <followers_count>160</followers_count> <profile_background_color>d2eee8</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>1d7c4c</profile_link_color> <profile_sidebar_fill_color>f4efcd</profile_sidebar_fill_color> <profile_sidebar_border_color>d1d1d1</profile_sidebar_border_color> <friends_count>76</friends_count> <created_at>Tue Apr 29 17:34:06 +0000 2008</created_at> <favourites_count>6</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>726</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Fri Jun 05 21:11:20 +0000 2009</created_at> <id>2047793045</id> <text>@Thanh Ce que j’ai vu de la deuxième mi-temps était sympa. Ribery comme un dingue + petit coup de fouet des Turcs sur la fin + déluge.</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id>2047262698</in_reply_to_status_id> <in_reply_to_user_id>4609851</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>Thanh</in_reply_to_screen_name> </status> </user> <user> <id>6355742</id> <name>Michaël Delhaye</name> <screen_name>michaeldelhaye</screen_name> <location>Enghien,Belgique</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/108491102/IMG_6412_normal.jpg</profile_image_url> <url>http://michael.delhaye.name</url> <protected>false</protected> <followers_count>24</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>23</friends_count> <created_at>Sun May 27 05:29:10 +0000 2007</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>187</statuses_count> <notifications/> <following/> <status> <created_at>Sat Jun 06 08:06:20 +0000 2009</created_at> <id>2052546882</id> <text>candidats.be : plus de 65 candidats signataires, y compris les présidents de Ecolo, PS et cdH http://tinyurl.com/q2lwgr</text> <source>&lt;a href="http://identi.ca/"&gt;Identica&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>16533939</id> <name>Monique Brunel</name> <screen_name>webatou</screen_name> <location>Mons (Belgique)</location> <description>En campagne pour des sites Web de qualité, conformes et accessibles</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/61025014/monique-gravatar-48_normal.jpg</profile_image_url> <url>http://blog.webatou.info/</url> <protected>false</protected> <followers_count>446</followers_count> <profile_background_color>A6A7C6</profile_background_color> <profile_text_color>4B4C83</profile_text_color> <profile_link_color>990000</profile_link_color> <profile_sidebar_fill_color>E0DFEF</profile_sidebar_fill_color> <profile_sidebar_border_color>4B4C83</profile_sidebar_border_color> <friends_count>305</friends_count> <created_at>Tue Sep 30 20:19:04 +0000 2008</created_at> <favourites_count>42</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/3629101/fond-ciel-800.png</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>1219</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Sat Jun 06 10:13:53 +0000 2009</created_at> <id>2053089937</id> <text>il est vrai que les updates manquent un peu de réinvention... RT: @Mateusz: Unfollow @dreynders</text> <source>&lt;a href="http://twitterfox.net/"&gt;TwitterFox&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>10376622</id> <name>Paris-Web</name> <screen_name>paris_web</screen_name> <location>Paris</location> <description>design, qualité, accessibilité</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/59673421/logo_pw2_normal.png</profile_image_url> <url>http://www.paris-web.fr/</url> <protected>false</protected> <followers_count>308</followers_count> <profile_background_color>FFFFFF</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>1a93d</profile_link_color> <profile_sidebar_fill_color>ffffff</profile_sidebar_fill_color> <profile_sidebar_border_color>1a93d1</profile_sidebar_border_color> <friends_count>21</friends_count> <created_at>Mon Nov 19 07:22:03 +0000 2007</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/1235152/logo-Paris_Web-square-small.png</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>80</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Thu May 28 12:13:15 +0000 2009</created_at> <id>1946479764</id> <text>!parisweb Certains sont bien informés, il a raison :-) RT @glazou : #pw09 ça va encore DÉPOTER !!!!!</text> <source>&lt;a href="http://identi.ca/"&gt;Identica&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>9102432</id> <name>Guillaume Schaeffer</name> <screen_name>giz404</screen_name> <location>Quatzenheim</location> <description>Chargé de comm' multifonctions</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/229520292/32twitter_normal.jpg</profile_image_url> <url>http://giz404.freecontrib.org/</url> <protected>false</protected> <followers_count>78</followers_count> <profile_background_color>60a399</profile_background_color> <profile_text_color>7a7a7a</profile_text_color> <profile_link_color>60a399</profile_link_color> <profile_sidebar_fill_color>100f2e</profile_sidebar_fill_color> <profile_sidebar_border_color>cbbe7a</profile_sidebar_border_color> <friends_count>66</friends_count> <created_at>Wed Sep 26 07:13:44 +0000 2007</created_at> <favourites_count>2</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/11779247/fond-twitter.jpg</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>1059</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Thu Jun 04 16:48:24 +0000 2009</created_at> <id>2031430131</id> <text>Cette fois ci je m'arrache, l'apéro n'attend pas !</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>14293464</id> <name>Ldo</name> <screen_name>Ldo</screen_name> <location>Lille</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/52394921/n1036120738_40950_8926_normal.jpg</profile_image_url> <url>http://www.12h26.com</url> <protected>false</protected> <followers_count>40</followers_count> <profile_background_color>3C7682</profile_background_color> <profile_text_color>70797D</profile_text_color> <profile_link_color>58A362</profile_link_color> <profile_sidebar_fill_color>232323</profile_sidebar_fill_color> <profile_sidebar_border_color>A5D0BF</profile_sidebar_border_color> <friends_count>30</friends_count> <created_at>Thu Apr 03 14:14:20 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/3059197/2638_bg_twit.jpg</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>396</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Fri Jun 05 20:37:11 +0000 2009</created_at> <id>2047416093</id> <text>On va tous mourriiiir, c'est foutuuuuuuu !!! et en plus c'est notre faute... #home :D</text> <source>&lt;a href="http://twidroid.com"&gt;twidroid&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>15432061</id> <name>maximux</name> <screen_name>maximux</screen_name> <location/> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/218640151/logo_normal.png</profile_image_url> <url/> <protected>false</protected> <followers_count>1</followers_count> <profile_background_color>ffffff</profile_background_color> <profile_text_color>5b5b5d</profile_text_color> <profile_link_color>93117e</profile_link_color> <profile_sidebar_fill_color>ffffff</profile_sidebar_fill_color> <profile_sidebar_border_color>c492bd</profile_sidebar_border_color> <friends_count>1</friends_count> <created_at>Mon Jul 14 20:45:09 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>-10800</utc_offset> <time_zone>Greenland</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/13888544/logo.png</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>1</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Mon Jul 14 20:45:43 +0000 2008</created_at> <id>858369223</id> <text>Update soon...</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>14489786</id> <name>Knowledge Plaza</name> <screen_name>knowledgeplaza</screen_name> <location>Belgium</location> <description>An easy-to-use, open, flexible and intuitive solution for sharing information and knowledge. </description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/86615521/kp_symbol_logo_medium_normal.png</profile_image_url> <url>http://www.knowledgeplaza.net</url> <protected>false</protected> <followers_count>49</followers_count> <profile_background_color>ffffff</profile_background_color> <profile_text_color>222</profile_text_color> <profile_link_color>13678A</profile_link_color> <profile_sidebar_fill_color>E7FED2</profile_sidebar_fill_color> <profile_sidebar_border_color>ffffff</profile_sidebar_border_color> <friends_count>18</friends_count> <created_at>Wed Apr 23 08:44:18 +0000 2008</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/5073227/kp_symbol_logo_medium.png</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>0</statuses_count> <notifications>false</notifications> <following>false</following> </user> <user> <id>8101262</id> <name>Scott Gavin</name> <screen_name>slgavin</screen_name> <location>Kent UK</location> <description>Director @ Applied Trends who are UK rep for Knowledge Plaza, big on Enterprise 2.0</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/58053333/scott2_normal.jpg</profile_image_url> <url>http://scottgavin.info/</url> <protected>false</protected> <followers_count>517</followers_count> <profile_background_color>0099B9</profile_background_color> <profile_text_color>3C3940</profile_text_color> <profile_link_color>0099B9</profile_link_color> <profile_sidebar_fill_color>95E8EC</profile_sidebar_fill_color> <profile_sidebar_border_color>5ED4DC</profile_sidebar_border_color> <friends_count>462</friends_count> <created_at>Fri Aug 10 10:37:11 +0000 2007</created_at> <favourites_count>21</favourites_count> <utc_offset>0</utc_offset> <time_zone>London</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme4/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>1520</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Sat Jun 06 15:58:02 +0000 2009</created_at> <id>2055242882</id> <text>@gculpin yeah will be at nearby hotel by 8pm so look foward to meeting up #kcuk09</text> <source>&lt;a href="http://twitterfon.net/"&gt;TwitterFon&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id>2054156290</in_reply_to_status_id> <in_reply_to_user_id>625063</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>gculpin</in_reply_to_screen_name> </status> </user> <user> <id>1615611</id> <name>Olivier Verbeke</name> <screen_name>Olivero</screen_name> <location>Belgium</location> <description>MicroPlaza.com and KnowledgePlaza.be evangelist. You can't use an old map to find new land.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/54191560/OVe_normal.jpg</profile_image_url> <url>http://knowledgeplaza.be</url> <protected>false</protected> <followers_count>198</followers_count> <profile_background_color>ECF3FF</profile_background_color> <profile_text_color>707070</profile_text_color> <profile_link_color>2557F8</profile_link_color> <profile_sidebar_fill_color>ffffff</profile_sidebar_fill_color> <profile_sidebar_border_color>707070</profile_sidebar_border_color> <friends_count>191</friends_count> <created_at>Tue Mar 20 11:31:16 +0000 2007</created_at> <favourites_count>9</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/5592700/be_heard_bis.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>287</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Wed Mar 25 15:50:55 +0000 2009</created_at> <id>1388610561</id> <text>RT @microplaza Twitter: Seriously short stories versus gateway to substantive content - http://tinyurl.com/dmwe6v (via @denisbhancock)</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>66693</id> <name>tnt</name> <screen_name>tnt</screen_name> <location>Rollingwood, United States</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/16548342/glider_normal.png</profile_image_url> <url/> <protected>true</protected> <followers_count>22</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>24</friends_count> <created_at>Thu Dec 14 11:35:42 +0000 2006</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>602</statuses_count> <notifications/> <following/> </user> <user> <id>10209392</id> <name>Benjamin De Cock</name> <screen_name>deaxon</screen_name> <location>Belgium</location> <description>Interaction Designer</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/60184959/hop_ptit_normal.png</profile_image_url> <url>http://deaxon.com</url> <protected>false</protected> <followers_count>323</followers_count> <profile_background_color>3C362E</profile_background_color> <profile_text_color>121212</profile_text_color> <profile_link_color>32CCFF</profile_link_color> <profile_sidebar_fill_color>F8F8F8</profile_sidebar_fill_color> <profile_sidebar_border_color>F3F3F3</profile_sidebar_border_color> <friends_count>50</friends_count> <created_at>Tue Nov 13 09:34:36 +0000 2007</created_at> <favourites_count>6</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>784</statuses_count> <notifications/> <following/> <status> <created_at>Thu Jun 04 21:11:54 +0000 2009</created_at> <id>2034535191</id> <text>Camino 2.0 Beta 3 is out. Well, who cares when you have Safari 4b available? http://i5.be/rw</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>2121031</id> <name>Michaël Villar</name> <screen_name>michaelvillar</screen_name> <location>iPhone: 50.666611,4.612473</location> <description>Webdevelopper/designer</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/74654059/bored_500_normal.jpg</profile_image_url> <url>http://www.michaelvillar.com/</url> <protected>false</protected> <followers_count>378</followers_count> <profile_background_color>6e6e6e</profile_background_color> <profile_text_color>5F5F5F</profile_text_color> <profile_link_color>005bcb</profile_link_color> <profile_sidebar_fill_color>000000</profile_sidebar_fill_color> <profile_sidebar_border_color>000000</profile_sidebar_border_color> <friends_count>77</friends_count> <created_at>Sat Mar 24 17:49:38 +0000 2007</created_at> <favourites_count>2</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/2483355/Image-1.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>2099</statuses_count> <notifications/> <following/> <status> <created_at>Fri Jun 05 19:43:13 +0000 2009</created_at> <id>2046806775</id> <text>Nice, the Home HD video from youtube is bugged when downloaded.. 1.3 go for the trash.</text> <source>&lt;a href="http://www.atebits.com/"&gt;Tweetie&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>6619162</id> <name>Nicolas Perriault</name> <screen_name>n1k0</screen_name> <location>Arcueil, France</location> <description>They didn't know that it was impossible, thus they did it. -- Mark Twain</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/94266171/Photo_9_sepia_normal.jpg</profile_image_url> <url>http://prendreuncafe.com</url> <protected>false</protected> <followers_count>393</followers_count> <profile_background_color>1A1B1F</profile_background_color> <profile_text_color>666666</profile_text_color> <profile_link_color>2FC2EF</profile_link_color> <profile_sidebar_fill_color>252429</profile_sidebar_fill_color> <profile_sidebar_border_color>181A1E</profile_sidebar_border_color> <friends_count>164</friends_count> <created_at>Wed Jun 06 13:58:15 +0000 2007</created_at> <favourites_count>37</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme9/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>3737</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Sat Jun 06 15:11:54 +0000 2009</created_at> <id>2054845546</id> <text>@laurentLC +1 #sensiolabs</text> <source>&lt;a href="http://www.nambu.com"&gt;Nambu&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id>2054655825</in_reply_to_status_id> <in_reply_to_user_id>8459932</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>laurentLC</in_reply_to_screen_name> </status> </user> <user> <id>7591842</id> <name>Hélène</name> <screen_name>la_lene</screen_name> <location>Lyon, France</location> <description>Photography, webdesign, digital scrapbooking</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/250699617/4160_86743176589_644556589_1739684_6727225_n_normal.jpg</profile_image_url> <url>http://www.jeuxdemaux.com</url> <protected>true</protected> <followers_count>114</followers_count> <profile_background_color>ffffff</profile_background_color> <profile_text_color>694f54</profile_text_color> <profile_link_color>1c87b0</profile_link_color> <profile_sidebar_fill_color>f990ee</profile_sidebar_fill_color> <profile_sidebar_border_color>ffffff</profile_sidebar_border_color> <friends_count>124</friends_count> <created_at>Thu Jul 19 18:21:42 +0000 2007</created_at> <favourites_count>4</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/3878930/fond.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>2801</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Fri Jun 05 20:28:08 +0000 2009</created_at> <id>2047314395</id> <text>oh merdeuuu la bourde où fallait pas....</text> <source>&lt;a href="http://twitterfox.net/"&gt;TwitterFox&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>8781082</id> <name>AdrienLeygues</name> <screen_name>Voulf</screen_name> <location>Paris</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/54126426/adrien_legues_avatar_normal.png</profile_image_url> <url>http://adriens.leygues.free.fr</url> <protected>false</protected> <followers_count>97</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>65</friends_count> <created_at>Mon Sep 10 08:01:07 +0000 2007</created_at> <favourites_count>1</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>1132</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Thu Jun 04 17:12:46 +0000 2009</created_at> <id>2031714284</id> <text>Drink Day @ Digitas, No Charette !</text> <source>&lt;a href="http://www.tweetdeck.com/"&gt;TweetDeck&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>6637282</id> <name>Frédéric de Villamil</name> <screen_name>fdevillamil</screen_name> <location>Paris, France</location> <description>Web usability specialist / founder of Twitmark.me, social bookmarking 140 characters at a time</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/179360630/fred-20090424-002_normal.jpg</profile_image_url> <url>http://t37.net</url> <protected>false</protected> <followers_count>578</followers_count> <profile_background_color>FFFFFF</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>2971A7</profile_link_color> <profile_sidebar_fill_color>ffffff</profile_sidebar_fill_color> <profile_sidebar_border_color>FFFFFF</profile_sidebar_border_color> <friends_count>140</friends_count> <created_at>Thu Jun 07 10:34:28 +0000 2007</created_at> <favourites_count>7</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/2708305/twitter-template.png</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>8158</statuses_count> <notifications>0</notifications> <following>0</following> <status> <created_at>Sat Jun 06 13:07:50 +0000 2009</created_at> <id>2053937664</id> <text>@bduperrin I'm in (unless @bobonne says the contrary)</text> <source>&lt;a href="http://desktop.seesmic.com/"&gt;Seesmic Desktop&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id>2053912822</in_reply_to_status_id> <in_reply_to_user_id>15412816</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>bduperrin</in_reply_to_screen_name> </status> </user> <user> <id>6611282</id> <name>Groumphy</name> <screen_name>Groumphy</screen_name> <location>Bruxelles</location> <description>Idée à chaud, et suivis d'une journée !</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/76988485/150x150_normal.jpg</profile_image_url> <url>http://my.opera.com/groumphy</url> <protected>false</protected> <followers_count>98</followers_count> <profile_background_color>C6E2EE</profile_background_color> <profile_text_color>663B12</profile_text_color> <profile_link_color>1F98C7</profile_link_color> <profile_sidebar_fill_color>DAECF4</profile_sidebar_fill_color> <profile_sidebar_border_color>C6E2EE</profile_sidebar_border_color> <friends_count>114</friends_count> <created_at>Wed Jun 06 05:33:40 +0000 2007</created_at> <favourites_count>3</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme2/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>1922</statuses_count> <notifications/> <following/> <status> <created_at>Fri Jun 05 14:16:36 +0000 2009</created_at> <id>2043041890</id> <text>regarde "Home"... Pour ceux qui vont le manquer ce soir : http://bit.ly/Oxle6</text> <source>&lt;a href="http://www.twitbin.com/"&gt;TwitBin&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>4750251</id> <name>Xuan NGUYEN</name> <screen_name>xuxu</screen_name> <location>Lyon</location> <description>Développeur web lyonnais chez O2Sources, fan de musique, des séries TV (US), de la bonne bouffe, des toytoys, et des bouches de poulpes ^.^</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/250662781/2592995080_b6bbd0fcce_o_normal.jpg</profile_image_url> <url>http://xuxu.fr</url> <protected>false</protected> <followers_count>317</followers_count> <profile_background_color>0099B9</profile_background_color> <profile_text_color>3C3940</profile_text_color> <profile_link_color>0099B9</profile_link_color> <profile_sidebar_fill_color>95E8EC</profile_sidebar_fill_color> <profile_sidebar_border_color>5ED4DC</profile_sidebar_border_color> <friends_count>151</friends_count> <created_at>Sun Apr 15 12:17:38 +0000 2007</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme4/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>3130</statuses_count> <notifications/> <following/> <status> <created_at>Sat Jun 06 15:26:21 +0000 2009</created_at> <id>2054966697</id> <text>@Slima tu la mettras ur flickr ^^ T'es dans quelle partie de la France aujourd'hui o_O ? t'arrêtes pas de bouger ! xD</text> <source>&lt;a href="http://twitterfox.net/"&gt;TwitterFox&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id>2054835129</in_reply_to_status_id> <in_reply_to_user_id>11662572</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>Slima</in_reply_to_screen_name> </status> </user> <user> <id>2366811</id> <name>Maurice Svay</name> <screen_name>mauriz</screen_name> <location>Paris</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/57275076/200807_normal.jpg</profile_image_url> <url>http://www.svay.com/</url> <protected>false</protected> <followers_count>462</followers_count> <profile_background_color>209888</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>38BCEE</profile_link_color> <profile_sidebar_fill_color>EEEEEE</profile_sidebar_fill_color> <profile_sidebar_border_color>DDDDDD</profile_sidebar_border_color> <friends_count>220</friends_count> <created_at>Mon Mar 26 22:19:00 +0000 2007</created_at> <favourites_count>2</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/3280554/bg.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>1692</statuses_count> <notifications>0</notifications> <following>0</following> <status> <created_at>Sat Jun 06 10:06:06 +0000 2009</created_at> <id>2053057392</id> <text>Les travaux avancent. Aujourd'hui: peinture et moquette</text> <source>&lt;a href="http://twitterhelp.blogspot.com/2008/05/twitter-via-mobile-web-mtwittercom.html"&gt;mobile web&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>1154601</id> <name>Vincent Battaglia</name> <screen_name>Vinch01</screen_name> <location>Brussels, Belgium</location> <description>Blogger, Creative Web developer, Communication Manager &amp; Chief Geek Officer at 1MD.be</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/59091653/avatar_normal.jpg</profile_image_url> <url>http://www.vinch.be/blog</url> <protected>false</protected> <followers_count>789</followers_count> <profile_background_color>EBEBEB</profile_background_color> <profile_text_color>333333</profile_text_color> <profile_link_color>990000</profile_link_color> <profile_sidebar_fill_color>F3F3F3</profile_sidebar_fill_color> <profile_sidebar_border_color>DFDFDF</profile_sidebar_border_color> <friends_count>481</friends_count> <created_at>Wed Mar 14 12:56:06 +0000 2007</created_at> <favourites_count>1</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme7/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>3032</statuses_count> <notifications>0</notifications> <following>0</following> <status> <created_at>Fri Jun 05 21:33:48 +0000 2009</created_at> <id>2048036226</id> <text>RT @PhilippeMartin: http://twitpic.com/6okn4 - Yulbiz LIlle 3 (merci pour cette journée !)</text> <source>&lt;a href="http://www.atebits.com/"&gt;Tweetie&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>747723</id> <name>Fabien Basmaison</name> <screen_name>an_archi</screen_name> <location>China</location> <description>a bit of architecture, a few minces of webdesign... and a forever curious guy.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/84046348/blackout_normal.png</profile_image_url> <url>http://www.arkhi.org/</url> <protected>true</protected> <followers_count>65</followers_count> <profile_background_color>cb6243</profile_background_color> <profile_text_color>53180e</profile_text_color> <profile_link_color>e32c02</profile_link_color> <profile_sidebar_fill_color>ebbda8</profile_sidebar_fill_color> <profile_sidebar_border_color>53180e</profile_sidebar_border_color> <friends_count>88</friends_count> <created_at>Fri Feb 02 14:40:26 +0000 2007</created_at> <favourites_count>124</favourites_count> <utc_offset>28800</utc_offset> <time_zone>Beijing</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/46032/IMGP5119-01.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>3748</statuses_count> <notifications/> <following/> </user> <user> <id>11049532</id> <name>Dew</name> <screen_name>diou</screen_name> <location>dtc</location> <description>Alsacreations</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/39637992/fzem29_normal.jpg</profile_image_url> <url>http://www.blup.fr</url> <protected>false</protected> <followers_count>169</followers_count> <profile_background_color>283c4d</profile_background_color> <profile_text_color>373737</profile_text_color> <profile_link_color>93A500</profile_link_color> <profile_sidebar_fill_color>4A657B</profile_sidebar_fill_color> <profile_sidebar_border_color>31435D</profile_sidebar_border_color> <friends_count>30</friends_count> <created_at>Tue Dec 11 14:02:08 +0000 2007</created_at> <favourites_count>1</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/3828150/twitter.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>138</statuses_count> <notifications/> <following/> <status> <created_at>Thu Jun 04 08:11:12 +0000 2009</created_at> <id>2027244130</id> <text>Voyages-sncf doit être hébergé dans les îles Vanuatu en fait.</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>6860282</id> <name>Bouvard Yannick</name> <screen_name>yeca</screen_name> <location>France</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/30426532/dillon_normal.jpg</profile_image_url> <url>http://www.nanoblog.com</url> <protected>false</protected> <followers_count>58</followers_count> <profile_background_color>EEEDC1</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>31</friends_count> <created_at>Sun Jun 17 00:14:50 +0000 2007</created_at> <favourites_count>11</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>44</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Fri Feb 27 11:25:11 +0000 2009</created_at> <id>1257685822</id> <text>vient d’inscrire 5 villes d’Europe au concours « Les meilleures destinations d’Europe ». - #VAIOtopspots - http://bit.ly/Z40L3</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>10186092</id> <name>hellgy</name> <screen_name>hellgy</screen_name> <location>Metz/luxembourg</location> <description>Usability queen @ jamendo // geek, design &amp; pastry</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/234187719/31_normal.jpg</profile_image_url> <url>http://weblog.redisdead.net</url> <protected>false</protected> <followers_count>199</followers_count> <profile_background_color>EBEBEB</profile_background_color> <profile_text_color>5F5F5F</profile_text_color> <profile_link_color>89B72F</profile_link_color> <profile_sidebar_fill_color>F0F0F0</profile_sidebar_fill_color> <profile_sidebar_border_color>D0D0D0</profile_sidebar_border_color> <friends_count>112</friends_count> <created_at>Mon Nov 12 16:49:32 +0000 2007</created_at> <favourites_count>3</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/1189882/doudou.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>665</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Fri Jun 05 20:08:07 +0000 2009</created_at> <id>2047090051</id> <text>@clawfire je sais pas encore mais normalement je fais des gâteaux</text> <source>&lt;a href="http://twidroid.com"&gt;twidroid&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id>2044906581</in_reply_to_status_id> <in_reply_to_user_id>6370372</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>clawfire</in_reply_to_screen_name> </status> </user> <user> <id>11017752</id> <name>Raphaël Goetter</name> <screen_name>goetter</screen_name> <location>Strasbourg, France</location> <description>Marié deux enfants...</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/69334267/20080615-RG__0882_normal.jpg</profile_image_url> <url>http://www.goetter.fr</url> <protected>false</protected> <followers_count>251</followers_count> <profile_background_color>266478</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>104</friends_count> <created_at>Mon Dec 10 13:26:05 +0000 2007</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>777</statuses_count> <notifications>false</notifications> <following>0</following> <status> <created_at>Fri Jun 05 13:34:15 +0000 2009</created_at> <id>2042621375</id> <text>@nicodiz : bah ouais, je suis plutôt d'accord sur le principe en fait</text> <source>&lt;a href="http://twitterfox.net/"&gt;TwitterFox&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id>2042532756</in_reply_to_status_id> <in_reply_to_user_id>14239715</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>nicodiz</in_reply_to_screen_name> </status> </user> <user> <id>2123191</id> <name>Bertrand Rousseau</name> <screen_name>broussea</screen_name> <location>Belgium</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/55209700/avatar_normal.jpg</profile_image_url> <url>http://www.brousseau.be/blog/</url> <protected>true</protected> <followers_count>24</followers_count> <profile_background_color>1A1B1F</profile_background_color> <profile_text_color>666666</profile_text_color> <profile_link_color>2FC2EF</profile_link_color> <profile_sidebar_fill_color>252429</profile_sidebar_fill_color> <profile_sidebar_border_color>181A1E</profile_sidebar_border_color> <friends_count>20</friends_count> <created_at>Sat Mar 24 18:18:52 +0000 2007</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme9/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>169</statuses_count> <notifications/> <following/> </user> <user> <id>7068082</id> <name>Simon van der Linden</name> <screen_name>sivanderlinden</screen_name> <location>Barcelona</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/63502241/sivanderlinden_normal.png</profile_image_url> <url>http://simon.vanderlinden.eu.org/</url> <protected>false</protected> <followers_count>27</followers_count> <profile_background_color>C6E2EE</profile_background_color> <profile_text_color>663B12</profile_text_color> <profile_link_color>1F98C7</profile_link_color> <profile_sidebar_fill_color>DAECF4</profile_sidebar_fill_color> <profile_sidebar_border_color>C6E2EE</profile_sidebar_border_color> <friends_count>23</friends_count> <created_at>Mon Jun 25 12:50:29 +0000 2007</created_at> <favourites_count>1</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme2/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>61</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Fri May 22 08:21:53 +0000 2009</created_at> <id>1880472361</id> <text>That is a lovely home - http://tinyurl.com/y572ls</text> <source>&lt;a href="http://microplaza.com"&gt;MicroPlaza&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>5318</id> <name>Stephane Deschamps</name> <screen_name>notabene</screen_name> <location>Longjumeau (comme NKM :))</location> <description>self-taught (who isn't), lazy, friendly french guy</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/118583327/sherpa_normal.jpg</profile_image_url> <url>http://www.nota-bene.org/</url> <protected>false</protected> <followers_count>320</followers_count> <profile_background_color>e6e6e6</profile_background_color> <profile_text_color>0C3E53</profile_text_color> <profile_link_color>FF0000</profile_link_color> <profile_sidebar_fill_color>FFF7CC</profile_sidebar_fill_color> <profile_sidebar_border_color>F2E195</profile_sidebar_border_color> <friends_count>169</friends_count> <created_at>Tue Sep 05 11:54:46 +0000 2006</created_at> <favourites_count>51</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/2992/closeup.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>1467</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Sat Jun 06 11:16:04 +0000 2009</created_at> <id>2053359451</id> <text>Je suis le yann arthus bertrand du puceron #home http://www.flickr.com/photos/sdeschamps/3599279547/</text> <source>&lt;a href="http://twitterfox.net/"&gt;TwitterFox&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>3630411</id> <name>Tristan Nitot</name> <screen_name>nitot</screen_name> <location>Paris</location> <description>Web, Open Standards and Firefox addict</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/119797649/Tristan-hackergotchi_normal.png</profile_image_url> <url>http://standblog.org/</url> <protected>false</protected> <followers_count>1994</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>142</friends_count> <created_at>Fri Apr 06 15:46:26 +0000 2007</created_at> <favourites_count>14</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>940</statuses_count> <notifications>0</notifications> <following>0</following> <status> <created_at>Sat Jun 06 16:07:11 +0000 2009</created_at> <id>2055330360</id> <text>@notafish : trouvé sur France 2, qui le passait en HD. par ailleurs, le mal est réparé !</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id>2047288389</in_reply_to_status_id> <in_reply_to_user_id>6477562</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>notafish</in_reply_to_screen_name> </status> </user> <user> <id>4609851</id> <name>Thanh</name> <screen_name>Thanh</screen_name> <location>Lyon</location> <description>Owner of O2Sources, A French and Fresh Web Agency, standards compliant.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/72282693/3215232598_587652ee90_normal.jpg</profile_image_url> <url>http://www.tranches-de-vie.fr</url> <protected>true</protected> <followers_count>298</followers_count> <profile_background_color>000000</profile_background_color> <profile_text_color>FFA600</profile_text_color> <profile_link_color>B8D27C</profile_link_color> <profile_sidebar_fill_color>000000</profile_sidebar_fill_color> <profile_sidebar_border_color>B47500</profile_sidebar_border_color> <friends_count>200</friends_count> <created_at>Sat Apr 14 15:22:58 +0000 2007</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Paris</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/585582/bg.gif</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>5407</statuses_count> <notifications>0</notifications> <following>0</following> <status> <created_at>Sat Jun 06 12:47:29 +0000 2009</created_at> <id>2053817546</id> <text>Non madame j'insiste, je n'y connais rien en pokemon, c'est pas marqué vendeur jouet sur mon debardeur!</text> <source>&lt;a href="http://ubertwitter.com"&gt;UberTwitter&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>781660</id> <name>Ploum</name> <screen_name>ploum</screen_name> <location/> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/24173212/hackergotchi48_normal.png</profile_image_url> <url>http://ploum.frimouvy.org</url> <protected>false</protected> <followers_count>179</followers_count> <profile_background_color>C6E2EE</profile_background_color> <profile_text_color>663B12</profile_text_color> <profile_link_color>1F98C7</profile_link_color> <profile_sidebar_fill_color>DAECF4</profile_sidebar_fill_color> <profile_sidebar_border_color>C6E2EE</profile_sidebar_border_color> <friends_count>34</friends_count> <created_at>Tue Feb 20 00:03:42 +0000 2007</created_at> <favourites_count>1</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme2/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>937</statuses_count> <notifications/> <following/> <status> <created_at>Fri Jun 05 18:32:46 +0000 2009</created_at> <id>2045997779</id> <text>http://www.asmar.fr/ : le CV de dévelopeur web le plus… incroyable que j'aie jamais vu. À ne pas manquer!</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>122853</id> <name>Patrick Rácz</name> <screen_name>pracz</screen_name> <location>Belgium</location> <description>Developer at Whatever SA, a Belgium-based 2.0 company</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/130471840/n712820150_1096453_3752_normal.jpg</profile_image_url> <url>http://microplaza.com</url> <protected>false</protected> <followers_count>128</followers_count> <profile_background_color>FFFFFF</profile_background_color> <profile_text_color>3C3C3C</profile_text_color> <profile_link_color>eb8f14</profile_link_color> <profile_sidebar_fill_color>FFFFFF</profile_sidebar_fill_color> <profile_sidebar_border_color>C3C3C3</profile_sidebar_border_color> <friends_count>105</friends_count> <created_at>Thu Dec 21 17:58:34 +0000 2006</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/5129611/bg_body.gif</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>257</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Thu Jun 04 14:52:37 +0000 2009</created_at> <id>2030098384</id> <text>Trianonra emlékezzünk! - http://tinyurl.com/re6ec3</text> <source>&lt;a href="http://microplaza.com"&gt;MicroPlaza&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>21213</id> <name>Antoine Perdaens</name> <screen_name>tlg</screen_name> <location>Belgium</location> <description>MicroPlaza and KnowledgePlaza Evangelist and Whatever's right brain</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/72822765/me_normal.jpg</profile_image_url> <url>http://microplaza.com</url> <protected>false</protected> <followers_count>328</followers_count> <profile_background_color>FFFFFF</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>000000</profile_link_color> <profile_sidebar_fill_color>F3F3F3</profile_sidebar_fill_color> <profile_sidebar_border_color>C6C6C6</profile_sidebar_border_color> <friends_count>257</friends_count> <created_at>Fri Nov 24 23:42:18 +0000 2006</created_at> <favourites_count>9</favourites_count> <utc_offset>-18000</utc_offset> <time_zone>Eastern Time (US &amp; Canada)</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>695</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Sat Jun 06 16:36:45 +0000 2009</created_at> <id>2055599760</id> <text>I've always been right brain on this one RT @kfrancoi: Brain test : Which way is the Dancer spinning? http://bit.ly/abzLl</text> <source>&lt;a href="http://www.twhirl.org/"&gt;twhirl&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>5862322</id> <name>Bastien Gorissen</name> <screen_name>GrungiAnkhfire</screen_name> <location>Limal, Belgium</location> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/27954782/avat_normal.jpg</profile_image_url> <url/> <protected>false</protected> <followers_count>16</followers_count> <profile_background_color>000000</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>18</friends_count> <created_at>Tue May 08 13:02:00 +0000 2007</created_at> <favourites_count>0</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/642572/5cm_Per_Second_-_06.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>114</statuses_count> <notifications/> <following/> <status> <created_at>Thu Jun 04 12:19:47 +0000 2009</created_at> <id>2028651749</id> <text>@lucasmoors Ils ont fait grève malgré la levée du préavis ?</text> <source>&lt;a href="http://twitterfox.net/"&gt;TwitterFox&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id>6519042</in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name>lucasmoors</in_reply_to_screen_name> </status> </user> <user> <id>6047672</id> <name>Akonkwa Mubagwa</name> <screen_name>Akonkwa</screen_name> <location/> <description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/16314812/Ako_picture_cv_normal.jpg</profile_image_url> <url/> <protected>true</protected> <followers_count>25</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>18</friends_count> <created_at>Tue May 15 00:51:40 +0000 2007</created_at> <favourites_count>3</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>63</statuses_count> <notifications/> <following/> </user> <user> <id>242733</id> <name>Pascale</name> <screen_name>Alessa</screen_name> <location>Belgium</location> <description>Music, books &amp; video games addict.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/66083094/close_normal.JPG</profile_image_url> <url>http://pascale.ploum.be</url> <protected>false</protected> <followers_count>71</followers_count> <profile_background_color>fdb4cd</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>cc3366</profile_link_color> <profile_sidebar_fill_color>f995b4</profile_sidebar_fill_color> <profile_sidebar_border_color>CC3366</profile_sidebar_border_color> <friends_count>35</friends_count> <created_at>Mon Dec 25 14:05:10 +0000 2006</created_at> <favourites_count>2</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/3723354/fb_daydreams1280.jpg</profile_background_image_url> <profile_background_tile>true</profile_background_tile> <statuses_count>225</statuses_count> <notifications>false</notifications> <following>false</following> <status> <created_at>Sun May 17 15:36:54 +0000 2009</created_at> <id>1826482272</id> <text>is completely addicted to this year's Eurovision winner song, love it!</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> <user> <id>21223</id> <name>Raphael Slinckx</name> <screen_name>kikidonk</screen_name> <location>iPhone: 37.772049,-122.397598</location> <description>Open Source Hacker. Surfing the Hype wave.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/15130582/hackergotchi-96_normal.png</profile_image_url> <url>http://raphael.slinckx.net</url> <protected>false</protected> <followers_count>171</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>92</friends_count> <created_at>Fri Nov 24 23:49:13 +0000 2006</created_at> <favourites_count>1</favourites_count> <utc_offset>3600</utc_offset> <time_zone>Brussels</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/734972/273110320_2b7e7f7497_b.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>361</statuses_count> <notifications/> <following/> <status> <created_at>Thu Jun 04 11:06:16 +0000 2009</created_at> <id>2028179768</id> <text>Uneventful flight, which is a good thing! Now for a zombie-day :)</text> <source>&lt;a href="http://twitterrific.com"&gt;Twitterrific&lt;/a&gt;</source> <truncated>false</truncated> <in_reply_to_status_id/> <in_reply_to_user_id/> <favorited>false</favorited> <in_reply_to_screen_name/> </status> </user> </users>
{ "content_hash": "721d2ec0d54364747215b7d3b5c9a424", "timestamp": "", "source": "github", "line_count": 2727, "max_line_length": 188, "avg_line_length": 45.283094976164286, "alnum_prop": 0.7321823349826297, "repo_name": "intfrr/phptwitterbot", "id": "c5e8fd92c8ec417a89c1fb7863b9dde45114e559", "size": "123583", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "test/unit/xml/server/statuses/friends/6896142.xml", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "90313" } ], "symlink_target": "" }
package org.cloudfoundry.client.v2.buildpacks; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import org.cloudfoundry.Nullable; import org.immutables.value.Value; /** * The request payload to Update a Buildpack */ @JsonSerialize @Value.Immutable abstract class _UpdateBuildpackRequest { /** * The buildpack id */ @JsonIgnore abstract String getBuildpackId(); /** * The enabled flag */ @JsonProperty("enabled") @Nullable abstract Boolean getEnabled(); /** * The filename */ @JsonProperty("filename") @Nullable abstract String getFilename(); /** * The locked flag */ @JsonProperty("locked") @Nullable abstract Boolean getLocked(); /** * The name */ @JsonProperty("name") @Nullable abstract String getName(); /** * The position */ @JsonProperty("position") @Nullable abstract Integer getPosition(); }
{ "content_hash": "f5621806cd15791a1a53a2e3a0695e3c", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 63, "avg_line_length": 18.116666666666667, "alnum_prop": 0.6485740570377185, "repo_name": "alexander071/cf-java-client", "id": "f82bb3a68e070c873ccbdc71a20bfa7da45dbd30", "size": "1707", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cloudfoundry-client/src/main/java/org/cloudfoundry/client/v2/buildpacks/_UpdateBuildpackRequest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5043" }, { "name": "Java", "bytes": "4410753" }, { "name": "Shell", "bytes": "8834" } ], "symlink_target": "" }
package o; import java.text.ParseException; public final class ᑉ extends iF.if { private static final long serialVersionUID = 1L; public ᑉ(Exception paramException) { super(paramException); } public ᑉ(String paramString) { super(paramString); } public ᑉ(String paramString, ParseException paramParseException) { super(paramString, paramParseException); } } /* Location: /Users/vikas/Documents/Mhacks_Real_app/classes-dex2jar.jar * Qualified Name: o.·ëâ * JD-Core Version: 0.6.2 */
{ "content_hash": "6ce1ba382ca19e61aa608f1bd52abdd0", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 81, "avg_line_length": 19.214285714285715, "alnum_prop": 0.6951672862453532, "repo_name": "mmmsplay10/QuizUpWinner", "id": "d109711887af9919f3c3b8567521496d2d1d9be3", "size": "549", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "quizup/o/·ëâ.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "6075" }, { "name": "Java", "bytes": "23608889" }, { "name": "JavaScript", "bytes": "6345" }, { "name": "Python", "bytes": "933916" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc on Thu Jan 01 15:37:47 PST 2015 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Jackson-core 2.5.0 API</title> <script type="text/javascript"> targetPage = "" + window.location.search; if (targetPage != "" && targetPage != "undefined") targetPage = targetPage.substring(1); if (targetPage.indexOf(":") != -1 || (targetPage != "" && !validURL(targetPage))) targetPage = "undefined"; function validURL(url) { var pos = url.indexOf(".html"); if (pos == -1 || pos != url.length - 5) return false; var allowNumber = false; var allowSep = false; var seenDot = false; for (var i = 0; i < url.length - 5; i++) { var ch = url.charAt(i); if ('a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '$' || ch == '_') { allowNumber = true; allowSep = true; } else if ('0' <= ch && ch <= '9' || ch == '-') { if (!allowNumber) return false; } else if (ch == '/' || ch == '.') { if (!allowSep) return false; allowNumber = false; allowSep = false; if (ch == '.') seenDot = true; if (ch == '/' && seenDot) return false; } else { return false; } } return true; } function loadFrames() { if (targetPage != "" && targetPage != "undefined") top.classFrame.location = top.targetPage; } </script> </head> <frameset cols="20%,80%" title="Documentation frame" onload="top.loadFrames()"> <frameset rows="30%,70%" title="Left frames" onload="top.loadFrames()"> <frame src="overview-frame.html" name="packageListFrame" title="All Packages"> <frame src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> </frameset> <frame src="overview-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes"> <noframes> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <h2>Frame Alert</h2> <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> </noframes> </frameset> </html>
{ "content_hash": "55e152ddf900dc1504e3245003c75ab1", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 205, "avg_line_length": 40.23529411764706, "alnum_prop": 0.5350877192982456, "repo_name": "FasterXML/jackson-core", "id": "3562b545a9d1d69fda81ba283980aed2aec5349f", "size": "2736", "binary": false, "copies": "1", "ref": "refs/heads/2.15", "path": "docs/javadoc/2.5/index.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "4192574" }, { "name": "Logos", "bytes": "42257" }, { "name": "Shell", "bytes": "40" } ], "symlink_target": "" }
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>$InjectorLike | UI-Router</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> <link rel="stylesheet" href="../assets/css/typedoctheme.css"> <script src="../assets/js/modernizr.js"></script> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">UI-Router</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../globals.html">Globals</a> </li> <li> <a href="../modules/common.html">common</a> </li> <li> <a href="common._injectorlike.html">$InjectorLike</a> </li> </ul> <h1>Interface $InjectorLike</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">$InjectorLike</span> </li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="common._injectorlike.html#strictdi" class="tsd-kind-icon">strict<wbr>Di</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="common._injectorlike.html#annotate" class="tsd-kind-icon">annotate</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="common._injectorlike.html#get" class="tsd-kind-icon">get</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="common._injectorlike.html#has" class="tsd-kind-icon">has</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="common._injectorlike.html#invoke" class="tsd-kind-icon">invoke</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="strictdi" class="tsd-anchor"></a> <!----> <!--<h3><span class="tsd-flag ts-flagOptional">Optional</span> strict<wbr>Di</h3>--> <!----> <div class="tsd-signature tsd-kind-icon">strict<wbr>Di<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <div class="tsd-declaration"> </div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/angular-ui/ui-router/blob/4d86ca2/src/common/coreservices.ts#L47">common/coreservices.ts:47</a></li> </ul> </aside> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="annotate" class="tsd-anchor"></a> <!----> <!--<h3>annotate</h3>--> <!----> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">annotate<span class="tsd-signature-symbol">(</span>fn<span class="tsd-signature-symbol">: </span><a href="../modules/common.html#iinjectable" class="tsd-signature-type">IInjectable</a>, strictDi<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>fn: <a href="../modules/common.html#iinjectable" class="tsd-signature-type">IInjectable</a></h5> </li> <li> <h5>strictDi <span class="tsd-flag ts-flagOptional">Optional</span>: <span class="tsd-signature-type">boolean</span></h5> </li> </ul> <div class="tsd-returns"> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4> </div> <hr> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/angular-ui/ui-router/blob/4d86ca2/src/common/coreservices.ts#L46">common/coreservices.ts:46</a></li> </ul> </aside> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="get" class="tsd-anchor"></a> <!----> <!--<h3>get</h3>--> <!----> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">get<span class="tsd-signature-symbol">(</span>token<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>token: <span class="tsd-signature-type">any</span></h5> </li> </ul> <div class="tsd-returns"> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4> </div> <hr> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/angular-ui/ui-router/blob/4d86ca2/src/common/coreservices.ts#L43">common/coreservices.ts:43</a></li> </ul> </aside> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="has" class="tsd-anchor"></a> <!----> <!--<h3>has</h3>--> <!----> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">has<span class="tsd-signature-symbol">(</span>token<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>token: <span class="tsd-signature-type">any</span></h5> </li> </ul> <div class="tsd-returns"> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> </div> <hr> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/angular-ui/ui-router/blob/4d86ca2/src/common/coreservices.ts#L44">common/coreservices.ts:44</a></li> </ul> </aside> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="invoke" class="tsd-anchor"></a> <!----> <!--<h3>invoke</h3>--> <!----> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">invoke<span class="tsd-signature-symbol">(</span>fn<span class="tsd-signature-symbol">: </span><a href="../modules/common.html#iinjectable" class="tsd-signature-type">IInjectable</a>, context<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span>, locals<span class="tsd-signature-symbol">?: </span><a href="common.obj.html" class="tsd-signature-type">Obj</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>fn: <a href="../modules/common.html#iinjectable" class="tsd-signature-type">IInjectable</a></h5> </li> <li> <h5>context <span class="tsd-flag ts-flagOptional">Optional</span>: <span class="tsd-signature-type">any</span></h5> </li> <li> <h5>locals <span class="tsd-flag ts-flagOptional">Optional</span>: <a href="common.obj.html" class="tsd-signature-type">Obj</a></h5> </li> </ul> <div class="tsd-returns"> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4> </div> <hr> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/angular-ui/ui-router/blob/4d86ca2/src/common/coreservices.ts#L45">common/coreservices.ts:45</a></li> </ul> </aside> </li> </ul> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="../globals.html"><em>Globals</em></a> </li> <li class="current tsd-kind-external-module"> <a href="../modules/common.html">common</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/common_hof.html">common_<wbr>hof</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/common_predicates.html">common_<wbr>predicates</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/common_strings.html">common_<wbr>strings</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/core.html">core</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/hooks.html">hooks</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/justjs.html">justjs</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/ng1.html">ng1</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/ng1_directives.html">ng1_<wbr>directives</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/ng1_state_events.html">ng1_<wbr>state_<wbr>events</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/ng2.html">ng2</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/ng2_directives.html">ng2_<wbr>directives</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/params.html">params</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/path.html">path</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/resolve.html">resolve</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/state.html">state</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/trace.html">trace</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/transition.html">transition</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/url.html">url</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/view.html">view</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> </ul> <ul class="current"> <li class="current tsd-kind-interface tsd-parent-kind-external-module"> <a href="common._injectorlike.html" class="tsd-kind-icon">$<wbr>Injector<wbr>Like</a> <ul> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="common._injectorlike.html#strictdi" class="tsd-kind-icon">strict<wbr>Di</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="common._injectorlike.html#annotate" class="tsd-kind-icon">annotate</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="common._injectorlike.html#get" class="tsd-kind-icon">get</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="common._injectorlike.html#has" class="tsd-kind-icon">has</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="common._injectorlike.html#invoke" class="tsd-kind-icon">invoke</a> </li> </ul> </li> </ul> <ul class="after-current"> </ul> </nav> </div> </div> </div> <footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li> <li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li> <li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li> <li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li> <li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> <li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li> <li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li> </ul> </div> </div> </footer> <div class="container tsd-generator"> <p>Generated using <a href="http://typedoc.io" target="_blank">TypeDoc</a></p> </div> <div class="overlay"></div> <script src="../assets/js/main.js"></script> <script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script> </body> </html>
{ "content_hash": "4ced71c45c5378e928f22caad37c47c8", "timestamp": "", "source": "github", "line_count": 407, "max_line_length": 573, "avg_line_length": 47.90909090909091, "alnum_prop": 0.6281860608236319, "repo_name": "ui-router/ui-router.github.io", "id": "1a80b2cbfef6bd3f33860e2ed18084c11dc7e6a6", "size": "19507", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_ng2_docs/1.0.0-beta.2/interfaces/common._injectorlike.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4640890" }, { "name": "HTML", "bytes": "276915023" }, { "name": "JavaScript", "bytes": "831953" }, { "name": "Ruby", "bytes": "140" }, { "name": "SCSS", "bytes": "66332" }, { "name": "Shell", "bytes": "5090" } ], "symlink_target": "" }
<?php namespace PHPCensor\Model\Build; use Exception; use PHPCensor\Builder; use PHPCensor\Model\Build; /** * Remote Subversion Build Model * * @package PHP Censor * @subpackage Application * * @author Nadir Dzhilkibaev <[email protected]> * @author Dmitry Khomutov <[email protected]> */ class SvnBuild extends TypedBuild { protected string $svnCommand = 'svn export -q --non-interactive '; /** * Get the URL to be used to clone this remote repository. * * @return string */ protected function getCloneUrl() { $url = \rtrim($this->getProject()->getReference(), '/') . '/'; $branch = \ltrim($this->getBranch(), '/'); // For empty default branch or default branch name like "/trunk" or "trunk" (-> "trunk") if (empty($branch) || $branch === 'trunk') { $url .= 'trunk'; // For default branch with standard default branch directory ("branches") like "/branch-1" or "branch-1" // (-> "branches/branch-1") } elseif (false === \strpos($branch, '/')) { $url .= 'branches/' . $branch; // For default branch with non-standard branch directory like "/branch/branch-1" or "branch/branch-1" // (-> "branch/branch-1") } else { $url .= $branch; } return $url; } /** * @return void */ protected function extendSvnCommandFromConfig(Builder $builder) { $cmd = $this->svnCommand; $buildSettings = $builder->getConfig('build_settings'); if ($buildSettings) { if (isset($buildSettings['svn']) && \is_array($buildSettings['svn'])) { foreach ($buildSettings['svn'] as $key => $value) { $cmd .= " --${key} ${value} "; } } if (isset($buildSettings['clone_depth']) && 0 < (int)$buildSettings['clone_depth']) { $cmd .= ' --depth ' . \intval($buildSettings['clone_depth']) . ' '; } } $this->svnCommand = $cmd; } /** * Create a working copy by cloning, copying, or similar. * * @param string $buildPath * * @return bool * * @throws Exception */ public function createWorkingCopy(Builder $builder, $buildPath) { $this->extendSvnCommandFromConfig($builder); $key = \trim($this->getProject()->getSshPrivateKey()); if (!empty($key)) { $success = $this->cloneBySsh($builder, $buildPath); } else { $success = $this->cloneByHttp($builder, $buildPath); } if (!$success) { $builder->logFailure('Failed to export remote subversion repository.'); return false; } return $this->handleConfig($builder, $buildPath); } /** * Use an HTTP-based svn export. * * @param string $cloneTo * * @return bool */ protected function cloneByHttp(Builder $builder, $cloneTo) { $cmd = $this->svnCommand; if (!empty($this->getCommitId())) { $cmd .= ' -r %s %s "%s"'; $success = $builder->executeCommand($cmd, $this->getCommitId(), $this->getCloneUrl(), $cloneTo); } else { $cmd .= ' %s "%s"'; $success = $builder->executeCommand($cmd, $this->getCloneUrl(), $cloneTo); } return $success; } /** * Use an SSH-based svn export. * * @param string $cloneTo * * @return bool */ protected function cloneBySsh(Builder $builder, $cloneTo) { $cmd = $this->svnCommand . ' %s "%s"'; $keyFile = $this->writeSshKey(); $sshWrapper = $this->writeSshWrapper($keyFile); $cmd = 'export SVN_SSH="' . $sshWrapper . '" && ' . $cmd; $success = $builder->executeCommand($cmd, $this->getCloneUrl(), $cloneTo); // Remove the key file and svn wrapper: \unlink($keyFile); \unlink($sshWrapper); return $success; } }
{ "content_hash": "1131d6ae3625bc3166424784356a1611", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 112, "avg_line_length": 28.03448275862069, "alnum_prop": 0.5328413284132841, "repo_name": "php-censor/php-censor", "id": "fffa7ccba38c6802b8784da45db14d931f0adf4b", "size": "4065", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Model/Build/SvnBuild.php", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "15613" }, { "name": "HTML", "bytes": "105532" }, { "name": "JavaScript", "bytes": "52048" }, { "name": "Makefile", "bytes": "1719" }, { "name": "PHP", "bytes": "1308297" } ], "symlink_target": "" }
@interface IDEPlaygroundPageNavigableItem : IDEContainerFileReferenceNavigableItem { } @end
{ "content_hash": "0435709bbff2cb306c5f54cd65ec56a2", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 82, "avg_line_length": 15.666666666666666, "alnum_prop": 0.851063829787234, "repo_name": "kolinkrewinkel/Multiplex", "id": "0e34efa3e274f3a9cccb0a1b75fa8830556ea504", "size": "317", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "Multiplex/IDEHeaders/IDEHeaders/IDEKit/IDEPlaygroundPageNavigableItem.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "4691836" }, { "name": "Python", "bytes": "2267" }, { "name": "Ruby", "bytes": "109" }, { "name": "Shell", "bytes": "293" } ], "symlink_target": "" }
/*jslint anon:true, sloppy:true, nomen:true*/ process.chdir(__dirname); /* * Create the MojitoServer instance we'll interact with. Options can be passed * using an object with the desired key/value pairs. */ var Mojito = require('mojito'); var app = Mojito.createServer(); // --------------------------------------------------------------------------- // Different hosting environments require different approaches to starting the // server. Adjust below to match the requirements of your hosting environment. // --------------------------------------------------------------------------- module.exports = app.listen();
{ "content_hash": "a4a6d186b1880a34d13cdfa32c282272", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 78, "avg_line_length": 31.5, "alnum_prop": 0.5603174603174603, "repo_name": "jeffblack360/mojito", "id": "7672446b486766d08b724877f37fab937391f273", "size": "796", "binary": false, "copies": "12", "ref": "refs/heads/develop", "path": "examples/developer-guide/dashboard/trib/server.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "71546" }, { "name": "JavaScript", "bytes": "2724195" }, { "name": "Python", "bytes": "72465" }, { "name": "Ruby", "bytes": "32" }, { "name": "Shell", "bytes": "675" } ], "symlink_target": "" }
package stroom.util.pipeline.scope; import com.google.inject.ScopeAnnotation; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; @Target({TYPE, METHOD}) @Retention(RUNTIME) @ScopeAnnotation public @interface PipelineScoped { }
{ "content_hash": "c5ab5caba3784cc037ce065aa6164b2d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 59, "avg_line_length": 24.941176470588236, "alnum_prop": 0.8231132075471698, "repo_name": "gchq/stroom", "id": "7ff8db8e0646896e07e99bc5ab1fa47b61cfad88", "size": "424", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "stroom-util/src/main/java/stroom/util/pipeline/scope/PipelineScoped.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "272243" }, { "name": "Dockerfile", "bytes": "21009" }, { "name": "HTML", "bytes": "14114" }, { "name": "Java", "bytes": "22782925" }, { "name": "JavaScript", "bytes": "14516557" }, { "name": "Makefile", "bytes": "661" }, { "name": "Python", "bytes": "3176" }, { "name": "SCSS", "bytes": "158667" }, { "name": "Shell", "bytes": "166531" }, { "name": "TypeScript", "bytes": "2009517" }, { "name": "XSLT", "bytes": "174226" } ], "symlink_target": "" }
static BOOL RPJSONValidatorShouldSuppressWarnings; @interface MVRPValidatorPredicate(Protected) - (void)validateValue:(id)value withKey:(NSString *)key; - (NSMutableArray *)failedRequirementDescriptions; @end @implementation MVRPJSONValidator + (BOOL)validateValuesFrom:(id)json withRequirements:(NSDictionary *)requirements error:(NSError **)error { // The json parameter must be an NSArray or NSDictionary with // NSString keys and NSString/NSNumber/NSNull/NSDictionary/NSArray values // // The requirements parameter must be an NSDictionary with these specifications: // * Keys: NSString/NSNumber // * Values: RPValidatorPredicate/NSDictionary // // The error parameter may be nil. Otherwise, it must be an NSError class if(!json) { [MVRPJSONValidator log:@"RPJSONValidator Error: json parameter is nil -- there is nothing to validate. Returning NO"]; if(error) { *error = [NSError errorWithDomain:RPJSONValidatorErrorDomain code:RPJSONValidatorErrorBadJSONParameter userInfo:@{ NSLocalizedDescriptionKey : @"Nothing to validate", NSLocalizedFailureReasonErrorKey : @"json parameter is nil", NSLocalizedRecoverySuggestionErrorKey : @"pass in valid json" }]; } return NO; } if(![json isKindOfClass:[NSDictionary class]] && ![json isKindOfClass:[NSArray class]]) { [MVRPJSONValidator log:@"RPJSONValidator Error: json parameter is not valid JSON (it is not an NSArray or NSDictionary). Returning NO"]; if(error) { *error = [NSError errorWithDomain:RPJSONValidatorErrorDomain code:RPJSONValidatorErrorBadJSONParameter userInfo:@{ NSLocalizedDescriptionKey : @"Nothing to validate", NSLocalizedFailureReasonErrorKey : @"json parameter is not an NSArray or NSDictionary", NSLocalizedRecoverySuggestionErrorKey : @"pass in valid json" }]; } return NO; } if(!requirements) { [MVRPJSONValidator log:@"RPJSONValidator Error: requirements parameter is nil -- there are no requirements. Returning NO"]; if(error) { *error = [NSError errorWithDomain:RPJSONValidatorErrorDomain code:RPJSONValidatorErrorBadRequirementsParameter userInfo:@{ NSLocalizedDescriptionKey : @"Nothing to validate", NSLocalizedFailureReasonErrorKey : @"requirements parameter is nil", NSLocalizedRecoverySuggestionErrorKey : @"pass in valid requirements" }]; } return NO; } if(![requirements isKindOfClass:[NSDictionary class]]) { [MVRPJSONValidator log:@"RPJSONValidator Error: requirements parameter is not an NSDictionary. Returning NO"]; if(error) { *error = [NSError errorWithDomain:RPJSONValidatorErrorDomain code:RPJSONValidatorErrorBadRequirementsParameter userInfo:@{ NSLocalizedDescriptionKey : @"Nothing to validate", NSLocalizedFailureReasonErrorKey : @"requirements parameter is not an NSDictionary", NSLocalizedRecoverySuggestionErrorKey : @"pass in valid requirements" }]; } return NO; } return [MVRPJSONValidator validateValuesFrom:json withRequirements:requirements error:error userInfo:[@{} mutableCopy]]; } + (BOOL)validateValuesFrom:(id)json withRequirements:(NSDictionary *)requirements error:(NSError **)error userInfo:(NSMutableDictionary *)userInfo { // The json parameter must be an NSArray or NSDictionary with // NSString keys and NSString/NSNumber/NSNull/NSDictionary/NSArray values // // The requirements parameter must be an NSDictionary with these specifications: // * Keys: NSString/NSNumber // * Keys correspond to JSON keys or indices of arrays // * Values: RPValidatorPredicate/NSDictionary __block BOOL encounteredError = NO; [requirements enumerateKeysAndObjectsUsingBlock:^(id requirementsKey, id requirementsValue, BOOL *stop) { id jsonValue; if([json isKindOfClass:[NSArray class]] && [requirementsKey isKindOfClass:[NSNumber class]] && [json count] > [requirementsKey unsignedIntegerValue]) { jsonValue = [json objectAtIndex:[requirementsKey unsignedIntegerValue]]; } else if([json isKindOfClass:[NSDictionary class]]) { jsonValue = [json objectForKey:requirementsKey]; } else { jsonValue = nil; } if([requirementsValue isKindOfClass:[MVRPValidatorPredicate class]] && [requirementsKey isKindOfClass:[NSString class]]) { [(MVRPValidatorPredicate *)requirementsValue validateValue:jsonValue withKey:requirementsKey]; if([[(MVRPValidatorPredicate *)requirementsValue failedRequirementDescriptions] count]) { NSMutableDictionary *failingKeys = [userInfo objectForKey:RPJSONValidatorFailingKeys]; if(failingKeys) failingKeys = [failingKeys mutableCopy]; else failingKeys = [NSMutableDictionary dictionary]; [failingKeys setObject:[(MVRPValidatorPredicate *)requirementsValue failedRequirementDescriptions] forKey:requirementsKey]; [userInfo setObject:failingKeys forKey:RPJSONValidatorFailingKeys]; } } else if([requirementsValue isKindOfClass:[NSDictionary class]]) { [MVRPJSONValidator validateValuesFrom:jsonValue withRequirements:requirementsValue error:error userInfo:userInfo]; } else { [MVRPJSONValidator log:[NSString stringWithFormat:@"RPJSONValidator Error: requirements parameter isn't valid. Value (%@) isn't an RPValidatorPredicate or NSDictionary or NSNumber. Returning NO", requirementsValue]]; encounteredError = YES; if (error) { *error = [NSError errorWithDomain:RPJSONValidatorErrorDomain code:RPJSONValidatorErrorBadRequirementsParameter userInfo:@{ NSLocalizedDescriptionKey : @"Requirements not setup correctly", NSLocalizedFailureReasonErrorKey : [NSString stringWithFormat:@"Requirements key (%@) with value (%@) is not an RPValidatorPredicate or NSDictionary", requirementsKey, requirementsValue], NSLocalizedRecoverySuggestionErrorKey : @"Review requirements syntax" }]; } *stop = YES; } }]; if (encounteredError) { return NO; } if([[userInfo allKeys] count]) { if (error) { [userInfo setObject:@"JSON did not validate" forKey:NSLocalizedDescriptionKey]; [userInfo setObject:@"At least one requirement wasn't met" forKey:NSLocalizedFailureReasonErrorKey]; [userInfo setObject:@"Perhaps use backup JSON" forKey:NSLocalizedRecoverySuggestionErrorKey]; *error = [NSError errorWithDomain:RPJSONValidatorErrorDomain code:RPJSONValidatorErrorInvalidJSON userInfo:userInfo]; } return NO; } return YES; } + (NSString *)prettyStringGivenRPJSONValidatorError:(NSError *)error { __block NSString *prettyString = @""; NSDictionary *failingKeys = [[error userInfo] objectForKey:RPJSONValidatorFailingKeys]; [failingKeys enumerateKeysAndObjectsUsingBlock:^(NSString *badKey, NSArray *requirements, BOOL *stop) { prettyString = [prettyString stringByAppendingFormat:@"* %@\n", badKey]; for (NSString *requirement in requirements) { prettyString = [prettyString stringByAppendingFormat:@" * %@\n", requirement]; } }]; return prettyString; } + (void)setShouldSuppressLogging:(BOOL)shouldSuppressLogging { RPJSONValidatorShouldSuppressWarnings = shouldSuppressLogging; } + (void)log:(NSString *)warning { if(!RPJSONValidatorShouldSuppressWarnings) NSLog(@"%@", warning); } @end
{ "content_hash": "def7c7f692afb70fc4f1fa643fb13218", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 239, "avg_line_length": 50.170212765957444, "alnum_prop": 0.5797285835453775, "repo_name": "vitoziv/moves-ios-sdk", "id": "b11af10152c2767c04699ea2ea4f229840e19b04", "size": "9640", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "moves-ios-sdk/internal/RPJSONValidator/MVRPJSONValidator.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "179754" }, { "name": "Ruby", "bytes": "773" } ], "symlink_target": "" }
<!-- Modal for send invoice email --> <div id="send-email" class="modal fade in" {% if page.show-modal %}style="display: block;"{% endif %}> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title">Send invoice by mail</h4> </div> <div class="modal-body has-sections"> <section> <div class="form-group clearfix"> <label for="inputName" class="col-sm-2 control-label"> To<abbr title="Required field">*</abbr> </label> <div class="col-sm-10"> <input id="inputName" type="text" class="form-control" value="[email protected]"> </div> </div> <div class="form-group clearfix"> <label for="invoiceMessage" class="col-sm-2 control-label"> Message<abbr title="Required field">*</abbr> </label> <div class="col-sm-10"> <textarea id="invoiceMessage" class="form-control" rows="8"> Hi, We're sending you [invoice-title] for a total cost of [invoice-total]. The payment term is [invoice-payment-term]. Greetings, John Doe Inc. </textarea> </div> </div> </section> </div><!-- .modal-body --> <div class="modal-footer"> <a href="#" class="btn-link pull-left" data-dismiss="modal">Cancel</a> <a href="#" class="btn btn-success pull-right" data-dismiss="modal">Send</a> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal -->
{ "content_hash": "463890d22589fd0d337edefb3183e66b", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 103, "avg_line_length": 34.755102040816325, "alnum_prop": 0.5549031121550205, "repo_name": "cybord/invoicing-html-prototype", "id": "b231f3be4b1c26647f91b31f249cf90c1b123f75", "size": "1703", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_includes/modals/send-email.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
'use strict'; const expect = require('chai').expect; const createServer = require('../lib/create-server'); const views = require('./views'); const http = require('http'); const StateMachineSkill = require('../lib/StateMachineSkill'); const portfinder = require('portfinder'); describe('createServer', () => { let server; let port; before(() => { const skill = new StateMachineSkill({ views }); server = createServer(skill); return portfinder.getPortPromise() .then((_port) => { port = _port; server.listen(port, () => console.log(`Listening on ${port}`)); }); }); it('should return 404 on not GET', (done) => { http.get(`http://localhost:${port}`, (res) => { expect(res.statusCode).to.equal(404); done(); }); }); it('should return json response on POST', (done) => { const postData = JSON.stringify({ msg: 'Hello World!', }); const options = { port, hostname: 'localhost', path: '/', method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(postData), }, }; const req = http.request(options, (res) => { expect(res.statusCode).to.equal(200); let data = ''; res.on('data', (chunk) => { data += chunk; }); res.on('end', () => { expect('{"version":"1.0","response":{"outputSpeech":{"type":"SSML","ssml":"<speak>An unrecoverable error occurred.</speak>"},"shouldEndSession":true}}').to.equal(data); done(); }); }); req.write(postData); req.end(); }); after(() => { server.close(); }); });
{ "content_hash": "9a64a9dffae11e769efc9f310734655a", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 176, "avg_line_length": 24.573529411764707, "alnum_prop": 0.5511669658886894, "repo_name": "cvaca7/voxa", "id": "bb40eb1f96a0269148d5d7c5d6db2094d1aa2a56", "size": "1671", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/create-server.spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "136991" }, { "name": "Shell", "bytes": "576" } ], "symlink_target": "" }
package org.mifos.customers.office.persistence; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.matchers.JUnitMatchers.hasItem; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Locale; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.mifos.application.collectionsheet.persistence.OfficeBuilder; import org.mifos.application.master.business.MifosCurrency; import org.mifos.config.Localization; import org.mifos.customers.office.business.OfficeBO; import org.mifos.customers.office.business.OfficeLevelEntity; import org.mifos.customers.office.exceptions.OfficeException; import org.mifos.customers.office.util.helpers.OfficeLevel; import org.mifos.dto.domain.OfficeDetailsDto; import org.mifos.dto.domain.OfficeDto; import org.mifos.dto.domain.OfficeHierarchyDto; import org.mifos.dto.domain.OfficeLevelDto; import org.mifos.framework.MifosIntegrationTestCase; import org.mifos.framework.TestUtils; import org.mifos.framework.components.audit.util.helpers.AuditConfiguration; import org.mifos.framework.util.StandardTestingService; import org.mifos.framework.util.helpers.IntegrationTestObjectMother; import org.mifos.framework.util.helpers.Money; import org.mifos.service.test.TestMode; import org.mifos.test.framework.util.DatabaseCleaner; import org.springframework.beans.factory.annotation.Autowired; public class OfficeDaoHibernateIntegrationTest extends MifosIntegrationTestCase { // class under test @Autowired private OfficeDao officeDao; @Autowired private DatabaseCleaner databaseCleaner; // data private OfficeBO headOffice; private OfficeBO regionalOffice; private OfficeBO areaOffice; private OfficeBO branch1; private OfficeBO branch2; private OfficeBO branch3; private static MifosCurrency oldDefaultCurrency; @BeforeClass public static void initialiseHibernateUtil() { Locale locale = Localization.getInstance().getMainLocale(); AuditConfiguration.init(locale); oldDefaultCurrency = Money.getDefaultCurrency(); Money.setDefaultCurrency(TestUtils.RUPEE); new StandardTestingService().setTestMode(TestMode.INTEGRATION); } @AfterClass public static void resetCurrency() { Money.setDefaultCurrency(oldDefaultCurrency); } @After public void cleanDatabaseTablesAfterTest() { // NOTE: - only added to stop older integration tests failing due to brittleness databaseCleaner.clean(); } @Before public void cleanDatabaseTables() { databaseCleaner.clean(); createOfficeHierarchy(); } @Test public void givenAnOfficeExistsShouldReturnItAsOfficeDto() { OfficeDto office = officeDao.findOfficeDtoById(headOffice.getOfficeId()); assertThat(office.getName(), is("Mifos HO")); } @Test public void givenActiveLevelsExistsShouldReturnThemAsOfficeViews() { List<OfficeDetailsDto> offices = officeDao.findActiveOfficeLevels(); assertThat(offices.isEmpty(), is(false)); } @Test public void givenAnOfficeHierarchyExistsShouldReturnItAsOfficeHierarchyDto() { OfficeHierarchyDto officeHierarchy = officeDao.headOfficeHierarchy(); assertThat(officeHierarchy.getOfficeName(), is("Mifos HO")); assertThat(officeHierarchy.isActive(), is(true)); assertThat(officeHierarchy.getChildren().size(), is(2)); } @Test public void shouldReturnOfficeNamesOfHighestLevelOfficeInAOfficeHierarchyFromOfficeIdList() { Collection<Short> officeIds = Arrays.asList(this.areaOffice.getOfficeId(), this.branch2.getOfficeId(), this.branch3.getOfficeId()); List<String> topLevelOfficeNames = officeDao.topLevelOfficeNames(officeIds); assertThat(topLevelOfficeNames.isEmpty(), is(false)); assertThat(topLevelOfficeNames, hasItem(areaOffice.getOfficeName())); assertThat("branch2 is a branch of the area office and should not be returned", topLevelOfficeNames, not(hasItem(branch2.getOfficeName()))); assertThat(topLevelOfficeNames, hasItem(branch3.getOfficeName())); } @Test(expected=OfficeException.class) public void shouldThrowOfficeExceptionWhenActiveChildrenExistUnderOffice() throws Exception { officeDao.validateNoActiveChildrenExist(headOffice.getOfficeId()); } @Test public void shouldNotThrowOfficeExceptionWhenNoActiveChildrenExist() throws Exception { officeDao.validateNoActiveChildrenExist(branch3.getOfficeId()); } @Test(expected=OfficeException.class) public void shouldThrowOfficeExceptionWhenActivePersonnelExist() throws Exception { officeDao.validateNoActivePeronnelExist(headOffice.getOfficeId()); } @Test public void shouldNotThrowOfficeExceptionWhenNoActivePersonnelExist() throws Exception { officeDao.validateNoActivePeronnelExist(branch3.getOfficeId()); } @Test public void shouldNotThrowOfficeExceptionWhenOfficeNameDoesNotExist() throws Exception { officeDao.validateOfficeNameIsNotTaken("officeNameThatDoesNotAlreadyExist"); } @Test(expected=OfficeException.class) public void shouldThrowOfficeExceptionWhenOfficeNameDoesExist() throws Exception { officeDao.validateOfficeNameIsNotTaken(headOffice.getOfficeName()); } @Test public void shouldNotThrowOfficeExceptionWhenOfficeShortNameDoesNotExist() throws Exception { officeDao.validateOfficeShortNameIsNotTaken("shortNameThatDoesNotAlreadyExist"); } @Test(expected=OfficeException.class) public void shouldThrowOfficeExceptionWhenOfficeShortNameDoesExist() throws Exception { officeDao.validateOfficeShortNameIsNotTaken(headOffice.getShortName()); } @Test public void shouldRetrieveAllOfficesAsOfficeDtos() throws Exception { List<OfficeDto> allOffices = officeDao.findAllOffices(); // verification assertThat(allOffices.size(), is(9)); } @Test public void shouldRetrieveAllParentOfficesOfLevelAsOfficeDtos() throws Exception { List<OfficeDto> allOffices = officeDao.findActiveParents(OfficeLevel.HEADOFFICE); // verification assertThat(allOffices.size(), is(0)); } @Test public void shouldRetrieveOfficeLevels() throws Exception { OfficeLevelDto allOffices = officeDao.findOfficeLevelsWithConfiguration(); // verification assertThat(allOffices.isHeadOfficeEnabled(), is(true)); assertThat(allOffices.isBranchOfficeEnabled(), is(true)); assertThat(allOffices.getHeadOfficeNameKey(), is(notNullValue())); assertThat(allOffices.getBranchOfficeNameKey(), is(notNullValue())); } @Test public void shouldRetrieveOfficeLevelById() throws Exception { OfficeLevelEntity officeLevel = officeDao.retrieveOfficeLevel(OfficeLevel.AREAOFFICE); // verification assertThat(officeLevel.isConfigured(), is(true)); } @Test public void shouldRetrieveAllNonBranchOfficesUnderHeadOffice() { List<OfficeDto> nonBranchOffices = officeDao.findNonBranchesOnlyWithParentsMatching(headOffice.getSearchId()); // verification assertFalse(nonBranchOffices.isEmpty()); } private void createOfficeHierarchy() { // A default head office is added as seed data for integration tests along with a 'TestAreaOffice' as child headOffice = IntegrationTestObjectMother.findOfficeById(Short.valueOf("1")); regionalOffice = new OfficeBuilder().withGlobalOfficeNum("002").withName("region1").regionalOffice().withParentOffice(headOffice).build(); IntegrationTestObjectMother.createOffice(regionalOffice); OfficeBO subRegionalOffice = new OfficeBuilder().withGlobalOfficeNum("003").withName("sub1-of-region1").subRegionalOffice().withParentOffice(regionalOffice).build(); IntegrationTestObjectMother.createOffice(subRegionalOffice); areaOffice = new OfficeBuilder().withGlobalOfficeNum("004").withName("area-of-sub1-regional").areaOffice().withParentOffice(subRegionalOffice).build(); IntegrationTestObjectMother.createOffice(areaOffice); branch1 = new OfficeBuilder().withGlobalOfficeNum("005").withName("branch1-of-area").branchOffice().withParentOffice(areaOffice).build(); IntegrationTestObjectMother.createOffice(branch1); branch2 = new OfficeBuilder().withGlobalOfficeNum("006").withName("branch2-of-area").branchOffice().withParentOffice(areaOffice).build(); IntegrationTestObjectMother.createOffice(branch2); branch3 = new OfficeBuilder().withGlobalOfficeNum("007").withName("branch1-of-regional").branchOffice().withParentOffice(regionalOffice).build(); IntegrationTestObjectMother.createOffice(branch3); } }
{ "content_hash": "672bb6af0d748c35bedadb8a77e75cbb", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 173, "avg_line_length": 36.75903614457831, "alnum_prop": 0.7575658254124331, "repo_name": "maduhu/mifos-head", "id": "3a09abec21c4cb47a3dbba73ef04764cb04e881c", "size": "9914", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "application/src/test/java/org/mifos/customers/office/persistence/OfficeDaoHibernateIntegrationTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "128581" }, { "name": "Groff", "bytes": "671" }, { "name": "HTML", "bytes": "83305" }, { "name": "Java", "bytes": "19433677" }, { "name": "JavaScript", "bytes": "586018" }, { "name": "Makefile", "bytes": "44" }, { "name": "Python", "bytes": "27237" }, { "name": "Shell", "bytes": "65574" } ], "symlink_target": "" }
::ActiveAdmin.register ::Trax::Site, :as => "Site" do index form do |f| f.inputs "Meta Info" do f.input :host f.input :name f.input :details f.input :description end f.inputs "Settings" do f.input :active f.input :routing_strategy, :as => :select, :collection => ::Trax::Channel::ROUTING_STRATEGIES f.input :is_default f.input :theme, :as => :select, :collection => ::Trax::Theme.all end f.actions end end
{ "content_hash": "a34665783779ae4eb6d66bab8fc85cab", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 99, "avg_line_length": 22.545454545454547, "alnum_prop": 0.5766129032258065, "repo_name": "jasonayre/trax", "id": "dcb9e1e6b5d809aaec42a0d5fcc64e1283d91c9c", "size": "496", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "backend/lib/trax/backend/admin/site.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "419871" }, { "name": "CoffeeScript", "bytes": "3741" }, { "name": "JavaScript", "bytes": "978334" }, { "name": "Ruby", "bytes": "178745" } ], "symlink_target": "" }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE617_Reachable_Assertion__fixed_67b.c Label Definition File: CWE617_Reachable_Assertion.label.xml Template File: sources-sink-67b.tmpl.c */ /* * @description * CWE: 617 Reachable Assertion * BadSource: fixed Fixed value less than the assert value * GoodSource: Number greater than ASSERT_VALUE * Sinks: * BadSink : Assert if n is less than or equal to ASSERT_VALUE * Flow Variant: 67 Data flow: data passed in a struct from one function to another in different source files * * */ #include "std_testcase.h" #include <assert.h> #define ASSERT_VALUE 5 typedef struct _CWE617_Reachable_Assertion__fixed_67_structType { int structFirst; } CWE617_Reachable_Assertion__fixed_67_structType; #ifndef OMITBAD void CWE617_Reachable_Assertion__fixed_67b_badSink(CWE617_Reachable_Assertion__fixed_67_structType myStruct) { int data = myStruct.structFirst; /* POTENTIAL FLAW: this assertion could trigger if n <= ASSERT_VALUE */ assert(data > ASSERT_VALUE); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE617_Reachable_Assertion__fixed_67b_goodG2BSink(CWE617_Reachable_Assertion__fixed_67_structType myStruct) { int data = myStruct.structFirst; /* POTENTIAL FLAW: this assertion could trigger if n <= ASSERT_VALUE */ assert(data > ASSERT_VALUE); } #endif /* OMITGOOD */
{ "content_hash": "337936a312a40c36824cb484b3a8ad60", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 112, "avg_line_length": 29.714285714285715, "alnum_prop": 0.717032967032967, "repo_name": "JianpingZeng/xcc", "id": "af62cea5d5e8e268395b8096d020f3856afb39b5", "size": "1456", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "xcc/test/juliet/testcases/CWE617_Reachable_Assertion/CWE617_Reachable_Assertion__fixed_67b.c", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <sem:triples uri="http://www.lds.org/vrl/objects/plants/ornamental-cabbage" xmlns:sem="http://marklogic.com/semantics"> <sem:triple> <sem:subject>http://www.lds.org/vrl/objects/plants/ornamental-cabbage</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate> <sem:object datatype="xsd:string" xml:lang="eng">Ornamental Cabbage</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/vrl/objects/plants/ornamental-cabbage</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate> <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/vrl/objects/plants/ornamental-cabbage</sem:subject> <sem:predicate>http://www.lds.org/core#entityType</sem:predicate> <sem:object datatype="sem:iri">http://www.lds.org/Topic</sem:object> </sem:triple> </sem:triples>
{ "content_hash": "515a1602cff267587569e22abc063f9f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 119, "avg_line_length": 55.888888888888886, "alnum_prop": 0.7147117296222664, "repo_name": "freshie/ml-taxonomies", "id": "e811bffae686751abf3aa0b0aeabb258042ee93c", "size": "1006", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "roxy/data/gospel-topical-explorer-v2/taxonomies/vrl/objects/plants/ornamental-cabbage.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4422" }, { "name": "CSS", "bytes": "38665" }, { "name": "HTML", "bytes": "356" }, { "name": "JavaScript", "bytes": "411651" }, { "name": "Ruby", "bytes": "259121" }, { "name": "Shell", "bytes": "7329" }, { "name": "XQuery", "bytes": "857170" }, { "name": "XSLT", "bytes": "13753" } ], "symlink_target": "" }
package org.locationtech.geomesa.cassandra.tools.commands import com.beust.jcommander.Parameters import org.locationtech.geomesa.cassandra.data.CassandraDataStore import org.locationtech.geomesa.cassandra.tools.CassandraDataStoreCommand import org.locationtech.geomesa.cassandra.tools.CassandraDataStoreCommand.CassandraDataStoreParams import org.locationtech.geomesa.cassandra.tools.commands.CassandraGetSftConfigCommand.CassandraGetSftConfigParameters import org.locationtech.geomesa.tools.status.{GetSftConfigCommand, GetSftConfigParams} class CassandraGetSftConfigCommand extends GetSftConfigCommand[CassandraDataStore] with CassandraDataStoreCommand { override val params = new CassandraGetSftConfigParameters } object CassandraGetSftConfigCommand { @Parameters(commandDescription = "Get the SimpleFeatureType of a feature") class CassandraGetSftConfigParameters extends GetSftConfigParams with CassandraDataStoreParams }
{ "content_hash": "7fd178828fa253d6dd9f24b4d84d696e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 117, "avg_line_length": 46.95, "alnum_prop": 0.8817891373801917, "repo_name": "jahhulbert-ccri/geomesa", "id": "e39b7e83758313b32906a88d838d8ce614dd466d", "size": "1402", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "geomesa-cassandra/geomesa-cassandra-tools/src/main/scala/org/locationtech/geomesa/cassandra/tools/commands/CassandraGetSftConfigCommand.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "2900" }, { "name": "Java", "bytes": "331235" }, { "name": "JavaScript", "bytes": "140" }, { "name": "Python", "bytes": "6267" }, { "name": "R", "bytes": "2716" }, { "name": "Scala", "bytes": "6494320" }, { "name": "Scheme", "bytes": "3143" }, { "name": "Shell", "bytes": "133379" } ], "symlink_target": "" }
.. _impatient: ================= For the Impatient ================= This HowTo gives you a quick instruction on how to get a demo of **djangocms-cascade** up and running. It also is a good starting point to ask questions or report bugs, since its backend is used as a fully functional reference implementation, used by the unit tests of project. Create a Python Virtual Environment =================================== To keep environments separate, first create a *virtualenv*. .. code-block:: bash #!/bin/sh sudo pip install --upgrade virtualenv virtualenv --distribute --no-site-packages myvirtualenv source myvirtualenv/bin/activate (myvirtualenv)$ Clone the latest stable releases ================================ Create a temporary file, for instance named requirements.txt, containing these entries: .. code-block:: guess Django==1.9.6 Django-Select2==5.8.4 Pillow==3.2.0 Unidecode==0.4.18 django-classy-tags==0.7.2 django-cms==3.2.3 django-filer==1.2.0 django-treebeard==4.0 django-polymorphic==0.9.2 django-reversion==1.10.1 django-sass-processor==0.3.4 django-sekizai==0.9.0 djangocms-bootstrap3==0.1.1 -e git+https://github.com/jrief/djangocms-cascade.git#egg=djangocms-cascade djangocms-text-ckeditor==2.8.1 easy-thumbnails==2.3 html5lib==0.9999999 jsonfield==1.0.3 six==1.9.0 and install them into your environment: .. code-block:: bash pip install -r requirements.txt this will take a few minutes. After the installation finished, change into the folder containing the demo application, install missing CSS and JavaScript files, initialize the database and create a superuser: .. code-block:: bash cd $VIRTUAL_ENV/src/djangocms-cascade bower install --require cd examples ./manage.py migrate --settings=bs3demo.settings ./manage.py createsuperuser --settings=bs3demo.settings ./manage.py runserver --settings=bs3demo.settings Point a browser onto http://localhost:8000/ and log in as the super user. Here you should be able to add your first page. Do this by changing into into **Structure** mode on the top of the page. Now a heading named ``MAIN CONTENT`` appears. This heading symbolizes a **djangoCMS** Placeholder. Locate the plus sign right to the heading and click on it. From its context menu select **Container** located in the section **Bootstrap**: |add-container| .. |add-container| image:: _static/add-container.png This brings you into the editor mode for a Bootstrap container. To this container you may add one or more Bootstrap **Rows**. Inside these rows you may organize the layout using some Bootstrap **Columns**. Please proceed with the detailled explanation on how to use the :ref:`Bootstrap's grid <bootstrap3/grid>` system within **djangocms-cascade**.
{ "content_hash": "4fc0177e2e127372664d52f822f90733", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 100, "avg_line_length": 31.21590909090909, "alnum_prop": 0.732435384055333, "repo_name": "rfleschenberg/djangocms-cascade", "id": "c8c319cd22556372d15b5102adc72bde5531fbef", "size": "2747", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/source/impatient.rst", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3158" }, { "name": "HTML", "bytes": "15968" }, { "name": "JavaScript", "bytes": "89011" }, { "name": "Python", "bytes": "270069" } ], "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) on Wed Aug 14 21:12:38 EDT 2013 --> <title>CreditAnalyticsResponse</title> <meta name="date" content="2013-08-14"> <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="CreditAnalyticsResponse"; } //--> </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="navBarCell1Rev">Class</li> <li><a href="class-use/CreditAnalyticsResponse.html">Use</a></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><a href="../../../../org/drip/service/bridge/CreditAnalyticsRequest.html" title="class in org.drip.service.bridge"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/drip/service/bridge/CreditAnalyticsStub.html" title="class in org.drip.service.bridge"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/drip/service/bridge/CreditAnalyticsResponse.html" target="_top">Frames</a></li> <li><a href="CreditAnalyticsResponse.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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.drip.service.bridge</div> <h2 title="Class CreditAnalyticsResponse" class="title">Class CreditAnalyticsResponse</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li><a href="../../../../org/drip/service/stream/Serializer.html" title="class in org.drip.service.stream">org.drip.service.stream.Serializer</a></li> <li> <ul class="inheritance"> <li>org.drip.service.bridge.CreditAnalyticsResponse</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="strong">CreditAnalyticsResponse</span> extends <a href="../../../../org/drip/service/stream/Serializer.html" title="class in org.drip.service.stream">Serializer</a></pre> <div class="block">CreditAnalyticsResponse contains the response from the Credit Analytics server to the client. It contains the following parameters: - The GUID and of the request. - The type and time-stamp of the response. - The string version of the response body.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#CAR_FAILURE">CAR_FAILURE</a></strong></code> <div class="block">Failure Message</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#CAR_STATUS">CAR_STATUS</a></strong></code> <div class="block">Status Message</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#CAR_SUCCESS">CAR_SUCCESS</a></strong></code> <div class="block">Success Message</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="fields_inherited_from_class_org.drip.service.stream.Serializer"> <!-- --> </a> <h3>Fields inherited from class&nbsp;org.drip.service.stream.<a href="../../../../org/drip/service/stream/Serializer.html" title="class in org.drip.service.stream">Serializer</a></h3> <code><a href="../../../../org/drip/service/stream/Serializer.html#NULL_SER_STRING">NULL_SER_STRING</a>, <a href="../../../../org/drip/service/stream/Serializer.html#VERSION">VERSION</a></code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#CreditAnalyticsResponse(byte[])">CreditAnalyticsResponse</a></strong>(byte[]&nbsp;ab)</code> <div class="block">CreditAnalyticsResponse de-serialization from input byte array</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#CreditAnalyticsResponse(java.lang.String, java.lang.String, java.lang.String)">CreditAnalyticsResponse</a></strong>(java.lang.String&nbsp;strRequestID, java.lang.String&nbsp;strType, java.lang.String&nbsp;strBaseMsg)</code> <div class="block">CreditAnalyticsResponse constructor</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/drip/service/stream/Serializer.html" title="class in org.drip.service.stream">Serializer</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#deserialize(byte[])">deserialize</a></strong>(byte[]&nbsp;ab)</code> <div class="block">De-serialize from a byte array.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#getBaseMsg()">getBaseMsg</a></strong>()</code> <div class="block">Retrieve the Base Message</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#getFieldDelimiter()">getFieldDelimiter</a></strong>()</code> <div class="block">Returns the Field Delimiter String</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#getObjectTrailer()">getObjectTrailer</a></strong>()</code> <div class="block">Returns the Object Trailer String</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#getRequestID()">getRequestID</a></strong>()</code> <div class="block">Retrieve the Request ID</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>byte[]</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#getSerializedMsg()">getSerializedMsg</a></strong>()</code> <div class="block">Retrieve the Measure Bytes</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#getTimeSnap()">getTimeSnap</a></strong>()</code> <div class="block">Retrieve the Time Snap</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#getType()">getType</a></strong>()</code> <div class="block">Retrieve the Type</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static void</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#main(java.lang.String[])">main</a></strong>(java.lang.String[]&nbsp;astrArgs)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>byte[]</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#serialize()">serialize</a></strong>()</code> <div class="block">Serialize into a byte array.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><strong><a href="../../../../org/drip/service/bridge/CreditAnalyticsResponse.html#setSerializedMsg(byte[])">setSerializedMsg</a></strong>(byte[]&nbsp;abMeasure)</code> <div class="block">Set the Measure Bytes</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_org.drip.service.stream.Serializer"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.drip.service.stream.<a href="../../../../org/drip/service/stream/Serializer.html" title="class in org.drip.service.stream">Serializer</a></h3> <code><a href="../../../../org/drip/service/stream/Serializer.html#getCollectionKeyValueDelimiter()">getCollectionKeyValueDelimiter</a>, <a href="../../../../org/drip/service/stream/Serializer.html#getCollectionMultiLevelKeyDelimiter()">getCollectionMultiLevelKeyDelimiter</a>, <a href="../../../../org/drip/service/stream/Serializer.html#getCollectionRecordDelimiter()">getCollectionRecordDelimiter</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field_detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="CAR_STATUS"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>CAR_STATUS</h4> <pre>public static final&nbsp;java.lang.String CAR_STATUS</pre> <div class="block">Status Message</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.drip.service.bridge.CreditAnalyticsResponse.CAR_STATUS">Constant Field Values</a></dd></dl> </li> </ul> <a name="CAR_FAILURE"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>CAR_FAILURE</h4> <pre>public static final&nbsp;java.lang.String CAR_FAILURE</pre> <div class="block">Failure Message</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.drip.service.bridge.CreditAnalyticsResponse.CAR_FAILURE">Constant Field Values</a></dd></dl> </li> </ul> <a name="CAR_SUCCESS"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>CAR_SUCCESS</h4> <pre>public static final&nbsp;java.lang.String CAR_SUCCESS</pre> <div class="block">Success Message</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.drip.service.bridge.CreditAnalyticsResponse.CAR_SUCCESS">Constant Field Values</a></dd></dl> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="CreditAnalyticsResponse(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>CreditAnalyticsResponse</h4> <pre>public&nbsp;CreditAnalyticsResponse(byte[]&nbsp;ab) throws java.lang.Exception</pre> <div class="block">CreditAnalyticsResponse de-serialization from input byte array</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>ab</code> - Byte Array</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.lang.Exception</code> - Thrown if CreditAnalyticsResponse cannot be properly de-serialized</dd></dl> </li> </ul> <a name="CreditAnalyticsResponse(java.lang.String, java.lang.String, java.lang.String)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>CreditAnalyticsResponse</h4> <pre>public&nbsp;CreditAnalyticsResponse(java.lang.String&nbsp;strRequestID, java.lang.String&nbsp;strType, java.lang.String&nbsp;strBaseMsg) throws java.lang.Exception</pre> <div class="block">CreditAnalyticsResponse constructor</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>strRequestID</code> - The corresponding Request ID</dd><dd><code>strType</code> - Type</dd><dd><code>strBaseMsg</code> - Base Message</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.lang.Exception</code> - Thrown if the inputs are invalid</dd></dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getRequestID()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getRequestID</h4> <pre>public&nbsp;java.lang.String&nbsp;getRequestID()</pre> <div class="block">Retrieve the Request ID</div> <dl><dt><span class="strong">Returns:</span></dt><dd>The Type</dd></dl> </li> </ul> <a name="getTimeSnap()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTimeSnap</h4> <pre>public&nbsp;java.lang.String&nbsp;getTimeSnap()</pre> <div class="block">Retrieve the Time Snap</div> <dl><dt><span class="strong">Returns:</span></dt><dd>The Time Snap</dd></dl> </li> </ul> <a name="getType()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getType</h4> <pre>public&nbsp;java.lang.String&nbsp;getType()</pre> <div class="block">Retrieve the Type</div> <dl><dt><span class="strong">Returns:</span></dt><dd>The Type</dd></dl> </li> </ul> <a name="getBaseMsg()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getBaseMsg</h4> <pre>public&nbsp;java.lang.String&nbsp;getBaseMsg()</pre> <div class="block">Retrieve the Base Message</div> <dl><dt><span class="strong">Returns:</span></dt><dd>The Base Message</dd></dl> </li> </ul> <a name="setSerializedMsg(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setSerializedMsg</h4> <pre>public&nbsp;boolean&nbsp;setSerializedMsg(byte[]&nbsp;abMeasure)</pre> <div class="block">Set the Measure Bytes</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>abMeasure</code> - The Measure Bytes</dd> <dt><span class="strong">Returns:</span></dt><dd>TRUE => Message Properly set</dd></dl> </li> </ul> <a name="getSerializedMsg()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSerializedMsg</h4> <pre>public&nbsp;byte[]&nbsp;getSerializedMsg()</pre> <div class="block">Retrieve the Measure Bytes</div> <dl><dt><span class="strong">Returns:</span></dt><dd>The Measure Bytes</dd></dl> </li> </ul> <a name="getFieldDelimiter()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getFieldDelimiter</h4> <pre>public&nbsp;java.lang.String&nbsp;getFieldDelimiter()</pre> <div class="block"><strong>Description copied from class:&nbsp;<code><a href="../../../../org/drip/service/stream/Serializer.html#getFieldDelimiter()">Serializer</a></code></strong></div> <div class="block">Returns the Field Delimiter String</div> <dl> <dt><strong>Overrides:</strong></dt> <dd><code><a href="../../../../org/drip/service/stream/Serializer.html#getFieldDelimiter()">getFieldDelimiter</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/drip/service/stream/Serializer.html" title="class in org.drip.service.stream">Serializer</a></code></dd> <dt><span class="strong">Returns:</span></dt><dd>Field Delimiter String</dd></dl> </li> </ul> <a name="getObjectTrailer()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getObjectTrailer</h4> <pre>public&nbsp;java.lang.String&nbsp;getObjectTrailer()</pre> <div class="block"><strong>Description copied from class:&nbsp;<code><a href="../../../../org/drip/service/stream/Serializer.html#getObjectTrailer()">Serializer</a></code></strong></div> <div class="block">Returns the Object Trailer String</div> <dl> <dt><strong>Overrides:</strong></dt> <dd><code><a href="../../../../org/drip/service/stream/Serializer.html#getObjectTrailer()">getObjectTrailer</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/drip/service/stream/Serializer.html" title="class in org.drip.service.stream">Serializer</a></code></dd> <dt><span class="strong">Returns:</span></dt><dd>Object Trailer String</dd></dl> </li> </ul> <a name="serialize()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>serialize</h4> <pre>public&nbsp;byte[]&nbsp;serialize()</pre> <div class="block"><strong>Description copied from class:&nbsp;<code><a href="../../../../org/drip/service/stream/Serializer.html#serialize()">Serializer</a></code></strong></div> <div class="block">Serialize into a byte array.</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/drip/service/stream/Serializer.html#serialize()">serialize</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/drip/service/stream/Serializer.html" title="class in org.drip.service.stream">Serializer</a></code></dd> <dt><span class="strong">Returns:</span></dt><dd>Byte Array</dd></dl> </li> </ul> <a name="deserialize(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>deserialize</h4> <pre>public&nbsp;<a href="../../../../org/drip/service/stream/Serializer.html" title="class in org.drip.service.stream">Serializer</a>&nbsp;deserialize(byte[]&nbsp;ab)</pre> <div class="block"><strong>Description copied from class:&nbsp;<code><a href="../../../../org/drip/service/stream/Serializer.html#deserialize(byte[])">Serializer</a></code></strong></div> <div class="block">De-serialize from a byte array.</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/drip/service/stream/Serializer.html#deserialize(byte[])">deserialize</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/drip/service/stream/Serializer.html" title="class in org.drip.service.stream">Serializer</a></code></dd> <dt><span class="strong">Returns:</span></dt><dd>De-serialized object instance represented by Serializer</dd></dl> </li> </ul> <a name="main(java.lang.String[])"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>main</h4> <pre>public static final&nbsp;void&nbsp;main(java.lang.String[]&nbsp;astrArgs) throws java.lang.Exception</pre> <dl><dt><span class="strong">Throws:</span></dt> <dd><code>java.lang.Exception</code></dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= 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="navBarCell1Rev">Class</li> <li><a href="class-use/CreditAnalyticsResponse.html">Use</a></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><a href="../../../../org/drip/service/bridge/CreditAnalyticsRequest.html" title="class in org.drip.service.bridge"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/drip/service/bridge/CreditAnalyticsStub.html" title="class in org.drip.service.bridge"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/drip/service/bridge/CreditAnalyticsResponse.html" target="_top">Frames</a></li> <li><a href="CreditAnalyticsResponse.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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "d5f0fb741bb7e244f2fe31be554e61c7", "timestamp": "", "source": "github", "line_count": 574, "max_line_length": 415, "avg_line_length": 42.46689895470383, "alnum_prop": 0.6477272727272727, "repo_name": "tectronics/rootfinder", "id": "dc56f4dc7fd6cb8959ed5f1854716de3bad5a0b2", "size": "24376", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "2.2/docs/Javadoc/org/drip/service/bridge/CreditAnalyticsResponse.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "34839" }, { "name": "HTML", "bytes": "77000232" }, { "name": "Java", "bytes": "10842587" } ], "symlink_target": "" }
package org.robolectric.shadows; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Rect; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.Robolectric; import org.robolectric.TestRunners; import static org.fest.assertions.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.robolectric.Robolectric.shadowOf; import static org.robolectric.shadows.ShadowPath.Point.Type.LINE_TO; @RunWith(TestRunners.WithDefaults.class) public class CanvasTest { private Bitmap targetBitmap; private Bitmap imageBitmap; @Before public void setUp() throws Exception { targetBitmap = Robolectric.newInstanceOf(Bitmap.class); imageBitmap = BitmapFactory.decodeFile("/an/image.jpg"); } @Test public void shouldDescribeBitmapDrawing() throws Exception { Canvas canvas = new Canvas(targetBitmap); canvas.drawBitmap(imageBitmap, 1, 2, new Paint()); canvas.drawBitmap(imageBitmap, 100, 200, new Paint()); assertEquals("Bitmap for file:/an/image.jpg at (1,2)\n" + "Bitmap for file:/an/image.jpg at (100,200)", shadowOf(canvas).getDescription()); assertEquals("Bitmap for file:/an/image.jpg at (1,2)\n" + "Bitmap for file:/an/image.jpg at (100,200)", shadowOf(targetBitmap).getDescription()); } @Test public void shouldDescribeBitmapDrawing_withDestinationRect() throws Exception { Canvas canvas = new Canvas(targetBitmap); canvas.drawBitmap(imageBitmap, new Rect(1,2,3,4), new Rect(5,6,7,8), new Paint()); assertEquals("Bitmap for file:/an/image.jpg at (5,6) with height=2 and width=2 taken from Rect(1, 2 - 3, 4)", shadowOf(canvas).getDescription()); } @Test public void shouldDescribeBitmapDrawing_WithMatrix() throws Exception { Canvas canvas = new Canvas(targetBitmap); canvas.drawBitmap(imageBitmap, new Matrix(), new Paint()); canvas.drawBitmap(imageBitmap, new Matrix(), new Paint()); assertEquals("Bitmap for file:/an/image.jpg transformed by matrix\n" + "Bitmap for file:/an/image.jpg transformed by matrix", shadowOf(canvas).getDescription()); assertEquals("Bitmap for file:/an/image.jpg transformed by matrix\n" + "Bitmap for file:/an/image.jpg transformed by matrix", shadowOf(targetBitmap).getDescription()); } @Test public void visualize_shouldReturnDescription() throws Exception { Canvas canvas = new Canvas(targetBitmap); canvas.drawBitmap(imageBitmap, new Matrix(), new Paint()); canvas.drawBitmap(imageBitmap, new Matrix(), new Paint()); assertEquals("Bitmap for file:/an/image.jpg transformed by matrix\n" + "Bitmap for file:/an/image.jpg transformed by matrix", Robolectric.visualize(canvas)); } @Test public void drawColor_shouldReturnDescription() throws Exception { Canvas canvas = new Canvas(targetBitmap); canvas.drawColor(Color.WHITE); canvas.drawColor(Color.GREEN); canvas.drawColor(Color.TRANSPARENT); assertEquals("draw color -1draw color -16711936draw color 0", shadowOf(canvas).getDescription()); } @Test public void drawPath_shouldRecordThePathAndThePaint() throws Exception { Canvas canvas = new Canvas(targetBitmap); Path path = new Path(); path.lineTo(10, 10); Paint paint = new Paint(); paint.setAlpha(7); canvas.drawPath(path, paint); ShadowCanvas shadow = shadowOf(canvas); assertThat(shadow.getPathPaintHistoryCount()).isEqualTo(1); assertEquals(shadowOf(shadow.getDrawnPath(0)).getPoints().get(0), new ShadowPath.Point(10, 10, LINE_TO)); assertThat(shadow.getDrawnPathPaint(0)).isEqualTo(paint); } @Test public void drawPath_shouldRecordThePointsOfEachPathEvenWhenItIsTheSameInstance() throws Exception { Canvas canvas = new Canvas(targetBitmap); Paint paint = new Paint(); Path path = new Path(); path.lineTo(10, 10); canvas.drawPath(path, paint); path.reset(); path.lineTo(20, 20); canvas.drawPath(path, paint); ShadowCanvas shadow = shadowOf(canvas); assertThat(shadow.getPathPaintHistoryCount()).isEqualTo(2); assertEquals(shadowOf(shadow.getDrawnPath(0)).getPoints().get(0), new ShadowPath.Point(10, 10, LINE_TO)); assertEquals(shadowOf(shadow.getDrawnPath(1)).getPoints().get(0), new ShadowPath.Point(20, 20, LINE_TO)); } @Test public void drawPath_shouldAppendDescriptionToBitmap() throws Exception { Canvas canvas = new Canvas(targetBitmap); Path path1 = new Path(); path1.lineTo(10, 10); path1.moveTo(20, 15); Path path2 = new Path(); path2.moveTo(100, 100); path2.lineTo(150, 140); Paint paint = new Paint(); canvas.drawPath(path1, paint); canvas.drawPath(path2, paint); assertEquals("Path " + shadowOf(path1).getPoints().toString() + "\n" + "Path " + shadowOf(path2).getPoints().toString(), shadowOf(canvas).getDescription()); assertEquals("Path " + shadowOf(path1).getPoints().toString() + "\n" + "Path " + shadowOf(path2).getPoints().toString(), shadowOf(targetBitmap).getDescription()); } @Test public void resetCanvasHistory_shouldClearTheHistoryAndDescription() throws Exception { Canvas canvas = new Canvas(); canvas.drawPath(new Path(), new Paint()); canvas.drawText("hi", 1, 2, new Paint()); ShadowCanvas shadow = shadowOf(canvas); shadow.resetCanvasHistory(); assertThat(shadow.getPathPaintHistoryCount()).isEqualTo(0); assertThat(shadow.getTextHistoryCount()).isEqualTo(0); assertEquals("", shadow.getDescription()); } @Test public void shouldGetAndSetHeightAndWidth() throws Exception { Canvas canvas = new Canvas(); shadowOf(canvas).setWidth(99); shadowOf(canvas).setHeight(42); assertEquals(99, canvas.getWidth()); assertEquals(42, canvas.getHeight()); } @Test public void shouldRecordText() throws Exception { Canvas canvas = new Canvas(); Paint paint = new Paint(); Paint paint2 = new Paint(); paint.setColor(1); paint2.setColor(5); canvas.drawText("hello", 1, 2, paint); canvas.drawText("hello 2", 4, 6, paint2); ShadowCanvas shadowCanvas = shadowOf(canvas); assertThat(shadowCanvas.getTextHistoryCount()).isEqualTo(2); assertEquals(1f, shadowCanvas.getDrawnTextEvent(0).x, 0); assertEquals(2f, shadowCanvas.getDrawnTextEvent(0).y, 0); assertEquals(4f, shadowCanvas.getDrawnTextEvent(1).x, 0); assertEquals(6f, shadowCanvas.getDrawnTextEvent(1).y, 0); assertEquals(paint, shadowCanvas.getDrawnTextEvent(0).paint); assertEquals(paint2, shadowCanvas.getDrawnTextEvent(1).paint); assertEquals("hello", shadowCanvas.getDrawnTextEvent(0).text); assertEquals("hello 2", shadowCanvas.getDrawnTextEvent(1).text); } }
{ "content_hash": "39e79fd9faba4e9471b653de14aee0d0", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 153, "avg_line_length": 38.869791666666664, "alnum_prop": 0.6695698780651212, "repo_name": "dierksen/robolectric", "id": "d606a6796d7d327507969b956114321d66415cc4", "size": "7463", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/test/java/org/robolectric/shadows/CanvasTest.java", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
import datetime import os import unittest from copy import copy from decimal import Decimal from django.conf import settings from django.contrib.gis.gdal import DataSource from django.contrib.gis.utils.layermapping import ( InvalidDecimal, InvalidString, LayerMapError, LayerMapping, MissingForeignKey, ) from django.db import connection from django.test import TestCase, override_settings from .models import ( City, County, CountyFeat, DoesNotAllowNulls, HasNulls, ICity1, ICity2, Interstate, Invalid, State, city_mapping, co_mapping, cofeat_mapping, has_nulls_mapping, inter_mapping, ) shp_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.pardir, 'data')) city_shp = os.path.join(shp_path, 'cities', 'cities.shp') co_shp = os.path.join(shp_path, 'counties', 'counties.shp') inter_shp = os.path.join(shp_path, 'interstates', 'interstates.shp') invalid_shp = os.path.join(shp_path, 'invalid', 'emptypoints.shp') has_nulls_geojson = os.path.join(shp_path, 'has_nulls', 'has_nulls.geojson') # Dictionaries to hold what's expected in the county shapefile. NAMES = ['Bexar', 'Galveston', 'Harris', 'Honolulu', 'Pueblo'] NUMS = [1, 2, 1, 19, 1] # Number of polygons for each. STATES = ['Texas', 'Texas', 'Texas', 'Hawaii', 'Colorado'] class LayerMapTest(TestCase): def test_init(self): "Testing LayerMapping initialization." # Model field that does not exist. bad1 = copy(city_mapping) bad1['foobar'] = 'FooField' # Shapefile field that does not exist. bad2 = copy(city_mapping) bad2['name'] = 'Nombre' # Nonexistent geographic field type. bad3 = copy(city_mapping) bad3['point'] = 'CURVE' # Incrementing through the bad mapping dictionaries and # ensuring that a LayerMapError is raised. for bad_map in (bad1, bad2, bad3): with self.assertRaises(LayerMapError): LayerMapping(City, city_shp, bad_map) # A LookupError should be thrown for bogus encodings. with self.assertRaises(LookupError): LayerMapping(City, city_shp, city_mapping, encoding='foobar') def test_simple_layermap(self): "Test LayerMapping import of a simple point shapefile." # Setting up for the LayerMapping. lm = LayerMapping(City, city_shp, city_mapping) lm.save() # There should be three cities in the shape file. self.assertEqual(3, City.objects.count()) # Opening up the shapefile, and verifying the values in each # of the features made it to the model. ds = DataSource(city_shp) layer = ds[0] for feat in layer: city = City.objects.get(name=feat['Name'].value) self.assertEqual(feat['Population'].value, city.population) self.assertEqual(Decimal(str(feat['Density'])), city.density) self.assertEqual(feat['Created'].value, city.dt) # Comparing the geometries. pnt1, pnt2 = feat.geom, city.point self.assertAlmostEqual(pnt1.x, pnt2.x, 5) self.assertAlmostEqual(pnt1.y, pnt2.y, 5) def test_layermap_strict(self): "Testing the `strict` keyword, and import of a LineString shapefile." # When the `strict` keyword is set an error encountered will force # the importation to stop. with self.assertRaises(InvalidDecimal): lm = LayerMapping(Interstate, inter_shp, inter_mapping) lm.save(silent=True, strict=True) Interstate.objects.all().delete() # This LayerMapping should work b/c `strict` is not set. lm = LayerMapping(Interstate, inter_shp, inter_mapping) lm.save(silent=True) # Two interstate should have imported correctly. self.assertEqual(2, Interstate.objects.count()) # Verifying the values in the layer w/the model. ds = DataSource(inter_shp) # Only the first two features of this shapefile are valid. valid_feats = ds[0][:2] for feat in valid_feats: istate = Interstate.objects.get(name=feat['Name'].value) if feat.fid == 0: self.assertEqual(Decimal(str(feat['Length'])), istate.length) elif feat.fid == 1: # Everything but the first two decimal digits were truncated, # because the Interstate model's `length` field has decimal_places=2. self.assertAlmostEqual(feat.get('Length'), float(istate.length), 2) for p1, p2 in zip(feat.geom, istate.path): self.assertAlmostEqual(p1[0], p2[0], 6) self.assertAlmostEqual(p1[1], p2[1], 6) def county_helper(self, county_feat=True): "Helper function for ensuring the integrity of the mapped County models." for name, n, st in zip(NAMES, NUMS, STATES): # Should only be one record b/c of `unique` keyword. c = County.objects.get(name=name) self.assertEqual(n, len(c.mpoly)) self.assertEqual(st, c.state.name) # Checking ForeignKey mapping. # Multiple records because `unique` was not set. if county_feat: qs = CountyFeat.objects.filter(name=name) self.assertEqual(n, qs.count()) def test_layermap_unique_multigeometry_fk(self): "Testing the `unique`, and `transform`, geometry collection conversion, and ForeignKey mappings." # All the following should work. # Telling LayerMapping that we want no transformations performed on the data. lm = LayerMapping(County, co_shp, co_mapping, transform=False) # Specifying the source spatial reference system via the `source_srs` keyword. lm = LayerMapping(County, co_shp, co_mapping, source_srs=4269) lm = LayerMapping(County, co_shp, co_mapping, source_srs='NAD83') # Unique may take tuple or string parameters. for arg in ('name', ('name', 'mpoly')): lm = LayerMapping(County, co_shp, co_mapping, transform=False, unique=arg) # Now test for failures # Testing invalid params for the `unique` keyword. for e, arg in ((TypeError, 5.0), (ValueError, 'foobar'), (ValueError, ('name', 'mpolygon'))): with self.assertRaises(e): LayerMapping(County, co_shp, co_mapping, transform=False, unique=arg) # No source reference system defined in the shapefile, should raise an error. if connection.features.supports_transform: with self.assertRaises(LayerMapError): LayerMapping(County, co_shp, co_mapping) # Passing in invalid ForeignKey mapping parameters -- must be a dictionary # mapping for the model the ForeignKey points to. bad_fk_map1 = copy(co_mapping) bad_fk_map1['state'] = 'name' bad_fk_map2 = copy(co_mapping) bad_fk_map2['state'] = {'nombre': 'State'} with self.assertRaises(TypeError): LayerMapping(County, co_shp, bad_fk_map1, transform=False) with self.assertRaises(LayerMapError): LayerMapping(County, co_shp, bad_fk_map2, transform=False) # There exist no State models for the ForeignKey mapping to work -- should raise # a MissingForeignKey exception (this error would be ignored if the `strict` # keyword is not set). lm = LayerMapping(County, co_shp, co_mapping, transform=False, unique='name') with self.assertRaises(MissingForeignKey): lm.save(silent=True, strict=True) # Now creating the state models so the ForeignKey mapping may work. State.objects.bulk_create([ State(name='Colorado'), State(name='Hawaii'), State(name='Texas') ]) # If a mapping is specified as a collection, all OGR fields that # are not collections will be converted into them. For example, # a Point column would be converted to MultiPoint. Other things being done # w/the keyword args: # `transform=False`: Specifies that no transform is to be done; this # has the effect of ignoring the spatial reference check (because the # county shapefile does not have implicit spatial reference info). # # `unique='name'`: Creates models on the condition that they have # unique county names; geometries from each feature however will be # appended to the geometry collection of the unique model. Thus, # all of the various islands in Honolulu county will be in in one # database record with a MULTIPOLYGON type. lm = LayerMapping(County, co_shp, co_mapping, transform=False, unique='name') lm.save(silent=True, strict=True) # A reference that doesn't use the unique keyword; a new database record will # created for each polygon. lm = LayerMapping(CountyFeat, co_shp, cofeat_mapping, transform=False) lm.save(silent=True, strict=True) # The county helper is called to ensure integrity of County models. self.county_helper() def test_test_fid_range_step(self): "Tests the `fid_range` keyword and the `step` keyword of .save()." # Function for clearing out all the counties before testing. def clear_counties(): County.objects.all().delete() State.objects.bulk_create([ State(name='Colorado'), State(name='Hawaii'), State(name='Texas') ]) # Initializing the LayerMapping object to use in these tests. lm = LayerMapping(County, co_shp, co_mapping, transform=False, unique='name') # Bad feature id ranges should raise a type error. bad_ranges = (5.0, 'foo', co_shp) for bad in bad_ranges: with self.assertRaises(TypeError): lm.save(fid_range=bad) # Step keyword should not be allowed w/`fid_range`. fr = (3, 5) # layer[3:5] with self.assertRaises(LayerMapError): lm.save(fid_range=fr, step=10) lm.save(fid_range=fr) # Features IDs 3 & 4 are for Galveston County, Texas -- only # one model is returned because the `unique` keyword was set. qs = County.objects.all() self.assertEqual(1, qs.count()) self.assertEqual('Galveston', qs[0].name) # Features IDs 5 and beyond for Honolulu County, Hawaii, and # FID 0 is for Pueblo County, Colorado. clear_counties() lm.save(fid_range=slice(5, None), silent=True, strict=True) # layer[5:] lm.save(fid_range=slice(None, 1), silent=True, strict=True) # layer[:1] # Only Pueblo & Honolulu counties should be present because of # the `unique` keyword. Have to set `order_by` on this QuerySet # or else MySQL will return a different ordering than the other dbs. qs = County.objects.order_by('name') self.assertEqual(2, qs.count()) hi, co = tuple(qs) hi_idx, co_idx = tuple(map(NAMES.index, ('Honolulu', 'Pueblo'))) self.assertEqual('Pueblo', co.name) self.assertEqual(NUMS[co_idx], len(co.mpoly)) self.assertEqual('Honolulu', hi.name) self.assertEqual(NUMS[hi_idx], len(hi.mpoly)) # Testing the `step` keyword -- should get the same counties # regardless of we use a step that divides equally, that is odd, # or that is larger than the dataset. for st in (4, 7, 1000): clear_counties() lm.save(step=st, strict=True) self.county_helper(county_feat=False) def test_model_inheritance(self): "Tests LayerMapping on inherited models. See #12093." icity_mapping = { 'name': 'Name', 'population': 'Population', 'density': 'Density', 'point': 'POINT', 'dt': 'Created', } # Parent model has geometry field. lm1 = LayerMapping(ICity1, city_shp, icity_mapping) lm1.save() # Grandparent has geometry field. lm2 = LayerMapping(ICity2, city_shp, icity_mapping) lm2.save() self.assertEqual(6, ICity1.objects.count()) self.assertEqual(3, ICity2.objects.count()) def test_invalid_layer(self): "Tests LayerMapping on invalid geometries. See #15378." invalid_mapping = {'point': 'POINT'} lm = LayerMapping(Invalid, invalid_shp, invalid_mapping, source_srs=4326) lm.save(silent=True) def test_charfield_too_short(self): mapping = copy(city_mapping) mapping['name_short'] = 'Name' lm = LayerMapping(City, city_shp, mapping) with self.assertRaises(InvalidString): lm.save(silent=True, strict=True) def test_textfield(self): "String content fits also in a TextField" mapping = copy(city_mapping) mapping['name_txt'] = 'Name' lm = LayerMapping(City, city_shp, mapping) lm.save(silent=True, strict=True) self.assertEqual(City.objects.count(), 3) self.assertEqual(City.objects.get(name='Houston').name_txt, "Houston") def test_encoded_name(self): """ Test a layer containing utf-8-encoded name """ city_shp = os.path.join(shp_path, 'ch-city', 'ch-city.shp') lm = LayerMapping(City, city_shp, city_mapping) lm.save(silent=True, strict=True) self.assertEqual(City.objects.count(), 1) self.assertEqual(City.objects.all()[0].name, "Zürich") def test_null_geom_with_unique(self): """LayerMapping may be created with a unique and a null geometry.""" State.objects.bulk_create([State(name='Colorado'), State(name='Hawaii'), State(name='Texas')]) hw = State.objects.get(name='Hawaii') hu = County.objects.create(name='Honolulu', state=hw, mpoly=None) lm = LayerMapping(County, co_shp, co_mapping, transform=False, unique='name') lm.save(silent=True, strict=True) hu.refresh_from_db() self.assertIsNotNone(hu.mpoly) self.assertEqual(hu.mpoly.ogr.num_coords, 449) def test_null_number_imported(self): """LayerMapping import of GeoJSON with a null numeric value.""" lm = LayerMapping(HasNulls, has_nulls_geojson, has_nulls_mapping) lm.save() self.assertEqual(HasNulls.objects.count(), 3) self.assertEqual(HasNulls.objects.filter(num=0).count(), 1) self.assertEqual(HasNulls.objects.filter(num__isnull=True).count(), 1) def test_null_string_imported(self): "Test LayerMapping import of GeoJSON with a null string value." lm = LayerMapping(HasNulls, has_nulls_geojson, has_nulls_mapping) lm.save() self.assertEqual(HasNulls.objects.filter(name='None').count(), 0) num_empty = 1 if connection.features.interprets_empty_strings_as_nulls else 0 self.assertEqual(HasNulls.objects.filter(name='').count(), num_empty) self.assertEqual(HasNulls.objects.filter(name__isnull=True).count(), 1) def test_nullable_boolean_imported(self): """LayerMapping import of GeoJSON with a nullable boolean value.""" lm = LayerMapping(HasNulls, has_nulls_geojson, has_nulls_mapping) lm.save() self.assertEqual(HasNulls.objects.filter(boolean=True).count(), 1) self.assertEqual(HasNulls.objects.filter(boolean=False).count(), 1) self.assertEqual(HasNulls.objects.filter(boolean__isnull=True).count(), 1) def test_nullable_datetime_imported(self): """LayerMapping import of GeoJSON with a nullable date/time value.""" lm = LayerMapping(HasNulls, has_nulls_geojson, has_nulls_mapping) lm.save() self.assertEqual(HasNulls.objects.filter(datetime__lt=datetime.date(1994, 8, 15)).count(), 1) self.assertEqual(HasNulls.objects.filter(datetime='2018-11-29T03:02:52').count(), 1) self.assertEqual(HasNulls.objects.filter(datetime__isnull=True).count(), 1) def test_uuids_imported(self): """LayerMapping import of GeoJSON with UUIDs.""" lm = LayerMapping(HasNulls, has_nulls_geojson, has_nulls_mapping) lm.save() self.assertEqual(HasNulls.objects.filter(uuid='1378c26f-cbe6-44b0-929f-eb330d4991f5').count(), 1) def test_null_number_imported_not_allowed(self): """ LayerMapping import of GeoJSON with nulls to fields that don't permit them. """ lm = LayerMapping(DoesNotAllowNulls, has_nulls_geojson, has_nulls_mapping) lm.save(silent=True) # When a model fails to save due to IntegrityError (null in non-null # column), subsequent saves fail with "An error occurred in the current # transaction. You can't execute queries until the end of the 'atomic' # block." On Oracle and MySQL, the one object that did load appears in # this count. On other databases, no records appear. self.assertLessEqual(DoesNotAllowNulls.objects.count(), 1) class OtherRouter: def db_for_read(self, model, **hints): return 'other' def db_for_write(self, model, **hints): return self.db_for_read(model, **hints) def allow_relation(self, obj1, obj2, **hints): # ContentType objects are created during a post-migrate signal while # performing fixture teardown using the default database alias and # don't abide by the database specified by this router. return True def allow_migrate(self, db, app_label, **hints): return True @override_settings(DATABASE_ROUTERS=[OtherRouter()]) class LayerMapRouterTest(TestCase): databases = {'default', 'other'} @unittest.skipUnless(len(settings.DATABASES) > 1, 'multiple databases required') def test_layermapping_default_db(self): lm = LayerMapping(City, city_shp, city_mapping) self.assertEqual(lm.using, 'other')
{ "content_hash": "13689ae613f8b6b35489b6eb067dd6f6", "timestamp": "", "source": "github", "line_count": 405, "max_line_length": 105, "avg_line_length": 44.37283950617284, "alnum_prop": 0.640977129820266, "repo_name": "schinckel/django", "id": "50fdb4815a7211675efea033aac29cf064a0a404", "size": "17972", "binary": false, "copies": "37", "ref": "refs/heads/master", "path": "tests/gis_tests/layermap/tests.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "85024" }, { "name": "HTML", "bytes": "224566" }, { "name": "JavaScript", "bytes": "251536" }, { "name": "Makefile", "bytes": "125" }, { "name": "Python", "bytes": "13234142" }, { "name": "Shell", "bytes": "809" }, { "name": "Smarty", "bytes": "130" } ], "symlink_target": "" }
logtail.html
{ "content_hash": "c5a1477353d80395b9d503d7dfb810d4", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 12, "avg_line_length": 12, "alnum_prop": 0.9166666666666666, "repo_name": "sealabr/pm2-web_dashboard", "id": "81a329f7fd7d6f899ce379c09139877d5c9c6eb4", "size": "12", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "js/js-logtail/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "478920" }, { "name": "HTML", "bytes": "565324" }, { "name": "JavaScript", "bytes": "289797" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>smc: 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.10.0 / smc - 8.8.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> smc <small> 8.8.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-06-12 16:57:09 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-06-12 16:57:09 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.10.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.08.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.08.1 Official release 4.08.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/smc&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/SMC&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.8&quot; &amp; &lt; &quot;8.9~&quot;} &quot;coq-int-map&quot; {&gt;= &quot;8.8&quot; &amp; &lt; &quot;8.9~&quot;} ] tags: [ &quot;keyword: BDD&quot; &quot;keyword: binary decision diagrams&quot; &quot;keyword: classical logic&quot; &quot;keyword: propositional logic&quot; &quot;keyword: garbage collection&quot; &quot;keyword: modal mu-calculus&quot; &quot;keyword: model checking&quot; &quot;keyword: symbolic model checking&quot; &quot;keyword: reflection&quot; &quot;category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures&quot; &quot;date: 2002-11&quot; ] authors: [ &quot;Kumar Neeraj Verma &lt;[email protected]&gt;&quot; ] bug-reports: &quot;https://github.com/coq-contribs/smc/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/smc.git&quot; synopsis: &quot;BDD based symbolic model checker for the modal mu-calculus&quot; description: &quot;&quot;&quot; Provides BDD algorithms, a symbolic model checker for the modal mu-calculus based on it, together with a garbage collector&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/smc/archive/v8.8.0.tar.gz&quot; checksum: &quot;md5=606c309374468d1c1a178f5b67b2d95c&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-smc.8.8.0 coq.8.10.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.10.0). The following dependencies couldn&#39;t be met: - coq-smc -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints 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-smc.8.8.0</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": "a8b3c441405f538eecc31457c1bb4b67", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 480, "avg_line_length": 43.69090909090909, "alnum_prop": 0.5518102372034956, "repo_name": "coq-bench/coq-bench.github.io", "id": "1f8211c793e336070d587152a9af91ebd42a7ff5", "size": "7234", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.08.1-2.0.5/released/8.10.0/smc/8.8.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout android:layout_width="fill_parent" android:layout_height="60dp" android:orientation="horizontal"> <Button android:id="@+id/btnUme" android:layout_width="fill_parent" android:layout_height="60dp" android:layout_weight="1"/> <TextView android:id="@+id/obsahKosika" android:gravity="center" android:layout_weight="1" android:textSize="17sp" android:visibility="invisible" android:layout_width="match_parent" android:layout_height="60dp" /> <Button android:id="@+id/btninfo" android:layout_width="fill_parent" android:layout_height="60dp" android:visibility="invisible" android:text="@string/popisbtninfo" android:layout_weight="1"/> </LinearLayout> <Button android:id="@+id/btnDph" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/popisbtndph" android:layout_marginTop="5dip"/> <Button android:id="@+id/btnPrivyd2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/popisbtnprivyd" android:layout_marginTop="5dip"/> <Button android:id="@+id/btnMajzav2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/popisbtnmajzav" android:layout_marginTop="5dip"/> <Button android:id="@+id/btnFob" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/popisbtnfob" android:layout_marginTop="5dip"/> <Button android:id="@+id/btnPlatbystatu" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/popisbtnplatbystatu" android:layout_marginTop="5dip"/> </LinearLayout>
{ "content_hash": "0520210b6b5f548e7af27ccd00267449", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 72, "avg_line_length": 33.19402985074627, "alnum_prop": 0.6276978417266187, "repo_name": "eurosecom/samfantozzi", "id": "dd19d5c6cc0d5d264923e85c6a85fb01f64f9b21", "size": "2224", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/danovezos.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "830128" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "76522c828be375638b780aa3611e2b53", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "94b28b7e2d3d6edb0549478118d1f344d96d5fdd", "size": "172", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Apocynaceae/Anodendron/Anodendron aambe/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/.idea/DB-Final.iml" filepath="$PROJECT_DIR$/.idea/DB-Final.iml" /> </modules> </component> </project>
{ "content_hash": "a3a7067ab17db58a1d49718b62cab43c", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 110, "avg_line_length": 33.5, "alnum_prop": 0.6529850746268657, "repo_name": "kouchakyazdi/Chat-mongodb", "id": "cff9606aab0c7be5b579fce7687d9fb60604f3d2", "size": "268", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": ".idea/modules.xml", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10778" }, { "name": "HTML", "bytes": "10983" }, { "name": "JavaScript", "bytes": "176" }, { "name": "PHP", "bytes": "25133" } ], "symlink_target": "" }
/** * HTML5 Audio Read-Along * @author Weston Ruter, X-Team * @license MIT/GPL * https://github.com/westonruter/html5-audio-read-along */ var ReadAlong = { text_element: null, audio_element: null, autofocus_current_word: true, words: [], init: function (args) { var name; for (name in args) { this[name] = args[name]; } this.generateWordList(); this.addEventListeners(); this.selectCurrentWord(); }, /** * Build an index of all of the words that can be read along with their begin, * and end times, and the DOM element representing the word. */ generateWordList: function () { var word_els = this.text_element.querySelectorAll('[data-begin]'); this.words = Array.prototype.map.call(word_els, function (word_el, index) { var word = { 'begin': parseFloat(word_el.dataset.begin), 'dur': parseFloat(word_el.dataset.dur), 'element': word_el }; word_el.tabIndex = 0; // to make it focusable/interactive word.index = index; word.end = word.begin + word.dur; word_el.dataset.index = word.index; return word; }); }, /** * From the audio's currentTime, find the word that is currently being played * @todo this would better be implemented as a binary search */ getCurrentWord: function () { var i; var len; var is_current_word; var word = null; for (i = 0, len = this.words.length; i < len; i += 1) { is_current_word = ( ( this.audio_element.currentTime >= this.words[i].begin && this.audio_element.currentTime < this.words[i].end ) || (this.audio_element.currentTime < this.words[i].begin) ); if (is_current_word) { word = this.words[i]; break; } } if (!word) { throw Error('Unable to find current word and we should always be able to.'); } return word; }, _current_end_select_timeout_id: null, _current_next_select_timeout_id: null, /** * Select the current word and set timeout to select the next one if playing */ selectCurrentWord: function() { var that = this; var current_word = this.getCurrentWord(); var is_playing = !this.audio_element.paused; if (!current_word.element.classList.contains('speaking')) { this.removeWordSelection(); current_word.element.classList.add('speaking'); if (this.autofocus_current_word) { current_word.element.focus(); } } /** * The timeupdate Media event does not fire repeatedly enough to be * able to rely on for updating the selected word (it hovers around * 250ms resolution), so we add a setTimeout with the exact duration * of the word. */ if (is_playing) { // Remove word selection when the word ceases to be spoken var seconds_until_this_word_ends = current_word.end - this.audio_element.currentTime; // Note: 'word' not 'world'! ;-) if (typeof this.audio_element === 'number' && !isNaN(this.audio_element)) { seconds_until_this_word_ends *= 1.0/this.audio_element.playbackRate; } clearTimeout(this._current_end_select_timeout_id); this._current_end_select_timeout_id = setTimeout( function () { if (!that.audio_element.paused) { // we always want to have a word selected while paused current_word.element.classList.remove('speaking'); } }, Math.max(seconds_until_this_word_ends * 1000, 0) ); // Automatically trigger selectCurrentWord when the next word begins var next_word = this.words[current_word.index + 1]; if (next_word) { var seconds_until_next_word_begins = next_word.begin - this.audio_element.currentTime; var orig_seconds_until_next_word_begins = seconds_until_next_word_begins; // temp if (typeof this.audio_element === 'number' && !isNaN(this.audio_element)) { seconds_until_next_word_begins *= 1.0/this.audio_element.playbackRate; } clearTimeout(this._current_next_select_timeout_id); this._current_next_select_timeout_id = setTimeout( function () { that.selectCurrentWord(); }, Math.max(seconds_until_next_word_begins * 1000, 0) ); } } }, removeWordSelection: function() { // There should only be one element with .speaking, but selecting all for good measure var spoken_word_els = this.text_element.querySelectorAll('span[data-begin].speaking'); Array.prototype.forEach.call(spoken_word_els, function (spoken_word_el) { spoken_word_el.classList.remove('speaking'); }); }, addEventListeners: function () { var that = this; /** * Select next word (at that.audio_element.currentTime) when playing begins */ that.audio_element.addEventListener('play', function (e) { that.selectCurrentWord(); that.text_element.classList.add('speaking'); }, false); /** * Abandon seeking the next word because we're paused */ that.audio_element.addEventListener('pause', function (e) { that.selectCurrentWord(); // We always want a word to be selected that.text_element.classList.remove('speaking'); }, false); /** * Seek by selecting a word (event delegation) */ function on_select_word_el(e) { if (!e.target.dataset.begin) { return; } e.preventDefault(); var i = e.target.dataset.index; that.audio_element.currentTime = that.words[i].begin + 0.01; //Note: times apparently cannot be exactly set and sometimes select too early that.selectCurrentWord(); } that.text_element.addEventListener('click', on_select_word_el, false); that.text_element.addEventListener('keypress', function (e) { if ( (e.charCode || e.keyCode) === 13 /*Enter*/) { on_select_word_el.call(this, e); } }, false); /** * Spacebar toggles playback */ document.addEventListener('keypress', function (e) { if ( (e.charCode || e.keyCode) === 32 /*Space*/) { e.preventDefault(); if (that.audio_element.paused) { that.audio_element.play(); } else { that.audio_element.pause(); } } }, false); /** * First click handler sets currentTime to the word, and second click * here then causes it to play. * @todo Should it stop playing once the duration is over? */ that.text_element.addEventListener('dblclick', function (e) { e.preventDefault(); that.audio_element.play(); }, false); /** * Select a word when seeking */ that.audio_element.addEventListener('seeked', function (e) { that.selectCurrentWord(); /** * Address probem with Chrome where sometimes it seems to get stuck upon seeked: * http://code.google.com/p/chromium/issues/detail?id=99749 */ var audio_element = this; if (!audio_element.paused) { var previousTime = audio_element.currentTime; setTimeout(function () { if (!audio_element.paused && previousTime === audio_element.currentTime) { audio_element.currentTime += 0.01; // Attempt to unstick } }, 500); } }, false); /** * Select a word when seeking */ that.audio_element.addEventListener('ratechange', function (e) { that.selectCurrentWord(); }, false); } };
{ "content_hash": "81cfd8f3c7e5ce2d31bb9b5249c52e9c", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 150, "avg_line_length": 36.2563025210084, "alnum_prop": 0.5338973229806466, "repo_name": "sozoStudio/sozoStudio.github.io", "id": "0e5ba3435a3772d52718960ad5187cfe3e88d5d4", "size": "8629", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "FoguangTemple_chromeApp/app/js/read-along.js", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "680095" }, { "name": "HTML", "bytes": "3129552" }, { "name": "JavaScript", "bytes": "1432019" }, { "name": "PHP", "bytes": "1097" } ], "symlink_target": "" }
<?php namespace webmagic\scheduler; /** * Class ArrayScheduler * @package lib\webmagic\scheduler * @author Lujie.Zhou([email protected]) */ class ArrayScheduler implements Scheduler, MonitorableScheduler { /** * @var array, the url list */ public $queue = []; /** * @var array, the url index, you can get url by index number */ public $queueIndex = []; /** * @var array, url extra data * format: [ * 'http://www.baidu.com' => [ * 'aa' => 'bb' * ] * ] */ public $extras = []; /** * @param int $index * @return bool|mixed * @inheritdoc */ public function getUrl($index) { return isset($this->queueIndex[$index]) ? $this->queueIndex[$index] : false; } /** * @param string $url * @return bool|mixed * @inheritdoc */ public function getExtra($url) { return isset($this->extras[$url]) ? $this->extras[$url] : []; } /** * @param string $url * @param array $extra * @inheritdoc */ public function push($url, $extra = []) { if ($extra) { $this->extras[$url] = $extra; } $this->queue[] = $url; } /** * @return \Generator * @inheritdoc */ public function poll() { while ($this->queue) { $url = array_shift($this->queue); $this->queueIndex[] = $url; $extra = $this->getExtra($url); yield ['url' => $url, 'extra' => $extra]; } } public function reset() { $this->queue = []; $this->extras = []; $this->queueIndex = []; } public function __invoke() { $this->poll(); } /** * @return int */ public function getLeftUrlsCount() { return count($this->queue); } /** * @return int */ public function getTotalUrlsCount() { return count($this->queueIndex) + count($this->queue); } }
{ "content_hash": "6afe438008ac1fd436a156427bf45ce4", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 84, "avg_line_length": 19.00925925925926, "alnum_prop": 0.4788114953726254, "repo_name": "gaolujie1989/webmagic", "id": "b86a06b8548fe0691b5145e9680ef349aa52bb41", "size": "2093", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scheduler/ArrayScheduler.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "15180" } ], "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 (1.8.0_121) on Mon May 08 10:04:58 PDT 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Deprecated List (ORC Core 1.4.0 API)</title> <meta name="date" content="2017-05-08"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Deprecated List (ORC Core 1.4.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li class="navBarCell1Rev">Deprecated</li> <li><a href="index-all.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?deprecated-list.html" target="_top">Frames</a></li> <li><a href="deprecated-list.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All&nbsp;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="Deprecated API" class="title">Deprecated API</h1> <h2 title="Contents">Contents</h2> <ul> <li><a href="#class">Deprecated Classes</a></li> <li><a href="#method">Deprecated Methods</a></li> <li><a href="#constructor">Deprecated Constructors</a></li> </ul> </div> <div class="contentContainer"><a name="class"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <table class="deprecatedSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated Classes table, listing deprecated classes, and an explanation"> <caption><span>Deprecated Classes</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="org/apache/orc/impl/MemoryManager.html" title="class in org.apache.orc.impl">org.apache.orc.impl.MemoryManager</a></td> </tr> </tbody> </table> </li> </ul> <a name="method"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <table class="deprecatedSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated Methods table, listing deprecated methods, and an explanation"> <caption><span>Deprecated Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="org/apache/orc/impl/InStream.html#create-java.lang.String-java.nio.ByteBuffer:A-long:A-long-org.apache.orc.CompressionCodec-int-">org.apache.orc.impl.InStream.create(String, ByteBuffer[], long[], long, CompressionCodec, int)</a></td> </tr> <tr class="rowColor"> <td class="colOne"><a href="org/apache/orc/Reader.html#getTypes--">org.apache.orc.Reader.getTypes()</a> <div class="block"><span class="deprecationComment">use getSchema instead</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="org/apache/orc/impl/RecordReaderImpl.html#mapSargColumnsToOrcInternalColIdx-java.util.List-java.lang.String:A-int-">org.apache.orc.impl.RecordReaderImpl.mapSargColumnsToOrcInternalColIdx(List&lt;PredicateLeaf&gt;, String[], int)</a> <div class="block"><span class="deprecationComment">Use #mapSargColumnsToOrcInternalColIdx(List, SchemaEvolution)</span></div> </td> </tr> </tbody> </table> </li> </ul> <a name="constructor"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <table class="deprecatedSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated Constructors table, listing deprecated constructors, and an explanation"> <caption><span>Deprecated Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="org/apache/orc/impl/SchemaEvolution.html#SchemaEvolution-org.apache.orc.TypeDescription-boolean:A-">org.apache.orc.impl.SchemaEvolution(TypeDescription, boolean[])</a></td> </tr> <tr class="rowColor"> <td class="colOne"><a href="org/apache/orc/impl/SchemaEvolution.html#SchemaEvolution-org.apache.orc.TypeDescription-org.apache.orc.TypeDescription-boolean:A-">org.apache.orc.impl.SchemaEvolution(TypeDescription, TypeDescription, boolean[])</a></td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li class="navBarCell1Rev">Deprecated</li> <li><a href="index-all.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?deprecated-list.html" target="_top">Frames</a></li> <li><a href="deprecated-list.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All&nbsp;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 ======= --> <p class="legalCopy"><small>Copyright &#169; 2013&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> </body> </html>
{ "content_hash": "839a29434d4526973fa517e90afedb9e", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 261, "avg_line_length": 34.89447236180904, "alnum_prop": 0.6746831797235023, "repo_name": "pudidic/orc", "id": "bfaac62d656c8b6f04e13e7e7b01cf83469bf755", "size": "6944", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "site/api/orc-core/deprecated-list.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "639" }, { "name": "C", "bytes": "1690" }, { "name": "C++", "bytes": "1164764" }, { "name": "CMake", "bytes": "20716" }, { "name": "CSS", "bytes": "87995" }, { "name": "HTML", "bytes": "13686442" }, { "name": "Java", "bytes": "1895735" }, { "name": "JavaScript", "bytes": "3308" }, { "name": "Protocol Buffer", "bytes": "7180" }, { "name": "Ruby", "bytes": "60" }, { "name": "Shell", "bytes": "2295" } ], "symlink_target": "" }
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Fluent Bit * ========== * Copyright (C) 2015-2022 The Fluent Bit Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdio.h> #include <stdlib.h> #include <time.h> #include <msgpack.h> #include <fluent-bit/flb_input.h> #include <fluent-bit/flb_input_plugin.h> #include <fluent-bit/flb_config.h> #include <fluent-bit/flb_config_map.h> #include <fluent-bit/flb_error.h> #include <fluent-bit/flb_time.h> #include <fluent-bit/flb_pack.h> #include "in_dummy.h" static int set_dummy_timestamp(msgpack_packer *mp_pck, struct flb_dummy *ctx) { struct flb_time t; struct flb_time diff; struct flb_time dummy_time; int ret; if (ctx->base_timestamp == NULL) { ctx->base_timestamp = flb_malloc(sizeof(struct flb_time)); flb_time_get(ctx->base_timestamp); ret = flb_time_append_to_msgpack(ctx->dummy_timestamp, mp_pck, 0); } else { flb_time_get(&t); flb_time_diff(&t, ctx->base_timestamp, &diff); flb_time_add(ctx->dummy_timestamp, &diff, &dummy_time); ret = flb_time_append_to_msgpack(&dummy_time, mp_pck, 0); } return ret; } static int init_msg(msgpack_sbuffer *mp_sbuf, msgpack_packer *mp_pck) { /* Initialize local msgpack buffer */ msgpack_sbuffer_init(mp_sbuf); msgpack_packer_init(mp_pck, mp_sbuf, msgpack_sbuffer_write); return 0; } static int gen_msg(struct flb_input_instance *ins, void *in_context, msgpack_packer *mp_pck) { size_t off = 0; size_t start = 0; char *pack; int pack_size; msgpack_unpacked result; struct flb_dummy *ctx = in_context; pack = ctx->ref_msgpack; pack_size = ctx->ref_msgpack_size; msgpack_unpacked_init(&result); while (msgpack_unpack_next(&result, pack, pack_size, &off) == MSGPACK_UNPACK_SUCCESS) { if (result.data.type == MSGPACK_OBJECT_MAP) { /* { map => val, map => val, map => val } */ msgpack_pack_array(mp_pck, 2); if (ctx->dummy_timestamp != NULL){ set_dummy_timestamp(mp_pck, ctx); } else { flb_pack_time_now(mp_pck); } msgpack_pack_str_body(mp_pck, pack + start, off - start); } start = off; } msgpack_unpacked_destroy(&result); return 0; } /* cb_collect callback */ static int in_dummy_collect(struct flb_input_instance *ins, struct flb_config *config, void *in_context) { struct flb_dummy *ctx = in_context; msgpack_sbuffer mp_sbuf; msgpack_packer mp_pck; int i; if (ctx->samples > 0 && (ctx->samples_count >= ctx->samples)) { return -1; } if (ctx->fixed_timestamp == FLB_FALSE) { init_msg(&mp_sbuf, &mp_pck); for (i = 0; i < ctx->copies; i++) { gen_msg(ins, in_context, &mp_pck); } flb_input_log_append(ins, NULL, 0, mp_sbuf.data, mp_sbuf.size); msgpack_sbuffer_destroy(&mp_sbuf); } else { flb_input_log_append(ins, NULL, 0, ctx->mp_sbuf.data, ctx->mp_sbuf.size); } if (ctx->samples > 0) { ctx->samples_count++; } return 0; } static int config_destroy(struct flb_dummy *ctx) { flb_free(ctx->dummy_timestamp); flb_free(ctx->base_timestamp); if (ctx->fixed_timestamp == FLB_TRUE) { msgpack_sbuffer_destroy(&ctx->mp_sbuf); } if (ctx->dummy_message) { flb_free(ctx->dummy_message); } flb_free(ctx->ref_msgpack); flb_free(ctx); return 0; } /* Set plugin configuration */ static int configure(struct flb_dummy *ctx, struct flb_input_instance *in, struct timespec *tm) { struct flb_time dummy_time; const char *msg; int dummy_time_enabled = FLB_FALSE; msgpack_packer mp_pck; int root_type; int ret = -1; int i; ctx->dummy_message = NULL; ctx->dummy_message_len = 0; ctx->ref_msgpack = NULL; ret = flb_input_config_map_set(in, (void *) ctx); if (ret == -1) { return -1; } /* interval settings */ tm->tv_sec = 1; tm->tv_nsec = 0; if (ctx->rate > 1) { tm->tv_sec = 0; tm->tv_nsec = 1000000000 / ctx->rate; } /* dummy timestamp */ ctx->dummy_timestamp = NULL; ctx->base_timestamp = NULL; flb_time_zero(&dummy_time); if (ctx->start_time_sec >= 0 || ctx->start_time_nsec >= 0) { dummy_time_enabled = FLB_TRUE; if (ctx->start_time_sec >= 0) { dummy_time.tm.tv_sec = ctx->start_time_sec; } if (ctx->start_time_nsec >= 0) { dummy_time.tm.tv_nsec = ctx->start_time_nsec; } } if (dummy_time_enabled) { ctx->dummy_timestamp = flb_malloc(sizeof(struct flb_time)); flb_time_copy(ctx->dummy_timestamp, &dummy_time); } /* handle it explicitly since we need to validate it is valid JSON */ msg = flb_input_get_property("dummy", in); if (msg == NULL) { msg = DEFAULT_DUMMY_MESSAGE; } ret = flb_pack_json(msg, strlen(msg), &ctx->ref_msgpack, &ctx->ref_msgpack_size, &root_type); if (ret == 0) { ctx->dummy_message = flb_strdup(msg); ctx->dummy_message_len = strlen(msg); } else { flb_plg_warn(ctx->ins, "data is incomplete. Use default string."); ctx->dummy_message = flb_strdup(DEFAULT_DUMMY_MESSAGE); ctx->dummy_message_len = strlen(ctx->dummy_message); ret = flb_pack_json(ctx->dummy_message, ctx->dummy_message_len, &ctx->ref_msgpack, &ctx->ref_msgpack_size, &root_type); if (ret != 0) { flb_plg_error(ctx->ins, "unexpected error"); return -1; } } if (ctx->fixed_timestamp == FLB_TRUE) { init_msg(&ctx->mp_sbuf, &mp_pck); for (i = 0; i < ctx->copies; i++) { gen_msg(in, ctx, &mp_pck); } } return 0; } /* Initialize plugin */ static int in_dummy_init(struct flb_input_instance *in, struct flb_config *config, void *data) { int ret = -1; struct flb_dummy *ctx = NULL; struct timespec tm; /* Allocate space for the configuration */ ctx = flb_malloc(sizeof(struct flb_dummy)); if (ctx == NULL) { return -1; } ctx->ins = in; ctx->samples = 0; ctx->samples_count = 0; /* Initialize head config */ ret = configure(ctx, in, &tm); if (ret < 0) { config_destroy(ctx); return -1; } flb_input_set_context(in, ctx); ret = flb_input_set_collector_time(in, in_dummy_collect, tm.tv_sec, tm.tv_nsec, config); if (ret < 0) { flb_plg_error(ctx->ins, "could not set collector for dummy input plugin"); config_destroy(ctx); return -1; } ctx->coll_fd = ret; return 0; } static void in_dummy_pause(void *data, struct flb_config *config) { struct flb_dummy *ctx = data; flb_input_collector_pause(ctx->coll_fd, ctx->ins); } static void in_dummy_resume(void *data, struct flb_config *config) { struct flb_dummy *ctx = data; flb_input_collector_resume(ctx->coll_fd, ctx->ins); } static int in_dummy_exit(void *data, struct flb_config *config) { (void) *config; struct flb_dummy *ctx = data; config_destroy(ctx); return 0; } /* Configuration properties map */ static struct flb_config_map config_map[] = { { FLB_CONFIG_MAP_INT, "samples", "0", 0, FLB_TRUE, offsetof(struct flb_dummy, samples), "set a number of times to generate event." }, { FLB_CONFIG_MAP_STR, "dummy", DEFAULT_DUMMY_MESSAGE, 0, FLB_FALSE, 0, "set the sample record to be generated. It should be a JSON object." }, { FLB_CONFIG_MAP_INT, "rate", "1", 0, FLB_TRUE, offsetof(struct flb_dummy, rate), "set a number of events per second." }, { FLB_CONFIG_MAP_INT, "copies", "1", 0, FLB_TRUE, offsetof(struct flb_dummy, copies), "set the number of copies to generate per collectd." }, { FLB_CONFIG_MAP_INT, "start_time_sec", "-1", 0, FLB_TRUE, offsetof(struct flb_dummy, start_time_sec), "set a dummy base timestamp in seconds." }, { FLB_CONFIG_MAP_INT, "start_time_nsec", "-1", 0, FLB_TRUE, offsetof(struct flb_dummy, start_time_nsec), "set a dummy base timestamp in nanoseconds." }, { FLB_CONFIG_MAP_BOOL, "fixed_timestamp", "off", 0, FLB_TRUE, offsetof(struct flb_dummy, fixed_timestamp), "used a fixed timestamp, allows the message to pre-generated once." }, {0} }; struct flb_input_plugin in_dummy_plugin = { .name = "dummy", .description = "Generate dummy data", .cb_init = in_dummy_init, .cb_pre_run = NULL, .cb_collect = in_dummy_collect, .cb_flush_buf = NULL, .config_map = config_map, .cb_pause = in_dummy_pause, .cb_resume = in_dummy_resume, .cb_exit = in_dummy_exit };
{ "content_hash": "985c632262e8b62a62330e2d9334d55b", "timestamp": "", "source": "github", "line_count": 348, "max_line_length": 92, "avg_line_length": 27.988505747126435, "alnum_prop": 0.5759753593429158, "repo_name": "fluent/fluent-bit", "id": "c5b55f7000a9b51cf529640aa190ed2b66c5b77d", "size": "9740", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "plugins/in_dummy/in_dummy.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "34215" }, { "name": "Awk", "bytes": "1967" }, { "name": "Batchfile", "bytes": "34565" }, { "name": "BitBake", "bytes": "3218" }, { "name": "C", "bytes": "46244484" }, { "name": "C++", "bytes": "3014145" }, { "name": "CMake", "bytes": "798817" }, { "name": "CSS", "bytes": "33350" }, { "name": "Dockerfile", "bytes": "32271" }, { "name": "Emacs Lisp", "bytes": "305" }, { "name": "GDB", "bytes": "199" }, { "name": "Go", "bytes": "35683" }, { "name": "HTML", "bytes": "284625" }, { "name": "Java", "bytes": "12989" }, { "name": "JavaScript", "bytes": "54874" }, { "name": "Lex", "bytes": "11348" }, { "name": "Lua", "bytes": "487918" }, { "name": "M4", "bytes": "541844" }, { "name": "Makefile", "bytes": "754913" }, { "name": "Meson", "bytes": "772" }, { "name": "NASL", "bytes": "678" }, { "name": "PHP", "bytes": "149" }, { "name": "Perl", "bytes": "184697" }, { "name": "PowerShell", "bytes": "1989" }, { "name": "Python", "bytes": "726457" }, { "name": "Roff", "bytes": "212750" }, { "name": "Ruby", "bytes": "77427" }, { "name": "Shell", "bytes": "1985560" }, { "name": "TypeScript", "bytes": "72168" }, { "name": "WebAssembly", "bytes": "28005" }, { "name": "XSLT", "bytes": "415" }, { "name": "Yacc", "bytes": "17385" }, { "name": "jq", "bytes": "1065" }, { "name": "sed", "bytes": "588" } ], "symlink_target": "" }
"""Tests for the gcp module - serviceusage.py""" import typing import unittest import mock from tests.providers.gcp import gcp_mocks class GoogleServiceUsageTest(unittest.TestCase): """Test Google Service Usage class.""" # pylint: disable=line-too-long @typing.no_type_check @mock.patch('libcloudforensics.providers.gcp.internal.common.ExecuteRequest') @mock.patch('libcloudforensics.providers.gcp.internal.serviceusage.GoogleServiceUsage.GsuApi') def testGetEnabled(self, mock_gsu_api, mock_execute_request): """Validates the GetEnabled function""" mock_execute_request.return_value = gcp_mocks.MOCK_ENABLED_SERVICES mock_service_usage = mock_gsu_api.return_value.services.return_value response = gcp_mocks.FAKE_SERVICE_USAGE.GetEnabled() mock_execute_request.assert_called_with(mock_service_usage, 'list', {'parent': 'projects/fake-project', 'filter': 'state:ENABLED'}) self.assertListEqual(response, [ 'bigquery.googleapis.com', 'cloudapis.googleapis.com', 'compute.googleapis.com' ]) @typing.no_type_check @mock.patch('libcloudforensics.providers.gcp.internal.common.ExecuteRequest') @mock.patch('libcloudforensics.providers.gcp.internal.serviceusage.GoogleServiceUsage.GsuApi') def testEnableService(self, mock_gsu_api, mock_execute_request): """Validates that EnableService calls ExecuteRequest with the correct arguments.""" mock_service_usage = mock_gsu_api.return_value.services.return_value mock_execute_request.return_value = [{'name': 'operations/noop.DONE_OPERATION'}] gcp_mocks.FAKE_SERVICE_USAGE.EnableService('container.googleapis.com') mock_execute_request.assert_called_with(mock_service_usage, 'enable', {'name': 'projects/fake-project/services/container.googleapis.com'}) @typing.no_type_check @mock.patch('libcloudforensics.providers.gcp.internal.common.ExecuteRequest') @mock.patch('libcloudforensics.providers.gcp.internal.serviceusage.GoogleServiceUsage.GsuApi') def testDisableService(self, mock_gsu_api, mock_execute_request): """Validates that DisableService calls ExecuteRequest with the correct arguments.""" mock_service_usage = mock_gsu_api.return_value.services.return_value mock_execute_request.return_value = [{'name': 'operations/noop.DONE_OPERATION'}] gcp_mocks.FAKE_SERVICE_USAGE.DisableService('container.googleapis.com') mock_execute_request.assert_called_with(mock_service_usage, 'disable', {'name': 'projects/fake-project/services/container.googleapis.com'})
{ "content_hash": "6f7019f80b4432e80881acf2a4c0fac2", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 96, "avg_line_length": 45.80357142857143, "alnum_prop": 0.7508771929824561, "repo_name": "google/cloud-forensics-utils", "id": "8f90b22ad491efb7d1c5f5fea26d7b0194d74d6e", "size": "3165", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "tests/providers/gcp/internal/test_serviceusage.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "843359" }, { "name": "Shell", "bytes": "3622" } ], "symlink_target": "" }
@class NSArray; @protocol ITunesSoftwareServiceResponse <NSObject> - (NSArray *)infoMessages; - (NSArray *)warnings; - (NSArray *)errors; - (BOOL)isCancelled; - (BOOL)isSuccessful; @end
{ "content_hash": "91fdac7bf80f7eb9bcd66ed39609de24", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 50, "avg_line_length": 18.8, "alnum_prop": 0.7340425531914894, "repo_name": "kolinkrewinkel/Multiplex", "id": "0c3ee9a90184f2094f3068765809518cb070533f", "size": "353", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "Multiplex/IDEHeaders/IDEHeaders/IDEFoundation/ITunesSoftwareServiceResponse-Protocol.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "4691836" }, { "name": "Python", "bytes": "2267" }, { "name": "Ruby", "bytes": "109" }, { "name": "Shell", "bytes": "293" } ], "symlink_target": "" }
package org.wso2.carbon.ui; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.Bundle; import org.osgi.framework.ServiceReference; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.core.common.AuthenticationException; import org.wso2.carbon.registry.core.Registry; import org.wso2.carbon.ui.deployment.beans.CarbonUIDefinitions; import org.wso2.carbon.ui.deployment.beans.Context; import org.wso2.carbon.ui.internal.CarbonUIServiceComponent; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; import java.util.HashMap; import java.util.regex.Matcher; public class CarbonSecuredHttpContext extends SecuredComponentEntryHttpContext { public static final String LOGGED_USER = CarbonConstants.LOGGED_USER; public static final String CARBON_AUTHNETICATOR = "CarbonAuthenticator"; private static final Log log = LogFactory.getLog(CarbonSecuredHttpContext.class); private Bundle bundle = null; private HashMap<String, String> httpUrlsToBeByPassed = new HashMap<String, String>(); private HashMap<String, String> urlsToBeByPassed = new HashMap<String, String>(); private String defaultHomePage; private Context defaultContext; /** * * @param bundle * @param s * @param uiResourceRegistry * @param registry */ public CarbonSecuredHttpContext(Bundle bundle, String s, UIResourceRegistry uiResourceRegistry, Registry registry) { super(bundle, s, uiResourceRegistry); this.registry = registry; this.bundle = bundle; } /** * {@inheritDoc} */ public boolean handleSecurity(HttpServletRequest request, HttpServletResponse response) throws IOException { String requestedURI = request.getRequestURI(); // Get the matching CarbonUIAuthenticator. If no match found for the given request, this // will return null. CarbonUIAuthenticator authenticator = CarbonUILoginUtil.getAuthenticator(request); // This check is required for Single Logout implementation. If the request is not for SSO // based authentication page or SSO Servlet, then if the session is invalid redirect the // requests to logout_action.jsp. CarbonSSOSessionManager ssoSessionManager = CarbonSSOSessionManager.getInstance(); requestedURI = ssoSessionManager.getRequestedUrl(request,authenticator); HttpSession session; String sessionId; boolean authenticated = false; try { // Get the user's current authenticated session - if any exists. session = request.getSession(); sessionId = session.getId(); Boolean authenticatedObj = (Boolean) session.getAttribute("authenticated"); if (authenticatedObj != null) { authenticated = authenticatedObj.booleanValue(); if(log.isDebugEnabled()){ log.debug("Is authenticated " + authenticated); } } } catch (Exception e) { log.debug("No session exits"); return false; } String context = request.getContextPath(); if ("/".equals(context)) { context = ""; } // We eliminate the /tenant/{tenant-domain} from authentications Matcher matcher = CarbonUILoginUtil.getTenantEnabledUriPattern().matcher(requestedURI); if (matcher.matches()) { log.debug("Tenant webapp request " + requestedURI); return CarbonUILoginUtil.escapeTenantWebAppRequests(authenticated, response, requestedURI, context); } // TODO: When filtered from a Servlet filter the request uri always contains 2 //, this is a // temporary fix if (requestedURI.indexOf("//") == 0) { requestedURI = requestedURI.substring(1); } if (httpUrlsToBeByPassed.isEmpty()) { // Populates http urls to be by passed. populatehttpUrlsToBeByPassed(); } if (requestedURI.equals(context) || requestedURI.equals(context + "/")) { return handleRequestOnContext(request, response); } // Storing intermediate value of requestedURI. // This is needed for OpenID authentication later. String tempUrl = requestedURI; // When war is deployed on top of an existing app server we cannot use root context // for deployment. Hence a new context is added.Now url changes from eg: // carbon/admin/index.jsp to wso2/carbon/admin/index.jsp In this case before doing anything, // we need to remove web app context (eg: wso2) . CarbonUILoginUtil.addNewContext(requestedURI); // Disabling http access to admin console user guide documents should be allowed to access // via http protocol int val = -1; if ((val = allowNonSecuredContent(requestedURI, request, response, authenticated, authenticator)) != CarbonUILoginUtil.CONTINUE) { if (val == CarbonUILoginUtil.RETURN_TRUE) { log.debug("Skipping security check for non secured content. " + requestedURI); return true; } else { log.debug("Security check failed for the resource " + requestedURI); return false; } } // We are allowing requests for .jar/.class resources. Otherwise applets won't get loaded // due to session checks. (applet loading happens over https://) if(requestedURI.endsWith(".jar") || requestedURI.endsWith(".class")) { log.debug("Skipping authentication for .jar files and .class file." + requestedURI); return true; } String resourceURI = requestedURI.replaceFirst("/carbon/", "../"); if (log.isDebugEnabled()) { log.debug("CarbonSecuredHttpContext -> handleSecurity() requestURI:" + requestedURI + " id:" + sessionId + " resourceURI:" + resourceURI); } if (urlsToBeByPassed.isEmpty()) { // retrieve urls that should be by-passed from security check populateUrlsToBeBypassed(); } // if the current uri is marked to be by-passed, let it pass through if (isCurrentUrlToBePassed(request, session, resourceURI)) { return true; } String indexPageURL = CarbonUIUtil.getIndexPageURL(session.getServletContext(), request.getSession()); // Reading the requestedURL from the cookie to obtain the request made while not // authanticated; and setting it as the indexPageURL indexPageURL = CarbonUILoginUtil.getIndexPageUrlFromCookie(requestedURI, indexPageURL, request); // If a custom index page is used send the login request with the indexpage specified indexPageURL = CarbonUILoginUtil.getCustomIndexPage(request, indexPageURL); // Reading home page set on product.xml // If the params in the servletcontext is null get them from the UTIL indexPageURL = updateIndexPageWithHomePage(indexPageURL); if ((val = CarbonUILoginUtil.handleLoginPageRequest(requestedURI, request, response, authenticated, context, indexPageURL)) != CarbonUILoginUtil.CONTINUE) { if (val == CarbonUILoginUtil.RETURN_TRUE) { return true; } else { return false; } } // If authenticator defines to skip URL, return true if (ssoSessionManager.skipAuthentication(request)) { if(log.isDebugEnabled()){ log.debug("Skipping security checks for authenticator defined URL " + requestedURI); } return true; } // If someone signed in from a tenant, try to access a different tenant domain, he should be // forced to sign out without any prompt Cloud requirement requestedURI = CarbonUILoginUtil.getForcedSignOutRequestedURI(requestedURI, request); String contextPath = (request.getContextPath().equals("") || request.getContextPath() .equals("/")) ? "" : request.getContextPath(); String tenantDomain = (String) session.getAttribute(MultitenantConstants.TENANT_DOMAIN); if (tenantDomain != null && !tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { contextPath += "/" + MultitenantConstants.TENANT_AWARE_URL_PREFIX + "/" + tenantDomain; } String httpLogin = request.getParameter("gsHttpRequest"); boolean skipLoginPage = false; // Login page is not required for all the Authenticators. if (authenticator != null && authenticator.skipLoginPage() && requestedURI.indexOf("login_action.jsp") < 0 && (requestedURI.endsWith("/carbon/") || (requestedURI.indexOf("/registry/atom") == -1 && requestedURI .endsWith("/carbon")))) { // Add this to session for future use. request.getSession().setAttribute("skipLoginPage", "true"); } if (request.getSession().getAttribute("skipLoginPage") != null) { if ("true".equals(((String) request.getSession().getAttribute("skipLoginPage")))) { skipLoginPage = true; } } if (requestedURI.indexOf("login_action.jsp") > -1 && authenticator != null) { return CarbonUILoginUtil.handleLogin(authenticator, request, response, session, authenticated, contextPath, indexPageURL, httpLogin); } else if (requestedURI.indexOf("logout_action.jsp") > 1) { return CarbonUILoginUtil.handleLogout(authenticator, request, response, session, authenticated, contextPath, indexPageURL, httpLogin); } if (requestedURI.endsWith("/carbon/")) { if (skipLoginPage) { response.sendRedirect(contextPath + indexPageURL + "?skipLoginPage=true"); } else { response.sendRedirect(contextPath + indexPageURL); } return false; } else if (requestedURI.indexOf("/registry/atom") == -1 && requestedURI.endsWith("/carbon")) { if (skipLoginPage) { response.sendRedirect(contextPath + indexPageURL + "?skipLoginPage=true"); } else { response.sendRedirect(contextPath + indexPageURL); } return false; } else if (CarbonUILoginUtil.letRequestedUrlIn(requestedURI, tempUrl)) { return true; } else if (requestedURI.endsWith(".jsp") && authenticated) { return true; } if (!authenticated) { if (requestedURI.endsWith("ajaxprocessor.jsp")) { // Prevent login page appearing return true; } else { return CarbonUILoginUtil.saveOriginalUrl(authenticator, request, response, session, skipLoginPage, contextPath, indexPageURL, requestedURI); } } if (request.getSession().isNew()) { if (skipLoginPage) { response.sendRedirect(contextPath + "/carbon/admin/login_action.jsp"); } else { response.sendRedirect(contextPath + "/carbon/admin/login.jsp"); } return false; } return true; } /** * * @param indexPageURL * @return */ private String updateIndexPageWithHomePage(String indexPageURL) { // If the params in the servletcontext is null get them from the UTIL if (defaultHomePage == null) { defaultHomePage = (String) CarbonUIUtil .getProductParam(CarbonConstants.PRODUCT_XML_WSO2CARBON + CarbonConstants.DEFAULT_HOME_PAGE); } if (defaultHomePage != null && defaultHomePage.trim().length() > 0 && indexPageURL.contains("/carbon/admin/index.jsp")) { indexPageURL = defaultHomePage; if (!indexPageURL.startsWith("/")) { indexPageURL = "/" + indexPageURL; } } return indexPageURL; } /** * * @param request * @param session * @param resourceURI * @return */ private boolean isCurrentUrlToBePassed(HttpServletRequest request, HttpSession session, String resourceURI) { if (!urlsToBeByPassed.isEmpty() && urlsToBeByPassed.containsKey(resourceURI)) { if (log.isDebugEnabled()) { log.debug("By passing authentication check for URI : " + resourceURI); } // Before bypassing, set the backendURL properly so that it doesn't fail String contextPath = request.getContextPath(); String backendServerURL = request.getParameter("backendURL"); if (backendServerURL == null) { backendServerURL = CarbonUIUtil.getServerURL(session.getServletContext(), request.getSession()); } if ("/".equals(contextPath)) { contextPath = ""; } backendServerURL = backendServerURL.replace("${carbon.context}", contextPath); session.setAttribute(CarbonConstants.SERVER_URL, backendServerURL); return true; } return false; } /** * */ @SuppressWarnings({ "unchecked", "rawtypes" }) private void populateUrlsToBeBypassed() { if (bundle != null && urlsToBeByPassed.isEmpty()) { ServiceReference reference = bundle.getBundleContext().getServiceReference( CarbonUIDefinitions.class.getName()); CarbonUIDefinitions carbonUIDefinitions; if (reference != null) { carbonUIDefinitions = (CarbonUIDefinitions) bundle.getBundleContext().getService( reference); if (carbonUIDefinitions != null) { urlsToBeByPassed = carbonUIDefinitions.getUnauthenticatedUrls(); } } } } /** * * @param requestedURI * @param request * @param response * @param authenticated * @param authenticator * @return * @throws IOException */ @SuppressWarnings("deprecation") private int allowNonSecuredContent(String requestedURI, HttpServletRequest request, HttpServletResponse response, boolean authenticated, CarbonUIAuthenticator authenticator) throws IOException { if (!request.isSecure() && !(requestedURI.endsWith(".html"))) { // By passing items required for try-it & IDE plugins if (requestedURI.endsWith(".css") || requestedURI.endsWith(".gif") || requestedURI.endsWith(".GIF") || requestedURI.endsWith(".jpg") || requestedURI.endsWith(".JPG") || requestedURI.endsWith(".png") || requestedURI.endsWith(".PNG") || requestedURI.endsWith(".xsl") || requestedURI.endsWith(".xslt") || requestedURI.endsWith(".js") || requestedURI.endsWith(".ico") || requestedURI.endsWith("/filedownload") || requestedURI.endsWith("/fileupload") || requestedURI.contains("/fileupload/") || requestedURI.contains("admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp") || requestedURI.contains("registry/atom") || requestedURI.contains("registry/tags") || requestedURI.contains("gadgets/") || requestedURI.contains("registry/resource")) { return CarbonUILoginUtil.RETURN_TRUE; } String resourceURI = requestedURI.replaceFirst("/carbon/", "../"); // By passing the pages which are specified as bypass https if (httpUrlsToBeByPassed.containsKey(resourceURI)) { if (!authenticated) { try { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (Cookie cookie : cookies) { if (cookie.getName().equals(CarbonConstants.REMEMBER_ME_COOKE_NAME) && authenticator != null) { try { authenticator.authenticateWithCookie(request); } catch (AuthenticationException ignored) { // We can ignore here and proceed with normal login. if (log.isDebugEnabled()) { log.debug(ignored); } } } } } } catch (Exception e) { log.error(e.getMessage(), e); throw new IOException(e.getMessage(), e); } } return CarbonUILoginUtil.RETURN_TRUE; } String enableHTTPAdminConsole = CarbonUIServiceComponent.getServerConfiguration() .getFirstProperty(CarbonConstants.ENABLE_HTTP_ADMIN_CONSOLE); if (enableHTTPAdminConsole == null || "false".equalsIgnoreCase(enableHTTPAdminConsole.trim())) { String adminConsoleURL = CarbonUIUtil.getAdminConsoleURL(request); if (adminConsoleURL != null) { if (log.isTraceEnabled()) { log.trace("Request came to admin console via http.Forwarding to : " + adminConsoleURL); } response.sendRedirect(adminConsoleURL); return CarbonUILoginUtil.RETURN_FALSE; } } } return CarbonUILoginUtil.CONTINUE; } /** * * @param request * @param response * @return * @throws IOException */ private boolean handleRequestOnContext(HttpServletRequest request, HttpServletResponse response) throws IOException { log.debug("Handling request on context"); if (defaultContext != null && !"".equals(defaultContext.getContextName()) && !"null".equals(defaultContext.getContextName())) { String adminConsoleURL = CarbonUIUtil.getAdminConsoleURL(request); int index = adminConsoleURL.lastIndexOf("carbon"); String defaultContextUrl = adminConsoleURL.substring(0, index) + defaultContext.getContextName() + "/"; response.sendRedirect(defaultContextUrl); } else { response.sendRedirect("carbon"); } return false; } /** * */ @SuppressWarnings("unchecked") private void populatehttpUrlsToBeByPassed() { if (bundle != null && httpUrlsToBeByPassed.isEmpty() && defaultContext == null) { @SuppressWarnings("rawtypes") ServiceReference reference = bundle.getBundleContext().getServiceReference( CarbonUIDefinitions.class.getName()); CarbonUIDefinitions carbonUIDefinitions; if (reference != null) { carbonUIDefinitions = (CarbonUIDefinitions) bundle.getBundleContext().getService( reference); if (carbonUIDefinitions != null) { httpUrlsToBeByPassed = carbonUIDefinitions.getHttpUrls(); if (carbonUIDefinitions.getContexts().containsKey("default-context")) { defaultContext = carbonUIDefinitions.getContexts().get("default-context"); } } } } } }
{ "content_hash": "813bc076aa3a28f9533643d4e2288f84", "timestamp": "", "source": "github", "line_count": 481, "max_line_length": 118, "avg_line_length": 42.392931392931395, "alnum_prop": 0.5932028836251287, "repo_name": "Thanu/stratos", "id": "1b9e3665a4e93b96753b8771b39f1157e6d998bd", "size": "21074", "binary": false, "copies": "12", "ref": "refs/heads/master", "path": "dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CarbonSecuredHttpContext.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "17184" }, { "name": "C", "bytes": "27195" }, { "name": "CSS", "bytes": "107113" }, { "name": "HTML", "bytes": "153216" }, { "name": "Java", "bytes": "6447503" }, { "name": "JavaScript", "bytes": "3927701" }, { "name": "Python", "bytes": "647261" }, { "name": "Ruby", "bytes": "3546" }, { "name": "Shell", "bytes": "130188" } ], "symlink_target": "" }
JConverter es un módulo con servicios para calcular medidas de peso basado en el patrón de diseño JS revelador. [Para ver detalles sobre el procedimiento ejecutado durante el desarrollo del taller, presiona click sobre el enlace]( https://sites.google.com/view/memodevs) ## Descripción del mecanismo de conversión JConverter - Como paso inicial se crea una instancia del modulo sin parámetros de entrada y tendrá como retorno el numero cero 0. - Cada unidad de medida en el contexto de la aplicación tendrá solo 2 caracteres, es decir: 'tl' para representar toneladas, 'kg' para representar Kilogramos, 'lb' para representar Libras y 'mg' para representar finalmente miligramos. - Una vez creado el objeto, se procede a ingresar los parámetros siguiendo un orden específico que define los parámetros de conversión, seguido de un valor numérico como tercer parámetro, es decir, si quiero convertir el numero "94" de Kilos a Libras, el orden correcto es: 'kg', 'lb', 94. - Los 2 primeros argumentos correspoden a las unidades origen/destino, y la última es el valor numérico a convertir. - Unidad origen: corresponde al parametro número 1 según el orden del parámetro. ('kg', '...', ...) - Unidad Destino: corresponde al parametro número 2 según el orden del parámetro. ('...', 'lb', ...) ## Instalación - Ejecutar el siguiente comando: ``` npm install jconvertidor ``` - Posteriormente, hay que verificar si se descargó algún directorio cuyo nombre es "jconvertidor" en la carpeta local "node_modules". ## Métodos que incorpora ``` - Actualmente la función cuenta con algunos servicios básicos. - Es posible llevarla a un cliente web en tan solo minutos. - Estos servicios se exponen desde el retorno de función, y a su vez realiza el llamado a miembros propios (funciones con otro nombre interno) -Busca lograr un desacople de responsabilidades y 100% modular. ``` ``` iniciar: sin parámetros de entrada getMedidas: sin parametros de entrada calcularMedidas: con parametros ('kg', 'lb', 94) getObjOrigen: sin parametros, retorna todo el objeto origen getObjDestino: sin parametros, retorna todo el objeto destino ``` ## Uso ``` const jconverter = require('jconvertidor').default let clienteConverter = jconverter() console.log("hola mundo"+clienteConverter.iniciar()) // se crea un array de JSON donde cada objeto representa una unidad de medida. let datos = clienteConverter.getMedidas() // obtiene todas las unidades de medida configuradas. // se calcula el resultado a partir del objeto creado, indicando la unidad origen y destino a convertir seguido del valor. let resultadoA = clienteConverter.calcularMedidas('lb','kg', 188) let resultadoB = clienteConverter.calcularMedidas('kg','lb', 94) // obtiene las medidas en formato JSON let medidasCatch = JSON.stringify(datos) // unidades validadas console.log("validación de unidades básico: "+(resultadoA==resultadoB)) console.log("resultado A: "+resultadoA+" , resultado B: "+ resultadoB) ``` ## Propuesta a la comunidad y compañeros de estudio. # implementación de otras medidas de peso - Actualmente el módulo tiene habilitado la conversión de Kg a Lb y viceverza. - Se propone a quien quiera hacer parte de este repositorio a realizar sus pull request respectivos para evaluar la mejor manera, ello para fines didácticos y prácticas en entornos laborales reales. ``` En total son 4 unidades de medida que contemplará el módulo JS. Pendiente pasar de Toneladas a todas las medidas (4) Pendiente pasar de Kilos a las demás medidas distintas de libras (3) Pendiente pasar de Libras a las demás medidas distintas de Kilos (3) Pendiente pasar de Gramos a todas las demás medidas (4) ``` ## Créditos - [Twitter Jaime Diaz](https://twitter.com/jdiaz0017) - [Sitio en google de Jaime Diaz](https://sites.google.com/view/memodevs/) ## Licencia [MIT](https://opensource.org/licenses/MIT)
{ "content_hash": "4dc3efcbcf66f6471842f2827bd54771", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 289, "avg_line_length": 52.013513513513516, "alnum_prop": 0.7734476487399324, "repo_name": "jaimediaz817/jConverter", "id": "595d2383c962f42ba4c0ffd30db3c9f9881d1564", "size": "3907", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "readme.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "7405" } ], "symlink_target": "" }
import asyncore import email.mime.text from email.message import EmailMessage import email.utils import socket import smtpd import smtplib import io import re import sys import time import select import errno import textwrap import unittest from test import support, mock_socket try: import threading except ImportError: threading = None HOST = support.HOST if sys.platform == 'darwin': # select.poll returns a select.POLLHUP at the end of the tests # on darwin, so just ignore it def handle_expt(self): pass smtpd.SMTPChannel.handle_expt = handle_expt def server(evt, buf, serv): serv.listen() evt.set() try: conn, addr = serv.accept() except socket.timeout: pass else: n = 500 while buf and n > 0: r, w, e = select.select([], [conn], []) if w: sent = conn.send(buf) buf = buf[sent:] n -= 1 conn.close() finally: serv.close() evt.set() class GeneralTests(unittest.TestCase): def setUp(self): smtplib.socket = mock_socket self.port = 25 def tearDown(self): smtplib.socket = socket # This method is no longer used but is retained for backward compatibility, # so test to make sure it still works. def testQuoteData(self): teststr = "abc\n.jkl\rfoo\r\n..blue" expected = "abc\r\n..jkl\r\nfoo\r\n...blue" self.assertEqual(expected, smtplib.quotedata(teststr)) def testBasic1(self): mock_socket.reply_with(b"220 Hola mundo") # connects smtp = smtplib.SMTP(HOST, self.port) smtp.close() def testSourceAddress(self): mock_socket.reply_with(b"220 Hola mundo") # connects smtp = smtplib.SMTP(HOST, self.port, source_address=('127.0.0.1',19876)) self.assertEqual(smtp.source_address, ('127.0.0.1', 19876)) smtp.close() def testBasic2(self): mock_socket.reply_with(b"220 Hola mundo") # connects, include port in host name smtp = smtplib.SMTP("%s:%s" % (HOST, self.port)) smtp.close() def testLocalHostName(self): mock_socket.reply_with(b"220 Hola mundo") # check that supplied local_hostname is used smtp = smtplib.SMTP(HOST, self.port, local_hostname="testhost") self.assertEqual(smtp.local_hostname, "testhost") smtp.close() def testTimeoutDefault(self): mock_socket.reply_with(b"220 Hola mundo") self.assertIsNone(mock_socket.getdefaulttimeout()) mock_socket.setdefaulttimeout(30) self.assertEqual(mock_socket.getdefaulttimeout(), 30) try: smtp = smtplib.SMTP(HOST, self.port) finally: mock_socket.setdefaulttimeout(None) self.assertEqual(smtp.sock.gettimeout(), 30) smtp.close() def testTimeoutNone(self): mock_socket.reply_with(b"220 Hola mundo") self.assertIsNone(socket.getdefaulttimeout()) socket.setdefaulttimeout(30) try: smtp = smtplib.SMTP(HOST, self.port, timeout=None) finally: socket.setdefaulttimeout(None) self.assertIsNone(smtp.sock.gettimeout()) smtp.close() def testTimeoutValue(self): mock_socket.reply_with(b"220 Hola mundo") smtp = smtplib.SMTP(HOST, self.port, timeout=30) self.assertEqual(smtp.sock.gettimeout(), 30) smtp.close() def test_debuglevel(self): mock_socket.reply_with(b"220 Hello world") smtp = smtplib.SMTP() smtp.set_debuglevel(1) with support.captured_stderr() as stderr: smtp.connect(HOST, self.port) smtp.close() expected = re.compile(r"^connect:", re.MULTILINE) self.assertRegex(stderr.getvalue(), expected) def test_debuglevel_2(self): mock_socket.reply_with(b"220 Hello world") smtp = smtplib.SMTP() smtp.set_debuglevel(2) with support.captured_stderr() as stderr: smtp.connect(HOST, self.port) smtp.close() expected = re.compile(r"^\d{2}:\d{2}:\d{2}\.\d{6} connect: ", re.MULTILINE) self.assertRegex(stderr.getvalue(), expected) # Test server thread using the specified SMTP server class def debugging_server(serv, serv_evt, client_evt): serv_evt.set() try: if hasattr(select, 'poll'): poll_fun = asyncore.poll2 else: poll_fun = asyncore.poll n = 1000 while asyncore.socket_map and n > 0: poll_fun(0.01, asyncore.socket_map) # when the client conversation is finished, it will # set client_evt, and it's then ok to kill the server if client_evt.is_set(): serv.close() break n -= 1 except socket.timeout: pass finally: if not client_evt.is_set(): # allow some time for the client to read the result time.sleep(0.5) serv.close() asyncore.close_all() serv_evt.set() MSG_BEGIN = '---------- MESSAGE FOLLOWS ----------\n' MSG_END = '------------ END MESSAGE ------------\n' # NOTE: Some SMTP objects in the tests below are created with a non-default # local_hostname argument to the constructor, since (on some systems) the FQDN # lookup caused by the default local_hostname sometimes takes so long that the # test server times out, causing the test to fail. # Test behavior of smtpd.DebuggingServer @unittest.skipUnless(threading, 'Threading required for this test.') class DebuggingServerTests(unittest.TestCase): maxDiff = None def setUp(self): self.real_getfqdn = socket.getfqdn socket.getfqdn = mock_socket.getfqdn # temporarily replace sys.stdout to capture DebuggingServer output self.old_stdout = sys.stdout self.output = io.StringIO() sys.stdout = self.output self.serv_evt = threading.Event() self.client_evt = threading.Event() # Capture SMTPChannel debug output self.old_DEBUGSTREAM = smtpd.DEBUGSTREAM smtpd.DEBUGSTREAM = io.StringIO() # Pick a random unused port by passing 0 for the port number self.serv = smtpd.DebuggingServer((HOST, 0), ('nowhere', -1), decode_data=True) # Keep a note of what port was assigned self.port = self.serv.socket.getsockname()[1] serv_args = (self.serv, self.serv_evt, self.client_evt) self.thread = threading.Thread(target=debugging_server, args=serv_args) self.thread.start() # wait until server thread has assigned a port number self.serv_evt.wait() self.serv_evt.clear() def tearDown(self): socket.getfqdn = self.real_getfqdn # indicate that the client is finished self.client_evt.set() # wait for the server thread to terminate self.serv_evt.wait() self.thread.join() # restore sys.stdout sys.stdout = self.old_stdout # restore DEBUGSTREAM smtpd.DEBUGSTREAM.close() smtpd.DEBUGSTREAM = self.old_DEBUGSTREAM def testBasic(self): # connect smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.quit() def testSourceAddress(self): # connect port = support.find_unused_port() try: smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3, source_address=('127.0.0.1', port)) self.assertEqual(smtp.source_address, ('127.0.0.1', port)) self.assertEqual(smtp.local_hostname, 'localhost') smtp.quit() except OSError as e: if e.errno == errno.EADDRINUSE: self.skipTest("couldn't bind to port %d" % port) raise def testNOOP(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) expected = (250, b'OK') self.assertEqual(smtp.noop(), expected) smtp.quit() def testRSET(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) expected = (250, b'OK') self.assertEqual(smtp.rset(), expected) smtp.quit() def testELHO(self): # EHLO isn't implemented in DebuggingServer smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) expected = (250, b'\nSIZE 33554432\nHELP') self.assertEqual(smtp.ehlo(), expected) smtp.quit() def testEXPNNotImplemented(self): # EXPN isn't implemented in DebuggingServer smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) expected = (502, b'EXPN not implemented') smtp.putcmd('EXPN') self.assertEqual(smtp.getreply(), expected) smtp.quit() def testVRFY(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) expected = (252, b'Cannot VRFY user, but will accept message ' + \ b'and attempt delivery') self.assertEqual(smtp.vrfy('[email protected]'), expected) self.assertEqual(smtp.verify('[email protected]'), expected) smtp.quit() def testSecondHELO(self): # check that a second HELO returns a message that it's a duplicate # (this behavior is specific to smtpd.SMTPChannel) smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.helo() expected = (503, b'Duplicate HELO/EHLO') self.assertEqual(smtp.helo(), expected) smtp.quit() def testHELP(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) self.assertEqual(smtp.help(), b'Supported commands: EHLO HELO MAIL ' + \ b'RCPT DATA RSET NOOP QUIT VRFY') smtp.quit() def testSend(self): # connect and send mail m = 'A test message' smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.sendmail('John', 'Sally', m) # XXX(nnorwitz): this test is flaky and dies with a bad file descriptor # in asyncore. This sleep might help, but should really be fixed # properly by using an Event variable. time.sleep(0.01) smtp.quit() self.client_evt.set() self.serv_evt.wait() self.output.flush() mexpect = '%s%s\n%s' % (MSG_BEGIN, m, MSG_END) self.assertEqual(self.output.getvalue(), mexpect) def testSendBinary(self): m = b'A test message' smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.sendmail('John', 'Sally', m) # XXX (see comment in testSend) time.sleep(0.01) smtp.quit() self.client_evt.set() self.serv_evt.wait() self.output.flush() mexpect = '%s%s\n%s' % (MSG_BEGIN, m.decode('ascii'), MSG_END) self.assertEqual(self.output.getvalue(), mexpect) def testSendNeedingDotQuote(self): # Issue 12283 m = '.A test\n.mes.sage.' smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.sendmail('John', 'Sally', m) # XXX (see comment in testSend) time.sleep(0.01) smtp.quit() self.client_evt.set() self.serv_evt.wait() self.output.flush() mexpect = '%s%s\n%s' % (MSG_BEGIN, m, MSG_END) self.assertEqual(self.output.getvalue(), mexpect) def testSendNullSender(self): m = 'A test message' smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.sendmail('<>', 'Sally', m) # XXX (see comment in testSend) time.sleep(0.01) smtp.quit() self.client_evt.set() self.serv_evt.wait() self.output.flush() mexpect = '%s%s\n%s' % (MSG_BEGIN, m, MSG_END) self.assertEqual(self.output.getvalue(), mexpect) debugout = smtpd.DEBUGSTREAM.getvalue() sender = re.compile("^sender: <>$", re.MULTILINE) self.assertRegex(debugout, sender) def testSendMessage(self): m = email.mime.text.MIMEText('A test message') smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.send_message(m, from_addr='John', to_addrs='Sally') # XXX (see comment in testSend) time.sleep(0.01) smtp.quit() self.client_evt.set() self.serv_evt.wait() self.output.flush() # Add the X-Peer header that DebuggingServer adds m['X-Peer'] = socket.gethostbyname('localhost') mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) self.assertEqual(self.output.getvalue(), mexpect) def testSendMessageWithAddresses(self): m = email.mime.text.MIMEText('A test message') m['From'] = '[email protected]' m['To'] = 'John' m['CC'] = 'Sally, Fred' m['Bcc'] = 'John Root <root@localhost>, "Dinsdale" <[email protected]>' smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.send_message(m) # XXX (see comment in testSend) time.sleep(0.01) smtp.quit() # make sure the Bcc header is still in the message. self.assertEqual(m['Bcc'], 'John Root <root@localhost>, "Dinsdale" ' '<[email protected]>') self.client_evt.set() self.serv_evt.wait() self.output.flush() # Add the X-Peer header that DebuggingServer adds m['X-Peer'] = socket.gethostbyname('localhost') # The Bcc header should not be transmitted. del m['Bcc'] mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) self.assertEqual(self.output.getvalue(), mexpect) debugout = smtpd.DEBUGSTREAM.getvalue() sender = re.compile("^sender: [email protected]$", re.MULTILINE) self.assertRegex(debugout, sender) for addr in ('John', 'Sally', 'Fred', 'root@localhost', '[email protected]'): to_addr = re.compile(r"^recips: .*'{}'.*$".format(addr), re.MULTILINE) self.assertRegex(debugout, to_addr) def testSendMessageWithSomeAddresses(self): # Make sure nothing breaks if not all of the three 'to' headers exist m = email.mime.text.MIMEText('A test message') m['From'] = '[email protected]' m['To'] = 'John, Dinsdale' smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.send_message(m) # XXX (see comment in testSend) time.sleep(0.01) smtp.quit() self.client_evt.set() self.serv_evt.wait() self.output.flush() # Add the X-Peer header that DebuggingServer adds m['X-Peer'] = socket.gethostbyname('localhost') mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) self.assertEqual(self.output.getvalue(), mexpect) debugout = smtpd.DEBUGSTREAM.getvalue() sender = re.compile("^sender: [email protected]$", re.MULTILINE) self.assertRegex(debugout, sender) for addr in ('John', 'Dinsdale'): to_addr = re.compile(r"^recips: .*'{}'.*$".format(addr), re.MULTILINE) self.assertRegex(debugout, to_addr) def testSendMessageWithSpecifiedAddresses(self): # Make sure addresses specified in call override those in message. m = email.mime.text.MIMEText('A test message') m['From'] = '[email protected]' m['To'] = 'John, Dinsdale' smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.send_message(m, from_addr='[email protected]', to_addrs='[email protected]') # XXX (see comment in testSend) time.sleep(0.01) smtp.quit() self.client_evt.set() self.serv_evt.wait() self.output.flush() # Add the X-Peer header that DebuggingServer adds m['X-Peer'] = socket.gethostbyname('localhost') mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) self.assertEqual(self.output.getvalue(), mexpect) debugout = smtpd.DEBUGSTREAM.getvalue() sender = re.compile("^sender: [email protected]$", re.MULTILINE) self.assertRegex(debugout, sender) for addr in ('John', 'Dinsdale'): to_addr = re.compile(r"^recips: .*'{}'.*$".format(addr), re.MULTILINE) self.assertNotRegex(debugout, to_addr) recip = re.compile(r"^recips: .*'[email protected]'.*$", re.MULTILINE) self.assertRegex(debugout, recip) def testSendMessageWithMultipleFrom(self): # Sender overrides To m = email.mime.text.MIMEText('A test message') m['From'] = 'Bernard, Bianca' m['Sender'] = '[email protected]' m['To'] = 'John, Dinsdale' smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.send_message(m) # XXX (see comment in testSend) time.sleep(0.01) smtp.quit() self.client_evt.set() self.serv_evt.wait() self.output.flush() # Add the X-Peer header that DebuggingServer adds m['X-Peer'] = socket.gethostbyname('localhost') mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) self.assertEqual(self.output.getvalue(), mexpect) debugout = smtpd.DEBUGSTREAM.getvalue() sender = re.compile("^sender: [email protected]$", re.MULTILINE) self.assertRegex(debugout, sender) for addr in ('John', 'Dinsdale'): to_addr = re.compile(r"^recips: .*'{}'.*$".format(addr), re.MULTILINE) self.assertRegex(debugout, to_addr) def testSendMessageResent(self): m = email.mime.text.MIMEText('A test message') m['From'] = '[email protected]' m['To'] = 'John' m['CC'] = 'Sally, Fred' m['Bcc'] = 'John Root <root@localhost>, "Dinsdale" <[email protected]>' m['Resent-Date'] = 'Thu, 1 Jan 1970 17:42:00 +0000' m['Resent-From'] = '[email protected]' m['Resent-To'] = 'Martha <[email protected]>, Jeff' m['Resent-Bcc'] = '[email protected]' smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) smtp.send_message(m) # XXX (see comment in testSend) time.sleep(0.01) smtp.quit() self.client_evt.set() self.serv_evt.wait() self.output.flush() # The Resent-Bcc headers are deleted before serialization. del m['Bcc'] del m['Resent-Bcc'] # Add the X-Peer header that DebuggingServer adds m['X-Peer'] = socket.gethostbyname('localhost') mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) self.assertEqual(self.output.getvalue(), mexpect) debugout = smtpd.DEBUGSTREAM.getvalue() sender = re.compile("^sender: [email protected]$", re.MULTILINE) self.assertRegex(debugout, sender) for addr in ('[email protected]', 'Jeff', '[email protected]'): to_addr = re.compile(r"^recips: .*'{}'.*$".format(addr), re.MULTILINE) self.assertRegex(debugout, to_addr) def testSendMessageMultipleResentRaises(self): m = email.mime.text.MIMEText('A test message') m['From'] = '[email protected]' m['To'] = 'John' m['CC'] = 'Sally, Fred' m['Bcc'] = 'John Root <root@localhost>, "Dinsdale" <[email protected]>' m['Resent-Date'] = 'Thu, 1 Jan 1970 17:42:00 +0000' m['Resent-From'] = '[email protected]' m['Resent-To'] = 'Martha <[email protected]>, Jeff' m['Resent-Bcc'] = '[email protected]' m['Resent-Date'] = 'Thu, 2 Jan 1970 17:42:00 +0000' m['Resent-To'] = '[email protected]' m['Resent-From'] = 'Martha <[email protected]>, Jeff' smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) with self.assertRaises(ValueError): smtp.send_message(m) smtp.close() class NonConnectingTests(unittest.TestCase): def testNotConnected(self): # Test various operations on an unconnected SMTP object that # should raise exceptions (at present the attempt in SMTP.send # to reference the nonexistent 'sock' attribute of the SMTP object # causes an AttributeError) smtp = smtplib.SMTP() self.assertRaises(smtplib.SMTPServerDisconnected, smtp.ehlo) self.assertRaises(smtplib.SMTPServerDisconnected, smtp.send, 'test msg') def testNonnumericPort(self): # check that non-numeric port raises OSError self.assertRaises(OSError, smtplib.SMTP, "localhost", "bogus") self.assertRaises(OSError, smtplib.SMTP, "localhost:bogus") # test response of client to a non-successful HELO message @unittest.skipUnless(threading, 'Threading required for this test.') class BadHELOServerTests(unittest.TestCase): def setUp(self): smtplib.socket = mock_socket mock_socket.reply_with(b"199 no hello for you!") self.old_stdout = sys.stdout self.output = io.StringIO() sys.stdout = self.output self.port = 25 def tearDown(self): smtplib.socket = socket sys.stdout = self.old_stdout def testFailingHELO(self): self.assertRaises(smtplib.SMTPConnectError, smtplib.SMTP, HOST, self.port, 'localhost', 3) @unittest.skipUnless(threading, 'Threading required for this test.') class TooLongLineTests(unittest.TestCase): respdata = b'250 OK' + (b'.' * smtplib._MAXLINE * 2) + b'\n' def setUp(self): self.old_stdout = sys.stdout self.output = io.StringIO() sys.stdout = self.output self.evt = threading.Event() self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.settimeout(15) self.port = support.bind_port(self.sock) servargs = (self.evt, self.respdata, self.sock) threading.Thread(target=server, args=servargs).start() self.evt.wait() self.evt.clear() def tearDown(self): self.evt.wait() sys.stdout = self.old_stdout def testLineTooLong(self): self.assertRaises(smtplib.SMTPResponseException, smtplib.SMTP, HOST, self.port, 'localhost', 3) sim_users = {'[email protected]':'John A', '[email protected]':'Sally B', '[email protected]':'Ruth C', } sim_auth = ('[email protected]', 'somepassword') sim_cram_md5_challenge = ('PENCeUxFREJoU0NnbmhNWitOMjNGNn' 'dAZWx3b29kLmlubm9zb2Z0LmNvbT4=') sim_auth_credentials = { 'login': 'TXIuQUBzb21ld2hlcmUuY29t', 'plain': 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=', 'cram-md5': ('TXIUQUBZB21LD2HLCMUUY29TIDG4OWQ0MJ' 'KWZGQ4ODNMNDA4NTGXMDRLZWMYZJDMODG1'), } sim_auth_login_user = 'TXIUQUBZB21LD2HLCMUUY29T' sim_auth_plain = 'AE1YLKFAC29TZXDOZXJLLMNVBQBZB21LCGFZC3DVCMQ=' sim_lists = {'list-1':['[email protected]','[email protected]'], 'list-2':['[email protected]',], } # Simulated SMTP channel & server class SimSMTPChannel(smtpd.SMTPChannel): quit_response = None mail_response = None rcpt_response = None data_response = None rcpt_count = 0 rset_count = 0 disconnect = 0 def __init__(self, extra_features, *args, **kw): self._extrafeatures = ''.join( [ "250-{0}\r\n".format(x) for x in extra_features ]) super(SimSMTPChannel, self).__init__(*args, **kw) def smtp_EHLO(self, arg): resp = ('250-testhost\r\n' '250-EXPN\r\n' '250-SIZE 20000000\r\n' '250-STARTTLS\r\n' '250-DELIVERBY\r\n') resp = resp + self._extrafeatures + '250 HELP' self.push(resp) self.seen_greeting = arg self.extended_smtp = True def smtp_VRFY(self, arg): # For max compatibility smtplib should be sending the raw address. if arg in sim_users: self.push('250 %s %s' % (sim_users[arg], smtplib.quoteaddr(arg))) else: self.push('550 No such user: %s' % arg) def smtp_EXPN(self, arg): list_name = arg.lower() if list_name in sim_lists: user_list = sim_lists[list_name] for n, user_email in enumerate(user_list): quoted_addr = smtplib.quoteaddr(user_email) if n < len(user_list) - 1: self.push('250-%s %s' % (sim_users[user_email], quoted_addr)) else: self.push('250 %s %s' % (sim_users[user_email], quoted_addr)) else: self.push('550 No access for you!') def smtp_AUTH(self, arg): mech = arg.strip().lower() if mech=='cram-md5': self.push('334 {}'.format(sim_cram_md5_challenge)) elif mech not in sim_auth_credentials: self.push('504 auth type unimplemented') return elif mech=='plain': self.push('334 ') elif mech=='login': self.push('334 ') else: self.push('550 No access for you!') def smtp_QUIT(self, arg): if self.quit_response is None: super(SimSMTPChannel, self).smtp_QUIT(arg) else: self.push(self.quit_response) self.close_when_done() def smtp_MAIL(self, arg): if self.mail_response is None: super().smtp_MAIL(arg) else: self.push(self.mail_response) if self.disconnect: self.close_when_done() def smtp_RCPT(self, arg): if self.rcpt_response is None: super().smtp_RCPT(arg) return self.rcpt_count += 1 self.push(self.rcpt_response[self.rcpt_count-1]) def smtp_RSET(self, arg): self.rset_count += 1 super().smtp_RSET(arg) def smtp_DATA(self, arg): if self.data_response is None: super().smtp_DATA(arg) else: self.push(self.data_response) def handle_error(self): raise class SimSMTPServer(smtpd.SMTPServer): channel_class = SimSMTPChannel def __init__(self, *args, **kw): self._extra_features = [] smtpd.SMTPServer.__init__(self, *args, **kw) def handle_accepted(self, conn, addr): self._SMTPchannel = self.channel_class( self._extra_features, self, conn, addr, decode_data=self._decode_data) def process_message(self, peer, mailfrom, rcpttos, data): pass def add_feature(self, feature): self._extra_features.append(feature) def handle_error(self): raise # Test various SMTP & ESMTP commands/behaviors that require a simulated server # (i.e., something with more features than DebuggingServer) @unittest.skipUnless(threading, 'Threading required for this test.') class SMTPSimTests(unittest.TestCase): def setUp(self): self.real_getfqdn = socket.getfqdn socket.getfqdn = mock_socket.getfqdn self.serv_evt = threading.Event() self.client_evt = threading.Event() # Pick a random unused port by passing 0 for the port number self.serv = SimSMTPServer((HOST, 0), ('nowhere', -1), decode_data=True) # Keep a note of what port was assigned self.port = self.serv.socket.getsockname()[1] serv_args = (self.serv, self.serv_evt, self.client_evt) self.thread = threading.Thread(target=debugging_server, args=serv_args) self.thread.start() # wait until server thread has assigned a port number self.serv_evt.wait() self.serv_evt.clear() def tearDown(self): socket.getfqdn = self.real_getfqdn # indicate that the client is finished self.client_evt.set() # wait for the server thread to terminate self.serv_evt.wait() self.thread.join() def testBasic(self): # smoke test smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) smtp.quit() def testEHLO(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) # no features should be present before the EHLO self.assertEqual(smtp.esmtp_features, {}) # features expected from the test server expected_features = {'expn':'', 'size': '20000000', 'starttls': '', 'deliverby': '', 'help': '', } smtp.ehlo() self.assertEqual(smtp.esmtp_features, expected_features) for k in expected_features: self.assertTrue(smtp.has_extn(k)) self.assertFalse(smtp.has_extn('unsupported-feature')) smtp.quit() def testVRFY(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) for email, name in sim_users.items(): expected_known = (250, bytes('%s %s' % (name, smtplib.quoteaddr(email)), "ascii")) self.assertEqual(smtp.vrfy(email), expected_known) u = '[email protected]' expected_unknown = (550, ('No such user: %s' % u).encode('ascii')) self.assertEqual(smtp.vrfy(u), expected_unknown) smtp.quit() def testEXPN(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) for listname, members in sim_lists.items(): users = [] for m in members: users.append('%s %s' % (sim_users[m], smtplib.quoteaddr(m))) expected_known = (250, bytes('\n'.join(users), "ascii")) self.assertEqual(smtp.expn(listname), expected_known) u = 'PSU-Members-List' expected_unknown = (550, b'No access for you!') self.assertEqual(smtp.expn(u), expected_unknown) smtp.quit() # SimSMTPChannel doesn't fully support AUTH because it requires a # synchronous read to obtain the credentials...so instead smtpd # sees the credential sent by smtplib's login method as an unknown command, # which results in smtplib raising an auth error. Fortunately the error # message contains the encoded credential, so we can partially check that it # was generated correctly (partially, because the 'word' is uppercased in # the error message). def testAUTH_PLAIN(self): self.serv.add_feature("AUTH PLAIN") smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: self.assertIn(sim_auth_plain, str(err)) smtp.close() def testAUTH_LOGIN(self): self.serv.add_feature("AUTH LOGIN") smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: self.assertIn(sim_auth_login_user, str(err)) smtp.close() def testAUTH_CRAM_MD5(self): self.serv.add_feature("AUTH CRAM-MD5") smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: self.assertIn(sim_auth_credentials['cram-md5'], str(err)) smtp.close() def testAUTH_multiple(self): # Test that multiple authentication methods are tried. self.serv.add_feature("AUTH BOGUS PLAIN LOGIN CRAM-MD5") smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: self.assertIn(sim_auth_login_user, str(err)) smtp.close() def test_auth_function(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH CRAM-MD5") smtp.user, smtp.password = sim_auth[0], sim_auth[1] supported = {'CRAM-MD5': smtp.auth_cram_md5, 'PLAIN': smtp.auth_plain, 'LOGIN': smtp.auth_login, } for mechanism, method in supported.items(): try: smtp.auth(mechanism, method) except smtplib.SMTPAuthenticationError as err: self.assertIn(sim_auth_credentials[mechanism.lower()].upper(), str(err)) smtp.close() def test_quit_resets_greeting(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) code, message = smtp.ehlo() self.assertEqual(code, 250) self.assertIn('size', smtp.esmtp_features) smtp.quit() self.assertNotIn('size', smtp.esmtp_features) smtp.connect(HOST, self.port) self.assertNotIn('size', smtp.esmtp_features) smtp.ehlo_or_helo_if_needed() self.assertIn('size', smtp.esmtp_features) smtp.quit() def test_with_statement(self): with smtplib.SMTP(HOST, self.port) as smtp: code, message = smtp.noop() self.assertEqual(code, 250) self.assertRaises(smtplib.SMTPServerDisconnected, smtp.send, b'foo') with smtplib.SMTP(HOST, self.port) as smtp: smtp.close() self.assertRaises(smtplib.SMTPServerDisconnected, smtp.send, b'foo') def test_with_statement_QUIT_failure(self): with self.assertRaises(smtplib.SMTPResponseException) as error: with smtplib.SMTP(HOST, self.port) as smtp: smtp.noop() self.serv._SMTPchannel.quit_response = '421 QUIT FAILED' self.assertEqual(error.exception.smtp_code, 421) self.assertEqual(error.exception.smtp_error, b'QUIT FAILED') #TODO: add tests for correct AUTH method fallback now that the #test infrastructure can support it. # Issue 17498: make sure _rset does not raise SMTPServerDisconnected exception def test__rest_from_mail_cmd(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) smtp.noop() self.serv._SMTPchannel.mail_response = '451 Requested action aborted' self.serv._SMTPchannel.disconnect = True with self.assertRaises(smtplib.SMTPSenderRefused): smtp.sendmail('John', 'Sally', 'test message') self.assertIsNone(smtp.sock) # Issue 5713: make sure close, not rset, is called if we get a 421 error def test_421_from_mail_cmd(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) smtp.noop() self.serv._SMTPchannel.mail_response = '421 closing connection' with self.assertRaises(smtplib.SMTPSenderRefused): smtp.sendmail('John', 'Sally', 'test message') self.assertIsNone(smtp.sock) self.assertEqual(self.serv._SMTPchannel.rset_count, 0) def test_421_from_rcpt_cmd(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) smtp.noop() self.serv._SMTPchannel.rcpt_response = ['250 accepted', '421 closing'] with self.assertRaises(smtplib.SMTPRecipientsRefused) as r: smtp.sendmail('John', ['Sally', 'Frank', 'George'], 'test message') self.assertIsNone(smtp.sock) self.assertEqual(self.serv._SMTPchannel.rset_count, 0) self.assertDictEqual(r.exception.args[0], {'Frank': (421, b'closing')}) def test_421_from_data_cmd(self): class MySimSMTPChannel(SimSMTPChannel): def found_terminator(self): if self.smtp_state == self.DATA: self.push('421 closing') else: super().found_terminator() self.serv.channel_class = MySimSMTPChannel smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) smtp.noop() with self.assertRaises(smtplib.SMTPDataError): smtp.sendmail('[email protected]', ['[email protected]'], 'test message') self.assertIsNone(smtp.sock) self.assertEqual(self.serv._SMTPchannel.rcpt_count, 0) def test_smtputf8_NotSupportedError_if_no_server_support(self): smtp = smtplib.SMTP( HOST, self.port, local_hostname='localhost', timeout=3) self.addCleanup(smtp.close) smtp.ehlo() self.assertTrue(smtp.does_esmtp) self.assertFalse(smtp.has_extn('smtputf8')) self.assertRaises( smtplib.SMTPNotSupportedError, smtp.sendmail, 'John', 'Sally', '', mail_options=['BODY=8BITMIME', 'SMTPUTF8']) self.assertRaises( smtplib.SMTPNotSupportedError, smtp.mail, 'John', options=['BODY=8BITMIME', 'SMTPUTF8']) def test_send_unicode_without_SMTPUTF8(self): smtp = smtplib.SMTP( HOST, self.port, local_hostname='localhost', timeout=3) self.addCleanup(smtp.close) self.assertRaises(UnicodeEncodeError, smtp.sendmail, 'Alice', 'Böb', '') self.assertRaises(UnicodeEncodeError, smtp.mail, 'Älice') class SimSMTPUTF8Server(SimSMTPServer): def __init__(self, *args, **kw): # The base SMTP server turns these on automatically, but our test # server is set up to munge the EHLO response, so we need to provide # them as well. And yes, the call is to SMTPServer not SimSMTPServer. self._extra_features = ['SMTPUTF8', '8BITMIME'] smtpd.SMTPServer.__init__(self, *args, **kw) def handle_accepted(self, conn, addr): self._SMTPchannel = self.channel_class( self._extra_features, self, conn, addr, decode_data=self._decode_data, enable_SMTPUTF8=self.enable_SMTPUTF8, ) def process_message(self, peer, mailfrom, rcpttos, data, mail_options=None, rcpt_options=None): self.last_peer = peer self.last_mailfrom = mailfrom self.last_rcpttos = rcpttos self.last_message = data self.last_mail_options = mail_options self.last_rcpt_options = rcpt_options @unittest.skipUnless(threading, 'Threading required for this test.') class SMTPUTF8SimTests(unittest.TestCase): maxDiff = None def setUp(self): self.real_getfqdn = socket.getfqdn socket.getfqdn = mock_socket.getfqdn self.serv_evt = threading.Event() self.client_evt = threading.Event() # Pick a random unused port by passing 0 for the port number self.serv = SimSMTPUTF8Server((HOST, 0), ('nowhere', -1), decode_data=False, enable_SMTPUTF8=True) # Keep a note of what port was assigned self.port = self.serv.socket.getsockname()[1] serv_args = (self.serv, self.serv_evt, self.client_evt) self.thread = threading.Thread(target=debugging_server, args=serv_args) self.thread.start() # wait until server thread has assigned a port number self.serv_evt.wait() self.serv_evt.clear() def tearDown(self): socket.getfqdn = self.real_getfqdn # indicate that the client is finished self.client_evt.set() # wait for the server thread to terminate self.serv_evt.wait() self.thread.join() def test_test_server_supports_extensions(self): smtp = smtplib.SMTP( HOST, self.port, local_hostname='localhost', timeout=3) self.addCleanup(smtp.close) smtp.ehlo() self.assertTrue(smtp.does_esmtp) self.assertTrue(smtp.has_extn('smtputf8')) def test_send_unicode_with_SMTPUTF8_via_sendmail(self): m = '¡a test message containing unicode!'.encode('utf-8') smtp = smtplib.SMTP( HOST, self.port, local_hostname='localhost', timeout=3) self.addCleanup(smtp.close) smtp.sendmail('Jőhn', 'Sálly', m, mail_options=['BODY=8BITMIME', 'SMTPUTF8']) self.assertEqual(self.serv.last_mailfrom, 'Jőhn') self.assertEqual(self.serv.last_rcpttos, ['Sálly']) self.assertEqual(self.serv.last_message, m) self.assertIn('BODY=8BITMIME', self.serv.last_mail_options) self.assertIn('SMTPUTF8', self.serv.last_mail_options) self.assertEqual(self.serv.last_rcpt_options, []) def test_send_unicode_with_SMTPUTF8_via_low_level_API(self): m = '¡a test message containing unicode!'.encode('utf-8') smtp = smtplib.SMTP( HOST, self.port, local_hostname='localhost', timeout=3) self.addCleanup(smtp.close) smtp.ehlo() self.assertEqual( smtp.mail('Jő', options=['BODY=8BITMIME', 'SMTPUTF8']), (250, b'OK')) self.assertEqual(smtp.rcpt('János'), (250, b'OK')) self.assertEqual(smtp.data(m), (250, b'OK')) self.assertEqual(self.serv.last_mailfrom, 'Jő') self.assertEqual(self.serv.last_rcpttos, ['János']) self.assertEqual(self.serv.last_message, m) self.assertIn('BODY=8BITMIME', self.serv.last_mail_options) self.assertIn('SMTPUTF8', self.serv.last_mail_options) self.assertEqual(self.serv.last_rcpt_options, []) def test_send_message_uses_smtputf8_if_addrs_non_ascii(self): msg = EmailMessage() msg['From'] = "Páolo <fő[email protected]>" msg['To'] = 'Dinsdale' msg['Subject'] = 'Nudge nudge, wink, wink \u1F609' # XXX I don't know why I need two \n's here, but this is an existing # bug (if it is one) and not a problem with the new functionality. msg.set_content("oh là là, know what I mean, know what I mean?\n\n") # XXX smtpd converts received /r/n to /n, so we can't easily test that # we are successfully sending /r/n :(. expected = textwrap.dedent("""\ From: Páolo <fő[email protected]> To: Dinsdale Subject: Nudge nudge, wink, wink \u1F609 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit MIME-Version: 1.0 oh là là, know what I mean, know what I mean? """) smtp = smtplib.SMTP( HOST, self.port, local_hostname='localhost', timeout=3) self.addCleanup(smtp.close) self.assertEqual(smtp.send_message(msg), {}) self.assertEqual(self.serv.last_mailfrom, 'fő[email protected]') self.assertEqual(self.serv.last_rcpttos, ['Dinsdale']) self.assertEqual(self.serv.last_message.decode(), expected) self.assertIn('BODY=8BITMIME', self.serv.last_mail_options) self.assertIn('SMTPUTF8', self.serv.last_mail_options) self.assertEqual(self.serv.last_rcpt_options, []) def test_send_message_error_on_non_ascii_addrs_if_no_smtputf8(self): msg = EmailMessage() msg['From'] = "Páolo <fő[email protected]>" msg['To'] = 'Dinsdale' msg['Subject'] = 'Nudge nudge, wink, wink \u1F609' smtp = smtplib.SMTP( HOST, self.port, local_hostname='localhost', timeout=3) self.addCleanup(smtp.close) self.assertRaises(smtplib.SMTPNotSupportedError, smtp.send_message(msg)) @support.reap_threads def test_main(verbose=None): support.run_unittest(GeneralTests, DebuggingServerTests, NonConnectingTests, BadHELOServerTests, SMTPSimTests, TooLongLineTests) if __name__ == '__main__': test_main()
{ "content_hash": "3bdfaa884a94399abbfbe3353024adc4", "timestamp": "", "source": "github", "line_count": 1153, "max_line_length": 90, "avg_line_length": 38.67823070251518, "alnum_prop": 0.5977666158399857, "repo_name": "munyirik/python", "id": "e66ae9be51c044e8124c49628627f057fb83bac3", "size": "44619", "binary": false, "copies": "3", "ref": "refs/heads/develop", "path": "cpython/Lib/test/test_smtplib.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "470920" }, { "name": "Batchfile", "bytes": "35551" }, { "name": "C", "bytes": "17872871" }, { "name": "C#", "bytes": "1231" }, { "name": "C++", "bytes": "356072" }, { "name": "CSS", "bytes": "2839" }, { "name": "Common Lisp", "bytes": "24481" }, { "name": "DIGITAL Command Language", "bytes": "26402" }, { "name": "Groff", "bytes": "254942" }, { "name": "HTML", "bytes": "130698" }, { "name": "JavaScript", "bytes": "10616" }, { "name": "Makefile", "bytes": "25026" }, { "name": "Objective-C", "bytes": "33182" }, { "name": "PLSQL", "bytes": "22886" }, { "name": "PostScript", "bytes": "13803" }, { "name": "PowerShell", "bytes": "1420" }, { "name": "Prolog", "bytes": "557" }, { "name": "Python", "bytes": "24911704" }, { "name": "R", "bytes": "5378" }, { "name": "Shell", "bytes": "437386" }, { "name": "TeX", "bytes": "323102" }, { "name": "Visual Basic", "bytes": "481" } ], "symlink_target": "" }
title: aik27 type: products image: /img/Screen Shot 2017-05-09 at 11.56.54 AM.png heading: k27 description: lksadjf lkasdjf lksajdf lksdaj flksadj flksa fdj main: heading: Foo Bar BAz description: |- ***This is i a thing***kjh hjk kj # Blah Blah ## Blah![undefined](undefined) ### Baah image1: alt: kkkk ---
{ "content_hash": "4ad0fe81af8bc23161a8a686a49eda51", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 61, "avg_line_length": 22.333333333333332, "alnum_prop": 0.6656716417910448, "repo_name": "pblack/kaldi-hugo-cms-template", "id": "f94170de93098eb6aea762e25e63cad930048872", "size": "339", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "site/content/pages2/aik27.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "94394" }, { "name": "HTML", "bytes": "18889" }, { "name": "JavaScript", "bytes": "10014" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="800" android:fillAfter="true" android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:repeatCount="-1" android:toDegrees="360" > </rotate>
{ "content_hash": "9f125c32d42086f79391f0cfa4819b3f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 66, "avg_line_length": 28.09090909090909, "alnum_prop": 0.6699029126213593, "repo_name": "jeasinlee/AndroidBasicLibs", "id": "0f6335a03b93493a5b0cba41759f863e4bc7374a", "size": "309", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "uihelper/src/main/res/anim/rotating_anim.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "773639" } ], "symlink_target": "" }
/*! * \file container.h * \brief Common POD(plain old data) container types. */ // Acknowledgement: This file originates from incubator-tvm #ifndef MXNET_RUNTIME_CONTAINER_H_ #define MXNET_RUNTIME_CONTAINER_H_ #include <dmlc/logging.h> #include <mxnet/runtime/memory.h> #include <mxnet/runtime/object.h> #include <initializer_list> #include <type_traits> #include <utility> #include <vector> namespace mxnet { namespace runtime { class ADTBuilder; /*! * \brief Base template for classes with array like memory layout. * * It provides general methods to access the memory. The memory * layout is ArrayType + [ElemType]. The alignment of ArrayType * and ElemType is handled by the memory allocator. * * \tparam ArrayType The array header type, contains object specific metadata. * \tparam ElemType The type of objects stored in the array right after * ArrayType. * * \code * // Example usage of the template to define a simple array wrapper * class ArrayObj : public InplaceArrayBase<ArrayObj, Elem> { * public: * // Wrap EmplaceInit to initialize the elements * template <typename Iterator> * void Init(Iterator begin, Iterator end) { * size_t num_elems = std::distance(begin, end); * auto it = begin; * this->size = 0; * for (size_t i = 0; i < num_elems; ++i) { * InplaceArrayBase::EmplaceInit(i, *it++); * this->size++; * } * } * } * * void test_function() { * vector<Elem> fields; * auto ptr = make_inplace_array_object<ArrayObj, Elem>(fields.size()); * ptr->Init(fields.begin(), fields.end()); * * // Access the 0th element in the array. * assert(ptr->operator[](0) == fields[0]); * } * * \endcode */ template <typename ArrayType, typename ElemType> class InplaceArrayBase { public: /*! * \brief Access element at index * \param idx The index of the element. * \return Const reference to ElemType at the index. */ const ElemType& operator[](size_t idx) const { size_t size = Self()->GetSize(); CHECK_LT(idx, size) << "Index " << idx << " out of bounds " << size << "\n"; return *(reinterpret_cast<ElemType*>(AddressOf(idx))); } /*! * \brief Access element at index * \param idx The index of the element. * \return Reference to ElemType at the index. */ ElemType& operator[](size_t idx) { size_t size = Self()->GetSize(); CHECK_LT(idx, size) << "Index " << idx << " out of bounds " << size << "\n"; return *(reinterpret_cast<ElemType*>(AddressOf(idx))); } /*! * \brief Destroy the Inplace Array Base object */ ~InplaceArrayBase() { if (!(std::is_standard_layout<ElemType>::value && std::is_trivial<ElemType>::value)) { size_t size = Self()->GetSize(); for (size_t i = 0; i < size; ++i) { ElemType* fp = reinterpret_cast<ElemType*>(AddressOf(i)); fp->ElemType::~ElemType(); } } } protected: friend class ADTBuilder; /*! * \brief Construct a value in place with the arguments. * * \tparam Args Type parameters of the arguments. * \param idx Index of the element. * \param args Arguments to construct the new value. * * \note Please make sure ArrayType::GetSize returns 0 before first call of * EmplaceInit, and increment GetSize by 1 each time EmplaceInit succeeds. */ template <typename... Args> void EmplaceInit(size_t idx, Args&&... args) { void* field_ptr = AddressOf(idx); new (field_ptr) ElemType(std::forward<Args>(args)...); } private: /*! * \brief Return the self object for the array. * * \return Pointer to ArrayType. */ inline ArrayType* Self() const { return static_cast<ArrayType*>(const_cast<InplaceArrayBase*>(this)); } /*! * \brief Return the raw pointer to the element at idx. * * \param idx The index of the element. * \return Raw pointer to the element. */ void* AddressOf(size_t idx) const { static_assert(alignof(ArrayType) % alignof(ElemType) == 0 && sizeof(ArrayType) % alignof(ElemType) == 0, "The size and alignment of ArrayType should respect " "ElemType's alignment."); size_t kDataStart = sizeof(ArrayType); ArrayType* self = Self(); char* data_start = reinterpret_cast<char*>(self) + kDataStart; return data_start + idx * sizeof(ElemType); } }; /*! \brief An object representing a structure or enumeration. */ class ADTObj : public Object, public InplaceArrayBase<ADTObj, ObjectRef> { public: /*! \brief The tag representing the constructor used. */ uint32_t tag; /*! \brief Number of fields in the ADT object. */ uint32_t size{0}; // The fields of the structure follows directly in memory. static constexpr const char* _type_key = "MXNet.ADT"; static constexpr const uint32_t _type_index = TypeIndex::kMXNetADT; MXNET_DECLARE_FINAL_OBJECT_INFO(ADTObj, Object) private: /*! * \return The number of elements in the array. */ size_t GetSize() const { return size; } /*! * \brief Initialize the elements in the array. * * \tparam Iterator Iterator type of the array. * \param begin The begin iterator. * \param end The end iterator. */ template <typename Iterator> void Init(Iterator begin, Iterator end) { size_t num_elems = std::distance(begin, end); this->size = 0; auto it = begin; for (size_t i = 0; i < num_elems; ++i) { InplaceArrayBase::EmplaceInit(i, *it++); // Only increment size after the initialization succeeds this->size++; } } friend class ADT; friend InplaceArrayBase<ADTObj, ObjectRef>; }; /*! \brief reference to algebraic data type objects. */ class ADT : public ObjectRef { public: /*! * \brief construct an ADT object reference. * \param tag The tag of the ADT object. * \param fields The fields of the ADT object. * \return The constructed ADT object reference. */ ADT(uint32_t tag, std::vector<ObjectRef> fields) : ADT(tag, fields.begin(), fields.end()){}; /*! * \brief construct an ADT object reference. * \param tag The tag of the ADT object. * \param begin The begin iterator to the start of the fields array. * \param end The end iterator to the end of the fields array. * \return The constructed ADT object reference. */ template <typename Iterator> ADT(uint32_t tag, Iterator begin, Iterator end) { size_t num_elems = std::distance(begin, end); auto ptr = make_inplace_array_object<ADTObj, ObjectRef>(num_elems); ptr->tag = tag; ptr->Init(begin, end); data_ = std::move(ptr); } /*! * \brief construct an ADT object reference. * \param tag The tag of the ADT object. * \param init The initializer list of fields. * \return The constructed ADT object reference. */ ADT(uint32_t tag, std::initializer_list<ObjectRef> init) : ADT(tag, init.begin(), init.end()){}; /*! * \brief Access element at index. * * \param idx The array index * \return const ObjectRef */ const ObjectRef& operator[](size_t idx) const { return operator->()->operator[](idx); } /*! * \brief Return the ADT tag. */ size_t tag() const { return operator->()->tag; } /*! * \brief Return the number of fields. */ size_t size() const { return operator->()->size; } /*! * \brief Construct a tuple object. * * \tparam Args Type params of tuple feilds. * \param args Tuple fields. * \return ADT The tuple object reference. */ template <typename... Args> static ADT Tuple(Args&&... args) { return ADT(0, std::forward<Args>(args)...); } MXNET_DEFINE_OBJECT_REF_METHODS(ADT, ObjectRef, ADTObj) }; } // namespace runtime } // namespace mxnet #endif // MXNET_RUNTIME_CONTAINER_H_
{ "content_hash": "efa455b8d28c2f728a98e329346a281b", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 80, "avg_line_length": 29.347169811320754, "alnum_prop": 0.6429214350006429, "repo_name": "sxjscience/mxnet", "id": "fc1d4a173669210d1c7bc73cd3e45187efa9ce67", "size": "8584", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "include/mxnet/runtime/container.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "1731" }, { "name": "Batchfile", "bytes": "13130" }, { "name": "C", "bytes": "233076" }, { "name": "C++", "bytes": "9825123" }, { "name": "CMake", "bytes": "164182" }, { "name": "Clojure", "bytes": "622640" }, { "name": "Cuda", "bytes": "1342259" }, { "name": "Dockerfile", "bytes": "100733" }, { "name": "Groovy", "bytes": "167263" }, { "name": "HTML", "bytes": "40268" }, { "name": "Java", "bytes": "202775" }, { "name": "Julia", "bytes": "445413" }, { "name": "Jupyter Notebook", "bytes": "3660357" }, { "name": "MATLAB", "bytes": "36633" }, { "name": "Makefile", "bytes": "149220" }, { "name": "Perl", "bytes": "1558293" }, { "name": "PowerShell", "bytes": "9244" }, { "name": "Python", "bytes": "9890105" }, { "name": "R", "bytes": "357982" }, { "name": "Raku", "bytes": "9012" }, { "name": "SWIG", "bytes": "161870" }, { "name": "Scala", "bytes": "1304635" }, { "name": "Shell", "bytes": "464521" }, { "name": "Smalltalk", "bytes": "3497" } ], "symlink_target": "" }
<?php namespace phpDocumentor; use Cilex\Application as Cilex; use Cilex\Provider\JmsSerializerServiceProvider; use Cilex\Provider\MonologServiceProvider; use Cilex\Provider\ValidatorServiceProvider; use Composer\Autoload\ClassLoader; use Monolog\ErrorHandler; use Monolog\Handler\NullHandler; use Monolog\Handler\StreamHandler; use Monolog\Logger; use phpDocumentor\Command\Helper\ConfigurationHelper; use phpDocumentor\Command\Helper\LoggerHelper; use phpDocumentor\Console\Input\ArgvInput; use phpDocumentor\Plugin\Core\Descriptor\Validator\DefaultValidators; use Symfony\Component\Console\Application as ConsoleApplication; use Symfony\Component\Console\Shell; use Symfony\Component\Stopwatch\Stopwatch; /** * Application class for phpDocumentor. * * Can be used as bootstrap when the run method is not invoked. */ class Application extends Cilex { /** @var string $VERSION represents the version of phpDocumentor as stored in /VERSION */ public static $VERSION; /** * Initializes all components used by phpDocumentor. * * @param ClassLoader $autoloader * @param array $values */ public function __construct($autoloader = null, array $values = array()) { gc_disable(); $this->defineIniSettings(); self::$VERSION = strpos('@package_version@', '@') === 0 ? trim(file_get_contents(__DIR__ . '/../../VERSION')) : '@package_version@'; parent::__construct('phpDocumentor', self::$VERSION, $values); $this['kernel.timer.start'] = time(); $this['kernel.stopwatch'] = function () { return new Stopwatch(); }; $this['autoloader'] = $autoloader; $this->register(new JmsSerializerServiceProvider()); $this->register(new Configuration\ServiceProvider()); $this->addEventDispatcher(); $this->addLogging(); $this->register(new ValidatorServiceProvider()); $this->register(new Translator\ServiceProvider()); $this->register(new Descriptor\ServiceProvider()); $this->register(new Parser\ServiceProvider()); $this->register(new Partials\ServiceProvider()); $this->register(new Transformer\ServiceProvider()); $this->register(new Plugin\ServiceProvider()); $this['descriptor.builder.initializers']->addInitializer( new DefaultValidators($this['descriptor.analyzer']->getValidator()) ); $this['descriptor.builder.initializers']->initialize($this['descriptor.analyzer']); $this->addCommandsForProjectNamespace(); if (\Phar::running()) { $this->addCommandsForPharNamespace(); } } /** * Removes all logging handlers and replaces them with handlers that can write to the given logPath and level. * * @param Logger $logger The logger instance that needs to be configured. * @param integer $level The minimum level that will be written to the normal logfile; matches one of the * constants in {@see \Monolog\Logger}. * @param string $logPath The full path where the normal log file needs to be written. * * @return void */ public function configureLogger($logger, $level, $logPath = null) { /** @var Logger $monolog */ $monolog = $logger; switch ($level) { case 'emergency': case 'emerg': $level = Logger::EMERGENCY; break; case 'alert': $level = Logger::ALERT; break; case 'critical': case 'crit': $level = Logger::CRITICAL; break; case 'error': case 'err': $level = Logger::ERROR; break; case 'warning': case 'warn': $level = Logger::WARNING; break; case 'notice': $level = Logger::NOTICE; break; case 'info': $level = Logger::INFO; break; case 'debug': $level = Logger::DEBUG; break; } $this['monolog.level'] = $level; if ($logPath) { $logPath = str_replace( array('{APP_ROOT}', '{DATE}'), array(realpath(__DIR__.'/../..'), $this['kernel.timer.start']), $logPath ); $this['monolog.logfile'] = $logPath; } // remove all handlers from the stack try { while ($monolog->popHandler()) { } } catch (\LogicException $e) { // popHandler throws an exception when you try to pop the empty stack; to us this is not an // error but an indication that the handler stack is empty. } if ($level === 'quiet') { $monolog->pushHandler(new NullHandler()); return; } // set our new handlers if ($logPath) { $monolog->pushHandler(new StreamHandler($logPath, $level)); } else { $monolog->pushHandler(new StreamHandler('php://stdout', $level)); } } /** * Run the application and if no command is provided, use project:run. * * @param bool $interactive Whether to run in interactive mode. * * @return void */ public function run($interactive = false) { /** @var ConsoleApplication $app */ $app = $this['console']; $app->setAutoExit(false); if ($interactive) { $app = new Shell($app); } $output = new Console\Output\Output(); $output->setLogger($this['monolog']); $app->run(new ArgvInput(), $output); } /** * Adjust php.ini settings. * * @return void */ protected function defineIniSettings() { $this->setTimezone(); ini_set('memory_limit', -1); // this code cannot be tested because we cannot control the system settings in unit tests // @codeCoverageIgnoreStart if (extension_loaded('Zend OPcache') && ini_get('opcache.enable') && ini_get('opcache.enable_cli')) { if (ini_get('opcache.save_comments')) { ini_set('opcache.load_comments', 1); } else { ini_set('opcache.enable', 0); } } if (extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.save_comments') == 0) { throw new \RuntimeException('Please enable zend_optimizerplus.save_comments in php.ini.'); } // @codeCoverageIgnoreEnd } /** * If the timezone is not set anywhere, set it to UTC. * * This is done to prevent any warnings being outputted in relation to using * date/time functions. What is checked is php.ini, and if the PHP version * is prior to 5.4, the TZ environment variable. * * @link http://php.net/manual/en/function.date-default-timezone-get.php for more information how PHP determines the * default timezone. * * @codeCoverageIgnore this method is very hard, if not impossible, to unit test and not critical. * * @return void */ protected function setTimezone() { if (false === ini_get('date.timezone') || (version_compare(phpversion(), '5.4.0', '<') && false === getenv('TZ')) ) { date_default_timezone_set('UTC'); } } /** * Adds a logging provider to the container of phpDocumentor. * * @return void */ protected function addLogging() { $this->register( new MonologServiceProvider(), array( 'monolog.name' => 'phpDocumentor', 'monolog.logfile' => sys_get_temp_dir() . '/phpdoc.log', 'monolog.debugfile' => sys_get_temp_dir() . '/phpdoc.debug.log', 'monolog.level' => Logger::INFO, ) ); $app = $this; /** @var Configuration $configuration */ $configuration = $this['config']; $this['monolog.configure'] = $this->protect( function ($log) use ($app, $configuration) { $paths = $configuration->getLogging()->getPaths(); $logLevel = $configuration->getLogging()->getLevel(); $app->configureLogger($log, $logLevel, $paths['default'], $paths['errors']); } ); $this->extend( 'console', function (ConsoleApplication $console) use ($configuration) { $console->getHelperSet()->set(new LoggerHelper()); $console->getHelperSet()->set(new ConfigurationHelper($configuration)); return $console; } ); ErrorHandler::register($this['monolog']); } /** * Adds the event dispatcher to phpDocumentor's container. * * @return void */ protected function addEventDispatcher() { $this['event_dispatcher'] = $this->share( function () { return Event\Dispatcher::getInstance(); } ); } /** * Adds the command to phpDocumentor that belong to the Project namespace. * * @return void */ protected function addCommandsForProjectNamespace() { $this->command(new Command\Project\RunCommand()); } /** * Adds the command to phpDocumentor that belong to the Phar namespace. * * @return void */ protected function addCommandsForPharNamespace() { $this->command(new Command\Phar\UpdateCommand()); } }
{ "content_hash": "e7324de1ad03ed2c88db660428b42b84", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 120, "avg_line_length": 31.750809061488674, "alnum_prop": 0.5614106615023953, "repo_name": "PatidarWeb/phpDocumentor2", "id": "8f34d8cc18eabf990559f860e9adfc80e355c433", "size": "10034", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/phpDocumentor/Application.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "27975" }, { "name": "JavaScript", "bytes": "8222" }, { "name": "Makefile", "bytes": "4917" }, { "name": "PHP", "bytes": "1024009" }, { "name": "Python", "bytes": "10284" }, { "name": "Shell", "bytes": "1193" } ], "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 (1.8.0_91) on Mon Jun 20 22:26:32 PDT 2016 --> <title> Class Hierarchy</title> <meta name="date" content="2016-06-20"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title=" Class Hierarchy"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Tree</li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-all.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?package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All&nbsp;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 class="title">Hierarchy For Package &lt;Unnamed&gt;</h1> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a> <ul> <li type="circle"><a href="Main.html" title="class in &lt;Unnamed&gt;"><span class="typeNameLink">Main</span></a></li> <li type="circle"><a href="Rational.html" title="class in &lt;Unnamed&gt;"><span class="typeNameLink">Rational</span></a></li> <li type="circle"><a href="RationalTest.html" title="class in &lt;Unnamed&gt;"><span class="typeNameLink">RationalTest</span></a></li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Tree</li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-all.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?package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All&nbsp;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": "f2c2740a7e9736111dccc4f702499a97", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 202, "avg_line_length": 31.404580152671755, "alnum_prop": 0.6351482741857073, "repo_name": "UCSB-CS56-M16/cs56-rational-example", "id": "4db3f914b5f255b27238693c4fc4ac31739578a6", "size": "4114", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ex07/javadoc/package-tree.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "598" }, { "name": "Java", "bytes": "24827" } ], "symlink_target": "" }
.example-button-row { display: flex; align-items: center; justify-content: space-around; }
{ "content_hash": "c9e98167a8d32c0385a408ef81b09615", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 32, "avg_line_length": 19.4, "alnum_prop": 0.7010309278350515, "repo_name": "mcl-de/material2", "id": "9771bda678bfe2074fabf21650c3a3feab8b2995", "size": "97", "binary": false, "copies": "16", "ref": "refs/heads/master", "path": "src/material-examples/button-types/button-types-example.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "234890" }, { "name": "HTML", "bytes": "241132" }, { "name": "JavaScript", "bytes": "18446" }, { "name": "Shell", "bytes": "24406" }, { "name": "TypeScript", "bytes": "2234864" } ], "symlink_target": "" }
package org.killbill.billing.entitlement; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.apache.shiro.SecurityUtils; import org.apache.shiro.config.Ini; import org.apache.shiro.config.IniSecurityManagerFactory; import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.util.Factory; import org.apache.shiro.util.ThreadContext; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.killbill.billing.GuicyKillbillTestSuiteWithEmbeddedDB; import org.killbill.billing.account.api.Account; import org.killbill.billing.account.api.AccountApiException; import org.killbill.billing.account.api.AccountData; import org.killbill.billing.account.api.AccountInternalApi; import org.killbill.billing.account.api.AccountUserApi; import org.killbill.billing.api.TestApiListener; import org.killbill.billing.callcontext.InternalCallContext; import org.killbill.billing.catalog.DefaultCatalogService; import org.killbill.billing.catalog.api.CatalogService; import org.killbill.billing.catalog.api.Currency; import org.killbill.billing.catalog.api.StaticCatalog; import org.killbill.billing.catalog.api.VersionedCatalog; import org.killbill.billing.entitlement.api.EntitlementApi; import org.killbill.billing.entitlement.api.SubscriptionApi; import org.killbill.billing.entitlement.dao.BlockingStateDao; import org.killbill.billing.entitlement.engine.core.EntitlementUtils; import org.killbill.billing.entitlement.engine.core.EventsStreamBuilder; import org.killbill.billing.entitlement.glue.TestEntitlementModuleWithEmbeddedDB; import org.killbill.billing.junction.BlockingInternalApi; import org.killbill.billing.lifecycle.api.BusService; import org.killbill.billing.mock.MockAccountBuilder; import org.killbill.billing.platform.api.KillbillConfigSource; import org.killbill.billing.security.Permission; import org.killbill.billing.security.api.SecurityApi; import org.killbill.billing.subscription.api.SubscriptionBaseInternalApi; import org.killbill.billing.subscription.api.SubscriptionBaseService; import org.killbill.billing.subscription.api.user.SubscriptionBaseApiException; import org.killbill.billing.subscription.engine.core.DefaultSubscriptionBaseService; import org.killbill.billing.tag.TagInternalApi; import org.killbill.billing.util.api.AuditUserApi; import org.killbill.billing.util.callcontext.InternalCallContextFactory; import org.killbill.billing.util.dao.NonEntityDao; import org.killbill.billing.util.tag.dao.TagDao; import org.killbill.bus.api.PersistentBus; import org.killbill.clock.ClockMock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.inject.Guice; import com.google.inject.Inject; import com.google.inject.Injector; import com.google.inject.Stage; import static org.testng.Assert.assertNotNull; public class EntitlementTestSuiteWithEmbeddedDB extends GuicyKillbillTestSuiteWithEmbeddedDB { protected static final Logger log = LoggerFactory.getLogger(EntitlementTestSuiteWithEmbeddedDB.class); @Inject protected AccountUserApi accountApi; @Inject protected AccountInternalApi accountInternalApi; @Inject protected BlockingInternalApi blockingInternalApi; @Inject protected EntitlementApi entitlementApi; @Inject protected SubscriptionApi subscriptionApi; @Inject protected BlockingStateDao blockingStateDao; @Inject protected CatalogService catalogService; @Inject protected SubscriptionBaseInternalApi subscriptionInternalApi; @Inject protected PersistentBus bus; @Inject protected TagDao tagDao; @Inject protected TagInternalApi tagInternalApi; @Inject protected TestApiListener testListener; @Inject protected BusService busService; @Inject protected SubscriptionBaseService subscriptionBaseService; @Inject protected EntitlementService entitlementService; @Inject protected EntitlementUtils entitlementUtils; @Inject protected EventsStreamBuilder eventsStreamBuilder; @Inject protected AuditUserApi auditUserApi; @Inject protected InternalCallContextFactory internalCallContextFactory; @Inject protected SecurityApi securityApi; @Inject protected NonEntityDao nonEntityDao; protected VersionedCatalog catalog; @Override protected KillbillConfigSource getConfigSource(final Map<String, String> extraProperties) { final Map<String, String> allExtraProperties = new HashMap<String, String>(extraProperties); allExtraProperties.put("org.killbill.catalog.uri", "org/killbill/billing/catalog/catalogTest.xml"); return getConfigSource(null, allExtraProperties); } @BeforeClass(groups = "slow") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(Stage.PRODUCTION, new TestEntitlementModuleWithEmbeddedDB(configSource, clock)); injector.injectMembers(this); } @BeforeMethod(groups = "slow") public void beforeMethod() throws Exception { if (hasFailed()) { return; } super.beforeMethod(); startTestFamework(testListener, clock, busService, subscriptionBaseService, entitlementService); this.catalog = initCatalog(catalogService); configureShiro(); login("EntitlementUser"); } private void login(final String username) { securityApi.login(username, "password"); } protected void configureShiro() { final Ini config = new Ini(); config.addSection("users"); config.getSection("users").put("EntitlementUser", "password, entitlement"); config.addSection("roles"); config.getSection("roles").put("entitlement", Permission.ACCOUNT_CAN_CREATE.toString() + "," + Permission.ENTITLEMENT_CAN_CREATE.toString() + "," + Permission.ENTITLEMENT_CAN_CHANGE_PLAN.toString() + "," + Permission.ENTITLEMENT_CAN_PAUSE_RESUME.toString() + "," + Permission.ENTITLEMENT_CAN_TRANSFER.toString() + "," + Permission.ENTITLEMENT_CAN_CANCEL.toString()); // Reset the security manager ThreadContext.unbindSecurityManager(); final Factory<SecurityManager> factory = new IniSecurityManagerFactory(config); final SecurityManager securityManager = factory.getInstance(); SecurityUtils.setSecurityManager(securityManager); } @AfterMethod(groups = "slow") public void afterMethod() throws Exception { if (hasFailed()) { return; } securityApi.logout(); stopTestFramework(testListener, busService, subscriptionBaseService, entitlementService); } private VersionedCatalog initCatalog(final CatalogService catalogService) throws Exception { ((DefaultCatalogService) catalogService).loadCatalog(); final VersionedCatalog catalog = catalogService.getFullCatalog(true, true, internalCallContext); assertNotNull(catalog); return catalog; } private void startTestFamework(final TestApiListener testListener, final ClockMock clock, final BusService busService, final SubscriptionBaseService subscriptionBaseService, final EntitlementService entitlementService) throws Exception { log.debug("STARTING TEST FRAMEWORK"); resetTestListener(testListener); resetClockToStartOfTest(clock); startBusAndRegisterListener(busService, testListener); restartSubscriptionService(subscriptionBaseService); restartEntitlementService(entitlementService); log.debug("STARTED TEST FRAMEWORK"); } private void stopTestFramework(final TestApiListener testListener, final BusService busService, final SubscriptionBaseService subscriptionBaseService, final EntitlementService entitlementService) throws Exception { log.debug("STOPPING TEST FRAMEWORK"); stopBusAndUnregisterListener(busService, testListener); stopSubscriptionService(subscriptionBaseService); stopEntitlementService(entitlementService); log.debug("STOPPED TEST FRAMEWORK"); } private void resetTestListener(final TestApiListener testListener) { // RESET LIST OF EXPECTED EVENTS if (testListener != null) { testListener.reset(); } } private void resetClockToStartOfTest(final ClockMock clock) { // Date at which all tests start-- we create the date object here after the system properties which set the JVM in UTC have been set. final DateTime testStartDate = new DateTime(2012, 5, 7, 0, 3, 42, 0); clock.setDeltaFromReality(testStartDate.getMillis() - clock.getUTCNow().getMillis()); } private void startBusAndRegisterListener(final BusService busService, final TestApiListener testListener) throws Exception { busService.getBus().startQueue(); busService.getBus().register(testListener); } private void restartSubscriptionService(final SubscriptionBaseService subscriptionBaseService) { // START NOTIFICATION QUEUE FOR SUBSCRIPTION ((DefaultSubscriptionBaseService) subscriptionBaseService).initialize(); ((DefaultSubscriptionBaseService) subscriptionBaseService).start(); } private void restartEntitlementService(final EntitlementService entitlementService) { // START NOTIFICATION QUEUE FOR ENTITLEMENT ((DefaultEntitlementService) entitlementService).initialize(); ((DefaultEntitlementService) entitlementService).start(); } private void stopBusAndUnregisterListener(final BusService busService, final TestApiListener testListener) throws Exception { busService.getBus().unregister(testListener); busService.getBus().stopQueue(); } private void stopSubscriptionService(final SubscriptionBaseService subscriptionBaseService) throws Exception { ((DefaultSubscriptionBaseService) subscriptionBaseService).stop(); } private void stopEntitlementService(final EntitlementService entitlementService) throws Exception { ((DefaultEntitlementService) entitlementService).stop(); } protected AccountData getAccountData(final int billingDay) { return new MockAccountBuilder().name(UUID.randomUUID().toString().substring(1, 8)) .firstNameLength(6) .email(UUID.randomUUID().toString().substring(1, 8)) .phone(UUID.randomUUID().toString().substring(1, 8)) .migrated(false) .externalKey(UUID.randomUUID().toString().substring(1, 8)) .billingCycleDayLocal(billingDay) .currency(Currency.USD) .paymentMethodId(UUID.randomUUID()) .referenceTime(clock.getUTCNow()) .timeZone(DateTimeZone.UTC) .build(); } protected Account createAccount(final AccountData accountData) throws AccountApiException { final Account account = accountApi.createAccount(accountData, callContext); refreshCallContext(account.getId()); return account; } protected void setChargedThroughDate(final UUID entitlementId, final DateTime ctd, final InternalCallContext internalCallContext) throws SubscriptionBaseApiException { final Map<DateTime, List<UUID>> chargeThroughDates = ImmutableMap.of(ctd, ImmutableList.of(entitlementId)); subscriptionInternalApi.setChargedThroughDates(chargeThroughDates, internalCallContext); } @Override protected void assertListenerStatus() { testListener.assertListenerStatus(); } }
{ "content_hash": "8cc4fc00bd4a57500cb50e4888357b0a", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 171, "avg_line_length": 42.47651006711409, "alnum_prop": 0.7094327697898563, "repo_name": "killbill/killbill", "id": "f627d560becfdc9f89e3145a02dc876bc12423f0", "size": "13379", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "entitlement/src/test/java/org/killbill/billing/entitlement/EntitlementTestSuiteWithEmbeddedDB.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "105855" }, { "name": "HTML", "bytes": "16358" }, { "name": "Java", "bytes": "13037928" }, { "name": "JavaScript", "bytes": "136386" }, { "name": "Mustache", "bytes": "4593" }, { "name": "PLpgSQL", "bytes": "14609" }, { "name": "Ruby", "bytes": "9048" }, { "name": "Shell", "bytes": "22894" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <!--for record item--> <style name="record_layout"> <item name="android:paddingTop">15dp</item> <item name="android:paddingBottom">5dp</item> </style> <style name="list_font"> <item name="android:textSize">20sp</item> <item name="android:textColor">@android:color/black</item> </style> <style name="splitter"> <item name="android:background">@color/light_gray</item> <item name="android:alpha">10</item> </style> <!--for button bar--> <style name="btn_bar_style"> <item name="android:paddingTop">10dp</item> <item name="android:paddingBottom">10dp</item> <item name="android:paddingLeft">25dp</item> <item name="android:paddingRight">25dp</item> <item name="android:background">@android:color/white</item> </style> <style name="btn_bar_btn_style"> <item name="android:textColor">@android:color/tertiary_text_light</item> <item name="android:textSize">@dimen/btn_text_size</item> </style> </resources>
{ "content_hash": "cb8f3794ba7bd7276a94c90928afa229", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 80, "avg_line_length": 39.42857142857143, "alnum_prop": 0.6222826086956522, "repo_name": "feng-zhe/stopwatch", "id": "490c226dde309be517c7536de46d82003ce46c34", "size": "1104", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "res/values/styles.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "33290" } ], "symlink_target": "" }
/** * @class Ext.EventManager * Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides * several useful events directly. * See {@link Ext.EventObject} for more details on normalized event objects. * @singleton */ Ext.EventManager = function(){ var docReadyEvent, docReadyProcId, docReadyState = false, E = Ext.lib.Event, D = Ext.lib.Dom, DOC = document, WINDOW = window, IEDEFERED = "ie-deferred-loader", DOMCONTENTLOADED = "DOMContentLoaded", propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/, /* * This cache is used to hold special js objects, the document and window, that don't have an id. We need to keep * a reference to them so we can look them up at a later point. */ specialElCache = []; function getId(el){ var id = false, i = 0, len = specialElCache.length, id = false, skip = false, o; if(el){ if(el.getElementById || el.navigator){ // look up the id for(; i < len; ++i){ o = specialElCache[i]; if(o.el === el){ id = o.id; break; } } if(!id){ // for browsers that support it, ensure that give the el the same id id = Ext.id(el); specialElCache.push({ id: id, el: el }); skip = true; } }else{ id = Ext.id(el); } if(!Ext.elCache[id]){ Ext.Element.addToCache(new Ext.Element(el), id); if(skip){ Ext.elCache[id].skipGC = true; } } } return id; }; /// There is some jquery work around stuff here that isn't needed in Ext Core. function addListener(el, ename, fn, task, wrap, scope){ el = Ext.getDom(el); var id = getId(el), es = Ext.elCache[id].events, wfn; wfn = E.on(el, ename, wrap); es[ename] = es[ename] || []; /* 0 = Original Function, 1 = Event Manager Wrapped Function, 2 = Scope, 3 = Adapter Wrapped Function, 4 = Buffered Task */ es[ename].push([fn, wrap, scope, wfn, task]); // this is a workaround for jQuery and should somehow be removed from Ext Core in the future // without breaking ExtJS. if(ename == "mousewheel" && el.addEventListener){ // workaround for jQuery var args = ["DOMMouseScroll", wrap, false]; el.addEventListener.apply(el, args); Ext.EventManager.addListener(WINDOW, 'unload', function(){ el.removeEventListener.apply(el, args); }); } if(ename == "mousedown" && el == document){ // fix stopped mousedowns on the document Ext.EventManager.stoppedMouseDownEvent.addListener(wrap); } }; function fireDocReady(){ if(!docReadyState){ Ext.isReady = docReadyState = true; if(docReadyProcId){ clearInterval(docReadyProcId); } if(Ext.isGecko || Ext.isOpera) { DOC.removeEventListener(DOMCONTENTLOADED, fireDocReady, false); } if(Ext.isIE){ var defer = DOC.getElementById(IEDEFERED); if(defer){ defer.onreadystatechange = null; defer.parentNode.removeChild(defer); } } if(docReadyEvent){ docReadyEvent.fire(); docReadyEvent.listeners = []; // clearListeners no longer compatible. Force single: true? } } }; function initDocReady(){ var COMPLETE = "complete"; docReadyEvent = new Ext.util.Event(); if (Ext.isGecko || Ext.isOpera) { DOC.addEventListener(DOMCONTENTLOADED, fireDocReady, false); } else if (Ext.isIE){ DOC.write("<s"+'cript id=' + IEDEFERED + ' defer="defer" src="/'+'/:"></s'+"cript>"); DOC.getElementById(IEDEFERED).onreadystatechange = function(){ if(this.readyState == COMPLETE){ fireDocReady(); } }; } else if (Ext.isWebKit){ docReadyProcId = setInterval(function(){ if(DOC.readyState == COMPLETE) { fireDocReady(); } }, 10); } // no matter what, make sure it fires on load E.on(WINDOW, "load", fireDocReady); }; function createTargeted(h, o){ return function(){ var args = Ext.toArray(arguments); if(o.target == Ext.EventObject.setEvent(args[0]).target){ h.apply(this, args); } }; }; function createBuffered(h, o, task){ return function(e){ // create new event object impl so new events don't wipe out properties task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]); }; }; function createSingle(h, el, ename, fn, scope){ return function(e){ Ext.EventManager.removeListener(el, ename, fn, scope); h(e); }; }; function createDelayed(h, o, fn){ return function(e){ var task = new Ext.util.DelayedTask(h); if(!fn.tasks) { fn.tasks = []; } fn.tasks.push(task); task.delay(o.delay || 10, h, null, [new Ext.EventObjectImpl(e)]); }; }; function listen(element, ename, opt, fn, scope){ var o = !Ext.isObject(opt) ? {} : opt, el = Ext.getDom(element), task; fn = fn || o.fn; scope = scope || o.scope; if(!el){ throw "Error listening for \"" + ename + '\". Element "' + element + '" doesn\'t exist.'; } function h(e){ // prevent errors while unload occurring if(!Ext){// !window[xname]){ ==> can't we do this? return; } e = Ext.EventObject.setEvent(e); var t; if (o.delegate) { if(!(t = e.getTarget(o.delegate, el))){ return; } } else { t = e.target; } if (o.stopEvent) { e.stopEvent(); } if (o.preventDefault) { e.preventDefault(); } if (o.stopPropagation) { e.stopPropagation(); } if (o.normalized) { e = e.browserEvent; } fn.call(scope || el, e, t, o); }; if(o.target){ h = createTargeted(h, o); } if(o.delay){ h = createDelayed(h, o, fn); } if(o.single){ h = createSingle(h, el, ename, fn, scope); } if(o.buffer){ task = new Ext.util.DelayedTask(h); h = createBuffered(h, o, task); } addListener(el, ename, fn, task, h, scope); return h; }; var pub = { /** * Appends an event handler to an element. The shorthand version {@link #on} is equivalent. Typically you will * use {@link Ext.Element#addListener} directly on an Element in favor of calling this version. * @param {String/HTMLElement} el The html element or id to assign the event handler to. * @param {String} eventName The name of the event to listen for. * @param {Function} handler The handler function the event invokes. This function is passed * the following parameters:<ul> * <li>evt : EventObject<div class="sub-desc">The {@link Ext.EventObject EventObject} describing the event.</div></li> * <li>t : Element<div class="sub-desc">The {@link Ext.Element Element} which was the target of the event. * Note that this may be filtered by using the <tt>delegate</tt> option.</div></li> * <li>o : Object<div class="sub-desc">The options object from the addListener call.</div></li> * </ul> * @param {Object} scope (optional) The scope (<b><code>this</code></b> reference) in which the handler function is executed. <b>Defaults to the Element</b>. * @param {Object} options (optional) An object containing handler configuration properties. * This may contain any of the following properties:<ul> * <li>scope : Object<div class="sub-desc">The scope (<b><code>this</code></b> reference) in which the handler function is executed. <b>Defaults to the Element</b>.</div></li> * <li>delegate : String<div class="sub-desc">A simple selector to filter the target or look for a descendant of the target</div></li> * <li>stopEvent : Boolean<div class="sub-desc">True to stop the event. That is stop propagation, and prevent the default action.</div></li> * <li>preventDefault : Boolean<div class="sub-desc">True to prevent the default action</div></li> * <li>stopPropagation : Boolean<div class="sub-desc">True to prevent event propagation</div></li> * <li>normalized : Boolean<div class="sub-desc">False to pass a browser event to the handler function instead of an Ext.EventObject</div></li> * <li>delay : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after te event fires.</div></li> * <li>single : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li> * <li>buffer : Number<div class="sub-desc">Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed * by the specified number of milliseconds. If the event fires again within that time, the original * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li> * <li>target : Element<div class="sub-desc">Only call the handler if the event was fired on the target Element, <i>not</i> if the event was bubbled up from a child node.</div></li> * </ul><br> * <p>See {@link Ext.Element#addListener} for examples of how to use these options.</p> */ addListener : function(element, eventName, fn, scope, options){ if(Ext.isObject(eventName)){ var o = eventName, e, val; for(e in o){ val = o[e]; if(!propRe.test(e)){ if(Ext.isFunction(val)){ // shared options listen(element, e, o, val, o.scope); }else{ // individual options listen(element, e, val); } } } } else { listen(element, eventName, options, fn, scope); } }, /** * Removes an event handler from an element. The shorthand version {@link #un} is equivalent. Typically * you will use {@link Ext.Element#removeListener} directly on an Element in favor of calling this version. * @param {String/HTMLElement} el The id or html element from which to remove the listener. * @param {String} eventName The name of the event. * @param {Function} fn The handler function to remove. <b>This must be a reference to the function passed into the {@link #addListener} call.</b> * @param {Object} scope If a scope (<b><code>this</code></b> reference) was specified when the listener was added, * then this must refer to the same object. */ removeListener : function(el, eventName, fn, scope){ el = Ext.getDom(el); var id = getId(el), f = el && (Ext.elCache[id].events)[eventName] || [], wrap, i, l, k, wf, len, fnc; for (i = 0, len = f.length; i < len; i++) { /* 0 = Original Function, 1 = Event Manager Wrapped Function, 2 = Scope, 3 = Adapter Wrapped Function, 4 = Buffered Task */ if (Ext.isArray(fnc = f[i]) && fnc[0] == fn && (!scope || fnc[2] == scope)) { if(fnc[4]) { fnc[4].cancel(); } k = fn.tasks && fn.tasks.length; if(k) { while(k--) { fn.tasks[k].cancel(); } delete fn.tasks; } wf = wrap = fnc[1]; if (E.extAdapter) { wf = fnc[3]; } E.un(el, eventName, wf); f.splice(i,1); if (f.length === 0) { delete Ext.elCache[id].events[eventName]; } for (k in Ext.elCache[id].events) { return false; } Ext.elCache[id].events = {}; return false; } } // jQuery workaround that should be removed from Ext Core if(eventName == "mousewheel" && el.addEventListener && wrap){ el.removeEventListener("DOMMouseScroll", wrap, false); } if(eventName == "mousedown" && el == DOC && wrap){ // fix stopped mousedowns on the document Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap); } }, /** * Removes all event handers from an element. Typically you will use {@link Ext.Element#removeAllListeners} * directly on an Element in favor of calling this version. * @param {String/HTMLElement} el The id or html element from which to remove all event handlers. */ removeAll : function(el){ el = Ext.getDom(el); var id = getId(el), ec = Ext.elCache[id] || {}, es = ec.events || {}, f, i, len, ename, fn, k; for(ename in es){ if(es.hasOwnProperty(ename)){ f = es[ename]; /* 0 = Original Function, 1 = Event Manager Wrapped Function, 2 = Scope, 3 = Adapter Wrapped Function, 4 = Buffered Task */ for (i = 0, len = f.length; i < len; i++) { fn = f[i]; if(fn[4]) { fn[4].cancel(); } if(fn[0].tasks && (k = fn[0].tasks.length)) { while(k--) { fn[0].tasks[k].cancel(); } delete fn.tasks; } E.un(el, ename, E.extAdapter ? fn[3] : fn[1]); } } } if (Ext.elCache[id]) { Ext.elCache[id].events = {}; } }, getListeners : function(el, eventName) { el = Ext.getDom(el); var id = getId(el), ec = Ext.elCache[id] || {}, es = ec.events || {}, results = []; if (es && es[eventName]) { return es[eventName]; } else { return null; } }, purgeElement : function(el, recurse, eventName) { el = Ext.getDom(el); var id = getId(el), ec = Ext.elCache[id] || {}, es = ec.events || {}, i, f, len; if (eventName) { if (es && es.hasOwnProperty(eventName)) { f = es[eventName]; for (i = 0, len = f.length; i < len; i++) { Ext.EventManager.removeListener(el, eventName, f[i][0]); } } } else { Ext.EventManager.removeAll(el); } if (recurse && el && el.childNodes) { for (i = 0, len = el.childNodes.length; i < len; i++) { Ext.EventManager.purgeElement(el.childNodes[i], recurse, eventName); } } }, _unload : function() { var el; for (el in Ext.elCache) { Ext.EventManager.removeAll(el); } }, /** * Adds a listener to be notified when the document is ready (before onload and before images are loaded). Can be * accessed shorthanded as Ext.onReady(). * @param {Function} fn The method the event invokes. * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the handler function executes. Defaults to the browser window. * @param {boolean} options (optional) Options object as passed to {@link Ext.Element#addListener}. It is recommended that the options * <code>{single: true}</code> be used so that the handler is removed on first invocation. */ onDocumentReady : function(fn, scope, options){ if(docReadyState){ // if it already fired docReadyEvent.addListener(fn, scope, options); docReadyEvent.fire(); docReadyEvent.listeners = []; // clearListeners no longer compatible. Force single: true? } else { if(!docReadyEvent) initDocReady(); options = options || {}; options.delay = options.delay || 1; docReadyEvent.addListener(fn, scope, options); } } }; /** * Appends an event handler to an element. Shorthand for {@link #addListener}. * @param {String/HTMLElement} el The html element or id to assign the event handler to * @param {String} eventName The name of the event to listen for. * @param {Function} handler The handler function the event invokes. * @param {Object} scope (optional) (<code>this</code> reference) in which the handler function executes. <b>Defaults to the Element</b>. * @param {Object} options (optional) An object containing standard {@link #addListener} options * @member Ext.EventManager * @method on */ pub.on = pub.addListener; /** * Removes an event handler from an element. Shorthand for {@link #removeListener}. * @param {String/HTMLElement} el The id or html element from which to remove the listener. * @param {String} eventName The name of the event. * @param {Function} fn The handler function to remove. <b>This must be a reference to the function passed into the {@link #on} call.</b> * @param {Object} scope If a scope (<b><code>this</code></b> reference) was specified when the listener was added, * then this must refer to the same object. * @member Ext.EventManager * @method un */ pub.un = pub.removeListener; pub.stoppedMouseDownEvent = new Ext.util.Event(); return pub; }(); /** * Adds a listener to be notified when the document is ready (before onload and before images are loaded). Shorthand of {@link Ext.EventManager#onDocumentReady}. * @param {Function} fn The method the event invokes. * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the handler function executes. Defaults to the browser window. * @param {boolean} options (optional) Options object as passed to {@link Ext.Element#addListener}. It is recommended that the options * <code>{single: true}</code> be used so that the handler is removed on first invocation. * @member Ext * @method onReady */ Ext.onReady = Ext.EventManager.onDocumentReady; //Initialize doc classes (function(){ var initExtCss = function(){ // find the body element var bd = document.body || document.getElementsByTagName('body')[0]; if(!bd){ return false; } var cls = [' ', Ext.isIE ? "ext-ie " + (Ext.isIE6 ? 'ext-ie6' : (Ext.isIE7 ? 'ext-ie7' : 'ext-ie8')) : Ext.isGecko ? "ext-gecko " + (Ext.isGecko2 ? 'ext-gecko2' : 'ext-gecko3') : Ext.isOpera ? "ext-opera" : Ext.isWebKit ? "ext-webkit" : ""]; if(Ext.isSafari){ cls.push("ext-safari " + (Ext.isSafari2 ? 'ext-safari2' : (Ext.isSafari3 ? 'ext-safari3' : 'ext-safari4'))); }else if(Ext.isChrome){ cls.push("ext-chrome"); } if(Ext.isMac){ cls.push("ext-mac"); } if(Ext.isLinux){ cls.push("ext-linux"); } if(Ext.isStrict || Ext.isBorderBox){ // add to the parent to allow for selectors like ".ext-strict .ext-ie" var p = bd.parentNode; if(p){ p.className += Ext.isStrict ? ' ext-strict' : ' ext-border-box'; } } bd.className += cls.join(' '); return true; } if(!initExtCss()){ Ext.onReady(initExtCss); } })(); /** * @class Ext.EventObject * Just as {@link Ext.Element} wraps around a native DOM node, Ext.EventObject * wraps the browser's native event-object normalizing cross-browser differences, * such as which mouse button is clicked, keys pressed, mechanisms to stop * event-propagation along with a method to prevent default actions from taking place. * <p>For example:</p> * <pre><code> function handleClick(e, t){ // e is not a standard event object, it is a Ext.EventObject e.preventDefault(); var target = e.getTarget(); // same as t (the target HTMLElement) ... } var myDiv = {@link Ext#get Ext.get}("myDiv"); // get reference to an {@link Ext.Element} myDiv.on( // 'on' is shorthand for addListener "click", // perform an action on click of myDiv handleClick // reference to the action handler ); // other methods to do the same: Ext.EventManager.on("myDiv", 'click', handleClick); Ext.EventManager.addListener("myDiv", 'click', handleClick); </code></pre> * @singleton */ Ext.EventObject = function(){ var E = Ext.lib.Event, // safari keypress events for special keys return bad keycodes safariKeys = { 3 : 13, // enter 63234 : 37, // left 63235 : 39, // right 63232 : 38, // up 63233 : 40, // down 63276 : 33, // page up 63277 : 34, // page down 63272 : 46, // delete 63273 : 36, // home 63275 : 35 // end }, // normalize button clicks btnMap = Ext.isIE ? {1:0,4:1,2:2} : (Ext.isWebKit ? {1:0,2:1,3:2} : {0:0,1:1,2:2}); Ext.EventObjectImpl = function(e){ if(e){ this.setEvent(e.browserEvent || e); } }; Ext.EventObjectImpl.prototype = { /** @private */ setEvent : function(e){ var me = this; if(e == me || (e && e.browserEvent)){ // already wrapped return e; } me.browserEvent = e; if(e){ // normalize buttons me.button = e.button ? btnMap[e.button] : (e.which ? e.which - 1 : -1); if(e.type == 'click' && me.button == -1){ me.button = 0; } me.type = e.type; me.shiftKey = e.shiftKey; // mac metaKey behaves like ctrlKey me.ctrlKey = e.ctrlKey || e.metaKey || false; me.altKey = e.altKey; // in getKey these will be normalized for the mac me.keyCode = e.keyCode; me.charCode = e.charCode; // cache the target for the delayed and or buffered events me.target = E.getTarget(e); // same for XY me.xy = E.getXY(e); }else{ me.button = -1; me.shiftKey = false; me.ctrlKey = false; me.altKey = false; me.keyCode = 0; me.charCode = 0; me.target = null; me.xy = [0, 0]; } return me; }, /** * Stop the event (preventDefault and stopPropagation) */ stopEvent : function(){ var me = this; if(me.browserEvent){ if(me.browserEvent.type == 'mousedown'){ Ext.EventManager.stoppedMouseDownEvent.fire(me); } E.stopEvent(me.browserEvent); } }, /** * Prevents the browsers default handling of the event. */ preventDefault : function(){ if(this.browserEvent){ E.preventDefault(this.browserEvent); } }, /** * Cancels bubbling of the event. */ stopPropagation : function(){ var me = this; if(me.browserEvent){ if(me.browserEvent.type == 'mousedown'){ Ext.EventManager.stoppedMouseDownEvent.fire(me); } E.stopPropagation(me.browserEvent); } }, /** * Gets the character code for the event. * @return {Number} */ getCharCode : function(){ return this.charCode || this.keyCode; }, /** * Returns a normalized keyCode for the event. * @return {Number} The key code */ getKey : function(){ return this.normalizeKey(this.keyCode || this.charCode) }, // private normalizeKey: function(k){ return Ext.isSafari ? (safariKeys[k] || k) : k; }, /** * Gets the x coordinate of the event. * @return {Number} */ getPageX : function(){ return this.xy[0]; }, /** * Gets the y coordinate of the event. * @return {Number} */ getPageY : function(){ return this.xy[1]; }, /** * Gets the page coordinates of the event. * @return {Array} The xy values like [x, y] */ getXY : function(){ return this.xy; }, /** * Gets the target for the event. * @param {String} selector (optional) A simple selector to filter the target or look for an ancestor of the target * @param {Number/Mixed} maxDepth (optional) The max depth to search as a number or element (defaults to 10 || document.body) * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node * @return {HTMLelement} */ getTarget : function(selector, maxDepth, returnEl){ return selector ? Ext.fly(this.target).findParent(selector, maxDepth, returnEl) : (returnEl ? Ext.get(this.target) : this.target); }, /** * Gets the related target. * @return {HTMLElement} */ getRelatedTarget : function(){ return this.browserEvent ? E.getRelatedTarget(this.browserEvent) : null; }, /** * Normalizes mouse wheel delta across browsers * @return {Number} The delta */ getWheelDelta : function(){ var e = this.browserEvent; var delta = 0; if(e.wheelDelta){ /* IE/Opera. */ delta = e.wheelDelta/120; }else if(e.detail){ /* Mozilla case. */ delta = -e.detail/3; } return delta; }, /** * Returns true if the target of this event is a child of el. Unless the allowEl parameter is set, it will return false if if the target is el. * Example usage:<pre><code> // Handle click on any child of an element Ext.getBody().on('click', function(e){ if(e.within('some-el')){ alert('Clicked on a child of some-el!'); } }); // Handle click directly on an element, ignoring clicks on child nodes Ext.getBody().on('click', function(e,t){ if((t.id == 'some-el') && !e.within(t, true)){ alert('Clicked directly on some-el!'); } }); </code></pre> * @param {Mixed} el The id, DOM element or Ext.Element to check * @param {Boolean} related (optional) true to test if the related target is within el instead of the target * @param {Boolean} allowEl {optional} true to also check if the passed element is the target or related target * @return {Boolean} */ within : function(el, related, allowEl){ if(el){ var t = this[related ? "getRelatedTarget" : "getTarget"](); return t && ((allowEl ? (t == Ext.getDom(el)) : false) || Ext.fly(el).contains(t)); } return false; } }; return new Ext.EventObjectImpl(); }();
{ "content_hash": "1ba4e0227cd5dbc790399d15206a4523", "timestamp": "", "source": "github", "line_count": 767, "max_line_length": 189, "avg_line_length": 40.05084745762712, "alnum_prop": 0.4954913896936749, "repo_name": "ewgRa/ExtCore-Fork", "id": "68e905ecbd640298e808d5df6a7cc03ab3afd159", "size": "30866", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/core/EventManager.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
import chai from 'chai' import CardinalDirection from '../examples/cardinal-direction' import PrimaryColor from '../examples/primary-color' chai.should() const {NORTH, SOUTH, WEST} = CardinalDirection const {YELLOW} = PrimaryColor describe('#isSameTypeAs(that)', () => { it('returns true', () => { NORTH.isSameTypeAs(WEST) .should .be .true }) it('returns false', () => { SOUTH.isSameTypeAs(YELLOW) .should .be .false }) })
{ "content_hash": "ac2b03c5be83b58d7cd0f02d3a913ba6", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 62, "avg_line_length": 23.473684210526315, "alnum_prop": 0.6748878923766816, "repo_name": "alan-ghelardi/enumerations", "id": "845bce28541fbb3c6f8bd986f2573123769b5ada", "size": "446", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/enum.isSameTypeAs.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "21004" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd"> <ldml> <identity> <version number="$Revision: 4178 $"/> <generation date="$Date: 2009-06-14 23:46:26 -0400 (Sun, 14 Jun 2009) $"/> <language type="uz"/> <script type="Latn"/> </identity> <localeDisplayNames> <languages> <language type="ar">arabcha</language> <language type="de">olmoncha</language> <language type="en">inglizcha</language> <language type="es">ispancha</language> <language type="fr">fransuzcha</language> <language type="hi">hindcha</language> <language type="it">italyancha</language> <language type="ja">yaponcha</language> <language type="pt">portugalcha</language> <language type="ru">ruscha</language> <language type="uz">o'zbekcha</language> <language type="zh">xitoycha</language> </languages> <scripts> <script type="Cyrl">Kiril</script> <script type="Latn">Lotin</script> </scripts> <territories> <territory type="AF">Afgʿoniston</territory> <territory type="BR">Braziliya</territory> <territory type="CN">Xitoy</territory> <territory type="DE">Olmoniya</territory> <territory type="FR">Fransiya</territory> <territory type="GB">Birlashgan Qirollik</territory> <territory type="IN">Hindiston</territory> <territory type="IT">Italiya</territory> <territory type="JP">Yaponiya</territory> <territory type="RU">Rossiya</territory> <territory type="US">Qo'shma Shtatlar</territory> <territory type="UZ">Oʿzbekiston</territory> </territories> </localeDisplayNames> <characters> <exemplarCharacters draft="unconfirmed">[a-v x-z ʿ]</exemplarCharacters> </characters> <dates> <calendars> <calendar type="gregorian"> <months> <monthContext type="format"> <monthWidth type="abbreviated"> <month type="1" draft="unconfirmed">Yanv</month> <month type="2" draft="unconfirmed">Fev</month> <month type="3" draft="unconfirmed">Mar</month> <month type="4" draft="unconfirmed">Apr</month> <month type="5" draft="unconfirmed">May</month> <month type="6" draft="unconfirmed">Iyun</month> <month type="7" draft="unconfirmed">Iyul</month> <month type="8" draft="unconfirmed">Avg</month> <month type="9" draft="unconfirmed">Sen</month> <month type="10" draft="unconfirmed">Okt</month> <month type="11" draft="unconfirmed">Noya</month> <month type="12" draft="unconfirmed">Dek</month> </monthWidth> </monthContext> <monthContext type="stand-alone"> <monthWidth type="narrow"> <month type="1" draft="unconfirmed">Y</month> <month type="2" draft="unconfirmed">F</month> <month type="3" draft="unconfirmed">M</month> <month type="4" draft="unconfirmed">A</month> <month type="5" draft="unconfirmed">M</month> <month type="6" draft="unconfirmed">I</month> <month type="7" draft="unconfirmed">I</month> <month type="8" draft="unconfirmed">A</month> <month type="9" draft="unconfirmed">S</month> <month type="10" draft="unconfirmed">O</month> <month type="11" draft="unconfirmed">N</month> <month type="12" draft="unconfirmed">D</month> </monthWidth> </monthContext> </months> <days> <dayContext type="format"> <dayWidth type="abbreviated"> <day type="sun" draft="unconfirmed">Yaksh</day> <day type="mon" draft="unconfirmed">Dush</day> <day type="tue" draft="unconfirmed">Sesh</day> <day type="wed" draft="unconfirmed">Chor</day> <day type="thu" draft="unconfirmed">Pay</day> <day type="fri" draft="unconfirmed">Jum</day> <day type="sat" draft="unconfirmed">Shan</day> </dayWidth> <dayWidth type="wide"> <day type="sun" draft="unconfirmed">yakshanba</day> <day type="mon" draft="unconfirmed">dushanba</day> <day type="tue" draft="unconfirmed">seshanba</day> <day type="wed" draft="unconfirmed">chorshanba</day> <day type="thu" draft="unconfirmed">payshanba</day> <day type="fri" draft="unconfirmed">juma</day> <day type="sat" draft="unconfirmed">shanba</day> </dayWidth> </dayContext> <dayContext type="stand-alone"> <dayWidth type="narrow"> <day type="sun" draft="unconfirmed">Y</day> <day type="mon" draft="unconfirmed">D</day> <day type="tue" draft="unconfirmed">S</day> <day type="wed" draft="unconfirmed">C</day> <day type="thu" draft="unconfirmed">P</day> <day type="fri" draft="unconfirmed">J</day> <day type="sat" draft="unconfirmed">S</day> </dayWidth> </dayContext> </days> </calendar> <calendar type="islamic"> <months> <monthContext type="format"> <monthWidth type="wide"> <month type="3" draft="unconfirmed">Rabiul-avval</month> <month type="4" draft="unconfirmed">Rabiul-oxir</month> <month type="5" draft="unconfirmed">Jumodiul-ulo</month> <month type="6" draft="unconfirmed">Jumodiul-uxro</month> <month type="8" draft="unconfirmed">Shaʿbon</month> <month type="9" draft="unconfirmed">Ramazon</month> <month type="10" draft="unconfirmed">Shavvol</month> <month type="11" draft="unconfirmed">Zil-qaʿda</month> <month type="12" draft="unconfirmed">Zil-hijja</month> </monthWidth> </monthContext> </months> </calendar> </calendars> </dates> <numbers> <currencies> <currency type="BRL"> <displayName draft="unconfirmed">Brazil reali</displayName> </currency> <currency type="CNY"> <displayName draft="unconfirmed">Xitoy yuani</displayName> </currency> <currency type="EUR"> <displayName draft="unconfirmed">Evro</displayName> </currency> <currency type="GBP"> <displayName draft="unconfirmed">Ingliz funt sterlingi</displayName> </currency> <currency type="INR"> <displayName draft="unconfirmed">Hind rupiyasi</displayName> </currency> <currency type="JPY"> <displayName draft="unconfirmed">Yapon yenasi</displayName> </currency> <currency type="RUB"> <displayName draft="unconfirmed">Rus rubli</displayName> </currency> <currency type="USD"> <displayName draft="unconfirmed">AQSH dollari</displayName> </currency> <currency type="UZS"> <displayName draft="unconfirmed">Oʿzbekiston soʿm</displayName> <symbol draft="unconfirmed">soʿm</symbol> </currency> </currencies> </numbers> </ldml>
{ "content_hash": "1b6a709165e4e9348ee0ada4ed06c4b9", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 76, "avg_line_length": 39.44705882352941, "alnum_prop": 0.6269012824336415, "repo_name": "mbr/Babel-CLDR", "id": "9fc90629b68a1edad008ec59af47563076412d31", "size": "6714", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CLDR-1.7.2/common/main/uz_Latn.xml", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "4752" }, { "name": "Python", "bytes": "446655" } ], "symlink_target": "" }
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>PHPXRef 0.7.1 : Unnamed Project : Function Reference: alternator()</title> <link rel="stylesheet" href="../sample.css" type="text/css"> <link rel="stylesheet" href="../sample-print.css" type="text/css" media="print"> <style id="hilight" type="text/css"></style> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> </head> <body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff"> <table class="pagetitle" width="100%"> <tr> <td valign="top" class="pagetitle"> [ <a href="../index.html">Index</a> ] </td> <td align="right" class="pagetitle"> <h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2> </td> </tr> </table> <!-- Generated by PHPXref 0.7.1 at Thu Oct 23 19:15:14 2014 --> <!-- PHPXref (c) 2000-2010 Gareth Watts - [email protected] --> <!-- http://phpxref.sourceforge.net/ --> <script src="../phpxref.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript"> <!-- ext='.html'; relbase='../'; subdir='_functions'; filename='index.html'; cookiekey='phpxref'; handleNavFrame(relbase, subdir, filename); logFunction('alternator'); // --> </script> <script language="JavaScript" type="text/javascript"> if (gwGetCookie('xrefnav')=='off') document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>'); else document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>'); </script> <noscript> <p class="navlinks"> [ <a href="../nav.html" target="_top">Show Explorer</a> ] [ <a href="index.html" target="_top">Hide Navbar</a> ] </p> </noscript> [<a href="../index.html">Top level directory</a>]<br> <script language="JavaScript" type="text/javascript"> <!-- document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>'); document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">'); document.writeln('<tr><td class="searchbox-title">'); document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>'); document.writeln('<\/td><\/tr>'); document.writeln('<tr><td class="searchbox-body" id="searchbox-body">'); document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>'); document.writeln('<a class="searchbox-body" href="../_classes/index.html">Class<\/a>: '); document.writeln('<input type="text" size=10 value="" name="classname"><br>'); document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../_functions/index.html">Function<\/a>: '); document.writeln('<input type="text" size=10 value="" name="funcname"><br>'); document.writeln('<a class="searchbox-body" href="../_variables/index.html">Variable<\/a>: '); document.writeln('<input type="text" size=10 value="" name="varname"><br>'); document.writeln('<a class="searchbox-body" href="../_constants/index.html">Constant<\/a>: '); document.writeln('<input type="text" size=10 value="" name="constname"><br>'); document.writeln('<a class="searchbox-body" href="../_tables/index.html">Table<\/a>: '); document.writeln('<input type="text" size=10 value="" name="tablename"><br>'); document.writeln('<input type="submit" class="searchbox-button" value="Search">'); document.writeln('<\/form>'); document.writeln('<\/td><\/tr><\/table>'); document.writeln('<\/td><\/tr><\/table>'); // --> </script> <div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div> <h3>Function and Method Cross Reference</h3> <h2><a href="index.html#alternator">alternator()</a></h2> <b>Defined at:</b><ul> <li><a href="../bonfire/codeigniter/helpers/string_helper.php.html#alternator">/bonfire/codeigniter/helpers/string_helper.php</a> -> <a onClick="logFunction('alternator', '/bonfire/codeigniter/helpers/string_helper.php.source.html#l262')" href="../bonfire/codeigniter/helpers/string_helper.php.source.html#l262"> line 262</a></li> </ul> <b>No references found.</b><br><br> </ul> <!-- A link to the phpxref site in your customized footer file is appreciated ;-) --> <br><hr> <table width="100%"> <tr><td>Generated: Thu Oct 23 19:15:14 2014</td> <td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td> </tr> </table> </body></html>
{ "content_hash": "6420a253e8d84d35d472fc1ed9ae5064", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 331, "avg_line_length": 49.92631578947368, "alnum_prop": 0.6719375922411975, "repo_name": "inputx/code-ref-doc", "id": "eaf8fd935368fc7d07ab346d0d9ba1e8dbaa1181", "size": "4743", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rebbit/_functions/alternator.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "17952" }, { "name": "JavaScript", "bytes": "255489" } ], "symlink_target": "" }
"""Unit tests for the astropy.coordinates.angle_utilities module""" import numpy as np import pytest import astropy.units as u from astropy.coordinates.angle_utilities import ( golden_spiral_grid, uniform_spherical_random_surface, uniform_spherical_random_volume) from astropy.utils import NumpyRNGContext def test_golden_spiral_grid_input(): usph = golden_spiral_grid(size=100) assert len(usph) == 100 @pytest.mark.parametrize("func", [uniform_spherical_random_surface, uniform_spherical_random_volume]) def test_uniform_spherical_random_input(func): with NumpyRNGContext(42): sph = func(size=100) assert len(sph) == 100 def test_uniform_spherical_random_volume_input(): with NumpyRNGContext(42): sph = uniform_spherical_random_volume(size=100, max_radius=1) assert len(sph) == 100 assert sph.distance.unit == u.dimensionless_unscaled assert sph.distance.max() <= 1. sph = uniform_spherical_random_volume(size=100, max_radius=4*u.pc) assert len(sph) == 100 assert sph.distance.max() <= 4*u.pc
{ "content_hash": "b7b7486b513f03faeadd983b226cbb70", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 90, "avg_line_length": 33.205882352941174, "alnum_prop": 0.6837909654561559, "repo_name": "lpsinger/astropy", "id": "885938f5578aa255f29881cb5771a9a4e498a186", "size": "1129", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "astropy/coordinates/tests/test_angle_generators.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "11040074" }, { "name": "C++", "bytes": "47001" }, { "name": "Cython", "bytes": "78755" }, { "name": "HTML", "bytes": "1172" }, { "name": "Lex", "bytes": "183333" }, { "name": "M4", "bytes": "18757" }, { "name": "Makefile", "bytes": "52508" }, { "name": "Python", "bytes": "12323563" }, { "name": "Shell", "bytes": "17024" }, { "name": "TeX", "bytes": "853" } ], "symlink_target": "" }
package org.assertj.core.api.character; import org.assertj.core.api.CharacterAssert; import org.assertj.core.api.CharacterAssertBaseTest; import static org.mockito.Mockito.verify; /** * Tests for <code>{@link CharacterAssert#isNotEqualTo(char)}</code>. * * @author Alex Ruiz */ public class CharacterAssert_isNotEqualTo_char_Test extends CharacterAssertBaseTest { @Override protected CharacterAssert invoke_api_method() { return assertions.isNotEqualTo('b'); } @Override protected void verify_internal_effects() { verify(characters).assertNotEqual(getInfo(assertions), getActual(assertions), 'b'); } }
{ "content_hash": "997c236f01db5b413578101d99abdcdc", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 87, "avg_line_length": 24.384615384615383, "alnum_prop": 0.7539432176656151, "repo_name": "yurloc/assertj-core", "id": "6adfd5dc6b9a51f777a9cb15ba5d094829ade643", "size": "1275", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/org/assertj/core/api/character/CharacterAssert_isNotEqualTo_char_Test.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import logging import os import config import destalinator import slackbot import slacker import utils import json class Executor(object): def __init__(self, debug=False, verbose=False): self.debug = debug self.verbose = verbose self.config = config.Config() slackbot_token = os.getenv(self.config.slackbot_api_token_env_varname) api_token = os.getenv(self.config.api_token_env_varname) self.logger = logging.getLogger(__name__) utils.set_up_logger(self.logger, log_level_env_var='DESTALINATOR_LOG_LEVEL') self.destalinator_activated = False if os.getenv(self.config.destalinator_activated_env_varname): self.destalinator_activated = True self.logger.debug("destalinator_activated is %s", self.destalinator_activated) self.sb = slackbot.Slackbot(config.SLACK_NAME, token=slackbot_token) self.slacker = slacker.Slacker(config.SLACK_NAME, token=api_token, logger=self.logger) self.ds = destalinator.Destalinator(slacker=self.slacker, slackbot=self.sb, activated=self.destalinator_activated, logger=self.logger)
{ "content_hash": "0add3eae07274c4f886d0c6752f45233", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 94, "avg_line_length": 34.351351351351354, "alnum_prop": 0.6341463414634146, "repo_name": "rossrader/destalinator", "id": "af0ba61f2e635c5c71f41ff6c24c0afba92857ee", "size": "1295", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "executor.py", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "65646" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Media.Advertising; using Windows.Foundation; namespace Microsoft.PlayerFramework.Units.Advertising.Mockups { public class Player : IPlayer { public int CurrentBitrate { get; set; } Size dimensions; public Size Dimensions { get { return dimensions; } set { dimensions = value; if (DimensionsChanged != null) DimensionsChanged(this, EventArgs.Empty); } } bool isFullScreen; public bool IsFullScreen { get { return isFullScreen; } set { isFullScreen = value; if (FullscreenChanged != null) FullscreenChanged(this, EventArgs.Empty); } } double volume; public double Volume { get { return volume; } set { volume = value; if (VolumeChanged != null) VolumeChanged(this, EventArgs.Empty); } } bool isMuted; public bool IsMuted { get { return isMuted; } set { isMuted = value; if (IsMutedChanged != null) IsMutedChanged(this, EventArgs.Empty); } } public TimeSpan CurrentPosition { get { return TimeSpan.Zero; } } public event EventHandler<object> FullscreenChanged; public event EventHandler<object> DimensionsChanged; public event EventHandler<object> VolumeChanged; public event EventHandler<object> IsMutedChanged; } }
{ "content_hash": "381dcbb23a1b54f7a31a1be494cb0560", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 88, "avg_line_length": 24.90277777777778, "alnum_prop": 0.5404350250976018, "repo_name": "bondarenkod/pf-arm-deploy-error", "id": "ee0793cc8e302bc7a0c215f79dc3d4bd8a9ffaf4", "size": "1795", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "playerframework/Win8.Xaml.Units.Advertising/Metro.Xaml.Units.Advertising/Mockups/Player.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "241367" }, { "name": "C#", "bytes": "4589698" }, { "name": "CSS", "bytes": "669373" }, { "name": "HTML", "bytes": "291713" }, { "name": "JavaScript", "bytes": "5567351" } ], "symlink_target": "" }
package com.lyf.mycoolweather.util; import android.text.TextUtils; import com.google.gson.Gson; import com.lyf.mycoolweather.bean.Weather; import com.lyf.mycoolweather.db.City; import com.lyf.mycoolweather.db.County; import com.lyf.mycoolweather.db.Province; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; /** * Created by 刘亚飞 on 2017/3/27. */ public class Utility { /** * 获取省信息 * * @param response * @return */ public static boolean handleProvinceResponse(String response) { if (!TextUtils.isEmpty(response)) { try { JSONArray jsonArray = new JSONArray(response); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); Province province = new Province(); province.setProvinceCode(jsonObject.getInt("id")); province.setProvinceName(jsonObject.getString("name")); province.save(); } return true; } catch (JSONException e) { e.printStackTrace(); } } return false; } /** * 获取市 * @param response * @param provinceId * @return */ public static boolean handleCityResponse(String response,int provinceId) { if (!TextUtils.isEmpty(response)) { try { JSONArray jsonArray = new JSONArray(response); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); City city = new City(); city.setCityCode(jsonObject.getInt("id")); city.setCityName(jsonObject.getString("name")); city.setProvinceId(provinceId); city.save(); } return true; } catch (JSONException e) { e.printStackTrace(); } } return false; } /** * 获取县信息 * @param response * @param cityId * @return */ public static boolean handleCountyResponse(String response,int cityId){ if (!TextUtils.isEmpty(response)){ try { JSONArray jsonArray = new JSONArray(response); for (int i = 0; i < jsonArray.length(); i++){ JSONObject jsonObject = jsonArray.getJSONObject(i); County county = new County(); county.setWeatherId(jsonObject.getString("weather_id")); county.setCountyName(jsonObject.getString("name")); county.setCityId(cityId); county.save(); } return true; } catch (JSONException e) { e.printStackTrace(); } } return false; } /** * 获取天气数据 * @param response * @return */ public static Weather handleWeatherResponse(String response){ try { JSONObject jsonObject = new JSONObject(response); JSONArray jsonArray = jsonObject.getJSONArray("HeWeather"); String weatherContent = jsonArray.getJSONObject(0).toString(); return new Gson().fromJson(weatherContent,Weather.class); } catch (JSONException e) { e.printStackTrace(); } return null; } }
{ "content_hash": "677d6bf2f5edb96d5d54c525f419cb57", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 78, "avg_line_length": 28.860655737704917, "alnum_prop": 0.532803180914513, "repo_name": "lyf19993/mycoolweather", "id": "a4cbeea714766e5d1f8a6e7cd1d7ca31e3400e5c", "size": "3565", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/lyf/mycoolweather/util/Utility.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "33969" } ], "symlink_target": "" }
from django import forms from main.models import Episode, Location # from django.contrib.admin import widgets class Who(forms.Form): locked_by = forms.CharField(max_length=32, required=True, label="Please enter your name") # class Episode_Form(forms.ModelForm): # exclude=[] # class Meta: # model = Episode class Episode_Form_Preshow(forms.ModelForm): authors = forms.CharField(max_length=255, required=False) emails = forms.CharField(max_length=255, required=False) def __init__(self, *args, **kwargs): locations = kwargs.get('locations', Location.objects.all()) if 'locations' in kwargs: del kwargs['locations'] super(Episode_Form_Preshow, self).__init__(*args, **kwargs) self.fields['location']._set_choices([(l.id, l.name) for l in locations]) class Meta: model = Episode fields = ('sequence', 'name', 'slug', 'show','location', 'start', 'duration', 'authors', 'emails', 'released', 'description', 'tags') class Episode_Form_small(forms.ModelForm): class Meta: model = Episode fields = ('state', 'locked', 'locked_by', 'start', 'duration', 'name', 'emails', 'released', 'normalise', 'channelcopy', 'thumbnail', 'description', 'comment') class clrfForm(forms.Form): clid = forms.IntegerField(widget=forms.HiddenInput()) trash = forms.BooleanField(label="Trash",required=False) apply = forms.BooleanField(label="Apply",required=False) split = forms.BooleanField(label="Split",required=False) sequence = forms.IntegerField(label="Sequence",required=False, widget=forms.TextInput(attrs={'size':'3','class':'suSpinButton'})) start = forms.CharField(max_length=12,label="Start",required=False, help_text = "offset from start in h:m:s or frames, blank for start", widget=forms.TextInput(attrs={'size':'9'})) end = forms.CharField(max_length=12,label="End",required=False, help_text = "offset from start in h:m:s or frames, blank for end", widget=forms.TextInput(attrs={'size':'9'})) rf_comment = forms.CharField(label="Raw_File comment",required=False, widget=forms.Textarea(attrs={'rows':'2','cols':'20'})) cl_comment = forms.CharField(label="Cut_List comment",required=False, widget=forms.Textarea(attrs={'rows':'2','cols':'20'})) class Add_CutList_to_Ep(forms.Form): rf_filename = forms.CharField(max_length=132,required=False, help_text = "root is .../show/dv/location/, example: 2013-03-13/13:13:30.dv" ) sequence = forms.IntegerField(label="Sequence",required=False, widget=forms.TextInput(attrs={'size':'3','class':'suSpinButton'})) getit = forms.BooleanField(label="get this", required=False, help_text="check and save to add this") class AddImageToEp(forms.Form): image_id = forms.IntegerField(widget=forms.HiddenInput()) episode_id = forms.IntegerField(required=False,) class AddEpisodeToRaw(forms.ModelForm): class Meta: model = Episode fields = ('name', 'duration', # 'comment', ) raw_id = forms.IntegerField(widget=forms.HiddenInput())
{ "content_hash": "48fdadd78325bfa3426f1074bfe5518c", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 84, "avg_line_length": 39.48837209302326, "alnum_prop": 0.6166077738515902, "repo_name": "yoe/veyepar", "id": "c51f63caa7a5ea81744cf0487835a4c91fd0550a", "size": "3409", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dj/main/forms.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6107" }, { "name": "HTML", "bytes": "76370" }, { "name": "JavaScript", "bytes": "76640" }, { "name": "Python", "bytes": "713606" }, { "name": "Ruby", "bytes": "3503" }, { "name": "Shell", "bytes": "80571" } ], "symlink_target": "" }
#ifndef QDECLARATIVEREPEATER_H #define QDECLARATIVEREPEATER_H #include "qdeclarativeitem.h" QT_BEGIN_NAMESPACE QT_MODULE(Declarative) class QDeclarativeRepeaterPrivate; class Q_AUTOTEST_EXPORT QDeclarativeRepeater : public QDeclarativeItem { Q_OBJECT Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged) Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) Q_CLASSINFO("DefaultProperty", "delegate") public: QDeclarativeRepeater(QDeclarativeItem *parent=0); virtual ~QDeclarativeRepeater(); QVariant model() const; void setModel(const QVariant &); QDeclarativeComponent *delegate() const; void setDelegate(QDeclarativeComponent *); int count() const; Q_INVOKABLE Q_REVISION(1) QDeclarativeItem *itemAt(int index) const; Q_SIGNALS: void modelChanged(); void delegateChanged(); void countChanged(); Q_REVISION(1) void itemAdded(int index, QDeclarativeItem *item); Q_REVISION(1) void itemRemoved(int index, QDeclarativeItem *item); private: void clear(); void regenerate(); protected: virtual void componentComplete(); QVariant itemChange(GraphicsItemChange change, const QVariant &value); private Q_SLOTS: void itemsInserted(int,int); void itemsRemoved(int,int); void itemsMoved(int,int,int); void modelReset(); private: Q_DISABLE_COPY(QDeclarativeRepeater) Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeRepeater) }; QT_END_NAMESPACE QML_DECLARE_TYPE(QDeclarativeRepeater) #endif // QDECLARATIVEREPEATER_H
{ "content_hash": "dfda0d02f8742b01862b56ef8981bfed", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 102, "avg_line_length": 24.940298507462686, "alnum_prop": 0.7492519449431478, "repo_name": "RikoOphorst/blowbox", "id": "6d69a5111cb944dcbe4e57b4dd88e000d1a63ea4", "size": "3257", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "dependencies/qt/Include/QtDeclarative/5.5.1/QtDeclarative/private/qdeclarativerepeater_p.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "836" }, { "name": "C++", "bytes": "250806" }, { "name": "CSS", "bytes": "25182" }, { "name": "HLSL", "bytes": "1209" } ], "symlink_target": "" }
<link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="__PUBLIC__/css/style.css" type="text/css" /> <link rel="stylesheet" href="__PUBLIC__/css/layer/skin/layer.css" type="text/css" /> <link rel="stylesheet" href="__PUBLIC__/css/main.css" type="text/css" /> <link rel="stylesheet" href="__PUBLIC__/css/base.css" type="text/css" />
{ "content_hash": "c4ab01675cbc0dfdcad934f609038a08", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 86, "avg_line_length": 39.9, "alnum_prop": 0.6491228070175439, "repo_name": "zleevan/industry", "id": "9fdf22192a849b2f67fe83c319333f9146084f6f", "size": "400", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "App/Home/View/Public/head.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "203" }, { "name": "CSS", "bytes": "1580690" }, { "name": "HTML", "bytes": "327014" }, { "name": "JavaScript", "bytes": "3817994" }, { "name": "PHP", "bytes": "1301969" }, { "name": "Smarty", "bytes": "8249" } ], "symlink_target": "" }
SYNONYM #### According to Index Fungorum #### Published in null #### Original name Sphaeria cerastii Riess ### Remarks null
{ "content_hash": "378c1533a1f6d4ab6ee9e03cec4ea16b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 23, "avg_line_length": 9.76923076923077, "alnum_prop": 0.7086614173228346, "repo_name": "mdoering/backbone", "id": "cdb0a95ffb58046c45601218a0b2242e8d35851b", "size": "174", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Sordariomycetes/Diaporthales/Gnomoniaceae/Gnomonia/Gnomonia cerastis/ Syn. Sphaeria cerastii/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.zhuohua.student.service; import java.util.List; import com.zhuohua.student.model.StudentNoticeBoard; public interface NoticeService { public List<StudentNoticeBoard> findNoticeBoards(); public void delteNotice(StudentNoticeBoard sno); public StudentNoticeBoard get(int sno); public List<StudentNoticeBoard> getNoticeFromOther(String sno); public int unReadNews(String sno); public void update(StudentNoticeBoard notice); public List<StudentNoticeBoard> findUnreadNotice(String sno); }
{ "content_hash": "1ff2948a86575a032031760a948e5325", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 67, "avg_line_length": 23.91304347826087, "alnum_prop": 0.76, "repo_name": "tianfengjingjing/WindowsPhone8.1APPBasic", "id": "207fa19f98e1890d53638aa8f1e27555b3be7ff5", "size": "550", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/zhuohua/student/service/NoticeService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "47827" }, { "name": "CSS", "bytes": "52928" }, { "name": "HTML", "bytes": "1929" }, { "name": "Java", "bytes": "1069713" }, { "name": "JavaScript", "bytes": "589643" } ], "symlink_target": "" }
<?php namespace Magento\CheckoutAgreements\Test\Handler\CheckoutAgreement; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Handler\Curl as AbstractCurl; use Magento\Mtf\Util\Protocol\CurlTransport; use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; /** * Class Curl * Curl handler for creating Checkout Agreement */ class Curl extends AbstractCurl implements CheckoutAgreementInterface { /** * Mapping values for data. * * @var array */ protected $mappingData = [ 'is_active' => [ 'Enabled' => 1, 'Disabled' => 0, ], 'is_html' => [ 'HTML' => 1, 'Text' => 0, ], ]; /** * Url for save checkout agreement * * @var string */ protected $url = 'checkout/agreement/save/'; /** * Post request for creating new checkout agreement * * @param FixtureInterface|null $fixture * @return array * @throws \Exception */ public function persist(FixtureInterface $fixture = null) { $url = $_ENV['app_backend_url'] . $this->url; $data = $this->prepareData($fixture); $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); $curl->write($url, $data); $response = $curl->read(); $curl->close(); if (!strpos($response, 'data-ui-id="messages-message-success"')) { throw new \Exception("Checkout agreement creating by curl handler was not successful! Response: $response"); } preg_match('~id\/(\d*?)\/~', $response, $matches); $id = isset($matches[1]) ? $matches[1] : null; return ['agreement_id' => $id]; } /** * Prepare data * * @param FixtureInterface $fixture * @return array */ protected function prepareData($fixture) { $data = []; /** @var \Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement $fixture */ $stores = $fixture->getDataFieldConfig('stores')['source']->getStores(); foreach ($stores as $store) { /** @var \Magento\Store\Test\Fixture\Store $store */ $data['stores'][] = $store->getStoreId(); } $data = $this->replaceMappingData(array_merge($fixture->getData(), $data)); return $data; } }
{ "content_hash": "6dcf5b217b21ada5c754d78b44eb7901", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 120, "avg_line_length": 28.253012048192772, "alnum_prop": 0.5769722814498934, "repo_name": "j-froehlich/magento2_wk", "id": "e3425b12255b9f389e1257e247348bb5efed6e88", "size": "2453", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Handler/CheckoutAgreement/Curl.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "13636" }, { "name": "CSS", "bytes": "2076720" }, { "name": "HTML", "bytes": "6151072" }, { "name": "JavaScript", "bytes": "2488727" }, { "name": "PHP", "bytes": "12466046" }, { "name": "Shell", "bytes": "6088" }, { "name": "XSLT", "bytes": "19979" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "9812f111e096ff2ac1fca9d44991a11f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "e8c38e1e1072d3329af2e6df29ed1f48ca4d1437", "size": "193", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Galium/Galium ossirwaense/Galium ossirwaense ossirwaense/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
#include <linux/jiffies.h> #include <linux/sched.h> #include <linux/timer.h> #include <linux/kthread.h> #include "spk_priv.h" #include "serialio.h" #include "speakup.h" #include "speakup_acnt.h" /* local header file for Accent values */ #define DRV_VERSION "2.10" #define PROCSPEECH '\r' static int synth_probe(struct spk_synth *synth); static void accent_release(void); static const char *synth_immediate(struct spk_synth *synth, const char *buf); static void do_catch_up(struct spk_synth *synth); static void synth_flush(struct spk_synth *synth); static int synth_port_control; static int port_forced; static unsigned int synth_portlist[] = { 0x2a8, 0 }; static struct var_t vars[] = { { CAPS_START, .u.s = {"\033P8" } }, { CAPS_STOP, .u.s = {"\033P5" } }, { RATE, .u.n = {"\033R%c", 9, 0, 17, 0, 0, "0123456789abcdefgh" } }, { PITCH, .u.n = {"\033P%d", 5, 0, 9, 0, 0, NULL } }, { VOL, .u.n = {"\033A%d", 5, 0, 9, 0, 0, NULL } }, { TONE, .u.n = {"\033V%d", 5, 0, 9, 0, 0, NULL } }, { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; /* * These attributes will appear in /sys/accessibility/speakup/acntpc. */ static struct kobj_attribute caps_start_attribute = __ATTR(caps_start, USER_RW, spk_var_show, spk_var_store); static struct kobj_attribute caps_stop_attribute = __ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store); static struct kobj_attribute pitch_attribute = __ATTR(pitch, USER_RW, spk_var_show, spk_var_store); static struct kobj_attribute rate_attribute = __ATTR(rate, USER_RW, spk_var_show, spk_var_store); static struct kobj_attribute tone_attribute = __ATTR(tone, USER_RW, spk_var_show, spk_var_store); static struct kobj_attribute vol_attribute = __ATTR(vol, USER_RW, spk_var_show, spk_var_store); static struct kobj_attribute delay_time_attribute = __ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store); static struct kobj_attribute direct_attribute = __ATTR(direct, USER_RW, spk_var_show, spk_var_store); static struct kobj_attribute full_time_attribute = __ATTR(full_time, ROOT_W, spk_var_show, spk_var_store); static struct kobj_attribute jiffy_delta_attribute = __ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store); static struct kobj_attribute trigger_time_attribute = __ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store); /* * Create a group of attributes so that we can create and destroy them all * at once. */ static struct attribute *synth_attrs[] = { &caps_start_attribute.attr, &caps_stop_attribute.attr, &pitch_attribute.attr, &rate_attribute.attr, &tone_attribute.attr, &vol_attribute.attr, &delay_time_attribute.attr, &direct_attribute.attr, &full_time_attribute.attr, &jiffy_delta_attribute.attr, &trigger_time_attribute.attr, NULL, /* need to NULL terminate the list of attributes */ }; static struct spk_synth synth_acntpc = { .name = "acntpc", .version = DRV_VERSION, .long_name = "Accent PC", .init = "\033=X \033Oi\033T2\033=M\033N1\n", .procspeech = PROCSPEECH, .clear = SYNTH_CLEAR, .delay = 500, .trigger = 50, .jiffies = 50, .full = 1000, .startup = SYNTH_START, .checkval = SYNTH_CHECK, .vars = vars, .probe = synth_probe, .release = accent_release, .synth_immediate = synth_immediate, .catch_up = do_catch_up, .flush = synth_flush, .is_alive = spk_synth_is_alive_nop, .synth_adjust = NULL, .read_buff_add = NULL, .get_index = NULL, .indexing = { .command = NULL, .lowindex = 0, .highindex = 0, .currindex = 0, }, .attributes = { .attrs = synth_attrs, .name = "acntpc", }, }; static inline bool synth_writable(void) { return inb_p(synth_port_control) & SYNTH_WRITABLE; } static inline bool synth_full(void) { return inb_p(speakup_info.port_tts + UART_RX) == 'F'; } static const char *synth_immediate(struct spk_synth *synth, const char *buf) { u_char ch; while ((ch = *buf)) { int timeout = SPK_XMITR_TIMEOUT; if (ch == '\n') ch = PROCSPEECH; if (synth_full()) return buf; while (synth_writable()) { if (!--timeout) return buf; udelay(1); } outb_p(ch, speakup_info.port_tts); buf++; } return 0; } static void do_catch_up(struct spk_synth *synth) { u_char ch; unsigned long flags; unsigned long jiff_max; int timeout; int delay_time_val; int jiffy_delta_val; int full_time_val; struct var_t *delay_time; struct var_t *full_time; struct var_t *jiffy_delta; jiffy_delta = get_var(JIFFY); delay_time = get_var(DELAY); full_time = get_var(FULL); spk_lock(flags); jiffy_delta_val = jiffy_delta->u.n.value; spk_unlock(flags); jiff_max = jiffies + jiffy_delta_val; while (!kthread_should_stop()) { spk_lock(flags); if (speakup_info.flushing) { speakup_info.flushing = 0; spk_unlock(flags); synth->flush(synth); continue; } if (synth_buffer_empty()) { spk_unlock(flags); break; } set_current_state(TASK_INTERRUPTIBLE); full_time_val = full_time->u.n.value; spk_unlock(flags); if (synth_full()) { schedule_timeout(msecs_to_jiffies(full_time_val)); continue; } set_current_state(TASK_RUNNING); timeout = SPK_XMITR_TIMEOUT; while (synth_writable()) { if (!--timeout) break; udelay(1); } spk_lock(flags); ch = synth_buffer_getc(); spk_unlock(flags); if (ch == '\n') ch = PROCSPEECH; outb_p(ch, speakup_info.port_tts); if (jiffies >= jiff_max && ch == SPACE) { timeout = SPK_XMITR_TIMEOUT; while (synth_writable()) { if (!--timeout) break; udelay(1); } outb_p(PROCSPEECH, speakup_info.port_tts); spk_lock(flags); jiffy_delta_val = jiffy_delta->u.n.value; delay_time_val = delay_time->u.n.value; spk_unlock(flags); schedule_timeout(msecs_to_jiffies(delay_time_val)); jiff_max = jiffies+jiffy_delta_val; } } timeout = SPK_XMITR_TIMEOUT; while (synth_writable()) { if (!--timeout) break; udelay(1); } outb_p(PROCSPEECH, speakup_info.port_tts); } static void synth_flush(struct spk_synth *synth) { outb_p(SYNTH_CLEAR, speakup_info.port_tts); } static int synth_probe(struct spk_synth *synth) { unsigned int port_val = 0; int i = 0; pr_info("Probing for %s.\n", synth->long_name); if (port_forced) { speakup_info.port_tts = port_forced; pr_info("probe forced to %x by kernel command line\n", speakup_info.port_tts); if (synth_request_region(speakup_info.port_tts-1, SYNTH_IO_EXTENT)) { pr_warn("sorry, port already reserved\n"); return -EBUSY; } port_val = inw(speakup_info.port_tts-1); synth_port_control = speakup_info.port_tts-1; } else { for (i = 0; synth_portlist[i]; i++) { if (synth_request_region(synth_portlist[i], SYNTH_IO_EXTENT)) { pr_warn ("request_region: failed with 0x%x, %d\n", synth_portlist[i], SYNTH_IO_EXTENT); continue; } port_val = inw(synth_portlist[i]) & 0xfffc; if (port_val == 0x53fc) { /* 'S' and out&input bits */ synth_port_control = synth_portlist[i]; speakup_info.port_tts = synth_port_control+1; break; } } } port_val &= 0xfffc; if (port_val != 0x53fc) { /* 'S' and out&input bits */ pr_info("%s: not found\n", synth->long_name); synth_release_region(synth_port_control, SYNTH_IO_EXTENT); synth_port_control = 0; return -ENODEV; } pr_info("%s: %03x-%03x, driver version %s,\n", synth->long_name, synth_port_control, synth_port_control+SYNTH_IO_EXTENT-1, synth->version); synth->alive = 1; return 0; } static void accent_release(void) { if (speakup_info.port_tts) synth_release_region(speakup_info.port_tts-1, SYNTH_IO_EXTENT); speakup_info.port_tts = 0; } module_param_named(port, port_forced, int, S_IRUGO); module_param_named(start, synth_acntpc.startup, short, S_IRUGO); MODULE_PARM_DESC(port, "Set the port for the synthesizer (override probing)."); MODULE_PARM_DESC(start, "Start the synthesizer once it is loaded."); static int __init acntpc_init(void) { return synth_add(&synth_acntpc); } static void __exit acntpc_exit(void) { synth_remove(&synth_acntpc); } module_init(acntpc_init); module_exit(acntpc_exit); MODULE_AUTHOR("Kirk Reiser <[email protected]>"); MODULE_AUTHOR("David Borowski"); MODULE_DESCRIPTION("Speakup support for Accent PC synthesizer"); MODULE_LICENSE("GPL"); MODULE_VERSION(DRV_VERSION);
{ "content_hash": "e4b682c87ed4d1a70d0a7685722c96ae", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 79, "avg_line_length": 26.434083601286172, "alnum_prop": 0.6659773750152049, "repo_name": "indashnet/InDashNet.Open.UN2000", "id": "bbe28b6809e0707306debd18b79d4947e829427a", "size": "9338", "binary": false, "copies": "7583", "ref": "refs/heads/master", "path": "lichee/linux-3.4/drivers/staging/speakup/speakup_acntpc.c", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Using Git (Here at IGN) - IGN Code Foo</title> <meta name="description" content="An easy to use CSS 3D slideshow tool for quickly creating good looking HTML presentations."> <meta name="author" content="Hakim El Hattab"> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/ign.css"> <link rel="stylesheet" href="css/print.css" type="text/css" media="print"> <script type="text/javascript">//<![CDATA[ var _gaq = _gaq || []; _gaq.push(['_setAccount','UA-26995979-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); //]]></script> </head> <body> <div class="reveal"> <!-- Used to fade in a background when a specific slide state is reached --> <div class="state-background"></div> <!-- Any section element inside of this container is displayed as a slide --> <div class="slides"> <section> <h4 class="red"><img class="logo" src="assets/images/logo.png" /> Code Foo</h4> <h1>Using Git</h1> <h3 class="inverted">Here At IGN</h3> <script> // Delicously hacky. Look away. if( navigator.userAgent.match( /(iPhone|iPad|iPod|Android)/i ) ) document.write( '<p style="color: rgba(0,0,0,0.3); text-shadow: none;">('+'Tap to navigate'+')</p>' ); </script> </section> <section> <h2>Who am I?</h2> <p>I'm Jon Tai on the frontend engineering team.</p> <p>I go by <b style="font-size: 130%; margin-left: 0.1em; margin-right: 0.1em;">jtai</b> on Twitter, GitHub, and IGN's Jabber.</p> </section> <section> <section> <h2>What is Git?</h2> <p> You should already have some idea, since you<br />used Git to apply for Code Foo. </p> </section> <section> <blockquote cite="http://en.wikipedia.org/wiki/Git_(software)"> Git is a distributed revision control and source code management system ... </blockquote> <p> <i><small style="vertical-align: middle;">- <a href="http://en.wikipedia.org/wiki/Git_(software)">Wikipedia</a></small></i> </p> <p> <i>Distributed</i> means you ask people to <i>pull</i> your changes instead of <i>pushing</i> your changes to a central repository. </p> </section> <section> <blockquote cite="http://git-scm.com/"> ... with features like cheap local branching, convenient staging areas, and multiple workflows </blockquote> <p> <i><small style="vertical-align: middle;">- <a href="http://git-scm.com/">git-scm.com</a></small></i> </p> <p> And it's fast, too. </p> </section> </section> <section> <section> <h2>Get Git</h2> <p> Follow this handy <a href="https://help.github.com/articles/set-up-git">tutorial</a> at GitHub. </p> </section> <section> <p> Most of us actually install Git with <a href="http://mxcl.github.com/homebrew/">Homebrew</a>, which we also use to install other stuff like memcache. </p> <p style="margin-top: 0.8em;"> Skip the "GitHub for Mac" GUI; if you want a GUI,<br />try <a href="http://gitx.frim.nl/index.html">GitX</a> instead. </p> </section> </section> <section> <h2>Terminology</h2> <ul> <li>Repository</li> <li>Fork</li> <li>Remote</li> <li>Index</li> <li>Commit</li> <li>Branch</li> </ul> </section> <section> <section> <h2>Repository</h2> <p> The complete collection of a project's files<br />and the history of those files. </p> </section> <section> <p> Repositories are mirrored to GitHub<br />and shared with all collaborators. <br /><img src="assets/images/macbook_pro.png" height="256" width="256" style="vertical-align: middle;" /> ► <img src="assets/images/octocat.png" height="256" width="256" style="vertical-align: middle;" /> ► <img src="assets/images/adam.png" height="160" width="160" style="margin-left: 20px; vertical-align: middle;" /> </p> </section> </section> <section> <section> <h2>Fork</h2> <p> A personal copy of a repository. <br /><img src="assets/images/octocat_with_ign.png" height="256" width="256" style="vertical-align: middle;" /> ► <img src="assets/images/octocat.png" height="256" width="256" style="vertical-align: middle;" /> </p> </section> <section> <p> If you don't have write access to a repository, you can make your own copy of it and commit to the copy. </p> </section> <section> <p> You can publish your fork. You can also ask the original repository's owner to pull your changes. </p> <p style="margin-top: 0.8em;"> GitHub makes this process very, very easy. <br /><img src="assets/images/easy_button.png" /> </p> </section> </section> <section> <section> <h2>Remote</h2> <p> A copy of a repository, typically<br />hosted someplace like GitHub. </p> </section> <section> <p> When you clone a repository, the source repository is automatically added as a remote called <code>origin</code>. </p> </section> <section> <p> If you're cloning a fork, you probably want to add a remote pointing to the original repository. By convention, this remote is called <code>upstream</code>. </p> </section> <section> <p> You can push changes from your local repository to <code>origin</code> (or any other remotes you configure). <br /><img src="assets/images/macbook_pro.png" height="256" width="256" style="vertical-align: middle;" /> ► <img src="assets/images/octocat.png" height="256" width="256" style="vertical-align: middle;" /> </p> </section> <section> <p> You can also pull changes from <code>origin</code><br />into your local repository. <br /><img src="assets/images/octocat.png" height="256" width="256" style="vertical-align: middle;" /> ► <img src="assets/images/macbook_pro.png" height="256" width="256" style="vertical-align: middle;" /> </p> </section> <section> <p> Your local repository remembers the state of each remote. This state is updated every time you do a<br /><code>git fetch</code>. <br /><img src="assets/images/macbook_pro_with_octocat.png" height="256" width="256" style="vertical-align: middle;" /> ◄► <img src="assets/images/octocat.png" height="256" width="256" style="vertical-align: middle;" /> </p> </section> </section> <section> <section> <h2>Index</h2> <p> A staging area for changes. </p> </section> <section> <p> The index stores the state of all files in the repository. <br /><img src="assets/images/git_index.png" height="404" width="296" /> </p> </section> <section> <p> The index does not automatically reflect the files<br />in your working directory! Changes must be<br />explictly added to the index. </p> </section> </section> <section> <section> <h2>Commit</h2> <p> A change to a repository, including all of the<br />metadata associated with that change. </p> </section> <section> <p> Metadata includes the author, the date, a short log message, and the state of all files in the repository. <br /><img src="assets/images/git_commit.png" height="404" width="296" /> </p> </section> <section> <p> The first commit in a repository has no parents.<br />Most commits have one parent, but some commits <br />can have more than one parent. <br /><img src="assets/images/git_commit_parents.png" /> </p> </section> </section> <section> <section> <h2>Branch</h2> <p> A line of development; a series of commits. </p> </section> <section> <p> By convention, the "main" branch is called <code>master</code>. </p> </section> <section> <p> Each commit already knows its parent, so a branch only needs to reference the last commit in the branch. <br /><img src="assets/images/git_branch_symref.png" /> </p> </section> <section> <p> Branches allow development to occur in parallel. <br /><img src="assets/images/git_branches.png" height="470" width="659" /> </p> </section> <section> <p> Branches are usually merged with other branches to reunite separate development efforts. <br /><img src="assets/images/git_merges.png" height="471" width="837" /> </p> </section> </section> <section> <h2>Common Tasks</h2> <ul style="font-size: 80%; line-height: 120%;"> <li>Forking</li> <li>Cloning</li> <li>Branching</li> <li>Working</li> <li>Checking Status</li> <li>Viewing Changes</li> <li>Discarding Changes</li> <li>Adding Changes to the Index</li> <li>Committing</li> <li>Comparing with <code>master</code></li> <li>Pushing</li> <li>Pulling</li> <li>Merging</li> </ul> </section> <section> <section> <h2>Forking</h2> <p> Makes a personal copy of a repository. <br /><img src="assets/images/github_fork_btn.png" /> </p> </section> <section> <p> You will want to do all your branching<br />and committing in your own fork. </p> </section> <section> <p> When you're ready to ship, submit a pull request.<br />(More on pull requests later.) </p> </section> <section> <p> GitHub has a <a href="https://help.github.com/articles/fork-a-repo">guide</a> on forks. </p> </section> </section> <section> <section> <h2>Cloning</h2> <code>git clone [email protected]:ign/project.git</code> <p style="margin-top: 0.8em;"> Makes a local copy of the remote<br />repository for you to work in. <br /><img src="assets/images/octocat.png" height="256" width="256" style="vertical-align: middle;" /> ► <img src="assets/images/macbook_pro.png" height="256" width="256" style="vertical-align: middle;" /> </p> </section> <section> <p> Each project has its own unique URL; check the project's page on GitHub for the URL you should use. <br /><img src="assets/images/github_project_url.png" /> </p> </section> <section> <p> If you have a fork, make sure to clone the fork,<br />not the original repository. </p> <p style="margin-top: 0.8em;"> <code style="white-space: nowrap;">git clone [email protected]:<b style="font-size: 130%;">jtai</b>/project.git</code> </p> </section> <section> <p> Unless you <i>really</i> screw up your local repository, you should only need to clone each project once. </p> </section> </section> <section> <section> <h2>Branching</h2> <code>git checkout -b &lt;branch&gt;</code> <p style="margin-top: 0.8em;"> Creates a new branch off of the current branch's latest commit. It also switches to the new branch. <br /><img src="assets/images/git_branches.png" height="314" width="440" /> </p> </section> <section> <p> You should create a branch for every feature<br />or bug you work on. More on this later. </p> </section> <section> <p> To switch branches, use <code>git checkout &lt;branch&gt;</code> (without the <code>-b</code>). </p> </section> <section> <p> If you need the branch on a second machine, first make sure it's pushed to GitHub from the original machine. </p> <p style="margin-top: 0.8em;"> Then do a <code>git pull</code> on the second machine, and use <code>git checkout &lt;branch&gt;</code> to switch to the branch. </p> </section> </section> <section> <h2>Working</h2> <img src="assets/images/programming.gif" /> </section> <section> <h2>Checking Status</h2> <code>git status</code> <p style="margin-top: 0.8em;"> Shows you the state of your working directory,<br />the index, and the remote. </p> <pre><code contenteditable style="font-size: 18px; margin-top: 20px;"># On branch master # Your branch is ahead of 'origin/master' by 5 commits. # # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: assets/images/logo.png # # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: index.html # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # assets/images/git_url.png # assets/images/programming.gif </code></pre> </section> <section> <section> <h2>Viewing Changes</h2> <code>git diff</code> <p style="margin-top: 0.8em;"> Shows you the changes in your working<br />directory relative to the index. </p> </section> <section> <p> So if you add a change to the index, it won't show up in <code>git diff</code> anymore. This lets you add changes to the index one by one until <code>git diff</code> output is empty. </p> </section> </section> <section> <section> <h2>Discarding Changes</h2> <code>git checkout -- &lt;file&gt;</code> <p style="margin-top: 0.8em;"> Discards uncommitted changes in your working<br />directory by re-checking out the file. </p> </section> <section> <p> <code>git checkout</code> can also take a branch argument,<br />so the <code>--</code> means "what comes after this is a file". </p> </section> <section> <p> This operation is called "revert" in some other systems<br />(CVS, Subversion, Mercurial) </p> </section> </section> <section> <section> <h2>Adding Changes to the Index</h2> <code>git add &lt;file&gt;</code> <p style="margin-top: 0.8em;"> Adds a file (or the changes to a file, if the file is<br />already managed by Git) to the index. </p> </section> <section> <p> Unlike some other systems, you have to add a file<br />to the index every time it changes, not just the<br />first time you add the file. </p> </section> <section> <p> To view changes that have been staged in the index, use <code>git diff --cached</code> </p> </section> </section> <section> <section> <h2>Committing</h2> <code>git commit</code> <p style="margin-top: 0.8em;"> You will be prompted for a commit message,<br />then the changes staged in the index<br />will become an actual commit. </p> </section> <section> <p> The first line of a commit message should be<br />a short summary of the changes you made<br />(50 characters or less). </p> </section> <section> <p> If necessary, a more detailed explanation (perhaps<br />of <i>why</i> you made the change) should follow<br />after an empty blank line. </p> <pre><code contenteditable style="font-size: 16px; margin-top: 20px;">commit b8803de64e724cde0e802053e031189726b5caed Author: Jonathan Tai &lt;<script>var x2 = 'ai@'; x1 = 'jt'; x3 = 'ign.com'; document.write(x1 + x2 + x3);</script>&gt; Date: Fri Jul 6 11:34:00 2012 -0700 Updated object migration to use new release status field for all regions This applies the same change as c1a28a09c0721be9105895992524f5c1105ddbc8, except for UK, AU, and JP. Since the Object API is already using the new "status" field, UK/AU/JP status updates were not being written to the API because the migration script was setting the old "released" field. </code></pre> </section> <section> <p> More guidelines (and rationale) can be<br />found in this <a href="http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html">blog post</a>. </p> </section> </section> <section> <section> <h2>Comparing with master</h2> <code>git diff master...&lt;branch&gt;</code> <p style="margin-top: 0.8em;"> Shows the changes in your branch that are not in master. </p> </section> <section> <p> You should compare your branch with master before you push (publish your code) to make sure the changes<br />are what you think they should be. </p> </section> <section> <p> You should make sure your local <code>master</code><br />is up to date before diffing. </p> </section> <section> <p> Changes in master that are not in your branch will not be shown. To show the actual diff, use two dots instead. <br /><code>git diff master..&lt;branch&gt;</code> </p> </section> </section> <section> <section> <h2>Pushing</h2> <code>git push -u origin &lt;branch&gt;</code> <p style="margin-top: 0.8em;"> Pushes changes in <code>branch</code> to <code>origin</code>, making<br />your changes accessible to others. <br /><img src="assets/images/macbook_pro.png" height="256" width="256" style="vertical-align: middle;" /> ► <img src="assets/images/octocat.png" height="256" width="256" style="vertical-align: middle;" /> </p> </section> <section> <p> The <code>-u</code> argument sets up your local branch<br />to track the remote branch so it will be<br />updated if you do a <code>git pull</code> later. </p> </section> <section> <p> It's a good idea to push at least once a day<br />to ensure your work is backed up in case<br />something bad happens to your laptop. </p> </section> </section> <section> <section> <h2>Pulling</h2> <code>git pull</code> <p style="margin-top: 0.8em;"> Updates your current branch with<br />changes from <code>origin</code>. <br /><img src="assets/images/octocat.png" height="256" width="256" style="vertical-align: middle;" /> ► <img src="assets/images/macbook_pro.png" height="256" width="256" style="vertical-align: middle;" /> </p> </section> <section> <p> <code>git pull</code> is actually a shortcut for two other operations: <code>git fetch</code> and <code>git merge</code>. </p> </section> <section> <h2>git fetch</h2> <p> Downloads changes from a remote repository, updating your local repository. Your local branches and working directory are <i>not</i> updated. <br /><img src="assets/images/octocat.png" height="256" width="256" style="vertical-align: middle;" /> ► <img src="assets/images/macbook_pro_with_octocat.png" height="256" width="256" style="vertical-align: middle;" /> </p> </section> <section> <h2>git merge</h2> <p> The newly-downloaded changes from the remote branch will be merged into your current local branch.<sup>*</sup> <br />The working directory is also updated. </p> <p style="margin-top: 0.8em;"> <i><small>*If your current local branch is configured to track a remote branch</small></i> </p> </section> <section> <p> Since a merge is performed, you should make sure your working directory is clean before doing a <code>git pull</code>. </p> </section> </section> <section> <section> <h2>Merging</h2> <code>git merge &lt;branch&gt;</code> <p style="margin-top: 0.8em;"> Merges changes from <code>branch</code> into your current branch. <br /><img src="assets/images/git_merges.png" height="314" width="558" /> </p> </section> <section> <p> There are two typical reasons to do this. </p> </section> <section> <p> If you're working on a branch for a long time, you will want to periodically merge <code>master</code> into your branch. <br /><img src="assets/images/git_merge_from_master.png" height="317" width="684" /> <br />Switch to your branch with <code>git checkout &lt;branch&gt;</code>, then do <code>git merge master</code>. </p> </section> <section> <p> When you're done with a branch, you will want to<br />merge your branch into <code>master</code>. <br /><img src="assets/images/git_merges.png" height="314" width="558" /> <br />Switch to <code>master</code> with <code>git checkout master</code>,<br />then do <code>git merge &lt;branch&gt;</code>. </p> </section> <section> <p> If conflicting changes are introduced in the two branches being merged, a merge conflict will occur. Ask for help. </p> </section> </section> <section> <h2>Workflow</h2> <ul> <li>When to Branch</li> <li>Pull Requests</li> <li>Working with Forks</li> </ul> </section> <section> <section> <h2>When to Branch</h2> <p> You should create a branch for every<br />feature or bug you work on. </p> </section> <section> <p> Branches allow you (or us as a team) to<br />work on separate things in parallel. </p> </section> <section> <p> These things can then be reviewed,<br />tested, and merged separately. </p> </section> <section> <p> Keeping changes isolated until they're ready keeps your <code>master</code> branch deployable at all times. </p> </section> </section> <section> <section> <h2>Pull Requests</h2> <p> GitHub pull requests are an easy way to track proposed changes. Just push your branch, then open a pull request. <br /><img src="assets/images/github_pull_request_btn.png" /> </p> </section> <section> <p> Everyone with write access to the target repository<br />will be notified. The change can be discussed as<br />a whole or line by line. <br /><img src="assets/images/github_pull_request.png" /> </p> </section> <section> <p> Generally a reviewer would accept your pull request by merging the changes, but if your project uses a shared repository, you may be asked to merge and<br />close your own pull request. </p> </section> <section> <p> What happens after the code is merged<br />depends on the project. </p> </section> </section> <section> <section> <h2>Working with Forks</h2> <p> Forks can be little more complicated because you have two repositories to deal with instead of just one. <br /><img src="assets/images/octocat_with_ign.png" height="256" width="256" style="vertical-align: middle;" /> ► <img src="assets/images/octocat.png" height="256" width="256" style="vertical-align: middle;" /> </p> </section> <section> <p> Fortunately, the concepts are mostly the same. Work in a branch (in your fork), pull periodically from upstream, and submit a pull request when you're ready to ship. <br /><img src="assets/images/working_with_forks.png" height="360" width="480" /> </p> <p style="margin-top: 0.8em;"> <i><small>(Diagram is vastly over-simplified)</small></i> </p> </section> <section> <p> If you're using a fork, don't commit to the <code>master</code> branch (or any branch that exists in <code>upstream</code>). Instead,<br />set <code>master</code> aside for tracking <code>upstream</code><br />and make all your changes in a branch. </p> </section> <section> <p> To update your <code>master</code> branch, switch to <code>master</code>,<br />do a fetch and merge from <code>upstream</code>, then push it to<br />your fork (<code>origin</code>). </p> <pre><code contenteditable style="font-size: 18px; margin-top: 20px;">git checkout master git fetch upstream git merge upstream/master git push origin master </code></pre> </p> </section> <section> <p> Once your fork (<code>origin</code>) is up to date, merge from master into your branch to update it just as you<br />would if you weren't using a fork. </p> <pre><code contenteditable style="font-size: 18px; margin-top: 20px;">git checkout &lt;branch&gt; git merge master </code></pre> </p> </section> </section> <section> <h2>Final Thoughts</h2> <p>(Yes, this will be over soon.)</p> </section> <section> <h2>Branch and Commit Often</h2> <p> Branches are cheap, and commits are fast. Don't work on something for a week, then check it all in at once. </p> <p style="margin-top: 0.8em;"> <i><small>(But don't over-do it, every commit should at least parse/build)</small></i> </p> </section> <section> <h2>Deleting Code</h2> <p> Don't be afraid to delete code, or even entire files. As long as that code was previously committed, it will be in the revision history forever, so we can always get it back. </p> </section> <section> <h2>Large Blobs</h2> <p> Don't add large binary blobs to the repository. Once you add it, even if you delete it, it will take up space in the revision history forever. </p> </section> <section> <section data-state="alert"> <h2>Argumented git pull</h2> <p> Do <i>not</i> use <code>git pull</code> with a fourth refspec argument,<br />e.g., <code>git pull origin master</code>. </p> <p style="margin-top: 0.8em;"> It doesn't do what you think it does. </p> </section> <section> <p> <code>git pull origin master</code> merges changes<br />from the remote <code>master</code> branch directly into<br />your current local branch. </p> </section> <section> <p> A bare <code>git pull</code> will only merge a remote branch into a local branch with the same name<sup>*</sup>. </p> <p style="margin-top: 0.8em;"> With a refspec, <code>git pull</code> acts more like <code>git merge</code>, so you can accidentally merge two branches when you just meant to update your branch. </p> <p style="margin-top: 2em;"> <i><small style="vertical-align: middle;">Actually, it will use the tracking branch configuration you specified using <code>git push -u</code>, but unless you have a really odd configuration, local and remote branch names will be the same</small></i> </p> </section> <section> <p> Further, the remote references on your machine are<br />not updated, so <code>git status</code> will say you're ahead<br />of origin when you're really not. </p> </section> <section> <p> <code>git push origin &lt;branch&gt;</code> is perfectly fine. </p> <p style="margin-top: 0.8em;"> In fact, it is encouraged, otherwise you will push all branches. Any local branches that are out of date will fail to push, and any local branches that have been<br />deleted on the remote will be re-created. </p> </section> </section> <section> <h2>Additional Resources</h2> <ul> <li><a href="https://github.com/blog/120-new-to-git/">New to Git?</a> on GitHub lists a few beginner's guides</li> <li>The <a href="http://git-scm.com/documentation">documentation</a> page on git-scm.com has online manual pages, a book, and videos</li> <li>This <a href="http://mislav.uniqpath.com/2010/07/git-tips/">blog post</a> has some advanced tips you probably<br />don't know</li> </ul> </section> <section> <h2>Getting Help</h2> <p> Google, <code>git help &lt;command&gt;</code>, or<br />ask one of the engineers! </p> </section> <section> <h1>The End</h1> <h3 class="inverted">Any questions?</h3> </section> <section> <h2>Presentation</h2> <p><b style="font-size: 130%;">jontai.me/presentations</b></p> <h2 style="margin-top: 1.4em;">Presenter</h2> <p><b style="font-size: 130%; margin-left: 0.1em; margin-right: 0.1em;">jtai</b> on Twitter, GitHub, and IGN's Jabber</p> </section> </div> <!-- The navigational controls UI --> <aside class="controls"> <a class="left" href="#">&#x25C4;</a> <a class="right" href="#">&#x25BA;</a> <a class="up" href="#">&#x25B2;</a> <a class="down" href="#">&#x25BC;</a> </aside> <!-- Displays presentation progress, max value changes via JS to reflect # of slides --> <div class="progress"><span></span></div> </div> <!-- Optional libraries for code syntax highlighting and classList support in IE9 --> <!--<script src="lib/highlight.js"></script>--> <script src="lib/classList.js"></script> <script src="js/reveal.js"></script> <script> // Parse the query string into a key/value object var query = {}; location.search.replace( /[A-Z0-9]+?=(\w*)/gi, function(a) { query[ a.split( '=' ).shift() ] = a.split( '=' ).pop(); } ); // Fires when a slide with data-state=customevent is activated Reveal.addEventListener( 'customevent', function() { alert( '"customevent" has fired' ); } ); // Fires each time a new slide is activated Reveal.addEventListener( 'slidechanged', function( event ) { // event.previousSlide, event.currentSlide, event.indexh, event.indexv } ); Reveal.initialize({ // Display controls in the bottom right corner controls: true, // Display a presentation progress bar progress: true, // If true; each slide will be pushed to the browser history history: true, // Loops the presentation, defaults to false loop: false, // Flags if mouse wheel navigation should be enabled mouseWheel: true, // Apply a 3D roll to links on hover rollingLinks: false, // UI style theme: query.theme || 'default', // default/neon // Transition style transition: query.transition || 'default' // default/cube/page/concave/linear(2d) }); //hljs.initHighlightingOnLoad(); </script> </body> </html>
{ "content_hash": "1d4c6ac6bbfac16e83bdabaad8cf82e2", "timestamp": "", "source": "github", "line_count": 910, "max_line_length": 188, "avg_line_length": 34.676923076923075, "alnum_prop": 0.6012802636582584, "repo_name": "jtai/code-foo-git-intro", "id": "afa0549843b5b8ab705c42c39a824b8ca0cd79e5", "size": "31580", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.html", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "27912" } ], "symlink_target": "" }
layout: page title: dz-Algeria --- {% include postbycat key="dz" %}
{ "content_hash": "60ba8c487d183f3851bbd8236ad1d3ca", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 32, "avg_line_length": 16.75, "alnum_prop": 0.6716417910447762, "repo_name": "binhbat/binhbat.github.io", "id": "fc3d1749cd30567d56162726387fbe0700278fa9", "size": "71", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_drafts/dz/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "353" }, { "name": "HTML", "bytes": "20897" }, { "name": "JavaScript", "bytes": "479" } ], "symlink_target": "" }
package net.glowstone.inventory.crafting; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BannerMeta; import java.util.ArrayList; public class GlowBannerCopyMatcher extends ItemMatcher { /* - Must be exactly two banners - 1 with no pattern, and 1 with at least one layer - Must be same colour - No other items allowed in matrix */ @Override public ItemStack getResult(ItemStack[] matrix) { ArrayList<ItemStack> banners = new ArrayList<>(); for (ItemStack item : matrix) { if (item == null) { continue; } // TODO: handle all new banner types if (item.getType() == Material.LEGACY_BANNER) { banners.add(item); continue; } return null; // Non-banner item in matrix } if (banners.size() != 2) { return null; // Must have 2 banners only } if (banners.get(0).getDurability() != banners.get(1).getDurability()) { return null; // Not same color } ItemStack original = null; ItemStack blank = null; for (ItemStack banner : banners) { BannerMeta meta = (BannerMeta) banner.getItemMeta(); if (meta.getPatterns().isEmpty()) { if (blank != null) { return null; // More than 1 blank } blank = banner; } else { if (original != null) { return null; // More than 1 original } original = banner; } } if (original == null || blank == null) { return null; // Haven't got both needed banners } return original.clone(); } //TODO: Keep banner in matrix after crafting }
{ "content_hash": "0ca292e78b311069520f6b5055225507", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 79, "avg_line_length": 27.6231884057971, "alnum_prop": 0.527806925498426, "repo_name": "GlowstonePlusPlus/GlowstonePlusPlus", "id": "bec306de5a8b60cd63fef899bc14b87954228235", "size": "1906", "binary": false, "copies": "2", "ref": "refs/heads/dev", "path": "src/main/java/net/glowstone/inventory/crafting/GlowBannerCopyMatcher.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "2325722" }, { "name": "Python", "bytes": "1031" }, { "name": "Ruby", "bytes": "335" }, { "name": "Shell", "bytes": "2214" } ], "symlink_target": "" }
namespace Microsoft.Azure.Management.WebSites.Models { using System; using System.Linq; using System.Collections.Generic; using Newtonsoft.Json; using Microsoft.Rest; using Microsoft.Rest.Serialization; using Microsoft.Rest.Azure; /// <summary> /// Contact information for domain registration. If 'Domain Privacy' /// option is not selected then the contact information will be be made /// publicly available through the Whois directories as per ICANN /// requirements. /// </summary> public partial class Contact { /// <summary> /// Initializes a new instance of the Contact class. /// </summary> public Contact() { } /// <summary> /// Initializes a new instance of the Contact class. /// </summary> public Contact(Address addressMailing = default(Address), string email = default(string), string fax = default(string), string jobTitle = default(string), string nameFirst = default(string), string nameLast = default(string), string nameMiddle = default(string), string organization = default(string), string phone = default(string)) { AddressMailing = addressMailing; Email = email; Fax = fax; JobTitle = jobTitle; NameFirst = nameFirst; NameLast = nameLast; NameMiddle = nameMiddle; Organization = organization; Phone = phone; } /// <summary> /// Mailing address /// </summary> [JsonProperty(PropertyName = "addressMailing")] public Address AddressMailing { get; set; } /// <summary> /// Email address /// </summary> [JsonProperty(PropertyName = "email")] public string Email { get; set; } /// <summary> /// Fax number /// </summary> [JsonProperty(PropertyName = "fax")] public string Fax { get; set; } /// <summary> /// Job title /// </summary> [JsonProperty(PropertyName = "jobTitle")] public string JobTitle { get; set; } /// <summary> /// First name /// </summary> [JsonProperty(PropertyName = "nameFirst")] public string NameFirst { get; set; } /// <summary> /// Last name /// </summary> [JsonProperty(PropertyName = "nameLast")] public string NameLast { get; set; } /// <summary> /// Middle name /// </summary> [JsonProperty(PropertyName = "nameMiddle")] public string NameMiddle { get; set; } /// <summary> /// Organization /// </summary> [JsonProperty(PropertyName = "organization")] public string Organization { get; set; } /// <summary> /// Phone number /// </summary> [JsonProperty(PropertyName = "phone")] public string Phone { get; set; } } }
{ "content_hash": "35caaec49b5d2da801bb44f2fdcb87b0", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 341, "avg_line_length": 31.410526315789475, "alnum_prop": 0.5636729222520107, "repo_name": "smithab/azure-sdk-for-net", "id": "7e92300b7e3ae502004b6251112322396542ba47", "size": "3305", "binary": false, "copies": "5", "ref": "refs/heads/AutoRest", "path": "src/ResourceManagement/WebSite/Microsoft.Azure.Management.Websites/Generated/Models/Contact.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "118" }, { "name": "Batchfile", "bytes": "22878" }, { "name": "C#", "bytes": "33519703" }, { "name": "CSS", "bytes": "685" }, { "name": "JavaScript", "bytes": "7875" }, { "name": "PowerShell", "bytes": "19852" }, { "name": "Shell", "bytes": "687" }, { "name": "XSLT", "bytes": "6114" } ], "symlink_target": "" }