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: TypeError
Message: Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2011, in _prepare_split_single
writer.write_table(table)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 585, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2302, in table_cast
return cast_table_to_schema(table, schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2122, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
TypeError: Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
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 org.apache.drill.exec.server.rest;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.jaxrs.base.JsonMappingExceptionMapper;
import com.fasterxml.jackson.jaxrs.base.JsonParseExceptionMapper;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import com.google.common.base.Strings;
import freemarker.cache.ClassTemplateLoader;
import freemarker.cache.FileTemplateLoader;
import freemarker.cache.MultiTemplateLoader;
import freemarker.cache.TemplateLoader;
import freemarker.cache.WebappTemplateLoader;
import freemarker.core.HTMLOutputFormat;
import freemarker.template.Configuration;
import io.netty.channel.ChannelPromise;
import io.netty.channel.DefaultChannelPromise;
import io.netty.util.concurrent.EventExecutor;
import org.apache.drill.common.config.DrillConfig;
import org.apache.drill.exec.ExecConstants;
import org.apache.drill.exec.memory.BufferAllocator;
import org.apache.drill.exec.proto.UserBitShared;
import org.apache.drill.exec.rpc.user.UserSession;
import org.apache.drill.exec.server.Drillbit;
import org.apache.drill.exec.server.DrillbitContext;
import org.apache.drill.exec.server.rest.WebUserConnection.AnonWebUserConnection;
import org.apache.drill.exec.server.rest.auth.AuthDynamicFeature;
import org.apache.drill.exec.server.rest.auth.DrillUserPrincipal;
import org.apache.drill.exec.server.rest.auth.DrillUserPrincipal.AnonDrillUserPrincipal;
import org.apache.drill.exec.server.rest.profile.ProfileResources;
import org.apache.drill.exec.store.StoragePluginRegistry;
import org.apache.drill.exec.store.sys.PersistentStoreProvider;
import org.apache.drill.exec.work.WorkManager;
import org.glassfish.hk2.api.Factory;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.CommonProperties;
import org.glassfish.jersey.internal.util.PropertiesHelper;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.glassfish.jersey.process.internal.RequestScoped;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.server.ServerProperties;
import org.glassfish.jersey.server.filter.RolesAllowedDynamicFeature;
import org.glassfish.jersey.server.mvc.freemarker.FreemarkerMvcFeature;
import javax.inject.Inject;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.security.Principal;
import java.util.ArrayList;
import java.util.List;
public class DrillRestServer extends ResourceConfig {
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillRestServer.class);
public DrillRestServer(final WorkManager workManager, final ServletContext servletContext, final Drillbit drillbit) {
register(DrillRoot.class);
register(StatusResources.class);
register(StorageResources.class);
register(ProfileResources.class);
register(QueryResources.class);
register(MetricsResources.class);
register(ThreadsResources.class);
register(LogsResources.class);
property(FreemarkerMvcFeature.TEMPLATE_OBJECT_FACTORY, getFreemarkerConfiguration(servletContext));
register(FreemarkerMvcFeature.class);
register(MultiPartFeature.class);
property(ServerProperties.METAINF_SERVICES_LOOKUP_DISABLE, true);
final boolean isAuthEnabled =
workManager.getContext().getConfig().getBoolean(ExecConstants.USER_AUTHENTICATION_ENABLED);
if (isAuthEnabled) {
register(LogInLogOutResources.class);
register(AuthDynamicFeature.class);
register(RolesAllowedDynamicFeature.class);
}
//disable moxy so it doesn't conflict with jackson.
final String disableMoxy = PropertiesHelper.getPropertyNameForRuntime(CommonProperties.MOXY_JSON_FEATURE_DISABLE,
getConfiguration().getRuntimeType());
property(disableMoxy, true);
register(JsonParseExceptionMapper.class);
register(JsonMappingExceptionMapper.class);
register(GenericExceptionMapper.class);
JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider();
provider.setMapper(workManager.getContext().getLpPersistence().getMapper());
register(provider);
// Get an EventExecutor out of the BitServer EventLoopGroup to notify listeners for WebUserConnection. For
// actual connections between Drillbits this EventLoopGroup is used to handle network related events. Though
// there is no actual network connection associated with WebUserConnection but we need a CloseFuture in
// WebSessionResources, so we are using EvenExecutor from network EventLoopGroup pool.
final EventExecutor executor = workManager.getContext().getBitLoopGroup().next();
register(new AbstractBinder() {
@Override
protected void configure() {
bind(drillbit).to(Drillbit.class);
bind(workManager).to(WorkManager.class);
bind(executor).to(EventExecutor.class);
bind(workManager.getContext().getLpPersistence().getMapper()).to(ObjectMapper.class);
bind(workManager.getContext().getStoreProvider()).to(PersistentStoreProvider.class);
bind(workManager.getContext().getStorage()).to(StoragePluginRegistry.class);
bind(new UserAuthEnabled(isAuthEnabled)).to(UserAuthEnabled.class);
if (isAuthEnabled) {
bindFactory(DrillUserPrincipalProvider.class).to(DrillUserPrincipal.class);
bindFactory(AuthWebUserConnectionProvider.class).to(WebUserConnection.class);
} else {
bindFactory(AnonDrillUserPrincipalProvider.class).to(DrillUserPrincipal.class);
bindFactory(AnonWebUserConnectionProvider.class).to(WebUserConnection.class);
}
}
});
}
/**
* Creates freemarker configuration settings,
* default output format to trigger auto-escaping policy
* and template loaders.
*
* @param servletContext servlet context
* @return freemarker configuration settings
*/
private Configuration getFreemarkerConfiguration(ServletContext servletContext) {
Configuration configuration = new Configuration(Configuration.VERSION_2_3_26);
configuration.setOutputFormat(HTMLOutputFormat.INSTANCE);
List<TemplateLoader> loaders = new ArrayList<>();
loaders.add(new WebappTemplateLoader(servletContext));
loaders.add(new ClassTemplateLoader(DrillRestServer.class, "/"));
try {
loaders.add(new FileTemplateLoader(new File("/")));
} catch (IOException e) {
logger.error("Could not set up file template loader.", e);
}
configuration.setTemplateLoader(new MultiTemplateLoader(loaders.toArray(new TemplateLoader[loaders.size()])));
return configuration;
}
public static class AuthWebUserConnectionProvider implements Factory<WebUserConnection> {
@Inject
HttpServletRequest request;
@Inject
WorkManager workManager;
@Inject
EventExecutor executor;
@SuppressWarnings("resource")
@Override
public WebUserConnection provide() {
final HttpSession session = request.getSession();
final Principal sessionUserPrincipal = request.getUserPrincipal();
// If there is no valid principal this means user is not logged in yet.
if (sessionUserPrincipal == null) {
return null;
}
// User is logged in, get/set the WebSessionResources attribute
WebSessionResources webSessionResources =
(WebSessionResources) session.getAttribute(WebSessionResources.class.getSimpleName());
if (webSessionResources == null) {
// User is login in for the first time
final DrillbitContext drillbitContext = workManager.getContext();
final DrillConfig config = drillbitContext.getConfig();
final UserSession drillUserSession = UserSession.Builder.newBuilder()
.withCredentials(UserBitShared.UserCredentials.newBuilder()
.setUserName(sessionUserPrincipal.getName())
.build())
.withOptionManager(drillbitContext.getOptionManager())
.setSupportComplexTypes(config.getBoolean(ExecConstants.CLIENT_SUPPORT_COMPLEX_TYPES))
.build();
// Only try getting remote address in first login since it's a costly operation.
SocketAddress remoteAddress = null;
try {
// This can be slow as the underlying library will try to resolve the address
remoteAddress = new InetSocketAddress(InetAddress.getByName(request.getRemoteAddr()), request.getRemotePort());
session.setAttribute(SocketAddress.class.getSimpleName(), remoteAddress);
} catch (Exception ex) {
//no-op
logger.trace("Failed to get the remote address of the http session request", ex);
}
// Create per session BufferAllocator and set it in session
final String sessionAllocatorName = String.format("WebServer:AuthUserSession:%s", session.getId());
final BufferAllocator sessionAllocator = workManager.getContext().getAllocator().newChildAllocator(
sessionAllocatorName,
config.getLong(ExecConstants.HTTP_SESSION_MEMORY_RESERVATION),
config.getLong(ExecConstants.HTTP_SESSION_MEMORY_MAXIMUM));
// Create a dummy close future which is needed by Foreman only. Foreman uses this future to add a close
// listener to known about channel close event from underlying layer. We use this future to notify Foreman
// listeners when the Web session (not connection) between Web Client and WebServer is closed. This will help
// Foreman to cancel all the running queries for this Web Client.
final ChannelPromise closeFuture = new DefaultChannelPromise(null, executor);
// Create a WebSessionResource instance which owns the lifecycle of all the session resources.
// Set this instance as an attribute of HttpSession, since it will be used until session is destroyed
webSessionResources = new WebSessionResources(sessionAllocator, remoteAddress, drillUserSession, closeFuture);
session.setAttribute(WebSessionResources.class.getSimpleName(), webSessionResources);
}
// Create a new WebUserConnection for the request
return new WebUserConnection(webSessionResources);
}
@Override
public void dispose(WebUserConnection instance) {
}
}
public static class AnonWebUserConnectionProvider implements Factory<WebUserConnection> {
@Inject
HttpServletRequest request;
@Inject
WorkManager workManager;
@Inject
EventExecutor executor;
@SuppressWarnings("resource")
@Override
public WebUserConnection provide() {
final DrillbitContext drillbitContext = workManager.getContext();
final DrillConfig config = drillbitContext.getConfig();
// Create an allocator here for each request
final BufferAllocator sessionAllocator = drillbitContext.getAllocator()
.newChildAllocator("WebServer:AnonUserSession",
config.getLong(ExecConstants.HTTP_SESSION_MEMORY_RESERVATION),
config.getLong(ExecConstants.HTTP_SESSION_MEMORY_MAXIMUM));
final Principal sessionUserPrincipal = createSessionUserPrincipal(config, request);
// Create new UserSession for each request from non-authenticated user
final UserSession drillUserSession = UserSession.Builder.newBuilder()
.withCredentials(UserBitShared.UserCredentials.newBuilder()
.setUserName(sessionUserPrincipal.getName())
.build())
.withOptionManager(drillbitContext.getOptionManager())
.setSupportComplexTypes(drillbitContext.getConfig().getBoolean(ExecConstants.CLIENT_SUPPORT_COMPLEX_TYPES))
.build();
// Try to get the remote Address but set it to null in case of failure.
SocketAddress remoteAddress = null;
try {
// This can be slow as the underlying library will try to resolve the address
remoteAddress = new InetSocketAddress(InetAddress.getByName(request.getRemoteAddr()), request.getRemotePort());
} catch (Exception ex) {
// no-op
logger.trace("Failed to get the remote address of the http session request", ex);
}
// Create a dummy close future which is needed by Foreman only. Foreman uses this future to add a close
// listener to known about channel close event from underlying layer.
//
// The invocation of this close future is no-op as it will be triggered after query completion in unsecure case.
// But we need this close future as it's expected by Foreman.
final ChannelPromise closeFuture = new DefaultChannelPromise(null, executor);
final WebSessionResources webSessionResources = new WebSessionResources(sessionAllocator, remoteAddress,
drillUserSession, closeFuture);
// Create a AnonWenUserConnection for this request
return new AnonWebUserConnection(webSessionResources);
}
@Override
public void dispose(WebUserConnection instance) {
}
/**
* Creates session user principal. If impersonation is enabled without authentication and User-Name header is present and valid,
* will create session user principal with provided user name, otherwise anonymous user name will be used.
* In both cases session user principal will have admin rights.
*
* @param config drill config
* @param request client request
* @return session user principal
*/
private Principal createSessionUserPrincipal(DrillConfig config, HttpServletRequest request) {
if (WebServer.isImpersonationOnlyEnabled(config)) {
final String userName = request.getHeader("User-Name");
if (!Strings.isNullOrEmpty(userName)) {
return new DrillUserPrincipal(userName, true);
}
}
return new AnonDrillUserPrincipal();
}
}
// Provider which injects DrillUserPrincipal directly instead of getting it from SecurityContext and typecasting
public static class DrillUserPrincipalProvider implements Factory<DrillUserPrincipal> {
@Inject HttpServletRequest request;
@Override
public DrillUserPrincipal provide() {
return (DrillUserPrincipal) request.getUserPrincipal();
}
@Override
public void dispose(DrillUserPrincipal principal) {
// No-Op
}
}
// Provider which creates and cleanups DrillUserPrincipal for anonymous (auth disabled) mode
public static class AnonDrillUserPrincipalProvider implements Factory<DrillUserPrincipal> {
@RequestScoped
@Override
public DrillUserPrincipal provide() {
return new AnonDrillUserPrincipal();
}
@Override
public void dispose(DrillUserPrincipal principal) {
// If this worked it would have been clean to free the resources here, but there are various scenarios
// where dispose never gets called due to bugs in jersey.
}
}
// Returns whether auth is enabled or not in config
public static class UserAuthEnabled {
private boolean value;
public UserAuthEnabled(boolean value) {
this.value = value;
}
public boolean get() {
return value;
}
}
}
|
{
"content_hash": "d479b8664aeec94312b9261dcb45a432",
"timestamp": "",
"source": "github",
"line_count": 355,
"max_line_length": 132,
"avg_line_length": 43.309859154929576,
"alnum_prop": 0.7421138211382113,
"repo_name": "parthchandra/incubator-drill",
"id": "89141d735d588f4c40e8b04d328e59ff717e1bf5",
"size": "16176",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DrillRestServer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "6006"
},
{
"name": "C",
"bytes": "31411"
},
{
"name": "C++",
"bytes": "257521"
},
{
"name": "CMake",
"bytes": "13503"
},
{
"name": "FreeMarker",
"bytes": "55163"
},
{
"name": "GAP",
"bytes": "16176"
},
{
"name": "Java",
"bytes": "13218561"
},
{
"name": "JavaScript",
"bytes": "55772"
},
{
"name": "PLSQL",
"bytes": "6665"
},
{
"name": "Protocol Buffer",
"bytes": "19818"
},
{
"name": "Shell",
"bytes": "42289"
}
]
}
|
namespace blink {
class LayoutBoxModelObject;
class LocalFrameView;
class PropertyTreeState;
class TextElementTiming;
class TracedValue;
class TextRecord : public base::SupportsWeakPtr<TextRecord> {
public:
TextRecord(DOMNodeId new_node_id,
uint64_t new_first_size,
const FloatRect& element_timing_rect)
: node_id(new_node_id),
first_size(new_first_size),
element_timing_rect_(element_timing_rect) {
static unsigned next_insertion_index_ = 1;
insertion_index_ = next_insertion_index_++;
}
DOMNodeId node_id = kInvalidDOMNodeId;
uint64_t first_size = 0;
// |insertion_index_| is ordered by insertion time, used as a secondary key
// for ranking.
unsigned insertion_index_ = 0;
FloatRect element_timing_rect_;
// The time of the first paint after fully loaded.
base::TimeTicks paint_time = base::TimeTicks();
DISALLOW_COPY_AND_ASSIGN(TextRecord);
};
class CORE_EXPORT LargestTextPaintManager {
DISALLOW_NEW();
using TextRecordSetComparator = bool (*)(const base::WeakPtr<TextRecord>&,
const base::WeakPtr<TextRecord>&);
using TextRecordSet =
std::set<base::WeakPtr<TextRecord>, TextRecordSetComparator>;
public:
LargestTextPaintManager(LocalFrameView*, PaintTimingDetector*);
inline void RemoveVisibleRecord(base::WeakPtr<TextRecord> record) {
DCHECK(record);
size_ordered_set_.erase(record);
if (cached_largest_paint_candidate_.get() == record.get())
cached_largest_paint_candidate_ = nullptr;
is_result_invalidated_ = true;
}
base::WeakPtr<TextRecord> FindLargestPaintCandidate();
void ReportCandidateToTrace(const TextRecord&);
void ReportNoCandidateToTrace();
base::WeakPtr<TextRecord> UpdateCandidate();
void PopulateTraceValue(TracedValue&, const TextRecord& first_text_paint);
inline void SetCachedResultInvalidated(bool value) {
is_result_invalidated_ = value;
}
inline void InsertRecord(base::WeakPtr<TextRecord> record) {
size_ordered_set_.emplace(record);
SetCachedResultInvalidated(true);
}
void Trace(Visitor*);
private:
friend class LargestContentfulPaintCalculatorTest;
friend class TextPaintTimingDetectorTest;
TextRecordSet size_ordered_set_;
base::WeakPtr<TextRecord> cached_largest_paint_candidate_;
// This is used to cache the largest text paint result for better
// efficiency.
// The result will be invalidated whenever any change is done to the
// variables used in |FindLargestPaintCandidate|.
bool is_result_invalidated_ = false;
unsigned count_candidates_ = 0;
Member<const LocalFrameView> frame_view_;
Member<PaintTimingDetector> paint_timing_detector_;
DISALLOW_COPY_AND_ASSIGN(LargestTextPaintManager);
};
class CORE_EXPORT TextRecordsManager {
DISALLOW_NEW();
friend class TextPaintTimingDetectorTest;
public:
TextRecordsManager(LocalFrameView*, PaintTimingDetector*);
void RemoveVisibleRecord(const LayoutObject&);
void RemoveInvisibleRecord(const LayoutObject&);
void RecordVisibleObject(const LayoutObject&,
const uint64_t& visual_size,
const FloatRect& element_timing_rect);
void RecordInvisibleObject(const LayoutObject& object);
bool NeedMeausuringPaintTime() const {
return !texts_queued_for_paint_time_.IsEmpty() ||
!size_zero_texts_queued_for_paint_time_.IsEmpty();
}
void AssignPaintTimeToQueuedRecords(const base::TimeTicks&);
inline bool HasRecorded(const LayoutObject& object) const {
return visible_objects_.Contains(&object) ||
invisible_objects_.Contains(&object);
}
inline bool IsKnownVisible(const LayoutObject& object) const {
return visible_objects_.Contains(&object);
}
inline bool IsKnownInvisible(const LayoutObject& object) const {
return invisible_objects_.Contains(&object);
}
void CleanUpLargestTextPaint();
bool HasTextElementTiming() const { return text_element_timing_; }
void SetTextElementTiming(TextElementTiming* text_element_timing) {
text_element_timing_ = text_element_timing;
}
inline base::WeakPtr<TextRecord> UpdateCandidate() {
DCHECK(ltp_manager_);
return ltp_manager_->UpdateCandidate();
}
inline bool IsRecordingLargestTextPaint() const {
return ltp_manager_.has_value();
}
void Trace(Visitor*);
private:
friend class LargestContentfulPaintCalculatorTest;
friend class TextPaintTimingDetectorTest;
inline void QueueToMeasurePaintTime(base::WeakPtr<TextRecord>& record) {
texts_queued_for_paint_time_.push_back(std::move(record));
}
// Once LayoutObject* is destroyed, |visible_objects_| and
// |invisible_objects_| must immediately clear the corresponding record from
// themselves.
HashMap<const LayoutObject*, std::unique_ptr<TextRecord>> visible_objects_;
HashSet<const LayoutObject*> invisible_objects_;
Deque<base::WeakPtr<TextRecord>> texts_queued_for_paint_time_;
// These are text records created to notify Element Timing of texts which are
// first painted outside of the viewport. These have size 0 for the purpose of
// LCP computations, even if the size of the text itself is not 0. They are
// considered invisible objects by Largest Contentful Paint.
Deque<std::unique_ptr<TextRecord>> size_zero_texts_queued_for_paint_time_;
base::Optional<LargestTextPaintManager> ltp_manager_;
Member<TextElementTiming> text_element_timing_;
DISALLOW_COPY_AND_ASSIGN(TextRecordsManager);
};
// TextPaintTimingDetector contains Largest Text Paint and support for Text
// Element Timing.
//
// Largest Text Paint timing measures when the largest text element gets painted
// within viewport. Specifically, it:
// 1. Tracks all texts' first paints, recording their visual size, paint time.
// 2. Every 1 second after the first text pre-paint, the algorithm starts an
// analysis. In the analysis:
// 2.1 Largest Text Paint finds the text with the largest first visual size,
// reports its first paint time as a candidate result.
//
// For all these candidate results, Telemetry picks the lastly reported
// Largest Text Paint candidate as the final result.
//
// See also:
// https://docs.google.com/document/d/1DRVd4a2VU8-yyWftgOparZF-sf16daf0vfbsHuz2rws/edit#heading=h.lvno2v283uls
class CORE_EXPORT TextPaintTimingDetector final
: public GarbageCollected<TextPaintTimingDetector> {
friend class TextPaintTimingDetectorTest;
public:
explicit TextPaintTimingDetector(LocalFrameView*,
PaintTimingDetector*,
PaintTimingCallbackManager*);
bool ShouldWalkObject(const LayoutBoxModelObject&) const;
void RecordAggregatedText(const LayoutBoxModelObject& aggregator,
const IntRect& aggregated_visual_rect,
const PropertyTreeState&);
void OnPaintFinished();
void LayoutObjectWillBeDestroyed(const LayoutObject&);
void StopRecordingLargestTextPaint();
void ResetCallbackManager(PaintTimingCallbackManager* manager) {
callback_manager_ = manager;
}
inline bool IsRecordingLargestTextPaint() const {
return records_manager_.IsRecordingLargestTextPaint();
}
inline base::WeakPtr<TextRecord> UpdateCandidate() {
return records_manager_.UpdateCandidate();
}
void ReportSwapTime(base::TimeTicks timestamp);
void Trace(Visitor*);
private:
friend class LargestContentfulPaintCalculatorTest;
void RegisterNotifySwapTime(
PaintTimingCallbackManager::LocalThreadCallback callback);
TextRecordsManager records_manager_;
Member<PaintTimingCallbackManager> callback_manager_;
// Make sure that at most one swap promise is ongoing.
bool awaiting_swap_promise_ = false;
bool need_update_timing_at_frame_end_ = false;
Member<const LocalFrameView> frame_view_;
DISALLOW_COPY_AND_ASSIGN(TextPaintTimingDetector);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_TEXT_PAINT_TIMING_DETECTOR_H_
|
{
"content_hash": "84bd17b6f31f92de2cfe996a954974a3",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 110,
"avg_line_length": 35.95964125560538,
"alnum_prop": 0.7353784761192168,
"repo_name": "endlessm/chromium-browser",
"id": "6f48bf95211742b96ae2367bfc2bc5a14b1fa46b",
"size": "8852",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "third_party/blink/renderer/core/paint/text_paint_timing_detector.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": []
}
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="lang:clipboard.copy" content="Copy to clipboard">
<meta name="lang:clipboard.copied" content="Copied to clipboard">
<meta name="lang:search.language" content="en">
<meta name="lang:search.pipeline.stopwords" content="True">
<meta name="lang:search.pipeline.trimmer" content="True">
<meta name="lang:search.result.none" content="No matching documents">
<meta name="lang:search.result.one" content="1 matching document">
<meta name="lang:search.result.other" content="# matching documents">
<meta name="lang:search.tokenizer" content="[\s\-]+">
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin="">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono:400,500,700&display=fallback">
<style>
body,
input {
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif
}
code,
kbd,
pre {
font-family: "Roboto Mono", "Courier New", Courier, monospace
}
</style>
<link rel="stylesheet" href="../_static/stylesheets/application.css"/>
<link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/>
<link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/>
<link rel="stylesheet" href="../_static/fonts/material-icons.css"/>
<meta name="theme-color" content="#3f51b5">
<script src="../_static/javascripts/modernizr.js"></script>
<title>statsmodels.sandbox.regression.gmm.GMM.from_formula — statsmodels</title>
<link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png">
<link rel="manifest" href="../_static/icons/site.webmanifest">
<link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="../_static/icons/browserconfig.xml">
<link rel="stylesheet" href="../_static/stylesheets/examples.css">
<link rel="stylesheet" href="../_static/material.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/language_data.js"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="statsmodels.sandbox.regression.gmm.GMM.gmmobjective" href="statsmodels.sandbox.regression.gmm.GMM.gmmobjective.html" />
<link rel="prev" title="statsmodels.sandbox.regression.gmm.GMM.fititer" href="statsmodels.sandbox.regression.gmm.GMM.fititer.html" />
<script src="../_static/javascripts/version_dropdown.js"></script>
<script>
var json_loc = "../_static/versions.json",
target_loc = "../../",
text = "Versions";
$( document ).ready( add_version_dropdown(json_loc, target_loc, text));
</script>
</head>
<body dir=ltr
data-md-color-primary=indigo data-md-color-accent=blue>
<svg class="md-svg">
<defs data-children-count="0">
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
</defs>
</svg>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#generated/statsmodels.sandbox.regression.gmm.GMM.from_formula" tabindex="1" class="md-skip"> Skip to content </a>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid">
<div class="md-flex navheader">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="../index.html" title="statsmodels"
class="md-header-nav__button md-logo">
<img src="../_static/statsmodels-logo-v2-bw.svg" height="26"
alt="statsmodels logo">
</a>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
</div>
<div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
<span class="md-header-nav__topic">statsmodels 0.11.0</span>
<span class="md-header-nav__topic"> statsmodels.sandbox.regression.gmm.GMM.from_formula </span>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" action="../search.html" method="GET" name="search">
<input type="text" class="md-search__input" name="q" placeholder="Search"
autocapitalize="off" autocomplete="off" spellcheck="false"
data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">

</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="result">
<div class="md-search-result__meta">
Type to start searching
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
<a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
statsmodels
</div>
</a>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container">
<nav class="md-tabs" data-md-component="tabs">
<div class="md-tabs__inner md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li>
<li class="md-tabs__item"><a href="../gmm.html" class="md-tabs__link">Generalized Method of Moments <code class="xref py py-mod docutils literal notranslate"><span class="pre">gmm</span></code></a></li>
<li class="md-tabs__item"><a href="statsmodels.sandbox.regression.gmm.GMM.html" class="md-tabs__link">statsmodels.sandbox.regression.gmm.GMM</a></li>
</ul>
</div>
</nav>
<main class="md-main">
<div class="md-main__inner md-grid" data-md-component="container">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" data-md-level="0">
<label class="md-nav__title md-nav__title--site" for="__drawer">
<a href="../index.html" title="statsmodels" class="md-nav__button md-logo">
<img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48">
</a>
<a href="../index.html"
title="statsmodels">statsmodels 0.11.0</a>
</label>
<div class="md-nav__source">
<a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
statsmodels
</div>
</a>
</div>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../install.html" class="md-nav__link">Installing statsmodels</a>
</li>
<li class="md-nav__item">
<a href="../gettingstarted.html" class="md-nav__link">Getting started</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html" class="md-nav__link">User Guide</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../user-guide.html#background" class="md-nav__link">Background</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../duration.html" class="md-nav__link">Methods for Survival and Duration Analysis</a>
</li>
<li class="md-nav__item">
<a href="../nonparametric.html" class="md-nav__link">Nonparametric Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">nonparametric</span></code></a>
</li>
<li class="md-nav__item">
<a href="../gmm.html" class="md-nav__link">Generalized Method of Moments <code class="xref py py-mod docutils literal notranslate"><span class="pre">gmm</span></code></a>
</li>
<li class="md-nav__item">
<a href="../miscmodels.html" class="md-nav__link">Other Models <code class="xref py py-mod docutils literal notranslate"><span class="pre">miscmodels</span></code></a>
</li>
<li class="md-nav__item">
<a href="../multivariate.html" class="md-nav__link">Multivariate Statistics <code class="xref py py-mod docutils literal notranslate"><span class="pre">multivariate</span></code></a>
</li></ul>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a>
</li></ul>
</li>
<li class="md-nav__item">
<a href="../examples/index.html" class="md-nav__link">Examples</a>
</li>
<li class="md-nav__item">
<a href="../api.html" class="md-nav__link">API Reference</a>
</li>
<li class="md-nav__item">
<a href="../about.html" class="md-nav__link">About statsmodels</a>
</li>
<li class="md-nav__item">
<a href="../dev/index.html" class="md-nav__link">Developer Page</a>
</li>
<li class="md-nav__item">
<a href="../release/index.html" class="md-nav__link">Release Notes</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary">
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.sandbox.regression.gmm.GMM.from_formula.rst.txt">Show Source</a> </li>
<li id="searchbox" class="md-nav__item"></li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset" role="main">
<h1 id="generated-statsmodels-sandbox-regression-gmm-gmm-from-formula--page-root">statsmodels.sandbox.regression.gmm.GMM.from_formula<a class="headerlink" href="#generated-statsmodels-sandbox-regression-gmm-gmm-from-formula--page-root" title="Permalink to this headline">¶</a></h1>
<dl class="method">
<dt id="statsmodels.sandbox.regression.gmm.GMM.from_formula">
<em class="property">classmethod </em><code class="sig-prename descclassname">GMM.</code><code class="sig-name descname">from_formula</code><span class="sig-paren">(</span><em class="sig-param">formula</em>, <em class="sig-param">data</em>, <em class="sig-param">subset=None</em>, <em class="sig-param">drop_cols=None</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#statsmodels.sandbox.regression.gmm.GMM.from_formula" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a Model from a formula and dataframe.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>formula</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><code class="docutils literal notranslate"><span class="pre">str</span></code></a> or <code class="xref py py-obj docutils literal notranslate"><span class="pre">generic</span></code> <code class="xref py py-obj docutils literal notranslate"><span class="pre">Formula</span></code> <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">object</span></code></a></span></dt><dd><p>The formula specifying the model.</p>
</dd>
<dt><strong>data</strong><span class="classifier"><a class="reference external" href="https://docs.scipy.org/doc/numpy/glossary.html#term-array-like" title="(in NumPy v1.17)"><span>array_like</span></a></span></dt><dd><p>The data for the model. See Notes.</p>
</dd>
<dt><strong>subset</strong><span class="classifier"><a class="reference external" href="https://docs.scipy.org/doc/numpy/glossary.html#term-array-like" title="(in NumPy v1.17)"><span>array_like</span></a></span></dt><dd><p>An array-like object of booleans, integers, or index values that
indicate the subset of df to use in the model. Assumes df is a
<cite>pandas.DataFrame</cite>.</p>
</dd>
<dt><strong>drop_cols</strong><span class="classifier"><a class="reference external" href="https://docs.scipy.org/doc/numpy/glossary.html#term-array-like" title="(in NumPy v1.17)"><span>array_like</span></a></span></dt><dd><p>Columns to drop from the design matrix. Cannot be used to
drop terms involving categoricals.</p>
</dd>
<dt><strong>*args</strong></dt><dd><p>Additional positional argument that are passed to the model.</p>
</dd>
<dt><strong>**kwargs</strong></dt><dd><p>These are passed to the model with one exception. The
<code class="docutils literal notranslate"><span class="pre">eval_env</span></code> keyword is passed to patsy. It can be either a
<code class="xref py py-class docutils literal notranslate"><span class="pre">patsy:patsy.EvalEnvironment</span></code> object or an integer
indicating the depth of the namespace to use. For example, the
default <code class="docutils literal notranslate"><span class="pre">eval_env=0</span></code> uses the calling namespace. If you wish
to use a “clean” environment set <code class="docutils literal notranslate"><span class="pre">eval_env=-1</span></code>.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><code class="xref py py-obj docutils literal notranslate"><span class="pre">model</span></code></dt><dd><p>The model instance.</p>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>data must define __getitem__ with the keys in the formula terms
args and kwargs are passed on to the model instantiation. E.g.,
a numpy structured or rec array, a dictionary, or a pandas DataFrame.</p>
</dd></dl>
</article>
</div>
</div>
</main>
</div>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
<a href="statsmodels.sandbox.regression.gmm.GMM.fititer.html" title="Material"
class="md-flex md-footer-nav__link md-footer-nav__link--prev"
rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span
class="md-footer-nav__direction"> Previous </span> statsmodels.sandbox.regression.gmm.GMM.fititer </span>
</div>
</a>
<a href="statsmodels.sandbox.regression.gmm.GMM.gmmobjective.html" title="Admonition"
class="md-flex md-footer-nav__link md-footer-nav__link--next"
rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span
class="md-flex__ellipsis"> <span
class="md-footer-nav__direction"> Next </span> statsmodels.sandbox.regression.gmm.GMM.gmmobjective </span>
</div>
<div class="md-flex__cell md-flex__cell--shrink"><i
class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
© Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
</div>
Last updated on
Jan 22, 2020.
<br/>
Created using
<a href="http://sphinx-doc.org/">Sphinx</a> 2.3.1.
and
<a href="https://github.com/bashtage/sphinx-material/">Material for
Sphinx</a>
</div>
</div>
</div>
</footer>
<script src="../_static/javascripts/application.js"></script>
<script>app.initialize({version: "1.0.4", url: {base: ".."}})</script>
</body>
</html>
|
{
"content_hash": "24e6e571ae4452551276fb941e55b574",
"timestamp": "",
"source": "github",
"line_count": 457,
"max_line_length": 999,
"avg_line_length": 46.47483588621444,
"alnum_prop": 0.6234285983332548,
"repo_name": "statsmodels/statsmodels.github.io",
"id": "ba8b62d877dad459bf9a7b958983acace7dec9d9",
"size": "21247",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "v0.11.0/generated/statsmodels.sandbox.regression.gmm.GMM.from_formula.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": []
}
|
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = _descriptor.FileDescriptor(
name='app_notification_specifics.proto',
package='sync_pb',
serialized_pb='\n app_notification_specifics.proto\x12\x07sync_pb\"\x95\x01\n\x0f\x41ppNotification\x12\x0c\n\x04guid\x18\x01 \x01(\t\x12\x0e\n\x06\x61pp_id\x18\x02 \x01(\t\x12\x1d\n\x15\x63reation_timestamp_ms\x18\x03 \x01(\x03\x12\r\n\x05title\x18\x04 \x01(\t\x12\x11\n\tbody_text\x18\x05 \x01(\t\x12\x10\n\x08link_url\x18\x06 \x01(\t\x12\x11\n\tlink_text\x18\x07 \x01(\tB\x04H\x03`\x01')
_APPNOTIFICATION = _descriptor.Descriptor(
name='AppNotification',
full_name='sync_pb.AppNotification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='guid', full_name='sync_pb.AppNotification.guid', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=unicode("", "utf-8"),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='app_id', full_name='sync_pb.AppNotification.app_id', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=unicode("", "utf-8"),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='creation_timestamp_ms', full_name='sync_pb.AppNotification.creation_timestamp_ms', index=2,
number=3, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='title', full_name='sync_pb.AppNotification.title', index=3,
number=4, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=unicode("", "utf-8"),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='body_text', full_name='sync_pb.AppNotification.body_text', index=4,
number=5, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=unicode("", "utf-8"),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='link_url', full_name='sync_pb.AppNotification.link_url', index=5,
number=6, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=unicode("", "utf-8"),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='link_text', full_name='sync_pb.AppNotification.link_text', index=6,
number=7, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=unicode("", "utf-8"),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=46,
serialized_end=195,
)
DESCRIPTOR.message_types_by_name['AppNotification'] = _APPNOTIFICATION
class AppNotification(_message.Message):
__metaclass__ = _reflection.GeneratedProtocolMessageType
DESCRIPTOR = _APPNOTIFICATION
# @@protoc_insertion_point(class_scope:sync_pb.AppNotification)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), 'H\003`\001')
# @@protoc_insertion_point(module_scope)
|
{
"content_hash": "7e5806218cd9cde9a7bdf734b512e27c",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 392,
"avg_line_length": 40.89795918367347,
"alnum_prop": 0.7000998003992016,
"repo_name": "valurhrafn/chrome-sync-server",
"id": "a64fb11fd1176dfb55328a60820b27a2c1e6735c",
"size": "4111",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "protocol/app_notification_specifics_pb2.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "45773"
},
{
"name": "C++",
"bytes": "3523292"
},
{
"name": "Java",
"bytes": "1337225"
},
{
"name": "Python",
"bytes": "1627843"
},
{
"name": "Shell",
"bytes": "10385"
}
]
}
|
<?php
namespace TDM\UserBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$crawler = $client->request('GET', '/hello/Fabien');
$this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
}
}
|
{
"content_hash": "3691c7c66d5084c61b8304cd45a92da4",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 90,
"avg_line_length": 23.352941176470587,
"alnum_prop": 0.672544080604534,
"repo_name": "Bastienp/testTDM",
"id": "fd42c747436c617449c21090f28f852b5ea88f90",
"size": "397",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/TDM/UserBundle/Tests/Controller/DefaultControllerTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "124363"
},
{
"name": "CoffeeScript",
"bytes": "21725"
},
{
"name": "JavaScript",
"bytes": "1253012"
},
{
"name": "PHP",
"bytes": "3077897"
},
{
"name": "Shell",
"bytes": "14584"
},
{
"name": "XSLT",
"bytes": "30525"
}
]
}
|
namespace NPOI.POIFS.Crypt.Agile
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using NPOI.OpenXmlFormats.Encryption;
using NPOI.POIFS.Crypt;
using NPOI.POIFS.FileSystem;
using NPOI.Util;
public class AgileEncryptor : Encryptor {
private AgileEncryptionInfoBuilder builder;
private byte[] integritySalt;
private byte[] pwHash;
protected internal AgileEncryptor(AgileEncryptionInfoBuilder builder) {
this.builder = builder;
}
public override void ConfirmPassword(String password) {
// see [MS-OFFCRYPTO] - 2.3.3 EncryptionVerifier
Random r = new Random();
int blockSize = builder.GetHeader().BlockSize;
int keySize = builder.GetHeader().KeySize / 8;
int hashSize = builder.GetHeader().HashAlgorithm.hashSize;
byte[] newVerifierSalt = new byte[blockSize]
, newVerifier = new byte[blockSize]
, newKeySalt = new byte[blockSize]
, newKeySpec = new byte[keySize]
, newIntegritySalt = new byte[hashSize];
r.NextBytes(newVerifierSalt); // blocksize
r.NextBytes(newVerifier); // blocksize
r.NextBytes(newKeySalt); // blocksize
r.NextBytes(newKeySpec); // keysize
r.NextBytes(newIntegritySalt); // hashsize
ConfirmPassword(password, newKeySpec, newKeySalt, newVerifierSalt, newVerifier, newIntegritySalt);
}
public override void ConfirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt) {
AgileEncryptionVerifier ver = builder.GetVerifier();
ver.Salt = (/*setter*/verifierSalt);
AgileEncryptionHeader header = builder.GetHeader();
header.KeySalt = (/*setter*/keySalt);
HashAlgorithm hashAlgo = ver.HashAlgorithm;
int blockSize = header.BlockSize;
pwHash = CryptoFunctions.HashPassword(password, hashAlgo, verifierSalt, ver.SpinCount);
/**
* encryptedVerifierHashInput: This attribute MUST be generated by using the following steps:
* 1. Generate a random array of bytes with the number of bytes used specified by the saltSize
* attribute.
* 2. Generate an encryption key as specified in section 2.3.4.11 by using the user-supplied password,
* the binary byte array used to create the saltValue attribute, and a blockKey byte array
* consisting of the following bytes: 0xfe, 0xa7, 0xd2, 0x76, 0x3b, 0x4b, 0x9e, and 0x79.
* 3. Encrypt the random array of bytes generated in step 1 by using the binary form of the saltValue
* attribute as an Initialization vector as specified in section 2.3.4.12. If the array of bytes is not an
* integral multiple of blockSize bytes, pad the array with 0x00 to the next integral multiple of
* blockSize bytes.
* 4. Use base64 to encode the result of step 3.
*/
byte[] encryptedVerifier = AgileDecryptor.hashInput(builder, pwHash, AgileDecryptor.kVerifierInputBlock, verifier, Cipher.ENCRYPT_MODE);
ver.EncryptedVerifier = (/*setter*/encryptedVerifier);
/**
* encryptedVerifierHashValue: This attribute MUST be generated by using the following steps:
* 1. Obtain the hash value of the random array of bytes generated in step 1 of the steps for
* encryptedVerifierHashInput.
* 2. Generate an encryption key as specified in section 2.3.4.11 by using the user-supplied password,
* the binary byte array used to create the saltValue attribute, and a blockKey byte array
* consisting of the following bytes: 0xd7, 0xaa, 0x0f, 0x6d, 0x30, 0x61, 0x34, and 0x4e.
* 3. Encrypt the hash value obtained in step 1 by using the binary form of the saltValue attribute as
* an Initialization vector as specified in section 2.3.4.12. If hashSize is not an integral multiple of
* blockSize bytes, pad the hash value with 0x00 to an integral multiple of blockSize bytes.
* 4. Use base64 to encode the result of step 3.
*/
MessageDigest hashMD = CryptoFunctions.GetMessageDigest(hashAlgo);
byte[] hashedVerifier = hashMD.Digest(verifier);
byte[] encryptedVerifierHash = AgileDecryptor.hashInput(builder, pwHash, AgileDecryptor.kHashedVerifierBlock, hashedVerifier, Cipher.ENCRYPT_MODE);
ver.EncryptedVerifierHash = (/*setter*/encryptedVerifierHash);
/**
* encryptedKeyValue: This attribute MUST be generated by using the following steps:
* 1. Generate a random array of bytes that is the same size as specified by the
* Encryptor.KeyData.keyBits attribute of the parent element.
* 2. Generate an encryption key as specified in section 2.3.4.11, using the user-supplied password,
* the binary byte array used to create the saltValue attribute, and a blockKey byte array
* consisting of the following bytes: 0x14, 0x6e, 0x0b, 0xe7, 0xab, 0xac, 0xd0, and 0xd6.
* 3. Encrypt the random array of bytes generated in step 1 by using the binary form of the saltValue
* attribute as an Initialization vector as specified in section 2.3.4.12. If the array of bytes is not an
* integral multiple of blockSize bytes, pad the array with 0x00 to an integral multiple of
* blockSize bytes.
* 4. Use base64 to encode the result of step 3.
*/
byte[] encryptedKey = AgileDecryptor.hashInput(builder, pwHash, AgileDecryptor.kCryptoKeyBlock, keySpec, Cipher.ENCRYPT_MODE);
ver.EncryptedKey = (/*setter*/encryptedKey);
ISecretKey secretKey = new SecretKeySpec(keySpec, ver.CipherAlgorithm.jceId);
SetSecretKey(secretKey);
/*
* 2.3.4.14 DataIntegrity Generation (Agile Encryption)
*
* The DataIntegrity element Contained within an Encryption element MUST be generated by using
* the following steps:
* 1. Obtain the intermediate key by decrypting the encryptedKeyValue from a KeyEncryptor
* Contained within the KeyEncryptors sequence. Use this key for encryption operations in the
* remaining steps of this section.
* 2. Generate a random array of bytes, known as Salt, of the same length as the value of the
* KeyData.HashSize attribute.
* 3. Encrypt the random array of bytes generated in step 2 by using the binary form of the
* KeyData.saltValue attribute and a blockKey byte array consisting of the following bytes:
* 0x5f, 0xb2, 0xad, 0x01, 0x0c, 0xb9, 0xe1, and 0xf6 used to form an Initialization vector as
* specified in section 2.3.4.12. If the array of bytes is not an integral multiple of blockSize
* bytes, pad the array with 0x00 to the next integral multiple of blockSize bytes.
* 4. Assign the encryptedHmacKey attribute to the base64-encoded form of the result of step 3.
* 5. Generate an HMAC, as specified in [RFC2104], of the encrypted form of the data (message),
* which the DataIntegrity element will verify by using the Salt generated in step 2 as the key.
* Note that the entire EncryptedPackage stream (1), including the StreamSize field, MUST be
* used as the message.
* 6. Encrypt the HMAC as in step 3 by using a blockKey byte array consisting of the following bytes:
* 0xa0, 0x67, 0x7f, 0x02, 0xb2, 0x2c, 0x84, and 0x33.
* 7. Assign the encryptedHmacValue attribute to the base64-encoded form of the result of step 6.
*/
this.integritySalt = integritySalt;
try {
byte[] vec = CryptoFunctions.GenerateIv(hashAlgo, header.KeySalt, AgileDecryptor.kIntegrityKeyBlock, header.BlockSize);
Cipher cipher = CryptoFunctions.GetCipher(secretKey, ver.CipherAlgorithm, ver.ChainingMode, vec, Cipher.ENCRYPT_MODE);
byte[] FilledSalt = CryptoFunctions.GetBlock0(integritySalt, AgileDecryptor.GetNextBlockSize(integritySalt.Length, blockSize));
byte[] encryptedHmacKey = cipher.DoFinal(FilledSalt);
header.SetEncryptedHmacKey(encryptedHmacKey);
cipher = Cipher.GetInstance("RSA");
foreach (AgileEncryptionVerifier.AgileCertificateEntry ace in ver.GetCertificates()) {
cipher.Init(Cipher.ENCRYPT_MODE, ace.x509.GetPublicKey());
ace.encryptedKey = cipher.DoFinal(GetSecretKey().GetEncoded());
CryptoFunctions.Mac x509Hmac = CryptoFunctions.GetMac(hashAlgo);
x509Hmac.Init(GetSecretKey());
ace.certVerifier = x509Hmac.DoFinal(ace.x509.GetEncoded());
}
} catch (Exception e) {
throw new EncryptedDocumentException(e);
}
}
public override OutputStream GetDataStream(DirectoryNode dir)
{
// TODO: Initialize headers
AgileCipherOutputStream countStream = new AgileCipherOutputStream(dir, builder, GetSecretKey(), this);
//return countStream.GetStream();
throw new NotImplementedException("AgileCipherOutputStream should be derived from OutputStream");
}
/**
* Generate an HMAC, as specified in [RFC2104], of the encrypted form of the data (message),
* which the DataIntegrity element will verify by using the Salt generated in step 2 as the key.
* Note that the entire EncryptedPackage stream (1), including the StreamSize field, MUST be
* used as the message.
*
* Encrypt the HMAC as in step 3 by using a blockKey byte array consisting of the following bytes:
* 0xa0, 0x67, 0x7f, 0x02, 0xb2, 0x2c, 0x84, and 0x33.
**/
protected void UpdateIntegrityHMAC(FileInfo tmpFile, int oleStreamSize) {
// as the integrity hmac needs to contain the StreamSize,
// it's not possible to calculate it on-the-fly while buffering
// TODO: add stream size parameter to GetDataStream()
AgileEncryptionVerifier ver = builder.GetVerifier();
HashAlgorithm hashAlgo = ver.HashAlgorithm;
CryptoFunctions.Mac integrityMD = CryptoFunctions.GetMac(hashAlgo);
integrityMD.Init(new SecretKeySpec(integritySalt, hashAlgo.jceHmacId));
byte[] buf = new byte[1024];
LittleEndian.PutLong(buf, 0, oleStreamSize);
integrityMD.Update(buf, 0, LittleEndian.LONG_SIZE);
FileStream fis = tmpFile.Create();
try {
int readBytes;
while ((readBytes = fis.Read(buf, 0, buf.Length)) > 0) {
integrityMD.Update(buf, 0, readBytes);
}
} finally {
fis.Close();
}
byte[] hmacValue = integrityMD.DoFinal();
AgileEncryptionHeader header = builder.GetHeader();
int blockSize = header.BlockSize;
byte[] iv = CryptoFunctions.GenerateIv(header.HashAlgorithm, header.KeySalt, AgileDecryptor.kIntegrityValueBlock, blockSize);
Cipher cipher = CryptoFunctions.GetCipher(GetSecretKey(), header.CipherAlgorithm, header.ChainingMode, iv, Cipher.ENCRYPT_MODE);
byte[] hmacValueFilled = CryptoFunctions.GetBlock0(hmacValue, AgileDecryptor.GetNextBlockSize(hmacValue.Length, blockSize));
byte[] encryptedHmacValue = cipher.DoFinal(hmacValueFilled);
header.SetEncryptedHmacValue(encryptedHmacValue);
}
private CT_KeyEncryptorUri passwordUri = CT_KeyEncryptorUri.httpschemasmicrosoftcomoffice2006keyEncryptorpassword;
private CT_KeyEncryptorUri certificateUri = CT_KeyEncryptorUri.httpschemasmicrosoftcomoffice2006keyEncryptorcertificate;
protected EncryptionDocument CreateEncryptionDocument() {
AgileEncryptionVerifier ver = builder.GetVerifier();
AgileEncryptionHeader header = builder.GetHeader();
EncryptionDocument ed = EncryptionDocument.NewInstance();
CT_Encryption edRoot = ed.AddNewEncryption();
CT_KeyData keyData = edRoot.AddNewKeyData();
CT_KeyEncryptors keyEncList = edRoot.AddNewKeyEncryptors();
CT_KeyEncryptor keyEnc = keyEncList.AddNewKeyEncryptor();
keyEnc.uri = (/*setter*/passwordUri);
CT_PasswordKeyEncryptor keyPass = keyEnc.AddNewEncryptedPasswordKey();
keyPass.spinCount = (uint)ver.SpinCount;
keyData.saltSize = (uint)header.BlockSize;
keyPass.saltSize = (uint)header.BlockSize;
keyData.blockSize = (uint)header.BlockSize;
keyPass.blockSize = (uint)header.BlockSize;
keyData.keyBits = (uint)header.KeySize;
keyPass.keyBits = (uint)header.KeySize;
HashAlgorithm hashAlgo = header.HashAlgorithm;
keyData.hashSize = (uint)hashAlgo.hashSize;
keyPass.hashSize = (uint)hashAlgo.hashSize;
ST_CipherAlgorithm? xmlCipherAlgo = (ST_CipherAlgorithm?)Enum.Parse(typeof(ST_CipherAlgorithm),header.CipherAlgorithm.xmlId);
if (xmlCipherAlgo == null) {
throw new EncryptedDocumentException("CipherAlgorithm " + header.CipherAlgorithm + " not supported.");
}
keyData.cipherAlgorithm = (/*setter*/xmlCipherAlgo.Value);
keyPass.cipherAlgorithm = (/*setter*/xmlCipherAlgo.Value);
switch (header.ChainingMode.jceId) {
case "cbc":
keyData.cipherChaining = (/*setter*/ST_CipherChaining.ChainingModeCBC);
keyPass.cipherChaining = (/*setter*/ST_CipherChaining.ChainingModeCBC);
break;
case "cfb":
keyData.cipherChaining = (/*setter*/ST_CipherChaining.ChainingModeCFB);
keyPass.cipherChaining = (/*setter*/ST_CipherChaining.ChainingModeCFB);
break;
default:
throw new EncryptedDocumentException("ChainingMode " + header.ChainingMode + " not supported.");
}
ST_HashAlgorithm? xmlHashAlgo = (ST_HashAlgorithm?)Enum.Parse(typeof(ST_HashAlgorithm), hashAlgo.ecmaString);
if (xmlHashAlgo == null) {
throw new EncryptedDocumentException("HashAlgorithm " + hashAlgo + " not supported.");
}
keyData.hashAlgorithm = (/*setter*/xmlHashAlgo.Value);
keyPass.hashAlgorithm = (/*setter*/xmlHashAlgo.Value);
keyData.saltValue = (/*setter*/header.KeySalt);
keyPass.saltValue = (/*setter*/ver.Salt);
keyPass.encryptedVerifierHashInput = (/*setter*/ver.EncryptedVerifier);
keyPass.encryptedVerifierHashValue = (/*setter*/ver.EncryptedVerifierHash);
keyPass.encryptedKeyValue = (/*setter*/ver.EncryptedKey);
CT_DataIntegrity hmacData = edRoot.AddNewDataIntegrity();
hmacData.encryptedHmacKey = (/*setter*/header.GetEncryptedHmacKey());
hmacData.encryptedHmacValue = (/*setter*/header.GetEncryptedHmacValue());
foreach (AgileEncryptionVerifier.AgileCertificateEntry ace in ver.GetCertificates()) {
keyEnc = keyEncList.AddNewKeyEncryptor();
keyEnc.uri = (/*setter*/certificateUri);
CT_CertificateKeyEncryptor certData = keyEnc.AddNewEncryptedCertificateKey();
try {
certData.X509Certificate = ace.x509.GetEncoded();
} catch (Exception e) {
throw new EncryptedDocumentException(e);
}
certData.encryptedKeyValue = (/*setter*/ace.encryptedKey);
certData.certVerifier = (/*setter*/ace.certVerifier);
}
return ed;
}
protected void marshallEncryptionDocument(EncryptionDocument ed, LittleEndianByteArrayOutputStream os) {
//XmlOptions xo = new XmlOptions();
//xo.SetCharacterEncoding("UTF-8");
Dictionary<String, String> nsMap = new Dictionary<String, String>();
nsMap.Add(passwordUri.ToString(), "p");
nsMap.Add(certificateUri.ToString(), "c");
//xo.UseDefaultNamespace();
//xo.SaveSuggestedPrefixes(nsMap);
//xo.SaveNamespacesFirst();
//xo.SaveAggressiveNamespaces();
// Setting standalone doesn't work with xmlbeans-2.3 & 2.6
// ed.DocumentProperties().Standalone=(/*setter*/true);
//xo.SaveNoXmlDecl();
MemoryStream bos = new MemoryStream();
try {
byte[] buf = Encoding.UTF8.GetBytes("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n");
bos.Write(buf, 0, buf.Length);
ed.Save(bos);
os.Write(bos.ToArray());
} catch (IOException e) {
throw new EncryptedDocumentException("error marshalling encryption info document", e);
}
}
protected void CreateEncryptionInfoEntry(DirectoryNode dir, FileInfo tmpFile)
{
DataSpaceMapUtils.AddDefaultDataSpace(dir);
EncryptionInfo info = builder.GetInfo();
//EncryptionRecord er = new EncryptionRecord(){
// public void Write(LittleEndianByteArrayOutputStream bos) {
// // EncryptionVersionInfo (4 bytes): A Version structure (section 2.1.4), where
// // Version.vMajor MUST be 0x0004 and Version.vMinor MUST be 0x0004
// bos.Writeshort(info.VersionMajor);
// bos.Writeshort(info.VersionMinor);
// // Reserved (4 bytes): A value that MUST be 0x00000040
// bos.WriteInt(info.EncryptionFlags);
// EncryptionDocument ed = CreateEncryptionDocument();
// marshallEncryptionDocument(ed, bos);
// }
//};
//CreateEncryptionEntry(dir, "EncryptionInfo", er);
}
/**
* 2.3.4.15 Data Encryption (Agile Encryption)
*
* The EncryptedPackage stream (1) MUST be encrypted in 4096-byte segments to facilitate nearly
* random access while allowing CBC modes to be used in the encryption Process.
* The Initialization vector for the encryption process MUST be obtained by using the zero-based
* segment number as a blockKey and the binary form of the KeyData.saltValue as specified in
* section 2.3.4.12. The block number MUST be represented as a 32-bit unsigned integer.
* Data blocks MUST then be encrypted by using the Initialization vector and the intermediate key
* obtained by decrypting the encryptedKeyValue from a KeyEncryptor Contained within the
* KeyEncryptors sequence as specified in section 2.3.4.10. The data block MUST be pAdded to
* the next integral multiple of the KeyData.blockSize value. Any pAdding bytes can be used. Note
* that the StreamSize field of the EncryptedPackage field specifies the number of bytes of
* unencrypted data as specified in section 2.3.4.4.
*/
private class AgileCipherOutputStream : ChunkedCipherOutputStream {
ISecretKey skey;
public AgileCipherOutputStream(DirectoryNode dir, IEncryptionInfoBuilder builder, ISecretKey skey, AgileEncryptor encryptor)
: base(dir, 4096, builder, encryptor)
{
this.builder = builder;
this.skey = skey;
this.encryptor = encryptor;
}
protected override Cipher InitCipherForBlock(Cipher existing, int block, bool lastChunk)
{
return AgileDecryptor.InitCipherForBlock(existing, block, lastChunk, builder, skey, Cipher.ENCRYPT_MODE);
}
protected override void CalculateChecksum(FileInfo fileOut, int oleStreamSize)
{
// integrityHMAC needs to be updated before the encryption document is Created
((AgileEncryptor)encryptor).UpdateIntegrityHMAC(fileOut, oleStreamSize);
}
protected override void CreateEncryptionInfoEntry(DirectoryNode dir, FileInfo tmpFile)
{
((AgileEncryptor)encryptor).CreateEncryptionInfoEntry(dir, tmpFile);
}
}
}
}
|
{
"content_hash": "447a407be3fd8ba41362c05bdf4c4c75",
"timestamp": "",
"source": "github",
"line_count": 384,
"max_line_length": 159,
"avg_line_length": 55.106770833333336,
"alnum_prop": 0.6320589764188838,
"repo_name": "antony-liu/npoi",
"id": "a4166ebc8202311bb93404f12bc6122be7897d9a",
"size": "22095",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ooxml/POIFS/Crypt/Agile/AgileEncryptor.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1190"
},
{
"name": "C#",
"bytes": "24776162"
},
{
"name": "VBA",
"bytes": "816"
}
]
}
|
package org.terasology.rendering.assets.mesh;
import gnu.trove.list.TFloatList;
import gnu.trove.list.TIntList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.assets.ResourceUrn;
import org.terasology.assets.format.AbstractAssetFileFormat;
import org.terasology.assets.format.AssetDataFile;
import org.terasology.assets.module.annotations.RegisterAssetFileFormat;
import org.terasology.rendering.collada.ColladaLoader;
import org.terasology.rendering.collada.ColladaParseException;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.util.List;
/**
* Importer for Collada data exchange model files. Supports mesh data
* <p>
* The development of this loader was greatly influenced by
* http://www.wazim.com/Collada_Tutorial_1.htm
*
* @author mkienenb@gmail.com
*/
@RegisterAssetFileFormat
public class ColladaMeshFormat extends AbstractAssetFileFormat<MeshData> {
private static final Logger logger = LoggerFactory.getLogger(ColladaMeshFormat.class);
public ColladaMeshFormat() {
super("dae");
}
@Override
public MeshData load(ResourceUrn urn, List<AssetDataFile> inputs) throws IOException {
logger.info("Loading mesh for " + urn);
ColladaLoader loader = new ColladaLoader();
try (BufferedInputStream stream = inputs.get(0).openStream()) {
loader.parseMeshData(stream);
} catch (ColladaParseException e) {
throw new IOException("Error loading collada mesh for " + urn, e);
}
MeshData data = new MeshData();
TFloatList colorsMesh = data.getColors();
TFloatList verticesMesh = data.getVertices();
TFloatList texCoord0Mesh = data.getTexCoord0();
TFloatList normalsMesh = data.getNormals();
TIntList indicesMesh = data.getIndices();
// Scale vertices coordinates by unitsPerMeter
for (int i = 0; i < loader.getVertices().size(); i++) {
float originalVertexValue = loader.getVertices().get(i);
float adjustedVertexValue = (float) (originalVertexValue * loader.getUnitsPerMeter());
verticesMesh.add(adjustedVertexValue);
}
colorsMesh.addAll(loader.getColors());
texCoord0Mesh.addAll(loader.getTexCoord0());
normalsMesh.addAll(loader.getNormals());
indicesMesh.addAll(loader.getIndices());
if (data.getVertices() == null) {
throw new IOException("No vertices define");
}
//if (data.getNormals() == null || data.getNormals().size() != data.getVertices().size()) {
// throw new IOException("The number of normals does not match the number of vertices.");
//}
if (((null == data.getColors()) || (0 == data.getColors().size()))
&& ((null == data.getTexCoord0()) || (0 == data.getTexCoord0().size()))) {
throw new IOException("There must be either texture coordinates or vertex colors provided.");
}
if ((null != data.getTexCoord0()) && (0 != data.getTexCoord0().size())) {
if (data.getTexCoord0().size() / 2 != data.getVertices().size() / 3) {
throw new IOException("The number of tex coords (" + data.getTexCoord0().size() / 2
+ ") does not match the number of vertices (" + data.getVertices().size() / 3
+ ").");
}
}
if ((null != data.getColors()) && (0 != data.getColors().size())) {
if (data.getColors().size() / 4 != data.getVertices().size() / 3) {
throw new IOException("The number of vertex colors (" + data.getColors().size() / 4
+ ") does not match the number of vertices (" + data.getVertices().size() / 3
+ ").");
}
}
return data;
}
}
|
{
"content_hash": "182f9ef961602ec363b16c79bdbbd101",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 105,
"avg_line_length": 39.09090909090909,
"alnum_prop": 0.6315245478036176,
"repo_name": "samuto/Terasology",
"id": "66fbeda7f406932aa86c18075987fe2e9ae49fda",
"size": "4466",
"binary": false,
"copies": "8",
"ref": "refs/heads/develop",
"path": "engine/src/main/java/org/terasology/rendering/assets/mesh/ColladaMeshFormat.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "38"
},
{
"name": "GLSL",
"bytes": "109450"
},
{
"name": "Groovy",
"bytes": "1996"
},
{
"name": "Java",
"bytes": "6402121"
},
{
"name": "Protocol Buffer",
"bytes": "9493"
},
{
"name": "Shell",
"bytes": "7873"
}
]
}
|
import argparse
import codecs
import copy
import logging
import sys
import dockercloud
import requests
from dockercloudcli import commands
from dockercloudcli import parsers
from dockercloudcli.exceptions import InternalError
from . import __version__
requests.packages.urllib3.disable_warnings()
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
logging.basicConfig()
dockercloud.user_agent = "dockercloud-cli/%s" % __version__
def initialize_parser():
# Top parser
parser = argparse.ArgumentParser(description="Docker Cloud CLI", prog='docker-cloud')
parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __version__)
parser.add_argument('--debug', action='store_true', help=argparse.SUPPRESS)
subparsers = parser.add_subparsers(title="Docker Cloud CLI commands", dest='cmd')
# Command Parsers
parsers.add_action_parser(subparsers)
parsers.add_container_parser(subparsers)
parsers.add_event_parser(subparsers)
parsers.add_exec_parser(subparsers)
parsers.add_login_parser(subparsers)
parsers.add_node_parser(subparsers)
parsers.add_nodecluster_parser(subparsers)
parsers.add_repository_parser(subparsers)
parsers.add_run_parser(subparsers)
parsers.add_service_parser(subparsers)
parsers.add_stack_parser(subparsers)
parsers.add_tag_parser(subparsers)
parsers.add_trigger_parser(subparsers)
parsers.add_up_parser(subparsers)
return parser
def patch_help_option(argv=sys.argv):
args = copy.copy(argv)
if not args:
raise InternalError("Wrong argument is set, cannot be empty")
debug = False
if len(args) >= 2 and args[1] == '--debug':
debug = True
args.pop(1)
if len(args) == 1:
args.append('-h')
elif len(args) == 2 and args[1] in ['action', 'service', 'container', 'repository', 'exec', 'node',
'nodecluster', 'tag', 'trigger', 'stack', 'push', 'run']:
args.append('-h')
elif len(args) == 3:
if args[1] == 'action' and args[2] in ['inspect', 'logs', 'cancel', 'retry']:
args.append('-h')
elif args[1] == 'service' and args[2] in ['create', 'env', 'inspect', 'logs', 'redeploy', 'run', 'scale', 'set',
'start', 'stop', 'terminate']:
args.append('-h')
elif args[1] == 'container' and args[2] in ['exec', 'inspect', 'logs', 'redeploy', 'start', 'stop',
'terminate']:
args.append('-h')
elif args[1] == 'repository' and args[2] in ['register', 'rm', 'update', 'inspect']:
args.append('-h')
elif args[1] == 'node' and args[2] in ['inspect', 'rm', 'upgrade']:
args.append('-h')
elif args[1] == 'nodecluster' and args[2] in ['create', 'inspect', 'rm', 'scale', 'upgrade']:
args.append('-h')
elif args[1] == 'tag' and args[2] in ['add', 'ls', 'rm', 'set']:
args.append('-h')
elif args[1] == 'trigger' and args[2] in ['create', 'ls', 'rm']:
args.append('-h')
elif args[1] == 'stack' and args[2] in ['inspect', 'redeploy', 'terminate', 'start', 'stop', 'update',
'export']:
args.append('-h')
elif len(args) == 4:
if args[1] == 'service' and args[2] == 'env':
if args[3] in ['add', 'rm', 'set', 'update']:
args.append('-h')
if debug:
args.insert(1, '--debug')
return args[1:]
def dispatch_cmds(args):
if args.debug:
requests_log = logging.getLogger("python-dockercloud")
requests_log.setLevel(logging.DEBUG)
cli_log = logging.getLogger("cli")
cli_log.setLevel(logging.DEBUG)
if args.cmd == 'login':
commands.login()
elif args.cmd == 'action':
if args.subcmd == 'inspect':
commands.action_inspect(args.identifier)
elif args.subcmd == 'ls':
commands.action_ls(args.quiet, args.last)
elif args.subcmd == 'logs':
commands.action_logs(args.identifier, args.tail, args.follow)
elif args.subcmd == 'cancel':
commands.action_cancel(args.identifier)
elif args.subcmd == 'retry':
commands.action_retry(args.identifier)
elif args.cmd == 'event':
commands.event()
elif args.cmd == 'exec':
commands.container_exec(args.identifier, args.command)
elif args.cmd == 'run':
commands.service_run(image=args.image, name=args.name, cpu_shares=args.cpushares,
memory=args.memory, privileged=args.privileged,
target_num_containers=args.target_num_containers, run_command=args.run_command,
entrypoint=args.entrypoint, expose=args.expose, publish=args.publish, envvars=args.env,
envfiles=args.env_file,
tag=args.tag, linked_to_service=args.link_service,
autorestart=args.autorestart, autodestroy=args.autodestroy,
autoredeploy=args.autoredeploy, roles=args.role,
sequential=args.sequential, volume=args.volume, volumes_from=args.volumes_from,
deployment_strategy=args.deployment_strategy, sync=args.sync, net=args.net, pid=args.pid)
elif args.cmd == 'service':
if args.subcmd == 'create':
commands.service_create(image=args.image, name=args.name, cpu_shares=args.cpushares,
memory=args.memory, privileged=args.privileged,
target_num_containers=args.target_num_containers, run_command=args.run_command,
entrypoint=args.entrypoint, expose=args.expose, publish=args.publish,
envvars=args.env, envfiles=args.env_file,
tag=args.tag, linked_to_service=args.link_service,
autorestart=args.autorestart, autodestroy=args.autodestroy,
autoredeploy=args.autoredeploy, roles=args.role,
sequential=args.sequential, volume=args.volume, volumes_from=args.volumes_from,
deployment_strategy=args.deployment_strategy, sync=args.sync, net=args.net,
pid=args.pid)
elif args.subcmd == 'inspect':
commands.service_inspect(args.identifier)
elif args.subcmd == 'logs':
commands.service_logs(args.identifier, args.tail, args.follow)
elif args.subcmd == 'ps':
commands.service_ps(args.quiet, args.status, args.stack)
elif args.subcmd == 'redeploy':
commands.service_redeploy(args.identifier, args.not_reuse_volumes, args.sync)
elif args.subcmd == 'run':
commands.service_run(image=args.image, name=args.name, cpu_shares=args.cpushares,
memory=args.memory, privileged=args.privileged,
target_num_containers=args.target_num_containers, run_command=args.run_command,
entrypoint=args.entrypoint, expose=args.expose, publish=args.publish, envvars=args.env,
envfiles=args.env_file,
tag=args.tag, linked_to_service=args.link_service,
autorestart=args.autorestart, autodestroy=args.autodestroy,
autoredeploy=args.autoredeploy, roles=args.role,
sequential=args.sequential, volume=args.volume, volumes_from=args.volumes_from,
deployment_strategy=args.deployment_strategy, sync=args.sync, net=args.net,
pid=args.pid)
elif args.subcmd == 'scale':
commands.service_scale(args.identifier, args.target_num_containers, args.sync)
elif args.subcmd == 'set':
commands.service_set(args.identifier, image=args.image, cpu_shares=args.cpushares,
memory=args.memory, privileged=args.privileged,
target_num_containers=args.target_num_containers, run_command=args.run_command,
entrypoint=args.entrypoint, expose=args.expose, publish=args.publish, envvars=args.env,
envfiles=args.env_file,
tag=args.tag, linked_to_service=args.link_service,
autorestart=args.autorestart, autodestroy=args.autodestroy,
autoredeploy=args.autoredeploy, roles=args.role,
sequential=args.sequential, redeploy=args.redeploy,
volume=args.volume, volumes_from=args.volumes_from,
deployment_strategy=args.deployment_strategy, sync=args.sync, net=args.net,
pid=args.pid)
elif args.subcmd == 'start':
commands.service_start(args.identifier, args.sync)
elif args.subcmd == 'stop':
commands.service_stop(args.identifier, args.sync)
elif args.subcmd == 'terminate':
commands.service_terminate(args.identifier, args.sync)
elif args.subcmd == 'env':
if args.envsubcmd == 'add':
commands.service_env_add(args.identifier, envvars=args.env, envfiles=args.env_file,
redeploy=args.redeploy, sync=args.sync)
elif args.envsubcmd == 'ls':
commands.service_env_ls(args.identifier, args.quiet, args.user, args.image, args.dockercloud)
elif args.envsubcmd == 'rm':
commands.service_env_rm(args.identifier, names=args.name, redeploy=args.redeploy, sync=args.sync)
elif args.envsubcmd == 'set':
commands.service_env_set(args.identifier, envvars=args.env, envfiles=args.env_file,
redeploy=args.redeploy, sync=args.sync)
elif args.envsubcmd == 'update':
commands.service_env_update(args.identifier, envvars=args.env, envfiles=args.env_file,
redeploy=args.redeploy, sync=args.sync)
elif args.cmd == 'container':
if args.subcmd == 'exec':
commands.container_exec(args.identifier, args.command)
elif args.subcmd == 'inspect':
commands.container_inspect(args.identifier)
elif args.subcmd == 'logs':
commands.container_logs(args.identifier, args.tail, args.follow)
elif args.subcmd == 'redeploy':
commands.container_redeploy(args.identifier, args.not_reuse_volumes, args.sync)
elif args.subcmd == 'ps':
commands.container_ps(args.quiet, args.status, args.service, args.no_trunc)
elif args.subcmd == 'start':
commands.container_start(args.identifier, args.sync)
elif args.subcmd == 'stop':
commands.container_stop(args.identifier, args.sync)
elif args.subcmd == 'terminate':
commands.container_terminate(args.identifier, args.sync)
elif args.cmd == 'repository':
if args.subcmd == 'ls':
commands.repository_ls(args.quiet)
elif args.subcmd == 'register':
commands.repository_register(args.repository_name, args.username, args.password)
elif args.subcmd == 'rm':
commands.repository_rm(args.repository_name)
elif args.subcmd == 'update':
commands.repository_update(args.repository_name, args.username, args.password)
elif args.subcmd == 'inspect':
commands.repository_inspect(args.identifier)
elif args.cmd == 'node':
if args.subcmd == 'inspect':
commands.node_inspect(args.identifier)
elif args.subcmd == 'ls':
commands.node_ls(args.quiet)
elif args.subcmd == 'rm':
commands.node_rm(args.identifier, args.sync)
elif args.subcmd == 'upgrade':
commands.node_upgrade(args.identifier, args.sync)
elif args.subcmd == 'byo':
commands.node_byo()
elif args.cmd == 'nodecluster':
if args.subcmd == 'create':
commands.nodecluster_create(args.target_num_nodes, args.name, args.provider, args.region, args.nodetype,
args.sync, args.disk, args.tag, args.aws_vpc_id, args.aws_vpc_subnet,
args.aws_vpc_security_group, args.aws_iam_instance_profile_name)
elif args.subcmd == 'inspect':
commands.nodecluster_inspect(args.identifier)
elif args.subcmd == 'ls':
commands.nodecluster_ls(args.quiet)
elif args.subcmd == 'provider':
commands.nodecluster_show_providers(args.quiet)
elif args.subcmd == 'region':
commands.nodecluster_show_regions(args.provider)
elif args.subcmd == 'nodetype':
commands.nodecluster_show_types(args.provider, args.region)
elif args.subcmd == 'rm':
commands.nodecluster_rm(args.identifier, args.sync)
elif args.subcmd == 'az':
commands.nodecluster_az(args.quiet)
elif args.subcmd == 'scale':
commands.nodecluster_scale(args.identifier, args.target_num_nodes, args.sync)
elif args.cmd == 'tag':
if args.subcmd == 'add':
commands.tag_add(args.identifier, args.tag)
elif args.subcmd == 'ls':
commands.tag_ls(args.identifier, args.quiet)
elif args.subcmd == 'rm':
commands.tag_rm(args.identifier, args.tag)
elif args.subcmd == 'set':
commands.tag_set(args.identifier, args.tag)
elif args.cmd == 'trigger':
if args.subcmd == 'create':
commands.trigger_create(args.identifier, args.name, args.operation)
elif args.subcmd == 'ls':
commands.trigger_ls(args.identifier, args.quiet)
elif args.subcmd == 'rm':
commands.trigger_rm(args.identifier, args.trigger)
elif args.cmd == 'stack':
if args.subcmd == 'create':
commands.stack_create(args.name, args.file, args.sync)
elif args.subcmd == 'inspect':
commands.stack_inspect(args.identifier)
elif args.subcmd == 'ls':
commands.stack_ls(args.quiet)
elif args.subcmd == 'redeploy':
commands.stack_redeploy(args.identifier, args.not_reuse_volumes, args.sync)
elif args.subcmd == 'start':
commands.stack_start(args.identifier, args.sync)
elif args.subcmd == 'stop':
commands.stack_stop(args.identifier, args.sync)
elif args.subcmd == 'terminate':
commands.stack_terminate(args.identifier, args.sync)
elif args.subcmd == 'up':
commands.stack_up(args.name, args.file, args.sync)
elif args.subcmd == 'update':
commands.stack_update(args.identifier, args.file, args.sync)
elif args.subcmd == 'export':
commands.stack_export(args.identifier, args.file)
elif args.cmd == 'up':
commands.stack_up(args.name, args.file, args.sync)
def main():
parser = initialize_parser()
argv = patch_help_option(sys.argv)
args = parser.parse_args(argv)
dispatch_cmds(args)
if __name__ == '__main__':
main()
|
{
"content_hash": "93382d7c11d9f04c6bb1133178d16930",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 120,
"avg_line_length": 51.540983606557376,
"alnum_prop": 0.5794529262086514,
"repo_name": "docker/dockercloud-cli",
"id": "0ae5ea21086e19e0f36054fcb9c8988b0cbbe302",
"size": "15720",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dockercloudcli/cli.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "1216"
},
{
"name": "Python",
"bytes": "263052"
},
{
"name": "Shell",
"bytes": "213"
}
]
}
|
#if NETFRAMEWORK
using Accessibility;
namespace FlaUI.Core.Patterns
{
public partial interface ILegacyIAccessiblePattern
{
IAccessible GetIAccessible();
}
public abstract partial class LegacyIAccessiblePatternBase<TNativePattern> : ILegacyIAccessiblePattern
where TNativePattern : class
{
public abstract IAccessible GetIAccessible();
}
}
#endif
|
{
"content_hash": "5775a7c6623e3e007cc82c55aaf36ecd",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 106,
"avg_line_length": 23.352941176470587,
"alnum_prop": 0.7329974811083123,
"repo_name": "Roemer/FlaUI",
"id": "d7c006e7501c9e586a6e6d1e302af824c2266487",
"size": "399",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/FlaUI.Core/Patterns/LegacyIAccessiblePattern.Accessibility.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1146152"
},
{
"name": "PowerShell",
"bytes": "7463"
}
]
}
|
class MixObserver < Mongoid::Observer
def after_destroy(mix)
mix.tire.index.remove('mix', mix.id)
end
end
|
{
"content_hash": "b406ffbc34efc30aaec30a595ce87f84",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 38,
"avg_line_length": 22,
"alnum_prop": 0.7363636363636363,
"repo_name": "Medow/mixturefm",
"id": "09b6ae9b8ad65f74035e6f4e146c38e8ab1e2131",
"size": "110",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "app/observers/mix_observer.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "50260"
},
{
"name": "HTML",
"bytes": "57319"
},
{
"name": "JavaScript",
"bytes": "96409"
},
{
"name": "Ruby",
"bytes": "50018"
}
]
}
|
package org.apache.airavata.xbaya.ui.dialogs.graph.system;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import org.apache.airavata.workflow.model.graph.GraphException;
import org.apache.airavata.workflow.model.graph.system.EndDoWhileNode;
import org.apache.airavata.xbaya.XBayaEngine;
import org.apache.airavata.xbaya.ui.XBayaGUI;
import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
import org.apache.airavata.xbaya.ui.widgets.GridPanel;
import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
public class EndDoWhileConfigurationDialog {
private XBayaGUI xbayaGUI;
private EndDoWhileNode node;
private XBayaDialog dialog;
private XBayaTextField nameTextField;
private XBayaTextField idTextField;
private JSpinner numPorts;
/**
* Constructs an InputConfigurationWindow.
*
* @param node
* @param engine
*/
public EndDoWhileConfigurationDialog(EndDoWhileNode node, XBayaGUI xbayaGUI) {
this.xbayaGUI = xbayaGUI;
this.node = node;
initGui();
}
/**
* Shows the dialog.
*/
@SuppressWarnings("boxing")
public void show() {
String name = this.node.getName();
this.nameTextField.setText(name);
this.idTextField.setText(this.node.getID());
int number = this.node.getOutputPorts().size();
this.numPorts.setValue(number);
this.dialog.show();
}
/**
* Hides the dialog.
*/
private void hide() {
this.dialog.hide();
}
private void setInput() {
Integer value = (Integer) this.numPorts.getValue();
int number = value.intValue();
int current = this.node.getOutputPorts().size();
try {
if (number > current) {
// Add ports
for (int i = 0; i < number - current; i++) {
this.node.addOutputPort();
this.node.addInputPort();
}
} else if (number < current) {
for (int i = 0; i < current - number; i++) {
this.node.removeOutputPort();
this.node.removeInputPort();
}
} else {
// Do nothing.
}
} catch (GraphException e) {
this.xbayaGUI.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
e);
}
hide();
this.xbayaGUI.getGraphCanvas().repaint();
}
/**
* Initializes the GUI.
*/
private void initGui() {
this.nameTextField = new XBayaTextField();
this.nameTextField.setEditable(false);
XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
this.idTextField = new XBayaTextField();
this.idTextField.setEditable(false);
XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
SpinnerNumberModel model = new SpinnerNumberModel(1, 1,
Integer.MAX_VALUE, 1);
this.numPorts = new JSpinner(model);
XBayaLabel numPortLabel = new XBayaLabel("Number of Parameters",
this.numPorts);
GridPanel gridPanel = new GridPanel();
gridPanel.add(nameLabel);
gridPanel.add(this.nameTextField);
gridPanel.add(idLabel);
gridPanel.add(this.idTextField);
gridPanel.add(numPortLabel);
gridPanel.add(this.numPorts);
gridPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
JButton okButton = new JButton("OK");
okButton.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
setInput();
}
});
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
hide();
}
});
JPanel buttonPanel = new JPanel();
buttonPanel.add(okButton);
buttonPanel.add(cancelButton);
this.dialog = new XBayaDialog(xbayaGUI, "EndDoWhile Configuration",gridPanel, buttonPanel);
this.dialog.setDefaultButton(okButton);
}
}
|
{
"content_hash": "551d1a3f13470aeae1891bc3b2597774",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 100,
"avg_line_length": 29.908496732026144,
"alnum_prop": 0.6022727272727273,
"repo_name": "machristie/airavata",
"id": "4002fca55c8ee4a15fe4523a8e120b3168b892c0",
"size": "5389",
"binary": false,
"copies": "6",
"ref": "refs/heads/develop",
"path": "modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndDoWhileConfigurationDialog.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5598"
},
{
"name": "C",
"bytes": "55273"
},
{
"name": "C++",
"bytes": "7107801"
},
{
"name": "CSS",
"bytes": "25498"
},
{
"name": "HTML",
"bytes": "75743"
},
{
"name": "Java",
"bytes": "31936020"
},
{
"name": "PHP",
"bytes": "292649"
},
{
"name": "Python",
"bytes": "277768"
},
{
"name": "Shell",
"bytes": "53742"
},
{
"name": "Thrift",
"bytes": "417035"
},
{
"name": "XSLT",
"bytes": "34643"
}
]
}
|
title: "Overview"
description: "Overview documentation for Sensu."
product: "Sensu Core"
version: "1.8"
weight: 20
layout: "base-for-directory-listing"
menu:
sensu-core-1.8:
identifier: overview
---
{{< directoryListing >}}
|
{
"content_hash": "ec20741cbe1da1447b0770797902fc7a",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 48,
"avg_line_length": 19.25,
"alnum_prop": 0.70995670995671,
"repo_name": "sensu/sensu-docs",
"id": "aa85b642e25d106a0879258d0e1aa04c2be57b2a",
"size": "235",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "archived/sensu-core/1.8/overview/_index.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "123020"
},
{
"name": "JavaScript",
"bytes": "61971"
},
{
"name": "Procfile",
"bytes": "14"
},
{
"name": "Python",
"bytes": "3764"
},
{
"name": "Ruby",
"bytes": "4422"
},
{
"name": "SCSS",
"bytes": "32403"
},
{
"name": "Shell",
"bytes": "30924"
}
]
}
|
alias di="docker images" # Get images
alias dl="docker ps -lq" # Get latest container ID
alias dp="docker ps" # Get container process
alias dx="docker exec -it" # Run specific app on running Container
alias dpa="docker ps -a" # Get process included stop container
alias dpq="docker ps -aq" # Get process included stop container, Only display numeric IDs
alias drd="docker run -dP" # Run deamonized container, e.g., $dkd base /bin/echo hello
alias dri="docker run -itP" # Run interactive container, e.g., $dki base /bin/bash
alias dsr='dkill && drm' # Kill and Remove all containers
alias drv="docker run -itP -v /Users:/home" # Run with /Users volume as home
alias dip="docker inspect --format '{{ .NetworkSettings.IPAddress }}'" # Get container IP
alias dclean='docker rmi $(docker images -qf "dangling=true")' # remove dangling images
alias dr-ls="curl -X GET http://localhub:5000/v1/search"
dbl() { docker build -t=$1 .; } # Dockerfile build, e.g., $dbu tcnksm/test
drm() { docker rm $(docker ps -aq); } # Remove all containers
drmi() { docker rmi $(docker ps -aq); } # Remove all images
drme() { docker rmi $(docker images | grep "^<none>" | awk '{ print $3 }') }
dstop() { docker stop $(docker ps -aq); } # Stop all containers
dkill() { docker kill $(docker ps -aq); } # Kill all containers
dalias() { alias | grep 'docker' | sed "s/^\([^=]*\)=\(.*\)/\1 => \2/"| sed "s/['|\']//g" | sort; } # Show all alias related docker
dr-rm() {
echo curl -X DELETE http://localhub:5000/v1/repositories/library/$1/
curl -X DELETE http://localhub:5000/v1/repositories/library/$1/;
}
|
{
"content_hash": "87b6d32f2bb16cff922523de59ed74ce",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 131,
"avg_line_length": 66.48,
"alnum_prop": 0.6462093862815884,
"repo_name": "wharsojo/myboot2docker",
"id": "ab99a28ffc7802a88f8cb6ae9492189d8bfa9bb3",
"size": "1769",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "home/docker/.zprezto/modules/docker/init.zsh",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "D",
"bytes": "637"
},
{
"name": "Makefile",
"bytes": "555"
},
{
"name": "Shell",
"bytes": "125311"
}
]
}
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MasterPageDemo
{
public partial class ContactsBulgaria
{
}
}
|
{
"content_hash": "f2ea6fd534011be4db2db72ace01a126",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 81,
"avg_line_length": 26.11764705882353,
"alnum_prop": 0.42117117117117114,
"repo_name": "EmilMitev/Telerik-Academy",
"id": "654fa23ab9ff0031ecdbca85eee72d6c751bd704",
"size": "446",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "ASP.NET Web Forms/04. Master Pages/Demo/Master-Pages-Demo/ContactsBulgaria.aspx.designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "591386"
},
{
"name": "Batchfile",
"bytes": "122"
},
{
"name": "C#",
"bytes": "5141557"
},
{
"name": "CSS",
"bytes": "1506884"
},
{
"name": "CoffeeScript",
"bytes": "5994"
},
{
"name": "HTML",
"bytes": "1456770"
},
{
"name": "JavaScript",
"bytes": "18718229"
},
{
"name": "Makefile",
"bytes": "2344"
},
{
"name": "PowerShell",
"bytes": "468"
},
{
"name": "SQLPL",
"bytes": "21864"
},
{
"name": "Shell",
"bytes": "140"
},
{
"name": "XSLT",
"bytes": "4359"
}
]
}
|
from neutron.agent.l3 import fip_rule_priority_allocator as frpa
from neutron.tests import base
class TestFipPriority(base.BaseTestCase):
def test__init__(self):
test_pr = frpa.FipPriority(10)
self.assertEqual(10, test_pr.index)
def test__repr__(self):
test_pr = frpa.FipPriority(20)
self.assertEqual("20", str(test_pr))
def test__eq__(self):
left_pr = frpa.FipPriority(10)
right_pr = frpa.FipPriority(10)
other_pr = frpa.FipPriority(20)
self.assertEqual(left_pr, right_pr)
self.assertNotEqual(left_pr, other_pr)
self.assertNotEqual(right_pr, other_pr)
def test__hash__(self):
left_pr = frpa.FipPriority(10)
right_pr = frpa.FipPriority(10)
other_pr = frpa.FipPriority(20)
self.assertEqual(hash(left_pr), hash(right_pr))
self.assertNotEqual(hash(left_pr), hash(other_pr))
self.assertNotEqual(hash(other_pr), hash(right_pr))
class TestFipRulePriorityAllocator(base.BaseTestCase):
def setUp(self):
super(TestFipRulePriorityAllocator, self).setUp()
self.priority_rule_start = 100
self.priority_rule_end = 200
self.data_store_path = '/data_store_path_test'
def test__init__(self):
_frpa = frpa.FipRulePriorityAllocator(self.data_store_path,
self.priority_rule_start,
self.priority_rule_end)
self.assertEqual(self.data_store_path, _frpa.state_file)
self.assertEqual(frpa.FipPriority, _frpa.ItemClass)
self.assertEqual(100, len(_frpa.pool))
|
{
"content_hash": "ed08bc88472e85fbbf9cb95502fa7789",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 71,
"avg_line_length": 37.5,
"alnum_prop": 0.6218181818181818,
"repo_name": "eayunstack/neutron",
"id": "998701702bec9a39df2e0f22944bec42af1a7ad9",
"size": "2284",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "neutron/tests/unit/agent/l3/test_fip_rule_priority_allocator.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Mako",
"bytes": "1047"
},
{
"name": "Python",
"bytes": "10593193"
},
{
"name": "Shell",
"bytes": "8804"
}
]
}
|
using System.IO;
using System.Reflection;
using HtmlAgilityPack;
using Moq;
using NUnit.Framework;
using Nancy;
using Nancy.Testing;
using WelcomePage.Core;
namespace WelcomePage_UnitTests
{
[TestFixture]
public class BootstrapperTests
{
[Test]
public void HomePage()
{
// Arrange
var rootDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var bootstrapper = new Bootstrapper(rootDirectory);
var browser = new Browser(bootstrapper);
// Act
var response = browser.Get("/");
// Assert
Assert.IsNotNull(response);
}
}
[TestFixture]
public class HomeModuleTests
{
[Test]
public void HomePage()
{
// Arrange
var documentFolder = new Mock<IDocumentFolder>();
documentFolder.Setup(x => x.ReadAllText("README")).Returns("Hello\r\n==\r\nWorld");
var browser =
new Browser(
with => with.Module(new HomeModule(documentFolder.Object)));
// Act
var response = browser.Get("/");
// Assert
Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
var html = response.Body.AsHtmlDocument();
var content = html.GetElementbyId("content");
Assert.That(content.InnerHtml, Is.StringContaining("<h1>Hello</h1>"));
Assert.That(content.InnerHtml, Is.StringContaining("<p>World</p>"));
}
[Test]
public void OtherPage()
{
// Arrange
var documentFolder = new Mock<IDocumentFolder>();
documentFolder.Setup(x => x.ReadAllText("README")).Returns("Hello\r\n==\r\nWorld");
var browser =
new Browser(
with => with.Module(new HomeModule(documentFolder.Object)));
// Act
var response = browser.Get("/other-page");
// Assert
Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
var html = response.Body.AsHtmlDocument();
var content = html.GetElementbyId("content");
Assert.That(content.InnerHtml, Is.StringContaining("<h1>Hello</h1>"));
Assert.That(content.InnerHtml, Is.StringContaining("<p>World</p>"));
}
}
internal static class ResponseAsHtml
{
public static HtmlDocument AsHtmlDocument(this BrowserResponseBodyWrapper body)
{
var stream = body.AsStream();
var doc = new HtmlDocument();
doc.Load(stream);
return doc;
}
}
}
|
{
"content_hash": "568181c8ca4aad706e2ad056f2279172",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 96,
"avg_line_length": 30.359550561797754,
"alnum_prop": 0.5658771280532938,
"repo_name": "rlipscombe/vs-welcome-page",
"id": "ace7d628757c692765145cc3a95025e7e3898742",
"size": "2704",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WelcomePage_UnitTests/BootstrapperTests.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "41993"
},
{
"name": "CSS",
"bytes": "4968"
}
]
}
|
import os
import import_dataset
PROJECT_ID = os.environ["AUTOML_PROJECT_ID"]
BUCKET_ID = "{}-lcm".format(PROJECT_ID)
DATASET_ID = "VCN0000000000000000000"
def test_import_dataset(capsys):
# As importing a dataset can take a long time and only four operations can
# be run on a dataset at once. Try to import into a nonexistent dataset and
# confirm that the dataset was not found, but other elements of the request
# were valid.
try:
data = "gs://{}/video-classification/dataset.csv".format(BUCKET_ID)
import_dataset.import_dataset(PROJECT_ID, DATASET_ID, data)
out, _ = capsys.readouterr()
assert (
"The Dataset doesn't exist or is inaccessible for use with AutoMl."
in out
)
except Exception as e:
assert (
"The Dataset doesn't exist or is inaccessible for use with AutoMl."
in e.message
)
|
{
"content_hash": "15e274cba47555e90ac463adbdd28ecc",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 79,
"avg_line_length": 34.22222222222222,
"alnum_prop": 0.6482683982683982,
"repo_name": "GoogleCloudPlatform/python-docs-samples",
"id": "05262094fb1269746eaa2f2f528c29f63a789131",
"size": "1499",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "automl/beta/import_dataset_test.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "8008"
},
{
"name": "Dockerfile",
"bytes": "62031"
},
{
"name": "HTML",
"bytes": "69878"
},
{
"name": "JavaScript",
"bytes": "26494"
},
{
"name": "Jinja",
"bytes": "1892"
},
{
"name": "Jupyter Notebook",
"bytes": "47951698"
},
{
"name": "Makefile",
"bytes": "932"
},
{
"name": "Procfile",
"bytes": "138"
},
{
"name": "PureBasic",
"bytes": "11115"
},
{
"name": "Python",
"bytes": "5323502"
},
{
"name": "Shell",
"bytes": "78261"
}
]
}
|
package com.aware.plugin.automatic_query.querymanagement;
import android.content.Context;
import android.util.Log;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.ConcurrentSkipListSet;
import de.unipassau.mics.contextopheles.base.ContextophelesConstants;
import de.unipassau.mics.contextopheles.utils.CommonSettings;
/**
* Created by wmb on 10.02.14.
*/
public class QueryManager {
private ConcurrentSkipListSet<QueryObject> queryList;
private TermManager whatManager;
private TermManager whereManager;
private Context context;
public QueryManager(Context context) {
this.context = context;
queryList = new ConcurrentSkipListSet<QueryObject>(new QueryObjectImportanceComparator());
Log.d(this.getClass().toString(), "@registering WhatManagerPlugins");
whatManager = new TermManager("WhatManager");
whatManager.registerPlugin(ContextophelesConstants.UI_CONTENT_CONTENT_URI.toString(), ContextophelesConstants.UI_CONTENT_MAX_STORAGE, ContextophelesConstants.UI_CONTENT_WEAROFF_TIME);
whatManager.registerPlugin(ContextophelesConstants.CLIPBOARD_CATCHER_CONTENT_URI.toString(), ContextophelesConstants.CLIPBOARD_CATCHER_MAX_STORAGE, ContextophelesConstants.CLIPBOARD_CATCHER_WEAROFF_TIME);
whatManager.registerPlugin(ContextophelesConstants.OSMPOI_RESOLVER_CONTENT_URI.toString(), ContextophelesConstants.OSMPOI_RESOLVER_MAX_STORAGE, ContextophelesConstants.OSMPOI_RESOLVER_WEAROFF_TIME);
whatManager.registerPlugin(ContextophelesConstants.NOTIFICATION_CATCHER_CONTENT_URI.toString(), ContextophelesConstants.NOTIFICATION_CATCHER_MAX_STORAGE, ContextophelesConstants.NOTIFICATION_CATCHER_WEAROFF_TIME);
whatManager.registerPlugin(ContextophelesConstants.SMS_RECEIVER_CONTENT_URI.toString(), ContextophelesConstants.SMS_RECEIVER_MAX_STORAGE, ContextophelesConstants.SMS_RECEIVER_WEAROFF_TIME);
whatManager.registerPlugin(ContextophelesConstants.GEONAME_RESOLVER_CONTENT_URI.toString(), ContextophelesConstants.GEONAME_RESOLVER_MAX_STORAGE, ContextophelesConstants.GEONAME_RESOLVER_WEAROFF_TIME);
Log.d(this.getClass().toString(), "@registering WhereManagerPlugins");
whereManager = new TermManager("WhereManager");
whereManager.registerPlugin(ContextophelesConstants.TERM_COLLECTOR_GEODATA_CONTENT_URI.toString(), ContextophelesConstants.TERM_COLLECTOR_GEODATA_MAX_STORAGE, ContextophelesConstants.TERM_COLLECTOR_GEODATA_WEAROFF_TIME);
whereManager.registerPlugin(ContextophelesConstants.GEONAME_RESOLVER_CONTENT_URI.toString(), ContextophelesConstants.GEONAME_RESOLVER_MAX_STORAGE, ContextophelesConstants.GEONAME_RESOLVER_WEAROFF_TIME);
whereManager.registerPlugin(ContextophelesConstants.UI_CONTENT_CONTENT_URI.toString(), ContextophelesConstants.UI_CONTENT_MAX_STORAGE, ContextophelesConstants.UI_CONTENT_WEAROFF_TIME);
whereManager.registerPlugin(ContextophelesConstants.CLIPBOARD_CATCHER_CONTENT_URI.toString(), ContextophelesConstants.CLIPBOARD_CATCHER_MAX_STORAGE, ContextophelesConstants.CLIPBOARD_CATCHER_WEAROFF_TIME);
whereManager.registerPlugin(ContextophelesConstants.OSMPOI_RESOLVER_CONTENT_URI.toString(), ContextophelesConstants.OSMPOI_RESOLVER_MAX_STORAGE, ContextophelesConstants.OSMPOI_RESOLVER_WEAROFF_TIME);
whereManager.registerPlugin(ContextophelesConstants.NOTIFICATION_CATCHER_CONTENT_URI.toString(), ContextophelesConstants.NOTIFICATION_CATCHER_MAX_STORAGE, ContextophelesConstants.NOTIFICATION_CATCHER_WEAROFF_TIME);
whereManager.registerPlugin(ContextophelesConstants.SMS_RECEIVER_CONTENT_URI.toString(), ContextophelesConstants.SMS_RECEIVER_MAX_STORAGE, ContextophelesConstants.SMS_RECEIVER_WEAROFF_TIME);
whereManager.registerPlugin(ContextophelesConstants.GEONAME_RESOLVER_CONTENT_URI.toString(), ContextophelesConstants.GEONAME_RESOLVER_MAX_STORAGE, ContextophelesConstants.GEONAME_RESOLVER_WEAROFF_TIME);
}
public void addWhatObject(WhatObject toAdd) {
Log.d(this.getClass().toString(), "@addWhatObject: " + toAdd.getValue());
whatManager.add(toAdd);
createQuerysFromList(toAdd, whereManager.getTermObjects());
}
public void addWhereObject(WhereObject toAdd) {
Log.d(this.getClass().toString(), "@addWhereObject: " + toAdd.getValue());
whereManager.add(toAdd);
createQuerysFromList(toAdd, whatManager.getTermObjects());
}
private void cleanUp() {
Log.d(this.getClass().toString(), "@cleanUp");
cleanupQueryList();
whatManager.cleanUp();
whereManager.cleanUp();
}
private void cleanupQueryList() {
Long time = System.currentTimeMillis();
int wearOffTime = CommonSettings.getQueryListWearOffTime(context.getContentResolver());
// this collects the objects to remove
List<QueryObject> objectsToRemove = new ArrayList<QueryObject>();
// get all objects which are outdated
for (QueryObject queryObject : queryList) {
if (time - queryObject.getTimestamp() > wearOffTime) {
objectsToRemove.add(queryObject);
}
}
Log.d(this.getClass().toString(), "Removing Objects: " + objectsToRemove);
// remove them
for (QueryObject objectToRemove : objectsToRemove) {
queryList.remove(objectToRemove);
}
}
public QueryObject getNextQueryObject() {
Log.d(this.getClass().toString(), "@getNextQueryObject");
cleanUp();
Log.d(this.getClass().toString(), "QueryObjects:" + queryList);
Log.d(this.getClass().toString(), whatManager.toString());
Log.d(this.getClass().toString(), whereManager.toString());
if (!queryList.isEmpty()) {
// get and remove highest Object
QueryObject result = queryList.pollFirst();
return result;
} else {
return null;
}
}
// Assumes to get a WhereObject and a List of WhatObjects OR the other way round!
private void createQuerysFromList(TermObject singleObject, List<TermObject> objectList) {
if (singleObject.getClass().toString().equals(WhatObject.class.toString())) {
queryList.add(new QueryObject((WhatObject) singleObject, new WhereObject(0, "", "")));
for (TermObject whereObject : objectList) {
queryList.add(new QueryObject((WhatObject) singleObject, (WhereObject) whereObject));
}
} else {
queryList.add(new QueryObject(new WhatObject(0, "", ""), (WhereObject) singleObject));
for (TermObject whatObject : objectList) {
queryList.add(new QueryObject((WhatObject) whatObject, (WhereObject) singleObject));
}
}
}
private static class QueryObjectImportanceComparator implements Comparator<QueryObject> {
public int compare(QueryObject qo1, QueryObject qo2) {
double imp1 = qo1.getImportance();
double imp2 = qo2.getImportance();
if (imp1 > imp2) return -1;
if (imp1 < imp2) return 1;
return 0;
}
}
}
|
{
"content_hash": "bf6c61be71201ec56f47027a558042bf",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 228,
"avg_line_length": 55,
"alnum_prop": 0.7300485773768216,
"repo_name": "EEXCESS/android-app",
"id": "f44bc0f882bb50218b091d7338fa9cd9573a0f57",
"size": "7205",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Plugins/AutomaticQuery/src/com/aware/plugin/automatic_query/querymanagement/QueryManager.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1391"
},
{
"name": "Java",
"bytes": "1247025"
},
{
"name": "Shell",
"bytes": "1253"
}
]
}
|
ACCEPTED
#### According to
Index Fungorum
#### Published in
Acta Mycol. Sin. 4(3): 145 (1985)
#### Original name
Uncinula liquidambaris R.Y. Zheng & G.Q. Chen
### Remarks
null
|
{
"content_hash": "7e0b2340d5eaf0d0fa4ada0daa85795f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 45,
"avg_line_length": 13.76923076923077,
"alnum_prop": 0.6759776536312849,
"repo_name": "mdoering/backbone",
"id": "7590c6abe627d7ef4b409be43c1e6bcb003aa23f",
"size": "276",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Leotiomycetes/Erysiphales/Erysiphaceae/Uncinuliella/Uncinuliella liquidambaris/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": []
}
|
package org.hypothesis.servlet.jnlp;
import java.io.*;
import java.util.*;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarOutputStream;
/**
* JarDiff is able to create a jar file containing the delta between two jar
* files (old and new). The delta jar file can then be applied to the old jar
* file to reconstruct the new jar file.
* <p>
* Refer to the JNLP spec for details on how this is done.
*
* @version 1.13, 06/26/03
*/
public final class JarDiff implements JarDiffConstants {
/**
* JarFile2 wraps a JarFile providing some convenience methods.
*/
private static class JarFile2 {
/**
* Returns true if the two InputStreams differ.
*/
private static boolean differs(InputStream oldIS, InputStream newIS) throws IOException {
int newSize = 0;
int oldSize;
// int total = 0;
boolean retVal = false;
try {
while (newSize != -1) {
newSize = newIS.read(newBytes);
oldSize = oldIS.read(oldBytes);
if (newSize != oldSize) {
retVal = true;
break;
}
if (newSize > 0) {
while (--newSize >= 0) {
// total++;
if (newBytes[newSize] != oldBytes[newSize]) {
retVal = true;
break;
}
if (retVal) {
// Jump out
break;
}
newSize = 0;
}
}
}
} catch (IOException ioE) {
throw ioE;
} finally {
try {
oldIS.close();
} catch (IOException e) {
// Ignore
}
try {
newIS.close();
} catch (IOException e) {
// Ignore
}
}
return retVal;
}
private JarFile _jar;
private List<JarEntry> _entries;
private Map<String, JarEntry> _nameToEntryMap;
private Map<Long, LinkedList<JarEntry>> _crcToEntryMap;
public JarFile2(String path) throws IOException {
_jar = new JarFile(new File(path));
index();
}
public boolean contains(JarFile2 f, JarEntry e) throws IOException {
JarEntry thisEntry = getEntryByName(e.getName());
// Look up name in 'this' Jar2File - if not exist return false
if (thisEntry == null)
return false;
// Check CRC - if no match - return false
if (thisEntry.getCrc() != e.getCrc())
return false;
// Check contents - if no match - return false
InputStream oldIS = getJarFile().getInputStream(thisEntry);
InputStream newIS = f.getJarFile().getInputStream(e);
boolean retValue = differs(oldIS, newIS);
return !retValue;
}
public String getBestMatch(JarFile2 file, JarEntry entry) throws IOException {
// check for same name and same content, return name if found
if (contains(file, entry)) {
return (entry.getName());
}
// return name of same content file or null
return (hasSameContent(file, entry));
}
public JarEntry getEntryByName(String name) {
return _nameToEntryMap.get(name);
}
public Iterator<JarEntry> getJarEntries() {
return _entries.iterator();
}
public JarFile getJarFile() {
return _jar;
}
public String hasSameContent(JarFile2 file, JarEntry entry) throws IOException {
String thisName = null;
Long crcL = new Long(entry.getCrc());
// check if this jar contains files with the passed in entry's crc
if (_crcToEntryMap.containsKey(crcL)) {
// get the Linked List with files with the crc
List<JarEntry> ll = _crcToEntryMap.get(crcL);
// go through the list and check for content match
ListIterator<JarEntry> li = ll.listIterator(0);
if (li != null) {
while (li.hasNext()) {
JarEntry thisEntry = li.next();
// check for content match
InputStream oldIS = getJarFile().getInputStream(thisEntry);
InputStream newIS = file.getJarFile().getInputStream(entry);
if (!differs(oldIS, newIS)) {
thisName = thisEntry.getName();
return thisName;
}
}
}
}
return thisName;
}
private void index() throws IOException {
Enumeration<JarEntry> entries = _jar.entries();
_nameToEntryMap = new HashMap<>();
_crcToEntryMap = new HashMap<>();
_entries = new ArrayList<>();
if (entries != null) {
while (entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
long crc = entry.getCrc();
Long crcL = new Long(crc);
_nameToEntryMap.put(entry.getName(), entry);
_entries.add(entry);
// generate the CRC to entries map
if (_crcToEntryMap.containsKey(crcL)) {
// key exist, add the entry to the correcponding
// linked list
// get the linked list
LinkedList<JarEntry> ll = _crcToEntryMap.get(crcL);
// put in the new entry
ll.add(entry);
// put it back in the hash map
_crcToEntryMap.put(crcL, ll);
} else {
// create a new entry in the hashmap for the new key
// first create the linked list and put in the new
// entry
LinkedList<JarEntry> ll = new LinkedList<>();
ll.add(entry);
// create the new entry in the hashmap
_crcToEntryMap.put(crcL, ll);
}
}
}
}
}
private static final int DEFAULT_READ_SIZE = 2048;
private static final byte[] newBytes = new byte[DEFAULT_READ_SIZE];
/*
* public static ResourceBundle getResources() { if (_resources == null) {
* _resources = ResourceBundle
* .getBundle("jnlp/sample/jardiff/resources/strings"); } return _resources;
* }
*/
private static final byte[] oldBytes = new byte[DEFAULT_READ_SIZE];
// private static ResourceBundle _resources = null;
private JarDiff() {
}
/**
* Writes the index file out to <code>jos</code>. <code>oldEntries</code>
* gives the names of the files that were removed, <code>movedMap</code>
* maps from the new name to the old name.
*/
private static void createIndex(JarOutputStream jos, List<String> oldEntries, Map<String, String> movedMap)
throws IOException {
StringWriter writer = new StringWriter();
writer.write(VERSION_HEADER);
writer.write("\r\n");
// Write out entries that have been removed
for (int counter = 0; counter < oldEntries.size(); counter++) {
String name = oldEntries.get(counter);
writer.write(REMOVE_COMMAND);
writer.write(" ");
writeEscapedString(writer, name);
writer.write("\r\n");
}
// And those that have moved
Iterator<String> names = movedMap.keySet().iterator();
if (names != null) {
while (names.hasNext()) {
String newName = names.next();
String oldName = movedMap.get(newName);
writer.write(MOVE_COMMAND);
writer.write(" ");
writeEscapedString(writer, oldName);
writer.write(" ");
writeEscapedString(writer, newName);
writer.write("\r\n");
}
}
JarEntry je = new JarEntry(INDEX_NAME);
byte[] bytes = writer.toString().getBytes("UTF-8");
writer.close();
jos.putNextEntry(je);
jos.write(bytes, 0, bytes.length);
}
/**
* Creates a patch from the two passed in files, writing the result to
* <code>os</code>.
*/
public static void createPatch(String oldPath, String newPath, OutputStream os, boolean minimal)
throws IOException {
JarFile2 oldJar = new JarFile2(oldPath);
JarFile2 newJar = new JarFile2(newPath);
try {
Iterator<JarEntry> jarEntries;
Iterator<String> nameEntries;
Map<String, String> moved = new HashMap<>();
// HashSet<String> visited = new HashSet<>();
Set<String> implicit = new HashSet<>();
Set<String> moveSrc = new HashSet<>();
Set<String> newEntries = new HashSet<>();
// FIRST PASS
// Go through the entries in new jar and
// determine which files are candidates for implicit moves
// ( files that has the same filename and same content in old.jar
// and new.jar )
// and for files that cannot be implicitly moved, we will either
// find out whether it is moved or new (modified)
jarEntries = newJar.getJarEntries();
if (jarEntries != null) {
while (jarEntries.hasNext()) {
JarEntry newEntry = jarEntries.next();
String newname = newEntry.getName();
// Return best match of contents, will return a name match
// if possible
String oldname = oldJar.getBestMatch(newJar, newEntry);
if (oldname == null) {
// New or modified entry
newEntries.add(newname);
} else {
// Content already exist - need to do a move
// Should do implicit move? Yes, if names are the same,
// and
// no move command already exist from oldJar
if (oldname.equals(newname) && !moveSrc.contains(oldname)) {
implicit.add(newname);
} else {
// The 1.0.1/1.0 JarDiffPatcher cannot handle
// multiple MOVE command with same src.
// The work around here is if we are going to
// generate
// a MOVE command with duplicate src, we will
// instead add the target as a new file. This way
// the jardiff can be applied by 1.0.1/1.0
// JarDiffPatcher also.
if (!minimal && (implicit.contains(oldname) || moveSrc.contains(oldname))) {
// generate non-minimal jardiff
// for backward compatibility
newEntries.add(newname);
} else {
// Use newname as key, since they are unique
moved.put(newname, oldname);
moveSrc.add(oldname);
}
// Check if this disables an implicit 'move
// <oldname> <oldname>'
if (implicit.contains(oldname) && minimal) {
implicit.remove(oldname);
moved.put(oldname, oldname);
moveSrc.add(oldname);
}
}
}
}
} // if (entries != null)
// SECOND PASS: <deleted files> = <oldjarnames> - <implicitmoves> -
// <source of move commands> - <new or modified entries>
List<String> deleted = new ArrayList<>();
jarEntries = oldJar.getJarEntries();
if (jarEntries != null) {
while (jarEntries.hasNext()) {
JarEntry oldEntry = jarEntries.next();
String oldName = oldEntry.getName();
if (!implicit.contains(oldName) && !moveSrc.contains(oldName) && !newEntries.contains(oldName)) {
deleted.add(oldName);
}
}
}
// DEBUG
JarOutputStream jos = new JarOutputStream(os);
// Write out all the MOVEs and REMOVEs
createIndex(jos, deleted, moved);
// Put in New and Modified entries
nameEntries = newEntries.iterator();
if (nameEntries != null) {
while (nameEntries.hasNext()) {
String newName = nameEntries.next();
writeEntry(jos, newJar.getEntryByName(newName), newJar);
}
}
jos.finish();
jos.close();
} catch (IOException ioE) {
throw ioE;
} finally {
try {
oldJar.getJarFile().close();
} catch (IOException e1) {
// ignore
}
try {
newJar.getJarFile().close();
} catch (IOException e1) {
// ignore
}
} // finally
}
// -creatediff -applydiff -debug -output file
public static void main(String[] args) throws IOException {
boolean diff = true;
boolean minimal = true;
String outputFile = "out.jardiff";
for (int counter = 0; counter < args.length; counter++) {
// for backward compatibilty with 1.0.1/1.0
if (args[counter].equals("-nonminimal") || args[counter].equals("-n")) {
minimal = false;
} else if (args[counter].equals("-creatediff") || args[counter].equals("-c")) {
diff = true;
} else if (args[counter].equals("-applydiff") || args[counter].equals("-a")) {
diff = false;
/*
* } else if (args[counter].equals("-debug") ||
* args[counter].equals("-d")) { _debug = true;
*/
} else if (args[counter].equals("-output") || args[counter].equals("-o")) {
if (++counter < args.length) {
outputFile = args[counter];
}
} else if (args[counter].equals("-applydiff") || args[counter].equals("-a")) {
diff = false;
} else {
if ((counter + 2) != args.length) {
showHelp();
System.exit(0);
}
if (diff) {
try {
OutputStream os = new FileOutputStream(outputFile);
JarDiff.createPatch(args[counter], args[counter + 1], os, minimal);
os.close();
} catch (IOException ioe) {
try {
System.out.println(/* getResources().getString( */"jardiff.error.create"/* ) */
+ " " + ioe);
} catch (MissingResourceException mre) {
}
}
} else {
try {
OutputStream os = new FileOutputStream(outputFile);
new JarDiffPatcher().applyPatch(null, args[counter], args[counter + 1], os);
os.close();
} catch (IOException ioe) {
try {
System.out.println(/* getResources().getString( */"jardiff.error.apply"/* ) */
+ " " + ioe);
} catch (MissingResourceException mre) {
}
}
}
System.exit(0);
}
}
showHelp();
}
private static void showHelp() {
System.out.println(
"JarDiff: [-nonminimal (for backward compatibility with 1.0.1/1.0] [-creatediff | -applydiff] [-output file] old.jar new.jar");
}
private static void writeEntry(JarOutputStream jos, JarEntry entry, InputStream data) throws IOException {
jos.putNextEntry(entry);
try {
// Read the entry
int size = data.read(newBytes);
while (size != -1) {
jos.write(newBytes, 0, size);
size = data.read(newBytes);
}
} catch (IOException ioE) {
throw ioE;
} finally {
try {
data.close();
} catch (IOException e) {
// Ignore
}
}
}
private static void writeEntry(JarOutputStream jos, JarEntry entry, JarFile2 file) throws IOException {
writeEntry(jos, entry, file.getJarFile().getInputStream(entry));
}
private static void writeEscapedString(Writer writer, String string) throws IOException {
int index = 0;
int last = 0;
char[] chars = null;
while ((index = string.indexOf(' ', index)) != -1) {
if (last != index) {
if (chars == null) {
chars = string.toCharArray();
}
writer.write(chars, last, index - last);
}
last = index;
index++;
writer.write('\\');
}
if (last != 0) {
writer.write(chars, last, chars.length - last);
} else {
// no spaces
writer.write(string);
}
}
}
|
{
"content_hash": "23ef538c00b0cdf8eb2f615b98354c88",
"timestamp": "",
"source": "github",
"line_count": 513,
"max_line_length": 131,
"avg_line_length": 27.212475633528264,
"alnum_prop": 0.6270057306590258,
"repo_name": "tilioteo/hypothesis",
"id": "0d59627faedf809d112a4954143942e492c3583e",
"size": "15778",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/server/src/main/java/org/hypothesis/servlet/jnlp/JarDiff.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "5353"
},
{
"name": "HTML",
"bytes": "455"
},
{
"name": "Java",
"bytes": "994093"
}
]
}
|
=========================================
VistA Patches: GEN. MED. REC. - GENERATOR
=========================================
This directory contains patch host files for a VistA package.
The files are organized into subdirectories named for each patch.
See `<../README.rst>`__ for package details.
|
{
"content_hash": "d7c99f04857784b131fc996ec23b6182",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 65,
"avg_line_length": 37.625,
"alnum_prop": 0.5481727574750831,
"repo_name": "luisibanez/vista-debian-med-package",
"id": "a31264886b811c2e063f9cf9d9fd751678340e3f",
"size": "301",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "Packages/General Medical Record - Generator/Patches/README.rst",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "9885"
},
{
"name": "JavaScript",
"bytes": "5277"
},
{
"name": "M",
"bytes": "6982"
},
{
"name": "Python",
"bytes": "1021549"
},
{
"name": "Ruby",
"bytes": "5667"
},
{
"name": "Shell",
"bytes": "45819"
}
]
}
|
class Gws::Circular::TrashPurgeJob < Gws::ApplicationJob
include Gws::TrashPurge::BaseJob
self.model = Gws::Circular::Post
end
|
{
"content_hash": "1ced4349712d74c3d5f1b275749ef676",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 56,
"avg_line_length": 26.4,
"alnum_prop": 0.7575757575757576,
"repo_name": "shirasagi/shirasagi",
"id": "44c8161128853e19f6bb4d32f03ddc1418fb353f",
"size": "132",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "app/jobs/gws/circular/trash_purge_job.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "82226"
},
{
"name": "HTML",
"bytes": "3237226"
},
{
"name": "JavaScript",
"bytes": "11966681"
},
{
"name": "Ruby",
"bytes": "12375064"
},
{
"name": "SCSS",
"bytes": "526557"
},
{
"name": "Shell",
"bytes": "20130"
}
]
}
|
void f() {
auto int a; // expected-warning {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
int auto b; // expected-error{{cannot combine with previous 'int' declaration specifier}}
}
typedef auto PR25449(); // expected-error {{'auto' not allowed in typedef}}
|
{
"content_hash": "ca3babc6fddc1818a17b9b866ceeceef",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 140,
"avg_line_length": 53.833333333333336,
"alnum_prop": 0.718266253869969,
"repo_name": "ensemblr/llvm-project-boilerplate",
"id": "f3daf1a19f3cafb43d58cec892a15ffdec7befdd",
"size": "433",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "include/llvm/tools/clang/test/SemaCXX/auto-cxx0x.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "32"
},
{
"name": "AppleScript",
"bytes": "1429"
},
{
"name": "Assembly",
"bytes": "15649629"
},
{
"name": "Awk",
"bytes": "1747037"
},
{
"name": "Batchfile",
"bytes": "34481"
},
{
"name": "Brainfuck",
"bytes": "284"
},
{
"name": "C",
"bytes": "85584624"
},
{
"name": "C#",
"bytes": "20737"
},
{
"name": "C++",
"bytes": "168418524"
},
{
"name": "CMake",
"bytes": "1174816"
},
{
"name": "CSS",
"bytes": "49900"
},
{
"name": "Cuda",
"bytes": "414703"
},
{
"name": "Emacs Lisp",
"bytes": "110018"
},
{
"name": "Forth",
"bytes": "1490"
},
{
"name": "Fortran",
"bytes": "356707"
},
{
"name": "GAP",
"bytes": "6167"
},
{
"name": "Go",
"bytes": "132137"
},
{
"name": "HTML",
"bytes": "1751124"
},
{
"name": "JavaScript",
"bytes": "141512"
},
{
"name": "LLVM",
"bytes": "62219250"
},
{
"name": "Limbo",
"bytes": "7437"
},
{
"name": "Logos",
"bytes": "1572537943"
},
{
"name": "Lua",
"bytes": "86606"
},
{
"name": "M",
"bytes": "2008"
},
{
"name": "M4",
"bytes": "109560"
},
{
"name": "Makefile",
"bytes": "616437"
},
{
"name": "Mathematica",
"bytes": "7845"
},
{
"name": "Matlab",
"bytes": "53817"
},
{
"name": "Mercury",
"bytes": "1194"
},
{
"name": "Mirah",
"bytes": "1079943"
},
{
"name": "OCaml",
"bytes": "407143"
},
{
"name": "Objective-C",
"bytes": "5910944"
},
{
"name": "Objective-C++",
"bytes": "1720450"
},
{
"name": "OpenEdge ABL",
"bytes": "690534"
},
{
"name": "PHP",
"bytes": "15986"
},
{
"name": "POV-Ray SDL",
"bytes": "19471"
},
{
"name": "Perl",
"bytes": "591927"
},
{
"name": "PostScript",
"bytes": "845774"
},
{
"name": "Protocol Buffer",
"bytes": "20013"
},
{
"name": "Python",
"bytes": "1895427"
},
{
"name": "QMake",
"bytes": "15580"
},
{
"name": "RenderScript",
"bytes": "741"
},
{
"name": "Roff",
"bytes": "94555"
},
{
"name": "Rust",
"bytes": "200"
},
{
"name": "Scheme",
"bytes": "2654"
},
{
"name": "Shell",
"bytes": "1144090"
},
{
"name": "Smalltalk",
"bytes": "144607"
},
{
"name": "SourcePawn",
"bytes": "1544"
},
{
"name": "Standard ML",
"bytes": "2841"
},
{
"name": "Tcl",
"bytes": "8285"
},
{
"name": "TeX",
"bytes": "320484"
},
{
"name": "Vim script",
"bytes": "17239"
},
{
"name": "Yacc",
"bytes": "163484"
}
]
}
|
package com.amazonaws.services.glue.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
* <p>
* A column in a <code>Table</code>.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/Column" target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Column implements Serializable, Cloneable, StructuredPojo {
/**
* <p>
* The name of the <code>Column</code>.
* </p>
*/
private String name;
/**
* <p>
* The data type of the <code>Column</code>.
* </p>
*/
private String type;
/**
* <p>
* A free-form text comment.
* </p>
*/
private String comment;
/**
* <p>
* These key-value pairs define properties associated with the column.
* </p>
*/
private java.util.Map<String, String> parameters;
/**
* <p>
* The name of the <code>Column</code>.
* </p>
*
* @param name
* The name of the <code>Column</code>.
*/
public void setName(String name) {
this.name = name;
}
/**
* <p>
* The name of the <code>Column</code>.
* </p>
*
* @return The name of the <code>Column</code>.
*/
public String getName() {
return this.name;
}
/**
* <p>
* The name of the <code>Column</code>.
* </p>
*
* @param name
* The name of the <code>Column</code>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Column withName(String name) {
setName(name);
return this;
}
/**
* <p>
* The data type of the <code>Column</code>.
* </p>
*
* @param type
* The data type of the <code>Column</code>.
*/
public void setType(String type) {
this.type = type;
}
/**
* <p>
* The data type of the <code>Column</code>.
* </p>
*
* @return The data type of the <code>Column</code>.
*/
public String getType() {
return this.type;
}
/**
* <p>
* The data type of the <code>Column</code>.
* </p>
*
* @param type
* The data type of the <code>Column</code>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Column withType(String type) {
setType(type);
return this;
}
/**
* <p>
* A free-form text comment.
* </p>
*
* @param comment
* A free-form text comment.
*/
public void setComment(String comment) {
this.comment = comment;
}
/**
* <p>
* A free-form text comment.
* </p>
*
* @return A free-form text comment.
*/
public String getComment() {
return this.comment;
}
/**
* <p>
* A free-form text comment.
* </p>
*
* @param comment
* A free-form text comment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Column withComment(String comment) {
setComment(comment);
return this;
}
/**
* <p>
* These key-value pairs define properties associated with the column.
* </p>
*
* @return These key-value pairs define properties associated with the column.
*/
public java.util.Map<String, String> getParameters() {
return parameters;
}
/**
* <p>
* These key-value pairs define properties associated with the column.
* </p>
*
* @param parameters
* These key-value pairs define properties associated with the column.
*/
public void setParameters(java.util.Map<String, String> parameters) {
this.parameters = parameters;
}
/**
* <p>
* These key-value pairs define properties associated with the column.
* </p>
*
* @param parameters
* These key-value pairs define properties associated with the column.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Column withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
}
public Column addParametersEntry(String key, String value) {
if (null == this.parameters) {
this.parameters = new java.util.HashMap<String, String>();
}
if (this.parameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.parameters.put(key, value);
return this;
}
/**
* Removes all the entries added into Parameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Column clearParametersEntries() {
this.parameters = null;
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getComment() != null)
sb.append("Comment: ").append(getComment()).append(",");
if (getParameters() != null)
sb.append("Parameters: ").append(getParameters());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Column == false)
return false;
Column other = (Column) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getComment() == null ^ this.getComment() == null)
return false;
if (other.getComment() != null && other.getComment().equals(this.getComment()) == false)
return false;
if (other.getParameters() == null ^ this.getParameters() == null)
return false;
if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode());
hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode());
return hashCode;
}
@Override
public Column clone() {
try {
return (Column) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.glue.model.transform.ColumnMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}
|
{
"content_hash": "1a7f7554cdf402c4ec4d7ee342697dd3",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 137,
"avg_line_length": 27.167763157894736,
"alnum_prop": 0.5631432376801065,
"repo_name": "jentfoo/aws-sdk-java",
"id": "4b576ddbf642f74a3e86f6cc693fde819ed2a407",
"size": "8839",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/Column.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "270"
},
{
"name": "FreeMarker",
"bytes": "173637"
},
{
"name": "Gherkin",
"bytes": "25063"
},
{
"name": "Java",
"bytes": "356214839"
},
{
"name": "Scilab",
"bytes": "3924"
},
{
"name": "Shell",
"bytes": "295"
}
]
}
|
package org.drools.workbench.screens.guided.dtable.client.widget;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.google.gwt.event.shared.EventBus;
import org.drools.workbench.models.datamodel.oracle.DataType;
import org.drools.workbench.models.datamodel.rule.IAction;
import org.drools.workbench.models.datamodel.rule.InterpolationVariable;
import org.drools.workbench.models.datamodel.rule.RuleModel;
import org.drools.workbench.models.guided.dtable.shared.model.ActionCol52;
import org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn;
import org.drools.workbench.models.guided.dtable.shared.model.BRLActionVariableColumn;
import org.drools.workbench.models.guided.dtable.shared.model.BRLColumn;
import org.drools.workbench.models.guided.dtable.shared.model.BRLRuleModel;
import org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52;
import org.drools.workbench.screens.guided.dtable.client.resources.i18n.GuidedDecisionTableConstants;
import org.drools.workbench.screens.guided.rule.client.editor.RuleModellerConfiguration;
import org.jboss.errai.common.client.api.Caller;
import org.kie.workbench.common.services.shared.rulename.RuleNamesService;
import org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle;
import org.uberfire.backend.vfs.Path;
/**
* An editor for a BRL Action Columns
*/
public class BRLActionColumnViewImpl extends AbstractBRLColumnViewImpl<IAction, BRLActionVariableColumn>
implements
BRLActionColumnView {
private Presenter presenter;
public BRLActionColumnViewImpl( final Path path,
final GuidedDecisionTable52 model,
final AsyncPackageDataModelOracle oracle,
final Caller<RuleNamesService> ruleNamesService,
final BRLActionColumn column,
final EventBus eventBus,
final boolean isNew,
final boolean isReadOnly ) {
super( path,
model,
oracle,
ruleNamesService,
column,
eventBus,
isNew,
isReadOnly );
}
@Override
public String getTitle() {
return GuidedDecisionTableConstants.INSTANCE.ActionBRLFragmentConfiguration();
}
protected boolean isHeaderUnique( String header ) {
for ( ActionCol52 o : model.getActionCols() ) {
if ( o.getHeader().equals( header ) ) {
return false;
}
}
return true;
}
protected BRLRuleModel getRuleModel( BRLColumn<IAction, BRLActionVariableColumn> column ) {
BRLRuleModel ruleModel = new BRLRuleModel( model );
List<IAction> definition = column.getDefinition();
ruleModel.rhs = definition.toArray( new IAction[ definition.size() ] );
return ruleModel;
}
protected RuleModellerConfiguration getRuleModellerConfiguration() {
return new RuleModellerConfiguration( true,
false,
true,
true );
}
public void setPresenter( Presenter presenter ) {
this.presenter = presenter;
}
@Override
protected void doInsertColumn() {
this.editingCol.setDefinition( Arrays.asList( this.ruleModel.rhs ) );
presenter.insertColumn( (BRLActionColumn) this.editingCol );
}
@Override
protected void doUpdateColumn() {
this.editingCol.setDefinition( Arrays.asList( this.ruleModel.rhs ) );
presenter.updateColumn( (BRLActionColumn) this.originalCol,
(BRLActionColumn) this.editingCol );
}
@Override
protected List<BRLActionVariableColumn> convertInterpolationVariables( Map<InterpolationVariable, Integer> ivs ) {
//If there are no variables add a boolean column to specify whether the fragment should apply
if ( ivs.size() == 0 ) {
BRLActionVariableColumn variable = new BRLActionVariableColumn( "",
DataType.TYPE_BOOLEAN );
variable.setHeader( editingCol.getHeader() );
variable.setHideColumn( editingCol.isHideColumn() );
List<BRLActionVariableColumn> variables = new ArrayList<BRLActionVariableColumn>();
variables.add( variable );
return variables;
}
//Convert to columns for use in the Decision Table
BRLActionVariableColumn[] variables = new BRLActionVariableColumn[ ivs.size() ];
for ( Map.Entry<InterpolationVariable, Integer> me : ivs.entrySet() ) {
InterpolationVariable iv = me.getKey();
int index = me.getValue();
BRLActionVariableColumn variable = new BRLActionVariableColumn( iv.getVarName(),
iv.getDataType(),
iv.getFactType(),
iv.getFactField() );
variable.setHeader( editingCol.getHeader() );
variable.setHideColumn( editingCol.isHideColumn() );
variables[ index ] = variable;
}
//Convert the array into a mutable list (Arrays.toList provides an immutable list)
List<BRLActionVariableColumn> variableList = new ArrayList<BRLActionVariableColumn>();
for ( BRLActionVariableColumn variable : variables ) {
variableList.add( variable );
}
return variableList;
}
@Override
protected BRLColumn<IAction, BRLActionVariableColumn> cloneBRLColumn( BRLColumn<IAction, BRLActionVariableColumn> col ) {
BRLActionColumn clone = new BRLActionColumn();
clone.setHeader( col.getHeader() );
clone.setHideColumn( col.isHideColumn() );
clone.setChildColumns( cloneVariables( col.getChildColumns() ) );
clone.setDefinition( cloneDefinition( col.getDefinition() ) );
return clone;
}
private List<BRLActionVariableColumn> cloneVariables( List<BRLActionVariableColumn> variables ) {
List<BRLActionVariableColumn> clone = new ArrayList<BRLActionVariableColumn>();
for ( BRLActionVariableColumn variable : variables ) {
clone.add( cloneVariable( variable ) );
}
return clone;
}
private BRLActionVariableColumn cloneVariable( BRLActionVariableColumn variable ) {
BRLActionVariableColumn clone = new BRLActionVariableColumn( variable.getVarName(),
variable.getFieldType(),
variable.getFactType(),
variable.getFactField() );
clone.setHeader( variable.getHeader() );
clone.setHideColumn( variable.isHideColumn() );
clone.setWidth( variable.getWidth() );
return clone;
}
private List<IAction> cloneDefinition( List<IAction> definition ) {
RuleModelCloneVisitor visitor = new RuleModelCloneVisitor();
RuleModel rm = new RuleModel();
for ( IAction action : definition ) {
rm.addRhsItem( action );
}
RuleModel rmClone = visitor.visitRuleModel( rm );
List<IAction> clone = new ArrayList<IAction>();
for ( IAction action : rmClone.rhs ) {
clone.add( action );
}
return clone;
}
}
|
{
"content_hash": "6f5fdb56cdf7ed1659896e14a85b122e",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 125,
"avg_line_length": 44.162921348314605,
"alnum_prop": 0.6176059025569266,
"repo_name": "padmaragl/drools-wb",
"id": "16b21476cb40db83dab7b468d810602c8cb03b3f",
"size": "8452",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "drools-wb-screens/drools-wb-guided-dtable-editor/drools-wb-guided-dtable-editor-client/src/main/java/org/drools/workbench/screens/guided/dtable/client/widget/BRLActionColumnViewImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3549"
},
{
"name": "CSS",
"bytes": "25794"
},
{
"name": "HTML",
"bytes": "9482"
},
{
"name": "Java",
"bytes": "4685052"
},
{
"name": "JavaScript",
"bytes": "56922"
},
{
"name": "Shell",
"bytes": "3913"
}
]
}
|
package org.codehaus.groovy.grails.cli.support;
import org.codehaus.groovy.tools.RootLoader;
import org.codehaus.groovy.tools.LoaderConfiguration;
import java.net.URL;
/**
* @author Graeme Rocher
* @since 1.0
* <p/>
* Created: Nov 29, 2007
*/
public class GrailsRootLoader extends RootLoader {
public GrailsRootLoader(URL[] urls, ClassLoader parent) {
super(urls, parent);
}
public GrailsRootLoader(LoaderConfiguration lc) {
super(lc);
}
protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
try {
return super.loadClass(name, resolve);
} catch (LinkageError e) {
return getParent().loadClass(name);
}
}
}
|
{
"content_hash": "d233ee4257be37d814e11b47105f5fdf",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 91,
"avg_line_length": 24.29032258064516,
"alnum_prop": 0.6547144754316069,
"repo_name": "lpicanco/grails",
"id": "1a86936de2fd239ccf9adcf845b0ee1c80c778a8",
"size": "1352",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/commons/org/codehaus/groovy/grails/cli/support/GrailsRootLoader.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "3896589"
},
{
"name": "JavaScript",
"bytes": "373"
},
{
"name": "Perl",
"bytes": "9273"
},
{
"name": "Python",
"bytes": "3087"
}
]
}
|
package com.microsoft.azure.management.labservices.v2018_10_15;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Represents the payload to list environments owned by a user.
*/
public class ListEnvironmentsPayload {
/**
* The resource Id of the lab.
*/
@JsonProperty(value = "labId")
private String labId;
/**
* Get the resource Id of the lab.
*
* @return the labId value
*/
public String labId() {
return this.labId;
}
/**
* Set the resource Id of the lab.
*
* @param labId the labId value to set
* @return the ListEnvironmentsPayload object itself.
*/
public ListEnvironmentsPayload withLabId(String labId) {
this.labId = labId;
return this;
}
}
|
{
"content_hash": "4e0121faae4d3ab6f8f5940378661c4b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 63,
"avg_line_length": 21.16216216216216,
"alnum_prop": 0.6257982120051085,
"repo_name": "selvasingh/azure-sdk-for-java",
"id": "ba973ae9c11b8a9c6b14458ed31b70864b2d6421",
"size": "1013",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "sdk/labservices/mgmt-v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListEnvironmentsPayload.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "29891970"
},
{
"name": "JavaScript",
"bytes": "6198"
},
{
"name": "PowerShell",
"bytes": "160"
},
{
"name": "Shell",
"bytes": "609"
}
]
}
|
require File.dirname(__FILE__) + '/bench_helper'
require File.dirname(__FILE__) + '/github_contest'
GithubContest::Data.load!
cluster = GithubContest::UsersCluster.new(:require_watches=>2, :vector_type => :tanimoto)
Benchmark.bm(20) do |results|
results.report("load data:") do
cluster.load!
end
results.report("build tree:") do
cluster.build
end
results.report("find KNN:") do
cluster.find_neighbors_of_test_users(100)
end
cluster.recommendations.each do |recommended_repos|
puts recommended_repos.emit_recommendations
end
end
|
{
"content_hash": "8208ae2e0c3da9096710cf975e46322b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 89,
"avg_line_length": 22.153846153846153,
"alnum_prop": 0.6996527777777778,
"repo_name": "danielsdeleo/Decider",
"id": "5c185fa728b9f2c612422575574ca59785e975da",
"size": "576",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "benchmark/github_user_clusters.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "135053"
}
]
}
|
<?php
if (isset($_POST['submit']))
{
// load file
require_once '../src/Validator.php';
// instanciate object.
// optional, if you are going to check for username etc. is taken
// you have to inject a db class in the constructor.
$v = new Datalaere\PHPSecurity\Validator();
$v->setFeedback('req', ' is bullshit!');
// all error messages are returned with the name of the input field
/*
* Form validation for $_POST
*/
//choose what source to validate and the items to validate
$v->checkPost($_POST, array(
// chose the input name field to set rules for
'username' => array(
// the field is required
'required' => true,
// min length
'min' => 8,
// max length
'max' => 20,
// the username is NOT in db
//'notTaken' => 'users'
),
'password' => array(
'required' => true,
'min' => 8,
'max' => 20,
// check if the input is valid and does not contain script tags
'validInput' => $_POST['password']
),
'email' => array(
'required' => true,
'min' => 8,
'max' => 30,
// check if the email is valid and contains @
'validEmail' => $_POST['email'],
'notTaken' => 'users'
),
));
/*
* Form validation for $_FILES
*/
$v->checkFile($_FILES, array(
// name of file input field
'files' => array(
//allowed extensions for files
'ext' => array('png', 'jpg', 'jpeg'),
//set allowed size in bytes
'size' => 1000000
)
));
// if validation did not pass (there was errors somewhere
if (!$v->passed())
{
// gather the errorrs and echo them out
foreach ($v->errors() as $error)
{
echo $error . '<br>';
}
}
}
?>
<form action="" method="post" enctype='multipart/form-data'>
<input type="text" name="username">
<input type="text" name="password" autocomplete="off">
<input type="text" name="email" autocomplete="off">
<input type="file" name="files[]">
<input type="submit" name="submit">
</form>
|
{
"content_hash": "ab3fd045ee1d4eb7d606141a268e3757",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 75,
"avg_line_length": 29.240506329113924,
"alnum_prop": 0.5004329004329005,
"repo_name": "WebSupport-DK/php-security",
"id": "82497467e521d33599790f2384fa62bfeab79024",
"size": "2310",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/validator.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "13644"
}
]
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_60-ea) on Tue Sep 06 12:41:45 EDT 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider.LoadMetricSupplier (Public javadocs 2016.9 API)</title>
<meta name="date" content="2016-09-06">
<link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider.LoadMetricSupplier (Public javadocs 2016.9 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../org/wildfly/swarm/config/modcluster/mod_cluster_config/dynamic_load_provider/LoadMetricSupplier.html" title="interface in org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2016.9</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/modcluster/mod_cluster_config/dynamic_load_provider/class-use/LoadMetricSupplier.html" target="_top">Frames</a></li>
<li><a href="LoadMetricSupplier.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider.LoadMetricSupplier" class="title">Uses of Interface<br>org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider.LoadMetricSupplier</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../../org/wildfly/swarm/config/modcluster/mod_cluster_config/dynamic_load_provider/LoadMetricSupplier.html" title="interface in org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider">LoadMetricSupplier</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.modcluster.mod_cluster_config">org.wildfly.swarm.config.modcluster.mod_cluster_config</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.config.modcluster.mod_cluster_config">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/modcluster/mod_cluster_config/dynamic_load_provider/LoadMetricSupplier.html" title="interface in org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider">LoadMetricSupplier</a> in <a href="../../../../../../../../org/wildfly/swarm/config/modcluster/mod_cluster_config/package-summary.html">org.wildfly.swarm.config.modcluster.mod_cluster_config</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/modcluster/mod_cluster_config/package-summary.html">org.wildfly.swarm.config.modcluster.mod_cluster_config</a> with parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/modcluster/mod_cluster_config/dynamic_load_provider/LoadMetricSupplier.html" title="interface in org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider">LoadMetricSupplier</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/modcluster/mod_cluster_config/ConfigurationDynamicLoadProvider.html" title="type parameter in ConfigurationDynamicLoadProvider">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">ConfigurationDynamicLoadProvider.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/modcluster/mod_cluster_config/ConfigurationDynamicLoadProvider.html#loadMetric-org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider.LoadMetricSupplier-">loadMetric</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/modcluster/mod_cluster_config/dynamic_load_provider/LoadMetricSupplier.html" title="interface in org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider">LoadMetricSupplier</a> supplier)</code>
<div class="block">Install a supplied LoadMetric object to the list of subresources</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../org/wildfly/swarm/config/modcluster/mod_cluster_config/dynamic_load_provider/LoadMetricSupplier.html" title="interface in org.wildfly.swarm.config.modcluster.mod_cluster_config.dynamic_load_provider">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2016.9</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/modcluster/mod_cluster_config/dynamic_load_provider/class-use/LoadMetricSupplier.html" target="_top">Frames</a></li>
<li><a href="LoadMetricSupplier.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2016 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
|
{
"content_hash": "f4fdfdb7986f178bb5e02107fd9a3328",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 657,
"avg_line_length": 51.73529411764706,
"alnum_prop": 0.664013644115975,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "4468d5d18f1aca49c78d1f44c5b67f010b2b4231",
"size": "8795",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2016.9/apidocs/org/wildfly/swarm/config/modcluster/mod_cluster_config/dynamic_load_provider/class-use/LoadMetricSupplier.html",
"mode": "33188",
"license": "apache-2.0",
"language": []
}
|
package org.apache.struts2.util;
/**
* Entry in a list.
*
*/
public class ListEntry {
final private Object key;
final private Object value;
final private boolean isSelected;
public ListEntry(Object key, Object value, boolean isSelected) {
this.key = key;
this.value = value;
this.isSelected = isSelected;
}
public boolean getIsSelected() {
return isSelected;
}
public Object getKey() {
return key;
}
public Object getValue() {
return value;
}
}
|
{
"content_hash": "c34faaf7b62944e2f19fe330003aa5d6",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 68,
"avg_line_length": 17.176470588235293,
"alnum_prop": 0.5684931506849316,
"repo_name": "xiaguangme/struts2-src-study",
"id": "6f9a2177385a8bfce66befb5da5f5d2bb55a33cc",
"size": "1475",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/org/apache/struts2/util/ListEntry.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "18012"
},
{
"name": "Java",
"bytes": "3297928"
}
]
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>zorns-lemma: Not compatible</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.0 / zorns-lemma - 8.11.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
zorns-lemma
<small>
8.11.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-07-31 07:04:33 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-31 07:04:33 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.12 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.7.0 Formal proof management system.
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "miloradovsky@gmail.com"
homepage: "https://github.com/coq-community/zorns-lemma"
dev-repo: "git+https://github.com/coq-community/zorns-lemma.git"
bug-reports: "https://github.com/coq-community/zorns-lemma/issues"
license: "LGPL-2.1-or-later"
synopsis: "This library develops some basic set theory"
description: """
The main purpose the author had in writing it was as support for the Topology library.
"""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {>= "8.10" & < "8.12~"}
]
tags: [
"category: Mathematics/Logic/Set theory"
"keyword: set theory"
"keyword: cardinals"
"keyword: ordinals"
"keyword: finite"
"keyword: countable"
"keyword: quotients"
"keyword: well-orders"
"keyword: Zorn's lemma"
"logpath: ZornsLemma"
]
authors: [
"Daniel Schepler"
]
url {
archive: "https://github.com/coq-community/zorns-lemma/archive/v8.11.0.tar.gz"
checksum: "sha256=af8872b360b5f0f84d6a514f7db1aa855d11460d1ed9394279f19b1399d9da32"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-zorns-lemma.8.11.0 coq.8.7.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.0).
The following dependencies couldn't be met:
- coq-zorns-lemma -> coq >= 8.10
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-zorns-lemma.8.11.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "73cf374f8b36e5e94ada0720f2d4d3cf",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 157,
"avg_line_length": 40.16477272727273,
"alnum_prop": 0.546894893195643,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "e3202d88b8d083d4c856a1bd3840d51f3f4f9c8e",
"size": "7071",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.05.0-2.0.6/released/8.7.0/zorns-lemma/8.11.0.html",
"mode": "33188",
"license": "mit",
"language": []
}
|
End of preview.
No dataset card yet
- Downloads last month
- 3