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 1074
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 939)
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 1074
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 javax.microedition.khronos.egl;
public abstract class EGLSurface
{
}
|
{
"content_hash": "da1f44f9ac34099ca104bd1b078921a3",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 39,
"avg_line_length": 11.428571428571429,
"alnum_prop": 0.7875,
"repo_name": "xorware/android_frameworks_base",
"id": "e1d08d365c999757fa299bcaa96d81979c359738",
"size": "699",
"binary": false,
"copies": "15",
"ref": "refs/heads/n",
"path": "opengl/java/javax/microedition/khronos/egl/EGLSurface.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "167132"
},
{
"name": "C++",
"bytes": "7092455"
},
{
"name": "GLSL",
"bytes": "20654"
},
{
"name": "HTML",
"bytes": "224185"
},
{
"name": "Java",
"bytes": "78926513"
},
{
"name": "Makefile",
"bytes": "420231"
},
{
"name": "Python",
"bytes": "42309"
},
{
"name": "RenderScript",
"bytes": "153826"
},
{
"name": "Shell",
"bytes": "21079"
}
]
}
|
#ifndef RANDOM_H
#define RANDOM_H 1
#include <stddef.h>
#include <stdint.h>
void random_init(void);
void random_set_seed(uint32_t);
void random_bytes(void *, size_t);
uint32_t random_uint32(void);
uint64_t random_uint64(void);
static inline int
random_range(int max)
{
return random_uint32() % max;
}
static inline uint8_t
random_uint8(void)
{
return random_uint32();
}
static inline uint16_t
random_uint16(void)
{
return random_uint32();
}
#endif /* random.h */
|
{
"content_hash": "939140e07477a0da2ee79c19fe1a138b",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 34,
"avg_line_length": 14.235294117647058,
"alnum_prop": 0.6942148760330579,
"repo_name": "onecloud/ovs-igmp-v3",
"id": "5fe50b725a160ad017f56af85e82f6ccdfdb4f13",
"size": "1102",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "lib/random.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "10439047"
},
{
"name": "C++",
"bytes": "88256"
},
{
"name": "Groff",
"bytes": "315899"
},
{
"name": "Makefile",
"bytes": "66828"
},
{
"name": "Perl",
"bytes": "17264"
},
{
"name": "PowerShell",
"bytes": "5635"
},
{
"name": "Python",
"bytes": "725830"
},
{
"name": "Shell",
"bytes": "10354624"
}
]
}
|
require_relative '../../../spec_helper'
require Arachni::Options.instance.dir['lib'] + 'rpc/client/dispatcher'
require Arachni::Options.instance.dir['lib'] + 'rpc/server/dispatcher'
describe Arachni::RPC::Server::Framework do
before( :all ) do
@opts = Arachni::Options.instance
@opts.audit_links = true
@dispatchers = []
@opts.pool_size = 1
@get_instance = proc do |opts|
opts ||= @opts
port = random_port
opts.rpc_port = port
exec_dispatcher( opts )
port2 = random_port
opts.rpc_port = port2
opts.neighbour = "#{opts.rpc_address}:#{port}"
opts.pipe_id = 'blah'
exec_dispatcher( opts )
dispatcher = Arachni::RPC::Client::Dispatcher.new( opts,
"#{opts.rpc_address}:#{port}" )
inst_info = dispatcher.dispatch
inst = Arachni::RPC::Client::Instance.new( opts,
inst_info['url'], inst_info['token']
)
inst.opts.grid_mode = 'high_performance'
inst
end
@instance = @get_instance.call
@framework = @instance.framework
@modules = @instance.modules
@plugins = @instance.plugins
@instance_clean = @get_instance.call
@framework_clean = @instance_clean.framework
@stat_keys = [
:requests, :responses, :time_out_count,
:time, :avg, :sitemap_size, :auditmap_size, :progress, :curr_res_time,
:curr_res_cnt, :curr_avg, :average_res_time, :max_concurrency,
:current_page, :eta,
]
end
describe '#busy?' do
context 'when the scan is not running' do
it 'should return false' do
@framework_clean.busy?.should be_false
end
end
context 'when the scan is running' do
it 'should return true' do
@instance.opts.url = server_url_for( :auditor )
@modules.load( 'test' )
@framework.run.should be_true
@framework.busy?.should be_true
end
end
end
describe '#version' do
it 'should return the system version' do
@framework_clean.version.should == Arachni::VERSION
end
end
describe '#revision' do
it 'should return the framework revision' do
@framework_clean.revision.should == Arachni::Framework::REVISION
end
end
describe '#high_performance?' do
it 'should return true' do
@framework_clean.high_performance?.should be_true
end
end
describe '#output' do
it 'should return the instance\'s output messages' do
output = @framework_clean.output.first
output.keys.first.is_a?( Symbol ).should be_true
output.values.first.is_a?( String ).should be_true
end
end
describe '#run' do
it 'should perform a scan' do
instance = @instance_clean
instance.opts.url = server_url_for( :framework_hpg )
instance.modules.load( 'test' )
instance.framework.run.should be_true
sleep( 1 ) while instance.framework.busy?
instance.framework.issues.should be_any
end
end
describe '#auditstore' do
it 'should return an auditstore object' do
auditstore = @instance_clean.framework.auditstore
auditstore.is_a?( Arachni::AuditStore ).should be_true
auditstore.issues.should be_any
issue = auditstore.issues.first
issue.is_a?( Arachni::Issue ).should be_true
issue.variations.should be_any
issue.variations.first.is_a?( Arachni::Issue ).should be_true
end
end
describe '#stats' do
it 'should return a hash containing general runtime statistics' do
instance = @instance_clean
instance.opts.url = server_url_for( :framework_hpg )
instance.modules.load( 'test' )
instance.framework.run.should be_true
stats = instance.framework.stats
stats.keys.should == @stat_keys
@stat_keys.each { |k| stats[k].should be_true }
end
end
describe '#paused?' do
context 'when not paused' do
it 'should return false' do
instance = @instance_clean
instance.framework.paused?.should be_false
end
end
context 'when paused' do
it 'should return true' do
instance = @instance_clean
instance.framework.pause
instance.framework.paused?.should be_true
end
end
end
describe '#resume' do
it 'should resume the scan' do
instance = @instance_clean
instance.framework.pause
instance.framework.paused?.should be_true
instance.framework.resume.should be_true
instance.framework.paused?.should be_false
end
end
describe '#clean_up' do
it 'should set the framework state to finished, wait for plugins to finish and merge their results' do
instance = @get_instance.call
instance.opts.url = server_url_for( :framework_hpg )
instance.modules.load( 'test' )
instance.plugins.load( { 'wait' => {}, 'distributable' => {} } )
instance.framework.run.should be_true
instance.framework.auditstore.plugins.should be_empty
instance.framework.busy?.should be_true
tries = 4
begin
sleep( 1 ) while instance.framework.busy?
rescue Exception
tries -= 1
retry if tries > 0
end
instance.framework.clean_up.should be_true
results = instance.framework.auditstore.plugins
results.should be_any
results['wait'].should be_any
results['wait'][:results].should == { stuff: true }
results['distributable'][:results].should == { stuff: 2 }
end
end
describe '#progress' do
before { @progress_keys = %W(stats status busy issues instances messages).sort }
it 'should be aliased to #progress_data' do
instance = @instance_clean
data = instance.framework.progress_data
data.keys.sort.should == @progress_keys
end
context 'when called without options' do
it 'should return all progress data' do
instance = @instance_clean
data = instance.framework.progress
data.keys.sort.should == @progress_keys
keys = (@stat_keys | %w(url status)).flatten.map { |k| k.to_s }.sort
data['stats'].should be_any
data['stats'].keys.sort.should == (keys | %w(current_pages)).flatten.sort
data['instances'].should be_any
data['status'].should be_true
data['busy'].nil?.should be_false
data['messages'].is_a?( Array ).should be_true
data['issues'].should be_any
data['instances'].size.should == 2
keys = (keys | %w(current_page)).flatten.sort
data['instances'].first.keys.sort.should == keys
data['instances'].last.keys.sort.should == keys
end
end
context 'when called with option' do
describe :messages do
context 'when set to false' do
it 'should exclude messages' do
keys = @instance_clean.framework. progress( messages: false ).
keys.sort
pk = @progress_keys.dup
pk.delete( "messages" )
keys.should == pk
end
end
end
describe :issues do
context 'when set to false' do
it 'should exclude issues' do
keys = @instance_clean.framework. progress( issues: false ).
keys.sort
pk = @progress_keys.dup
pk.delete( "issues" )
keys.should == pk
end
end
end
describe :slaves do
context 'when set to false' do
it 'should exclude issues' do
keys = @instance_clean.framework. progress( slaves: false ).
keys.sort
pk = @progress_keys.dup
pk.delete( "instances" )
keys.should == pk
end
end
end
describe :as_hash do
context 'when set to true' do
it 'should include issues as a hash' do
@instance_clean.framework
.progress( as_hash: true )['issues']
.first.is_a?( Hash ).should be_true
end
end
end
end
end
describe '#report' do
it 'should return a hash report of the scan' do
report = @instance_clean.framework.report
report.is_a?( Hash ).should be_true
report['issues'].should be_any
issue = report['issues'].first
issue.is_a?( Hash ).should be_true
issue['variations'].should be_any
issue['variations'].first.is_a?( Hash ).should be_true
end
it 'should be aliased to #audit_store_as_hash' do
@instance_clean.framework.report.should ==
@instance_clean.framework.audit_store_as_hash
end
it 'should be aliased to #auditstore_as_hash' do
@instance_clean.framework.report.should ==
@instance_clean.framework.auditstore_as_hash
end
end
describe '#serialized_auditstore' do
it 'should return a YAML serialized AuditStore' do
yaml_str = @instance_clean.framework.serialized_auditstore
YAML.load( yaml_str ).is_a?( Arachni::AuditStore ).should be_true
end
end
describe '#serialized_report' do
it 'should return a YAML serialized report hash' do
yaml_str = @instance_clean.framework.serialized_report
YAML.load( yaml_str ).should == @instance_clean.framework.report
end
end
describe '#issues' do
it 'should return an array of issues without variations' do
issues = @instance_clean.framework.issues
issues.should be_any
issue = issues.first
issue.is_a?( Arachni::Issue ).should be_true
issue.variations.should be_empty
end
end
describe '#issues_as_hash' do
it 'should return an array of issues (as hash) without variations' do
issues = @instance_clean.framework.issues_as_hash
issues.should be_any
issue = issues.first
issue.is_a?( Hash ).should be_true
issue['variations'].should be_empty
end
end
describe '#restrict_to_elements' do
it 'should return false' do
@instance_clean.framework.restrict_to_elements( [] ).should be_false
end
end
describe '#update_page_queue' do
it 'should return false' do
@instance_clean.framework.update_page_queue( [] ).should be_false
end
end
describe '#register_issues' do
it 'should return false' do
@instance_clean.framework.register_issues( [] ).should be_false
end
end
end
|
{
"content_hash": "622551b495c0c4e6130c9865f13cc9c4",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 110,
"avg_line_length": 36.98753894080997,
"alnum_prop": 0.5403857491788091,
"repo_name": "winny19/entersoft-scanner",
"id": "66db1f949d16744c19069658a73cd8ff454864f3",
"size": "11873",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "spec/arachni/rpc/server/framework_hpg_spec.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "13123"
},
{
"name": "Perl",
"bytes": "8784"
},
{
"name": "Ruby",
"bytes": "1718806"
}
]
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;
using Windows.Storage.AccessCache;
namespace JumpList.Services
{
public class DataService
{
FutureService _FutureService;
JumpListService _JumpListService;
public DataService()
{
_FutureService = new FutureService();
_JumpListService = new JumpListService();
}
public async Task SaveFileInfoAsync(Models.FileInfo model)
{
// nothing to save (can be okay)
if (model == null) return;
// save content to file
await Windows.Storage.FileIO.WriteTextAsync(model.Ref, model.Text);
}
public async Task<Models.FileInfo> GetFileInfoAsync(string path)
{
if (string.IsNullOrEmpty(path))
return null;
var file = await StorageFile.GetFileFromPathAsync(path);
return await GetFileInfoAsync(file);
}
public async Task<Models.FileInfo> GetFileInfoAsync(StorageFile file)
{
if (file == null)
{
// nothing to do
return null;
}
else
{
// add as future item
_FutureService.Add(file);
}
// add to jumplist
await _JumpListService.AddAsync(file);
// return model
return new JumpList.Models.FileInfo
{
Text = await FileIO.ReadTextAsync(file),
Name = file.DisplayName,
Ref = file,
};
}
}
}
|
{
"content_hash": "2f990a7bcfed50a8970bf345e01238c2",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 79,
"avg_line_length": 26.415384615384614,
"alnum_prop": 0.5428072218986605,
"repo_name": "abubberman/Template10",
"id": "340bd93093ea3efba3aba14c2ebc4304e3b27bd1",
"size": "1719",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Samples/JumpList/Services/DataService.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2414"
},
{
"name": "C#",
"bytes": "476736"
},
{
"name": "CSS",
"bytes": "1778"
},
{
"name": "HTML",
"bytes": "584"
},
{
"name": "PowerShell",
"bytes": "151"
}
]
}
|
#ifndef __itkGeodesicActiveContourShapePriorLevelSetFunction_h
#define __itkGeodesicActiveContourShapePriorLevelSetFunction_h
#include "itkShapePriorSegmentationLevelSetFunction.h"
namespace itk
{
/** \class GeodesicActiveContourShapePriorLevelSetFunction
*
* \brief This function is used in
* GeodesicActiveContourShapePriorSegmentationLevelSetFilter to
* segment structures in an image based on user supplied edge potential map and
* shape model.
*
* \par IMPORTANT
* The LevelSetFunction, SegmentationLevelSetFunction and
* ShapePriorSegmentationLevelSetFunction classes contain additional
* information necessary to gain full understanding of how to use
* this function.
*
* GeodesicActiveContourShapePriorLevelSetFunction is a subclass of the
* generic LevelSetFunction.
* It is used to segment structures in an image based on a user supplied
* edge potential map \f$ g(I) \f$, which
* has values close to zero in regions near edges (or high image gradient) and values
* close to one in regions with relatively constant intensity. Typically, the edge
* potential map is a function of the gradient, for example:
*
* \f[ g(I) = 1 / ( 1 + | (\nabla * G)(I)| ) \f]
* \f[ g(I) = \exp^{-|(\nabla * G)(I)|} \f]
*
* where \f$ I \f$ is image intensity and
* \f$ (\nabla * G) \f$ is the derivative of Gaussian operator.
*
* The edge potential image is set via the SetFeatureImage() method.
*
* In this function both the propagation term \f$ P(\mathbf{x}) \f$
* and the curvature spatial modifier term \f$ Z(\mathbf{x}) \f$ are taken directly
* from the edge potential image such that:
*
* \f[ P(\mathbf{x}) = g(\mathbf{x}) \f]
* \f[ Z(\mathbf{x}) = g(\mathbf{x}) \f]
*
* An advection term \f$ \mathbf{A}(\mathbf{x}) \f$ is constructed
* from the negative gradient of the edge potential image.
*
* \f[ \mathbf{A}(\mathbf{x}) = -\nabla g(\mathbf{x}) \f]
*
* This term behaves like a doublet attracting the contour to the edges.
*
* This class extends the basic LevelSetFunction with a shape prior term
* as developed in [1].
*
* \f$ \zeta( \phi^{*} - \phi) \f$
*
* where \f$ \phi^{*} \f$ is the signed distance function from a target shape
* and \f$ \zeta \f$ is a scalar constant.
*
* The target shape signed distance function is supplied through a
* ShapeSignedDistanceFunction object. Typically, the shape is a function
* of a set of parameters.
*
* \sa LevelSetFunction
* \sa SegmentationLevelSetFunction
* \sa ShapePriorSegmentationLevelSetFunction
* \sa ShapeSignedDistanceFunction
*
* \par REFERENCES
* \par
* [1] Leventon, M.E. et al. "Statistical Shape Influence in Geodesic Active Contours", CVPR 2000.
*
* \ingroup FiniteDifferenceFunctions
* \ingroup ITKLevelSets
*/
template< class TImageType, class TFeatureImageType = TImageType >
class ITK_EXPORT GeodesicActiveContourShapePriorLevelSetFunction:
public ShapePriorSegmentationLevelSetFunction< TImageType, TFeatureImageType >
{
public:
/** Standard class typedefs. */
typedef GeodesicActiveContourShapePriorLevelSetFunction
Self;
typedef ShapePriorSegmentationLevelSetFunction< TImageType, TFeatureImageType > Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
typedef TFeatureImageType FeatureImageType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods) */
itkTypeMacro(GeodesicActiveContourShapePriorLevelSetFunction,
ShapePriorSegmentationLevelSetFunction);
/** Extract some parameters from the superclass. */
typedef typename Superclass::ImageType ImageType;
typedef typename Superclass::NeighborhoodType NeighborhoodType;
typedef typename Superclass::ScalarValueType ScalarValueType;
typedef typename Superclass::FeatureScalarType FeatureScalarType;
typedef typename Superclass::RadiusType RadiusType;
typedef typename Superclass::FloatOffsetType FloatOffsetType;
typedef typename Superclass::VectorImageType VectorImageType;
typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
/** Extract some parameters from the superclass. */
itkStaticConstMacro(ImageDimension, unsigned int,
Superclass::ImageDimension);
/** Compute speed image from feature image. */
virtual void CalculateSpeedImage();
/** Compute the advection field from feature image. */
virtual void CalculateAdvectionImage();
/** The curvature speed is same as the propagation speed. */
virtual ScalarValueType CurvatureSpeed(const NeighborhoodType & neighborhood,
const FloatOffsetType & offset, GlobalDataStruct *gd) const
{ return this->PropagationSpeed(neighborhood, offset, gd); }
/** Set/Get the sigma for the Gaussian kernel used to compute the gradient
* of the feature image needed for the advection term of the equation. */
void SetDerivativeSigma(const double v)
{ m_DerivativeSigma = v; }
double GetDerivativeSigma()
{ return m_DerivativeSigma; }
virtual void Initialize(const RadiusType & r)
{
Superclass::Initialize(r);
this->SetAdvectionWeight(NumericTraits< ScalarValueType >::One);
this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
this->SetShapePriorWeight(NumericTraits< ScalarValueType >::One);
}
protected:
GeodesicActiveContourShapePriorLevelSetFunction()
{
this->SetAdvectionWeight(NumericTraits< ScalarValueType >::One);
this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
this->SetShapePriorWeight(NumericTraits< ScalarValueType >::One);
m_DerivativeSigma = 1.0;
}
virtual ~GeodesicActiveContourShapePriorLevelSetFunction() {}
GeodesicActiveContourShapePriorLevelSetFunction(const Self &); //purposely not
// implemented
void operator=(const Self &); //purposely not
// implemented
void PrintSelf(std::ostream & os, Indent indent) const
{
Superclass::PrintSelf(os, indent);
os << indent << "DerivativeSigma: " << m_DerivativeSigma << std::endl;
}
private:
double m_DerivativeSigma;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkGeodesicActiveContourShapePriorLevelSetFunction.hxx"
#endif
#endif
|
{
"content_hash": "759c311bb7fb08a08939fa094ad084d1",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 100,
"avg_line_length": 39.27485380116959,
"alnum_prop": 0.7068195354377605,
"repo_name": "CapeDrew/DCMTK-ITK",
"id": "9084c580cd85b8995f3e71596a7c6cbc63e4e6a4",
"size": "7491",
"binary": false,
"copies": "7",
"ref": "refs/heads/AddDCMTK",
"path": "Modules/Segmentation/LevelSets/include/itkGeodesicActiveContourShapePriorLevelSetFunction.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "27077612"
},
{
"name": "C#",
"bytes": "1714"
},
{
"name": "C++",
"bytes": "38101837"
},
{
"name": "FORTRAN",
"bytes": "2241251"
},
{
"name": "Io",
"bytes": "1833"
},
{
"name": "Java",
"bytes": "60450"
},
{
"name": "Objective-C",
"bytes": "6591"
},
{
"name": "Perl",
"bytes": "17899"
},
{
"name": "Prolog",
"bytes": "4406"
},
{
"name": "Python",
"bytes": "934200"
},
{
"name": "Ruby",
"bytes": "296"
},
{
"name": "Rust",
"bytes": "895"
},
{
"name": "Shell",
"bytes": "215658"
},
{
"name": "Tcl",
"bytes": "130560"
}
]
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0-google-v3) on Mon May 09 20:04:45 EDT 2011 -->
<TITLE>
ContextFactory.Listener (Rhino)
</TITLE>
<META NAME="date" CONTENT="2011-05-09">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ContextFactory.Listener (Rhino)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../org/mozilla/javascript/ContextFactory.GlobalSetter.html" title="interface in org.mozilla.javascript"><B>PREV CLASS</B></A>
<A HREF="../../../org/mozilla/javascript/ContextListener.html" title="interface in org.mozilla.javascript"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/mozilla/javascript/ContextFactory.Listener.html" target="_top"><B>FRAMES</B></A>
<A HREF="ContextFactory.Listener.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.mozilla.javascript</FONT>
<BR>
Interface ContextFactory.Listener</H2>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../org/mozilla/javascript/ContextListener.html" title="interface in org.mozilla.javascript">ContextListener</A></DD>
</DL>
<DL>
<DT><B>Enclosing class:</B><DD><A HREF="../../../org/mozilla/javascript/ContextFactory.html" title="class in org.mozilla.javascript">ContextFactory</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public static interface <B>ContextFactory.Listener</B></DL>
</PRE>
<P>
Listener of <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> creation and release events.
<P>
<P>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.Listener.html#contextCreated(org.mozilla.javascript.Context)">contextCreated</A></B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A> cx)</CODE>
<BR>
Notify about newly created <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.Listener.html#contextReleased(org.mozilla.javascript.Context)">contextReleased</A></B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A> cx)</CODE>
<BR>
Notify that the specified <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> instance is no longer
associated with the current thread.</TD>
</TR>
</TABLE>
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="contextCreated(org.mozilla.javascript.Context)"><!-- --></A><H3>
contextCreated</H3>
<PRE>
void <B>contextCreated</B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A> cx)</PRE>
<DL>
<DD>Notify about newly created <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> object.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="contextReleased(org.mozilla.javascript.Context)"><!-- --></A><H3>
contextReleased</H3>
<PRE>
void <B>contextReleased</B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A> cx)</PRE>
<DL>
<DD>Notify that the specified <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> instance is no longer
associated with the current thread.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../org/mozilla/javascript/ContextFactory.GlobalSetter.html" title="interface in org.mozilla.javascript"><B>PREV CLASS</B></A>
<A HREF="../../../org/mozilla/javascript/ContextListener.html" title="interface in org.mozilla.javascript"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/mozilla/javascript/ContextFactory.Listener.html" target="_top"><B>FRAMES</B></A>
<A HREF="ContextFactory.Listener.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
|
{
"content_hash": "0c53190e68f896341c738b7f7c14cba5",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 278,
"avg_line_length": 42.35564853556485,
"alnum_prop": 0.643979057591623,
"repo_name": "gamerDecathlete/BB10-WebWorks-Community-Samples",
"id": "e18dbb737bc179670e0292cb7b2478a963872ae4",
"size": "10123",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "Ant-Cordova-Build-Script/tools/rhino1_7R3/javadoc/org/mozilla/javascript/ContextFactory.Listener.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "1422"
},
{
"name": "Batchfile",
"bytes": "46413"
},
{
"name": "C",
"bytes": "789"
},
{
"name": "C++",
"bytes": "289230"
},
{
"name": "CSS",
"bytes": "3282958"
},
{
"name": "HTML",
"bytes": "69730707"
},
{
"name": "Java",
"bytes": "9064250"
},
{
"name": "JavaScript",
"bytes": "8669274"
},
{
"name": "Makefile",
"bytes": "2153"
},
{
"name": "Objective-C",
"bytes": "4012"
},
{
"name": "Perl",
"bytes": "19680"
},
{
"name": "Python",
"bytes": "6700"
},
{
"name": "QMake",
"bytes": "2201"
},
{
"name": "Shell",
"bytes": "30974"
},
{
"name": "XSLT",
"bytes": "446934"
}
]
}
|
#ifndef BOOST_UNITS_SYSTEMS_INFORMATION_NAT_HPP_INCLUDED
#define BOOST_UNITS_SYSTEMS_INFORMATION_NAT_HPP_INCLUDED
#include <boost/units/systems/information/byte.hpp>
#include <boost/units/base_units/information/nat.hpp>
namespace boost {
namespace units {
namespace information {
namespace hu {
namespace nat {
typedef unit<information_dimension, make_system<nat_base_unit>::type> info;
} // namespace bit
} // namespace hu
BOOST_UNITS_STATIC_CONSTANT(nat, hu::nat::info);
BOOST_UNITS_STATIC_CONSTANT(nats, hu::nat::info);
} // namespace information
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_SYSTEMS_INFORMATION_NAT_HPP_INCLUDED
|
{
"content_hash": "fc5fef4c9b54f179cadaeebc738f2a5b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 75,
"avg_line_length": 27.36,
"alnum_prop": 0.7353801169590644,
"repo_name": "zjutjsj1004/third",
"id": "1879468f1c08743d88f9cb63c8446f3227641e31",
"size": "1011",
"binary": false,
"copies": "17",
"ref": "refs/heads/master",
"path": "boost/boost/units/systems/information/nat.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "224158"
},
{
"name": "Batchfile",
"bytes": "33175"
},
{
"name": "C",
"bytes": "5576593"
},
{
"name": "C#",
"bytes": "41850"
},
{
"name": "C++",
"bytes": "179595990"
},
{
"name": "CMake",
"bytes": "28348"
},
{
"name": "CSS",
"bytes": "331303"
},
{
"name": "Cuda",
"bytes": "26521"
},
{
"name": "FORTRAN",
"bytes": "1856"
},
{
"name": "Groff",
"bytes": "1305458"
},
{
"name": "HTML",
"bytes": "159660377"
},
{
"name": "IDL",
"bytes": "15"
},
{
"name": "JavaScript",
"bytes": "285786"
},
{
"name": "Lex",
"bytes": "1290"
},
{
"name": "Makefile",
"bytes": "1202020"
},
{
"name": "Max",
"bytes": "37424"
},
{
"name": "Objective-C",
"bytes": "3674"
},
{
"name": "Objective-C++",
"bytes": "651"
},
{
"name": "PHP",
"bytes": "60249"
},
{
"name": "Perl",
"bytes": "37297"
},
{
"name": "Perl6",
"bytes": "2130"
},
{
"name": "Python",
"bytes": "1833677"
},
{
"name": "QML",
"bytes": "613"
},
{
"name": "QMake",
"bytes": "17385"
},
{
"name": "Rebol",
"bytes": "372"
},
{
"name": "Shell",
"bytes": "1144162"
},
{
"name": "Tcl",
"bytes": "1205"
},
{
"name": "TeX",
"bytes": "38313"
},
{
"name": "XSLT",
"bytes": "564356"
},
{
"name": "Yacc",
"bytes": "20341"
}
]
}
|
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>com.cadnunsdev</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
</configuration>
</project>
|
{
"content_hash": "7659d71a84dc2a8f953e43f5906eddb5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 64,
"avg_line_length": 33.8,
"alnum_prop": 0.5364891518737672,
"repo_name": "CadnunsDimir/M3LPBD__201701_ProjetoFinal",
"id": "2c3bbb7f255268bf49ee8d0b9e4b1633ed15ec03",
"size": "507",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "JAVA/com.cadnunsdev/nbproject/project.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "33444"
}
]
}
|
cask 'unity-linux-support-for-editor' do
version '2018.2.13f1,83fbdcd35118'
sha256 'c61316ec0fab896d57367791d67ec8ec03eddc4c8c7f0947434dd69d5b1694d9'
url "https://netstorage.unity3d.com/unity/#{version.after_comma}/MacEditorTargetInstaller/UnitySetup-Linux-Support-for-Editor-#{version.before_comma}.pkg"
appcast 'https://unity3d.com/get-unity/download/archive'
name 'Unity Linux Build Support'
homepage 'https://unity3d.com/unity/'
depends_on cask: 'unity'
pkg "UnitySetup-Linux-Support-for-Editor-#{version.before_comma}.pkg"
uninstall pkgutil: 'com.unity3d.LinuxStandaloneSupport'
end
|
{
"content_hash": "a333ce2c38a2aa97465bba050c522b4b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 156,
"avg_line_length": 40.666666666666664,
"alnum_prop": 0.7852459016393443,
"repo_name": "aguynamedryan/homebrew-cask",
"id": "c395a1e3985cd6b83cc635faab93c4459b95c192",
"size": "610",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "Casks/unity-linux-support-for-editor.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Ruby",
"bytes": "2192473"
},
{
"name": "Shell",
"bytes": "35032"
}
]
}
|
#ifndef _SkipNgram_h_
#define _SkipNgram_h_
#include "Ngram.h"
#include "LHash.h"
class SkipNgram: public Ngram
{
public:
SkipNgram(Vocab &vocab, unsigned order);
/*
* LM interface
*/
LogP wordProb(VocabIndex word, const VocabIndex *context);
Boolean read(File &file, Boolean limitVocab = false);
Boolean write(File &file);
/*
* Estimation
*/
Boolean estimate(NgramStats &stats, Discount **discounts);
unsigned maxEMiters; /* max number of EM iterations */
double minEMdelta; /* min log likelihood delta */
Prob initialSkipProb; /* default initial skip probability */
void memStats(MemStats &stats);
protected:
LHash<VocabIndex, Prob> skipProbs; /* word skipping probs */
LogP estimateEstepNgram(VocabIndex *ngram, NgramCount ngramCount,
NgramStats &stats,
NgramCounts<FloatCount> &ngramExps,
LHash<VocabIndex, double> &skipExps);
LogP estimateEstep(NgramStats &stats,
NgramCounts<FloatCount> &ngramExps,
LHash<VocabIndex, double> &skipExps);
void estimateMstep(NgramStats &stats,
NgramCounts<FloatCount> &ngramExps,
LHash<VocabIndex, double> &skipExps,
Discount **discounts);
};
#endif /* _SkipNgram_h_ */
|
{
"content_hash": "76c5d1e7a13daf195137e42454f40b07",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 69,
"avg_line_length": 25.918367346938776,
"alnum_prop": 0.6677165354330709,
"repo_name": "shyamjvs/cs626_project",
"id": "023bc350462a7d72d623c8757da4c5a739766189",
"size": "1542",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "stat_moses/srilm/lm/src/SkipNgram.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "10914"
},
{
"name": "Awk",
"bytes": "743344"
},
{
"name": "C",
"bytes": "3906431"
},
{
"name": "C#",
"bytes": "206438"
},
{
"name": "C++",
"bytes": "16167412"
},
{
"name": "CSS",
"bytes": "23612"
},
{
"name": "Eiffel",
"bytes": "66"
},
{
"name": "Emacs Lisp",
"bytes": "17034"
},
{
"name": "FORTRAN",
"bytes": "58"
},
{
"name": "Frege",
"bytes": "811021"
},
{
"name": "Java",
"bytes": "9070"
},
{
"name": "JavaScript",
"bytes": "273860"
},
{
"name": "Objective-C",
"bytes": "35399"
},
{
"name": "PHP",
"bytes": "133822"
},
{
"name": "Perl",
"bytes": "1739883"
},
{
"name": "Python",
"bytes": "625658"
},
{
"name": "R",
"bytes": "726"
},
{
"name": "Ruby",
"bytes": "4403"
},
{
"name": "Shell",
"bytes": "1302208"
},
{
"name": "Slash",
"bytes": "356"
},
{
"name": "SystemVerilog",
"bytes": "184"
},
{
"name": "XSLT",
"bytes": "759"
},
{
"name": "nesC",
"bytes": "366"
}
]
}
|
package org.elasticsearch.hadoop.integration.cascading;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import org.apache.hadoop.mapred.JobConf;
import org.elasticsearch.hadoop.EsHadoopIllegalArgumentException;
import org.elasticsearch.hadoop.HdfsUtils;
import org.elasticsearch.hadoop.HdpBootstrap;
import org.elasticsearch.hadoop.LocalEs;
import org.elasticsearch.hadoop.Provisioner;
import org.elasticsearch.hadoop.QueryTestParams;
import org.elasticsearch.hadoop.mr.HadoopCfgUtils;
import org.elasticsearch.hadoop.util.TestUtils;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.rules.ExternalResource;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import cascading.util.Update;
@RunWith(Suite.class)
@Suite.SuiteClasses({ AbstractCascadingHadoopSaveTest.class, AbstractCascadingHadoopJsonSaveTest.class, AbstractCascadingHadoopSearchTest.class, AbstractCascadingHadoopJsonSearchTest.class })
//@Suite.SuiteClasses({ AbstractCascadingHadoopJsonSaveTest.class, AbstractCascadingHadoopJsonSearchTest.class })
public class CascadingHadoopSuite {
@ClassRule
public static ExternalResource resource = new LocalEs();
public static JobConf configuration;
@BeforeClass
public static void setup() throws Exception {
configuration = HdpBootstrap.hadoopConfig();
System.setProperty(Update.UPDATE_CHECK_SKIP, "true");
//configuration.setNumReduceTasks(0);
if (!HadoopCfgUtils.isLocal(configuration)) {
configuration = CascadingProvisioner.cascading(configuration);
}
HdfsUtils.copyFromLocal(TestUtils.sampleArtistsDat());
HdfsUtils.copyFromLocal(TestUtils.sampleQueryDsl());
HdfsUtils.copyFromLocal(TestUtils.sampleQueryUri());
QueryTestParams.provisionQueries(configuration);
}
private static class CascadingProvisioner extends Provisioner {
public static final String[] CASCADING_JARS;
static {
// initialize cascading jars
// read them from the classpath
List<String> jars = new ArrayList<String>();
// cascading-core
jars.add(findContainingJar("cascading/cascade/Cascade.class"));
// cascading-hadoop
jars.add(findContainingJar("cascading/flow/hadoop/HadoopFlow.class"));
// jgrapht
jars.add(findContainingJar("org/jgrapht/Graph.class"));
jars.add(findContainingJar("riffle/process/Process.class"));
// riffle
jars.add(findContainingJar("org/codehaus/janino/Java.class"));
// janino commons-compiler
jars.add(findContainingJar("org/codehaus/commons/compiler/CompileException.class"));
CASCADING_JARS = jars.toArray(new String[jars.size()]);
}
public static JobConf cascading(JobConf conf) {
addLibs(conf, CASCADING_JARS);
return conf;
}
private static String findContainingJar(String binaryName) {
ClassLoader loader = Provisioner.class.getClassLoader();
try {
for (Enumeration<URL> urls = loader.getResources(binaryName); urls.hasMoreElements();) {
URL url = urls.nextElement();
// remove jar:
if ("jar".equals(url.getProtocol())) {
return url.getPath().replaceAll("!.*$", "");
}
}
} catch (IOException ex) {
throw new EsHadoopIllegalArgumentException("Cannot find jar for class " + binaryName, ex);
}
throw new EsHadoopIllegalArgumentException("Cannot find class " + binaryName);
}
}
}
|
{
"content_hash": "86c09baec173b65cbede9ac003be57df",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 191,
"avg_line_length": 38.93877551020408,
"alnum_prop": 0.6834381551362684,
"repo_name": "jasontedor/elasticsearch-hadoop",
"id": "b8c8915936eab836884e0dc486ba2c4388e6313a",
"size": "4604",
"binary": false,
"copies": "19",
"ref": "refs/heads/master",
"path": "cascading/src/itest/java/org/elasticsearch/hadoop/integration/cascading/CascadingHadoopSuite.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1568436"
},
{
"name": "Scala",
"bytes": "166742"
}
]
}
|
namespace bluez {
// BluetoothGattDescriptorClient is used to communicate with remote GATT
// characteristic descriptor objects exposed by the Bluetooth daemon.
class DEVICE_BLUETOOTH_EXPORT BluetoothGattDescriptorClient
: public BluezDBusClient {
public:
// Structure of properties associated with GATT descriptors.
struct Properties : public dbus::PropertySet {
// The 128-bit characteristic descriptor UUID. [read-only]
dbus::Property<std::string> uuid;
// Object path of the GATT characteristic the descriptor belongs to.
// [read-only]
dbus::Property<dbus::ObjectPath> characteristic;
// The cached value of the descriptor. This property gets updated only after
// a successful read request. [read-only]
dbus::Property<std::vector<uint8_t>> value;
Properties(dbus::ObjectProxy* object_proxy,
const std::string& interface_name,
const PropertyChangedCallback& callback);
~Properties() override;
};
// Interface for observing changes from a remote GATT characteristic
// descriptor.
class Observer {
public:
virtual ~Observer() {}
// Called when the GATT descriptor with object path |object_path| is added
// to the system.
virtual void GattDescriptorAdded(const dbus::ObjectPath& object_path) {}
// Called when the GATT descriptor with object path |object_path| is removed
// from the system.
virtual void GattDescriptorRemoved(const dbus::ObjectPath& object_path) {}
// Called when the GATT descriptor with object path |object_path| has a
// change in the value of the property named |property_name|.
virtual void GattDescriptorPropertyChanged(
const dbus::ObjectPath& object_path,
const std::string& property_name) {}
};
// Callbacks used to report the result of asynchronous methods.
using ErrorCallback =
base::OnceCallback<void(const std::string& error_name,
const std::string& error_message)>;
using ValueCallback =
base::OnceCallback<void(const std::vector<uint8_t>& value)>;
~BluetoothGattDescriptorClient() override;
// Adds and removes observers for events on all remote GATT descriptors. Check
// the |object_path| parameter of observer methods to determine which GATT
// descriptor is issuing the event.
virtual void AddObserver(Observer* observer) = 0;
virtual void RemoveObserver(Observer* observer) = 0;
// Returns the list of GATT descriptor object paths known to the system.
virtual std::vector<dbus::ObjectPath> GetDescriptors() = 0;
// Obtain the properties for the GATT descriptor with object path
// |object_path|. Values should be copied if needed.
virtual Properties* GetProperties(const dbus::ObjectPath& object_path) = 0;
// Issues a request to read the value of GATT descriptor with object path
// |object_path| and returns the value in |callback| on success. On error,
// invokes |error_callback|.
virtual void ReadValue(const dbus::ObjectPath& object_path,
ValueCallback callback,
ErrorCallback error_callback) = 0;
// Issues a request to write the value of GATT descriptor with object path
// |object_path| with value |value|. Invokes |callback| on success and
// |error_callback| on failure.
virtual void WriteValue(const dbus::ObjectPath& object_path,
const std::vector<uint8_t>& value,
base::OnceClosure callback,
ErrorCallback error_callback) = 0;
// Creates the instance.
static BluetoothGattDescriptorClient* Create();
// Constants used to indicate exceptional error conditions.
static const char kNoResponseError[];
static const char kUnknownDescriptorError[];
protected:
BluetoothGattDescriptorClient();
private:
DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorClient);
};
} // namespace bluez
#endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_
|
{
"content_hash": "69b67a60050745747c7046f9814d28c9",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 80,
"avg_line_length": 39.633663366336634,
"alnum_prop": 0.7049712715463402,
"repo_name": "endlessm/chromium-browser",
"id": "b9f9a9682fb9bd2fbb9d85b7f8f708ecc79267ca",
"size": "4570",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "device/bluetooth/dbus/bluetooth_gatt_descriptor_client.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": []
}
|
package org.killbill.billing.util.customfield.dao;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import javax.annotation.Nullable;
import org.skife.jdbi.v2.IDBI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.killbill.billing.BillingExceptionBase;
import org.killbill.billing.ErrorCode;
import org.killbill.billing.ObjectType;
import org.killbill.bus.api.PersistentBus;
import org.killbill.billing.callcontext.InternalCallContext;
import org.killbill.billing.callcontext.InternalTenantContext;
import org.killbill.clock.Clock;
import org.killbill.billing.events.BusInternalEvent;
import org.killbill.billing.util.api.CustomFieldApiException;
import org.killbill.billing.util.audit.ChangeType;
import org.killbill.billing.util.cache.CacheControllerDispatcher;
import org.killbill.billing.util.customfield.CustomField;
import org.killbill.billing.util.customfield.api.DefaultCustomFieldCreationEvent;
import org.killbill.billing.util.customfield.api.DefaultCustomFieldDeletionEvent;
import org.killbill.billing.util.dao.NonEntityDao;
import org.killbill.billing.util.entity.Pagination;
import org.killbill.billing.util.entity.dao.DefaultPaginationSqlDaoHelper.PaginationIteratorBuilder;
import org.killbill.billing.util.entity.dao.EntityDaoBase;
import org.killbill.billing.util.entity.dao.EntitySqlDao;
import org.killbill.billing.util.entity.dao.EntitySqlDaoTransactionWrapper;
import org.killbill.billing.util.entity.dao.EntitySqlDaoTransactionalJdbiWrapper;
import org.killbill.billing.util.entity.dao.EntitySqlDaoWrapperFactory;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableList;
import com.google.inject.Inject;
public class DefaultCustomFieldDao extends EntityDaoBase<CustomFieldModelDao, CustomField, CustomFieldApiException> implements CustomFieldDao {
private static final Logger log = LoggerFactory.getLogger(DefaultCustomFieldDao.class);
private final PersistentBus bus;
@Inject
public DefaultCustomFieldDao(final IDBI dbi, final Clock clock, final CacheControllerDispatcher controllerDispatcher, final NonEntityDao nonEntityDao, final PersistentBus bus) {
super(new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, controllerDispatcher, nonEntityDao), CustomFieldSqlDao.class);
this.bus = bus;
}
@Override
public List<CustomFieldModelDao> getCustomFieldsForObject(final UUID objectId, final ObjectType objectType, final InternalTenantContext context) {
return transactionalSqlDao.execute(new EntitySqlDaoTransactionWrapper<List<CustomFieldModelDao>>() {
@Override
public List<CustomFieldModelDao> inTransaction(final EntitySqlDaoWrapperFactory<EntitySqlDao> entitySqlDaoWrapperFactory) throws Exception {
return entitySqlDaoWrapperFactory.become(CustomFieldSqlDao.class).getCustomFieldsForObject(objectId, objectType, context);
}
});
}
@Override
public List<CustomFieldModelDao> getCustomFieldsForAccountType(final ObjectType objectType, final InternalTenantContext context) {
final List<CustomFieldModelDao> allFields = getCustomFieldsForAccount(context);
return ImmutableList.<CustomFieldModelDao>copyOf(Collections2.filter(allFields, new Predicate<CustomFieldModelDao>() {
@Override
public boolean apply(@Nullable final CustomFieldModelDao input) {
return input.getObjectType() == objectType;
}
}));
}
@Override
public List<CustomFieldModelDao> getCustomFieldsForAccount(final InternalTenantContext context) {
return transactionalSqlDao.execute(new EntitySqlDaoTransactionWrapper<List<CustomFieldModelDao>>() {
@Override
public List<CustomFieldModelDao> inTransaction(final EntitySqlDaoWrapperFactory<EntitySqlDao> entitySqlDaoWrapperFactory) throws Exception {
return entitySqlDaoWrapperFactory.become(CustomFieldSqlDao.class).getByAccountRecordId(context);
}
});
}
@Override
public void deleteCustomField(final UUID customFieldId, final InternalCallContext context) throws CustomFieldApiException {
transactionalSqlDao.execute(new EntitySqlDaoTransactionWrapper<Void>() {
@Override
public Void inTransaction(final EntitySqlDaoWrapperFactory<EntitySqlDao> entitySqlDaoWrapperFactory) throws Exception {
entitySqlDaoWrapperFactory.become(CustomFieldSqlDao.class).markTagAsDeleted(customFieldId.toString(), context);
return null;
}
});
}
@Override
protected CustomFieldApiException generateAlreadyExistsException(final CustomFieldModelDao entity, final InternalCallContext context) {
return new CustomFieldApiException(ErrorCode.CUSTOM_FIELD_ALREADY_EXISTS, entity.getId());
}
@Override
protected void postBusEventFromTransaction(final CustomFieldModelDao customField, final CustomFieldModelDao savedCustomField, final ChangeType changeType,
final EntitySqlDaoWrapperFactory<EntitySqlDao> entitySqlDaoWrapperFactory, final InternalCallContext context)
throws BillingExceptionBase {
BusInternalEvent customFieldEvent = null;
switch (changeType) {
case INSERT:
customFieldEvent = new DefaultCustomFieldCreationEvent(customField.getId(), customField.getObjectId(), customField.getObjectType(),
context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken());
break;
case DELETE:
customFieldEvent = new DefaultCustomFieldDeletionEvent(customField.getId(), customField.getObjectId(), customField.getObjectType(),
context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken());
break;
default:
return;
}
try {
bus.postFromTransaction(customFieldEvent, entitySqlDaoWrapperFactory.getSqlDao());
} catch (PersistentBus.EventBusException e) {
log.warn("Failed to post tag event for custom field " + customField.getId().toString(), e);
}
}
@Override
public Pagination<CustomFieldModelDao> searchCustomFields(final String searchKey, final Long offset, final Long limit, final InternalTenantContext context) {
return paginationHelper.getPagination(CustomFieldSqlDao.class,
new PaginationIteratorBuilder<CustomFieldModelDao, CustomField, CustomFieldSqlDao>() {
@Override
public Long getCount(final CustomFieldSqlDao customFieldSqlDao, final InternalTenantContext context) {
return customFieldSqlDao.getSearchCount(searchKey, String.format("%%%s%%", searchKey), context);
}
@Override
public Iterator<CustomFieldModelDao> build(final CustomFieldSqlDao customFieldSqlDao, final Long limit, final InternalTenantContext context) {
return customFieldSqlDao.search(searchKey, String.format("%%%s%%", searchKey), offset, limit, context);
}
},
offset,
limit,
context);
}
}
|
{
"content_hash": "2512f959c90cfe1101f3ef37119abd27",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 192,
"avg_line_length": 53.14093959731544,
"alnum_prop": 0.6905784288961859,
"repo_name": "kares/killbill",
"id": "0791c2dd4bce9f5b12c57f4b8249846ff3145657",
"size": "8540",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "util/src/main/java/org/killbill/billing/util/customfield/dao/DefaultCustomFieldDao.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "90220"
},
{
"name": "Java",
"bytes": "6783984"
},
{
"name": "JavaScript",
"bytes": "528124"
},
{
"name": "Ruby",
"bytes": "6721"
},
{
"name": "Shell",
"bytes": "14196"
}
]
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FellSky.Game.Space.Terrain
{
class Nebula
{
}
}
|
{
"content_hash": "edbb0eb69bc6f803b09b5f76d2d26fbb",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 36,
"avg_line_length": 15.666666666666666,
"alnum_prop": 0.7340425531914894,
"repo_name": "markgarcia/Fell-Sky",
"id": "b4ef8d7e7d94ff9e3811fb41e57ed47924d82713",
"size": "190",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "FellSky/Game/Space/Terrain/Nebula.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "467402"
},
{
"name": "CSS",
"bytes": "2789"
},
{
"name": "FLUX",
"bytes": "1352"
},
{
"name": "HLSL",
"bytes": "7879"
}
]
}
|
@interface MainAppViewController () {
NSDictionary *lastStatus;
}
@property (strong, nonatomic) ISO8601DateFormatter *dateFormatter;
@property (strong, nonatomic) NSTimeZone *utcTimeZone;
@property (strong, nonatomic) NightScoutUploader *uploader;
@end
@implementation MainAppViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Hitting a crash like this:
// http://stackoverflow.com/questions/26656342/uiwebview-random-crash-at-uiviewanimationstate-release-message-sent-to-deallo
// Looks like switching NightscoutWebView to WKWebView should help. Until then:
[UIView setAnimationsEnabled:NO];
_dateFormatter = [[ISO8601DateFormatter alloc] init];
_dateFormatter.includeTime = YES;
_dateFormatter.defaultTimeZone = [NSTimeZone timeZoneWithName:@"UTC"];
self.uploader = [[NightScoutUploader alloc] init];
self.uploader.endpoint = [[Config sharedInstance] nightscoutURL];
self.uploader.APISecret = [[Config sharedInstance] nightscoutAPISecret];
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
self.managedObjectContext = appDelegate.managedObjectContext;
[self setupAutoConnect];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
NSLog(@"Stopping scan");
[RileyLinkBLEManager sharedManager].scanningEnabled = NO;
}
- (void)setupAutoConnect {
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"RileyLinkRecord"
inManagedObjectContext:self.managedObjectContext];
[fetchRequest setEntity:entity];
NSError *error;
NSMutableArray *autoConnectIds = [NSMutableArray array];
NSArray *fetchedObjects = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];
for (RileyLinkRecord *record in fetchedObjects) {
NSLog(@"Loaded: %@ from db", record.name);
if ([record.autoConnect boolValue]) {
[autoConnectIds addObject:record.peripheralId];
}
}
[[RileyLinkBLEManager sharedManager] setAutoConnectIds:autoConnectIds];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark GlucoseLinkDelegate methods
- (void)rileyLink:(RileyLinkBLEManager *)rileyLink didReceivePacket:(MinimedPacket*)packet {
[self.uploader addPacket:packet];
}
- (void)rileyLink:(RileyLinkBLEManager *)rileyLink updatedStatus:(NSDictionary*)status {
lastStatus = status;
// TODO: find place to display, now that we're using nightscout
}
@end
|
{
"content_hash": "b6a9b58381df993ba68ce805969df597",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 126,
"avg_line_length": 31.878048780487806,
"alnum_prop": 0.7536342769701607,
"repo_name": "mddub/rileylink_ios",
"id": "0d454f39f3b220b8cf66ab273dcdf058e313d1ec",
"size": "3059",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RileyLink/MainAppViewController.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "280295"
},
{
"name": "Ruby",
"bytes": "6015"
}
]
}
|
/*
*= require bootstrap/dist/css/bootstrap
*= require_tree .
*= require_self
*/
|
{
"content_hash": "ebc7951e380e55c32b75c204ec59332d",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 40,
"avg_line_length": 16.8,
"alnum_prop": 0.6428571428571429,
"repo_name": "ricale/linkroup",
"id": "a3b073d289839e09ecd7de3f34c6e708701a08f9",
"size": "84",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/assets/stylesheets/application.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "111"
},
{
"name": "HTML",
"bytes": "5206"
},
{
"name": "JavaScript",
"bytes": "6582"
},
{
"name": "Ruby",
"bytes": "35157"
}
]
}
|
from allauth.socialaccount.tests import OAuth2TestsMixin
from allauth.tests import MockedResponse, TestCase
from .provider import LineProvider
class LineTests(OAuth2TestsMixin, TestCase):
provider_id = LineProvider.id
def get_mocked_response(self):
return MockedResponse(200, """
{
"mid": "u7d47d26a6bab09b95695ff02d1a36e38",
"displayName": "\uc774\uc0c1\ud601",
"pictureUrl":
"http://dl.profile.line-cdn.net/0m055ab14d725138288331268c45ac5286a35482fb794a"
}""")
|
{
"content_hash": "0bab7ed89bc55e9be44c6db240a76d12",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 79,
"avg_line_length": 28.41176470588235,
"alnum_prop": 0.7763975155279503,
"repo_name": "spool/django-allauth",
"id": "2b5f9369eef39ace3ab55314adccc9224b9abf18",
"size": "483",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "allauth/socialaccount/providers/line/tests.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "42116"
},
{
"name": "JavaScript",
"bytes": "3388"
},
{
"name": "Makefile",
"bytes": "694"
},
{
"name": "Python",
"bytes": "623679"
}
]
}
|
package org.kie.workbench.common.dmn.client.marshaller.converters.dd;
import java.util.List;
import java.util.Objects;
import java.util.function.BiFunction;
import java.util.function.Function;
import jsinterop.base.Js;
import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dc.JSIBounds;
import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dc.JSIPoint;
import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNShape;
import org.kie.workbench.common.stunner.core.graph.Edge;
import org.kie.workbench.common.stunner.core.graph.Node;
import org.kie.workbench.common.stunner.core.graph.content.Bound;
import org.kie.workbench.common.stunner.core.graph.content.Bounds;
import org.kie.workbench.common.stunner.core.graph.content.relationship.Child;
import org.kie.workbench.common.stunner.core.graph.content.view.Point2D;
import org.kie.workbench.common.stunner.core.graph.content.view.View;
public class PointUtils {
private PointUtils() {
// util class.
}
public static JSIPoint point2dToDMNDIPoint(final Point2D point2d) {
final JSIPoint result = new JSIPoint();
result.setX(point2d.getX());
result.setY(point2d.getY());
return result;
}
public static Point2D dmndiPointToPoint2D(final JSIPoint dmndiPoint) {
return new Point2D(dmndiPoint.getX(), dmndiPoint.getY());
}
// In Stunner terms the location of a child (target) is always relative to the
// Parent (source) location however DMN requires all locations to be absolute.
public static void convertToAbsoluteBounds(final Node<?, ?> targetNode) {
convertBounds(targetNode, Double::sum);
}
// In DMN terms the location of a Node is always absolute however Stunner requires
// children (target) to have a relative location to their Parent (source).
public static void convertToRelativeBounds(final Node<?, ?> targetNode) {
convertBounds(targetNode,
(base, delta) -> base - delta);
}
@SuppressWarnings("unchecked")
private static void convertBounds(final Node<?, ?> targetNode,
final BiFunction<Double, Double, Double> converter) {
if (targetNode.getContent() instanceof View<?>) {
final View<?> targetNodeView = (View<?>) targetNode.getContent();
double boundsX = xOfBound(upperLeftBound(targetNodeView));
double boundsY = yOfBound(upperLeftBound(targetNodeView));
final double boundsWidth = xOfBound(lowerRightBound(targetNodeView)) - boundsX;
final double boundsHeight = yOfBound(lowerRightBound(targetNodeView)) - boundsY;
final List<Edge<?, ?>> inEdges = (List<Edge<?, ?>>) targetNode.getInEdges();
for (Edge<?, ?> e : inEdges) {
if (e.getContent() instanceof Child) {
final Node<?, ?> sourceNode = e.getSourceNode();
final View<?> sourceView = (View<?>) sourceNode.getContent();
final Bound sourceViewULBound = sourceView.getBounds().getUpperLeft();
final double dx = sourceViewULBound.getX();
final double dy = sourceViewULBound.getY();
boundsX = converter.apply(boundsX, dx);
boundsY = converter.apply(boundsY, dy);
targetNodeView.setBounds(Bounds.create(boundsX, boundsY, boundsX + boundsWidth, boundsY + boundsHeight));
break;
}
}
}
}
public static double xOfShape(final JSIDMNShape shape) {
return extractValue(shape,
bounds -> {
final JSIBounds _bounds = Js.uncheckedCast(bounds);
return _bounds.getX();
});
}
public static double yOfShape(final JSIDMNShape shape) {
return extractValue(shape,
bounds -> {
final JSIBounds _bounds = Js.uncheckedCast(bounds);
return _bounds.getY();
});
}
public static double widthOfShape(final JSIDMNShape shape) {
return extractValue(shape,
bounds -> {
final JSIBounds _bounds = Js.uncheckedCast(bounds);
return _bounds.getWidth();
});
}
public static double heightOfShape(final JSIDMNShape shape) {
return extractValue(shape,
bounds -> {
final JSIBounds _bounds = Js.uncheckedCast(bounds);
return _bounds.getHeight();
});
}
public static Bound upperLeftBound(final View view) {
return extractBounds(view, Bounds::getUpperLeft);
}
public static Bound lowerRightBound(final View view) {
return extractBounds(view, Bounds::getLowerRight);
}
public static double xOfBound(final Bound bound) {
return extractBound(bound, Bound::getX);
}
public static double yOfBound(final Bound bound) {
return extractBound(bound, Bound::getY);
}
private static double extractValue(final JSIDMNShape shape,
final Function<JSIBounds, Double> extractor) {
if (Objects.nonNull(shape)) {
final JSIDMNShape _shape = Js.uncheckedCast(shape);
if (Objects.nonNull(_shape.getBounds())) {
final JSIBounds bounds = Js.uncheckedCast(_shape.getBounds());
return extractor.apply(bounds);
}
}
return 0.0;
}
private static Bound extractBounds(final View view,
final Function<Bounds, Bound> extractor) {
if (Objects.nonNull(view)) {
if (Objects.nonNull(view.getBounds())) {
return extractor.apply(view.getBounds());
}
}
return null;
}
private static double extractBound(final Bound bound,
final Function<Bound, Double> extractor) {
if (Objects.nonNull(bound)) {
return extractor.apply(bound);
}
return 0.0;
}
}
|
{
"content_hash": "477d08c5de850639d492c4b9c22e0a24",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 125,
"avg_line_length": 41.33548387096774,
"alnum_prop": 0.5966911190884969,
"repo_name": "droolsjbpm/kie-wb-common",
"id": "4cc8b36fcbd10812a82258a76313a4c6382707cb",
"size": "7026",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/marshaller/converters/dd/PointUtils.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "38549"
},
{
"name": "FreeMarker",
"bytes": "37490"
},
{
"name": "GAP",
"bytes": "86275"
},
{
"name": "HTML",
"bytes": "127323"
},
{
"name": "Java",
"bytes": "19056067"
}
]
}
|
// Copyright (C) 2014 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.query.change;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.gerrit.index.query.Predicate.and;
import static com.google.gerrit.index.query.Predicate.not;
import static com.google.gerrit.index.query.Predicate.or;
import static com.google.gerrit.server.query.change.ChangeStatusPredicate.open;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.gerrit.index.IndexConfig;
import com.google.gerrit.index.query.InternalQuery;
import com.google.gerrit.index.query.Predicate;
import com.google.gerrit.reviewdb.client.Branch;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.client.RefNames;
import com.google.gerrit.server.index.change.ChangeIndexCollection;
import com.google.gerrit.server.notedb.ChangeNotes;
import com.google.inject.Inject;
import com.google.inject.Provider;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.Supplier;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
/**
* Query wrapper for the change index.
*
* <p>Instances are one-time-use. Other singleton classes should inject a Provider rather than
* holding on to a single instance.
*/
public class InternalChangeQuery extends InternalQuery<ChangeData, InternalChangeQuery> {
private static Predicate<ChangeData> ref(Branch.NameKey branch) {
return new RefPredicate(branch.get());
}
private static Predicate<ChangeData> change(Change.Key key) {
return new ChangeIdPredicate(key.get());
}
private static Predicate<ChangeData> project(Project.NameKey project) {
return new ProjectPredicate(project.get());
}
private static Predicate<ChangeData> status(Change.Status status) {
return ChangeStatusPredicate.forStatus(status);
}
private static Predicate<ChangeData> commit(String id) {
return new CommitPredicate(id);
}
private final ChangeData.Factory changeDataFactory;
private final ChangeNotes.Factory notesFactory;
@Inject
InternalChangeQuery(
ChangeQueryProcessor queryProcessor,
ChangeIndexCollection indexes,
IndexConfig indexConfig,
ChangeData.Factory changeDataFactory,
ChangeNotes.Factory notesFactory) {
super(queryProcessor, indexes, indexConfig);
this.changeDataFactory = changeDataFactory;
this.notesFactory = notesFactory;
}
public List<ChangeData> byKey(Change.Key key) {
return byKeyPrefix(key.get());
}
public List<ChangeData> byKeyPrefix(String prefix) {
return query(new ChangeIdPredicate(prefix));
}
public List<ChangeData> byLegacyChangeId(Change.Id id) {
return query(new LegacyChangeIdPredicate(id));
}
public List<ChangeData> byLegacyChangeIds(Collection<Change.Id> ids) {
List<Predicate<ChangeData>> preds = new ArrayList<>(ids.size());
for (Change.Id id : ids) {
preds.add(new LegacyChangeIdPredicate(id));
}
return query(or(preds));
}
public List<ChangeData> byBranchKey(Branch.NameKey branch, Change.Key key) {
return query(byBranchKeyPred(branch, key));
}
public List<ChangeData> byBranchKeyOpen(Project.NameKey project, String branch, Change.Key key) {
return query(and(byBranchKeyPred(new Branch.NameKey(project, branch), key), open()));
}
public static Predicate<ChangeData> byBranchKeyOpenPred(
Project.NameKey project, String branch, Change.Key key) {
return and(byBranchKeyPred(new Branch.NameKey(project, branch), key), open());
}
private static Predicate<ChangeData> byBranchKeyPred(Branch.NameKey branch, Change.Key key) {
return and(ref(branch), project(branch.getParentKey()), change(key));
}
public List<ChangeData> byProject(Project.NameKey project) {
return query(project(project));
}
public List<ChangeData> byBranchOpen(Branch.NameKey branch) {
return query(and(ref(branch), project(branch.getParentKey()), open()));
}
public List<ChangeData> byBranchNew(Branch.NameKey branch) {
return query(and(ref(branch), project(branch.getParentKey()), status(Change.Status.NEW)));
}
public Iterable<ChangeData> byCommitsOnBranchNotMerged(
Repository repo, Branch.NameKey branch, Collection<String> hashes) throws IOException {
return byCommitsOnBranchNotMerged(
repo,
branch,
hashes,
// Account for all commit predicates plus ref, project, status.
indexConfig.maxTerms() - 3);
}
@VisibleForTesting
Iterable<ChangeData> byCommitsOnBranchNotMerged(
Repository repo, Branch.NameKey branch, Collection<String> hashes, int indexLimit)
throws IOException {
if (hashes.size() > indexLimit) {
return byCommitsOnBranchNotMergedFromDatabase(repo, branch, hashes);
}
return byCommitsOnBranchNotMergedFromIndex(branch, hashes);
}
private Iterable<ChangeData> byCommitsOnBranchNotMergedFromDatabase(
Repository repo, Branch.NameKey branch, Collection<String> hashes) throws IOException {
Set<Change.Id> changeIds = Sets.newHashSetWithExpectedSize(hashes.size());
String lastPrefix = null;
for (Ref ref : repo.getRefDatabase().getRefsByPrefix(RefNames.REFS_CHANGES)) {
String r = ref.getName();
if ((lastPrefix != null && r.startsWith(lastPrefix))
|| !hashes.contains(ref.getObjectId().name())) {
continue;
}
Change.Id id = Change.Id.fromRef(r);
if (id == null) {
continue;
}
if (changeIds.add(id)) {
lastPrefix = r.substring(0, r.lastIndexOf('/'));
}
}
List<ChangeNotes> notes =
notesFactory.create(
branch.getParentKey(),
changeIds,
cn -> {
Change c = cn.getChange();
return c.getDest().equals(branch) && !c.isMerged();
});
return Lists.transform(notes, n -> changeDataFactory.create(n));
}
private Iterable<ChangeData> byCommitsOnBranchNotMergedFromIndex(
Branch.NameKey branch, Collection<String> hashes) {
return query(
and(
ref(branch),
project(branch.getParentKey()),
not(status(Change.Status.MERGED)),
or(commits(hashes))));
}
private static List<Predicate<ChangeData>> commits(Collection<String> hashes) {
List<Predicate<ChangeData>> commits = new ArrayList<>(hashes.size());
for (String s : hashes) {
commits.add(commit(s));
}
return commits;
}
public List<ChangeData> byProjectOpen(Project.NameKey project) {
return query(and(project(project), open()));
}
public List<ChangeData> byTopicOpen(String topic) {
return query(and(new ExactTopicPredicate(topic), open()));
}
public List<ChangeData> byCommit(ObjectId id) {
return byCommit(id.name());
}
public List<ChangeData> byCommit(String hash) {
return query(commit(hash));
}
public List<ChangeData> byProjectCommit(Project.NameKey project, ObjectId id) {
return byProjectCommit(project, id.name());
}
public List<ChangeData> byProjectCommit(Project.NameKey project, String hash) {
return query(and(project(project), commit(hash)));
}
public List<ChangeData> byProjectCommits(Project.NameKey project, List<String> hashes) {
int n = indexConfig.maxTerms() - 1;
checkArgument(hashes.size() <= n, "cannot exceed %s commits", n);
return query(and(project(project), or(commits(hashes))));
}
public List<ChangeData> byBranchCommit(String project, String branch, String hash) {
return query(byBranchCommitPred(project, branch, hash));
}
public List<ChangeData> byBranchCommit(Branch.NameKey branch, String hash) {
return byBranchCommit(branch.getParentKey().get(), branch.get(), hash);
}
public List<ChangeData> byBranchCommitOpen(String project, String branch, String hash) {
return query(and(byBranchCommitPred(project, branch, hash), open()));
}
public static Predicate<ChangeData> byBranchCommitOpenPred(
Project.NameKey project, String branch, String hash) {
return and(byBranchCommitPred(project.get(), branch, hash), open());
}
private static Predicate<ChangeData> byBranchCommitPred(
String project, String branch, String hash) {
return and(new ProjectPredicate(project), new RefPredicate(branch), commit(hash));
}
public List<ChangeData> bySubmissionId(String cs) {
if (Strings.isNullOrEmpty(cs)) {
return Collections.emptyList();
}
return query(new SubmissionIdPredicate(cs));
}
private static Predicate<ChangeData> byProjectGroupsPredicate(
IndexConfig indexConfig, Project.NameKey project, Collection<String> groups) {
int n = indexConfig.maxTerms() - 1;
checkArgument(groups.size() <= n, "cannot exceed %s groups", n);
List<GroupPredicate> groupPredicates = new ArrayList<>(groups.size());
for (String g : groups) {
groupPredicates.add(new GroupPredicate(g));
}
return and(project(project), or(groupPredicates));
}
public static List<ChangeData> byProjectGroups(
Provider<InternalChangeQuery> queryProvider,
IndexConfig indexConfig,
Project.NameKey project,
Collection<String> groups) {
// These queries may be complex along multiple dimensions:
// * Many groups per change, if there are very many patch sets. This requires partitioning the
// list of predicates and combining results.
// * Many changes with the same set of groups, if the relation chain is very long. This
// requires querying exhaustively with pagination.
// For both cases, we need to invoke the queryProvider multiple times, since each
// InternalChangeQuery is single-use.
Supplier<InternalChangeQuery> querySupplier = () -> queryProvider.get().enforceVisibility(true);
int batchSize = indexConfig.maxTerms() - 1;
if (groups.size() <= batchSize) {
return queryExhaustively(
querySupplier, byProjectGroupsPredicate(indexConfig, project, groups));
}
Set<Change.Id> seen = new HashSet<>();
List<ChangeData> result = new ArrayList<>();
for (List<String> part : Iterables.partition(groups, batchSize)) {
for (ChangeData cd :
queryExhaustively(querySupplier, byProjectGroupsPredicate(indexConfig, project, part))) {
if (!seen.add(cd.getId())) {
result.add(cd);
}
}
}
return result;
}
}
|
{
"content_hash": "2ce4d5ce1fd40d863c760881581a9383",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 100,
"avg_line_length": 36.543408360128616,
"alnum_prop": 0.7175538935327761,
"repo_name": "qtproject/qtqa-gerrit",
"id": "74a0f71d1a2984483afc00c73b68e27142e92a0f",
"size": "11365",
"binary": false,
"copies": "1",
"ref": "refs/heads/upstream/stable-3.0",
"path": "java/com/google/gerrit/server/query/change/InternalChangeQuery.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "48801"
},
{
"name": "GAP",
"bytes": "4303"
},
{
"name": "Go",
"bytes": "1865"
},
{
"name": "Groff",
"bytes": "28221"
},
{
"name": "HTML",
"bytes": "57863"
},
{
"name": "Java",
"bytes": "8471079"
},
{
"name": "JavaScript",
"bytes": "1590"
},
{
"name": "Makefile",
"bytes": "1313"
},
{
"name": "PLpgSQL",
"bytes": "4462"
},
{
"name": "Perl",
"bytes": "9943"
},
{
"name": "Prolog",
"bytes": "17711"
},
{
"name": "Python",
"bytes": "7074"
},
{
"name": "Shell",
"bytes": "47588"
}
]
}
|
Small programs written in Go
|
{
"content_hash": "0c1d18b0f3f010805cb59edd83502153",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 29,
"alnum_prop": 0.8275862068965517,
"repo_name": "kkshetty/golang-samples",
"id": "99e1c10b2ffd42244fd5723e8540259a7099627a",
"size": "46",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "803"
}
]
}
|
package net.worph.filesytem.IOAbstractionLayer.memoryMappedImpl;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.net.URI;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.worph.filesytem.IOAbstractionLayer.BytePack;
/**
*
* @author Worph
*/
public class MemoryMapedFile implements BytePack{
private MappedByteBuffer buffer;
private FileChannel channel;
public MemoryMapedFile(URI fileLocation,int maxSize) {
try {
Path path = Paths.get(fileLocation);
channel = new RandomAccessFile(path.toFile(), "rw").getChannel();
buffer = channel.map(FileChannel.MapMode.READ_WRITE, 0, maxSize);
buffer.limit(maxSize);
buffer.position(0);
} catch (IOException ex) {
Logger.getLogger(MemoryMapedFile.class.getName()).log(Level.SEVERE, null, ex);
}
}
@Override
public void flush(){
buffer.force();
}
@Override
public void close() {
try {
channel.close();
} catch (IOException ex) {
Logger.getLogger(MemoryMapedFile.class.getName()).log(Level.SEVERE, null, ex);
}
}
public int read(ByteBuffer dst) throws IOException {
int i = dst.remaining();
buffer.get(dst.array(), dst.position(),i);
return i;
}
public int read(ByteBuffer dst, long position) throws IOException {
buffer.position((int) position);
return read(dst);
}
public int write(ByteBuffer src) throws IOException {
int i = src.remaining();
buffer.put(src);
return i;
}
public int write(ByteBuffer src, long position) throws IOException {
buffer.position((int) position);
return write(src);
}
public long position() throws IOException {
return buffer.position();
}
public void position(long newPosition) throws IOException {
buffer.position((int) newPosition);
}
public long capacity() throws IOException{
return buffer.capacity();
}
public long size() throws IOException {
return buffer.capacity();
}
}
|
{
"content_hash": "e207593e8f5e11072029630c73ff227e",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 90,
"avg_line_length": 26.71590909090909,
"alnum_prop": 0.6401531263292216,
"repo_name": "worph/WFS",
"id": "79ba7133a1cc15ffdd993ec32f19d1ed85dba76f",
"size": "2351",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/net/worph/filesytem/IOAbstractionLayer/memoryMappedImpl/MemoryMapedFile.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "93587"
}
]
}
|
package Paws::WAFRegional::GetSqlInjectionMatchSet;
use Moose;
has SqlInjectionMatchSetId => (is => 'ro', isa => 'Str', required => 1);
use MooseX::ClassAttribute;
class_has _api_call => (isa => 'Str', is => 'ro', default => 'GetSqlInjectionMatchSet');
class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::WAFRegional::GetSqlInjectionMatchSetResponse');
class_has _result_key => (isa => 'Str', is => 'ro');
1;
### main pod documentation begin ###
=head1 NAME
Paws::WAFRegional::GetSqlInjectionMatchSet - Arguments for method GetSqlInjectionMatchSet on Paws::WAFRegional
=head1 DESCRIPTION
This class represents the parameters used for calling the method GetSqlInjectionMatchSet on the
AWS WAF Regional service. Use the attributes of this class
as arguments to method GetSqlInjectionMatchSet.
You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to GetSqlInjectionMatchSet.
As an example:
$service_obj->GetSqlInjectionMatchSet(Att1 => $value1, Att2 => $value2, ...);
Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
=head1 ATTRIBUTES
=head2 B<REQUIRED> SqlInjectionMatchSetId => Str
The C<SqlInjectionMatchSetId> of the SqlInjectionMatchSet that you want
to get. C<SqlInjectionMatchSetId> is returned by
CreateSqlInjectionMatchSet and by ListSqlInjectionMatchSets.
=head1 SEE ALSO
This class forms part of L<Paws>, documenting arguments for method GetSqlInjectionMatchSet in L<Paws::WAFRegional>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: https://github.com/pplu/aws-sdk-perl
Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
=cut
|
{
"content_hash": "aa2f29e212aff76609ffe0bbbcc48752",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 249,
"avg_line_length": 34.09090909090909,
"alnum_prop": 0.7584,
"repo_name": "ioanrogers/aws-sdk-perl",
"id": "f8216055eeb0a1cd0211c8f8569114c6e5d25c2b",
"size": "1876",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "auto-lib/Paws/WAFRegional/GetSqlInjectionMatchSet.pm",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "1292"
},
{
"name": "Perl",
"bytes": "20360380"
},
{
"name": "Perl 6",
"bytes": "99393"
},
{
"name": "Shell",
"bytes": "445"
}
]
}
|
//******************************************************************************
// Project: Weather-based simulation framework (WBSF)
// Programmer: Rémi Saint-Amant
//
// It under the terms of the GNU General Public License as published by
// the Free Software Foundation
// It is provided "as is" without express or implied warranty.
//******************************************************************************
// 01-01-2016 Rémi Saint-Amant Include into Weather-based simulation framework
//****************************************************************************
#include "stdafx.h"
#include "GraphPropertyDlg.h"
namespace WBSF
{
// CGraphPropertyDlg dialog
IMPLEMENT_DYNAMIC(CGraphPropertyDlg, CDialog)
CGraphPropertyDlg::CGraphPropertyDlg(CWnd* pParent /*=NULL*/)
: CDialog(IDD, pParent)
{
// m_pointSymbol = 0;
// m_lineStyle = 0;
}
CGraphPropertyDlg::~CGraphPropertyDlg()
{
}
void CGraphPropertyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_GRAPH_TYPE, m_typeCtrl);
DDX_Control(pDX, IDC_GRAPH_COLOR, m_colorCtrl);
DDX_Control(pDX, IDC_GRAPH_POINT_SYMBOL, m_pointSymbolCtrl);
DDX_Control(pDX, IDC_GRAPH_POINT_SIZE, m_pointSizeCtrl);
DDX_Control(pDX, IDC_GRAPH_LINE_STYLE, m_lineStyleCtrl);
DDX_Control(pDX, IDC_GRAPH_LINE_WIDTH, m_lineWithCtrl);
DDX_Control(pDX, IDC_GRAPH_SMOOTH, m_smoothCtrl);
m_colorCtrl.EnableOtherButton(_T("other"));
if (pDX->m_bSaveAndValidate)
{
//m_graphDefine.m_bXAxis = m_XAxisCtrl.GetCheck();
m_graphDefine.m_type = m_typeCtrl.GetCurSel();
m_graphDefine.m_symbolColor = m_colorCtrl.GetColor();
m_graphDefine.m_symbolType = m_pointSymbolCtrl.GetCurSel();
m_graphDefine.m_symbolHeight = m_graphDefine.m_lineWidth = ToInt(m_pointSizeCtrl.GetString());
m_graphDefine.m_lineWidth = ToInt(m_lineWithCtrl.GetString());
m_graphDefine.m_lineColor = m_colorCtrl.GetColor();
m_graphDefine.m_lineStyle = m_lineStyleCtrl.GetCurSel();
m_graphDefine.m_bLineSmoothed = m_smoothCtrl.GetCheck();
}
else
{
//m_XAxisCtrl.SetCheck(m_graphDefine.m_bXAxis);
m_typeCtrl.SetCurSel(m_graphDefine.m_type);
m_colorCtrl.SetColumnsNumber(10);
m_colorCtrl.SetColor(m_graphDefine.m_symbolColor);
m_pointSymbolCtrl.SetCurSel(m_graphDefine.m_symbolType);
m_pointSizeCtrl.SetWindowText(ToString(m_graphDefine.m_symbolHeight));
m_lineStyleCtrl.SetCurSel(m_graphDefine.m_lineStyle);
m_lineWithCtrl.SetWindowText(ToString(m_graphDefine.m_lineWidth));
m_smoothCtrl.SetCheck(m_graphDefine.m_bLineSmoothed);
}
}
BEGIN_MESSAGE_MAP(CGraphPropertyDlg, CDialog)
END_MESSAGE_MAP()
}
|
{
"content_hash": "6a39f9ac04c0545869c82e7cbcea18f0",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 97,
"avg_line_length": 35.1025641025641,
"alnum_prop": 0.6504747991234477,
"repo_name": "RNCan/WeatherBasedSimulationFramework",
"id": "4664b528b47019d8a5a0138089b119b88a34bacf",
"size": "2738",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wbs/src/UI/GraphPropertyDlg.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "25087"
},
{
"name": "C",
"bytes": "304223"
},
{
"name": "C#",
"bytes": "16020"
},
{
"name": "C++",
"bytes": "15327220"
},
{
"name": "HTML",
"bytes": "29355"
},
{
"name": "Python",
"bytes": "2061"
}
]
}
|
<?php helpers\assets::js(array(
helpers\url::template_path() . 'js/jquery.js',
helpers\url::template_path() . 'js/bootstrap.min.js',
)); ?>
</body>
</html>
|
{
"content_hash": "39121d135b20f20602a11ad7d8089a4d",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 55,
"avg_line_length": 26.5,
"alnum_prop": 0.6352201257861635,
"repo_name": "AvRrS/charleyproject-v2",
"id": "3084e045ccbb5e3959b3a4c616a5cafb89a151a5",
"size": "159",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/templates/MacAdmin/footerLite.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "443"
},
{
"name": "CSS",
"bytes": "61139"
},
{
"name": "HTML",
"bytes": "2"
},
{
"name": "JavaScript",
"bytes": "39251"
},
{
"name": "PHP",
"bytes": "324525"
}
]
}
|
#include <stdio.h>
#include <err.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "configuration.h"
#include "fieldprinter.h"
#include "stringlist.h"
#include "tokenizer.h"
#include "wrappers.h"
int main(int argc, char **argv)
{
CONFIGURATION *configuration = configuration_new(argc, argv);
FILE *input = stdin;
if (configuration->file)
{
Fclose(stdin);
input = Fopen(configuration->file, "r");
}
setvbuf(input, (char *) NULL, _IOLBF, 0);
setvbuf(stdout, (char *) NULL, _IOLBF, 0);
TOKENIZER *tokenizer = tokenizer_new();
tokenizer_enable_empty_tokens(tokenizer,
configuration->allow_empty_tokens);
tokenizer_enable_escaped_delimiters(tokenizer,
configuration->
backslash_escapes_delimiters);
tokenizer_enable_trimming(tokenizer, configuration->trim_non_alphanumeric);
if (configuration->ignore_quoted_delimiters)
{
tokenizer_set_quotes(tokenizer, configuration->quote_open,
configuration->quote_close);
}
tokenizer_set_delimiters(tokenizer, configuration->delimiters);
tokenizer_set_excludes(tokenizer, configuration->excludes);
FIELDPRINTER *printer = fieldprinter_new(configuration->fields,
configuration->separator,
configuration->empty_string);
size_t allocated_bytes = 128; // initial value can be modified by
// getline.
char *line = MALLOC_ARRAY(allocated_bytes, char);
while (Getline(&line, &allocated_bytes, input) != -1)
{
STRINGLIST *tokens = tokenizer_create_tokens(tokenizer, line);
fieldprinter_print(printer, tokens);
tokenizer_free_tokens(tokenizer);
}
Free(line);
fieldprinter_delete(printer);
tokenizer_delete(tokenizer);
Fclose(input);
configuration_delete(configuration);
exit(EXIT_SUCCESS);
}
|
{
"content_hash": "d95d7fbcf56b38680f19e126a0ef0a8c",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 79,
"avg_line_length": 35.189655172413794,
"alnum_prop": 0.615874571288584,
"repo_name": "johnmorrow/pk",
"id": "f6f624eba19a03469e5886487bbf32bc86d3a23c",
"size": "2650",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "773"
},
{
"name": "C",
"bytes": "36711"
},
{
"name": "M4",
"bytes": "584"
},
{
"name": "Makefile",
"bytes": "1265"
},
{
"name": "Ruby",
"bytes": "769"
},
{
"name": "Shell",
"bytes": "1664"
}
]
}
|
<?php
require_once __DIR__ . '/vendor/autoload.php';
use PhpAmqpLib\Connection\AMQPConnection;
$connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');
$channel = $connection->channel();
$channel->queue_declare('hello', false, false, false, false);
echo ' [*] Waiting for messages. To exit press CTRL+C', "\n";
$callback = function($msg) {
echo " [x] Received ", $msg->body, "\n";
};
$channel->basic_consume('hello', '', false, true, false, false, $callback);
while(count($channel->callbacks)) {
$channel->wait();
}
$channel->close();
$connection->close();
?>
|
{
"content_hash": "a12cf795880781a8418f5350f23e5f91",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 75,
"avg_line_length": 21.814814814814813,
"alnum_prop": 0.6502546689303905,
"repo_name": "thoven78/rabbitmq-tutorials",
"id": "325330e288e52ab0ce7f0ac5cab6282b563a6243",
"size": "589",
"binary": false,
"copies": "17",
"ref": "refs/heads/master",
"path": "php/receive.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "48416"
},
{
"name": "Clojure",
"bytes": "7620"
},
{
"name": "Erlang",
"bytes": "11282"
},
{
"name": "Go",
"bytes": "17418"
},
{
"name": "Haskell",
"bytes": "9727"
},
{
"name": "Java",
"bytes": "23386"
},
{
"name": "Makefile",
"bytes": "4371"
},
{
"name": "PHP",
"bytes": "9334"
},
{
"name": "Perl",
"bytes": "9442"
},
{
"name": "Python",
"bytes": "26206"
},
{
"name": "Ruby",
"bytes": "13397"
},
{
"name": "Shell",
"bytes": "272"
}
]
}
|
package com.loskut.dao.interfaces;
import com.loskut.model.ClothType;
/**
* Created by RAYANT on 16.01.2016.
*/
public interface ClothTypeDao extends GenericDao<Integer,ClothType> {
}
|
{
"content_hash": "9263aa5fc76d21735440d4132d6e51a7",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 69,
"avg_line_length": 20.88888888888889,
"alnum_prop": 0.7606382978723404,
"repo_name": "loskut-team/loskut",
"id": "05c6951675aa2e31b59d9ae9af9b0b20808f6300",
"size": "188",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/loskut/dao/interfaces/ClothTypeDao.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "211085"
},
{
"name": "Java",
"bytes": "297971"
},
{
"name": "JavaScript",
"bytes": "485076"
}
]
}
|
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CalendarDays = void 0;
var _jsxRuntime = require("../../lib/jsxRuntime");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var React = _interopRequireWildcard(require("react"));
var _date = require("../../lib/date");
var _CalendarDay = require("../CalendarDay/CalendarDay");
var _calendar = require("../../lib/calendar");
var _LocaleProviderContext = require("../LocaleProviderContext/LocaleProviderContext");
var _classNames = require("../../lib/classNames");
var _Caption = require("../Typography/Caption/Caption");
var _excluded = ["viewDate", "value", "weekStartsOn", "onDayChange", "isDaySelected", "isDayActive", "isDaySelectionEnd", "isDaySelectionStart", "onDayEnter", "onDayLeave", "isDayHinted", "isHintedDaySelectionStart", "isHintedDaySelectionEnd", "isDayFocused", "isDayDisabled", "size", "showNeighboringMonth", "dayProps"];
var CalendarDays = function CalendarDays(_ref) {
var viewDate = _ref.viewDate,
value = _ref.value,
weekStartsOn = _ref.weekStartsOn,
onDayChange = _ref.onDayChange,
isDaySelected = _ref.isDaySelected,
isDayActive = _ref.isDayActive,
isDaySelectionEnd = _ref.isDaySelectionEnd,
isDaySelectionStart = _ref.isDaySelectionStart,
onDayEnter = _ref.onDayEnter,
onDayLeave = _ref.onDayLeave,
isDayHinted = _ref.isDayHinted,
isHintedDaySelectionStart = _ref.isHintedDaySelectionStart,
isHintedDaySelectionEnd = _ref.isHintedDaySelectionEnd,
isDayFocused = _ref.isDayFocused,
isDayDisabled = _ref.isDayDisabled,
size = _ref.size,
_ref$showNeighboringM = _ref.showNeighboringMonth,
showNeighboringMonth = _ref$showNeighboringM === void 0 ? false : _ref$showNeighboringM,
dayProps = _ref.dayProps,
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
var locale = React.useContext(_LocaleProviderContext.LocaleProviderContext);
var ref = React.useRef(null);
var _React$useState = React.useState(new Date()),
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 1),
now = _React$useState2[0];
var weeks = React.useMemo(function () {
return (0, _calendar.getWeeks)(viewDate, weekStartsOn);
}, [weekStartsOn, viewDate]);
var daysNames = React.useMemo(function () {
return (0, _calendar.getDaysNames)(now, weekStartsOn, locale);
}, [locale, now, weekStartsOn]);
var handleDayChange = React.useCallback(function (date) {
var _ref$current;
onDayChange(date);
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
}, [onDayChange]);
return (0, _jsxRuntime.createScopedElement)("div", (0, _extends2.default)({}, props, {
vkuiClass: "CalendarDays",
ref: ref
}), (0, _jsxRuntime.createScopedElement)("div", {
vkuiClass: (0, _classNames.classNames)("CalendarDays__row", "CalendarDays__row--size-".concat(size))
}, daysNames.map(function (dayName) {
return (0, _jsxRuntime.createScopedElement)(_Caption.Caption, {
key: dayName,
level: "1",
vkuiClass: "CalendarDays__weekday"
}, dayName);
})), weeks.map(function (week, i) {
return (0, _jsxRuntime.createScopedElement)("div", {
vkuiClass: (0, _classNames.classNames)("CalendarDays__row", "CalendarDays__row--size-".concat(size)),
key: i
}, week.map(function (day, i) {
var sameMonth = (0, _date.isSameMonth)(day, viewDate);
return (0, _jsxRuntime.createScopedElement)(_CalendarDay.CalendarDay, (0, _extends2.default)({
key: day.toISOString(),
day: day,
today: (0, _date.isSameDay)(day, now),
active: isDayActive(day),
onChange: handleDayChange,
hidden: !showNeighboringMonth && !sameMonth,
disabled: isDayDisabled(day),
selectionStart: isDaySelectionStart(day, i),
selectionEnd: isDaySelectionEnd(day, i),
hintedSelectionStart: isHintedDaySelectionStart === null || isHintedDaySelectionStart === void 0 ? void 0 : isHintedDaySelectionStart(day, i),
hintedSelectionEnd: isHintedDaySelectionEnd === null || isHintedDaySelectionEnd === void 0 ? void 0 : isHintedDaySelectionEnd(day, i),
selected: isDaySelected === null || isDaySelected === void 0 ? void 0 : isDaySelected(day),
focused: isDayFocused(day),
onEnter: onDayEnter,
onLeave: onDayLeave,
hinted: isDayHinted === null || isDayHinted === void 0 ? void 0 : isDayHinted(day),
sameMonth: sameMonth,
size: size
}, dayProps));
}));
}));
};
exports.CalendarDays = CalendarDays;
//# sourceMappingURL=CalendarDays.js.map
|
{
"content_hash": "44ffe43d4772d12f1ffc45782319e76b",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 321,
"avg_line_length": 43.58474576271186,
"alnum_prop": 0.6877308963639899,
"repo_name": "cdnjs/cdnjs",
"id": "e6c9180a9455dc30ffe585cb894ab244f3b8e42b",
"size": "5143",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "ajax/libs/vkui/4.37.3/cjs/components/CalendarDays/CalendarDays.js",
"mode": "33188",
"license": "mit",
"language": []
}
|
namespace v8 {
namespace internal {
// ISA constants. --------------------------------------------------------------
typedef uint32_t Instr;
// The following macros initialize a float/double variable with a bit pattern
// without using static initializers: If ARM64_DEFINE_FP_STATICS is defined, the
// symbol is defined as uint32_t/uint64_t initialized with the desired bit
// pattern. Otherwise, the same symbol is declared as an external float/double.
#if defined(ARM64_DEFINE_FP_STATICS)
#define DEFINE_FLOAT(name, value) extern const uint32_t name = value
#define DEFINE_DOUBLE(name, value) extern const uint64_t name = value
#else
#define DEFINE_FLOAT(name, value) extern const float name
#define DEFINE_DOUBLE(name, value) extern const double name
#endif // defined(ARM64_DEFINE_FP_STATICS)
DEFINE_FLOAT(kFP32PositiveInfinity, 0x7f800000);
DEFINE_FLOAT(kFP32NegativeInfinity, 0xff800000);
DEFINE_DOUBLE(kFP64PositiveInfinity, 0x7ff0000000000000UL);
DEFINE_DOUBLE(kFP64NegativeInfinity, 0xfff0000000000000UL);
// This value is a signalling NaN as both a double and as a float (taking the
// least-significant word).
DEFINE_DOUBLE(kFP64SignallingNaN, 0x7ff000007f800001);
DEFINE_FLOAT(kFP32SignallingNaN, 0x7f800001);
// A similar value, but as a quiet NaN.
DEFINE_DOUBLE(kFP64QuietNaN, 0x7ff800007fc00001);
DEFINE_FLOAT(kFP32QuietNaN, 0x7fc00001);
// The default NaN values (for FPCR.DN=1).
DEFINE_DOUBLE(kFP64DefaultNaN, 0x7ff8000000000000UL);
DEFINE_FLOAT(kFP32DefaultNaN, 0x7fc00000);
#undef DEFINE_FLOAT
#undef DEFINE_DOUBLE
enum LSDataSize {
LSByte = 0,
LSHalfword = 1,
LSWord = 2,
LSDoubleWord = 3
};
LSDataSize CalcLSPairDataSize(LoadStorePairOp op);
enum ImmBranchType {
UnknownBranchType = 0,
CondBranchType = 1,
UncondBranchType = 2,
CompareBranchType = 3,
TestBranchType = 4
};
enum AddrMode {
Offset,
PreIndex,
PostIndex
};
enum FPRounding {
// The first four values are encodable directly by FPCR<RMode>.
FPTieEven = 0x0,
FPPositiveInfinity = 0x1,
FPNegativeInfinity = 0x2,
FPZero = 0x3,
// The final rounding mode is only available when explicitly specified by the
// instruction (such as with fcvta). It cannot be set in FPCR.
FPTieAway
};
enum Reg31Mode {
Reg31IsStackPointer,
Reg31IsZeroRegister
};
// Instructions. ---------------------------------------------------------------
class Instruction {
public:
V8_INLINE Instr InstructionBits() const {
return *reinterpret_cast<const Instr*>(this);
}
V8_INLINE void SetInstructionBits(Instr new_instr) {
*reinterpret_cast<Instr*>(this) = new_instr;
}
int Bit(int pos) const {
return (InstructionBits() >> pos) & 1;
}
uint32_t Bits(int msb, int lsb) const {
return unsigned_bitextract_32(msb, lsb, InstructionBits());
}
int32_t SignedBits(int msb, int lsb) const {
int32_t bits = *(reinterpret_cast<const int32_t*>(this));
return signed_bitextract_32(msb, lsb, bits);
}
Instr Mask(uint32_t mask) const {
return InstructionBits() & mask;
}
V8_INLINE const Instruction* following(int count = 1) const {
return InstructionAtOffset(count * static_cast<int>(kInstructionSize));
}
V8_INLINE Instruction* following(int count = 1) {
return InstructionAtOffset(count * static_cast<int>(kInstructionSize));
}
V8_INLINE const Instruction* preceding(int count = 1) const {
return following(-count);
}
V8_INLINE Instruction* preceding(int count = 1) {
return following(-count);
}
#define DEFINE_GETTER(Name, HighBit, LowBit, Func) \
int32_t Name() const { return Func(HighBit, LowBit); }
INSTRUCTION_FIELDS_LIST(DEFINE_GETTER)
#undef DEFINE_GETTER
// ImmPCRel is a compound field (not present in INSTRUCTION_FIELDS_LIST),
// formed from ImmPCRelLo and ImmPCRelHi.
int ImmPCRel() const {
DCHECK(IsPCRelAddressing());
int offset = ((ImmPCRelHi() << ImmPCRelLo_width) | ImmPCRelLo());
int width = ImmPCRelLo_width + ImmPCRelHi_width;
return signed_bitextract_32(width - 1, 0, offset);
}
uint64_t ImmLogical();
float ImmFP32();
double ImmFP64();
LSDataSize SizeLSPair() const {
return CalcLSPairDataSize(
static_cast<LoadStorePairOp>(Mask(LoadStorePairMask)));
}
// Helpers.
bool IsCondBranchImm() const {
return Mask(ConditionalBranchFMask) == ConditionalBranchFixed;
}
bool IsUncondBranchImm() const {
return Mask(UnconditionalBranchFMask) == UnconditionalBranchFixed;
}
bool IsCompareBranch() const {
return Mask(CompareBranchFMask) == CompareBranchFixed;
}
bool IsTestBranch() const {
return Mask(TestBranchFMask) == TestBranchFixed;
}
bool IsImmBranch() const {
return BranchType() != UnknownBranchType;
}
bool IsLdrLiteral() const {
return Mask(LoadLiteralFMask) == LoadLiteralFixed;
}
bool IsLdrLiteralX() const {
return Mask(LoadLiteralMask) == LDR_x_lit;
}
bool IsPCRelAddressing() const {
return Mask(PCRelAddressingFMask) == PCRelAddressingFixed;
}
bool IsAdr() const {
return Mask(PCRelAddressingMask) == ADR;
}
bool IsBrk() const { return Mask(ExceptionMask) == BRK; }
bool IsUnresolvedInternalReference() const {
// Unresolved internal references are encoded as two consecutive brk
// instructions.
return IsBrk() && following()->IsBrk();
}
bool IsLogicalImmediate() const {
return Mask(LogicalImmediateFMask) == LogicalImmediateFixed;
}
bool IsAddSubImmediate() const {
return Mask(AddSubImmediateFMask) == AddSubImmediateFixed;
}
bool IsAddSubShifted() const {
return Mask(AddSubShiftedFMask) == AddSubShiftedFixed;
}
bool IsAddSubExtended() const {
return Mask(AddSubExtendedFMask) == AddSubExtendedFixed;
}
// Match any loads or stores, including pairs.
bool IsLoadOrStore() const {
return Mask(LoadStoreAnyFMask) == LoadStoreAnyFixed;
}
// Match any loads, including pairs.
bool IsLoad() const;
// Match any stores, including pairs.
bool IsStore() const;
// Indicate whether Rd can be the stack pointer or the zero register. This
// does not check that the instruction actually has an Rd field.
Reg31Mode RdMode() const {
// The following instructions use csp or wsp as Rd:
// Add/sub (immediate) when not setting the flags.
// Add/sub (extended) when not setting the flags.
// Logical (immediate) when not setting the flags.
// Otherwise, r31 is the zero register.
if (IsAddSubImmediate() || IsAddSubExtended()) {
if (Mask(AddSubSetFlagsBit)) {
return Reg31IsZeroRegister;
} else {
return Reg31IsStackPointer;
}
}
if (IsLogicalImmediate()) {
// Of the logical (immediate) instructions, only ANDS (and its aliases)
// can set the flags. The others can all write into csp.
// Note that some logical operations are not available to
// immediate-operand instructions, so we have to combine two masks here.
if (Mask(LogicalImmediateMask & LogicalOpMask) == ANDS) {
return Reg31IsZeroRegister;
} else {
return Reg31IsStackPointer;
}
}
return Reg31IsZeroRegister;
}
// Indicate whether Rn can be the stack pointer or the zero register. This
// does not check that the instruction actually has an Rn field.
Reg31Mode RnMode() const {
// The following instructions use csp or wsp as Rn:
// All loads and stores.
// Add/sub (immediate).
// Add/sub (extended).
// Otherwise, r31 is the zero register.
if (IsLoadOrStore() || IsAddSubImmediate() || IsAddSubExtended()) {
return Reg31IsStackPointer;
}
return Reg31IsZeroRegister;
}
ImmBranchType BranchType() const {
if (IsCondBranchImm()) {
return CondBranchType;
} else if (IsUncondBranchImm()) {
return UncondBranchType;
} else if (IsCompareBranch()) {
return CompareBranchType;
} else if (IsTestBranch()) {
return TestBranchType;
} else {
return UnknownBranchType;
}
}
static int ImmBranchRangeBitwidth(ImmBranchType branch_type) {
switch (branch_type) {
case UncondBranchType:
return ImmUncondBranch_width;
case CondBranchType:
return ImmCondBranch_width;
case CompareBranchType:
return ImmCmpBranch_width;
case TestBranchType:
return ImmTestBranch_width;
default:
UNREACHABLE();
return 0;
}
}
// The range of the branch instruction, expressed as 'instr +- range'.
static int32_t ImmBranchRange(ImmBranchType branch_type) {
return
(1 << (ImmBranchRangeBitwidth(branch_type) + kInstructionSizeLog2)) / 2 -
kInstructionSize;
}
int ImmBranch() const {
switch (BranchType()) {
case CondBranchType: return ImmCondBranch();
case UncondBranchType: return ImmUncondBranch();
case CompareBranchType: return ImmCmpBranch();
case TestBranchType: return ImmTestBranch();
default: UNREACHABLE();
}
return 0;
}
int ImmUnresolvedInternalReference() const {
DCHECK(IsUnresolvedInternalReference());
// Unresolved references are encoded as two consecutive brk instructions.
// The associated immediate is made of the two 16-bit payloads.
int32_t high16 = ImmException();
int32_t low16 = following()->ImmException();
return (high16 << 16) | low16;
}
bool IsBranchAndLinkToRegister() const {
return Mask(UnconditionalBranchToRegisterMask) == BLR;
}
bool IsMovz() const {
return (Mask(MoveWideImmediateMask) == MOVZ_x) ||
(Mask(MoveWideImmediateMask) == MOVZ_w);
}
bool IsMovk() const {
return (Mask(MoveWideImmediateMask) == MOVK_x) ||
(Mask(MoveWideImmediateMask) == MOVK_w);
}
bool IsMovn() const {
return (Mask(MoveWideImmediateMask) == MOVN_x) ||
(Mask(MoveWideImmediateMask) == MOVN_w);
}
bool IsNop(int n) {
// A marking nop is an instruction
// mov r<n>, r<n>
// which is encoded as
// orr r<n>, xzr, r<n>
return (Mask(LogicalShiftedMask) == ORR_x) &&
(Rd() == Rm()) &&
(Rd() == n);
}
// Find the PC offset encoded in this instruction. 'this' may be a branch or
// a PC-relative addressing instruction.
// The offset returned is unscaled.
int64_t ImmPCOffset();
// Find the target of this instruction. 'this' may be a branch or a
// PC-relative addressing instruction.
Instruction* ImmPCOffsetTarget();
static bool IsValidImmPCOffset(ImmBranchType branch_type, ptrdiff_t offset);
bool IsTargetInImmPCOffsetRange(Instruction* target);
// Patch a PC-relative offset to refer to 'target'. 'this' may be a branch or
// a PC-relative addressing instruction.
void SetImmPCOffsetTarget(Instruction* target);
void SetUnresolvedInternalReferenceImmTarget(Instruction* target);
// Patch a literal load instruction to load from 'source'.
void SetImmLLiteral(Instruction* source);
uintptr_t LiteralAddress() {
int offset = ImmLLiteral() << kLoadLiteralScaleLog2;
return reinterpret_cast<uintptr_t>(this) + offset;
}
enum CheckAlignment { NO_CHECK, CHECK_ALIGNMENT };
V8_INLINE const Instruction* InstructionAtOffset(
int64_t offset, CheckAlignment check = CHECK_ALIGNMENT) const {
// The FUZZ_disasm test relies on no check being done.
DCHECK(check == NO_CHECK || IsAligned(offset, kInstructionSize));
return this + offset;
}
V8_INLINE Instruction* InstructionAtOffset(
int64_t offset, CheckAlignment check = CHECK_ALIGNMENT) {
// The FUZZ_disasm test relies on no check being done.
DCHECK(check == NO_CHECK || IsAligned(offset, kInstructionSize));
return this + offset;
}
template<typename T> V8_INLINE static Instruction* Cast(T src) {
return reinterpret_cast<Instruction*>(src);
}
V8_INLINE ptrdiff_t DistanceTo(Instruction* target) {
return reinterpret_cast<Address>(target) - reinterpret_cast<Address>(this);
}
static const int ImmPCRelRangeBitwidth = 21;
static bool IsValidPCRelOffset(ptrdiff_t offset) { return is_int21(offset); }
void SetPCRelImmTarget(Instruction* target);
void SetBranchImmTarget(Instruction* target);
};
// Where Instruction looks at instructions generated by the Assembler,
// InstructionSequence looks at instructions sequences generated by the
// MacroAssembler.
class InstructionSequence : public Instruction {
public:
static InstructionSequence* At(Address address) {
return reinterpret_cast<InstructionSequence*>(address);
}
// Sequences generated by MacroAssembler::InlineData().
bool IsInlineData() const;
uint64_t InlineData() const;
};
// Simulator/Debugger debug instructions ---------------------------------------
// Each debug marker is represented by a HLT instruction. The immediate comment
// field in the instruction is used to identify the type of debug marker. Each
// marker encodes arguments in a different way, as described below.
// Indicate to the Debugger that the instruction is a redirected call.
const Instr kImmExceptionIsRedirectedCall = 0xca11;
// Represent unreachable code. This is used as a guard in parts of the code that
// should not be reachable, such as in data encoded inline in the instructions.
const Instr kImmExceptionIsUnreachable = 0xdebf;
// A pseudo 'printf' instruction. The arguments will be passed to the platform
// printf method.
const Instr kImmExceptionIsPrintf = 0xdeb1;
// Most parameters are stored in ARM64 registers as if the printf
// pseudo-instruction was a call to the real printf method:
// x0: The format string.
// x1-x7: Optional arguments.
// d0-d7: Optional arguments.
//
// Also, the argument layout is described inline in the instructions:
// - arg_count: The number of arguments.
// - arg_pattern: A set of PrintfArgPattern values, packed into two-bit fields.
//
// Floating-point and integer arguments are passed in separate sets of registers
// in AAPCS64 (even for varargs functions), so it is not possible to determine
// the type of each argument without some information about the values that were
// passed in. This information could be retrieved from the printf format string,
// but the format string is not trivial to parse so we encode the relevant
// information with the HLT instruction.
const unsigned kPrintfArgCountOffset = 1 * kInstructionSize;
const unsigned kPrintfArgPatternListOffset = 2 * kInstructionSize;
const unsigned kPrintfLength = 3 * kInstructionSize;
const unsigned kPrintfMaxArgCount = 4;
// The argument pattern is a set of two-bit-fields, each with one of the
// following values:
enum PrintfArgPattern {
kPrintfArgW = 1,
kPrintfArgX = 2,
// There is no kPrintfArgS because floats are always converted to doubles in C
// varargs calls.
kPrintfArgD = 3
};
static const unsigned kPrintfArgPatternBits = 2;
// A pseudo 'debug' instruction.
const Instr kImmExceptionIsDebug = 0xdeb0;
// Parameters are inlined in the code after a debug pseudo-instruction:
// - Debug code.
// - Debug parameters.
// - Debug message string. This is a NULL-terminated ASCII string, padded to
// kInstructionSize so that subsequent instructions are correctly aligned.
// - A kImmExceptionIsUnreachable marker, to catch accidental execution of the
// string data.
const unsigned kDebugCodeOffset = 1 * kInstructionSize;
const unsigned kDebugParamsOffset = 2 * kInstructionSize;
const unsigned kDebugMessageOffset = 3 * kInstructionSize;
// Debug parameters.
// Used without a TRACE_ option, the Debugger will print the arguments only
// once. Otherwise TRACE_ENABLE and TRACE_DISABLE will enable or disable tracing
// before every instruction for the specified LOG_ parameters.
//
// TRACE_OVERRIDE enables the specified LOG_ parameters, and disabled any
// others that were not specified.
//
// For example:
//
// __ debug("print registers and fp registers", 0, LOG_REGS | LOG_FP_REGS);
// will print the registers and fp registers only once.
//
// __ debug("trace disasm", 1, TRACE_ENABLE | LOG_DISASM);
// starts disassembling the code.
//
// __ debug("trace rets", 2, TRACE_ENABLE | LOG_REGS);
// adds the general purpose registers to the trace.
//
// __ debug("stop regs", 3, TRACE_DISABLE | LOG_REGS);
// stops tracing the registers.
const unsigned kDebuggerTracingDirectivesMask = 3 << 6;
enum DebugParameters {
NO_PARAM = 0,
BREAK = 1 << 0,
LOG_DISASM = 1 << 1, // Use only with TRACE. Disassemble the code.
LOG_REGS = 1 << 2, // Log general purpose registers.
LOG_FP_REGS = 1 << 3, // Log floating-point registers.
LOG_SYS_REGS = 1 << 4, // Log the status flags.
LOG_WRITE = 1 << 5, // Log any memory write.
LOG_STATE = LOG_REGS | LOG_FP_REGS | LOG_SYS_REGS,
LOG_ALL = LOG_DISASM | LOG_STATE | LOG_WRITE,
// Trace control.
TRACE_ENABLE = 1 << 6,
TRACE_DISABLE = 2 << 6,
TRACE_OVERRIDE = 3 << 6
};
} } // namespace v8::internal
#endif // V8_ARM64_INSTRUCTIONS_ARM64_H_
|
{
"content_hash": "90c81bc80e1311482a2dbba88e487d4e",
"timestamp": "",
"source": "github",
"line_count": 526,
"max_line_length": 80,
"avg_line_length": 32.32699619771863,
"alnum_prop": 0.6998353328628558,
"repo_name": "dawangjiaowolaixunshan/runtime",
"id": "145a7c9053aa954954b5b93de25cb9187003ef74",
"size": "17374",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "deps/v8/src/arm64/instructions-arm64.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "29659"
},
{
"name": "C",
"bytes": "853"
},
{
"name": "C++",
"bytes": "2139966"
},
{
"name": "JavaScript",
"bytes": "508976"
},
{
"name": "Python",
"bytes": "6276"
},
{
"name": "Shell",
"bytes": "3888"
}
]
}
|
@interface SBLProtocolMockObjectBehavior : NSObject<SBLMockObjectBehavior>
- (instancetype)init UNAVAILABLE_ATTRIBUTE;
- (instancetype)initWithProtocol:(Protocol *)aProtocol;
@end
|
{
"content_hash": "14c55f4aadf875045fee50fd32cc0f6f",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 74,
"avg_line_length": 30.333333333333332,
"alnum_prop": 0.8296703296703297,
"repo_name": "Stubble/Stubble",
"id": "b286dcec1188fe448b9203533a24e6a2dacff8f9",
"size": "251",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Stubble/SBLProtocolMockObjectBehavior.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "145353"
},
{
"name": "Ruby",
"bytes": "6458"
}
]
}
|
package io.cloudslang.content.amazon.actions.instances;
import com.hp.oo.sdk.content.annotations.Action;
import com.hp.oo.sdk.content.annotations.Output;
import com.hp.oo.sdk.content.annotations.Param;
import com.hp.oo.sdk.content.annotations.Response;
import com.hp.oo.sdk.content.plugin.ActionMetadata.MatchType;
import com.hp.oo.sdk.content.plugin.ActionMetadata.ResponseType;
import io.cloudslang.content.amazon.entities.constants.Outputs;
import io.cloudslang.content.amazon.entities.inputs.CommonInputs;
import io.cloudslang.content.amazon.entities.inputs.InstanceInputs;
import io.cloudslang.content.amazon.execute.QueryApiExecutor;
import io.cloudslang.content.amazon.utils.ExceptionProcessor;
import java.util.Map;
import static io.cloudslang.content.amazon.utils.InputsUtil.getDefaultStringInput;
import static io.cloudslang.content.amazon.entities.constants.Constants.Apis.EC2_API;
import static io.cloudslang.content.amazon.entities.constants.Constants.DefaultApiVersion.INSTANCES_DEFAULT_API_VERSION;
import static io.cloudslang.content.amazon.entities.constants.Constants.AwsParams.HTTP_CLIENT_METHOD_GET;
import static io.cloudslang.content.amazon.entities.constants.Constants.Miscellaneous.EMPTY;
import static io.cloudslang.content.amazon.entities.constants.Constants.Ec2QueryApiActions.REBOOT_INSTANCES;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.CREDENTIAL;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.DELIMITER;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.ENDPOINT;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.HEADERS;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.IDENTITY;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.PROXY_HOST;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.PROXY_PASSWORD;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.PROXY_PORT;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.PROXY_USERNAME;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.QUERY_PARAMS;
import static io.cloudslang.content.amazon.entities.constants.Inputs.CommonInputs.VERSION;
import static io.cloudslang.content.amazon.entities.constants.Inputs.InstanceInputs.INSTANCE_IDS_STRING;
/**
* Created by persdana
* 6/22/2015.
*/
public class RebootInstancesAction {
/**
* Requests a reboot of one or more instances.
* Note: This operation is asynchronous; it only queues a request to reboot the specified instances. The operation
* succeeds if the instances are valid and belong to you. Requests to reboot terminated instances are ignored.
* If an instance does not cleanly shut down within four minutes, Amazon EC2 performs a hard reboot.
* For more information about troubleshooting, see Getting Console Output and Rebooting Instances
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html in the Amazon Elastic Compute Cloud User
* Guide.
*
* @param endpoint Optional - Endpoint to which request will be sent.
* Default: "https://ec2.amazonaws.com"
* @param identity ID of the secret access key associated with your Amazon AWS or IAM account.
* Example: "AKIAIOSFODNN7EXAMPLE"
* @param credential Secret access key associated with your Amazon AWS or IAM account.
* Example: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
* @param proxyHost Optional - proxy server used to connect to Amazon API. If empty no proxy will be used.
* Default: ""
* @param proxyPort Optional - proxy server port. You must either specify values for both proxyHost and
* proxyPort inputs or leave them both empty.
* Default: ""
* @param proxyUsername Optional - proxy server user name.
* Default: ""
* @param proxyPassword Optional - proxy server password associated with the proxyUsername input value.
* Default: ""
* @param headers Optional - string containing the headers to use for the request separated by new line (CRLF).
* The header name-value pair will be separated by ":".
* Format: Conforming with HTTP standard for headers (RFC 2616)
* Examples: "Accept:text/plain"
* Default: ""
* @param queryParams Optional - string containing query parameters that will be appended to the URL. The names
* and the values must not be URL encoded because if they are encoded then a double encoded
* will occur. The separator between name-value pairs is "&" symbol. The query name will be
* separated from query value by "=".
* Examples: "parameterName1=parameterValue1¶meterName2=parameterValue2"
* Default: ""
* @param version Optional - Version of the web service to made the call against it.
* Example: "2016-11-15"
* Default: "2016-11-15"
* @param delimiter Optional - delimiter that will be used.
* Default: ","
* @param instanceIdsString String that contains one or more values that represents instance IDs.
* Example: "i-12345678,i-abcdef12,i-12ab34cd"
* @return A map with strings as keys and strings as values that contains: outcome of the action (or failure message
* and the exception if there is one), returnCode of the operation and the ID of the request.
*/
@Action(name = "Reboot Instances",
outputs = {
@Output(Outputs.RETURN_CODE),
@Output(Outputs.RETURN_RESULT),
@Output(Outputs.EXCEPTION)
},
responses = {
@Response(text = Outputs.SUCCESS, field = Outputs.RETURN_CODE, value = Outputs.SUCCESS_RETURN_CODE,
matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED),
@Response(text = Outputs.FAILURE, field = Outputs.RETURN_CODE, value = Outputs.FAILURE_RETURN_CODE,
matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR)
}
)
public Map<String, String> execute(@Param(value = ENDPOINT) String endpoint,
@Param(value = IDENTITY, required = true) String identity,
@Param(value = CREDENTIAL, required = true, encrypted = true) String credential,
@Param(value = PROXY_HOST) String proxyHost,
@Param(value = PROXY_PORT) String proxyPort,
@Param(value = PROXY_USERNAME) String proxyUsername,
@Param(value = PROXY_PASSWORD, encrypted = true) String proxyPassword,
@Param(value = HEADERS) String headers,
@Param(value = QUERY_PARAMS) String queryParams,
@Param(value = VERSION) String version,
@Param(value = DELIMITER) String delimiter,
@Param(value = INSTANCE_IDS_STRING, required = true) String instanceIdsString) {
try {
version = getDefaultStringInput(version, INSTANCES_DEFAULT_API_VERSION);
final CommonInputs commonInputs = new CommonInputs.Builder()
.withEndpoint(endpoint, EC2_API, EMPTY)
.withIdentity(identity)
.withCredential(credential)
.withProxyHost(proxyHost)
.withProxyPort(proxyPort)
.withProxyUsername(proxyUsername)
.withProxyPassword(proxyPassword)
.withHeaders(headers)
.withQueryParams(queryParams)
.withVersion(version)
.withDelimiter(delimiter)
.withAction(REBOOT_INSTANCES)
.withApiService(EC2_API)
.withRequestUri(EMPTY)
.withRequestPayload(EMPTY)
.withHttpClientMethod(HTTP_CLIENT_METHOD_GET)
.build();
final InstanceInputs instanceInputs = new InstanceInputs.Builder()
.withInstanceIdsString(instanceIdsString)
.build();
return new QueryApiExecutor().execute(commonInputs, instanceInputs);
} catch (Exception e) {
return ExceptionProcessor.getExceptionResult(e);
}
}
}
|
{
"content_hash": "bb6043cf110a84f032d94b78813c41c3",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 125,
"avg_line_length": 64.40972222222223,
"alnum_prop": 0.6350404312668464,
"repo_name": "victorursan/cs-actions",
"id": "75aa15edfcb0633e3717730b4790145704dc87b5",
"size": "9759",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "cs-amazon/src/main/java/io/cloudslang/content/amazon/actions/instances/RebootInstancesAction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "3870134"
},
{
"name": "Scala",
"bytes": "196306"
},
{
"name": "XSLT",
"bytes": "544"
}
]
}
|
This application makes use of the following third party libraries:
## BRYXBanner
Copyright (c) 2015 Harlan Haskins <harlan@harlanhaskins.com>
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 - http://cocoapods.org
|
{
"content_hash": "d1d8b7aaa64314c484a281876210a5a2",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 77,
"avg_line_length": 48.6,
"alnum_prop": 0.8041152263374486,
"repo_name": "alexpersian/BRYXBanner",
"id": "5892fc66bb5db690f284aad120a7ec6b26063e01",
"size": "1234",
"binary": false,
"copies": "23",
"ref": "refs/heads/master",
"path": "Example/Pods/Target Support Files/Pods-BRYXBanner_Example/Pods-BRYXBanner_Example-acknowledgements.markdown",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "893"
},
{
"name": "Ruby",
"bytes": "855"
},
{
"name": "Shell",
"bytes": "14402"
},
{
"name": "Swift",
"bytes": "21193"
}
]
}
|
/**
* An interface for the wizard pages.
*/
qx.Interface.define("ms123.wizard.IPage", {
members: {
/**
* Validate fields of page.
*
* param wizard {ms123.wizard.Wizard} Wizard parent object.
*/
validate: function (wizard) {
// this.assert
}
}
});
|
{
"content_hash": "c4c0416aad60264a9d87f490fa70a1b9",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 61,
"avg_line_length": 17.375,
"alnum_prop": 0.5971223021582733,
"repo_name": "ms123s/simpl4-src",
"id": "1eb60d47344c6819a15bd17be520f633fbdaaa01",
"size": "955",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/common/source/class/ms123/wizard/IPage.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3887"
},
{
"name": "CSS",
"bytes": "735606"
},
{
"name": "Groovy",
"bytes": "512961"
},
{
"name": "HTML",
"bytes": "3285460"
},
{
"name": "Java",
"bytes": "4169538"
},
{
"name": "JavaScript",
"bytes": "33927529"
},
{
"name": "Python",
"bytes": "14350"
},
{
"name": "Shell",
"bytes": "72131"
},
{
"name": "Smarty",
"bytes": "19765"
},
{
"name": "XSLT",
"bytes": "579304"
}
]
}
|
- [#32](https://null/lalitkapoor/github-changes/pull/32) support for github enterprise (@lalitkapoor, @calmdev)
### v0.0.10 (2014/03/01 06:02 +00:00)
- [#26](https://null/lalitkapoor/github-changes/pull/26) handle missing author in pull requests (@lalitkapoor)
### v0.0.9 (2014/03/01 04:09 +00:00)
- [#22](https://null/lalitkapoor/github-changes/pull/22) show commit message if commit body is empty for --use-commit-body (@lalitkapoor)
- [#23](https://null/lalitkapoor/github-changes/pull/23) though tagged correctly commit ordering may vary (@lalitkapoor)
- [#24](https://null/lalitkapoor/github-changes/pull/24) sorting commits by date doesn't work for --data pulls (@lalitkapoor)
- [#21](https://null/lalitkapoor/github-changes/pull/21) attribution is not always correct for pull requests (@lalitkapoor)
### v0.0.8 (2014/02/25 08:05 +00:00)
- [#18](https://null/lalitkapoor/github-changes/pull/18) Add a Bitdeli Badge to README (@bitdeli-chef)
- [#15](https://null/lalitkapoor/github-changes/pull/15) add option to order versions based on semver instead of the tag date (@lalitkapoor)
### v0.0.7 (2014/02/25 06:40 +00:00)
- [#17](https://null/lalitkapoor/github-changes/pull/17) use-commit-body only works when only-pulls or only-merges is used (@lalitkapoor)
### v0.0.6 (2014/02/25 06:21 +00:00)
- [#13](https://null/lalitkapoor/github-changes/pull/13) don't strip down pull request object (@lalitkapoor)
- [#14](https://null/lalitkapoor/github-changes/pull/14) flags to improve what merge items to into the changelog (@lalitkapoor)
- [#16](https://null/lalitkapoor/github-changes/pull/16) when parsing pull request pr links not generated and attribution incorrect (@lalitkapoor)
### v0.0.5 (2014/02/23 10:14 +00:00)
- [#9](https://null/lalitkapoor/github-changes/pull/9) don't double space in the default formatter (@lalitkapoor)
### v0.0.4 (2014/02/23 08:43 +00:00)
- [#7](https://null/lalitkapoor/github-changes/pull/7) use commit date not author date when determining which commits belong to which tags (@lalitkapoor)
### v0.0.3 (2014/02/23 08:24 +00:00)
- [#2](https://null/lalitkapoor/github-changes/pull/2) Fixed typos. (@Fraser999)
- [#4](https://null/lalitkapoor/github-changes/pull/4) consider generating changelog based on commit messages (@lalitkapoor)
### v0.0.2 (2014/02/20 06:23 +00:00)
- [#1](https://null/lalitkapoor/github-changes/pull/1) error thrown when link header doesn't contain last (@lalitkapoor)
|
{
"content_hash": "516780a2fcb63c0136ae11e4aadff246",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 153,
"avg_line_length": 69.6,
"alnum_prop": 0.7298850574712644,
"repo_name": "joshbedo/github-changes",
"id": "15b2ef53321234e458f9ead954e8f0e5764ead4e",
"size": "2489",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CHANGELOG.md",
"mode": "33188",
"license": "mit",
"language": []
}
|
module.exports = function(grunt) {
var config = require("./config.json");
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
express: {
options: {
port: config.port,
server : 'sample/express/app.js',
hostname : "localhost"
}
},
casperjs: {
options: {
async: {
parallel: false
},
casperjsOptions: ['--ignore-ssl-errors=true']
},
files: ['tests/*.js']
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['tests/unit/*.js']
}
}
});
grunt.loadNpmTasks('grunt-express');
grunt.loadNpmTasks('grunt-casperjs');
grunt.loadNpmTasks('grunt-mocha-test');
// Default task(s).
grunt.registerTask('default', ['express-server', 'casperjs', 'mochaTest']);
grunt.registerTask('test', ['default']);
};
|
{
"content_hash": "2e6562a1ce70120e02998e34c8b3861c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 77,
"avg_line_length": 20.733333333333334,
"alnum_prop": 0.5316184351554126,
"repo_name": "harriha/node-tupas",
"id": "6d4e1874ab15fdfa7a621341cc2547aa7a86c394",
"size": "933",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Gruntfile.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "477"
},
{
"name": "JavaScript",
"bytes": "26372"
}
]
}
|
package org.apache.lucene.index;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.automaton.CompiledAutomaton;
/**
* Exposes flex API, merged from flex API of
* sub-segments.
*
* @lucene.experimental
*/
public final class MultiTerms extends Terms {
private final Terms[] subs;
private final ReaderSlice[] subSlices;
private final boolean hasFreqs;
private final boolean hasOffsets;
private final boolean hasPositions;
private final boolean hasPayloads;
/** Sole constructor.
*
* @param subs The {@link Terms} instances of all sub-readers.
* @param subSlices A parallel array (matching {@code
* subs}) describing the sub-reader slices.
*/
public MultiTerms(Terms[] subs, ReaderSlice[] subSlices) throws IOException {
this.subs = subs;
this.subSlices = subSlices;
assert subs.length > 0 : "inefficient: don't use MultiTerms over one sub";
boolean _hasFreqs = true;
boolean _hasOffsets = true;
boolean _hasPositions = true;
boolean _hasPayloads = false;
for(int i=0;i<subs.length;i++) {
_hasFreqs &= subs[i].hasFreqs();
_hasOffsets &= subs[i].hasOffsets();
_hasPositions &= subs[i].hasPositions();
_hasPayloads |= subs[i].hasPayloads();
}
hasFreqs = _hasFreqs;
hasOffsets = _hasOffsets;
hasPositions = _hasPositions;
hasPayloads = hasPositions && _hasPayloads; // if all subs have pos, and at least one has payloads.
}
@Override
public TermsEnum intersect(CompiledAutomaton compiled, BytesRef startTerm) throws IOException {
final List<MultiTermsEnum.TermsEnumIndex> termsEnums = new ArrayList<MultiTermsEnum.TermsEnumIndex>();
for(int i=0;i<subs.length;i++) {
final TermsEnum termsEnum = subs[i].intersect(compiled, startTerm);
if (termsEnum != null) {
termsEnums.add(new MultiTermsEnum.TermsEnumIndex(termsEnum, i));
}
}
if (termsEnums.size() > 0) {
return new MultiTermsEnum(subSlices).reset(termsEnums.toArray(MultiTermsEnum.TermsEnumIndex.EMPTY_ARRAY));
} else {
return TermsEnum.EMPTY;
}
}
@Override
public TermsEnum iterator(TermsEnum reuse) throws IOException {
final List<MultiTermsEnum.TermsEnumIndex> termsEnums = new ArrayList<MultiTermsEnum.TermsEnumIndex>();
for(int i=0;i<subs.length;i++) {
final TermsEnum termsEnum = subs[i].iterator(null);
if (termsEnum != null) {
termsEnums.add(new MultiTermsEnum.TermsEnumIndex(termsEnum, i));
}
}
if (termsEnums.size() > 0) {
return new MultiTermsEnum(subSlices).reset(termsEnums.toArray(MultiTermsEnum.TermsEnumIndex.EMPTY_ARRAY));
} else {
return TermsEnum.EMPTY;
}
}
@Override
public long size() {
return -1;
}
@Override
public long getSumTotalTermFreq() throws IOException {
long sum = 0;
for(Terms terms : subs) {
final long v = terms.getSumTotalTermFreq();
if (v == -1) {
return -1;
}
sum += v;
}
return sum;
}
@Override
public long getSumDocFreq() throws IOException {
long sum = 0;
for(Terms terms : subs) {
final long v = terms.getSumDocFreq();
if (v == -1) {
return -1;
}
sum += v;
}
return sum;
}
@Override
public int getDocCount() throws IOException {
int sum = 0;
for(Terms terms : subs) {
final int v = terms.getDocCount();
if (v == -1) {
return -1;
}
sum += v;
}
return sum;
}
@Override
public boolean hasFreqs() {
return hasFreqs;
}
@Override
public boolean hasOffsets() {
return hasOffsets;
}
@Override
public boolean hasPositions() {
return hasPositions;
}
@Override
public boolean hasPayloads() {
return hasPayloads;
}
}
|
{
"content_hash": "519321c2c1333a4ecdf1d8d7e507f6a0",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 112,
"avg_line_length": 25.135483870967743,
"alnum_prop": 0.6504106776180698,
"repo_name": "fogbeam/Heceta_solr",
"id": "34c5b92c62545f800e0d80d914aac95deb4cf18b",
"size": "4697",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lucene/core/src/java/org/apache/lucene/index/MultiTerms.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "13377"
},
{
"name": "CSS",
"bytes": "124656"
},
{
"name": "Java",
"bytes": "36810389"
},
{
"name": "JavaScript",
"bytes": "1215645"
},
{
"name": "Perl",
"bytes": "85397"
},
{
"name": "Python",
"bytes": "181578"
},
{
"name": "Shell",
"bytes": "84876"
},
{
"name": "XSLT",
"bytes": "87852"
}
]
}
|
package org.jasig.cas.support.saml.web.flow.mdui;
import org.opensaml.saml.metadata.resolver.filter.impl.MetadataFilterChain;
import org.quartz.Job;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.SimpleScheduleBuilder;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.core.io.Resource;
import javax.annotation.PostConstruct;
import java.util.Map;
import java.util.UUID;
/**
* A {@link StaticMetadataResolverAdapter} that loads metadata from static xml files
* served by urls or locally.
*
* @author Misagh Moayyed
* @since 4.1.0
*/
public final class StaticMetadataResolverAdapter extends AbstractMetadataResolverAdapter implements Job {
private static final int DEFAULT_METADATA_REFRESH_INTERNAL_MINS = 300;
/**
* Refresh metadata every {@link #DEFAULT_METADATA_REFRESH_INTERNAL_MINS}
* minutes by default.
**/
private int refreshIntervalInMinutes = DEFAULT_METADATA_REFRESH_INTERNAL_MINS;
/**
* New ctor - required for serialization and job scheduling.
*/
public StaticMetadataResolverAdapter() {
super();
}
/**
* Instantiates a new static metadata resolver adapter.
*
* @param metadataResources the metadata resources
*/
public StaticMetadataResolverAdapter(final Map<Resource, MetadataFilterChain> metadataResources) {
super(metadataResources);
}
public void setRefreshIntervalInMinutes(final int refreshIntervalInMinutes) {
this.refreshIntervalInMinutes = refreshIntervalInMinutes;
}
/**
* Refresh metadata. Schedules the job to retrieve metadata.
* @throws SchedulerException the scheduler exception
*/
@PostConstruct
public void refreshMetadata() throws SchedulerException {
final Thread thread = new Thread(new Runnable() {
@Override
public void run() {
buildMetadataResolverAggregate();
}
});
thread.start();
final JobDetail job = JobBuilder.newJob(this.getClass())
.withIdentity(this.getClass().getSimpleName().concat(UUID.randomUUID().toString())).build();
final Trigger trigger = TriggerBuilder.newTrigger()
.withIdentity(this.getClass().getSimpleName().concat(UUID.randomUUID().toString()))
.withSchedule(SimpleScheduleBuilder.simpleSchedule()
.withIntervalInMinutes(this.refreshIntervalInMinutes)
.repeatForever()).build();
final SchedulerFactory schFactory = new StdSchedulerFactory();
final Scheduler sch = schFactory.getScheduler();
sch.start();
sch.scheduleJob(job, trigger);
}
@Override
public void execute(final JobExecutionContext jobExecutionContext) throws JobExecutionException {
buildMetadataResolverAggregate();
}
}
|
{
"content_hash": "d3113ee7cd67af11d45e99a115c4ab80",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 108,
"avg_line_length": 34.17391304347826,
"alnum_prop": 0.7061068702290076,
"repo_name": "mduszyk/cas",
"id": "634db7f8fcf728f904f56dd0e275aa9ad8e5d40d",
"size": "3942",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "cas-server-support-saml/src/main/java/org/jasig/cas/support/saml/web/flow/mdui/StaticMetadataResolverAdapter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "188680"
},
{
"name": "HTML",
"bytes": "31750"
},
{
"name": "Java",
"bytes": "3056624"
},
{
"name": "JavaScript",
"bytes": "30476"
},
{
"name": "Shell",
"bytes": "8412"
}
]
}
|
package org.compass.core.test.resource;
import java.io.StringReader;
import java.util.Calendar;
import org.compass.core.CompassHits;
import org.compass.core.CompassSession;
import org.compass.core.CompassTransaction;
import org.compass.core.Property;
import org.compass.core.Resource;
import org.compass.core.config.CompassEnvironment;
import org.compass.core.config.CompassSettings;
import org.compass.core.mapping.CompassMapping;
import org.compass.core.mapping.ResourceMapping;
import org.compass.core.mapping.ResourcePropertyMapping;
import org.compass.core.spi.InternalCompassSession;
import org.compass.core.test.AbstractTestCase;
/**
* @author kimchy
*/
public class ResourceTests extends AbstractTestCase {
protected String[] getMappings() {
return new String[]{"resource/resource.cpm.xml"};
}
protected void addSettings(CompassSettings settings) {
settings.setGroupSettings(CompassEnvironment.Converter.PREFIX,
"mydate",
new String[]{CompassEnvironment.Converter.TYPE, CompassEnvironment.Converter.Format.FORMAT},
new String[]{CompassEnvironment.Converter.DefaultTypes.Simple.DATE, "yyyy-MM-dd"});
}
public void testMapping() {
InternalCompassSession session = (InternalCompassSession) openSession();
CompassMapping mapping = session.getMapping();
ResourceMapping resourceMapping = mapping.getMappingByAlias("a");
ResourcePropertyMapping resourcePropertyMapping = resourceMapping.getResourcePropertyMappingByDotPath("id");
assertNotNull(resourcePropertyMapping);
assertEquals("id", resourcePropertyMapping.getName());
assertEquals("id", resourcePropertyMapping.getPath().getPath());
resourceMapping = mapping.getMappingByAlias("b");
resourcePropertyMapping = resourceMapping.getResourcePropertyMappingByDotPath("id1");
assertNotNull(resourcePropertyMapping);
assertEquals("id1", resourcePropertyMapping.getName());
assertEquals("id1", resourcePropertyMapping.getPath().getPath());
resourcePropertyMapping = resourceMapping.getResourcePropertyMappingByDotPath("id2");
assertNotNull(resourcePropertyMapping);
assertEquals("id2", resourcePropertyMapping.getName());
assertEquals("id2", resourcePropertyMapping.getPath().getPath());
session.close();
}
public void testSingleIdResource() throws Exception {
CompassSession session = openSession();
CompassTransaction tr = session.beginTransaction();
Resource r = session.createResource("a");
Property id = session.createProperty("id", "1", Property.Store.YES, Property.Index.UN_TOKENIZED);
r.addProperty(id);
r.addProperty(session.createProperty("mvalue", "this is a test", Property.Store.YES, Property.Index.TOKENIZED));
session.save(r);
r = session.getResource("a", "1");
assertEquals("this is a test", r.getValue("mvalue"));
r = session.getResource("a", new String[]{"1"});
assertEquals("this is a test", r.getValue("mvalue"));
r = session.getResource("a", id);
assertEquals("this is a test", r.getValue("mvalue"));
r = session.getResource("a", new Property[]{id});
assertEquals("this is a test", r.getValue("mvalue"));
r = session.getResource("a", r);
assertEquals("this is a test", r.getValue("mvalue"));
CompassHits hits = session.find("test");
assertEquals(1, hits.getLength());
assertEquals("this is a test", hits.resource(0).getValue("mvalue"));
session.delete("a", "1");
r = session.getResource("a", r);
assertNull(r);
tr.commit();
session.close();
}
public void testMultipleIdResource() throws Exception {
CompassSession session = openSession();
CompassTransaction tr = session.beginTransaction();
Resource r = session.createResource("b");
Property id1 = session.createProperty("id1", "1", Property.Store.YES, Property.Index.UN_TOKENIZED);
Property id2 = session.createProperty("id2", "2", Property.Store.YES, Property.Index.UN_TOKENIZED);
r.addProperty(id1);
r.addProperty(id2);
r.addProperty(session.createProperty("mvalue", "this is a test", Property.Store.YES, Property.Index.TOKENIZED));
session.save(r);
r = session.getResource("b", new String[]{"1", "2"});
assertEquals("this is a test", r.getValue("mvalue"));
r = session.getResource("b", new Property[]{id1, id2});
assertEquals("this is a test", r.getValue("mvalue"));
r = session.getResource("b", r);
assertEquals("this is a test", r.getValue("mvalue"));
CompassHits hits = session.find("test");
assertEquals(1, hits.getLength());
assertEquals("this is a test", hits.resource(0).getValue("mvalue"));
tr.commit();
session.close();
}
public void testSimplePropertyMapping() throws Exception {
CompassSession session = openSession();
CompassTransaction tr = session.beginTransaction();
Resource r = session.createResource("c");
r.addProperty("id", "1");
r.addProperty("value1", "this is a test");
r.addProperty("value2", "this is a test");
r.addProperty("value3", "this is a test");
r.addProperty("value4", "this is a test");
Calendar cal = Calendar.getInstance();
cal.set(2000, 1, 1, 0, 0, 0);
r.addProperty("value5", cal.getTime());
r.addProperty("value6", new StringReader("reader"));
session.save(r);
r = session.getResource("c", "1");
Property prop = r.getProperty("value1");
assertEquals("this is a test", prop.getStringValue());
assertTrue(prop.isIndexed());
assertTrue(prop.isStored());
assertTrue(prop.isTokenized());
assertFalse(prop.isCompressed());
prop = r.getProperty("value2");
assertEquals("this is a test", prop.getStringValue());
assertTrue(prop.isIndexed());
assertTrue(prop.isStored());
assertTrue(prop.isTokenized());
assertFalse(prop.isCompressed());
prop = r.getProperty("value3");
assertEquals("this is a test", prop.getStringValue());
assertTrue(prop.isIndexed());
assertTrue(prop.isStored());
assertTrue(prop.isTokenized());
assertTrue(prop.isCompressed());
prop = r.getProperty("value4");
assertEquals("this is a test", prop.getStringValue());
assertTrue(prop.isIndexed());
assertTrue(prop.isStored());
assertFalse(prop.isTokenized());
assertFalse(prop.isCompressed());
prop = r.getProperty("value5");
assertEquals("2000-02-01", prop.getStringValue());
assertEquals(cal.getTime().toString(), prop.getObjectValue().toString());
assertTrue(prop.isIndexed());
assertTrue(prop.isStored());
assertTrue(prop.isTokenized());
assertFalse(prop.isCompressed());
CompassHits hits = session.find("value6:reader");
assertEquals(1, hits.length());
hits = session.find("value5:2000-02-01");
assertEquals(1, hits.length());
hits = session.find("value5:[2000-01-01 TO 2000-02-01]");
assertEquals(1, hits.length());
tr.commit();
session.close();
}
public void testResourceExtends() {
CompassSession session = openSession();
CompassTransaction tr = session.beginTransaction();
Resource r = session.createResource("d");
r.addProperty("id", "1");
r.addProperty("value1", "this is a test");
session.save(r);
r = session.getResource("d", "1");
assertEquals("this is a test", r.getValue("value1"));
tr.commit();
session.close();
}
public void testResourceContractExtends() {
CompassSession session = openSession();
CompassTransaction tr = session.beginTransaction();
Resource r = session.createResource("e");
r.addProperty("id", "1");
r.addProperty("value1", "test1");
r.addProperty("value2", "test2");
session.save(r);
r = session.getResource("e", "1");
assertNull(r.getValue("value1"));
assertEquals("test2", r.getValue("value2"));
tr.commit();
session.close();
}
public void testResourceExcludeFromAll() {
CompassSession session = openSession();
CompassTransaction tr = session.beginTransaction();
Resource r = session.createResource("f");
r.addProperty("id1", "1");
r.addProperty("id2", "2");
r.addProperty("value1", "test1");
r.addProperty("value2", "test2");
session.save(r);
CompassHits hits = session.find("1");
assertEquals(0, hits.length());
hits = session.find("2");
assertEquals(1, hits.length());
hits = session.find("test1");
assertEquals(0, hits.length());
hits = session.find("test2");
assertEquals(1, hits.length());
tr.commit();
session.close();
}
}
|
{
"content_hash": "511a561b133f9460b5798658093e4c20",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 120,
"avg_line_length": 36.462450592885375,
"alnum_prop": 0.637940379403794,
"repo_name": "vthriller/opensymphony-compass-backup",
"id": "2c796c9cca7493cfdef56b18e0bf0c0e697e4ce8",
"size": "9848",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/test/org/compass/core/test/resource/ResourceTests.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "189"
},
{
"name": "HTML",
"bytes": "31076"
},
{
"name": "Java",
"bytes": "4719137"
}
]
}
|
"""Auto-generated file, do not edit by hand. AL metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AL = PhoneMetadata(id='AL', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[15]\\d{2,5}', possible_length=(3, 4, 5, 6)),
toll_free=PhoneNumberDesc(national_number_pattern='1(?:1(?:2|6[01]\\d\\d)|2[7-9]|3[15]|41)', example_number='112', possible_length=(3, 6)),
premium_rate=PhoneNumberDesc(national_number_pattern='5\\d{4}', example_number='50000', possible_length=(5,)),
emergency=PhoneNumberDesc(national_number_pattern='1(?:12|2[7-9])', example_number='112', possible_length=(3,)),
short_code=PhoneNumberDesc(national_number_pattern='1(?:1(?:6(?:000|1(?:06|11|23))|8\\d\\d)|65\\d|89[12])|5\\d{4}|1(?:[1349]\\d|2[2-9])', example_number='110', possible_length=(3, 4, 5, 6)),
carrier_specific=PhoneNumberDesc(national_number_pattern='123', example_number='123', possible_length=(3,)),
sms_services=PhoneNumberDesc(national_number_pattern='131|5\\d{4}', example_number='131', possible_length=(3, 5)),
short_data=True)
|
{
"content_hash": "3adadc20eaf13cae395ced71b837d98e",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 194,
"avg_line_length": 95.91666666666667,
"alnum_prop": 0.6941789748045178,
"repo_name": "daviddrysdale/python-phonenumbers",
"id": "ca3c8b2411ba7969e1cd9177dd1a0d91265d3998",
"size": "1151",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "python/phonenumbers/shortdata/region_AL.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "3898"
},
{
"name": "Makefile",
"bytes": "9034"
},
{
"name": "Python",
"bytes": "22052087"
},
{
"name": "Ruby",
"bytes": "237"
}
]
}
|
smalltalk.addPackage('Benchfib');
smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib');
smalltalk.addMethod(
smalltalk.method({
selector: "main",
fn: function (){
var self=this;
var result;
return smalltalk.withContext(function($ctx1) {
result=_st((0))._tinyBenchmarks();
_st(console)._log_(_st("0 tinyBenchmarks => ").__comma(result));
return self}, function($ctx1) {$ctx1.fill(self,"main",{result:result},smalltalk.Benchfib.klass)})},
messageSends: ["tinyBenchmarks", "log:", ","]}),
smalltalk.Benchfib.klass);
smalltalk.addMethod(
smalltalk.method({
selector: "benchFib",
fn: function (){
var self=this;
return smalltalk.withContext(function($ctx1) {
var $2,$1;
$2=_st(self).__lt((2));
if(smalltalk.assert($2)){
$1=(1);
} else {
$1=_st(_st(_st(_st(self).__minus((1)))._benchFib()).__plus(_st(_st(self).__minus((2)))._benchFib())).__plus((1));
};
return $1;
}, function($ctx1) {$ctx1.fill(self,"benchFib",{},smalltalk.Number)})},
messageSends: ["ifTrue:ifFalse:", "+", "benchFib", "-", "<"]}),
smalltalk.Number);
smalltalk.addMethod(
smalltalk.method({
selector: "benchmark",
fn: function (){
var self=this;
var size,flags,prime,k,count;
function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
return smalltalk.withContext(function($ctx1) {
var $1,$2;
size=(8190);
_st((1))._to_do_(self,(function(iter){
return smalltalk.withContext(function($ctx2) {
count=(0);
count;
flags=_st($Array())._new();
flags;
_st(size)._timesRepeat_((function(){
return smalltalk.withContext(function($ctx3) {
return _st(flags)._add_(true);
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
return _st((1))._to_do_(size,(function(i){
return smalltalk.withContext(function($ctx3) {
$1=_st(flags)._at_(i);
if(smalltalk.assert($1)){
prime=_st(i).__plus((1));
prime;
k=_st(i).__plus(prime);
k;
_st((function(){
return smalltalk.withContext(function($ctx4) {
return _st(k).__lt_eq(size);
}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._whileTrue_((function(){
return smalltalk.withContext(function($ctx4) {
_st(flags)._at_put_(k,false);
k=_st(k).__plus(prime);
return k;
}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
count=_st(count).__plus((1));
return count;
};
}, function($ctx3) {$ctx3.fillBlock({i:i},$ctx1)})}));
}, function($ctx2) {$ctx2.fillBlock({iter:iter},$ctx1)})}));
$2=count;
return $2;
}, function($ctx1) {$ctx1.fill(self,"benchmark",{size:size,flags:flags,prime:prime,k:k,count:count},smalltalk.Number)})},
messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "+", "whileTrue:", "at:put:", "<=", "at:"]}),
smalltalk.Number);
smalltalk.addMethod(
smalltalk.method({
selector: "jsbenchFib",
fn: function (){
var self=this;
return smalltalk.withContext(function($ctx1) {
if (this < 2) {
return 1;
} else {
return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;};
return self}, function($ctx1) {$ctx1.fill(self,"jsbenchFib",{},smalltalk.Number)})},
messageSends: []}),
smalltalk.Number);
smalltalk.addMethod(
smalltalk.method({
selector: "jsbenchmark",
fn: function (){
var self=this;
return smalltalk.withContext(function($ctx1) {
var size = 8190;
var count;
for (var z=0;z<this;z++) {
count = 0;
var flags = new Array();
for (var p=0; p<size; p++) {
flags[p] = true;
}
for (var i=1;i<=size;i++) {
if (flags[i-1]) {
var prime = i+1;
var k = i + prime;
while (k <= size) {
flags[k-1] = false;
k = k + prime;
}
count = count + 1;
}
}
}
return count;
return self}, function($ctx1) {$ctx1.fill(self,"jsbenchmark",{},smalltalk.Number)})},
messageSends: []}),
smalltalk.Number);
smalltalk.addMethod(
smalltalk.method({
selector: "jstinyBenchmarks",
fn: function (){
var self=this;
var t1,t2,r,n1,n2;
function $Date(){return smalltalk.Date||(typeof Date=="undefined"?nil:Date)}
return smalltalk.withContext(function($ctx1) {
var $1;
n1=(1);
_st((function(){
return smalltalk.withContext(function($ctx2) {
t1=_st($Date())._millisecondsToRun_((function(){
return smalltalk.withContext(function($ctx3) {
return _st(n1)._jsbenchmark();
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
t1;
return _st(t1).__lt((1000));
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
return smalltalk.withContext(function($ctx2) {
n1=_st(n1).__star((2));
return n1;
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
n2=(28);
_st((function(){
return smalltalk.withContext(function($ctx2) {
t2=_st($Date())._millisecondsToRun_((function(){
return smalltalk.withContext(function($ctx3) {
r=_st(n2)._jsbenchFib();
return r;
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
t2;
return _st(t2).__lt((1000));
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
return smalltalk.withContext(function($ctx2) {
n2=_st(n2).__plus((1));
return n2;
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
$1=_st(_st(_st(_st(_st(_st(_st(n1).__star((500000))).__star((1000))).__slash(t1))._printString()).__comma(" bytecodes/sec; ")).__comma(_st(_st(_st(r).__star((1000))).__slash(t2))._printString())).__comma(" sends/sec");
return $1;
}, function($ctx1) {$ctx1.fill(self,"jstinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},smalltalk.Number)})},
messageSends: ["whileTrue:", "*", "millisecondsToRun:", "jsbenchmark", "<", "+", "jsbenchFib", ",", "printString", "/"]}),
smalltalk.Number);
smalltalk.addMethod(
smalltalk.method({
selector: "tinyBenchmarks",
fn: function (){
var self=this;
var t1,t2,r,n1,n2;
function $Date(){return smalltalk.Date||(typeof Date=="undefined"?nil:Date)}
return smalltalk.withContext(function($ctx1) {
var $1;
n1=(1);
_st((function(){
return smalltalk.withContext(function($ctx2) {
t1=_st($Date())._millisecondsToRun_((function(){
return smalltalk.withContext(function($ctx3) {
return _st(n1)._benchmark();
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
t1;
return _st(t1).__lt((1000));
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
return smalltalk.withContext(function($ctx2) {
n1=_st(n1).__star((2));
return n1;
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
n2=(16);
_st((function(){
return smalltalk.withContext(function($ctx2) {
t2=_st($Date())._millisecondsToRun_((function(){
return smalltalk.withContext(function($ctx3) {
r=_st(n2)._benchFib();
return r;
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
t2;
return _st(t2).__lt((1000));
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
return smalltalk.withContext(function($ctx2) {
n2=_st(n2).__plus((1));
return n2;
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
$1=_st(_st(_st(_st(_st(_st(_st(n1).__star((500000))).__star((1000))).__slash(t1))._printString()).__comma(" bytecodes/sec; ")).__comma(_st(_st(_st(r).__star((1000))).__slash(t2))._printString())).__comma(" sends/sec");
return $1;
}, function($ctx1) {$ctx1.fill(self,"tinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},smalltalk.Number)})},
messageSends: ["whileTrue:", "*", "millisecondsToRun:", "benchmark", "<", "+", "benchFib", ",", "printString", "/"]}),
smalltalk.Number);
|
{
"content_hash": "4cb5d4e6b402b2ed75d71414a88a9315",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 218,
"avg_line_length": 32.34101382488479,
"alnum_prop": 0.6484753491023083,
"repo_name": "dalehenrich/tasks",
"id": "e18dd9c13e4faabf7fc8f255d1d80102f47702f2",
"size": "7018",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "service/static/lib/amber/js/Benchfib.deploy.js",
"mode": "33261",
"license": "mit",
"language": []
}
|
(function($) {
$.jqplot.RadarRenderer = function(){
$.jqplot.LineRenderer.call(this);
};
$.jqplot.RadarRenderer.prototype = new $.jqplot.LineRenderer();
$.jqplot.RadarRenderer.prototype.constructor = $.jqplot.RadarRenderer;
// called with scope of a series
$.jqplot.RadarRenderer.prototype.init = function(options, plot) {
// Group: Properties
//
// prop: diameter
// Outer diameter of the pie, auto computed by default
this.diameter = null;
// prop: highlightColors
// an array of colors to use when highlighting a slice.
this.highlightColors = [];
// set highlight colors if none provided
if (this.highlightColors.length == 0) {
for (var i=0; i<this.seriesColors.length; i++){
var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
var newrgb = [rgba[0], rgba[1], rgba[2]];
var sum = newrgb[0] + newrgb[1] + newrgb[2];
for (var j=0; j<3; j++) {
// when darkening, lowest color component can be is 60.
newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
newrgb[j] = parseInt(newrgb[j], 10);
}
this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
}
}
this.highlightColorGenerator = new $.jqplot.ColorGenerator(this.highlightColors);
this.renderer.options = options;
$.extend(true, this, options);
plot.postParseOptionsHooks.addOnce(postParseOptions);
plot.postInitHooks.addOnce(postInit);
};
// setup default renderers for axes and legend so user doesn't have to
// called with scope of plot
function preInit(target, data, options) {
options = options || {};
options.axesDefaults = options.axesDefaults || {};
options.legend = options.legend || {};
options.seriesDefaults = options.seriesDefaults || {};
}
// called with scope of plot
function postParseOptions(options) {
for (var i=0; i<this.series.length; i++) {
this.series[i].seriesColors = this.seriesColors;
this.series[i].colorGenerator = $.jqplot.colorGenerator;
}
}
function postInit(target, data, options) {
for (var i=0; i<this.series.length; i++) {
if (this.series[i].renderer.constructor == $.jqplot.RadarRenderer) {
// don't allow mouseover and mousedown at same time.
if (this.series[i].highlightMouseOver) {
this.series[i].highlightMouseDown = false;
}
}
}
}
$.jqplot.RadarRenderer.prototype.drawLine = function (ctx, datas, color) {
var data = this.data;
var rotationDegree = (2*Math.PI)/data.length;
ctx.save();
ctx.translate(ctx.canvas.width / 2, ctx.canvas.height / 2);
// Move to starting point
ctx.strokeStyle = color;
ctx.fillStyle = color;
ctx.lineWidth = this.lineWidth;
ctx.beginPath();
var r = (-this._calculatedScale.scaleHop * (data[0][1])) / this._calculatedScale.stepInterval;
ctx.moveTo(0,r);
for (var i=0; i<data.length; i++){
r = (-this._calculatedScale.scaleHop * (data[i][1])) / this._calculatedScale.stepInterval;
ctx.lineTo(0,r);
ctx.rotate(rotationDegree);
}
// Close path and draw stroke / fill
ctx.closePath();
ctx.globalAlpha = .1;
ctx.fill();
ctx.globalAlpha = 1;
ctx.stroke();
ctx.restore();
};
$.jqplot.RadarRenderer.prototype.drawScales = function(ctx){
var data = this.data;
var rotationDegree = (2*Math.PI)/data.length;
ctx.save();
ctx.translate(ctx.canvas.width / 2, ctx.canvas.height / 2);
if (this.angleShowLineOut){
ctx.strokeStyle = this.angleLineColor;
ctx.lineWidth = this.angleLineWidth;
for (var h=0; h<data.length; h++){
ctx.rotate(rotationDegree);
ctx.beginPath();
ctx.moveTo(0,0);
ctx.lineTo(0,-maxSize);
ctx.stroke();
}
}
// Show web scales
for (var i=0; i<this._calculatedScale.steps; i++) {
ctx.beginPath();
if (this.renderer.options.scaleShowLine) {
ctx.strokeStyle = this.renderer.options.scaleLineColor;
ctx.lineWidth = this.scaleLineWidth;
ctx.moveTo(0, -this._calculatedScale.scaleHop * (i + 1));
for (var j = 0; j < data.length; j++) {
ctx.rotate(rotationDegree);
ctx.lineTo(0, -this._calculatedScale.scaleHop * (i + 1));
}
ctx.closePath();
ctx.stroke();
}
}
// Show scale labels
if (this.renderer.options.scaleShowLabels){
for (var i=1; i<=this._calculatedScale.steps; i++) {
ctx.textAlign = 'center';
ctx.font = this.scaleFontSize+"px " + this.scaleFontFamily;
ctx.fillStyle = this.scaleFontStyle;
ctx.textBaseline = "middle";
if (this.scaleShowLabelBackdrop){
var textWidth = ctx.measureText(this._calculatedScale.labels[i]).width;
ctx.fillStyle = this.scaleBackdropColor;
ctx.beginPath();
ctx.rect(
Math.round(- textWidth/2 - this.scaleBackdropPaddingX), //X
Math.round((-this._calculatedScale.scaleHop * (i + 1)) - this.scaleFontSize*0.5 - this.scaleBackdropPaddingY),//Y
Math.round(textWidth + (this.scaleBackdropPaddingX*2)), //Width
Math.round(this.scaleFontSize + (this.scaleBackdropPaddingY*2)) //Height
);
ctx.fill();
}
ctx.fillStyle = this.scaleFontColor;
ctx.fillText(this._calculatedScale.labels[i],10,-this._calculatedScale.scaleHop*i+5);
}
}
ctx.restore();
};
$.jqplot.RadarRenderer.prototype.drawAxes = function(ctx){
var data = this.data;
var rotationDegree = (2*Math.PI)/data.length;
ctx.save();
ctx.translate(ctx.canvas.width / 2, ctx.canvas.height / 2);
// Draw axes
ctx.strokeStyle = this.renderer.options.scaleLineColor;
for (var i=0; i<data.length; i++) {
ctx.beginPath();
ctx.moveTo(0, -this._calculatedScale.scaleHop);
ctx.lineTo(0, -this._calculatedScale.scaleHop*this._calculatedScale.steps);
ctx.closePath();
ctx.stroke();
ctx.rotate(rotationDegree);
}
// Draw axis labels
if (this.renderer.options.showAxisLabels){
ctx.font = this.renderer.options.labelFontSize + "px " + this.renderer.options.labelFontFamily;
ctx.fillStyle = this.renderer.options.labelFontStyle;
ctx.textBaseline = "middle";
for (var i=0; i<data.length; i++) {
var alpha = (2*Math.PI / data.length) * i;
var r = this._calculatedScale.scaleHop * this._calculatedScale.steps + (0.75 * this.renderer.options.labelFontSize);
var xPos = Math.floor(r * Math.sin(alpha));
var yPos = Math.floor(-r * Math.cos(alpha));
if (xPos > 0) ctx.textAlign = 'left';
else if(xPos < 0) ctx.textAlign = 'right';
else ctx.textAlign = 'center';
ctx.fillText(this.renderer.options.radarAxisLabels[i], xPos, yPos);
}
}
ctx.restore();
};
$.jqplot.RadarRenderer.prototype.drawOrigin = function(ctx, options){
if(this.renderer.options.showOrigin) {
var offx = 0;
var offy = 0;
var trans = 1;
if (options.legendInfo && options.legendInfo.placement == 'insideGrid') {
var li = options.legendInfo;
switch (li.location) {
case 'nw':
offx = li.width + li.xoffset;
break;
case 'w':
offx = li.width + li.xoffset;
break;
case 'sw':
offx = li.width + li.xoffset;
break;
case 'ne':
offx = li.width + li.xoffset;
trans = -1;
break;
case 'e':
offx = li.width + li.xoffset;
trans = -1;
break;
case 'se':
offx = li.width + li.xoffset;
trans = -1;
break;
case 'n':
offy = li.height + li.yoffset;
break;
case 's':
offy = li.height + li.yoffset;
trans = -1;
break;
default:
break;
}
}
var cw = ctx.canvas.width;
var ch = ctx.canvas.height;
this._center = [(cw - trans * offx) / 2 + trans * offx, (ch - trans * offy) / 2 + trans * offy];
ctx.strokeStyle = this.renderer.options.originStyle;
ctx.beginPath();
ctx.arc(this._center[0], this._center[1], 5, 0, 2 * Math.PI, true);
ctx.stroke();
}
};
$.jqplot.RadarRenderer.prototype.draw = function (ctx, gridData, options, plot) {
var opts = $.extend({}, this.renderer.options);
var stepCount = opts.scaleLineCount;
var stepInterval = opts.scaleLineMax / opts.scaleLineCount;
var scaleHop = (ctx.canvas.height / (2 * stepCount)) - 16/stepCount;
if(opts.showAxisLabels) {
scaleHop = scaleHop - 1.25*opts.labelFontSize/stepCount;
}
var stepLabels = [];
for(i=0; i<=stepCount; i++) {
var currentStep = i*stepInterval;
stepLabels[i] = Math.round((currentStep + Number.EPSILON) * 100) / 100;
}
this._calculatedScale = {
steps: stepCount,
stepInterval: stepInterval,
scaleHop : scaleHop,
graphMin : 0,
labels : stepLabels
};
// At first data series draw web
if(this.index == 0) {
this.renderer.drawOrigin.call(this, ctx, options);
this.renderer.drawScales.call(this, ctx);
this.renderer.drawAxes.call(this, ctx);
}
this.renderer.drawLine.call(this, ctx, [], this.seriesColors[this.index]);
};
$.jqplot.preInitHooks.push(preInit);
})(jQuery);
|
{
"content_hash": "41e5faef603a21fe9c347e584629b0b9",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 137,
"avg_line_length": 37.58922558922559,
"alnum_prop": 0.5130777499104263,
"repo_name": "svandecappelle/jQPlot",
"id": "1937180f4d9d7267cbac926137146b1c2d5929a9",
"size": "11164",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/plugins/radar/jqplot.radarRenderer.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8791"
},
{
"name": "HTML",
"bytes": "2416"
},
{
"name": "JavaScript",
"bytes": "1378713"
}
]
}
|
#ifndef TENSORFLOW_CORE_DATA_SERVICE_CLIENT_COMMON_H_
#define TENSORFLOW_CORE_DATA_SERVICE_CLIENT_COMMON_H_
#include <cstdint>
#include <optional>
#include <string>
#include <vector>
#include "absl/time/time.h"
#include "tensorflow/core/data/service/common.pb.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/protobuf/data_service.pb.h"
namespace tensorflow {
namespace data {
// tf.data service parameters.
struct DataServiceParams final {
std::string dataset_id;
ProcessingModeDef processing_mode;
std::string address;
std::string protocol;
std::string data_transfer_protocol;
std::string job_name;
int64_t repetition = 0;
std::optional<int64_t> num_consumers;
std::optional<int64_t> consumer_index;
int64_t max_outstanding_requests = 0;
absl::Duration task_refresh_interval;
TargetWorkers target_workers = TargetWorkers::TARGET_WORKERS_UNSPECIFIED;
DataServiceMetadata metadata;
std::optional<CrossTrainerCacheOptions> cross_trainer_cache_options;
};
// Container to hold the result of a `GetNext` call.
struct GetNextResult final {
explicit GetNextResult() = default;
GetNextResult(const GetNextResult&) = delete;
GetNextResult& operator=(const GetNextResult&) = delete;
GetNextResult(GetNextResult&&) = default;
GetNextResult& operator=(GetNextResult&&) = delete;
static GetNextResult EndOfSequence() {
GetNextResult result;
result.end_of_sequence = true;
return result;
}
std::vector<Tensor> tensors;
bool end_of_sequence = false;
};
} // namespace data
} // namespace tensorflow
#endif // TENSORFLOW_CORE_DATA_SERVICE_CLIENT_COMMON_H_
|
{
"content_hash": "2da589af90caec570b61e0b31f827e52",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 75,
"avg_line_length": 28.75438596491228,
"alnum_prop": 0.7498474679682733,
"repo_name": "yongtang/tensorflow",
"id": "c9bd04f029246595dbdf69f4c88b1031e183c5c1",
"size": "2307",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "tensorflow/core/data/service/client/common.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "36962"
},
{
"name": "C",
"bytes": "1368342"
},
{
"name": "C#",
"bytes": "13584"
},
{
"name": "C++",
"bytes": "125162438"
},
{
"name": "CMake",
"bytes": "179878"
},
{
"name": "Cython",
"bytes": "5003"
},
{
"name": "Dockerfile",
"bytes": "416133"
},
{
"name": "Go",
"bytes": "2118448"
},
{
"name": "HTML",
"bytes": "4686483"
},
{
"name": "Java",
"bytes": "1074438"
},
{
"name": "Jupyter Notebook",
"bytes": "792868"
},
{
"name": "LLVM",
"bytes": "6536"
},
{
"name": "MLIR",
"bytes": "11205807"
},
{
"name": "Makefile",
"bytes": "2760"
},
{
"name": "Objective-C",
"bytes": "172666"
},
{
"name": "Objective-C++",
"bytes": "300198"
},
{
"name": "Pawn",
"bytes": "5552"
},
{
"name": "Perl",
"bytes": "7536"
},
{
"name": "Python",
"bytes": "42642473"
},
{
"name": "Roff",
"bytes": "5034"
},
{
"name": "Ruby",
"bytes": "9199"
},
{
"name": "Shell",
"bytes": "621427"
},
{
"name": "Smarty",
"bytes": "89545"
},
{
"name": "SourcePawn",
"bytes": "14607"
},
{
"name": "Starlark",
"bytes": "7577804"
},
{
"name": "Swift",
"bytes": "78435"
},
{
"name": "Vim Snippet",
"bytes": "58"
}
]
}
|
End of preview.
No dataset card yet
- Downloads last month
- 3