code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
|---|---|
protected TabDelegate createTabDelegate(boolean incognito){
return new TabDelegate(incognito);
}
|
Creates TabDelegates for opening new Tabs.
|
public static Command createForcePuppetAgentCommand(NodeConfig node) throws AgentException {
return createCommand(getForcePuppetAgentCommand(),node);
}
|
Creates command to force running puppet agent.
|
public static Iterable<TextRange> excludeRanges(@NotNull TextRange original,@NotNull List<TextRange> excludedRanges){
if (!excludedRanges.isEmpty()) {
List<TextRange> enabledRanges=new ArrayList<TextRange>();
if (excludedRanges.size() > 1) {
Collections.sort(excludedRanges,RANGE_COMPARATOR);
}
int enabledRangeStart=original.getStartOffset();
for ( TextRange excludedRange : excludedRanges) {
if (excludedRange.getEndOffset() < enabledRangeStart) continue;
int excludedRangeStart=excludedRange.getStartOffset();
if (excludedRangeStart > original.getEndOffset()) break;
if (excludedRangeStart > enabledRangeStart) {
enabledRanges.add(new TextRange(enabledRangeStart,excludedRangeStart));
}
enabledRangeStart=excludedRange.getEndOffset();
}
if (enabledRangeStart < original.getEndOffset()) {
enabledRanges.add(new TextRange(enabledRangeStart,original.getEndOffset()));
}
return enabledRanges;
}
return Arrays.asList(original);
}
|
Excludes ranges from the original range. For example, if the original range is [30..100] and ranges to exclude are [20..50] and [60..90], resulting ranges will be [50..60] and [90..100]. The ranges may overlap and follow in any order. In the latter case the original list of excluded ranges is sorted by start/end offset.
|
@Override public synchronized String format(LogRecord record){
StringBuffer sb=new StringBuffer();
String[] array=parseLogRecord(record);
String type=array[0];
String text=array[1];
addTimeStamp(record,sb);
addClassName(record,sb);
addTypeName(record,sb,type);
addMethodName(record,sb);
addText(record,sb,text);
addThrown(record,sb);
return sb.toString();
}
|
Format the given LogRecord.
|
private void doAcquireInterruptibly(int arg) throws InterruptedException {
final Node node=addWaiter(Node.EXCLUSIVE);
boolean failed=true;
try {
for (; ; ) {
final Node p=node.predecessor();
if (p == head && tryAcquire(arg)) {
setHead(node);
p.next=null;
failed=false;
return;
}
if (shouldParkAfterFailedAcquire(p,node) && parkAndCheckInterrupt()) throw new InterruptedException();
}
}
finally {
if (failed) cancelAcquire(node);
}
}
|
Acquires in exclusive interruptible mode.
|
@Override public boolean isActive(){
return amIActive;
}
|
Used by the Whitebox GUI to tell if this plugin is still running.
|
private void showFeedback(String message){
if (myHost != null) {
myHost.showFeedback(message);
}
else {
System.out.println(message);
}
}
|
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
|
boolean nothingToVerify(){
return (anyToVerify == false);
}
|
returns true if there no files to verify. should only be called after all the META-INF entries have been processed.
|
public boolean appliesChunk(int cx,int cz){
return true;
}
|
Check whether a chunk should be read
|
@Override public void initialize() throws ReplicatorException, InterruptedException {
if (createCatalog) {
logger.info("Initializing data source tables: service=" + serviceName + " schema="+ connectionSpec.getSchema());
Database conn=null;
try {
if (this.connectionSpec.supportsCreateDB()) {
if (checkDBConnectivity(false,true)) {
logger.info("Confirmed DBMS connection");
}
else {
logger.info("Attempting to create schema via JDBC");
checkDBConnectivity(true,false);
}
}
else {
checkDBConnectivity(false,false);
logger.info("Confirmed DBMS connection");
}
conn=connectionManager.getCatalogConnection();
String schema=connectionSpec.getSchema();
if (conn.supportsUseDefaultSchema() && schema != null) {
if (conn.supportsCreateDropSchema()) {
conn.createSchema(schema);
}
conn.useDefaultSchema(schema);
}
commitSeqno.initialize();
Table consistency=ConsistencyTable.getConsistencyTableDefinition(schema);
if (conn.findTable(consistency.getSchema(),consistency.getName()) == null) {
conn.createTable(consistency,false,connectionSpec.getTableType());
}
HeartbeatTable heartbeatTable=new HeartbeatTable(schema,connectionSpec.getTableType(),serviceName);
heartbeatTable.initializeHeartbeatTable(conn);
heartbeatTable.initializeHeartbeatStageTable(conn);
ShardTable shardTable=new ShardTable(schema,connectionSpec.getTableType());
shardTable.initializeShardTable(conn);
channelTable=new ShardChannelTable(schema,connectionSpec.getTableType());
channelTable.initializeShardTable(conn,this.channels);
}
catch ( SQLException e) {
throw new ReplicatorException("Unable to create catalog tables",e);
}
finally {
if (conn != null) {
connectionManager.releaseCatalogConnection(conn);
}
}
}
}
|
Ensure all tables are ready for use, creating them if necessary.
|
public void connectionLost(MqttException cause){
final String methodName="connectionLost";
try {
if (mqttCallback != null && cause != null) {
log.fine(CLASS_NAME,methodName,"708",new Object[]{cause});
mqttCallback.connectionLost(cause);
}
if (reconnectInternalCallback != null && cause != null) {
reconnectInternalCallback.connectionLost(cause);
}
}
catch ( java.lang.Throwable t) {
log.fine(CLASS_NAME,methodName,"720",new Object[]{t});
}
}
|
This method is called when the connection to the server is lost. If there is no cause then it was a clean disconnect. The connectionLost callback will be invoked if registered and run on the thread that requested shutdown e.g. receiver or sender thread. If the request was a user initiated disconnect then the disconnect token will be notified.
|
public boolean isText(){
return (this == TEXT);
}
|
Return true if this edit mode is <code>TEXT</code>.
|
public ObjectMatrix1D make(int size){
if (this == sparse) return new SparseObjectMatrix1D(size);
return new DenseObjectMatrix1D(size);
}
|
Constructs a matrix with the given shape, each cell initialized with zero.
|
public void close() throws IOException {
if (closed) {
return;
}
closed=true;
try {
obuffer=cipher.doFinal();
}
catch ( IllegalBlockSizeException|BadPaddingException e) {
obuffer=null;
}
try {
flush();
}
catch ( IOException ignored) {
}
out.close();
}
|
Closes this output stream and releases any system resources associated with this stream. <p> This method invokes the <code>doFinal</code> method of the encapsulated cipher object, which causes any bytes buffered by the encapsulated cipher to be processed. The result is written out by calling the <code>flush</code> method of this output stream. <p> This method resets the encapsulated cipher object to its initial state and calls the <code>close</code> method of the underlying output stream.
|
public static void gradient(MultivariateFunction f,double[] x,double[] grad){
for (int i=0; i < f.getNumArguments(); i++) {
double h=MachineAccuracy.SQRT_EPSILON * (Math.abs(x[i]) + 1.0);
double oldx=x[i];
x[i]=oldx + h;
double fxplus=f.evaluate(x);
x[i]=oldx - h;
double fxminus=f.evaluate(x);
x[i]=oldx;
grad[i]=(fxplus - fxminus) / (2.0 * h);
}
}
|
determine gradient
|
public boolean isDeclaredN4JS(){
return declaredN4JS;
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
public void close() throws IOException {
writer.close();
}
|
Closes the underlying Writer
|
public boolean isProvisioningAcceptButton(){
return readBoolean(RcsSettingsData.PROV_ACCEPT_BUTTON);
}
|
Is Accept button shown with the message in the terms and conditions pop-up
|
public long generateWanId(long threadId,long offset,int gatewayIndex){
assert this != RESERVED;
return Bits.WAN_TYPE.shift(ordinal()) | Bits.WAN.shift(offset) | Bits.GATEWAY_ID.shift(gatewayIndex)| threadId;
}
|
Generates a new thread id for usage in a parallel wan context.
|
@LargeTest public void testStressAddRemoveVideoItem() throws Exception {
final int renderingMode=MediaItem.RENDERING_MODE_BLACK_BORDER;
final String videoItemFileName1=INPUT_FILE_PATH + "H264_BP_176x144_15fps_144kbps_AMRNB_8kHz_12.2kbps_m_1_17.3gp";
final String videoItemFileName2=INPUT_FILE_PATH + "MPEG4_SP_720x480_30fps_280kbps_AACLC_48kHz_96kbps_s_0_21.mp4";
final String videoItemFileName3=INPUT_FILE_PATH + "H263_profile0_176x144_15fps_128kbps_1_35.3gp";
final String videoItemFileName4=INPUT_FILE_PATH + "MPEG4_SP_640x480_15fps_1200kbps_AACLC_48khz_64kbps_m_1_17.3gp";
final String[] loggingInfo=new String[1];
writeTestCaseHeader("testStressAddRemoveVideoItem");
int i=0;
getBeginMemory();
for (i=0; i < 50; i++) {
if (i % 4 == 0) {
final MediaVideoItem mediaItem1=new MediaVideoItem(mVideoEditor,"m1" + i,videoItemFileName1,renderingMode);
mediaItem1.setExtractBoundaries(0,5000);
mVideoEditor.addMediaItem(mediaItem1);
}
if (i % 4 == 1) {
final MediaVideoItem mediaItem2=new MediaVideoItem(mVideoEditor,"m2" + i,videoItemFileName2,renderingMode);
mediaItem2.setExtractBoundaries(0,10000);
mVideoEditor.addMediaItem(mediaItem2);
}
if (i % 4 == 2) {
final MediaVideoItem mediaItem3=new MediaVideoItem(mVideoEditor,"m3" + i,videoItemFileName3,renderingMode);
mediaItem3.setExtractBoundaries(30000,45000);
mVideoEditor.addMediaItem(mediaItem3);
}
if (i % 4 == 3) {
final MediaVideoItem mediaItem4=new MediaVideoItem(mVideoEditor,"m4" + i,videoItemFileName4,renderingMode);
mediaItem4.setExtractBoundaries(10000,30000);
mVideoEditor.addMediaItem(mediaItem4);
}
if (i % 10 == 0) {
getAfterMemory_updateLog(loggingInfo,false,i);
}
}
getAfterMemory_updateLog(loggingInfo,false,i);
for (i=0; i < 50; i++) {
if (i % 4 == 0) {
mVideoEditor.removeMediaItem("m1" + i);
}
if (i % 4 == 1) {
mVideoEditor.removeMediaItem("m2" + i);
}
if (i % 4 == 2) {
mVideoEditor.removeMediaItem("m3" + i);
}
if (i % 4 == 3) {
mVideoEditor.removeMediaItem("m4" + i);
}
if (i % 10 == 0) {
getAfterMemory_updateLog(loggingInfo,true,i);
}
}
getAfterMemory_updateLog(loggingInfo,true,i);
}
|
To stress test MediaItem(Video Item) adding functionality
|
public Boolean isInRelationService(){
return myInRelServFlg.get();
}
|
Returns an internal flag specifying if the object is still handled by the Relation Service.
|
private static Map<URI,Set<StoragePort>> generateNetworkToStoragePortsMap(Map<Initiator,List<StoragePort>> existingAssignments,Map<URI,Set<Initiator>> existingInitiatorsMap){
Map<URI,Set<StoragePort>> network2StoragePortsMap=new HashMap<URI,Set<StoragePort>>();
if (existingAssignments == null) {
return network2StoragePortsMap;
}
for ( Entry<URI,Set<Initiator>> networkInitiators : existingInitiatorsMap.entrySet()) {
network2StoragePortsMap.put(networkInitiators.getKey(),new HashSet<StoragePort>());
for ( Initiator initiator : networkInitiators.getValue()) {
List<StoragePort> ports=existingAssignments.get(initiator);
for ( StoragePort port : ports) {
if (port.getRegistrationStatus().toString().equals(DiscoveredDataObject.RegistrationStatus.REGISTERED.name()) && port.getCompatibilityStatus().toString().equals(DiscoveredDataObject.CompatibilityStatus.COMPATIBLE.name()) && port.getDiscoveryStatus().toString().equals(DiscoveryStatus.VISIBLE.name())) {
network2StoragePortsMap.get(networkInitiators.getKey()).add(port);
}
}
}
}
return network2StoragePortsMap;
}
|
Creates a map of Initiator Network URI to a Set<StoragePort> of ports in that Network. When one or more of the initiator have routed access to the storage ports allocated, the storage ports mapped to the network may not all be in the network.
|
public static void throwAtomikosJMSException(String msg) throws AtomikosJMSException {
throwAtomikosJMSException(msg,null);
}
|
Logs and throws an AtomikosJMSException.
|
public boolean isIntersection(Coordinate pt){
for (Iterator it=iterator(); it.hasNext(); ) {
EdgeIntersection ei=(EdgeIntersection)it.next();
if (ei.coord.equals(pt)) return true;
}
return false;
}
|
Tests if the given point is an edge intersection
|
@POST @Path("run/{noteId}/{paragraphId}") @ZeppelinApi public Response runParagraphSynchronously(@PathParam("noteId") String noteId,@PathParam("paragraphId") String paragraphId,String message) throws IOException, IllegalArgumentException {
LOG.info("run paragraph synchronously {} {} {}",noteId,paragraphId,message);
Note note=notebook.getNote(noteId);
if (note == null) {
return new JsonResponse<>(Status.NOT_FOUND,"note not found.").build();
}
Paragraph paragraph=note.getParagraph(paragraphId);
if (paragraph == null) {
return new JsonResponse<>(Status.NOT_FOUND,"paragraph not found.").build();
}
handleParagraphParams(message,note,paragraph);
if (paragraph.getListener() == null) {
note.initializeJobListenerForParagraph(paragraph);
}
paragraph.run();
final InterpreterResult result=paragraph.getResult();
if (result.code() == InterpreterResult.Code.SUCCESS) {
return new JsonResponse<>(Status.OK,result).build();
}
else {
return new JsonResponse<>(Status.INTERNAL_SERVER_ERROR,result).build();
}
}
|
Run synchronously a paragraph REST API
|
public void configure(){
SerialTrafficController.instance().connectPort(this);
jmri.InstanceManager.setTurnoutManager(jmri.jmrix.oaktree.SerialTurnoutManager.instance());
jmri.InstanceManager.setLightManager(jmri.jmrix.oaktree.SerialLightManager.instance());
SerialSensorManager s;
jmri.InstanceManager.setSensorManager(s=jmri.jmrix.oaktree.SerialSensorManager.instance());
SerialTrafficController.instance().setSensorManager(s);
jmri.jmrix.oaktree.ActiveFlag.setActive();
}
|
set up all of the other objects to operate connected to this port
|
public boolean breakableLine(int line){
return (line < this.breakableLines.length) && this.breakableLines[line];
}
|
Returns whether the given line number can have a breakpoint set on it.
|
protected Message(){
}
|
Dear JPA...
|
boolean cancel(int propertyConstant){
if ((mPropertyMask & propertyConstant) != 0 && mNameValuesHolder != null) {
int count=mNameValuesHolder.size();
for (int i=0; i < count; ++i) {
NameValuesHolder nameValuesHolder=mNameValuesHolder.get(i);
if (nameValuesHolder.mNameConstant == propertyConstant) {
mNameValuesHolder.remove(i);
mPropertyMask&=~propertyConstant;
return true;
}
}
}
return false;
}
|
Removes the given property from being animated as a part of this PropertyBundle. If the property was a part of this bundle, it returns true to indicate that it was, in fact, canceled. This is an indication to the caller that a cancellation actually occurred.
|
public static List<WebElement> findElementsPresentAfter(SearchContext parent,By by,int waitInSeconds){
Preconditions.checkNotNull(parent);
Preconditions.checkNotNull(by);
findElementPresentAfter(parent,by,waitInSeconds);
return parent.findElements(by);
}
|
Will return all the elements that are present identified by the by. It will wait until one is present and then return all the present ones at that point.
|
public static PathPoint lineTo(float x,float y){
return new PathPoint(LINE,x,y);
}
|
Constructs and returns a PathPoint object that describes a line to the given xy location.
|
public final double tanHalfAngle(){
return Math.tan(0.5 * this.radians);
}
|
Obtains the tangent of half of this angle.
|
final Type internalGetReturnType(){
supportedOnlyIn2();
if (this.returnType == null) {
synchronized (this) {
if (this.returnType == null) {
preLazyInit();
this.returnType=this.ast.newPrimitiveType(PrimitiveType.VOID);
postLazyInit(this.returnType,RETURN_TYPE_PROPERTY);
}
}
}
return this.returnType;
}
|
Internal synonym for deprecated method. Used to avoid deprecation warnings.
|
public DataSet sort(Closure sort){
return new DataSet(this,null,sort);
}
|
Return a lazy-implemented re-ordered view of this DataSet.
|
static boolean isWhiteSpace(StringBuffer buf){
int n=buf.length();
for (int i=0; i < n; i++) {
if (!isWhiteSpace(buf.charAt(i))) return false;
}
return true;
}
|
Tell if the string is whitespace.
|
protected RemoteServer(RemoteRef ref){
super(ref);
}
|
Constructs a <code>RemoteServer</code> with the given reference type.
|
public static long generate(long crc,byte[] buffer,int offset,int len){
final long[] crcTable=CRC_TABLE;
for (int i=0; i < len; i++) {
final int index=((int)crc ^ buffer[offset + i]) & 0xff;
crc=(crc >>> 8) ^ crcTable[index];
}
return crc;
}
|
Calculates CRC from a char buffer
|
private FSManager(){
String delQueueProp=Sage.get(DELETE_QUEUE_PROP,"");
if (delQueueProp.length() > 0) {
java.util.Set delSet=Sage.parseDelimSet(delQueueProp,";");
java.util.Iterator walker=delSet.iterator();
while (walker.hasNext()) {
java.io.File newF=new java.io.File(walker.next().toString());
Seeker.getInstance().addIgnoreFile(newF);
}
}
if (Sage.EMBEDDED && Sage.LINUX_OS) {
String hddProp=Sage.get("linux/installed_hdd","");
if (hddProp != null && hddProp.length() > 0) {
if (Sage.DBG) System.out.println("Found HDD property: " + hddProp);
if (new java.io.File(hddProp).exists()) {
if (IOUtils.mountExternalDrive(hddProp.substring(5),SageTV.LINUX_ROOT_MEDIA_PATH)) {
if (Sage.DBG) System.out.println("Sucessfully mounted the HDD! (or it's already mounted)");
localHDD=new java.io.File(SageTV.LINUX_ROOT_MEDIA_PATH);
}
else {
if (Sage.DBG) System.out.println("FAILED mounting the HDD; clear the property!");
Sage.put("linux/installed_hdd","");
}
}
else {
if (Sage.DBG) System.out.println("HDD device does not exist; clear the property");
Sage.put("linux/installed_hdd","");
}
}
}
}
|
Creates a new instance of FSManager
|
private int rotateWordLeft(int x,int y){
x&=0xffff;
return (x << y) | (x >> (16 - y));
}
|
return the result rotating the 16 bit number in x left by y
|
public BindingElement createBindingElement(){
BindingElementImpl bindingElement=new BindingElementImpl();
return bindingElement;
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
public QName isMultiNameResolved(MultiName multiName){
return multiNames.get(multiName);
}
|
If CompilerAPI.resolveMultiName() successfully resolves a multiname to a qname, the result will be stored here. This method allows for quick lookup.
|
private void emitSSE41Compare(CompilationResultBuilder crb,AMD64MacroAssembler masm,Register result,Register array1,Register array2,Register length,Label trueLabel,Label falseLabel){
assert supportsSSE41(crb.target);
Register vector1=asRegister(vectorTemp1,AMD64Kind.DOUBLE);
Register vector2=asRegister(vectorTemp2,AMD64Kind.DOUBLE);
Label loop=new Label();
Label compareTail=new Label();
masm.andl(result,SSE4_1_VECTOR_SIZE - 1);
masm.andl(length,~(SSE4_1_VECTOR_SIZE - 1));
masm.jccb(ConditionFlag.Zero,compareTail);
masm.leaq(array1,new AMD64Address(array1,length,Scale.Times1,0));
masm.leaq(array2,new AMD64Address(array2,length,Scale.Times1,0));
masm.negq(length);
masm.align(crb.target.wordSize * 2);
masm.bind(loop);
masm.movdqu(vector1,new AMD64Address(array1,length,Scale.Times1,0));
masm.movdqu(vector2,new AMD64Address(array2,length,Scale.Times1,0));
masm.pxor(vector1,vector2);
masm.ptest(vector1,vector1);
masm.jcc(ConditionFlag.NotZero,falseLabel);
masm.addq(length,SSE4_1_VECTOR_SIZE);
masm.jcc(ConditionFlag.NotZero,loop);
masm.testl(result,result);
masm.jcc(ConditionFlag.Zero,trueLabel);
masm.movdqu(vector1,new AMD64Address(array1,result,Scale.Times1,-SSE4_1_VECTOR_SIZE));
masm.movdqu(vector2,new AMD64Address(array2,result,Scale.Times1,-SSE4_1_VECTOR_SIZE));
masm.pxor(vector1,vector2);
masm.ptest(vector1,vector1);
masm.jcc(ConditionFlag.NotZero,falseLabel);
masm.jmp(trueLabel);
masm.bind(compareTail);
masm.movl(length,result);
}
|
Emits code that uses SSE4.1 128-bit (16-byte) vector compares.
|
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:46.051 -0500",hash_original_method="50B0D0B78D385E8C0BEE924F86CB84EC",hash_generated_method="38419D10162DE19B56D626859AF70FC1") private StreamItems(){
}
|
This utility class cannot be instantiated
|
public NotificationChain basicSetConfiguration(Configuration newConfiguration,NotificationChain msgs){
Configuration oldConfiguration=configuration;
configuration=newConfiguration;
if (eNotificationRequired()) {
ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,FunctionblockPackage.FUNCTION_BLOCK__CONFIGURATION,oldConfiguration,newConfiguration);
if (msgs == null) msgs=notification;
else msgs.add(notification);
}
return msgs;
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
public LdapMessage(){
}
|
Ldap Message
|
public URL(String protocol,String host,int port,String file) throws MalformedURLException {
this(protocol,host,port,file,null);
}
|
Creates a new URL of the given component parts. The URL uses the protocol's default port.
|
public void put(long key,long value){
lookup(key).setValue(value);
}
|
Updates the value the key maps to.
|
private void loadMissingCertificates(TSLParserResult tslParserResult){
if ("ES".equals(tslParserResult.getTerritory())) {
List<TSLServiceProvider> serviceProviders=tslParserResult.getServiceProviders();
if (CollectionUtils.isNotEmpty(serviceProviders)) {
for ( TSLServiceProvider tslServiceProvider : serviceProviders) {
List<TSLService> services=tslServiceProvider.getServices();
if (CollectionUtils.isNotEmpty(services)) {
for ( TSLService tslService : services) {
List<String> certificateUrls=tslService.getCertificateUrls();
if (CollectionUtils.isNotEmpty(certificateUrls)) {
for ( String url : certificateUrls) {
try {
byte[] byteArray=dataLoader.get(url);
CertificateToken certificate=DSSUtils.loadCertificate(byteArray);
if (certificate != null) {
tslService.getCertificates().add(certificate);
}
}
catch ( Exception e) {
logger.warn("Cannot load certificate from url '" + url + "' : "+ e.getMessage());
}
}
}
}
}
}
}
}
}
|
The spanish TSL contains some urls with certificates to download
|
@Override protected void persist(Collection<RawProtein<ProSitePatternRawMatch>> filteredProteins,Map<String,Signature> modelAccessionToSignatureMap,Map<String,Protein> proteinIdToProteinMap){
for ( RawProtein<ProSitePatternRawMatch> rawProtein : filteredProteins) {
final Protein protein=proteinIdToProteinMap.get(rawProtein.getProteinIdentifier());
for ( ProSitePatternRawMatch rawMatch : rawProtein.getMatches()) {
Signature signature=modelAccessionToSignatureMap.get(rawMatch.getModelId());
PatternScanMatch match=buildMatch(signature,rawMatch);
protein.addMatch(match);
entityManager.persist(match);
}
}
}
|
This is the method that should be implemented by specific FilteredMatchDAOImpl's to persist filtered matches.
|
public static TimeOfDay createTimeOfDay(String timeString) throws NumberFormatException, InstantiationException, IllegalAccessException {
TimeOfDay time=TimeOfDay.class.newInstance().setHours(Integer.parseInt(timeString.split(":")[0],BASE_10)).setMinutes(Integer.parseInt(timeString.split(":")[1],BASE_10)).setSeconds(Integer.parseInt(timeString.split(":")[2],BASE_10));
return time;
}
|
Parses a TimeOfDay from a string of the form "HH:MM:SS".
|
public boolean isMouseResizeZone(){
return sizeWest || sizeEast || sizeNorth|| sizeSouth;
}
|
Gets whether the mouse is currently in this dock node's resize zone.
|
public void endVisit(TypeDeclarationStatement node){
}
|
End of visit the given type-specific AST node. <p> The default implementation does nothing. Subclasses may reimplement. </p>
|
private float calculateChallengePaceFromProgress(int progress){
return CHALLENGE_PACE_MIN_MINUTES_PER_MILE + ((1.0f - ((float)progress) / CHALLENGE_PACE_SEEK_BAR_MAX) * CHALLENGE_PACE_RANGE_MINUTES_PER_MILE);
}
|
Calculates Challenge Pace based on SeekBar progress.
|
public static IMultiPoint[] randomPoints(int n,int d){
IMultiPoint points[]=new IMultiPoint[n];
for (int i=0; i < n; i++) {
StringBuilder sb=new StringBuilder();
for (int j=0; j < d; j++) {
sb.append(rGen.nextDouble());
if (j < d - 1) {
sb.append(",");
}
}
points[i]=new Hyperpoint(sb.toString());
}
return points;
}
|
generate array of n d-dimensional points whose coordinates are values in the range 0 .. 1
|
public boolean deleteTranslation(PO po){
if (!isActiveLanguages(false)) return true;
if (po.get_IDOld() == 0) throw new IllegalArgumentException("PO Old ID is 0");
StringBuffer sb=new StringBuffer("DELETE FROM ");
sb.append(m_trlTableName).append(" WHERE ").append(m_baseTableName).append("_ID=").append(po.get_IDOld());
int no=DB.executeUpdate(sb.toString(),po.get_TrxName());
log.fine(m_trlTableName + ": ID=" + po.get_IDOld()+ " #"+ no);
return no != 0;
}
|
Delete Translation
|
public CharSequenceFilter addMatchesPattern(String regularExpression,int flags){
mCachedToString=null;
mMatchesPattern.add(Pattern.compile(regularExpression,flags));
return this;
}
|
Adds a regular expression matching rule to the filter.
|
public void runTest() throws Throwable {
Document doc;
Document newDoc;
Element newElem;
Document ownerDocDoc;
Document ownerDocElem;
DOMImplementation domImpl;
DocumentType docType;
String nullNS=null;
doc=(Document)load("staff",false);
domImpl=doc.getImplementation();
docType=domImpl.createDocumentType("mydoc",nullNS,nullNS);
newDoc=domImpl.createDocument("http://www.w3.org/DOM/Test","mydoc",docType);
ownerDocDoc=newDoc.getOwnerDocument();
assertNull("nodegetownerdocument02_1",ownerDocDoc);
newElem=newDoc.createElementNS("http://www.w3.org/DOM/Test","myelem");
ownerDocElem=newElem.getOwnerDocument();
assertNotNull("nodegetownerdocument02_2",ownerDocElem);
}
|
Runs the test case.
|
public static void connectViewsFunctions(final CConnection connection,final int moduleId,final int firstViewId) throws SQLException {
Preconditions.checkNotNull(connection,"IE00453: connection argument can not be null");
final String query=" { call connect_views_to_functions(?,?) } ";
final CallableStatement call=connection.getConnection().prepareCall(query);
call.setInt(1,moduleId);
call.setInt(2,firstViewId);
call.execute();
}
|
Fills the table that connects the views of a module with the functions of a module.
|
private Iterator<CustomerBean> iterator(){
List<CustomerBean> list=getCustomers();
if (list != null) {
return (list.iterator());
}
else {
return (null);
}
}
|
<p>Return an <code>Iterator</code> over the customer list, if any; otherwise return <code>null</code>.</p>
|
public void draw(Canvas c,Rect bounds){
mCirclePaint.setColor(mBackgroundColor);
mCirclePaint.setAlpha(mAlpha);
c.drawCircle(bounds.exactCenterX(),bounds.exactCenterY(),bounds.width() / 2,mCirclePaint);
final RectF arcBounds=mTempBounds;
arcBounds.set(bounds);
arcBounds.inset(mStrokeInset,mStrokeInset);
final float startAngle=(mStartTrim + mRotation) * 360;
final float endAngle=(mEndTrim + mRotation) * 360;
float sweepAngle=endAngle - startAngle;
mArcPaint.setColor(mColors[mColorIndex]);
mArcPaint.setAlpha(mAlpha);
c.drawArc(arcBounds,startAngle,sweepAngle,false,mArcPaint);
drawTriangle(c,startAngle,sweepAngle,bounds);
}
|
Draw the progress spinner
|
public void load(int offset,int width,long value){
for (int x=0; x < width; x++) {
long mask=Long.rotateLeft(1,width - x - 1);
if ((mask & value) == mask) {
set(offset + x);
}
else {
clear(offset + x);
}
}
}
|
Loads the value into the buffer starting at the offset index, and assuming that the value represents (width) number of bits. The MSB of the value will be located at the offset and the LSB of the value will be located at ( offset + width ).
|
public Sin(){
super(Number.class,Number.class);
}
|
Constructs a new node for calculating the trigonometric sine of an angle specified in radians.
|
protected void _writeLn(String s) throws IOException {
_write(s);
if (_prettyPrint) {
_write(LINE_SEPARATOR);
}
}
|
Writes a string followed by a line-separator. The line-separator is not written when pretty-printing is disabled.
|
private static PduPart findSmilPart(PduBody body){
int partNum=body.getPartsNum();
for (int i=0; i < partNum; i++) {
PduPart part=body.getPart(i);
if (Arrays.equals(part.getContentType(),ContentType.APP_SMIL.getBytes())) {
return part;
}
}
return null;
}
|
Find a SMIL part in the MM.
|
public ChildMemoryCircuitBreaker(BreakerSettings settings,ChildMemoryCircuitBreaker oldBreaker,ESLogger logger,HierarchyCircuitBreakerService parent,String name){
this.name=name;
this.settings=settings;
this.memoryBytesLimit=settings.getLimit();
this.overheadConstant=settings.getOverhead();
if (oldBreaker == null) {
this.used=new AtomicLong(0);
this.trippedCount=new AtomicLong(0);
}
else {
this.used=oldBreaker.used;
this.trippedCount=oldBreaker.trippedCount;
}
this.logger=logger;
if (logger.isTraceEnabled()) {
logger.trace("creating ChildCircuitBreaker with settings {}",this.settings);
}
this.parent=parent;
}
|
Create a circuit breaker that will break if the number of estimated bytes grows above the limit. All estimations will be multiplied by the given overheadConstant. Uses the given oldBreaker to initialize the starting offset.
|
public static IEntity createEntity(final RPObject object){
try {
final String type=object.getRPClass().getName();
if (type.equals("player") && object.has("name")) {
if (StendhalClient.get().getCharacter().equalsIgnoreCase(object.get("name"))) {
final User me=new User();
me.initialize(object);
EventDispatcher.dispatchEvents(object,me);
return me;
}
}
String eclass=null;
if (object.has("class")) {
eclass=object.get("class");
}
String subClass=null;
if (object.has("subclass")) {
subClass=object.get("subclass");
}
final Class<? extends IEntity> entityClass=EntityMap.getClass(type,eclass,subClass);
if (entityClass == null) {
return null;
}
final IEntity en=entityClass.newInstance();
en.initialize(object);
if (en instanceof Entity) {
EventDispatcher.dispatchEvents(object,(Entity)en);
}
return en;
}
catch ( final Exception e) {
logger.error("Error creating entity for object: " + object,e);
return null;
}
}
|
Creates an Entity of the correct type depending on the Marauroa object.
|
public final boolean pop(){
return m_values[m_index--];
}
|
Removes the object at the top of this stack and returns that object as the value of this function.
|
public static void init(Context context){
if (cameraManager == null) {
cameraManager=new CameraManager(context);
}
}
|
Initializes this static object with the Context of the calling Activity.
|
public static JBBPParser prepare(final String script){
return JBBPParser.prepare(script,JBBPBitOrder.LSB0);
}
|
Prepare a parser for a script with default bit order (LSB0) use.
|
public boolean save(String path){
boolean success=false;
loadPixels();
try {
OutputStream output=new BufferedOutputStream(parent.createOutput(path),16 * 1024);
String lower=path.toLowerCase();
String extension=lower.substring(lower.lastIndexOf('.') + 1);
if (extension.equals("jpg") || extension.equals("jpeg")) {
Bitmap outgoing=Bitmap.createBitmap(pixels,width,height,Config.ARGB_8888);
success=outgoing.compress(CompressFormat.JPEG,100,output);
}
else if (extension.equals("png")) {
Bitmap outgoing=Bitmap.createBitmap(pixels,width,height,Config.ARGB_8888);
success=outgoing.compress(CompressFormat.PNG,100,output);
}
else if (extension.equals("tga")) {
success=saveTGA(output);
}
else {
if (!extension.equals("tif") && !extension.equals("tiff")) {
path+=".tif";
}
success=saveTIFF(output);
}
output.flush();
output.close();
}
catch ( IOException e) {
e.printStackTrace();
}
if (!success) {
System.err.println("Could not write the image to " + path);
}
return success;
}
|
Save this image to disk. <p> As of revision 0100, this function requires an absolute path, in order to avoid confusion. To save inside the sketch folder, use the function savePath() from PApplet, or use saveFrame() instead. As of revision 0116, savePath() is not needed if this object has been created (as recommended) via createImage() or createGraphics() or one of its neighbors. <p> As of revision 0115, when using Java 1.4 and later, you can write to several formats besides tga and tiff. If Java 1.4 is installed and the extension used is supported (usually png, jpg, jpeg, bmp, and tiff), then those methods will be used to write the image. To get a list of the supported formats for writing, use: <BR> <TT>println(javax.imageio.ImageIO.getReaderFormatNames())</TT> <p> To use the original built-in image writers, use .tga or .tif as the extension, or don't include an extension. When no extension is used, the extension .tif will be added to the file name. <p> The ImageIO API claims to support wbmp files, however they probably require a black and white image. Basic testing produced a zero-length file with no error.
|
@Override public boolean handles(ResultHistoryList history,int index){
return true;
}
|
Checks whether the current item can be handled. Disables/enables the menu item.
|
private ServerSocketChannelIterator(Collection<SelectionKey> selectedKeys){
iterator=selectedKeys.iterator();
}
|
Build a SocketChannel iterator which will return a SocketChannel instead of a SelectionKey.
|
private void buildGetBusinessObjectDataResponse(MockCloseableHttpResponse response,URI uri) throws JAXBException {
Pattern pattern=Pattern.compile("/herd-app/rest/businessObjectData/namespaces/(.*)/businessObjectDefinitionNames/(.*)/businessObjectFormatUsages/(.*)" + "/businessObjectFormatFileTypes/(.*).*");
Matcher matcher=pattern.matcher(uri.getPath());
if (matcher.find()) {
BusinessObjectData businessObjectData=new BusinessObjectData();
businessObjectData.setNamespace(matcher.group(1));
businessObjectData.setBusinessObjectDefinitionName(matcher.group(2));
businessObjectData.setBusinessObjectFormatUsage(matcher.group(3));
businessObjectData.setBusinessObjectFormatFileType(matcher.group(4));
businessObjectData.setPartitionValue("2014-01-31");
businessObjectData.setPartitionKey("PROCESS_DATE");
businessObjectData.setAttributes(new ArrayList<Attribute>());
businessObjectData.setBusinessObjectFormatVersion(0);
businessObjectData.setLatestVersion(true);
businessObjectData.setStatus(BusinessObjectDataStatusEntity.VALID);
List<StorageUnit> storageUnits=new ArrayList<>();
businessObjectData.setStorageUnits(storageUnits);
StorageUnit storageUnit=new StorageUnit();
storageUnits.add(storageUnit);
storageUnit.setStorage(getNewStorage(StorageEntity.MANAGED_STORAGE));
List<StorageFile> storageFiles=new ArrayList<>();
storageUnit.setStorageFiles(storageFiles);
storageUnit.setStorageUnitStatus(StorageUnitStatusEntity.ENABLED);
List<String> localFiles=Arrays.asList("foo1.dat","Foo2.dat","FOO3.DAT","folder/foo3.dat","folder/foo2.dat","folder/foo1.dat");
for ( String filename : localFiles) {
StorageFile storageFile=new StorageFile();
storageFiles.add(storageFile);
storageFile.setFilePath(businessObjectData.getNamespace().toLowerCase().replace('_','-') + "/exchange-a/" + businessObjectData.getBusinessObjectFormatUsage().toLowerCase().replace('_','-')+ "/"+ businessObjectData.getBusinessObjectFormatFileType().toLowerCase().replace('_','-')+ "/"+ businessObjectData.getBusinessObjectDefinitionName().toLowerCase().replace('_','-')+ "/frmt-v"+ businessObjectData.getBusinessObjectFormatVersion()+ "/data-v"+ businessObjectData.getVersion()+ "/"+ businessObjectData.getPartitionKey().toLowerCase().replace('_','-')+ "="+ businessObjectData.getPartitionValue()+ "/"+ filename);
storageFile.setFileSizeBytes(1024L);
storageFile.setRowCount(10L);
}
businessObjectData.setSubPartitionValues(new ArrayList<String>());
businessObjectData.setId(1234);
businessObjectData.setVersion(0);
response.setEntity(getHttpEntity(businessObjectData));
}
}
|
Builds a business object data response.
|
public final int put(Object key,int value,boolean isReplace){
int prime=_prime;
int hash=hashCode(key) % prime;
Object[] keys=_keys;
while (true) {
Object testKey=keys[hash];
if (testKey == null) {
keys[hash]=key;
_values[hash]=value;
_size++;
if (keys.length <= 4 * _size) resize(4 * keys.length);
return NULL;
}
else if (key != testKey) {
hash=(hash + 1) % prime;
continue;
}
else if (isReplace) {
int old=_values[hash];
_values[hash]=value;
return old;
}
else {
return _values[hash];
}
}
}
|
Puts a new value in the property table with the appropriate flags
|
private static boolean isDefaultToPortrait(Context context){
Display currentDisplay=AndroidServices.instance().provideWindowManager().getDefaultDisplay();
Point displaySize=new Point();
currentDisplay.getSize(displaySize);
int orientation=currentDisplay.getRotation();
int naturalWidth, naturalHeight;
if (orientation == Surface.ROTATION_0 || orientation == Surface.ROTATION_180) {
naturalWidth=displaySize.x;
naturalHeight=displaySize.y;
}
else {
naturalWidth=displaySize.y;
naturalHeight=displaySize.x;
}
return naturalWidth < naturalHeight;
}
|
Calculate the default orientation of the device based on the width and height of the display when rotation = 0 (i.e. natural width and height)
|
private void flushStartTag() throws SAXException {
if (startTagInProgress) {
final String tagName=elementStack.get(0);
contentHandler.startElement("",tagName,tagName,attributeList);
attributeList.clear();
startTagInProgress=false;
}
}
|
Fires any pending SAX startElement event towards the configured ContentHandler.
|
public static SemOptimizerRicf serializableInstance(){
return new SemOptimizerRicf();
}
|
Generates a simple exemplar of this class to test serialization.
|
public void requestAllContactsCapabilities() throws RemoteException {
ServerApiUtils.testIms();
mCapabilityService.scheduleCapabilityOperation(new AllCapabilitiesRequester());
}
|
Requests capabilities for all contacts existing in the local address book. This method initiates in background new capability requests for each contact of the address book by sending SIP OPTIONS. The result of a capability request is sent asynchronously via callback method of the capabilities listener. A capability refresh is only sent if the timestamp associated to the capability has expired (the expiration value is fixed via MNO provisioning). The result of the capability refresh request is provided to all the clients that have registered the listener for this event.
|
@LargeTest public void testDownloadToProhibitedDirectory() throws Exception {
File downloadedFile=new File(PROHIBITED_DIRECTORY,DEFAULT_FILENAME);
try {
byte[] blobData=generateData(DEFAULT_FILE_SIZE,DataType.TEXT);
enqueueResponse(buildResponse(HTTP_OK,blobData));
Uri uri=getServerUri(DEFAULT_FILENAME);
Request request=new Request(uri);
Uri localUri=Uri.fromFile(downloadedFile);
request.setDestinationUri(localUri);
try {
mDownloadManager.enqueue(request);
fail("Failed to throw SecurityException when trying to write to /system.");
}
catch ( SecurityException s) {
assertFalse(downloadedFile.exists());
}
}
finally {
downloadedFile.delete();
}
}
|
Tests trying to download a file to the system partition.
|
public CipherParameters generateDerivedParameters(int keySize){
keySize=keySize / 8;
byte[] dKey=generateDerivedKey(keySize);
return new KeyParameter(dKey,0,keySize);
}
|
Generate a key parameter derived from the password, salt, and iteration count we are currently initialised with.
|
public synchronized boolean inInitialPhase(CourseComponent component){
if (component != mainComponent && component != nextComponent && component != prevComponent) return false;
return runnableCourseComponentWeakList.size() > 0;
}
|
specify the cache range for viewpager. we only care about the initial visualization of the viewpagers. for the [prev, main, next] fragment UI/pages. for the viewpagers in this range, also main page is not finish downloading, it will be initial phase. we will apply our loading policy only in initial phase
|
public void testBogusArguments() throws Exception {
IllegalArgumentException expected=expectThrows(IllegalArgumentException.class,null);
assertTrue(expected.getMessage().contains("Unknown parameters"));
}
|
Test that bogus arguments result in exception
|
public void print(Object o){
println(o,false);
}
|
Description of the Method
|
public void clearContent(){
modelMap.clear();
filteredModelMap.clear();
filterNameString="";
filterNameStringLowerCase="";
}
|
Clears all model content.
|
private Map parseObject(JsonLexer lexer){
Map content=new HashMap();
JsonToken previousToken=null;
JsonToken currentToken=null;
for (; ; ) {
currentToken=lexer.nextToken();
if (currentToken == null) {
throw new JsonException("Expected a String key on line: " + lexer.getReader().getLine() + ", "+ "column: "+ lexer.getReader().getColumn()+ ".\n"+ "But got an unterminated object.");
}
if (currentToken.getType() == CLOSE_CURLY) {
return content;
}
else if (currentToken.getType() != STRING) {
throw new JsonException("Expected " + STRING.getLabel() + " key "+ "on line: "+ currentToken.getStartLine()+ ", "+ "column: "+ currentToken.getStartColumn()+ ".\n"+ "But got '"+ currentToken.getText()+ "' instead.");
}
String mapKey=(String)currentToken.getValue();
currentToken=lexer.nextToken();
if (currentToken == null) {
throw new JsonException("Expected a " + COLON.getLabel() + " "+ "on line: "+ lexer.getReader().getLine()+ ", "+ "column: "+ lexer.getReader().getColumn()+ ".\n"+ "But got an unterminated object.");
}
if (currentToken.getType() != COLON) {
throw new JsonException("Expected " + COLON.getLabel() + " "+ "on line: "+ currentToken.getStartLine()+ ", "+ "column: "+ currentToken.getStartColumn()+ ".\n"+ "But got '"+ currentToken.getText()+ "' instead.");
}
currentToken=lexer.nextToken();
if (currentToken == null) {
throw new JsonException("Expected a value " + "on line: " + lexer.getReader().getLine() + ", "+ "column: "+ lexer.getReader().getColumn()+ ".\n"+ "But got an unterminated object.");
}
if (currentToken.getType() == OPEN_CURLY) {
content.put(mapKey,parseObject(lexer));
}
else if (currentToken.getType() == OPEN_BRACKET) {
content.put(mapKey,parseArray(lexer));
}
else if (currentToken.getType().ordinal() >= NULL.ordinal()) {
content.put(mapKey,currentToken.getValue());
}
else {
throw new JsonException("Expected a value, an array, or an object " + "on line: " + currentToken.getStartLine() + ", "+ "column: "+ currentToken.getStartColumn()+ ".\n"+ "But got '"+ currentToken.getText()+ "' instead.");
}
previousToken=currentToken;
currentToken=lexer.nextToken();
if (currentToken == null) {
throw new JsonException("Expected " + CLOSE_CURLY.getLabel() + " or "+ COMMA.getLabel()+ " "+ "on line: "+ previousToken.getEndLine()+ ", "+ "column: "+ previousToken.getEndColumn()+ ".\n"+ "But got an unterminated object.");
}
if (currentToken.getType() == CLOSE_CURLY) {
break;
}
else if (currentToken.getType() != COMMA) {
throw new JsonException("Expected a value or " + CLOSE_CURLY.getLabel() + " "+ "on line: "+ currentToken.getStartLine()+ ", "+ "column: "+ currentToken.getStartColumn()+ ".\n"+ "But got '"+ currentToken.getText()+ "' instead.");
}
}
return content;
}
|
Parses an object from the lexer
|
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:49.364 -0500",hash_original_method="2A27A75937E4BE02DA5FD7B031C4079A",hash_generated_method="23BC72FFEAC2A16A0D3A8E2F49EBED8E") public void reset(){
contexts=new Context[32];
namespaceDeclUris=false;
contextPos=0;
contexts[contextPos]=currentContext=new Context();
currentContext.declarePrefix("xml",XMLNS);
}
|
Reset this Namespace support object for reuse. <p>It is necessary to invoke this method before reusing the Namespace support object for a new session. If namespace declaration URIs are to be supported, that flag must also be set to a non-default value. </p>
|
public void stopJumping(){
for ( JumpingBeansSpan bean : jumpingBeans) {
if (bean != null) {
bean.teardown();
}
}
TextView tv=textView.get();
if (tv != null) {
CharSequence text=tv.getText();
if (text instanceof Spanned) {
CharSequence cleanText=removeJumpingBeansSpans((Spanned)text);
tv.setText(cleanText);
}
}
}
|
Stops the jumping animation and frees up the animations.
|
public ChampionCursor(Cursor cursor){
super(cursor);
}
|
Creates a cursor wrapper.
|
@Override public void onCreate(){
super.onCreate();
this.binder=new IPushMessageImpl();
}
|
Called by the system when the service is first created. Do not call this method directly.
|
private int indexOfWordPrefix(final CharSequence text,final char[] prefix){
if (TextUtils.isEmpty(text) || prefix == null) {
return -1;
}
final int mTextLength=text.length();
final int mPrefixLength=prefix.length;
if (mPrefixLength == 0 || mTextLength < mPrefixLength) {
return -1;
}
int i=0;
while (i < mTextLength) {
while (i < mTextLength && !Character.isLetterOrDigit(text.charAt(i))) {
i++;
}
if (i + mPrefixLength > mTextLength) {
return -1;
}
int j;
for (j=0; j < mPrefixLength; j++) {
if (Character.toUpperCase(text.charAt(i + j)) != prefix[j]) {
break;
}
}
if (j == mPrefixLength) {
return i;
}
while (i < mTextLength && Character.isLetterOrDigit(text.charAt(i))) {
i++;
}
}
return -1;
}
|
Finds the index of the first word that starts with the given prefix. If not found, returns -1.
|
public void selectParameters(List<Parameter> params){
for ( PartitionPattern partitionData : options.getPartitionPattern()) {
getParameter(partitionData.getName() + "." + MicrosatelliteSamplerTreeModelParser.TREE_MICROSATELLITE_SAMPLER_MODEL+ ".internalNodesParameter");
}
}
|
return a list of parameters that are required
|
public UnusedParameterException(String message){
super(message);
}
|
Thrown by OptionHandler in case of request of an unused parameter.
|
protected AbstractMRMessage pollMessage(){
if (commandOptionSet == false) {
if (log.isDebugEnabled()) {
log.debug("Command options are not valid yet!!");
}
return null;
}
NceMessage m=pollEprom.nceEpromPoll();
if (m != null) {
expectReplyEprom=true;
return m;
}
else {
expectReplyEprom=false;
}
if (pollAiuStatus == null) {
pollAiuStatus=new NceAIUChecker(this);
return pollAiuStatus.nceAiuPoll();
}
if (pollHandler == null) {
pollHandler=new NceTurnoutMonitor(this);
}
mWaitBeforePoll=NceTurnoutMonitor.POLL_TIME;
return pollHandler.pollMessage();
}
|
Check NCE EPROM and start NCE CS accessory memory poll
|
public WriteMetadataNodeToLocalIndexThread(Segment segment,Collection<URIMetadataNode> storeDocs){
super("WriteMetadataNodeToLocalIndexThread");
this.segment=segment;
this.storeDocs=storeDocs;
}
|
Parameters must be not null.
|
public boolean isTuesday(){
return tuesday;
}
|
Gets the value of the tuesday property.
|
public CucumberITGenerator create(final ParallelScheme parallelScheme) throws MojoExecutionException {
if (ParallelScheme.FEATURE.equals(parallelScheme)) {
return createFileGeneratorByFeature();
}
else {
return createFileGeneratorByScenario();
}
}
|
Create a CucumberITGenerator based on the given parallel scheme.
|
public BERSequence(ASN1Encodable obj){
super(obj);
}
|
create a sequence containing one object
|
public static List<SectionItemInterface> mappingAllVideoResponseModelFrom(CourseComponent courseComponent,Filter<VideoResponseModel> filter){
List<SectionItemInterface> items=new ArrayList<>();
for ( HasDownloadEntry item : courseComponent.getVideos()) {
VideoResponseModel model=mappingVideoResponseModelFrom((VideoBlockModel)item);
if (filter == null) items.add(model);
else {
if (filter.apply(model)) {
items.add(model);
}
}
}
return items;
}
|
we map the new course outline data to old data model. TODO : Ideally we should update all the code to match the new data model.
|
private static byte[] decode_base64(String s,int maxolen) throws IllegalArgumentException {
StringBuffer rs=new StringBuffer();
int off=0, slen=s.length(), olen=0;
byte ret[];
byte c1, c2, c3, c4, o;
if (maxolen <= 0) {
throw new IllegalArgumentException("Invalid maxolen");
}
while (off < slen - 1 && olen < maxolen) {
c1=char64(s.charAt(off++));
c2=char64(s.charAt(off++));
if (c1 == -1 || c2 == -1) {
break;
}
o=(byte)(c1 << 2);
o|=(c2 & 0x30) >> 4;
rs.append((char)o);
if (++olen >= maxolen || off >= slen) {
break;
}
c3=char64(s.charAt(off++));
if (c3 == -1) {
break;
}
o=(byte)((c2 & 0x0f) << 4);
o|=(c3 & 0x3c) >> 2;
rs.append((char)o);
if (++olen >= maxolen || off >= slen) {
break;
}
c4=char64(s.charAt(off++));
o=(byte)((c3 & 0x03) << 6);
o|=c4;
rs.append((char)o);
++olen;
}
ret=new byte[olen];
for (off=0; off < olen; off++) {
ret[off]=(byte)rs.charAt(off);
}
return ret;
}
|
Decode a string encoded using bcrypt's base64 scheme to a byte array. Note that this is *not* compatible with the standard MIME-base64 encoding.
|
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:02:43.842 -0500",hash_original_method="9DC9991C60DD393D44750907790C62ED",hash_generated_method="7F2F12718C23E6FE2A0FD5257882B9EA") protected void tearDown() throws Exception {
}
|
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.