code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public HarvestProcess urlExists(final String hash) throws IOException {
LoadTimeURL md=this.index.fulltext().getDefaultConnector().getLoadTimeURL(hash);
if (md != null && md.date >= 0) return HarvestProcess.LOADED;
HarvestProcess hp=this.crawlQueues.exists(ASCII.getBytes(hash));
if (hp != null) return hp;
... | tests if hash occurs in any database. |
public DiskBasedCache(File rootDirectory,int maxCacheSizeInBytes){
mRootDirectory=rootDirectory;
mMaxCacheSizeInBytes=maxCacheSizeInBytes;
}
| Constructs an instance of the DiskBasedCache at the specified directory. |
public Object unwrap(Class iface) throws SQLException {
return iface;
}
| Place holder for abstract method java.lang Object unwrap(java.lang.Class) in java.sql.Wrapper required by jdk 1.6 |
@NonNull public DividerAdapterBuilder leadingView(@NonNull ViewFactory viewFactory){
mLeadingItem=new Item(viewFactory,false);
return this;
}
| Sets the divider that appears before the wrapped adapters items. |
private void updateInfo(){
connectAddress=brokerAddressValue.getText();
willTopic=willTopicValue.getText();
willMessage=willMessageValue.getText();
clientId=clientIdValue.getText();
willQos=Integer.parseInt(willQosDrop.getText());
willRetain=willRetainCheckBox.getSelection();
username=usernameValue.getTex... | Updates the connection information |
public FilterServletOutputStream(final OutputStream stream){
this.stream=stream;
}
| Creates a FilterServletOutputStream. |
MenuItemImpl(MenuBuilder menu,int group,int id,int categoryOrder,int ordering,CharSequence title,int showAsAction){
mMenu=menu;
mId=id;
mGroup=group;
mCategoryOrder=categoryOrder;
mOrdering=ordering;
mTitle=title;
mShowAsAction=showAsAction;
}
| Instantiates this menu item. |
public static Message decodeMessage(byte[] data) throws IOException {
JavaType type=Mapper.getTypeFactory().constructParametricType(Message.class,JsonNode.class,JsonNode.class);
Message<JsonNode,JsonNode> m=Mapper.readValue(data,type);
switch (m.fixedHeader().messageType()) {
case CONNECT:
MqttConnectVariableHe... | Decode bytes (json data) to Message |
public static final LocoNetMessage createSetUr92GroupNamePacket(String sGroupName) throws jmri.jmrix.loconet.LocoNetException {
int gr_msb1=0;
int gr_msb2=0;
int i;
if (validateGroupName(sGroupName) == false) {
throw new jmri.jmrix.loconet.LocoNetException("Invalid Duplex Group Name - must be exactly 8 char... | Create a LocoNet packet to set the Duplex group name. <p> Throws an exception if s provides a 0-length group name string. If s is too short, it is padded with spaces at the end of the string. <p> |
private void removePhisThatDominateAllDefs(BitVector needsPhi,IR ir,BitVector defs){
for (int i=0; i < needsPhi.length(); i++) {
if (!needsPhi.get(i)) {
continue;
}
if (ir.HIRInfo.dominatorTree.dominates(i,defs)) {
needsPhi.clear(i);
}
}
}
| If node N dominates all defs of a register r, then N does not need a phi function for r; this function removes such nodes N from a Bit Set. |
public void addAttribute(AttributedCharacterIterator.Attribute attribute,Object value,int start,int end){
if (attribute == null) {
throw new NullPointerException("attribute == null");
}
if (start < 0 || end > text.length() || start >= end) {
throw new IllegalArgumentException();
}
if (value == null) {... | Applies a given attribute to the given range of this string. |
public MarkdownDialog(Dialog owner,ModalityType modality){
super(owner,modality);
}
| Creates a dialog with the specified owner Dialog and modality. |
private String toLoggableString(){
String string=canceled ? "canceled call" : "call";
HttpUrl redactedUrl=originalRequest.url().resolve("/...");
return string + " to " + redactedUrl;
}
| Returns a string that describes this call. Doesn't include a full URL as that might contain sensitive information. |
public static String toString(InputStream input,Charset encoding) throws IOException {
StringBuilderWriter sw=new StringBuilderWriter();
copy(input,sw,encoding);
return sw.toString();
}
| Get the contents of an <code>InputStream</code> as a String using the specified character encoding. <p> This method buffers the input internally, so there is no need to use a <code>BufferedInputStream</code>. </p> |
public static String format(final List<? extends NameValuePair> parameters,final String charset){
final StringBuilder result=new StringBuilder();
for ( final NameValuePair parameter : parameters) {
final String encodedName=encodeFormFields(parameter.getName(),charset);
final String encodedValue=encodeFormF... | Returns a String that is suitable for use as an <code>application/x-www-form-urlencoded</code> list of parameters in an HTTP PUT or HTTP POST. |
public boolean greaterThanOrEqualTo(final IntegerMap<T> map){
for ( final T key : map.keySet()) {
if (!(this.getInt(key) >= map.getInt(key))) {
return false;
}
}
return true;
}
| By >= we mean that each of our entries is greater than or equal to each entry in the other map. We do not take into account entries that are in our map but not in the second map. <br> It is possible that for two maps a and b a.greaterThanOrEqualTo(b) is false, and b.greaterThanOrEqualTo(a) is false, and that a and b ar... |
private void removeSubtitleCallBack(){
if (subtitleDisplayHandler != null) {
subtitleDisplayHandler.removeCallbacks(subtitleProcessesor);
subtitleDisplayHandler=null;
hideClosedCaptioning();
srt=null;
srtList=null;
}
if (subtitleFetchHandler != null) {
subtitleFetchHandler.removeCallbacks(... | This removes the callbacks and resets the handlers |
public static void sendErrorResponse(HttpServletResponse response,QName faultCode,String faultString,String faultActor,String faultDetail) throws IOException {
String soapMessageXml=SoapFault.createFaultXml(faultCode,faultString,faultActor,faultDetail);
String encoding=MimeUtils.UTF8;
byte[] messageBytes=soapMess... | Sends SOAP fault message to the other party. |
public static int calcUTF16toUTF8Length(final CharSequence s,final int offset,final int len){
final int end=offset + len;
int res=0;
for (int i=offset; i < end; i++) {
final int code=(int)s.charAt(i);
if (code < 0x80) res++;
else if (code < 0x800) {
res+=2;
}
else if (code < 0xD800... | Calculates the number of UTF8 bytes necessary to write a UTF16 string. |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:57:40.164 -0500",hash_original_method="E4A046EBA329CB34ADB8348C19056859",hash_generated_method="BA8A5F1F03DB979CE61190FBA9296E46") public static void sort(Object[] array){
C... | Sorts the specified array in ascending natural order. |
private void selectQuery(){
final SelectQueryItemDialog queryDefinitionDialog=new SelectQueryItemDialog(getShell(),server,workItemClient.getProjects().getProjects(),selectedQueryDefinition,QueryItemType.QUERY_DEFINITION);
if (queryDefinitionDialog.open() == IDialogConstants.OK_ID) {
selectedQueryDefinition=(Que... | The select query button was clicked by the user. |
@Override public boolean canBeRefined(){
if ((literals[literals.length - 1].getIndex() == allLiterals.length - 1)) {
return false;
}
else {
return true;
}
}
| Returns true only if this hypothesis can still be refined. |
@Override public Optional<ThrowingConsumer<Context>> selectOther(final RequestMessage requestMessage) throws OpProcessorException {
if (requestMessage.getOp().equals(Tokens.OPS_CLOSE)) {
if (!requestMessage.optionalArgs(Tokens.ARGS_SESSION).isPresent()) {
final String msg=String.format("A message with an [%... | Session based requests accept a "close" operator in addition to "eval". A close will trigger the session to be killed and any uncommitted transaction to be rolled-back. |
@Override public synchronized void disconnectionNotification(String eventName,Object source){
super.disconnectionNotification(eventName,source);
if (m_listenee == null) {
m_dataProvider=false;
m_trainingProvider=false;
m_testProvider=false;
}
}
| Notify this object that it has been deregistered as a listener with a source with respect to the supplied event name |
protected static void succeed(){
System.exit(0);
}
| Exit with a process success code. |
@Override public void onWebsocketPong(WebSocket conn,Framedata f){
}
| This default implementation does not do anything. Go ahead and overwrite it. |
public T put(String name,T plugin){
if (plugin == null) return null;
PluginHolder<T> old=put(name,new PluginHolder<T>(null,plugin));
return old == null ? null : old.get();
}
| register a plugin by a name |
public void addPropertyChangeListener(PropertyChangeListener listener){
List<PropertyChangeListener> l=Arrays.asList(listenerList.getListeners(PropertyChangeListener.class));
if (!l.contains(listener)) {
listenerList.add(PropertyChangeListener.class,listener);
}
}
| Add a listener for this Pane's property change events |
public OptionSet addETag(byte[] etag){
if (etag == null) throw new IllegalArgumentException("ETag option must not be null");
getETags().add(etag);
return this;
}
| Adds an ETag to the ETag options. Returns the current OptionSet object for a fluent API. |
public void removeFoundTextArea(final int[] rectArea,final int page){
if (rectArea == null || areas == null) {
return;
}
final Integer p=page;
final int[][] localAreas=this.areas.get(p);
if (localAreas != null) {
final int size=localAreas.length;
for (int i=0; i < size; i++) {
if (localAreas... | remove zone on page for text localAreas if present |
private void populateDiffs(TaskRepository repository,List<DiffEntry> diffs,TaskData taskData){
int diffCount=1;
for ( DiffEntry diffEntry : diffs) {
TaskAttribute diffAttribute=taskData.getRoot().createAttribute(AppraiseReviewTaskSchema.PREFIX_DIFF + diffCount);
diffAttribute.getMetaData().setType(Appraise... | Fills the diffs into the given task data. |
public String toString(){
StringBuffer buffer=new StringBuffer();
buffer.append("AcsAccessTokenGroups[");
for (int i=0; i < m_al.size(); i++) {
buffer.append(" [group").append(i + 1);
buffer.append(" = ").append((m_al.get(i)).toString());
buffer.append("] ").append(m_al);
}
buffer.append("]");
r... | toString methode: creates a String representation of the object |
public static synchronized void register(PurchaseObserver observer){
sPurchaseObserver=observer;
}
| Registers an observer that updates the UI. |
public boolean shouldBuild(){
if (hasBuildChanges) {
if (operationCanceled) return Policy.buildOnCancel;
return true;
}
return false;
}
| This method can only be safely called from inside a workspace operation. Should NOT be called from outside a prepareOperation/endOperation block. |
public boolean equalWithoutMorpheme(DecompoundedWord aOtherSplit){
return toStringWithoutMorpheme().equals(aOtherSplit.toStringWithoutMorpheme());
}
| Similar to the equals method, but combines morpheme and word |
private static TeamInfo randomTeam(ArrayList<TeamInfo> list){
int index=random.nextInt(list.size());
TeamInfo team=list.get(index);
long currTime=System.currentTimeMillis();
if ((team.getEndTimeInMillis() < currTime) || team.numMembers() == 0) {
System.out.println("\nteam " + team + " is too old; replacing.... | Get and return a random team. If the selected team is too old w.r.t its expiration, remove it, replacing it with a new team. |
@LargeTest public void testVideoLessThanAudio() throws Exception {
final String videoItemFileName1=INPUT_FILE_PATH + "MPEG4_SP_720x480_30fps_280kbps_AACLC_48kHz_96kbps_s_0_21.mp4";
final String audioTrackFilename=INPUT_FILE_PATH + "AACLC_48KHz_256Kbps_s_1_17.3gp";
final int renderingMode=MediaItem.RENDERING_MODE_... | To add Audio Track Greater than MediaItem Duration |
public final int numObjectsAtLocation(final Object location){
final Bag b=(Bag)(objectHash.get(location));
if (b == null) return 0;
assert sim.util.LocationLog.it(this,location);
return b.numObjs;
}
| Returns the number of objects at a given location. |
@Override public void eUnset(int featureID){
switch (featureID) {
case TypesPackage.TYPE_CONSTRAINT__VALUE:
setValue(VALUE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public ObjectPermissionModel(){
}
| Creates a new, empty object permission. |
public static Future<JDialog> inspect(Tree t,List<String> ruleNames){
TreeViewer viewer=new TreeViewer(ruleNames,t);
return viewer.open();
}
| Call this method to view a parse tree in a dialog box visually. |
public static InputDocument parse(String fileName,LangDescriptor language) throws Exception {
String content=load(fileName,language.indentSize);
return parse(fileName,content,language);
}
| Parse doc and fill tree and tokens fields |
public void addTexture(ATexture texture) throws TextureException {
if (mTextureList.indexOf(texture) > -1) return;
if (mTextureList.size() + 1 > mMaxTextures) {
throw new TextureException("Maximum number of textures for this material has been reached. Maximum number of textures is " + mMaxTextures + ".");
}... | Adds a texture to this material. Throws and error if the maximum number of textures was reached. |
public PlatformException(String msg,@Nullable Throwable cause){
super(msg,cause);
}
| Creates new exception with given error message and optional nested exception. |
private void handleDoubleClickEvent(final Event event){
for (int i=0; i < this.items.size(); i++) {
final LauncherItem item=this.items.get(i);
if (item.label != null && item.label.equals(event.widget)) {
if (this.selection != i) {
changeColor(this.selection,false);
this.selection=i;
... | Code executed when one double-clicks on a button |
public boolean isNumericKeyActions(){
return numericKeyActions;
}
| Indicate whether pressing the number keys should trigger an action |
public void addGeoJSONGeometryToLayer(GeoJSONObject object,RenderableLayer layer){
if (object == null) {
String message=Logging.getMessage("nullValue.ObjectIsNull");
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
if (layer == null) {
String message=Logging.getMess... | Create a layer from a GeoJSON document. |
@Override public void onFocusChange(View v,boolean hasFocus){
if (hasFocus) {
this.setClearDrawableVisible(this.getText().length() > 0);
}
else {
this.setClearDrawableVisible(false);
}
if (this.mOnFocusChangeListener != null) {
this.mOnFocusChangeListener.onFocusChange(v,hasFocus);
}
}
| Called when the focus state of a view has changed. |
private void processCompletionStagePublishAndComplete(Operation op){
if (hasOption(ServiceOption.INSTRUMENTATION)) {
updatePerOperationStats(op);
}
if (op.getAction() == Action.GET && !isIndexed()) {
op.linkState(null);
getHost().run(null);
return;
}
publish(op);
if (op.isFromReplication() &... | Final stage of operation completion processing. Notifications will be published and client will receive operation response |
private void executeQuery(){
log.info("");
int AD_Client_ID=Env.getAD_Client_ID(Env.getCtx());
String sql="";
KeyNamePair docTypeKNPair=(KeyNamePair)cmbDocType.getSelectedItem();
if (docTypeKNPair.getKey() == MRMA.Table_ID) {
sql=getRMASql();
}
else {
sql=getOrderSQL();
}
log.fine(sql);
int r... | Query Info |
public QueryDebuggerEventSettingsReply(final int packetId,final int errorCode){
super(packetId,errorCode);
}
| Creates a new instance of a Debugger Event Settings query. |
public VPlexStorageViewInfo addVirtualVolumesToStorageView(String viewName,String clusterName,Map<String,Integer> virtualVolumeMap) throws VPlexApiException {
s_logger.info("Request to add virtual volumes to storage view on VPlex at {}",_baseURI);
return _exportMgr.addVirtualVolumesToStorageView(viewName,clusterNam... | Adds the virtual volumes with the passed names to the storage view with the passed name. |
public boolean insert(long element){
if (size < maxSize) {
add(element);
return false;
}
else if (element > heap[1]) {
heap[1]=element;
updateTop();
return true;
}
else {
return false;
}
}
| inserts the element and returns true if this element caused another element to be dropped from the queue. |
public static boolean isImageType(String mime){
return mime.toLowerCase(Locale.getDefault()).startsWith("image/");
}
| Checks if mime type is an image type |
@Override public void preProcess(ResultProducer rp) throws Exception {
super.preProcess(rp);
if (m_ResultListener == null) {
throw new Exception("No ResultListener set");
}
m_ResultListener.preProcess(this);
}
| Prepare for the results to be received. |
public Adapter createEObjectAdapter(){
return null;
}
| Creates a new adapter for the default case. <!-- begin-user-doc --> This default implementation returns null. <!-- end-user-doc --> |
public boolean isExcluded(String fileName,List<File> excludedSources){
if (excludedSources == null) {
return false;
}
for ( File excludedDir : excludedSources) {
String normalizedFileName=DelphiUtils.normalizeFileName(fileName.toLowerCase());
String excludedDirNormalizedPath=DelphiUtils.normalizeFile... | Is file in excluded list? |
public static List<GTSWrapper> chunk(GTSDecoder decoder,long clipfrom,long clipto,long tsboundary,long chunkwidth,String chunklabel,String fileprefix,long maxsize,long maxgts,float lwmratio) throws WarpScriptException, IOException {
Map<Long,GTSEncoder> encoders=new LinkedHashMap<Long,GTSEncoder>();
if (decoder.get... | Split a GTSDecoder into multiple GTSWrapper instances, spilling on disk if necessary. The input GTSDecoder will be clipped to ['clipfrom','clipto']. The output GTSWrapper will be bucketized with each a single bucket of 'chunkwidth' span. All buckets within ['clipfrom','clipto'] will have a resulting GTSWrapper. Chunk e... |
public DTMAxisIterator reset(){
_sp=_oldsp;
return resetPosition();
}
| Resets the iterator to the last start node. |
public static int bitsPerElement(long minimum,long maximum){
int bits;
if (1 + maximum - minimum > 0) {
bits=(int)Math.round(Math.ceil(cern.jet.math.Arithmetic.log(2,1 + maximum - minimum)));
}
else {
bits=64;
}
return bits;
}
| Returns the number of bits necessary to store values in the range <tt>[minimum,maximum]</tt>. |
public static double millisecondPerYear(){
return 3.15569E10;
}
| Method millisecondPerYear |
private void updateCellHeights(){
if (textArea != null) {
cellHeight=textArea.getLineHeight();
ascent=textArea.getMaxAscent();
}
else {
cellHeight=20;
ascent=5;
}
repaint();
}
| Changes the height of the cells in the JList so that they are as tall as font. This function should be called whenever the user changes the Font of <code>textArea</code>. |
public DateTime toDateTime(LocalTime time){
return toDateTime(time,null);
}
| Converts this object to a DateTime using a LocalTime to fill in the missing fields and using the default time zone. <p> The resulting chronology is determined by the chronology of this LocalDate. The chronology of the time must match. If the time is null, the current time in the date's chronology is used. <p> This meth... |
private String titleOf(SearchResultMediator rp){
int total=rp.totalResults();
String title=rp.getTitle();
if (title.length() > 40) {
title=title.substring(0,39) + "...";
}
return title + " (" + total+ " "+ I18n.tr("results")+ ")";
}
| Returns the title of the specified ResultPanel. |
private static int unsignedKeyChange(String uname,String server){
ClientUser user=users.get(uname);
if (!user.isAllowsUnsignedChanges()) {
System.out.println("user " + uname + " doesn't allow unsigned key changes");
return ConsistencyErr.DISALLOWED_OP_ERR;
}
String newKeyData=user.getKeyData() + changeC... | Performs an unsigned key change by generating a new key pair for the user, and sends the new key to the server. Fails if the user requires signed key changes. |
public static void main(String[] args) throws Exception {
if (args.length != 1) {
System.out.println("Usage: java Exercise_12_12 file");
System.exit(1);
}
File file=new File(args[0]);
if (!file.exists()) {
System.out.println("File " + args[0] + " does not exist");
System.exit(2);
}
ArrayList... | Main method |
private void checkConfidentiality(AuthenticationPlugin plugin) throws SQLException {
if (plugin.requiresConfidentiality() && !isSSLEstablished()) {
throw SQLError.createSQLException(Messages.getString("Connection.AuthenticationPluginRequiresSSL",new Object[]{plugin.getProtocolPluginName()}),getExceptionIntercepto... | Check if given plugin requires confidentiality, but connection is without SSL |
public DExportPrivateKeyPkcs8(JFrame parent,String entryAlias,PasswordQualityConfig passwordQualityConfig){
super(parent,Dialog.ModalityType.DOCUMENT_MODAL);
this.entryAlias=entryAlias;
this.passwordQualityConfig=passwordQualityConfig;
initComponents();
}
| Creates a new DExportPrivateKeyPkcs8 dialog. |
protected void finalize() throws Throwable {
try {
if (this.key != null) {
java.util.Arrays.fill(this.key,(byte)0x00);
this.key=null;
}
}
finally {
super.finalize();
}
}
| Ensures that the bytes of this key are set to zero when there are no more references to it. |
private static <T>int gallopRight(T key,T[] a,int base,int len,int hint,Comparator<? super T> c){
assert len > 0 && hint >= 0 && hint < len;
int ofs=1;
int lastOfs=0;
if (c.compare(key,a[base + hint]) < 0) {
int maxOfs=hint + 1;
while (ofs < maxOfs && c.compare(key,a[base + hint - ofs]) < 0) {
las... | Like gallopLeft, except that if the range contains an element equal to key, gallopRight returns the index after the rightmost equal element. |
public int hashCode(){
return m_hashCode;
}
| Return the cached hashcode of the qualified name. |
public void firePropertyChange(PropertyChangeEvent event){
String propertyName=event.getPropertyName();
Object oldValue=event.getOldValue();
Object newValue=event.getNewValue();
if (newValue != null && oldValue != null && newValue.equals(oldValue)) {
return;
}
notifyEachListener: for ( PropertyChange... | Publishes a property change event to all listeners of that property. If the event's old and new values are equal (but non-null), no event will be published. |
public void halve(){
for (int i=0; i < coeffs.length; i++) {
coeffs[i]=coeffs[i].multiply(ONE_HALF);
}
}
| Divides all coefficients by 2. |
public static List<Person> loadPersonData(Properties props) throws Exception {
String pathname=props.getProperty("persondata.path");
List<Person> persons=new ArrayList<>();
Path path=new File(pathname).toPath();
try (BufferedReader br=Files.newBufferedReader(path)){
int lineno=0;
String line;
while ... | Load the person data from the path specified by the "persondata.path" property. |
private void blockCopyLinesDown(int srcInternal,int len){
if (len == 0) return;
int totalRows=mTotalRows;
int start=len - 1;
TerminalRow lineToBeOverWritten=mLines[(srcInternal + start + 1) % totalRows];
for (int i=start; i >= 0; --i) mLines[(srcInternal + i + 1) % totalRows]=mLines[(srcInternal + i) % to... | Block copy lines and associated metadata from one location to another in the circular buffer, taking wraparound into account. |
private static CalendarEntry createSubscription(CalendarService service) throws IOException, ServiceException {
System.out.println("Subscribing to the Google Doodles calendar");
CalendarEntry calendar=new CalendarEntry();
calendar.setId(DOODLES_CALENDAR_ID);
return service.insert(allcalendarsFeedUrl,calendar);
... | Subscribes to the public Google Doodles calendar using the allcalendars feed. |
public String toString(){
return String.valueOf(get());
}
| Returns the String representation of the current value. |
@Deprecated @SuppressWarnings("UnusedDeclaration") public static void authenticate(AuthCallback callback,String phoneNumber){
final DigitsAuthConfig.Builder digitsAuthConfigBuilder=new DigitsAuthConfig.Builder().withAuthCallBack(callback).withThemeResId(ThemeUtils.DEFAULT_THEME).withPhoneNumber(phoneNumber);
authen... | Starts the authentication flow with the provided phone number. |
@Override public String serialize(final boolean includingBuiltIn){
final StringBuilder sb=new StringBuilder(populationSets.size() * 10);
sb.append('[');
for (int i=0; i < populationSets.size(); i++) {
if (i != 0) {
sb.append(',');
}
sb.append(StringUtils.toGaml(populationSets.get(i),includingBui... | Method toGaml() |
boolean put(boolean isRoot,Vector names,Object value){
return put(isRoot,names,names.size(),value);
}
| Adds a single path (isRoot, names) and a mode to be used for this path = context. |
private void startReturn(){
insideReturn=true;
}
| Wird jedesmal wenn das Tag return beginnt aufgerufen, um intern in einen anderen Zustand zu gelangen. |
@Override public void checkConsistency(){
super.checkConsistency();
boolean hasOpeningAndClosingTime=false;
boolean hasOpeningTimeAndLatePenalty=false;
for ( ActivityParams actType : this.getActivityParams()) {
if (actType.isScoringThisActivityAtAll()) {
if ((actType.getOpeningTime() != Time.UNDEFINE... | Checks whether all the settings make sense or if there are some problems with the parameters currently set. Currently, this checks that for at least one activity type opening AND closing times are defined. |
public ExecutorDelivery(Executor executor){
mResponsePoster=executor;
}
| Creates a new response delivery interface, mockable version for testing. |
@Override public void drawRight(){
drawFrame(backgroundFrameRight);
drawPhotoCube(texCubeRight);
drawReticle(.1f);
drawTextGraphics(textImage);
}
| Draw right eye. Called when VRMode enabled. |
@Override protected int callSpeak(String text,float volume,int utteranceId){
Bundle params=new Bundle();
if (volume != 1.0) {
params.putFloat(TextToSpeech.Engine.KEY_PARAM_VOLUME,volume);
}
return mTextToSpeech.speak(text,TextToSpeech.QUEUE_FLUSH,params,Integer.toString(utteranceId));
}
| Overrides TtsPlatformImpl because the API changed in Lollipop. |
public static float computeDiscardScale(float amount,float range,boolean fromClick){
if (Math.abs(amount) < 1.0f) return 1.0f;
float t=amount / range;
float endScale=fromClick ? DISCARD_END_SCALE_CLICK : DISCARD_END_SCALE_SWIPE;
return MathUtils.interpolate(1.0f,endScale,Math.abs(t));
}
| Computes the scale of the tab based on its discard status. |
public final int yylength(){
return zzMarkedPos - zzStartRead;
}
| Returns the length of the matched text region. |
public static void dataChanged(Context context,long throttleMs){
SharedPreferences prefs=Utilities.getPrefs(context);
long now=System.currentTimeMillis();
long lastTime=prefs.getLong(KEY_LAST_NOTIFIED_TIME,0);
if (now < lastTime || now >= (lastTime + throttleMs)) {
BackupManager.dataChanged(context.getPacka... | Notify the backup manager that out database is dirty. <P>This does not force an immediate backup. |
public static int charAt(String source,int offset16){
char single=source.charAt(offset16);
if (single < LEAD_SURROGATE_MIN_VALUE) {
return single;
}
return _charAt(source,offset16,single);
}
| Extract a single UTF-32 value from a string. Used when iterating forwards or backwards (with <code>UTF16.getCharCount()</code>, as well as random access. If a validity check is required, use <code><a href="../lang/UCharacter.html#isLegal(char)"> UCharacter.isLegal()</a></code> on the return value. If the char retrieved... |
private void processOnline(){
log.config("");
if (!checkMandatory()) return;
boolean approved=false;
String info="";
ValueNamePair vp=(ValueNamePair)paymentCombo.getSelectedItem();
String PaymentRule=vp.getValue();
if (PaymentRule.equals(X_C_Order.PAYMENTRULE_CreditCard)) {
vp=(ValueNamePair)kTypeCo... | Process Online (sales only) - if approved - exit |
private BigInteger oddModPow(BigInteger y,BigInteger z){
if (y.equals(ONE)) return this;
if (signum == 0) return ZERO;
int[] base=mag.clone();
int[] exp=y.mag;
int[] mod=z.mag;
int modLen=mod.length;
if ((modLen & 1) != 0) {
int[] x=new int[modLen + 1];
System.arraycopy(mod,0,x,1,modLen);
... | Returns a BigInteger whose value is x to the power of y mod z. Assumes: z is odd && x < z. |
public XRTreeFrag(int root,XPathContext xctxt,ExpressionNode parent){
super(null);
exprSetParent(parent);
initDTM(root,xctxt);
}
| Create an XRTreeFrag Object. |
BinarySearchTreeNode<E> remove(BinarySearchTreeNode<E> node,E comparable){
while (node != null) {
int diff=comparable.compareTo(node.comparable);
if (diff < 0) {
node=node.left;
}
else if (diff > 0) {
node=node.right;
}
else {
if (node.comparable.equals(comparable)) {
t... | Returns the node removed if the comparable is found, null otherwise. |
public CommunicationException(){
super();
}
| Creates a new instance of CommunicationException. |
public static double scalb(final double d,final int n){
if ((n > -1023) && (n < 1024)) {
return d * Double.longBitsToDouble(((long)(n + 1023)) << 52);
}
if (Double.isNaN(d) || Double.isInfinite(d) || (d == 0)) {
return d;
}
if (n < -2098) {
return (d > 0) ? 0.0 : -0.0;
}
if (n > 2097) {
re... | Multiply a double number by a power of 2. |
@Override public Enumeration<Option> listOptions(){
Vector<Option> newVector=new Vector<Option>(8);
newVector.addElement(new Option("\tSet confidence threshold for pruning.\n" + "\t(default 0.25)","C",1,"-C <pruning confidence>"));
newVector.addElement(new Option("\tSet minimum number of objects per leaf.\n" + "\... | Returns an enumeration describing the available options. Valid options are: <p> -C confidence <br> Set confidence threshold for pruning. (Default: 0.25) <p> -M number <br> Set minimum number of instances per leaf. (Default: 2) <p> -R <br> Use reduced error pruning. <p> -N number <br> Set number of folds for reduced err... |
public void testFilterSubscriber_passesPatientsToActivity(){
mController.loadSearchResults();
TypedCursorFetchedEvent event=TypedCursorFetchedEventFactory.createEvent(Patient.class,getFakeAppPatientCursor());
mFakeCrudEventBus.post(event);
verify(mMockUi).setPatients(any(TypedCursor.class));
}
| Tests that patients are passed to the activity UI after retrieval. |
protected boolean beforeSave(boolean newRecord){
if (newRecord || is_ValueChanged("Keyword")) setKeyword(getKeyword());
if (getKeyword().equals("?")) {
log.saveError("FillMandatory",Msg.getElement(getCtx(),"Keyword"));
return false;
}
return true;
}
| Before Save |
@Override public void addKarma(final double karmaToAdd){
this.karma+=karmaToAdd;
put("karma",this.karma);
new GameEvent(this.getName(),"added karma",Integer.toString((int)karmaToAdd),Integer.toString((int)karma)).raise();
}
| Give the player some karma (good or bad). |
@Override public void configure(final HttpSecurity http) throws Exception {
http.sessionManagement().sessionCreationPolicy(NEVER).and().formLogin().disable().logout().disable().authorizeRequests().antMatchers(HttpMethod.OPTIONS).permitAll().antMatchers("/").access("#oauth2.hasUidScopeAndAnyRealm('/employees', '/servi... | Configure scopes for specific controller/httpmethods/roles here. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.