The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code: DatasetGenerationError
Exception: ArrowInvalid
Message: JSON parse error: Missing a closing quotation mark in string. in row 67
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 145, in _generate_tables
dataset = json.load(f)
File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 9664)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1995, in _prepare_split_single
for _, table in generator:
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 148, in _generate_tables
raise e
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables
pa_table = paj.read_json(
File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: JSON parse error: Missing a closing quotation mark in string. in row 67
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
builder.download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
self._download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
text
string | meta
dict |
|---|---|
window.crmFilter = (function($) {
var isInit = false;
var filter;
var events = $({});
var init = function() {
if (!isInit) {
isInit = true;
$('#crmFilter').advansedFilter({
anykey: true,
anykeytimeout: 1000,
maxfilters: -1,
hintDefaultDisable: false,
sorters: [
{ id: 'displayname', title: MailScriptResource.FilterByTitle, sortOrder: 'ascending', def: true },
{ id: 'contacttype', title: MailScriptResource.FilterByContactStage, sortOrder: 'ascending' }
],
filters: [
{
type: "combobox",
id: "company",
apiparamname: "contactListView",
title: MailScriptResource.FilterCompany,
filtertitle: MailScriptResource.FilterShowGroup,
group: MailScriptResource.FilterShowGroup,
groupby: 'type',
options:
[
{ value: "company", classname: '', title: MailScriptResource.FilterCompany, def: true },
{ value: "person", classname: '', title: MailScriptResource.FilterPerson },
{ value: "withopportunity", classname: '', title: MailScriptResource.FilterWithOpportunity }
]
},
{
type: "combobox",
id: "person",
apiparamname: "contactListView",
title: MailScriptResource.FilterPerson,
filtertitle: MailScriptResource.FilterShowGroup,
group: MailScriptResource.FilterShowGroup,
groupby: 'type',
options:
[
{ value: "company", classname: '', title: MailScriptResource.FilterCompany },
{ value: "person", classname: '', title: MailScriptResource.FilterPerson, def: true },
{ value: "withopportunity", classname: '', title: MailScriptResource.FilterWithOpportunity }
]
},
{
type: "combobox",
id: "withopportunity",
apiparamname: "contactListView",
title: MailScriptResource.FilterWithOpportunity,
filtertitle: MailScriptResource.FilterShowGroup,
group: MailScriptResource.FilterShowGroup,
groupby: 'type',
options:
[
{ value: "company", classname: '', title: MailScriptResource.FilterCompany },
{ value: "person", classname: '', title: MailScriptResource.FilterPerson },
{ value: "withopportunity", classname: '', title: MailScriptResource.FilterWithOpportunity, def: true }
]
},
{
type: "combobox",
id: "stages",
apiparamname: "contactStage",
title: MailScriptResource.FilterContactStage,
group: MailScriptResource.FilterAnotherGroup,
options: [],
defaulttitle: MailScriptResource.FilterChoose,
enable: false
},
{
type: "combobox",
id: "tags",
apiparamname: "tags",
title: MailScriptResource.FilterWithTags,
group: MailScriptResource.FilterAnotherGroup,
options: [],
defaulttitle: MailScriptResource.FilterChoose,
multiple: true,
enable: false
}
]
}).on('setfilter', onSetFilter).on('resetfilter', onResetFilter).on('resetallfilters', onResetAllFilters);
// filter object initialization should follow after advansed filter plugin call - because
// its replace target element with new markup
filter = $('#crmFilter');
tagsManager.bind(tagsManager.events.OnRefresh, onUpdateTags);
tagsManager.bind(tagsManager.events.OnDelete, onUpdateTags);
tagsManager.bind(tagsManager.events.OnCreate, onUpdateTags);
tagsManager.bind(tagsManager.events.OnUpdate, onUpdateTags);
contactStages.events.on('update', onUpdateStages);
}
};
var onSetFilter = function(evt, $container, filterItem, value, selectedfilters) {
events.trigger('set', [filterItem, value, selectedfilters]);
};
var onResetFilter = function(evt, $container, filterItem, selectedfilters) {
events.trigger('reset', [filterItem, selectedfilters]);
};
var onResetAllFilters = function(evt, $container, filterid, selectedfilters) {
events.trigger('resetall', [selectedfilters]);
};
var showItem = function(id, params) {
if (!params) {
params = {};
}
filter.advansedFilter({ filters: [{ id: id, params: params }] });
};
var show = function() {
filter.parent().show();
};
var hide = function() {
filter.parent().hide();
};
var update = function() {
filter.advansedFilter('resize');
onUpdateTags();
contactStages.update();
};
var onUpdateTags = function() {
var tags = [];
$.each(tagsManager.getAllTags(), function(index, value) {
if (0 > value.id) {
tags.push({ value: value.name, classname: 'to', title: value.name });
}
});
filter.advansedFilter({ filters: [{ type: 'combobox', id: 'tags', options: tags, enable: tags.length > 0 }] });
};
var onUpdateStages = function() {
var stages = [];
$.each(contactStages.getStages(), function(index, value) {
stages.push({ value: value.id, classname: 'colorFilterItem color_' + value.color.replace('#', ''), title: value.title });
});
filter.advansedFilter({ filters: [{ type: 'combobox', id: 'stages', options: stages, enable: stages.length > 0 }] });
events.trigger('ready');
};
var clear = function() {
filter.advansedFilter(null);
};
var setCompany = function() {
showItem('company', { value: 'company' });
};
var setPerson = function() {
showItem('person', { value: 'person' });
};
var setOpportunity = function() {
showItem('withopportunity', { value: 'withopportunity' });
};
var setStage = function(value) {
filter.advansedFilter({ filters: [{ type: 'combobox', id: 'stages', params: { value: value } }] });
};
var setTags = function(tags) {
filter.advansedFilter({ filters: [{ type: 'combobox', id: 'tags', params: { value: tags } }] });
};
var setSearch = function(text) {
filter.advansedFilter({ filters: [{ type: 'text', id: 'text', params: { value: text } }] });
};
var setSort = function(sort, order) {
filter.advansedFilter({ sorters: [{ id: sort, selected: true, dsc: 'descending' == order }] });
};
return {
init: init,
clear: clear,
update: update,
show: show,
hide: hide,
setCompany: setCompany,
setPerson: setPerson,
setOpportunity: setOpportunity,
setStage: setStage,
setTags: setTags,
setSearch: setSearch,
setSort: setSort,
events: events
};
})(jQuery);
|
{
"content_hash": "557fa6b281519e53e5699b2b04e11f31",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 133,
"avg_line_length": 38.76328502415459,
"alnum_prop": 0.5028664007976071,
"repo_name": "ONLYOFFICE/CommunityServer",
"id": "9f4e95c6e4e0572c8613fa5ed21aba07120235ac",
"size": "8635",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/studio/ASC.Web.Studio/addons/mail/js/contacts/filter/crmfilter.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "1C Enterprise",
"bytes": "9505"
},
{
"name": "ASP.NET",
"bytes": "1543455"
},
{
"name": "Batchfile",
"bytes": "11616"
},
{
"name": "C",
"bytes": "261"
},
{
"name": "C#",
"bytes": "37439795"
},
{
"name": "C++",
"bytes": "10200"
},
{
"name": "CSS",
"bytes": "632783"
},
{
"name": "Classic ASP",
"bytes": "43003"
},
{
"name": "F#",
"bytes": "9164"
},
{
"name": "HTML",
"bytes": "1350144"
},
{
"name": "Handlebars",
"bytes": "942"
},
{
"name": "JavaScript",
"bytes": "10480939"
},
{
"name": "Less",
"bytes": "1348959"
},
{
"name": "Makefile",
"bytes": "3611"
},
{
"name": "Perl",
"bytes": "6729"
},
{
"name": "PowerShell",
"bytes": "21562"
},
{
"name": "Procfile",
"bytes": "15"
},
{
"name": "Ruby",
"bytes": "30941"
},
{
"name": "Shell",
"bytes": "36554"
},
{
"name": "VBScript",
"bytes": "1225"
},
{
"name": "Visual Basic .NET",
"bytes": "13062"
},
{
"name": "XSLT",
"bytes": "105207"
}
]
}
|
package com.ibm.wuhan.bus.web.formbean;
import java.util.*;
import org.apache.commons.beanutils.locale.converters.DateLocaleConverter;
public class RegisterForm {
// private String id;
private String username;
private String password;
private String password2;
private String email;
private String birthday;
private String nickname;
// private String checkcode;
private Map errors = new HashMap();
public String getUsername() {
return username;
}
public Map getErrors() {
return errors;
}
public void setErrors(Map errors) {
this.errors = errors;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPassword2() {
return password2;
}
public void setPassword2(String password2) {
this.password2 = password2;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
// 用户名不为空 3~8位
// 密码不为空 3~8位数字
// 确认密码不为空 且和密码一致
// 电子邮箱不为空 且格式合法
// 生日可以为空 不为空时必须为日期
// 昵称不能为空 必须是汉字
public boolean validate() {
boolean isOK = true;
if (this.username == null || this.username.trim().equals("")) {
isOK = false;
errors.put("username", "用户名不能为空");
} else {
if (!this.username.matches("[A-Za-z\\d]{3,8}")) {
isOK = false;
errors.put("username", "用户名需要是3~8位字母数字");
}
}
if (this.password == null || this.password.trim().equals("")) {
isOK = false;
errors.put("password", "密码不能为空");
} else {
if (!this.password.matches("\\d{3,8}")) {
isOK = false;
errors.put("password", "密码需要是3~8位数字");
}
}
if (this.password2 == null || this.password2.trim().equals("")) {
isOK = false;
errors.put("password2", "确认密码不能为空");
} else {
if (!this.password.equals(this.password2)) {
isOK = false;
errors.put("password2", "两次密码要一致");
}
}
if (this.email == null || this.email.trim().equals("")) {
isOK = false;
errors.put("email", "邮箱不能为空");
} else {
// \\w+@\\w+(\\.+\\ww)+
if (!this.email.matches("\\w+@\\w+(\\.+\\w+)+")) {
isOK = false;
errors.put("email", "邮箱格式不对");
}
}
if (this.birthday != null && !this.birthday.trim().equals("")) {
// 校验日期是否合法
try {
DateLocaleConverter dlc = new DateLocaleConverter();
dlc.convert(this.birthday, "yyyy-MM-dd");
} catch (Exception e) {
isOK = false;
errors.put("birthday", "日期格式不对");
}
}
if (this.nickname == null || this.nickname.trim().equals("")) {
isOK = false;
errors.put("nickname", "昵称不能为空");
}
return isOK;
}
}
|
{
"content_hash": "ebb0bf1b2e24a7e514e07c9461ad3291",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 74,
"avg_line_length": 19.57718120805369,
"alnum_prop": 0.6324991429550908,
"repo_name": "junhuwh/WHBusApp-TC01",
"id": "d960d4d935b3b785a75bfd8b45fb6bd93ffcdcd5",
"size": "3207",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/ibm/wuhan/bus/web/formbean/RegisterForm.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "27661"
},
{
"name": "HTML",
"bytes": "199"
},
{
"name": "Java",
"bytes": "70259"
},
{
"name": "JavaScript",
"bytes": "1188"
}
]
}
|
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.Extensions.DependencyInjection;
namespace Cofoundry.Web;
/// <summary>
/// UI helper for Page Template functionality such as defining region.
/// </summary>
/// <typeparam name="TModel">ViewModel type</typeparam>
public class PageTemplateHelper<TModel>
: IPageTemplateHelper<TModel>, IViewContextAware
where TModel : IEditablePageViewModel
{
public ViewContext ViewContext { get; private set; }
public TModel Model { get; private set; }
public void Contextualize(ViewContext viewContext)
{
ViewContext = viewContext;
if (viewContext.ViewData.Model is TModel model)
{
if (!(model is IEditablePageViewModel))
{
throw new ArgumentException("Page templates must use a model that inherits from " + typeof(IEditablePageViewModel).Name);
}
Model = model;
}
else
{
throw new Exception("Model is not correct");
}
}
/// <summary>
/// Indictes where to render a region in the page template.
/// </summary>
/// <param name="regionName">The name of the page template region. This must be unique in a page template.</param>
/// <returns>IPageTemplateRegionTagBuilder to allow for method chaining.</returns>
public IPageTemplateRegionTagBuilder Region(string regionName)
{
var factory = ViewContext.HttpContext.RequestServices.GetRequiredService<IPageTemplateRegionTagBuilderFactory>();
var output = factory.Create(ViewContext, (IEditablePageViewModel)Model, regionName);
return output;
}
/// <summary>
/// Sets the description assigned to the template in the
/// administration UI. Use this to tell users what the template
/// should be used for.
/// </summary>
/// <param name="description">A plain text description about this template</param>
public IHtmlContent UseDescription(string description)
{
ArgumentNullException.ThrowIfNull(description);
// nothing is rendered here, this is just used as a convention for adding template meta data
return HtmlString.Empty;
}
}
|
{
"content_hash": "75898bb2e9443dd636fff8d0a2125e29",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 137,
"avg_line_length": 35.65625,
"alnum_prop": 0.6858019281332165,
"repo_name": "cofoundry-cms/cofoundry",
"id": "bcd850d8168e9a6ae2edcad34699254e4605f9a0",
"size": "2284",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Cofoundry.Web/Framework/Mvc/ViewHelpers/PageTemplates/PageTemplateHelper.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "4940398"
},
{
"name": "CSS",
"bytes": "185312"
},
{
"name": "HTML",
"bytes": "348286"
},
{
"name": "JavaScript",
"bytes": "869157"
},
{
"name": "PowerShell",
"bytes": "8549"
},
{
"name": "SCSS",
"bytes": "245339"
},
{
"name": "TSQL",
"bytes": "160288"
}
]
}
|
package jexcelunit.classmodule;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@SuppressWarnings("rawtypes")
public class PrimitiveChecker {
public static Class unWrapping(Class wrapper){
//Numeric
if(wrapper.equals(Short.class)) return short.class;
else if(wrapper.equals(Long.class)) return long.class;
else if(wrapper.equals(Integer.class)) return int.class;
else if(wrapper.equals(Byte.class)) return byte.class;
else if(wrapper.equals(Short.class)) return short.class;
//Floating Type
else if(wrapper.equals(Double.class)) return double.class;
else if(wrapper.equals(Float.class)) return float.class;
//BooleanType
else if(wrapper.equals(Boolean.class)) return boolean.class;
//etc
else if(wrapper.equals(Void.class)) return void.class;
else if(wrapper.equals(Character.class)) return char.class;
else return wrapper;
}
//Check this type is Wrapper class about primitive type.
public static boolean isWrapperClass(Class type){
if(
type.equals(Short.class)
|| type.equals(Double.class)
|| type.equals(Long.class)
|| type.equals(Byte.class)
|| type.equals(Float.class)
|| type.equals(Integer.class)
|| type.equals(Boolean.class)
|| type.equals(Character.class)
|| type.equals(String.class)
|| type.equals(StringBuffer.class)
|| type.equals(Object.class)
)
return true;
else if(type.getSuperclass() !=null){
if(type.getSuperclass().equals(Number.class))
return true;
else return false;
}
else return false;
}
public static int getFloatingType(Class type){
if(type.equals(float.class) || type.equals(Float.class))
return 1;
else if(type.equals(double.class)|| type.equals(Double.class))
return 0;
else
return -1;
}
@SuppressWarnings("unchecked")
public static Object convertObject(Class targetType,String paramString){
try {
Object paramObject=null;
//wrapper
if(isWrapperClass(targetType))
{
paramObject=targetType.getConstructor(String.class).newInstance(paramString.trim());
return paramObject;
}
//primitive
else if(targetType.equals(char.class))
return paramString.toCharArray()[0];
else if(targetType.equals(char[].class))
return paramString.toCharArray();
else if(targetType.equals(int.class)) return (int)Integer.parseInt(paramString);
else if(targetType.equals(double.class)) return (double)Double.parseDouble(paramString);
else if(targetType.equals(float.class)) return (float)Float.parseFloat(paramString);
else if(targetType.equals(short.class)) return (short)Short.parseShort(paramString);
else if(targetType.equals(Date.class))
{
try {
return new SimpleDateFormat().parse(paramString);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} //need To parse
}
else if(targetType.equals(boolean.class)) return (boolean)Boolean.parseBoolean(paramString);
else if(targetType.equals(byte.class)) return (byte)Byte.parseByte(paramString);
else if(targetType.isArray()) {
//if value is array.
String[] arrayItems = paramString.split(",");
Object item = null;
ArrayList list= new ArrayList();
for(String itemStr : arrayItems) {
itemStr= itemStr.trim();
item = PrimitiveChecker.convertObject(targetType.getComponentType(), itemStr);
list.add(item);
}
return list.toArray();
}
else if(isClassCollection(targetType)){
//TODO
//ÄÄÆ÷³ÍÆ® ŸÀÔÀ» ¾Ë¾Æ³»¾ßÇÔ..
if(paramString.equals("emptyList")) return new ArrayList();
else if(paramString.equals("emptySet")) return new HashSet();
else if(paramString.equals("emptyMap")) return new HashMap();
else {
String[] arrayItems = paramString.split(",");
Object item = null;
ArrayList list= new ArrayList();
for(String itemStr : arrayItems) {
itemStr= itemStr.trim();
item = itemStr;
list.add(item);
}
return list;
}
}
else if(paramString.toLowerCase().equals("null"))
return null;
else //mock;
return paramString;
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
@SuppressWarnings("unchecked")
public static Object ConvertToCollection(Class targetType, String paramString, Class componentType){
try {
if(List.class.isAssignableFrom(targetType)){
List list = (List) targetType.newInstance();
if(paramString.equals("emptyList")) return list;
String[] arrayItems = paramString.split(",");
Object item = null;
for(String itemStr : arrayItems) {
itemStr= itemStr.trim();
item = PrimitiveChecker.convertObject(componentType, itemStr);
list.add(item);
}
return list;
}
//2. Set
else if(Set.class.isAssignableFrom(targetType)){
Set set =(Set) targetType.newInstance();
if(paramString.equals("emptySet")) return set;
String[] arrayItems = paramString.split(",");
Object item = null;
for(String itemStr : arrayItems) {
itemStr= itemStr.trim();
item = PrimitiveChecker.convertObject(componentType, itemStr);
set.add(item);
}
return set;
}
//3. Map
else if(Map.class.isAssignableFrom(targetType)){
Map map=(Map) targetType.newInstance();
if(paramString.equals("emptyMap")) return map;
//TODO
return map;
}
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
/*
* ÀǵµÄ¡ ¾ÊÀº ClassInfo ·ÎµùÀ» ¸·¾Æ¾ßÇϴ°ÍÀÌ Å°Æ÷ÀÎÆ®.
* ¹æ¹ýÀº ¸î°¡Áö »ý°¢Çغ»°Å.
*
* 3.
* */
public static boolean isPrimitiveOrWrapper(Class type){
boolean flag= false;
if(type.isPrimitive())
flag= true;
else if(isWrapperClass(type))
flag=true;
return flag;
}
public static boolean isUserClass(Class type){
return !isClassCollection(type) && !isJavaType(type) &&!isPrimitiveOrWrapper(type) && !type.isArray();
}
public static boolean isClassCollection(Class c) {
return Collection.class.isAssignableFrom(c) || Map.class.isAssignableFrom(c);
}
public static boolean isCollection(Object ob) {
return ob instanceof Collection || ob instanceof Map;
}
public static boolean isJavaType(Class type){
Package packageName = type.getPackage();
if(packageName !=null){
return packageName.getName().startsWith("java.");
}
else return false;
}
}
|
{
"content_hash": "2a172d04df6fe7f856fa2cce09e98bba",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 104,
"avg_line_length": 30.642857142857142,
"alnum_prop": 0.7004662004662005,
"repo_name": "shpongle2634/JexcelUnit",
"id": "fa8585499e03f1755eef8bbaa143d6374f36ec41",
"size": "6864",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "JexcelUnit/src/jexcelunit/classmodule/PrimitiveChecker.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "82018"
}
]
}
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Transactions;
using Microsoft.DotNet.Cli;
using Microsoft.DotNet.ToolPackage;
using Microsoft.DotNet.Tools;
using Microsoft.Extensions.EnvironmentAbstractions;
using NuGet.Versioning;
namespace Microsoft.DotNet.Tools.Tests.ComponentMocks
{
internal class ToolPackageInstallerMock : IToolPackageInstaller
{
private const string ProjectFileName = "TempProject.csproj";
private readonly IToolPackageStore _store;
private readonly IProjectRestorer _projectRestorer;
private readonly IFileSystem _fileSystem;
private readonly Action _installCallback;
private readonly Dictionary<PackageId, IEnumerable<string>> _warningsMap;
private readonly Dictionary<PackageId, IReadOnlyList<FilePath>> _packagedShimsMap;
public ToolPackageInstallerMock(
IFileSystem fileSystem,
IToolPackageStore store,
IProjectRestorer projectRestorer,
Action installCallback = null,
Dictionary<PackageId, IEnumerable<string>> warningsMap = null,
Dictionary<PackageId, IReadOnlyList<FilePath>> packagedShimsMap = null)
{
_fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));
_store = store ?? throw new ArgumentNullException(nameof(store));
_projectRestorer = projectRestorer ?? throw new ArgumentNullException(nameof(projectRestorer));
_installCallback = installCallback;
_warningsMap = warningsMap ?? new Dictionary<PackageId, IEnumerable<string>>();
_packagedShimsMap = packagedShimsMap ?? new Dictionary<PackageId, IReadOnlyList<FilePath>>();
}
public IToolPackage InstallPackage(PackageId packageId,
VersionRange versionRange = null,
string targetFramework = null,
FilePath? nugetConfig = null,
DirectoryPath? rootConfigDirectory = null,
string[] additionalFeeds = null,
string verbosity = null)
{
var packageRootDirectory = _store.GetRootPackageDirectory(packageId);
string rollbackDirectory = null;
return TransactionalAction.Run<IToolPackage>(
action: () => {
var stageDirectory = _store.GetRandomStagingDirectory();
_fileSystem.Directory.CreateDirectory(stageDirectory.Value);
rollbackDirectory = stageDirectory.Value;
var tempProject = new FilePath(Path.Combine(stageDirectory.Value, ProjectFileName));
// Write a fake project with the requested package id, version, and framework
_fileSystem.File.WriteAllText(
tempProject.Value,
$"{packageId}:{versionRange?.ToString("S", new VersionRangeFormatter()) ?? "*"}:{targetFramework}");
// Perform a restore on the fake project
_projectRestorer.Restore(
tempProject,
stageDirectory,
nugetConfig,
verbosity);
if (_installCallback != null)
{
_installCallback();
}
var version = _store.GetStagedPackageVersion(stageDirectory, packageId);
var packageDirectory = _store.GetPackageDirectory(packageId, version);
if (_fileSystem.Directory.Exists(packageDirectory.Value))
{
throw new ToolPackageException(
string.Format(
CommonLocalizableStrings.ToolPackageConflictPackageId,
packageId,
version.ToNormalizedString()));
}
_fileSystem.Directory.CreateDirectory(packageRootDirectory.Value);
_fileSystem.Directory.Move(stageDirectory.Value, packageDirectory.Value);
rollbackDirectory = packageDirectory.Value;
IEnumerable<string> warnings = null;
_warningsMap.TryGetValue(packageId, out warnings);
IReadOnlyList<FilePath> packedShims = null;
_packagedShimsMap.TryGetValue(packageId, out packedShims);
return new ToolPackageMock(_fileSystem, packageId, version, packageDirectory, warnings: warnings, packagedShims: packedShims);
},
rollback: () => {
if (rollbackDirectory != null && _fileSystem.Directory.Exists(rollbackDirectory))
{
_fileSystem.Directory.Delete(rollbackDirectory, true);
}
if (_fileSystem.Directory.Exists(packageRootDirectory.Value) &&
!_fileSystem.Directory.EnumerateFileSystemEntries(packageRootDirectory.Value).Any())
{
_fileSystem.Directory.Delete(packageRootDirectory.Value, false);
}
});
}
}
}
|
{
"content_hash": "2c5af72f2eba70e14bba681cab1712e1",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 146,
"avg_line_length": 47.077586206896555,
"alnum_prop": 0.6015381798205457,
"repo_name": "svick/cli",
"id": "9737ff858e61be0f3b687a7533cb5a24a1a4f71c",
"size": "5463",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/Microsoft.DotNet.Tools.Tests.ComponentMocks/ToolPackageInstallerMock.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2069"
},
{
"name": "C#",
"bytes": "2047296"
},
{
"name": "F#",
"bytes": "476"
},
{
"name": "Groovy",
"bytes": "4206"
},
{
"name": "HTML",
"bytes": "36204"
},
{
"name": "PowerShell",
"bytes": "48497"
},
{
"name": "Shell",
"bytes": "60962"
},
{
"name": "Visual Basic",
"bytes": "1309"
}
]
}
|
@implementation ZPHTTPClient
+(NSString *)getUrl:(NSString *)urlString QueryParameter : (NSMutableDictionary *) queryParam
{
@try
{
urlString = [urlString stringByAppendingString:[self constructQueryString: queryParam]];
NSLog(@"HttpClient ---> Get URL: %@",urlString);
NSError *error = [[NSError alloc] init];
NSHTTPURLResponse *response = Nil;
NSMutableURLRequest *request = [self createRequestWithUrl: urlString HTTPMethod:@"GET" HTTPHeaders:nil];
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSLog(@"HTTPClient ---> Response Code: %ld Message: %@", (long)[response statusCode], [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]);
if ([response statusCode] >= 200 && [response statusCode] < 400)
{
if([response statusCode] == 204)
{
@throw [ZPUtil exceptionWithCode: @"" Message: @"Server did not return any content."];
}
return [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
}
@throw [ZPUtil exception:[NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error]];
}
@catch (ZPException *exception)
{
@throw;
}
@catch (NSException *exec)
{
@throw;
}
@finally
{
}
}
+(NSString *)postUrl:(NSString *)urlString QueryParameter : (NSMutableDictionary *) queryParam RequestBody:(NSMutableDictionary *)requestBody
{
@try
{
NSLog(@"HTTPClient ---> POST URL: %@",urlString);
NSMutableDictionary *headers = [[NSMutableDictionary alloc] init];
[headers setValue:@"application/x-www-form-urlencoded; charset=UTF-8" forKey:@"Content-Type"];
if(queryParam != nil && [queryParam count] > 0)
{
urlString = [urlString stringByAppendingString:[self constructQueryString: queryParam]];
}
NSMutableURLRequest *request = [self createRequestWithUrl: urlString HTTPMethod:@"POST" HTTPHeaders: headers];
NSError *error = [[NSError alloc] init];
NSHTTPURLResponse *response = Nil;
if(requestBody != nil && [requestBody count] > 0)
{
NSString *requestParam = [[NSString alloc] init];
for (NSString *key in requestBody)
{
NSString *value = [requestBody valueForKey:key];
if(![requestParam isEqualToString:@""])
{
requestParam = [requestParam stringByAppendingString:@"&"];
}
if([value isKindOfClass:[NSNumber class]])
{
requestParam = [requestParam stringByAppendingFormat:@"%@=%@", key, value];
}
else if([value isKindOfClass:[@(TRUE) class]])
{
requestParam = [requestParam stringByAppendingFormat:@"%@=%@", key, ([value boolValue])?@"true":@"false"];
}
else
{
//requestParam = [requestParam stringByAppendingFormat:@"%@=%@", key, value];
requestParam = [requestParam stringByAppendingFormat:@"%@=%@", key, (NSString *) CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef) value, NULL, (CFStringRef) @"&%", kCFStringEncodingUTF8))];
}
}
NSLog(@"Request string: %@", requestParam);
[request setHTTPBody:[requestParam dataUsingEncoding:NSUTF8StringEncoding]];
[request setValue:[NSString stringWithFormat:@"%ld", (long)[requestParam length]] forHTTPHeaderField:@"Content-Length"];
}
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSLog(@"HTTPClient ---> Response Code: %ld Message: %@", (long)[response statusCode], [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]);
if ([response statusCode] >= 200 && [response statusCode] < 400)
{
if([response statusCode] == 204)
{
@throw [ZPUtil exceptionWithCode: @"" Message: @"Server did not return any content."];
}
return [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
}
@throw [ZPUtil exception:[NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error]];
}
@catch (ZPException *exception)
{
@throw;
}
@catch (NSException *eee)
{
@throw;
}
@finally
{
}
}
+(NSString *) postUrl:(NSString *)urlString QueryParameter:(NSMutableDictionary *)queryParam RequestBody:(NSMutableDictionary *)requestBody Files:(NSMutableDictionary *)attachments
{
@try
{
urlString = [urlString stringByAppendingString:[self constructQueryString: queryParam]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
NSError *error = [[NSError alloc] init];
NSHTTPURLResponse *response = Nil;
NSLog(@"HTTPClient ---> POST URL With File: %@",urlString);
[request setHTTPMethod:@"POST"];
[request setURL: [NSURL URLWithString:urlString]];
NSString *boundary = @"---------------------------034913c6133037ce7063d9931f30e146";
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
[request setValue:contentType forHTTPHeaderField:@"Content-Type"];
NSMutableData *postData = [NSMutableData data];
if(requestBody != nil)
{
for(NSString *key in requestBody)
{
NSString *value = [requestBody valueForKey:key];
[postData appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n", key] dataUsingEncoding:NSUTF8StringEncoding]];
if([value isKindOfClass:[NSNumber class]])
{
[postData appendData:[[NSString stringWithFormat:@"%@",value] dataUsingEncoding:NSUTF8StringEncoding]];
}
else if([value isKindOfClass:[@(TRUE) class]])
{
[postData appendData:[[value boolValue]? @"true":@"false" dataUsingEncoding:NSUTF8StringEncoding]];
}
else
{
[postData appendData:[value dataUsingEncoding:NSUTF8StringEncoding]];
//[postData appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
}
}
//NSLog(@"POST Data: %@", [[NSString alloc] initWithData:postData encoding:NSUTF8StringEncoding]);
}
if(attachments != nil && [attachments count] > 0)
{
for(NSString *fileParam in attachments)
{
NSMutableArray *fileArray = [attachments valueForKey:fileParam];
for(NSString *filePath in fileArray)
{
if(filePath != nil && ![filePath isEqualToString:@""] && [[NSFileManager defaultManager] fileExistsAtPath: filePath])
{
NSData *fileData = [[NSData alloc] initWithContentsOfFile:filePath];
NSString *fileName = [filePath lastPathComponent];
[postData appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\n", fileParam, fileName]dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[NSMutableData dataWithData:fileData]];
[postData appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
}
else
{
NSMutableDictionary *fileError = [[NSMutableDictionary alloc] init];
[fileError setValue:@"Please check given filepath and filename." forKey:@"message"];
@throw [ZPUtil exception: fileError];
}
}
}
}
[postData appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
NSLog(@"Request String: %@", [[NSString alloc] initWithData: [request HTTPBody] encoding: NSUTF8StringEncoding]);
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
if ([response statusCode] >= 200 && [response statusCode] < 400)
{
if([response statusCode] == 204)
{
@throw [ZPUtil exceptionWithCode: @"" Message: @"Server did not return any content."];
}
return [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
}
@throw [ZPUtil exception:[NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error]];
}
@catch (ZPException *exception)
{
@throw;
}
@catch (NSException *eee)
{
@throw;
}
@finally
{
}
}
+(NSString *) putUrl:(NSString *)urlString QueryParameter : (NSMutableDictionary *) queryParam RequestBody:(NSMutableDictionary *)requestBody
{
@try
{
NSLog(@"HTTPClient ---> PUT URL: %@",urlString);
NSMutableDictionary *headers = [[NSMutableDictionary alloc] init];
[headers setValue:@"application/x-www-form-urlencoded; charset=UTF-8" forKey:@"Content-Type"];
if(queryParam != nil && [queryParam count] > 0)
{
urlString = [urlString stringByAppendingString:[self constructQueryString: queryParam]];
}
NSMutableURLRequest *request = [self createRequestWithUrl: urlString HTTPMethod:@"PUT" HTTPHeaders: headers];
NSError *error = [[NSError alloc] init];
NSHTTPURLResponse *response = Nil;
if(requestBody != nil && [requestBody count] > 0)
{
NSString *requestParam = [[NSString alloc] init];
for (NSString *key in requestBody)
{
if(![requestParam isEqualToString:@""])
{
requestParam = [requestParam stringByAppendingString:@"&"];
}
NSString *value = [requestBody valueForKey:key];
requestParam = [requestParam stringByAppendingFormat:@"%@=%@", key, (NSString *)
CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL,
(CFStringRef) value,
NULL,
(CFStringRef) @"&%",
kCFStringEncodingUTF8))];
}
[request setHTTPBody:[requestParam dataUsingEncoding:NSUTF8StringEncoding]];
[request setValue:[NSString stringWithFormat:@"%ld", (long)[requestParam length]] forHTTPHeaderField:@"Content-Length"];
//NSLog(@"POST Data: %@", [[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding]);
}
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
if ([response statusCode] >= 200 && [response statusCode] < 400)
{
if([response statusCode] == 204)
{
@throw [ZPUtil exceptionWithCode: @"" Message: @"Server did not return any content."];
}
return [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
}
@throw [ZPUtil exception:[NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error]];
}
@catch (ZPException *exception)
{
@throw;
}
@catch (NSException *eee)
{
@throw;
}
@finally
{
}
}
+(NSString *) putUrl:(NSString *)urlString QueryParameter:(NSMutableDictionary *)queryParam RequestBody:(NSMutableDictionary *)requestBody Files:(NSMutableDictionary *)attachments
{
@try
{
urlString = [urlString stringByAppendingString:[self constructQueryString: queryParam]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
NSError *error = [[NSError alloc] init];
NSHTTPURLResponse *response = Nil;
NSLog(@"HTTPClient ---> PUT URL With File: %@",urlString);
[request setHTTPMethod:@"PUT"];
[request setURL: [NSURL URLWithString:urlString]];
NSString *boundary = @"---------------------------034913c6133037ce7063d9931f30e146";
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
[request setValue:contentType forHTTPHeaderField:@"Content-Type"];
NSMutableData *putData = [NSMutableData data];
if(requestBody != nil)
{
for(NSString *key in requestBody)
{
NSString *value = [requestBody valueForKey:key];
[putData appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[putData appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n", key] dataUsingEncoding:NSUTF8StringEncoding]];
if([value isKindOfClass:[NSNumber class]])
{
[putData appendData:[[NSString stringWithFormat:@"%@",value] dataUsingEncoding:NSUTF8StringEncoding]];
}
if([value isKindOfClass:[@(TRUE) class]])
{
[putData appendData:[[value boolValue]? @"true":@"false" dataUsingEncoding:NSUTF8StringEncoding]];
}
else
{
[putData appendData:[value dataUsingEncoding:NSUTF8StringEncoding]];
//[putData appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
}
}
//NSLog(@"PUT Data: %@", [[NSString alloc] initWithData:postData encoding:NSUTF8StringEncoding]);
}
if(attachments != nil && [attachments count] > 0)
{
for(NSString *fileParam in attachments)
{
NSMutableArray *fileArray = [attachments valueForKey:fileParam];
for(NSString *filePath in fileArray)
{
if(filePath != nil && ![filePath isEqualToString:@""] && [[NSFileManager defaultManager] fileExistsAtPath: filePath])
{
NSData *fileData = [[NSData alloc] initWithContentsOfFile:filePath];
NSString *fileName = [filePath lastPathComponent];
[putData appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[putData appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\n", fileParam, fileName]dataUsingEncoding:NSUTF8StringEncoding]];
[putData appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[putData appendData:[NSMutableData dataWithData:fileData]];
[putData appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
}
else
{
NSMutableDictionary *fileError = [[NSMutableDictionary alloc] init];
[fileError setValue:@"Please check given filepath and filename." forKey:@"message"];
@throw [ZPUtil exception: fileError];
}
}
}
}
[putData appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:putData];
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
if ([response statusCode] >= 200 && [response statusCode] < 400)
{
if([response statusCode] == 204)
{
@throw [ZPUtil exceptionWithCode: @"" Message: @"Server did not return any content."];
}
return [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
}
@throw [ZPUtil exception:[NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error]];
}
@catch (ZPException *exception)
{
@throw;
}
@catch (NSException *eee)
{
@throw;
}
@finally
{
}
}
+(NSString *)deleteUrl:(NSString *)urlString QueryParameter : (NSMutableDictionary *) queryParam
{
@try
{
urlString = [urlString stringByAppendingString:[self constructQueryString: queryParam]];
NSLog(@"HTTPClient ---> Delete URL: %@",urlString);
NSMutableURLRequest *request = [self createRequestWithUrl: urlString HTTPMethod:@"DELETE" HTTPHeaders:nil];
NSError *error = [[NSError alloc] init];
NSHTTPURLResponse *response = Nil;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSLog(@"Response Code: %ld | Message: %@", (long)[response statusCode], [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]);
if ([response statusCode] >= 200 && [response statusCode] < 400)
{
if([response statusCode] == 204)
{
@throw [ZPUtil exceptionWithCode: @"" Message: @"Server did not return any content."];
}
return [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
}
@throw [ZPUtil exception:[NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error]];
}
@catch (ZPException *exception)
{
@throw;
}
@catch (NSException *exec)
{
@throw;
}
@finally
{
}
}
+(NSString *) constructQueryString:(NSMutableDictionary *)queryParam
{
NSString *queryString = [[NSString alloc] init];
if(queryParam != nil && [queryParam count] > 0)
{
queryString = @"?";
for(NSString *key in queryParam)
{
if(![queryString isEqual: @"?"])
{
queryString = [queryString stringByAppendingString:@"&"];
}
queryString = [queryString stringByAppendingFormat:@"%@=%@", key, [queryParam valueForKey:key]];
}
}
return queryString;
}
+(NSMutableURLRequest *)createRequestWithUrl:(NSString *)urlString HTTPMethod:(NSString *)method HTTPHeaders:(NSMutableDictionary *)headerParam
{
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setHTTPMethod: method];
[request addValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request addValue:@"ZohoProjects-ObjectiveC-Wrapper/1.0" forHTTPHeaderField:@"User-Agent"];
[request addValue:@"UTF-8" forHTTPHeaderField:@"Accept-Charset"];
if(headerParam != nil && [headerParam count] > 0)
{
for(NSString *headerName in headerParam)
{
[request addValue:[headerParam valueForKey: headerName] forHTTPHeaderField: headerName];
}
}
[request setURL: [NSURL URLWithString:urlString]];
return request;
}
@end
|
{
"content_hash": "eeef5be45eb99a7fd40b78ca32338177",
"timestamp": "",
"source": "github",
"line_count": 440,
"max_line_length": 238,
"avg_line_length": 46.356818181818184,
"alnum_prop": 0.5873412756777957,
"repo_name": "zoho/projects-objectivec-wrappers",
"id": "689b45d83c59b0be32e5f9887236d070a8b1d322",
"size": "20575",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ProjectsAPIWrappers/Util/ZPHTTPClient.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "255406"
}
]
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>izf: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.14.1 / izf - 8.9.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
izf
<small>
8.9.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-10-28 17:55:27 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-28 17:55:27 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.14.1 Formal proof management system
dune 3.4.1 Fast, portable, and opinionated build system
ocaml 4.08.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.08.1 Official release 4.08.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/izf"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/IZF"]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
]
tags: [
"keyword: Intuitionistic set theory"
"keyword: pointed graphs"
"keyword: type theory"
"keyword: intuitionistic choice operator"
"keyword: set theory"
"keyword: Zermelo-Fraenkel"
"category: Mathematics/Logic/Set theory"
"date: 2003-02"
]
authors: [
"Alexandre Miquel <Alexandre.Miquel@pps.jussieu.fr> [http://www.pps.jussieu.fr/~miquel]"
]
bug-reports: "https://github.com/coq-contribs/izf/issues"
dev-repo: "git+https://github.com/coq-contribs/izf.git"
synopsis: "Intuitionistic Zermelo-Fraenkel Set Theory in Coq"
description: """
This development contains the set-as-pointed-graph
interpretation of Intuitionistic Zermelo Frankel set theory in system
F_omega.2++ (F_omega + one extra universe + intuitionistic choice
operator), which is described in chapter 9 of the author's PhD
thesis (for IZ) and in the author's CSL'03 paper (for the extension
IZ -> IZF)."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/izf/archive/v8.9.0.tar.gz"
checksum: "md5=63408951be1dddce6e29a691c2fa95c4"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-izf.8.9.0 coq.8.14.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.14.1).
The following dependencies couldn't be met:
- coq-izf -> coq < 8.10~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-izf.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "d04509f2a8869c2d2cdc2a01e643970d",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 159,
"avg_line_length": 40.972375690607734,
"alnum_prop": 0.5535329018338727,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "2cce86bb62eee340da1e2696c399b3b5c9bbe664",
"size": "7441",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.08.1-2.0.5/released/8.14.1/izf/8.9.0.html",
"mode": "33188",
"license": "mit",
"language": []
}
|
.PHONY: clean test examples examples/hello examples/auth
install:
npm install
test:
node --harmony test/setup.js
examples:
find examples/ -name 'package.json' -a ! -path '*/node_modules/*' -execdir npm install \;
examples/hello:
node --harmony examples/hello/index.js
examples/auth:
node --harmony examples/auth/index.js
clean:
rm -rf node_modules
|
{
"content_hash": "17f9c8fb3904dc7dffe3a847ae0493f6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 90,
"avg_line_length": 18.94736842105263,
"alnum_prop": 0.7333333333333333,
"repo_name": "oconnore/tree-router",
"id": "fa51499e41d3d4ad94a6c17e7e6e28075e4135d9",
"size": "360",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Makefile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "42630"
},
{
"name": "Shell",
"bytes": "410"
}
]
}
|
var port = process.env.port || 1337;
var express = require('express');
var path = require('path');
var tweets = require('./routes/tweets.js');
// initialize application
var app = express();
app.use(express.static(path.join(__dirname, 'public')));
// setup api routes
app.use('/api', tweets)
// start the server
var server = app.listen(port, function () {
console.log('GottaGoToWork app listening on port ' + port);
});
|
{
"content_hash": "70aaeb16b2570f7a1dc618431c7346ec",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 63,
"avg_line_length": 24.055555555555557,
"alnum_prop": 0.6674364896073903,
"repo_name": "stevenfollis/GottaGoToWork",
"id": "97b035052c3ec7c3ad7e84dce50a36669b2e8bce",
"size": "435",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "708"
},
{
"name": "HTML",
"bytes": "2521"
},
{
"name": "JavaScript",
"bytes": "5165"
}
]
}
|
$(document).ready(function(){
function getData(url) {
return new Promise((resolve, reject) => {
d3.tsv(url, data => {
if(data) {
resolve(data);
}
else{
reject(new Error('get data error'));
}
});
});
}
function getGPS() {
return new Promise((resolve, reject) => {
if(navigator.geolocation)
navigator.geolocation.watchPosition(position => {
resolve(position);
})
else{
reject();
}
});
}
$('#hintButton').on('click', () => {
$('#hint').removeClass('show');
})
function urlParse( name, url ) {
if (!url) url = location.href;
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( url );
return results == null ? null : results[1];
}
let map = L.map('map').setView([22.99,120.218],13),
accessToken = 'pk.eyJ1IjoiYWJ6NTMzNzgiLCJhIjoiUkRleEgwVSJ9.rWFItANcHAZQ2U0ousK4cA',
mapID = 'abz53378.0klc153h',
today = new Date();
// set marker and center
//download map
L.tileLayer(`https://api.tiles.mapbox.com/v4/${mapID}/{z}/{x}/{y}.png?access_token=${accessToken}`, {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a><a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/nl/"><img alt="Creative Commons Licence" style="border-width:0" src="https://i.creativecommons.org/l/by-nc/3.0/nl/80x15.png" /></a>.'
}).addTo(map);
if(window.innerWidth <= 800) {
document.getElementsByClassName('leaflet-control-container')[0].innerHTML +=
`<button id="QA" class="circular primary ui icon button">
<i class="help icon"></i>
</button>`;
window.setTimeout(() => {
document.getElementById('QA').addEventListener('click', () => {
$("#hint").addClass('show');
}, false) ;
$("#QA").click();
}, 1000);
window.alert('請開啟定位,才能正常瀏覽此網頁!');
getGPS()
.then((position) => {
let lat = position.coords.latitude,
lng = position.coords.longitude;
map.setView([lat, lng],15)
L.marker([lat,lng]).addTo(map)
.bindPopup('所在位置')
.openPopup();
L.circle([lat, lng], 500, {
stroke: false,
fillColor: 'blue',
}).addTo(map);
})
.catch(() => {
window.alert("此裝置不支援GPS");
});
}
else{
document.getElementsByClassName('leaflet-control-container')[0].innerHTML += `<button id="GPS" class="ui primary button">我的位置</button>`;
window.setTimeout(() => {
document.getElementById('GPS').addEventListener("click",function listener() {
console.log(123);
document.getElementById('GPS').className += ' loading';
getGPS()
.then((position) => {
let lat = position.coords.latitude,
lng = position.coords.longitude;
map.setView([lat, lng],15)
L.marker([lat,lng]).addTo(map)
.bindPopup('所在位置')
.openPopup();
L.circle([lat, lng], 500, {
stroke: false,
fillColor: 'blue',
}).addTo(map);
return {lat, lng};
})
.then(({lat, lng}) => {
let className = document.getElementById('GPS').className;
document.getElementById('GPS').innerText = `${parseInt(lat*100)/100},${parseInt(lng*100)/100}`;
document.getElementById('GPS').className = className.replace('loading','');
document.getElementById('GPS').removeEventListener('click',listener,false);
})
.catch(() => {
window.alert("此裝置不支援GPS");
});
})
document.getElementsByClassName('leaflet-control-zoom-out')[0].addEventListener('click',() => {map.zoomOut()},false);
document.getElementsByClassName('leaflet-control-zoom-in')[0].addEventListener('click',() => {map.zoomIn()},false);
},1000);
}
// //set every circle
let myIcon = L.icon({
iconUrl: './hospital1.png',
//iconRetinaUrl: 'my-icon@2x.png',
iconSize: [32, 32],
//iconAnchor: [16, 16],
//popupAnchor: [-3, -76],
//shadowUrl: './hospital.png',
//shadowRetinaUrl: 'my-icon-shadow@2x.png',
//shadowSize: [23, 23],
//shadowAnchor: [22, 94]
});
getData('./data/dengue105.csv').then(data => {
let num = 0;
data.forEach(d => {
let date = new Date(d['確診日']),
times = 432000000;
if(today - date < times) {
num ++;
L.circle([d['緯度座標'], d['經度座標']], 200, {
stroke: false,
fillColor: 'red',
}).addTo(map);
}
});
return num;
})
.then(num => {
document.getElementsByClassName('leaflet-control-container')[0].innerHTML += `<div id="info">近五日內共有${num}個確診病例數</div>`;
})
.catch(err => {console.error(err);});
getData('./data/hospital_combine.tsv').then(data => {
let num = 0, markerArr = [];
markerArr = data.map(d => {
return L.marker([d['緯度'], d['經度']],{icon:myIcon}).addTo(map)
.bindPopup(`${d['名稱']}<br/>${d['電話']}<br/>${d['地址']}`);
});
map.on('zoomend', function() {
let currentZoom = map.getZoom(),
deltaZoom = currentZoom - 12;
let newIcon = L.icon({
iconUrl: './hospital1.png',
iconSize: [(deltaZoom)*6 + 32, (deltaZoom)*6 + 32]
});
markerArr.forEach(marker => marker.setIcon(newIcon));
});
return num;
})
});
|
{
"content_hash": "69547b1a64ba366ee98db883904fdcf9",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 420,
"avg_line_length": 29.546448087431695,
"alnum_prop": 0.5790641760680599,
"repo_name": "TaiwanStat/real.taiwanstat.com",
"id": "95c4907c735441c0f51aeb433671d4ea82554c8f",
"size": "5576",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dengue-vis-with-hospital/src/js/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "187"
},
{
"name": "CSS",
"bytes": "111100"
},
{
"name": "HTML",
"bytes": "521597"
},
{
"name": "Handlebars",
"bytes": "150100"
},
{
"name": "JavaScript",
"bytes": "3646635"
},
{
"name": "Pug",
"bytes": "3179"
},
{
"name": "Python",
"bytes": "133753"
},
{
"name": "SCSS",
"bytes": "3064"
},
{
"name": "Shell",
"bytes": "1318"
}
]
}
|
{% if site.owner.google.ad-client and site.owner.google.ad-slot %}
<div class="google-ads">
<!-- 320 x 50 ad -->
<script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline-block;width:320px;height:50px"
data-ad-client="{{ site.owner.google.ad-client }}"
data-ad-slot="{{ site.owner.google.ad-slot }}"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div><!-- /.google-ads -->
{% endif %}
<span>© {{ site.time | date: '%Y' }} {{ site.owner.name }}. </span> <br></br>
|
{
"content_hash": "e6add13d8eefb8f3a452794feb3a7ad3",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 93,
"avg_line_length": 38.5625,
"alnum_prop": 0.6158833063209076,
"repo_name": "rrcarter/rrcarter.github.io",
"id": "4cbeb0b2e2aab69283b6e7a033a31a3406a64c9f",
"size": "617",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/_footer.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "49867"
},
{
"name": "HTML",
"bytes": "21705"
},
{
"name": "JavaScript",
"bytes": "53186"
},
{
"name": "Ruby",
"bytes": "2234"
}
]
}
|
require "test/unit"
require "pit"
require_relative "gtranslate"
@@config = Pit.get("google_translate", :require => {
:api_key => "your Google translate API key"
})
class TestGTranslate < Test::Unit::TestCase
def setup
api_key = @@config[:api_key]
@texts = %w(私はあなたを愛しています。 今日は寝坊した やっぱりRubyは最高のプログラミング言語だ。 最高のハッカーになるためには、寝ている時間はない。)
@answers = ["I love you.", "Today I overslept", "Ruby is still the best programming language.", "To become the best hacker, no time to sleep."]
@answers2 = [["I love you."], ["Je t'aime."], ["Io ti amo."], ["私はあなたを愛しています。"]]
@gt = GTranslate.new(api_key)
end
def test_translate_one_to_one
assert_equal(@answers, @gt.translate(@texts, :from => :ja, :to => :en))
assert_equal(@answers, @gt.translate(@texts, :to => :en))
assert_equal(@answers, @gt.translate(@texts))
assert_equal(@texts[0], @gt.translate(@answers[0])[0])
end
def test_translate_one_to_many
result = @gt.translate(@texts[0], :to => [:en, :fr, :it, :ja])
assert_equal(@answers2.sort, result.values.sort)
end
def test_codes
set = {:Arabic => :ar, :'Chinese-Simplified' => :'zh-CN', :Danish => :da,
:English => :en, :French => :fr, :Japanese => :ja, :Swedish => :sv}
set.each { |country, code| assert_equal(code, GTranslate.codes[country]) }
end
def test_boomerang
text = "私はあなたを愛しています。\nさようなら。"
assert_equal(text.split("\n"), @gt.boomerang(text, :through => :ru))
assert_equal(text.split("\n"), @gt.boomerang(text, :through => [:de, :fr]))
assert_equal(text.split("\n"), @gt.boomerang(text))
end
def test_boomerang_verbose
assert_equal(@answers2, @gt.boomerang(@texts[0], :from => :ja,
:through => [:en, :fr, :it],
:verbose => true))
end
def test_detect
h = {:en => "I love you.", :it => "Io ti amo.", :de => "Ich liebe dich."}
h.each { |code, text| assert_equal(code, @gt.detect(text)[0]) }
end
end
|
{
"content_hash": "a1c25a15664ace32aa631cf596747950",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 147,
"avg_line_length": 38.509433962264154,
"alnum_prop": 0.5850073493385596,
"repo_name": "melborne/gtranslate",
"id": "e5efb4facddf8300046ce7831858f43fdce1636c",
"size": "2281",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/tc_gtranslate.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "16171"
}
]
}
|
package com.amazonaws.services.route53.model.transform;
import org.w3c.dom.Node;
import javax.annotation.Generated;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.transform.StandardErrorUnmarshaller;
import com.amazonaws.services.route53.model.NoSuchHostedZoneException;
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class NoSuchHostedZoneExceptionUnmarshaller extends StandardErrorUnmarshaller {
public NoSuchHostedZoneExceptionUnmarshaller() {
super(NoSuchHostedZoneException.class);
}
@Override
public AmazonServiceException unmarshall(Node node) throws Exception {
// Bail out if this isn't the right error code that this
// marshaller understands
String errorCode = parseErrorCode(node);
if (errorCode == null || !errorCode.equals("NoSuchHostedZone"))
return null;
NoSuchHostedZoneException e = (NoSuchHostedZoneException) super.unmarshall(node);
return e;
}
}
|
{
"content_hash": "654a06ce649eef9a97f6321b6ca07ae4",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 89,
"avg_line_length": 31.25,
"alnum_prop": 0.752,
"repo_name": "jentfoo/aws-sdk-java",
"id": "f61f12398ab5688825cfd531aad79d3571981445",
"size": "1580",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53/model/transform/NoSuchHostedZoneExceptionUnmarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "270"
},
{
"name": "FreeMarker",
"bytes": "173637"
},
{
"name": "Gherkin",
"bytes": "25063"
},
{
"name": "Java",
"bytes": "356214839"
},
{
"name": "Scilab",
"bytes": "3924"
},
{
"name": "Shell",
"bytes": "295"
}
]
}
|
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $app_strings, $current_language;
$dashletMeta['ChartsDashlet'] = array('title' => 'LBL_TITLE', // array index in language pack
'description' => 'LBL_DESCRIPTION', // array index in language pack
'category' => 'Charts',
'hidden' => true,
);
?>
|
{
"content_hash": "1969fd350126ad3efa7d8ade17a7f263",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 106,
"avg_line_length": 33.4,
"alnum_prop": 0.4471057884231537,
"repo_name": "vcatalasan/suitecrm-docker",
"id": "ca8a9c03d9a4c8e95f728361eb2c1079509f50b4",
"size": "2716",
"binary": false,
"copies": "56",
"ref": "refs/heads/master",
"path": "SuiteCRM/modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.meta.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1373"
},
{
"name": "CSS",
"bytes": "1471044"
},
{
"name": "HTML",
"bytes": "829912"
},
{
"name": "JavaScript",
"bytes": "3629011"
},
{
"name": "PHP",
"bytes": "35976721"
},
{
"name": "Perl",
"bytes": "38886"
},
{
"name": "Shell",
"bytes": "5"
},
{
"name": "Smarty",
"bytes": "2440555"
}
]
}
|
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "a6f1300de93ebb70f018270db5a0da30",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "f1d1e6e8f5fb151593d1b1ebaf270aec3fb2b57e",
"size": "181",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Liliales/Liliaceae/Gagea/Gagea confusa/ Syn. Gagea minimoides/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": []
}
|
As a New Yorker, we find changes in weather to be a part of life. To be ready
for the surprise each day, it would be helpful to know what the day will bring.
Create a React/Flux application to forecast the weather and suggest clothing or
accessories that may be required.
## Goals
- Implement an application for live updates of weather
- Display a high level week view
- Display a day view
- Describe weather by activity and temperature
- Offer a garment or accessory for the day
- Sequence by time
## Expectations
- Use node package management
- Base application on React and Flux frameworks
- Leverage [Forecast.io Api](https://developer.forecast.io/) for data
- Test with Mocha or Jest
- Share project on github and commit regularly - do not commit all changes at once
- Prepare to discuss decisions/trade-offs
- Spend no more than 2 days on the challenge
## Testing
As mentioned, write tests with either the Jest of Mocha frameworks. A testing harness should execute using the following command.
$ npm test
## Dependencies
These links are provided as a helper to find information. These are not the
only sources, so look for more if they do not give a full explanation.
[Node/Npm](https://docs.npmjs.com/)
[React](http://facebook.github.io/react/)
[Flux](https://facebook.github.io/flux/docs/overview.html)
[Forecast.io Api](https://developer.forecast.io/)
[Mocha](https://github.com/danvk/mocha-react)
[Jest](https://facebook.github.io/jest/docs/tutorial-react.html)
|
{
"content_hash": "9d61e4460d10e5f0f7ec3ad22992bdb7",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 129,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.7613636363636364,
"repo_name": "RecruitiFi/practice-react-weather",
"id": "7306a986d058e6d4b30828534073254fa287276a",
"size": "1519",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": []
}
|
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
<bill>
<committeeReports />
<version>1.0.0</version>
<subjects>
<billSubjects>
<policyArea>
<name>Crime and Law Enforcement</name>
</policyArea>
<legislativeSubjects>
<item>
<name>Abortion</name>
</item>
<item>
<name>Civil actions and liability</name>
</item>
<item>
<name>Criminal investigation, prosecution, interrogation</name>
</item>
</legislativeSubjects>
</billSubjects>
</subjects>
<laws />
<summaries>
<billSummaries>
<item>
<name>Introduced in House</name>
<lastSummaryUpdateDate>2017-03-02T22:13:20Z</lastSummaryUpdateDate>
<updateDate>2017-02-16T05:00:00Z</updateDate>
<actionDesc>Introduced in House</actionDesc>
<actionDate>2017-02-16</actionDate>
<versionCode>00</versionCode>
<text><![CDATA[<p><b>Dismemberment Abortion Ban Act of 2017</b></p> <p>This bill amends the federal criminal code to prohibit a physician from knowingly performing a dismemberment abortion. It provides a definition of the term "dismemberment abortion."</p> <p>A physician who performs a dismemberment abortion is subject to a criminal fine, up to two years in prison, or both, unless the dismemberment abortion was necessary to save the mother's life.</p> <p> A woman or a parent of a minor who undergoes a dismemberment abortion may file a civil action for damages against an individual who violates this bill. </p> <p>The legislation bars the criminal prosecution of a woman who undergoes a dismemberment abortion for conspiracy to violate the provisions of this bill, for being a principal or an accessory after the fact, or for concealing a dismemberment abortion.<br /></p>]]></text>
</item>
</billSummaries>
</summaries>
<createDate>2017-02-17T04:46:14Z</createDate>
<notes />
<sponsors>
<item>
<identifiers>
<gpoId>8046</gpoId>
<lisID>1071</lisID>
<bioguideId>S000522</bioguideId>
</identifiers>
<lastName>SMITH</lastName>
<middleName>H.</middleName>
<fullName>Rep. Smith, Christopher H. [R-NJ-4]</fullName>
<bioguideId>S000522</bioguideId>
<party>R</party>
<district>4</district>
<firstName>CHRISTOPHER</firstName>
<state>NJ</state>
<byRequestType />
</item>
</sponsors>
<updateDate>2017-06-19T21:15:29Z</updateDate>
<constitutionalAuthorityStatementText><![CDATA[<pre>From the Congressional Record Online through the Government Publishing Office [<a href='http://www.gpo.gov'>www.gpo.gov</a>]By Mr. SMITH of New Jersey:H.R. 1192.Congress has the power to enact this legislation pursuantto the following:Congress has the authority to protect unborn children underthe Supreme Court's Commerce Clause precedents and under theConstitution's grants of power to Congress under the EqualProtection, Due Process, and Enforcement Clauses of theFourteenth Amendment.[Page H1306]</pre>]]></constitutionalAuthorityStatementText>
<recordedVotes />
<billNumber>1192</billNumber>
<congress>115</congress>
<committees>
<billCommittees>
<item>
<subcommittees>
<item>
<name>Crime, Terrorism, Homeland Security, and Investigations Subcommittee</name>
<activities>
<item>
<date>2017-03-16T15:22:18Z</date>
<name>Referred to</name>
</item>
</activities>
<systemCode>hsju08</systemCode>
</item>
<item>
<name>Constitution and Civil Justice Subcommittee</name>
<activities>
<item>
<date>2017-03-16T15:21:27Z</date>
<name>Referred to</name>
</item>
</activities>
<systemCode>hsju10</systemCode>
</item>
</subcommittees>
<type>Standing</type>
<activities>
<item>
<date>2017-02-16T15:04:50Z</date>
<name>Referred to</name>
</item>
</activities>
<name>Judiciary Committee</name>
<chamber>House</chamber>
<systemCode>hsju00</systemCode>
</item>
</billCommittees>
</committees>
<amendments />
<cosponsors>
<item>
<middleName />
<lastName>Franks</lastName>
<firstName>Trent</firstName>
<fullName>Rep. Franks, Trent [R-AZ-8]</fullName>
<bioguideId>F000448</bioguideId>
<identifiers>
<gpoId>7799</gpoId>
<lisID>1707</lisID>
<bioguideId>F000448</bioguideId>
</identifiers>
<state>AZ</state>
<party>R</party>
<district>8</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Foxx</lastName>
<firstName>Virginia</firstName>
<fullName>Rep. Foxx, Virginia [R-NC-5]</fullName>
<bioguideId>F000450</bioguideId>
<identifiers>
<bioguideId>F000450</bioguideId>
<lisID>1791</lisID>
<gpoId>8028</gpoId>
</identifiers>
<state>NC</state>
<party>R</party>
<district>5</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Hartzler</lastName>
<firstName>Vicky</firstName>
<fullName>Rep. Hartzler, Vicky [R-MO-4]</fullName>
<bioguideId>H001053</bioguideId>
<identifiers>
<lisID>2032</lisID>
<gpoId>8012</gpoId>
<bioguideId>H001053</bioguideId>
</identifiers>
<state>MO</state>
<party>R</party>
<district>4</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName>B.</middleName>
<lastName>JONES</lastName>
<firstName>WALTER</firstName>
<fullName>Rep. Jones, Walter B., Jr. [R-NC-3]</fullName>
<bioguideId>J000255</bioguideId>
<identifiers>
<gpoId>8026</gpoId>
<lisID>612</lisID>
<bioguideId>J000255</bioguideId>
</identifiers>
<state>NC</state>
<party>R</party>
<district>3</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Wagner</lastName>
<firstName>Ann</firstName>
<fullName>Rep. Wagner, Ann [R-MO-2]</fullName>
<bioguideId>W000812</bioguideId>
<identifiers>
<bioguideId>W000812</bioguideId>
<lisID>2137</lisID>
<gpoId />
</identifiers>
<state>MO</state>
<party>R</party>
<district>2</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Stewart</lastName>
<firstName>Chris</firstName>
<fullName>Rep. Stewart, Chris [R-UT-2]</fullName>
<bioguideId>S001192</bioguideId>
<identifiers>
<bioguideId>S001192</bioguideId>
<lisID>2168</lisID>
<gpoId />
</identifiers>
<state>UT</state>
<party>R</party>
<district>2</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName>B.</middleName>
<lastName>ADERHOLT</lastName>
<firstName>ROBERT</firstName>
<fullName>Rep. Aderholt, Robert B. [R-AL-4]</fullName>
<bioguideId>A000055</bioguideId>
<identifiers>
<bioguideId>A000055</bioguideId>
<lisID>1460</lisID>
<gpoId>7789</gpoId>
</identifiers>
<state>AL</state>
<party>R</party>
<district>4</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName>French</middleName>
<lastName>Hill</lastName>
<firstName>J.</firstName>
<fullName>Rep. Hill, J. French [R-AR-2]</fullName>
<bioguideId>H001072</bioguideId>
<identifiers>
<gpoId />
<lisID>2223</lisID>
<bioguideId>H001072</bioguideId>
</identifiers>
<state>AR</state>
<party>R</party>
<district>2</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Farenthold</lastName>
<firstName>Blake</firstName>
<fullName>Rep. Farenthold, Blake [R-TX-27]</fullName>
<bioguideId>F000460</bioguideId>
<identifiers>
<bioguideId>F000460</bioguideId>
<lisID>2067</lisID>
<gpoId>8183</gpoId>
</identifiers>
<state>TX</state>
<party>R</party>
<district>27</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Yoder</lastName>
<firstName>Kevin</firstName>
<fullName>Rep. Yoder, Kevin [R-KS-3]</fullName>
<bioguideId>Y000063</bioguideId>
<identifiers>
<bioguideId>Y000063</bioguideId>
<lisID>2021</lisID>
<gpoId>7951</gpoId>
</identifiers>
<state>KS</state>
<party>R</party>
<district>3</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Wilson</lastName>
<firstName>Joe</firstName>
<fullName>Rep. Wilson, Joe [R-SC-2]</fullName>
<bioguideId>W000795</bioguideId>
<identifiers>
<bioguideId>W000795</bioguideId>
<lisID>1688</lisID>
<gpoId>8142</gpoId>
</identifiers>
<state>SC</state>
<party>R</party>
<district>2</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Babin</lastName>
<firstName>Brian</firstName>
<fullName>Rep. Babin, Brian [R-TX-36]</fullName>
<bioguideId>B001291</bioguideId>
<identifiers>
<gpoId />
<bioguideId>B001291</bioguideId>
<lisID>2270</lisID>
</identifiers>
<state>TX</state>
<party>R</party>
<district>36</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName>R.</middleName>
<lastName>Wenstrup</lastName>
<firstName>Brad</firstName>
<fullName>Rep. Wenstrup, Brad R. [R-OH-2]</fullName>
<bioguideId>W000815</bioguideId>
<identifiers>
<gpoId />
<bioguideId>W000815</bioguideId>
<lisID>2152</lisID>
</identifiers>
<state>OH</state>
<party>R</party>
<district>2</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Bridenstine</lastName>
<firstName>Jim</firstName>
<fullName>Rep. Bridenstine, Jim [R-OK-1]</fullName>
<bioguideId>B001283</bioguideId>
<identifiers>
<gpoId />
<bioguideId>B001283</bioguideId>
<lisID>2155</lisID>
</identifiers>
<state>OK</state>
<party>R</party>
<district>1</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Luetkemeyer</lastName>
<firstName>Blaine</firstName>
<fullName>Rep. Luetkemeyer, Blaine [R-MO-3]</fullName>
<bioguideId>L000569</bioguideId>
<identifiers>
<bioguideId>L000569</bioguideId>
<lisID>1931</lisID>
<gpoId>8017</gpoId>
</identifiers>
<state>MO</state>
<party>R</party>
<district>3</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName>M.</middleName>
<lastName>Palazzo</lastName>
<firstName>Steven</firstName>
<fullName>Rep. Palazzo, Steven M. [R-MS-4]</fullName>
<bioguideId>P000601</bioguideId>
<identifiers>
<gpoId>8022</gpoId>
<bioguideId>P000601</bioguideId>
<lisID>2035</lisID>
</identifiers>
<state>MS</state>
<party>R</party>
<district>4</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName>X.</middleName>
<lastName>Mooney</lastName>
<firstName>Alexander</firstName>
<fullName>Rep. Mooney, Alexander X. [R-WV-2]</fullName>
<bioguideId>M001195</bioguideId>
<identifiers>
<gpoId />
<lisID>2277</lisID>
<bioguideId>M001195</bioguideId>
</identifiers>
<state>WV</state>
<party>R</party>
<district>2</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName>S.</middleName>
<lastName>Yoho</lastName>
<firstName>Ted</firstName>
<fullName>Rep. Yoho, Ted S. [R-FL-3]</fullName>
<bioguideId>Y000065</bioguideId>
<identifiers>
<gpoId />
<bioguideId>Y000065</bioguideId>
<lisID>2115</lisID>
</identifiers>
<state>FL</state>
<party>R</party>
<district>3</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Banks</lastName>
<firstName>Jim</firstName>
<fullName>Rep. Banks, Jim [R-IN-3]</fullName>
<bioguideId>B001299</bioguideId>
<identifiers>
<gpoId />
<bioguideId>B001299</bioguideId>
<lisID>2326</lisID>
</identifiers>
<state>IN</state>
<party>R</party>
<district>3</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName>W.</middleName>
<lastName>Marshall</lastName>
<firstName>Roger</firstName>
<fullName>Rep. Marshall, Roger W. [R-KS-1]</fullName>
<bioguideId>M001198</bioguideId>
<identifiers>
<bioguideId>M001198</bioguideId>
<lisID>2328</lisID>
<gpoId />
</identifiers>
<state>KS</state>
<party>R</party>
<district>1</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Russell</lastName>
<firstName>Steve</firstName>
<fullName>Rep. Russell, Steve [R-OK-5]</fullName>
<bioguideId>R000604</bioguideId>
<identifiers>
<bioguideId>R000604</bioguideId>
<lisID>2265</lisID>
<gpoId />
</identifiers>
<state>OK</state>
<party>R</party>
<district>5</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Olson</lastName>
<firstName>Pete</firstName>
<fullName>Rep. Olson, Pete [R-TX-22]</fullName>
<bioguideId>O000168</bioguideId>
<identifiers>
<bioguideId>O000168</bioguideId>
<lisID>1955</lisID>
<gpoId>8178</gpoId>
</identifiers>
<state>TX</state>
<party>R</party>
<district>22</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Webster</lastName>
<firstName>Daniel</firstName>
<fullName>Rep. Webster, Daniel [R-FL-11]</fullName>
<bioguideId>W000806</bioguideId>
<identifiers>
<bioguideId>W000806</bioguideId>
<lisID>2002</lisID>
<gpoId>7880</gpoId>
</identifiers>
<state>FL</state>
<party>R</party>
<district>11</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Huizenga</lastName>
<firstName>Bill</firstName>
<fullName>Rep. Huizenga, Bill [R-MI-2]</fullName>
<bioguideId>H001058</bioguideId>
<identifiers>
<bioguideId>H001058</bioguideId>
<lisID>2028</lisID>
<gpoId>7987</gpoId>
</identifiers>
<state>MI</state>
<party>R</party>
<district>2</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Pittenger</lastName>
<firstName>Robert</firstName>
<fullName>Rep. Pittenger, Robert [R-NC-9]</fullName>
<bioguideId>P000606</bioguideId>
<identifiers>
<gpoId />
<bioguideId>P000606</bioguideId>
<lisID>2141</lisID>
</identifiers>
<state>NC</state>
<party>R</party>
<district>9</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Johnson</lastName>
<firstName>Bill</firstName>
<fullName>Rep. Johnson, Bill [R-OH-6]</fullName>
<bioguideId>J000292</bioguideId>
<identifiers>
<gpoId>8096</gpoId>
<bioguideId>J000292</bioguideId>
<lisID>2046</lisID>
</identifiers>
<state>OH</state>
<party>R</party>
<district>6</district>
<sponsorshipDate>2017-02-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>True</isOriginalCosponsor>
</item>
<item>
<middleName>B.</middleName>
<lastName>Hice</lastName>
<firstName>Jody</firstName>
<fullName>Rep. Hice, Jody B. [R-GA-10]</fullName>
<bioguideId>H001071</bioguideId>
<identifiers>
<gpoId />
<bioguideId>H001071</bioguideId>
<lisID>2237</lisID>
</identifiers>
<state>GA</state>
<party>R</party>
<district>10</district>
<sponsorshipDate>2017-03-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>False</isOriginalCosponsor>
</item>
<item>
<middleName>C.</middleName>
<lastName>Arrington</lastName>
<firstName>Jodey</firstName>
<fullName>Rep. Arrington, Jodey C. [R-TX-19]</fullName>
<bioguideId>A000375</bioguideId>
<identifiers>
<gpoId />
<bioguideId>A000375</bioguideId>
<lisID>2350</lisID>
</identifiers>
<state>TX</state>
<party>R</party>
<district>19</district>
<sponsorshipDate>2017-04-03</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>False</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Flores</lastName>
<firstName>Bill</firstName>
<fullName>Rep. Flores, Bill [R-TX-17]</fullName>
<bioguideId>F000461</bioguideId>
<identifiers>
<bioguideId>F000461</bioguideId>
<lisID>2065</lisID>
<gpoId>8173</gpoId>
</identifiers>
<state>TX</state>
<party>R</party>
<district>17</district>
<sponsorshipDate>2017-04-20</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>False</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Loudermilk</lastName>
<firstName>Barry</firstName>
<fullName>Rep. Loudermilk, Barry [R-GA-11]</fullName>
<bioguideId>L000583</bioguideId>
<identifiers>
<lisID>2238</lisID>
<gpoId />
<bioguideId>L000583</bioguideId>
</identifiers>
<state>GA</state>
<party>R</party>
<district>11</district>
<sponsorshipDate>2017-04-26</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>False</isOriginalCosponsor>
</item>
<item>
<middleName />
<lastName>Johnson</lastName>
<firstName>Mike</firstName>
<fullName>Rep. Johnson, Mike [R-LA-4]</fullName>
<bioguideId>J000299</bioguideId>
<identifiers>
<bioguideId>J000299</bioguideId>
<lisID>2330</lisID>
<gpoId />
</identifiers>
<state>LA</state>
<party>R</party>
<district>4</district>
<sponsorshipDate>2017-06-16</sponsorshipDate>
<sponsorshipWithdrawnDate />
<isOriginalCosponsor>False</isOriginalCosponsor>
</item>
</cosponsors>
<policyArea>
<name>Crime and Law Enforcement</name>
</policyArea>
<relatedBills />
<cboCostEstimates />
<title>Dismemberment Abortion Ban Act of 2017</title>
<billType>HR</billType>
<titles>
<item>
<titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
<chamberName />
<parentTitleType />
<title>Dismemberment Abortion Ban Act of 2017</title>
<chamberCode />
</item>
<item>
<titleType>Short Titles as Introduced</titleType>
<chamberName />
<parentTitleType />
<title>Dismemberment Abortion Ban Act of 2017</title>
<chamberCode />
</item>
<item>
<titleType>Official Title as Introduced</titleType>
<chamberName />
<parentTitleType />
<title>To amend title 18, United States Code, to prohibit dismemberment abortions, and for other purposes.</title>
<chamberCode />
</item>
<item>
<titleType>Display Title</titleType>
<chamberName />
<parentTitleType />
<title>Dismemberment Abortion Ban Act of 2017</title>
<chamberCode />
</item>
</titles>
<actions>
<actionTypeCounts>
<billReferrals>1</billReferrals>
<placeholderTextForH>2</placeholderTextForH>
<introducedInTheHouse>1</introducedInTheHouse>
<introducedInHouse>1</introducedInHouse>
</actionTypeCounts>
<item>
<actionDate>2017-03-16</actionDate>
<committee>
<name>Crime, Terrorism, Homeland Security, and Investigations Subcommittee</name>
<systemCode>hsju08</systemCode>
</committee>
<links />
<sourceSystem>
<code>1</code>
<name>House committee actions</name>
</sourceSystem>
<text>Referred to the Subcommittee on Crime, Terrorism, Homeland Security, and Investigations.</text>
<type>Committee</type>
</item>
<item>
<actionDate>2017-03-16</actionDate>
<committee>
<name>Constitution and Civil Justice Subcommittee</name>
<systemCode>hsju10</systemCode>
</committee>
<links />
<sourceSystem>
<code>1</code>
<name>House committee actions</name>
</sourceSystem>
<text>Referred to the Subcommittee on the Constitution and Civil Justice.</text>
<type>Committee</type>
</item>
<item>
<links />
<actionCode>H11100</actionCode>
<type>IntroReferral</type>
<committee>
<name>Judiciary Committee</name>
<systemCode>hsju00</systemCode>
</committee>
<actionDate>2017-02-16</actionDate>
<text>Referred to the House Committee on the Judiciary.</text>
<sourceSystem>
<code>2</code>
<name>House floor actions</name>
</sourceSystem>
</item>
<item>
<links />
<actionCode>Intro-H</actionCode>
<type>IntroReferral</type>
<committee />
<actionDate>2017-02-16</actionDate>
<text>Introduced in House</text>
<sourceSystem>
<code>9</code>
<name>Library of Congress</name>
</sourceSystem>
</item>
<item>
<links />
<actionCode>1000</actionCode>
<type>IntroReferral</type>
<committee />
<actionDate>2017-02-16</actionDate>
<text>Introduced in House</text>
<sourceSystem>
<code>9</code>
<name>Library of Congress</name>
</sourceSystem>
</item>
<actionByCounts>
<houseOfRepresentatives>5</houseOfRepresentatives>
</actionByCounts>
</actions>
<latestAction>
<links />
<actionDate>2017-03-16</actionDate>
<text>Referred to the Subcommittee on Crime, Terrorism, Homeland Security, and Investigations.</text>
</latestAction>
<calendarNumbers />
<introducedDate>2017-02-16</introducedDate>
<originChamber>House</originChamber>
</bill>
<dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>text/xml</dc:format>
<dc:language>EN</dc:language>
<dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
<dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
<dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
</dublinCore>
</billStatus>
|
{
"content_hash": "4984d5316f0ac078ecaa27712153ff20",
"timestamp": "",
"source": "github",
"line_count": 794,
"max_line_length": 908,
"avg_line_length": 35.70528967254408,
"alnum_prop": 0.5929805996472663,
"repo_name": "peter765/power-polls",
"id": "0c3a7e0593611bd5eec5322db3fa5e030bc363d1",
"size": "28350",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/bills/hr/hr1192/fdsys_billstatus.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "58567"
},
{
"name": "JavaScript",
"bytes": "7370"
},
{
"name": "Python",
"bytes": "22988"
}
]
}
|
import { TestComponent } from './test.component';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
describe('TestComponent', () => {
let componente: TestComponent;
let fixture: ComponentFixture<TestComponent>;
let de: DebugElement;
let elementoHtml: HTMLElement;
beforeEach(() => {
TestBed.configureTestingModule({ // TestBed crea el módulo de testing de Angular2
declarations: [TestComponent] // Componente que queremos probar
});
fixture = TestBed.createComponent(TestComponent); // Crear el componente
componente = fixture.componentInstance; // Acceder a una instancia del componente
// Buscar el <h1> del template asociado al componente mediante un selector CSS
de = fixture.debugElement.query(By.css('h1'));
elementoHtml = de.nativeElement;
});
it('debería mostrar el título original', () => {
fixture.detectChanges(); // Fuerza que Angular 'mire' si ha habido cambios en el entorno de test
expect(elementoHtml.textContent).toContain(componente.titulo);
});
it('debería poder mostrar un título diferente', () => {
componente.titulo = 'Nuevo título';
fixture.detectChanges(); // Angular detecta el cambio en la propiedad 'título'
expect(elementoHtml.textContent).toContain('Nuevo título');
});
it('la propiedad título no aparece en el dom hasta que invocamos "detectChanges" manualmente', () => {
expect(elementoHtml.textContent).toEqual('');
});
});
|
{
"content_hash": "861fae49808ae9f980462a43096dbcc7",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 104,
"avg_line_length": 38.02439024390244,
"alnum_prop": 0.710070558050032,
"repo_name": "iconojdiazch/angular2",
"id": "15b35c930ec6aee2e01b042853b648d02fa32d8c",
"size": "1568",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "angular/pruebas/ejemplos/ejemploTest0002/src/app/test.component.spec.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5848"
},
{
"name": "CSS",
"bytes": "488971"
},
{
"name": "HTML",
"bytes": "77297"
},
{
"name": "Java",
"bytes": "17862"
},
{
"name": "JavaScript",
"bytes": "3803323"
},
{
"name": "Shell",
"bytes": "6468"
},
{
"name": "TypeScript",
"bytes": "639076"
}
]
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_75) on Wed Jun 10 23:20:54 IST 2015 -->
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>Uses of Class org.apache.solr.handler.clustering.DocumentClusteringEngine (Solr 5.2.1 API)</title>
<meta name="date" content="2015-06-10">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.solr.handler.clustering.DocumentClusteringEngine (Solr 5.2.1 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/solr/handler/clustering/DocumentClusteringEngine.html" title="class in org.apache.solr.handler.clustering">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/solr/handler/clustering/class-use/DocumentClusteringEngine.html" target="_top">Frames</a></li>
<li><a href="DocumentClusteringEngine.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.solr.handler.clustering.DocumentClusteringEngine" class="title">Uses of Class<br>org.apache.solr.handler.clustering.DocumentClusteringEngine</h2>
</div>
<div class="classUseContainer">No usage of org.apache.solr.handler.clustering.DocumentClusteringEngine</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/solr/handler/clustering/DocumentClusteringEngine.html" title="class in org.apache.solr.handler.clustering">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/solr/handler/clustering/class-use/DocumentClusteringEngine.html" target="_top">Frames</a></li>
<li><a href="DocumentClusteringEngine.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<i>Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
|
{
"content_hash": "c8954f3a0f5b0074126e0727db00b705",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 181,
"avg_line_length": 38.48854961832061,
"alnum_prop": 0.6072986909956366,
"repo_name": "freakimkaefig/melodicsimilarity-solr",
"id": "10e406b61f76a5bafae19cb61b3ab0cddbceea18",
"size": "5042",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/solr-clustering/org/apache/solr/handler/clustering/class-use/DocumentClusteringEngine.html",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "AMPL",
"bytes": "291"
},
{
"name": "Batchfile",
"bytes": "53286"
},
{
"name": "CSS",
"bytes": "218719"
},
{
"name": "HTML",
"bytes": "176275"
},
{
"name": "JavaScript",
"bytes": "1131599"
},
{
"name": "Shell",
"bytes": "84180"
},
{
"name": "XSLT",
"bytes": "24929"
}
]
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
using Amazon.Lambda.TestUtilities;
using Amazon.Lambda.SQSEvents;
using BlueprintBaseName._1;
namespace BlueprintBaseName._1.Tests
{
public class FunctionTest
{
[Fact]
public async Task TestSQSEventLambdaFunction()
{
var sqsEvent = new SQSEvent
{
Records = new List<SQSEvent.SQSMessage>
{
new SQSEvent.SQSMessage
{
Body = "foobar"
}
}
};
var logger = new TestLambdaLogger();
var context = new TestLambdaContext
{
Logger = logger
};
var function = new Function();
await function.FunctionHandler(sqsEvent, context);
Assert.Contains("Processed message foobar", logger.Buffer.ToString());
}
}
}
|
{
"content_hash": "1c05554384760e01ae9473bab5de207e",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 82,
"avg_line_length": 24.261904761904763,
"alnum_prop": 0.534838076545633,
"repo_name": "thedevopsmachine/aws-lambda-dotnet",
"id": "1f499872f6cb8f739c013d4f62514f2e868641f9",
"size": "1019",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Blueprints/BlueprintDefinitions/netcore2.1/SimpleSQSFunction/template/test/BlueprintBaseName.1.Tests/FunctionTest.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "630"
},
{
"name": "C#",
"bytes": "951951"
},
{
"name": "CSS",
"bytes": "649"
},
{
"name": "F#",
"bytes": "42403"
},
{
"name": "HTML",
"bytes": "24912"
},
{
"name": "JavaScript",
"bytes": "223344"
},
{
"name": "PowerShell",
"bytes": "878640"
},
{
"name": "Shell",
"bytes": "234"
}
]
}
|
class ControlsProps {
public controls: any;
}
class ControlsJSX extends React.Component<ControlsProps, any> {
private clickPlay;
private clickStop;
private clickPause;
private clickPrev;
private clickNext;
constructor(props: ControlsProps) {
super(props);
this.clickPlay = () => props.controls.play();
this.clickStop = () => props.controls.stop();
this.clickPause = () => props.controls.pause();
this.clickPrev = () => props.controls.prev();
this.clickNext = () => props.controls.next();
}
render() {
var style = {
textAlign: "center"
};
return (<div style={style}>
<span onClick={this.clickPlay}><i className="fa fa-play"></i></span>
<span onClick={this.clickStop}><i className="fa fa-stop"></i></span>
<span onClick={this.clickPause}><i className="fa fa-pause"></i></span>
<span onClick={this.clickPrev}><i className="fa fa-fast-backward"></i></span>
<span onClick={this.clickNext}><i className="fa fa-fast-forward"></i></span>
</div>);
}
}
|
{
"content_hash": "f348e7ef241413e5b4a55ae6414e1257",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 89,
"avg_line_length": 33.5,
"alnum_prop": 0.582089552238806,
"repo_name": "jotak/mipod.x",
"id": "c8c4216cc6ad986f3e3f1591e0acb688302d2d12",
"size": "1183",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/typescript/main/controls.tsx",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "882"
},
{
"name": "Java",
"bytes": "45073"
},
{
"name": "JavaScript",
"bytes": "2953"
},
{
"name": "TypeScript",
"bytes": "6837"
}
]
}
|
\documentclass[a4paper]{article}
\title{Cross-ref Example}
\author{Hiromi ISHII}
\usepackage{amsmath,amssymb}
\begin{document}
\maketitle
\section{The first section}\label{sec:first-section}
This section is Section \ref{sec:first-section}.
\begin{lemma}\label{lem:1}
This Lemma \ref{lem:1} is not so important.
\end{lemma}
Following \ref{item:1}--\ref{item:2} are listed:
\begin{enumerate}
\item \label{item:1} This is the first item.
\item This is the second.
\item \label{item:2} The last item.
\end{enumerate}
I prefer item~\ref{item:1}.
\section{Another section}
In previous Section \ref{sec:first-section}, bra bra.
\begin{enumerate}
\item First
\item Second\label{item:4}
\item Third
\item Fourth.
\end{enumerate}
The item \ref{item:4} was referenced.
\end{document}
|
{
"content_hash": "72de8dec33d704ee7def8a50cb8722e5",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 53,
"avg_line_length": 20.307692307692307,
"alnum_prop": 0.7310606060606061,
"repo_name": "konn/latex-crossref",
"id": "10145124180e4a2a222760699a0d4344015b95c7",
"size": "792",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "data/simple.tex",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Haskell",
"bytes": "10227"
},
{
"name": "TeX",
"bytes": "1406"
}
]
}
|
package io.skysail.server.app.designer.restclient;
import java.util.List;
import io.skysail.api.links.Link;
import io.skysail.server.queryfilter.Filter;
import io.skysail.server.restlet.resources.ListServerResource;
import de.twenty11.skysail.server.core.restlet.ResourceContextId;
import javax.annotation.Generated;
@Generated("io.skysail.server.codegen.apt.processors.EntityProcessor")
public class ClientApplicationsResource extends ListServerResource<ClientApplication> {
private RestclientApplication app;
private ClientApplicationRepo repository;
public ClientApplicationsResource() {
super(ClientApplicationResource.class);
addToContext(ResourceContextId.LINK_TITLE, "List of ClientApplications");
}
protected void doInit() {
super.doInit();
app = (RestclientApplication)getApplication();
repository = (ClientApplicationRepo) app.getRepository(ClientApplication.class);
}
@Override
public List<ClientApplication> getEntity() {
return repository.find(new Filter());
}
@Override
public List<Link> getLinks() {
return super.getLinks();
}
}
|
{
"content_hash": "d9db3d4c6d678733232297dfed0b63e7",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 88,
"avg_line_length": 31.243243243243242,
"alnum_prop": 0.7465397923875432,
"repo_name": "evandor/skysail-framework",
"id": "f5a577a6d32db8c0d18bcc0099a216591ec6892c",
"size": "1156",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "skysail.server.designer.restclient/src-gen/io/skysail/server/app/designer/restclient/ClientApplicationsResource.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "326"
},
{
"name": "CSS",
"bytes": "2164334"
},
{
"name": "HTML",
"bytes": "442258"
},
{
"name": "Java",
"bytes": "2516097"
},
{
"name": "JavaScript",
"bytes": "8354803"
},
{
"name": "PHP",
"bytes": "3823"
},
{
"name": "Ruby",
"bytes": "1452682"
},
{
"name": "Shell",
"bytes": "570774"
},
{
"name": "Smalltalk",
"bytes": "25"
}
]
}
|
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
|
{
"content_hash": "2941a3ec0354bbc17ce2065f14856272",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 48,
"avg_line_length": 34.142857142857146,
"alnum_prop": 0.6778242677824268,
"repo_name": "jackjennings/mechanic-server",
"id": "0265f5788f1d401cf0c2713ef439614cc8424771",
"size": "239",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/puma.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "18524"
}
]
}
|
import getTypeFromName from '../../lib/helpers/getTypeFromName';
it('accept empty configs', () => {
expect(getTypeFromName()).toBe(null);
expect(getTypeFromName({})).toBe(null);
expect(getTypeFromName({ types: [] })).toBe(null);
});
it('cannot find name', () => {
const config = { types: [{ type: 'find' }] };
expect(getTypeFromName(config, 'findme')).toBe(null);
});
it('find name', () => {
const config = { types: [{ type: 'findme' }] };
expect(getTypeFromName(config, 'findme')).toEqual({ type: 'findme' });
});
|
{
"content_hash": "b7c15562573899e1a3aeb47a2f9517bc",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 72,
"avg_line_length": 28.105263157894736,
"alnum_prop": 0.6161048689138576,
"repo_name": "JPeer264/node-semantic-git-commit-cli",
"id": "f53abaf31604426c567dd399619b2dadf1417e02",
"size": "534",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "__tests__/helper/getTypeFromName.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "40582"
},
{
"name": "Shell",
"bytes": "131"
},
{
"name": "TypeScript",
"bytes": "16598"
}
]
}
|
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#607D8B</color>
<color name="colorPrimaryDark">#455A64</color>
<color name="colorAccent">#009688</color>
<color name="colorBlack">#000000</color>
<color name="colorLightGrey">#E0E0E0</color>
</resources>
|
{
"content_hash": "9c1e1d54e1ce2d399c69d4a078d5fa68",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 50,
"avg_line_length": 37.75,
"alnum_prop": 0.6788079470198676,
"repo_name": "deniskovalchuk/computer-science-news",
"id": "41bda566a2391adc00eb365b591ebe1067f183ff",
"size": "302",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/values/colors.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "41934"
}
]
}
|
package com.swfarm.biz.chain.dao.impl;
import com.swfarm.biz.chain.bo.CustomerOrderItem;
import com.swfarm.biz.chain.dao.CustomerOrderItemDao;
import com.swfarm.pub.framework.dao.GenericDaoHibernateImpl;
public class CustomerOrderItemDaoImpl extends
GenericDaoHibernateImpl<CustomerOrderItem, String> implements
CustomerOrderItemDao {
public CustomerOrderItemDaoImpl(Class<CustomerOrderItem> type) {
super(type);
}
}
|
{
"content_hash": "c30aa9974cd5c96875d121981f5c4653",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 65,
"avg_line_length": 29.6,
"alnum_prop": 0.7995495495495496,
"repo_name": "zhangqiang110/my4j",
"id": "ae0d9e19fbc4b41fae0699e66a6cade19c18eb91",
"size": "444",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pms/src/main/java/com/swfarm/biz/chain/dao/impl/CustomerOrderItemDaoImpl.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "41428"
}
]
}
|
using System;
namespace SoundCloud.NET
{
/// <summary>
/// Defines the activity type on which the dashboard will base.
/// </summary>
public enum ActivityType
{
Tracks,
Exclusive,
Affiliated
}
}
|
{
"content_hash": "8bf41fcd594c6ce81c596a20d159402f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 67,
"avg_line_length": 13.833333333333334,
"alnum_prop": 0.5742971887550201,
"repo_name": "hamstercat/Emby.Channels",
"id": "9b5a4d5e511219ce6ddae6150c7e02eb682895ac",
"size": "1005",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "MediaBrowser.Plugins.SoundCloud/API/ActivityType.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "5021171"
},
{
"name": "HTML",
"bytes": "46991"
}
]
}
|
<?php
namespace Example\InjectServicesMappedTo;
use Symfony\Component\DependencyInjection\Annotation\Service;
use Symfony\Component\DependencyInjection\Annotation\Tag\MapTo;
/**
* @Service(
* tags={@MapTo("commandHandler", key=HandlerB::COMMAND_NAME, priority=9)}
* )
*/
class HandlerB implements CommandHandlerInterface
{
const COMMAND_NAME = 'commandB';
public function handle()
{
return 'B';
}
}
|
{
"content_hash": "7499a3c9c09f1a430c4ca4c7e405d37c",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 78,
"avg_line_length": 20.714285714285715,
"alnum_prop": 0.7126436781609196,
"repo_name": "christianblos/symfony-di-annotation",
"id": "eb5d4d9c25b2745097a95732cac7766beafde9b7",
"size": "435",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/inject_services_mapped_to/classes/HandlerB.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "29652"
}
]
}
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @implements {SDK.TargetManager.Observer}
* @unrestricted
*/
Sources.ThreadsSidebarPane = class extends UI.VBox {
constructor() {
super();
/** @type {?Sources.UIList.Item} */
this._selectedListItem = null;
/** @type {!Map<!SDK.Target, !Sources.UIList.Item>} */
this._targetToListItem = new Map();
this.threadList = new Sources.UIList();
this.threadList.show(this.element);
this._availableNodeTargetsElement = this.element.createChild('div', 'hidden available-node-targets');
SDK.targetManager.addModelListener(
SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this._onDebuggerStateChanged, this);
SDK.targetManager.addModelListener(
SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, this._onDebuggerStateChanged, this);
SDK.targetManager.addModelListener(
SDK.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextChanged, this._onExecutionContextChanged, this);
UI.context.addFlavorChangeListener(SDK.Target, this._targetChanged, this);
SDK.targetManager.addEventListener(SDK.TargetManager.Events.NameChanged, this._targetNameChanged, this);
SDK.targetManager.addModelListener(
SDK.SubTargetsManager, SDK.SubTargetsManager.Events.AvailableNodeTargetsChanged,
this._availableNodeTargetsChanged, this);
SDK.targetManager.observeTargets(this, SDK.Target.Capability.JS);
this._availableNodeTargetsChanged();
}
/**
* @return {boolean}
*/
static shouldBeShown() {
var minJSTargets = Runtime.queryParam('nodeFrontend') ? 1 : 2;
if (SDK.targetManager.targets(SDK.Target.Capability.JS).length >= minJSTargets)
return true;
if (Sources.ThreadsSidebarPane.availableNodeTargetsCount())
return true;
return false;
}
/**
* @return {number}
*/
static availableNodeTargetsCount() {
var count = 0;
for (var target of SDK.targetManager.targets(SDK.Target.Capability.Target))
count += SDK.SubTargetsManager.fromTarget(target).availableNodeTargetsCount();
return count;
}
_availableNodeTargetsChanged() {
var count = Sources.ThreadsSidebarPane.availableNodeTargetsCount();
if (!count) {
this._availableNodeTargetsElement.classList.add('hidden');
return;
}
this._availableNodeTargetsElement.removeChildren();
this._availableNodeTargetsElement.createTextChild(
count === 1 ? Common.UIString('Node instance available.') :
Common.UIString('%d Node instances available.', count));
var link = this._availableNodeTargetsElement.createChild('span', 'link');
link.textContent = Common.UIString('Connect');
link.addEventListener('click', () => {
InspectorFrontendHost.openNodeFrontend();
}, false);
this._availableNodeTargetsElement.classList.remove('hidden');
}
/**
* @override
* @param {!SDK.Target} target
*/
targetAdded(target) {
var listItem = new Sources.UIList.Item('', '', false);
listItem.element.addEventListener('click', this._onListItemClick.bind(this, listItem, target), false);
this._targetToListItem.set(target, listItem);
this.threadList.addItem(listItem);
listItem.setTitle(this._titleForTarget(target));
this._updateDebuggerState(target);
var currentTarget = UI.context.flavor(SDK.Target);
if (currentTarget === target)
this._selectListItem(listItem);
}
/**
* @override
* @param {!SDK.Target} target
*/
targetRemoved(target) {
var item = this._targetToListItem.get(target);
if (!item)
return;
this.threadList.removeItem(item);
this._targetToListItem.delete(target);
}
/**
* @param {!Common.Event} event
*/
_targetNameChanged(event) {
var target = /** @type {!SDK.Target} */ (event.data);
var listItem = this._targetToListItem.get(target);
if (listItem)
listItem.setTitle(this._titleForTarget(target));
}
/**
* @param {!Common.Event} event
*/
_targetChanged(event) {
var listItem = this._targetToListItem.get(/** @type {!SDK.Target} */ (event.data));
if (listItem)
this._selectListItem(listItem);
}
/**
* @param {!SDK.Target} target
* @return {string}
*/
_titleForTarget(target) {
var executionContext = target.runtimeModel.defaultExecutionContext();
return executionContext && executionContext.label() ? executionContext.label() : target.name();
}
/**
* @param {!Common.Event} event
*/
_onDebuggerStateChanged(event) {
var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.data);
this._updateDebuggerState(debuggerModel.target());
}
/**
* @param {!Common.Event} event
*/
_onExecutionContextChanged(event) {
var executionContext = /** @type {!SDK.ExecutionContext} */ (event.data);
var target = executionContext.target();
var listItem = this._targetToListItem.get(target);
if (listItem)
listItem.setTitle(this._titleForTarget(target));
}
/**
* @param {!SDK.Target} target
*/
_updateDebuggerState(target) {
var listItem = this._targetToListItem.get(target);
var debuggerModel = SDK.DebuggerModel.fromTarget(target);
console.assert(debuggerModel);
listItem.setSubtitle(Common.UIString(debuggerModel.isPaused() ? 'paused' : ''));
}
/**
* @param {!Sources.UIList.Item} listItem
*/
_selectListItem(listItem) {
if (listItem === this._selectedListItem)
return;
if (this._selectedListItem)
this._selectedListItem.setSelected(false);
this._selectedListItem = listItem;
listItem.setSelected(true);
}
/**
* @param {!Sources.UIList.Item} listItem
* @param {!SDK.Target} target
*/
_onListItemClick(listItem, target) {
UI.context.setFlavor(SDK.Target, target);
listItem.element.scrollIntoViewIfNeeded();
}
};
Sources.ThreadsSidebarPane._targetSymbol = Symbol('_targetSymbol');
|
{
"content_hash": "eeedfcf80b5f3b2b0d10420774e9693c",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 114,
"avg_line_length": 32.22872340425532,
"alnum_prop": 0.6855916817956759,
"repo_name": "google-ar/WebARonARCore",
"id": "a5258f39c5d96c98bab27b4703ec3a9682721ec8",
"size": "6059",
"binary": false,
"copies": "1",
"ref": "refs/heads/webarcore_57.0.2987.5",
"path": "third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js",
"mode": "33188",
"license": "apache-2.0",
"language": []
}
|
Volume Control allows you to control the volume of your Mac with Alfred workflow.
#Usage
- vol: show current volume
- vol $num: set volume to a specified number.
- vol mute/unmute: mute or unmute.
- vol up [$num]: increase the volume by a specified number. The default value is 10% if the $num parameter is not present. And you can hold cmd to double the increasement.
- vol down [$num]: similar to above.
- vol max: set volume to 100%.
- vol low: set volume to 25%.
- vol mid: set volume to 50%.
- vol high: set volume to 75%.
> All the above commands are searchable.
> And you can just type first several letters of a command, e.g. `vol u 20` means `vol up 20`, `vol mu` means `vol mute`.
#Installation
Download [Volume Control.alfredworkflow](https://github.com/raulchen/alfred-volume-control/raw/master/Volume%20Control.alfredworkflow) and double-click it.
|
{
"content_hash": "b98e88600d3772aba68aa3e0518405ef",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 173,
"avg_line_length": 44.35,
"alnum_prop": 0.7204058624577226,
"repo_name": "raulchen/alfred-volume-control",
"id": "46928bd7675098996fb225dca1fe477fbd3fd993",
"size": "895",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "7900"
}
]
}
|
package networkerror
// UnverifiedServerError replaces x509.UnknownAuthorityError when the server
// has SSL but the client is unable to verify it's certificate
type UnverifiedServerError struct {
URL string
}
func (UnverifiedServerError) Error() string {
return "x509: certificate signed by unknown authority"
}
|
{
"content_hash": "7cfc4f34bdb90aa741531a4a51ee8a9b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 76,
"avg_line_length": 28.818181818181817,
"alnum_prop": 0.804416403785489,
"repo_name": "orange-cloudfoundry/terraform-provider-cloudfoundry",
"id": "59a877302a8f494887c2751cc9b1057099c0b6d5",
"size": "317",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/code.cloudfoundry.org/cfnetworking-cli-api/cfnetworking/networkerror/unverified_server_error.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "261939"
},
{
"name": "Shell",
"bytes": "3779"
}
]
}
|
package org.kie.server.controller.rest;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Variant;
import org.kie.server.common.rest.RestEasy960Util;
import org.kie.server.api.KieServerConstants;
import org.kie.server.api.marshalling.Marshaller;
import org.kie.server.api.marshalling.MarshallerFactory;
import org.kie.server.api.marshalling.MarshallingFormat;
import org.kie.server.api.model.Wrapped;
import org.kie.server.controller.api.model.KieServerInstance;
import org.kie.server.controller.api.model.KieServerInstanceInfo;
import org.kie.server.controller.api.model.KieServerInstanceList;
import org.kie.server.controller.api.model.KieServerSetup;
import org.kie.server.controller.api.model.KieServerStatus;
import org.kie.server.controller.api.model.runtime.Container;
import org.kie.server.controller.api.model.runtime.ContainerKey;
import org.kie.server.controller.api.model.runtime.ServerInstance;
import org.kie.server.controller.api.model.runtime.ServerInstanceKey;
import org.kie.server.controller.api.model.spec.ContainerSpec;
import org.kie.server.controller.api.model.spec.ContainerSpecKey;
import org.kie.server.controller.api.model.spec.ContainerSpecList;
import org.kie.server.controller.api.model.spec.ProcessConfig;
import org.kie.server.controller.api.model.spec.RuleConfig;
import org.kie.server.controller.api.model.spec.ServerConfig;
import org.kie.server.controller.api.model.spec.ServerTemplate;
import org.kie.server.controller.api.model.spec.ServerTemplateKey;
import org.kie.server.controller.api.model.spec.ServerTemplateList;
public class ControllerUtils {
private static Marshaller jsonMarshaller = MarshallerFactory.getMarshaller(getMinimalModelClasses(), MarshallingFormat.JSON, ControllerUtils.class.getClassLoader());
private static Marshaller jaxbMarshaller = MarshallerFactory.getMarshaller(getModelClasses(), MarshallingFormat.JAXB, ControllerUtils.class.getClassLoader());
public static Set<Class<?>> getModelClasses() {
Set<Class<?>> modelClasses = new HashSet<Class<?>>();
modelClasses.add(KieServerInstance.class);
modelClasses.add(KieServerInstanceList.class);
modelClasses.add(KieServerInstanceInfo.class);
modelClasses.add(KieServerSetup.class);
modelClasses.add(KieServerStatus.class);
modelClasses.add(ServerInstance.class);
modelClasses.add(ServerInstanceKey.class);
modelClasses.add(ServerTemplate.class);
modelClasses.add(ServerTemplateKey.class);
modelClasses.add(ServerConfig.class);
modelClasses.add(RuleConfig.class);
modelClasses.add(ProcessConfig.class);
modelClasses.add(ContainerSpec.class);
modelClasses.add(ContainerSpecKey.class);
modelClasses.add(Container.class);
modelClasses.add(ContainerKey.class);
modelClasses.add(ServerTemplateList.class);
modelClasses.add(ContainerSpecList.class);
return modelClasses;
}
public static Set<Class<?>> getMinimalModelClasses() {
Set<Class<?>> modelClasses = new HashSet<Class<?>>();
modelClasses.add(RuleConfig.class);
modelClasses.add(ProcessConfig.class);
return modelClasses;
}
public static Response createCorrectVariant(String responseObj, HttpHeaders headers, javax.ws.rs.core.Response.Status status) {
Response.ResponseBuilder responseBuilder = null;
Variant v = getVariant(headers);
if( status != null ) {
responseBuilder = Response.status(status).entity(responseObj).variant(v);
} else {
responseBuilder = Response.ok(responseObj, v);
}
return responseBuilder.build();
}
public static Variant getVariant(HttpHeaders headers) {
Variant v = RestEasy960Util.getVariant(headers);
if( v == null ) {
v = Variant.mediaTypes(getMediaType(headers)).add().build().get(0);;
}
return v;
}
public static String getContentType(HttpHeaders headers) {
// default to application/xml
String contentType = MediaType.APPLICATION_XML_TYPE.toString();
// check variant that is based on accept header important in case of GET as then Content-Type might not be given
Variant v = RestEasy960Util.getVariant(headers);
if (v != null) {
// set the default to selected variant
contentType = v.getMediaType().toString();
}
// now look for actual Content-Type header
List<String> contentTypeHeader = headers.getRequestHeader(HttpHeaders.CONTENT_TYPE);
if (contentTypeHeader != null && !contentTypeHeader.isEmpty() && contentTypeHeader.get(0) != null) {
contentType = contentTypeHeader.get(0);
}
List<String> kieContentTypeHeader = headers.getRequestHeader(KieServerConstants.KIE_CONTENT_TYPE_HEADER);
if (kieContentTypeHeader != null && !kieContentTypeHeader.isEmpty()) {
contentType = kieContentTypeHeader.get(0);
}
return contentType;
}
public static MediaType getMediaType(HttpHeaders httpHeaders) {
String contentType = getContentType(httpHeaders);
try {
return MediaType.valueOf(contentType);
} catch (IllegalArgumentException e) {
MarshallingFormat format = MarshallingFormat.fromType(contentType);
switch (format) {
case JAXB:
return MediaType.APPLICATION_XML_TYPE;
case XSTREAM:
return MediaType.APPLICATION_XML_TYPE;
case JSON:
return MediaType.APPLICATION_JSON_TYPE;
default:
return MediaType.APPLICATION_XML_TYPE;
}
}
}
public static MarshallingFormat getFormat(String descriptor) {
MarshallingFormat format = MarshallingFormat.fromType(descriptor);
if (format == null) {
format = MarshallingFormat.valueOf(descriptor);
}
return format;
}
public static <T> T unmarshal(String data, String marshallingFormat, Class<T> unmarshalType) {
if (data == null || data.isEmpty()) {
return null;
}
MarshallingFormat format = getFormat(marshallingFormat);
Marshaller marshaller = null;
switch (format) {
case JAXB: {
marshaller = jaxbMarshaller;
break;
}
case JSON: {
marshaller = jsonMarshaller;
break;
}
default: {
marshaller = jsonMarshaller;
break;
}
}
Object instance = marshaller.unmarshall(data, unmarshalType);
if (instance instanceof Wrapped) {
return (T) ((Wrapped) instance).unwrap();
}
return (T) instance;
}
public static String marshal(String marshallingFormat, Object entity) {
MarshallingFormat format = getFormat(marshallingFormat);
if (format == null) {
throw new IllegalArgumentException("Unknown marshalling format " + marshallingFormat);
}
Marshaller marshaller = null;
switch (format) {
case JAXB: {
marshaller = jaxbMarshaller;
break;
}
case JSON: {
marshaller = jsonMarshaller;
break;
}
default: {
marshaller = jsonMarshaller;
break;
}
}
return marshaller.marshall(entity);
}
public static String getUser() {
return System.getProperty(KieServerConstants.CFG_KIE_USER, "kieserver");
}
public static String getPassword() {
return System.getProperty(KieServerConstants.CFG_KIE_PASSWORD, "kieserver1!");
}
}
|
{
"content_hash": "4dc55fdaece9f20853426f977cad612f",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 169,
"avg_line_length": 36.77625570776256,
"alnum_prop": 0.665507822200149,
"repo_name": "reynoldsm88/droolsjbpm-integration",
"id": "6c563f2e1f6111ebf82dc9f4501e97262c123861",
"size": "8630",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2569"
},
{
"name": "CSS",
"bytes": "7748"
},
{
"name": "FreeMarker",
"bytes": "20776"
},
{
"name": "HTML",
"bytes": "2654"
},
{
"name": "Java",
"bytes": "6923430"
},
{
"name": "JavaScript",
"bytes": "32051"
},
{
"name": "Shell",
"bytes": "3525"
},
{
"name": "Visual Basic",
"bytes": "4658"
},
{
"name": "XSLT",
"bytes": "1094"
}
]
}
|
.PHONY: help install clean delpyc assets scss syncf5
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo
@echo " install -- to proceed to a new install of this project. Use clean command before if you want to reset a current install"
@echo " clean -- to clean your local repository from all stuff created by buildout and instance usage"
@echo " delpyc -- to remove all *.pyc files, this is recursive from the current directory"
@echo
@echo " assets -- to minify all assets and collect static files"
@echo " scss -- to compile all SCSS stuffs with compass"
@echo " syncf5 -- to synchronize needed Javascript files from foundation5 sources dir to the project static files"
@echo
delpyc:
find . -name "*\.pyc"|xargs rm -f
clean: delpyc
rm -Rf bin include eggs lib parts django-apps-src develop-eggs .installed.cfg compass/.sass-cache project/webapp_statics/.webassets-cache
syncf5:
rm -Rf project/webapp_statics/js/foundation5
cp -r foundation5/bower_components/foundation/js project/webapp_statics/js/foundation5
# Cleaning vendor libs
rm -Rf project/webapp_statics/js/foundation5/vendor
mkdir -p project/webapp_statics/js/foundation5/vendor
# Getting the real sources for updated vendor libs
cp foundation5/bower_components/fastclick/lib/fastclick.js project/webapp_statics/js/foundation5/vendor/
cp foundation5/bower_components/jquery/dist/jquery.js project/webapp_statics/js/foundation5/vendor/
cp foundation5/bower_components/jquery-placeholder/jquery.placeholder.js project/webapp_statics/js/foundation5/vendor/
cp foundation5/bower_components/jquery.cookie/jquery.cookie.js project/webapp_statics/js/foundation5/vendor/
cp foundation5/bower_components/lodash/dist/lodash.js project/webapp_statics/js/foundation5/vendor/
cp foundation5/bower_components/modernizr/modernizr.js project/webapp_statics/js/foundation5/vendor/
assets:
django-instance collectstatic --pythonpath=project/ --noinput
django-instance assets build --pythonpath=project/
django-instance collectstatic --pythonpath=project/ --noinput
scss:
compass compile -c compass/config.rb compass/
install:
virtualenv --no-site-packages --setuptools .
bin/pip install 'setuptools==7.0'
bin/pip install 'pip==1.5.6'
mkdir -p eggs
bin/python bootstrap.py --setuptools-version=7.0 --config-file=buildout.cfg --version=2.2.5
bin/buildout -v
bin/django-instance syncdb --all
bin/django-instance migrate --fake
|
{
"content_hash": "92ccfedf4718e8e9cb41658e13f5e595",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 138,
"avg_line_length": 47.84313725490196,
"alnum_prop": 0.7799180327868852,
"repo_name": "emencia/emencia_paste_djangocms_2",
"id": "5c37a119d426b382621a63cec9df30cb8e79d9e6",
"size": "2441",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "emencia_paste_djangocms_2/django_buildout/Makefile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1365166"
},
{
"name": "JavaScript",
"bytes": "327281"
},
{
"name": "Makefile",
"bytes": "2441"
},
{
"name": "Python",
"bytes": "102833"
},
{
"name": "Ruby",
"bytes": "2897"
}
]
}
|
function varargout = mibImageMorphOpsGUI(varargin)
% function varargout = mibImageMorphOpsGUI(varargin)
% mibImageMorphOpsGUI function is responsible for morphological operations done with images.
%
% mibImageMorphOpsGUI contains MATLAB code for mibImageMorphOpsGUI.fig
% Copyright (C) 30.10.2014 Ilya Belevich, University of Helsinki (ilya.belevich @ helsinki.fi)
% part of Microscopy Image Browser, http:\\mib.helsinki.fi
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
%
% Updates
% 26.02.2016, IB, updated for 4D datasets
% Edit the above text to modify the response to help mibImageMorphOpsGUI
% Last Modified by GUIDE v2.5 06-Feb-2017 17:38:19
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @mibImageMorphOpsGUI_OpeningFcn, ...
'gui_OutputFcn', @mibImageMorphOpsGUI_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
end
% --- Executes just before mibImageMorphOpsGUI is made visible.
function mibImageMorphOpsGUI_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to mibImageMorphOpsGUI (see VARARGIN)
% obtain controller
handles.winController = varargin{1};
% define radio buttons callbacks
%set(handles.connectivityPanel, 'SelectionChangeFcn', @connectivityPanel_Callback);
%set(handles.actionPanel, 'SelectionChangeFcn', @actionPanel_Callback);
handles.connectivityPanel.SelectionChangeFcn = @connectivityPanel_Callback;
handles.actionPanel.SelectionChangeFcn = @actionPanel_Callback;
% Choose default command line output for mibChildGUI
handles.output = hObject;
% Determine the position of the dialog - on a side of the main figure
% if available, else, centered on the main figure
FigPos=get(0,'DefaultFigurePosition');
OldUnits = get(hObject, 'Units');
set(hObject, 'Units', 'pixels');
OldPos = get(hObject,'Position');
FigWidth = OldPos(3);
FigHeight = OldPos(4);
if isempty(gcbf)
ScreenUnits=get(0,'Units');
set(0,'Units','pixels');
ScreenSize=get(0,'ScreenSize');
set(0,'Units',ScreenUnits);
FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
else
GCBFOldUnits = get(gcbf,'Units');
set(gcbf,'Units','pixels');
GCBFPos = get(gcbf,'Position');
set(gcbf,'Units',GCBFOldUnits);
screenSize = get(0,'ScreenSize');
if GCBFPos(1)-FigWidth > 0 % put figure on the left side of the main figure
FigPos(1:2) = [GCBFPos(1)-FigWidth-10 GCBFPos(2)+GCBFPos(4)-FigHeight+59];
elseif GCBFPos(1) + GCBFPos(3) + FigWidth < screenSize(3) % put figure on the right side of the main figure
FigPos(1:2) = [GCBFPos(1)+GCBFPos(3)+10 GCBFPos(2)+GCBFPos(4)-FigHeight+59];
else
FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
(GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
end
end
FigPos(3:4)=[FigWidth FigHeight];
set(hObject, 'Position', FigPos);
set(hObject, 'Units', OldUnits);
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes mibImageMorphOpsGUI wait for user response (see UIRESUME)
% uiwait(handles.mibImageMorphOpsGUI);
end
% --- Outputs from this function are returned to the command line.
function varargout = mibImageMorphOpsGUI_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
end
% --- Executes when user attempts to close mibImageMorphOpsGUI.
function mibImageMorphOpsGUI_CloseRequestFcn(hObject, eventdata, handles)
% hObject handle to mibImageMorphOpsGUI (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles.winController.closeWindow();
end
% --- Executes on button press in cancelBtn.
function cancelBtn_Callback(hObject, eventdata, handles)
handles.winController.closeWindow();
end
% --- Executes on selection change in morphOpsPopup.
function morphOpsPopup_Callback(hObject, eventdata, handles)
handles.winController.morphOpsPopup_Callback();
end
function modePanel_Callback(hObject, eventdata, handles)
handles.winController.modePanel_Callback();
end
function connectivityPanel_Callback(hObject, eventdata)
handles = guidata(hObject);
handles.winController.connectivityPanel_Callback(eventdata);
end
function actionPanel_Callback(hObject, eventdata)
handles = guidata(hObject);
handles.winController.actionPanel_Callback(eventdata);
end
function smoothWidth_Callback(hObject, eventdata, handles)
val = str2double(handles.smoothWidth.String);
handles.smoothSigma.String = num2str(val/5);
% use auto preview
if handles.autoPreviewCheck.Value == 1
handles.winController.previewBtn_Callback();
end
end
% --- Executes on selection change in colorChannelPopoup.
function colorChannelPopoup_Callback(hObject, eventdata, handles)
% use auto preview
if handles.autoPreviewCheck.Value == 1
handles.winController.previewBtn_Callback();
end
end
function strelShapePopup_Callback(hObject, eventdata, handles)
% use auto preview
if handles.autoPreviewCheck.Value == 1
handles.winController.previewBtn_Callback();
end
end
function strelSizeEdit_Callback(hObject, eventdata, handles)
% use auto preview
if handles.autoPreviewCheck.Value == 1
handles.winController.previewBtn_Callback();
end
end
function multiplyEdit_Callback(hObject, eventdata, handles)
% use auto preview
if handles.autoPreviewCheck.Value == 1
handles.winController.previewBtn_Callback();
end
end
function smoothSigma_Callback(hObject, eventdata, handles)
% use auto preview
if handles.autoPreviewCheck.Value == 1
handles.winController.previewBtn_Callback();
end
end
function autoPreviewCheck_Callback(hObject, eventdata, handles)
% use auto preview
if handles.autoPreviewCheck.Value == 1
handles.winController.previewBtn_Callback();
end
end
% --- Executes on button press in previewBtn.
function previewBtn_Callback(hObject, eventdata, handles)
handles.winController.previewBtn_Callback();
end
function continueBtn_Callback(hObject, eventdata, handles)
handles.winController.continueBtn_Callback();
end
|
{
"content_hash": "eeebfe9915afe9cf6ba2ca20876e6288",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 111,
"avg_line_length": 34.48309178743961,
"alnum_prop": 0.7490893807789297,
"repo_name": "yejiyang/open_matlab_toolbox",
"id": "b2d52990629c25fdcbdc0dd5d6cc2ba10d182a1b",
"size": "7138",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MIB2_Matlab/GuiTools/mibImageMorphOpsGUI.m",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "HTML",
"bytes": "198557"
},
{
"name": "Limbo",
"bytes": "6962"
},
{
"name": "M",
"bytes": "63"
},
{
"name": "Matlab",
"bytes": "1568452"
},
{
"name": "TeX",
"bytes": "10983"
}
]
}
|
package com.fionapet.business.facade;
import com.fionapet.business.entity.AppConfig;
import io.swagger.annotations.ApiParam;
import org.dubbo.x.facade.RestResult;
import org.dubbo.x.service.CURDService;
import org.dubbo.x.facade.RestServiceBase;
import com.fionapet.business.service.AppConfigService;
import org.dubbo.x.util.ConstantVariable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import javax.ws.rs.HeaderParam;
/**
* 应用配置
* Created by tom on 2016-07-18 11:56:10.
*/
public class AppConfigRestServiceImpl extends RestServiceBase<AppConfig> implements AppConfigRestService {
private static final Logger LOGGER = LoggerFactory.getLogger(AppConfigRestServiceImpl.class);
@Autowired
private AppConfigService appConfigService;
public AppConfigService getAppConfigService() {
return appConfigService;
}
public void setAppConfigService(AppConfigService appConfigService) {
this.appConfigService = appConfigService;
}
@Override
public CURDService<AppConfig> getService() {
return appConfigService;
}
@Override
public RestResult<String> genNumberByName(@HeaderParam(ConstantVariable.HEADER_AUTHORIZATION_KEY) String token, @ApiParam("name") String name) {
return RestResult.OK(appConfigService.genNumberByName(name));
}
}
|
{
"content_hash": "152f8f95b28f9078454457f996299aca",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 148,
"avg_line_length": 31.613636363636363,
"alnum_prop": 0.7764198418404026,
"repo_name": "fiona-pet/business",
"id": "57ce9f86318491b547963491575ee3973dfaf44e",
"size": "1399",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fionapet-business-rest-provider/src/main/java/com/fionapet/business/facade/AppConfigRestServiceImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "93075"
},
{
"name": "HTML",
"bytes": "5192"
},
{
"name": "Java",
"bytes": "1192613"
},
{
"name": "JavaScript",
"bytes": "2295478"
},
{
"name": "PLSQL",
"bytes": "311"
},
{
"name": "TSQL",
"bytes": "1025604"
}
]
}
|
<?php
namespace lithium\data\collection;
class DocumentSet extends \lithium\data\Collection {
/**
* PHP magic method used when setting properties on the `Document` instance, i.e.
* `$document->title = 'Lorem Ipsum'`. If `$value` is a complex data type (i.e. associative
* array), it is wrapped in a sub-`Document` object before being appended.
*
* @param $name The name of the field/property to write to, i.e. `title` in the above example.
* @param $value The value to write, i.e. `'Lorem Ipsum'`.
* @return void
*/
public function __set($name, $value = null) {
if (is_array($name) && !$value) {
foreach ($name as $key => $value) {
$this->__set($key, $value);
}
return;
}
if (is_string($name) && strpos($name, '.')) {
$current = $this;
$path = explode('.', $name);
$length = count($path) - 1;
for ($i = 0; $i < $length; $i++) {
$key = $path[$i];
$next = $current->__get($key);
if (!is_object($next) && ($model = $this->_model)) {
$next = $model::connection()->cast($this, $next);
$current->_data[$key] = $next;
}
$current = $next;
}
$current->__set(end($path), $value);
}
if (is_array($value)) {
$value = $this->_relation('set', $name, $value);
}
$this->_data[$name] = $value;
}
/**
* PHP magic method used to check the presence of a field as document properties, i.e.
* `$document->_id`.
*
* @param $name The field name, as specified with an object property.
* @return boolean True if the field specified in `$name` exists, false otherwise.
*/
public function __isset($name) {
return isset($this->_data[$name]);
}
/**
* PHP magic method used when unset() is called on a `Document` instance.
* Use case for this would be when you wish to edit a document and remove a field, ie. :
* {{{ $doc = Post::find($id); unset($doc->fieldName); $doc->save(); }}}
*
* @param unknown_type $name
* @return unknown_type
*/
public function __unset($name) {
unset($this->_data[$name]);
}
/**
* Allows several properties to be assigned at once.
*
* For example:
* {{{
* $doc->set(array('title' => 'Lorem Ipsum', 'value' => 42));
* }}}
*
* @param $values An associative array of fields and values to assign to the `Document`.
* @return void
*/
public function set($values) {
foreach ($values as $key => $val) {
$this[$key] = $val;
}
}
/**
* Allows document fields to be accessed as array keys, i.e. `$document['_id']`.
*
* @param mixed $offset String or integer indicating the offset or index of a document in a set,
* or the name of a field in an individual document.
* @return mixed Returns either a sub-object in the document, or a scalar field value.
*/
public function offsetGet($offset) {
$data = null;
$null = null;
$model = $this->_model;
if (!isset($this->_data[$offset]) && !$data = $this->_populate(null, $offset)) {
return $null;
}
if (is_array($data = $this->_data[$offset]) && $model) {
$this->_data[$offset] = $model::connection()->cast($this, $data);
}
if (isset($this->_data[$offset])) {
return $this->_data[$offset];
}
return $null;
}
/**
* Rewinds the collection of sub-`Document`s to the beginning and returns the first one found.
*
* @return object Returns the first `Document` object instance in the collection.
*/
public function rewind() {
$data = parent::rewind() ?: $this->_populate();
$key = key($this->_data);
if (is_object($data)) {
return $data;
}
if (isset($this->_data[$key])) {
return $this->offsetGet($key);
}
}
public function current() {
return $this->offsetGet(key($this->_data));
}
/**
* Returns the next document in the set, and advances the object's internal pointer. If the end
* of the set is reached, a new document will be fetched from the data source connection handle
* If no more documents can be fetched, returns `null`.
*
* @return mixed Returns the next document in the set, or `null`, if no more documents are
* available.
*/
public function next() {
$prev = key($this->_data);
$this->_valid = !(next($this->_data) === false && key($this->_data) === null);
$cur = key($this->_data);
if (!$this->_valid && $cur !== $prev && $cur !== null) {
$this->_valid = true;
}
$this->_valid = $this->_valid ?: !is_null($this->_populate());
return $this->_valid ? $this->offsetGet(key($this->_data)) : null;
}
public function export(array $options = array()) {
$map = function($doc) use ($options) {
return is_array($doc) ? $doc : $doc->export();
};
return array_map($map, $this->_data);
}
/**
* Lazy-loads a document from a query using a reference to a database adapter and a query
* result resource.
*
* @param array $data
* @param mixed $key
* @return array
*/
protected function _populate($data = null, $key = null) {
if ($this->closed() || !($model = $this->_model)) {
return;
}
$conn = $model::connection();
if (($data = $data ?: $this->_result->next()) === null) {
return $this->close();
}
$options = array('exists' => true, 'first' => true, 'pathKey' => $this->_pathKey);
return $this->_data[] = $conn->cast($this, array($key => $data), $options);
}
/**
* Instantiates a new `Document` object as a descendant of the current object, and sets all
* default values and internal state.
*
* @param string $classType The type of class to create, either `'entity'` or `'set'`.
* @param string $key The key name to which the related object is assigned.
* @param array $data The internal data of the related object.
* @param array $options Any other options to pass when instantiating the related object.
* @return object Returns a new `Document` object instance.
*/
protected function _relation($classType, $key, $data, $options = array()) {
$parent = $this;
$model = $this->_model;
if (is_object($data) && $data instanceof Document) {
$data->assignTo($this, compact('model', 'pathKey'));
return $data;
}
$options += compact('model', 'data', 'parent');
return new $this->_classes[$classType]($options);
}
}
?>
|
{
"content_hash": "35683d120e3678971c39a046f585332e",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 97,
"avg_line_length": 29.781553398058254,
"alnum_prop": 0.6097799511002445,
"repo_name": "WarToaster/HangOn",
"id": "3549e33694d9b5209552ab12aaf9c7d75b2edab4",
"size": "6338",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "libraries/lithium/data/collection/DocumentSet.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "44750"
},
{
"name": "JavaScript",
"bytes": "17981"
},
{
"name": "PHP",
"bytes": "2100971"
},
{
"name": "Shell",
"bytes": "247"
}
]
}
|
import numpy as np
print(bool(np.nan))
|
{
"content_hash": "8caf9e36d5ba2666be47bddb8eaace53",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 19,
"avg_line_length": 13.333333333333334,
"alnum_prop": 0.725,
"repo_name": "amorgun/python-trickery",
"id": "0af2d4441e9aa98c18d57ebb3e47d27ecf181c61",
"size": "40",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "numpy_nan.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "1925"
}
]
}
|
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "e617a46c518080731741a5ee03fb7ee8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "a8c8a1933bc02f81813501a37f3148f230f47fbf",
"size": "190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Protozoa/Ciliophora/Gymnostomatea/Pleurostomatida/Litonotidae/Lionotus/Lionotus armillatus/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": []
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v5.1.0: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v5.1.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1Task.html">Task</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">v8::Task Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classv8_1_1Task.html">v8::Task</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Run</b>()=0 (defined in <a class="el" href="classv8_1_1Task.html">v8::Task</a>)</td><td class="entry"><a class="el" href="classv8_1_1Task.html">v8::Task</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>~Task</b>() (defined in <a class="el" href="classv8_1_1Task.html">v8::Task</a>)</td><td class="entry"><a class="el" href="classv8_1_1Task.html">v8::Task</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
|
{
"content_hash": "5d81b4d5151100a38e1b77c0dcf1a19d",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 303,
"avg_line_length": 45.68518518518518,
"alnum_prop": 0.6410620186461289,
"repo_name": "v8-dox/v8-dox.github.io",
"id": "fa591d5727d65e44ad47297f8a97875d2bf2b4d8",
"size": "4934",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fd0253b/html/classv8_1_1Task-members.html",
"mode": "33188",
"license": "mit",
"language": []
}
|
package org.telegram.tl;
/**
* TL Vector of integers. @see org.telegram.tl.TLVector
*
* @author Ruben Bermudez
*/
public class TLIntVector extends TLVector<Integer> {
public TLIntVector() {
setDestClass(Integer.class);
}
@Override
public String toString() {
return "vector<int>#1cb5c415";
}
public int[] toIntArray() {
int[] res = new int[size()];
for (int i = 0; i < res.length; i++) {
res[i] = get(i);
}
return res;
}
}
|
{
"content_hash": "1b8440622aae92d5e7182fcc55d014e4",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 55,
"avg_line_length": 20.68,
"alnum_prop": 0.5570599613152805,
"repo_name": "rubenlagus/TelegramApi",
"id": "abfa3192e6699ee1f1cbaaad86b27adbc8ae415b",
"size": "517",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/telegram/tl/TLIntVector.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "2393726"
}
]
}
|
import React from 'react';
import autobind from 'core-decorators/es/autobind';
import MediaQuery from 'react-responsive';
import { withRouter } from 'react-router-dom';
import { connect } from 'react-redux';
import { graphql } from 'react-apollo';
import { Tab2, Tabs2, Intent, Icon } from '@blueprintjs/core';
import bp from '../../../../../../lib/react/components/utility/bp';
import UsersView from '../../views/UsersView';
import TeamsView from '../../views/TeamsView';
import GameStateView from '../../views/GameStateView';
import ServerSettingsView from '../../views/ServerSettingsView';
import InstructionArticlesView from '../../views/InstructionArticlesView';
import S3ExplorerView from '../../views/S3ExplorerView';
import ChallengesView from '../../views/ChallengesView';
import LogsView from '../../views/LogsView';
import ResponsesView from '../../views/ResponsesView';
import FeedView from '../../views/FeedView';
import NotificationToaster from '../../../components/NotificationToaster';
import UncheckedResponseToaster from '../../../components/UncheckedResponseToaster';
import { getResponses } from '../../../../graphql/response';
const POLL_RESPONSE_INTERVAL = 60 * 1000;
const VIEWS = [
'users',
'teams',
'challenges',
'uploads',
'instructions',
'state',
'server',
'logs',
'responses',
'feed'
];
const QueryGetResponsesOptions = {
name: 'QueryGetResponses',
options: {
fetchPolicy: 'network-only',
variables: { uncheckedOnly: true }
}
}
const mapStateToProps = (state, ownProps) => {
return {
showResponses: state.settings.showNotifications
}
}
@graphql(getResponses('checked'), QueryGetResponsesOptions)
@withRouter
@connect(mapStateToProps)
@autobind
class AdminDashboard extends React.Component {
state = {
selectedTabId: 'users',
uncheckedResponses: 0
}
componentWillMount() {
this._clearPollingResponses();
this._startPollingResponses();
const { params } = this.props.match;
if (params) {
// Ensure view exists
let viewExists = false;
VIEWS.forEach((view) => {
if (!viewExists) {
if (view === params.view) viewExists = true;
}
})
if (viewExists) {
this.props.history.push(`/admin/dashboard/${params.view}${params.item?`/${params.item}`:''}`);
this.setState({selectedTabId: params.view});
}
else {
this.props.history.push(`/admin/dashboard/users`);
this.setState({selectedTabId: 'users'});
NotificationToaster.show({
intent: Intent.WARNING,
message: `The view '${params.view}' does not exist. You have been redirected to the 'users' view.`
});
}
}
}
componentWillUnmount() {
this._clearPollingResponses();
}
_startPollingResponses() {
this.pollResponses = setInterval(this._handlePollResponses, POLL_RESPONSE_INTERVAL);
}
_clearPollingResponses() {
clearInterval(this.pollResponses);
}
_handleResponseAction() {
this.props.history.push(`/admin/dashboard/responses`);
this.setState({selectedTabId: 'responses'});
}
async _handlePollResponses() {
// Only request data if notifications are turned on
if (!this.props.showResponses) return;
try {
const result = await this.props.QueryGetResponses.refetch();
const { data: { error, getResponses } } = result;
const difference = getResponses.length - this.state.uncheckedResponses;
if (difference > 0) {
UncheckedResponseToaster.show({
timeout: 20000,
intent: Intent.SUCCESS,
message: `There ${difference>1?'are':'is'} ${difference} new unchecked ${difference>1?'responses':'response'} (${getResponses.length} total).`,
action: {
onClick: this._handleResponseAction,
text: 'View'
}
});
}
else if (getResponses.length > 0) {
UncheckedResponseToaster.show({
timeout: 20000,
intent: Intent.PRIMARY,
message: `There ${getResponses.length===1?'is':'are'} ${getResponses.length} unchecked ${getResponses.length===1?'response':'responses'}.`,
action: {
onClick: this._handleResponseAction,
text: 'View'
}
});
}
this.setState({ uncheckedResponses: getResponses.length });
}
catch (err) {
NotificationToaster.show({
intent: Intent.DANGER,
message: err.toString()
});
}
}
handleTabChange(newTabId) {
this.props.history.push(`/admin/dashboard/${newTabId}`);
this.setState({selectedTabId: newTabId});
}
_generateTab(vertical, idIndex, iconName, label, panel) {
if (vertical) {
return <Tab2 id={VIEWS[idIndex]} title={<span><Icon iconName={iconName}/> {label}</span>} panel={panel}/>;
}
else {
return <Tab2 id={VIEWS[idIndex]} title={<Icon iconName={iconName}/>} panel={panel}/>;
}
}
renderTabs(vertical) {
const { item } = this.props.match.params;
return (
<Tabs2 id='dashboard' className={vertical?'':'mobile-tabs'} onChange={this.handleTabChange}
selectedTabId={this.state.selectedTabId} vertical={vertical}>
{this._generateTab(vertical, 0, 'person', 'Users',
<UsersView shouldRefresh={this.state.selectedTabId===VIEWS[0]} item={item}/>
)}
{this._generateTab(vertical, 1, 'people', 'Teams',
<TeamsView shouldRefresh={this.state.selectedTabId===VIEWS[1]} item={item}/>
)}
{this._generateTab(vertical, 2, 'flag', 'Challenges',
<ChallengesView shouldRefresh={this.state.selectedTabId===VIEWS[2]} item={item}/>
)}
{this._generateTab(vertical, 8, 'inbox', 'Responses',
<ResponsesView shouldRefresh={this.state.selectedTabId===VIEWS[8]} item={item}/>
)}
{this._generateTab(vertical, 9, 'feed', 'Newsfeed',
<FeedView shouldRefresh={this.state.selectedTabId===VIEWS[9]} item={item}/>
)}
{this._generateTab(vertical, 4, 'clipboard', 'Instructions',
<InstructionArticlesView shouldRefresh={this.state.selectedTabId===VIEWS[4]} item={item}/>
)}
{this._generateTab(vertical, 3, 'cloud-upload', 'Uploads',
<S3ExplorerView shouldRefresh={this.state.selectedTabId===VIEWS[3]} item={item}/>
)}
{this._generateTab(vertical, 5, 'property', 'Game State',
<GameStateView shouldRefresh={this.state.selectedTabId===VIEWS[5]} item={item}/>
)}
{this._generateTab(vertical, 6, 'cog', 'Settings',
<ServerSettingsView shouldRefresh={this.state.selectedTabId===VIEWS[6]} item={item}/>
)}
{this._generateTab(vertical, 7, 'application', 'Logs',
<LogsView shouldRefresh={this.state.selectedTabId===VIEWS[7]} item={item}/>
)}
</Tabs2>
);
}
render() {
return (
<main id='admin-dashboard'>
<h2 style={{margin: '1rem 0.6rem'}}>Administrator Dashboard</h2>
<MediaQuery minWidth={bp.s+1}>
{this.renderTabs(true)}
</MediaQuery>
<MediaQuery maxWidth={bp.s}>
{this.renderTabs(false)}
</MediaQuery>
</main>
);
}
}
export default AdminDashboard;
|
{
"content_hash": "3626f07a04db0385f1111fdf865c1e9a",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 148,
"avg_line_length": 29.28755364806867,
"alnum_prop": 0.6694021101992966,
"repo_name": "bwyap/ptc-amazing-g-race",
"id": "5843b1f000371adc8b2f491df6f412a95f3980b7",
"size": "6824",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/client/react/admin/pages/DashboardPage/AdminDashboard.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "21343"
},
{
"name": "HTML",
"bytes": "684"
},
{
"name": "JavaScript",
"bytes": "618199"
}
]
}
|
End of preview.