Dataset Preview
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 447
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 7604)
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 447
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 |
|---|---|
package contagionJVM.Dialog;
import contagionJVM.Entities.PlayerEntity;
import contagionJVM.GameObject.PlayerGO;
import contagionJVM.Helper.ColorToken;
import contagionJVM.Helper.MenuHelper;
import contagionJVM.Repository.OverflowItemRepository;
import contagionJVM.Repository.PlayerRepository;
import contagionJVM.Repository.ProgressionLevelRepository;
import contagionJVM.System.ProgressionSystem;
import org.nwnx.nwnx2.jvm.NWObject;
import org.nwnx.nwnx2.jvm.NWScript;
import org.nwnx.nwnx2.jvm.Scheduler;
import org.nwnx.nwnx2.jvm.constants.ObjectType;
@SuppressWarnings("UnusedDeclaration")
public class Conversation_RestMenu extends DialogBase implements IDialogHandler {
@Override
public PlayerDialog SetUp(NWObject oPC) {
PlayerDialog dialog = new PlayerDialog();
DialogPage mainPage = new DialogPage(
BuildMainPageHeader(oPC),
ColorToken.Green() + "Open Overflow Inventory" + ColorToken.End(),
"Allocate Skill Points",
"Dice Bag",
"Emote Menu",
"View Badges",
"View Crafts",
"View Key Items",
"Modify Clothes",
"Dye Clothes",
"Character Management");
dialog.addPage("MainPage", mainPage);
return dialog;
}
@Override
public void Initialize()
{
PlayerGO pcGO = new PlayerGO(GetPC());
OverflowItemRepository repo = new OverflowItemRepository();
long overflowCount = repo.GetPlayerOverflowItemCount(pcGO.getUUID());
if(overflowCount <= 0)
{
SetResponseVisible("MainPage", 1, false);
}
}
@Override
public void DoAction(final NWObject oPC, String pageName, int responseID) {
switch (pageName) {
case "MainPage":
switch (responseID) {
// Open Overflow Inventory
case 1:
final NWObject storage = NWScript.createObject(ObjectType.PLACEABLE, "overflow_storage", NWScript.getLocation(oPC), false, "");
Scheduler.assign(oPC, new Runnable() {
@Override
public void run() {
NWScript.actionInteractObject(storage);
}
});
break;
// Allocate Skill Points
case 2:
SwitchConversation("AllocateSkillPoints");
break;
// Dice Bag
case 3:
NWScript.setLocalObject(oPC, "dmfi_univ_target", oPC);
NWScript.setLocalLocation(oPC, "dmfi_univ_location", NWScript.getLocation(oPC));
NWScript.setLocalString(oPC, "dmfi_univ_conv", "pc_dicebag");
Scheduler.assign(oPC, new Runnable() {
@Override
public void run() {
NWScript.clearAllActions(false);
NWScript.actionStartConversation(oPC, "dmfi_universal", true, false);
}
});
break;
// Emote Menu
case 4:
NWScript.setLocalObject(oPC, "dmfi_univ_target", oPC);
NWScript.setLocalLocation(oPC, "dmfi_univ_location", NWScript.getLocation(oPC));
NWScript.setLocalString(oPC, "dmfi_univ_conv", "pc_emote");
Scheduler.assign(oPC, new Runnable() {
@Override
public void run() {
NWScript.clearAllActions(false);
NWScript.actionStartConversation(oPC, "dmfi_universal", true, false);
}
});
break;
// View Badges
case 5:
SwitchConversation("ViewBadges");
break;
// View Crafts
case 6:
SwitchConversation("ViewCrafts");
break;
// Key Item Categories Page
case 7:
SwitchConversation("KeyItems");
break;
// Modify Clothes
case 8:
Scheduler.assign(oPC, new Runnable() {
@Override
public void run() {
NWScript.actionStartConversation(oPC, "x0_skill_ctrap", true, false);
}
});
break;
// Dye Clothes
case 9:
Scheduler.assign(oPC, new Runnable() {
@Override
public void run() {
NWScript.actionStartConversation(oPC, "dye_dyekit", true, false);
}
});
break;
// Character Management
case 10:
SwitchConversation("CharacterManagement");
break;
}
break;
}
}
@Override
public void EndDialog()
{
}
private String BuildMainPageHeader(NWObject oPC)
{
PlayerGO pcGO = new PlayerGO(oPC);
PlayerRepository repo = new PlayerRepository();
ProgressionLevelRepository levelRepo = new ProgressionLevelRepository();
PlayerEntity entity = repo.getByUUID(pcGO.getUUID());
int requiredExp = levelRepo.getByLevel(entity.getLevel()).getExperience();
String header = ColorToken.Green() + "Name: " + ColorToken.End() + NWScript.getName(oPC, false) + "\n\n";
header += ColorToken.Green() + "Level: " + ColorToken.End() + entity.getLevel() + "\n";
header += ColorToken.Green() + "Skill Points: " + ColorToken.End() + entity.getUnallocatedSP() + "\n";
header += ColorToken.Green() + "Exp: " + ColorToken.End() + MenuHelper.BuildBar(entity.getExperience(), requiredExp, 100) + "\n";
header += ColorToken.Green() + "Hunger: " + ColorToken.End() + MenuHelper.BuildBar(entity.getCurrentHunger(), entity.getMaxHunger(), 100) + "\n";
header += ColorToken.Green() + "Infection: " + ColorToken.End() + MenuHelper.BuildBar(entity.getCurrentInfection(), 100, 100) + "\n";
return header;
}
}
|
{
"content_hash": "e4341ee452a289343e497b5c6f265c0f",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 155,
"avg_line_length": 41.74846625766871,
"alnum_prop": 0.49875091844232183,
"repo_name": "zunath/Contagion_JVM",
"id": "6caa56512fda4f36da1b6d460dcd6711416987c3",
"size": "6805",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/contagionJVM/Dialog/Conversation_RestMenu.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "849346"
}
]
}
|
package org.codehaus.mojo.mrm.plugin;
import java.io.IOException;
/**
* A thread that waits for the user to press a key.
*/
public class ConsoleScanner
extends Thread
{
/**
* The guard for {@link #finished}.
*/
private final Object lock = new Object();
/**
* Flag to indicate that the thread has finished.
* <p/>
* Guarded by {@link #lock}.
*/
private boolean finished = false;
/**
* creates a new instance.
*/
public ConsoleScanner()
{
setName( "Console scanner" );
setDaemon( true );
}
/**
* {@inheritDoc}
*/
public void run()
{
try
{
synchronized ( lock )
{
try
{
while ( !finished )
{
checkSystemInput();
try
{
lock.wait( 500 );
}
catch ( InterruptedException e )
{
// ignore
}
}
}
finally
{
synchronized ( lock )
{
finished = true;
lock.notifyAll();
}
}
}
}
catch ( IOException e )
{
// ignore
}
}
/**
* Checks for the user pressing Enter.
*
* @throws IOException if something went wrong.
*/
private void checkSystemInput()
throws IOException
{
while ( System.in.available() > 0 )
{
int input = System.in.read();
if ( input >= 0 )
{
char c = (char) input;
if ( c == '\n' )
{
synchronized ( lock )
{
finished = true;
lock.notifyAll();
}
}
}
else
{
synchronized ( lock )
{
finished = true;
lock.notifyAll();
}
}
}
}
/**
* Blocks until the console scanner is finished.
*
* @throws InterruptedException if interrupted.
*/
public void waitForFinished()
throws InterruptedException
{
synchronized ( lock )
{
while ( !finished )
{
lock.wait();
}
}
}
}
|
{
"content_hash": "8eb2250b3d4921b014b351dac8fa9e62",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 56,
"avg_line_length": 21.733870967741936,
"alnum_prop": 0.3562152133580705,
"repo_name": "mojohaus/mrm",
"id": "f8049feae487f475c93d030320908c3df9f1556b",
"size": "3294",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "mrm-maven-plugin/src/main/java/org/codehaus/mojo/mrm/plugin/ConsoleScanner.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "2057"
},
{
"name": "Java",
"bytes": "361660"
}
]
}
|
import re
import requests
import json
class InfobloxNotFoundException(Exception):
pass
class InfobloxNoIPavailableException(Exception):
pass
class InfobloxNoNetworkAvailableException(Exception):
pass
class InfobloxGeneralException(Exception):
pass
class InfobloxBadInputParameter(Exception):
pass
class Infoblox(object):
""" Implements the following subset of Infoblox IPAM API via REST API
create_network
delete_network
create_networkcontainer
delete_networkcontainer
get_next_available_network
create_host_record
create_txt_record
delete_txt_record
delete_host_record
add_host_alias
delete_host_alias
create_cname_record
delete_cname_record
update_cname_record
create_dhcp_range
delete_dhcp_range
get_next_available_ip
get_host
get_host_by_ip
get_ip_by_host
get_host_by_regexp
get_txt_by_regexp
get_host_by_extattrs
get_host_extattrs
get_host_by_mac
get_network
get_network_by_ip
get_network_by_extattrs
get_network_extattrs
update_network_extattrs
delete_network_extattrs
csv_upload
csv_insert
csv_delete
get_lease_cltt_by_hostname
get_lease_by_ip
get_lease_by_mac
"""
def __init__(self, iba_ipaddr, iba_user, iba_password, iba_wapi_version, iba_dns_view, iba_network_view, iba_verify_ssl=False):
""" Class initialization method
:param iba_ipaddr: IBA IP address of management interface
:param iba_user: IBA user name
:param iba_password: IBA user password
:param iba_wapi_version: IBA WAPI version (example: 1.0)
:param iba_dns_view: IBA default view
:param iba_network_view: IBA default network view
:param iba_verify_ssl: IBA SSL certificate validation (example: False)
"""
self.iba_host = iba_ipaddr
self.iba_user = iba_user
self.iba_password = iba_password
self.iba_wapi_version = iba_wapi_version
self.iba_dns_view = iba_dns_view
self.iba_network_view = iba_network_view
self.iba_verify_ssl = iba_verify_ssl
def add_view(self,arg):
""" Stupid helper function to add &view= to URL requests that want one
"""
return arg + '&view=' + self.iba_dns_view
def get_next_available_ip(self, network):
""" Implements IBA next_available_ip REST API call
Returns IP v4 address
:param network: network in CIDR format
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/network?network=' + network + '&network_view=' + self.iba_network_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
net_ref = r_json[0]['_ref']
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/' + net_ref + '?_function=next_available_ip&num=1'
r = requests.post(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
ip_v4 = r_json['ips'][0]
return ip_v4
else:
if 'text' in r_json:
if 'code' in r_json and r_json['code'] == 'Client.Ibap.Data':
raise InfobloxNoIPavailableException(
r_json['text'])
else:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxNotFoundException(
"No requested network found: " + network)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def create_host_record(self, address, fqdn):
""" Implements IBA REST API call to create IBA host record
Returns IP v4 address assigned to the host
:param address: IP v4 address or NET v4 address in CIDR format to get next_available_ip from
:param fqdn: hostname in FQDN
"""
if re.match("^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\/[0-9]+$", address):
ipv4addr = 'func:nextavailableip:' + address
else:
if re.match("^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$", address):
ipv4addr = address
else:
raise InfobloxBadInputParameter(
'Expected IP or NET address in CIDR format')
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/record:host' + '?_return_fields=ipv4addrs'
payload = '{"ipv4addrs": [{"configure_for_dhcp": false,"ipv4addr": "' + \
ipv4addr + '"}],"name": "' + fqdn + '","view": "' + self.iba_dns_view + '"}'
try:
r = requests.post(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
r_json = r.json()
if r.status_code == 200 or r.status_code == 201:
return r_json['ipv4addrs'][0]['ipv4addr']
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def create_txt_record(self, text, fqdn):
""" Implements IBA REST API call to create IBA txt record
Returns IP v4 address assigned to the host
:param text: free text to be added to the record
:param fqdn: hostname in FQDN
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/record:txt'
payload = '{"text": "' + text + '","name": "' + \
fqdn + '","view": "' + self.iba_dns_view + '"}'
try:
r = requests.post(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
r_json = r.json()
if r.status_code == 200 or r.status_code == 201:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def delete_host_record(self, fqdn):
""" Implements IBA REST API call to delete IBA host record
:param fqdn: hostname in FQDN
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:host?name=' + fqdn + '&view=' + self.iba_dns_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
host_ref = r_json[0]['_ref']
if host_ref and re.match("record:host\/[^:]+:([^\/]+)\/", host_ref).group(1) == fqdn:
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + host_ref
r = requests.delete(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxGeneralException(
"Received unexpected host reference: " + host_ref)
else:
raise InfobloxNotFoundException(
"No requested host found: " + fqdn)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def delete_txt_record(self, fqdn):
""" Implements IBA REST API call to delete IBA TXT record
:param fqdn: hostname in FQDN
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:txt?name=' + fqdn + '&view=' + self.iba_dns_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
host_ref = r_json[0]['_ref']
if host_ref and re.match("record:txt\/[^:]+:([^\/]+)\/", host_ref).group(1) == fqdn:
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + host_ref
r = requests.delete(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxGeneralException(
"Received unexpected host reference: " + host_ref)
else:
raise InfobloxNotFoundException(
"No requested host found: " + fqdn)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def add_host_alias(self, host_fqdn, alias_fqdn):
""" Implements IBA REST API call to add an alias to IBA host record
:param host_fqdn: host record name in FQDN
:param alias_fqdn: host record name in FQDN
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:host?name=' + host_fqdn + '&view=' + \
self.iba_dns_view + '&_return_fields=name,aliases'
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
host_ref = r_json[0]['_ref']
if host_ref and re.match("record:host\/[^:]+:([^\/]+)\/", host_ref).group(1) == host_fqdn:
if 'aliases' in r_json[0]:
aliases = r_json[0]['aliases']
aliases.append(alias_fqdn)
payload = '{"aliases": ' + \
json.JSONEncoder().encode(aliases) + '}'
else:
payload = '{"aliases": ["' + alias_fqdn + '"]}'
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + host_ref
r = requests.put(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxGeneralException(
"Received unexpected host reference: " + host_ref)
else:
raise InfobloxNotFoundException(
"No requested host found: " + host_fqdn)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def delete_host_alias(self, host_fqdn, alias_fqdn):
""" Implements IBA REST API call to add an alias to IBA host record
:param host_fqdn: host record name in FQDN
:param alias_fqdn: host record name in FQDN
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:host?name=' + host_fqdn + '&view=' + \
self.iba_dns_view + '&_return_fields=name,aliases'
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
host_ref = r_json[0]['_ref']
if host_ref and re.match("record:host\/[^:]+:([^\/]+)\/", host_ref).group(1) == host_fqdn:
if 'aliases' in r_json[0]:
aliases = r_json[0]['aliases']
aliases.remove(alias_fqdn)
payload = '{"aliases": ' + \
json.JSONEncoder().encode(aliases) + '}'
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + host_ref
r = requests.put(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(
r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxNotFoundException(
"No requested host alias found: " + alias_fqdn)
else:
raise InfobloxGeneralException(
"Received unexpected host reference: " + host_ref)
else:
raise InfobloxNotFoundException(
"No requested host found: " + host_fqdn)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def create_cname_record(self, canonical, name):
""" Implements IBA REST API call to create IBA cname record
:param canonical: canonical name in FQDN format
:param name: the name for a CNAME record in FQDN format
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/record:cname'
payload = '{"canonical": "' + canonical + '","name": "' + \
name + '","view": "' + self.iba_dns_view + '"}'
try:
r = requests.post(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
r_json = r.json()
if r.status_code == 200 or r.status_code == 201:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def delete_cname_record(self, fqdn):
""" Implements IBA REST API call to delete IBA cname record
:param fqdn: cname in FQDN
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:cname?name=' + fqdn + '&view=' + self.iba_dns_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
cname_ref = r_json[0]['_ref']
if cname_ref and re.match("record:cname\/[^:]+:([^\/]+)\/", cname_ref).group(1) == fqdn:
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + cname_ref
r = requests.delete(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxGeneralException(
"Received unexpected cname record reference: " + cname_ref)
else:
raise InfobloxNotFoundException(
"No requested cname record found: " + fqdn)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def update_cname_record(self, canonical, name):
""" Implements IBA REST API call to update or repoint IBA cname record
:param canonical: canonical name in FQDN format
:param name: the name for the new CNAME record in FQDN format
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/record:cname'
payload = json.dumps({'name': name})
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
r_json = r.json()
# RFC1912 - A CNAME can not coexist with any other data, we should
# expect utmost one entry
if r.status_code == 200 and len(r_json) == 1:
ibx_cname = r.json()[0]
cname_ref = ibx_cname['_ref']
payload = '{"canonical": ' + \
json.JSONEncoder().encode(canonical) + '}'
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + cname_ref
r = requests.put(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
if r.status_code == 200 or r.status_code == 201:
return
else:
r.raise_for_status()
elif len(r_json) == 0:
raise InfobloxNotFoundException(
"CNAME: " + name + " not found.")
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def create_dhcp_range(self, start_ip_v4, end_ip_v4):
""" Implements IBA REST API call to add DHCP range for given start and end addresses
:param start_ip_v4: IP v4 address
:param end_ip_v4: IP v4 address
"""
rest_url = 'https://' + self.iba_host + \
'/wapi/v' + self.iba_wapi_version + '/range'
payload = '{"start_addr": "' + start_ip_v4 + \
'","end_addr": "' + end_ip_v4 + '"}'
try:
r = requests.post(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
r_json = r.json()
if r.status_code == 200 or r.status_code == 201:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def delete_dhcp_range(self, start_ip_v4, end_ip_v4):
""" Implements IBA REST API call to delete DHCP range for given start and end addresses
:param start_ip_v4: IP v4 address
:param end_ip_v4: IP v4 address
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + '/range?start_addr=' + \
start_ip_v4 + '?end_addr=' + end_ip_v4 + \
'&network_view=' + self.iba_network_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
range_ref = r_json[0]['_ref']
if range_ref:
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + range_ref
r = requests.delete(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxGeneralException(
"No range reference received in IBA reply")
else:
raise InfobloxNotFoundException(
"No requested range found: " + start_ip_v4 + "-" + end_ip_v4)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_host(self, fqdn, fields=None):
""" Implements IBA REST API call to retrieve host record fields
Returns hash table of fields with field name as a hash key
:param fqdn: hostname in FQDN
:param fields: comma-separated list of field names (optional)
"""
if fields:
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:host?name=' + fqdn + '&_return_fields=' + fields
if not self.iba_dns_view == '':
rest_url = self.add_view(rest_url)
else:
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:host?name=' + fqdn
if not self.iba_dns_view == '':
rest_url = self.add_view(rest_url)
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
return r_json[0]
else:
raise InfobloxNotFoundException("No hosts found: " + fqdn)
else:
if 'text' in r_json:
raise InfobloxNotFoundException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_host_by_regexp(self, fqdn):
""" Implements IBA REST API call to retrieve host records by fqdn regexp filter
Returns array of host names in FQDN matched to given regexp filter
:param fqdn: hostname in FQDN or FQDN regexp filter
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:host?name~=' + fqdn + '&view=' + self.iba_dns_view
hosts = []
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
for host in r_json:
hosts.append(host['name'])
return hosts
else:
raise InfobloxNotFoundException(
"No hosts found for regexp filter: " + fqdn)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_txt_by_regexp(self, fqdn):
""" Implements IBA REST API call to retrieve TXT records by fqdn regexp filter
Returns dictonary of host names in FQDN matched to given regexp filter with the TXT value
:param fqdn: hostname in FQDN or FQDN regexp filter
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:txt?name~=' + fqdn + '&view=' + self.iba_dns_view
hosts = {}
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
for host in r_json:
hosts[host['name']] = host['text']
return hosts
else:
raise InfobloxNotFoundException(
"No txt records found for regexp filter: " + fqdn)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_extattrs_by_ip(self, ip_v4, attributes=False):
""" Implements IBA REST API call to find hostname by IP address
Returns array of host names in FQDN associated with given IP address
:param ip_v4: IP v4 address
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/ipv4address?ip_address=' + ip_v4 + '&network_view=' + self.iba_network_view + \
'&_return_fields=names,extattrs'
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
extattrs = {}
if attributes:
for attribute in attributes:
if attribute in r_json[0]['extattrs']:
extattrs[attribute] = r_json[0][
'extattrs'][attribute]['value']
else:
raise InfobloxNotFoundException(
"No requested attribute found: " + attribute)
else:
for attribute in r_json[0]['extattrs'].keys():
extattrs[attribute] = r_json[0][
'extattrs'][attribute]['value']
return extattrs
else:
raise InfobloxNotFoundException(
"No requested host found: " + ip_v4)
else:
if 'text' in r_json:
raise InfobloxNotFoundException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_host_by_ip(self, ip_v4):
""" Implements IBA REST API call to find hostname by IP address
Returns array of host names in FQDN associated with given IP address
:param ip_v4: IP v4 address
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/ipv4address?ip_address=' + ip_v4 + '&network_view=' + self.iba_network_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
if len(r_json[0]['names']) > 0:
return r_json[0]['names']
else:
raise InfobloxNotFoundException(
"No host records found for IP: " + ip_v4)
else:
raise InfobloxNotFoundException("No IP found: " + ip_v4)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_ip_by_host(self, fqdn):
""" Implements IBA REST API call to find IP addresses by hostname
Returns array of IP v4 addresses associated with given hostname
:param fqdn: hostname in FQDN
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:host?name=' + fqdn + '&view=' + self.iba_dns_view
ipv4addrs = []
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
if len(r_json[0]['ipv4addrs']) > 0:
for ipv4addr in r_json[0]['ipv4addrs']:
ipv4addrs.append(ipv4addr['ipv4addr'])
return ipv4addrs
else:
raise InfobloxNotFoundException(
"No host records found for FQDN: " + fqdn)
else:
raise InfobloxNotFoundException("No hosts found: " + fqdn)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_host_extattrs(self, fqdn, attributes=None):
""" Implements IBA REST API call to retrieve host extensible attributes
Returns hash table of attributes with attribute name as a hash key
:param fqdn: hostname in FQDN
:param attributes: array of extensible attribute names (optional)
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:host?name=' + fqdn + '&_return_fields=name,extattrs'
if not self.iba_dns_view == '':
rest_url = self.add_view(rest_url)
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
extattrs = {}
if attributes:
for attribute in attributes:
if attribute in r_json[0]['extattrs']:
extattrs[attribute] = r_json[0][
'extattrs'][attribute]['value']
else:
raise InfobloxNotFoundException(
"No requested attribute found: " + attribute)
else:
for attribute in r_json[0]['extattrs'].keys():
extattrs[attribute] = r_json[0][
'extattrs'][attribute]['value']
return extattrs
else:
raise InfobloxNotFoundException(
"No requested host found: " + fqdn)
else:
if 'text' in r_json:
raise InfobloxNotFoundException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_host_by_mac(self, mac, attributes=None):
""" IBA REST API call to retreive a host object by MAC address
Returns a record:host type list
:param mac: MAC address (string)
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:host?mac=' + mac + '&view=' + \
self.iba_dns_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
return r_json[0]
else:
raise InfobloxNotFoundException(
"No requested host found: " + mac)
except ValueError:
raise Exception(r)
except Exception:
raise
def get_all_networks(self, max_results='1000'):
""" Implements IBA REST API call to retrieve all network objects
Returns hash table of networks
:param max_results: maximum number of results to return
(optional)
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/network?_max_results=' + max_results
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
return r_json
else:
raise InfobloxNotFoundException("No networks found")
else:
if 'text' in r_json:
raise InfobloxNotFoundException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_network(self, network, fields=None):
""" Implements IBA REST API call to retrieve network object fields
Returns hash table of fields with field name as a hash key
:param network: network in CIDR format
:param fields: comma-separated list of field names
(optional, returns network in CIDR format and netmask if not specified)
"""
if not fields:
fields = 'network,netmask'
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + '/network?network=' + \
network + '&network_view=' + self.iba_network_view + '&_return_fields=' + fields
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
return r_json[0]
else:
raise InfobloxNotFoundException(
"No requested network found: " + network)
else:
if 'text' in r_json:
raise InfobloxNotFoundException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_network_by_ip(self, ip_v4):
""" Implements IBA REST API call to find network by IP address which belongs to this network
Returns network in CIDR format
:param ip_v4: IP v4 address
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/ipv4address?ip_address=' + ip_v4 + '&network_view=' + self.iba_network_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
if 'network' in r_json[0]:
return r_json[0]['network']
else:
raise InfobloxNotFoundException(
"No network found for IP: " + ip_v4)
else:
raise InfobloxNotFoundException("No IP found: " + ip_v4)
else:
if 'text' in r_json:
raise InfobloxNotFoundException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_network_by_extattrs(self, attributes):
""" Implements IBA REST API call to find a network by it's extensible attributes
Returns array of networks in CIDR format
:param attributes: comma-separated list of attributes name/value pairs in the format:
attr_name=attr_value - exact match for attribute value
attr_name:=attr_value - case insensitive match for attribute value
attr_name~=regular_expression - match attribute value by regular expression
attr_name>=attr_value - search by number greater than value
attr_name<=attr_value - search by number less than value
attr_name!=attr_value - search by number not equal of value
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/network?*' + "&*".join(attributes.split(",")) + \
'&network_view=' + self.iba_network_view
networks = []
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
for network in r_json:
if 'network' in network:
networks.append(network['network'])
return networks
else:
raise InfobloxNotFoundException(
"No networks found for extensible attributes: " + attributes)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_host_by_extattrs(self, attributes,max_results='1000'):
""" Implements IBA REST API call to find host by it's extensible attributes
Returns array of hosts in FQDN
:param attributes: comma-separated list of attributes name/value pairs in the format:
attr_name=attr_value - exact match for attribute value
attr_name:=attr_value - case insensitive match for attribute value
attr_name~=regular_expression - match attribute value by regular expression
attr_name>=attr_value - search by number greater than value
attr_name<=attr_value - search by number less than value
attr_name!=attr_value - search by number not equal of value
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/record:host?*' + \
"&*".join(attributes.split(",")) + '&view=' + self.iba_dns_view + \
'&_max_results=' + max_results
hosts = []
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
for host in r_json:
if 'name' in host:
hosts.append(host['name'])
return hosts
else:
raise InfobloxNotFoundException(
"No hosts found for extensible attributes: " + attributes)
else:
if 'text' in r_json:
raise InfobloxNotFoundException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_network_extattrs(self, network, attributes=None):
""" Implements IBA REST API call to retrieve network extensible attributes
Returns hash table of attributes with attribute name as a hash key
:param network: network in CIDR format
:param attributes: array of extensible attribute names (optional)
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + '/network?network=' + \
network + '&network_view=' + self.iba_network_view + \
'&_return_fields=network,extattrs'
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
extattrs = {}
if attributes:
for attribute in attributes:
if attribute in r_json[0]['extattrs']:
extattrs[attribute] = r_json[0][
'extattrs'][attribute]['value']
else:
raise InfobloxNotFoundException(
"No requested attribute found: " + attribute)
else:
for attribute in r_json[0]['extattrs'].keys():
extattrs[attribute] = r_json[0][
'extattrs'][attribute]['value']
return extattrs
else:
raise InfobloxNotFoundException(
"No requested network found: " + network)
else:
if 'text' in r_json:
raise InfobloxNotFoundException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def update_network_extattrs(self, network, attributes):
""" Implements IBA REST API call to add or update network extensible attributes
:param network: network in CIDR format
:param attributes: hash table of extensible attributes with attribute name as a hash key
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + '/network?network=' + \
network + '&network_view=' + self.iba_network_view + \
'&_return_fields=network,extattrs'
extattrs = {}
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
network_ref = r_json[0]['_ref']
if network_ref:
extattrs = r_json[0]['extattrs']
for attr_name, attr_value in attributes.items():
extattrs[attr_name]['value'] = attr_value
payload = '{"extattrs": ' + \
json.JSONEncoder().encode(extattrs) + '}'
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + network_ref
r = requests.put(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxGeneralException(
"No network reference received in IBA reply for network: " + network)
else:
raise InfobloxNotFoundException(
"No requested network found: " + network)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def delete_network_extattrs(self, network, attributes):
""" Implements IBA REST API call to delete network extensible attributes
:param network: network in CIDR format
:param attributes: array of extensible attribute names
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + '/network?network=' + \
network + '&network_view=' + self.iba_network_view + \
'&_return_fields=network,extattrs'
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
network_ref = r_json[0]['_ref']
if network_ref:
extattrs = r_json[0]['extattrs']
for attribute in attributes:
if attribute in extattrs:
del extattrs[attribute]
payload = '{"extattrs": ' + \
json.JSONEncoder().encode(extattrs) + '}'
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + network_ref
r = requests.put(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxGeneralException(
"No network reference received in IBA reply for network: " + network)
else:
raise InfobloxNotFoundException(
"No requested network found: " + network)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def create_network(self, network, comment=''):
""" Implements IBA REST API call to create DHCP network object
:param network: network in CIDR format
"""
rest_url = 'https://' + self.iba_host + \
'/wapi/v' + self.iba_wapi_version + '/network'
payload = '{"network": "' + network + \
'","network_view": "' + self.iba_network_view + '"'
if(len(comment) > 0):
payload += ',"comment":"'+comment+'"}'
else:
payload += '}'
try:
r = requests.post(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
r_json = r.json()
if r.status_code == 200 or r.status_code == 201:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def delete_network(self, network):
""" Implements IBA REST API call to delete DHCP network object
:param network: network in CIDR format
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/network?network=' + network + '&network_view=' + self.iba_network_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
network_ref = r_json[0]['_ref']
if network_ref:
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + network_ref
r = requests.delete(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxGeneralException(
"No network reference received in IBA reply for network: " + network)
else:
raise InfobloxNotFoundException(
"No network found: " + network)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def create_networkcontainer(self, networkcontainer):
""" Implements IBA REST API call to create DHCP network containert object
:param networkcontainer: network container in CIDR format
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/networkcontainer'
payload = '{"network": "' + networkcontainer + \
'","network_view": "' + self.iba_network_view + '"}'
try:
r = requests.post(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, data=payload)
r_json = r.json()
if r.status_code == 200 or r.status_code == 201:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def delete_networkcontainer(self, networkcontainer):
""" Implements IBA REST API call to delete DHCP network container object
:param networkcontainer: network container in CIDR format
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/networkcontainer?network=' + networkcontainer + \
'&network_view=' + self.iba_network_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
network_ref = r_json[0]['_ref']
if network_ref:
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + network_ref
r = requests.delete(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxGeneralException(
"No network container reference received in IBA reply for network container: " + networkcontainer)
else:
raise InfobloxNotFoundException(
"No network container found: " + networkcontainer)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def get_next_available_network(self, networkcontainer, cidr):
""" Implements IBA REST API call to retrieve next available network of network container
Returns network address in CIDR format
:param networkcontainer: network container address in CIDR format
:param cidr: requested network length (from 0 to 32)
"""
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/networkcontainer?network=' + networkcontainer + \
'&network_view=' + self.iba_network_view
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
net_ref = r_json[0]['_ref']
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + \
'/' + net_ref + '?_function=next_available_network&cidr=' + \
str(cidr) + '&num=1'
r = requests.post(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
network = r_json['networks'][0]
return network
else:
if 'text' in r_json:
if 'code' in r_json and r_json['code'] == 'Client.Ibap.Data':
raise InfobloxNoNetworkAvailableException(r_json[
'text'])
else:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxNotFoundException(
"No requested network container found: " + networkcontainer)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def csv_upload(self, filename, operation, update_method="OVERRIDE", on_error='CONTINUE'):
# create the request url for init.
rest_url_pre = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version
try:
init_url = rest_url_pre + '/fileop?_function=uploadinit'
# send request to the server to establish the object, with token and url.
r = requests.post(url=init_url, auth=(self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
# need to do escaping or we will have issues when it's sent to the requests.post
req_url = r_json['url']
files = {'file': (filename, open(filename, 'rb')) }
file_r = requests.post(url=req_url, auth=(self.iba_user, self.iba_password), verify=self.iba_verify_ssl, files=files)
# Use the token to tell the server to process the file as a csv_import
token = r_json['token']
csv_url = rest_url_pre + '/fileop?_function=csv_import'
# Here we use the on_error CONTINUE setting so that if we try and delete lines that don't exist we keep going,
# and so that if we try and insert lines that are already in infoblox it simply keeps going.
payload = { "token": token, "operation": operation, "on_error": on_error }
if operation == 'UPDATE':
payload['update_method'] = update_method
requests.post(url=csv_url, auth=(self.iba_user, self.iba_password), verify=self.iba_verify_ssl, json=payload)
except ValueError:
raise Exception(r)
except Exception:
raise
# Inserts the rows of elements associated with rows in the CSV.
def csv_insert(self, filename):
self.csv_upload(filename, 'INSERT')
# Deletes the rows of elements associated with rows in the CSV.
def csv_delete(self, filename):
self.csv_upload(filename, 'DELETE')
### DHCP functions.
### Bug? Getting cltt information only works with dynamic IPs, not static reservations.
def get_lease_cltt_by_hostname(self,client_hostname):
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/lease?_return_fields=cltt&client_hostname~=' + client_hostname
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
except ValueError:
raise Exception(r)
except Exception:
raise
if(len(r_json) > 0):
return r_json
def get_lease_by_ip(self,client_ip):
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/lease?_return_fields=cltt&address=' + client_ip
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
except ValueError:
raise Exception(r)
except Exception:
raise
if(len(r_json) > 0):
return r_json
def get_leaseip_by_mac(self,client_mac):
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/search?search_string:=' + client_mac
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
except ValueError:
raise Exception(r)
except Exception:
raise
if(len(r_json) > 0):
return r_json
def query_record(self, record_type, fields=None, **kwargs):
rest_url = 'https://{}/wapi/v{}/record:{}?'.format(self.iba_host, self.iba_wapi_version, record_type)
if fields:
kwargs['_return_fields'] = fields
params = '&'.join(['{}={}'.format(k,v) for k,v in kwargs.items()])
rest_url += params
if not self.iba_dns_view == '':
rest_url = self.add_view(rest_url)
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
return r_json
else:
if 'text' in r_json:
raise InfobloxNotFoundException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
def update_host_extattrs(self, host, attributes):
""" Implements IBA REST API call to set host extensible attributes
:param host: FQDN as a string
:param attributes: hash table of extensible attributes with attribute name as a hash key
This will remove any existing extensible attributes so get the original list first!
"""
# First, get the host record's reference based on the hostname
rest_url = 'https://' + self.iba_host + '/wapi/v' + self.iba_wapi_version + '/record:host?name=' + \
host + '&view=' + self.iba_dns_view + \
'&_return_fields=name,extattrs'
extattrs = {}
try:
r = requests.get(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl)
r_json = r.json()
if r.status_code == 200:
if len(r_json) > 0:
host_ref = r_json[0]['_ref']
if host_ref:
for attr_name, attr_value in attributes.items():
extattrs[attr_name] = {'value': attr_value}
payload = dict(extattrs=extattrs)
rest_url = 'https://' + self.iba_host + '/wapi/v' + \
self.iba_wapi_version + '/' + host_ref
r = requests.put(url=rest_url, auth=(
self.iba_user, self.iba_password), verify=self.iba_verify_ssl, json=payload)
if r.status_code == 200:
return
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
else:
raise InfobloxGeneralException(
"No host reference received in IBA reply for host: " + host)
else:
raise InfobloxNotFoundException(
"No requested host found: " + host)
else:
if 'text' in r_json:
raise InfobloxGeneralException(r_json['text'])
else:
r.raise_for_status()
except ValueError:
raise Exception(r)
except Exception:
raise
|
{
"content_hash": "fcf3186b466deb6146ebaf383232b65d",
"timestamp": "",
"source": "github",
"line_count": 1463,
"max_line_length": 131,
"avg_line_length": 44.75598086124402,
"alnum_prop": 0.48413207489538473,
"repo_name": "kraigu/Infoblox-API-Python",
"id": "207f3105377db663a8e598d8d4b3da53ce6077a2",
"size": "66230",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "infoblox.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "67477"
}
]
}
|
package a.org.fakereplace.test.replacement.annotated.inherited;
@InheritedAnnotation(20)
@NotInheritedAnnotation
public class RemovedInheritedSuperClass {
}
|
{
"content_hash": "43ca06f28344c1e62b9e0c4593b4e21a",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 63,
"avg_line_length": 17.88888888888889,
"alnum_prop": 0.8385093167701864,
"repo_name": "fakereplace/fakereplace",
"id": "e8c2cdc4d8485403ba5fd2fb467e9c42fecbb80c",
"size": "830",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/test/java/a/org/fakereplace/test/replacement/annotated/inherited/RemovedInheritedSuperClass.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "1981"
},
{
"name": "Java",
"bytes": "911839"
}
]
}
|
package com.paypal.risk.hadoopjt.util
import org.slf4j.LoggerFactory
import scala.xml.XML
import scala.collection.mutable.Map
/**
* @author Danick
*/
object Constants {
val logger = LoggerFactory.getLogger(getClass())
val hadoopConfigProperties: Map[String, String] = Map()
val MAPRED_JT_HTTP_ADDRESS = "mapred.job.tracker.http.address"
val MAPRED_JT_ADDRESS = "mapred.job.tracker"
//hadoop v1 web pages
val JT_JOB_TRACKER = "jobtracker.jsp"
val JT_JOBQUEUE_DETAILS = "jobqueue_details.jsp"
val JT_SCHEDULER = "scheduler"
val JT_PARAM_QUEUENAME = "queueName"
val JT_PARAM_JOBID = "jobid"
val JT_PARAM_SETPOOL = "setPool"
//hadoop v2 APIs
val YARN_RM_HTTP_ADDRESS = "yarn.resourcemanager.webapp.address"
val YARN_MR_HISTORY_ADDRESS = "mapreduce.jobhistory.webapp.address"
def loadResource(xmlFile: String) {
val resource = getClass().getClassLoader().getResource(xmlFile)
if (resource != null) {
logger.debug("load resource " + xmlFile)
val resourceDoc = XML.load(resource)
val properties = (resourceDoc \ "property")
for (property <- properties) {
val name = (property \ "name")(0).text
val value = (property \ "value")(0).text
hadoopConfigProperties.put(name, value)
}
} else {
logger.debug("Can not load resource " + xmlFile)
}
}
var JT_HTTP_BASE_URL: String = null
var HADOOP_VERSION: Int = 0
var JT_YARN_MR_HISTORY_ADDRESS:String = null
def initConfiguration() = {
loadResource("core-site.xml")
loadResource("hdfs-site.xml")
loadResource("yarn-site.xml")
loadResource("mapred-site.xml")
//firstly try with hadoop v2
if (hadoopConfigProperties.contains(YARN_RM_HTTP_ADDRESS)) {
HADOOP_VERSION = 2
JT_HTTP_BASE_URL = "http://" + hadoopConfigProperties(YARN_RM_HTTP_ADDRESS)
JT_YARN_MR_HISTORY_ADDRESS = "http://" + hadoopConfigProperties(YARN_MR_HISTORY_ADDRESS)
} else {
if (hadoopConfigProperties.contains(MAPRED_JT_HTTP_ADDRESS) && hadoopConfigProperties.contains(MAPRED_JT_ADDRESS)) {
val port = hadoopConfigProperties(MAPRED_JT_HTTP_ADDRESS)
val jobTrackerAdd = hadoopConfigProperties(MAPRED_JT_ADDRESS)
HADOOP_VERSION = 1
JT_HTTP_BASE_URL = "http://" + jobTrackerAdd.substring(0, jobTrackerAdd.indexOf(":")) + port.substring(port.indexOf(":"));
} else {
throw new RuntimeException("Unable to find job tracker location, make sure $HADOOP_CONFIG_DIR or $HADOOP_PREFIX or $HADOOP_HOME is properly configured")
}
}
}
initConfiguration()
}
|
{
"content_hash": "35435053ad6adfdd6e62ba60f00862ca",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 160,
"avg_line_length": 35.46666666666667,
"alnum_prop": 0.6657894736842105,
"repo_name": "danickzhu/commandline-hadoop-job-tracker",
"id": "1721f96b7f6f5a0a961345f640425bbac71902ea",
"size": "3286",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/scala/com/paypal/risk/hadoopjt/util/Constants.scala",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "20093"
},
{
"name": "Scala",
"bytes": "83765"
},
{
"name": "Shell",
"bytes": "1908"
}
]
}
|
var neo4j = require('./src/persistence/neo4j');
neo4j.createNode({ name: 'develop', type: 'branch'}, function(err, branch) {
console.log('Branch ID: ', branch.id);
neo4j.createNode({ hash: '2sai32g9d', type: 'commit'}, function(err, commit) {
console.log('Commit ID: ', commit.id);
commit.createRelationshipTo(branch, 'belongs to', {}, function(err, rel) {
console.log('err: ', err);
});
})
});
|
{
"content_hash": "3d06e8d6864d960f8a1782ea785e6b74",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 80,
"avg_line_length": 32.46153846153846,
"alnum_prop": 0.6279620853080569,
"repo_name": "bripkens/branchflow",
"id": "744b17544ed425f6b0c1dfe3005ac1f22a04d1b1",
"size": "444",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "main.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "57690"
}
]
}
|
package ml.shifu.guagua.mapreduce;
import java.io.IOException;
import ml.shifu.guagua.mapreduce.GuaguaRecordWriter;
import org.apache.hadoop.io.Text;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class GuaguaRecordWriterTest {
private GuaguaRecordWriter writer;
@Before
public void setUp() {
writer = new GuaguaRecordWriter();
}
@Test
public void testClose() {
try {
writer.close(null);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
@Test(expected = RuntimeException.class)
public void testWrite() {
try {
writer.write(new Text(), new Text());
} catch (IOException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
@After
public void tearDown() {
writer = null;
}
}
|
{
"content_hash": "02c45320dd52e1a9957d78e03cd925b1",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 52,
"avg_line_length": 21.448979591836736,
"alnum_prop": 0.6032350142721218,
"repo_name": "ShifuML/guagua",
"id": "746df6c0ec183057f0a12dc20dc53fc712868d15",
"size": "1670",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "guagua-mapreduce/src/test/java/ml/shifu/guagua/mapreduce/GuaguaRecordWriterTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1205426"
},
{
"name": "Shell",
"bytes": "15983"
}
]
}
|
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace DropboxSorter
{
class Program
{
static void Main(string[] args)
{
var UserFolder=Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
string mainFolder = Path.Combine(UserFolder, @"Dropbox\Camera Uploads");
const string mask = @"\d{4}-\d{2}-\d{2} \d{2}\.\d{2}\.\d{2}(-\d)?.jpg";
var re=new Regex(mask);
var directory = new DirectoryInfo(mainFolder);
var files = directory.GetFiles();
var filteredfiles = files.Where(x => re.IsMatch(x.Name));
foreach (var filteredfile in filteredfiles)
{
var date = filteredfile.Name.Substring(0, 10);
const string dateFormat = "yyyy-MM-dd";
var dt =DateTime.ParseExact(date, dateFormat, CultureInfo.CurrentCulture);
var subdir= directory.CreateSubdirectory(dt.ToString(dateFormat));
var newfn = filteredfile.Name.Substring(11);
var fullfn = Path.Combine(subdir.FullName, newfn);
filteredfile.MoveTo(fullfn);
}
}
}
}
|
{
"content_hash": "d52e83e222b921326b8511cc5d1b30b5",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 92,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.6444270015698587,
"repo_name": "UnstableMutex/DropboxCameraUploadsSorter",
"id": "19e746e5093a24adf823b9d8af51ff38a8a80716",
"size": "1276",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DropboxSorter/DropboxSorter/Program.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "12278"
}
]
}
|
module GHCJS.DOM.SVGFitToViewBox (
) where
|
{
"content_hash": "623d23aba2186dd1ea0dbaa225f09db5",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 34,
"avg_line_length": 22.5,
"alnum_prop": 0.7555555555555555,
"repo_name": "manyoo/ghcjs-dom",
"id": "c124b825a68c094cec6e0bf9927cbbd46e12f9d7",
"size": "45",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ghcjs-dom-webkit/src/GHCJS/DOM/SVGFitToViewBox.hs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "90"
},
{
"name": "Haskell",
"bytes": "3948159"
},
{
"name": "JavaScript",
"bytes": "603"
}
]
}
|
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import Table from '../Table'
import getCookie from './getCookie'
export default class DiophantineTest extends Component {
constructor (props) {
super(props)
this.refreshExample()
}
state = {}
refreshExample () {
fetch('http://discrete-eltech.eurodir.ru:8888/test/diophantine?id=' + getCookie('student_id'))
.then(response => response.json())
.then(example => {
console.log(example)
let inputs = ReactDOM.findDOMNode(this).querySelectorAll('input[type="number"]'); // Fuck JavaScript
[].forEach.call(inputs, input => input.value = '')
this.setState(example)
})
.catch(console.error)
}
check () {
let tableNode = ReactDOM.findDOMNode(this).querySelectorAll('.table tr');
let table = [].map.call(tableNode, tr => {
return [].map.call(tr.querySelectorAll('input[type="number"]'), input => {
return input.value !== '' ? parseInt(input.value) : ''
})
})
let output = {
nod : parseInt(this.refs.nod.value),
a : parseInt(this.refs.a1.value),
b : parseInt(this.refs.b1.value),
c : parseInt(this.refs.c1.value),
x : [parseInt(this.refs.x0.value), parseInt(this.refs.x1.value)],
y : [parseInt(this.refs.y0.value), parseInt(this.refs.y1.value)],
}
fetch('http://discrete-eltech.eurodir.ru:8888/test/diophantine/', {
method : 'post',
headers : new Headers({
'Content-Type': 'application/json'
}),
body : JSON.stringify({
input : this.state.input,
table : table,
output : output,
test_id : this.state.test_id,
}),
})
.then(response => response.json())
.then(response => this.setState({
...this.state,
status : response.status,
}))
.catch(console.error)
}
render () {
return (
<div className="content-wrap">
<h1>Решение диофантово уравнения</h1>
<h2>Контроль</h2>
{this.state.input ?
<div>
<p>Решите уравение: {this.state.input[0]}x + {this.state.input[1]}y = {this.state.input[2]}</p>
<div className="answer-area">
НОД ({this.state.input.join(', ')}) =
<div className="input-number-wrap inline">
<input type="number" ref="nod"/>
</div>
</div>
<div className="answer-area">
a1 =
<div className="input-number-wrap inline">
<input type="number" ref="a1"/>
</div>
b1 =
<div className="input-number-wrap inline">
<input type="number" ref="b1"/>
</div>
c1 =
<div className="input-number-wrap inline">
<input type="number" ref="c1"/>
</div>
</div>
<p>Ответ:</p>
<div>
<div className="answer-area">
X =
<div className="input-number-wrap inline">
<input type="number" ref="x0"/>
</div>
+
<div className="input-number-wrap inline">
<input type="number" ref="x1"/>
</div>
t
</div>
<div className="answer-area">
Y =
<div className="input-number-wrap inline">
<input type="number" ref="y0"/>
</div>
+
<div className="input-number-wrap inline">
<input type="number" ref="y1"/>
</div>
t
</div>
</div>
<div className="table">
<Table data={this.state.table.map((row, i) => row.map((col, j) => {
return i == 1 && j < 2 ?
<input type="number" disabled={true}/> :
<input type="number"/>
}))}/>
</div>
<div className="button-wrap">
<button onClick={e => this.check(e)}>Проверить</button>
{this.state.status !== undefined ?
(this.state.status ?
<i className="checker ok"></i> : <i className="checker wrong"></i>
)
: null
}
</div>
</div>
: null
}
</div>
)
}
}
|
{
"content_hash": "48bdcb77702754f80c6cc3e53f300eb4",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 108,
"avg_line_length": 33.67153284671533,
"alnum_prop": 0.4782137437676133,
"repo_name": "discreteMathTool/discretemathtool.github.io",
"id": "9a57f62dfb7223719e2add088b91a2c4a744b7b9",
"size": "4678",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "components/algorithms/DiophantineTest.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5907"
},
{
"name": "HTML",
"bytes": "772"
},
{
"name": "JavaScript",
"bytes": "1563979"
}
]
}
|
package com.github.bjoern2.codegen;
public class JavaAnnotationArgumentImpl implements JavaAnnotationArgument {
private String name;
private Object value;
public JavaAnnotationArgumentImpl() {
super();
}
public JavaAnnotationArgumentImpl(String name, Object value) {
super();
this.name = name;
this.value = value;
}
@Override
public String getName() {
return name;
}
@Override
public void setName(String name) {
this.name = name;
}
@Override
public void setValue(Object value) {
this.value = value;
}
@Override
public Object getValue() {
return value;
}
}
|
{
"content_hash": "0ce27408b0909c8194e20d9f1e869d1a",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 75,
"avg_line_length": 15.763157894736842,
"alnum_prop": 0.7161936560934892,
"repo_name": "Bjoern2/java-codegen",
"id": "f5e8c7d33a2333cbf70b3401c5ffdd655a07f6ed",
"size": "599",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/github/bjoern2/codegen/JavaAnnotationArgumentImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "99208"
}
]
}
|
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.drools</groupId>
<artifactId>drools</artifactId>
<version>7.8.0-SNAPSHOT</version>
</parent>
<artifactId>drools-examples-api</artifactId>
<name>Drools API examples</name>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.drools</groupId>
<artifactId>kiebase-inclusion</artifactId>
<version>${version.org.kie}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>default-kiesession</module>
<module>named-kiesession</module>
<module>kiebase-inclusion</module>
<module>default-kiesession-from-file</module>
<module>named-kiesession-from-file</module>
<module>kie-module-from-multiple-files</module>
<module>kiefilesystem-example</module>
<module>kiemodulemodel-example</module>
<module>kiecontainer-from-kierepo</module>
<module>multiple-kbases</module>
<module>reactive-kiesession</module>
<module>ruleunit</module>
</modules>
</project>
|
{
"content_hash": "78dfc7efe4c04e8c5e90993fe8eb7079",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 108,
"avg_line_length": 31.53488372093023,
"alnum_prop": 0.6865781710914455,
"repo_name": "reynoldsm88/drools",
"id": "532fee9bcece608fd6f1a4605a2d11e7fe6a0015",
"size": "1356",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "drools-examples-api/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "14766"
},
{
"name": "Batchfile",
"bytes": "2554"
},
{
"name": "CSS",
"bytes": "1412"
},
{
"name": "GAP",
"bytes": "197080"
},
{
"name": "HTML",
"bytes": "6832"
},
{
"name": "Java",
"bytes": "27734331"
},
{
"name": "Protocol Buffer",
"bytes": "13855"
},
{
"name": "Python",
"bytes": "4555"
},
{
"name": "Ruby",
"bytes": "491"
},
{
"name": "Shell",
"bytes": "1120"
},
{
"name": "XSLT",
"bytes": "24302"
}
]
}
|
require 'peddler/client'
module MWS
module Recommendations
# The Recommendations API enables you to programmatically retrieve Amazon
# Selling Coach recommendations by recommendation category. A recommendation
# is an actionable, timely, and personalized opportunity to increase your
# sales and performance.
class Client < ::Peddler::Client
self.version = '2013-04-01'
self.path = "/Recommendations/#{version}"
# Checks whether there are active recommendations for each category for
# the given marketplace, and if there are, returns the time when
# recommendations were last updated for each category
#
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_GetLastUpdatedTimeForRecommendations.html
# @param [String] marketplace_id
# @return [Peddler::XMLParser]
def get_last_updated_time_for_recommendations(marketplace_id)
operation('GetLastUpdatedTimeForRecommendations')
.add('MarketplaceId' => marketplace_id)
run
end
# Lists active recommendations for a specific category or for all
# categories for a specific marketplace
#
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_ListRecommendations.html
# @param [String] marketplace_id
# @param [Hash] opts
# @option opts [String] :recommendation_category
# @option opts [Array<Struct, Hash>] :category_query_list
# @return [Peddler::XMLParser]
def list_recommendations(marketplace_id, opts = {})
operation('ListRecommendations')
.add(opts)
.add('MarketplaceId' => marketplace_id)
.structure!(
'CategoryQueryList', 'CategoryQuery', '1', 'FilterOptions',
'FilterOption'
)
run
end
# Lists the next page of active recommendations
#
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_ListRecommendationsByNextToken.html
# @param [String] next_token
# @return [Peddler::XMLParser]
def list_recommendations_by_next_token(next_token)
operation('ListRecommendationsByNextToken')
.add('NextToken' => next_token)
run
end
# Gets the service status of the API
#
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_GetServiceStatus.html
# @return [Peddler::XMLParser]
def get_service_status
operation('GetServiceStatus')
run
end
end
end
end
|
{
"content_hash": "2602edc9a75f1c130c7ed73a4d55f407",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 134,
"avg_line_length": 37.4,
"alnum_prop": 0.674942704354469,
"repo_name": "hakanensari/peddler",
"id": "143cde615fe5a2b89d35d9ff3dcef0423e512f1a",
"size": "2649",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "lib/mws/recommendations/client.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "157"
},
{
"name": "Ruby",
"bytes": "199653"
}
]
}
|
//
// RHKeyValueStore.h
// KVStoreDemo
//
// Created by ran on 2017/8/16.
// Copyright © 2017年 ran. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef KeyValueStore
#define KeyValueStore [RHKeyValueStore store]
#endif
@interface RHKeyValueStore : NSObject
/**
Database path.
*/
@property (nonatomic, strong, readonly) NSString *path;
/**
Global key value storage instance.
@return store instance
*/
+ (instancetype)store;
/**
Isolation storage.
@param label isolating string
@return store instance
*/
+ (instancetype)storeWithLabel:(NSString *)label;
- (instancetype)init NS_UNAVAILABLE;
/**
Get all keys.
@return key list
*/
- (NSArray<NSString *> *)allKeys;
/**
Get K-V pair count.
@return kv count number
*/
- (NSUInteger)getKVCount;
/**
Clear all data of current table
@return query success or not
*/
- (BOOL)clear;
/**
Get integer value for the specified key, if no data return 0.
@param key key
@return integer value
*/
- (NSInteger)integerForKey:(NSString *)key;
/**
Get integer value for the specified key, if no data return default value.
@param key key
@param defaultValue default result value
@return query success or not
*/
- (NSInteger)integerForKey:(NSString *)key defaultValue:(NSInteger)defaultValue;
/**
Set integer value for the specified key.
@param value integer value
@param key key
@return insert success or not
*/
- (BOOL)setInteger:(NSInteger)value forKey:(NSString *)key;
/**
Get bool value for the specified key, if no data return NO.
@param key key
@return query success or not
*/
- (BOOL)boolForKey:(NSString *)key;
/**
Get bool value for the spcified key, if no data return default value.
@param key key
@param defaultValue default result value
@return query success or not
*/
- (BOOL)boolForKey:(NSString *)key defaultValue:(BOOL)defaultValue;
/**
Set bool value for the specified key.
@param value bool value
@param key key
@return insert success or not
*/
- (BOOL)setBool:(BOOL)value forKey:(NSString *)key;
/**
Get double value for the specified key, if no data return 0.0.
@param key key
@return query success or not
*/
- (double)doubleForKey:(NSString *)key;
/**
Get double value for the spcified key, if no data return default value.
@param key key
@param defaultValue default result value
@return query success or not
*/
- (double)doubleForKey:(NSString *)key defaultValue:(double)defaultValue;
/**
Set double value for the specified key.
@param value double value
@param key key
@return insert success or not
*/
- (BOOL)setDouble:(double)value forKey:(NSString *)key;
/**
Get string value for the specified key, if no data return nil.
@param key key
@return query success or not
*/
- (NSString *)stringForKey:(NSString *)key;
/**
Set string value for the specified key.
@param value string value
@param key key
@return insert success or not
*/
- (BOOL)setString:(NSString *)value forKey:(NSString *)key;
/**
Get JSON decoded object for the specified key.
@param key key
@return json object (dict/array)
*/
- (id)jsonObjectForKey:(NSString *)key;
/**
Set JSON encoded object for the specified key, must transfer object to json object (NSDictionary/NSArray) first.
@param value json object (dict/array)
@param key key
@return insert success or not
*/
- (BOOL)setJsonObject:(id)value forKey:(NSString *)key;
/**
Get object for the specified key.
@param key key
@return result object
*/
- (id)unarchiveObjectForKey:(NSString *)key;
/**
Set object for the spcified key, object class must confirm NSCoding protocol and implement `initWithCoder:` `encodeWithCoder:` methods.
@param value object
@param key key
@return insert success or not
*/
- (BOOL)setArchiveObject:(id)value forKey:(NSString *)key;
@end
|
{
"content_hash": "0e021f88a1eed4571d7f3cf12f7468d2",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 136,
"avg_line_length": 19.989473684210527,
"alnum_prop": 0.7159031068983676,
"repo_name": "Rannie/RHKeyValueStore",
"id": "130cf0a0366d25db8b02c06b6dafccfeefe2e6b6",
"size": "3801",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RHKeyValueStore/RHKeyValueStore.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "8591"
},
{
"name": "Objective-C++",
"bytes": "13878"
},
{
"name": "Ruby",
"bytes": "830"
}
]
}
|
HOST=$1
if [ -z "${HOST}" ]; then
echo "Usage:$0 IP"
exit 1
fi
echo "Remove IP:${HOST} from denyhosts..."
/etc/init.d/denyhosts stop
echo '
/etc/hosts.deny
/var/lib/denyhosts/hosts
/var/lib/denyhosts/hosts-restricted
/var/lib/denyhosts/hosts-root
/var/lib/denyhosts/hosts-valid
/var/lib/denyhosts/users-hosts
' | grep -v "^$" | xargs sed -i "/${HOST}/d"
#iptables -D INPUT -s ${HOST} -p tcp -m tcp --dport 22 -j DROP
echo " done"
/etc/init.d/denyhosts start
|
{
"content_hash": "dcec6a249d8369bc3e3061a32145217a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 62,
"avg_line_length": 23.35,
"alnum_prop": 0.6702355460385439,
"repo_name": "boxcore/shell",
"id": "a9ab8a5d71f1e196e3aa9fb6a3cc6cfd29438350",
"size": "547",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "install-3rd/lnmp1.4/tools/denyhosts_removeip.sh",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "15365"
},
{
"name": "HTML",
"bytes": "3029"
},
{
"name": "PHP",
"bytes": "76413"
},
{
"name": "Python",
"bytes": "33465"
},
{
"name": "Shell",
"bytes": "956715"
}
]
}
|
package com.amazonaws.services.waf.model.waf.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.waf.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* ListRateBasedRulesRequestMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ListRateBasedRulesRequestMarshaller {
private static final MarshallingInfo<String> NEXTMARKER_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("NextMarker").build();
private static final MarshallingInfo<Integer> LIMIT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Limit").build();
private static final ListRateBasedRulesRequestMarshaller instance = new ListRateBasedRulesRequestMarshaller();
public static ListRateBasedRulesRequestMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(ListRateBasedRulesRequest listRateBasedRulesRequest, ProtocolMarshaller protocolMarshaller) {
if (listRateBasedRulesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listRateBasedRulesRequest.getNextMarker(), NEXTMARKER_BINDING);
protocolMarshaller.marshall(listRateBasedRulesRequest.getLimit(), LIMIT_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
|
{
"content_hash": "75e778c47a656f72770ebbca1ba2eed8",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 157,
"avg_line_length": 37.659574468085104,
"alnum_prop": 0.747457627118644,
"repo_name": "aws/aws-sdk-java",
"id": "06249648534af968e2e30b3aa9a73fd991a31f9b",
"size": "2350",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/model/waf/transform/ListRateBasedRulesRequestMarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": []
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace Raging.Toolbox.Extensions
{
// ReSharper disable PossibleMultipleEnumeration
// ReSharper disable once AssignNullToNotNullAttribute
public static class EnumerableExtensions
{
/// <summary>
/// An IEnumerable<T> extension method that queries if the collection is null or empty.
/// </summary>
///
/// <typeparam name="T"> Generic type parameter. </typeparam>
/// <param name="source"> the source enumerable. </param>
///
/// <returns>
/// true if a null or is t>, false if not.
/// </returns>
public static bool IsNullOrEmpty<T>(this IEnumerable<T> source)
{
return source == null || !source.Any();
}
public static bool IsNotNullOrEmpty<T>(this IEnumerable<T> source)
{
return !source.IsNullOrEmpty();
}
/// <summary>
/// An IEnumerable<T> extension method that return an empty collection if null.
/// </summary>
///
/// <typeparam name="T"> Generic type parameter. </typeparam>
/// <param name="source"> the source enumerable. </param>
///
/// <returns>
/// An empty enumerator that allows foreach to be used to process the collection.
/// </returns>
public static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> source)
{
return source ?? Enumerable.Empty<T>();
}
/// <summary>
/// An IEnumerable<T> extension method that applies an operation to all items in this
/// collection.
/// </summary>
///
/// <typeparam name="T"> Generic type parameter. </typeparam>
/// <param name="source"> the source enumerable. </param>
/// <param name="action"> The action. </param>
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T> action)
{
Guard.Null(() => source);
Guard.Null(() => action);
foreach(var item in source) action(item);
return source;
}
/// <summary>
/// An IEnumerable<T> extension method that applies an operation to all items in this
/// collection in parallel.
/// </summary>
///
/// <typeparam name="T"> Generic type parameter. </typeparam>
/// <param name="source"> the source enumerable. </param>
/// <param name="action"> The action. </param>
/// <param name="options"> Options for controlling the operation. </param>
public static IEnumerable<T> ParallelForEach<T>(this IEnumerable<T> source, Action<T> action, ParallelOptions options = null)
{
if(options.IsNull())
Parallel.ForEach(source, action);
else
Parallel.ForEach(source, options, action);
return source;
}
/// <summary>
/// An IEnumerable<string> extension method that joins all strings in the collection to
/// a single separated string.
/// </summary>
///
/// <param name="source"> the source enumerable. </param>
/// <param name="separator"> (Optional) the separator. </param>
///
/// <returns>
/// A string.
/// </returns>
public static string Join(this IEnumerable<string> source, string separator = ",")
{
Guard.Null(() => source);
Guard.NullOrEmpty(() => separator);
return string.Join(separator, source);
}
public static IEnumerable<T> Apply<T>(this IEnumerable<T> source, Action<T> action)
{
Guard.Null(() => source);
Guard.Null(() => action);
foreach (var item in source)
{
action(item);
yield return item;
}
}
public static IEnumerable<TSource> Apply<TSource>(this IEnumerable<TSource> source, Action<TSource, int> action)
{
Guard.Null(() => source);
Guard.Null(() => action);
var i = 0;
foreach (var item in source)
{
action(item, i);
yield return item;
i += 1;
}
}
/// <summary>
/// An IEnumerable<TSource> extension method to order with direction.
/// </summary>
///
/// <typeparam name="TSource">Type of the source.</typeparam>
/// <typeparam name="TKey">Type of the key.</typeparam>
/// <param name="source">the source enumerable.</param>
/// <param name="keySelector">The key selector.</param>
/// <param name="descending">true to descending.</param>
///
/// <returns>
/// An IOrderedEnumerable<TSource>
/// </returns>
public static IOrderedEnumerable<TSource> OrderBy<TSource, TKey>(
this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
bool descending)
{
Guard.Null(() => source);
return descending
? source.OrderByDescending(keySelector)
: source.OrderBy(keySelector);
}
/// <summary>
/// An IQueryable<TSource> extension method to order with direction.
/// </summary>
/// <typeparam name="TSource">Type of the source.</typeparam>
/// <typeparam name="TKey">Type of the key.</typeparam>
/// <param name="source">the source enumerable.</param>
/// <param name="keySelector">The key selector.</param>
/// <param name="descending">true to descending.</param>
/// <returns>
/// An IOrderedEnumerable<TSource>
/// </returns>
public static IOrderedQueryable<TSource> OrderBy<TSource, TKey>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
bool descending)
{
Guard.Null(() => source);
return descending
? source.OrderByDescending(keySelector)
: source.OrderBy(keySelector);
}
/// <summary>
/// An extension method that joins all members of the collection to
/// a single separated string.
/// </summary>
/// <typeparam name="T">A type that overrides the object.ToString() method.</typeparam>
/// <param name="source">The value to act on.</param>
/// <param name="separator">(Optional) the separator. By default, a comma is used.</param>
/// <returns>A string.</returns>
public static string Join<T>(this IEnumerable<T> source, string separator = ",")
{
return string.Join(separator, source);
}
/// <summary>
/// Returns all distinct elements of the given source, where "distinctness"
/// is determined via a projection and the default equality comparer for the projected type.
/// </summary>
/// <remarks>
/// This operator uses deferred execution and streams the results, although
/// a set of already-seen keys is retained. If a key is seen multiple times,
/// only the first element with that key is returned.
/// </remarks>
/// <typeparam name="TSource">Type of the source sequence</typeparam>
/// <typeparam name="TKey">Type of the projected element</typeparam>
/// <param name="source">Source sequence</param>
/// <param name="keySelector">Projection for determining "distinctness"</param>
/// <returns>
/// A sequence consisting of distinct elements from the source sequence,
/// comparing them by the specified key projection.
/// </returns>
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector)
{
return source.DistinctBy(keySelector, null);
}
/// <summary>
/// Returns all distinct elements of the given source, where "distinctness"
/// is determined via a projection and the specified comparer for the projected type.
/// </summary>
/// <remarks>
/// This operator uses deferred execution and streams the results, although
/// a set of already-seen keys is retained. If a key is seen multiple times,
/// only the first element with that key is returned.
/// </remarks>
/// <typeparam name="TSource">Type of the source sequence</typeparam>
/// <typeparam name="TKey">Type of the projected element</typeparam>
/// <param name="source">Source sequence</param>
/// <param name="keySelector">Projection for determining "distinctness"</param>
/// <param name="comparer">
/// The equality comparer to use to determine whether or not keys are equal.
/// If null, the default equality comparer for <c>TSource</c> is used.
/// </param>
/// <returns>
/// A sequence consisting of distinct elements from the source sequence,
/// comparing them by the specified key projection.
/// </returns>
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(
this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer)
{
Guard.Null(() => source, source);
Guard.Null(() => keySelector, keySelector);
return DistinctByImpl(source, keySelector, comparer);
}
private static IEnumerable<TSource> DistinctByImpl<TSource, TKey>(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer)
{
var knownKeys = new HashSet<TKey>(comparer);
return source.Where(element => knownKeys.Add(keySelector(element)));
}
}
}
|
{
"content_hash": "6457bb7f61e4332289261ce061f0ef47",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 133,
"avg_line_length": 40.325490196078434,
"alnum_prop": 0.5681221433433823,
"repo_name": "RagingKore/Raging.Toolbox",
"id": "649e3bdc36f725082f495df44820c7e976bdea32",
"size": "10283",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Raging.Toolbox/Extensions/EnumerableExtensions.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "240877"
}
]
}
|
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
{
"content_hash": "4f69404b8c229a912defd37cc7568ebf",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 60,
"avg_line_length": 16.857142857142858,
"alnum_prop": 0.7796610169491526,
"repo_name": "lishiyong-github/DistOpenFile",
"id": "e7b8e4a86846babdc75e8d69f5881225662b680f",
"size": "282",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FileView/AppDelegate.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "31919"
},
{
"name": "Ruby",
"bytes": "699"
}
]
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_202-ea) on Tue Mar 05 23:06:09 NZDT 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>io.ebean.text.csv (ebean 11.35.3 API)</title>
<meta name="date" content="2019-03-05">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="io.ebean.text.csv (ebean 11.35.3 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../io/ebean/text/package-summary.html">Prev Package</a></li>
<li><a href="../../../../io/ebean/text/json/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?io/ebean/text/csv/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package io.ebean.text.csv</h1>
<div class="docSummary">
<div class="block">CSV processing objects.</div>
</div>
<p>See: <a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../io/ebean/text/csv/CsvCallback.html" title="interface in io.ebean.text.csv">CsvCallback</a><T></td>
<td class="colLast">
<div class="block">Provides callback methods for customisation of CSV processing.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../io/ebean/text/csv/CsvReader.html" title="interface in io.ebean.text.csv">CsvReader</a><T></td>
<td class="colLast">
<div class="block">Reads CSV data turning it into object graphs that you can be saved (inserted)
or processed yourself.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../io/ebean/text/csv/DefaultCsvCallback.html" title="class in io.ebean.text.csv">DefaultCsvCallback</a><T></td>
<td class="colLast">
<div class="block">Provides the default implementation of CsvCallback.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!-- -->
</a>
<h2 title="Package io.ebean.text.csv Description">Package io.ebean.text.csv Description</h2>
<div class="block">CSV processing objects.</div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../io/ebean/text/package-summary.html">Prev Package</a></li>
<li><a href="../../../../io/ebean/text/json/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?io/ebean/text/csv/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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>Copyright © 2019. All rights reserved.</small></p>
</body>
</html>
|
{
"content_hash": "4fc3c2b3919d75022a3bf19e84c5a04f",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 156,
"avg_line_length": 35.798882681564244,
"alnum_prop": 0.6359238451935081,
"repo_name": "ebean-orm/ebean-orm.github.io",
"id": "2ee309ec13dbdb4c172bbc4f388342a8553938e3",
"size": "6408",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "apidoc/11/io/ebean/text/csv/package-summary.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "133613"
},
{
"name": "HTML",
"bytes": "49047496"
},
{
"name": "Java",
"bytes": "2615"
},
{
"name": "JavaScript",
"bytes": "74774"
},
{
"name": "Kotlin",
"bytes": "1347"
},
{
"name": "Shell",
"bytes": "1829"
}
]
}
|
package tests.i1814;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
import io.jooby.apt.MvcModuleCompilerRunner;
import io.jooby.test.MockContext;
import io.jooby.test.MockRouter;
public class Issue1814 {
@Test
public void shouldIgnoreWildcardResponseType() throws Exception {
new MvcModuleCompilerRunner(new C1814())
.example(Expected1814.class)
.module(
app -> {
MockRouter router = new MockRouter(app);
MockContext ctx = new MockContext();
ctx.setQueryString("?type=foo");
assertEquals("[foo]", router.get("/1814", ctx).value().toString());
});
}
}
|
{
"content_hash": "4c3342bc3967f4fef7cd777242f5e475",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 81,
"avg_line_length": 27.423076923076923,
"alnum_prop": 0.6549789621318373,
"repo_name": "jooby-project/jooby",
"id": "a400d3f85fa8dff7c73eb237330bc67267ad02b4",
"size": "835",
"binary": false,
"copies": "1",
"ref": "refs/heads/3.x",
"path": "modules/jooby-apt/src/test/java/tests/i1814/Issue1814.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "1046"
},
{
"name": "FreeMarker",
"bytes": "108"
},
{
"name": "Groovy",
"bytes": "1901"
},
{
"name": "HTML",
"bytes": "6645"
},
{
"name": "Handlebars",
"bytes": "13085"
},
{
"name": "Java",
"bytes": "2938794"
},
{
"name": "Kotlin",
"bytes": "49172"
},
{
"name": "PHP",
"bytes": "16878"
},
{
"name": "Shell",
"bytes": "1096"
}
]
}
|
package org.apache.beam.runners.flink.translation.functions;
import static org.apache.beam.runners.core.construction.PTransformTranslation.PAR_DO_TRANSFORM_URN;
import static org.hamcrest.Matchers.is;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import org.apache.beam.model.pipeline.v1.RunnerApi;
import org.apache.beam.model.pipeline.v1.RunnerApi.Components;
import org.apache.beam.model.pipeline.v1.RunnerApi.ExecutableStagePayload;
import org.apache.beam.model.pipeline.v1.RunnerApi.PCollection;
import org.apache.beam.runners.fnexecution.control.BundleProgressHandler;
import org.apache.beam.runners.fnexecution.control.ExecutableStageContext;
import org.apache.beam.runners.fnexecution.control.OutputReceiverFactory;
import org.apache.beam.runners.fnexecution.control.ProcessBundleDescriptors;
import org.apache.beam.runners.fnexecution.control.RemoteBundle;
import org.apache.beam.runners.fnexecution.control.StageBundleFactory;
import org.apache.beam.runners.fnexecution.provisioning.JobInfo;
import org.apache.beam.runners.fnexecution.state.StateRequestHandler;
import org.apache.beam.sdk.fn.data.FnDataReceiver;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.apache.beam.sdk.transforms.join.RawUnionValue;
import org.apache.beam.sdk.util.WindowedValue;
import org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.Struct;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap;
import org.apache.flink.api.common.cache.DistributedCache;
import org.apache.flink.api.common.functions.RuntimeContext;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.util.Collector;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.powermock.reflect.Whitebox;
/** Tests for {@link FlinkExecutableStageFunction}. */
@RunWith(Parameterized.class)
public class FlinkExecutableStageFunctionTest {
@Parameterized.Parameters
public static Object[] data() {
return new Object[] {true, false};
}
@Parameterized.Parameter public boolean isStateful;
@Rule public ExpectedException thrown = ExpectedException.none();
@Mock private RuntimeContext runtimeContext;
@Mock private DistributedCache distributedCache;
@Mock private Collector<RawUnionValue> collector;
@Mock private ExecutableStageContext stageContext;
@Mock private StageBundleFactory stageBundleFactory;
@Mock private StateRequestHandler stateRequestHandler;
@Mock private ProcessBundleDescriptors.ExecutableProcessBundleDescriptor processBundleDescriptor;
// NOTE: ExecutableStage.fromPayload expects exactly one input, so we provide one here. These unit
// tests in general ignore the executable stage itself and mock around it.
private final ExecutableStagePayload stagePayload =
ExecutableStagePayload.newBuilder()
.setInput("input")
.setComponents(
Components.newBuilder()
.putTransforms(
"transform",
RunnerApi.PTransform.newBuilder()
.putInputs("bla", "input")
.setSpec(RunnerApi.FunctionSpec.newBuilder().setUrn(PAR_DO_TRANSFORM_URN))
.build())
.putPcollections("input", PCollection.getDefaultInstance())
.build())
.addUserStates(
ExecutableStagePayload.UserStateId.newBuilder().setTransformId("transform").build())
.build();
private final JobInfo jobInfo =
JobInfo.create("job-id", "job-name", "retrieval-token", Struct.getDefaultInstance());
@Before
public void setUpMocks() throws Exception {
MockitoAnnotations.initMocks(this);
when(runtimeContext.getDistributedCache()).thenReturn(distributedCache);
when(stageContext.getStageBundleFactory(any())).thenReturn(stageBundleFactory);
RemoteBundle remoteBundle = Mockito.mock(RemoteBundle.class);
when(stageBundleFactory.getBundle(any(), any(), any())).thenReturn(remoteBundle);
ImmutableMap input =
ImmutableMap.builder().put("input", Mockito.mock(FnDataReceiver.class)).build();
when(remoteBundle.getInputReceivers()).thenReturn(input);
when(processBundleDescriptor.getTimerSpecs()).thenReturn(Collections.emptyMap());
}
@Test
public void sdkErrorsSurfaceOnClose() throws Exception {
FlinkExecutableStageFunction<Integer> function = getFunction(Collections.emptyMap());
function.open(new Configuration());
@SuppressWarnings("unchecked")
RemoteBundle bundle = Mockito.mock(RemoteBundle.class);
when(stageBundleFactory.getBundle(any(), any(), any())).thenReturn(bundle);
@SuppressWarnings("unchecked")
FnDataReceiver<WindowedValue<?>> receiver = Mockito.mock(FnDataReceiver.class);
when(bundle.getInputReceivers()).thenReturn(ImmutableMap.of("input", receiver));
Exception expected = new Exception();
doThrow(expected).when(bundle).close();
thrown.expect(is(expected));
function.mapPartition(Collections.emptyList(), collector);
}
@Test
public void expectedInputsAreSent() throws Exception {
FlinkExecutableStageFunction<Integer> function = getFunction(Collections.emptyMap());
function.open(new Configuration());
@SuppressWarnings("unchecked")
RemoteBundle bundle = Mockito.mock(RemoteBundle.class);
when(stageBundleFactory.getBundle(any(), any(), any())).thenReturn(bundle);
@SuppressWarnings("unchecked")
FnDataReceiver<WindowedValue<?>> receiver = Mockito.mock(FnDataReceiver.class);
when(bundle.getInputReceivers()).thenReturn(ImmutableMap.of("input", receiver));
WindowedValue<Integer> one = WindowedValue.valueInGlobalWindow(1);
WindowedValue<Integer> two = WindowedValue.valueInGlobalWindow(2);
WindowedValue<Integer> three = WindowedValue.valueInGlobalWindow(3);
function.mapPartition(Arrays.asList(one, two, three), collector);
verify(receiver).accept(one);
verify(receiver).accept(two);
verify(receiver).accept(three);
verifyNoMoreInteractions(receiver);
}
@Test
public void outputsAreTaggedCorrectly() throws Exception {
WindowedValue<Integer> three = WindowedValue.valueInGlobalWindow(3);
WindowedValue<Integer> four = WindowedValue.valueInGlobalWindow(4);
WindowedValue<Integer> five = WindowedValue.valueInGlobalWindow(5);
Map<String, Integer> outputTagMap =
ImmutableMap.of(
"one", 1,
"two", 2,
"three", 3);
// We use a real StageBundleFactory here in order to exercise the output receiver factory.
StageBundleFactory stageBundleFactory =
new StageBundleFactory() {
private boolean once;
@Override
public RemoteBundle getBundle(
OutputReceiverFactory receiverFactory,
StateRequestHandler stateRequestHandler,
BundleProgressHandler progressHandler) {
return new RemoteBundle() {
@Override
public String getId() {
return "bundle-id";
}
@Override
public Map<String, FnDataReceiver> getInputReceivers() {
return ImmutableMap.of(
"input",
input -> {
/* Ignore input*/
});
}
@Override
public void close() throws Exception {
if (once) {
return;
}
// Emit all values to the runner when the bundle is closed.
receiverFactory.create("one").accept(three);
receiverFactory.create("two").accept(four);
receiverFactory.create("three").accept(five);
once = true;
}
};
}
@Override
public ProcessBundleDescriptors.ExecutableProcessBundleDescriptor
getProcessBundleDescriptor() {
return processBundleDescriptor;
}
@Override
public void close() throws Exception {}
};
// Wire the stage bundle factory into our context.
when(stageContext.getStageBundleFactory(any())).thenReturn(stageBundleFactory);
FlinkExecutableStageFunction<Integer> function = getFunction(outputTagMap);
function.open(new Configuration());
if (isStateful) {
function.reduce(Collections.emptyList(), collector);
} else {
function.mapPartition(Collections.emptyList(), collector);
}
// Ensure that the tagged values sent to the collector have the correct union tags as specified
// in the output map.
verify(collector).collect(new RawUnionValue(1, three));
verify(collector).collect(new RawUnionValue(2, four));
verify(collector).collect(new RawUnionValue(3, five));
verifyNoMoreInteractions(collector);
}
@Test
public void testStageBundleClosed() throws Exception {
FlinkExecutableStageFunction<Integer> function = getFunction(Collections.emptyMap());
function.open(new Configuration());
function.close();
verify(stageBundleFactory).getProcessBundleDescriptor();
verify(stageBundleFactory).close();
verifyNoMoreInteractions(stageBundleFactory);
}
/**
* Creates a {@link FlinkExecutableStageFunction}. Sets the runtime context to {@link
* #runtimeContext}. The context factory is mocked to return {@link #stageContext} every time. The
* behavior of the stage context itself is unchanged.
*/
private FlinkExecutableStageFunction<Integer> getFunction(Map<String, Integer> outputMap) {
FlinkExecutableStageContextFactory contextFactory =
Mockito.mock(FlinkExecutableStageContextFactory.class);
when(contextFactory.get(any())).thenReturn(stageContext);
FlinkExecutableStageFunction<Integer> function =
new FlinkExecutableStageFunction<>(
"step",
PipelineOptionsFactory.create(),
stagePayload,
jobInfo,
outputMap,
contextFactory,
null);
function.setRuntimeContext(runtimeContext);
Whitebox.setInternalState(function, "stateRequestHandler", stateRequestHandler);
return function;
}
}
|
{
"content_hash": "aaef24363aedc3bde812861e56e850e6",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 100,
"avg_line_length": 41.60700389105058,
"alnum_prop": 0.712335172542785,
"repo_name": "RyanSkraba/beam",
"id": "93f7cd2bcaa5ada6933c669b33678840dc9c70eb",
"size": "11498",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "runners/flink/src/test/java/org/apache/beam/runners/flink/translation/functions/FlinkExecutableStageFunctionTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "1597"
},
{
"name": "CSS",
"bytes": "40963"
},
{
"name": "Dockerfile",
"bytes": "16638"
},
{
"name": "FreeMarker",
"bytes": "7428"
},
{
"name": "Go",
"bytes": "2683402"
},
{
"name": "Groovy",
"bytes": "517560"
},
{
"name": "HTML",
"bytes": "183330"
},
{
"name": "Java",
"bytes": "28609011"
},
{
"name": "JavaScript",
"bytes": "16595"
},
{
"name": "Jupyter Notebook",
"bytes": "56365"
},
{
"name": "Python",
"bytes": "6191025"
},
{
"name": "Ruby",
"bytes": "4159"
},
{
"name": "Shell",
"bytes": "235061"
},
{
"name": "TSQL",
"bytes": "841"
}
]
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>interval: 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.8.2 / interval - 3.2.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
interval
<small>
3.2.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-13 00:33:15 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-13 00:33:15 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.8.2 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.03.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.03.0 Official 4.03.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "guillaume.melquiond@inria.fr"
homepage: "https://coqinterval.gitlabpages.inria.fr/"
dev-repo: "git+https://gitlab.inria.fr/coqinterval/interval.git"
bug-reports: "https://gitlab.inria.fr/coqinterval/interval/issues"
license: "CeCILL-C"
build: [
["./configure"]
["./remake" "-j%{jobs}%"]
]
install: ["./remake" "install"]
depends: [
"coq" {>= "8.5" & < "8.7"}
"coq-flocq" {>= "2.5.0" & < "3.0~"}
"coq-mathcomp-ssreflect" {>= "1.6"}
"coq-coquelicot" {>= "3.0"}
]
tags: [
"keyword:interval arithmetic"
"keyword:decision procedure"
"keyword:floating-point arithmetic"
"keyword:reflexive tactic"
"keyword:Taylor models"
"category:Mathematics/Real Calculus and Topology"
"category:Computer Science/Decision Procedures and Certified Algorithms/Decision procedures"
]
authors: [ "Guillaume Melquiond <guillaume.melquiond@inria.fr>" ]
synopsis: "A Coq tactic for proving bounds on real-valued expressions automatically"
url {
src: "https://coqinterval.gitlabpages.inria.fr/releases/interval-3.2.0.tar.gz"
checksum: "md5=19aabc38a870036eaf5a07149b4c0565"
}
</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-interval.3.2.0 coq.8.8.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.8.2).
The following dependencies couldn't be met:
- coq-interval -> coq < 8.7 -> ocaml < 4.03.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-interval.3.2.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": "1c75c5e10d38f004dcf21a45dd805a8b",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 159,
"avg_line_length": 41.651428571428575,
"alnum_prop": 0.5494580875291535,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "02a88a7cb3afd2f38f162847790211b2abfb86f2",
"size": "7314",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.03.0-2.0.5/released/8.8.2/interval/3.2.0.html",
"mode": "33188",
"license": "mit",
"language": []
}
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tmrm = require("azure-pipelines-task-lib/mock-run");
const path = require("path");
const mocks = require("./mockWebApi");
let rootDir = path.join(__dirname, '../../Tasks', 'TagBuild');
let taskPath = path.join(rootDir, 'tagBuild.js');
let tmr = new tmrm.TaskMockRunner(taskPath);
tmr.registerMock('azure-devops-node-api/WebApi', mocks.MockWebApi);
// set variables
process.env["SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"] = "http://localhost:8080/tfs/defaultcollection";
process.env["SYSTEM_TEAMPROJECT"] = "demo";
process.env["BUILD_BUILDID"] = "1";
process.env["RELEAS_RELEASEID"] = "22";
process.env["SYSTEM_ACCESSTOKEN"] = "faketoken";
// set inputs
tmr.setInput('tags', 'tag1');
tmr.setInput('type', 'Build');
tmr.run();
// need setTimeout because of async methods
setTimeout(() => {
if ("demo" !== mocks.MockWebApi.taggerCall.project ||
"Build" !== mocks.MockWebApi.taggerCall.callType ||
1 !== mocks.MockWebApi.taggerCall.id ||
!mocks.MockWebApi.taggerCall.tags.some(t => t === "tag1") ||
mocks.MockWebApi.taggerCall.tags.length !== 1) {
console.log(mocks.MockWebApi.taggerCall);
console.error("Tagging failed.");
}
else {
console.log("Tagging successful!");
}
}, 100);
//# sourceMappingURL=test-tagBuildFromRelease-succeeds.js.map
|
{
"content_hash": "43983a943c6ee7cc2ea53d2c7dcce3d1",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 98,
"avg_line_length": 40.76470588235294,
"alnum_prop": 0.6782106782106783,
"repo_name": "colindembovsky/cols-agent-tasks",
"id": "654827ffbd3fbf60ce3ec622452976fda0719431",
"size": "1386",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "test/tagBuild/test-tagBuildFromRelease-succeeds.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "348"
},
{
"name": "Dockerfile",
"bytes": "1069"
},
{
"name": "PowerShell",
"bytes": "186636"
},
{
"name": "Shell",
"bytes": "695"
},
{
"name": "TypeScript",
"bytes": "146174"
},
{
"name": "XSLT",
"bytes": "2099"
}
]
}
|
<?php
return array (
'<b>Nobody wrote something yet.</b><br>Make the beginning and post something...' => '<b>Ещё никто ничего не написал.</b><br>Начните первым...',
'<b>There are no profile posts yet!</b>' => '<b>Сообщений в профиле пока нет!</b>',
);
|
{
"content_hash": "5b0da1239614c7957da36341d15dbd6a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 145,
"avg_line_length": 51.2,
"alnum_prop": 0.6484375,
"repo_name": "calonso-conabio/intranet",
"id": "ee4f7b85ce8442bdcb7cb72d737ae9796d64767d",
"size": "316",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "protected/humhub/modules/directory/messages/ru/views_directory_userPosts.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "13"
},
{
"name": "Batchfile",
"bytes": "1410"
},
{
"name": "CSS",
"bytes": "215052"
},
{
"name": "HTML",
"bytes": "31712"
},
{
"name": "JavaScript",
"bytes": "657426"
},
{
"name": "PHP",
"bytes": "13097099"
},
{
"name": "Shell",
"bytes": "179"
}
]
}
|
"""
Django settings for test_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import sys
from django.conf import global_settings
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# add apps to path
sys.path.insert(0, os.path.join(BASE_DIR, 'apps'))
# add wpadmin to path
sys.path.insert(0, os.path.join(BASE_DIR, '..'))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '&478os2g_tt5g!e+wqgs5h8#-u8ydqhkohnc6u&*yxg9cu@rm5'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
# Django WP Admin must be before django.contrib.admin
'wpadmin',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'authors',
'books',
'cds',
'dvds',
'test_app',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'test_project.urls'
WSGI_APPLICATION = 'test_project.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'files/static-collected/')
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),
)
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
'django.core.context_processors.request',
)
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
WPADMIN = {
'adminpanel': {
'admin_site': 'test_project.admin.admin',
'title': 'Django admin panel',
'menu': {
'top': 'wpadmin.menu.menus.BasicTopMenu',
'left': 'wpadmin.menu.menus.BasicLeftMenu',
},
'dashboard': {
'breadcrumbs': True,
},
'custom_style': STATIC_URL + 'wpadmin/css/themes/sunrise.css',
},
'userpanel': {
'admin_site': 'test_project.admin.user',
'title': 'Django user panel',
'menu': {
'top': 'test_project.wp.UserTopMenu',
'left': 'test_project.wp.UserLeftMenu',
},
'dashboard': {
'breadcrumbs': False,
},
'custom_style': STATIC_URL + 'wpadmin/css/themes/ocean.css',
},
}
|
{
"content_hash": "0d58823044e25486bd7fa0eb44b48c5c",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 77,
"avg_line_length": 24.683098591549296,
"alnum_prop": 0.6679029957203995,
"repo_name": "vstoykov/django-wpadmin",
"id": "1a15cc208101276d296b316281fb3dcf9bce6694",
"size": "3505",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test_project/test_project/settings.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "49106"
},
{
"name": "JavaScript",
"bytes": "5244"
},
{
"name": "Python",
"bytes": "53714"
},
{
"name": "Shell",
"bytes": "551"
}
]
}
|
This application makes use of the following third party libraries:
## SwiftChart
The MIT License (MIT)
Copyright (c) 2014 Giampaolo Bellavite
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Generated by CocoaPods - https://cocoapods.org
|
{
"content_hash": "fc5d97e9227fc234b7513433206a6e45",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 78,
"avg_line_length": 45.074074074074076,
"alnum_prop": 0.8027937551355793,
"repo_name": "gpbl/SwiftChart",
"id": "d43a1501ddd282706148e1b672973a1faef46139",
"size": "1236",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Example/Pods/Target Support Files/Pods-SwiftChart_Example/Pods-SwiftChart_Example-acknowledgements.markdown",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "855"
},
{
"name": "Swift",
"bytes": "42067"
}
]
}
|
package au.com.noojee.acceloapi.entities;
import java.time.LocalDateTime;
import au.com.noojee.acceloapi.entities.meta.fieldTypes.BasicFilterField;
import au.com.noojee.acceloapi.entities.meta.fieldTypes.DateFilterField;
import au.com.noojee.acceloapi.entities.meta.fieldTypes.InsertOnlyField;
import au.com.noojee.acceloapi.entities.meta.fieldTypes.MetaBasicFilterFields;
import au.com.noojee.acceloapi.entities.meta.fieldTypes.SearchFilterField;
public class Contact extends AcceloEntity<Contact>
{
public static final String FIELDS_ALL = "contact._ALL";
@SearchFilterField
private String firstname;
private String middlename;
@SearchFilterField
private String surname;
private String preferred_name;
@BasicFilterField
private String username;
private String password;
@BasicFilterField
private String title;
private String salutation;
private String comments;
@BasicFilterField
private int contact_status;
@BasicFilterField
private String standing;
private int country_id;
private int physical_address_id;
private int postal_address_id;
private String phone;
private String mobile;
private String fax;
@BasicFilterField
@SearchFilterField
private String email;
private int default_affiliation; // id of the contacts affiliation. Will normally be the company they are primarily
// associated with.
private String communication;
private String invoice_method;
@DateFilterField
private LocalDateTime date_created ;
@DateFilterField
private LocalDateTime date_modified ;
@InsertOnlyField
private int company_id; // only used when inserting new contacts. This value is not normally available.
@SuppressWarnings("unused")
private class Meta implements MetaBasicFilterFields
{
@BasicFilterField
private transient String affiliation; // matches on the default_affiliation.
@BasicFilterField
private transient String contact_number; // filters over phone, fax and mobile
}
public String getFirstname()
{
return firstname;
}
public void setFirstname(String firstname)
{
this.firstname = firstname;
}
public String getMiddlename()
{
return middlename;
}
public String getSurname()
{
return surname;
}
public void setSurname(String surname)
{
this.surname = surname;
}
public String getPreferred_name()
{
return preferred_name;
}
public String getUsername()
{
return username;
}
public String getPassword()
{
return password;
}
public String getTitle()
{
return title;
}
public String getSalutation()
{
return salutation;
}
public String getComments()
{
return comments;
}
public void setComments(String comments)
{
this.comments = comments;
}
public int getStatus()
{
return contact_status;
}
public String getStanding()
{
return standing;
}
public int getCountryId()
{
return country_id;
}
public int getPhysicalAddressId()
{
return physical_address_id;
}
public int getPostalAddressId()
{
return postal_address_id;
}
public String getPhone()
{
return phone;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getMobile()
{
return mobile;
}
public void setMobile(String mobile)
{
this.mobile = mobile;
}
public String getFax()
{
return fax;
}
public String getEmail()
{
return email;
}
public void setEmail(String email)
{
this.email = email;
}
public String getCommunication()
{
return communication;
}
public String getInvoice_method()
{
return invoice_method;
}
public int getDefaultAffiliation()
{
return default_affiliation;
}
public void setDefaultAffiliation(int affiliationId)
{
this.default_affiliation = affiliationId;
}
/**
* You can only set this if you are inserting a new contact.
* At all other times the value is meaningless.
*
* @param company_id
*/
public void setCompanyId(Integer company_id)
{
this.company_id = (company_id == null ? 0 : company_id);
}
@Override
public String toString()
{
return "Contact [id=" + getId() + ", firstname=" + firstname + ", middlename=" + middlename
+ ", surname=" + surname + ", preferred_name=" + preferred_name + ", username=" + username
+ ", password=" + password + ", title=" + title + ", salutation=" + salutation + ", comments="
+ comments + ", contact_status=" + contact_status + ", standing=" + standing + ", country_id=" + country_id
+ ", physical_address_id=" + physical_address_id + ", postal_address_id=" + postal_address_id
+ ", phone=" + phone + ", fax=" + fax + ", email=" + email
+ ", communication=" + communication + ", invoice_method=" + invoice_method + "]";
}
public String getFullName()
{
return firstname + " " + surname;
}
@Override
public int compareTo(Contact o)
{
return this.getSurname().compareTo(o.getSurname());
}
}
|
{
"content_hash": "f53fdd24ec1e56686ebdff44c364e0b8",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 116,
"avg_line_length": 19.811475409836067,
"alnum_prop": 0.7157633429871741,
"repo_name": "bsutton/acceloapi",
"id": "9700fe751be5d8114083b48ea99c716bbb349a61",
"size": "4834",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/au/com/noojee/acceloapi/entities/Contact.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "302740"
}
]
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vim中文手册</title>
<meta name="description" content="vim8.0 中文帮助文档">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="vim.css" type="text/css">
</head>
<body>
<header class="site-header">
<div class="wrap">
<div class="site-title"><a href="/vim-zh/usr_toc.html">Vim中文手册</a></div>
<div class="site-description">{"type":"documentation"}</div>
</div>
</header>
<div class="page-content">
<div class="wrap">
<h2 class="vim-chapter">Vim documentation: howto</h2>
<div class="vim-document">
<div class="pre">
译者: iCrazy <icrazy@ustc.edu> <span class="String"><a href="http://vimcdoc.sf.net">http://vimcdoc.sf.net</a></span>
如何…… <span class="Ignore">*</span><span id="howdoi" class="String anchor">howdoi</span><span class="Ignore">*</span> <span class="Ignore">*</span><span id="how-do-i" class="String anchor">how-do-i</span><span class="Ignore">*</span> <span class="Ignore">*</span><span id="howto" class="String anchor">howto</span><span class="Ignore">*</span> <span class="Ignore">*</span><span id="how-to" class="String anchor">how-to</span><span class="Ignore">*</span>
<span class="Ignore">|</span><a href="usr_01.html#tutor"><span class="Identifier">tutor</span></a><span class="Ignore">|</span> 入门
<span class="Ignore">|</span><span class="Identifier">:quit</span><span class="Ignore">|</span> 退出?我被困住了,请帮帮我!
<span class="Ignore">|</span><a href="starting.html#initialization"><span class="Identifier">initialization</span></a><span class="Ignore">|</span> 初始化 Vim
<span class="Ignore">|</span><a href="usr_05.html#vimrc-intro"><span class="Identifier">vimrc-intro</span></a><span class="Ignore">|</span> 写一个 Vim 脚本文件 (vimrc)
<span class="Ignore">|</span><a href="starting.html#suspend"><span class="Identifier">suspend</span></a><span class="Ignore">|</span> 挂起 Vim
<span class="Ignore">|</span><a href="usr_11.html#usr_11.txt"><span class="Identifier">usr_11.txt</span></a><span class="Ignore">|</span> 在一次崩溃后恢复
<span class="Ignore">|</span><a href="usr_07.html#07.4"><span class="Identifier">07.4</span></a><span class="Ignore">|</span> 在覆盖我的文件时保留一个备份
<span class="Ignore">|</span><a href="usr_07.html#usr_07.txt"><span class="Identifier">usr_07.txt</span></a><span class="Ignore">|</span> 编辑文件
<span class="Ignore">|</span><a href="usr_23.html#23.4"><span class="Identifier">23.4</span></a><span class="Ignore">|</span> 编辑二进制文件
<span class="Ignore">|</span><a href="usr_24.html#usr_24.txt"><span class="Identifier">usr_24.txt</span></a><span class="Ignore">|</span> 插入文本
<span class="Ignore">|</span><a href="change.html#deleting"><span class="Identifier">deleting</span></a><span class="Ignore">|</span> 删除文本
<span class="Ignore">|</span><a href="usr_04.html#usr_04.txt"><span class="Identifier">usr_04.txt</span></a><span class="Ignore">|</span> 改变文本
<span class="Ignore">|</span><a href="usr_04.html#04.5"><span class="Identifier">04.5</span></a><span class="Ignore">|</span> 复制和移动文本
<span class="Ignore">|</span><a href="usr_25.html#usr_25.txt"><span class="Identifier">usr_25.txt</span></a><span class="Ignore">|</span> 给文本排版
<span class="Ignore">|</span><a href="usr_30.html#30.6"><span class="Identifier">30.6</span></a><span class="Ignore">|</span> 给注释排版
<span class="Ignore">|</span><a href="usr_30.html#30.2"><span class="Identifier">30.2</span></a><span class="Ignore">|</span> 缩进 C 程序
<span class="Ignore">|</span><a href="usr_25.html#25.3"><span class="Identifier">25.3</span></a><span class="Ignore">|</span> 自动设置缩进
<span class="Ignore">|</span><a href="usr_26.html#usr_26.txt"><span class="Identifier">usr_26.txt</span></a><span class="Ignore">|</span> 重复执行命令
<span class="Ignore">|</span><a href="usr_02.html#02.5"><span class="Identifier">02.5</span></a><span class="Ignore">|</span> 撤销和重做
<span class="Ignore">|</span><a href="usr_03.html#usr_03.txt"><span class="Identifier">usr_03.txt</span></a><span class="Ignore">|</span> 在文本中移动
<span class="Ignore">|</span><a href="motion.html#word-motions"><span class="Identifier">word-motions</span></a><span class="Ignore">|</span> 基于单词的移动
<span class="Ignore">|</span><a href="motion.html#left-right-motions"><span class="Identifier">left-right-motions</span></a><span class="Ignore">|</span> 左右移动
<span class="Ignore">|</span><a href="motion.html#up-down-motions"><span class="Identifier">up-down-motions</span></a><span class="Ignore">|</span> 上下移动
<span class="Ignore">|</span><a href="motion.html#object-motions"><span class="Identifier">object-motions</span></a><span class="Ignore">|</span> 基于文本对象的移动
<span class="Ignore">|</span><a href="motion.html#various-motions"><span class="Identifier">various-motions</span></a><span class="Ignore">|</span> 其它移动方式
<span class="Ignore">|</span><a href="motion.html#object-select"><span class="Identifier">object-select</span></a><span class="Ignore">|</span> 基于文本对象的选择
<span class="Ignore">|</span><span class="Identifier">'whichwrap'</span><span class="Ignore">|</span> 移动时跳过换行符
<span class="Ignore">|</span><span class="Identifier">'virtualedit'</span><span class="Ignore">|</span> 移动到没有文本的地方
<span class="Ignore">|</span><a href="usr_27.html#usr_27.txt"><span class="Identifier">usr_27.txt</span></a><span class="Ignore">|</span> 指定查找的模式
<span class="Ignore">|</span><a href="tagsrch.html#tags-and-searches"><span class="Identifier">tags-and-searches</span></a><span class="Ignore">|</span> 进行标签和特殊查找
<span class="Ignore">|</span><a href="usr_29.html#29.4"><span class="Identifier">29.4</span></a><span class="Ignore">|</span> 在包含文件中查找变量、函数或宏
<span class="Ignore">|</span><span class="Identifier">K</span><span class="Ignore">|</span> 查找光标处关键词的手册页
<span class="Ignore">|</span><a href="usr_03.html#03.7"><span class="Identifier">03.7</span></a><span class="Ignore">|</span> 滚屏
<span class="Ignore">|</span><span class="Identifier">'sidescroll'</span><span class="Ignore">|</span> 水平/竖直方向滚屏
<span class="Ignore">|</span><span class="Identifier">'scrolloff'</span><span class="Ignore">|</span> 设置可见的上下文行数
<span class="Ignore">|</span><a href="intro.html#mode-switching"><span class="Identifier">mode-switching</span></a><span class="Ignore">|</span> 切换模式
<span class="Ignore">|</span><a href="usr_04.html#04.4"><span class="Identifier">04.4</span></a><span class="Ignore">|</span> 使用可视模式
<span class="Ignore">|</span><span class="Identifier">'insertmode'</span><span class="Ignore">|</span> 以插入模式启动 Vim
<span class="Ignore">|</span><a href="usr_40.html#40.1"><span class="Identifier">40.1</span></a><span class="Ignore">|</span> 映射热键
<span class="Ignore">|</span><a href="usr_24.html#24.7"><span class="Identifier">24.7</span></a><span class="Ignore">|</span> 创建缩写
<span class="Ignore">|</span><a href="insert.html#ins-expandtab"><span class="Identifier">ins-expandtab</span></a><span class="Ignore">|</span> 在插入模式下用空格扩展制表符
<span class="Ignore">|</span><a href="insert.html#i_CTRL-R"><span class="Identifier">i_CTRL-R</span></a><span class="Ignore">|</span> 在插入模式下插入寄存器的内容
<span class="Ignore">|</span><a href="usr_24.html#24.3"><span class="Identifier">24.3</span></a><span class="Ignore">|</span> 在插入模式下自动补全单词
<span class="Ignore">|</span><a href="usr_25.html#25.1"><span class="Identifier">25.1</span></a><span class="Ignore">|</span> 断开过长的行
<span class="Ignore">|</span><a href="usr_20.html#20.1"><span class="Identifier">20.1</span></a><span class="Ignore">|</span> 编辑命令行
<span class="Ignore">|</span><a href="usr_20.html#20.3"><span class="Identifier">20.3</span></a><span class="Ignore">|</span> 命令行自动补全
<span class="Ignore">|</span><span class="Identifier">'cmdheight'</span><span class="Ignore">|</span> 增加命令行的高度
<span class="Ignore">|</span><a href="usr_10.html#10.3"><span class="Identifier">10.3</span></a><span class="Ignore">|</span> 指定命令行范围
<span class="Ignore">|</span><a href="usr_40.html#40.3"><span class="Identifier">40.3</span></a><span class="Ignore">|</span> 指定在 读/写 或 进入/离开 缓冲区/窗口 之前/之后
自动执行命令
<span class="Ignore">|</span><span class="Identifier">'autowrite'</span><span class="Ignore">|</span> 自动存盘
<span class="Ignore">|</span><a href="usr_30.html#30.1"><span class="Identifier">30.1</span></a><span class="Ignore">|</span> 加速 编辑-编译-编辑 循环,在 Vim 里面编译和修正错误
<span class="Ignore">|</span><a href="options.html#options"><span class="Identifier">options</span></a><span class="Ignore">|</span> 设置选项
<span class="Ignore">|</span><a href="options.html#auto-setting"><span class="Identifier">auto-setting</span></a><span class="Ignore">|</span> 自动设置选项
<span class="Ignore">|</span><a href="term.html#term-dependent-settings"><span class="Identifier">term-dependent-settings</span></a><span class="Ignore">|</span> 设置依赖于终端名称的选项
<span class="Ignore">|</span><a href="starting.html#save-settings"><span class="Identifier">save-settings</span></a><span class="Ignore">|</span> 保存设置
<span class="Ignore">|</span><span class="Identifier">:quote</span><span class="Ignore">|</span> 对我的 .vim 文件进行注释
<span class="Ignore">|</span><span class="Identifier">'helpheight'</span><span class="Ignore">|</span> 调整默认的帮助高度
<span class="Ignore">|</span><span class="Identifier">'highlight'</span><span class="Ignore">|</span> 设置各种高亮模式
<span class="Ignore">|</span><span class="Identifier">'title'</span><span class="Ignore">|</span> 设置窗口标题
<span class="Ignore">|</span><span class="Identifier">'icon'</span><span class="Ignore">|</span> 设置窗口图标标题
<span class="Ignore">|</span><span class="Identifier">'report'</span><span class="Ignore">|</span> 避免看到每一行上的改变信息
<span class="Ignore">|</span><span class="Identifier">'shortmess'</span><span class="Ignore">|</span> 避免按回车 <span class="Ignore">|</span><a href="message.html#hit-enter"><span class="Identifier">hit-enter</span></a><span class="Ignore">|</span> 提示
<span class="Ignore">|</span><a href="term.html#mouse-using"><span class="Identifier">mouse-using</span></a><span class="Ignore">|</span> 在 Vim 中使用鼠标
<span class="Ignore">|</span><a href="usr_08.html#usr_08.txt"><span class="Identifier">usr_08.txt</span></a><span class="Ignore">|</span> 管理多窗口和缓冲区
<span class="Ignore">|</span><a href="gui.html#gui.txt"><span class="Identifier">gui.txt</span></a><span class="Ignore">|</span> 使用 GUI
|您 (还) 不能!| 用 Vim 洗盘子 :)
<span class="Ignore">|</span><a href="usr_06.html#usr_06.txt"><span class="Identifier">usr_06.txt</span></a><span class="Ignore">|</span> 打开语法高亮
<span class="Ignore">|</span><a href="syntax.html#2html.vim"><span class="Identifier">2html.vim</span></a><span class="Ignore">|</span> 把一个彩色的文件转换成 HTML
<span class="Ignore">|</span><a href="various.html#less"><span class="Identifier">less</span></a><span class="Ignore">|</span> 用 Vim 模拟 less 或 more,但带有语法高亮
</pre>
<!-- vim: set foldmethod=manual : -->
</div>
</div>
</div>
</div>
<footer class="site-footer">
<div class="wrap">
<div class="footer-content">
<i>Generated by vim2html.rb on </i>
<a href="http://www.4e00.com/vim-zh/usr_toc.html">www.4e00.com</a>
</div>
</div>
</footer>
</body>
</html>
|
{
"content_hash": "fac4461b0ed2267103da36db988f6f31",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 458,
"avg_line_length": 89.48412698412699,
"alnum_prop": 0.6632372505543237,
"repo_name": "yuweijun/yuweijun.github.io",
"id": "df22380a4d339beae27e99569347c189baaa7f1b",
"size": "12367",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vim-zh/howto.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "589062"
},
{
"name": "CSS",
"bytes": "86538"
},
{
"name": "Go",
"bytes": "2652"
},
{
"name": "HTML",
"bytes": "126806134"
},
{
"name": "JavaScript",
"bytes": "12389716"
},
{
"name": "Perl",
"bytes": "7390"
},
{
"name": "PostScript",
"bytes": "32036"
},
{
"name": "Ruby",
"bytes": "8626"
},
{
"name": "Shell",
"bytes": "193"
},
{
"name": "Vim Script",
"bytes": "209"
},
{
"name": "XSLT",
"bytes": "7176"
}
]
}
|
// author BOSS
#ifndef __HOST__
#define __HOST__
/******************************************************************************
** IMPORTANT!!! **
** **
** Defines either _WIN32, __MAC__, __UNIX__, __OS2__, __PM__ to
** use the specified definitions indicated below in the preprocessor settings. **
** **
** Also define either __FarProc__ or __FarData__ and __MOTO__ to use the
** specified definitions indicated below in the preprocessor settings. **
** **
** If a preprocessor settings is not allow in the compiler that is being use,
** then it is recommended that a "platform.h" is created with the definition
** of the computer and/or operating system.
******************************************************************************/
#include BOSS_TESSERACT_U_platform_h //original-code:"platform.h"
/* _WIN32 */
#ifdef _WIN32
#include BOSS_FAKEWIN_V_windows_h //original-code:<windows.h>
#include BOSS_FAKEWIN_V_winbase_h //original-code:<winbase.h> // winbase.h contains windows.h
#endif
/********************************************************/
/* __MAC__ */
#ifdef __MAC__
#include <Types.h>
/*----------------------------*/
/*----------------------------*/
#endif
/********************************************************/
#if defined(__UNIX__) || defined( __DOS__ ) || defined(__OS2__) || defined(__PM__)
/*----------------------------*/
/* FarProc and FarData */
/*----------------------------*/
/*----------------------------*/
#endif
/*****************************************************************************
**
** Standard GHC Definitions
**
*****************************************************************************/
#ifdef __MOTO__
#define __NATIVE__ MOTO
#else
#define __NATIVE__ INTEL
#endif
//typedef HANDLE FD* PHANDLE;
// definitions of portable data types (numbers and characters)
typedef signed char inT8; // modified by BOSS, original-code: typedef SIGNED char inT8;
typedef unsigned char uinT8;
typedef short inT16;
typedef unsigned short uinT16;
typedef int inT32;
typedef unsigned int uinT32;
#if (_MSC_VER >= 1200) //%%% vkr for VC 6.0
typedef INT64 inT64;
typedef UINT64 uinT64;
#else
typedef long long int inT64;
typedef unsigned long long int uinT64;
#endif //%%% vkr for VC 6.0
typedef float FLOAT32;
typedef double FLOAT64;
typedef unsigned char BOOL8;
#define INT32FORMAT "%d"
#define INT64FORMAT "%lld"
#define MAX_INT8 0x7f
#define MAX_INT16 0x7fff
#define MAX_INT32 0x7fffffff
#define MAX_UINT8 0xff
#define MAX_UINT16 0xffff
#define MAX_UINT32 0xffffffff
#define MAX_FLOAT32 ((float)3.40282347e+38)
#define MIN_INT8 0x80
#define MIN_INT16 0x8000
#define MIN_INT32 static_cast<int>(0x80000000)
#define MIN_UINT8 0x00
#define MIN_UINT16 0x0000
#define MIN_UINT32 0x00000000
#define MIN_FLOAT32 ((float)1.17549435e-38)
// Defines
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
// Return true if x is within tolerance of y
template<class T> bool NearlyEqual(T x, T y, T tolerance) {
T diff = x - y;
return diff <= tolerance && -diff <= tolerance;
}
#endif
|
{
"content_hash": "315a1ae05419e1c019e3f05a82896c75",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 179,
"avg_line_length": 36.28440366972477,
"alnum_prop": 0.43944374209860937,
"repo_name": "koobonil/Boss2D",
"id": "9dddcaae38a8d5c1b3b26c057befb843ff2dc1d0",
"size": "6449",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Boss2D/addon/_old/tesseract-3.04.01_for_boss/ccutil/host.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "4820445"
},
{
"name": "Awk",
"bytes": "4272"
},
{
"name": "Batchfile",
"bytes": "89930"
},
{
"name": "C",
"bytes": "119747922"
},
{
"name": "C#",
"bytes": "87505"
},
{
"name": "C++",
"bytes": "272329620"
},
{
"name": "CMake",
"bytes": "1199656"
},
{
"name": "CSS",
"bytes": "42679"
},
{
"name": "Clojure",
"bytes": "1487"
},
{
"name": "Cuda",
"bytes": "1651996"
},
{
"name": "DIGITAL Command Language",
"bytes": "239527"
},
{
"name": "Dockerfile",
"bytes": "9638"
},
{
"name": "Emacs Lisp",
"bytes": "15570"
},
{
"name": "Go",
"bytes": "858185"
},
{
"name": "HLSL",
"bytes": "3314"
},
{
"name": "HTML",
"bytes": "2958385"
},
{
"name": "Java",
"bytes": "2921052"
},
{
"name": "JavaScript",
"bytes": "178190"
},
{
"name": "Jupyter Notebook",
"bytes": "1833654"
},
{
"name": "LLVM",
"bytes": "6536"
},
{
"name": "M4",
"bytes": "775724"
},
{
"name": "MATLAB",
"bytes": "74606"
},
{
"name": "Makefile",
"bytes": "3941551"
},
{
"name": "Meson",
"bytes": "2847"
},
{
"name": "Module Management System",
"bytes": "2626"
},
{
"name": "NSIS",
"bytes": "4505"
},
{
"name": "Objective-C",
"bytes": "4090702"
},
{
"name": "Objective-C++",
"bytes": "1702390"
},
{
"name": "PHP",
"bytes": "3530"
},
{
"name": "Perl",
"bytes": "11096338"
},
{
"name": "Perl 6",
"bytes": "11802"
},
{
"name": "PowerShell",
"bytes": "38571"
},
{
"name": "Python",
"bytes": "24123805"
},
{
"name": "QMake",
"bytes": "18188"
},
{
"name": "Roff",
"bytes": "1261269"
},
{
"name": "Ruby",
"bytes": "5890"
},
{
"name": "Scala",
"bytes": "5683"
},
{
"name": "Shell",
"bytes": "2879948"
},
{
"name": "TeX",
"bytes": "243507"
},
{
"name": "TypeScript",
"bytes": "1593696"
},
{
"name": "Verilog",
"bytes": "1215"
},
{
"name": "Vim Script",
"bytes": "3759"
},
{
"name": "Visual Basic",
"bytes": "16186"
},
{
"name": "eC",
"bytes": "9705"
}
]
}
|
<?php
/**
* model class for Orders table
*/
class Orders_model extends CI_Model {
function __construct() {
$this->load->database();
}
}
|
{
"content_hash": "f919a4c325b2b3037dcb8599bb29f1e3",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 37,
"avg_line_length": 12.909090909090908,
"alnum_prop": 0.6338028169014085,
"repo_name": "vikstar94/chombo",
"id": "20fdc283deffb4a327aaf54125ee238dce46ce0c",
"size": "142",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/models/Orders_model.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "240"
},
{
"name": "CSS",
"bytes": "171363"
},
{
"name": "HTML",
"bytes": "8441390"
},
{
"name": "JavaScript",
"bytes": "267151"
},
{
"name": "PHP",
"bytes": "1903403"
}
]
}
|
<?php
/**
* The template for displaying Archive pages.
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* Learn more: http://d5creation.com
* A D5 Creation Theme
*/
get_header(); ?>
<section id="primary">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title">
<?php if ( is_day() ) : ?>
<?php printf( __( 'Daily Archives: %s', 'd5socialia' ), '<span>' . get_the_date() . '</span>' ); ?>
<?php elseif ( is_month() ) : ?>
<?php printf( __( 'Monthly Archives: %s', 'd5socialia' ), '<span>' . get_the_date( 'F Y' ) . '</span>' ); ?>
<?php elseif ( is_year() ) : ?>
<?php printf( __( 'Yearly Archives: %s', 'd5socialia' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); ?>
<?php else : ?>
<?php _e( 'Blog Archives', 'd5socialia' ); ?>
<?php endif; ?>
</h1>
</header>
<?php d5socialia_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php d5socialia_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'd5socialia' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'd5socialia' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
|
{
"content_hash": "9de762ff08bb087d3fbd757bfe4ef542",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 157,
"avg_line_length": 31.742857142857144,
"alnum_prop": 0.549054905490549,
"repo_name": "agocs/agocs.org",
"id": "77513b6aa1bfaaebc6469835fd59b8cbd9a75a0e",
"size": "2222",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "old_site/wp-content/themes/d5-socialia/archive.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "237"
},
{
"name": "CSS",
"bytes": "1219163"
},
{
"name": "HTML",
"bytes": "2984494"
},
{
"name": "JavaScript",
"bytes": "2069921"
},
{
"name": "PHP",
"bytes": "9401949"
},
{
"name": "Ruby",
"bytes": "97271"
},
{
"name": "Smarty",
"bytes": "33"
}
]
}
|
End of preview.
No dataset card yet
- Downloads last month
- 3