text stringlengths 2 1.04M | meta dict |
|---|---|
'use strict';
const Blog = require('../models/Blog');
/**
* GET /blog
*/
exports.getIndex = (req, res) => {
Blog.find({owner: req.user.id}, (err, result, next) => {
if (err) {
return next(err);
}
res.render('blog/index', {
blogs: result,
title: 'Articles'
});
})
};
/**
* GET /blog/:slug
*/
exports.getShowBlog = (req, res) => {
const slug = req.params.slug;
Blog.findOne({slug: slug}, (err, result, next) => {
if (err) {
return next(err);
}
res.render('blog/show', {
post: result,
title: 'Articles'
});
})
};
/**
* GET /blog/new
*/
exports.getNewBlog = (req, res) => {
res.render('blog/new', {
title: 'Articles'
});
};
/**
* POST /blog/new
*/
exports.postNewBlog = (req, res) => {
req.assert('title', 'Title cannot be blank').notEmpty();
req.assert('bodyBlog', 'Text cannot be blank').notEmpty();
const errors = req.validationErrors();
if (errors) {
req.flash('errors', errors);
return res.redirect('/blog/new');
}
const blog = new Blog({
title: req.body.title,
bodyBlog: req.body.bodyBlog,
publishedAt: Date(),
owner: req.user.id
});
blog.save((err) => {
if (err) { return next(err); }
req.flash('success', {msg: 'Article was created successfully.'});
res.redirect('/blog');
});
};
/**
* GET /blog/edit
*/
exports.getUpdateBlog = (req, res, next) => {
const slug = req.params.slug;
Blog.findOne({slug: slug}, (err, blog) => {
if (err) { return next(err); }
if (blog.owner != req.user.id) {
res.status(403).send();
return;
}
res.render('blog/edit', {
blog: blog,
title: 'Articles'
});
});
};
/**
* POST /blog/edit
*/
exports.postUpdateBlog = (req, res) => {
const slug = req.params.slug;
req.assert('title', 'Title cannot be blank').notEmpty();
req.assert('bodyBlog', 'Text cannot be blank').notEmpty();
const errors = req.validationErrors();
if (errors) {
req.flash('errors', errors);
return res.redirect('/blog/new');
}
Blog.findOne({slug: slug}, (err, blog) => {
if (err) { return next(err); }
blog.title = req.body.title;
blog.bodyBlog = req.body.bodyBlog;
blog.save((err) => {
if (err) { return next(err); }
req.flash('success', { msg: 'Article has been changed.' });
res.redirect('/blog');
});
});
};
/**
* POST /blog/delete
* Delete user account.
*/
exports.postDeleteBlog = (req, res, next) => {
const slug = req.params.slug;
Blog.remove({ slug: slug }, (err) => {
if (err) { return next(err); }
req.flash('info', { msg: 'Article has been deleted.' });
res.redirect('/blog');
});
};
| {
"content_hash": "fa25561e81d54cd368b7ac647f8d52eb",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 73,
"avg_line_length": 22.79230769230769,
"alnum_prop": 0.5072561592980088,
"repo_name": "alexgoncharcherkassy/express-blog",
"id": "ace0f268a6ece65aef493a6d55f5fd18cd46869e",
"size": "2963",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "controllers/blog.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "174560"
},
{
"name": "HTML",
"bytes": "17285"
},
{
"name": "JavaScript",
"bytes": "34272"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<title _locid="PortabilityAnalysis0">.NET Portability Report</title>
<style>
/* Body style, for the entire document */
body {
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1 {
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2 {
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3 {
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
h4 {
font-weight: normal;
font-size: 12pt;
margin: 0;
padding: 0 0 0 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a {
color: #1382CE;
}
/* Paragraph text (for longer informational messages) */
p {
font-size: 10pt;
}
/* Table styles */
table {
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th {
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td {
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
.NoBreakingChanges {
color: darkgreen;
font-weight:bold;
}
.FewBreakingChanges {
color: orange;
font-weight:bold;
}
.ManyBreakingChanges {
color: red;
font-weight:bold;
}
.BreakDetails {
margin-left: 30px;
}
.CompatMessage {
font-style: italic;
font-size: 10pt;
}
.GoodMessage {
color: darkgreen;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink {
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover {
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered {
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell {
width: 100%;
}
/* Padding around the content after the h1 */
#content {
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table {
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table {
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded {
min-width: 18px;
min-height: 18px;
background-repeat: no-repeat;
background-position: center;
}
/* Success icon encoded */
.IconSuccessEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==);
}
/* Information icon encoded */
.IconInfoEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
}
/* Warning icon encoded */
.IconWarningEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
}
/* Error icon encoded */
.IconErrorEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
}
</style>
</head>
<body>
<h1 _locid="PortabilityReport">.NET Portability Report</h1>
<div id="content">
<div id="submissionId" style="font-size:8pt;">
<p>
<i>
Submission Id
fc76db06-6fd8-427c-8559-1742380af0c8
</i>
</p>
</div>
<h2 _locid="SummaryTitle">
<a name="Portability Summary"></a>Portability Summary
</h2>
<div id="summary">
<table>
<tbody>
<tr>
<th>Assembly</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
</tr>
<tr>
<td><strong><a href="#bbv.Common.DistributedEventBroker">bbv.Common.DistributedEventBroker</a></strong></td>
<td class="text-center">95.74 %</td>
<td class="text-center">95.04 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">95.04 %</td>
</tr>
</tbody>
</table>
</div>
<div id="details">
<a name="bbv.Common.DistributedEventBroker"><h3>bbv.Common.DistributedEventBroker</h3></a>
<table>
<tbody>
<tr>
<th>Target type</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
<th>Recommended changes</th>
</tr>
<tr>
<td>System.Collections.Generic.List`1</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">ForEach(System.Action{`0})</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Runtime.Serialization.Formatters.Binary.BinaryFormatter</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Deserialize(System.IO.Stream)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Serialize(System.IO.Stream,System.Object)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.SerializableAttribute</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove this attribute</td>
</tr>
<tr>
<td style="padding-left:2em">#ctor</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove this attribute</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
<p>
<a href="#Portability Summary">Back to Summary</a>
</p>
</div>
</div>
</body>
</html> | {
"content_hash": "3b70f89b301227e0ff99b1bf72f2f842",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 562,
"avg_line_length": 41.90027700831025,
"alnum_prop": 0.4781832606108687,
"repo_name": "kuhlenh/port-to-core",
"id": "cbf63cf01f8b3fc62c041197634c2661caba5025",
"size": "15126",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "Reports/bb/bbv.common.distributedeventbroker.7.1.12149.1635/bbv.Common.DistributedEventBroker-Net40.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2323514650"
}
],
"symlink_target": ""
} |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import logging
import emission.storage.timeseries.abstract_timeseries as esta
import emission.core.wrapper.entry as ecwe
def get_last_entry(user_id, time_query, config_key):
user_ts = esta.TimeSeries.get_time_series(user_id)
# get the list of overrides for this time range. This should be non zero
# only if there has been an override since the last run, which needs to be
# saved back into the cache.
config_overrides = list(user_ts.find_entries([config_key], time_query))
logging.debug("Found %d user overrides for user %s" % (len(config_overrides), user_id))
if len(config_overrides) == 0:
logging.warning("No user defined overrides for key %s and user %s, early return" % (config_key, user_id))
return (None, None)
else:
# entries are sorted by the write_ts, we can take the last value
coe = ecwe.Entry(config_overrides[-1])
logging.debug("last entry is %s" % coe)
return (coe.data, coe.metadata.write_ts)
| {
"content_hash": "74dda49e463f37253f5a0f0c08f2ac0c",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 113,
"avg_line_length": 44.285714285714285,
"alnum_prop": 0.7064516129032258,
"repo_name": "shankari/e-mission-server",
"id": "3eb81c7ace07d472f74736aef826474837546f73",
"size": "1240",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "emission/analysis/configs/config_utils.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "445"
},
{
"name": "CSS",
"bytes": "97039"
},
{
"name": "Dockerfile",
"bytes": "1306"
},
{
"name": "HTML",
"bytes": "64875"
},
{
"name": "JavaScript",
"bytes": "116761"
},
{
"name": "Jupyter Notebook",
"bytes": "4656584"
},
{
"name": "Python",
"bytes": "2209414"
},
{
"name": "SCSS",
"bytes": "41755"
},
{
"name": "Shell",
"bytes": "11419"
}
],
"symlink_target": ""
} |
static const NSInteger kVideoListCellThumbnailTag = 0x78;
#pragma mark Private methods
@interface VideoListViewController (Private)
- (void)requestVideosForActiveSection;
@end
@implementation VideoListViewController
@synthesize dataManager;
@synthesize videos = _videos;
@synthesize videoSections;
@synthesize activeSectionIndex;
@synthesize theSearchBar;
@synthesize cell = _cell;
@synthesize federatedSearchTerms, federatedSearchResults;
#pragma mark NSObject
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.activeSectionIndex = 0;
}
return self;
}
- (void)dealloc {
self.dataManager.delegate = nil;
[theSearchBar release];
[videoSections release];
[_videos release];
[dataManager release];
self.federatedSearchTerms = nil;
self.federatedSearchResults = nil;
[super dealloc];
}
#pragma mark VideoDataDelegate
- (void)setupNavScrollButtons {
BOOL bookmarkSelected = NO;
if ([_navScrollView numberOfButtons] > 0 && [_navScrollView indexOfSelectedButton] == NSNotFound) {
bookmarkSelected = YES;
}
[_navScrollView removeAllRegularButtons];
for (NSDictionary *sectionInfo in self.videoSections) {
[_navScrollView addButtonWithTitle:[sectionInfo objectForKey:@"title"]];
}
if ([self.dataManager bookmarkedVideos].count) {
[_navScrollView setShowsBookmarkButton:YES];
} else {
[_navScrollView setShowsBookmarkButton:NO];
}
if (bookmarkSelected && [self.dataManager bookmarkedVideos].count > 0) {
[_navScrollView selectButtonAtIndex:[_navScrollView bookmarkButtonIndex]];
} else {
[_navScrollView selectButtonAtIndex:self.activeSectionIndex];
}
[_navScrollView setNeedsLayout];
}
- (void)requestVideosForActiveSection {
if (self.videoSections.count > self.activeSectionIndex) {
NSString *section = [[self.videoSections objectAtIndex:self.activeSectionIndex] objectForKey:@"value"];
self.dataManager.delegate = self;
[self.dataManager requestVideosForSection:section];
}
}
- (void)dataManager:(VideoDataManager *)manager didReceiveSections:(NSArray *)sections
{
self.videoSections = (NSArray *)sections;
[self setupNavScrollButtons]; // update button pressed states
[self requestVideosForActiveSection];
}
- (void)dataManager:(VideoDataManager *)manager didReceiveVideos:(NSArray *)videos
{
self.videos = videos;
[_videoTable reloadData];
}
- (void)setupNavScrollView {
_navScrollView.showsSearchButton = YES;
_navScrollView.delegate = self;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self setupNavScrollView];
[self addTableView:_videoTable];
_videoTable.rowHeight = 90.0f;
self.dataManager.delegate = self;
[self.dataManager requestSections];
self.navigationItem.title = [[KGO_SHARED_APP_DELEGATE() moduleForTag:self.dataManager.module.tag] shortName];
if (self.federatedSearchTerms || self.federatedSearchResults) {
[_navScrollView showSearchBarAnimated:NO];
[_navScrollView.searchController setActive:NO animated:NO];
_navScrollView.searchController.searchBar.text = self.federatedSearchTerms;
if (self.federatedSearchResults) {
[_navScrollView.searchController setSearchResults:self.federatedSearchResults
forModuleTag:self.dataManager.module.tag];
}
}
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.dataManager.delegate = self;
[self setupNavScrollButtons];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
// Save whatever thumbnail data we've downloaded.
[[CoreDataManager sharedManager] saveData];
}
#pragma mark UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return self.videos.count;
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ThumbnailTableViewCell *cell = (ThumbnailTableViewCell *)[tableView dequeueReusableCellWithIdentifier:
[ThumbnailTableViewCell commonReuseIdentifier]];
if (!cell) {
[[NSBundle mainBundle] loadNibNamed:@"ThumbnailTableViewCell" owner:self options:nil];
cell = _cell;
cell.thumbnailSize = CGSizeMake(120, tableView.rowHeight);
}
Video *video = [self.videos objectAtIndex:indexPath.row];
cell.thumbView.delegate = video;
video.thumbView = cell.thumbView;
cell.titleLabel.text = video.title;
cell.subtitleLabel.text = video.subtitle;
cell.thumbView.imageURL = video.thumbnailURLString;
cell.thumbView.imageData = video.thumbnailImageData;
[cell.thumbView loadImage];
return cell;
}
#pragma mark UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (self.videos.count > indexPath.row) {
NSString *section = [[self.videoSections objectAtIndex:self.activeSectionIndex] objectForKey:@"value"];
Video *video = [self.videos objectAtIndex:indexPath.row];
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
section, @"section", video, @"video", nil];
[KGO_SHARED_APP_DELEGATE() showPage:LocalPathPageNameDetail
forModuleTag:self.dataManager.module.tag
params:params];
}
}
#pragma mark KGOScrollingTabstripDelegate
- (void)tabstrip:(KGOScrollingTabstrip *)tabstrip clickedButtonAtIndex:(NSUInteger)index {
self.activeSectionIndex = index;
[self requestVideosForActiveSection];
if (self.videoSections.count > self.activeSectionIndex) {
VideoModule *module = (VideoModule *)[KGO_SHARED_APP_DELEGATE() moduleForTag:self.dataManager.module.tag];
module.searchSection = [[self.videoSections objectAtIndex:self.activeSectionIndex] objectForKey:@"value"];
}
}
- (void)tabstripBookmarkButtonPressed:(id)sender {
showingBookmarks = YES;
self.videos = [self.dataManager bookmarkedVideos];
[_videoTable reloadData];
}
- (BOOL)tabstripShouldShowSearchDisplayController:(KGOScrollingTabstrip *)tabstrip
{
return YES;
}
- (UIViewController *)viewControllerForTabstrip:(KGOScrollingTabstrip *)tabstrip
{
return self;
}
#pragma mark KGOSearchDisplayDelegate
- (BOOL)searchControllerShouldShowSuggestions:(KGOSearchDisplayController *)controller {
return NO;
}
- (NSArray *)searchControllerValidModules:(KGOSearchDisplayController *)controller {
return [NSArray arrayWithObject:self.dataManager.module.tag];
}
- (NSString *)searchControllerModuleTag:(KGOSearchDisplayController *)controller {
return self.dataManager.module.tag;
}
- (void)resultsHolder:(id<KGOSearchResultsHolder>)resultsHolder
didSelectResult:(id<KGOSearchResult>)aResult
{
NSString *section = [[self.videoSections objectAtIndex:self.activeSectionIndex] objectForKey:@"value"];
if ([aResult isKindOfClass:[Video class]]) {
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
section, @"section", aResult, @"video", nil];
[KGO_SHARED_APP_DELEGATE() showPage:LocalPathPageNameDetail
forModuleTag:[aResult moduleTag]
params:params];
}
}
- (void)searchController:(KGOSearchDisplayController *)controller willHideSearchResultsTableView:(UITableView *)tableView
{
if (controller == self.dataManager.module.searchDelegate) {
self.dataManager.module.searchDelegate = nil;
}
self.federatedSearchTerms = nil;
self.federatedSearchResults = nil;
[_navScrollView hideSearchBarAnimated:YES];
[_navScrollView selectButtonAtIndex:self.activeSectionIndex];
}
@end
| {
"content_hash": "999eb0ee7d7c26599265d9a10277553e",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 121,
"avg_line_length": 32.980237154150196,
"alnum_prop": 0.7068552253116012,
"repo_name": "modolabs/Harvard-Tour-iOS",
"id": "abe8a5b4a852b0f3a076a6fce41942d8254cf728",
"size": "8616",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Modules/Video/VideoListViewController.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "514435"
},
{
"name": "C++",
"bytes": "704"
},
{
"name": "JavaScript",
"bytes": "17417"
},
{
"name": "Objective-C",
"bytes": "1460585"
},
{
"name": "Python",
"bytes": "20909"
},
{
"name": "Shell",
"bytes": "100"
}
],
"symlink_target": ""
} |
package org.hawkular.inventory.api;
import org.hawkular.inventory.api.model.DataEntity;
import org.hawkular.inventory.api.model.RelativePath;
import org.hawkular.inventory.api.model.StructuredData;
import org.hawkular.inventory.api.paging.Page;
import org.hawkular.inventory.api.paging.Pager;
/**
* @author Lukas Krejci
* @since 0.3.0
*/
public final class Data {
private Data() {
}
public interface Read<Role extends DataEntity.Role> extends ReadInterface<Single, Multiple, Role> {
}
public interface ReadWrite<Role extends DataEntity.Role>
extends ReadWriteInterface<DataEntity.Update, DataEntity.Blueprint<Role>, Single, Multiple, Role> {
@Override
Single create(DataEntity.Blueprint<Role> blueprint) throws EntityAlreadyExistsException, ValidationException;
@Override
void update(Role role, DataEntity.Update update) throws EntityNotFoundException, ValidationException;
}
public interface Single extends ResolvableToSingle<DataEntity, DataEntity.Update> {
/**
* Loads the data entity on the current position in the inventory traversal along with its data.
*
* <p>Note that this might be a potentially expensive operation because of the attached data structure being
* loaded.
*
* @return the fully loaded structured data on the current position in the inventory traversal
* @throws EntityNotFoundException if there is no structured data on the current position in the inventory
* @see ResolvableToSingle#entity()
*/
@Override
DataEntity entity() throws EntityNotFoundException;
/**
* Returns the data on the path relative to the entity.
*
* In another words, you can use this method to obtain only a subset of the data stored on the data entity.
*
* <p>I.e if you have an data entity which contains a map with a key "foo", which contains a list and you
* want to obtain a third element of that list, you'd do:
* {@code
* ...data(RelativePath.to().structuredData().key("foo").index(2).get());
* }
*
* <p>If you want to obtain the whole data structure, use an empty path: {@code RelativePath.empty().get()}.
*
* @param dataPath the path to the subset of the data.
* @return the subset of the data stored with the data entity
* @see #flatData(RelativePath)
*/
StructuredData data(RelativePath dataPath);
/**
* This is very similar to {@link #data(RelativePath)} but this method doesn't load the child data.
*
* <p>If the data on the path contains a "primitive" value, the value is loaded. If the data contains a list,
* the returned instance will contain an empty list and if the data contains a map the returned instance will
* contain an empty map.
*
* @param dataPath the path to the subset of the data to return
* @return the subset of the data stored with the data entity
*/
StructuredData flatData(RelativePath dataPath);
@Override
default boolean exists() {
try {
flatData(RelativePath.empty().get());
return true;
} catch (EntityNotFoundException | RelationNotFoundException ignored) {
return false;
}
}
@Override
void update(DataEntity.Update update) throws EntityNotFoundException, RelationNotFoundException,
ValidationException;
}
public interface Multiple extends ResolvableToMany<DataEntity> {
/**
* Note that this is potentially expensive operation because it loads all the data associated with each of the
* returned data entities.
*
* @param pager the pager object describing the subset of the entities to return
* @return the page of the results
*/
@Override
Page<DataEntity> entities(Pager pager);
/**
* Similar to {@link Single#data(RelativePath)}, only resolved over multiple entities.
*
* @param dataPath the path to the data entry inside the data entity
* @param pager pager to use to page the data
* @return the page of the data entries
*/
Page<StructuredData> data(RelativePath dataPath, Pager pager);
/**
* Similar to {@link Single#flatData(RelativePath)}, only resolved over multiple entities.
*
* @param dataPath the path to the data entry inside the data entity
* @param pager pager to use to page the data
* @return the page of the data entries
*/
Page<StructuredData> flatData(RelativePath dataPath, Pager pager);
@Override
default boolean anyExists() {
return flatData(RelativePath.empty().get(), Pager.single()).hasNext();
}
}
}
| {
"content_hash": "0400063561fdc0a6347c278617ce42f4",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 118,
"avg_line_length": 39,
"alnum_prop": 0.6410256410256411,
"repo_name": "jkandasa/hawkular-inventory",
"id": "d323298c8df83449c9f85626058891e1471eac75",
"size": "5708",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/Data.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1492130"
},
{
"name": "Scala",
"bytes": "10492"
},
{
"name": "Shell",
"bytes": "1590"
}
],
"symlink_target": ""
} |
section.text
global_start ;must be declared for linker (ld)
_start: ;tells linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section.data
msg db 'Hello, world!', 0xa ;string to be printed
len equ $ - msg ;length of the string
| {
"content_hash": "5a3c05e425b361b1c7daad5ae69efd6b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 62,
"avg_line_length": 40.13333333333333,
"alnum_prop": 0.5182724252491694,
"repo_name": "zhmz90/Daily",
"id": "e25a3b0d0f67e12d214cc0c180ad05d0479c949b",
"size": "602",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "learn/assembly/hello_world.asm",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "1723"
},
{
"name": "C",
"bytes": "1558699"
},
{
"name": "C++",
"bytes": "39093"
},
{
"name": "CMake",
"bytes": "9888"
},
{
"name": "Java",
"bytes": "413"
},
{
"name": "Julia",
"bytes": "27890"
},
{
"name": "Jupyter Notebook",
"bytes": "813562"
},
{
"name": "LLVM",
"bytes": "1211"
},
{
"name": "Lua",
"bytes": "45884"
},
{
"name": "M4",
"bytes": "7552"
},
{
"name": "Makefile",
"bytes": "30262"
},
{
"name": "Perl",
"bytes": "15640"
},
{
"name": "Protocol Buffer",
"bytes": "705"
},
{
"name": "Python",
"bytes": "45107"
},
{
"name": "R",
"bytes": "13427"
},
{
"name": "Rebol",
"bytes": "2109"
},
{
"name": "Roff",
"bytes": "19873"
},
{
"name": "Scala",
"bytes": "3079"
},
{
"name": "Shell",
"bytes": "3808"
},
{
"name": "TeX",
"bytes": "1146"
}
],
"symlink_target": ""
} |
package dialogs;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import configuration.TConfiguration;
import configuration.TLanguage;
import database.DBTasks;
public class InsertWordImageFrame extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
private JPanel contentPane;
private JButton btnBuscar;
private String imageName;
private String newTextImage;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
InsertWordImageFrame frame = new InsertWordImageFrame(
"Castellano", new JLabel(), "");
frame.setLocationRelativeTo(null);
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public void setImageName(String imageName) {
this.imageName = imageName;
}
/**
* Create the frame.
*/
public InsertWordImageFrame(String language, JLabel image, String textImage) {
TConfiguration.setLanguage(language);
TLanguage.initLanguage(TConfiguration.getLanguage());
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 150, 150);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
JPanel panel = new JPanel();
panel.setBorder(new TitledBorder(null, TLanguage
.getString("INSERT_WORD_IMAGE_FRAME.KEY_TERMS"), TitledBorder.LEADING, TitledBorder.TOP, null, null));
contentPane.add(panel);
panel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
JLabel text = new JLabel();
this.newTextImage = textImage;
text.setText("Sarà inserito il termine \"" + newTextImage
+ "\" all'immagine ");
panel.add(text);
panel.add(image);
btnBuscar = new JButton(TLanguage.getString("INSERT_WORD_IMAGE_FRAME.SAVE"));
btnBuscar.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (!newTextImage.equals("")) {
if (!imageName.equals("")) {
DBTasks.addImageDB(imageName, TConfiguration.getLanguage(),"nombreComun", newTextImage);
JOptionPane.showMessageDialog(null,
TLanguage.getString("ADD_IMAGE_FRAME.CHANGES_DONE_WARNING"),
TLanguage.getString("ADD_IMAGE_FRAME.CHANGES_DONE_WARNING_TITLE"),
JOptionPane.INFORMATION_MESSAGE);
dispose();
}
else {
JOptionPane.showMessageDialog(null,
TLanguage
.getString("INSERT_WORD_IMAGE_FRAME.IMG_EMPTY_WARNING"),
TLanguage
.getString("INSERT_WORD_IMAGE_FRAME.TERM_EMPTY_WARNING_TITLE"),
JOptionPane.WARNING_MESSAGE);
dispose();
}
} else {
JOptionPane.showMessageDialog(null,
TLanguage
.getString("INSERT_WORD_IMAGE_FRAME.TERM_EMPTY_WARNING"),
TLanguage
.getString("INSERT_WORD_IMAGE_FRAME.TERM_EMPTY_WARNING_TITLE"),
JOptionPane.WARNING_MESSAGE);
dispose();
}
}
});
panel.add(btnBuscar);
contentPane.add(panel);
}
}
| {
"content_hash": "ebc81482e56e508c843fc96d29b9814a",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 106,
"avg_line_length": 31.89830508474576,
"alnum_prop": 0.6182252922422954,
"repo_name": "ProgettoRadis/ArasuiteIta",
"id": "6723fc31890133eccad0fd1b8a902f03acd83e1b",
"size": "3764",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "galleryManager/src/dialogs/InsertWordImageFrame.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CLIPS",
"bytes": "2811"
},
{
"name": "HTML",
"bytes": "1615"
},
{
"name": "Java",
"bytes": "2496189"
},
{
"name": "NSIS",
"bytes": "21104"
},
{
"name": "Shell",
"bytes": "174"
},
{
"name": "TeX",
"bytes": "88341"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_33) on Tue Aug 20 12:20:55 EDT 2013 -->
<TITLE>
mars
</TITLE>
<META NAME="date" CONTENT="2013-08-20">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="../mars/package-summary.html" target="classFrame">mars</A></FONT>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="ErrorList.html" title="class in mars" target="classFrame">ErrorList</A>
<BR>
<A HREF="ErrorMessage.html" title="class in mars" target="classFrame">ErrorMessage</A>
<BR>
<A HREF="Globals.html" title="class in mars" target="classFrame">Globals</A>
<BR>
<A HREF="MarsLaunch.html" title="class in mars" target="classFrame">MarsLaunch</A>
<BR>
<A HREF="MarsSplashScreen.html" title="class in mars" target="classFrame">MarsSplashScreen</A>
<BR>
<A HREF="MIPSprogram.html" title="class in mars" target="classFrame">MIPSprogram</A>
<BR>
<A HREF="ProgramStatement.html" title="class in mars" target="classFrame">ProgramStatement</A>
<BR>
<A HREF="Settings.html" title="class in mars" target="classFrame">Settings</A></FONT></TD>
</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Exceptions</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="ProcessingException.html" title="class in mars" target="classFrame">ProcessingException</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>
| {
"content_hash": "1bb3772ef9fdb64648beca50c7254a21",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 112,
"avg_line_length": 30.017543859649123,
"alnum_prop": 0.695499707773232,
"repo_name": "aaaustin10/Mars",
"id": "7948d04679ce1458d21a8d71056f569b8a052189",
"size": "1711",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/mars/package-frame.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "276"
},
{
"name": "HTML",
"bytes": "138108"
},
{
"name": "Java",
"bytes": "2546578"
}
],
"symlink_target": ""
} |
package com.github.jparse;
import static com.github.jparse.ParseResult.failure;
import static java.util.Objects.requireNonNull;
final class PhraseParser<T, U> extends FluentParser<T, U> {
private final Parser<T, ? extends U> parser;
PhraseParser(Parser<T, ? extends U> parser) {
this.parser = requireNonNull(parser);
}
@Override
public ParseResult<T, ? extends U> parse(Sequence<T> sequence) {
ParseResult<T, ? extends U> result = parser.parse(sequence);
if (!result.isSuccess() || result.getRest().length() == 0) {
return result;
} else {
return failure("end of sequence expected", result.getRest());
}
}
}
| {
"content_hash": "aa484bbe7104952c5d119944f734d793",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 73,
"avg_line_length": 28.12,
"alnum_prop": 0.6401137980085349,
"repo_name": "yngui/jparse",
"id": "385cd3d073e63604b7e0489987a38c23d4cb0305",
"size": "1845",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/github/jparse/PhraseParser.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "95010"
}
],
"symlink_target": ""
} |
// Copyright (c) Facebook, Inc. and its affiliates.
//
// 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 "rsocket/benchmarks/Throughput.h"
#include <folly/Benchmark.h>
#include <folly/Synchronized.h>
#include <folly/init/Init.h>
#include <folly/io/async/ScopedEventBaseThread.h>
#include <folly/portability/GFlags.h>
#include <folly/synchronization/Baton.h>
#include "rsocket/RSocket.h"
#include "yarpl/Flowable.h"
using namespace rsocket;
constexpr size_t kMessageLen = 32;
DEFINE_int32(items, 1000000, "number of items in stream");
namespace {
/// State shared across the client and server DirectDuplexConnections.
struct State {
/// Whether one of the two connections has been destroyed.
folly::Synchronized<bool> destroyed;
};
/// DuplexConnection that talks to another DuplexConnection via memory.
class DirectDuplexConnection : public DuplexConnection {
public:
DirectDuplexConnection(std::shared_ptr<State> state, folly::EventBase& evb)
: state_{std::move(state)}, evb_{evb} {}
~DirectDuplexConnection() override {
*state_->destroyed.wlock() = true;
}
// Tie two DirectDuplexConnections together so they can talk to each other.
void tie(DirectDuplexConnection* other) {
other_ = other;
other_->other_ = this;
}
void setInput(std::shared_ptr<DuplexConnection::Subscriber> input) override {
input_ = std::move(input);
}
void send(std::unique_ptr<folly::IOBuf> buf) override {
auto destroyed = state_->destroyed.rlock();
if (*destroyed || !other_) {
return;
}
other_->evb_.runInEventBaseThread(
[state = state_, other = other_, b = std::move(buf)]() mutable {
auto destroyed = state->destroyed.rlock();
if (*destroyed) {
return;
}
other->input_->onNext(std::move(b));
});
}
private:
std::shared_ptr<State> state_;
folly::EventBase& evb_;
DirectDuplexConnection* other_{nullptr};
std::shared_ptr<DuplexConnection::Subscriber> input_;
};
class Acceptor : public ConnectionAcceptor {
public:
explicit Acceptor(std::shared_ptr<State> state) : state_{std::move(state)} {}
void setClientConnection(DirectDuplexConnection* connection) {
client_ = connection;
}
void start(OnDuplexConnectionAccept onAccept) override {
worker_.getEventBase()->runInEventBaseThread(
[this, onAccept = std::move(onAccept)]() mutable {
auto server = std::make_unique<DirectDuplexConnection>(
std::move(state_), *worker_.getEventBase());
server->tie(client_);
onAccept(std::move(server), *worker_.getEventBase());
});
}
void stop() override {}
folly::Optional<uint16_t> listeningPort() const override {
return folly::none;
}
private:
std::shared_ptr<State> state_;
DirectDuplexConnection* client_{nullptr};
folly::ScopedEventBaseThread worker_;
};
class Factory : public ConnectionFactory {
public:
Factory() {
auto state = std::make_shared<State>();
connection_ = std::make_unique<DirectDuplexConnection>(
state, *worker_.getEventBase());
auto acceptor = std::make_unique<Acceptor>(state);
acceptor_ = acceptor.get();
acceptor_->setClientConnection(connection_.get());
auto responder =
std::make_shared<FixedResponder>(std::string(kMessageLen, 'a'));
server_ = std::make_unique<RSocketServer>(std::move(acceptor));
server_->start([responder](const SetupParameters&) { return responder; });
}
folly::Future<ConnectedDuplexConnection> connect(
ProtocolVersion,
ResumeStatus /* unused */) override {
return folly::via(worker_.getEventBase(), [this] {
return ConnectedDuplexConnection{
std::move(connection_), *worker_.getEventBase()};
});
}
private:
std::unique_ptr<DirectDuplexConnection> connection_;
std::unique_ptr<rsocket::RSocketServer> server_;
Acceptor* acceptor_{nullptr};
folly::ScopedEventBaseThread worker_;
};
std::shared_ptr<RSocketClient> makeClient() {
auto factory = std::make_unique<Factory>();
return RSocket::createConnectedClient(std::move(factory)).get();
}
} // namespace
BENCHMARK(StreamThroughput, n) {
(void)n;
std::shared_ptr<RSocketClient> client;
std::shared_ptr<BoundedSubscriber> subscriber;
folly::ScopedEventBaseThread worker;
Latch latch{1};
BENCHMARK_SUSPEND {
LOG(INFO) << " Running with " << FLAGS_items << " items";
client = makeClient();
}
client->getRequester()
->requestStream(Payload("InMemoryStream"))
->subscribe(std::make_shared<BoundedSubscriber>(latch, FLAGS_items));
constexpr std::chrono::minutes timeout{5};
if (!latch.timed_wait(timeout)) {
LOG(ERROR) << "Timed out!";
}
}
| {
"content_hash": "c54b69ede1043d1802db0e7b30a4de62",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 79,
"avg_line_length": 28.080213903743317,
"alnum_prop": 0.6842506189297277,
"repo_name": "rsocket/rsocket-cpp",
"id": "c5128152ec764d7717f323ac70989b74cc285577",
"size": "5251",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "rsocket/benchmarks/StreamThroughputMemory.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "5898"
},
{
"name": "C++",
"bytes": "1192300"
},
{
"name": "CMake",
"bytes": "109952"
},
{
"name": "Python",
"bytes": "330243"
},
{
"name": "Shell",
"bytes": "12978"
}
],
"symlink_target": ""
} |
<?php
/*
* Simple WordPress URL change
* Run me in the browser, no config required in here.
*/
?>
<html>
<head>
<style>body { padding-top: 60px; font-family: monospace; background: black; color: #18e113; } label{ width: 155px; display: block; float: left; } form div {margin: 5px 0; } #warning { font-size: 18px; width: 100%; padding: 10px 0 10px 0; height: 30px; color: white; text-align: center; background: red; position: fixed; top: 0; } input {padding: 0.6em; width: 25em; font-size: 0.9em} input[type=submit] { width: 35.75em; margin-top: 1em; } </style>
<title>Simple WP URL Change</title>
<meta name="robots" content="noindex,nofollow">
</head>
<body>
<div id="warning">IMPORTANT: REMOVE ME FROM SERVER ONCE FINISHED</div>
<?php
// details posted?
if( isset($_POST['submit']) ){
$db_name = $_POST['db_name'];
$db_username = $_POST['db_username'];
$db_password = $_POST['db_password'];
$old_domain = $_POST['old_domain'];
$new_domain = $_POST['new_domain'];
$prefix = $_POST['prefix'];
// check if correct
echo "
Is this correct? - <br />
<strong>Database Name:</strong> $db_name <br />
<strong>Database Username:</strong> $db_username <br />
<strong>Database Password (note: spaces have not been trimmed):</strong> $db_password <br />
<strong>Old Domain:</strong> $old_domain <br />
<strong>New Domain:</strong> $new_domain <br />
<strong>Table Prefix:</strong> $prefix <br />
";
?>
<br />
<form action="" method="post">
<input type="submit" name="yes" value="Yes I'm sure" />
<input type="submit" name="no" value="No I made a mistake, go back" />
<input type="hidden" name="db_name" value="<?php echo $db_name; ?>" />
<input type="hidden" name="db_username" value="<?php echo $db_username; ?>" />
<input type="hidden" name="db_password" value="<?php echo $db_password; ?>" />
<input type="hidden" name="prefix" value="<?php echo $prefix; ?>" />
<input type="hidden" name="old_domain" value="<?php echo $old_domain; ?>" />
<input type="hidden" name="new_domain" value="<?php echo $new_domain; ?>" />
</form>
<?php
}
if( isset($_POST['yes']) ){ // attempt to connect and update
$db_name = $_POST['db_name'];
$db_username = $_POST['db_username'];
$db_password = $_POST['db_password'];
$old_domain = $_POST['old_domain'];
$new_domain = $_POST['new_domain'];
$prefix = $_POST['prefix'];
$db_conn = mysqli_connect('localhost', $db_username, $db_password, $db_name);
if( mysqli_connect_errno() ){
die('MySQL database connection failed. '.mysqli_connect_error(). ' --- '.mysqli_connect_errno());
}
// configure
$site_url = "UPDATE {$prefix}options SET option_value = replace(option_value, '$old_domain', '$new_domain') WHERE option_name = 'home' OR option_name = 'siteurl';";
$guid = "UPDATE {$prefix}posts SET guid = REPLACE (guid, '$old_domain', '$new_domain');";
$url_content = "UPDATE {$prefix}posts SET post_content = REPLACE (post_content, '$old_domain', '$new_domain')";
$image_path = "UPDATE {$prefix}posts SET post_content = REPLACE (post_content, 'src=\"$old_domain', 'src=\"$new_domain')";
$image_path2 = "UPDATE {$prefix}posts SET guid = REPLACE (guid, '$old_domain', '$new_domain') WHERE post_type = 'attachment'";
$post_meta = "UPDATE {$prefix}postmeta SET meta_value = REPLACE (meta_value, '$old_domain','$new_domain')";
// run/report
$query1 = mysqli_query($db_conn, $site_url);
echo !$query1 ? 'query1 - site_url update FAILED - '.mysqli_error().'<br />' : 'query1 - site_url update SUCCESS <br />';
$query2 = mysqli_query($db_conn, $guid);
echo !$query2 ? 'query2 - guid update FAILED - '.mysqli_error().'<br />' : 'query2 - guid update SUCCESS <br />';
$query3 = mysqli_query($db_conn, $url_content);
echo !$query3 ? 'query3 - url_content update FAILED - '.mysqli_error().'<br />' : 'query3 - url_content update SUCCESS <br />';
$query4 = mysqli_query($db_conn, $image_path);
echo !$query4 ? 'query4 - image_path update FAILED - '.mysqli_error().'<br />' : 'query4 - image_path update SUCCESS <br />';
$query5 = mysqli_query($db_conn, $image_path2);
echo !$query5 ? 'query5 - image_path2 update FAILED - '.mysqli_error().'<br />' : 'query5 - image_path2 update SUCCESS <br />';
$query6 = mysqli_query($db_conn, $post_meta);
echo !$query6 ? 'query6 - post_meta update FAILED - '.mysqli_error().'<br />' : 'query6 - post_meta update SUCCESS <br />';
?>
<br />
</body>
</html>
<?php
die('Now remove this script from the server!');
}
if( !isset($_POST['submit']) || isset($_POST['no']) ){
?>
<form action="" method="post">
<div>
<label>Database Name</label>
<input type="text" name="db_name" required="required" />
</div>
<div>
<label>Database Username</label>
<input type="text" name="db_username" required="required" />
</div>
<div>
<label>Database Password</label>
<input type="text" name="db_password" required="required" />
</div>
<div>
<label>Table Prefix</label>
<input type="text" name="prefix" required="required" placeholder="e.g wp_" />
</div>
<hr>
<div>
<label>OLD Domain</label>
<input type="text" name="old_domain" required="required" placeholder="http://www.olddomain.com" />
</div>
<div>
<label>NEW Domain</label>
<input type="text" name="new_domain" required="required" placeholder="http://www.newdomain.com" />
</div>
<div><input type="submit" value="Continue" name="submit" /></div>
</form>
<?php } ?>
</body>
</html>
| {
"content_hash": "d256f802181f186599f8d71d2ddca540",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 450,
"avg_line_length": 43.62406015037594,
"alnum_prop": 0.5942778352292313,
"repo_name": "LukeKM7/simple-wp-url-change",
"id": "2831c4d06055db30a1d607e011206ce94b25d728",
"size": "5802",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "simple-wp-url-change/index.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "142"
},
{
"name": "PHP",
"bytes": "5802"
}
],
"symlink_target": ""
} |
<?php
namespace Kpacha\Helmet\Plugin;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
/**
*
* @author Kpacha <kpacha666@gmail.com>
*/
class Plugin
{
/**
* @var string
*/
private $command;
/**
* @var string
*/
private $output;
/**
* @var TableNode
*/
private $profileTable;
public function __construct($command = '')
{
$this->command = $command;
}
public function addProfiles(TableNode $table)
{
$this->profileTable = $table;
}
public function isInstalled()
{
$return = $this->exec("type $this->command");
return $return['status'] === 0;
}
public function launchAttackWith($attackType, PyStringNode $string)
{
$return = $this->exec($this->getCommand($string));
$this->output = trim(implode("\n", $return['output']));
}
public function getOutput()
{
return $this->output;
}
protected function exec($command)
{
$return = array('output' => null, 'status' => null);
exec($command, $return['output'], $return['status']);
return $return;
}
protected function getCommand(PyStringNode $string)
{
return $this->command . ' ' . $this->parseParameters($string);
}
protected function parseParameters(PyStringNode $string)
{
$rawParams = $string->getRaw();
preg_match_all("/<(\w*)>/", $rawParams, $parameters);
foreach ($parameters[1] as $parameter) {
$rawParams = str_replace("<$parameter>", $this->getParameter($parameter), $rawParams);
}
return $rawParams;
}
protected function getParameter($name)
{
$value = null;
$profiles = $this->profileTable->getRows();
$keys = array_shift($profiles);
foreach ($profiles as $profile) {
$profile = array_combine($keys, $profile);
if ($profile['name'] === $name) {
$value = $profile['value'];
break;
}
}
return $value;
}
}
| {
"content_hash": "a6fc46da9dde1517484eb9808ae52441",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 98,
"avg_line_length": 22.677419354838708,
"alnum_prop": 0.5462304409672831,
"repo_name": "kpacha/helmet",
"id": "e629a5e0567a907ce2412dfde914a7cbddcd3dac",
"size": "2109",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Kpacha/Helmet/Plugin/Plugin.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "16783"
},
{
"name": "Shell",
"bytes": "40"
}
],
"symlink_target": ""
} |
/*.postbox.acf_postbox > .inside > .field {
padding: 0 10px 30px;
}
#acf_after_title-sortables .acf_postbox > .inside > .field {
padding-top: 15px;
padding-bottom: 15px;
}
#acf_after_title-sortables .acf_postbox > .inside > .field:nth-last-child(2),
#normal-sortables .acf_postbox > .inside > .field:nth-last-child(2){
padding-bottom: 0;
}
#acf_after_title-sortables > div:last-child {
margin-bottom: 0;
}*/
.bs-metabox-table {
width: 100%;
margin: 10px 0;
table-layout: fixed;
}
.bs-metabox-table td {
vertical-align: top;
text-align: center;
padding-bottom: 5px;
}
.bs-metabox-table th {
padding-bottom: 5px;
}
.bs-metabox-table .bs-metabox-actions {
width: 50px;
vertical-align: middle;
text-align: center;
padding-left: 5px;
}
.bs-metabox-table .bs-metabox-actions a {
display: inline-block;
padding-bottom: 5px;
}
.bs-metabox-remove {
color: #a00;
}
.bs-metabox-table textarea,
.bs-metabox-table input {
width: 100%;
}
.bso-iu-image-preview {
display: block;
margin-bottom: 7px;
}
.bso-iu-remove-image {
color: #a00;
display: inline-block;
position: relative;
top: 5px;
margin-left: 7px;
}
| {
"content_hash": "c45b65259a93736377f9e26c39f0b834",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 77,
"avg_line_length": 19.135593220338983,
"alnum_prop": 0.6846767050487157,
"repo_name": "MrVoltz/wordpress-bootstrap",
"id": "118522a5f1992d92edd39184104120b1f53dc4ef",
"size": "1129",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bootstrap/admin.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "83808"
},
{
"name": "JavaScript",
"bytes": "197761"
},
{
"name": "PHP",
"bytes": "417463"
}
],
"symlink_target": ""
} |
/**
* @class SlideNavigationExample.controller.Main
*
* This {@link Ext.app.Controller} serves as a demonstration of how to
* listen to various events relating to a {@link Ext.ux.slidenavigation.View}.
*
*/
Ext.define("SlideNavigationExample.controller.Main", {
extend: 'Ext.app.Controller',
config: {
refs: {
slideNav: 'slidenavigationview',
moviePosterListContainer: 'slidenavigationview container[title="Item 8"]'
},
control: {
/**
* Here are examples of the various events you can listen for.
*/
slideNav: {
open: function(nav, position, duration) {
console.log('Container open (position='+position+',duration='+duration+')');
},
close: function(nav, position, duration) {
console.log('Container close (position='+position+',duration='+duration+')');
},
select: function(nav, item, index) {
console.log('Selected item (index='+index+')');
},
opened: function(nav) {
console.log('Container opened');
},
closed: function(nav) {
console.log('Container closed');
},
slideend: function(nav) {
console.log('Container slideend');
},
slidestart: function(nav) {
console.log('Container slidestart');
},
dragstart: function(nav) {
console.log('Container dragstart');
},
dragend: function(nav) {
console.log('Container dragend');
}
},
/**
* The 'activate' event fires on the container, not the child
* element.
*
*/
moviePosterListContainer: {
activate: function(container) {
console.log('Activate moviePosterListContainer');
}
}
}
}
}); | {
"content_hash": "083252868f90ceb26595db9ec22ec259",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 97,
"avg_line_length": 31.197183098591548,
"alnum_prop": 0.4654627539503386,
"repo_name": "wnielson/sencha-SlideView",
"id": "a56fced9aae6146916b750a7873e36e153eb0091",
"size": "2215",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "app/controller/Main.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "30106"
},
{
"name": "Ruby",
"bytes": "428"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Web.Routing;
using FakeN.Web;
using Microsoft.Owin.Host.SystemWeb.Tests.FakeN;
namespace Microsoft.Owin.Host.SystemWeb.Tests
{
public class TestsBase
{
protected bool WasCalled { get; set; }
protected IDictionary<string, object> WasCalledInput { get; set; }
protected Task WasCalledApp(IDictionary<string, object> env)
{
WasCalled = true;
WasCalledInput = env;
return Utils.CompletedTask;
}
protected FakeHttpContext NewHttpContext(Uri url, string method = "GET")
{
return new FakeHttpContextEx(new FakeHttpRequestEx(url, method), new FakeHttpResponseEx());
}
protected RequestContext NewRequestContext(RouteBase route, FakeHttpContext httpContext)
{
RouteData routeData = route.GetRouteData(httpContext);
return routeData != null ? new RequestContext(httpContext, routeData) : null;
}
protected RequestContext NewRequestContext(RouteCollection routes, FakeHttpContext httpContext)
{
RouteData routeData = routes.GetRouteData(httpContext);
return routeData != null ? new RequestContext(httpContext, routeData) : null;
}
protected Task ExecuteRequestContext(RequestContext requestContext)
{
var httpHandler = (OwinHttpHandler)requestContext.RouteData.RouteHandler.GetHttpHandler(requestContext);
Task task = Task.Factory.FromAsync(httpHandler.BeginProcessRequest, httpHandler.EndProcessRequest,
requestContext.HttpContext, null);
return task;
}
}
}
| {
"content_hash": "d2c5dc1960843d98a72cfd72f9517e66",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 116,
"avg_line_length": 36.291666666666664,
"alnum_prop": 0.6768082663605052,
"repo_name": "mind0n/hive",
"id": "c53197e7c35121f987d7030c61bbd333f6c83cd1",
"size": "1876",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "Cache/Samples/katana/tests/Microsoft.Owin.Host.SystemWeb.Tests/TestsBase.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "670329"
},
{
"name": "ActionScript",
"bytes": "7830"
},
{
"name": "ApacheConf",
"bytes": "47"
},
{
"name": "Batchfile",
"bytes": "18096"
},
{
"name": "C",
"bytes": "19746409"
},
{
"name": "C#",
"bytes": "258148996"
},
{
"name": "C++",
"bytes": "48534520"
},
{
"name": "CSS",
"bytes": "933736"
},
{
"name": "ColdFusion",
"bytes": "10780"
},
{
"name": "GLSL",
"bytes": "3935"
},
{
"name": "HTML",
"bytes": "4631854"
},
{
"name": "Java",
"bytes": "10881"
},
{
"name": "JavaScript",
"bytes": "10250558"
},
{
"name": "Logos",
"bytes": "1526844"
},
{
"name": "MAXScript",
"bytes": "18182"
},
{
"name": "Mathematica",
"bytes": "1166912"
},
{
"name": "Objective-C",
"bytes": "2937200"
},
{
"name": "PHP",
"bytes": "81898"
},
{
"name": "Perl",
"bytes": "9496"
},
{
"name": "PowerShell",
"bytes": "44339"
},
{
"name": "Python",
"bytes": "188058"
},
{
"name": "Shell",
"bytes": "758"
},
{
"name": "Smalltalk",
"bytes": "5818"
},
{
"name": "TypeScript",
"bytes": "50090"
}
],
"symlink_target": ""
} |
#pragma once
#include "Analyzer.h"
/*
keyword 1 Line
Keyword 2 Line
between (keyword1 , keyword2 ) Lines tiemstemp Interval
*/
enum E_BETWEEN_POS
{
BPOS_LINE_1 = 0,
BPOS_LINE_2,
BPOS_LINE_MAX
};
struct STBetween_Class
{
char *pKeyword[BPOS_LINE_MAX];
STDTime stPreTime;
STInterval stInterval;
};
class CAnalyzer_BetweenLines : public CAnalyzer
{
public:
CAnalyzer_BetweenLines();
~CAnalyzer_BetweenLines();
bool initConfig(char *pConfigFile, char *pSector);
bool parsingLine(char *p);
void report(CLogger *pLogger);
private:
CSList *m_pClassList; // specific Key's value average
void parsingClass(char *p, STBetween_Class *pClass);
}; | {
"content_hash": "dadeaaafb46c265d3aff253fff687246",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 55,
"avg_line_length": 16.073170731707318,
"alnum_prop": 0.7298937784522003,
"repo_name": "appleeh/leviathan",
"id": "90850c485700733fa4f8e7f7a74c9c23ac62d35a",
"size": "659",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "project/LogAnalyzer/include/Analyzer_BetweenLines.h",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/*******************************************************************
** m a t h 6 4 . c
** Forth Inspired Command Language - 64 bit math support routines
** Authors: Michael A. Gauland (gaulandm@mdhost.cse.tek.com)
** Larry Hastings (larry@hastings.org)
** John Sadler (john_sadler@alum.mit.edu)
** Created: 25 January 1998
** Rev 2.03: Support for 128 bit DP math. This file really ouught to
** be renamed!
** $Id: double.c,v 1.2 2010/09/12 15:18:07 asau Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
** All rights reserved.
**
** Get the latest Ficl release at http://ficl.sourceforge.net
**
** I am interested in hearing from anyone who uses Ficl. If you have
** a problem, a success story, a defect, an enhancement request, or
** if you would like to contribute to the Ficl release, please
** contact me by email at the address above.
**
** L I C E N S E and D I S C L A I M E R
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
** SUCH DAMAGE.
*/
//#include <stdint.h>
#include "ficl.h"
#if FICL_PLATFORM_HAS_2INTEGER
ficl2UnsignedQR ficl2UnsignedDivide(ficl2Unsigned q, ficlUnsigned y)
{
ficl2UnsignedQR result;
result.quotient = q / y;
/*
** Once we have the quotient, it's cheaper to calculate the
** remainder this way than with % (mod). --lch
*/
result.remainder = (ficlInteger)(q - (result.quotient * y));
return result;
}
#else /* FICL_PLATFORM_HAS_2INTEGER */
#define FICL_CELL_HIGH_BIT ((uintmax_t)1 << (FICL_BITS_PER_CELL-1))
#define UMOD_SHIFT (FICL_BITS_PER_CELL / 2)
#define UMOD_MASK ((1L << (FICL_BITS_PER_CELL / 2)) - 1)
/**************************************************************************
ficl2IntegerIsNegative
** Returns TRUE if the specified ficl2Unsigned has its sign bit set.
**************************************************************************/
int ficl2IntegerIsNegative(ficl2Integer x)
{
return (x.high < 0);
}
/**************************************************************************
ficl2IntegerNegate
** Negates an ficl2Unsigned by complementing and incrementing.
**************************************************************************/
ficl2Integer ficl2IntegerNegate(ficl2Integer x)
{
x.high = ~x.high;
x.low = ~x.low;
x.low ++;
if (x.low == 0)
x.high++;
return x;
}
/**************************************************************************
ficl2UnsignedMultiplyAccumulate
** Mixed precision multiply and accumulate primitive for number building.
** Multiplies ficl2Unsigned u by ficlUnsigned mul and adds ficlUnsigned add. Mul is typically
** the numeric base, and add represents a digit to be appended to the
** growing number.
** Returns the result of the operation
**************************************************************************/
ficl2Unsigned ficl2UnsignedMultiplyAccumulate(ficl2Unsigned u, ficlUnsigned mul, ficlUnsigned add)
{
ficl2Unsigned resultLo = ficl2UnsignedMultiply(u.low, mul);
ficl2Unsigned resultHi = ficl2UnsignedMultiply(u.high, mul);
resultLo.high += resultHi.low;
resultHi.low = resultLo.low + add;
if (resultHi.low < resultLo.low)
resultLo.high++;
resultLo.low = resultHi.low;
return resultLo;
}
/**************************************************************************
ficl2IntegerMultiply
** Multiplies a pair of ficlIntegers and returns an ficl2Integer result.
**************************************************************************/
ficl2Integer ficl2IntegerMultiply(ficlInteger x, ficlInteger y)
{
ficl2Unsigned prod;
int sign = 1;
if (x < 0)
{
sign = -sign;
x = -x;
}
if (y < 0)
{
sign = -sign;
y = -y;
}
prod = ficl2UnsignedMultiply(x, y);
if (sign > 0)
return FICL_2UNSIGNED_TO_2INTEGER(prod);
else
return ficl2IntegerNegate(FICL_2UNSIGNED_TO_2INTEGER(prod));
}
ficl2Integer ficl2IntegerDecrement(ficl2Integer x)
{
if (x.low == INT_MIN)
x.high--;
x.low--;
return x;
}
ficl2Unsigned ficl2UnsignedAdd(ficl2Unsigned x, ficl2Unsigned y)
{
ficl2Unsigned result;
int carry;
result.high = x.high + y.high;
result.low = x.low + y.low;
carry = ((x.low | y.low) & FICL_CELL_HIGH_BIT) && !(result.low & FICL_CELL_HIGH_BIT);
carry |= ((x.low & y.low) & FICL_CELL_HIGH_BIT);
if (carry)
{
result.high++;
}
return result;
}
/**************************************************************************
ficl2UnsignedMultiply
** Contributed by:
** Michael A. Gauland gaulandm@mdhost.cse.tek.com
**************************************************************************/
ficl2Unsigned ficl2UnsignedMultiply(ficlUnsigned x, ficlUnsigned y)
{
ficl2Unsigned result = { 0, 0 };
ficl2Unsigned addend;
addend.low = y;
addend.high = 0; /* No sign extension--arguments are unsigned */
while (x != 0)
{
if ( x & 1)
{
result = ficl2UnsignedAdd(result, addend);
}
x >>= 1;
addend = ficl2UnsignedArithmeticShiftLeft(addend);
}
return result;
}
/**************************************************************************
ficl2UnsignedSubtract
**
**************************************************************************/
ficl2Unsigned ficl2UnsignedSubtract(ficl2Unsigned x, ficl2Unsigned y)
{
ficl2Unsigned result;
result.high = x.high - y.high;
result.low = x.low - y.low;
if (x.low < y.low)
{
result.high--;
}
return result;
}
/**************************************************************************
ficl2UnsignedArithmeticShiftLeft
** 64 bit left shift
**************************************************************************/
ficl2Unsigned ficl2UnsignedArithmeticShiftLeft( ficl2Unsigned x )
{
ficl2Unsigned result;
result.high = x.high << 1;
if (x.low & FICL_CELL_HIGH_BIT)
{
result.high++;
}
result.low = x.low << 1;
return result;
}
/**************************************************************************
ficl2UnsignedArithmeticShiftRight
** 64 bit right shift (unsigned - no sign extend)
**************************************************************************/
ficl2Unsigned ficl2UnsignedArithmeticShiftRight( ficl2Unsigned x )
{
ficl2Unsigned result;
result.low = x.low >> 1;
if (x.high & 1)
{
result.low |= FICL_CELL_HIGH_BIT;
}
result.high = x.high >> 1;
return result;
}
/**************************************************************************
ficl2UnsignedOr
** 64 bit bitwise OR
**************************************************************************/
ficl2Unsigned ficl2UnsignedOr( ficl2Unsigned x, ficl2Unsigned y )
{
ficl2Unsigned result;
result.high = x.high | y.high;
result.low = x.low | y.low;
return result;
}
/**************************************************************************
ficl2UnsignedCompare
** Return -1 if x < y; 0 if x==y, and 1 if x > y.
**************************************************************************/
int ficl2UnsignedCompare(ficl2Unsigned x, ficl2Unsigned y)
{
if (x.high > y.high)
return 1;
if (x.high < y.high)
return -1;
/* High parts are equal */
if (x.low > y.low)
return 1;
else if (x.low < y.low)
return -1;
return 0;
}
/**************************************************************************
ficl2UnsignedDivide
** Portable versions of ficl2Multiply and ficl2Divide in C
** Contributed by:
** Michael A. Gauland gaulandm@mdhost.cse.tek.com
**************************************************************************/
ficl2UnsignedQR ficl2UnsignedDivide(ficl2Unsigned q, ficlUnsigned y)
{
ficl2UnsignedQR result;
ficl2Unsigned quotient;
ficl2Unsigned subtrahend;
ficl2Unsigned mask;
quotient.low = 0;
quotient.high = 0;
subtrahend.low = y;
subtrahend.high = 0;
mask.low = 1;
mask.high = 0;
while ((ficl2UnsignedCompare(subtrahend, q) < 0) &&
(subtrahend.high & FICL_CELL_HIGH_BIT) == 0)
{
mask = ficl2UnsignedArithmeticShiftLeft(mask);
subtrahend = ficl2UnsignedArithmeticShiftLeft(subtrahend);
}
while (mask.low != 0 || mask.high != 0)
{
if (ficl2UnsignedCompare(subtrahend, q) <= 0)
{
q = ficl2UnsignedSubtract( q, subtrahend);
quotient = ficl2UnsignedOr(quotient, mask);
}
mask = ficl2UnsignedArithmeticShiftRight(mask);
subtrahend = ficl2UnsignedArithmeticShiftRight(subtrahend);
}
result.quotient = quotient;
result.remainder = q.low;
return result;
}
#endif /* !FICL_PLATFORM_HAS_2INTEGER */
/**************************************************************************
ficl2IntegerAbsoluteValue
** Returns the absolute value of an ficl2Unsigned
**************************************************************************/
ficl2Integer ficl2IntegerAbsoluteValue(ficl2Integer x)
{
if (ficl2IntegerIsNegative(x))
return ficl2IntegerNegate(x);
return x;
}
/**************************************************************************
ficl2IntegerDivideFloored
**
** FROM THE FORTH ANS...
** Floored division is integer division in which the remainder carries
** the sign of the divisor or is zero, and the quotient is rounded to
** its arithmetic floor. Symmetric division is integer division in which
** the remainder carries the sign of the dividend or is zero and the
** quotient is the mathematical quotient rounded towards zero or
** truncated. Examples of each are shown in tables 3.3 and 3.4.
**
** Table 3.3 - Floored Division Example
** Dividend Divisor Remainder Quotient
** -------- ------- --------- --------
** 10 7 3 1
** -10 7 4 -2
** 10 -7 -4 -2
** -10 -7 -3 1
**
**
** Table 3.4 - Symmetric Division Example
** Dividend Divisor Remainder Quotient
** -------- ------- --------- --------
** 10 7 3 1
** -10 7 -3 -1
** 10 -7 3 -1
** -10 -7 -3 1
**************************************************************************/
ficl2IntegerQR ficl2IntegerDivideFloored(ficl2Integer num, ficlInteger den)
{
ficl2IntegerQR qr;
ficl2UnsignedQR uqr;
int signRem = 1;
int signQuot = 1;
if (ficl2IntegerIsNegative(num))
{
num = ficl2IntegerNegate(num);
signQuot = -signQuot;
}
if (den < 0)
{
den = -den;
signRem = -signRem;
signQuot = -signQuot;
}
uqr = ficl2UnsignedDivide(FICL_2INTEGER_TO_2UNSIGNED(num), (ficlUnsigned)den);
qr = FICL_2UNSIGNEDQR_TO_2INTEGERQR(uqr);
if (signQuot < 0)
{
qr.quotient = ficl2IntegerNegate(qr.quotient);
if (qr.remainder != 0)
{
qr.quotient = ficl2IntegerDecrement(qr.quotient);
qr.remainder = den - qr.remainder;
}
}
if (signRem < 0)
qr.remainder = -qr.remainder;
return qr;
}
/**************************************************************************
ficl2IntegerDivideSymmetric
** Divide an ficl2Unsigned by a ficlInteger and return a ficlInteger quotient and a
** ficlInteger remainder. The absolute values of quotient and remainder are not
** affected by the signs of the numerator and denominator (the operation
** is symmetric on the number line)
**************************************************************************/
ficl2IntegerQR ficl2IntegerDivideSymmetric(ficl2Integer num, ficlInteger den)
{
ficl2IntegerQR qr;
ficl2UnsignedQR uqr;
int signRem = 1;
int signQuot = 1;
if (ficl2IntegerIsNegative(num))
{
num = ficl2IntegerNegate(num);
signRem = -signRem;
signQuot = -signQuot;
}
if (den < 0)
{
den = -den;
signQuot = -signQuot;
}
uqr = ficl2UnsignedDivide(FICL_2INTEGER_TO_2UNSIGNED(num), (ficlUnsigned)den);
qr = FICL_2UNSIGNEDQR_TO_2INTEGERQR(uqr);
if (signRem < 0)
qr.remainder = -qr.remainder;
if (signQuot < 0)
qr.quotient = ficl2IntegerNegate(qr.quotient);
return qr;
}
| {
"content_hash": "f10f3fad7f2bad1353fe2372de26f828",
"timestamp": "",
"source": "github",
"line_count": 479,
"max_line_length": 98,
"avg_line_length": 29.532359081419624,
"alnum_prop": 0.5217729393468118,
"repo_name": "createuniverses/praxis",
"id": "419186e6433693fe4f2c612db0e0038b1fccf2b9",
"size": "14146",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ficl-4.1.0/double.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "4769"
},
{
"name": "Batchfile",
"bytes": "1148"
},
{
"name": "C",
"bytes": "13186436"
},
{
"name": "C++",
"bytes": "2984512"
},
{
"name": "CMake",
"bytes": "3333"
},
{
"name": "CSS",
"bytes": "2758"
},
{
"name": "Common Lisp",
"bytes": "3705"
},
{
"name": "Forth",
"bytes": "488289"
},
{
"name": "GLSL",
"bytes": "80821"
},
{
"name": "Groff",
"bytes": "12511"
},
{
"name": "HTML",
"bytes": "1296611"
},
{
"name": "Io",
"bytes": "1001"
},
{
"name": "Lua",
"bytes": "1587873"
},
{
"name": "Makefile",
"bytes": "21338"
},
{
"name": "Objective-C",
"bytes": "36195"
},
{
"name": "Python",
"bytes": "6254"
},
{
"name": "QMake",
"bytes": "12417"
},
{
"name": "Scheme",
"bytes": "353014"
},
{
"name": "Shell",
"bytes": "127"
}
],
"symlink_target": ""
} |
#include <osapi.h>
#include <os_type.h>
#include <c_types.h>
#include <user_interface.h>
#include "gpio.h"
#include "dhcommands.h"
#include "dhdebug.h"
#include "dhsender_queue.h"
#include "dhterminal.h"
#include "dhsettings.h"
#include "dhap.h"
typedef struct {
unsigned int magic;
unsigned int resetCounter;
} RESET_COUNTER;
#define RESET_COUNTER_MAGIC 0x12345678
#define RESET_COUNTER_RTC_ADDRESS 64
#define RESET_NUM 3
LOCAL os_timer_t mResetTimer;
LOCAL unsigned int mSpecialMode = 0;
LOCAL void ICACHE_FLASH_ATTR reset_counter(void *arg) {
RESET_COUNTER counter;
counter.magic = RESET_COUNTER_MAGIC;
counter.resetCounter = 0;
system_rtc_mem_write(RESET_COUNTER_RTC_ADDRESS, &counter, sizeof(counter));
}
extern int rtc_mem_check(int f);
void user_rf_pre_init(void) {
RESET_COUNTER counter;
system_rtc_mem_read(64, &counter, sizeof(counter));
if(counter.magic == RESET_COUNTER_MAGIC && counter.resetCounter <= RESET_NUM) {
counter.resetCounter++;
if(counter.resetCounter == RESET_NUM) {
reset_counter(0);
mSpecialMode = 1;
} else {
system_rtc_mem_write(RESET_COUNTER_RTC_ADDRESS, &counter, sizeof(counter));
os_timer_disarm(&mResetTimer);
os_timer_setfn(&mResetTimer, (os_timer_func_t *)reset_counter, NULL);
os_timer_arm(&mResetTimer, 3000, 0);
}
} else {
reset_counter(0);
}
system_restore();
rtc_mem_check(0);
}
void user_init(void) {
if(mSpecialMode) {
system_set_os_print(0);
dhsettings_init();
dhap_init();
} else {
dhterminal_init();
dhdebug("*****************************");
dhsender_queue_init();
dhsettings_init();
dhconnector_init(dhcommands_do);
dhgpio_init();
dhdebug("Initialization completed");
}
}
| {
"content_hash": "1bc334e1d52714bc19d5e79b92f953d6",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 80,
"avg_line_length": 23.830985915492956,
"alnum_prop": 0.6932624113475178,
"repo_name": "clandestin/esp8266-firmware",
"id": "015fc4fee45e4e405812f3facccfb228839b44da",
"size": "1830",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "firmware-src/sources/main.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "77"
},
{
"name": "C",
"bytes": "290627"
},
{
"name": "C++",
"bytes": "54208"
},
{
"name": "HTML",
"bytes": "15569"
},
{
"name": "Makefile",
"bytes": "2551"
},
{
"name": "Shell",
"bytes": "3150"
}
],
"symlink_target": ""
} |
using System;
using System.Linq;
namespace Breeze.Sharp {
// TODO: make immutable later
/// <summary>
/// A ValidationOptions instance is used to specify the conditions under which validation will be executed.
/// This may be set via the <see cref="EntityManager.ValidationOptions"/> property.
/// </summary>
public class ValidationOptions {
public ValidationOptions() {
ValidationApplicability = ValidationApplicability.Default;
// ValidationNotificationMode = NetClient.ValidationNotificationMode.Notify;
}
public ValidationApplicability ValidationApplicability { get; set; }
public static ValidationOptions Default = new ValidationOptions();
}
/// <summary>
/// An enum used to describe the conditions under which validation should occur.
/// This value is set via the <see cref="ValidationOptions.ValidationApplicability"/>.
/// </summary>
[Flags]
public enum ValidationApplicability {
OnPropertyChange = 1,
OnAttach = 2,
OnQuery = 4,
OnSave = 8,
Default = OnPropertyChange | OnAttach | OnSave
}
// DON'T ADD back without discussing with Jay
// Possiblity of throwing an exception while validating requires changes in a number of places
// to insure other process aren't broken (example is during a query)
//public enum ValidationNotificationMode {
// /// <summary>
// /// Causes notification through the <b>INotifyDataErrorInfo</b> interface.
// /// </summary>
// Notify = 1,
// /// <summary>
// /// Throws an exception.
// /// </summary>
// ThrowException = 2,
// /// <summary>
// /// Notify using <b>INotifyDataErrorInfo</b> and throw exception.
// /// </summary>
// NotifyAndThrowException = 3
//}
}
| {
"content_hash": "f00d7d259b28cf952f9f4ef450f9eff7",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 109,
"avg_line_length": 31.196428571428573,
"alnum_prop": 0.683457355466514,
"repo_name": "Breeze/breeze.sharp",
"id": "6166630f8ebe7f42565c6aa28d852e34eeee3910",
"size": "1749",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Breeze.Sharp/ValidationOptions.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "45"
},
{
"name": "C#",
"bytes": "871775"
},
{
"name": "HTML",
"bytes": "19909"
},
{
"name": "JavaScript",
"bytes": "17601"
}
],
"symlink_target": ""
} |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE369_Divide_by_Zero__int_listen_socket_modulo_21.c
Label Definition File: CWE369_Divide_by_Zero__int.label.xml
Template File: sources-sinks-21.tmpl.c
*/
/*
* @description
* CWE: 369 Divide by Zero
* BadSource: listen_socket Read data using a listen socket (server side)
* GoodSource: Non-zero
* Sinks: modulo
* GoodSink: Check for zero before modulo
* BadSink : Modulo a constant with data
* Flow Variant: 21 Control flow: Flow controlled by value of a static global variable. All functions contained in one file.
*
* */
#include "std_testcase.h"
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#include <direct.h>
#pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */
#define CLOSE_SOCKET closesocket
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define CLOSE_SOCKET close
#define SOCKET int
#endif
#define TCP_PORT 27015
#define LISTEN_BACKLOG 5
#define CHAR_ARRAY_SIZE (3 * sizeof(data) + 2)
#ifndef OMITBAD
/* The static variable below is used to drive control flow in the sink function */
static int badStatic = 0;
static void badSink(int data)
{
if(badStatic)
{
/* POTENTIAL FLAW: Possibly divide by zero */
printIntLine(100 % data);
}
}
void CWE369_Divide_by_Zero__int_listen_socket_modulo_21_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
badStatic = 1; /* true */
badSink(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* The static variables below are used to drive control flow in the sink functions. */
static int goodB2G1Static = 0;
static int goodB2G2Static = 0;
static int goodG2BStatic = 0;
/* goodB2G1() - use badsource and goodsink by setting the static variable to false instead of true */
static void goodB2G1Sink(int data)
{
if(goodB2G1Static)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* FIX: test for a zero denominator */
if( data != 0 )
{
printIntLine(100 % data);
}
else
{
printLine("This would result in a divide by zero");
}
}
}
static void goodB2G1()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
goodB2G1Static = 0; /* false */
goodB2G1Sink(data);
}
/* goodB2G2() - use badsource and goodsink by reversing the blocks in the if in the sink function */
static void goodB2G2Sink(int data)
{
if(goodB2G2Static)
{
/* FIX: test for a zero denominator */
if( data != 0 )
{
printIntLine(100 % data);
}
else
{
printLine("This would result in a divide by zero");
}
}
}
static void goodB2G2()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
goodB2G2Static = 1; /* true */
goodB2G2Sink(data);
}
/* goodG2B() - use goodsource and badsink */
static void goodG2BSink(int data)
{
if(goodG2BStatic)
{
/* POTENTIAL FLAW: Possibly divide by zero */
printIntLine(100 % data);
}
}
static void goodG2B()
{
int data;
/* Initialize data */
data = -1;
/* FIX: Use a value not equal to zero */
data = 7;
goodG2BStatic = 1; /* true */
goodG2BSink(data);
}
void CWE369_Divide_by_Zero__int_listen_socket_modulo_21_good()
{
goodB2G1();
goodB2G2();
goodG2B();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE369_Divide_by_Zero__int_listen_socket_modulo_21_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE369_Divide_by_Zero__int_listen_socket_modulo_21_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| {
"content_hash": "910b9968c69d6a5deaacf3d4c9380d03",
"timestamp": "",
"source": "github",
"line_count": 392,
"max_line_length": 124,
"avg_line_length": 27.841836734693878,
"alnum_prop": 0.5251969946857248,
"repo_name": "JianpingZeng/xcc",
"id": "7b2dd6e00fd6f8d266a002bd9f31dc43ee1140b0",
"size": "10914",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "xcc/test/juliet/testcases/CWE369_Divide_by_Zero/s02/CWE369_Divide_by_Zero__int_listen_socket_modulo_21.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
//
// AGDrawing.h
// HighlighterDetector
//
// Created by Aleksander Grzyb on 25/05/14.
// Copyright (c) 2014 Aleksander Grzyb. All rights reserved.
//
#ifndef __HighlighterDetector__AGDrawing__
#define __HighlighterDetector__AGDrawing__
#include <opencv2/opencv.hpp>
class AGDrawing {
public:
void static drawCornersInImage(cv::Mat& image, std::vector<cv::Point>& imageCorners);
void static drawSquaresInImage(cv::Mat& image, std::vector<std::vector<cv::Point>>& squares);
};
#endif /* defined(__HighlighterDetector__AGDrawing__) */
| {
"content_hash": "4e6e925c16e6ed3fe6c53df12ae711c2",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 97,
"avg_line_length": 27.7,
"alnum_prop": 0.7111913357400722,
"repo_name": "aleksandergrzyb/HighlighterDetectorApplication",
"id": "7a8ea9345541e0a75f0a3e9c3c48f3423f9117a8",
"size": "554",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "HighlighterDetectorApplication/ImageProcessing/AGDrawing.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "2402"
},
{
"name": "Objective-C",
"bytes": "16839"
},
{
"name": "Objective-C++",
"bytes": "40969"
},
{
"name": "Ruby",
"bytes": "71"
}
],
"symlink_target": ""
} |
using UnityEngine;
using System.Collections;
public class GameStorageRetriever
{
private GameStorageKey key;
private GameStorageRetriever(GameStorageKey key)
{
this.key = key;
}
public static GameStorageRetriever ForKey(GameStorageKey key)
{
return new GameStorageRetriever(key);
}
public GameStorage<T> GetPersistentOnDevice<T>()
{
return PlayerPrefsOnDevicePersistentStorageRetriever.GetForKey<T>(key);
}
public GameStorage<T> GetVolatileOnMemory<T>()
{
return DictionaryOnMemoryVolatileStorageRetriever.GetForKey<T>(key);
}
}
| {
"content_hash": "224e2aea54d699dce817bedd9043817a",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 73,
"avg_line_length": 20.555555555555557,
"alnum_prop": 0.7873873873873873,
"repo_name": "alvarogzp/nextation",
"id": "27a98b6d369339e96237e8e335dadb9a05288d7e",
"size": "555",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Assets/Scripts/Storage/GameStorageRetriever.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "179337"
},
{
"name": "JavaScript",
"bytes": "1437"
},
{
"name": "Shell",
"bytes": "3196"
}
],
"symlink_target": ""
} |
#include "../challenge_1_5/challenge_1_5.h"
#include <climits>
#include <numeric>
inline int BitsSet(unsigned char c)
{
auto set = 0;
set += c >> 0 & 1;
set += c >> 1 & 1;
set += c >> 2 & 1;
set += c >> 3 & 1;
set += c >> 4 & 1;
set += c >> 5 & 1;
set += c >> 6 & 1;
set += c >> 7 & 1;
return set;
}
inline int HammingDistance(const std::vector<unsigned char> & first, const std::vector<unsigned char> & second)
{
auto smallerPtr = &first;
auto biggerPtr = &second;
if (first.size() < second.size())
std::swap(smallerPtr, biggerPtr);
const auto & smaller = smallerPtr[0];
const auto & bigger = biggerPtr[0];
auto distance = 0;
for (size_t i = 0; i < smaller.size(); i++)
distance += BitsSet(smaller[i] ^ bigger[i]);
auto diff = bigger.size() - smaller.size();
for (size_t i = 0; i < diff; i++)
distance += BitsSet(bigger[smaller.size() + i]);
return distance;
}
inline bool TakeBytes(const std::vector<unsigned char> & data, size_t start, size_t size, std::vector<unsigned char> & out)
{
if (start + size > data.size())
return false;
out.resize(size);
for (size_t i = 0; i < size; i++)
out[i] = data[start + i];
return true;
}
inline size_t FindRepeatingXorKeysize(const std::vector<unsigned char> & ciphertext, size_t lowerBound = 2, size_t upperBound = 40)
{
double smallestDistance = INT_MAX;
auto bestKeysize = lowerBound;
for (auto KEYSIZE = lowerBound; KEYSIZE < upperBound; KEYSIZE++)
{
std::vector<unsigned char> blocks[4];
for (size_t i = 0; i < _countof(blocks); i++)
if (!TakeBytes(ciphertext, i * KEYSIZE, KEYSIZE, blocks[i]))
{
puts("TakeBytes failed...");
return bestKeysize;
}
std::vector<double> distances;
distances.reserve(_countof(blocks) * 2);
for (size_t i = 0; i < _countof(blocks); i++)
for (auto j = i + 1; j < _countof(blocks); j++)
distances.push_back(double(HammingDistance(blocks[i], blocks[j])) / KEYSIZE);
auto averageDistance = std::accumulate(distances.begin(), distances.end(), 0.0) / distances.size();
//printf("size: %d, dist: %f\n", KEYSIZE, averageDistance);
if (averageDistance <= smallestDistance)
{
//printf("found better %f from %f, keysize: %d\n", averageDistance, smallestDistance, KEYSIZE);
smallestDistance = averageDistance;
bestKeysize = KEYSIZE;
}
}
return bestKeysize;
}
inline void BreakRepeatingXor(const std::vector<unsigned char> & ciphertext, std::vector<unsigned char> & foundKey)
{
//find keysize
auto KEYSIZE = FindRepeatingXorKeysize(ciphertext);
foundKey.resize(KEYSIZE);
//break ciphertext into blocks of KEYSIZE
std::vector<std::vector<unsigned char>> blocks;
blocks.resize(ciphertext.size() / KEYSIZE);
for (size_t i = 0; i < blocks.size(); i++)
{
if (!TakeBytes(ciphertext, i * KEYSIZE, KEYSIZE, blocks[i]))
{
puts("TakeBytes failed...");
return;
}
}
//transpose the blocks
std::vector<std::vector<unsigned char>> transposed;
transposed.resize(KEYSIZE);
for (size_t i = 0; i < transposed.size(); i++)
{
transposed[i].resize(blocks.size());
for (size_t j = 0; j < blocks.size(); j++)
transposed[i][j] = blocks[j][i];
}
//solve single-byte xor key for each transposed block
for (size_t i = 0; i < transposed.size(); i++)
{
auto bestScore = 0;
unsigned char bestKey = 0;
FindBestSingleXorKey(transposed[i], bestKey, bestScore);
foundKey[i] = bestKey;
}
} | {
"content_hash": "d32174b4cd9fe77e67e10d71c7433d4c",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 131,
"avg_line_length": 33.869565217391305,
"alnum_prop": 0.562772785622593,
"repo_name": "mrexodia/cryptopals",
"id": "ce9b299bbfea66addab34a0580e2a3766d5992f6",
"size": "3909",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "challenge_1_6/challenge_1_6.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "22254"
},
{
"name": "Objective-C",
"bytes": "49644"
}
],
"symlink_target": ""
} |
<?php
namespace Symfony\Bundle\FrameworkBundle\Command;
use Symfony\Bundle\FrameworkBundle\Console\Helper\DescriptorHelper;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
/**
* A console command for retrieving information about services.
*
* @author Ryan Weaver <ryan@thatsquality.com>
*
* @internal
*/
#[AsCommand(name: 'debug:container', description: 'Display current services for an application')]
class ContainerDebugCommand extends Command
{
use BuildDebugContainerTrait;
/**
* {@inheritdoc}
*/
protected function configure()
{
$this
->setDefinition([
new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'),
new InputOption('show-arguments', null, InputOption::VALUE_NONE, 'Show arguments in services'),
new InputOption('show-hidden', null, InputOption::VALUE_NONE, 'Show hidden (internal) services'),
new InputOption('tag', null, InputOption::VALUE_REQUIRED, 'Show all services with a specific tag'),
new InputOption('tags', null, InputOption::VALUE_NONE, 'Display tagged services for an application'),
new InputOption('parameter', null, InputOption::VALUE_REQUIRED, 'Display a specific parameter for an application'),
new InputOption('parameters', null, InputOption::VALUE_NONE, 'Display parameters for an application'),
new InputOption('types', null, InputOption::VALUE_NONE, 'Display types (classes/interfaces) available in the container'),
new InputOption('env-var', null, InputOption::VALUE_REQUIRED, 'Display a specific environment variable used in the container'),
new InputOption('env-vars', null, InputOption::VALUE_NONE, 'Display environment variables used in the container'),
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'),
new InputOption('deprecations', null, InputOption::VALUE_NONE, 'Display deprecations generated when compiling and warming up the container'),
])
->setHelp(<<<'EOF'
The <info>%command.name%</info> command displays all configured <comment>public</comment> services:
<info>php %command.full_name%</info>
To see deprecations generated during container compilation and cache warmup, use the <info>--deprecations</info> option:
<info>php %command.full_name% --deprecations</info>
To get specific information about a service, specify its name:
<info>php %command.full_name% validator</info>
To get specific information about a service including all its arguments, use the <info>--show-arguments</info> flag:
<info>php %command.full_name% validator --show-arguments</info>
To see available types that can be used for autowiring, use the <info>--types</info> flag:
<info>php %command.full_name% --types</info>
To see environment variables used by the container, use the <info>--env-vars</info> flag:
<info>php %command.full_name% --env-vars</info>
Display a specific environment variable by specifying its name with the <info>--env-var</info> option:
<info>php %command.full_name% --env-var=APP_ENV</info>
Use the --tags option to display tagged <comment>public</comment> services grouped by tag:
<info>php %command.full_name% --tags</info>
Find all services with a specific tag by specifying the tag name with the <info>--tag</info> option:
<info>php %command.full_name% --tag=form.type</info>
Use the <info>--parameters</info> option to display all parameters:
<info>php %command.full_name% --parameters</info>
Display a specific parameter by specifying its name with the <info>--parameter</info> option:
<info>php %command.full_name% --parameter=kernel.debug</info>
By default, internal services are hidden. You can display them
using the <info>--show-hidden</info> flag:
<info>php %command.full_name% --show-hidden</info>
EOF
)
;
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$errorIo = $io->getErrorStyle();
$this->validateInput($input);
$kernel = $this->getApplication()->getKernel();
$object = $this->getContainerBuilder($kernel);
if ($input->getOption('env-vars')) {
$options = ['env-vars' => true];
} elseif ($envVar = $input->getOption('env-var')) {
$options = ['env-vars' => true, 'name' => $envVar];
} elseif ($input->getOption('types')) {
$options = [];
$options['filter'] = $this->filterToServiceTypes(...);
} elseif ($input->getOption('parameters')) {
$parameters = [];
foreach ($object->getParameterBag()->all() as $k => $v) {
$parameters[$k] = $object->resolveEnvPlaceholders($v);
}
$object = new ParameterBag($parameters);
$options = [];
} elseif ($parameter = $input->getOption('parameter')) {
$options = ['parameter' => $parameter];
} elseif ($input->getOption('tags')) {
$options = ['group_by' => 'tags'];
} elseif ($tag = $input->getOption('tag')) {
$options = ['tag' => $tag];
} elseif ($name = $input->getArgument('name')) {
$name = $this->findProperServiceName($input, $errorIo, $object, $name, $input->getOption('show-hidden'));
$options = ['id' => $name];
} elseif ($input->getOption('deprecations')) {
$options = ['deprecations' => true];
} else {
$options = [];
}
$helper = new DescriptorHelper();
$options['format'] = $input->getOption('format');
$options['show_arguments'] = $input->getOption('show-arguments');
$options['show_hidden'] = $input->getOption('show-hidden');
$options['raw_text'] = $input->getOption('raw');
$options['output'] = $io;
$options['is_debug'] = $kernel->isDebug();
try {
$helper->describe($io, $object, $options);
if (isset($options['id']) && isset($kernel->getContainer()->getRemovedIds()[$options['id']])) {
$errorIo->note(sprintf('The "%s" service or alias has been removed or inlined when the container was compiled.', $options['id']));
}
} catch (ServiceNotFoundException $e) {
if ('' !== $e->getId() && '@' === $e->getId()[0]) {
throw new ServiceNotFoundException($e->getId(), $e->getSourceId(), null, [substr($e->getId(), 1)]);
}
throw $e;
}
if (!$input->getArgument('name') && !$input->getOption('tag') && !$input->getOption('parameter') && !$input->getOption('env-vars') && !$input->getOption('env-var') && $input->isInteractive()) {
if ($input->getOption('tags')) {
$errorIo->comment('To search for a specific tag, re-run this command with a search term. (e.g. <comment>debug:container --tag=form.type</comment>)');
} elseif ($input->getOption('parameters')) {
$errorIo->comment('To search for a specific parameter, re-run this command with a search term. (e.g. <comment>debug:container --parameter=kernel.debug</comment>)');
} elseif (!$input->getOption('deprecations')) {
$errorIo->comment('To search for a specific service, re-run this command with a search term. (e.g. <comment>debug:container log</comment>)');
}
}
return 0;
}
public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
{
if ($input->mustSuggestOptionValuesFor('format')) {
$helper = new DescriptorHelper();
$suggestions->suggestValues($helper->getFormats());
return;
}
$kernel = $this->getApplication()->getKernel();
$object = $this->getContainerBuilder($kernel);
if ($input->mustSuggestArgumentValuesFor('name')
&& !$input->getOption('tag') && !$input->getOption('tags')
&& !$input->getOption('parameter') && !$input->getOption('parameters')
&& !$input->getOption('env-var') && !$input->getOption('env-vars')
&& !$input->getOption('types') && !$input->getOption('deprecations')
) {
$suggestions->suggestValues($this->findServiceIdsContaining(
$object,
$input->getCompletionValue(),
(bool) $input->getOption('show-hidden')
));
return;
}
if ($input->mustSuggestOptionValuesFor('tag')) {
$suggestions->suggestValues($object->findTags());
return;
}
if ($input->mustSuggestOptionValuesFor('parameter')) {
$suggestions->suggestValues(array_keys($object->getParameterBag()->all()));
}
}
/**
* Validates input arguments and options.
*
* @throws \InvalidArgumentException
*/
protected function validateInput(InputInterface $input)
{
$options = ['tags', 'tag', 'parameters', 'parameter'];
$optionsCount = 0;
foreach ($options as $option) {
if ($input->getOption($option)) {
++$optionsCount;
}
}
$name = $input->getArgument('name');
if ((null !== $name) && ($optionsCount > 0)) {
throw new InvalidArgumentException('The options tags, tag, parameters & parameter cannot be combined with the service name argument.');
} elseif ((null === $name) && $optionsCount > 1) {
throw new InvalidArgumentException('The options tags, tag, parameters & parameter cannot be combined together.');
}
}
private function findProperServiceName(InputInterface $input, SymfonyStyle $io, ContainerBuilder $builder, string $name, bool $showHidden): string
{
$name = ltrim($name, '\\');
if ($builder->has($name) || !$input->isInteractive()) {
return $name;
}
$matchingServices = $this->findServiceIdsContaining($builder, $name, $showHidden);
if (empty($matchingServices)) {
throw new InvalidArgumentException(sprintf('No services found that match "%s".', $name));
}
if (1 === \count($matchingServices)) {
return $matchingServices[0];
}
return $io->choice('Select one of the following services to display its information', $matchingServices);
}
private function findServiceIdsContaining(ContainerBuilder $builder, string $name, bool $showHidden): array
{
$serviceIds = $builder->getServiceIds();
$foundServiceIds = $foundServiceIdsIgnoringBackslashes = [];
foreach ($serviceIds as $serviceId) {
if (!$showHidden && str_starts_with($serviceId, '.')) {
continue;
}
if (false !== stripos(str_replace('\\', '', $serviceId), $name)) {
$foundServiceIdsIgnoringBackslashes[] = $serviceId;
}
if ('' === $name || false !== stripos($serviceId, $name)) {
$foundServiceIds[] = $serviceId;
}
}
return $foundServiceIds ?: $foundServiceIdsIgnoringBackslashes;
}
/**
* @internal
*/
public function filterToServiceTypes(string $serviceId): bool
{
// filter out things that could not be valid class names
if (!preg_match('/(?(DEFINE)(?<V>[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+))^(?&V)(?:\\\\(?&V))*+(?: \$(?&V))?$/', $serviceId)) {
return false;
}
// if the id has a \, assume it is a class
if (str_contains($serviceId, '\\')) {
return true;
}
return class_exists($serviceId) || interface_exists($serviceId, false);
}
}
| {
"content_hash": "079c32b767a34179cc3f65e3813a006b",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 201,
"avg_line_length": 42.00328947368421,
"alnum_prop": 0.6137520557600439,
"repo_name": "symfony/framework-bundle",
"id": "c5c2da4a4407c908b9780f59e7595acf11018abc",
"size": "12998",
"binary": false,
"copies": "5",
"ref": "refs/heads/6.1",
"path": "Command/ContainerDebugCommand.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "1514234"
},
{
"name": "Twig",
"bytes": "734"
}
],
"symlink_target": ""
} |
extern "C"
{
#endif
/// Print input to stdout (convert to string if needed).
FORCE_EXPORT void sioPrint_(rtclosure *closure, rtdata data, rtt_t rtt);
EXPORT_CLOSURE(sioPrint)
/// Read a line of text from stdin.
FORCE_EXPORT rtstring *sioRead_(rtclosure *closure, rtt_t *retvalrtt);
EXPORT_CLOSURE(sioRead)
/// Read an entire UTF-8 text file into a string
FORCE_EXPORT rtvariant *sioLoadFile_(rtclosure *closure, rtt_t *retvalrtt, rtdata path, rtt_t rtt);
EXPORT_CLOSURE(sioLoadFile)
/// Save the data in the second parameter as a string to the file named in the first parameter.
FORCE_EXPORT rtdata sioSaveFile_(rtclosure *closure, rtt_t *retvalrtt, rtdata path, rtt_t pathrtt, rtdata data, rtt_t datartt);
EXPORT_CLOSURE(sioSaveFile)
#ifdef __cplusplus
}
#endif
#endif
| {
"content_hash": "cb846c4cc9e48c8c218a0ff1f742f260",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 128,
"avg_line_length": 37.333333333333336,
"alnum_prop": 0.7461734693877551,
"repo_name": "orycho/Intro",
"id": "e9eadb19904c22b83b09e4ab7f9473f40c654cf4",
"size": "862",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Intro/LibSIO.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2086"
},
{
"name": "C++",
"bytes": "652166"
},
{
"name": "Makefile",
"bytes": "3350"
}
],
"symlink_target": ""
} |
@implementation NSString (StringSize)
- (CGSize)sizeWithFont:(UIFont*)font maxSize:(CGSize)size
{
//特殊的格式要求都写在属性字典中
NSDictionary*attrs =@{NSFontAttributeName:font};
//返回一个矩形,大小等于文本绘制完占据的宽和高。
return [self boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
}
+ (CGSize)sizeWithString:(NSString*)str font:(UIFont*)font maxSize:(CGSize)size{
NSDictionary*attrs =@{NSFontAttributeName:font};
return [str boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
}
@end
| {
"content_hash": "4139dc0d245216bb21dd75ce25ca7715",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 124,
"avg_line_length": 39.86666666666667,
"alnum_prop": 0.7876254180602007,
"repo_name": "315355504/KWTest",
"id": "c7ac6c4851b010c088f8ca8b3b2c137f2021d361",
"size": "822",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "KWTest/KW/CategoryGroup/NSString+StringSize.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1002"
},
{
"name": "Objective-C",
"bytes": "704317"
},
{
"name": "Ruby",
"bytes": "427"
}
],
"symlink_target": ""
} |
import Ember from 'ember';
import DS from 'ember-data';
export default Ember.Mixin.create({
deletedAt: DS.attr('date'),
isDeleted: function() {
return Ember.isPresent(this.get('deletedAt'));
}.property('deletedAt')
});
| {
"content_hash": "a7d76763d201b95d3a1cc8483942f628",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 50,
"avg_line_length": 23.1,
"alnum_prop": 0.6883116883116883,
"repo_name": "NullVoxPopuli/aeonvera-ui",
"id": "971d6c66f000c29aac2642408a48c414d5d0828a",
"size": "231",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/mixins/models/deleted-at.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "82895"
},
{
"name": "HTML",
"bytes": "120459"
},
{
"name": "JavaScript",
"bytes": "434126"
},
{
"name": "Shell",
"bytes": "2028"
},
{
"name": "TypeScript",
"bytes": "28107"
}
],
"symlink_target": ""
} |
ActiveRecord::Schema.define(version: 20150828140021) do
create_table "sensitives", force: :cascade do |t|
t.string "encrypted_message"
t.string "encrypted_message_iv"
end
end
| {
"content_hash": "2f61be568c14e9658e60b4c3fb7bd1d5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 55,
"avg_line_length": 23.625,
"alnum_prop": 0.7248677248677249,
"repo_name": "gsamokovarov/claude",
"id": "c03272e1a6e452b074730b5158de876c4aeea8ad",
"size": "930",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/dummy/db/schema.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "686"
},
{
"name": "HTML",
"bytes": "4883"
},
{
"name": "JavaScript",
"bytes": "602"
},
{
"name": "Ruby",
"bytes": "28987"
},
{
"name": "Shell",
"bytes": "115"
}
],
"symlink_target": ""
} |
/*!
* jQuery Form Plugin
* version: 2.64 (25-FEB-2011)
* @requires jQuery v1.3.2 or later
*
* Examples and documentation at: http://malsup.com/jquery/form/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
;(function($) {
/*
Usage Note:
-----------
Do not use both ajaxSubmit and ajaxForm on the same form. These
functions are intended to be exclusive. Use ajaxSubmit if you want
to bind your own submit handler to the form. For example,
$(document).ready(function() {
$('#myForm').bind('submit', function(e) {
e.preventDefault(); // <-- important
$(this).ajaxSubmit({
target: '#output'
});
});
});
Use ajaxForm when you want the plugin to manage all the event binding
for you. For example,
$(document).ready(function() {
$('#myForm').ajaxForm({
target: '#output'
});
});
When using ajaxForm, the ajaxSubmit function will be invoked for you
at the appropriate time.
*/
/**
* ajaxSubmit() provides a mechanism for immediately submitting
* an HTML form using AJAX.
*/
$.fn.ajaxSubmit = function(options) {
// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
if (!this.length) {
log('ajaxSubmit: skipping submit process - no element selected');
return this;
}
if (typeof options == 'function') {
options = { success: options };
}
var action = this.attr('action');
var url = (typeof action === 'string') ? $.trim(action) : '';
if (url) {
// clean url (don't include hash vaue)
url = (url.match(/^([^#]+)/)||[])[1];
}
url = url || window.location.href || '';
options = $.extend(true, {
url: url,
type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57)
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
}, options);
// hook for manipulating the form data before it is extracted;
// convenient for use with rich editors like tinyMCE or FCKEditor
var veto = {};
this.trigger('form-pre-serialize', [this, options, veto]);
if (veto.veto) {
log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
return this;
}
// provide opportunity to alter form data before it is serialized
if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
log('ajaxSubmit: submit aborted via beforeSerialize callback');
return this;
}
var n,v,a = this.formToArray(options.semantic);
if (options.data) {
options.extraData = options.data;
for (n in options.data) {
if(options.data[n] instanceof Array) {
for (var k in options.data[n]) {
a.push( { name: n, value: options.data[n][k] } );
}
}
else {
v = options.data[n];
v = $.isFunction(v) ? v() : v; // if value is fn, invoke it
a.push( { name: n, value: v } );
}
}
}
// give pre-submit callback an opportunity to abort the submit
if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
log('ajaxSubmit: submit aborted via beforeSubmit callback');
return this;
}
// fire vetoable 'validate' event
this.trigger('form-submit-validate', [a, this, options, veto]);
if (veto.veto) {
log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
return this;
}
var q = $.param(a);
if (options.type.toUpperCase() == 'GET') {
options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
options.data = null; // data is null for 'get'
}
else {
options.data = q; // data is the query string for 'post'
}
var $form = this, callbacks = [];
if (options.resetForm) {
callbacks.push(function() { $form.resetForm(); });
}
if (options.clearForm) {
callbacks.push(function() { $form.clearForm(); });
}
// perform a load on the target only if dataType is not provided
if (!options.dataType && options.target) {
var oldSuccess = options.success || function(){};
callbacks.push(function(data) {
var fn = options.replaceTarget ? 'replaceWith' : 'html';
$(options.target)[fn](data).each(oldSuccess, arguments);
});
}
else if (options.success) {
callbacks.push(options.success);
}
options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
var context = options.context || options; // jQuery 1.4+ supports scope context
for (var i=0, max=callbacks.length; i < max; i++) {
callbacks[i].apply(context, [data, status, xhr || $form, $form]);
}
};
// are there files to upload?
var fileInputs = $('input:file', this).length > 0;
var mp = 'multipart/form-data';
var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
// options.iframe allows user to force iframe mode
// 06-NOV-09: now defaulting to iframe mode if file input is detected
if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {
// hack to fix Safari hang (thanks to Tim Molendijk for this)
// see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
if (options.closeKeepAlive) {
$.get(options.closeKeepAlive, fileUpload);
}
else {
fileUpload();
}
}
else {
$.ajax(options);
}
// fire 'notify' event
this.trigger('form-submit-notify', [this, options]);
return this;
// private function for handling file uploads (hat tip to YAHOO!)
function fileUpload() {
var form = $form[0];
if ($(':input[name=submit],:input[id=submit]', form).length) {
// if there is an input with a name or id of 'submit' then we won't be
// able to invoke the submit fn on the form (at least not x-browser)
alert('Error: Form elements must not have name or id of "submit".');
return;
}
var s = $.extend(true, {}, $.ajaxSettings, options);
s.context = s.context || s;
var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id;
var $io = $('<iframe id="' + id + '" name="' + id + '" src="'+ s.iframeSrc +'" />');
var io = $io[0];
$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
var xhr = { // mock object
aborted: 0,
responseText: null,
responseXML: null,
status: 0,
statusText: 'n/a',
getAllResponseHeaders: function() {},
getResponseHeader: function() {},
setRequestHeader: function() {},
abort: function() {
this.aborted = 1;
$io.attr('src', s.iframeSrc); // abort op in progress
}
};
var g = s.global;
// trigger ajax global events so that activity/block indicators work like normal
if (g && ! $.active++) {
$.event.trigger("ajaxStart");
}
if (g) {
$.event.trigger("ajaxSend", [xhr, s]);
}
if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
if (s.global) {
$.active--;
}
return;
}
if (xhr.aborted) {
return;
}
var timedOut = 0;
// add submitting element to data if we know it
var sub = form.clk;
if (sub) {
var n = sub.name;
if (n && !sub.disabled) {
s.extraData = s.extraData || {};
s.extraData[n] = sub.value;
if (sub.type == "image") {
s.extraData[n+'.x'] = form.clk_x;
s.extraData[n+'.y'] = form.clk_y;
}
}
}
// take a breath so that pending repaints get some cpu time before the upload starts
function doSubmit() {
// make sure form attrs are set
var t = $form.attr('target'), a = $form.attr('action');
// update form attrs in IE friendly way
form.setAttribute('target',id);
if (form.getAttribute('method') != 'POST') {
form.setAttribute('method', 'POST');
}
if (form.getAttribute('action') != s.url) {
form.setAttribute('action', s.url);
}
// ie borks in some cases when setting encoding
if (! s.skipEncodingOverride) {
$form.attr({
encoding: 'multipart/form-data',
enctype: 'multipart/form-data'
});
}
// support timout
if (s.timeout) {
setTimeout(function() { timedOut = true; cb(); }, s.timeout);
}
// add "extra" data to form if provided in options
var extraInputs = [];
try {
if (s.extraData) {
for (var n in s.extraData) {
extraInputs.push(
$('<input type="hidden" name="'+n+'" value="'+s.extraData[n]+'" />')
.appendTo(form)[0]);
}
}
// add iframe to doc and submit the form
$io.appendTo('body');
io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
form.submit();
}
finally {
// reset attrs and remove "extra" input elements
form.setAttribute('action',a);
if(t) {
form.setAttribute('target', t);
} else {
$form.removeAttr('target');
}
$(extraInputs).remove();
}
}
if (s.forceSync) {
doSubmit();
}
else {
setTimeout(doSubmit, 10); // this lets dom updates render
}
var data, doc, domCheckCount = 50;
function cb() {
doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
if (!doc || doc.location.href == s.iframeSrc) {
// response not received yet
return;
}
io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
var ok = true;
try {
if (timedOut) {
throw 'timeout';
}
var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
log('isXml='+isXml);
if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) {
if (--domCheckCount) {
// in some browsers (Opera) the iframe DOM is not always traversable when
// the onload callback fires, so we loop a bit to accommodate
log('requeing onLoad callback, DOM not available');
setTimeout(cb, 250);
return;
}
// let this fall through because server response could be an empty document
//log('Could not access iframe DOM after mutiple tries.');
//throw 'DOMException: not available';
}
//log('response detected');
xhr.responseText = doc.body ? doc.body.innerHTML : doc.documentElement ? doc.documentElement.innerHTML : null;
xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
xhr.getResponseHeader = function(header){
var headers = {'content-type': s.dataType};
return headers[header];
};
var scr = /(json|script)/.test(s.dataType);
if (scr || s.textarea) {
// see if user embedded response in textarea
var ta = doc.getElementsByTagName('textarea')[0];
if (ta) {
xhr.responseText = ta.value;
}
else if (scr) {
// account for browsers injecting pre around json response
var pre = doc.getElementsByTagName('pre')[0];
var b = doc.getElementsByTagName('body')[0];
if (pre) {
xhr.responseText = pre.textContent;
}
else if (b) {
xhr.responseText = b.innerHTML;
}
}
}
else if (s.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
xhr.responseXML = toXml(xhr.responseText);
}
data = httpData(xhr, s.dataType, s);
}
catch(e){
log('error caught:',e);
ok = false;
xhr.error = e;
s.error && s.error.call(s.context, xhr, 'error', e);
g && $.event.trigger("ajaxError", [xhr, s, e]);
}
if (xhr.aborted) {
log('upload aborted');
ok = false;
}
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
if (ok) {
s.success && s.success.call(s.context, data, 'success', xhr);
g && $.event.trigger("ajaxSuccess", [xhr, s]);
}
g && $.event.trigger("ajaxComplete", [xhr, s]);
if (g && ! --$.active) {
$.event.trigger("ajaxStop");
}
s.complete && s.complete.call(s.context, xhr, ok ? 'success' : 'error');
// clean up
setTimeout(function() {
$io.removeData('form-plugin-onload');
$io.remove();
xhr.responseXML = null;
}, 100);
}
var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
if (window.ActiveXObject) {
doc = new ActiveXObject('Microsoft.XMLDOM');
doc.async = 'false';
doc.loadXML(s);
}
else {
doc = (new DOMParser()).parseFromString(s, 'text/xml');
}
return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
};
var parseJSON = $.parseJSON || function(s) {
return window['eval']('(' + s + ')');
};
var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
var ct = xhr.getResponseHeader('content-type') || '',
xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
if (xml && data.documentElement.nodeName === 'parsererror') {
$.error && $.error('parsererror');
}
if (s && s.dataFilter) {
data = s.dataFilter(data, type);
}
if (typeof data === 'string') {
if (type === 'json' || !type && ct.indexOf('json') >= 0) {
data = parseJSON(data);
} else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
$.globalEval(data);
}
}
return data;
};
}
};
/**
* ajaxForm() provides a mechanism for fully automating form submission.
*
* The advantages of using this method instead of ajaxSubmit() are:
*
* 1: This method will include coordinates for <input type="image" /> elements (if the element
* is used to submit the form).
* 2. This method will include the submit element's name/value data (for the element that was
* used to submit the form).
* 3. This method binds the submit() method to the form for you.
*
* The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
* passes the options argument along after properly binding events for submit elements and
* the form itself.
*/
$.fn.ajaxForm = function(options) {
// in jQuery 1.3+ we can fix mistakes with the ready state
if (this.length === 0) {
var o = { s: this.selector, c: this.context };
if (!$.isReady && o.s) {
log('DOM not ready, queuing ajaxForm');
$(function() {
$(o.s,o.c).ajaxForm(options);
});
return this;
}
// is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
return this;
}
return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
e.preventDefault();
$(this).ajaxSubmit(options);
}
}).bind('click.form-plugin', function(e) {
var target = e.target;
var $el = $(target);
if (!($el.is(":submit,input:image"))) {
// is this a child element of the submit el? (ex: a span within a button)
var t = $el.closest(':submit');
if (t.length == 0) {
return;
}
target = t[0];
}
var form = this;
form.clk = target;
if (target.type == 'image') {
if (e.offsetX != undefined) {
form.clk_x = e.offsetX;
form.clk_y = e.offsetY;
} else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
var offset = $el.offset();
form.clk_x = e.pageX - offset.left;
form.clk_y = e.pageY - offset.top;
} else {
form.clk_x = e.pageX - target.offsetLeft;
form.clk_y = e.pageY - target.offsetTop;
}
}
// clear form vars
setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
});
};
// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
$.fn.ajaxFormUnbind = function() {
return this.unbind('submit.form-plugin click.form-plugin');
};
/**
* formToArray() gathers form element data into an array of objects that can
* be passed to any of the following ajax functions: $.get, $.post, or load.
* Each object in the array has both a 'name' and 'value' property. An example of
* an array for a simple login form might be:
*
* [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
*
* It is this array that is passed to pre-submit callback functions provided to the
* ajaxSubmit() and ajaxForm() methods.
*/
$.fn.formToArray = function(semantic) {
var a = [];
if (this.length === 0) {
return a;
}
var form = this[0];
var els = semantic ? form.getElementsByTagName('*') : form.elements;
if (!els) {
return a;
}
var i,j,n,v,el,max,jmax;
for(i=0, max=els.length; i < max; i++) {
el = els[i];
n = el.name;
if (!n) {
continue;
}
if (semantic && form.clk && el.type == "image") {
// handle image inputs on the fly when semantic == true
if(!el.disabled && form.clk == el) {
a.push({name: n, value: $(el).val()});
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
}
continue;
}
v = $.fieldValue(el, true);
if (v && v.constructor == Array) {
for(j=0, jmax=v.length; j < jmax; j++) {
a.push({name: n, value: v[j]});
}
}
else if (v !== null && typeof v != 'undefined') {
// clean values put by placeholder fallback scripts
if(v === $(el).attr('placeholder')) {
v = '';
}
a.push({name: n, value: v});
}
}
if (!semantic && form.clk) {
// input type=='image' are not found in elements array! handle it here
var $input = $(form.clk), input = $input[0];
n = input.name;
if (n && !input.disabled && input.type == 'image') {
a.push({name: n, value: $input.val()});
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
}
}
return a;
};
/**
* Serializes form data into a 'submittable' string. This method will return a string
* in the format: name1=value1&name2=value2
*/
$.fn.formSerialize = function(semantic) {
//hand off to jQuery.param for proper encoding
return $.param(this.formToArray(semantic));
};
/**
* Serializes all field elements in the jQuery object into a query string.
* This method will return a string in the format: name1=value1&name2=value2
*/
$.fn.fieldSerialize = function(successful) {
var a = [];
this.each(function() {
var n = this.name;
if (!n) {
return;
}
var v = $.fieldValue(this, successful);
if (v && v.constructor == Array) {
for (var i=0,max=v.length; i < max; i++) {
a.push({name: n, value: v[i]});
}
}
else if (v !== null && typeof v != 'undefined') {
a.push({name: this.name, value: v});
}
});
//hand off to jQuery.param for proper encoding
return $.param(a);
};
/**
* Returns the value(s) of the element in the matched set. For example, consider the following form:
*
* <form><fieldset>
* <input name="A" type="text" />
* <input name="A" type="text" />
* <input name="B" type="checkbox" value="B1" />
* <input name="B" type="checkbox" value="B2"/>
* <input name="C" type="radio" value="C1" />
* <input name="C" type="radio" value="C2" />
* </fieldset></form>
*
* var v = $(':text').fieldValue();
* // if no values are entered into the text inputs
* v == ['','']
* // if values entered into the text inputs are 'foo' and 'bar'
* v == ['foo','bar']
*
* var v = $(':checkbox').fieldValue();
* // if neither checkbox is checked
* v === undefined
* // if both checkboxes are checked
* v == ['B1', 'B2']
*
* var v = $(':radio').fieldValue();
* // if neither radio is checked
* v === undefined
* // if first radio is checked
* v == ['C1']
*
* The successful argument controls whether or not the field element must be 'successful'
* (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
* The default value of the successful argument is true. If this value is false the value(s)
* for each element is returned.
*
* Note: This method *always* returns an array. If no valid value can be determined the
* array will be empty, otherwise it will contain one or more values.
*/
$.fn.fieldValue = function(successful) {
for (var val=[], i=0, max=this.length; i < max; i++) {
var el = this[i];
var v = $.fieldValue(el, successful);
if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
continue;
}
v.constructor == Array ? $.merge(val, v) : val.push(v);
}
return val;
};
/**
* Returns the value of the field element.
*/
$.fieldValue = function(el, successful) {
var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
if (successful === undefined) {
successful = true;
}
if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
(t == 'checkbox' || t == 'radio') && !el.checked ||
(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
tag == 'select' && el.selectedIndex == -1)) {
return null;
}
if (tag == 'select') {
var index = el.selectedIndex;
if (index < 0) {
return null;
}
var a = [], ops = el.options;
var one = (t == 'select-one');
var max = (one ? index+1 : ops.length);
for(var i=(one ? index : 0); i < max; i++) {
var op = ops[i];
if (op.selected) {
var v = op.value;
if (!v) { // extra pain for IE...
v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
}
if (one) {
return v;
}
a.push(v);
}
}
return a;
}
return $(el).val();
};
/**
* Clears the form data. Takes the following actions on the form's input fields:
* - input text fields will have their 'value' property set to the empty string
* - select elements will have their 'selectedIndex' property set to -1
* - checkbox and radio inputs will have their 'checked' property set to false
* - inputs of type submit, button, reset, and hidden will *not* be effected
* - button elements will *not* be effected
*/
$.fn.clearForm = function() {
return this.each(function() {
$('input,select,textarea', this).clearFields();
});
};
/**
* Clears the selected form elements.
*/
$.fn.clearFields = $.fn.clearInputs = function() {
return this.each(function() {
var t = this.type, tag = this.tagName.toLowerCase();
if (t == 'text' || t == 'password' || tag == 'textarea') {
this.value = '';
}
else if (t == 'checkbox' || t == 'radio') {
this.checked = false;
}
else if (tag == 'select') {
this.selectedIndex = -1;
}
});
};
/**
* Resets the form data. Causes all form elements to be reset to their original value.
*/
$.fn.resetForm = function() {
return this.each(function() {
// guard against an input with the name of 'reset'
// note that IE reports the reset function as an 'object'
if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
this.reset();
}
});
};
/**
* Enables or disables any matching elements.
*/
$.fn.enable = function(b) {
if (b === undefined) {
b = true;
}
return this.each(function() {
this.disabled = !b;
});
};
/**
* Checks/unchecks any matching checkboxes or radio buttons and
* selects/deselects and matching option elements.
*/
$.fn.selected = function(select) {
if (select === undefined) {
select = true;
}
return this.each(function() {
var t = this.type;
if (t == 'checkbox' || t == 'radio') {
this.checked = select;
}
else if (this.tagName.toLowerCase() == 'option') {
var $sel = $(this).parent('select');
if (select && $sel[0] && $sel[0].type == 'select-one') {
// deselect all other options
$sel.find('option').selected(false);
}
this.selected = select;
}
});
};
// helper fn for console logging
// set $.fn.ajaxSubmit.debug to true to enable debug logging
function log() {
if ($.fn.ajaxSubmit.debug) {
var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
if (window.console && window.console.log) {
window.console.log(msg);
}
else if (window.opera && window.opera.postError) {
window.opera.postError(msg);
}
}
};
})(jQuery);
| {
"content_hash": "fcec13f909016a2ebac2f02ef137c5e2",
"timestamp": "",
"source": "github",
"line_count": 807,
"max_line_length": 115,
"avg_line_length": 29.219330855018587,
"alnum_prop": 0.6105173876166242,
"repo_name": "mozilla/spark-eol",
"id": "b52f189eb98249a305a94a267a8a2ee4ee770c0a",
"size": "23580",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "media/js/libs/jquery.form.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "74499"
},
{
"name": "Python",
"bytes": "53188"
},
{
"name": "Shell",
"bytes": "1213"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML style="overflow:auto;">
<HEAD>
<meta name="generator" content="JDiff v1.1.0">
<!-- Generated by the JDiff Javadoc doclet -->
<!-- (http://www.jdiff.org) -->
<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
android.view.Gravity
</TITLE>
<link href="../../../../assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../stylesheet-jdiff.css" rel="stylesheet" type="text/css" />
<noscript>
<style type="text/css">
body{overflow:auto;}
#body-content{position:relative; top:0;}
#doc-content{overflow:visible;border-left:3px solid #666;}
#side-nav{padding:0;}
#side-nav .toggle-list ul {display:block;}
#resize-packages-nav{border-bottom:3px solid #666;}
</style>
</noscript>
<style type="text/css">
</style>
</HEAD>
<BODY>
<!-- Start of nav bar -->
<a name="top"></a>
<div id="header" style="margin-bottom:0;padding-bottom:0;">
<div id="headerLeft">
<a href="../../../../index.html" tabindex="-1" target="_top"><img src="../../../../assets/images/bg_logo.png" alt="Android Developers" /></a>
</div>
<div id="headerRight">
<div id="headerLinks">
<!-- <img src="/assets/images/icon_world.jpg" alt="" /> -->
<span class="text">
<!-- <a href="#">English</a> | -->
<nobr><a href="http://developer.android.com" target="_top">Android Developers</a> | <a href="http://www.android.com" target="_top">Android.com</a></nobr>
</span>
</div>
<div class="and-diff-id" style="margin-top:6px;margin-right:8px;">
<table class="diffspectable">
<tr>
<td colspan="2" class="diffspechead">API Diff Specification</td>
</tr>
<tr>
<td class="diffspec" style="padding-top:.25em">To Level:</td>
<td class="diffvaluenew" style="padding-top:.25em">17</td>
</tr>
<tr>
<td class="diffspec">From Level:</td>
<td class="diffvalueold">16</td>
</tr>
<tr>
<td class="diffspec">Generated</td>
<td class="diffvalue">2012.11.12 19:50</td>
</tr>
</table>
</div><!-- End and-diff-id -->
<div class="and-diff-id" style="margin-right:8px;">
<table class="diffspectable">
<tr>
<td class="diffspec" colspan="2"><a href="jdiff_statistics.html">Statistics</a>
</tr>
</table>
</div> <!-- End and-diff-id -->
</div> <!-- End headerRight -->
</div> <!-- End header -->
<div id="body-content" xstyle="padding:12px;padding-right:18px;">
<div id="doc-content" style="position:relative;">
<div id="mainBodyFluid">
<H2>
Class android.view.<A HREF="../../../../reference/android/view/Gravity.html" target="_top"><font size="+2"><code>Gravity</code></font></A>
</H2>
<a NAME="constructors"></a>
<a NAME="methods"></a>
<p>
<a NAME="Added"></a>
<TABLE summary="Added Methods" WIDTH="100%">
<TR>
<TH VALIGN="TOP" COLSPAN=2>Added Methods</FONT></TD>
</TH>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.view.Gravity.apply_added(int, int, int, android.graphics.Rect, android.graphics.Rect, int)"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/view/Gravity.html#apply(int, int, int, android.graphics.Rect, android.graphics.Rect, int)" target="_top"><code>apply</code></A>(<code>int,</nobr> int<nobr>,</nobr> int<nobr>,</nobr> Rect<nobr>,</nobr> Rect<nobr>,</nobr> int<nobr><nobr></code>)</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.view.Gravity.apply_added(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect, int)"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/view/Gravity.html#apply(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect, int)" target="_top"><code>apply</code></A>(<code>int,</nobr> int<nobr>,</nobr> int<nobr>,</nobr> Rect<nobr>,</nobr> int<nobr>,</nobr> int<nobr>,</nobr> Rect<nobr>,</nobr> int<nobr><nobr></code>)</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.view.Gravity.applyDisplay_added(int, android.graphics.Rect, android.graphics.Rect, int)"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/view/Gravity.html#applyDisplay(int, android.graphics.Rect, android.graphics.Rect, int)" target="_top"><code>applyDisplay</code></A>(<code>int,</nobr> Rect<nobr>,</nobr> Rect<nobr>,</nobr> int<nobr><nobr></code>)</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.view.Gravity.getAbsoluteGravity_added(int, int)"></A>
<nobr><code>int</code> <A HREF="../../../../reference/android/view/Gravity.html#getAbsoluteGravity(int, int)" target="_top"><code>getAbsoluteGravity</code></A>(<code>int,</nobr> int<nobr><nobr></code>)</nobr>
</TD>
<TD> </TD>
</TR>
</TABLE>
<a NAME="fields"></a>
</div>
<div id="footer">
<div id="copyright">
Except as noted, this content is licensed under
<a href="http://creativecommons.org/licenses/by/2.5/"> Creative Commons Attribution 2.5</a>.
For details and restrictions, see the <a href="/license.html">Content License</a>.
</div>
<div id="footerlinks">
<p>
<a href="http://www.android.com/terms.html">Site Terms of Service</a> -
<a href="http://www.android.com/privacy.html">Privacy Policy</a> -
<a href="http://www.android.com/branding.html">Brand Guidelines</a>
</p>
</div>
</div> <!-- end footer -->
</div><!-- end doc-content -->
</div> <!-- end body-content -->
<script src="//www.google-analytics.com/ga.js" type="text/javascript">
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-5831155-1");
pageTracker._setAllowAnchor(true);
pageTracker._initData();
pageTracker._trackPageview();
} catch(e) {}
</script>
</BODY>
</HTML>
| {
"content_hash": "956adebcdf3072c8f27b16120e095763",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 366,
"avg_line_length": 44.81818181818182,
"alnum_prop": 0.6370728662817913,
"repo_name": "AzureZhao/android-developer-cn",
"id": "ad3f94b175157e6e16d4bee72c9aeca2669e2a5b",
"size": "6409",
"binary": false,
"copies": "6",
"ref": "refs/heads/4.4.zh_cn",
"path": "sdk/api_diff/17/changes/android.view.Gravity.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "225261"
},
{
"name": "HTML",
"bytes": "481791360"
},
{
"name": "JavaScript",
"bytes": "640571"
}
],
"symlink_target": ""
} |
package org.openkilda.floodlight.feature;
import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
import org.openkilda.model.SwitchFeature;
import net.floodlightcontroller.core.IOFSwitch;
import net.floodlightcontroller.core.SwitchDescription;
import java.util.Optional;
public class PktpsFlagFeature extends AbstractFeature {
@Override
public Optional<SwitchFeature> discover(IOFSwitch sw) {
Optional<SwitchFeature> empty = Optional.empty();
SwitchDescription description = sw.getSwitchDescription();
if (description.getHardwareDescription() == null) {
return empty;
}
if (containsIgnoreCase(description.getManufacturerDescription(), CENTEC_MANUFACTURED)) {
return empty;
}
if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(description.getManufacturerDescription())
|| E_SWITCH_HARDWARE_DESCRIPTION_REGEX.matcher(description.getHardwareDescription()).matches()
|| NOVIFLOW_VIRTUAL_SWITCH_HARDWARE_DESCRIPTION_REGEX.matcher(
description.getHardwareDescription()).matches()) {
// Actually E switches support PKTPS flag. But they can't work with PKTPS and KBPS flags in the same time.
// KBPS flag is used for Flow creation so we must enable it to be able to create Flows on E switches.
// PKTPS is used for default rule meters and it can be replaced by KBPS (with recalculated rate and
// burst size). That is why we will assume that E switches don't support PKTPS flag.
return empty;
}
return Optional.of(SwitchFeature.PKTPS_FLAG);
}
}
| {
"content_hash": "d922240ce137b1c9f183e19ce60bbf43",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 118,
"avg_line_length": 40.285714285714285,
"alnum_prop": 0.6973995271867612,
"repo_name": "jonvestal/open-kilda",
"id": "a241d1d39edffea8d60cb303449176329c663177",
"size": "2309",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src-java/floodlight-service/floodlight-modules/src/main/java/org/openkilda/floodlight/feature/PktpsFlagFeature.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "65404"
},
{
"name": "Dockerfile",
"bytes": "22398"
},
{
"name": "Gherkin",
"bytes": "88336"
},
{
"name": "Groovy",
"bytes": "70766"
},
{
"name": "HTML",
"bytes": "161798"
},
{
"name": "Java",
"bytes": "3580119"
},
{
"name": "JavaScript",
"bytes": "332794"
},
{
"name": "Makefile",
"bytes": "21113"
},
{
"name": "Python",
"bytes": "425871"
},
{
"name": "Shell",
"bytes": "39572"
}
],
"symlink_target": ""
} |
patternExample002
| {
"content_hash": "21aa9f40692d0564ae44b098ebaa6b6c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 17,
"avg_line_length": 18,
"alnum_prop": 0.9444444444444444,
"repo_name": "fishkingsin/patternExample002",
"id": "ced3190da14469b2d2c9373b625fa8cf90a3b6ea",
"size": "38",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "8163"
},
{
"name": "Makefile",
"bytes": "382"
}
],
"symlink_target": ""
} |
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Params extends Model
{
//
}
| {
"content_hash": "db2a54115609e264921805482d9e9c10",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 39,
"avg_line_length": 10.2,
"alnum_prop": 0.7058823529411765,
"repo_name": "komorowskidev/laravel-senOszambali",
"id": "4de44c52b0f203709a8a2b7243eae7e653a70b32",
"size": "102",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/Params.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "553"
},
{
"name": "HTML",
"bytes": "26875"
},
{
"name": "JavaScript",
"bytes": "1132"
},
{
"name": "PHP",
"bytes": "107327"
},
{
"name": "Vue",
"bytes": "563"
}
],
"symlink_target": ""
} |
"use strict";
var EventListener = require('fbjs/lib/EventListener');
var ReactDOM = require('react-dom');
module.exports = {
EventListener,
ownerDocument,
isNodeInRoot,
listen
}
/**
* listen
*/
function listen(node, event, func) {
return EventListener.listen(ownerDocument(node), event, func);
}
/**
* Get elements owner document
*
* @param {ReactComponent|HTMLElement} componentOrElement
* @returns {HTMLElement}
*/
function ownerDocument(componentOrElement) {
var elem = ReactDOM.findDOMNode(componentOrElement);
return elem && elem.ownerDocument || document;
}
/**
* Checks whether a node is within
* a root nodes tree
*
* @param {DOMElement} node
* @param {DOMElement} root
* @returns {boolean}
*/
function isNodeInRoot(node, root) {
node = ReactDOM.findDOMNode(node), root = ReactDOM.findDOMNode(root);
return _isNodeInRoot(node, root);
}
function _isNodeInRoot(node, root){
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
} | {
"content_hash": "6556b7f8660af4a1f7d984f5cf5c321c",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 73,
"avg_line_length": 21.48,
"alnum_prop": 0.6638733705772812,
"repo_name": "subschema/subschema",
"id": "33f6d06bd7eb3a474b75c831c8d8f168e1ab7ce2",
"size": "1074",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Dom.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4207"
},
{
"name": "HTML",
"bytes": "490"
},
{
"name": "JavaScript",
"bytes": "373137"
}
],
"symlink_target": ""
} |
require File.dirname(__FILE__) + '/../test_helper'
require 'sessions_controller'
# Re-raise errors caught by the controller.
class SessionsController; def rescue_action(e) raise e end; end
class SessionsControllerTest < ActionController::TestCase
# Be sure to include AuthenticatedTestHelper in test/test_helper.rb instead
# Then, you can remove it from this and the units test.
include AuthenticatedTestHelper
fixtures :users
def test_new_layout
get :new
assert_response :success
assert_template 'new'
assert_select "div[id=horiz-menu]", :count => 0
end
def test_should_login_and_redirect
post :create, :login => 'quentin', :password => 'monkey'
assert session[:user_id]
assert_response :redirect
end
def test_should_fail_login_and_not_redirect
post :create, :login => 'quentin', :password => 'bad password'
assert_nil session[:user_id]
assert_response :success
end
def test_should_logout
login_as :quentin
get :destroy
assert_nil session[:user_id]
assert_response :redirect
assert_redirected_to login_path
end
def test_should_remember_me
@request.cookies["auth_token"] = nil
post :create, :login => 'quentin', :password => 'monkey', :remember_me => "1"
assert_not_nil @response.cookies["auth_token"]
end
def test_should_not_remember_me
@request.cookies["auth_token"] = nil
post :create, :login => 'quentin', :password => 'monkey', :remember_me => "0"
assert @response.cookies["auth_token"].blank?
end
def test_should_delete_token_on_logout
login_as :quentin
get :destroy
assert @response.cookies["auth_token"].blank?
end
def test_should_login_with_cookie
users(:quentin).remember_me
@request.cookies["auth_token"] = cookie_for(:quentin)
get :new
assert @controller.send(:logged_in?)
end
def test_should_fail_expired_cookie_login
users(:quentin).remember_me
users(:quentin).update_attribute :remember_token_expires_at, 5.minutes.ago
@request.cookies["auth_token"] = cookie_for(:quentin)
get :new
assert !@controller.send(:logged_in?)
end
def test_should_fail_cookie_login
users(:quentin).remember_me
@request.cookies["auth_token"] = auth_token('invalid_auth_token')
get :new
assert !@controller.send(:logged_in?)
end
protected
def auth_token(token)
CGI::Cookie.new('name' => 'auth_token', 'value' => token)
end
def cookie_for(user)
auth_token users(user).remember_token
end
end
| {
"content_hash": "a13cef50e1138f4c5aff3ab77cc71b6e",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 81,
"avg_line_length": 28.693181818181817,
"alnum_prop": 0.6815841584158416,
"repo_name": "ehedberg/travis",
"id": "b9fe1721e69abbac0cd0195c94171213f50e0f8b",
"size": "2525",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/functional/sessions_controller_test.rb",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "74734"
},
{
"name": "PHP",
"bytes": "694"
},
{
"name": "Ruby",
"bytes": "193683"
}
],
"symlink_target": ""
} |
//// [modulePrologueSystem.ts]
"use strict";
export class Foo {}
//// [modulePrologueSystem.js]
System.register([], function (exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var Foo;
return {
setters: [],
execute: function () {
Foo = /** @class */ (function () {
function Foo() {
}
return Foo;
}());
exports_1("Foo", Foo);
}
};
});
| {
"content_hash": "98f4f5e8a787f2a203573f03a2070f16",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 53,
"avg_line_length": 23.545454545454547,
"alnum_prop": 0.4420849420849421,
"repo_name": "synaptek/TypeScript",
"id": "afa319820eb752318c8ef17155f47cecb28a087c",
"size": "518",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "tests/baselines/reference/modulePrologueSystem.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "232"
},
{
"name": "Groovy",
"bytes": "726"
},
{
"name": "HTML",
"bytes": "3817"
},
{
"name": "JavaScript",
"bytes": "175"
},
{
"name": "PowerShell",
"bytes": "2855"
},
{
"name": "Shell",
"bytes": "283"
},
{
"name": "TypeScript",
"bytes": "49292459"
}
],
"symlink_target": ""
} |
"""
Copyright (c) 2016, Jose Dolz .All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Jose Dolz. Dec, 2016.
email: jose.dolz.upv@gmail.com
LIVIA Department, ETS, Montreal.
"""
import pdb
import numpy as np
# ----- Dice Score -----
def computeDice(autoSeg, groundTruth):
""" Returns
-------
DiceArray : floats array
Dice coefficient as a float on range [0,1].
Maximum similarity = 1
No similarity = 0 """
n_classes = int( np.max(groundTruth) + 1)
DiceArray = []
for c_i in xrange(1,n_classes):
idx_Auto = np.where(autoSeg.flatten() == c_i)[0]
idx_GT = np.where(groundTruth.flatten() == c_i)[0]
autoArray = np.zeros(autoSeg.size,dtype=np.bool)
autoArray[idx_Auto] = 1
gtArray = np.zeros(autoSeg.size,dtype=np.bool)
gtArray[idx_GT] = 1
dsc = dice(autoArray, gtArray)
#dice = np.sum(autoSeg[groundTruth==c_i])*2.0 / (np.sum(autoSeg) + np.sum(groundTruth))
DiceArray.append(dsc)
return DiceArray
def dice(im1, im2):
"""
Computes the Dice coefficient
----------
im1 : boolean array
im2 : boolean array
If they are not boolean, they will be converted.
-------
It returns the Dice coefficient as a float on the range [0,1].
1: Perfect overlapping
0: Not overlapping
"""
im1 = np.asarray(im1).astype(np.bool)
im2 = np.asarray(im2).astype(np.bool)
if im1.size != im2.size:
raise ValueError("Size mismatch between input arrays!!!")
im_sum = im1.sum() + im2.sum()
if im_sum == 0:
return 1.0
# Compute Dice
intersection = np.logical_and(im1, im2)
return 2. * intersection.sum() / im_sum
| {
"content_hash": "c97d891361794d5270f996c6fe1d1645",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 95,
"avg_line_length": 30.822222222222223,
"alnum_prop": 0.6398702235039654,
"repo_name": "josedolz/LiviaNET",
"id": "2bbf33c46f6886279972559af098cd9be5284764",
"size": "2774",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/LiviaNet/Modules/General/Evaluation.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "159013"
}
],
"symlink_target": ""
} |
package io.fabric8.tooling.archetype.builder;
import io.fabric8.tooling.archetype.ArchetypeUtils;
import io.fabric8.utils.DomHelper;
import io.fabric8.utils.Files;
import io.fabric8.utils.IOHelpers;
import io.fabric8.utils.Objects;
import io.fabric8.utils.Strings;
import org.apache.commons.text.StringEscapeUtils;
import org.eclipse.jgit.api.CloneCommand;
import org.eclipse.jgit.api.Git;
import org.kohsuke.github.GHOrganization;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.GitHub;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.InputSource;
import java.io.*;
import java.util.*;
import java.util.regex.Pattern;
/**
* This class is a replacement for <code>mvn archetype:create-from-project</code> without dependencies to
* maven-archetype related libraries.
*/
public class CatalogBuilder extends AbstractBuilder {
public static Logger LOG = LoggerFactory.getLogger(CatalogBuilder.class);
private File bomFile;
private File catalogXmlFile;
private PrintWriter printWriter;
private final Map<String, String> versionProperties = new HashMap<>();
private File archetypesPomFile;
private Set<String> archetypesPomArtifactIds;
private Set<String> missingArtifactIds = new TreeSet<>();
public CatalogBuilder(File catalogXmlFile) {
this.catalogXmlFile = catalogXmlFile;
}
public Set<String> getMissingArtifactIds() {
return missingArtifactIds;
}
public void setBomFile(File bomFile) {
this.bomFile = bomFile;
}
/**
* Starts generation of Archetype Catalog (see: http://maven.apache.org/xsd/archetype-catalog-1.0.0.xsd)
*
* @throws IOException
*/
public void configure() throws IOException {
if (archetypesPomFile != null) {
archetypesPomArtifactIds = loadArchetypesPomArtifactIds(archetypesPomFile);
}
catalogXmlFile.getParentFile().mkdirs();
LOG.info("Writing catalog: " + catalogXmlFile);
printWriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(catalogXmlFile), "UTF-8"));
printWriter.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<archetype-catalog xmlns=\"http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0\"\n" +
indent + indent + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
indent + indent + "xsi:schemaLocation=\"http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0 http://maven.apache.org/xsd/archetype-catalog-1.0.0.xsd\">\n" +
indent + "<archetypes>");
if (bomFile != null && bomFile.exists()) {
// read all properties of the bom, so we have default values for ${ } placeholders
String text = IOHelpers.readFully(bomFile);
Document doc = archetypeUtils.parseXml(new InputSource(new StringReader(text)));
Element root = doc.getDocumentElement();
// lets load all the properties defined in the <properties> element in the bom pom.
NodeList propertyElements = root.getElementsByTagName("properties");
if (propertyElements.getLength() > 0) {
Element propertyElement = (Element) propertyElements.item(0);
NodeList children = propertyElement.getChildNodes();
for (int cn = 0; cn < children.getLength(); cn++) {
Node e = children.item(cn);
if (e instanceof Element) {
versionProperties.put(e.getNodeName(), e.getTextContent());
}
}
}
if (LOG.isDebugEnabled()) {
for (Map.Entry<String, String> entry : versionProperties.entrySet()) {
LOG.debug("bom property: {}={}", entry.getKey(), entry.getValue());
}
}
}
}
protected Set<String> loadArchetypesPomArtifactIds(File archetypesPomFile) throws IOException {
Set<String> answer = new TreeSet<>();
if (!archetypesPomFile.isFile() || !archetypesPomFile.exists()) {
LOG.warn("archetypes pom.xml file does not exist!: " + archetypesPomFile);
return null;
}
try {
Document doc = archetypeUtils.parseXml(new InputSource(new FileReader(archetypesPomFile)));
Element root = doc.getDocumentElement();
// lets load all the properties defined in the <properties> element in the bom pom.
NodeList moduleElements = root.getElementsByTagName("module");
for (int i = 0, size = moduleElements.getLength(); i < size; i++) {
Element moduleElement = (Element) moduleElements.item(i);
String module = moduleElement.getTextContent();
if (Strings.isNotBlank(module)) {
answer.add(module);
}
}
LOG.info("Loaded archetypes module names: "+ answer);
return answer;
} catch (FileNotFoundException e) {
throw new IOException("Failed to parse " + archetypesPomFile + ". " + e, e);
}
}
/**
* Completes generation of Archetype Catalog.
*/
public void close() {
printWriter.println(indent + "</archetypes>\n" +
"</archetype-catalog>");
printWriter.close();
}
protected void addArchetypeMetaData(File pom, String outputName) throws FileNotFoundException {
Document doc = archetypeUtils.parseXml(new InputSource(new FileReader(pom)));
Element root = doc.getDocumentElement();
String groupId = archetypeUtils.firstElementText(root, "groupId", "io.fabric8.archetypes");
String artifactId = archetypeUtils.firstElementText(root, "artifactId", outputName);
String description = archetypeUtils.firstElementText(root, "description", "");
String version = "";
NodeList parents = root.getElementsByTagName("parent");
if (parents.getLength() > 0) {
version = archetypeUtils.firstElementText((Element) parents.item(0), "version", "");
}
if (version.length() == 0) {
version = archetypeUtils.firstElementText(root, "version", "");
}
if (archetypesPomArtifactIds != null) {
if (!archetypesPomArtifactIds.contains(artifactId)) {
LOG.warn("Not adding archetype: " + artifactId + " to the catalog as it is not included in the " + archetypesPomFile);
missingArtifactIds.add(artifactId);
return;
}
}
printWriter.println(String.format(indent + indent + "<archetype>\n" +
indent + indent + indent + "<groupId>%s</groupId>\n" +
indent + indent + indent + "<artifactId>%s</artifactId>\n" +
indent + indent + indent + "<version>%s</version>\n" +
indent + indent + indent + "<description>%s</description>\n" +
indent + indent + "</archetype>", groupId, artifactId, version, StringEscapeUtils.escapeXml10(description)));
}
public void setArchetypesPomFile(File archetypesPomFile) {
this.archetypesPomFile = archetypesPomFile;
}
}
| {
"content_hash": "2771dbf2ce4b51d1143e2d1ac3d8cfcb",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 194,
"avg_line_length": 42.10227272727273,
"alnum_prop": 0.6377867746288799,
"repo_name": "fabric8io/ipaas-quickstarts",
"id": "f5081fa83e17da3868facc9b1d4895b8eab3643e",
"size": "8048",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/CatalogBuilder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "1183"
},
{
"name": "Java",
"bytes": "131597"
}
],
"symlink_target": ""
} |
<div class="container-fluid scrollable" style="background-color: white;">
<div ui-content-for="title">
<span>Fuel Economizer</span>
</div>
<div class="scrollable-content">
<div class="header-text">
About Fuel Economizer
</div>
<div class="text-text">
Fuel Economizer is a currently in-development application to track fuel economy and maybe other things
about your vehicle. Right now we're in active development (check it out
<a href="http://github.com/Dorthu/FuelEconomizer" target="_blank">on github</a>) and registration is manual
(contact me if you want to sign up).
</div>
<div class="header-text">
How To Use
</div>
<div class="text-text">
Fuel Economizer is very simple to use! When you're at the pump, enter in three simple pieces of data:
your current odometer reading, the amount of gas you bought, and the price you paid - done and done! After
a few data points are added, Fuel Economizer can begin showing you valuable information about your fuel
economy, whenever you're interested!
</div>
<div class="text-text">
<a href="#/login" class="btn btn-primary" style="width: 100%;">Continue to Login</a>
</div>
<div class="text-text">
If you don't have an account and want to try this out, please contact me. If you don't know how to contact
me, I'm sorry, but this isn't open to the public just yet - check back soon!
</div>
</div>
</div> | {
"content_hash": "2bb94315e7b7b8380d283276fc2265b0",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 119,
"avg_line_length": 47.911764705882355,
"alnum_prop": 0.6138735420503376,
"repo_name": "Dorthu/EconomizerWeb",
"id": "e687f9e16b78cdc67b607b2f12cdef63b4ed0908",
"size": "1629",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/home/home.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "601"
},
{
"name": "HTML",
"bytes": "11517"
},
{
"name": "JavaScript",
"bytes": "20538"
}
],
"symlink_target": ""
} |
{% load i18n %}
<div class="table_actions clearfix">
{% block table_filter %}
{% if filter.filter_type == 'fixed' %}
<div class="table_filter btn-group" data-toggle="buttons-radio">
{% for button in filter.fixed_buttons %}
<button name="{{ filter.get_param_name }}" type="submit" value="{{ button.value }}" class="btn btn-small{% ifequal button.value filter.filter_string %} active{% endifequal %}">{% if button.icon %}<i class="{{ button.icon }}"></i> {% endif %}{{ button.text }}{% if button.count >= 0 %} ({{ button.count }}){% endif %}</button>
{% endfor %}
</div>
{% elif filter.filter_type == 'query' %}
<div class="table_search">
<input class="span3 example" value="{{ filter.filter_string|default:'' }}" type="text" name="{{ filter.get_param_name }}" />
<button type="submit" {{ filter.attr_string|safe }}>{% trans "Filter" %}</button>
</div>
{% endif %}
{% endblock table_filter %}
{% block table_actions %}
{% for action in table_actions %}
{% if action != filter %}
{% if action.method != "GET" %}
<button {{ action.attr_string|safe }} name="action" value="{{ action.get_param_name }}" type="submit">{% if action.handles_multiple %}{{ action.verbose_name_plural }}{% else %}{{ action.verbose_name }}{% endif %}</button>
{% else %}
<a href='{{ action.get_link_url }}' title='{{ action.verbose_name }}' {{ action.attr_string|safe }}>{{ action.verbose_name }}</a>
{% endif %}
{% endif %}
{% endfor %}
</div>
{% endblock table_actions %}
| {
"content_hash": "bbb8328504c84cf3e6119701f9427ffb",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 333,
"avg_line_length": 57.464285714285715,
"alnum_prop": 0.5668116842759477,
"repo_name": "kaiweifan/horizon",
"id": "44b43f6749b40b39dc2b9fa9d53e02d74dc3ad84",
"size": "1609",
"binary": false,
"copies": "15",
"ref": "refs/heads/vip2",
"path": "horizon/templates/horizon/common/_data_table_table_actions.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "160827"
},
{
"name": "JavaScript",
"bytes": "360901"
},
{
"name": "Python",
"bytes": "2832603"
},
{
"name": "Shell",
"bytes": "12986"
}
],
"symlink_target": ""
} |
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import { purple } from '@material-ui/core/colors';
import FormGroup from '@material-ui/core/FormGroup';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Switch from '@material-ui/core/Switch';
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';
const PurpleSwitch = withStyles({
switchBase: {
color: purple[300],
'&$checked': {
color: purple[500],
},
'&$checked + $track': {
backgroundColor: purple[500],
},
},
checked: {},
track: {},
})(Switch);
const IOSSwitch = withStyles((theme) => ({
root: {
width: 42,
height: 26,
padding: 0,
margin: theme.spacing(1),
},
switchBase: {
padding: 1,
'&$checked': {
transform: 'translateX(16px)',
color: theme.palette.common.white,
'& + $track': {
backgroundColor: '#52d869',
opacity: 1,
border: 'none',
},
},
'&$focusVisible $thumb': {
color: '#52d869',
border: '6px solid #fff',
},
},
thumb: {
width: 24,
height: 24,
},
track: {
borderRadius: 26 / 2,
border: `1px solid ${theme.palette.grey[400]}`,
backgroundColor: theme.palette.grey[50],
opacity: 1,
transition: theme.transitions.create(['background-color', 'border']),
},
checked: {},
focusVisible: {},
}))(({ classes, ...props }) => {
return (
<Switch
focusVisibleClassName={classes.focusVisible}
disableRipple
classes={{
root: classes.root,
switchBase: classes.switchBase,
thumb: classes.thumb,
track: classes.track,
checked: classes.checked,
}}
{...props}
/>
);
});
const AntSwitch = withStyles((theme) => ({
root: {
width: 28,
height: 16,
padding: 0,
display: 'flex',
},
switchBase: {
padding: 2,
color: theme.palette.grey[500],
'&$checked': {
transform: 'translateX(12px)',
color: theme.palette.common.white,
'& + $track': {
opacity: 1,
backgroundColor: theme.palette.primary.main,
borderColor: theme.palette.primary.main,
},
},
},
thumb: {
width: 12,
height: 12,
boxShadow: 'none',
},
track: {
border: `1px solid ${theme.palette.grey[500]}`,
borderRadius: 16 / 2,
opacity: 1,
backgroundColor: theme.palette.common.white,
},
checked: {},
}))(Switch);
export default function CustomizedSwitches() {
const [state, setState] = React.useState({
checkedA: true,
checkedB: true,
checkedC: true,
});
const handleChange = (event) => {
setState({ ...state, [event.target.name]: event.target.checked });
};
return (
<FormGroup>
<FormControlLabel
control={<PurpleSwitch checked={state.checkedA} onChange={handleChange} name="checkedA" />}
label="Custom color"
/>
<FormControlLabel
control={<IOSSwitch checked={state.checkedB} onChange={handleChange} name="checkedB" />}
label="iOS style"
/>
<Typography component="div">
<Grid component="label" container alignItems="center" spacing={1}>
<Grid item>Off</Grid>
<Grid item>
<AntSwitch checked={state.checkedC} onChange={handleChange} name="checkedC" />
</Grid>
<Grid item>On</Grid>
</Grid>
</Typography>
</FormGroup>
);
}
| {
"content_hash": "d453563ee9f6d0179e08b881f3deb44e",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 99,
"avg_line_length": 24.321678321678323,
"alnum_prop": 0.5830937320299022,
"repo_name": "lgollut/material-ui",
"id": "32ff2e0e92fc05b92210a712bb1880d0a74ad7eb",
"size": "3478",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/src/pages/components/switches/CustomizedSwitches.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1202143"
}
],
"symlink_target": ""
} |
package steambot.api;
public class SteamID {
private long communityId;
public SteamID(long communityId)
{
this.communityId = communityId;
}
public long getAccountId()
{
return (communityId & 0xFFFFFFFFL);
}
public long getCommunityId()
{
return communityId;
}
public String render()
{
long accountId = getAccountId();
return "STEAM_0:" + (accountId & 1) + ":" + (accountId >> 1);
}
public static SteamID fromAccountId(long accountId)
{
return new SteamID(0x0110000100000000L & accountId);
}
@Override
public String toString() {
return "SteamID [communityId=" + communityId + ", getAccountId()=" + getAccountId() + ", render()=" + render() + "]";
}
}
| {
"content_hash": "9c61ce0cbd0ef4066077e45053b1f48a",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 119,
"avg_line_length": 22.085714285714285,
"alnum_prop": 0.6028460543337646,
"repo_name": "tichok/SteamBot",
"id": "d6526020d1d09c5ff68204896c43ac935ae25890",
"size": "773",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/steambot/api/SteamID.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "38694"
}
],
"symlink_target": ""
} |
package com.palantir.baseline.errorprone;
import com.google.auto.service.AutoService;
import com.google.errorprone.BugPattern;
import com.google.errorprone.VisitorState;
import com.google.errorprone.bugpatterns.BugChecker;
import com.google.errorprone.fixes.SuggestedFix;
import com.google.errorprone.fixes.SuggestedFixes;
import com.google.errorprone.matchers.Description;
import com.google.errorprone.matchers.Matcher;
import com.google.errorprone.matchers.method.MethodMatchers;
import com.google.errorprone.util.ASTHelpers;
import com.palantir.baseline.errorprone.safety.Safety;
import com.palantir.baseline.errorprone.safety.SafetyAnalysis;
import com.palantir.baseline.errorprone.safety.SafetyAnnotations;
import com.sun.source.tree.AssignmentTree;
import com.sun.source.tree.ClassTree;
import com.sun.source.tree.CompoundAssignmentTree;
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.MethodInvocationTree;
import com.sun.source.tree.MethodTree;
import com.sun.source.tree.NewClassTree;
import com.sun.source.tree.ReturnTree;
import com.sun.source.tree.StatementTree;
import com.sun.source.tree.Tree;
import com.sun.source.tree.VariableTree;
import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.Symbol.MethodSymbol;
import com.sun.tools.javac.code.Symbol.TypeVariableSymbol;
import com.sun.tools.javac.code.Symbol.VarSymbol;
import com.sun.tools.javac.code.Type;
import com.sun.tools.javac.code.Type.TypeVar;
import java.util.List;
import java.util.Objects;
/**
* Ensures that safe-logging annotated elements are handled correctly by annotated method parameters.
* Potential future work:
* <ul>
* <li>We could check return statements in methods annotated for
* safety to require consistency</li>
* <li>Enforce propagation of safety annotations from fields and types to types which encapsulate them.</li>
* <li>More complex flow analysis to ensure safety information is respected.</li>
* </ul>
*/
@AutoService(BugChecker.class)
@BugPattern(
link = "https://github.com/palantir/gradle-baseline#baseline-error-prone-checks",
linkType = BugPattern.LinkType.CUSTOM,
severity = BugPattern.SeverityLevel.ERROR,
summary = "safe-logging annotations must agree between args and method parameters")
public final class IllegalSafeLoggingArgument extends BugChecker
implements BugChecker.MethodInvocationTreeMatcher,
BugChecker.ReturnTreeMatcher,
BugChecker.AssignmentTreeMatcher,
BugChecker.CompoundAssignmentTreeMatcher,
BugChecker.MethodTreeMatcher,
BugChecker.VariableTreeMatcher,
BugChecker.NewClassTreeMatcher,
BugChecker.ClassTreeMatcher {
private static final String UNSAFE_ARG = "com.palantir.logsafe.UnsafeArg";
private static final Matcher<ExpressionTree> SAFE_ARG_OF_METHOD_MATCHER = MethodMatchers.staticMethod()
.onClass("com.palantir.logsafe.SafeArg")
.named("of");
private static Type resolveParameterType(Type input, ExpressionTree tree, VisitorState state) {
// Important not to call getReceiver/getReceiverType on a NewClassTree, which throws.
if (input instanceof TypeVar && tree instanceof MethodInvocationTree) {
TypeVar typeVar = (TypeVar) input;
Type receiver = ASTHelpers.getReceiverType(tree);
if (receiver == null) {
return input;
}
Symbol symbol = ASTHelpers.getSymbol(tree);
// List<String> -> Collection<E> gives us Collection<String>
Type boundToMethodOwner = state.getTypes().asSuper(receiver, symbol.owner);
List<TypeVariableSymbol> ownerTypeVars = symbol.owner.getTypeParameters();
// Validate that the type parameters match -- it's possible raw types are used, and
// no type variables are bound. See IllegalSafeLoggingArgumentTest.testRawTypes.
if (ownerTypeVars.size() == boundToMethodOwner.getTypeArguments().size()) {
for (int i = 0; i < ownerTypeVars.size(); i++) {
TypeVariableSymbol ownerVar = ownerTypeVars.get(i);
if (Objects.equals(ownerVar, typeVar.tsym)) {
return boundToMethodOwner.getTypeArguments().get(i);
}
}
}
}
return input;
}
@Override
public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
return matchCtorOrMethodInvocation(
tree, tree.getTypeArguments(), tree.getArguments(), ASTHelpers.getSymbol(tree), state);
}
@Override
public Description matchNewClass(NewClassTree tree, VisitorState state) {
return matchCtorOrMethodInvocation(
tree, tree.getTypeArguments(), tree.getArguments(), ASTHelpers.getSymbol(tree), state);
}
@SuppressWarnings({"CheckStyle", "ReferenceEquality"})
private Description matchCtorOrMethodInvocation(
ExpressionTree tree,
List<? extends Tree> typeArguments,
List<? extends ExpressionTree> arguments,
MethodSymbol methodSymbol,
VisitorState state) {
if (methodSymbol == null) {
return Description.NO_MATCH;
}
handleResultTypeArguments(tree, state);
handleMethodTypeArguments(tree, typeArguments, methodSymbol, state);
if (arguments.isEmpty()) {
return Description.NO_MATCH;
}
List<VarSymbol> parameters = methodSymbol.getParameters();
for (int i = 0; i < parameters.size(); i++) {
VarSymbol parameter = parameters.get(i);
Type resolvedParameterType = resolveParameterType(parameter.type, tree, state);
Safety parameterSafety = Safety.mergeAssumingUnknownIsSame(
SafetyAnnotations.getSafety(parameter, state),
SafetyAnnotations.getSafety(resolvedParameterType, state),
SafetyAnnotations.getSafety(resolvedParameterType.tsym, state));
// Collect additional safety info from the declared type
// Reference equality is okay because 'resolveParameterType' returns the input if the type doesn't need to
// be resolved.
if (parameter.type != resolvedParameterType) {
parameterSafety = Safety.mergeAssumingUnknownIsSame(
parameterSafety,
SafetyAnnotations.getSafety(parameter.type, state),
SafetyAnnotations.getSafety(parameter.type.tsym, state));
}
if (parameterSafety.allowsAll()) {
// Fast path: all types are accepted, there's no reason to do further analysis.
continue;
}
int limit = methodSymbol.isVarArgs() && i == parameters.size() - 1 ? arguments.size() : i + 1;
for (int j = i; j < limit; j++) {
ExpressionTree argument = arguments.get(j);
Safety argumentSafety = SafetyAnalysis.of(state.withPath(new TreePath(state.getPath(), argument)));
if (!parameterSafety.allowsValueWith(argumentSafety)) {
// use state.reportMatch to report all failing arguments if multiple are invalid
state.reportMatch(buildDescription(argument)
.setMessage(String.format(
"Dangerous argument value: arg is '%s' but the parameter requires '%s'.",
argumentSafety, parameterSafety))
.addFix(getSuggestedFix(tree, state, argumentSafety))
.build());
}
}
}
return Description.NO_MATCH;
}
private void handleResultTypeArguments(ExpressionTree tree, VisitorState state) {
Type type = ASTHelpers.getResultType(tree);
if (type != null && !type.getTypeArguments().isEmpty()) {
List<Type> resultTypeArguments = type.getTypeArguments();
List<TypeVariableSymbol> parameterTypes = type.tsym.getTypeParameters();
if (parameterTypes.size() == resultTypeArguments.size()) {
for (int i = 0; i < parameterTypes.size(); i++) {
TypeVariableSymbol typeVar = parameterTypes.get(i);
Type typeArgumentType = resultTypeArguments.get(i);
Safety typeVarSafety = Safety.mergeAssumingUnknownIsSame(
SafetyAnnotations.getSafety(typeVar, state),
SafetyAnnotations.getSafety(typeVar.type, state),
SafetyAnnotations.getSafety(typeVar.type.tsym, state));
Safety typeArgumentSafety = Safety.mergeAssumingUnknownIsSame(
SafetyAnnotations.getSafety(typeArgumentType, state),
SafetyAnnotations.getSafety(typeArgumentType.tsym, state));
if (!typeVarSafety.allowsAll() && !typeVarSafety.allowsValueWith(typeArgumentSafety)) {
// use state.reportMatch to report all failing arguments if multiple are invalid
state.reportMatch(buildDescription(tree)
.setMessage(String.format(
"Dangerous argument value: arg is '%s' but the parameter requires '%s'.",
typeArgumentSafety, typeVarSafety))
.build());
}
}
}
}
}
private void handleMethodTypeArguments(
ExpressionTree tree, List<? extends Tree> typeArguments, MethodSymbol methodSymbol, VisitorState state) {
List<TypeVariableSymbol> typeParameters = methodSymbol.getTypeParameters();
if (typeParameters == null
|| typeParameters.isEmpty()
|| typeArguments == null
|| typeArguments.isEmpty()
|| typeArguments.size() != typeParameters.size()) {
return;
}
for (int i = 0; i < typeParameters.size(); i++) {
TypeVariableSymbol parameter = typeParameters.get(i);
Tree argument = typeArguments.get(i);
Safety required = Safety.mergeAssumingUnknownIsSame(
SafetyAnnotations.getSafety(parameter, state),
SafetyAnnotations.getSafety(parameter.type, state),
SafetyAnnotations.getSafety(parameter.type.tsym, state));
Safety given = SafetyAnnotations.getSafety(argument, state);
if (!required.allowsValueWith(given)) {
// use state.reportMatch to report all failing arguments if multiple are invalid
state.reportMatch(buildDescription(tree)
.setMessage(String.format(
"Dangerous argument value: arg is '%s' but the parameter requires '%s'.",
given, required))
.build());
}
}
}
private static SuggestedFix getSuggestedFix(ExpressionTree tree, VisitorState state, Safety argumentSafety) {
if (SAFE_ARG_OF_METHOD_MATCHER.matches(tree, state) && Safety.UNSAFE.allowsValueWith(argumentSafety)) {
SuggestedFix.Builder fix = SuggestedFix.builder();
String unsafeQualifiedClassName = SuggestedFixes.qualifyType(state, fix, UNSAFE_ARG);
String replacement = String.format("%s.of", unsafeQualifiedClassName);
return fix.replace(((MethodInvocationTree) tree).getMethodSelect(), replacement)
.build();
}
return SuggestedFix.emptyFix();
}
@Override
public Description matchReturn(ReturnTree tree, VisitorState state) {
if (tree.getExpression() == null) {
return Description.NO_MATCH;
}
TreePath path = state.getPath();
while (path != null && path.getLeaf() instanceof StatementTree) {
path = path.getParentPath();
}
if (path == null || !(path.getLeaf() instanceof MethodTree)) {
return Description.NO_MATCH;
}
MethodTree method = (MethodTree) path.getLeaf();
Safety methodDeclaredSafety = SafetyAnnotations.getSafety(ASTHelpers.getSymbol(method), state);
if (methodDeclaredSafety.allowsAll()) {
// Fast path, all types are accepted, there's no reason to do further analysis.
return Description.NO_MATCH;
}
Safety returnValueSafety =
SafetyAnalysis.of(state.withPath(new TreePath(state.getPath(), tree.getExpression())));
if (methodDeclaredSafety.allowsValueWith(returnValueSafety)) {
return Description.NO_MATCH;
}
return buildDescription(tree)
.setMessage(String.format(
"Dangerous return value: result is '%s' but the method is annotated '%s'.",
returnValueSafety, methodDeclaredSafety))
.build();
}
@Override
public Description matchAssignment(AssignmentTree tree, VisitorState state) {
return handleAssignment(tree, tree.getVariable(), tree.getExpression(), state);
}
@Override
public Description matchCompoundAssignment(CompoundAssignmentTree tree, VisitorState state) {
return handleAssignment(tree, tree.getVariable(), tree.getExpression(), state);
}
private Description handleAssignment(
ExpressionTree assignmentTree, ExpressionTree variable, ExpressionTree expression, VisitorState state) {
Safety variableDeclaredSafety = SafetyAnnotations.getSafety(variable, state);
if (variableDeclaredSafety.allowsAll()) {
return Description.NO_MATCH;
}
Safety assignmentValue = SafetyAnalysis.of(state.withPath(new TreePath(state.getPath(), expression)));
if (variableDeclaredSafety.allowsValueWith(assignmentValue)) {
return Description.NO_MATCH;
}
return buildDescription(assignmentTree)
.setMessage(String.format(
"Dangerous assignment: value is '%s' but the variable is annotated '%s'.",
assignmentValue, variableDeclaredSafety))
.build();
}
@Override
public Description matchMethod(MethodTree tree, VisitorState state) {
Tree returnType = tree.getReturnType();
if (returnType == null) {
return Description.NO_MATCH;
}
Safety methodSafetyAnnotation = SafetyAnnotations.getSafety(ASTHelpers.getSymbol(tree), state);
if (methodSafetyAnnotation.allowsAll()) {
return Description.NO_MATCH;
}
Safety returnTypeSafety = SafetyAnnotations.getSafety(ASTHelpers.getSymbol(returnType), state);
if (methodSafetyAnnotation.allowsValueWith(returnTypeSafety)) {
return Description.NO_MATCH;
}
return buildDescription(returnType)
.setMessage(String.format(
"Dangerous return type: type is '%s' but the method is annotated '%s'.",
returnTypeSafety, methodSafetyAnnotation))
.build();
}
@Override
public Description matchVariable(VariableTree tree, VisitorState state) {
Safety parameterSafetyAnnotation = SafetyAnnotations.getSafety(ASTHelpers.getSymbol(tree), state);
if (parameterSafetyAnnotation.allowsAll()) {
return Description.NO_MATCH;
}
Safety variableTypeSafety = SafetyAnnotations.getSafety(ASTHelpers.getSymbol(tree.getType()), state);
if (parameterSafetyAnnotation.allowsValueWith(variableTypeSafety)) {
return Description.NO_MATCH;
}
return buildDescription(tree)
.setMessage(String.format(
"Dangerous variable: type is '%s' but the variable is annotated '%s'.",
variableTypeSafety, parameterSafetyAnnotation))
.build();
}
@Override
public Description matchClass(ClassTree tree, VisitorState state) {
Safety directSafety = SafetyAnnotations.getDirectSafety(ASTHelpers.getSymbol(tree), state);
if (directSafety.allowsAll()) {
return Description.NO_MATCH;
}
Safety ancestorSafety = SafetyAnnotations.getTypeSafetyFromAncestors(tree, state);
if (directSafety.allowsValueWith(ancestorSafety)) {
return Description.NO_MATCH;
}
return buildDescription(tree)
.setMessage(String.format(
"Dangerous type: annotated '%s' but ancestors declare '%s'.", directSafety, ancestorSafety))
.build();
}
}
| {
"content_hash": "a4d2c6e2e4840436975ab56b8067569f",
"timestamp": "",
"source": "github",
"line_count": 346,
"max_line_length": 118,
"avg_line_length": 49.274566473988436,
"alnum_prop": 0.6362249985336383,
"repo_name": "palantir/gradle-baseline",
"id": "df72f2ea87c2e509c97c23b301be621140c80fa2",
"size": "17683",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/IllegalSafeLoggingArgument.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "201004"
},
{
"name": "Java",
"bytes": "1890756"
},
{
"name": "Shell",
"bytes": "76"
}
],
"symlink_target": ""
} |
'use strict';
var test = require('../');
test('parent', function (t) {
t.plan(3);
var firstChildRan = false;
t.pass('assertion in parent');
t.test('first child', function (st) {
st.plan(1);
st.pass('pass first child');
firstChildRan = true;
});
t.test('second child', function (st) {
st.plan(2);
st.ok(firstChildRan, 'first child ran first');
st.pass('pass second child');
});
});
| {
"content_hash": "1a1c041ab41ae97211b5826bd2033f96",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 54,
"avg_line_length": 20.130434782608695,
"alnum_prop": 0.5377969762419006,
"repo_name": "substack/tape",
"id": "b3063b96ee1424b8213e59539d95a1e96c21556c",
"size": "463",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/subtest_plan.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "354"
},
{
"name": "JavaScript",
"bytes": "229261"
},
{
"name": "Shell",
"bytes": "49"
}
],
"symlink_target": ""
} |
Plotting - Correlate
==============================
This module is for plotting correlation analysis resutls between multiple masts. The typical format is to give the method the results from a method in an.analysis.correlate. The method then returns a plotly go.Figure object which consists of data and layout Python dictionaries.
A more robust example will be added here in the future.
.. code-block:: python
:linenos:
results = an.analysis.correlate.masts_10_minute_by_direction(ref_mast, site_mast)
results_fig = an.plotting.correlate.masts_10_minute_by_direction(results)
offline.iplot(results_fig)
.. automodule:: plotting.correlate
:members:
| {
"content_hash": "14dcd12611b883da63491be572ea2101",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 279,
"avg_line_length": 43.1875,
"alnum_prop": 0.7163531114327062,
"repo_name": "coryjog/anemoi",
"id": "2a50c4dc89c166411e81ad230b75624cc70370ab",
"size": "691",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "anemoi_docs/code_plotting_correlate.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "804"
},
{
"name": "CSS",
"bytes": "26106"
},
{
"name": "HTML",
"bytes": "648762"
},
{
"name": "JavaScript",
"bytes": "95470"
},
{
"name": "Makefile",
"bytes": "606"
},
{
"name": "Python",
"bytes": "164350"
}
],
"symlink_target": ""
} |
package com.dw.leetcode;
public class LongestWordinDictionary_720 {
class TrieNode {
public char val;
public TrieNode[] hash;
public boolean isWord;
public TrieNode(char c) {
this.val = c;
this.hash = new TrieNode[26];
this.isWord = false;
}
public StringBuilder dfs(StringBuilder res){
StringBuilder max=new StringBuilder();
for(int i=0;i<26;i++){
if(hash[i]!=null && hash[i].isWord){
StringBuilder temp=new StringBuilder();
temp.append(hash[i].val);
temp.append(hash[i].dfs(temp));
if(temp.length() > max.length()) // this is very important, it will choose first letter always
max=temp;
}
}
return max;
}
}
public String longestWord(String[] words) {
TrieNode root=new TrieNode(' ');
for(String word: words) {
TrieNode current = root;
for(int i=0;i<word.length();i++) {
char c = word.charAt(i);
if(current.hash[c-'a'] == null) {
current.hash[c-'a'] = new TrieNode(c);
}
current = current.hash[word.charAt(i)-'a'];
if(i == word.length() - 1) {
current.isWord = true;
}
}
}
StringBuilder sb = new StringBuilder();
sb = root.dfs(sb);
return sb.toString();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
String[] words = {"a", "banana", "app", "appl", "ap", "apply", "apple"};
LongestWordinDictionary_720 s = new LongestWordinDictionary_720();
System.out.println(s.longestWord(words));
}
}
| {
"content_hash": "294ea6df4837fd77437cfb41709581f2",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 114,
"avg_line_length": 25.196969696969695,
"alnum_prop": 0.5538184004810583,
"repo_name": "emacslisp/Java",
"id": "ffae17639795304d91ab1f0274afc3879b090765",
"size": "1663",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "JavaMain/src/com/dw/leetcode/LongestWordinDictionary_720.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "430451"
},
{
"name": "HTML",
"bytes": "77076"
},
{
"name": "Java",
"bytes": "7657508"
},
{
"name": "JavaScript",
"bytes": "184534"
},
{
"name": "SCSS",
"bytes": "432566"
},
{
"name": "Shell",
"bytes": "214"
}
],
"symlink_target": ""
} |
#include <algorithm>
#include <iterator>
#include <vector>
#include <catch2/catch_template_test_macros.hpp>
#include <cpp-sort/adapters/indirect_adapter.h>
#include <cpp-sort/adapters/stable_adapter.h>
#include <cpp-sort/sorters.h>
#include <testing-tools/distributions.h>
TEMPLATE_TEST_CASE( "every random-access sorter with indirect adapter", "[indirect_adapter]",
cppsort::adaptive_shivers_sorter,
cppsort::cartesian_tree_sorter,
cppsort::d_ary_heap_sorter<7>,
cppsort::default_sorter,
cppsort::drop_merge_sorter,
cppsort::grail_sorter<>,
cppsort::heap_sorter,
cppsort::insertion_sorter,
cppsort::mel_sorter,
cppsort::merge_insertion_sorter,
cppsort::merge_sorter,
cppsort::pdq_sorter,
cppsort::poplar_sorter,
cppsort::quick_merge_sorter,
cppsort::quick_sorter,
cppsort::selection_sorter,
cppsort::ska_sorter,
cppsort::slab_sorter,
cppsort::smooth_sorter,
cppsort::spin_sorter,
cppsort::split_sorter,
cppsort::spread_sorter,
cppsort::std_sorter,
cppsort::stable_adapter<cppsort::std_sorter>,
cppsort::tim_sorter,
cppsort::verge_sorter,
cppsort::wiki_sorter<> )
{
std::vector<double> collection; collection.reserve(412);
auto distribution = dist::shuffled{};
distribution.call<double>(std::back_inserter(collection), 412, -125);
cppsort::indirect_adapter<TestType> sorter;
sorter(collection);
CHECK( std::is_sorted(collection.begin(), collection.end()) );
}
TEMPLATE_TEST_CASE( "every bidirectional sorter with indirect_adapter", "[indirect_adapter]",
cppsort::cartesian_tree_sorter,
cppsort::drop_merge_sorter,
cppsort::insertion_sorter,
cppsort::mel_sorter,
cppsort::merge_sorter,
cppsort::pdq_sorter, // Check extended support
cppsort::quick_merge_sorter,
cppsort::quick_sorter,
cppsort::selection_sorter,
cppsort::slab_sorter,
cppsort::verge_sorter )
{
std::list<double> collection;
auto distribution = dist::shuffled{};
distribution.call<double>(std::back_inserter(collection), 412, -125);
cppsort::indirect_adapter<TestType> sorter;
sorter(collection);
CHECK( std::is_sorted(collection.begin(), collection.end()) );
}
TEMPLATE_TEST_CASE( "every forward sorter with with indirect_adapter", "[indirect_adapter]",
cppsort::cartesian_tree_sorter,
cppsort::mel_sorter,
cppsort::merge_sorter,
cppsort::pdq_sorter, // Check extended support
cppsort::quick_merge_sorter,
cppsort::quick_sorter,
cppsort::selection_sorter )
{
std::forward_list<double> collection;
auto distribution = dist::shuffled{};
distribution.call<double>(std::front_inserter(collection), 412, -125);
cppsort::indirect_adapter<TestType> sorter;
sorter(collection);
CHECK( std::is_sorted(collection.begin(), collection.end()) );
}
| {
"content_hash": "297cb71c6eef4945a52e165742d14446",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 93,
"avg_line_length": 41.13793103448276,
"alnum_prop": 0.559094719195306,
"repo_name": "Morwenn/cpp-sort",
"id": "9ef662df28676c370f25914d644a3302dd0931ec",
"size": "3652",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "tests/adapters/indirect_adapter_every_sorter.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "7641"
},
{
"name": "C++",
"bytes": "1917168"
},
{
"name": "CMake",
"bytes": "49348"
},
{
"name": "Python",
"bytes": "27398"
},
{
"name": "Shell",
"bytes": "1073"
},
{
"name": "TeX",
"bytes": "10860"
}
],
"symlink_target": ""
} |
class CreateAppConfigs < ActiveRecord::Migration[4.2]
def change
create_table :app_configs do |t|
t.string :rulebook_name
t.string :front_page
t.string :faq
t.timestamps
end
end
end
| {
"content_hash": "fa09eaec8692c4ecb6c03af903169bb4",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 53,
"avg_line_length": 19.90909090909091,
"alnum_prop": 0.6484018264840182,
"repo_name": "rdunlop/unicycling-rulebook",
"id": "60ed591190cdf40fee70fe86757b38ba9f028736",
"size": "219",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/migrate/20120929035746_create_app_configs.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "113"
},
{
"name": "CoffeeScript",
"bytes": "911"
},
{
"name": "Dockerfile",
"bytes": "371"
},
{
"name": "HTML",
"bytes": "2573"
},
{
"name": "Haml",
"bytes": "53198"
},
{
"name": "JavaScript",
"bytes": "2499"
},
{
"name": "Procfile",
"bytes": "62"
},
{
"name": "Ruby",
"bytes": "300476"
},
{
"name": "SCSS",
"bytes": "23621"
},
{
"name": "Shell",
"bytes": "2896"
}
],
"symlink_target": ""
} |
define([
'dojo/parser',
'app/App'
],
function (
parser
) {
window.AGRC = {
// errorLogger: ijit.modules.ErrorLogger
errorLogger: null,
// app: app.App
// global reference to App
app: null,
// version: String
// The version number.
version: '0.1.0',
// apiKey: String
// The api key used for services on api.mapserv.utah.gov
// apiKey: 'AGRC-63E1FF17767822', // localhost
apiKey: 'AGRC-A94B063C533889', // key for atlas.utah.gov
urls: {
mapService: '/arcgis/rest/services/UGSChemistry/MapServer'
},
fields: {
MonitoringLocationIdentifier: 'MonitoringLocationIdentifier'
}
};
// lights...camera...action!
parser.parse();
}); | {
"content_hash": "13c484fd5ef38f7c46f470c1a9953e3c",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 72,
"avg_line_length": 21.86842105263158,
"alnum_prop": 0.53309265944645,
"repo_name": "inkenbrandt/ugs-chemistry",
"id": "cb0d162c52fe43b126b46483d21a9ca87ef3a27f",
"size": "831",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/main.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "41666"
},
{
"name": "JavaScript",
"bytes": "607745"
},
{
"name": "PHP",
"bytes": "751"
},
{
"name": "Python",
"bytes": "192525"
},
{
"name": "Shell",
"bytes": "4144"
}
],
"symlink_target": ""
} |
"""File comparison methods for different file formats.
This module provides a main file comparison method, :meth:`file_cmp()`, that compares two files and returns
True if they are equivalent, False otherwise. The comparison is made differently depending on the file format.
For instance, two Newick files are considered equal if one tree is the result of a permutation of the other.
Typical usage examples::
file_cmp('a/homo_sapiens.fa', 'b/homo_sapiens.fa')
from pathlib import Path
file_cmp(Path('a', 'tree1.nw'), Path('b', 'tree2.nw'))
"""
__all__ = ['NEWICK_EXT', 'file_cmp']
import filecmp
from pathlib import Path
from Bio import Phylo
from .dircmp import PathLike
# File extensions that should be interpreted as the same file format:
NEWICK_EXT = {'.nw', '.nwk', '.newick', '.nh'}
def file_cmp(fpath1: PathLike, fpath2: PathLike) -> bool:
"""Returns True if files `fpath1` and `fpath2` are equivalent, False otherwise.
Args:
fpath1: First file path.
fpath2: Second file path.
"""
fext1 = Path(fpath1).suffix
fext2 = Path(fpath2).suffix
if (fext1 in NEWICK_EXT) and (fext2 in NEWICK_EXT):
return _tree_cmp(fpath1, fpath2)
# Resort to a shallow binary file comparison (files with identical os.stat() signatures are taken to be
# equal)
return filecmp.cmp(str(fpath1), str(fpath2))
def _tree_cmp(fpath1: PathLike, fpath2: PathLike, tree_format: str = 'newick') -> bool:
"""Returns True if trees stored in `fpath1` and `fpath2` are equivalent, False otherwise.
Args:
fpath1: First tree file path.
fpath2: Second tree file path.
tree_format: Tree format, i.e. ``newick``, ``nexus``, ``phyloxml`` or ``nexml``.
"""
ref_tree = Phylo.read(fpath1, tree_format)
target_tree = Phylo.read(fpath2, tree_format)
# Both trees are considered equal if they have the same leaves and the same distance from each to the root
ref_dists = {leaf.name: ref_tree.distance(leaf) for leaf in ref_tree.get_terminals()}
target_dists = {leaf.name: target_tree.distance(leaf) for leaf in target_tree.get_terminals()}
return ref_dists == target_dists
| {
"content_hash": "f792fe411e79d1fe8960b19c2d823144",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 110,
"avg_line_length": 35.68852459016394,
"alnum_prop": 0.6871841984382178,
"repo_name": "Ensembl/ensembl-compara",
"id": "bd758c35d56d3ad2144e28a64caf0e86d2fe9f7a",
"size": "2832",
"binary": false,
"copies": "1",
"ref": "refs/heads/release/108",
"path": "src/python/lib/ensembl/compara/filesys/filecmp.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AngelScript",
"bytes": "854"
},
{
"name": "C",
"bytes": "1732"
},
{
"name": "HTML",
"bytes": "3156"
},
{
"name": "Java",
"bytes": "42160"
},
{
"name": "JavaScript",
"bytes": "14023"
},
{
"name": "Nextflow",
"bytes": "5551"
},
{
"name": "Perl",
"bytes": "7428049"
},
{
"name": "Python",
"bytes": "137625"
},
{
"name": "R",
"bytes": "18440"
},
{
"name": "Shell",
"bytes": "16970"
},
{
"name": "Visual Basic 6.0",
"bytes": "2722"
},
{
"name": "XS",
"bytes": "16045"
}
],
"symlink_target": ""
} |
package gate.termraider.gui;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import javax.swing.table.*;
import org.apache.commons.lang.StringUtils;
import gate.creole.*;
import java.util.*;
import gate.termraider.bank.*;
import gate.termraider.util.*;
public class HyponymyDebugger
extends JPanel
implements ANNIEConstants {
private static final long serialVersionUID = -3587317001405213679L;
private JScrollPane scrollPane;
private HyponymyTermbank termbank;
private JTable table;
private JButton goButton;
private JPanel controlPanel, placeholder;
public HyponymyDebugger(HyponymyTermbank termbank) {
this.termbank = termbank;
setLayout(new BorderLayout());
makeControlPanel();
this.add(controlPanel, BorderLayout.NORTH);
placeholder = new JPanel();
this.add(placeholder, BorderLayout.CENTER);
}
private void makeControlPanel() {
goButton = new JButton("generate debugging table");
goButton.setToolTipText("This may take some time!");
goButton.addActionListener(new HDGoButtonActionListener(this));
controlPanel = new JPanel();
controlPanel.setLayout(new BoxLayout(controlPanel, BoxLayout.X_AXIS));
controlPanel.add(Box.createHorizontalGlue());
controlPanel.add(goButton);
controlPanel.add(Box.createHorizontalGlue());
}
protected void generateTable() {
JTextField tempField = new JTextField("generating...");
placeholder.add(tempField);
TableModel tableModel = new HDTableModel(termbank);
table = new JTable(tableModel);
table.setDefaultRenderer(String.class, new MultilineCellRenderer());
table.setAutoCreateRowSorter(true);
scrollPane = new JScrollPane(table,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.remove(placeholder);
this.add(scrollPane, BorderLayout.CENTER);
}
}
class HDTableModel extends AbstractTableModel {
private static final long serialVersionUID = -1124137938074923640L;
private String[] columnNames = {"term", "raw score", "docs", "docs", "hyponyms", "hyponyms", "heads"};
private Map<Term, Set<String>> termDocuments, termHyponyms, termHeads;
private List<Term> terms;
private HyponymyTermbank termbank;
public HDTableModel(HyponymyTermbank termbank) {
this.termbank = termbank;
this.termDocuments = termbank.getTermDocuments();
this.termHeads = termbank.getTermHeads();
this.termHyponyms = termbank.getTermHyponyms();
terms = new ArrayList<Term>(termDocuments.keySet());
Collections.sort(terms, new TermComparator());
}
public Class<?> getColumnClass(int i) {
return String.class;
}
@Override
public int getColumnCount() {
return columnNames.length;
}
@Override
public int getRowCount() {
return termDocuments.size();
}
public String getColumnName(int c) {
return columnNames[c];
}
public boolean isCellEditable(int r, int c) {
return false;
}
@Override
public Object getValueAt(int row, int column) {
Term term = terms.get(row);
String result = "";
switch(column) {
case 0:
result = term.toString();
break;
case 1:
result = Double.toString(termbank.getRawScore(term));
break;
case 2:
result = Integer.toString(termDocuments.get(term).size());
break;
case 3:
result = StringUtils.join(termDocuments.get(term), '\n');
break;
case 4:
result = Integer.toString(termHyponyms.get(term).size());
break;
case 5:
result = StringUtils.join(termHyponyms.get(term), '\n');
break;
case 6:
result = StringUtils.join(termHeads.get(term), '\n');
break;
}
return result;
}
}
class HDGoButtonActionListener implements ActionListener {
private HyponymyDebugger viewer;
public HDGoButtonActionListener(HyponymyDebugger viewer) {
this.viewer = viewer;
}
@Override
public void actionPerformed(ActionEvent arg0) {
viewer.generateTable();
}
} | {
"content_hash": "d4deb5c0b533d4c32eb50fbc65164070",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 104,
"avg_line_length": 27.235294117647058,
"alnum_prop": 0.6942644588432926,
"repo_name": "Network-of-BioThings/GettinCRAFTy",
"id": "1d01b1f846ec03e88e1e07561ae34177b7170dee",
"size": "4666",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/resources/gate/plugins/TermRaider/src/gate/termraider/gui/HyponymyDebugger.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "9711"
},
{
"name": "CSS",
"bytes": "81825"
},
{
"name": "Groovy",
"bytes": "25475"
},
{
"name": "Java",
"bytes": "5308837"
},
{
"name": "Perl",
"bytes": "181577"
},
{
"name": "Prolog",
"bytes": "123527"
},
{
"name": "Shell",
"bytes": "17297"
},
{
"name": "TeX",
"bytes": "11724"
}
],
"symlink_target": ""
} |
from django.views.generic import ListView
from haystack.query import SearchQuerySet
from haystack.utils.geo import Point, D
from ..models import Store
from ..utils import caching_geo_lookup
class DistanceSearchView(ListView):
template_name = 'stores/store_search.html'
distance = 25
def get_location(self):
# TODO: geopy the location based on kwargs
location = self.request.GET.get('location')
lat = self.request.GET.get('lat')
lng = self.request.GET.get('lng')
if location:
name, geo = caching_geo_lookup(location)
elif lat and lng:
geo = (float(lat), float(lng))
else:
geo = None
self.location_geo = geo
return Point(geo[1], geo[0])
def get_distance(self):
return D(km=self.request.GET.get('distance', self.distance))
def get_queryset(self):
location = self.get_location()
if not location:
return SearchQuerySet.none
distance = self.get_distance()
print location, distance
return SearchQuerySet().dwithin('location', location, distance)\
.distance('location', location).order_by('-distance')
def get_context_data(self, **kwargs):
ctx = super(DistanceSearchView, self).get_context_data(**kwargs)
ctx.update({
'location': self.request.GET.get('location'),
'location_geo': self.location_geo,
})
return ctx | {
"content_hash": "35505e1cbcce03ff6f105bc98edea843",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 72,
"avg_line_length": 32,
"alnum_prop": 0.6195652173913043,
"repo_name": "nikdoof/vapemap",
"id": "2de0a70ebdf4b2a83dbc12d5638b55b6c5761098",
"size": "1472",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/stores/views/search.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "107"
},
{
"name": "JavaScript",
"bytes": "3216"
},
{
"name": "Puppet",
"bytes": "7746"
},
{
"name": "Python",
"bytes": "204060"
}
],
"symlink_target": ""
} |
require File.expand_path('../../../spec_helper', __FILE__)
module Backup
describe 'Database::Redis' do
shared_examples 'redis specs' do
specify 'No Compression' do
create_model :my_backup, <<-EOS
Backup::Model.new(:my_backup, 'a description') do
database Redis do |db|
db.mode = #{ mode }
db.rdb_path = '/var/lib/redis/dump.rdb'
db.invoke_save = #{ invoke_save }
end
store_with Local
end
EOS
job = backup_perform :my_backup
expect( job.package.exist? ).to be_true
expect( job.package ).to match_manifest(%q[
5782 my_backup/databases/Redis.rdb
])
end
specify 'With Compression' do
create_model :my_backup, <<-EOS
Backup::Model.new(:my_backup, 'a description') do
database Redis do |db|
db.mode = #{ mode }
db.rdb_path = '/var/lib/redis/dump.rdb'
db.invoke_save = #{ invoke_save }
end
compress_with Gzip
store_with Local
end
EOS
job = backup_perform :my_backup
expect( job.package.exist? ).to be_true
expect( job.package ).to match_manifest(%q[
2200..2300 my_backup/databases/Redis.rdb.gz
])
end
specify 'Multiple Dumps' do
create_model :my_backup, <<-EOS
Backup::Model.new(:my_backup, 'a description') do
database Redis, :dump_01 do |db|
db.mode = #{ mode }
db.rdb_path = '/var/lib/redis/dump.rdb'
db.invoke_save = #{ invoke_save }
end
database Redis, 'Dump #2' do |db|
db.mode = #{ mode }
db.rdb_path = '/var/lib/redis/dump.rdb'
db.invoke_save = #{ invoke_save }
end
store_with Local
end
EOS
job = backup_perform :my_backup
expect( job.package.exist? ).to be_true
expect( job.package ).to match_manifest(%q[
5782 my_backup/databases/Redis-dump_01.rdb
5782 my_backup/databases/Redis-Dump__2.rdb
])
end
end # shared_examples 'redis specs'
context 'using :copy mode' do
let(:mode) { ':copy' }
context 'with :invoke_save' do
let(:invoke_save) { 'true' }
include_examples 'redis specs'
end
context 'without :invoke_save' do
let(:invoke_save) { 'false' }
include_examples 'redis specs'
end
end
context 'using :sync mode' do
let(:mode) { ':sync' }
let(:invoke_save) { 'false' }
include_examples 'redis specs'
end
end
end
| {
"content_hash": "841b371c1648122cf03e4415c8c11485",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 58,
"avg_line_length": 26.316326530612244,
"alnum_prop": 0.5529274912756883,
"repo_name": "backup/backup",
"id": "8c5dbb4289078b3e21ca7f9d9a7f892612660fb5",
"size": "2579",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "vagrant/spec/acceptance/database/redis_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "599"
},
{
"name": "HTML",
"bytes": "2065"
},
{
"name": "Ruby",
"bytes": "1067349"
},
{
"name": "Shell",
"bytes": "2014"
}
],
"symlink_target": ""
} |
{-# LANGUAGE RecordWildCards #-}
-- | DSL for testing the modular solver
module UnitTests.Distribution.Client.Dependency.Modular.DSL (
ExampleDependency(..)
, Dependencies(..)
, ExPreference(..)
, ExampleDb
, ExampleVersionRange
, ExamplePkgVersion
, exAv
, exInst
, exFlag
, exResolve
, extractInstallPlan
, withSetupDeps
) where
-- base
import Data.Either (partitionEithers)
import Data.Maybe (catMaybes)
import Data.List (nub)
import Data.Monoid
import Data.Version
import qualified Data.Map as Map
-- Cabal
import qualified Distribution.Compiler as C
import qualified Distribution.InstalledPackageInfo as C
import qualified Distribution.Package as C
hiding (HasUnitId(..))
import qualified Distribution.PackageDescription as C
import qualified Distribution.Simple.PackageIndex as C.PackageIndex
import qualified Distribution.System as C
import qualified Distribution.Version as C
import Language.Haskell.Extension (Extension(..), Language)
-- cabal-install
import Distribution.Client.ComponentDeps (ComponentDeps)
import Distribution.Client.Dependency
import Distribution.Client.Dependency.Types
import Distribution.Client.Types
import qualified Distribution.Client.InstallPlan as CI.InstallPlan
import qualified Distribution.Client.PackageIndex as CI.PackageIndex
import qualified Distribution.Client.ComponentDeps as CD
{-------------------------------------------------------------------------------
Example package database DSL
In order to be able to set simple examples up quickly, we define a very
simple version of the package database here explicitly designed for use in
tests.
The design of `ExampleDb` takes the perspective of the solver, not the
perspective of the package DB. This makes it easier to set up tests for
various parts of the solver, but makes the mapping somewhat awkward, because
it means we first map from "solver perspective" `ExampleDb` to the package
database format, and then the modular solver internally in `IndexConversion`
maps this back to the solver specific data structures.
IMPLEMENTATION NOTES
--------------------
TODO: Perhaps these should be made comments of the corresponding data type
definitions. For now these are just my own conclusions and may be wrong.
* The difference between `GenericPackageDescription` and `PackageDescription`
is that `PackageDescription` describes a particular _configuration_ of a
package (for instance, see documentation for `checkPackage`). A
`GenericPackageDescription` can be returned into a `PackageDescription` in
two ways:
a. `finalizePackageDescription` does the proper translation, by taking
into account the platform, available dependencies, etc. and picks a
flag assignment (or gives an error if no flag assignment can be found)
b. `flattenPackageDescription` ignores flag assignment and just joins all
components together.
The slightly odd thing is that a `GenericPackageDescription` contains a
`PackageDescription` as a field; both of the above functions do the same
thing: they take the embedded `PackageDescription` as a basis for the result
value, but override `library`, `executables`, `testSuites`, `benchmarks`
and `buildDepends`.
* The `condTreeComponents` fields of a `CondTree` is a list of triples
`(condition, then-branch, else-branch)`, where the `else-branch` is
optional.
-------------------------------------------------------------------------------}
type ExamplePkgName = String
type ExamplePkgVersion = Int
type ExamplePkgHash = String -- for example "installed" packages
type ExampleFlagName = String
type ExampleTestName = String
type ExampleVersionRange = C.VersionRange
data Dependencies = NotBuildable | Buildable [ExampleDependency]
data ExampleDependency =
-- | Simple dependency on any version
ExAny ExamplePkgName
-- | Simple dependency on a fixed version
| ExFix ExamplePkgName ExamplePkgVersion
-- | Dependencies indexed by a flag
| ExFlag ExampleFlagName Dependencies Dependencies
-- | Dependency if tests are enabled
| ExTest ExampleTestName [ExampleDependency]
-- | Dependency on a language extension
| ExExt Extension
-- | Dependency on a language version
| ExLang Language
exFlag :: ExampleFlagName -> [ExampleDependency] -> [ExampleDependency]
-> ExampleDependency
exFlag n t e = ExFlag n (Buildable t) (Buildable e)
data ExPreference = ExPref String ExampleVersionRange
data ExampleAvailable = ExAv {
exAvName :: ExamplePkgName
, exAvVersion :: ExamplePkgVersion
, exAvDeps :: ComponentDeps [ExampleDependency]
}
exAv :: ExamplePkgName -> ExamplePkgVersion -> [ExampleDependency]
-> ExampleAvailable
exAv n v ds = ExAv { exAvName = n, exAvVersion = v
, exAvDeps = CD.fromLibraryDeps ds }
withSetupDeps :: ExampleAvailable -> [ExampleDependency] -> ExampleAvailable
withSetupDeps ex setupDeps = ex {
exAvDeps = exAvDeps ex <> CD.fromSetupDeps setupDeps
}
data ExampleInstalled = ExInst {
exInstName :: ExamplePkgName
, exInstVersion :: ExamplePkgVersion
, exInstHash :: ExamplePkgHash
, exInstBuildAgainst :: [ExampleInstalled]
}
exInst :: ExamplePkgName -> ExamplePkgVersion -> ExamplePkgHash
-> [ExampleInstalled] -> ExampleInstalled
exInst = ExInst
type ExampleDb = [Either ExampleInstalled ExampleAvailable]
type DependencyTree a = C.CondTree C.ConfVar [C.Dependency] a
exDbPkgs :: ExampleDb -> [ExamplePkgName]
exDbPkgs = map (either exInstName exAvName)
exAvSrcPkg :: ExampleAvailable -> SourcePackage
exAvSrcPkg ex =
let (libraryDeps, testSuites, exts, mlang) = splitTopLevel (CD.libraryDeps (exAvDeps ex))
in SourcePackage {
packageInfoId = exAvPkgId ex
, packageSource = LocalTarballPackage "<<path>>"
, packageDescrOverride = Nothing
, packageDescription = C.GenericPackageDescription {
C.packageDescription = C.emptyPackageDescription {
C.package = exAvPkgId ex
, C.library = error "not yet configured: library"
, C.executables = error "not yet configured: executables"
, C.testSuites = error "not yet configured: testSuites"
, C.benchmarks = error "not yet configured: benchmarks"
, C.buildDepends = error "not yet configured: buildDepends"
, C.setupBuildInfo = Just C.SetupBuildInfo {
C.setupDepends = mkSetupDeps (CD.setupDeps (exAvDeps ex))
}
}
, C.genPackageFlags = nub $ concatMap extractFlags
(CD.libraryDeps (exAvDeps ex))
, C.condLibrary = Just $ mkCondTree (extsLib exts <> langLib mlang)
disableLib
(Buildable libraryDeps)
, C.condExecutables = []
, C.condTestSuites =
let mkTree = mkCondTree mempty disableTest . Buildable
in map (\(t, deps) -> (t, mkTree deps)) testSuites
, C.condBenchmarks = []
}
}
where
-- Split the set of dependencies into the set of dependencies of the library,
-- the dependencies of the test suites and extensions.
splitTopLevel :: [ExampleDependency]
-> ( [ExampleDependency]
, [(ExampleTestName, [ExampleDependency])]
, [Extension]
, Maybe Language
)
splitTopLevel [] =
([], [], [], Nothing)
splitTopLevel (ExTest t a:deps) =
let (other, testSuites, exts, lang) = splitTopLevel deps
in (other, (t, a):testSuites, exts, lang)
splitTopLevel (ExExt ext:deps) =
let (other, testSuites, exts, lang) = splitTopLevel deps
in (other, testSuites, ext:exts, lang)
splitTopLevel (ExLang lang:deps) =
case splitTopLevel deps of
(other, testSuites, exts, Nothing) -> (other, testSuites, exts, Just lang)
_ -> error "Only 1 Language dependency is supported"
splitTopLevel (dep:deps) =
let (other, testSuites, exts, lang) = splitTopLevel deps
in (dep:other, testSuites, exts, lang)
-- Extract the total set of flags used
extractFlags :: ExampleDependency -> [C.Flag]
extractFlags (ExAny _) = []
extractFlags (ExFix _ _) = []
extractFlags (ExFlag f a b) = C.MkFlag {
C.flagName = C.FlagName f
, C.flagDescription = ""
, C.flagDefault = True
, C.flagManual = False
}
: concatMap extractFlags (deps a ++ deps b)
where
deps :: Dependencies -> [ExampleDependency]
deps NotBuildable = []
deps (Buildable ds) = ds
extractFlags (ExTest _ a) = concatMap extractFlags a
extractFlags (ExExt _) = []
extractFlags (ExLang _) = []
mkCondTree :: Monoid a => a -> (a -> a) -> Dependencies -> DependencyTree a
mkCondTree x dontBuild NotBuildable =
C.CondNode {
C.condTreeData = dontBuild x
, C.condTreeConstraints = []
, C.condTreeComponents = []
}
mkCondTree x dontBuild (Buildable deps) =
let (directDeps, flaggedDeps) = splitDeps deps
in C.CondNode {
C.condTreeData = x -- Necessary for language extensions
, C.condTreeConstraints = map mkDirect directDeps
, C.condTreeComponents = map (mkFlagged dontBuild) flaggedDeps
}
mkDirect :: (ExamplePkgName, Maybe ExamplePkgVersion) -> C.Dependency
mkDirect (dep, Nothing) = C.Dependency (C.PackageName dep) C.anyVersion
mkDirect (dep, Just n) = C.Dependency (C.PackageName dep) (C.thisVersion v)
where
v = Version [n, 0, 0] []
mkFlagged :: Monoid a
=> (a -> a)
-> (ExampleFlagName, Dependencies, Dependencies)
-> (C.Condition C.ConfVar
, DependencyTree a, Maybe (DependencyTree a))
mkFlagged dontBuild (f, a, b) = ( C.Var (C.Flag (C.FlagName f))
, mkCondTree mempty dontBuild a
, Just (mkCondTree mempty dontBuild b)
)
-- Split a set of dependencies into direct dependencies and flagged
-- dependencies. A direct dependency is a tuple of the name of package and
-- maybe its version (no version means any version) meant to be converted
-- to a 'C.Dependency' with 'mkDirect' for example. A flagged dependency is
-- the set of dependencies guarded by a flag.
--
-- TODO: Take care of flagged language extensions and language flavours.
splitDeps :: [ExampleDependency]
-> ( [(ExamplePkgName, Maybe Int)]
, [(ExampleFlagName, Dependencies, Dependencies)]
)
splitDeps [] =
([], [])
splitDeps (ExAny p:deps) =
let (directDeps, flaggedDeps) = splitDeps deps
in ((p, Nothing):directDeps, flaggedDeps)
splitDeps (ExFix p v:deps) =
let (directDeps, flaggedDeps) = splitDeps deps
in ((p, Just v):directDeps, flaggedDeps)
splitDeps (ExFlag f a b:deps) =
let (directDeps, flaggedDeps) = splitDeps deps
in (directDeps, (f, a, b):flaggedDeps)
splitDeps (ExTest _ _:_) =
error "Unexpected nested test"
splitDeps (_:deps) = splitDeps deps
-- Currently we only support simple setup dependencies
mkSetupDeps :: [ExampleDependency] -> [C.Dependency]
mkSetupDeps deps =
let (directDeps, []) = splitDeps deps in map mkDirect directDeps
-- A 'C.Library' with just the given extensions in its 'BuildInfo'
extsLib :: [Extension] -> C.Library
extsLib es = mempty { C.libBuildInfo = mempty { C.otherExtensions = es } }
-- A 'C.Library' with just the given extensions in its 'BuildInfo'
langLib :: Maybe Language -> C.Library
langLib (Just lang) = mempty { C.libBuildInfo = mempty { C.defaultLanguage = Just lang } }
langLib _ = mempty
disableLib :: C.Library -> C.Library
disableLib lib =
lib { C.libBuildInfo = (C.libBuildInfo lib) { C.buildable = False }}
disableTest :: C.TestSuite -> C.TestSuite
disableTest test =
test { C.testBuildInfo = (C.testBuildInfo test) { C.buildable = False }}
exAvPkgId :: ExampleAvailable -> C.PackageIdentifier
exAvPkgId ex = C.PackageIdentifier {
pkgName = C.PackageName (exAvName ex)
, pkgVersion = Version [exAvVersion ex, 0, 0] []
}
exInstInfo :: ExampleInstalled -> C.InstalledPackageInfo
exInstInfo ex = C.emptyInstalledPackageInfo {
C.installedUnitId = C.mkUnitId (exInstHash ex)
, C.sourcePackageId = exInstPkgId ex
, C.depends = map (C.mkUnitId . exInstHash)
(exInstBuildAgainst ex)
}
exInstPkgId :: ExampleInstalled -> C.PackageIdentifier
exInstPkgId ex = C.PackageIdentifier {
pkgName = C.PackageName (exInstName ex)
, pkgVersion = Version [exInstVersion ex, 0, 0] []
}
exAvIdx :: [ExampleAvailable] -> CI.PackageIndex.PackageIndex SourcePackage
exAvIdx = CI.PackageIndex.fromList . map exAvSrcPkg
exInstIdx :: [ExampleInstalled] -> C.PackageIndex.InstalledPackageIndex
exInstIdx = C.PackageIndex.fromList . map exInstInfo
exResolve :: ExampleDb
-- List of extensions supported by the compiler, or Nothing if unknown.
-> Maybe [Extension]
-- List of languages supported by the compiler, or Nothing if unknown.
-> Maybe [Language]
-> [ExamplePkgName]
-> Bool
-> [ExPreference]
-> ([String], Either String CI.InstallPlan.InstallPlan)
exResolve db exts langs targets indepGoals prefs = runProgress $
resolveDependencies C.buildPlatform
compiler
Modular
params
where
defaultCompiler = C.unknownCompilerInfo C.buildCompilerId C.NoAbiTag
compiler = defaultCompiler { C.compilerInfoExtensions = exts
, C.compilerInfoLanguages = langs
}
(inst, avai) = partitionEithers db
instIdx = exInstIdx inst
avaiIdx = SourcePackageDb {
packageIndex = exAvIdx avai
, packagePreferences = Map.empty
}
enableTests = fmap (\p -> PackageConstraintStanzas
(C.PackageName p) [TestStanzas])
(exDbPkgs db)
targets' = fmap (\p -> NamedPackage (C.PackageName p) []) targets
params = addPreferences (fmap toPref prefs)
$ addConstraints (fmap toLpc enableTests)
$ (standardInstallPolicy instIdx avaiIdx targets') {
depResolverIndependentGoals = indepGoals
}
toLpc pc = LabeledPackageConstraint pc ConstraintSourceUnknown
toPref (ExPref n v) = PackageVersionPreference (C.PackageName n) v
extractInstallPlan :: CI.InstallPlan.InstallPlan
-> [(ExamplePkgName, ExamplePkgVersion)]
extractInstallPlan = catMaybes . map confPkg . CI.InstallPlan.toList
where
confPkg :: CI.InstallPlan.PlanPackage -> Maybe (String, Int)
confPkg (CI.InstallPlan.Configured pkg) = Just $ srcPkg pkg
confPkg _ = Nothing
srcPkg :: ConfiguredPackage -> (String, Int)
srcPkg (ConfiguredPackage pkg _flags _stanzas _deps) =
let C.PackageIdentifier (C.PackageName p) (Version (n:_) _) =
packageInfoId pkg
in (p, n)
{-------------------------------------------------------------------------------
Auxiliary
-------------------------------------------------------------------------------}
-- | Run Progress computation
--
-- Like `runLog`, but for the more general `Progress` type.
runProgress :: Progress step e a -> ([step], Either e a)
runProgress = go
where
go (Step s p) = let (ss, result) = go p in (s:ss, result)
go (Fail e) = ([], Left e)
go (Done a) = ([], Right a)
| {
"content_hash": "0ce3ecd011eb91b2390ccb8e90b45669",
"timestamp": "",
"source": "github",
"line_count": 398,
"max_line_length": 94,
"avg_line_length": 41.64572864321608,
"alnum_prop": 0.6226244343891403,
"repo_name": "edsko/cabal",
"id": "91a00ac6d281a1d7e76cce01705cc57114c727f9",
"size": "16575",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/DSL.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "1288"
},
{
"name": "CSS",
"bytes": "1051"
},
{
"name": "Haskell",
"bytes": "2794821"
},
{
"name": "Makefile",
"bytes": "3276"
},
{
"name": "Shell",
"bytes": "25618"
}
],
"symlink_target": ""
} |
using System;
using FluentAssertions;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using Windows.Foundation.Collections;
using Windows.Storage;
namespace PK.Settings.StoreApps
{
[TestClass]
public class LocalSettingsSettingManagerTest
{
[TestMethod, TestCategory("CodeContract")]
public void ShouldAssertSettingSourceParameterIsNotNull()
{
LocalSettingsSettingManager unit;
//Arrange
//Act
Action action = () =>
unit = new LocalSettingsSettingManager(null);
//Assert
action.ShouldThrow<ArgumentNullException>();
}
}
} | {
"content_hash": "3b2f0785c3eda3782e70223a17b73010",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 65,
"avg_line_length": 27.51851851851852,
"alnum_prop": 0.6716016150740243,
"repo_name": "PascalK/PK",
"id": "03f3c8f80e4c532e68ce930c86e58d1c18008b21",
"size": "745",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Tests/PK.Settings.StoreApps.Tests/LocalSettingsSettingManagerTest.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "88628"
},
{
"name": "Shell",
"bytes": "2743"
}
],
"symlink_target": ""
} |
@interface MSDayColumnHeader : UICollectionReusableView
@property (nonatomic, strong) NSDate *day;
@property (nonatomic, assign) BOOL currentDay;
@end
| {
"content_hash": "479465e5a9a78fa957982ba43eb44e7c",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 55,
"avg_line_length": 25.5,
"alnum_prop": 0.7973856209150327,
"repo_name": "neonaldo/MSCollectionViewCalendarLayout",
"id": "8364467e119e8a7eda9f7ed0652f9c0bae406ba9",
"size": "322",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "Example/Example/MSDayColumnHeader.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2115"
},
{
"name": "C++",
"bytes": "2982"
},
{
"name": "Objective-C",
"bytes": "1624463"
},
{
"name": "Ruby",
"bytes": "805"
},
{
"name": "Shell",
"bytes": "4587"
}
],
"symlink_target": ""
} |
function solve(args) {
let studentsData = args
.map(studentString => studentString.split(' -> '));
let student = {};
studentsData.forEach(tokens => {
let key = tokens[0];
let value = tokens[1];
if (['grade', 'age'].includes(key)){
value = Number(value);
}
student[key] = value;
});
console.log(JSON.stringify(student));
}
solve([
'name -> Angel',
'surname -> Georgiev',
'age -> 20',
'grade -> 6.00',
'date -> 23/05/1995',
'town -> Sofia'
]); | {
"content_hash": "a382f1070c2b0d81c0e2e3ad02ee3048",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 59,
"avg_line_length": 22.346153846153847,
"alnum_prop": 0.4784853700516351,
"repo_name": "Menkachev/Software-University",
"id": "aa8af60314526840f3faa379f5beda5d54b393ef",
"size": "581",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Software Technologies/03. JavaScript/02 JavaScript Syntax - Exercises/15. Turn Object into JSON String.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "498662"
}
],
"symlink_target": ""
} |
import T2
import sys
from prompt_toolkit import prompt
from prompt_toolkit.contrib.completers import WordCompleter
bird_person = T2.Hand("Bird Person", "bp@gmail.com")
rick = T2.Hand("Rick Sanches", "rs@gmail.com")
morty = T2.Hand("Morty", "mr@gmail.com")
b1 = T2.Book("Coders at Work: Reflections on the Craft of Programming",
"Peter Seibel", "Apress", 2009)
b2 = T2.Book("Code Complete: A Practical Handbook of Software Construction",
"Steve McConnell", " Microsoft Press", "2009")
b3 = T2.Book("The Mythical Man Month", "Frederick P. Brooks, Jr. Page",
"Addison-Wesley Professional", "1995")
b4 = T2.Book("Don’t Make Me Think, Revisited: A Common Sense Approach to Web Usability",
"Steve Krug", "New Riders", "2014")
b5 = T2.Book("The Pragmatic Programmer: From Journeyman to Master",
"Andrew Hunt", "Addison-Wesley Professional", "1999")
np1 = T2.Newspaper("The New York Times", "01-23-2017")
np2 = T2.Newspaper("The Wall Street Journal", "05-17-2017")
np3 = T2.Newspaper("Los Angeles Times", "03-10-2017")
np4 = T2.Newspaper("New York Post", "05-05-2017")
np5 = T2.Newspaper("Chicago Tribune", "06-07-2017")
my_archive = T2.Archive()
my_archive.add([bird_person, rick, morty])
my_archive.add([b1, b2, b3, b4, b5])
my_archive.add([np1, np2, np3, np4, np5])
def give():
print("==============================")
print("Choice customer from the list:")
print("==============================")
customers = {c[1].name: c[0] for c in enumerate(my_archive.get_items('customer'))}
customers_completer = WordCompleter(customers.keys())
for item in customers.keys():
print("%s" % item)
print()
customer = prompt('customer ~> ', completer=customers_completer)
customer_id = customers[customer]
print("===========================")
print("Choice which book you give:")
print("===========================")
books = {b.title: b for b in my_archive.get_items('book')}
books_completer = WordCompleter(books.keys())
for item in books.keys():
print("%s" % item)
print()
book = prompt('book ~> ', completer=books_completer)
try:
my_archive.give_item(books[book], customer_id)
except Exception as msg:
print("====>> %s" % msg)
def take():
pass
def stats():
print(my_archive)
def customers():
pass
commands = {"stats": stats, "customers": customers, "give": give, "take": take}
commands_completer = WordCompleter(commands.keys())
def help():
print("Commands available:")
output = ""
for c in commands.keys():
output += str(c) + " "
print(output)
while True:
try:
command = prompt('archive ~> ', completer=commands_completer)
commands[command]()
except (KeyError):
help()
except (KeyboardInterrupt, EOFError):
print("\n See ya!")
sys.exit(0)
| {
"content_hash": "1088ee814b4f6e6d5b9a6125c92a2dc0",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 88,
"avg_line_length": 29.19607843137255,
"alnum_prop": 0.5936870382807253,
"repo_name": "kvantos/intro_to_python_class",
"id": "bed1bbaf730db271792e28e3ef5c7256236e9265",
"size": "3028",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Library.py",
"mode": "33261",
"license": "bsd-2-clause",
"language": [
{
"name": "Python",
"bytes": "97807"
}
],
"symlink_target": ""
} |
"""
QUOTE函数返回列所对应的原生SQL表达式。
Ref: https://www.sqlite.org/lang_corefunc.html
"""
from sqlite4dummy.tests.basetest import BaseUnittest
from datetime import datetime, date
import unittest
class Unittest(BaseUnittest):
def setUp(self):
self.connect_database()
def test_all(self):
cursor = self.cursor
# insert some data
create_sql = \
"""
CREATE TABLE test
(
_id INTEGER PRIMARY KEY,
_str TEXT,
_bytes BLOB,
_date DATE,
_datetime TIMESTAMP
)
"""
insert_sql = "INSERT INTO test VALUES (?,?,?,?,?)"
cursor.execute(create_sql)
cursor.execute(insert_sql,
(
1,
r"""abc`~!@#$%^&*()_+-={}[]|\:;'"<>,.?/""",
"Hello World".encode("utf-8"),
date.today(),
datetime.now(),
)
)
select_sql = \
"""
SELECT
quote(_str), quote(_bytes), quote(_date), quote(_datetime)
FROM
test
"""
print(cursor.execute(select_sql).fetchone())
def test_usage(self):
"""QUOTE可以用来获得原生SQL表达式。
"""
cursor = self.cursor
print(cursor.execute("SELECT QUOTE(?)",
(r"""abc`~!@#$%^&*()_+-={}[]|\:;'"<>,.?/""", )).fetchone())
print(cursor.execute("SELECT QUOTE(?)",
("Hello World".encode("utf-8"), )).fetchone())
print(cursor.execute("SELECT QUOTE(?)",
(date.today(), )).fetchone())
print(cursor.execute("SELECT QUOTE(?)",
(datetime.now(), )).fetchone())
if __name__ == "__main__":
unittest.main() | {
"content_hash": "0e8b94c5d3cb16e88a3d6b80ced552f7",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 71,
"avg_line_length": 27.03076923076923,
"alnum_prop": 0.4632896983494593,
"repo_name": "MacHu-GWU/sqlite4dummy-project",
"id": "6a0a9698cbab91a25dcb4564f2fd0d4a756554ee",
"size": "1858",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sqlite4dummy/tests/sqlite3_in_python/func/test_quote.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "8001"
},
{
"name": "Makefile",
"bytes": "7442"
},
{
"name": "Python",
"bytes": "269635"
}
],
"symlink_target": ""
} |
namespace prefs {
// CookieControlsMode enum value that decides when the cookie controls UI is
// enabled. This will block third-party cookies similar to
// kBlockThirdPartyCookies but with a new UI.
const char kCookieControlsMode[] = "profile.cookie_controls_mode";
// Version of the pattern format used to define content settings.
const char kContentSettingsVersion[] = "profile.content_settings.pref_version";
// Integer that specifies the index of the tab the user was on when they
// last visited the content settings window.
const char kContentSettingsWindowLastTabIndex[] =
"content_settings_window.last_tab_index";
// Preferences that are exclusively used to store managed values for default
// content settings.
const char kManagedDefaultAdsSetting[] =
"profile.managed_default_content_settings.ads";
const char kManagedDefaultCookiesSetting[] =
"profile.managed_default_content_settings.cookies";
const char kManagedDefaultGeolocationSetting[] =
"profile.managed_default_content_settings.geolocation";
const char kManagedDefaultImagesSetting[] =
"profile.managed_default_content_settings.images";
const char kManagedDefaultInsecureContentSetting[] =
"profile.managed_default_content_settings.insecure_content";
const char kManagedDefaultJavaScriptSetting[] =
"profile.managed_default_content_settings.javascript";
const char kManagedDefaultNotificationsSetting[] =
"profile.managed_default_content_settings.notifications";
const char kManagedDefaultMediaStreamSetting[] =
"profile.managed_default_content_settings.media_stream";
const char kManagedDefaultPopupsSetting[] =
"profile.managed_default_content_settings.popups";
const char kManagedDefaultSensorsSetting[] =
"profile.managed_default_content_settings.sensors";
const char kManagedDefaultWebBluetoothGuardSetting[] =
"profile.managed_default_content_settings.web_bluetooth_guard";
const char kManagedDefaultWebUsbGuardSetting[] =
"profile.managed_default_content_settings.web_usb_guard";
const char kManagedDefaultFileHandlingGuardSetting[] =
"profile.managed_default_content_settings.file_handling_guard";
const char kManagedDefaultFileSystemReadGuardSetting[] =
"profile.managed_default_content_settings.file_system_read_guard";
const char kManagedDefaultFileSystemWriteGuardSetting[] =
"profile.managed_default_content_settings.file_system_write_guard";
const char kManagedDefaultSerialGuardSetting[] =
"profile.managed_default_content_settings.serial_guard";
const char kManagedDefaultInsecurePrivateNetworkSetting[] =
"profile.managed_default_content_settings.insecure_private_network";
const char kManagedDefaultJavaScriptJitSetting[] =
"profile.managed_default_content_settings.javascript_jit";
// Preferences that are exclusively used to store managed
// content settings patterns.
const char kManagedAutoSelectCertificateForUrls[] =
"profile.managed_auto_select_certificate_for_urls";
const char kManagedCookiesAllowedForUrls[] =
"profile.managed_cookies_allowed_for_urls";
const char kManagedCookiesBlockedForUrls[] =
"profile.managed_cookies_blocked_for_urls";
const char kManagedCookiesSessionOnlyForUrls[] =
"profile.managed_cookies_sessiononly_for_urls";
const char kManagedImagesAllowedForUrls[] =
"profile.managed_images_allowed_for_urls";
const char kManagedImagesBlockedForUrls[] =
"profile.managed_images_blocked_for_urls";
const char kManagedInsecureContentAllowedForUrls[] =
"profile.managed_insecure_content_allowed_for_urls";
const char kManagedInsecureContentBlockedForUrls[] =
"profile.managed_insecure_content_blocked_for_urls";
const char kManagedJavaScriptAllowedForUrls[] =
"profile.managed_javascript_allowed_for_urls";
const char kManagedJavaScriptBlockedForUrls[] =
"profile.managed_javascript_blocked_for_urls";
const char kManagedNotificationsAllowedForUrls[] =
"profile.managed_notifications_allowed_for_urls";
const char kManagedNotificationsBlockedForUrls[] =
"profile.managed_notifications_blocked_for_urls";
const char kManagedPopupsAllowedForUrls[] =
"profile.managed_popups_allowed_for_urls";
const char kManagedPopupsBlockedForUrls[] =
"profile.managed_popups_blocked_for_urls";
const char kManagedSensorsAllowedForUrls[] =
"profile.managed_sensors_allowed_for_urls";
const char kManagedSensorsBlockedForUrls[] =
"profile.managed_sensors_blocked_for_urls";
const char kManagedWebUsbAllowDevicesForUrls[] =
"profile.managed_web_usb_allow_devices_for_urls";
const char kManagedWebUsbAskForUrls[] = "profile.managed_web_usb_ask_for_urls";
const char kManagedWebUsbBlockedForUrls[] =
"profile.managed_web_usb_blocked_for_urls";
const char kManagedFileHandlingAllowedForUrls[] =
"profile.managed_file_handling_allowed_for_urls";
const char kManagedFileHandlingBlockedForUrls[] =
"profile.managed_file_handling_blocked_for_urls";
const char kManagedFileSystemReadAskForUrls[] =
"profile.managed_file_system_read_ask_for_urls";
const char kManagedFileSystemReadBlockedForUrls[] =
"profile.managed_file_system_read_blocked_for_urls";
const char kManagedFileSystemWriteAskForUrls[] =
"profile.managed_file_system_write_ask_for_urls";
const char kManagedFileSystemWriteBlockedForUrls[] =
"profile.managed_file_system_write_blocked_for_urls";
const char kManagedLegacyCookieAccessAllowedForDomains[] =
"profile.managed_legacy_cookie_access_allowed_for_domains";
const char kManagedSerialAskForUrls[] = "profile.managed_serial_ask_for_urls";
const char kManagedSerialBlockedForUrls[] =
"profile.managed_serial_blocked_for_urls";
const char kManagedInsecurePrivateNetworkAllowedForUrls[] =
"profile.managed_insecure_private_network_allowed_for_urls";
const char kManagedJavaScriptJitAllowedForSites[] =
"profile.managed_javascript_jit_allowed_for_sites";
const char kManagedJavaScriptJitBlockedForSites[] =
"profile.managed_javascript_jit_blocked_for_sites";
// Boolean indicating whether the quiet UI is enabled for notification
// permission requests.
const char kEnableQuietNotificationPermissionUi[] =
"profile.content_settings.enable_quiet_permission_ui.notifications";
// Enum indicating by which method the quiet UI has been enabled for
// notification permission requests. This is stored as of M88 and will be
// backfilled if the quiet UI is enabled but this preference has no value.
const char kQuietNotificationPermissionUiEnablingMethod[] =
"profile.content_settings.enable_quiet_permission_ui_enabling_method."
"notifications";
// Time value indicating when the quiet notification UI was last disabled by the
// user. Only permission action history after this point is taken into account
// for adaptive quiet UI activation.
const char kQuietNotificationPermissionUiDisabledTime[] =
"profile.content_settings.disable_quiet_permission_ui_time.notifications";
#if defined(OS_ANDROID)
// Enable vibration for web notifications.
const char kNotificationsVibrateEnabled[] = "notifications.vibrate_enabled";
#endif
} // namespace prefs
| {
"content_hash": "73a698c57672b00adcb416cab6919cc1",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 80,
"avg_line_length": 50.0709219858156,
"alnum_prop": 0.7997167138810198,
"repo_name": "ric2b/Vivaldi-browser",
"id": "07498435b25319c0d3311bc842905ef00bd10412",
"size": "7291",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chromium/components/content_settings/core/common/pref_names.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package org.maera.plugin.web.conditions;
import org.apache.commons.lang.exception.NestableException;
public class ConditionLoadingException extends NestableException {
public ConditionLoadingException() {
}
public ConditionLoadingException(String string) {
super(string);
}
public ConditionLoadingException(String string, Throwable throwable) {
super(string, throwable);
}
public ConditionLoadingException(Throwable throwable) {
super(throwable);
}
}
| {
"content_hash": "48f73f25adcac3cbc000c53fb31bccb7",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 74,
"avg_line_length": 25.6,
"alnum_prop": 0.732421875,
"repo_name": "majianxiong/maera",
"id": "4597516750ae85ae693f30914fae4336a44ed512",
"size": "512",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "webfragment/src/main/java/org/maera/plugin/web/conditions/ConditionLoadingException.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "2328532"
}
],
"symlink_target": ""
} |
package org.apache.camel.component.openshift.build_configs.springboot;
import javax.annotation.Generated;
import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* The Kubernetes Build Config component provides a producer to execute
* kubernetes build config operations.
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo")
@ConfigurationProperties(prefix = "camel.component.openshift-build-configs")
public class OpenshiftBuildConfigsComponentConfiguration
extends
ComponentConfigurationPropertiesCommon {
/**
* Whether to enable auto configuration of the openshift-build-configs
* component. This is enabled by default.
*/
private Boolean enabled;
/**
* Whether the component should resolve property placeholders on itself when
* starting. Only properties which are of String type can use property
* placeholders.
*/
private Boolean resolvePropertyPlaceholders = true;
/**
* Whether the component should use basic property binding (Camel 2.x) or
* the newer property binding with additional capabilities
*/
private Boolean basicPropertyBinding = false;
public Boolean getResolvePropertyPlaceholders() {
return resolvePropertyPlaceholders;
}
public void setResolvePropertyPlaceholders(
Boolean resolvePropertyPlaceholders) {
this.resolvePropertyPlaceholders = resolvePropertyPlaceholders;
}
public Boolean getBasicPropertyBinding() {
return basicPropertyBinding;
}
public void setBasicPropertyBinding(Boolean basicPropertyBinding) {
this.basicPropertyBinding = basicPropertyBinding;
}
} | {
"content_hash": "025f54511535c3a76dcd96259553b839",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 80,
"avg_line_length": 35.264150943396224,
"alnum_prop": 0.7517388978063135,
"repo_name": "Fabryprog/camel",
"id": "8e110981f9443da74701741287f2551abb8ca03e",
"size": "2671",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/openshift/build_configs/springboot/OpenshiftBuildConfigsComponentConfiguration.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Apex",
"bytes": "6521"
},
{
"name": "Batchfile",
"bytes": "2353"
},
{
"name": "CSS",
"bytes": "17204"
},
{
"name": "Elm",
"bytes": "10852"
},
{
"name": "FreeMarker",
"bytes": "8015"
},
{
"name": "Groovy",
"bytes": "14479"
},
{
"name": "HTML",
"bytes": "909437"
},
{
"name": "Java",
"bytes": "82182194"
},
{
"name": "JavaScript",
"bytes": "102432"
},
{
"name": "Makefile",
"bytes": "513"
},
{
"name": "Shell",
"bytes": "17240"
},
{
"name": "TSQL",
"bytes": "28835"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "Thrift",
"bytes": "6979"
},
{
"name": "XQuery",
"bytes": "546"
},
{
"name": "XSLT",
"bytes": "271473"
}
],
"symlink_target": ""
} |
#pragma once
#include <aws/kinesisanalytics/KinesisAnalytics_EXPORTS.h>
#include <aws/kinesisanalytics/model/ApplicationSummary.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace KinesisAnalytics
{
namespace Model
{
/**
* <p>TBD</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/CreateApplicationResponse">AWS
* API Reference</a></p>
*/
class AWS_KINESISANALYTICS_API CreateApplicationResult
{
public:
CreateApplicationResult();
CreateApplicationResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
CreateApplicationResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>In response to your <code>CreateApplication</code> request, Amazon Kinesis
* Analytics returns a response with a summary of the application it created,
* including the application Amazon Resource Name (ARN), name, and status.</p>
*/
inline const ApplicationSummary& GetApplicationSummary() const{ return m_applicationSummary; }
/**
* <p>In response to your <code>CreateApplication</code> request, Amazon Kinesis
* Analytics returns a response with a summary of the application it created,
* including the application Amazon Resource Name (ARN), name, and status.</p>
*/
inline void SetApplicationSummary(const ApplicationSummary& value) { m_applicationSummary = value; }
/**
* <p>In response to your <code>CreateApplication</code> request, Amazon Kinesis
* Analytics returns a response with a summary of the application it created,
* including the application Amazon Resource Name (ARN), name, and status.</p>
*/
inline void SetApplicationSummary(ApplicationSummary&& value) { m_applicationSummary = std::move(value); }
/**
* <p>In response to your <code>CreateApplication</code> request, Amazon Kinesis
* Analytics returns a response with a summary of the application it created,
* including the application Amazon Resource Name (ARN), name, and status.</p>
*/
inline CreateApplicationResult& WithApplicationSummary(const ApplicationSummary& value) { SetApplicationSummary(value); return *this;}
/**
* <p>In response to your <code>CreateApplication</code> request, Amazon Kinesis
* Analytics returns a response with a summary of the application it created,
* including the application Amazon Resource Name (ARN), name, and status.</p>
*/
inline CreateApplicationResult& WithApplicationSummary(ApplicationSummary&& value) { SetApplicationSummary(std::move(value)); return *this;}
private:
ApplicationSummary m_applicationSummary;
};
} // namespace Model
} // namespace KinesisAnalytics
} // namespace Aws
| {
"content_hash": "2ae0ae0a1bd91ae1e31cc26ea36bb628",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 144,
"avg_line_length": 37.34177215189873,
"alnum_prop": 0.727457627118644,
"repo_name": "jt70471/aws-sdk-cpp",
"id": "0ea5b86600eb4415bd185bf17ff1ef8d4eb91670",
"size": "3069",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-kinesisanalytics/include/aws/kinesisanalytics/model/CreateApplicationResult.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "13452"
},
{
"name": "C++",
"bytes": "278594037"
},
{
"name": "CMake",
"bytes": "653931"
},
{
"name": "Dockerfile",
"bytes": "5555"
},
{
"name": "HTML",
"bytes": "4471"
},
{
"name": "Java",
"bytes": "302182"
},
{
"name": "Python",
"bytes": "110380"
},
{
"name": "Shell",
"bytes": "4674"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="kernel.root_dir">C:/xampp18/htdocs/Symfony/app</parameter>
<parameter key="kernel.environment">dev</parameter>
<parameter key="kernel.debug">true</parameter>
<parameter key="kernel.name">app</parameter>
<parameter key="kernel.cache_dir">C:/xampp18/htdocs/Symfony/app/cache/dev</parameter>
<parameter key="kernel.logs_dir">C:/xampp18/htdocs/Symfony/app/logs</parameter>
<parameter key="kernel.bundles" type="collection">
<parameter key="FrameworkBundle">Symfony\Bundle\FrameworkBundle\FrameworkBundle</parameter>
<parameter key="SecurityBundle">Symfony\Bundle\SecurityBundle\SecurityBundle</parameter>
<parameter key="TwigBundle">Symfony\Bundle\TwigBundle\TwigBundle</parameter>
<parameter key="MonologBundle">Symfony\Bundle\MonologBundle\MonologBundle</parameter>
<parameter key="SwiftmailerBundle">Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle</parameter>
<parameter key="AsseticBundle">Symfony\Bundle\AsseticBundle\AsseticBundle</parameter>
<parameter key="DoctrineBundle">Doctrine\Bundle\DoctrineBundle\DoctrineBundle</parameter>
<parameter key="SensioFrameworkExtraBundle">Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle</parameter>
<parameter key="JMSAopBundle">JMS\AopBundle\JMSAopBundle</parameter>
<parameter key="JMSDiExtraBundle">JMS\DiExtraBundle\JMSDiExtraBundle</parameter>
<parameter key="JMSSecurityExtraBundle">JMS\SecurityExtraBundle\JMSSecurityExtraBundle</parameter>
<parameter key="miCalculadoracalcuBundle">miCalculadora\calcuBundle\miCalculadoracalcuBundle</parameter>
<parameter key="gestiongestionBundle">gestion\gestionBundle\gestiongestionBundle</parameter>
<parameter key="AcmeDemoBundle">Acme\DemoBundle\AcmeDemoBundle</parameter>
<parameter key="WebProfilerBundle">Symfony\Bundle\WebProfilerBundle\WebProfilerBundle</parameter>
<parameter key="SensioDistributionBundle">Sensio\Bundle\DistributionBundle\SensioDistributionBundle</parameter>
<parameter key="SensioGeneratorBundle">Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle</parameter>
</parameter>
<parameter key="kernel.charset">UTF-8</parameter>
<parameter key="kernel.container_class">appDevDebugProjectContainer</parameter>
<parameter key="database_driver">pdo_mysql</parameter>
<parameter key="database_host">127.0.0.1</parameter>
<parameter key="database_port">null</parameter>
<parameter key="database_name">symfony</parameter>
<parameter key="database_user">root</parameter>
<parameter key="database_password">null</parameter>
<parameter key="mailer_transport">smtp</parameter>
<parameter key="mailer_host">127.0.0.1</parameter>
<parameter key="mailer_user">null</parameter>
<parameter key="mailer_password">null</parameter>
<parameter key="locale">en</parameter>
<parameter key="secret">ThisTokenIsNotSoSecretChangeIt</parameter>
<parameter key="controller_resolver.class">Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver</parameter>
<parameter key="controller_name_converter.class">Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser</parameter>
<parameter key="response_listener.class">Symfony\Component\HttpKernel\EventListener\ResponseListener</parameter>
<parameter key="streamed_response_listener.class">Symfony\Component\HttpKernel\EventListener\StreamedResponseListener</parameter>
<parameter key="locale_listener.class">Symfony\Component\HttpKernel\EventListener\LocaleListener</parameter>
<parameter key="event_dispatcher.class">Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher</parameter>
<parameter key="http_kernel.class">Symfony\Bundle\FrameworkBundle\HttpKernel</parameter>
<parameter key="filesystem.class">Symfony\Component\Filesystem\Filesystem</parameter>
<parameter key="cache_warmer.class">Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate</parameter>
<parameter key="cache_clearer.class">Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer</parameter>
<parameter key="file_locator.class">Symfony\Component\HttpKernel\Config\FileLocator</parameter>
<parameter key="uri_signer.class">Symfony\Component\HttpKernel\UriSigner</parameter>
<parameter key="fragment.handler.class">Symfony\Component\HttpKernel\Fragment\FragmentHandler</parameter>
<parameter key="fragment.renderer.inline.class">Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer</parameter>
<parameter key="fragment.renderer.hinclude.class">Symfony\Bundle\FrameworkBundle\Fragment\ContainerAwareHIncludeFragmentRenderer</parameter>
<parameter key="fragment.renderer.hinclude.global_template">null</parameter>
<parameter key="fragment.path">/_fragment</parameter>
<parameter key="translator.class">Symfony\Bundle\FrameworkBundle\Translation\Translator</parameter>
<parameter key="translator.identity.class">Symfony\Component\Translation\IdentityTranslator</parameter>
<parameter key="translator.selector.class">Symfony\Component\Translation\MessageSelector</parameter>
<parameter key="translation.loader.php.class">Symfony\Component\Translation\Loader\PhpFileLoader</parameter>
<parameter key="translation.loader.yml.class">Symfony\Component\Translation\Loader\YamlFileLoader</parameter>
<parameter key="translation.loader.xliff.class">Symfony\Component\Translation\Loader\XliffFileLoader</parameter>
<parameter key="translation.loader.po.class">Symfony\Component\Translation\Loader\PoFileLoader</parameter>
<parameter key="translation.loader.mo.class">Symfony\Component\Translation\Loader\MoFileLoader</parameter>
<parameter key="translation.loader.qt.class">Symfony\Component\Translation\Loader\QtFileLoader</parameter>
<parameter key="translation.loader.csv.class">Symfony\Component\Translation\Loader\CsvFileLoader</parameter>
<parameter key="translation.loader.res.class">Symfony\Component\Translation\Loader\IcuResFileLoader</parameter>
<parameter key="translation.loader.dat.class">Symfony\Component\Translation\Loader\IcuDatFileLoader</parameter>
<parameter key="translation.loader.ini.class">Symfony\Component\Translation\Loader\IniFileLoader</parameter>
<parameter key="translation.dumper.php.class">Symfony\Component\Translation\Dumper\PhpFileDumper</parameter>
<parameter key="translation.dumper.xliff.class">Symfony\Component\Translation\Dumper\XliffFileDumper</parameter>
<parameter key="translation.dumper.po.class">Symfony\Component\Translation\Dumper\PoFileDumper</parameter>
<parameter key="translation.dumper.mo.class">Symfony\Component\Translation\Dumper\MoFileDumper</parameter>
<parameter key="translation.dumper.yml.class">Symfony\Component\Translation\Dumper\YamlFileDumper</parameter>
<parameter key="translation.dumper.qt.class">Symfony\Component\Translation\Dumper\QtFileDumper</parameter>
<parameter key="translation.dumper.csv.class">Symfony\Component\Translation\Dumper\CsvFileDumper</parameter>
<parameter key="translation.dumper.ini.class">Symfony\Component\Translation\Dumper\IniFileDumper</parameter>
<parameter key="translation.dumper.res.class">Symfony\Component\Translation\Dumper\IcuResFileDumper</parameter>
<parameter key="translation.extractor.php.class">Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor</parameter>
<parameter key="translation.loader.class">Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader</parameter>
<parameter key="translation.extractor.class">Symfony\Component\Translation\Extractor\ChainExtractor</parameter>
<parameter key="translation.writer.class">Symfony\Component\Translation\Writer\TranslationWriter</parameter>
<parameter key="debug.event_dispatcher.class">Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher</parameter>
<parameter key="debug.stopwatch.class">Symfony\Component\Stopwatch\Stopwatch</parameter>
<parameter key="debug.container.dump">C:/xampp18/htdocs/Symfony/app/cache/dev/appDevDebugProjectContainer.xml</parameter>
<parameter key="debug.controller_resolver.class">Symfony\Component\HttpKernel\Controller\TraceableControllerResolver</parameter>
<parameter key="debug.deprecation_logger_listener.class">Symfony\Component\HttpKernel\EventListener\DeprecationLoggerListener</parameter>
<parameter key="kernel.secret">ThisTokenIsNotSoSecretChangeIt</parameter>
<parameter key="kernel.trusted_proxies" type="collection"/>
<parameter key="kernel.trust_proxy_headers">false</parameter>
<parameter key="kernel.default_locale">en</parameter>
<parameter key="session.class">Symfony\Component\HttpFoundation\Session\Session</parameter>
<parameter key="session.flashbag.class">Symfony\Component\HttpFoundation\Session\Flash\FlashBag</parameter>
<parameter key="session.attribute_bag.class">Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag</parameter>
<parameter key="session.storage.native.class">Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage</parameter>
<parameter key="session.storage.mock_file.class">Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage</parameter>
<parameter key="session.handler.native_file.class">Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler</parameter>
<parameter key="session_listener.class">Symfony\Bundle\FrameworkBundle\EventListener\SessionListener</parameter>
<parameter key="session.storage.options" type="collection"/>
<parameter key="session.save_path">C:/xampp18/htdocs/Symfony/app/cache/dev/sessions</parameter>
<parameter key="form.resolved_type_factory.class">Symfony\Component\Form\ResolvedFormTypeFactory</parameter>
<parameter key="form.registry.class">Symfony\Component\Form\FormRegistry</parameter>
<parameter key="form.factory.class">Symfony\Component\Form\FormFactory</parameter>
<parameter key="form.extension.class">Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension</parameter>
<parameter key="form.type_guesser.validator.class">Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser</parameter>
<parameter key="property_accessor.class">Symfony\Component\PropertyAccess\PropertyAccessor</parameter>
<parameter key="form.csrf_provider.class">Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider</parameter>
<parameter key="form.type_extension.csrf.enabled">true</parameter>
<parameter key="form.type_extension.csrf.field_name">_token</parameter>
<parameter key="templating.engine.delegating.class">Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine</parameter>
<parameter key="templating.name_parser.class">Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser</parameter>
<parameter key="templating.filename_parser.class">Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser</parameter>
<parameter key="templating.cache_warmer.template_paths.class">Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer</parameter>
<parameter key="templating.locator.class">Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator</parameter>
<parameter key="templating.loader.filesystem.class">Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader</parameter>
<parameter key="templating.loader.cache.class">Symfony\Component\Templating\Loader\CacheLoader</parameter>
<parameter key="templating.loader.chain.class">Symfony\Component\Templating\Loader\ChainLoader</parameter>
<parameter key="templating.finder.class">Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder</parameter>
<parameter key="templating.engine.php.class">Symfony\Bundle\FrameworkBundle\Templating\PhpEngine</parameter>
<parameter key="templating.helper.slots.class">Symfony\Component\Templating\Helper\SlotsHelper</parameter>
<parameter key="templating.helper.assets.class">Symfony\Component\Templating\Helper\CoreAssetsHelper</parameter>
<parameter key="templating.helper.actions.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\ActionsHelper</parameter>
<parameter key="templating.helper.router.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper</parameter>
<parameter key="templating.helper.request.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\RequestHelper</parameter>
<parameter key="templating.helper.session.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper</parameter>
<parameter key="templating.helper.code.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper</parameter>
<parameter key="templating.helper.translator.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper</parameter>
<parameter key="templating.helper.form.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper</parameter>
<parameter key="templating.form.engine.class">Symfony\Component\Form\Extension\Templating\TemplatingRendererEngine</parameter>
<parameter key="templating.form.renderer.class">Symfony\Component\Form\FormRenderer</parameter>
<parameter key="templating.globals.class">Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables</parameter>
<parameter key="templating.asset.path_package.class">Symfony\Bundle\FrameworkBundle\Templating\Asset\PathPackage</parameter>
<parameter key="templating.asset.url_package.class">Symfony\Component\Templating\Asset\UrlPackage</parameter>
<parameter key="templating.asset.package_factory.class">Symfony\Bundle\FrameworkBundle\Templating\Asset\PackageFactory</parameter>
<parameter key="templating.helper.code.file_link_format">null</parameter>
<parameter key="templating.helper.form.resources" type="collection">
<parameter>FrameworkBundle:Form</parameter>
</parameter>
<parameter key="templating.debugger.class">Symfony\Bundle\FrameworkBundle\Templating\Debugger</parameter>
<parameter key="templating.loader.cache.path">null</parameter>
<parameter key="templating.engines" type="collection">
<parameter>twig</parameter>
</parameter>
<parameter key="validator.class">Symfony\Component\Validator\Validator</parameter>
<parameter key="validator.mapping.class_metadata_factory.class">Symfony\Component\Validator\Mapping\ClassMetadataFactory</parameter>
<parameter key="validator.mapping.cache.apc.class">Symfony\Component\Validator\Mapping\Cache\ApcCache</parameter>
<parameter key="validator.mapping.cache.prefix"></parameter>
<parameter key="validator.mapping.loader.loader_chain.class">Symfony\Component\Validator\Mapping\Loader\LoaderChain</parameter>
<parameter key="validator.mapping.loader.static_method_loader.class">Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader</parameter>
<parameter key="validator.mapping.loader.annotation_loader.class">Symfony\Component\Validator\Mapping\Loader\AnnotationLoader</parameter>
<parameter key="validator.mapping.loader.xml_files_loader.class">Symfony\Component\Validator\Mapping\Loader\XmlFilesLoader</parameter>
<parameter key="validator.mapping.loader.yaml_files_loader.class">Symfony\Component\Validator\Mapping\Loader\YamlFilesLoader</parameter>
<parameter key="validator.validator_factory.class">Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory</parameter>
<parameter key="validator.mapping.loader.xml_files_loader.mapping_files" type="collection">
<parameter>C:\xampp18\htdocs\Symfony\vendor\symfony\symfony\src\Symfony\Component\Form/Resources/config/validation.xml</parameter>
</parameter>
<parameter key="validator.mapping.loader.yaml_files_loader.mapping_files" type="collection"/>
<parameter key="validator.translation_domain">validators</parameter>
<parameter key="fragment.listener.class">Symfony\Component\HttpKernel\EventListener\FragmentListener</parameter>
<parameter key="profiler.class">Symfony\Component\HttpKernel\Profiler\Profiler</parameter>
<parameter key="profiler_listener.class">Symfony\Component\HttpKernel\EventListener\ProfilerListener</parameter>
<parameter key="data_collector.config.class">Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector</parameter>
<parameter key="data_collector.request.class">Symfony\Component\HttpKernel\DataCollector\RequestDataCollector</parameter>
<parameter key="data_collector.exception.class">Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector</parameter>
<parameter key="data_collector.events.class">Symfony\Component\HttpKernel\DataCollector\EventDataCollector</parameter>
<parameter key="data_collector.logger.class">Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector</parameter>
<parameter key="data_collector.time.class">Symfony\Component\HttpKernel\DataCollector\TimeDataCollector</parameter>
<parameter key="data_collector.memory.class">Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector</parameter>
<parameter key="data_collector.router.class">Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector</parameter>
<parameter key="profiler_listener.only_exceptions">false</parameter>
<parameter key="profiler_listener.only_master_requests">false</parameter>
<parameter key="profiler.storage.dsn">file:C:/xampp18/htdocs/Symfony/app/cache/dev/profiler</parameter>
<parameter key="profiler.storage.username"></parameter>
<parameter key="profiler.storage.password"></parameter>
<parameter key="profiler.storage.lifetime">86400</parameter>
<parameter key="router.class">Symfony\Bundle\FrameworkBundle\Routing\Router</parameter>
<parameter key="router.request_context.class">Symfony\Component\Routing\RequestContext</parameter>
<parameter key="routing.loader.class">Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader</parameter>
<parameter key="routing.resolver.class">Symfony\Component\Config\Loader\LoaderResolver</parameter>
<parameter key="routing.loader.xml.class">Symfony\Component\Routing\Loader\XmlFileLoader</parameter>
<parameter key="routing.loader.yml.class">Symfony\Component\Routing\Loader\YamlFileLoader</parameter>
<parameter key="routing.loader.php.class">Symfony\Component\Routing\Loader\PhpFileLoader</parameter>
<parameter key="router.options.generator_class">Symfony\Component\Routing\Generator\UrlGenerator</parameter>
<parameter key="router.options.generator_base_class">Symfony\Component\Routing\Generator\UrlGenerator</parameter>
<parameter key="router.options.generator_dumper_class">Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper</parameter>
<parameter key="router.options.matcher_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</parameter>
<parameter key="router.options.matcher_base_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</parameter>
<parameter key="router.options.matcher_dumper_class">Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper</parameter>
<parameter key="router.cache_warmer.class">Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer</parameter>
<parameter key="router.options.matcher.cache_class">appDevUrlMatcher</parameter>
<parameter key="router.options.generator.cache_class">appDevUrlGenerator</parameter>
<parameter key="router_listener.class">Symfony\Component\HttpKernel\EventListener\RouterListener</parameter>
<parameter key="router.request_context.host">localhost</parameter>
<parameter key="router.request_context.scheme">http</parameter>
<parameter key="router.request_context.base_url"></parameter>
<parameter key="router.resource">C:/xampp18/htdocs/Symfony/app/cache/dev/assetic/routing.yml</parameter>
<parameter key="router.cache_class_prefix">appDev</parameter>
<parameter key="request_listener.http_port">80</parameter>
<parameter key="request_listener.https_port">443</parameter>
<parameter key="annotations.reader.class">Doctrine\Common\Annotations\AnnotationReader</parameter>
<parameter key="annotations.cached_reader.class">Doctrine\Common\Annotations\CachedReader</parameter>
<parameter key="annotations.file_cache_reader.class">Doctrine\Common\Annotations\FileCacheReader</parameter>
<parameter key="security.context.class">Symfony\Component\Security\Core\SecurityContext</parameter>
<parameter key="security.user_checker.class">Symfony\Component\Security\Core\User\UserChecker</parameter>
<parameter key="security.encoder_factory.generic.class">Symfony\Component\Security\Core\Encoder\EncoderFactory</parameter>
<parameter key="security.encoder.digest.class">Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder</parameter>
<parameter key="security.encoder.plain.class">Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder</parameter>
<parameter key="security.encoder.pbkdf2.class">Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder</parameter>
<parameter key="security.encoder.bcrypt.class">Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder</parameter>
<parameter key="security.user.provider.in_memory.class">Symfony\Component\Security\Core\User\InMemoryUserProvider</parameter>
<parameter key="security.user.provider.in_memory.user.class">Symfony\Component\Security\Core\User\User</parameter>
<parameter key="security.user.provider.chain.class">Symfony\Component\Security\Core\User\ChainUserProvider</parameter>
<parameter key="security.authentication.trust_resolver.class">Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver</parameter>
<parameter key="security.authentication.trust_resolver.anonymous_class">Symfony\Component\Security\Core\Authentication\Token\AnonymousToken</parameter>
<parameter key="security.authentication.trust_resolver.rememberme_class">Symfony\Component\Security\Core\Authentication\Token\RememberMeToken</parameter>
<parameter key="security.authentication.manager.class">Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager</parameter>
<parameter key="security.authentication.session_strategy.class">Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy</parameter>
<parameter key="security.access.decision_manager.class">Symfony\Component\Security\Core\Authorization\AccessDecisionManager</parameter>
<parameter key="security.access.simple_role_voter.class">Symfony\Component\Security\Core\Authorization\Voter\RoleVoter</parameter>
<parameter key="security.access.authenticated_voter.class">Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter</parameter>
<parameter key="security.access.role_hierarchy_voter.class">Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter</parameter>
<parameter key="security.firewall.class">Symfony\Component\Security\Http\Firewall</parameter>
<parameter key="security.firewall.map.class">Symfony\Bundle\SecurityBundle\Security\FirewallMap</parameter>
<parameter key="security.firewall.context.class">Symfony\Bundle\SecurityBundle\Security\FirewallContext</parameter>
<parameter key="security.matcher.class">Symfony\Component\HttpFoundation\RequestMatcher</parameter>
<parameter key="security.role_hierarchy.class">Symfony\Component\Security\Core\Role\RoleHierarchy</parameter>
<parameter key="security.http_utils.class">Symfony\Component\Security\Http\HttpUtils</parameter>
<parameter key="security.validator.user_password.class">Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator</parameter>
<parameter key="security.authentication.retry_entry_point.class">Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint</parameter>
<parameter key="security.channel_listener.class">Symfony\Component\Security\Http\Firewall\ChannelListener</parameter>
<parameter key="security.authentication.form_entry_point.class">Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint</parameter>
<parameter key="security.authentication.listener.form.class">Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener</parameter>
<parameter key="security.authentication.listener.basic.class">Symfony\Component\Security\Http\Firewall\BasicAuthenticationListener</parameter>
<parameter key="security.authentication.basic_entry_point.class">Symfony\Component\Security\Http\EntryPoint\BasicAuthenticationEntryPoint</parameter>
<parameter key="security.authentication.listener.digest.class">Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener</parameter>
<parameter key="security.authentication.digest_entry_point.class">Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint</parameter>
<parameter key="security.authentication.listener.x509.class">Symfony\Component\Security\Http\Firewall\X509AuthenticationListener</parameter>
<parameter key="security.authentication.listener.anonymous.class">Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener</parameter>
<parameter key="security.authentication.switchuser_listener.class">Symfony\Component\Security\Http\Firewall\SwitchUserListener</parameter>
<parameter key="security.logout_listener.class">Symfony\Component\Security\Http\Firewall\LogoutListener</parameter>
<parameter key="security.logout.handler.session.class">Symfony\Component\Security\Http\Logout\SessionLogoutHandler</parameter>
<parameter key="security.logout.handler.cookie_clearing.class">Symfony\Component\Security\Http\Logout\CookieClearingLogoutHandler</parameter>
<parameter key="security.logout.success_handler.class">Symfony\Component\Security\Http\Logout\DefaultLogoutSuccessHandler</parameter>
<parameter key="security.access_listener.class">Symfony\Component\Security\Http\Firewall\AccessListener</parameter>
<parameter key="security.access_map.class">Symfony\Component\Security\Http\AccessMap</parameter>
<parameter key="security.exception_listener.class">Symfony\Component\Security\Http\Firewall\ExceptionListener</parameter>
<parameter key="security.context_listener.class">Symfony\Component\Security\Http\Firewall\ContextListener</parameter>
<parameter key="security.authentication.provider.dao.class">Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider</parameter>
<parameter key="security.authentication.provider.pre_authenticated.class">Symfony\Component\Security\Core\Authentication\Provider\PreAuthenticatedAuthenticationProvider</parameter>
<parameter key="security.authentication.provider.anonymous.class">Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider</parameter>
<parameter key="security.authentication.success_handler.class">Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler</parameter>
<parameter key="security.authentication.failure_handler.class">Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler</parameter>
<parameter key="security.authentication.provider.rememberme.class">Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider</parameter>
<parameter key="security.authentication.listener.rememberme.class">Symfony\Component\Security\Http\Firewall\RememberMeListener</parameter>
<parameter key="security.rememberme.token.provider.in_memory.class">Symfony\Component\Security\Core\Authentication\RememberMe\InMemoryTokenProvider</parameter>
<parameter key="security.authentication.rememberme.services.persistent.class">Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices</parameter>
<parameter key="security.authentication.rememberme.services.simplehash.class">Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices</parameter>
<parameter key="security.rememberme.response_listener.class">Symfony\Component\Security\Http\RememberMe\ResponseListener</parameter>
<parameter key="templating.helper.logout_url.class">Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper</parameter>
<parameter key="templating.helper.security.class">Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper</parameter>
<parameter key="twig.extension.logout_url.class">Symfony\Bundle\SecurityBundle\Twig\Extension\LogoutUrlExtension</parameter>
<parameter key="twig.extension.security.class">Symfony\Bridge\Twig\Extension\SecurityExtension</parameter>
<parameter key="data_collector.security.class">Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector</parameter>
<parameter key="security.access.denied_url">null</parameter>
<parameter key="security.authentication.manager.erase_credentials">true</parameter>
<parameter key="security.authentication.session_strategy.strategy">migrate</parameter>
<parameter key="security.access.always_authenticate_before_granting">false</parameter>
<parameter key="security.authentication.hide_user_not_found">true</parameter>
<parameter key="security.role_hierarchy.roles" type="collection">
<parameter key="ROLE_ADMIN" type="collection">
<parameter>ROLE_USER</parameter>
</parameter>
<parameter key="ROLE_SUPER_ADMIN" type="collection">
<parameter>ROLE_USER</parameter>
<parameter>ROLE_ADMIN</parameter>
<parameter>ROLE_ALLOWED_TO_SWITCH</parameter>
</parameter>
</parameter>
<parameter key="twig.class">Twig_Environment</parameter>
<parameter key="twig.loader.filesystem.class">Symfony\Bundle\TwigBundle\Loader\FilesystemLoader</parameter>
<parameter key="twig.loader.chain.class">Twig_Loader_Chain</parameter>
<parameter key="templating.engine.twig.class">Symfony\Bundle\TwigBundle\TwigEngine</parameter>
<parameter key="twig.cache_warmer.class">Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer</parameter>
<parameter key="twig.extension.trans.class">Symfony\Bridge\Twig\Extension\TranslationExtension</parameter>
<parameter key="twig.extension.assets.class">Symfony\Bundle\TwigBundle\Extension\AssetsExtension</parameter>
<parameter key="twig.extension.actions.class">Symfony\Bundle\TwigBundle\Extension\ActionsExtension</parameter>
<parameter key="twig.extension.code.class">Symfony\Bridge\Twig\Extension\CodeExtension</parameter>
<parameter key="twig.extension.routing.class">Symfony\Bridge\Twig\Extension\RoutingExtension</parameter>
<parameter key="twig.extension.yaml.class">Symfony\Bridge\Twig\Extension\YamlExtension</parameter>
<parameter key="twig.extension.form.class">Symfony\Bridge\Twig\Extension\FormExtension</parameter>
<parameter key="twig.extension.httpkernel.class">Symfony\Bridge\Twig\Extension\HttpKernelExtension</parameter>
<parameter key="twig.form.engine.class">Symfony\Bridge\Twig\Form\TwigRendererEngine</parameter>
<parameter key="twig.form.renderer.class">Symfony\Bridge\Twig\Form\TwigRenderer</parameter>
<parameter key="twig.translation.extractor.class">Symfony\Bridge\Twig\Translation\TwigExtractor</parameter>
<parameter key="twig.exception_listener.class">Symfony\Component\HttpKernel\EventListener\ExceptionListener</parameter>
<parameter key="twig.controller.exception.class">Symfony\Bundle\TwigBundle\Controller\ExceptionController</parameter>
<parameter key="twig.exception_listener.controller">twig.controller.exception:showAction</parameter>
<parameter key="twig.form.resources" type="collection">
<parameter>form_div_layout.html.twig</parameter>
</parameter>
<parameter key="twig.options" type="collection">
<parameter key="debug">true</parameter>
<parameter key="strict_variables">true</parameter>
<parameter key="exception_controller">twig.controller.exception:showAction</parameter>
<parameter key="cache">C:/xampp18/htdocs/Symfony/app/cache/dev/twig</parameter>
<parameter key="charset">UTF-8</parameter>
<parameter key="paths" type="collection"/>
</parameter>
<parameter key="debug.templating.engine.twig.class">Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine</parameter>
<parameter key="monolog.logger.class">Symfony\Bridge\Monolog\Logger</parameter>
<parameter key="monolog.gelf.publisher.class">Gelf\MessagePublisher</parameter>
<parameter key="monolog.handler.stream.class">Monolog\Handler\StreamHandler</parameter>
<parameter key="monolog.handler.group.class">Monolog\Handler\GroupHandler</parameter>
<parameter key="monolog.handler.buffer.class">Monolog\Handler\BufferHandler</parameter>
<parameter key="monolog.handler.rotating_file.class">Monolog\Handler\RotatingFileHandler</parameter>
<parameter key="monolog.handler.syslog.class">Monolog\Handler\SyslogHandler</parameter>
<parameter key="monolog.handler.null.class">Monolog\Handler\NullHandler</parameter>
<parameter key="monolog.handler.test.class">Monolog\Handler\TestHandler</parameter>
<parameter key="monolog.handler.gelf.class">Monolog\Handler\GelfHandler</parameter>
<parameter key="monolog.handler.firephp.class">Symfony\Bridge\Monolog\Handler\FirePHPHandler</parameter>
<parameter key="monolog.handler.chromephp.class">Symfony\Bridge\Monolog\Handler\ChromePhpHandler</parameter>
<parameter key="monolog.handler.debug.class">Symfony\Bridge\Monolog\Handler\DebugHandler</parameter>
<parameter key="monolog.handler.swift_mailer.class">Monolog\Handler\SwiftMailerHandler</parameter>
<parameter key="monolog.handler.native_mailer.class">Monolog\Handler\NativeMailerHandler</parameter>
<parameter key="monolog.handler.socket.class">Monolog\Handler\SocketHandler</parameter>
<parameter key="monolog.handler.pushover.class">Monolog\Handler\PushoverHandler</parameter>
<parameter key="monolog.handler.fingers_crossed.class">Monolog\Handler\FingersCrossedHandler</parameter>
<parameter key="monolog.handler.fingers_crossed.error_level_activation_strategy.class">Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy</parameter>
<parameter key="monolog.handlers_to_channels" type="collection">
<parameter key="monolog.handler.chromephp">null</parameter>
<parameter key="monolog.handler.firephp">null</parameter>
<parameter key="monolog.handler.main">null</parameter>
</parameter>
<parameter key="swiftmailer.class">Swift_Mailer</parameter>
<parameter key="swiftmailer.transport.sendmail.class">Swift_Transport_SendmailTransport</parameter>
<parameter key="swiftmailer.transport.mail.class">Swift_Transport_MailTransport</parameter>
<parameter key="swiftmailer.transport.failover.class">Swift_Transport_FailoverTransport</parameter>
<parameter key="swiftmailer.plugin.redirecting.class">Swift_Plugins_RedirectingPlugin</parameter>
<parameter key="swiftmailer.plugin.impersonate.class">Swift_Plugins_ImpersonatePlugin</parameter>
<parameter key="swiftmailer.plugin.messagelogger.class">Swift_Plugins_MessageLogger</parameter>
<parameter key="swiftmailer.plugin.antiflood.class">Swift_Plugins_AntiFloodPlugin</parameter>
<parameter key="swiftmailer.plugin.antiflood.threshold">99</parameter>
<parameter key="swiftmailer.plugin.antiflood.sleep">0</parameter>
<parameter key="swiftmailer.data_collector.class">Symfony\Bridge\Swiftmailer\DataCollector\MessageDataCollector</parameter>
<parameter key="swiftmailer.transport.smtp.class">Swift_Transport_EsmtpTransport</parameter>
<parameter key="swiftmailer.transport.smtp.encryption">null</parameter>
<parameter key="swiftmailer.transport.smtp.port">25</parameter>
<parameter key="swiftmailer.transport.smtp.host">127.0.0.1</parameter>
<parameter key="swiftmailer.transport.smtp.username">null</parameter>
<parameter key="swiftmailer.transport.smtp.password">null</parameter>
<parameter key="swiftmailer.transport.smtp.auth_mode">null</parameter>
<parameter key="swiftmailer.transport.smtp.timeout">30</parameter>
<parameter key="swiftmailer.transport.smtp.source_ip">null</parameter>
<parameter key="swiftmailer.plugin.blackhole.class">Swift_Plugins_BlackholePlugin</parameter>
<parameter key="swiftmailer.spool.memory.class">Swift_MemorySpool</parameter>
<parameter key="swiftmailer.email_sender.listener.class">Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener</parameter>
<parameter key="swiftmailer.spool.memory.path">C:/xampp18/htdocs/Symfony/app/cache/dev/swiftmailer/spool</parameter>
<parameter key="swiftmailer.spool.enabled">true</parameter>
<parameter key="swiftmailer.sender_address">null</parameter>
<parameter key="swiftmailer.single_address">null</parameter>
<parameter key="swiftmailer.delivery_whitelist" type="collection"/>
<parameter key="assetic.asset_factory.class">Symfony\Bundle\AsseticBundle\Factory\AssetFactory</parameter>
<parameter key="assetic.asset_manager.class">Assetic\Factory\LazyAssetManager</parameter>
<parameter key="assetic.asset_manager_cache_warmer.class">Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer</parameter>
<parameter key="assetic.cached_formula_loader.class">Assetic\Factory\Loader\CachedFormulaLoader</parameter>
<parameter key="assetic.config_cache.class">Assetic\Cache\ConfigCache</parameter>
<parameter key="assetic.config_loader.class">Symfony\Bundle\AsseticBundle\Factory\Loader\ConfigurationLoader</parameter>
<parameter key="assetic.config_resource.class">Symfony\Bundle\AsseticBundle\Factory\Resource\ConfigurationResource</parameter>
<parameter key="assetic.coalescing_directory_resource.class">Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource</parameter>
<parameter key="assetic.directory_resource.class">Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource</parameter>
<parameter key="assetic.filter_manager.class">Symfony\Bundle\AsseticBundle\FilterManager</parameter>
<parameter key="assetic.worker.ensure_filter.class">Assetic\Factory\Worker\EnsureFilterWorker</parameter>
<parameter key="assetic.value_supplier.class">Symfony\Bundle\AsseticBundle\DefaultValueSupplier</parameter>
<parameter key="assetic.node.paths" type="collection"/>
<parameter key="assetic.cache_dir">C:/xampp18/htdocs/Symfony/app/cache/dev/assetic</parameter>
<parameter key="assetic.bundles" type="collection"/>
<parameter key="assetic.twig_extension.class">Symfony\Bundle\AsseticBundle\Twig\AsseticExtension</parameter>
<parameter key="assetic.twig_formula_loader.class">Assetic\Extension\Twig\TwigFormulaLoader</parameter>
<parameter key="assetic.helper.dynamic.class">Symfony\Bundle\AsseticBundle\Templating\DynamicAsseticHelper</parameter>
<parameter key="assetic.helper.static.class">Symfony\Bundle\AsseticBundle\Templating\StaticAsseticHelper</parameter>
<parameter key="assetic.php_formula_loader.class">Symfony\Bundle\AsseticBundle\Factory\Loader\AsseticHelperFormulaLoader</parameter>
<parameter key="assetic.debug">true</parameter>
<parameter key="assetic.use_controller">true</parameter>
<parameter key="assetic.enable_profiler">false</parameter>
<parameter key="assetic.read_from">C:/xampp18/htdocs/Symfony/app/../web</parameter>
<parameter key="assetic.write_to">C:/xampp18/htdocs/Symfony/app/../web</parameter>
<parameter key="assetic.variables" type="collection"/>
<parameter key="assetic.java.bin">C:\windows\system32\java.EXE</parameter>
<parameter key="assetic.node.bin">/usr/bin/node</parameter>
<parameter key="assetic.ruby.bin">/usr/bin/ruby</parameter>
<parameter key="assetic.sass.bin">/usr/bin/sass</parameter>
<parameter key="assetic.filter.cssrewrite.class">Assetic\Filter\CssRewriteFilter</parameter>
<parameter key="assetic.twig_extension.functions" type="collection"/>
<parameter key="assetic.controller.class">Symfony\Bundle\AsseticBundle\Controller\AsseticController</parameter>
<parameter key="assetic.routing_loader.class">Symfony\Bundle\AsseticBundle\Routing\AsseticLoader</parameter>
<parameter key="assetic.cache.class">Assetic\Cache\FilesystemCache</parameter>
<parameter key="assetic.use_controller_worker.class">Symfony\Bundle\AsseticBundle\Factory\Worker\UseControllerWorker</parameter>
<parameter key="assetic.request_listener.class">Symfony\Bundle\AsseticBundle\EventListener\RequestListener</parameter>
<parameter key="doctrine.dbal.logger.chain.class">Doctrine\DBAL\Logging\LoggerChain</parameter>
<parameter key="doctrine.dbal.logger.profiling.class">Doctrine\DBAL\Logging\DebugStack</parameter>
<parameter key="doctrine.dbal.logger.class">Symfony\Bridge\Doctrine\Logger\DbalLogger</parameter>
<parameter key="doctrine.dbal.configuration.class">Doctrine\DBAL\Configuration</parameter>
<parameter key="doctrine.data_collector.class">Doctrine\Bundle\DoctrineBundle\DataCollector\DoctrineDataCollector</parameter>
<parameter key="doctrine.dbal.connection.event_manager.class">Symfony\Bridge\Doctrine\ContainerAwareEventManager</parameter>
<parameter key="doctrine.dbal.connection_factory.class">Doctrine\Bundle\DoctrineBundle\ConnectionFactory</parameter>
<parameter key="doctrine.dbal.events.mysql_session_init.class">Doctrine\DBAL\Event\Listeners\MysqlSessionInit</parameter>
<parameter key="doctrine.dbal.events.oracle_session_init.class">Doctrine\DBAL\Event\Listeners\OracleSessionInit</parameter>
<parameter key="doctrine.class">Doctrine\Bundle\DoctrineBundle\Registry</parameter>
<parameter key="doctrine.entity_managers" type="collection">
<parameter key="default">doctrine.orm.default_entity_manager</parameter>
</parameter>
<parameter key="doctrine.default_entity_manager">default</parameter>
<parameter key="doctrine.dbal.connection_factory.types" type="collection"/>
<parameter key="doctrine.connections" type="collection">
<parameter key="default">doctrine.dbal.default_connection</parameter>
</parameter>
<parameter key="doctrine.default_connection">default</parameter>
<parameter key="doctrine.orm.configuration.class">Doctrine\ORM\Configuration</parameter>
<parameter key="doctrine.orm.entity_manager.class">Doctrine\ORM\EntityManager</parameter>
<parameter key="doctrine.orm.manager_configurator.class">Doctrine\Bundle\DoctrineBundle\ManagerConfigurator</parameter>
<parameter key="doctrine.orm.cache.array.class">Doctrine\Common\Cache\ArrayCache</parameter>
<parameter key="doctrine.orm.cache.apc.class">Doctrine\Common\Cache\ApcCache</parameter>
<parameter key="doctrine.orm.cache.memcache.class">Doctrine\Common\Cache\MemcacheCache</parameter>
<parameter key="doctrine.orm.cache.memcache_host">localhost</parameter>
<parameter key="doctrine.orm.cache.memcache_port">11211</parameter>
<parameter key="doctrine.orm.cache.memcache_instance.class">Memcache</parameter>
<parameter key="doctrine.orm.cache.memcached.class">Doctrine\Common\Cache\MemcachedCache</parameter>
<parameter key="doctrine.orm.cache.memcached_host">localhost</parameter>
<parameter key="doctrine.orm.cache.memcached_port">11211</parameter>
<parameter key="doctrine.orm.cache.memcached_instance.class">Memcached</parameter>
<parameter key="doctrine.orm.cache.redis.class">Doctrine\Common\Cache\RedisCache</parameter>
<parameter key="doctrine.orm.cache.redis_host">localhost</parameter>
<parameter key="doctrine.orm.cache.redis_port">6379</parameter>
<parameter key="doctrine.orm.cache.redis_instance.class">Redis</parameter>
<parameter key="doctrine.orm.cache.xcache.class">Doctrine\Common\Cache\XcacheCache</parameter>
<parameter key="doctrine.orm.cache.wincache.class">Doctrine\Common\Cache\WinCacheCache</parameter>
<parameter key="doctrine.orm.cache.zenddata.class">Doctrine\Common\Cache\ZendDataCache</parameter>
<parameter key="doctrine.orm.metadata.driver_chain.class">Doctrine\ORM\Mapping\Driver\DriverChain</parameter>
<parameter key="doctrine.orm.metadata.annotation.class">Doctrine\ORM\Mapping\Driver\AnnotationDriver</parameter>
<parameter key="doctrine.orm.metadata.xml.class">Doctrine\ORM\Mapping\Driver\SimplifiedXmlDriver</parameter>
<parameter key="doctrine.orm.metadata.yml.class">Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver</parameter>
<parameter key="doctrine.orm.metadata.php.class">Doctrine\ORM\Mapping\Driver\PHPDriver</parameter>
<parameter key="doctrine.orm.metadata.staticphp.class">Doctrine\ORM\Mapping\Driver\StaticPHPDriver</parameter>
<parameter key="doctrine.orm.proxy_cache_warmer.class">Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer</parameter>
<parameter key="form.type_guesser.doctrine.class">Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser</parameter>
<parameter key="doctrine.orm.validator.unique.class">Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator</parameter>
<parameter key="doctrine.orm.validator_initializer.class">Symfony\Bridge\Doctrine\Validator\DoctrineInitializer</parameter>
<parameter key="doctrine.orm.security.user.provider.class">Symfony\Bridge\Doctrine\Security\User\EntityUserProvider</parameter>
<parameter key="doctrine.orm.listeners.resolve_target_entity.class">Doctrine\ORM\Tools\ResolveTargetEntityListener</parameter>
<parameter key="doctrine.orm.naming_strategy.default.class">Doctrine\ORM\Mapping\DefaultNamingStrategy</parameter>
<parameter key="doctrine.orm.naming_strategy.underscore.class">Doctrine\ORM\Mapping\UnderscoreNamingStrategy</parameter>
<parameter key="doctrine.orm.auto_generate_proxy_classes">true</parameter>
<parameter key="doctrine.orm.proxy_dir">C:/xampp18/htdocs/Symfony/app/cache/dev/doctrine/orm/Proxies</parameter>
<parameter key="doctrine.orm.proxy_namespace">Proxies</parameter>
<parameter key="sensio_framework_extra.view.guesser.class">Sensio\Bundle\FrameworkExtraBundle\Templating\TemplateGuesser</parameter>
<parameter key="sensio_framework_extra.controller.listener.class">Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener</parameter>
<parameter key="sensio_framework_extra.routing.loader.annot_dir.class">Symfony\Component\Routing\Loader\AnnotationDirectoryLoader</parameter>
<parameter key="sensio_framework_extra.routing.loader.annot_file.class">Symfony\Component\Routing\Loader\AnnotationFileLoader</parameter>
<parameter key="sensio_framework_extra.routing.loader.annot_class.class">Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader</parameter>
<parameter key="sensio_framework_extra.converter.listener.class">Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener</parameter>
<parameter key="sensio_framework_extra.converter.manager.class">Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager</parameter>
<parameter key="sensio_framework_extra.converter.doctrine.class">Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter</parameter>
<parameter key="sensio_framework_extra.converter.datetime.class">Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter</parameter>
<parameter key="sensio_framework_extra.view.listener.class">Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener</parameter>
<parameter key="jms_aop.cache_dir">C:/xampp18/htdocs/Symfony/app/cache/dev/jms_aop</parameter>
<parameter key="jms_aop.interceptor_loader.class">JMS\AopBundle\Aop\InterceptorLoader</parameter>
<parameter key="jms_di_extra.metadata.driver.annotation_driver.class">JMS\DiExtraBundle\Metadata\Driver\AnnotationDriver</parameter>
<parameter key="jms_di_extra.metadata.driver.configured_controller_injections.class">JMS\DiExtraBundle\Metadata\Driver\ConfiguredControllerInjectionsDriver</parameter>
<parameter key="jms_di_extra.metadata.driver.lazy_loading_driver.class">Metadata\Driver\LazyLoadingDriver</parameter>
<parameter key="jms_di_extra.metadata.metadata_factory.class">Metadata\MetadataFactory</parameter>
<parameter key="jms_di_extra.metadata.cache.file_cache.class">Metadata\Cache\FileCache</parameter>
<parameter key="jms_di_extra.metadata.converter.class">JMS\DiExtraBundle\Metadata\MetadataConverter</parameter>
<parameter key="jms_di_extra.controller_resolver.class">JMS\DiExtraBundle\HttpKernel\ControllerResolver</parameter>
<parameter key="jms_di_extra.controller_injectors_warmer.class">JMS\DiExtraBundle\HttpKernel\ControllerInjectorsWarmer</parameter>
<parameter key="jms_di_extra.all_bundles">false</parameter>
<parameter key="jms_di_extra.bundles" type="collection"/>
<parameter key="jms_di_extra.directories" type="collection"/>
<parameter key="jms_di_extra.cache_dir">C:/xampp18/htdocs/Symfony/app/cache/dev/jms_diextra</parameter>
<parameter key="jms_di_extra.disable_grep">false</parameter>
<parameter key="jms_di_extra.doctrine_integration">true</parameter>
<parameter key="jms_di_extra.cache_warmer.controller_file_blacklist" type="collection"/>
<parameter key="jms_di_extra.doctrine_integration.entity_manager.file">C:/xampp18/htdocs/Symfony/app/cache/dev/jms_diextra/doctrine/EntityManager_51a54ae0f0b4e.php</parameter>
<parameter key="jms_di_extra.doctrine_integration.entity_manager.class">EntityManager51a54ae0f0b4e_546a8d27f194334ee012bfe64f629947b07e4919\__CG__\Doctrine\ORM\EntityManager</parameter>
<parameter key="security.secured_services" type="collection"/>
<parameter key="security.access.method_interceptor.class">JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor</parameter>
<parameter key="security.access.method_access_control" type="collection"/>
<parameter key="security.access.remembering_access_decision_manager.class">JMS\SecurityExtraBundle\Security\Authorization\RememberingAccessDecisionManager</parameter>
<parameter key="security.access.run_as_manager.class">JMS\SecurityExtraBundle\Security\Authorization\RunAsManager</parameter>
<parameter key="security.authentication.provider.run_as.class">JMS\SecurityExtraBundle\Security\Authentication\Provider\RunAsAuthenticationProvider</parameter>
<parameter key="security.run_as.key">RunAsToken</parameter>
<parameter key="security.run_as.role_prefix">ROLE_</parameter>
<parameter key="security.access.after_invocation_manager.class">JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager</parameter>
<parameter key="security.access.after_invocation.acl_provider.class">JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AclAfterInvocationProvider</parameter>
<parameter key="security.access.iddqd_voter.class">JMS\SecurityExtraBundle\Security\Authorization\Voter\IddqdVoter</parameter>
<parameter key="security.extra.metadata_factory.class">Metadata\MetadataFactory</parameter>
<parameter key="security.extra.lazy_loading_driver.class">Metadata\Driver\LazyLoadingDriver</parameter>
<parameter key="security.extra.driver_chain.class">Metadata\Driver\DriverChain</parameter>
<parameter key="security.extra.annotation_driver.class">JMS\SecurityExtraBundle\Metadata\Driver\AnnotationDriver</parameter>
<parameter key="security.extra.file_cache.class">Metadata\Cache\FileCache</parameter>
<parameter key="security.access.secure_all_services">false</parameter>
<parameter key="security.extra.cache_dir">C:/xampp18/htdocs/Symfony/app/cache/dev/jms_security</parameter>
<parameter key="security.acl.permission_evaluator.class">JMS\SecurityExtraBundle\Security\Acl\Expression\PermissionEvaluator</parameter>
<parameter key="security.acl.has_permission_compiler.class">JMS\SecurityExtraBundle\Security\Acl\Expression\HasPermissionFunctionCompiler</parameter>
<parameter key="security.expressions.voter.class">JMS\SecurityExtraBundle\Security\Authorization\Expression\LazyLoadingExpressionVoter</parameter>
<parameter key="security.expressions.handler.class">JMS\SecurityExtraBundle\Security\Authorization\Expression\ContainerAwareExpressionHandler</parameter>
<parameter key="security.expressions.compiler.class">JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler</parameter>
<parameter key="security.expressions.expression.class">JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression</parameter>
<parameter key="security.expressions.variable_compiler.class">JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\ContainerAwareVariableCompiler</parameter>
<parameter key="security.expressions.parameter_compiler.class">JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\ParameterExpressionCompiler</parameter>
<parameter key="security.expressions.reverse_interpreter.class">JMS\SecurityExtraBundle\Security\Authorization\Expression\ReverseInterpreter</parameter>
<parameter key="security.extra.config_driver.class">JMS\SecurityExtraBundle\Metadata\Driver\ConfigDriver</parameter>
<parameter key="security.extra.twig_extension.class">JMS\SecurityExtraBundle\Twig\SecurityExtension</parameter>
<parameter key="security.authenticated_voter.disabled">false</parameter>
<parameter key="security.role_voter.disabled">false</parameter>
<parameter key="security.acl_voter.disabled">false</parameter>
<parameter key="security.extra.iddqd_ignore_roles" type="collection">
<parameter>ROLE_PREVIOUS_ADMIN</parameter>
</parameter>
<parameter key="security.iddqd_aliases" type="collection"/>
<parameter key="web_profiler.controller.profiler.class">Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController</parameter>
<parameter key="web_profiler.controller.router.class">Symfony\Bundle\WebProfilerBundle\Controller\RouterController</parameter>
<parameter key="web_profiler.controller.exception.class">Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController</parameter>
<parameter key="web_profiler.debug_toolbar.class">Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener</parameter>
<parameter key="web_profiler.debug_toolbar.intercept_redirects">false</parameter>
<parameter key="web_profiler.debug_toolbar.mode">2</parameter>
<parameter key="web_profiler.debug_toolbar.position">bottom</parameter>
<parameter key="sensio.distribution.webconfigurator.class">Sensio\Bundle\DistributionBundle\Configurator\Configurator</parameter>
<parameter key="data_collector.templates" type="collection">
<parameter key="data_collector.config" type="collection">
<parameter>config</parameter>
<parameter>@WebProfiler/Collector/config.html.twig</parameter>
</parameter>
<parameter key="data_collector.request" type="collection">
<parameter>request</parameter>
<parameter>@WebProfiler/Collector/request.html.twig</parameter>
</parameter>
<parameter key="data_collector.exception" type="collection">
<parameter>exception</parameter>
<parameter>@WebProfiler/Collector/exception.html.twig</parameter>
</parameter>
<parameter key="data_collector.events" type="collection">
<parameter>events</parameter>
<parameter>@WebProfiler/Collector/events.html.twig</parameter>
</parameter>
<parameter key="data_collector.logger" type="collection">
<parameter>logger</parameter>
<parameter>@WebProfiler/Collector/logger.html.twig</parameter>
</parameter>
<parameter key="data_collector.time" type="collection">
<parameter>time</parameter>
<parameter>@WebProfiler/Collector/time.html.twig</parameter>
</parameter>
<parameter key="data_collector.memory" type="collection">
<parameter>memory</parameter>
<parameter>@WebProfiler/Collector/memory.html.twig</parameter>
</parameter>
<parameter key="data_collector.router" type="collection">
<parameter>router</parameter>
<parameter>@WebProfiler/Collector/router.html.twig</parameter>
</parameter>
<parameter key="data_collector.security" type="collection">
<parameter>security</parameter>
<parameter>SecurityBundle:Collector:security</parameter>
</parameter>
<parameter key="swiftmailer.data_collector" type="collection">
<parameter>swiftmailer</parameter>
<parameter>SwiftmailerBundle:Collector:swiftmailer</parameter>
</parameter>
<parameter key="data_collector.doctrine" type="collection">
<parameter>db</parameter>
<parameter>DoctrineBundle:Collector:db</parameter>
</parameter>
</parameter>
</parameters>
<services>
<service id="controller_name_converter" class="Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser" public="false">
<tag name="monolog.logger" channel="request"/>
<argument type="service" id="kernel"/>
</service>
<service id="response_listener" class="Symfony\Component\HttpKernel\EventListener\ResponseListener">
<tag name="kernel.event_subscriber"/>
<argument>UTF-8</argument>
</service>
<service id="streamed_response_listener" class="Symfony\Component\HttpKernel\EventListener\StreamedResponseListener">
<tag name="kernel.event_subscriber"/>
</service>
<service id="locale_listener" class="Symfony\Component\HttpKernel\EventListener\LocaleListener">
<tag name="kernel.event_subscriber"/>
<argument>en</argument>
<argument type="service" id="router"/>
</service>
<service id="event_dispatcher" class="Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher">
<argument type="service" id="service_container"/>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>data_collector.router</argument>
<argument>onKernelController</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.response</argument>
<argument type="collection">
<argument>monolog.handler.firephp</argument>
<argument>onKernelResponse</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.response</argument>
<argument type="collection">
<argument>monolog.handler.chromephp</argument>
<argument>onKernelResponse</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.request</argument>
<argument type="collection">
<argument>assetic.request_listener</argument>
<argument>onKernelRequest</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>sensio_framework_extra.controller.listener</argument>
<argument>onKernelController</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>sensio_framework_extra.converter.listener</argument>
<argument>onKernelController</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>sensio_framework_extra.view.listener</argument>
<argument>onKernelController</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.view</argument>
<argument type="collection">
<argument>sensio_framework_extra.view.listener</argument>
<argument>onKernelView</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.response</argument>
<argument type="collection">
<argument>sensio_framework_extra.cache.listener</argument>
<argument>onKernelResponse</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>acme.demo.listener</argument>
<argument>onKernelController</argument>
</argument>
<argument>0</argument>
</call>
<call method="addSubscriberService">
<argument>response_listener</argument>
<argument>Symfony\Component\HttpKernel\EventListener\ResponseListener</argument>
</call>
<call method="addSubscriberService">
<argument>streamed_response_listener</argument>
<argument>Symfony\Component\HttpKernel\EventListener\StreamedResponseListener</argument>
</call>
<call method="addSubscriberService">
<argument>locale_listener</argument>
<argument>Symfony\Component\HttpKernel\EventListener\LocaleListener</argument>
</call>
<call method="addSubscriberService">
<argument>fragment.handler</argument>
<argument>Symfony\Component\HttpKernel\Fragment\FragmentHandler</argument>
</call>
<call method="addSubscriberService">
<argument>debug.deprecation_logger_listener</argument>
<argument>Symfony\Component\HttpKernel\EventListener\DeprecationLoggerListener</argument>
</call>
<call method="addSubscriberService">
<argument>session_listener</argument>
<argument>Symfony\Bundle\FrameworkBundle\EventListener\SessionListener</argument>
</call>
<call method="addSubscriberService">
<argument>fragment.listener</argument>
<argument>Symfony\Component\HttpKernel\EventListener\FragmentListener</argument>
</call>
<call method="addSubscriberService">
<argument>profiler_listener</argument>
<argument>Symfony\Component\HttpKernel\EventListener\ProfilerListener</argument>
</call>
<call method="addSubscriberService">
<argument>data_collector.request</argument>
<argument>Symfony\Component\HttpKernel\DataCollector\RequestDataCollector</argument>
</call>
<call method="addSubscriberService">
<argument>router_listener</argument>
<argument>Symfony\Component\HttpKernel\EventListener\RouterListener</argument>
</call>
<call method="addSubscriberService">
<argument>security.firewall</argument>
<argument>Symfony\Component\Security\Http\Firewall</argument>
</call>
<call method="addSubscriberService">
<argument>security.rememberme.response_listener</argument>
<argument>Symfony\Component\Security\Http\RememberMe\ResponseListener</argument>
</call>
<call method="addSubscriberService">
<argument>twig.exception_listener</argument>
<argument>Symfony\Component\HttpKernel\EventListener\ExceptionListener</argument>
</call>
<call method="addSubscriberService">
<argument>swiftmailer.email_sender.listener</argument>
<argument>Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener</argument>
</call>
<call method="addSubscriberService">
<argument>web_profiler.debug_toolbar</argument>
<argument>Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener</argument>
</call>
</service>
<service id="http_kernel" class="Symfony\Bundle\FrameworkBundle\HttpKernel">
<argument type="service" id="debug.event_dispatcher"/>
<argument type="service" id="service_container"/>
<argument type="service" id="debug.controller_resolver"/>
</service>
<service id="cache_warmer" class="Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate">
<argument type="collection">
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer" public="false">
<tag name="kernel.cache_warmer" priority="20"/>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder" public="false">
<argument type="service" id="kernel"/>
<argument type="service" id="templating.filename_parser"/>
<argument>C:/xampp18/htdocs/Symfony/app/Resources</argument>
</service>
</argument>
<argument type="service" id="templating.locator"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer" public="false">
<tag name="kernel.cache_warmer" priority="10"/>
<argument type="service" id="service_container"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer" public="false">
<tag name="kernel.cache_warmer"/>
<argument type="service" id="router"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer" public="false">
<tag name="kernel.cache_warmer"/>
<argument type="service" id="service_container"/>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder" public="false">
<argument type="service" id="kernel"/>
<argument type="service" id="templating.filename_parser"/>
<argument>C:/xampp18/htdocs/Symfony/app/Resources</argument>
</service>
</argument>
</service>
</argument>
<argument type="service">
<service class="Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer" public="false">
<tag name="kernel.cache_warmer"/>
<argument type="service" id="doctrine"/>
</service>
</argument>
<argument type="service">
<service class="JMS\DiExtraBundle\HttpKernel\ControllerInjectorsWarmer" public="false">
<tag name="kernel.cache_warmer"/>
<argument type="service" id="kernel"/>
<argument type="service" id="jms_di_extra.controller_resolver"/>
<argument type="collection"/>
</service>
</argument>
</argument>
</service>
<service id="cache_clearer" class="Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer">
<argument type="collection"/>
</service>
<service id="request" scope="request"/>
<service id="service_container"/>
<service id="kernel"/>
<service id="filesystem" class="Symfony\Component\Filesystem\Filesystem"/>
<service id="file_locator" class="Symfony\Component\HttpKernel\Config\FileLocator">
<argument type="service" id="kernel"/>
<argument>C:/xampp18/htdocs/Symfony/app/Resources</argument>
</service>
<service id="uri_signer" class="Symfony\Component\HttpKernel\UriSigner">
<argument>ThisTokenIsNotSoSecretChangeIt</argument>
</service>
<service id="fragment.handler" class="Symfony\Component\HttpKernel\Fragment\FragmentHandler">
<tag name="kernel.event_subscriber"/>
<argument type="collection"/>
<argument>true</argument>
<call method="addRenderer">
<argument type="service" id="fragment.renderer.inline"/>
</call>
<call method="addRenderer">
<argument type="service" id="fragment.renderer.hinclude"/>
</call>
</service>
<service id="fragment.renderer.inline" class="Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer">
<tag name="kernel.fragment_renderer"/>
<argument type="service" id="http_kernel"/>
<call method="setFragmentPath">
<argument>/_fragment</argument>
</call>
</service>
<service id="fragment.renderer.hinclude" class="Symfony\Bundle\FrameworkBundle\Fragment\ContainerAwareHIncludeFragmentRenderer">
<tag name="kernel.fragment_renderer"/>
<argument type="service" id="service_container"/>
<argument type="service" id="uri_signer"/>
<argument>null</argument>
<call method="setFragmentPath">
<argument>/_fragment</argument>
</call>
</service>
<service id="translator.default" class="Symfony\Bundle\FrameworkBundle\Translation\Translator">
<argument type="service" id="service_container"/>
<argument type="service" id="translator.selector"/>
<argument type="collection">
<argument key="translation.loader.php" type="collection">
<argument>php</argument>
</argument>
<argument key="translation.loader.yml" type="collection">
<argument>yml</argument>
</argument>
<argument key="translation.loader.xliff" type="collection">
<argument>xlf</argument>
<argument>xliff</argument>
</argument>
<argument key="translation.loader.po" type="collection">
<argument>po</argument>
</argument>
<argument key="translation.loader.mo" type="collection">
<argument>mo</argument>
</argument>
<argument key="translation.loader.qt" type="collection">
<argument>ts</argument>
</argument>
<argument key="translation.loader.csv" type="collection">
<argument>csv</argument>
</argument>
<argument key="translation.loader.res" type="collection">
<argument>res</argument>
</argument>
<argument key="translation.loader.dat" type="collection">
<argument>dat</argument>
</argument>
<argument key="translation.loader.ini" type="collection">
<argument>ini</argument>
</argument>
</argument>
<argument type="collection">
<argument key="cache_dir">C:/xampp18/htdocs/Symfony/app/cache/dev/translations</argument>
<argument key="debug">true</argument>
</argument>
</service>
<service id="translator" class="Symfony\Component\Translation\IdentityTranslator">
<argument type="service" id="translator.selector"/>
</service>
<service id="translator.selector" class="Symfony\Component\Translation\MessageSelector" public="false"/>
<service id="translation.loader.php" class="Symfony\Component\Translation\Loader\PhpFileLoader">
<tag name="translation.loader" alias="php"/>
</service>
<service id="translation.loader.yml" class="Symfony\Component\Translation\Loader\YamlFileLoader">
<tag name="translation.loader" alias="yml"/>
</service>
<service id="translation.loader.xliff" class="Symfony\Component\Translation\Loader\XliffFileLoader">
<tag name="translation.loader" alias="xlf" legacy-alias="xliff"/>
</service>
<service id="translation.loader.po" class="Symfony\Component\Translation\Loader\PoFileLoader">
<tag name="translation.loader" alias="po"/>
</service>
<service id="translation.loader.mo" class="Symfony\Component\Translation\Loader\MoFileLoader">
<tag name="translation.loader" alias="mo"/>
</service>
<service id="translation.loader.qt" class="Symfony\Component\Translation\Loader\QtFileLoader">
<tag name="translation.loader" alias="ts"/>
</service>
<service id="translation.loader.csv" class="Symfony\Component\Translation\Loader\CsvFileLoader">
<tag name="translation.loader" alias="csv"/>
</service>
<service id="translation.loader.res" class="Symfony\Component\Translation\Loader\IcuResFileLoader">
<tag name="translation.loader" alias="res"/>
</service>
<service id="translation.loader.dat" class="Symfony\Component\Translation\Loader\IcuResFileLoader">
<tag name="translation.loader" alias="dat"/>
</service>
<service id="translation.loader.ini" class="Symfony\Component\Translation\Loader\IniFileLoader">
<tag name="translation.loader" alias="ini"/>
</service>
<service id="translation.dumper.php" class="Symfony\Component\Translation\Dumper\PhpFileDumper">
<tag name="translation.dumper" alias="php"/>
</service>
<service id="translation.dumper.xliff" class="Symfony\Component\Translation\Dumper\XliffFileDumper">
<tag name="translation.dumper" alias="xlf"/>
</service>
<service id="translation.dumper.po" class="Symfony\Component\Translation\Dumper\PoFileDumper">
<tag name="translation.dumper" alias="po"/>
</service>
<service id="translation.dumper.mo" class="Symfony\Component\Translation\Dumper\MoFileDumper">
<tag name="translation.dumper" alias="mo"/>
</service>
<service id="translation.dumper.yml" class="Symfony\Component\Translation\Dumper\YamlFileDumper">
<tag name="translation.dumper" alias="yml"/>
</service>
<service id="translation.dumper.qt" class="Symfony\Component\Translation\Dumper\QtFileDumper">
<tag name="translation.dumper" alias="ts"/>
</service>
<service id="translation.dumper.csv" class="Symfony\Component\Translation\Dumper\CsvFileDumper">
<tag name="translation.dumper" alias="csv"/>
</service>
<service id="translation.dumper.ini" class="Symfony\Component\Translation\Dumper\IniFileDumper">
<tag name="translation.dumper" alias="ini"/>
</service>
<service id="translation.dumper.res" class="Symfony\Component\Translation\Dumper\IcuResFileDumper">
<tag name="translation.dumper" alias="res"/>
</service>
<service id="translation.extractor.php" class="Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor">
<tag name="translation.extractor" alias="php"/>
</service>
<service id="translation.loader" class="Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader">
<call method="addLoader">
<argument>php</argument>
<argument type="service" id="translation.loader.php"/>
</call>
<call method="addLoader">
<argument>yml</argument>
<argument type="service" id="translation.loader.yml"/>
</call>
<call method="addLoader">
<argument>xlf</argument>
<argument type="service" id="translation.loader.xliff"/>
</call>
<call method="addLoader">
<argument>xliff</argument>
<argument type="service" id="translation.loader.xliff"/>
</call>
<call method="addLoader">
<argument>po</argument>
<argument type="service" id="translation.loader.po"/>
</call>
<call method="addLoader">
<argument>mo</argument>
<argument type="service" id="translation.loader.mo"/>
</call>
<call method="addLoader">
<argument>ts</argument>
<argument type="service" id="translation.loader.qt"/>
</call>
<call method="addLoader">
<argument>csv</argument>
<argument type="service" id="translation.loader.csv"/>
</call>
<call method="addLoader">
<argument>res</argument>
<argument type="service" id="translation.loader.res"/>
</call>
<call method="addLoader">
<argument>dat</argument>
<argument type="service" id="translation.loader.dat"/>
</call>
<call method="addLoader">
<argument>ini</argument>
<argument type="service" id="translation.loader.ini"/>
</call>
</service>
<service id="translation.extractor" class="Symfony\Component\Translation\Extractor\ChainExtractor">
<call method="addExtractor">
<argument>php</argument>
<argument type="service" id="translation.extractor.php"/>
</call>
<call method="addExtractor">
<argument>twig</argument>
<argument type="service" id="twig.translation.extractor"/>
</call>
</service>
<service id="translation.writer" class="Symfony\Component\Translation\Writer\TranslationWriter">
<call method="addDumper">
<argument>php</argument>
<argument type="service" id="translation.dumper.php"/>
</call>
<call method="addDumper">
<argument>xlf</argument>
<argument type="service" id="translation.dumper.xliff"/>
</call>
<call method="addDumper">
<argument>po</argument>
<argument type="service" id="translation.dumper.po"/>
</call>
<call method="addDumper">
<argument>mo</argument>
<argument type="service" id="translation.dumper.mo"/>
</call>
<call method="addDumper">
<argument>yml</argument>
<argument type="service" id="translation.dumper.yml"/>
</call>
<call method="addDumper">
<argument>ts</argument>
<argument type="service" id="translation.dumper.qt"/>
</call>
<call method="addDumper">
<argument>csv</argument>
<argument type="service" id="translation.dumper.csv"/>
</call>
<call method="addDumper">
<argument>ini</argument>
<argument type="service" id="translation.dumper.ini"/>
</call>
<call method="addDumper">
<argument>res</argument>
<argument type="service" id="translation.dumper.res"/>
</call>
</service>
<service id="debug.stopwatch" class="Symfony\Component\Stopwatch\Stopwatch"/>
<service id="debug.event_dispatcher" class="Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher">
<tag name="monolog.logger" channel="event"/>
<argument type="service" id="event_dispatcher"/>
<argument type="service" id="debug.stopwatch"/>
<argument type="service" id="monolog.logger.event"/>
<call method="setProfiler">
<argument type="service" id="profiler"/>
</call>
</service>
<service id="debug.controller_resolver" class="Symfony\Component\HttpKernel\Controller\TraceableControllerResolver">
<argument type="service" id="jms_di_extra.controller_resolver"/>
<argument type="service" id="debug.stopwatch"/>
</service>
<service id="debug.deprecation_logger_listener" class="Symfony\Component\HttpKernel\EventListener\DeprecationLoggerListener">
<tag name="kernel.event_subscriber"/>
<tag name="monolog.logger" channel="deprecation"/>
<argument type="service" id="monolog.logger.deprecation"/>
</service>
<service id="session" class="Symfony\Component\HttpFoundation\Session\Session">
<argument type="service" id="session.storage.native"/>
<argument type="service">
<service class="Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag" public="false"/>
</argument>
<argument type="service">
<service class="Symfony\Component\HttpFoundation\Session\Flash\FlashBag" public="false"/>
</argument>
</service>
<service id="session.storage.native" class="Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage">
<argument type="collection"/>
<argument type="service" id="session.handler"/>
</service>
<service id="session_listener" class="Symfony\Bundle\FrameworkBundle\EventListener\SessionListener">
<tag name="kernel.event_subscriber"/>
<argument type="service" id="service_container"/>
</service>
<service id="form.resolved_type_factory" class="Symfony\Component\Form\ResolvedFormTypeFactory"/>
<service id="form.registry" class="Symfony\Component\Form\FormRegistry">
<argument type="collection">
<argument type="service">
<service class="Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension" public="false">
<argument type="service" id="service_container"/>
<argument type="collection">
<argument key="field">form.type.field</argument>
<argument key="form">form.type.form</argument>
<argument key="birthday">form.type.birthday</argument>
<argument key="checkbox">form.type.checkbox</argument>
<argument key="choice">form.type.choice</argument>
<argument key="collection">form.type.collection</argument>
<argument key="country">form.type.country</argument>
<argument key="date">form.type.date</argument>
<argument key="datetime">form.type.datetime</argument>
<argument key="email">form.type.email</argument>
<argument key="file">form.type.file</argument>
<argument key="hidden">form.type.hidden</argument>
<argument key="integer">form.type.integer</argument>
<argument key="language">form.type.language</argument>
<argument key="locale">form.type.locale</argument>
<argument key="money">form.type.money</argument>
<argument key="number">form.type.number</argument>
<argument key="password">form.type.password</argument>
<argument key="percent">form.type.percent</argument>
<argument key="radio">form.type.radio</argument>
<argument key="repeated">form.type.repeated</argument>
<argument key="search">form.type.search</argument>
<argument key="textarea">form.type.textarea</argument>
<argument key="text">form.type.text</argument>
<argument key="time">form.type.time</argument>
<argument key="timezone">form.type.timezone</argument>
<argument key="url">form.type.url</argument>
<argument key="entity">form.type.entity</argument>
</argument>
<argument type="collection">
<argument key="form" type="collection">
<argument>form.type_extension.form.http_foundation</argument>
<argument>form.type_extension.form.validator</argument>
<argument>form.type_extension.csrf</argument>
</argument>
<argument key="repeated" type="collection">
<argument>form.type_extension.repeated.validator</argument>
</argument>
</argument>
<argument type="collection">
<argument>form.type_guesser.validator</argument>
<argument>form.type_guesser.doctrine</argument>
</argument>
</service>
</argument>
</argument>
<argument type="service" id="form.resolved_type_factory"/>
</service>
<service id="form.factory" class="Symfony\Component\Form\FormFactory">
<argument type="service" id="form.registry"/>
<argument type="service" id="form.resolved_type_factory"/>
</service>
<service id="form.type_guesser.validator" class="Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser">
<tag name="form.type_guesser"/>
<argument type="service" id="validator.mapping.class_metadata_factory"/>
</service>
<service id="property_accessor" class="Symfony\Component\PropertyAccess\PropertyAccessor"/>
<service id="form.type.field" class="Symfony\Component\Form\Extension\Core\Type\FieldType">
<tag name="form.type" alias="field"/>
</service>
<service id="form.type.form" class="Symfony\Component\Form\Extension\Core\Type\FormType">
<tag name="form.type" alias="form"/>
<argument type="service" id="property_accessor"/>
</service>
<service id="form.type.birthday" class="Symfony\Component\Form\Extension\Core\Type\BirthdayType">
<tag name="form.type" alias="birthday"/>
</service>
<service id="form.type.checkbox" class="Symfony\Component\Form\Extension\Core\Type\CheckboxType">
<tag name="form.type" alias="checkbox"/>
</service>
<service id="form.type.choice" class="Symfony\Component\Form\Extension\Core\Type\ChoiceType">
<tag name="form.type" alias="choice"/>
</service>
<service id="form.type.collection" class="Symfony\Component\Form\Extension\Core\Type\CollectionType">
<tag name="form.type" alias="collection"/>
</service>
<service id="form.type.country" class="Symfony\Component\Form\Extension\Core\Type\CountryType">
<tag name="form.type" alias="country"/>
</service>
<service id="form.type.date" class="Symfony\Component\Form\Extension\Core\Type\DateType">
<tag name="form.type" alias="date"/>
</service>
<service id="form.type.datetime" class="Symfony\Component\Form\Extension\Core\Type\DateTimeType">
<tag name="form.type" alias="datetime"/>
</service>
<service id="form.type.email" class="Symfony\Component\Form\Extension\Core\Type\EmailType">
<tag name="form.type" alias="email"/>
</service>
<service id="form.type.file" class="Symfony\Component\Form\Extension\Core\Type\FileType">
<tag name="form.type" alias="file"/>
</service>
<service id="form.type.hidden" class="Symfony\Component\Form\Extension\Core\Type\HiddenType">
<tag name="form.type" alias="hidden"/>
</service>
<service id="form.type.integer" class="Symfony\Component\Form\Extension\Core\Type\IntegerType">
<tag name="form.type" alias="integer"/>
</service>
<service id="form.type.language" class="Symfony\Component\Form\Extension\Core\Type\LanguageType">
<tag name="form.type" alias="language"/>
</service>
<service id="form.type.locale" class="Symfony\Component\Form\Extension\Core\Type\LocaleType">
<tag name="form.type" alias="locale"/>
</service>
<service id="form.type.money" class="Symfony\Component\Form\Extension\Core\Type\MoneyType">
<tag name="form.type" alias="money"/>
</service>
<service id="form.type.number" class="Symfony\Component\Form\Extension\Core\Type\NumberType">
<tag name="form.type" alias="number"/>
</service>
<service id="form.type.password" class="Symfony\Component\Form\Extension\Core\Type\PasswordType">
<tag name="form.type" alias="password"/>
</service>
<service id="form.type.percent" class="Symfony\Component\Form\Extension\Core\Type\PercentType">
<tag name="form.type" alias="percent"/>
</service>
<service id="form.type.radio" class="Symfony\Component\Form\Extension\Core\Type\RadioType">
<tag name="form.type" alias="radio"/>
</service>
<service id="form.type.repeated" class="Symfony\Component\Form\Extension\Core\Type\RepeatedType">
<tag name="form.type" alias="repeated"/>
</service>
<service id="form.type.search" class="Symfony\Component\Form\Extension\Core\Type\SearchType">
<tag name="form.type" alias="search"/>
</service>
<service id="form.type.textarea" class="Symfony\Component\Form\Extension\Core\Type\TextareaType">
<tag name="form.type" alias="textarea"/>
</service>
<service id="form.type.text" class="Symfony\Component\Form\Extension\Core\Type\TextType">
<tag name="form.type" alias="text"/>
</service>
<service id="form.type.time" class="Symfony\Component\Form\Extension\Core\Type\TimeType">
<tag name="form.type" alias="time"/>
</service>
<service id="form.type.timezone" class="Symfony\Component\Form\Extension\Core\Type\TimezoneType">
<tag name="form.type" alias="timezone"/>
</service>
<service id="form.type.url" class="Symfony\Component\Form\Extension\Core\Type\UrlType">
<tag name="form.type" alias="url"/>
</service>
<service id="form.type_extension.form.http_foundation" class="Symfony\Component\Form\Extension\HttpFoundation\Type\FormTypeHttpFoundationExtension">
<tag name="form.type_extension" alias="form"/>
</service>
<service id="form.type_extension.form.validator" class="Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension">
<tag name="form.type_extension" alias="form"/>
<argument type="service" id="validator"/>
</service>
<service id="form.type_extension.repeated.validator" class="Symfony\Component\Form\Extension\Validator\Type\RepeatedTypeValidatorExtension">
<tag name="form.type_extension" alias="repeated"/>
</service>
<service id="form.csrf_provider" class="Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider">
<argument type="service" id="session"/>
<argument>ThisTokenIsNotSoSecretChangeIt</argument>
</service>
<service id="form.type_extension.csrf" class="Symfony\Component\Form\Extension\Csrf\Type\FormTypeCsrfExtension">
<tag name="form.type_extension" alias="form"/>
<argument type="service" id="form.csrf_provider"/>
<argument>true</argument>
<argument>_token</argument>
</service>
<service id="templating.name_parser" class="Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser">
<argument type="service" id="kernel"/>
</service>
<service id="templating.filename_parser" class="Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser"/>
<service id="templating.locator" class="Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator" public="false">
<argument type="service" id="file_locator"/>
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev</argument>
</service>
<service id="templating.helper.slots" class="Symfony\Component\Templating\Helper\SlotsHelper">
<tag name="templating.helper" alias="slots"/>
</service>
<service id="templating.helper.assets" class="Symfony\Component\Templating\Helper\CoreAssetsHelper" scope="request">
<tag name="templating.helper" alias="assets"/>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\Templating\Asset\PathPackage" scope="request" public="false">
<argument type="service" id="request"/>
<argument>null</argument>
<argument>%%s?%%s</argument>
</service>
</argument>
<argument type="collection"/>
</service>
<service id="templating.asset.package_factory" class="Symfony\Bundle\FrameworkBundle\Templating\Asset\PackageFactory">
<argument type="service" id="service_container"/>
</service>
<service id="templating.helper.request" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\RequestHelper">
<tag name="templating.helper" alias="request"/>
<argument type="service" id="request"/>
</service>
<service id="templating.helper.session" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper">
<tag name="templating.helper" alias="session"/>
<argument type="service" id="request"/>
</service>
<service id="templating.helper.router" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper">
<tag name="templating.helper" alias="router"/>
<argument type="service" id="router"/>
</service>
<service id="templating.helper.actions" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\ActionsHelper">
<tag name="templating.helper" alias="actions"/>
<argument type="service" id="fragment.handler"/>
</service>
<service id="templating.helper.code" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper">
<tag name="templating.helper" alias="code"/>
<argument>null</argument>
<argument>C:/xampp18/htdocs/Symfony/app</argument>
<argument>UTF-8</argument>
</service>
<service id="templating.helper.translator" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper">
<tag name="templating.helper" alias="translator"/>
<argument type="service" id="translator"/>
</service>
<service id="templating.helper.form" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper">
<tag name="templating.helper" alias="form"/>
<argument type="service">
<service class="Symfony\Component\Form\FormRenderer" public="false">
<argument type="service">
<service class="Symfony\Component\Form\Extension\Templating\TemplatingRendererEngine" public="false">
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\Templating\PhpEngine" public="false">
<argument type="service" id="templating.name_parser"/>
<argument type="service" id="service_container"/>
<argument type="service" id="templating.loader"/>
<argument type="service" id="templating.globals"/>
<call method="setCharset">
<argument>UTF-8</argument>
</call>
<call method="setHelpers">
<argument type="collection">
<argument key="slots">templating.helper.slots</argument>
<argument key="assets">templating.helper.assets</argument>
<argument key="request">templating.helper.request</argument>
<argument key="session">templating.helper.session</argument>
<argument key="router">templating.helper.router</argument>
<argument key="actions">templating.helper.actions</argument>
<argument key="code">templating.helper.code</argument>
<argument key="translator">templating.helper.translator</argument>
<argument key="form">templating.helper.form</argument>
<argument key="logout_url">templating.helper.logout_url</argument>
<argument key="security">templating.helper.security</argument>
<argument key="assetic">assetic.helper.dynamic</argument>
</argument>
</call>
</service>
</argument>
<argument type="collection">
<argument>FrameworkBundle:Form</argument>
</argument>
</service>
</argument>
<argument type="service" id="form.csrf_provider"/>
</service>
</argument>
</service>
<service id="templating.globals" class="Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables">
<argument type="service" id="service_container"/>
</service>
<service id="validator" class="Symfony\Component\Validator\Validator">
<argument type="service" id="validator.mapping.class_metadata_factory"/>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory" public="false">
<argument type="service" id="service_container"/>
<argument type="collection">
<argument key="security.validator.user_password">security.validator.user_password</argument>
<argument key="doctrine.orm.validator.unique">doctrine.orm.validator.unique</argument>
</argument>
</service>
</argument>
<argument type="service" id="translator.default"/>
<argument>validators</argument>
<argument type="collection">
<argument type="service" id="doctrine.orm.validator_initializer"/>
</argument>
</service>
<service id="validator.mapping.class_metadata_factory" class="Symfony\Component\Validator\Mapping\ClassMetadataFactory" public="false">
<argument type="service">
<service class="Symfony\Component\Validator\Mapping\Loader\LoaderChain" public="false">
<argument type="collection">
<argument type="service">
<service class="Symfony\Component\Validator\Mapping\Loader\AnnotationLoader" public="false">
<argument type="service" id="annotation_reader"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader" public="false"/>
</argument>
<argument type="service">
<service class="Symfony\Component\Validator\Mapping\Loader\XmlFilesLoader" public="false">
<argument type="collection">
<argument>C:\xampp18\htdocs\Symfony\vendor\symfony\symfony\src\Symfony\Component\Form/Resources/config/validation.xml</argument>
</argument>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Validator\Mapping\Loader\YamlFilesLoader" public="false">
<argument type="collection"/>
</service>
</argument>
</argument>
</service>
</argument>
<argument>null</argument>
</service>
<service id="fragment.listener" class="Symfony\Component\HttpKernel\EventListener\FragmentListener">
<tag name="kernel.event_subscriber"/>
<argument type="service" id="uri_signer"/>
<argument>/_fragment</argument>
</service>
<service id="profiler" class="Symfony\Component\HttpKernel\Profiler\Profiler">
<tag name="monolog.logger" channel="profiler"/>
<argument type="service">
<service class="Symfony\Component\HttpKernel\Profiler\FileProfilerStorage" public="false">
<argument>file:C:/xampp18/htdocs/Symfony/app/cache/dev/profiler</argument>
<argument></argument>
<argument></argument>
<argument>86400</argument>
</service>
</argument>
<argument type="service" id="monolog.logger.profiler"/>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector" public="false">
<tag name="data_collector" template="@WebProfiler/Collector/config.html.twig" id="config" priority="255"/>
<call method="setKernel">
<argument type="service" id="kernel"/>
</call>
</service>
</argument>
</call>
<call method="add">
<argument type="service" id="data_collector.request"/>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector" public="false">
<tag name="data_collector" template="@WebProfiler/Collector/exception.html.twig" id="exception" priority="255"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\EventDataCollector" public="false">
<tag name="data_collector" template="@WebProfiler/Collector/events.html.twig" id="events" priority="255"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector" public="false">
<tag name="data_collector" template="@WebProfiler/Collector/logger.html.twig" id="logger" priority="255"/>
<tag name="monolog.logger" channel="profiler"/>
<argument type="service" id="monolog.logger.profiler"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\TimeDataCollector" public="false">
<tag name="data_collector" template="@WebProfiler/Collector/time.html.twig" id="time" priority="255"/>
<argument type="service" id="kernel"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector" public="false">
<tag name="data_collector" template="@WebProfiler/Collector/memory.html.twig" id="memory" priority="255"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service" id="data_collector.router"/>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector" public="false">
<tag name="data_collector" template="SecurityBundle:Collector:security" id="security"/>
<argument type="service" id="security.context"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Bridge\Swiftmailer\DataCollector\MessageDataCollector" public="false">
<tag name="data_collector" template="SwiftmailerBundle:Collector:swiftmailer" id="swiftmailer"/>
<argument type="service" id="service_container"/>
<argument>true</argument>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Doctrine\Bundle\DoctrineBundle\DataCollector\DoctrineDataCollector" public="false">
<tag name="data_collector" template="DoctrineBundle:Collector:db" id="db"/>
<argument type="service" id="doctrine"/>
<call method="addLogger">
<argument>default</argument>
<argument type="service" id="doctrine.dbal.logger.profiling.default"/>
</call>
</service>
</argument>
</call>
</service>
<service id="profiler_listener" class="Symfony\Component\HttpKernel\EventListener\ProfilerListener">
<tag name="kernel.event_subscriber"/>
<argument type="service" id="profiler"/>
<argument>null</argument>
<argument>false</argument>
<argument>false</argument>
</service>
<service id="data_collector.request" class="Symfony\Component\HttpKernel\DataCollector\RequestDataCollector">
<tag name="kernel.event_subscriber"/>
<tag name="data_collector" template="@WebProfiler/Collector/request.html.twig" id="request" priority="255"/>
</service>
<service id="data_collector.router" class="Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
<tag name="data_collector" template="@WebProfiler/Collector/router.html.twig" id="router" priority="255"/>
</service>
<service id="routing.loader" class="Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader">
<tag name="monolog.logger" channel="router"/>
<argument type="service" id="controller_name_converter"/>
<argument type="service" id="monolog.logger.router"/>
<argument type="service">
<service class="Symfony\Component\Config\Loader\LoaderResolver" public="false">
<call method="addLoader">
<argument type="service">
<service class="Symfony\Component\Routing\Loader\XmlFileLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="file_locator"/>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Symfony\Component\Routing\Loader\YamlFileLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="file_locator"/>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Symfony\Component\Routing\Loader\PhpFileLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="file_locator"/>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Routing\AsseticLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="assetic.asset_manager"/>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Symfony\Component\Routing\Loader\AnnotationDirectoryLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="file_locator"/>
<argument type="service">
<service class="Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="annotation_reader"/>
</service>
</argument>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Symfony\Component\Routing\Loader\AnnotationFileLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="file_locator"/>
<argument type="service">
<service class="Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="annotation_reader"/>
</service>
</argument>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="annotation_reader"/>
</service>
</argument>
</call>
</service>
</argument>
</service>
<service id="router.request_context" class="Symfony\Component\Routing\RequestContext" public="false">
<argument></argument>
<argument>GET</argument>
<argument>localhost</argument>
<argument>http</argument>
<argument>80</argument>
<argument>443</argument>
</service>
<service id="router_listener" class="Symfony\Component\HttpKernel\EventListener\RouterListener">
<tag name="kernel.event_subscriber"/>
<tag name="monolog.logger" channel="request"/>
<argument type="service" id="router"/>
<argument type="service" id="router.request_context"/>
<argument type="service" id="monolog.logger.request"/>
</service>
<service id="security.context" class="Symfony\Component\Security\Core\SecurityContext">
<argument type="service" id="security.authentication.manager"/>
<argument type="service" id="security.access.decision_manager"/>
<argument>false</argument>
</service>
<service id="security.authentication.manager" class="Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager" public="false">
<argument type="collection">
<argument type="service">
<service class="Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider" public="false">
<argument type="service" id="security.user.provider.concrete.in_memory"/>
<argument type="service">
<service class="Symfony\Component\Security\Core\User\UserChecker" public="false"/>
</argument>
<argument>secured_area</argument>
<argument type="service" id="security.encoder_factory"/>
<argument>true</argument>
</service>
</argument>
</argument>
<argument>true</argument>
<call method="setEventDispatcher">
<argument type="service" id="event_dispatcher"/>
</call>
</service>
<service id="security.authentication.trust_resolver" class="Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver">
<argument>Symfony\Component\Security\Core\Authentication\Token\AnonymousToken</argument>
<argument>Symfony\Component\Security\Core\Authentication\Token\RememberMeToken</argument>
</service>
<service id="security.access.decision_manager" class="JMS\SecurityExtraBundle\Security\Authorization\RememberingAccessDecisionManager">
<argument type="service">
<service class="Symfony\Component\Security\Core\Authorization\AccessDecisionManager" public="false">
<argument type="collection">
<argument type="service">
<service class="JMS\SecurityExtraBundle\Security\Authorization\Expression\LazyLoadingExpressionVoter" public="false">
<tag name="security.voter" priority="230"/>
<tag name="monolog.logger" channel="security"/>
<argument type="service" id="security.expressions.handler"/>
<argument type="service" id="monolog.logger.security"/>
<call method="setLazyCompiler">
<argument type="service" id="service_container"/>
<argument>security.expressions.compiler</argument>
</call>
<call method="setCacheDir">
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/jms_security/expressions</argument>
</call>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter" public="false">
<tag name="security.voter" priority="245"/>
<argument type="service" id="security.role_hierarchy"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter" public="false">
<tag name="security.voter" priority="250"/>
<argument type="service" id="security.authentication.trust_resolver"/>
</service>
</argument>
</argument>
<argument>affirmative</argument>
<argument>false</argument>
<argument>true</argument>
</service>
</argument>
</service>
<service id="security.role_hierarchy" class="Symfony\Component\Security\Core\Role\RoleHierarchy">
<argument type="collection">
<argument key="ROLE_ADMIN" type="collection">
<argument>ROLE_USER</argument>
</argument>
<argument key="ROLE_SUPER_ADMIN" type="collection">
<argument>ROLE_USER</argument>
<argument>ROLE_ADMIN</argument>
<argument>ROLE_ALLOWED_TO_SWITCH</argument>
</argument>
</argument>
</service>
<service id="security.firewall" class="Symfony\Component\Security\Http\Firewall">
<tag name="kernel.event_subscriber"/>
<argument type="service">
<service class="Symfony\Bundle\SecurityBundle\Security\FirewallMap" public="false">
<argument type="service" id="service_container"/>
<argument type="collection">
<argument key="security.firewall.map.context.dev" type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/(_(profiler|wdt)|css|images|js)/</argument>
</service>
</argument>
<argument key="security.firewall.map.context.login" type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/demo/secured/login$</argument>
</service>
</argument>
<argument key="security.firewall.map.context.secured_area" type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/demo/secured/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument type="service" id="event_dispatcher"/>
</service>
<service id="security.validator.user_password" class="Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator">
<tag name="validator.constraint_validator" alias="security.validator.user_password"/>
<argument type="service" id="security.context"/>
<argument type="service" id="security.encoder_factory"/>
</service>
<service id="security.secure_random" class="Symfony\Component\Security\Core\Util\SecureRandom">
<tag name="monolog.logger" channel="security"/>
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/secure_random.seed</argument>
<argument type="service" id="monolog.logger.security"/>
</service>
<service id="security.rememberme.response_listener" class="Symfony\Component\Security\Http\RememberMe\ResponseListener">
<tag name="kernel.event_subscriber"/>
</service>
<service id="templating.helper.logout_url" class="Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper">
<tag name="templating.helper" alias="logout_url"/>
<argument type="service" id="service_container"/>
<argument type="service" id="router"/>
<call method="registerListener">
<argument>secured_area</argument>
<argument>_demo_logout</argument>
<argument>logout</argument>
<argument>_csrf_token</argument>
<argument>null</argument>
</call>
</service>
<service id="templating.helper.security" class="Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper">
<tag name="templating.helper" alias="security"/>
<argument type="service" id="security.context"/>
</service>
<service id="security.user.provider.concrete.in_memory" class="Symfony\Component\Security\Core\User\InMemoryUserProvider" public="false">
<call method="createUser">
<argument type="service">
<service class="Symfony\Component\Security\Core\User\User" public="false">
<argument>user</argument>
<argument>userpass</argument>
<argument type="collection">
<argument>ROLE_USER</argument>
</argument>
</service>
</argument>
</call>
<call method="createUser">
<argument type="service">
<service class="Symfony\Component\Security\Core\User\User" public="false">
<argument>admin</argument>
<argument>adminpass</argument>
<argument type="collection">
<argument>ROLE_ADMIN</argument>
</argument>
</service>
</argument>
</call>
</service>
<service id="security.firewall.map.context.dev" class="Symfony\Bundle\SecurityBundle\Security\FirewallContext">
<argument type="collection"/>
<argument>null</argument>
</service>
<service id="security.firewall.map.context.login" class="Symfony\Bundle\SecurityBundle\Security\FirewallContext">
<argument type="collection"/>
<argument>null</argument>
</service>
<service id="security.firewall.map.context.secured_area" class="Symfony\Bundle\SecurityBundle\Security\FirewallContext">
<argument type="collection">
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\ChannelListener" public="false">
<tag name="monolog.logger" channel="security"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\AccessMap" public="false"/>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint" public="false">
<argument>80</argument>
<argument>443</argument>
</service>
</argument>
<argument type="service" id="monolog.logger.security"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\ContextListener" public="false">
<argument type="service" id="security.context"/>
<argument type="collection">
<argument type="service" id="security.user.provider.concrete.in_memory"/>
</argument>
<argument>secured_area</argument>
<argument type="service" id="monolog.logger.security"/>
<argument type="service" id="event_dispatcher"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\LogoutListener" public="false">
<argument type="service" id="security.context"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
<argument type="service" id="router"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Logout\DefaultLogoutSuccessHandler" public="false">
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
<argument type="service" id="router"/>
</service>
</argument>
<argument>_demo</argument>
</service>
</argument>
<argument type="collection">
<argument key="csrf_parameter">_csrf_token</argument>
<argument key="intention">logout</argument>
<argument key="logout_path">_demo_logout</argument>
</argument>
<call method="addHandler">
<argument type="service">
<service class="Symfony\Component\Security\Http\Logout\SessionLogoutHandler" public="false"/>
</argument>
</call>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener" public="false">
<tag name="security.remember_me_aware" id="secured_area" provider="security.user.provider.concrete.in_memory"/>
<argument type="service" id="security.context"/>
<argument type="service" id="security.authentication.manager"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy" public="false">
<argument>migrate</argument>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
<argument type="service" id="router"/>
</service>
</argument>
<argument>secured_area</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler" public="false">
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
<argument type="service" id="router"/>
</service>
</argument>
<argument type="collection">
<argument key="login_path">_demo_login</argument>
<argument key="always_use_default_target_path">false</argument>
<argument key="default_target_path">/</argument>
<argument key="target_path_parameter">_target_path</argument>
<argument key="use_referer">false</argument>
</argument>
<call method="setProviderKey">
<argument>secured_area</argument>
</call>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler" public="false">
<argument type="service" id="http_kernel"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
<argument type="service" id="router"/>
</service>
</argument>
<argument type="collection">
<argument key="login_path">_demo_login</argument>
<argument key="failure_path">null</argument>
<argument key="failure_forward">false</argument>
<argument key="failure_path_parameter">_failure_path</argument>
</argument>
<argument type="service" id="monolog.logger.security"/>
</service>
</argument>
<argument type="collection">
<argument key="check_path">_security_check</argument>
<argument key="use_forward">false</argument>
<argument key="username_parameter">_username</argument>
<argument key="password_parameter">_password</argument>
<argument key="csrf_parameter">_csrf_token</argument>
<argument key="intention">authenticate</argument>
<argument key="post_only">true</argument>
</argument>
<argument type="service" id="monolog.logger.security"/>
<argument type="service" id="event_dispatcher"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\AccessListener" public="false">
<tag name="monolog.logger" channel="security"/>
<argument type="service" id="security.context"/>
<argument type="service" id="security.access.decision_manager"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\AccessMap" public="false"/>
</argument>
<argument type="service" id="security.authentication.manager"/>
<argument type="service" id="monolog.logger.security"/>
</service>
</argument>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\ExceptionListener" public="false">
<argument type="service" id="security.context"/>
<argument type="service" id="security.authentication.trust_resolver"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
<argument type="service" id="router"/>
</service>
</argument>
<argument>secured_area</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint" public="false">
<argument type="service" id="http_kernel"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
<argument type="service" id="router"/>
</service>
</argument>
<argument>_demo_login</argument>
<argument>false</argument>
</service>
</argument>
<argument>null</argument>
<argument>null</argument>
<argument type="service" id="monolog.logger.security"/>
</service>
</argument>
</service>
<service id="twig" class="Twig_Environment">
<argument type="service" id="twig.loader"/>
<argument type="collection">
<argument key="debug">true</argument>
<argument key="strict_variables">true</argument>
<argument key="exception_controller">twig.controller.exception:showAction</argument>
<argument key="cache">C:/xampp18/htdocs/Symfony/app/cache/dev/twig</argument>
<argument key="charset">UTF-8</argument>
<argument key="paths" type="collection"/>
</argument>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bundle\SecurityBundle\Twig\Extension\LogoutUrlExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="templating.helper.logout_url"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\SecurityExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="security.context"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\TranslationExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="translator"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bundle\TwigBundle\Extension\AssetsExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="service_container"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bundle\TwigBundle\Extension\ActionsExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="service_container"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\CodeExtension" public="false">
<tag name="twig.extension"/>
<argument>null</argument>
<argument>C:/xampp18/htdocs/Symfony/app</argument>
<argument>UTF-8</argument>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\RoutingExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="router"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\YamlExtension" public="false">
<tag name="twig.extension"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\HttpKernelExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="fragment.handler"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\FormExtension" public="false">
<tag name="twig.extension"/>
<argument type="service">
<service class="Symfony\Bridge\Twig\Form\TwigRenderer" public="false">
<argument type="service">
<service class="Symfony\Bridge\Twig\Form\TwigRendererEngine" public="false">
<argument type="collection">
<argument>form_div_layout.html.twig</argument>
</argument>
</service>
</argument>
<argument type="service" id="form.csrf_provider"/>
</service>
</argument>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Twig_Extension_Debug" public="false">
<tag name="twig.extension"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Twig\AsseticExtension" public="false">
<tag name="twig.extension"/>
<tag name="assetic.templating.twig"/>
<argument type="service" id="assetic.asset_factory"/>
<argument type="service" id="templating.name_parser"/>
<argument>true</argument>
<argument type="collection"/>
<argument type="collection"/>
<argument type="service" id="assetic.value_supplier.default"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Doctrine\Bundle\DoctrineBundle\Twig\DoctrineExtension" public="false">
<tag name="twig.extension"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="JMS\SecurityExtraBundle\Twig\SecurityExtension" public="false">
<tag name="twig.extension" alias="jms_security_extra"/>
<argument type="service" id="security.context"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service" id="twig.extension.acme.demo"/>
</call>
<call method="addGlobal">
<argument>app</argument>
<argument type="service" id="templating.globals"/>
</call>
</service>
<service id="twig.translation.extractor" class="Symfony\Bridge\Twig\Translation\TwigExtractor">
<tag name="translation.extractor" alias="twig"/>
<argument type="service" id="twig"/>
</service>
<service id="twig.exception_listener" class="Symfony\Component\HttpKernel\EventListener\ExceptionListener">
<tag name="kernel.event_subscriber"/>
<tag name="monolog.logger" channel="request"/>
<argument>twig.controller.exception:showAction</argument>
<argument type="service" id="monolog.logger.request"/>
</service>
<service id="twig.controller.exception" class="Symfony\Bundle\TwigBundle\Controller\ExceptionController">
<argument type="service" id="twig"/>
<argument>true</argument>
</service>
<service id="monolog.handler.main" class="Monolog\Handler\StreamHandler">
<argument>C:/xampp18/htdocs/Symfony/app/logs/dev.log</argument>
<argument>100</argument>
<argument>true</argument>
</service>
<service id="monolog.handler.firephp" class="Symfony\Bridge\Monolog\Handler\FirePHPHandler">
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/>
<argument>200</argument>
<argument>true</argument>
</service>
<service id="monolog.handler.chromephp" class="Symfony\Bridge\Monolog\Handler\ChromePhpHandler">
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/>
<argument>200</argument>
<argument>true</argument>
</service>
<service id="swiftmailer.transport.eventdispatcher" class="Swift_Events_SimpleEventDispatcher" public="false"/>
<service id="swiftmailer.plugin.messagelogger" class="Swift_Plugins_MessageLogger">
<tag name="swiftmailer.plugin"/>
</service>
<service id="swiftmailer.email_sender.listener" class="Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener">
<tag name="kernel.event_subscriber"/>
<argument type="service" id="service_container"/>
</service>
<service id="assetic.filter_manager" class="Symfony\Bundle\AsseticBundle\FilterManager">
<argument type="service" id="service_container"/>
<argument type="collection">
<argument key="cssrewrite">assetic.filter.cssrewrite</argument>
</argument>
</service>
<service id="assetic.asset_manager" class="Assetic\Factory\LazyAssetManager">
<argument type="service" id="assetic.asset_factory"/>
<argument type="collection">
<argument key="twig" type="service">
<service class="Assetic\Factory\Loader\CachedFormulaLoader" public="false">
<tag name="assetic.formula_loader" alias="twig"/>
<tag name="assetic.templating.twig"/>
<argument type="service">
<service class="Assetic\Extension\Twig\TwigFormulaLoader" public="false">
<tag name="assetic.templating.twig"/>
<argument type="service" id="twig"/>
</service>
</argument>
<argument type="service">
<service class="Assetic\Cache\ConfigCache" public="false">
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/assetic/config</argument>
</service>
</argument>
<argument>true</argument>
</service>
</argument>
</argument>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="service" id="templating.loader"/>
<argument></argument>
<argument>C:/xampp18/htdocs/Symfony/app/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument>twig</argument>
</call>
</service>
<service id="assetic.asset_factory" class="Symfony\Bundle\AsseticBundle\Factory\AssetFactory" public="false">
<argument type="service" id="kernel"/>
<argument type="service" id="service_container"/>
<argument type="service">
<service class="Symfony\Component\DependencyInjection\ParameterBag\ParameterBag" factory-method="getParameterBag" factory-service="service_container" public="false"/>
</argument>
<argument>C:/xampp18/htdocs/Symfony/app/../web</argument>
<argument>true</argument>
<call method="addWorker">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Worker\UseControllerWorker" public="false">
<tag name="assetic.factory_worker"/>
</service>
</argument>
</call>
</service>
<service id="assetic.value_supplier.default" class="Symfony\Bundle\AsseticBundle\DefaultValueSupplier" public="false">
<argument type="service" id="service_container"/>
</service>
<service id="assetic.filter.cssrewrite" class="Assetic\Filter\CssRewriteFilter">
<tag name="assetic.filter" alias="cssrewrite"/>
</service>
<service id="assetic.controller" class="Symfony\Bundle\AsseticBundle\Controller\AsseticController" scope="prototype">
<argument type="service" id="request"/>
<argument type="service" id="assetic.asset_manager"/>
<argument type="service" id="assetic.cache"/>
<argument>false</argument>
<argument type="service" id="profiler"/>
<call method="setValueSupplier">
<argument type="service" id="assetic.value_supplier.default"/>
</call>
</service>
<service id="assetic.cache" class="Assetic\Cache\FilesystemCache" public="false">
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/assetic/assets</argument>
</service>
<service id="assetic.request_listener" class="Symfony\Bundle\AsseticBundle\EventListener\RequestListener">
<tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest"/>
</service>
<service id="doctrine.dbal.connection_factory" class="Doctrine\Bundle\DoctrineBundle\ConnectionFactory">
<argument type="collection"/>
</service>
<service id="doctrine" class="Doctrine\Bundle\DoctrineBundle\Registry">
<argument type="service" id="service_container"/>
<argument type="collection">
<argument key="default">doctrine.dbal.default_connection</argument>
</argument>
<argument type="collection">
<argument key="default">doctrine.orm.default_entity_manager</argument>
</argument>
<argument>default</argument>
<argument>default</argument>
</service>
<service id="doctrine.dbal.logger.profiling.default" class="Doctrine\DBAL\Logging\DebugStack" public="false"/>
<service id="doctrine.dbal.default_connection" class="stdClass" factory-method="createConnection" factory-service="doctrine.dbal.connection_factory">
<argument type="collection">
<argument key="dbname">symfony</argument>
<argument key="host">127.0.0.1</argument>
<argument key="port">null</argument>
<argument key="user">root</argument>
<argument key="password">null</argument>
<argument key="charset">UTF8</argument>
<argument key="driver">pdo_mysql</argument>
<argument key="driverOptions" type="collection"/>
</argument>
<argument type="service">
<service class="Doctrine\DBAL\Configuration" public="false">
<call method="setSQLLogger">
<argument type="service">
<service class="Doctrine\DBAL\Logging\LoggerChain" public="false">
<call method="addLogger">
<argument type="service">
<service class="Symfony\Bridge\Doctrine\Logger\DbalLogger" public="false">
<tag name="monolog.logger" channel="doctrine"/>
<argument type="service" id="monolog.logger.doctrine"/>
<argument type="service" id="debug.stopwatch"/>
</service>
</argument>
</call>
<call method="addLogger">
<argument type="service" id="doctrine.dbal.logger.profiling.default"/>
</call>
</service>
</argument>
</call>
</service>
</argument>
<argument type="service">
<service class="Symfony\Bridge\Doctrine\ContainerAwareEventManager" public="false">
<argument type="service" id="service_container"/>
</service>
</argument>
<argument type="collection"/>
</service>
<service id="form.type_guesser.doctrine" class="Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser">
<tag name="form.type_guesser"/>
<argument type="service" id="doctrine"/>
</service>
<service id="form.type.entity" class="Symfony\Bridge\Doctrine\Form\Type\EntityType">
<tag name="form.type" alias="entity"/>
<argument type="service" id="doctrine"/>
</service>
<service id="doctrine.orm.validator.unique" class="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator">
<tag name="validator.constraint_validator" alias="doctrine.orm.validator.unique"/>
<argument type="service" id="doctrine"/>
</service>
<service id="doctrine.orm.validator_initializer" class="Symfony\Bridge\Doctrine\Validator\DoctrineInitializer">
<tag name="validator.initializer"/>
<argument type="service" id="doctrine"/>
</service>
<service id="doctrine.orm.default_manager_configurator" class="Doctrine\Bundle\DoctrineBundle\ManagerConfigurator">
<argument type="collection"/>
</service>
<service id="doctrine.orm.default_entity_manager" class="EntityManager51a54ae0f0b4e_546a8d27f194334ee012bfe64f629947b07e4919\__CG__\Doctrine\ORM\EntityManager">
<file>C:/xampp18/htdocs/Symfony/app/cache/dev/jms_diextra/doctrine/EntityManager_51a54ae0f0b4e.php</file>
<argument type="service">
<service class="Doctrine\ORM\EntityManager" factory-method="create" public="false">
<argument type="service" id="doctrine.dbal.default_connection"/>
<argument type="service">
<service class="Doctrine\ORM\Configuration" public="false">
<call method="setEntityNamespaces">
<argument type="collection">
<argument key="gestiongestionBundle">gestion\gestionBundle\Entity</argument>
</argument>
</call>
<call method="setMetadataCacheImpl">
<argument type="service">
<service class="Doctrine\Common\Cache\ArrayCache" public="false">
<call method="setNamespace">
<argument>sf2orm_default_a103b868082149d466a2bdeb11a9d302</argument>
</call>
</service>
</argument>
</call>
<call method="setQueryCacheImpl">
<argument type="service">
<service class="Doctrine\Common\Cache\ArrayCache" public="false">
<call method="setNamespace">
<argument>sf2orm_default_a103b868082149d466a2bdeb11a9d302</argument>
</call>
</service>
</argument>
</call>
<call method="setResultCacheImpl">
<argument type="service">
<service class="Doctrine\Common\Cache\ArrayCache" public="false">
<call method="setNamespace">
<argument>sf2orm_default_a103b868082149d466a2bdeb11a9d302</argument>
</call>
</service>
</argument>
</call>
<call method="setMetadataDriverImpl">
<argument type="service">
<service class="Doctrine\ORM\Mapping\Driver\DriverChain" public="false">
<call method="addDriver">
<argument type="service">
<service class="Doctrine\ORM\Mapping\Driver\AnnotationDriver" public="false">
<argument type="service" id="annotation_reader"/>
<argument type="collection">
<argument>C:\xampp18\htdocs\Symfony\src\gestion\gestionBundle\Entity</argument>
</argument>
</service>
</argument>
<argument>gestion\gestionBundle\Entity</argument>
</call>
</service>
</argument>
</call>
<call method="setProxyDir">
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/doctrine/orm/Proxies</argument>
</call>
<call method="setProxyNamespace">
<argument>Proxies</argument>
</call>
<call method="setAutoGenerateProxyClasses">
<argument>true</argument>
</call>
<call method="setClassMetadataFactoryName">
<argument>Doctrine\ORM\Mapping\ClassMetadataFactory</argument>
</call>
<call method="setDefaultRepositoryClassName">
<argument>Doctrine\ORM\EntityRepository</argument>
</call>
<call method="setNamingStrategy">
<argument type="service">
<service class="Doctrine\ORM\Mapping\DefaultNamingStrategy" public="false"/>
</argument>
</call>
</service>
</argument>
<configurator service="doctrine.orm.default_manager_configurator" method="configure"/>
</service>
</argument>
<argument type="service" id="service_container"/>
</service>
<service id="sensio_framework_extra.view.guesser" class="Sensio\Bundle\FrameworkExtraBundle\Templating\TemplateGuesser">
<argument type="service" id="kernel"/>
</service>
<service id="sensio_framework_extra.controller.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
<argument type="service" id="annotation_reader"/>
</service>
<service id="sensio_framework_extra.converter.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
<argument type="service" id="sensio_framework_extra.converter.manager"/>
</service>
<service id="sensio_framework_extra.converter.manager" class="Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager">
<call method="add">
<argument type="service" id="sensio_framework_extra.converter.doctrine.orm"/>
<argument>0</argument>
<argument>doctrine.orm</argument>
</call>
<call method="add">
<argument type="service" id="sensio_framework_extra.converter.datetime"/>
<argument>0</argument>
<argument>datetime</argument>
</call>
</service>
<service id="sensio_framework_extra.converter.doctrine.orm" class="Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter">
<tag name="request.param_converter" converter="doctrine.orm"/>
<argument type="service" id="doctrine"/>
</service>
<service id="sensio_framework_extra.converter.datetime" class="Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter">
<tag name="request.param_converter" converter="datetime"/>
</service>
<service id="sensio_framework_extra.view.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
<tag name="kernel.event_listener" event="kernel.view" method="onKernelView"/>
<argument type="service" id="service_container"/>
</service>
<service id="sensio_framework_extra.cache.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\CacheListener">
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/>
</service>
<service id="jms_aop.pointcut_container" class="JMS\AopBundle\Aop\PointcutContainer"/>
<service id="jms_aop.interceptor_loader" class="JMS\AopBundle\Aop\InterceptorLoader">
<argument type="service" id="service_container"/>
</service>
<service id="jms_di_extra.metadata.metadata_factory" class="Metadata\MetadataFactory">
<argument type="service">
<service class="Metadata\Driver\LazyLoadingDriver" public="false">
<argument type="service" id="service_container"/>
<argument>jms_di_extra.metadata_driver</argument>
</service>
</argument>
<argument>Metadata\ClassHierarchyMetadata</argument>
<argument>true</argument>
<call method="setCache">
<argument type="service">
<service class="Metadata\Cache\FileCache" public="false">
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/jms_diextra/metadata</argument>
</service>
</argument>
</call>
</service>
<service id="jms_di_extra.metadata.converter" class="JMS\DiExtraBundle\Metadata\MetadataConverter"/>
<service id="jms_di_extra.controller_resolver" class="JMS\DiExtraBundle\HttpKernel\ControllerResolver" public="false">
<tag name="monolog.logger" channel="request"/>
<argument type="service" id="service_container"/>
<argument type="service" id="controller_name_converter"/>
<argument type="service" id="monolog.logger.request"/>
</service>
<service id="security.access.method_interceptor" class="JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor">
<tag name="monolog.logger" channel="security"/>
<argument type="service" id="security.context"/>
<argument type="service" id="security.authentication.manager"/>
<argument type="service" id="security.access.decision_manager"/>
<argument type="service">
<service class="JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager" public="false">
<argument type="collection"/>
</service>
</argument>
<argument type="service">
<service class="JMS\SecurityExtraBundle\Security\Authorization\RunAsManager" public="false">
<argument>RunAsToken</argument>
<argument>ROLE_</argument>
</service>
</argument>
<argument type="service" id="security.extra.metadata_factory"/>
<argument type="service" id="monolog.logger.security"/>
</service>
<service id="security.access.pointcut" class="JMS\SecurityExtraBundle\Security\Authorization\Interception\SecurityPointcut">
<tag name="jms_aop.pointcut" interceptor="security.access.method_interceptor"/>
<argument type="service" id="security.extra.metadata_factory"/>
<argument>false</argument>
<argument type="collection"/>
<call method="setSecuredClasses">
<argument type="collection"/>
</call>
</service>
<service id="security.extra.metadata_factory" class="Metadata\MetadataFactory" public="false">
<argument type="service">
<service class="Metadata\Driver\LazyLoadingDriver" public="false">
<argument type="service" id="service_container"/>
<argument>security.extra.metadata_driver</argument>
</service>
</argument>
<argument type="service">
<service class="Metadata\Cache\FileCache" public="false">
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/jms_security</argument>
<argument>true</argument>
</service>
</argument>
<call method="setIncludeInterfaces">
<argument>true</argument>
</call>
</service>
<service id="security.expressions.reverse_interpreter" class="JMS\SecurityExtraBundle\Security\Authorization\Expression\ReverseInterpreter">
<argument type="service" id="security.expressions.compiler"/>
<argument type="service" id="security.expressions.handler"/>
</service>
<service id="security.expressions.handler" class="JMS\SecurityExtraBundle\Security\Authorization\Expression\ContainerAwareExpressionHandler" public="false">
<argument type="service" id="service_container"/>
</service>
<service id="security.expressions.compiler" class="JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler">
<call method="addFunctionCompiler">
<argument type="service">
<service class="JMS\SecurityExtraBundle\Security\Acl\Expression\HasPermissionFunctionCompiler" public="false">
<tag name="security.expressions.function_compiler"/>
<tag name="security.expressions.variable" variable="permission_evaluator" service="security.acl.permission_evaluator"/>
</service>
</argument>
</call>
<call method="addTypeCompiler">
<argument type="service">
<service class="JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\ParameterExpressionCompiler" public="false">
<tag name="security.expressions.type_compiler"/>
</service>
</argument>
</call>
<call method="addTypeCompiler">
<argument type="service">
<service class="JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\ContainerAwareVariableCompiler" public="false">
<tag name="security.expressions.type_compiler"/>
<tag name="security.expressions.variable" variable="trust_resolver" service="security.authentication.trust_resolver"/>
<tag name="security.expressions.variable" variable="role_hierarchy" service="security.role_hierarchy"/>
<call method="setMaps">
<argument type="collection">
<argument key="trust_resolver">security.authentication.trust_resolver</argument>
<argument key="role_hierarchy">security.role_hierarchy</argument>
<argument key="permission_evaluator">security.acl.permission_evaluator</argument>
</argument>
<argument type="collection"/>
</call>
</service>
</argument>
</call>
</service>
<service id="twig.extension.acme.demo" class="Acme\DemoBundle\Twig\Extension\DemoExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="twig.loader"/>
</service>
<service id="acme.demo.listener" class="Acme\DemoBundle\EventListener\ControllerListener">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
<argument type="service" id="twig.extension.acme.demo"/>
</service>
<service id="web_profiler.controller.profiler" class="Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController">
<argument type="service" id="router"/>
<argument type="service" id="profiler"/>
<argument type="service" id="twig"/>
<argument type="collection">
<argument key="data_collector.config" type="collection">
<argument>config</argument>
<argument>@WebProfiler/Collector/config.html.twig</argument>
</argument>
<argument key="data_collector.request" type="collection">
<argument>request</argument>
<argument>@WebProfiler/Collector/request.html.twig</argument>
</argument>
<argument key="data_collector.exception" type="collection">
<argument>exception</argument>
<argument>@WebProfiler/Collector/exception.html.twig</argument>
</argument>
<argument key="data_collector.events" type="collection">
<argument>events</argument>
<argument>@WebProfiler/Collector/events.html.twig</argument>
</argument>
<argument key="data_collector.logger" type="collection">
<argument>logger</argument>
<argument>@WebProfiler/Collector/logger.html.twig</argument>
</argument>
<argument key="data_collector.time" type="collection">
<argument>time</argument>
<argument>@WebProfiler/Collector/time.html.twig</argument>
</argument>
<argument key="data_collector.memory" type="collection">
<argument>memory</argument>
<argument>@WebProfiler/Collector/memory.html.twig</argument>
</argument>
<argument key="data_collector.router" type="collection">
<argument>router</argument>
<argument>@WebProfiler/Collector/router.html.twig</argument>
</argument>
<argument key="data_collector.security" type="collection">
<argument>security</argument>
<argument>SecurityBundle:Collector:security</argument>
</argument>
<argument key="swiftmailer.data_collector" type="collection">
<argument>swiftmailer</argument>
<argument>SwiftmailerBundle:Collector:swiftmailer</argument>
</argument>
<argument key="data_collector.doctrine" type="collection">
<argument>db</argument>
<argument>DoctrineBundle:Collector:db</argument>
</argument>
</argument>
<argument>bottom</argument>
</service>
<service id="web_profiler.controller.router" class="Symfony\Bundle\WebProfilerBundle\Controller\RouterController">
<argument type="service" id="profiler"/>
<argument type="service" id="twig"/>
<argument type="service" id="router"/>
</service>
<service id="web_profiler.controller.exception" class="Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController">
<argument type="service" id="profiler"/>
<argument type="service" id="twig"/>
<argument>true</argument>
</service>
<service id="web_profiler.debug_toolbar" class="Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener">
<tag name="kernel.event_subscriber"/>
<argument type="service" id="twig"/>
<argument>false</argument>
<argument>2</argument>
<argument>bottom</argument>
</service>
<service id="sensio.distribution.webconfigurator" class="Sensio\Bundle\DistributionBundle\Configurator\Configurator">
<argument>C:/xampp18/htdocs/Symfony/app</argument>
</service>
<service id="monolog.logger.request" class="Symfony\Bridge\Monolog\Logger">
<argument>request</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.chromephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.event" class="Symfony\Bridge\Monolog\Logger">
<argument>event</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.chromephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.deprecation" class="Symfony\Bridge\Monolog\Logger">
<argument>deprecation</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.chromephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.templating" class="Symfony\Bridge\Monolog\Logger">
<argument>templating</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.chromephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.profiler" class="Symfony\Bridge\Monolog\Logger">
<argument>profiler</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.chromephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.router" class="Symfony\Bridge\Monolog\Logger">
<argument>router</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.chromephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.security" class="Symfony\Bridge\Monolog\Logger">
<argument>security</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.chromephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.doctrine" class="Symfony\Bridge\Monolog\Logger">
<argument>doctrine</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.chromephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.handler.debug" class="Symfony\Bridge\Monolog\Handler\DebugHandler">
<argument>100</argument>
<argument>true</argument>
</service>
<service id="session.storage.filesystem" class="Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage">
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/sessions</argument>
</service>
<service id="session.handler" class="Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler">
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/sessions</argument>
</service>
<service id="templating.loader" class="Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader">
<argument type="service" id="templating.locator"/>
</service>
<service id="templating" class="Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine">
<argument type="service" id="twig"/>
<argument type="service" id="templating.name_parser"/>
<argument type="service" id="templating.locator"/>
<argument type="service" id="debug.stopwatch"/>
<argument type="service" id="templating.globals"/>
<call method="setDefaultEscapingStrategy">
<argument type="collection">
<argument type="service" id="templating"/>
<argument>guessDefaultEscapingStrategy</argument>
</argument>
</call>
</service>
<service id="router" class="Symfony\Bundle\FrameworkBundle\Routing\Router">
<tag name="monolog.logger" channel="router"/>
<argument type="service" id="service_container"/>
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/assetic/routing.yml</argument>
<argument type="collection">
<argument key="cache_dir">C:/xampp18/htdocs/Symfony/app/cache/dev</argument>
<argument key="debug">true</argument>
<argument key="generator_class">Symfony\Component\Routing\Generator\UrlGenerator</argument>
<argument key="generator_base_class">Symfony\Component\Routing\Generator\UrlGenerator</argument>
<argument key="generator_dumper_class">Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper</argument>
<argument key="generator_cache_class">appDevUrlGenerator</argument>
<argument key="matcher_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</argument>
<argument key="matcher_base_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</argument>
<argument key="matcher_dumper_class">Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper</argument>
<argument key="matcher_cache_class">appDevUrlMatcher</argument>
<argument key="strict_requirements">true</argument>
</argument>
<argument type="service" id="router.request_context"/>
<argument type="service" id="monolog.logger.router"/>
</service>
<service id="annotation_reader" class="Doctrine\Common\Annotations\FileCacheReader">
<argument type="service">
<service class="Doctrine\Common\Annotations\AnnotationReader" public="false"/>
</argument>
<argument>C:/xampp18/htdocs/Symfony/app/cache/dev/annotations</argument>
<argument>true</argument>
</service>
<service id="security.encoder_factory" class="Symfony\Component\Security\Core\Encoder\EncoderFactory">
<argument type="collection">
<argument key="Symfony\Component\Security\Core\User\User" type="collection">
<argument key="class">%security.encoder.plain.class%</argument>
<argument key="arguments" type="collection">
<argument>false</argument>
</argument>
</argument>
</argument>
</service>
<service id="twig.loader" class="Symfony\Bundle\TwigBundle\Loader\FilesystemLoader">
<tag name="twig.loader"/>
<argument type="service" id="templating.locator"/>
<argument type="service" id="templating.name_parser"/>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\vendor\symfony\symfony\src\Symfony\Bridge\Twig/Resources/views/Form</argument>
</call>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/views</argument>
<argument>Framework</argument>
</call>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\SecurityBundle/Resources/views</argument>
<argument>Security</argument>
</call>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle/Resources/views</argument>
<argument>Twig</argument>
</call>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\vendor\symfony\swiftmailer-bundle\Symfony\Bundle\SwiftmailerBundle/Resources/views</argument>
<argument>Swiftmailer</argument>
</call>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\vendor\doctrine\doctrine-bundle\Doctrine\Bundle\DoctrineBundle/Resources/views</argument>
<argument>Doctrine</argument>
</call>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\src\miCalculadora\calcuBundle/Resources/views</argument>
<argument>miCalculadoracalcu</argument>
</call>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\src\gestion\gestionBundle/Resources/views</argument>
<argument>gestiongestion</argument>
</call>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\src\Acme\DemoBundle/Resources/views</argument>
<argument>AcmeDemo</argument>
</call>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\WebProfilerBundle/Resources/views</argument>
<argument>WebProfiler</argument>
</call>
<call method="addPath">
<argument>C:\xampp18\htdocs\Symfony\vendor\sensio\distribution-bundle\Sensio\Bundle\DistributionBundle/Resources/views</argument>
<argument>SensioDistribution</argument>
</call>
<call method="addPath">
<argument>C:/xampp18/htdocs/Symfony/app/Resources/views</argument>
</call>
</service>
<service id="logger" class="Symfony\Bridge\Monolog\Logger">
<argument>app</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.chromephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="swiftmailer.transport" class="Swift_Transport_SpoolTransport">
<argument type="service" id="swiftmailer.transport.eventdispatcher"/>
<argument type="service" id="swiftmailer.spool"/>
<call method="registerPlugin">
<argument type="service" id="swiftmailer.plugin.messagelogger"/>
</call>
</service>
<service id="mailer" class="Swift_Mailer">
<argument type="service" id="swiftmailer.transport"/>
</service>
<service id="swiftmailer.transport.real" class="Swift_Transport_EsmtpTransport">
<argument type="service">
<service class="Swift_Transport_StreamBuffer" public="false">
<argument type="service">
<service class="Swift_StreamFilters_StringReplacementFilterFactory" public="false"/>
</argument>
</service>
</argument>
<argument type="collection">
<argument type="service">
<service class="Swift_Transport_Esmtp_AuthHandler" public="false">
<argument type="collection">
<argument type="service">
<service class="Swift_Transport_Esmtp_Auth_CramMd5Authenticator" public="false"/>
</argument>
<argument type="service">
<service class="Swift_Transport_Esmtp_Auth_LoginAuthenticator" public="false"/>
</argument>
<argument type="service">
<service class="Swift_Transport_Esmtp_Auth_PlainAuthenticator" public="false"/>
</argument>
</argument>
</service>
</argument>
</argument>
<argument type="service" id="swiftmailer.transport.eventdispatcher"/>
<call method="setHost">
<argument>127.0.0.1</argument>
</call>
<call method="setPort">
<argument>25</argument>
</call>
<call method="setEncryption">
<argument>null</argument>
</call>
<call method="setUsername">
<argument>null</argument>
</call>
<call method="setPassword">
<argument>null</argument>
</call>
<call method="setAuthMode">
<argument>null</argument>
</call>
<call method="setTimeout">
<argument>30</argument>
</call>
<call method="setSourceIp">
<argument>null</argument>
</call>
</service>
<service id="swiftmailer.spool" class="Swift_MemorySpool"/>
<service id="jms_di_extra.metadata_driver" class="JMS\DiExtraBundle\Metadata\Driver\AnnotationDriver">
<argument type="service" id="annotation_reader"/>
</service>
<service id="security.extra.metadata_driver" class="Metadata\Driver\DriverChain">
<argument type="collection">
<argument type="service">
<service class="JMS\SecurityExtraBundle\Metadata\Driver\AnnotationDriver" public="false">
<argument type="service" id="annotation_reader"/>
</service>
</argument>
</argument>
</service>
<service id="session.storage" alias="session.storage.native"/>
<service id="debug.templating.engine.twig" alias="templating"/>
<service id="database_connection" alias="doctrine.dbal.default_connection"/>
<service id="doctrine.orm.entity_manager" alias="doctrine.orm.default_entity_manager"/>
</services>
</container>
| {
"content_hash": "ee52b3043a736a7a922a21d1c786a30a",
"timestamp": "",
"source": "github",
"line_count": 2906,
"max_line_length": 228,
"avg_line_length": 59.167240192704746,
"alnum_prop": 0.6926951262068163,
"repo_name": "elenaGonzalez/CursoSymfony",
"id": "a84b61adca47a1c5a33402dc9c63c198857c4297",
"size": "171940",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/cache/dev/appDevDebugProjectContainer.xml",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
.. _install:
============
Installation
============
The easiest way to install Elephant is by creating a conda environment, followed by ``pip install elephant``.
Below is the explanation of how to proceed with these two steps.
.. _prerequisites:
*************
Prerequisites
*************
Elephant requires `Python <http://python.org/>`_ 3.6, 3.7, 3.8, or 3.9.
.. tabs::
.. tab:: (recommended) Conda (Linux/MacOS/Windows)
1. Create your conda environment (e.g., `elephant`):
.. code-block:: sh
conda create --name elephant python=3.7 numpy scipy tqdm
2. Activate your environment:
.. code-block:: sh
conda activate elephant
.. tab:: Debian/Ubuntu
Open a terminal and run:
.. code-block:: sh
sudo apt-get install python-pip python-numpy python-scipy python-pip python-six python-tqdm
************
Installation
************
.. tabs::
.. tab:: Stable release version
The easiest way to install Elephant is via `pip <http://pypi.python.org/pypi/pip>`_:
.. code-block:: sh
pip install elephant
If you want to use advanced features of Elephant, install the package
with extras:
.. code-block:: sh
pip install elephant[extras]
To upgrade to a newer release use the ``--upgrade`` flag:
.. code-block:: sh
pip install --upgrade elephant
If you do not have permission to install software systemwide, you can
install into your user directory using the ``--user`` flag:
.. code-block:: sh
pip install --user elephant
.. tab:: Development version
If you have `Git <https://git-scm.com/>`_ installed on your system,
it is also possible to install the development version of Elephant.
1. Before installing the development version, you may need to uninstall
the previously installed version of Elephant:
.. code-block:: sh
pip uninstall elephant
2. Clone the repository and install the local version:
.. code-block:: sh
git clone git://github.com/NeuralEnsemble/elephant.git
cd elephant
.. tabs::
.. tab:: Minimal setup
.. code-block:: sh
pip install -e .
.. tab:: conda (with extras)
.. code-block:: sh
conda remove -n elephant --all # remove the previous environment
conda env create -f requirements/environment.yml
conda activate elephant
pip install -e .
***********
MPI support
***********
Some Elephant modules (ASSET, SPADE, etc.) are parallelized to run with MPI.
In order to make use of MPI parallelization, you need to install ``mpi4py``
package:
.. tabs::
.. tab:: conda (easiest)
.. code-block:: sh
conda install -c conda-forge mpi4py
.. tab:: pip (Linux)
.. code-block:: sh
sudo apt install -y libopenmpi-dev openmpi-bin
pip install mpi4py
To run a python script that supports MPI parallelization, run in a terminal:
.. code-block:: sh
mpiexec -n numprocs python -m mpi4py pyfile [arg] ...
For more information, refer to `mpi4py
<https://mpi4py.readthedocs.io/en/stable/mpi4py.run.html>`_ documentation.
***********************
CUDA and OpenCL support
***********************
:ref:`asset` module supports CUDA and OpenCL. These are experimental features.
You can have one, both, or none installed in your system.
.. tabs::
.. tab:: CUDA
To leverage CUDA acceleration on an NVIDIA GPU card, `CUDA toolkit
<https://developer.nvidia.com/cuda-downloads>`_ must installed on
your system. Then run the following command in a terminal:
.. code-block:: sh
pip install pycuda
In case you experience issues installing PyCUDA, `this guide
<https://medium.com/leadkaro/setting-up-pycuda-on-ubuntu-18-04-for-
gpu-programming-with-python-830e03fc4b81>`_ offers a step-by-step
installation manual.
If PyCUDA is detected and installed, CUDA backend is used by default in
Elephant ASSET module. To turn off CUDA support, set ``ELEPHANT_USE_CUDA``
environment flag to ``0``.
.. tab:: OpenCL
If you have a laptop with a built-in Intel Graphics Card, you can still
leverage significant performance optimization with OpenCL backend.
The simplest way to install PyOpenCL is to run a conda command:
.. code-block:: sh
conda install -c conda-forge pyopencl intel-compute-runtime
However, if you have root (sudo) privileges, it's recommended to install
up-to-date `Intel Graphics Compute Runtime
<https://github.com/intel/compute-runtime/releases>`_ system-wide and then
install PyOpenCL as follows:
.. code-block:: sh
conda install -c conda-forge pyopencl ocl-icd-system
Set ``ELEPHANT_USE_OPENCL`` environment flag to ``0`` to turn off
PyOpenCL support.
.. note::
Make sure you've disabled GPU Hangcheck as described in the
`Intel GPU developers documentation <https://software.intel.com/
content/www/us/en/develop/documentation/get-started-with-intel-
oneapi-base-linux/top/before-you-begin.html>`_. Do it with caution -
using your graphics card to perform computations may make the system
unresponsive until the compute program terminates.
************
Dependencies
************
Elephant relies on two special packages, installed by default:
* `quantities <http://pypi.python.org/pypi/quantities>`_ - support for physical quantities with units (mV, ms, etc.)
* `neo <http://pypi.python.org/pypi/neo>`_ - electrophysiology data manipulations
| {
"content_hash": "f0a8635afc8ea77bfa3a8e22370fc3b7",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 120,
"avg_line_length": 27.194570135746606,
"alnum_prop": 0.6119800332778702,
"repo_name": "mdenker/elephant",
"id": "541e445655b8b81864a12eb39f157b5bd746815b",
"size": "6010",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/install.rst",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "11359"
},
{
"name": "C++",
"bytes": "92294"
},
{
"name": "Cuda",
"bytes": "21912"
},
{
"name": "Python",
"bytes": "1712932"
}
],
"symlink_target": ""
} |
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}add_contract_form{% endblock %}
{% block form_action %}{% url 'horizon:project:policytargets:add_contract' policy_target_id %}{% endblock %}
{% block modal-header %}{% trans "Add Policy Rule Set" %}{% endblock %}
{% block modal-body %}
<div class="left">
<fieldset>
{% include "horizon/common/_form_fields.html" %}
</fieldset>
</div>
<div class="right">
<h3>{% trans "Description:" %}</h3>
<p>{% trans "Add Policy Rule Set. Press Ctrl to select multiple items." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url 'horizon:project:policytargets:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
| {
"content_hash": "b5c5ffbc90699f686a717f21d8fcd24b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 119,
"avg_line_length": 35.28,
"alnum_prop": 0.6326530612244898,
"repo_name": "tbachman/group-based-policy-ui",
"id": "b8cfd152a675cb2c2e3c43fa07713403e7620352",
"size": "882",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "gbpui/panels/policytargets/templates/policytargets/_add_contract.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "32887"
},
{
"name": "HTML",
"bytes": "58517"
},
{
"name": "JavaScript",
"bytes": "4491"
},
{
"name": "Python",
"bytes": "284077"
},
{
"name": "Shell",
"bytes": "16643"
}
],
"symlink_target": ""
} |
<?php
namespace OpenCFP\Http\Controller;
use Cartalyst\Sentry\Sentry;
use Cartalyst\Sentry\Users\UserExistsException;
use OpenCFP\Http\Form\SignupForm;
use OpenCFP\Infrastructure\Crypto\PseudoRandomStringGenerator;
use Silex\Application;
use Spot\Locator;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
class SignupController extends BaseController
{
use FlashableTrait;
public function indexAction(Request $req, $currentTimeString = 'now')
{
/* @var Sentry $sentry */
$sentry = $this->service('sentry');
if ($sentry->check()) {
return $this->redirectTo('dashboard');
}
if (strtotime($this->app->config('application.enddate') . ' 11:59 PM') < strtotime($currentTimeString)) {
$this->service('session')->set('flash', [
'type' => 'error',
'short' => 'Error',
'ext' => 'Sorry, the call for papers has ended.',
]);
return $this->redirectTo('homepage');
}
return $this->render('user/create.twig', [
'transportation' => 0,
'hotel' => 0,
'formAction' => $this->url('user_create'),
'buttonInfo' => 'Create my speaker profile',
'coc_link' => $this->app->config('application.coc_link'),
]);
}
public function processAction(Request $req, Application $app)
{
$form_data = [
'formAction' => $this->url('user_create'),
'first_name' => $req->get('first_name'),
'last_name' => $req->get('last_name'),
'company' => $req->get('company'),
'twitter' => $req->get('twitter'),
'email' => $req->get('email'),
'password' => $req->get('password'),
'password2' => $req->get('password2'),
'airport' => $req->get('airport'),
'agree_coc' => $req->get('agree_coc'),
'buttonInfo' => 'Create my speaker profile',
'coc_link' => $this->app->config('application.coc_link'),
];
$form_data['speaker_info'] = $req->get('speaker_info') ?: null;
$form_data['speaker_bio'] = $req->get('speaker_bio') ?: null;
$form_data['transportation'] = $req->get('transportation') ?: null;
$form_data['hotel'] = $req->get('hotel') ?: null;
$form_data['speaker_photo'] = null;
if ($req->files->get('speaker_photo') !== null) {
$form_data['speaker_photo'] = $req->files->get('speaker_photo');
}
$form = new SignupForm($form_data, $app['purifier'], ['has_coc' => !empty($app->config('application.coc_link'))]);
$isValid = $form->validateAll();
if ($isValid) {
$sanitized_data = $form->getCleanData();
if (isset($form_data['speaker_photo'])) {
/** @var \Symfony\Component\HttpFoundation\File\UploadedFile $file */
$file = $form_data['speaker_photo'];
/** @var ProfileImageProcessor $processor */
$processor = $app['profile_image_processor'];
/** @var PseudoRandomStringGenerator $generator */
$generator = $app['security.random'];
/**
* The extension technically is not required. We guess the extension using a trusted method.
*/
$sanitized_data['speaker_photo'] = $generator->generate(40) . '.' . $file->guessExtension();
$processor->process($file, $sanitized_data['speaker_photo']);
}
// Create account using Sentry
try {
$user_data = [
'first_name' => $sanitized_data['first_name'],
'last_name' => $sanitized_data['last_name'],
'company' => $sanitized_data['company'],
'twitter' => $sanitized_data['twitter'],
'email' => $sanitized_data['email'],
'password' => $sanitized_data['password'],
'airport' => $sanitized_data['airport'],
'activated' => 1,
];
/* @var Sentry $sentry */
$sentry = $app['sentry'];
$user = $sentry->getUserProvider()->create($user_data);
// Add them to the proper group
$user->addGroup($sentry
->getGroupProvider()
->findByName('Speakers')
);
/* @var Locator $spot */
$spot = $app['spot'];
// Add in the extra speaker information
$mapper = $spot->mapper('\OpenCFP\Domain\Entity\User');
$speaker = $mapper->get($user->id);
$speaker->info = $sanitized_data['speaker_info'];
$speaker->bio = $sanitized_data['speaker_bio'];
$speaker->photo_path = $sanitized_data['speaker_photo'];
$speaker->transportation = (int) $sanitized_data['transportation'];
$speaker->hotel = (int) $sanitized_data['hotel'];
$mapper->save($speaker);
// This is for redirecting to OAuth endpoint if we arrived
// as part of the Authorization Code Grant flow.
if ($this->service('session')->has('redirectTo')) {
$sentry->login($user);
return new RedirectResponse($this->service('session')->get('redirectTo'));
}
// Set Success Flash Message
$app['session']->set('flash', [
'type' => 'success',
'short' => 'Success',
'ext' => "You've successfully created your account!",
]);
return $this->redirectTo('login');
} catch (UserExistsException $e) {
$app['session']->set('flash', [
'type' => 'error',
'short' => 'Error',
'ext' => 'A user already exists with that email address',
]);
}
}
if (!$isValid) {
// Set Error Flash Message
$app['session']->set('flash', [
'type' => 'error',
'short' => 'Error',
'ext' => implode("<br>", $form->getErrorMessages()),
]);
}
$form_data['flash'] = $this->getFlash($app);
return $this->render('user/create.twig', $form_data);
}
}
| {
"content_hash": "9c9a2dfb4968fe51ac2dd97b1446e82c",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 122,
"avg_line_length": 38.83529411764706,
"alnum_prop": 0.49378976067858227,
"repo_name": "OpenWestConference/opencfp",
"id": "0f03c0a588e24102087b767c789df97941fb6f83",
"size": "6602",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "classes/Http/Controller/SignupController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6385"
},
{
"name": "HTML",
"bytes": "69315"
},
{
"name": "JavaScript",
"bytes": "5151"
},
{
"name": "Makefile",
"bytes": "381"
},
{
"name": "PHP",
"bytes": "569258"
},
{
"name": "Shell",
"bytes": "2174"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe 'orphaning a vm', type: :integration do
with_reset_sandbox_before_each
let(:cloud_config) do
cloud_config = Bosh::Spec::NewDeployments.simple_cloud_config
cloud_config['networks'][0]['type'] = 'manual'
cloud_config
end
let(:manifest) do
manifest = Bosh::Spec::NewDeployments.simple_manifest_with_instance_groups(instances: 2)
manifest['instance_groups'][0]['persistent_disk'] = 660
manifest['update'] = manifest['update'].merge('vm_strategy' => 'create-swap-delete')
manifest
end
before do
deploy_from_scratch(manifest_hash: manifest, cloud_config_hash: cloud_config)
end
context 'when a create-swap-delete deployment succeeds on the first attempt' do
it 'orphans the old vm' do
deploy_simple_manifest(manifest_hash: manifest, recreate: true)
vms = table(bosh_runner.run('vms', json: true))
expect(vms.length).to eq(2)
orphaned_vms = table(bosh_runner.run('orphaned-vms', json: true))
expect(orphaned_vms.length).to eq(2)
end
end
context 'when a create-swap-delete deployment fails' do
it 'orphans the old vms upon a subsequent, successful deployment' do
current_sandbox.cpi.commands.make_detach_disk_to_raise_not_implemented
deploy_simple_manifest(manifest_hash: manifest, recreate: true, failure_expected: true)
vms = table(bosh_runner.run('vms', json: true))
expect(vms.length).to eq(4)
orphaned_vms = table(bosh_runner.run('orphaned-vms', json: true))
expect(orphaned_vms.length).to eq(0)
current_sandbox.cpi.commands.allow_detach_disk_to_succeed
deploy_simple_manifest(manifest_hash: manifest, recreate: true)
vms = table(bosh_runner.run('vms', json: true))
expect(vms.length).to eq(2)
orphaned_vms = table(bosh_runner.run('orphaned-vms', json: true))
expect(orphaned_vms.length).to eq(4)
end
context 'when a create-swap-delete deployment fails multiple times' do
it 'should not create more than a single inactive vm per instance' do
current_sandbox.cpi.commands.make_detach_disk_to_raise_not_implemented
deploy_simple_manifest(manifest_hash: manifest, recreate: true, failure_expected: true)
vms = table(bosh_runner.run('vms', json: true))
expect(vms.length).to eq(4)
orphaned_vms = table(bosh_runner.run('orphaned-vms', json: true))
expect(orphaned_vms.length).to eq(0)
deploy_simple_manifest(manifest_hash: manifest, failure_expected: true)
vms = table(bosh_runner.run('vms', json: true))
expect(vms.length).to eq(4)
deploy_simple_manifest(manifest_hash: manifest, failure_expected: true)
vms = table(bosh_runner.run('vms', json: true))
expect(vms.length).to eq(4)
orphaned_vms = table(bosh_runner.run('orphaned-vms', json: true))
expect(orphaned_vms.length).to eq(0)
end
end
context 'when there is an unresponsive agent' do
it 'successfully deploys' do
director.instances.first.kill_agent
deploy_simple_manifest(manifest_hash: manifest, recreate: true, fix: true)
vms = table(bosh_runner.run('vms', json: true))
expect(vms.length).to eq(2)
# the second instance successfully orphans the existing vm
orphaned_vms = table(bosh_runner.run('orphaned-vms', json: true))
expect(orphaned_vms.length).to eq(1)
end
context 'when the deloyment fails multiple times with some unrepsonsive vms' do
it 'orphans only the responsive vms and does not release orphaned vm network plans' do
current_sandbox.cpi.commands.make_detach_disk_to_raise_not_implemented
deploy_simple_manifest(manifest_hash: manifest, recreate: true, failure_expected: true)
vms = table(bosh_runner.run('vms', json: true))
expect(vms.length).to eq(4)
orphaned_vms = table(bosh_runner.run('orphaned-vms', json: true))
expect(orphaned_vms.length).to eq(0)
director.instances.last.kill_agent
current_sandbox.cpi.commands.allow_detach_disk_to_succeed
deploy_simple_manifest(manifest_hash: manifest, recreate: true, fix: true)
vms = table(bosh_runner.run('vms', json: true))
expect(vms.length).to eq(2)
orphaned_vms = table(bosh_runner.run('orphaned-vms', json: true))
expect(orphaned_vms.length).to eq(3)
deploy_simple_manifest(manifest_hash: manifest, recreate: true)
vms = table(bosh_runner.run('vms', json: true))
expect(vms.length).to eq(2)
orphaned_vms = table(bosh_runner.run('orphaned-vms', json: true))
expect(orphaned_vms.length).to eq(5)
end
end
end
end
end
| {
"content_hash": "f06bba49867381f4085e4ec1ccd20e6c",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 97,
"avg_line_length": 37.3671875,
"alnum_prop": 0.6656909889190884,
"repo_name": "barthy1/bosh",
"id": "12e39541f95c53a73273a04da87bcf8bbb379f38",
"size": "4783",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/spec/gocli/integration/vm_orphan_spec.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "11145"
},
{
"name": "Go",
"bytes": "56502"
},
{
"name": "HCL",
"bytes": "10057"
},
{
"name": "HTML",
"bytes": "59167"
},
{
"name": "Ruby",
"bytes": "7205717"
},
{
"name": "Shell",
"bytes": "116927"
}
],
"symlink_target": ""
} |
package org.seasar.doma.internal.jdbc.command;
import java.util.Map;
import java.util.stream.Collector;
import org.seasar.doma.MapKeyNamingType;
/**
*
* @author nakamura-to
*
* @param <RESULT>
*/
public class MapCollectorHandler<RESULT> extends
AbstractCollectorHandler<Map<String, Object>, RESULT> {
public MapCollectorHandler(MapKeyNamingType mapKeyNamingType,
Collector<Map<String, Object>, ?, RESULT> collector) {
super(new MapStreamHandler<>(mapKeyNamingType,
s -> s.collect(collector)));
}
}
| {
"content_hash": "2dcd9519c1c53b578c8dc362bfc49bc7",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 66,
"avg_line_length": 23.458333333333332,
"alnum_prop": 0.6909413854351687,
"repo_name": "backpaper0/doma2",
"id": "740f692a3695fa2c6b32f6396add4344781c5475",
"size": "1188",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/org/seasar/doma/internal/jdbc/command/MapCollectorHandler.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "4666069"
},
{
"name": "Shell",
"bytes": "499"
}
],
"symlink_target": ""
} |
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/pwm.h>
#include <zephyr/device.h>
#include <zephyr/display/mb_display.h>
#define PERIOD_MIN PWM_USEC(50)
#define PERIOD_MAX PWM_USEC(3900)
#define BEEP_DURATION K_MSEC(60)
#define NS_TO_HZ(_ns) (NSEC_PER_SEC / (_ns))
static const struct pwm_dt_spec pwm = PWM_DT_SPEC_GET(DT_PATH(zephyr_user));
static uint32_t period;
static struct k_work beep_work;
static volatile bool beep_active;
static const struct gpio_dt_spec sw0_gpio = GPIO_DT_SPEC_GET(DT_ALIAS(sw0), gpios);
static const struct gpio_dt_spec sw1_gpio = GPIO_DT_SPEC_GET(DT_ALIAS(sw1), gpios);
/* ensure SW0 & SW1 are on same gpio controller */
BUILD_ASSERT(DT_SAME_NODE(DT_GPIO_CTLR(DT_ALIAS(sw0), gpios), DT_GPIO_CTLR(DT_ALIAS(sw1), gpios)));
static void beep(struct k_work *work)
{
/* The "period / 2" pulse duration gives 50% duty cycle, which
* should result in the maximum sound volume.
*/
pwm_set_dt(&pwm, period, period / 2U);
k_sleep(BEEP_DURATION);
/* Disable the PWM */
pwm_set_pulse_dt(&pwm, 0);
/* Ensure there's a clear silent period between two tones */
k_sleep(K_MSEC(50));
beep_active = false;
}
static void button_pressed(const struct device *dev, struct gpio_callback *cb,
uint32_t pins)
{
struct mb_display *disp;
if (beep_active) {
printk("Button press while beeping\n");
return;
}
beep_active = true;
if (pins & BIT(sw0_gpio.pin)) {
printk("A pressed\n");
if (period < PERIOD_MAX) {
period += PWM_USEC(50U);
}
} else {
printk("B pressed\n");
if (period > PERIOD_MIN) {
period -= PWM_USEC(50U);
}
}
printk("Period is %u us (%u Hz)\n", period / NSEC_PER_USEC,
NS_TO_HZ(period));
disp = mb_display_get();
mb_display_print(disp, MB_DISPLAY_MODE_DEFAULT, 500, "%uHz",
NS_TO_HZ(period));
k_work_submit(&beep_work);
}
void main(void)
{
static struct gpio_callback button_cb_data;
if (!device_is_ready(pwm.dev)) {
printk("%s: device not ready.\n", pwm.dev->name);
return;
}
/* since sw0_gpio.port == sw1_gpio.port, we only need to check ready once */
if (!device_is_ready(sw0_gpio.port)) {
printk("%s: device not ready.\n", sw0_gpio.port->name);
return;
}
period = pwm.period;
gpio_pin_configure_dt(&sw0_gpio, GPIO_INPUT);
gpio_pin_configure_dt(&sw1_gpio, GPIO_INPUT);
gpio_pin_interrupt_configure_dt(&sw0_gpio, GPIO_INT_EDGE_TO_ACTIVE);
gpio_pin_interrupt_configure_dt(&sw1_gpio, GPIO_INT_EDGE_TO_ACTIVE);
gpio_init_callback(&button_cb_data, button_pressed,
BIT(sw0_gpio.pin) | BIT(sw1_gpio.pin));
k_work_init(&beep_work, beep);
/* Notify with a beep that we've started */
k_work_submit(&beep_work);
gpio_add_callback(sw0_gpio.port, &button_cb_data);
}
| {
"content_hash": "487678f6dc0f4059034aa3c5df763b4b",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 99,
"avg_line_length": 24.99099099099099,
"alnum_prop": 0.6719538572458543,
"repo_name": "zephyrproject-rtos/zephyr",
"id": "13ff462c0ea20ef1afe9deba069e34af6589a840",
"size": "2862",
"binary": false,
"copies": "4",
"ref": "refs/heads/main",
"path": "samples/boards/bbc_microbit/sound/src/main.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "444860"
},
{
"name": "Batchfile",
"bytes": "110"
},
{
"name": "C",
"bytes": "45371144"
},
{
"name": "C++",
"bytes": "29398"
},
{
"name": "CMake",
"bytes": "1408561"
},
{
"name": "Cadence",
"bytes": "1501"
},
{
"name": "EmberScript",
"bytes": "997"
},
{
"name": "Forth",
"bytes": "1648"
},
{
"name": "GDB",
"bytes": "1285"
},
{
"name": "Haskell",
"bytes": "753"
},
{
"name": "JetBrains MPS",
"bytes": "3312"
},
{
"name": "PLSQL",
"bytes": "281"
},
{
"name": "Perl",
"bytes": "215578"
},
{
"name": "Python",
"bytes": "2273122"
},
{
"name": "Shell",
"bytes": "173841"
},
{
"name": "SmPL",
"bytes": "36840"
},
{
"name": "Smalltalk",
"bytes": "1885"
},
{
"name": "SourcePawn",
"bytes": "14890"
},
{
"name": "Tcl",
"bytes": "7034"
},
{
"name": "VBA",
"bytes": "294"
},
{
"name": "Verilog",
"bytes": "6394"
}
],
"symlink_target": ""
} |
module.exports = require('./dist');
| {
"content_hash": "d986934eb73670bc0319a7632e3fc54c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 35,
"avg_line_length": 36,
"alnum_prop": 0.6666666666666666,
"repo_name": "tajo/bulldozer",
"id": "c1b27797befaa635c09b720e47b96f0f786cc77f",
"size": "57",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "11927"
}
],
"symlink_target": ""
} |
import { BasicBadgeModule } from './basic-badge.module';
describe('BasicBadgeModule', () => {
let basicBadgeModule: BasicBadgeModule;
beforeEach(() => {
basicBadgeModule = new BasicBadgeModule();
});
it('should create an instance', () => {
expect(basicBadgeModule).toBeTruthy();
});
});
| {
"content_hash": "e154c3765f5da856d32bde2d09e24ad2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 56,
"avg_line_length": 23.692307692307693,
"alnum_prop": 0.6558441558441559,
"repo_name": "A-l-y-l-e/Alyle-UI",
"id": "d3381266aad2f859c47482741f2fb6aebac1baca",
"size": "308",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/app/docs/components/badge-demo/basic-badge/basic-badge.module.spec.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1958186"
},
{
"name": "JavaScript",
"bytes": "6569"
},
{
"name": "Shell",
"bytes": "4177"
},
{
"name": "TypeScript",
"bytes": "1142002"
}
],
"symlink_target": ""
} |
package java.io;
import com.facebook.infer.models.InferUndefined;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class ObjectInputStream extends InputStream {
private InputStream emptyStream;
private static Object UNSHARED_OBJ;
private boolean hasPushbackTC;
private byte pushbackTC;
private int nestedLevels;
private int nextHandle;
private DataInputStream input;
private DataInputStream primitiveTypes;
private InputStream primitiveData;
private boolean enableResolve;
private ArrayList<Object> objectsRead;
private Object currentObject;
private ObjectStreamClass currentClass;
private InputValidationDesc[] validations;
private boolean subclassOverridingImplementation;
private ClassLoader callerClassLoader;
private boolean mustResolve;
private int descriptorHandle;
private static HashMap<String, Class<?>> PRIMITIVE_CLASSES;
static class InputValidationDesc {
ObjectInputValidation validator;
int priority;
}
private static ClassLoader bootstrapLoader;
private static ClassLoader systemLoader;
private HashMap<Class<?>, List<Class<?>>> cachedSuperclasses;
public ObjectInputStream(InputStream in) throws IOException {
this.input = new DataInputStream(in);
InferUndefined.can_throw_ioexception_void();
}
protected ObjectInputStream() throws IOException, SecurityException {
}
public int available() throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
public void close() throws IOException {
input.close();
}
public void defaultReadObject() throws IOException {
InferUndefined.can_throw_ioexception_void();
}
public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
public int read(byte b[]) throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
public int read(byte b[], int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
public boolean readBoolean() throws IOException {
return InferUndefined.can_throw_ioexception_boolean();
}
public byte readByte() throws IOException {
return InferUndefined.can_throw_ioexception_byte();
}
public char readChar() throws IOException {
return InferUndefined.can_throw_ioexception_char();
}
public double readDouble() throws IOException {
return InferUndefined.can_throw_ioexception_double();
}
public ObjectInputStream.GetField readFields() throws IOException {
throw new IOException();
}
public float readFloat() throws IOException {
return InferUndefined.can_throw_ioexception_float();
}
public void readFully(byte[] buf) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
public void readFully(byte[] buf, int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
public int readInt() throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
public long readLong() throws IOException {
return InferUndefined.can_throw_ioexception_long();
}
public final Object readObject() throws IOException {
return InferUndefined.can_throw_ioexception_object();
}
public short readShort() throws IOException {
return InferUndefined.can_throw_ioexception_short();
}
public Object readUnshared() throws IOException, ClassNotFoundException {
return InferUndefined.can_throw_ioexception_object();
}
public int readUnsignedByte() throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
public int readUnsignedShort() throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
public String readUTF() throws IOException {
return InferUndefined.can_throw_ioexception_string();
}
public int skipBytes(int len) throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
public static abstract class GetField {
}
}
| {
"content_hash": "61ab68d19b750cf8b32c13afb50fb3f0",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 77,
"avg_line_length": 29.15068493150685,
"alnum_prop": 0.7065319548872181,
"repo_name": "hawkinchina/facebook-",
"id": "cc4f690a3ab7b596fa00b02ca556ee9bad1c12b7",
"size": "4256",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "infer/models/java/src/java/io/ObjectInputStream.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "131580"
},
{
"name": "C++",
"bytes": "3787"
},
{
"name": "CMake",
"bytes": "461"
},
{
"name": "Java",
"bytes": "643219"
},
{
"name": "Makefile",
"bytes": "16811"
},
{
"name": "OCaml",
"bytes": "2432413"
},
{
"name": "Objective-C",
"bytes": "57198"
},
{
"name": "Objective-C++",
"bytes": "193"
},
{
"name": "Perl",
"bytes": "245"
},
{
"name": "Python",
"bytes": "79767"
},
{
"name": "Shell",
"bytes": "16881"
},
{
"name": "Standard ML",
"bytes": "207"
}
],
"symlink_target": ""
} |
Event.simulateMouse = function(element, eventName) {
var options = Object.extend({
pointerX: 0,
pointerY: 0,
buttons: 0,
ctrlKey: false,
altKey: false,
shiftKey: false,
metaKey: false
}, arguments[2] || {});
var oEvent = document.createEvent("MouseEvents");
oEvent.initMouseEvent(eventName, true, true, document.defaultView,
options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY,
options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, 0, $(element));
if(this.mark) Element.remove(this.mark);
this.mark = document.createElement('div');
this.mark.appendChild(document.createTextNode(" "));
document.body.appendChild(this.mark);
this.mark.style.position = 'absolute';
this.mark.style.top = options.pointerY + "px";
this.mark.style.left = options.pointerX + "px";
this.mark.style.width = "5px";
this.mark.style.height = "5px;";
this.mark.style.borderTop = "1px solid red;";
this.mark.style.borderLeft = "1px solid red;";
if(this.step)
alert('['+new Date().getTime().toString()+'] '+eventName+'/'+Test.Unit.inspect(options));
$(element).dispatchEvent(oEvent);
};
// Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", this doesn't work in 1.0.6 or DP2.
// You need to downgrade to 1.0.4 for now to get this working
// See https://bugzilla.mozilla.org/show_bug.cgi?id=289940 for the fix that fixed too much
Event.simulateKey = function(element, eventName) {
var options = Object.extend({
ctrlKey: false,
altKey: false,
shiftKey: false,
metaKey: false,
keyCode: 0,
charCode: 0
}, arguments[2] || {});
var oEvent = document.createEvent("KeyEvents");
oEvent.initKeyEvent(eventName, true, true, window,
options.ctrlKey, options.altKey, options.shiftKey, options.metaKey,
options.keyCode, options.charCode );
$(element).dispatchEvent(oEvent);
};
Event.simulateKeys = function(element, command) {
for(var i=0; i<command.length; i++) {
Event.simulateKey(element,'keypress',{charCode:command.charCodeAt(i)});
}
};
var Test = {};
Test.Unit = {};
// security exception workaround
Test.Unit.inspect = Object.inspect;
Test.Unit.Logger = Class.create();
Test.Unit.Logger.prototype = {
initialize: function(log) {
this.log = $(log);
if (this.log) {
this._createLogTable();
}
},
start: function(testName) {
if (!this.log) return;
this.testName = testName;
this.lastLogLine = document.createElement('tr');
this.statusCell = document.createElement('td');
this.nameCell = document.createElement('td');
this.nameCell.className = "nameCell";
this.nameCell.appendChild(document.createTextNode(testName));
this.messageCell = document.createElement('td');
this.lastLogLine.appendChild(this.statusCell);
this.lastLogLine.appendChild(this.nameCell);
this.lastLogLine.appendChild(this.messageCell);
this.loglines.appendChild(this.lastLogLine);
},
finish: function(status, summary) {
if (!this.log) return;
this.lastLogLine.className = status;
this.statusCell.innerHTML = status;
this.messageCell.innerHTML = this._toHTML(summary);
this.addLinksToResults();
},
message: function(message) {
if (!this.log) return;
this.messageCell.innerHTML = this._toHTML(message);
},
summary: function(summary) {
if (!this.log) return;
this.logsummary.innerHTML = this._toHTML(summary);
},
_createLogTable: function() {
this.log.innerHTML =
'<div id="logsummary"></div>' +
'<table id="logtable">' +
'<thead><tr><th>Status</th><th>Test</th><th>Message</th></tr></thead>' +
'<tbody id="loglines"></tbody>' +
'</table>';
this.logsummary = $('logsummary');
this.loglines = $('loglines');
},
_toHTML: function(txt) {
return txt.escapeHTML().replace(/\n/g,"<br/>");
},
addLinksToResults: function(){
$$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log
td.title = "Run only this test";
Event.observe(td, 'click', function(){ window.location.search = "?tests=" + td.innerHTML;});
});
$$("tr.passed .nameCell").each( function(td){ // todo: limit to children of this.log
td.title = "Run all tests";
Event.observe(td, 'click', function(){ window.location.search = "";});
});
}
};
Test.Unit.Runner = Class.create();
Test.Unit.Runner.prototype = {
initialize: function(testcases) {
this.options = Object.extend({
testLog: 'testlog'
}, arguments[1] || {});
this.options.resultsURL = this.parseResultsURLQueryParameter();
this.options.tests = this.parseTestsQueryParameter();
if (this.options.testLog) {
this.options.testLog = $(this.options.testLog) || null;
}
if(this.options.tests) {
this.tests = [];
for(var i = 0; i < this.options.tests.length; i++) {
if(/^test/.test(this.options.tests[i])) {
this.tests.push(new Test.Unit.Testcase(this.options.tests[i], testcases[this.options.tests[i]], testcases["setup"], testcases["teardown"]));
}
}
} else {
if (this.options.test) {
this.tests = [new Test.Unit.Testcase(this.options.test, testcases[this.options.test], testcases["setup"], testcases["teardown"])];
} else {
this.tests = [];
for(var testcase in testcases) {
if(/^test/.test(testcase)) {
this.tests.push(
new Test.Unit.Testcase(
this.options.context ? ' -> ' + this.options.titles[testcase] : testcase,
testcases[testcase], testcases["setup"], testcases["teardown"]
));
}
}
}
}
this.currentTest = 0;
this.logger = new Test.Unit.Logger(this.options.testLog);
setTimeout(this.runTests.bind(this), 1000);
},
parseResultsURLQueryParameter: function() {
return window.location.search.parseQuery()["resultsURL"];
},
parseTestsQueryParameter: function(){
if (window.location.search.parseQuery()["tests"]){
return window.location.search.parseQuery()["tests"].split(',');
};
},
// Returns:
// "ERROR" if there was an error,
// "FAILURE" if there was a failure, or
// "SUCCESS" if there was neither
getResult: function() {
var hasFailure = false;
for(var i=0;i<this.tests.length;i++) {
if (this.tests[i].errors > 0) {
return "ERROR";
}
if (this.tests[i].failures > 0) {
hasFailure = true;
}
}
if (hasFailure) {
return "FAILURE";
} else {
return "SUCCESS";
}
},
postResults: function() {
if (this.options.resultsURL) {
new Ajax.Request(this.options.resultsURL,
{ method: 'get', parameters: 'result=' + this.getResult(), asynchronous: false });
}
},
runTests: function() {
var test = this.tests[this.currentTest];
if (!test) {
// finished!
this.postResults();
this.logger.summary(this.summary());
return;
}
if(!test.isWaiting) {
this.logger.start(test.name);
}
test.run();
if(test.isWaiting) {
this.logger.message("Waiting for " + test.timeToWait + "ms");
setTimeout(this.runTests.bind(this), test.timeToWait || 1000);
} else {
this.logger.finish(test.status(), test.summary());
this.currentTest++;
// tail recursive, hopefully the browser will skip the stackframe
this.runTests();
}
},
summary: function() {
var assertions = 0;
var failures = 0;
var errors = 0;
var messages = [];
for(var i=0;i<this.tests.length;i++) {
assertions += this.tests[i].assertions;
failures += this.tests[i].failures;
errors += this.tests[i].errors;
}
return (
(this.options.context ? this.options.context + ': ': '') +
this.tests.length + " tests, " +
assertions + " assertions, " +
failures + " failures, " +
errors + " errors");
}
};
Test.Unit.Assertions = Class.create();
Test.Unit.Assertions.prototype = {
initialize: function() {
this.assertions = 0;
this.failures = 0;
this.errors = 0;
this.messages = [];
},
summary: function() {
return (
this.assertions + " assertions, " +
this.failures + " failures, " +
this.errors + " errors" + "\n" +
this.messages.join("\n"));
},
pass: function() {
this.assertions++;
},
fail: function(message) {
this.failures++;
this.messages.push("Failure: " + message);
},
info: function(message) {
this.messages.push("Info: " + message);
},
error: function(error) {
this.errors++;
this.messages.push(error.name + ": "+ error.message + "(" + Test.Unit.inspect(error) +")");
},
status: function() {
if (this.failures > 0) return 'failed';
if (this.errors > 0) return 'error';
return 'passed';
},
assert: function(expression) {
var message = arguments[1] || 'assert: got "' + Test.Unit.inspect(expression) + '"';
try { expression ? this.pass() :
this.fail(message); }
catch(e) { this.error(e); }
},
assertEqual: function(expected, actual) {
var message = arguments[2] || "assertEqual";
try { (expected == actual) ? this.pass() :
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
'", actual "' + Test.Unit.inspect(actual) + '"'); }
catch(e) { this.error(e); }
},
assertInspect: function(expected, actual) {
var message = arguments[2] || "assertInspect";
try { (expected == actual.inspect()) ? this.pass() :
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
'", actual "' + Test.Unit.inspect(actual) + '"'); }
catch(e) { this.error(e); }
},
assertEnumEqual: function(expected, actual) {
var message = arguments[2] || "assertEnumEqual";
try { $A(expected).length == $A(actual).length &&
expected.zip(actual).all(function(pair) { return pair[0] == pair[1] }) ?
this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) +
', actual ' + Test.Unit.inspect(actual)); }
catch(e) { this.error(e); }
},
assertNotEqual: function(expected, actual) {
var message = arguments[2] || "assertNotEqual";
try { (expected != actual) ? this.pass() :
this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); }
catch(e) { this.error(e); }
},
assertIdentical: function(expected, actual) {
var message = arguments[2] || "assertIdentical";
try { (expected === actual) ? this.pass() :
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
'", actual "' + Test.Unit.inspect(actual) + '"'); }
catch(e) { this.error(e); }
},
assertNotIdentical: function(expected, actual) {
var message = arguments[2] || "assertNotIdentical";
try { !(expected === actual) ? this.pass() :
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
'", actual "' + Test.Unit.inspect(actual) + '"'); }
catch(e) { this.error(e); }
},
assertNull: function(obj) {
var message = arguments[1] || 'assertNull';
try { (obj==null) ? this.pass() :
this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); }
catch(e) { this.error(e); }
},
assertMatch: function(expected, actual) {
var message = arguments[2] || 'assertMatch';
var regex = new RegExp(expected);
try { (regex.exec(actual)) ? this.pass() :
this.fail(message + ' : regex: "' + Test.Unit.inspect(expected) + ' did not match: ' + Test.Unit.inspect(actual) + '"'); }
catch(e) { this.error(e); }
},
assertHidden: function(element) {
var message = arguments[1] || 'assertHidden';
this.assertEqual("none", element.style.display, message);
},
assertNotNull: function(object) {
var message = arguments[1] || 'assertNotNull';
this.assert(object != null, message);
},
assertType: function(expected, actual) {
var message = arguments[2] || 'assertType';
try {
(actual.constructor == expected) ? this.pass() :
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
'", actual "' + (actual.constructor) + '"'); }
catch(e) { this.error(e); }
},
assertNotOfType: function(expected, actual) {
var message = arguments[2] || 'assertNotOfType';
try {
(actual.constructor != expected) ? this.pass() :
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
'", actual "' + (actual.constructor) + '"'); }
catch(e) { this.error(e); }
},
assertInstanceOf: function(expected, actual) {
var message = arguments[2] || 'assertInstanceOf';
try {
(actual instanceof expected) ? this.pass() :
this.fail(message + ": object was not an instance of the expected type"); }
catch(e) { this.error(e); }
},
assertNotInstanceOf: function(expected, actual) {
var message = arguments[2] || 'assertNotInstanceOf';
try {
!(actual instanceof expected) ? this.pass() :
this.fail(message + ": object was an instance of the not expected type"); }
catch(e) { this.error(e); }
},
assertRespondsTo: function(method, obj) {
var message = arguments[2] || 'assertRespondsTo';
try {
(obj[method] && typeof obj[method] == 'function') ? this.pass() :
this.fail(message + ": object doesn't respond to [" + method + "]"); }
catch(e) { this.error(e); }
},
assertReturnsTrue: function(method, obj) {
var message = arguments[2] || 'assertReturnsTrue';
try {
var m = obj[method];
if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)];
m() ? this.pass() :
this.fail(message + ": method returned false"); }
catch(e) { this.error(e); }
},
assertReturnsFalse: function(method, obj) {
var message = arguments[2] || 'assertReturnsFalse';
try {
var m = obj[method];
if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)];
!m() ? this.pass() :
this.fail(message + ": method returned true"); }
catch(e) { this.error(e); }
},
assertRaise: function(exceptionName, method) {
var message = arguments[2] || 'assertRaise';
try {
method();
this.fail(message + ": exception expected but none was raised"); }
catch(e) {
((exceptionName == null) || (e.name==exceptionName)) ? this.pass() : this.error(e);
}
},
assertElementsMatch: function() {
var expressions = $A(arguments), elements = $A(expressions.shift());
if (elements.length != expressions.length) {
this.fail('assertElementsMatch: size mismatch: ' + elements.length + ' elements, ' + expressions.length + ' expressions');
return false;
}
elements.zip(expressions).all(function(pair, index) {
var element = $(pair.first()), expression = pair.last();
if (element.match(expression)) return true;
this.fail('assertElementsMatch: (in index ' + index + ') expected ' + expression.inspect() + ' but got ' + element.inspect());
}.bind(this)) && this.pass();
},
assertElementMatches: function(element, expression) {
this.assertElementsMatch([element], expression);
},
_isVisible: function(element) {
element = $(element);
if(!element.parentNode) return true;
this.assertNotNull(element);
if(element.style && Element.getStyle(element, 'display') == 'none')
return false;
return this._isVisible(element.parentNode);
},
assertNotVisible: function(element) {
this.assert(!this._isVisible(element), Test.Unit.inspect(element) + " was not hidden and didn't have a hidden parent either. " + ("" || arguments[1]));
},
assertVisible: function(element) {
this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1]));
},
benchmark: function(operation, iterations) {
var startAt = new Date();
(iterations || 1).times(operation);
var timeTaken = ((new Date())-startAt);
this.info((arguments[2] || 'Operation') + ' finished ' +
iterations + ' iterations in ' + (timeTaken/1000)+'s' );
return timeTaken;
}
};
Test.Unit.Testcase = Class.create();
Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), {
initialize: function(name, test, setup, teardown) {
Test.Unit.Assertions.prototype.initialize.bind(this)();
this.name = name;
if(typeof test == 'string') {
test = test.gsub(/(\.should[^\(]+\()/,'#{0}this,');
test = test.gsub(/(\.should[^\(]+)\(this,\)/,'#{1}(this)');
this.test = function() {
eval('with(this){'+test+'}');
}
} else {
this.test = test || function() {};
}
this.setup = setup || function() {};
this.teardown = teardown || function() {};
this.isWaiting = false;
this.timeToWait = 1000;
},
wait: function(time, nextPart) {
this.isWaiting = true;
this.test = nextPart;
this.timeToWait = time;
},
run: function() {
try {
try {
if (!this.isWaiting) this.setup.bind(this)();
this.isWaiting = false;
this.test.bind(this)();
} finally {
if(!this.isWaiting) {
this.teardown.bind(this)();
}
}
}
catch(e) { this.error(e); }
}
});
// *EXPERIMENTAL* BDD-style testing to please non-technical folk
// This draws many ideas from RSpec http://rspec.rubyforge.org/
Test.setupBDDExtensionMethods = function(){
var METHODMAP = {
shouldEqual: 'assertEqual',
shouldNotEqual: 'assertNotEqual',
shouldEqualEnum: 'assertEnumEqual',
shouldBeA: 'assertType',
shouldNotBeA: 'assertNotOfType',
shouldBeAn: 'assertType',
shouldNotBeAn: 'assertNotOfType',
shouldBeNull: 'assertNull',
shouldNotBeNull: 'assertNotNull',
shouldBe: 'assertReturnsTrue',
shouldNotBe: 'assertReturnsFalse',
shouldRespondTo: 'assertRespondsTo'
};
var makeAssertion = function(assertion, args, object) {
this[assertion].apply(this,(args || []).concat([object]));
};
Test.BDDMethods = {};
$H(METHODMAP).each(function(pair) {
Test.BDDMethods[pair.key] = function() {
var args = $A(arguments);
var scope = args.shift();
makeAssertion.apply(scope, [pair.value, args, this]); };
});
[Array.prototype, String.prototype, Number.prototype, Boolean.prototype].each(
function(p){ Object.extend(p, Test.BDDMethods) }
);
};
Test.context = function(name, spec, log){
Test.setupBDDExtensionMethods();
var compiledSpec = {};
var titles = {};
for(specName in spec) {
switch(specName){
case "setup":
case "teardown":
compiledSpec[specName] = spec[specName];
break;
default:
var testName = 'test'+specName.gsub(/\s+/,'-').camelize();
var body = spec[specName].toString().split('\n').slice(1);
if(/^\{/.test(body[0])) body = body.slice(1);
body.pop();
body = body.map(function(statement){
return statement.strip()
});
compiledSpec[testName] = body.join('\n');
titles[testName] = specName;
}
}
new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || 'testlog', context: name });
}; | {
"content_hash": "1e89c8cafff26a39fda84775b70b1d4c",
"timestamp": "",
"source": "github",
"line_count": 550,
"max_line_length": 155,
"avg_line_length": 35.28363636363636,
"alnum_prop": 0.6070802844481088,
"repo_name": "pandoraui/scriptaculous",
"id": "980fb167fb54a967e237cb27297f8a4806102b6a",
"size": "19824",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/unittest.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1291"
},
{
"name": "HTML",
"bytes": "285482"
},
{
"name": "JavaScript",
"bytes": "40029"
},
{
"name": "Ruby",
"bytes": "7056"
}
],
"symlink_target": ""
} |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE690_NULL_Deref_From_Return__wchar_t_calloc_82_goodB2G.cpp
Label Definition File: CWE690_NULL_Deref_From_Return.free.label.xml
Template File: source-sinks-82_goodB2G.tmpl.cpp
*/
/*
* @description
* CWE: 690 Unchecked Return Value To NULL Pointer
* BadSource: calloc Allocate data using calloc()
* Sinks:
* GoodSink: Check to see if the data allocation failed and if not, use data
* BadSink : Don't check for NULL and use data
* Flow Variant: 82 Data flow: data passed in a parameter to an virtual method called via a pointer
*
* */
#ifndef OMITGOOD
#include "std_testcase.h"
#include "CWE690_NULL_Deref_From_Return__wchar_t_calloc_82.h"
namespace CWE690_NULL_Deref_From_Return__wchar_t_calloc_82
{
void CWE690_NULL_Deref_From_Return__wchar_t_calloc_82_goodB2G::action(wchar_t * data)
{
/* FIX: Check to see if the memory allocation function was successful before initializing the memory buffer */
if (data != NULL)
{
wcscpy(data, L"Initialize");
printWLine(data);
free(data);
}
}
}
#endif /* OMITGOOD */
| {
"content_hash": "d7a069c58c2733926a2ed41cfea29f26",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 114,
"avg_line_length": 31.86111111111111,
"alnum_prop": 0.6887532693984307,
"repo_name": "JianpingZeng/xcc",
"id": "16737902b9f0cb0724045095aadaec3f238fad97",
"size": "1147",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "xcc/test/juliet/testcases/CWE690_NULL_Deref_From_Return/s02/CWE690_NULL_Deref_From_Return__wchar_t_calloc_82_goodB2G.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
function Remove-DbaDbCertificate {
<#
.SYNOPSIS
Deletes specified database certificate
.DESCRIPTION
Deletes specified database certificate
.PARAMETER SqlInstance
The SQL Server to create the certificates on.
.PARAMETER SqlCredential
Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.
.PARAMETER Database
The database where the certificate will be removed.
.PARAMETER Certificate
The certificate that will be removed
.PARAMETER WhatIf
Shows what would happen if the command were to run. No actions are actually performed.
.PARAMETER Confirm
Prompts you for confirmation before executing any changing operations within the command.
.PARAMETER EnableException
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
.PARAMETER InputObject
Piped certificate objects
.NOTES
Tags: Certificate, Security
Author: Chrissy LeMaire (@cl), netnerds.net
Website: https://dbatools.io
Copyright: (c) 2018 by dbatools, licensed under MIT
License: MIT https://opensource.org/licenses/MIT
.LINK
https://dbatools.io/Remove-DbaDbCertificate
.EXAMPLE
PS C:\> Remove-DbaDbCertificate -SqlInstance Server1
The certificate in the master database on server1 will be removed if it exists.
.EXAMPLE
PS C:\> Remove-DbaDbCertificate -SqlInstance Server1 -Database db1 -Confirm:$false
Suppresses all prompts to remove the certificate in the 'db1' database and drops the key.
#>
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess, ConfirmImpact = "High")]
param (
[DbaInstanceParameter[]]$SqlInstance,
[PSCredential]$SqlCredential,
[string[]]$Database,
[string[]]$Certificate,
[parameter(ValueFromPipeline)]
[Microsoft.SqlServer.Management.Smo.Certificate[]]$InputObject,
[switch]$EnableException
)
process {
if ($SqlInstance) {
$InputObject += Get-DbaDbCertificate -SqlInstance $SqlInstance -SqlCredential $SqlCredential -Certificate $Certificate -Database $Database
}
foreach ($cert in $InputObject) {
$db = $cert.Parent
$server = $db.Parent
if ($Pscmdlet.ShouldProcess($server.Name, "Dropping the certificate named $cert for database $db")) {
try {
# erroractionprefs are not invoked for .net methods suddenly (??), so use Invoke-DbaQuery
# Avoids modifying the collection
Invoke-DbaQuery -SqlInstance $server -Database $db.Name -Query "DROP CERTIFICATE $cert" -EnableException
Write-Message -Level Verbose -Message "Successfully removed certificate named $cert from the $db database on $server"
[pscustomobject]@{
ComputerName = $server.ComputerName
InstanceName = $server.ServiceName
SqlInstance = $server.DomainInstanceName
Database = $db.Name
Certificate = $cert.Name
Status = "Success"
}
} catch {
Stop-Function -Message "Failed to drop certificate named $($cert.Name) from $($db.Name) on $($server.Name)." -Target $smocert -ErrorRecord $_ -Continue
}
}
}
}
} | {
"content_hash": "70af2769432b7815a80b6d72d269a632",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 171,
"avg_line_length": 41.333333333333336,
"alnum_prop": 0.6436950146627566,
"repo_name": "alevyinroc/dbatools",
"id": "0d6c4d7f43661c7c7eeb60e5513801c8356ef5cc",
"size": "4092",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "functions/Remove-DbaDbCertificate.ps1",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "481258"
},
{
"name": "PowerShell",
"bytes": "10381925"
},
{
"name": "Rich Text Format",
"bytes": "61846"
},
{
"name": "TSQL",
"bytes": "1026352"
}
],
"symlink_target": ""
} |
var TestRunner = require("../../test-runner.js"),
test = new TestRunner();
describe("regions/viewportanchor tests", function(){
before(function(onDone) {
test.init(onDone);
});
after(function() {
test.shutdown();
});
it("correct.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/correct.vtt", "regions/viewportanchor/correct.json", onDone);
});
it("incorrect-delimiter.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/incorrect-delimiter.vtt", "regions/viewportanchor/bad-viewportanchor.json", onDone);
});
it("letter-in-value.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/letter-in-value.vtt", "regions/viewportanchor/bad-viewportanchor.json", onDone);
});
it("negative-percent.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/negative-percent.vtt", "regions/viewportanchor/bad-viewportanchor.json", onDone);
});
it("no-comma.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/no-comma.vtt", "regions/viewportanchor/bad-viewportanchor.json", onDone);
});
it("no-percent.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/no-percent.vtt", "regions/viewportanchor/bad-viewportanchor.json", onDone);
});
it("percent-at-front.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/percent-at-front.vtt", "regions/viewportanchor/bad-viewportanchor.json", onDone);
});
it("percent-over.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/percent-over.vtt", "regions/viewportanchor/bad-viewportanchor.json", onDone);
});
it("space-after-delimiter.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/space-after-delimiter.vtt", "regions/viewportanchor/bad-viewportanchor.json", onDone);
});
it("space-before-delimiter.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/space-before-delimiter.vtt", "regions/viewportanchor/bad-viewportanchor.json", onDone);
});
it("two-periods.vtt", function(onDone){
test.jsonEqualParsing("regions/viewportanchor/two-periods.vtt", "regions/viewportanchor/bad-viewportanchor.json", onDone);
});
});
| {
"content_hash": "9bcfcbbdac50cbe5ae8328ab85900b92",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 137,
"avg_line_length": 38.6551724137931,
"alnum_prop": 0.7346119536128457,
"repo_name": "amandatru/amandatru.github.io",
"id": "711441324927611afe39fc610af963b26d76ba43",
"size": "2242",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "420/node_modules/video.js/node_modules/vtt.js/tests/regions/viewportanchor/test.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "177346"
},
{
"name": "HTML",
"bytes": "10146"
},
{
"name": "JavaScript",
"bytes": "682235"
}
],
"symlink_target": ""
} |
using System;
using System.Xml.Serialization;
namespace Aop.Api.Domain
{
/// <summary>
/// OpenPromoCamp Data Structure.
/// </summary>
[Serializable]
public class OpenPromoCamp : AopObject
{
/// <summary>
/// 简短活动名,默认和活动名称相同
/// </summary>
[XmlElement("camp_alias")]
public string CampAlias { get; set; }
/// <summary>
/// 活动描述
/// </summary>
[XmlElement("camp_desc")]
public string CampDesc { get; set; }
/// <summary>
/// 活动结束时间
/// </summary>
[XmlElement("camp_end_time")]
public string CampEndTime { get; set; }
/// <summary>
/// 活动名称
/// </summary>
[XmlElement("camp_name")]
public string CampName { get; set; }
/// <summary>
/// 活动开始时间
/// </summary>
[XmlElement("camp_start_time")]
public string CampStartTime { get; set; }
/// <summary>
/// 活动类型,现在支持DRAW_PRIZE:表示领奖活动
/// </summary>
[XmlElement("camp_type")]
public string CampType { get; set; }
}
}
| {
"content_hash": "2cef839143be438667e3d1ca0c1858c0",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 49,
"avg_line_length": 23.604166666666668,
"alnum_prop": 0.500441306266549,
"repo_name": "oceanho/AnyPayment",
"id": "f1e1df5292b68ff01a596d1e281b6a2e392ed016",
"size": "1235",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "docs/alipay-sdk-NET-20151130120112/Domain/OpenPromoCamp.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "11467"
}
],
"symlink_target": ""
} |
'use strict';
/**
* @ngdoc function
* @name kivipeli.controller:GameCtrl
* @description
* # GameCtrl
* Controller of the kivipeli
*/
angular.module('kivipeli')
.controller('GameCtrl', function(
$scope,
aiPlayer,
gameService,
turnMediatorService
) {
gameService.newGame();
$scope.gameService = gameService;
$scope.turnMediatorService = turnMediatorService;
$scope.aiPlayer = aiPlayer;
});
| {
"content_hash": "e5c77710ba64b2bd7792d7571f4d51e8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 54,
"avg_line_length": 19.869565217391305,
"alnum_prop": 0.6411378555798687,
"repo_name": "joelmertanen/stonegame",
"id": "14200f48bd87acdeaacb64dba1e6176d5ada710f",
"size": "457",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/scripts/controllers/game.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "24139"
},
{
"name": "CSS",
"bytes": "4324"
},
{
"name": "HTML",
"bytes": "9093"
},
{
"name": "JavaScript",
"bytes": "33107"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header aui-dropdown2-trigger-group" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-clover">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a>
</h1>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="aui-page-panel-inner">
<div class="aui-page-panel-nav aui-page-panel-nav-clover">
<div class="aui-page-header-inner" style="margin-bottom: 20px;">
<div class="aui-page-header-image">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="aui-page-header-main" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup aui-navgroup-vertical">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading packages-nav-heading">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui package-filter-container">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="package-filter-no-results-message hidden">
<small>No results found.</small>
</p>
<div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="packages-tree-container"></div>
<div class="clover-packages-lozenges"></div>
</div>
</div>
</div>
</nav> </div>
<section class="aui-page-panel-content">
<div class="aui-page-panel-content-clover">
<div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="test-Test_AbaRouteValidator_17b.html">Class Test_AbaRouteValidator_17b</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_37307_good
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_17b.html?line=53369#src-53369" >testAbaNumberCheck_37307_good</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:46:55
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_37307_good</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=2930#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.7352941</span>73.5%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="aui-page-panel-content-clover" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="aui-page-panel-content" -->
</div> <!-- class="aui-page-panel-inner" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html> | {
"content_hash": "6713eca9cf95d0a2de0a1e085a7a95ab",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 296,
"avg_line_length": 43.9377990430622,
"alnum_prop": 0.5098551671567026,
"repo_name": "dcarda/aba.route.validator",
"id": "44599aea96c4d87a5523836e70357b1a852094af",
"size": "9183",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_17b_testAbaNumberCheck_37307_good_29e.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "18715254"
}
],
"symlink_target": ""
} |
<?php
namespace Oro\Bundle\WorkflowBundle\Tests\Unit\Configuration\Handler;
use Oro\Bundle\WorkflowBundle\Configuration\Handler\AttributeHandler;
use Oro\Bundle\WorkflowBundle\Configuration\WorkflowConfiguration;
class AttributeHandlerTest extends \PHPUnit_Framework_TestCase
{
/**
* @var AttributeHandler
*/
protected $handler;
protected function setUp()
{
$this->handler = new AttributeHandler();
}
/**
* @param array $expected
* @param array $input
* @dataProvider handleDataProvider
*/
public function testHandle(array $expected, array $input)
{
$this->assertEquals($expected, $this->handler->handle($input));
}
public function handleDataProvider()
{
return array(
'simple configuration' => array(
'expected' => array(
WorkflowConfiguration::NODE_ATTRIBUTES => array(
array(
'name' => 'test_attribute',
'property_path' => 'entity.test_attribute',
)
)
),
'input' => array(
WorkflowConfiguration::NODE_ATTRIBUTES => array(
array(
'name' => 'test_attribute',
'property_path' => 'entity.test_attribute',
)
)
),
),
'full configuration' => array(
'expected' => array(
WorkflowConfiguration::NODE_ATTRIBUTES => array(
array(
'name' => 'test_attribute',
'label' => 'Test Attribute', //should be kept as filtering disposed to another class
'type' => 'entity',
'entity_acl' => array(
'delete' => false,
),
'property_path' => 'entity.test_attribute',
)
),
),
'input' => array(
WorkflowConfiguration::NODE_ATTRIBUTES => array(
array(
'name' => 'test_attribute',
'label' => 'Test Attribute',
'type' => 'entity',
'entity_acl' => array(
'delete' => false,
),
'property_path' => 'entity.test_attribute'
)
),
),
),
);
}
public function testHandleEmptyConfiguration()
{
$configuration = array(
WorkflowConfiguration::NODE_ATTRIBUTES => array(
array('property_path' => 'entity.property')
),
);
$result = $this->handler->handle($configuration);
$attributes = $result[WorkflowConfiguration::NODE_ATTRIBUTES];
$this->assertCount(1, $attributes);
$step = current($attributes);
$this->assertArrayHasKey('name', $step);
$this->assertStringStartsWith('attribute_', $step['name']);
}
}
| {
"content_hash": "008c0a81c72ffaa23685248ef638d8af",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 112,
"avg_line_length": 33.72727272727273,
"alnum_prop": 0.44324648098233005,
"repo_name": "geoffroycochard/platform",
"id": "4d338bab5801aa1d01bf188faf14d8a77481b103",
"size": "3339",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Oro/Bundle/WorkflowBundle/Tests/Unit/Configuration/Handler/AttributeHandlerTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "583679"
},
{
"name": "Cucumber",
"bytes": "660"
},
{
"name": "HTML",
"bytes": "1342329"
},
{
"name": "JavaScript",
"bytes": "4589734"
},
{
"name": "PHP",
"bytes": "19492046"
}
],
"symlink_target": ""
} |
FN="hu35ksubacdf_2.18.0.tar.gz"
URLS=(
"https://bioconductor.org/packages/3.14/data/annotation/src/contrib/hu35ksubacdf_2.18.0.tar.gz"
"https://bioarchive.galaxyproject.org/hu35ksubacdf_2.18.0.tar.gz"
"https://depot.galaxyproject.org/software/bioconductor-hu35ksubacdf/bioconductor-hu35ksubacdf_2.18.0_src_all.tar.gz"
)
MD5="c8b82c4755eb62818ca0dbf22de5d25e"
# Use a staging area in the conda dir rather than temp dirs, both to avoid
# permission issues as well as to have things downloaded in a predictable
# manner.
STAGING=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM
mkdir -p $STAGING
TARBALL=$STAGING/$FN
SUCCESS=0
for URL in ${URLS[@]}; do
curl -L $URL > $TARBALL
[[ $? == 0 ]] || continue
# Platform-specific md5sum checks.
if [[ $(uname -s) == "Linux" ]]; then
if md5sum -c <<<"$MD5 $TARBALL"; then
SUCCESS=1
break
fi
else if [[ $(uname -s) == "Darwin" ]]; then
if [[ $(md5 $TARBALL | cut -f4 -d " ") == "$MD5" ]]; then
SUCCESS=1
break
fi
fi
fi
done
if [[ $SUCCESS != 1 ]]; then
echo "ERROR: post-link.sh was unable to download any of the following URLs with the md5sum $MD5:"
printf '%s\n' "${URLS[@]}"
exit 1
fi
# Install and clean up
R CMD INSTALL --library=$PREFIX/lib/R/library $TARBALL
rm $TARBALL
rmdir $STAGING
| {
"content_hash": "187f3ff1ee45b23f4350d49dc1371985",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 118,
"avg_line_length": 28.955555555555556,
"alnum_prop": 0.6692248656945511,
"repo_name": "acaprez/recipes",
"id": "dc654a48b1d6445a618e43b76ba766996f40a1a4",
"size": "1315",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "recipes/bioconductor-hu35ksubacdf/post-link.sh",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "3356"
},
{
"name": "C",
"bytes": "154"
},
{
"name": "CMake",
"bytes": "18139"
},
{
"name": "Groovy",
"bytes": "1725"
},
{
"name": "ImageJ Macro",
"bytes": "185"
},
{
"name": "Perl",
"bytes": "45847"
},
{
"name": "Python",
"bytes": "492185"
},
{
"name": "Raku",
"bytes": "1067"
},
{
"name": "Roff",
"bytes": "1012"
},
{
"name": "Shell",
"bytes": "4131398"
}
],
"symlink_target": ""
} |
The security plugin allows to manage user, roles and permissions.
It also provides middleware for authentification and authorization. Authentification is using [Passport](http://passportjs.org/) middleware. Sessions are persisted in MongoDB.
Authorization is role and permission based. Plugins can add permissions, e.g. 'post:edit', at `security.addPermission()`. For each role can be defined if it has that permission or not. Users can have multiple roles. The middleware `security.middleware.loadRoles()` add all roles and their permissions to `req.session.user`, you can access in your middleware. Protect your routes and middleware by adding the middleware `security.middleware.hasPermission(['post:edit'])`.
Session middleware, login and logout functionality is configured for each application plugin (`backend` and `frontend`).
## Options
* **sessionSecret** `String`: Shared session secret, which is used to encrypt session
## API
### security.addPermission(pluginName, permissions)
* **pluginName** `String`: Name of registering plugin, e.g. 'post'
* **permission** `Array.<String>`: Array of permission keys, e.g. ['show', 'edit']
All permissions you add can be configured in the backend for each role.
### security.addCustomUserField(field)
* **field** `Array.<Objects> || Object`: Configuration for one or multiple fields
Add custom user fields to user object. Make sure that `name`, which equals the field path
in the user objects starts with `public.`, because `User.public` is an object which can
be extended.
Example:
```javascript
security.addCustomUserField([
{ name: 'public.email',
type: 'text',
label: 'E-Mail' },
{ name: 'public.firstname',
type: 'text',
label: 'First name' },
{ name: 'public.lastname',
type: 'text',
label: 'Last name' }
]);
```
### security.middleware.loadRoles
Type: `Function`, Express middleware
Middleware adds roles and permissions of current user to request at `req.session.user`.
```javascript
console.log(req.session.user);
{
"username": "oskars",
"roles": ["Painter"],
"permissions": ["painting:draw", "painting:clear"]
}
```
### security.middleware.isAuthenticated({redirect: redirectUrl})
Type: `Function`
* **redirectUrl** `String`: URL were user is redirected to if not authenticated
* **returns** `Function`: Express middleware
Express middleware checks if user is authenticated. If user is authenticated `next()` is called. Otherwise, for JSON requests error `403` is returned, other requests are redirected.
### security.middleware.hasPermission(permissions)
Type: `Function`
* **permissions** `Array.<Strings> || String`: Permissions in format 'PLUGIN:PERMISSION', e.g. 'post:edit'
* **returns** `Function`: Express middleware
Middleware checks if user has all given permissions and calls `next()` if true. Otherwise, for JSON requests error `403` is returned, other requests are redirected.
### security.passport
Type: `Object` Passport instance
Configured passport instance, which provides middleware to add authorization middleware to express apps.
## REST API
The JSON REST service is currently generated with baucis and provides the following methods:
```
GET /backend/api/CurrentUser Return name, roles and permissions of current user
GET /backend/api/CustomUserFields List of form fields, which are added by project to user form
GET /backend/api/Permissions Return all registered permissions (`security.permissions`)
GET /backend/api/Users
POST /backend/api/Users
GET /backend/api/Users/:id
PUT /backend/api/Users/:id
DELETE /backend/api/Users/:id
GET /backend/api/Roles
POST /backend/api/Roles
GET /backend/api/Roles/:id
PUT /backend/api/Roles/:id
DELETE /backend/api/Roles/:id
```
## Model: User
The user model uses a mongoose plugin provided by [passport-local-mongoose](https://github.com/saintedlama/passport-local-mongoose), which extends the user model by `username`, as well as `hash` and `salt` to encrypt the password. It also extends the model by additional methods, e.g. `User.setPassword()`.
```javascript
var user = new mongoose.Schema({
username: String,
roles: [Schema.Types.ObjectId], // Array of references to role
public: {} // Object to define custom fields
});
```
## Model: Role
```javascript
var role = new mongoose.Schema({
name: String,
permissions: Schema.Types.Mixed // Array of Strings of permissions (e.g. 'post:edit') this role has
});
```
| {
"content_hash": "ad2cdd9e5078daf3e7df5eb1f17a4baf",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 470,
"avg_line_length": 35.51162790697674,
"alnum_prop": 0.7166557520192097,
"repo_name": "bauhausjs/bauhausjs",
"id": "0664aecc86a2a665098cc591726d28b599f4aff4",
"size": "4601",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "security/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "68996"
},
{
"name": "HTML",
"bytes": "4142753"
},
{
"name": "JavaScript",
"bytes": "1090206"
},
{
"name": "Makefile",
"bytes": "2283"
},
{
"name": "Ruby",
"bytes": "4979"
},
{
"name": "Shell",
"bytes": "388"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe Gitlab::Middleware::BasicHealthCheck do
let(:app) { double(:app) }
let(:middleware) { described_class.new(app) }
let(:env) { {} }
describe '#call' do
context 'outside IP' do
before do
env['REMOTE_ADDR'] = '8.8.8.8'
end
it 'returns a 404' do
env['PATH_INFO'] = described_class::HEALTH_PATH
response = middleware.call(env)
expect(response[0]).to eq(404)
end
it 'forwards the call for other paths' do
env['PATH_INFO'] = '/'
expect(app).to receive(:call)
middleware.call(env)
end
end
context 'whitelisted IP' do
before do
env['REMOTE_ADDR'] = '127.0.0.1'
end
it 'returns 200 response when endpoint is hit' do
env['PATH_INFO'] = described_class::HEALTH_PATH
expect(app).not_to receive(:call)
response = middleware.call(env)
expect(response[0]).to eq(200)
expect(response[1]).to eq({ 'Content-Type' => 'text/plain' })
expect(response[2]).to eq(['GitLab OK'])
end
it 'forwards the call for other paths' do
env['PATH_INFO'] = '/-/readiness'
expect(app).to receive(:call)
middleware.call(env)
end
end
end
end
| {
"content_hash": "c791c48d883cdc477108688c1c213bf3",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 69,
"avg_line_length": 22.473684210526315,
"alnum_prop": 0.570647931303669,
"repo_name": "dreampet/gitlab",
"id": "187d903a5e192414b5aa31e757d036c70640403a",
"size": "1281",
"binary": false,
"copies": "3",
"ref": "refs/heads/11-7-stable-zh",
"path": "spec/lib/gitlab/middleware/basic_health_check_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "675415"
},
{
"name": "Clojure",
"bytes": "79"
},
{
"name": "Dockerfile",
"bytes": "1907"
},
{
"name": "HTML",
"bytes": "1329381"
},
{
"name": "JavaScript",
"bytes": "4251148"
},
{
"name": "Ruby",
"bytes": "19538796"
},
{
"name": "Shell",
"bytes": "44183"
},
{
"name": "Vue",
"bytes": "1051808"
}
],
"symlink_target": ""
} |
{% extends '!footer.html' %}
{% block extrafooter %}
<div class="footer">
<table style="margin: 0px auto;">
<tbody>
<tr>
<td style="text-align: center; padding: 30px;">
<a href="http://stackoverflow.com/questions/tagged/chatterbot">
<div>
<img src="{{ pathto('_static/so-icon.png', True) }}">
</div>
<div>
Ask a question under the<br/>
chatterbot tag
</div>
</a>
</td>
<td style="text-align: center; padding: 30px;">
<a href="https://github.com/gunthercox/ChatterBot/issues/new">
<div>
<img src="{{ pathto('_static/github-mark.png', True) }}">
</div>
<div>
Report an issue on<br/>
GitHub
</div>
</a>
</td>
</tr>
<tr>
<td colspan="2">
<div id="mc_embed_signup">
<form action="//salvius.us15.list-manage.com/subscribe/post?u=580aa1ae653acac0a2d60dc17&id=6ebc548663" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2>Subscribe to the ChatterBot Newsletter</h2>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address </label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_580aa1ae653acac0a2d60dc17_6ebc548663" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js"></script>
<script type='text/javascript'>
(function($) {
window.fnames = new Array();
window.ftypes = new Array();
fnames[0]='EMAIL';
ftypes[0]='email';
fnames[1]='FNAME';
ftypes[1]='text';
fnames[2]='LNAME';
ftypes[2]='text';
}(jQuery));
var $mcj = jQuery.noConflict(true);
</script>
{{ super() }}
{% endblock %}
| {
"content_hash": "5d9f65ea6f472fa3a1cff102cc4899bc",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 255,
"avg_line_length": 47.02777777777778,
"alnum_prop": 0.4477259303012404,
"repo_name": "gunthercox/ChatterBot",
"id": "b0f07384a1222c4a04eb7644f65314624e3bae58",
"size": "3386",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/_templates/footer.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "375133"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rvRepos"
android:layout_width="match_parent"
android:layout_height="match_parent" /> | {
"content_hash": "31527b4ed132750e1017dee7a5ef8c6e",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 98,
"avg_line_length": 50.2,
"alnum_prop": 0.7211155378486056,
"repo_name": "pierreduchemin/poec-android-03-2017",
"id": "eed87bd23ebfd52a456431c2235cbf539c2196f3",
"size": "251",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Exercice10/app/src/main/res/layout/activity_main.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "81112"
}
],
"symlink_target": ""
} |
namespace chromeos {
class AuthStatusConsumer;
class UserContext;
// Interaction with cryptohomed: mount home dirs, create new home dirs, update
// passwords.
//
// Typical flow:
// AuthenticateToMount() calls cryptohomed to perform offline login,
// AuthenticateToCreate() calls cryptohomed to create new cryptohome.
class CHROMEOS_EXPORT ExtendedAuthenticator
: public base::RefCountedThreadSafe<ExtendedAuthenticator> {
public:
enum AuthState {
SUCCESS, // Login succeeded.
NO_MOUNT, // No cryptohome exist for user.
FAILED_MOUNT, // Failed to mount existing cryptohome - login failed.
FAILED_TPM, // Failed to mount/create cryptohome because of TPM error.
};
typedef base::Callback<void(const std::string& result)> ResultCallback;
typedef base::Callback<void(const UserContext& context)> ContextCallback;
class NewAuthStatusConsumer {
public:
virtual ~NewAuthStatusConsumer() {}
// The current login attempt has ended in failure, with error.
virtual void OnAuthenticationFailure(AuthState state) = 0;
};
explicit ExtendedAuthenticator(NewAuthStatusConsumer* consumer);
explicit ExtendedAuthenticator(AuthStatusConsumer* consumer);
// Updates consumer of the class.
void SetConsumer(AuthStatusConsumer* consumer);
// This call will attempt to mount the home dir for the user, key (and key
// label) in |context|. If the key is of type KEY_TYPE_PASSWORD_PLAIN, it will
// be hashed with the system salt before being passed to cryptohomed. This
// call assumes that the home dir already exist for the user and will return
// an error otherwise. On success, the user ID hash (used as the mount point)
// will be passed to |success_callback|.
void AuthenticateToMount(const UserContext& context,
const ResultCallback& success_callback);
// This call will attempt to authenticate the user with the key (and key
// label) in |context|. No further actions are taken after authentication.
void AuthenticateToCheck(const UserContext& context,
const base::Closure& success_callback);
// This call will create and mount the home dir for |user_id| with the given
// |keys| if the home dir is missing. If the home dir exists already, a mount
// attempt will be performed using the first key in |keys| for authentication.
// Note that all |keys| should have been transformed from plain text already.
// This method does not alter them.
void CreateMount(const std::string& user_id,
const std::vector<cryptohome::KeyDefinition>& keys,
const ResultCallback& success_callback);
// Attempts to add a new |key| for the user identified/authorized by
// |context|. If a key with the same label already exists, the behavior
// depends on the |replace_existing| flag. If the flag is set, the old key is
// replaced. If the flag is not set, an error occurs. It is not allowed to
// replace the key used for authorization.
void AddKey(const UserContext& context,
const cryptohome::KeyDefinition& key,
bool replace_existing,
const base::Closure& success_callback);
// Attempts to perform an authorized update of the key in |context| with the
// new |key|. The update is authorized by providing the |signature| of the
// key. The original key must have the |PRIV_AUTHORIZED_UPDATE| privilege to
// perform this operation. The key labels in |context| and in |key| should be
// the same.
void UpdateKeyAuthorized(const UserContext& context,
const cryptohome::KeyDefinition& key,
const std::string& signature,
const base::Closure& success_callback);
// Attempts to remove the key labeled |key_to_remove| for the user identified/
// authorized by |context|. It is possible to remove the key used for
// authorization, although it should be done with extreme care.
void RemoveKey(const UserContext& context,
const std::string& key_to_remove,
const base::Closure& success_callback);
// Hashes the key in |user_context| with the system salt it its type is
// KEY_TYPE_PASSWORD_PLAIN and passes the resulting UserContext to the
// |callback|.
void TransformKeyIfNeeded(const UserContext& user_context,
const ContextCallback& callback);
private:
friend class base::RefCountedThreadSafe<ExtendedAuthenticator>;
~ExtendedAuthenticator();
// Callback for system salt getter.
void OnSaltObtained(const std::string& system_salt);
// Performs actual operation with fully configured |context|.
void DoAuthenticateToMount(const ResultCallback& success_callback,
const UserContext& context);
void DoAuthenticateToCheck(const base::Closure& success_callback,
const UserContext& context);
void DoAddKey(const cryptohome::KeyDefinition& key,
bool replace_existing,
const base::Closure& success_callback,
const UserContext& context);
void DoUpdateKeyAuthorized(const cryptohome::KeyDefinition& key,
const std::string& signature,
const base::Closure& success_callback,
const UserContext& context);
void DoRemoveKey(const std::string& key_to_remove,
const base::Closure& success_callback,
const UserContext& context);
// Inner operation callbacks.
void OnMountComplete(const std::string& time_marker,
const UserContext& context,
const ResultCallback& success_callback,
bool success,
cryptohome::MountError return_code,
const std::string& mount_hash);
void OnOperationComplete(const std::string& time_marker,
const UserContext& context,
const base::Closure& success_callback,
bool success,
cryptohome::MountError return_code);
bool salt_obtained_;
std::string system_salt_;
std::vector<base::Closure> system_salt_callbacks_;
NewAuthStatusConsumer* consumer_;
AuthStatusConsumer* old_consumer_;
DISALLOW_COPY_AND_ASSIGN(ExtendedAuthenticator);
};
} // namespace chromeos
#endif // CHROMEOS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_H_
| {
"content_hash": "2989718222754e8bce34fe12a9b49c8d",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 80,
"avg_line_length": 45.236111111111114,
"alnum_prop": 0.6727049431992631,
"repo_name": "sencha/chromium-spacewalk",
"id": "589989f02cba952326119b8371c948d7cf095796",
"size": "7131",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "chromeos/login/auth/extended_authenticator.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _Node2 = _interopRequireDefault(require("./Node"));
var _Range = _interopRequireDefault(require("./Range"));
var PlainValue =
/*#__PURE__*/
function (_Node) {
(0, _inherits2.default)(PlainValue, _Node);
function PlainValue() {
(0, _classCallCheck2.default)(this, PlainValue);
return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(PlainValue).apply(this, arguments));
}
(0, _createClass2.default)(PlainValue, [{
key: "parseBlockValue",
value: function parseBlockValue(start) {
var _this$context = this.context,
indent = _this$context.indent,
inFlow = _this$context.inFlow,
src = _this$context.src;
var offset = start;
var valueEnd = start;
for (var ch = src[offset]; ch === '\n'; ch = src[offset]) {
if (_Node2.default.atDocumentBoundary(src, offset + 1)) break;
var end = _Node2.default.endOfBlockIndent(src, indent, offset + 1);
if (end === null || src[end] === '#') break;
if (src[end] === '\n') {
offset = end;
} else {
valueEnd = PlainValue.endOfLine(src, end, inFlow);
offset = valueEnd;
}
}
if (this.valueRange.isEmpty()) this.valueRange.start = start;
this.valueRange.end = valueEnd;
return valueEnd;
}
/**
* Parses a plain value from the source
*
* Accepted forms are:
* ```
* #comment
*
* first line
*
* first line #comment
*
* first line
* block
* lines
*
* #comment
* block
* lines
* ```
* where block lines are empty or have an indent level greater than `indent`.
*
* @param {ParseContext} context
* @param {number} start - Index of first character
* @returns {number} - Index of the character after this scalar, may be `\n`
*/
}, {
key: "parse",
value: function parse(context, start) {
this.context = context;
var inFlow = context.inFlow,
src = context.src;
var offset = start;
var ch = src[offset];
if (ch && ch !== '#' && ch !== '\n') {
offset = PlainValue.endOfLine(src, start, inFlow);
}
this.valueRange = new _Range.default(start, offset);
offset = _Node2.default.endOfWhiteSpace(src, offset);
offset = this.parseComment(offset);
if (!this.hasComment || this.valueRange.isEmpty()) {
offset = this.parseBlockValue(offset);
}
return offset;
}
}, {
key: "strValue",
get: function get() {
if (!this.valueRange || !this.context) return null;
var _this$valueRange = this.valueRange,
start = _this$valueRange.start,
end = _this$valueRange.end;
var src = this.context.src;
var ch = src[end - 1];
while (start < end && (ch === '\n' || ch === '\t' || ch === ' ')) {
ch = src[--end - 1];
}
ch = src[start];
while (start < end && (ch === '\n' || ch === '\t' || ch === ' ')) {
ch = src[++start];
}
var str = '';
for (var i = start; i < end; ++i) {
var _ch = src[i];
if (_ch === '\n') {
var _Node$foldNewline = _Node2.default.foldNewline(src, i, -1),
fold = _Node$foldNewline.fold,
offset = _Node$foldNewline.offset;
str += fold;
i = offset;
} else if (_ch === ' ' || _ch === '\t') {
// trim trailing whitespace
var wsStart = i;
var next = src[i + 1];
while (i < end && (next === ' ' || next === '\t')) {
i += 1;
next = src[i + 1];
}
if (next !== '\n') str += i > wsStart ? src.slice(wsStart, i + 1) : _ch;
} else {
str += _ch;
}
}
return str;
}
}], [{
key: "endOfLine",
value: function endOfLine(src, start, inFlow) {
var ch = src[start];
var offset = start;
while (ch && ch !== '\n') {
if (inFlow && (ch === '[' || ch === ']' || ch === '{' || ch === '}' || ch === ',')) break;
var next = src[offset + 1];
if (ch === ':' && (!next || next === '\n' || next === '\t' || next === ' ' || inFlow && next === ',')) break;
if ((ch === ' ' || ch === '\t') && next === '#') break;
offset += 1;
ch = next;
}
return offset;
}
}]);
return PlainValue;
}(_Node2.default);
exports.default = PlainValue; | {
"content_hash": "ce604804c18d00e6037329e86132c623",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 124,
"avg_line_length": 28.2896174863388,
"alnum_prop": 0.5344794282402936,
"repo_name": "jpoeng/jpoeng.github.io",
"id": "32e9fe73e4ec729935b2dc39e93c70b3616c0a27",
"size": "5177",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "node_modules/yaml/browser/dist/cst/PlainValue.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5765"
},
{
"name": "HTML",
"bytes": "53947"
},
{
"name": "JavaScript",
"bytes": "1885"
},
{
"name": "PHP",
"bytes": "9773"
}
],
"symlink_target": ""
} |
package org.apache.druid.segment.column;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.druid.java.util.common.StringUtils;
import javax.annotation.Nullable;
import java.util.Objects;
/**
* This interface serves as a common foundation for Druids native type system, and provides common methods for reasoning
* about and handling type matters. Additional type common type handling methods are provided by {@link Types} utility.
*
* This information is used by Druid to make decisions about how to correctly process inputs and determine output types
* at all layers of the engine, from how to group, filter, aggregate, and transform columns up to how to best plan SQL
* into native Druid queries.
*
* The native Druid type system can currently be broken down at a high level into 'primitive' types, 'array' types, and
* 'complex' types, and this classification is defined by an enumeration which implements {@link TypeDescriptor} such
* as {@link ValueType} for the general query engines and {@link org.apache.druid.math.expr.ExprType} for low level
* expression processing. This is exposed via {@link #getType()}, and will be most callers first point of contact with
* the {@link TypeSignature} when trying to decide how to handle a given input.
*
* Druid 'primitive' types includes strings and numeric types. Note: multi-value string columns are still considered
* 'primitive' string types, because they do not behave as traditional arrays (unless explicitly converted to an array),
* and are always serialized as opportunistically single valued, so whether or not any particular string column is
* multi-valued might vary from segment to segment. The concept of multi-valued strings only exists at a very low
* engine level and are only modeled by the ColumnCapabilities implementation of {@link TypeSignature}.
*
* 'array' types contain additional nested type information about the elements of an array, a reference to another
* {@link TypeSignature} through the {@link #getElementType()} method. If {@link TypeDescriptor#isArray()} is true,
* then {@link #getElementType()} should never return null.
*
* 'complex' types are Druids extensible types, which have a registry that allows these types to be defined and
* associated with a name which is available as {@link #getComplexTypeName()}. These type names are unique, so this
* information is used to allow handling of these 'complex' types to confirm.
*
* {@link TypeSignature} is currently manifested in 3 forms: {@link ColumnType} which is the high level 'native' Druid
* type definitions using {@link ValueType}, and is used by row signatures and SQL schemas, used by callers as input
* to various API methods, and most general purpose type handling. In 'druid-processing' there is an additional
* type ... type, ColumnCapabilities, which is effectively a {@link ColumnType} but includes some additional
* information for low level query processing, such as details about whether a column has indexes, dictionaries, null
* values, is a multi-value string column, and more.
*
* The third is {@link org.apache.druid.math.expr.ExpressionType}, which instead of {@link ValueType} uses
* {@link org.apache.druid.math.expr.ExprType}, and is used exclusively for handling Druid native expression evaluation.
* {@link org.apache.druid.math.expr.ExpressionType} exists because the Druid expression system does not natively
* handle float types, so it is essentially a mapping of {@link ColumnType} where floats are coerced to double typed
* values. Ideally at some point Druid expressions can just handle floats directly, and these two {@link TypeSignature}
* can be merged, which will simplify this interface to no longer need be generic, allow {@link ColumnType} to be
* collapsed into {@link BaseTypeSignature}, and finally unify the type system.
*/
public interface TypeSignature<Type extends TypeDescriptor>
{
/**
* {@link TypeDescriptor} enumeration used to handle different classes of types
*
* @see ValueType
* @see org.apache.druid.math.expr.ExprType
*/
Type getType();
/**
* Type name of 'complex' types ({@link ValueType#COMPLEX}, {@link org.apache.druid.math.expr.ExprType#COMPLEX}),
* which are 'registered' by their name, acting as a key to get the correct set of serialization, deserialization,
* and other type specific handling facilties.
*
* For other types, this value will be null.
*/
@Nullable
String getComplexTypeName();
/**
* {@link TypeSignature} for the elements contained in an array type ({@link ValueType#ARRAY},
* {@link org.apache.druid.math.expr.ExprType#ARRAY}).
*
* For non-array types, this value will be null.
*/
@Nullable
TypeSignature<Type> getElementType();
/**
* Check if the value of {@link #getType()} is equal to the candidate {@link TypeDescriptor}.
*/
default boolean is(Type candidate)
{
return Objects.equals(getType(), candidate);
}
/**
* Check if the value of {@link #getType()} matches any of the {@link TypeDescriptor} specified.
*/
default boolean anyOf(Type... types)
{
for (Type candidate : types) {
if (Objects.equals(getType(), candidate)) {
return true;
}
}
return false;
}
/**
* Check if the type is numeric ({@link TypeDescriptor#isNumeric()})
*/
@JsonIgnore
default boolean isNumeric()
{
return getType().isNumeric();
}
/**
* Check if the type is a primitive ({@link TypeDescriptor#isPrimitive()}, e.g. not an array, not a complex type)
*/
@JsonIgnore
default boolean isPrimitive()
{
return getType().isPrimitive();
}
/**
* Check if the type is an array ({@link TypeDescriptor#isArray()})
*/
@JsonIgnore
default boolean isArray()
{
return getType().isArray();
}
/**
* Convert a {@link TypeSignature} into a simple string. This value can be converted back into a {@link TypeSignature}
* with {@link Types#fromString(TypeFactory, String)}.
*/
@JsonIgnore
default String asTypeString()
{
if (isArray()) {
return StringUtils.format("ARRAY<%s>", getElementType());
}
final String complexTypeName = getComplexTypeName();
if (!isPrimitive()) {
return complexTypeName == null ? "COMPLEX" : StringUtils.format("COMPLEX<%s>", complexTypeName);
}
return getType().toString();
}
}
| {
"content_hash": "8292dd50705a3a6e858414e21eef3837",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 120,
"avg_line_length": 43.53741496598639,
"alnum_prop": 0.72609375,
"repo_name": "druid-io/druid",
"id": "acf5eef4a505bde86024101c2954f8eb9bc42fd4",
"size": "7207",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/main/java/org/apache/druid/segment/column/TypeSignature.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "2538"
},
{
"name": "CSS",
"bytes": "11623"
},
{
"name": "HTML",
"bytes": "26736"
},
{
"name": "Java",
"bytes": "20112547"
},
{
"name": "JavaScript",
"bytes": "295150"
},
{
"name": "Makefile",
"bytes": "659"
},
{
"name": "PostScript",
"bytes": "5"
},
{
"name": "R",
"bytes": "17002"
},
{
"name": "Roff",
"bytes": "3617"
},
{
"name": "Shell",
"bytes": "6116"
},
{
"name": "TeX",
"bytes": "399444"
},
{
"name": "Thrift",
"bytes": "199"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2005-2016 Red Hat, Inc.
Red Hat licenses this file to you under the Apache License, version
2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.fabric8.support</groupId>
<artifactId>support-project</artifactId>
<version>1.2.0.redhat-630-SNAPSHOT</version>
</parent>
<groupId>io.fabric8.support</groupId>
<packaging>war</packaging>
<artifactId>support-webapp</artifactId>
<name>JBoss Fuse :: Support :: Webapp</name>
<properties>
<!-- this lets this plugin deploy nicely into karaf, these get used
for the ImportPackage directive for maven-bundle-plugin -->
<fuse.osgi.import>
javax.servlet,
javax.servlet.http,
org.ops4j.pax.web.service,
org.osgi.service.http,
org.osgi.framework,
javax.management,
*;resolution:=optional
</fuse.osgi.import>
<fuse.osgi.export></fuse.osgi.export>
<servlet-api-version>2.5</servlet-api-version>
<maven-antrun-plugin-version>1.7</maven-antrun-plugin-version>
<maven-resources-plugin-version>2.6</maven-resources-plugin-version>
<maven-bundle-plugin-version>2.3.7</maven-bundle-plugin-version>
<war-plugin-version>2.1.1</war-plugin-version>
<!--<redhat-support-lib.version>1.0.4.jbossorg-1</redhat-support-lib.version>-->
<redhat-support-lib.version>2.0.7.redhat-2</redhat-support-lib.version>
<webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
<webapp-outdir>${basedir}/target/${webapp-dir}</webapp-outdir>
<plugin-context>/rhaccess-web</plugin-context>
</properties>
<dependencies>
<!-- servlet API is provided by the container -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>fabric-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.hawt</groupId>
<artifactId>hawtio-system</artifactId>
<version>${hawtio-version}</version>
</dependency>
<dependency>
<groupId>com.redhat.gss</groupId>
<artifactId>redhat-support-lib-java</artifactId>
<version>${redhat-support-lib.version}</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.3</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>${osgi-version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- We use maven-antrun-plugin to build up a list of
javascript files for our plugin mbean, this means
it needs to run before the maven-resources-plugin
copies and filters the web.xml, since for this
example we use contextParam settings to configure
our plugin mbean -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin-version}</version>
<executions>
<execution>
<!-- defining this maven plugin in the same phase as the
maven-antrun-plugin but *after* we've configured the
maven-antrun-plugin ensures we filter resources *after*
we've discovered the plugin .js files. -->
<id>copy-resources</id>
<phase>generate-sources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- maven-bundle-plugin config, needed to make this war
deployable in karaf, defines the context that this bundle
should handle requests on -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${maven-bundle-plugin-version}</version>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<manifestLocation>${webapp-outdir}/META-INF</manifestLocation>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Webapp-Context>${plugin-context}</Webapp-Context>
<Web-ContextPath>${plugin-context}</Web-ContextPath>
<Embed-Directory>WEB-INF/lib</Embed-Directory>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Export-Package>${fuse.osgi.export}</Export-Package>
<Import-Package>${fuse.osgi.import}</Import-Package>
<DynamicImport-Package>${fuse.osgi.dynamic}</DynamicImport-Package>
<Private-Package>${fuse.osgi.private.pkg}</Private-Package>
<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
<Bundle-Name>${project.description}</Bundle-Name>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Implementation-Title>RHAccess</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- We define the maven-war-plugin here and make sure it uses
the manifest file generated by the maven-bundle-plugin. We
also ensure it picks up our filtered web.xml and not the one
in src/main/resources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${war-plugin-version}</version>
<configuration>
<outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@
</outputFileNameMapping>
<packagingExcludes>**/classes/OSGI-INF/**</packagingExcludes>
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<manifestFile>${webapp-outdir}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "2d3346f654d55490c9a24c1247d34d6c",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 107,
"avg_line_length": 40.1875,
"alnum_prop": 0.5518921721099015,
"repo_name": "jludvice/fabric8",
"id": "1e29305d8e8a7da90347c70e072f52046ee56f9c",
"size": "9645",
"binary": false,
"copies": "1",
"ref": "refs/heads/1.2.0.redhat-6-3-x",
"path": "tooling/rh-support/support-webapp/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "52"
},
{
"name": "Batchfile",
"bytes": "12242"
},
{
"name": "CSS",
"bytes": "10262"
},
{
"name": "HTML",
"bytes": "23749"
},
{
"name": "Java",
"bytes": "9018908"
},
{
"name": "JavaScript",
"bytes": "605777"
},
{
"name": "Protocol Buffer",
"bytes": "899"
},
{
"name": "Scala",
"bytes": "5260"
},
{
"name": "Shell",
"bytes": "62620"
}
],
"symlink_target": ""
} |
#include <linux/mii.h>
#include <linux/phy.h>
#include <linux/slab.h>
#include <asm/io.h>
#include "stmmac.h"
#define MII_BUSY 0x00000001
#define MII_WRITE 0x00000002
static int stmmac_mdio_busy_wait(void __iomem *ioaddr, unsigned int mii_addr)
{
unsigned long curr;
unsigned long finish = jiffies + 3 * HZ;
do {
curr = jiffies;
if (readl(ioaddr + mii_addr) & MII_BUSY)
cpu_relax();
else
return 0;
} while (!time_after_eq(curr, finish));
return -EBUSY;
}
/**
* stmmac_mdio_read
* @bus: points to the mii_bus structure
* @phyaddr: MII addr reg bits 15-11
* @phyreg: MII addr reg bits 10-6
* Description: it reads data from the MII register from within the phy device.
* For the 7111 GMAC, we must set the bit 0 in the MII address register while
* accessing the PHY registers.
* Fortunately, it seems this has no drawback for the 7109 MAC.
*/
static int stmmac_mdio_read(struct mii_bus *bus, int phyaddr, int phyreg)
{
struct net_device *ndev = bus->priv;
struct stmmac_priv *priv = netdev_priv(ndev);
unsigned int mii_address = priv->hw->mii.addr;
unsigned int mii_data = priv->hw->mii.data;
int data;
u16 regValue = (((phyaddr << 11) & (0x0000F800)) |
((phyreg << 6) & (0x000007C0)));
regValue |= MII_BUSY | ((priv->clk_csr & 0xF) << 2);
if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address))
return -EBUSY;
writel(regValue, priv->ioaddr + mii_address);
if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address))
return -EBUSY;
/* Read the data from the MII data register */
data = (int)readl(priv->ioaddr + mii_data);
return data;
}
/**
* stmmac_mdio_write
* @bus: points to the mii_bus structure
* @phyaddr: MII addr reg bits 15-11
* @phyreg: MII addr reg bits 10-6
* @phydata: phy data
* Description: it writes the data into the MII register from within the device.
*/
static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
u16 phydata)
{
struct net_device *ndev = bus->priv;
struct stmmac_priv *priv = netdev_priv(ndev);
unsigned int mii_address = priv->hw->mii.addr;
unsigned int mii_data = priv->hw->mii.data;
u16 value =
(((phyaddr << 11) & (0x0000F800)) | ((phyreg << 6) & (0x000007C0)))
| MII_WRITE;
value |= MII_BUSY | ((priv->clk_csr & 0xF) << 2);
/* Wait until any existing MII operation is complete */
if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address))
return -EBUSY;
/* Set the MII address register to write */
writel(phydata, priv->ioaddr + mii_data);
writel(value, priv->ioaddr + mii_address);
/* Wait until any existing MII operation is complete */
return stmmac_mdio_busy_wait(priv->ioaddr, mii_address);
}
/**
* stmmac_mdio_reset
* @bus: points to the mii_bus structure
* Description: reset the MII bus
*/
static int stmmac_mdio_reset(struct mii_bus *bus)
{
#if defined(CONFIG_STMMAC_PLATFORM)
struct net_device *ndev = bus->priv;
struct stmmac_priv *priv = netdev_priv(ndev);
unsigned int mii_address = priv->hw->mii.addr;
if (priv->plat->mdio_bus_data->phy_reset) {
pr_debug("stmmac_mdio_reset: calling phy_reset\n");
priv->plat->mdio_bus_data->phy_reset(priv->plat->bsp_priv);
}
/* This is a workaround for problems with the STE101P PHY.
* It doesn't complete its reset until at least one clock cycle
* on MDC, so perform a dummy mdio read.
*/
writel(0, priv->ioaddr + mii_address);
#endif
return 0;
}
/**
* stmmac_mdio_register
* @ndev: net device structure
* Description: it registers the MII bus
*/
int stmmac_mdio_register(struct net_device *ndev)
{
int err = 0;
struct mii_bus *new_bus;
int *irqlist;
struct stmmac_priv *priv = netdev_priv(ndev);
struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data;
int addr, found;
if (!mdio_bus_data)
return 0;
new_bus = mdiobus_alloc();
if (new_bus == NULL)
return -ENOMEM;
if (mdio_bus_data->irqs)
irqlist = mdio_bus_data->irqs;
else
irqlist = priv->mii_irq;
new_bus->name = "stmmac";
new_bus->read = &stmmac_mdio_read;
new_bus->write = &stmmac_mdio_write;
new_bus->reset = &stmmac_mdio_reset;
snprintf(new_bus->id, MII_BUS_ID_SIZE, "%s-%x",
new_bus->name, priv->plat->bus_id);
new_bus->priv = ndev;
new_bus->irq = irqlist;
new_bus->phy_mask = mdio_bus_data->phy_mask;
new_bus->parent = priv->device;
err = mdiobus_register(new_bus);
if (err != 0) {
pr_err("%s: Cannot register as MDIO bus\n", new_bus->name);
goto bus_register_fail;
}
found = 0;
for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
struct phy_device *phydev = new_bus->phy_map[addr];
if (phydev) {
int act = 0;
char irq_num[4];
char *irq_str;
/*
* If an IRQ was provided to be assigned after
* the bus probe, do it here.
*/
if ((mdio_bus_data->irqs == NULL) &&
(mdio_bus_data->probed_phy_irq > 0)) {
irqlist[addr] = mdio_bus_data->probed_phy_irq;
phydev->irq = mdio_bus_data->probed_phy_irq;
}
/*
* If we're going to bind the MAC to this PHY bus,
* and no PHY number was provided to the MAC,
* use the one probed here.
*/
if (priv->plat->phy_addr == -1)
priv->plat->phy_addr = addr;
act = (priv->plat->phy_addr == addr);
switch (phydev->irq) {
case PHY_POLL:
irq_str = "POLL";
break;
case PHY_IGNORE_INTERRUPT:
irq_str = "IGNORE";
break;
default:
sprintf(irq_num, "%d", phydev->irq);
irq_str = irq_num;
break;
}
pr_info("%s: PHY ID %08x at %d IRQ %s (%s)%s\n",
ndev->name, phydev->phy_id, addr,
irq_str, dev_name(&phydev->dev),
act ? " active" : "");
found = 1;
}
}
if (!found) {
pr_warning("%s: No PHY found\n", ndev->name);
mdiobus_unregister(new_bus);
mdiobus_free(new_bus);
return -ENODEV;
}
priv->mii = new_bus;
return 0;
bus_register_fail:
mdiobus_free(new_bus);
return err;
}
/**
* stmmac_mdio_unregister
* @ndev: net device structure
* Description: it unregisters the MII bus
*/
int stmmac_mdio_unregister(struct net_device *ndev)
{
struct stmmac_priv *priv = netdev_priv(ndev);
if (!priv->mii)
return 0;
mdiobus_unregister(priv->mii);
priv->mii->priv = NULL;
mdiobus_free(priv->mii);
priv->mii = NULL;
return 0;
}
| {
"content_hash": "641058efc7494ede9b5a41f700492ccf",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 80,
"avg_line_length": 24.786290322580644,
"alnum_prop": 0.6497478444769806,
"repo_name": "manuelmagix/kernel_bq_piccolo",
"id": "cc15039eaa4739a33e916b5f9506ce0b1c0f4ccc",
"size": "7304",
"binary": false,
"copies": "2070",
"ref": "refs/heads/master",
"path": "drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "4528"
},
{
"name": "Assembly",
"bytes": "9818830"
},
{
"name": "Awk",
"bytes": "18681"
},
{
"name": "C",
"bytes": "494602785"
},
{
"name": "C++",
"bytes": "4382330"
},
{
"name": "Clojure",
"bytes": "480"
},
{
"name": "Groff",
"bytes": "22012"
},
{
"name": "Lex",
"bytes": "40805"
},
{
"name": "Makefile",
"bytes": "1373737"
},
{
"name": "Objective-C",
"bytes": "1218215"
},
{
"name": "Perl",
"bytes": "406175"
},
{
"name": "Python",
"bytes": "37296"
},
{
"name": "Scilab",
"bytes": "21433"
},
{
"name": "Shell",
"bytes": "137667"
},
{
"name": "SourcePawn",
"bytes": "4687"
},
{
"name": "UnrealScript",
"bytes": "6113"
},
{
"name": "Yacc",
"bytes": "83091"
}
],
"symlink_target": ""
} |
from __future__ import print_function
import copy
import numpy
import theano
from theano import Variable, Constant
from theano import tensor
from theano.compile import SharedVariable
from theano.sandbox.cuda.type import CudaNdarrayType
try:
# We must do those import to be able to create the full doc when nvcc
# is not available
from theano.sandbox.cuda import filter as type_support_filter
from theano.sandbox.cuda.basic_ops import HostFromGpu, GpuFromHost
except ImportError:
pass
class _operators(tensor.basic._tensor_py_operators):
"""
Define a few properties and conversion methods for CudaNdarray Variables.
The default implementation of arithemetic operators is to build graphs of
TensorType variables.
The optimization pass (specialization) will insert pure GPU implementations.
This approach relieves the Cuda-Ops of having to deal with input argument
checking and gradients.
"""
def _as_TensorVariable(self):
return HostFromGpu()(self)
def _as_CudaNdarrayVariable(self):
return self
dtype = property(lambda s: 'float32')
broadcastable = property(lambda s: s.type.broadcastable)
ndim = property(lambda s: s.type.ndim)
class CudaNdarrayVariable(_operators, Variable):
pass
CudaNdarrayType.Variable = CudaNdarrayVariable
class CudaNdarrayConstantSignature(tensor.TensorConstantSignature):
pass
class CudaNdarrayConstant(_operators, Constant):
def signature(self):
return CudaNdarrayConstantSignature((self.type, numpy.asarray(self.data)))
def __str__(self):
if self.name is not None:
return self.name
try:
data = str(numpy.asarray(self.data))
except Exception as e:
data = "error while transferring the value: " + str(e)
return "CudaNdarrayConstant{"+data+"}"
CudaNdarrayType.Constant = CudaNdarrayConstant
class CudaNdarraySharedVariable(_operators, SharedVariable):
"""
Shared Variable interface to CUDA-allocated arrays.
"""
get_value_return_ndarray = True
def get_value(self, borrow=False, return_internal_type=False):
"""
Return the value of this SharedVariable's internal array.
Parameters
----------
borrow
Permit the return of internal storage, when used in conjunction with
``return_internal_type=True``.
return_internal_type
True to return the internal ``cuda_ndarray`` instance rather than a
``numpy.ndarray`` (Default False).
By default ``get_value()`` copies from the GPU to a ``numpy.ndarray``
and returns that host-allocated array.
``get_value(False,True)`` will return a GPU-allocated copy of the
original GPU array.
``get_value(True,True)`` will return the original GPU-allocated array
without any copying.
"""
if return_internal_type or not self.get_value_return_ndarray:
# return a cuda_ndarray
if borrow:
return self.container.value
else:
return copy.deepcopy(self.container.value)
else: # return an ndarray
return numpy.asarray(self.container.value)
def set_value(self, value, borrow=False):
"""
Assign `value` to the GPU-allocated array.
Parameters
----------
borrow : bool
``True`` permits reusing `value` itself, ``False`` requires that
this function copies `value` into internal storage.
Notes
-----
Prior to Theano 0.3.1, set_value did not work in-place on the GPU. This
meant that sometimes, GPU memory for the new value would be allocated
before the old memory was released. If you're running near the limits of
GPU memory, this could cause you to run out of GPU memory.
Beginning with Theano 0.3.1, set_value will work in-place on the GPU, if
the following conditions are met:
* The destination on the GPU must be c_contiguous.
* The source is on the CPU.
* The old value must have the same dtype as the new value
(which is a given for now, since only float32 is
supported).
* The old and new value must have the same shape.
* The old value is being completely replaced by the new
value (not partially modified, e.g. by replacing some
subtensor of it).
* You change the value of the shared variable via
set_value, not via the .value accessors. You should not
use the .value accessors anyway, since they will soon be
deprecated and removed.
It is also worth mentioning that, for efficient transfer to the GPU,
Theano will make the new data ``c_contiguous``. This can require an
extra copy of the data on the host.
The inplace on gpu memory work when borrow is either True or False.
"""
if not borrow:
# TODO: check for cuda_ndarray type
if not isinstance(value, numpy.ndarray):
# in case this is a cuda_ndarray, we copy it
value = copy.deepcopy(value)
self.container.value = value # this will copy a numpy ndarray
def __getitem__(self, *args):
# Defined to explicitly use the implementation from `_operators`, since
# the definition in `SharedVariable` is only meant to raise an error.
return _operators.__getitem__(self, *args)
CudaNdarrayType.SharedVariable = CudaNdarraySharedVariable
def cuda_shared_constructor(value, name=None, strict=False,
allow_downcast=None, borrow=False,
broadcastable=None, target='gpu'):
"""
SharedVariable Constructor for CudaNdarrayType.
"""
if target != 'gpu':
raise TypeError('not for gpu')
# THIS CONSTRUCTOR TRIES TO CAST VALUE TO A FLOAT32, WHICH THEN GOES ONTO THE CARD
# SO INT shared vars, float64 shared vars, etc. all end up on the card.
# THIS IS NOT THE DEFAULT BEHAVIOUR THAT WE WANT.
# SEE float32_shared_constructor
# TODO: what should strict mean in this context, since we always have to make a copy?
if strict:
_value = value
else:
_value = theano._asarray(value, dtype='float32')
if not isinstance(_value, numpy.ndarray):
raise TypeError('ndarray required')
if _value.dtype.num != CudaNdarrayType.typenum:
raise TypeError('float32 ndarray required')
if broadcastable is None:
broadcastable = (False,) * len(value.shape)
type = CudaNdarrayType(broadcastable=broadcastable)
print("trying to return?")
try:
rval = CudaNdarraySharedVariable(type=type, value=_value, name=name, strict=strict)
except Exception as e:
print("ERROR", e)
raise
return rval
def float32_shared_constructor(value, name=None, strict=False,
allow_downcast=None, borrow=False,
broadcastable=None, target='gpu'):
"""
SharedVariable Constructor for CudaNdarrayType from numpy.ndarray or
CudaNdarray.
"""
if target != 'gpu':
raise TypeError('not for gpu')
if theano.sandbox.cuda.use.device_number is None:
theano.sandbox.cuda.use("gpu",
force=True,
default_to_move_computation_to_gpu=False,
move_shared_float32_to_gpu=False,
enable_cuda=False)
# if value isn't a float32 ndarray, or a CudaNdarray then raise
if not isinstance(value, (numpy.ndarray, theano.sandbox.cuda.CudaNdarray)):
raise TypeError('ndarray or CudaNdarray required')
if isinstance(value, numpy.ndarray) and value.dtype.num != CudaNdarrayType.typenum:
raise TypeError('float32 ndarray required')
if broadcastable is None:
broadcastable = (False,) * len(value.shape)
type = CudaNdarrayType(broadcastable=broadcastable)
get_value_return_ndarray = True
if isinstance(value, theano.sandbox.cuda.CudaNdarray):
get_value_return_ndarray = False
if borrow:
deviceval = value
else:
deviceval = value.copy()
else:
# type.broadcastable is guaranteed to be a tuple, which this next
# function requires
deviceval = type_support_filter(value, type.broadcastable, False, None)
try:
rval = CudaNdarraySharedVariable(type=type, value=deviceval, name=name, strict=strict)
except Exception as e:
print("ERROR", e)
raise
rval.get_value_return_ndarray = get_value_return_ndarray
return rval
| {
"content_hash": "603753ba55c4496d11edc4141950ffce",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 94,
"avg_line_length": 35.344,
"alnum_prop": 0.6420325939339068,
"repo_name": "rizar/attention-lvcsr",
"id": "17501cc6cb50fa24ce0fe81b81ee059fb889188e",
"size": "8836",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "libs/Theano/theano/sandbox/cuda/var.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1288"
},
{
"name": "C",
"bytes": "156742"
},
{
"name": "C++",
"bytes": "209135"
},
{
"name": "CSS",
"bytes": "3500"
},
{
"name": "Cuda",
"bytes": "231732"
},
{
"name": "Gnuplot",
"bytes": "484"
},
{
"name": "HTML",
"bytes": "33356"
},
{
"name": "Jupyter Notebook",
"bytes": "191071"
},
{
"name": "Makefile",
"bytes": "973"
},
{
"name": "Python",
"bytes": "9313243"
},
{
"name": "Shell",
"bytes": "34454"
},
{
"name": "TeX",
"bytes": "102624"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
namespace bootstrap_git_auto_notes
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
// Uncomment the following line of code to enable query support for actions with an IQueryable or IQueryable<T> return type.
// To avoid processing unexpected or malicious queries, use the validation settings on QueryableAttribute to validate incoming queries.
// For more information, visit http://go.microsoft.com/fwlink/?LinkId=279712.
//config.EnableQuerySupport();
}
}
} | {
"content_hash": "69585000883c5f1e183b7dc3f3d249f4",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 147,
"avg_line_length": 37.083333333333336,
"alnum_prop": 0.648314606741573,
"repo_name": "hamiltondanielb/GitHub-Release-Notes",
"id": "dc7800aef5931f7700b32602304843286888aa3a",
"size": "892",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bootstrap_git_auto_notes/App_Start/WebApiConfig.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "115"
},
{
"name": "C#",
"bytes": "108540"
},
{
"name": "JavaScript",
"bytes": "5150"
}
],
"symlink_target": ""
} |
import os
import pwd
from st2common import log as logging
from st2common.models.system.action import RemoteAction
from st2common.util.shell import quote_unix
__all__ = [
'ParamikoRemoteCommandAction',
]
LOG = logging.getLogger(__name__)
LOGGED_USER_USERNAME = pwd.getpwuid(os.getuid())[0]
class ParamikoRemoteCommandAction(RemoteAction):
def get_full_command_string(self):
# Note: We pass -E to sudo because we want to preserve user provided
# environment variables
env_str = self._get_env_vars_export_string()
cwd = self.get_cwd()
if self.sudo:
if env_str:
command = quote_unix('%s && cd %s && %s' % (env_str, cwd, self.command))
else:
command = quote_unix('cd %s && %s' % (cwd, self.command))
command = 'sudo -E -- bash -c %s' % (command)
else:
if env_str:
command = '%s && cd %s && %s' % (env_str, cwd,
self.command)
else:
command = 'cd %s && %s' % (cwd, self.command)
LOG.debug('Command to run on remote host will be: %s', command)
return command
| {
"content_hash": "5177133ee4bf0ab194f82c228231821f",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 88,
"avg_line_length": 30.15,
"alnum_prop": 0.5530679933665008,
"repo_name": "punalpatel/st2",
"id": "b3bda0251e992cf8de9771896d7a17663975ad49",
"size": "1986",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "st2common/st2common/models/system/paramiko_command_action.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "198"
},
{
"name": "Makefile",
"bytes": "41838"
},
{
"name": "PowerShell",
"bytes": "299"
},
{
"name": "Python",
"bytes": "3729615"
},
{
"name": "Shell",
"bytes": "39063"
},
{
"name": "Slash",
"bytes": "677"
}
],
"symlink_target": ""
} |
/**
* Everything in one source file is kept in a TopLevel structure.
* @param pid The tree representing the package clause.
* @param sourcefile The source file name.
* @param defs All definitions in this file (ClassDef, Import, and Skip)
* @param packge The package it belongs to.
* @param namedImportScope A scope for all named imports.
* @param starImportScope A scope for all import-on-demands.
* @param lineMap Line starting positions, defined only
* if option -g is set.
* @param docComments A hashtable that stores all documentation comments
* indexed by the tree nodes they refer to.
* defined only if option -s is set.
* @param endPositions A hashtable that stores ending positions of source
* ranges indexed by the tree nodes they belong to.
* Defined only if option -Xjcov is set.
*/
public static class JCCompilationUnit extends JCTree implements CompilationUnitTree {
public List<JCAnnotation> packageAnnotations;//包注释
public JCExpression pid;//源文件所在包的全名
public List<JCTree> defs;
public JavaFileObject sourcefile; //在JavaCompiler.parse(2)设置
//packge.members_field是一个Scope,这个Scope里的每一个Entry
//代表了包名目录下的所有除成员类与本地类以外的类
//每个Entry是在Enter阶段加入的
public PackageSymbol packge;
//在Env.topLevelEnv(JCCompilationUnit tree)中进行初始化
public Scope namedImportScope;
public Scope starImportScope;//含java.lang包中的所有类,接口
public long flags;
//在JavaCompiler.parse(2)设置
public Position.LineMap lineMap = null;//com.sun.tools.javac.util.Position
//在Parser.compilationUnit()设置
public Map<JCTree, String> docComments = null;
//在EndPosParser.compilationUnit()设置(加“-Xjcov”选项)
public Map<JCTree, Integer> endPositions = null;
protected JCCompilationUnit(List<JCAnnotation> packageAnnotations,
JCExpression pid,
List<JCTree> defs,
JavaFileObject sourcefile,
PackageSymbol packge,
Scope namedImportScope,
Scope starImportScope) {
super(TOPLEVEL);
this.packageAnnotations = packageAnnotations;
this.pid = pid;
this.defs = defs;
this.sourcefile = sourcefile;
this.packge = packge;
this.namedImportScope = namedImportScope;
this.starImportScope = starImportScope;
}
@Override
public void accept(Visitor v) { v.visitTopLevel(this); }//是指JCTree.Visitor
//是指com.sun.source.tree.Tree.Kind
//COMPILATION_UNIT(CompilationUnitTree.class)
//JCCompilationUnit也实现了CompilationUnitTree接口
public Kind getKind() { return Kind.COMPILATION_UNIT; }
public List<JCAnnotation> getPackageAnnotations() {
return packageAnnotations;
}
public List<JCImport> getImports() {
ListBuffer<JCImport> imports = new ListBuffer<JCImport>();
for (JCTree tree : defs) {
if (tree.tag == IMPORT)
imports.append((JCImport)tree);
else
break;//为什么退出呢?因为import语句是连着在一起出现的
}
return imports.toList();
}
public JCExpression getPackageName() { return pid; }
public JavaFileObject getSourceFile() {
return sourcefile;
}
public Position.LineMap getLineMap() {
return lineMap;
}
public List<JCTree> getTypeDecls() {//返回一棵没有IMPORT的JCTree
//List中的head是<JCTree>,tail是跟着head的子List<JCTree>
List<JCTree> typeDefs;
for (typeDefs = defs; !typeDefs.isEmpty(); typeDefs = typeDefs.tail)
if (typeDefs.head.tag != IMPORT)
break;
return typeDefs;
}
@Override
public <R,D> R accept(TreeVisitor<R,D> v, D d) {
return v.visitCompilationUnit(this, d);
}
} | {
"content_hash": "a42a3aa150d2b95907da74039ec8fb3e",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 89,
"avg_line_length": 43.535353535353536,
"alnum_prop": 0.5814385150812065,
"repo_name": "fengshao0907/Open-Source-Research",
"id": "5be996122e097b95524b0a5389db2c284670c589",
"size": "4572",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Javac2007/流程/tree/Tree/JCCompilationUnit.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "146130"
},
{
"name": "Batchfile",
"bytes": "75552"
},
{
"name": "C",
"bytes": "926153"
},
{
"name": "C++",
"bytes": "53181927"
},
{
"name": "CSS",
"bytes": "10690"
},
{
"name": "D",
"bytes": "25797"
},
{
"name": "DTrace",
"bytes": "64398"
},
{
"name": "HTML",
"bytes": "70715"
},
{
"name": "Java",
"bytes": "32378710"
},
{
"name": "JavaScript",
"bytes": "39651"
},
{
"name": "Makefile",
"bytes": "158575"
},
{
"name": "Mathematica",
"bytes": "18238"
},
{
"name": "Protocol Buffer",
"bytes": "1449"
},
{
"name": "Shell",
"bytes": "215485"
},
{
"name": "XSLT",
"bytes": "351083"
}
],
"symlink_target": ""
} |
using System;
using L4p.Common.FunnelsModel.comm;
using L4p.Common.Loggers;
using L4p.Common.Wcf;
namespace L4p.Common.FunnelsModel.hub
{
public static class WcfHelpers
{
public static IDisposable AsServiceAt(this IFunnelsResolver target, ILogFile log, string uri)
{
var wcf = hub.wcf.FunnelsResolver.New(target);
var host = WcfHost<IFunnelsResolver>.New(log, wcf);
host.StartAt(uri);
return host;
}
public static IDisposable AsService(this IFunnelsShop target, ILogFile log)
{
var info = target.GetInfo();
var uri = info.Uri;
var wcf = hub.wcf.FunnelsShop.New(target);
var host = WcfHost<IFunnelsShop>.New(log, wcf);
host.StartAt(uri);
return host;
}
}
} | {
"content_hash": "6fe875cf3eb8525f094c5605a5139911",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 101,
"avg_line_length": 25.515151515151516,
"alnum_prop": 0.6021377672209026,
"repo_name": "Ubinary/L4p",
"id": "157f01c0e9a89f89313b859625ecd6c2e2567de0",
"size": "842",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "L4p.Common/FunnelsModel/hub/WcfHelpers.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "639694"
},
{
"name": "JavaScript",
"bytes": "1298"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using Raft.Persistance.Journaler.Transformers;
namespace Raft.Persistance.Journaler.Tests.Unit.Transformers
{
[TestFixture]
public class EntryDataTests
{
[Test]
public void PrependsEntryDataLengthToBytes()
{
// Arrange
var entry = BitConverter.GetBytes(100);
var entryData = new EntryData();
// Act
var result = entryData.Transform(entry, new Dictionary<string, string>());
// Assert
result.Length.Should().Be(entry.Length + sizeof (int));
result.Take(sizeof (int))
.SequenceEqual(BitConverter.GetBytes(entry.Length))
.Should().BeTrue();
}
}
}
| {
"content_hash": "14799bc3b7906e35bf9f898f244da045",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 86,
"avg_line_length": 27.933333333333334,
"alnum_prop": 0.6121718377088305,
"repo_name": "yburke94/Raft.net",
"id": "6ed5be55c2edbe2d103c94344a4dfb9207e77adf",
"size": "840",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Raft.Persistance.Journaler.Tests.Unit/Transformers/EntryDataTests.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "576059"
}
],
"symlink_target": ""
} |
/* All OK */
#include <pthread.h>
static pthread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER;
static int shared;
static void *th(void *v)
{
pthread_mutex_lock(&mx);
shared++;
pthread_mutex_unlock(&mx);
return 0;
}
int main()
{
pthread_t a, b;
pthread_mutex_lock(&mx);
pthread_mutex_unlock(&mx);
pthread_create(&a, NULL, th, NULL);
pthread_create(&b, NULL, th, NULL);
pthread_join(a, NULL);
pthread_join(b, NULL);
return 0;
}
| {
"content_hash": "736c44bac02dbe1adbd3177157432a08",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 54,
"avg_line_length": 13.84375,
"alnum_prop": 0.6523702031602708,
"repo_name": "indashnet/InDashNet.Open.UN2000",
"id": "144ce608d1f68c44efe9bab7fd2fc330cb735f1e",
"size": "443",
"binary": false,
"copies": "45",
"ref": "refs/heads/master",
"path": "android/external/valgrind/main/helgrind/tests/hg01_all_ok.c",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/* still unfinished */
#define sys_sysmp printargs
#define sys_sginap printargs
#define sys_sgikopt printargs
#define sys_sysmips printargs
#define sys_sigreturn printargs
#define sys_recvmsg printargs
#define sys_sendmsg printargs
#define sys_nfssvc printargs
#define sys_getfh printargs
#define sys_async_daemon printargs
#define sys_exportfs printargs
#define sys_BSD_getime printargs
#define sys_sproc printargs
#define sys_procblk printargs
#define sys_sprocsp printargs
#define sys_msync printargs
#define sys_madvise printargs
#define sys_pagelock printargs
#define sys_quotactl printargs
#define sys_cacheflush printargs
#define sys_cachectl printargs
#define sys_nuname printargs
#define sys_sigpoll printargs
#define sys_swapctl printargs
#define sys_sigstack printargs
#define sys_sigsendset printargs
#define sys_priocntl printargs
#define sys_ksigqueue printargs
#define sys_lwp_sema_wait printargs
#define sys_lwp_sema_trywait printargs
#define sys_syscall printargs
#define sys_clocal printargs
#define sys_syssun printargs
#define sys_sysi86 printargs
#define sys_sysmachine printargs
#define sys_plock printargs
#define sys_pathconf printargs
#define sys_sigtimedwait printargs
#define sys_ulimit printargs
#define sys_ptrace printargs
#define sys_stty printargs
#define sys_lwp_info printargs
#define sys_priocntlsys printargs
#define sys_hrtsys printargs
#define sys_xenix printargs
#define sys_statfs printargs
#define sys_fstatfs printargs
#define sys_statvfs printargs
#define sys_fstatvfs printargs
#define sys_sigsendsys printargs
#define sys_gtty printargs
#define sys_vtrace printargs
#define sys_fpathconf printargs
#define sys_evsys printargs
#define sys_acct printargs
#define sys_exec printargs
#define sys_lwp_sema_post printargs
#define sys_nfssys printargs
#define sys_sigaltstack printargs
#define sys_uadmin printargs
#define sys_umount printargs
#define sys_modctl printargs
#define sys_acancel printargs
#define sys_async printargs
#define sys_evtrapret printargs
#define sys_lwp_create printargs
#define sys_lwp_exit printargs
#define sys_lwp_suspend printargs
#define sys_lwp_continue printargs
#define sys_lwp_kill printargs
#define sys_lwp_self printargs
#define sys_lwp_setprivate printargs
#define sys_lwp_getprivate printargs
#define sys_lwp_wait printargs
#define sys_lwp_mutex_unlock printargs
#define sys_lwp_mutex_lock printargs
#define sys_lwp_cond_wait printargs
#define sys_lwp_cond_signal printargs
#define sys_lwp_cond_broadcast printargs
#define sys_inst_sync printargs
#define sys_auditsys printargs
#define sys_processor_bind printargs
#define sys_processor_info printargs
#define sys_p_online printargs
#define sys_sigqueue printargs
#define sys_clock_gettime printargs
#define sys_clock_settime printargs
#define sys_clock_getres printargs
#define sys_nanosleep printargs
#define sys_timer_create printargs
#define sys_timer_delete printargs
#define sys_timer_settime printargs
#define sys_timer_gettime printargs
#define sys_timer_getoverrun printargs
#define sys_msgctl printargs
#define sys_msgget printargs
#define sys_msgrcv printargs
#define sys_msgsnd printargs
#define sys_shmat printargs
#define sys_shmctl printargs
#define sys_shmdt printargs
#define sys_shmget printargs
#define sys_semctl printargs
#define sys_semget printargs
#define sys_semop printargs
#define sys_olduname printargs
#define sys_ustat printargs
#define sys_fusers printargs
#define sys_sysfs1 printargs
#define sys_sysfs2 printargs
#define sys_sysfs3 printargs
#define sys_keyctl printargs
#define sys_secsys printargs
#define sys_filepriv printargs
#define sys_devstat printargs
#define sys_fdevstat printargs
#define sys_flvlfile printargs
#define sys_lvlfile printargs
#define sys_lvlequal printargs
#define sys_lvlproc printargs
#define sys_lvlipc printargs
#define sys_auditevt printargs
#define sys_auditctl printargs
#define sys_auditdmp printargs
#define sys_auditlog printargs
#define sys_auditbuf printargs
#define sys_lvldom printargs
#define sys_lvlvfs printargs
#define sys_mkmld printargs
#define sys_mldmode printargs
#define sys_secadvise printargs
#define sys_online printargs
#define sys_lwpinfo printargs
#define sys_lwpprivate printargs
#define sys_processor_exbind printargs
#define sys_prepblock printargs
#define sys_block printargs
#define sys_rdblock printargs
#define sys_unblock printargs
#define sys_cancelblock printargs
#define sys_lwpkill printargs
#define sys_modload printargs
#define sys_moduload printargs
#define sys_modpath printargs
#define sys_modstat printargs
#define sys_modadm printargs
#define sys_lwpsuspend printargs
#define sys_lwpcontinue printargs
#define sys_priocntllst printargs
#define sys_lwp_sema_trywait printargs
#define sys_xsetsockaddr printargs
#define sys_dshmsys printargs
#define sys_invlpg printargs
#define sys_migrate printargs
#define sys_kill3 printargs
#define sys_xbindresvport printargs
#define sys_lwp_sema_trywait printargs
#define sys_tsolsys printargs
#ifndef HAVE_SYS_ACL_H
#define sys_acl printargs
#define sys_facl printargs
#define sys_aclipc printargs
#endif
#define sys_install_utrap printargs
#define sys_signotify printargs
#define sys_schedctl printargs
#define sys_pset printargs
#define sys_resolvepath printargs
#define sys_signotifywait printargs
#define sys_lwp_sigredirect printargs
#define sys_lwp_alarm printargs
#define sys_rpcsys printargs
#define sys_sockconfig printargs
#define sys_ntp_gettime printargs
#define sys_ntp_adjtime printargs
/* like another call */
#define sys_lchown sys_chown
#define sys_setuid sys_close
#define sys_seteuid sys_close
#define sys_setgid sys_close
#define sys_setegid sys_close
#define sys_vhangup sys_close
#define sys_fdsync sys_close
#define sys_setreuid sys_dup2
#define sys_setregid sys_dup2
#define sys_sigfillset sys_sigpending
#define sys_vfork sys_fork
#define sys_ksigaction sys_sigaction
#define sys_BSDgetpgrp sys_getpgrp
#define sys_BSDsetpgrp sys_setpgrp
#define sys_waitsys sys_waitid
#define sys_sigset sys_signal
#define sys_sigrelse sys_sighold
#define sys_sigignore sys_sighold
#define sys_sigpause sys_sighold
#define sys_sleep sys_alarm
#define sys_fork1 sys_fork
#define sys_forkall sys_fork
#define sys_memcntl sys_mctl
#if UNIXWARE > 2
#define sys_rfork1 sys_rfork
#define sys_rforkall sys_rfork
#ifndef HAVE_SYS_NSCSYS_H
#define sys_ssisys printargs
#endif
#endif
/* aio */
#define sys_aionotify printargs
#define sys_aioinit printargs
#define sys_aiostart printargs
#define sys_aiolio printargs
#define sys_aiosuspend printargs
#define sys_aioerror printargs
#define sys_aioliowait printargs
#define sys_aioaread printargs
#define sys_aioawrite printargs
#define sys_aiolio64 printargs
#define sys_aiosuspend64 printargs
#define sys_aioerror64 printargs
#define sys_aioliowait64 printargs
#define sys_aioaread64 printargs
#define sys_aioaread64 printargs
#define sys_aioawrite64 printargs
#define sys_aiocancel64 printargs
#define sys_aiofsync printargs
/* the various 64-bit file stuff */
#if !_LFS64_LARGEFILE
/* we've implemented these */
#define sys_getdents64 printargs
#define sys_mmap64 printargs
#define sys_stat64 printargs
#define sys_lstat64 printargs
#define sys_fstat64 printargs
#define sys_setrlimit64 printargs
#define sys_getrlimit64 printargs
#define sys_pread64 printargs
#define sys_pwrite64 printargs
#define sys_ftruncate64 printargs
#define sys_truncate64 printargs
#define sys_lseek64 printargs
#endif
/* unimplemented 64-bit stuff */
#define sys_statvfs64 printargs
#define sys_fstatvfs64 printargs
/* like another call */
#define sys_creat64 sys_creat
#define sys_open64 sys_open
#define sys_llseek sys_lseek64
/* printargs does the right thing */
#define sys_sync printargs
#define sys_profil printargs
#define sys_yield printargs
#define sys_pause printargs
#define sys_sethostid printargs
/* subfunction entry points */
#define sys_pgrpsys printargs
#define sys_sigcall printargs
#define sys_msgsys printargs
#define sys_shmsys printargs
#define sys_semsys printargs
#define sys_utssys printargs
#define sys_sysfs printargs
#define sys_spcall printargs
#define sys_context printargs
#define sys_door printargs
#define sys_kaio printargs
| {
"content_hash": "97768b01c2866e77ff6d2a24a2816afc",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 40,
"avg_line_length": 29.498194945848375,
"alnum_prop": 0.82193122016889,
"repo_name": "timmattison/strace-arm",
"id": "9ee09272255b315ee5ae2cfa517d13f5e16df003",
"size": "9681",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "svr4/dummy.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "1888999"
},
{
"name": "Emacs Lisp",
"bytes": "3128"
},
{
"name": "Perl",
"bytes": "21109"
},
{
"name": "Shell",
"bytes": "25203"
}
],
"symlink_target": ""
} |
namespace chrono {
namespace vehicle {
/// @addtogroup vehicle_powertrain
/// @{
/// Simple CVT-like powertrain subsystem (specified through JSON file).
class CH_VEHICLE_API SimpleCVTPowertrain : public ChSimpleCVTPowertrain {
public:
SimpleCVTPowertrain(const std::string& filename);
SimpleCVTPowertrain(const rapidjson::Document& d);
~SimpleCVTPowertrain() {}
virtual void SetGearRatios(std::vector<double>& fwd, double& rev) override;
virtual double GetMaxTorque() const override { return m_max_torque; }
virtual double GetMaxPower() const override { return m_max_power; }
virtual double GetMaxSpeed() const override { return m_max_speed; }
private:
virtual void Create(const rapidjson::Document& d) override;
double m_fwd_gear_ratio; // forward gear ratio (single gear transmission)
double m_rev_gear_ratio; // reverse gear ratio
double m_max_torque; // maximum motor torque
double m_max_power; // maximum motor power
double m_max_speed; // maximum engine speed
};
/// @} vehicle_powertrain
} // end namespace vehicle
} // end namespace chrono
#endif
| {
"content_hash": "2aaaa9f848960de2c654489d0be8da22",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 79,
"avg_line_length": 32.6,
"alnum_prop": 0.7072743207712533,
"repo_name": "rserban/chrono",
"id": "5fa4ad58d4f657fdf1a5d63e4f1be1a4ed7dcc91",
"size": "2126",
"binary": false,
"copies": "4",
"ref": "refs/heads/main",
"path": "src/chrono_vehicle/powertrain/SimpleCVTPowertrain.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "7528"
},
{
"name": "C",
"bytes": "2409870"
},
{
"name": "C++",
"bytes": "30022151"
},
{
"name": "CMake",
"bytes": "735935"
},
{
"name": "CSS",
"bytes": "170326"
},
{
"name": "Cuda",
"bytes": "1232062"
},
{
"name": "Dockerfile",
"bytes": "3279"
},
{
"name": "Forth",
"bytes": "169197"
},
{
"name": "GLSL",
"bytes": "4925"
},
{
"name": "HTML",
"bytes": "7922"
},
{
"name": "Inno Setup",
"bytes": "24125"
},
{
"name": "JavaScript",
"bytes": "4731"
},
{
"name": "Lex",
"bytes": "3433"
},
{
"name": "Lua",
"bytes": "651"
},
{
"name": "MATLAB",
"bytes": "35942"
},
{
"name": "POV-Ray SDL",
"bytes": "44795"
},
{
"name": "PowerShell",
"bytes": "115"
},
{
"name": "Python",
"bytes": "833451"
},
{
"name": "SWIG",
"bytes": "316928"
},
{
"name": "Shell",
"bytes": "4782"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.