content stringlengths 40 137k |
|---|
"private MelSpectrum process(Spectrum input) throws IllegalArgumentException {\n MelSpectrum outputMelSpectrum;\n getTimer().start();\n double[] in = input.getSpectrumData();\n if (in.length != (NPoint >> 1)) {\n throw new IllegalArgumentException(\"String_Node_Str\" + in.length + \"String_Node_Str\" + NPoint);\n }\n double[] outputMelFilterbank = new double[numberFilters];\n for (int i = 0; i < numberFilters; i++) {\n outputMelFilterbank[i] = filter[i].filterOutput(in);\n }\n getTimer().stop();\n if (getDump()) {\n System.out.println(Util.dumpDoubleArray(outputMelFilterbank, \"String_Node_Str\", 12, 5));\n }\n outputMelSpectrum = new MelSpectrum(outputMelFilterbank);\n return outputMelSpectrum;\n}\n"
|
"protected boolean updateConnectionPreferences(VizConnection<T> connection, String preferences) {\n boolean requiresReset = false;\n String[] split = preferences.split(getDelimiter(), -1);\n try {\n String host = split[0];\n int port = Integer.parseInt(split[1]);\n String path = split[2];\n requiresReset |= connection.setHost(host);\n requiresReset |= connection.setPort(port);\n requiresReset |= connection.setPath(path);\n } catch (IndexOutOfBoundsException | NullPointerException | NumberFormatException e) {\n requiresReset = false;\n }\n return requiresReset;\n}\n"
|
"protected Byte convertObjectToByte(Object sourceObject) throws ConversionException {\n if (sourceObject instanceof String && ((String) sourceObject).length() > 0 && ((String) sourceObject).charAt(0) == PLUS) {\n return super.convertObjectToByte(((String) sourceObject).substring(1));\n }\n return super.convertObjectToByte(sourceObject);\n}\n"
|
"public static void easy(ImageFloat32 image) {\n DetectDescribePoint<ImageFloat32, SurfFeature> surf = FactoryDetectDescribe.surfStable(new ConfigFastHessian(0, 2, 200, 2, 9, 4, 4), null, null, ImageFloat32.class);\n surf.detect(image);\n System.out.println(\"String_Node_Str\" + surf.getNumberOfFeatures());\n System.out.println(\"String_Node_Str\" + surf.getDescription(0).value[0]);\n}\n"
|
"public void addNetworkEvent(Event event) {\n long delayedTime = event.getTime() + network.generateDelay();\n event.setTime(delayedTime);\n queue.add(event);\n}\n"
|
"public void load(CompoundTag tag) {\n String id = ((StringTag) tag.getTag(\"String_Node_Str\")).getValue();\n LongTag uuidMost = tag.getTagAs(\"String_Node_Str\");\n LongTag uuidLeast = tag.getTagAs(\"String_Node_Str\");\n List<NBTTag> pos = ((ListTag) tag.getTagAs(\"String_Node_Str\")).listTags();\n List<NBTTag> motion = ((ListTag) tag.getTagAs(\"String_Node_Str\")).listTags();\n List<NBTTag> rotation = ((ListTag) tag.getTagAs(\"String_Node_Str\")).listTags();\n FloatTag fallDistance = tag.getTagAs(\"String_Node_Str\");\n ShortTag fireTicks = tag.getTagAs(\"String_Node_Str\");\n ShortTag airTicks = tag.getTagAs(\"String_Node_Str\");\n ByteTag onGround = tag.getTagAs(\"String_Node_Str\");\n ByteTag invulnerable = tag.getTagAs(\"String_Node_Str\");\n IntTag dimension = tag.getTagAs(\"String_Node_Str\");\n IntTag portalCooldown = tag.getTagAs(\"String_Node_Str\");\n StringTag displayName = (tag.containsTag(\"String_Node_Str\")) ? (StringTag) tag.getTag(\"String_Node_Str\") : new StringTag(\"String_Node_Str\").setValue(\"String_Node_Str\");\n ByteTag dnVisible = (tag.containsTag(\"String_Node_Str\")) ? (ByteTag) tag.getTag(\"String_Node_Str\") : new ByteTag(\"String_Node_Str\").setValue((byte) 0);\n ByteTag silent = (tag.containsTag(\"String_Node_Str\")) ? (ByteTag) tag.getTag(\"String_Node_Str\") : new ByteTag(\"String_Node_Str\").setValue((byte) 0);\n NBTTag riding = tag.getTagAs(\"String_Node_Str\");\n NBTTag commandStats = tag.getTagAs(\"String_Node_Str\");\n this.id = counter.incrementAndGet();\n loc = Coordinates.create(TridentServer.WORLD, 0, 0, 0);\n velocity = new Vector(0, 0, 0);\n this.uniqueId = new UUID(uuidMost.getValue(), uuidLeast.getValue());\n double[] location = new double[3];\n for (int i = 0; i < 3; i += 1) {\n NBTTag t = pos.get(i);\n if (t instanceof DoubleTag) {\n location[i] = ((DoubleTag) t).getValue();\n } else {\n location[i] = ((IntTag) t).getValue();\n }\n }\n loc.setX(location[0]);\n loc.setY(location[1]);\n loc.setZ(location[2]);\n double[] velocity = new double[3];\n for (int i = 0; i < 3; i += 1) {\n NBTTag t = motion.get(i);\n if (t instanceof DoubleTag) {\n velocity[i] = ((DoubleTag) t).getValue();\n } else {\n velocity[i] = ((IntTag) t).getValue();\n }\n }\n this.velocity.setX(velocity[0]);\n this.velocity.setY(velocity[1]);\n this.velocity.setZ(velocity[2]);\n if (rotation.get(0) instanceof IntTag) {\n loc.setYaw(((IntTag) rotation.get(0)).getValue());\n } else {\n loc.setYaw(((FloatTag) rotation.get(0)).getValue());\n }\n if (rotation.get(1) instanceof IntTag) {\n loc.setPitch(((IntTag) rotation.get(1)).getValue());\n } else {\n loc.setPitch(((FloatTag) rotation.get(1)).getValue());\n }\n this.fallDistance.set((long) fallDistance.getValue());\n this.fireTicks.set(fireTicks.getValue());\n this.airTicks.set(airTicks.getValue());\n this.portalCooldown.set(portalCooldown.getValue());\n this.onGround = onGround.getValue() == 1;\n this.godMode = invulnerable.getValue() == 1;\n this.nameVisible = dnVisible.getValue() == 1;\n this.silent = silent.getValue() == 1;\n this.displayName = displayName.getValue();\n}\n"
|
"public String execute() throws Exception {\n if (bUOC.getUserInformation() != null) {\n listSubjects = bUOC.getUserSubjects();\n if (s_assign != null && s_assign.length() > 0) {\n String[] infoAssing = s_assign.split(\"String_Node_Str\");\n teacher = bUOC.isTeacher(new UOCSubject(infoAssing[0], infoAssing[2]));\n listClassroms = bUOC.getUserClassrooms(new UOCSubject(infoAssing[0], infoAssing[2]));\n }\n if (s_aula != null && s_aula.length() > 0 && s_assign != null) {\n String[] infoAssing = s_assign.split(\"String_Node_Str\");\n listActivity = bUOC.getSubjectActivities(new UOCSubject(infoAssing[0], infoAssing[2]));\n }\n imageURL = bUOC.getUserInformation().getUserPhoto();\n if (imageURL == null)\n imageURL = \"String_Node_Str\";\n fullName = bUOC.getUserInformation().getUserFullName();\n } else {\n imageURL = null;\n fullName = null;\n }\n this.fileupload();\n this.crearDeliverFile();\n this.listFile();\n return SUCCESS;\n}\n"
|
"public void setValue(IValue value) {\n Name name = Name.getQualified(\"String_Node_Str\" + resultIndex);\n this.getClassName();\n MarkerList markers = new MarkerList();\n value.resolveTypes(markers, this);\n value = value.resolve(markers, this);\n IType type = value.getType();\n IValue value1 = value.withType(type, type, markers, this);\n if (value1 == null) {\n } else {\n value = value1;\n type = value1.getType();\n }\n value.checkTypes(markers, this);\n value.check(markers, this);\n if (this.reportErrors(markers)) {\n this.cleanup();\n return;\n }\n REPLVariable field = new REPLVariable(CODE_POSITION, name, type, value);\n field.modifiers = Modifiers.FINAL;\n if (this.computeVariable(field)) {\n if (field.getType() != Types.VOID) {\n this.variables.put(field.name, field);\n System.out.println(field.toString());\n resultIndex++;\n }\n }\n}\n"
|
"protected void printImages(Set<? extends Image> images, String indent, PrintStream out) {\n out.println(String.format(IMAGEFORMAT, indent, \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\"));\n for (Image image : images) {\n String id = image.getId();\n String location = image.getLocation() != null ? image.getLocation().getId() : \"String_Node_Str\";\n String description = image.getDescription();\n out.println(String.format(IMAGEFORMAT, indent, id, location, description));\n cacheProvider.getProviderCacheForType(Constants.IMAGE_CACHE).put(image.getProviderId(), image.getId());\n }\n}\n"
|
"private void inferXsdFromDataModule(String xmlFile) {\n WSDataModel wsObject = (WSDataModel) (getXObject().getWsObject());\n XSDDriver d = new XSDDriver();\n if (d.outputXSD_UTF_8(wsObject.getXsdSchema(), xmlFile) != null) {\n MessageDialog.openInformation(getSite().getShell(), \"String_Node_Str\", \"String_Node_Str\");\n } else {\n MessageDialog.openError(getSite().getShell(), \"String_Node_Str\", \"String_Node_Str\");\n }\n}\n"
|
"public double epsilon(double[][] a, double[][] b) throws JMetalException {\n int i, j, k;\n double eps, epsJ = 0.0, epsK = 0.0, epsTemp;\n this.numberOfObjectives = front[0].length;\n setParams();\n if (method == 0) {\n eps = Double.MIN_VALUE;\n } else {\n eps = 0;\n }\n for (i = 0; i < a.length; i++) {\n for (j = 0; j < b.length; j++) {\n for (k = 0; k < this.numberOfObjectives; k++) {\n switch(method) {\n case 0:\n if (obj[k] == 0) {\n epsTemp = b[j][k] - a[i][k];\n } else {\n epsTemp = a[i][k] - b[j][k];\n }\n break;\n default:\n if ((a[i][k] < 0 && b[j][k] > 0) || (a[i][k] > 0 && b[j][k] < 0) || (a[i][k] == 0 || b[j][k] == 0)) {\n throw new JMetalException(\"String_Node_Str\");\n }\n if (obj[k] == 0) {\n epsTemp = b[j][k] / a[i][k];\n } else {\n epsTemp = a[i][k] / b[j][k];\n }\n break;\n }\n if (k == 0) {\n epsK = epsTemp;\n } else if (epsK < epsTemp) {\n epsK = epsTemp;\n }\n }\n if (j == 0) {\n epsJ = epsK;\n } else if (epsJ > epsK) {\n epsJ = epsK;\n }\n }\n if (i == 0) {\n eps = epsJ;\n } else if (eps < epsJ) {\n eps = epsJ;\n }\n }\n return eps;\n}\n"
|
"public <T> CLBuffer<?> createInputBufferFor(CLContext context, PList<T> list) {\n char[] ar = ((CharList) list).getArray();\n CharBuffer ibuffer = CharBuffer.wrap(ar, 0, list.size());\n return context.createCharBuffer(CLMem.Usage.Input, ibuffer, true);\n}\n"
|
"private void genBaseMetadata() {\n FHIRResource Resource = fact.fhir_class(\"String_Node_Str\");\n FHIRResource Element = fact.fhir_class(\"String_Node_Str\");\n FHIRResource Reference = fact.fhir_class(\"String_Node_Str\");\n fact.fhir_class(\"String_Node_Str\").addTitle(\"String_Node_Str\").addDefinition(\"String_Node_Str\").restriction(fact.fhir_restriction(value, RDFS.Literal));\n FHIRResource treeRoot = fact.fhir_class(\"String_Node_Str\").addTitle(\"String_Node_Str\");\n FHIRResource nodeRole = fact.fhir_objectProperty(\"String_Node_Str\").addTitle(\"String_Node_Str\").domain(Resource).range(treeRoot.resource);\n Resource.restriction(fact.fhir_cardinality_restriction(nodeRole.resource, treeRoot.resource, 0, 1));\n FHIRResource index = fact.fhir_dataProperty(\"String_Node_Str\").addTitle(\"String_Node_Str\").domain(Element).range(XSD.nonNegativeInteger);\n Element.restriction(fact.fhir_cardinality_restriction(index.resource, XSD.nonNegativeInteger, 0, 1));\n FHIRResource link = fact.fhir_objectProperty(\"String_Node_Str\").addTitle(\"String_Node_Str\");\n Reference.restriction(fact.fhir_cardinality_restriction(link.resource, Resource.resource, 0, 1));\n fact.fhir_class(\"String_Node_Str\", RDFNamespace.RDFXMLLiteral);\n}\n"
|
"public void action() {\n if (Formulae.getOre(def, owner.getCurStat(14), axeID)) {\n if (DataConversions.random(0, 200) == 0) {\n InvItem gem = new InvItem(Formulae.getGem(), 1);\n owner.incExp(14, 100, true);\n owner.getInventory().add(gem);\n owner.getActionSender().sendMessage(\"String_Node_Str\");\n } else {\n owner.getInventory().add(ore);\n owner.getActionSender().sendMessage(\"String_Node_Str\" + ore.getDef().getName() + \"String_Node_Str\");\n owner.setSkillLoops(0);\n owner.incExp(14, def.getExp(), true);\n owner.getActionSender().sendStat(14);\n world.registerGameObject(new GameObject(object.getLocation(), 98, object.getDirection(), object.getType()));\n world.delayedSpawnObject(newobject.getLoc(), def.getRespawnTime() * 1000);\n }\n owner.getActionSender().sendInventory();\n } else {\n boolean retry = false;\n if (retrytime - swings > 0)\n retry = true;\n owner.getActionSender().sendMessage(\"String_Node_Str\");\n if (retry) {\n world.getDelayedEventHandler().add(new SingleEvent(owner, 500) {\n public void action() {\n owner.setSkillLoops(swings + 1);\n handleMining(object, owner, owner.getClick());\n }\n });\n }\n if (!retry) {\n owner.isMining(false);\n owner.setSkillLoops(0);\n }\n }\n owner.setBusy(false);\n}\n"
|
"public void setDefaultValue(String defaultValue) {\n if (defaultValue == null) {\n this.defaultValue = StringConstants.EMPTY_STRING;\n } else {\n this.defaultValue = defaultValue;\n }\n validate();\n}\n"
|
"public static SpannableStringBuilder format(CharSequence text) {\n SpannableStringBuilder b = new SpannableStringBuilder(text);\n Matcher m = BOLD_PATTERN.matcher(text);\n for (int deleted = 0; m.find(); ) {\n int s = m.start() - deleted;\n int e = m.end() - deleted;\n String value = m.group(1);\n builder.replace(s, e, value);\n deleted += 4;\n StyleSpan span = new StyleSpan(Typeface.BOLD);\n builder.setSpan(span, s, s + value.length(), 0);\n }\n m.usePattern(STRIKE_THROUGH_PATTERN);\n for (int deleted = 0; m.find(); ) {\n int s = m.start() - deleted;\n int e = m.end() - deleted;\n String value = m.group(1);\n builder.replace(s, e, value);\n deleted += 4;\n StrikethroughSpan span = new StrikethroughSpan();\n builder.setSpan(span, s, s + value.length(), 0);\n }\n m.usePattern(ESCAPED_PATTERN);\n m.reset(builder);\n for (int deleted = 0; m.find(); ) {\n int s = m.start() - deleted;\n int e = m.end() - deleted;\n String value = m.group(1);\n if (\"String_Node_Str\".equals(value)) {\n builder.replace(s, e, \"String_Node_Str\");\n deleted += 4;\n } else if (\"String_Node_Str\".equals(value)) {\n builder.replace(s, e, \"String_Node_Str\");\n deleted += 3;\n } else if (\"String_Node_Str\".equals(value)) {\n builder.replace(s, e, \"String_Node_Str\");\n deleted += 3;\n }\n }\n m.usePattern(NAMED_LINK_PATTERN);\n m.reset(builder);\n for (int deleted = 0; m.find(); ) {\n int s = m.start() - deleted;\n int e = m.end() - deleted;\n String name = m.group(1);\n String url = m.group(2);\n builder.replace(s, e, name);\n deleted += 4 + url.length();\n if (url.startsWith(\"String_Node_Str\")) {\n url = \"String_Node_Str\" + url;\n } else if (!url.startsWith(\"String_Node_Str\") && !url.startsWith(\"String_Node_Str\")) {\n url = \"String_Node_Str\" + url;\n }\n URLSpan span = new URLSpan(url);\n builder.setSpan(span, s, s + name.length(), 0);\n }\n m.usePattern(RAW_LINK_PATTERN);\n m.reset(builder);\n while (m.find()) {\n URLSpan span = new URLSpan(m.group());\n builder.setSpan(span, m.start(), m.end(), 0);\n }\n return builder;\n}\n"
|
"protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.preference);\n prefs = getPreferenceScreen().getSharedPreferences();\n updateX2oolsPrefs();\n}\n"
|
"public int comparePlayers(IPlayer p1, IPlayer p2) {\n Plugin p = plugin.getProxy().getPluginManager().getPlugin(\"String_Node_Str\");\n if (p != null) {\n BungeePerms bp = BungeePerms.getInstance();\n try {\n User u1 = bp.getPermissionsManager().getUser(p1.getName());\n User u2 = bp.getPermissionsManager().getUser(p2.getName());\n if (u1 != null && u2 != null) {\n Group g1 = bp.getPermissionsManager().getMainGroup(u1);\n Group g2 = bp.getPermissionsManager().getMainGroup(u2);\n if (g1 != null && g2 != null) {\n int r1 = g1.getRank();\n int r2 = g2.getRank();\n if (r1 > r2) {\n return -1;\n }\n if (r2 > r1) {\n return 1;\n }\n return 0;\n }\n }\n if (r2 > r1) {\n return 1;\n }\n return 0;\n } catch (Throwable th) {\n BungeeTabListPlus.getInstance().reportError(th);\n }\n }\n if (p1 instanceof BungeePlayer && p2 instanceof BungeePlayer) {\n int i = 0;\n for (String group : ((BungeePlayer) p1).getPlayer().getGroups()) {\n if (!group.equals(\"String_Node_Str\")) {\n i = 1;\n }\n }\n int j = 0;\n for (String group : ((BungeePlayer) p2).getPlayer().getGroups()) {\n if (!group.equals(\"String_Node_Str\")) {\n j = 1;\n }\n }\n if (i > j) {\n return -1;\n }\n if (j > i) {\n return 1;\n }\n }\n return 0;\n}\n"
|
"private String decideForm(String wordForm, int idx) {\n String cleanWord = cs.normalize.clean(wordForm);\n if (!cs.knownWords.contains(cleanWord)) {\n String unkWord = cs.sig.getSignature(cleanWord, idx, cs.prm.language);\n unkWord = cs.normalize.escape(unkWord);\n if (!cs.knownUnks.contains(unkWord)) {\n unkWord = \"String_Node_Str\";\n return unkWord;\n }\n }\n return cleanWord;\n}\n"
|
"private static List<TdView> loadViews(Connection dataProvider, Catalog catalog, Schema schema, String viewPattern) throws Exception {\n List<TdView> views = new ArrayList<TdView>();\n TypedReturnCode<java.sql.Connection> rcConn = MetadataConnectionUtils.checkConnection((DatabaseConnection) dataProvider);\n if (!rcConn.isOk()) {\n log.error(rcConn.getMessage());\n throw new Exception(rcConn.getMessage());\n }\n java.sql.Connection connection = rcConn.getObject();\n DatabaseConnection databaseConnection = (DatabaseConnection) dataProvider;\n DatabaseMetaData dm = ExtractMetaDataUtils.getDatabaseMetaData(connection, databaseConnection, false);\n try {\n if (schema != null) {\n if (PackageHelper.getViews(schema).size() == 0) {\n views = MetadataFillFactory.getDBInstance().fillViews(schema, dm, null, viewPattern, VIEW_TYPES);\n } else {\n MetadataFillFactory.getDBInstance().setLinked(false);\n views = MetadataFillFactory.getDBInstance().fillViews(schema, dm, null, viewPattern);\n MetadataFillFactory.getDBInstance().setLinked(true);\n }\n } else {\n if (PackageHelper.getViews(catalog).size() == 0) {\n views = MetadataFillFactory.getDBInstance().fillViews(catalog, dm, null, viewPattern);\n } else {\n MetadataFillFactory.getDBInstance().setLinked(false);\n views = MetadataFillFactory.getDBInstance().fillViews(catalog, dm, null, viewPattern);\n MetadataFillFactory.getDBInstance().setLinked(true);\n }\n }\n } finally {\n ConnectionUtils.closeConnection(connection);\n }\n return views;\n}\n"
|
"private void setupContent() {\n getDetailsContent();\n setupContentUpdater();\n setupCommentsChangeListener();\n}\n"
|
"private NSArray<UIGestureRecognizer> createGestureRecognizers() {\n UIGestureRecognizerDelegate gestureRecognizerDelegate = new UIGestureRecognizerDelegateAdapter() {\n public boolean shouldRecognizeSimultaneously(UIGestureRecognizer gestureRecognizer, UIGestureRecognizer otherGestureRecognizer) {\n if (gestureRecognizer.getView() != firstPieceView && gestureRecognizer.getView() != secondPieceView && gestureRecognizer.getView() != thirdPieceView) {\n return false;\n }\n if (gestureRecognizer.getView() != otherGestureRecognizer.getView()) {\n return false;\n }\n if (gestureRecognizer instanceof UILongPressGestureRecognizer || otherGestureRecognizer instanceof UILongPressGestureRecognizer) {\n return false;\n }\n return true;\n }\n };\n UIRotationGestureRecognizer rotationGestureRecognizer = new UIRotationGestureRecognizer(new UIGestureRecognizer.GestureListener() {\n public void handleGesture(UIGestureRecognizer gestureRecognizer) {\n rotatePiece((UIRotationGestureRecognizer) gestureRecognizer);\n }\n });\n UIPinchGestureRecognizer pinchGestureRecognizer = new UIPinchGestureRecognizer(new UIGestureRecognizer.GestureListener() {\n public void handleGesture(UIGestureRecognizer gestureRecognizer) {\n scalePiece((UIPinchGestureRecognizer) gestureRecognizer);\n }\n });\n UIPanGestureRecognizer panGestureRecognizer = new UIPanGestureRecognizer(new UIGestureRecognizer.GestureListener() {\n public void handleGesture(UIGestureRecognizer gestureRecognizer) {\n panPiece((UIPanGestureRecognizer) gestureRecognizer);\n }\n });\n UILongPressGestureRecognizer longPressGestureRecognizer = new UILongPressGestureRecognizer(new UIGestureRecognizer.OnGestureListener() {\n\n public void handleGesture(UIGestureRecognizer gestureRecognizer) {\n showResetMenu((UILongPressGestureRecognizer) gestureRecognizer);\n }\n });\n NSArray<UIGestureRecognizer> gestureRecognizers = new NSArray<>(rotationGestureRecognizer, pinchGestureRecognizer, panGestureRecognizer, longPressGestureRecognizer);\n for (UIGestureRecognizer gestureRecognizer : gestureRecognizers) {\n gestureRecognizer.setDelegate(gestureRecognizerDelegate);\n }\n return gestureRecognizers;\n}\n"
|
"public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n JmsConsumerInfo other = (JmsConsumerInfo) obj;\n if (consumerId != null) {\n return consumerId.equals(other.consumerId);\n }\n return true;\n}\n"
|
"private HitEnum buildPostingsHitEnum() throws IOException {\n return PostingsHitEnum.fromPostings(context.hitContext.reader(), context.hitContext.docId(), context.mapper.fieldType().name(), weigher.acceptableTerms(), getQueryWeigher(), getCorpusWeigher(false), weigher);\n}\n"
|
"protected void deleteTempFiles() {\n final Storage storage = getConfig().storage();\n if (storage.dbDir() == null) {\n return;\n }\n if (!storage.isTmpDir()) {\n return;\n }\n if (!forceDelete(storage.dbDir())) {\n LOGGER.warn(\"String_Node_Str\", storage.dbDir());\n }\n}\n"
|
"public void testGetClientSize() {\n Window.enableScrolling(false);\n final int oldClientHeight = Window.getClientHeight();\n final int oldClientWidth = Window.getClientWidth();\n assertTrue(oldClientHeight > 0);\n assertTrue(oldClientWidth > 0);\n Window.enableScrolling(true);\n Label largeDOM = new Label();\n largeDOM.setPixelSize(oldClientWidth + 100, oldClientHeight + 100);\n RootPanel.get().add(largeDOM);\n int newClientHeight = Window.getClientHeight();\n int newClientWidth = Window.getClientWidth();\n assertTrue(newClientHeight < oldClientHeight);\n assertTrue(newClientWidth < oldClientWidth);\n largeDOM.setPixelSize(oldClientWidth + 500, oldClientHeight + 500);\n int finalClientHeight = Window.getClientHeight();\n int finalClientWidth = Window.getClientWidth();\n assertEquals(newClientHeight, finalClientHeight);\n assertEquals(newClientWidth, finalClientWidth);\n}\n"
|
"public ExecutionResult execute(Item item) {\n if (item instanceof DatabaseConnectionItem) {\n Connection connection = ((DatabaseConnectionItem) item).getConnection();\n if (connection instanceof DatabaseConnection) {\n DatabaseConnection dbConn = (DatabaseConnection) connection;\n try {\n if (!dbConn.isContextMode()) {\n String pass = dbConn.getPassword();\n String rawPass = null;\n try {\n rawPass = PasswordEncryptUtil.decryptPassword(pass);\n } catch (Exception e) {\n rawPass = ConnectionHelper.getDecryptPassword(pass);\n }\n dbConn.setRawPassword(rawPass);\n factory.save(item, true);\n return ExecutionResult.SUCCESS_NO_ALERT;\n }\n } catch (Exception e) {\n ExceptionHandler.process(e);\n return ExecutionResult.FAILURE;\n }\n }\n }\n return ExecutionResult.NOTHING_TO_DO;\n}\n"
|
"private IDimension populateDimension(CubeMaterializer cubeMaterializer, DimensionHandle dim, TabularCubeHandle cubeHandle, Map appContext, Map<ReportElementHandle, QueryDefinition> queryMap, Map<ReportElementHandle, List<ColumnMeta>> metaMap, SecurityListener sl) throws AdapterException {\n List hiers = dim.getContents(DimensionHandle.HIERARCHIES_PROP);\n List iHiers = new ArrayList();\n for (int j = 0; j < hiers.size(); j++) {\n TabularHierarchyHandle hierhandle = (TabularHierarchyHandle) hiers.get(0);\n List levels = hierhandle.getContents(TabularHierarchyHandle.LEVELS_PROP);\n List<ILevelDefn> levelInHier = new ArrayList<ILevelDefn>();\n List<String> leafLevelKeyColumn = new ArrayList<String>();\n Set<String> columnNamesForLevels = new HashSet<String>();\n for (int k = 0; k < levels.size(); k++) {\n TabularLevelHandle level = (TabularLevelHandle) levels.get(k);\n columnNamesForLevels.add(level.getColumnName());\n List levelAttrs = new ArrayList();\n Iterator it = level.attributesIterator();\n while (it.hasNext()) {\n LevelAttributeHandle levelAttr = (LevelAttributeHandle) it.next();\n levelAttrs.add(OlapExpressionUtil.getAttributeColumnName(level.getName(), levelAttr.getName()));\n }\n if (DesignChoiceConstants.LEVEL_TYPE_DYNAMIC.equals(level.getLevelType()) && level.getDisplayColumnName() != null) {\n levelAttrs.add(OlapExpressionUtil.getDisplayColumnName(level.getName()));\n }\n leafLevelKeyColumn.add(level.getName());\n levelInHier.add(CubeElementFactory.createLevelDefinition(level.getName(), new String[] { level.getName() }, this.toStringArray(levelAttrs)));\n }\n String[] jointHierarchyKeys = getJointHierarchyKeys(cubeHandle, hierhandle);\n if (!cubeHandle.autoPrimaryKey()) {\n for (String jointKey : jointHierarchyKeys) {\n if (!columnNamesForLevels.contains(jointKey)) {\n throw new AdapterException(ResourceConstants.CUBE_JOINT_COLUMN_NOT_IN_LEVELS, new String[] { jointKey, dim.getName() });\n }\n }\n }\n if (levelInHier.size() >= 1) {\n if (cubeHandle.autoPrimaryKey() && jointHierarchyKeys.length > 0) {\n if (!Arrays.deepEquals(jointHierarchyKeys, new String[] { ((TabularLevelHandle) levels.get(levels.size() - 1)).getColumnName() })) {\n levelInHier.add(CubeElementFactory.createLevelDefinition(\"String_Node_Str\", getDummyLevelNamesForJointHierarchyKeys(jointHierarchyKeys), new String[0]));\n } else if (levelInHier.size() > 1 && isDateTimeDimension(hierhandle)) {\n levelInHier.add(CubeElementFactory.createLevelDefinition(\"String_Node_Str\", leafLevelKeyColumn.toArray(new String[0]), new String[0]));\n }\n } else if (levelInHier.size() > 1) {\n levelInHier.add(CubeElementFactory.createLevelDefinition(\"String_Node_Str\", leafLevelKeyColumn.toArray(new String[0]), new String[0]));\n }\n }\n try {\n sl.process(dim);\n Object originalMemCache = null;\n if (!(cubeHandle.getDataSet().equals(hierhandle.getDataSet()) || hierhandle.getDataSet() == null)) {\n originalMemCache = appContext.remove(DataEngine.MEMORY_DATA_SET_CACHE);\n }\n IDatasetIterator valueIt = null;\n String[] timeType = getTimeLevelType(hierhandle);\n for (int i = 0; i < timeType.length; i++) {\n levelInHier.get(i).setTimeType(timeType[i]);\n }\n if (!CubeHandleUtil.isTimeDimension(dim)) {\n valueIt = new DataSetIterator(this, cubeQueryMap.get(hierhandle), cubeMetaMap.get(hierhandle), appContext, sl, dim.getName());\n } else {\n valueIt = new TimeDimensionDatasetIterator(this, CubeHandleUtil.getStartTime(dim), CubeHandleUtil.getEndTime(dim), getFieldName(hierhandle), timeType);\n }\n iHiers.add(cubeMaterializer.createHierarchy(dim.getName(), hierhandle.getName(), valueIt, levelInHier.toArray(new ILevelDefn[0]), dataEngine.getSession().getStopSign()));\n if (originalMemCache != null) {\n appContext.put(DataEngine.MEMORY_DATA_SET_CACHE, originalMemCache);\n }\n } catch (Exception e) {\n throw new AdapterException(ResourceConstants.CUBE_HIERARCHY_CREATION_ERROR, e, dim.getName() + \"String_Node_Str\" + hierhandle.getName());\n }\n }\n try {\n return cubeMaterializer.createDimension(dim.getName(), (IHierarchy) iHiers.get(0));\n } catch (Exception e) {\n throw new AdapterException(ResourceConstants.CUBE_DIMENSION_CREATION_ERROR, e, dim.getName());\n }\n}\n"
|
"public Report getReportIR(ReportDesignHandle designHandle) {\n try {\n stream = archive.getStream(DESIGN_IR_STREAM);\n EngineIRReader reader = new EngineIRReader();\n Report reportIR = reader.read(stream);\n reportIR.setVersion(getVersion());\n reader.link(reportIR, designHandle);\n return reportIR;\n } catch (IOException ioex) {\n logger.log(Level.FINE, \"String_Node_Str\", ioex);\n }\n return null;\n}\n"
|
"public void onLoaderReset(Loader<List<POIManager>> loader) {\n if (this.adapter != null) {\n this.adapter.clear();\n this.adapter.onPause();\n }\n}\n"
|
"private void ifStatement(Context context, SwiftAST tree) throws UserException {\n LogHelper.trace(context, \"String_Node_Str\");\n If ifStmt = If.fromAST(context, tree);\n Var conditionVar = exprWalker.eval(context, ifStmt.getCondition(), ifStmt.getCondType(context), false, null);\n assert (conditionVar != null);\n List<Var> usedVariables = new ArrayList<Var>();\n List<Var> keepOpenVars = new ArrayList<Var>();\n VariableUsageInfo thenVU = ifStmt.getThenBlock().checkedGetVariableUsage();\n List<VariableUsageInfo> branchVUs;\n if (ifStmt.hasElse()) {\n VariableUsageInfo elseVU = ifStmt.getElseBlock().checkedGetVariableUsage();\n branchVUs = Arrays.asList(thenVU, elseVU);\n } else {\n branchVUs = Arrays.asList(thenVU);\n }\n checkConditionalDeadlock(context, conditionVar, branchVUs);\n summariseBranchVariableUsage(context, branchVUs, usedVariables, keepOpenVars);\n if (!usedVariables.contains(conditionVar))\n usedVariables.add(conditionVar);\n FunctionContext fc = context.getFunctionContext();\n backend.startWaitStatement(fc.constructName(\"String_Node_Str\"), Arrays.asList(conditionVar), usedVariables, keepOpenVars, null, WaitMode.DATA_ONLY, false, TaskMode.LOCAL_CONTROL);\n Context waitContext = new LocalContext(context);\n Var condVal = varCreator.fetchValueOf(waitContext, conditionVar);\n backend.startIfStatement(Arg.createVar(condVal), ifStmt.hasElse());\n block(new LocalContext(waitContext), ifStmt.getThenBlock());\n if (ifStmt.hasElse()) {\n backend.startElseBlock();\n block(new LocalContext(waitContext), ifStmt.getElseBlock());\n }\n backend.endIfStatement();\n backend.endWaitStatement(Arrays.asList(conditionVar), usedVariables, keepOpenVars);\n}\n"
|
"public static APIResponse<ArrayList<Event>> getSimpleEventsInWeek(Context c, int year, int week, boolean loadFromCache) throws NoDataException {\n Log.d(\"String_Node_Str\", \"String_Node_Str\" + week);\n String apiUrl = String.format(TBAv2.API_URL.get(TBAv2.QUERY.EVENT_LIST), year);\n String sqlWhere;\n String[] whereArgs;\n if (week > Utilities.getCmpWeek(year)) {\n sqlWhere = Database.Events.YEAR + \"String_Node_Str\" + Database.Events.WEEK + \"String_Node_Str\";\n whereArgs = new String[] { Integer.toString(year), Integer.toString(Utilities.getCmpWeek(year)) };\n } else {\n sqlWhere = Database.Events.YEAR + \"String_Node_Str\" + Database.Events.WEEK + \"String_Node_Str\";\n whereArgs = new String[] { Integer.toString(year), Integer.toString(week) };\n }\n return Event.queryList(c, loadFromCache, null, sqlWhere, whereArgs, new String[] { apiUrl });\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Player player = game.getPlayer(targetPointer.getFirst(game, source));\n if (player == null) {\n return false;\n }\n FilterPermanent newFilter = filter.copy();\n newFilter.add(new ControllerIdPredicate(player.getId()));\n int amount = count.calculate(game, source, this);\n int realCount = game.getBattlefield().countAll(filter, player.getId(), game);\n amount = Math.min(amount, realCount);\n Target target = new TargetPermanent(amount, amount, filter, true);\n if (amount > 0 && target.canChoose(source.getSourceId(), player.getId(), game)) {\n boolean abilityApplied = false;\n while (!target.isChosen() && target.canChoose(player.getId(), game) && player.isInGame()) {\n player.chooseTarget(Outcome.Sacrifice, target, source, game);\n }\n for (int idx = 0; idx < target.getTargets().size(); idx++) {\n Permanent permanent = game.getPermanent(target.getTargets().get(idx));\n if (permanent != null) {\n abilityApplied |= permanent.sacrifice(source.getSourceId(), game);\n }\n }\n return abilityApplied;\n }\n return false;\n}\n"
|
"public static int[] getRGB2(BufferedImage image) {\n int type = image.getType();\n Raster raster = image.getRaster();\n DataBuffer dataBuffer = raster.getDataBuffer();\n int numOfBanks = dataBuffer.getNumBanks();\n int dataType = dataBuffer.getDataType();\n int imageWidth = image.getWidth();\n int imageHeight = image.getHeight();\n int imageSize = imageWidth * imageHeight;\n int[] rgbs = new int[imageSize];\n switch(dataType) {\n case DataBuffer.TYPE_INT:\n rgbs = ((DataBufferInt) dataBuffer).getData(0);\n if (type == BufferedImage.TYPE_INT_ARGB_PRE) {\n for (int i = 0; i < imageSize; i++) {\n float alpha = 255.0f / ((rgbs[i] >> 24) & 0xff);\n byte red = (byte) (((rgbs[i] >> 16) & 0xff) * alpha);\n byte green = (byte) (((rgbs[i] >> 8) & 0xff) * alpha);\n byte blue = (byte) ((rgbs[i] & 0xff) * alpha);\n rgbs[i] = (rgbs[i] & 0xff000000) | ((red & 0xff) << 16) | ((green & 0xff) << 8) | (blue & 0xff);\n }\n } else if (type == BufferedImage.TYPE_INT_BGR) {\n for (int i = 0; i < rgbs.length; i++) {\n int blue = (rgbs[i] >> 16) & 0xff;\n int green = (rgbs[i] >> 8) & 0xff;\n int red = rgbs[i] & 0xff;\n rgbs[i] = 0xff000000 | (red << 16) | (green << 8) | blue;\n }\n } else if (type == BufferedImage.TYPE_INT_RGB) {\n for (int i = 0; i < rgbs.length; i++) rgbs[i] = 0xff000000 | rgbs[i];\n } else if (type == BufferedImage.TYPE_INT_ARGB) {\n ;\n }\n return rgbs;\n case DataBuffer.TYPE_BYTE:\n byte[][] bpixels = ((DataBufferByte) dataBuffer).getBankData();\n if (type == BufferedImage.TYPE_BYTE_INDEXED || type == BufferedImage.TYPE_BYTE_BINARY) {\n IndexColorModel indexModel = (IndexColorModel) image.getColorModel();\n int mapSize = indexModel.getMapSize();\n byte[] reds = new byte[mapSize];\n byte[] greens = new byte[mapSize];\n byte[] blues = new byte[mapSize];\n byte[] alphas = new byte[mapSize];\n int[] palette = new int[mapSize];\n indexModel.getReds(reds);\n indexModel.getGreens(greens);\n indexModel.getBlues(blues);\n indexModel.getAlphas(alphas);\n for (int i = 0; i < mapSize; i++) palette[i] = (alphas[i] & 0xff) << 24 | (reds[i] & 0xff) << 16 | (greens[i] & 0xff) << 8 | blues[i] & 0xff;\n int bitsPerPixel = raster.getSampleModel().getSampleSize(0);\n int i = 0, index = 0, padding = 0, safeEnd = 0;\n switch(bitsPerPixel) {\n case 8:\n for (; i < imageSize; i++) rgbs[i] = palette[bpixels[0][i] & 0xff];\n break;\n case 4:\n padding = imageWidth % 2;\n safeEnd = imageWidth - padding;\n for (int j = 0; j < imageHeight; j++) {\n for (int k = 0; k < safeEnd; k += 2, i++) {\n rgbs[index++] = palette[(bpixels[0][i] >>> 4) & 0x0f];\n rgbs[index++] = palette[bpixels[0][i] & 0x0f];\n }\n if (padding != 0)\n rgbs[index++] = palette[(bpixels[0][i] >>> 4) & 0x0f];\n }\n break;\n case 2:\n padding = imageWidth % 4;\n safeEnd = imageWidth - padding;\n for (int j = 0; j < imageHeight; j++) {\n for (int k = 0; k < safeEnd; k += 4, i++) {\n for (int l = 6; l >= 0; l -= 2, index++) rgbs[index] = palette[(bpixels[0][i] >>> l) & 0x03];\n }\n if (padding != 0) {\n for (int m = 0, n = 6; m < padding; m++, n -= 2, index++) rgbs[index] = palette[(bpixels[0][i] >>> n) & 0x03];\n i++;\n }\n }\n break;\n case 1:\n padding = imageWidth % 8;\n safeEnd = imageWidth - padding;\n int maxValue = 8 - padding;\n for (int j = 0; j < imageHeight; j++) {\n for (int k = 0; k < safeEnd; k += 8, i++) {\n for (int l = 7; l >= 0; l--, index++) rgbs[index] = palette[(bpixels[0][i] >>> l) & 0x01];\n }\n if (padding != 0) {\n for (int m = 7; m >= maxValue; m--, index++) rgbs[index] = palette[(bpixels[0][i] >>> m) & 0x01];\n i++;\n }\n }\n break;\n default:\n System.out.println(bitsPerPixel + \"String_Node_Str\");\n }\n } else if (type == BufferedImage.TYPE_4BYTE_ABGR) {\n if (numOfBanks == 1) {\n for (int i = 0, index = 0; i < imageSize; i++) rgbs[i] = ((bpixels[0][index++] & 0xff) << 24) | (bpixels[0][index++] & 0xff) | ((bpixels[0][index++] & 0xff) << 8) | ((bpixels[0][index++] & 0xff) << 16);\n } else {\n for (int i = 0; i < imageSize; i++) rgbs[i] = ((bpixels[0][i] & 0xff) << 24) | (bpixels[1][i] & 0xff) | ((bpixels[2][i] & 0xff) << 8) | ((bpixels[3][i] & 0xff) << 16);\n }\n } else if (type == BufferedImage.TYPE_3BYTE_BGR) {\n if (numOfBanks == 1) {\n for (int i = 0, index = 0; i < imageSize; i++) rgbs[i] = 0xff000000 | (bpixels[0][index++] & 0xff) | ((bpixels[0][index++] & 0xff) << 8) | ((bpixels[0][index++] & 0xff) << 16);\n } else {\n for (int i = 0; i < imageSize; i++) rgbs[i] = 0xff000000 | (bpixels[0][i] & 0xff) | ((bpixels[1][i] & 0xff) << 8) | ((bpixels[2][i] & 0xff) << 16);\n }\n } else if (type == BufferedImage.TYPE_4BYTE_ABGR_PRE) {\n if (numOfBanks == 1) {\n for (int i = 0, index = 0; i < imageSize; i++, index += 4) {\n float alpha = 255.0f * (bpixels[0][index] & 0xff);\n byte blue = (byte) ((bpixels[0][index + 1] & 0xff) * alpha);\n byte green = (byte) ((bpixels[0][index + 2] & 0xff) * alpha);\n byte red = (byte) ((bpixels[0][index + 3] & 0xff) * alpha);\n rgbs[i] = ((bpixels[0][index] & 0xff) << 24) | ((red & 0xff) << 16) | ((green & 0xff) << 8) | (blue & 0xff);\n }\n } else {\n for (int i = 0; i < imageSize; i++) {\n float alpha = 255.0f * (bpixels[0][i] & 0xff);\n byte blue = (byte) ((bpixels[1][i] & 0xff) * alpha);\n byte green = (byte) ((bpixels[2][i] & 0xff) * alpha);\n byte red = (byte) ((bpixels[3][i] & 0xff) * alpha);\n rgbs[i] = ((bpixels[0][i] & 0xff) << 24) | ((red & 0xff) << 16) | ((green & 0xff) << 8) | (blue & 0xff);\n }\n }\n } else if (type == BufferedImage.TYPE_BYTE_GRAY) {\n for (int i = 0; i < imageSize; i++) rgbs[i] = 0xff000000 | ((bpixels[0][i] & 0xff) << 16) | ((bpixels[0][i] & 0xff) << 8) | (bpixels[0][i] & 0xff);\n }\n return rgbs;\n case DataBuffer.TYPE_USHORT:\n short[] spixels = ((DataBufferUShort) dataBuffer).getBankData()[0];\n if (type == BufferedImage.TYPE_USHORT_GRAY) {\n for (int i = 0; i < imageSize; i++) {\n int gray = ((spixels[i] >> 8) & 0xff);\n rgbs[i] = 0xff000000 | (gray << 16) | (gray << 8) | gray;\n }\n } else if (type == BufferedImage.TYPE_USHORT_565_RGB) {\n for (int i = 0; i < imageSize; i++) {\n int red = ((spixels[i] >> 11) & 0x1f);\n int green = ((spixels[i] >> 5) & 0x3f);\n int blue = (spixels[i] & 0x1f);\n rgbs[i] = 0xff000000 | (red << 19) | (green << 10) | (blue << 3);\n }\n } else if (type == BufferedImage.TYPE_USHORT_555_RGB) {\n for (int i = 0; i < imageSize; i++) {\n int red = ((spixels[i] >>> 10) & 0x1f);\n int green = ((spixels[i] >>> 5) & 0x1f);\n int blue = (spixels[i] & 0x1f);\n rgbs[i] = 0xff000000 | (red << 19) | (green << 11) | (blue << 3);\n }\n }\n return rgbs;\n default:\n return image.getRGB(0, 0, imageWidth, imageHeight, rgbs, 0, imageWidth);\n }\n}\n"
|
"public void createControl(Composite parent) {\n Composite topLevelComposite = new Composite(parent, SWT.NONE);\n topLevelComposite.setData(SwtAUTHierarchyConstants.WIDGET_NAME, \"String_Node_Str\");\n GridLayout layout = new GridLayout();\n layout.numColumns = 1;\n layout.verticalSpacing = 2;\n layout.marginWidth = Layout.MARGIN_WIDTH;\n layout.marginHeight = Layout.MARGIN_HEIGHT;\n topLevelComposite.setLayout(layout);\n GridData layoutData = new GridData(GridData.FILL_BOTH);\n layoutData.grabExcessHorizontalSpace = true;\n topLevelComposite.setLayoutData(layoutData);\n m_control = topLevelComposite;\n Composite buttonComp = new Composite(topLevelComposite, SWT.BORDER);\n layout = new GridLayout(3, false);\n layout.marginWidth = 3;\n layout.marginHeight = 3;\n buttonComp.setLayout(layout);\n GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);\n buttonComp.setLayoutData(gridData);\n createComboLabels(buttonComp);\n createCombos(buttonComp);\n initTableViewer(buttonComp);\n createButtons(buttonComp);\n Plugin.getHelpSystem().setHelp(getTable(), ContextHelpIds.JB_DATASET_VIEW);\n}\n"
|
"private int getMaxAllowedChildHeight(View child, AmbientState ambientState) {\n if (child instanceof ExpandableNotificationRow) {\n ExpandableNotificationRow row = (ExpandableNotificationRow) child;\n if (ambientState == null && row.isHeadsUp() || ambientState != null && ambientState.getTopHeadsUpEntry() == child) {\n int extraSize = row.getIntrinsicHeight() - row.getHeadsUpHeight();\n return mCollapsedSize + extraSize;\n }\n return row.getIntrinsicHeight();\n } else if (child instanceof ExpandableView) {\n ExpandableView expandableView = (ExpandableView) child;\n return expandableView.getIntrinsicHeight();\n }\n return child == null ? mCollapsedSize : child.getHeight();\n}\n"
|
"public ImagePlus call() {\n ImagePlus[] channels = extractChannels(originalImage);\n ImagePlus[] results = new ImagePlus[channels.length];\n for (int ch = 0; ch < channels.length; ch++) {\n GaussianBlur gs = new GaussianBlur();\n ImageProcessor ip_x = channels[ch].getProcessor().duplicate().convertToFloat();\n gs.blurGaussian(ip_x, 0.4 * sigma, 0.4 * sigma, 0.0002);\n Convolver c = new Convolver();\n float[] sobelFilter_x = { 1f, 2f, 1f, 0f, 0f, 0f, -1f, -2f, -1f };\n c.convolveFloat(ip_x, sobelFilter_x, 3, 3);\n ImageProcessor ip_y = channels[ch].getProcessor().convertToFloat();\n gs.blurGaussian(ip_y, 0.4 * sigma, 0.4 * sigma, 0.0002);\n c = new Convolver();\n float[] sobelFilter_y = { 1f, 0f, -1f, 2f, 0f, -2f, 1f, 0f, -1f };\n c.convolveFloat(ip_y, sobelFilter_y, 3, 3);\n ImageProcessor ip = new FloatProcessor(width, height);\n for (int x = 0; x < width; x++) {\n for (int y = 0; y < height; y++) {\n float s_x = ip_x.getf(x, y);\n float s_y = ip_y.getf(x, y);\n ip.setf(x, y, (float) Math.sqrt(s_x * s_x + s_y * s_y));\n }\n }\n results[ch] = new ImagePlus(availableFeatures[SOBEL] + \"String_Node_Str\" + sigma, ip);\n }\n return mergeResultChannels(results);\n}\n"
|
"public void removeIndex(Comparable oldValue, Data indexKey) {\n takeWriteLock();\n try {\n if (oldValue instanceof IndexImpl.NullObject) {\n recordsWithNullValue.remove(indexKey);\n } else {\n ConcurrentMap<Data, QueryableEntry> records = recordMap.get(oldValue);\n if (records != null) {\n records.remove(indexKey);\n if (records.size() == 0) {\n recordMap.remove(oldValue);\n }\n }\n }\n } finally {\n releaseWriteLock();\n }\n}\n"
|
"protected int getOverlayLayoutOffsetY2() {\n return orient == VERTICAL ? 0 : getLabelSize();\n}\n"
|
"public Word next() {\n Position currentPos = mPositions.getLast();\n mCurrentString.setLength(currentPos.length);\n do {\n if (currentPos.pos.hasNext()) {\n final CharGroup currentGroup = currentPos.pos.next();\n currentPos.length = currentGroup.mChars.length;\n for (int i : currentGroup.mChars) mCurrentString.append(Character.toChars(i));\n if (null != currentGroup.mChildren) {\n currentPos = new Position(currentGroup.mChildren.mData);\n mPositions.addLast(currentPos);\n }\n if (currentGroup.mFrequency >= 0)\n return new Word(mCurrentString.toString(), currentGroup.mFrequency, currentGroup.mShortcutTargets, currentGroup.mBigrams, currentGroup.mIsNotAWord, currentGroup.mIsBlacklistEntry);\n } else {\n mPositions.removeLast();\n currentPos = mPositions.getLast();\n mCurrentString.setLength(mCurrentString.length() - mPositions.getLast().length);\n }\n } while (true);\n}\n"
|
"public static void update(Marker marker, Home home) {\n marker.setVisible(home.isValid());\n marker.setPosition(home.getCoord());\n marker.setSnippet(\"String_Node_Str\" + home.getAltitude());\n}\n"
|
"public static boolean isType(Element e) {\n if (e == null)\n return false;\n switch(e.getKind()) {\n case ANNOTATION_TYPE:\n case CLASS:\n case ENUM:\n case INTERFACE:\n TypeKind kind = e.asType().getKind();\n return !kind.isPrimitive() && kind != TypeKind.VOID;\n }\n return false;\n}\n"
|
"protected void handleQPoll(String[] args) {\n long timeout = 0;\n if (args.length > 1) {\n timeout = Long.parseLong(args[1]);\n }\n try {\n println(getQueue().poll(timeout, TimeUnit.SECONDS));\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n}\n"
|
"public void actionPerformed(ActionEvent e) {\n JButton button = (JButton) e.getSource();\n String name = button.getName();\n if (name.equals(\"String_Node_Str\")) {\n if (metaContact != null) {\n this.clist.renameMetaContact(metaContact, renameContactPanel.getNewName());\n }\n this.dispose();\n } else {\n this.dispose();\n }\n}\n"
|
"public boolean readBoolean(String section, String name) {\n try {\n return this.cache.fetch(section, name, Boolean.class);\n } catch (Exception e) {\n return false;\n }\n}\n"
|
"public static <M extends AbstractManager, T> M getManager(final String name, final ManagerFactory<M, T> factory, final T data) {\n LOCK.lock();\n try {\n M manager = (M) map.get(name);\n if (manager == null) {\n manager = factory.createManager(name, data);\n if (manager == null) {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n map.put(name, manager);\n }\n manager.count++;\n return manager;\n } finally {\n lock.unlock();\n }\n}\n"
|
"public static int[] ExtractVersionNumberFromString(String appVersion) {\n Pattern p = Pattern.compile(\"String_Node_Str\");\n Matcher m = p.matcher(appVersion);\n int[] version = new int[] { 0, 0, 0 };\n if (m.matches()) {\n version[0] = Integer.parseInt(m.group(1));\n version[1] = Integer.parseInt(m.group(2));\n version[2] = Integer.parseInt(m.group(3));\n }\n return new int[] { majorVersion, minorVersion };\n}\n"
|
"public GLM buildBinaryClassifier(int[] attrs, int[][] indices, double[][] values, int[] y, int maxNumIters, double lambda, double l1Ratio) {\n double[] w = new double[attrs.length];\n double intercept = 0;\n double[] pTrain = new double[y.length];\n double[] rTrain = new double[y.length];\n OptimUtils.computePseudoResidual(pTrain, y, rTrain);\n double[] theta = new double[values.length];\n for (int i = 0; i < values.length; i++) {\n theta[i] = StatUtils.sumSq(values[i]) / 4;\n }\n final double lambda1 = lambda * l1Ratio;\n final double lambda2 = lambda * (1 - l1Ratio);\n final double tl1 = lambda1 * y.length;\n final double tl2 = lambda2 * y.length;\n double prevLoss = GLMOptimUtils.computeElasticNetLoss(pTrain, y, w, lambda1, lambda2);\n for (int iter = 0; iter < maxNumIters; iter++) {\n if (fitIntercept) {\n intercept += OptimUtils.fitIntercept(pTrain, y);\n }\n doOnePass(indices, values, theta, y, tl1, tl2, w, pTrain, rTrain);\n double currLoss = GLMOptimUtils.computeElasticNetLoss(pTrain, y, w, lambda1, lambda2);\n if (verbose) {\n System.out.println(\"String_Node_Str\" + iter + \"String_Node_Str\" + \"String_Node_Str\" + currLoss);\n }\n if (prevLoss - currLoss < epsilon) {\n break;\n }\n prevLoss = currLoss;\n }\n return GLMOptimUtils.getGLM(attrs, w, intercept);\n}\n"
|
"public void update(float delta) {\n if (speed > 0) {\n speed -= delta;\n return;\n }\n speed = 0.1f;\n for (Map.Entry<BehaviorTree, List<Interpreter>> entry : interpreters.entrySet()) {\n for (Interpreter interpreter : entry.getValue()) {\n interpreter.tick(delta);\n }\n }\n}\n"
|
"public <T extends Constructible> T createObject(Class<T> clazz) {\n if (clazz == null) {\n throw new NullPointerException(\"String_Node_Str\");\n }\n Class<? extends Constructible> implClass = MODEL_MAP.get(clazz);\n if (implClass == null) {\n throw new IllegalArgumentException(clazz.getName());\n }\n try {\n return (T) implClass.newInstance();\n } catch (Exception e) {\n throw new OpenAPIClassCreationException(e);\n }\n}\n"
|
"protected IContent cloneContent(IContent content, long pageNumber, long totalPageNumber) {\n IContent newContent = content.cloneContent(false);\n if (newContent.getContentType() == IContent.AUTOTEXT_CONTENT) {\n IAutoTextContent autoText = (IAutoTextContent) newContent;\n int type = autoText.getType();\n if (type == IAutoTextContent.PAGE_NUMBER || type == IAutoTextContent.UNFILTERED_PAGE_NUMBER) {\n String pattern = autoText.getComputedStyle().getNumberFormat();\n NumberFormatter nf = new NumberFormatter(pattern);\n autoText.setText(nf.format(pageNumber));\n }\n }\n Iterator iter = content.getChildren().iterator();\n while (iter.hasNext()) {\n IContent child = (IContent) iter.next();\n IContent newChild = cloneContent(newContent, child, pageNumber, totalPageNumber);\n newChild.setParent(newContent);\n newContent.getChildren().add(newChild);\n }\n return newContent;\n}\n"
|
"public static boolean isFitToPage(HttpServletRequest request) {\n String fitToPage = getParameter(request, PARAM_FIT_TO_PAGE);\n if (\"String_Node_Str\".equalsIgnoreCase(fitToPage))\n return false;\n return true;\n}\n"
|
"public String call() throws Exception {\n TableView<?> table = getRealComponent();\n TableColumn col = null;\n if (m_columns.size() == 0) {\n col = table.getVisibleLeafColumn(column);\n } else {\n col = m_columns.get(column);\n }\n table.scrollTo(row);\n table.scrollToColumn(col);\n table.layout();\n List<? extends TableCell> tCells = ComponentHandler.getAssignableFrom(TableCell.class);\n for (TableCell<?, ?> cell : tCells) {\n if (cell.getIndex() == row && cell.getTableColumn() == col && cell.getTableView() == table) {\n String txt = cell.getText();\n if (txt == null && cell instanceof TextFieldTableCell && cell.isEditing()) {\n TextField f = (TextField) cell.getGraphic();\n txt = f.getText();\n }\n return txt;\n }\n }\n return null;\n}\n"
|
"public SlaOrOlaIndicators getSlaOrOlaIndicators(String endpointId, String slaOrOlaName, String periodStart, String periodEnd, int pageSize, int pageStart) throws Exception {\n DirectoryService directoryService = Framework.getService(DirectoryService.class);\n Session session = directoryService.open(org.easysoa.registry.types.SlaOrOlaIndicator.DOCTYPE);\n if (session == null) {\n throw new Exception(\"String_Node_Str\" + org.easysoa.registry.types.SlaOrOlaIndicator.DOCTYPE + \"String_Node_Str\");\n }\n Map<String, Serializable> parameters = new HashMap<String, Serializable>();\n if (endpointId != null && !\"String_Node_Str\".equals(endpointId)) {\n parameters.put(\"String_Node_Str\", endpointId);\n }\n if (slaOrOlaName != null && !\"String_Node_Str\".equals(slaOrOlaName)) {\n parameters.put(\"String_Node_Str\", slaOrOlaName);\n }\n SlaOrOlaIndicators slaOrOlaIndicators = new SlaOrOlaIndicators();\n try {\n Map<String, String> orderByParams = new HashMap<String, String>();\n Set<String> fullTextSearchParams = new HashSet<String>();\n SimpleDateFormat dateFormater = new SimpleDateFormat(\"String_Node_Str\");\n Calendar calendarFrom = new GregorianCalendar();\n Calendar calendarTo = new GregorianCalendar();\n Calendar currentDate = new GregorianCalendar();\n if (periodEnd == null && periodStart == null) {\n calendarTo.clear();\n calendarTo.set(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DAY_OF_MONTH), 23, 59, 59);\n } else if (periodEnd == null && periodStart != null) {\n calendarTo.setTime(currentDate.getTime());\n } else {\n calendarTo.setTime(dateFormater.parse(periodEnd));\n }\n if (periodStart != null) {\n calendarFrom.setTime(dateFormater.parse(periodStart));\n } else {\n calendarFrom.clear();\n calendarFrom.set(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DAY_OF_MONTH));\n }\n SQLBetweenFilter dateRangeFilter = new SQLBetweenFilter(calendarFrom, calendarTo);\n parameters.put(\"String_Node_Str\", dateRangeFilter);\n DocumentModelList soaNodeModelList = session.query(parameters, fullTextSearchParams, orderByParams, false, pageSize, pageStart * pageSize);\n SlaOrOlaIndicator indicator;\n for (DocumentModel model : soaNodeModelList) {\n indicator = new SlaOrOlaIndicator();\n indicator.setEndpointId((String) model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_ENDPOINT_ID));\n indicator.setType(model.getType());\n indicator.setServiceLevelHealth(ServiceLevelHealth.valueOf((String) model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_SERVICE_LEVEL_HEALTH)));\n indicator.setServiceLevelViolation((Boolean) model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_SERVICE_LEVEL_VIOLATION));\n indicator.setSlaOrOlaName((String) model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_SLA_OR_OLA_NAME));\n GregorianCalendar calendar = (GregorianCalendar) model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_TIMESTAMP);\n indicator.setTimestamp(calendar.getTime());\n slaOrOlaIndicators.getSlaOrOlaIndicatorList().add(indicator);\n }\n } catch (ClientException ex) {\n ex.printStackTrace();\n throw ex;\n }\n return slaOrOlaIndicators;\n}\n"
|
"public void run() {\n try {\n try {\n serverSocket = openServerSocket();\n setRunning(true);\n synchronized (this) {\n this.notifyAll();\n }\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n while (keepOn()) {\n try {\n Socket clientSocket = serverSocket.accept();\n synchronized (handlers) {\n if (!keepOn()) {\n clientSocket.close();\n } else {\n Pop3Handler pop3Handler = new Pop3Handler(new Pop3CommandRegistry(), managers.getUserManager(), clientSocket);\n handlers.add(pop3Handler);\n pop3Handler.start();\n }\n }\n } catch (IOException ignored) {\n }\n }\n } finally {\n quit();\n }\n}\n"
|
"public void delNote(final int i) {\n isDirty = true;\n if (!notes.isEmpty() && (i > -1) && (i < notes.size())) {\n notes.remove(i);\n }\n}\n"
|
"public void process(WatchedEvent event) {\n try {\n String path = event.getPath();\n msgLog.logMessage(this + \"String_Node_Str\" + new Date() + \"String_Node_Str\" + event + \"String_Node_Str\" + path + \"String_Node_Str\", true);\n if (path == null && event.getState() == Watcher.Event.KeeperState.Expired) {\n keeperState = KeeperState.Expired;\n if (zooKeeper != null) {\n try {\n zooKeeper.close();\n } catch (InterruptedException e) {\n e.printStackTrace();\n Thread.interrupted();\n }\n }\n zooKeeper = instantiateZooKeeper();\n } else if (path == null && event.getState() == Watcher.Event.KeeperState.SyncConnected) {\n long newSessionId = zooKeeper.getSessionId();\n if (newSessionId != sessionId) {\n Pair<Master, Machine> masterBeforeIWrite = getMasterFromZooKeeper(false);\n msgLog.logMessage(\"String_Node_Str\" + masterBeforeIWrite);\n sequenceNr = setup();\n msgLog.logMessage(\"String_Node_Str\" + sequenceNr + \"String_Node_Str\" + newSessionId);\n keeperState = KeeperState.SyncConnected;\n Pair<Master, Machine> masterAfterIWrote = getMasterFromZooKeeper(false);\n msgLog.logMessage(\"String_Node_Str\" + masterAfterIWrote);\n int masterId = masterAfterIWrote.other().getMachineId();\n setDataChangeWatcher(MASTER_NOTIFY_CHILD, masterId);\n receiver.newMaster(masterAfterIWrote, new Exception());\n sessionId = newSessionId;\n } else {\n msgLog.logMessage(\"String_Node_Str\" + sessionId);\n keeperState = KeeperState.SyncConnected;\n }\n } else if (path == null && event.getState() == Watcher.Event.KeeperState.Disconnected) {\n keeperState = KeeperState.Disconnected;\n } else if (event.getType() == Watcher.Event.EventType.NodeDataChanged) {\n Pair<Master, Machine> currentMaster = getMasterFromZooKeeper(true);\n if (path.contains(MASTER_NOTIFY_CHILD)) {\n setDataChangeWatcher(MASTER_NOTIFY_CHILD, -1);\n if (currentMaster.other().getMachineId() == machineId) {\n receiver.newMaster(currentMaster, new Exception());\n }\n } else if (path.contains(MASTER_REBOUND_CHILD)) {\n setDataChangeWatcher(MASTER_REBOUND_CHILD, -1);\n if (currentMaster.other().getMachineId() != machineId) {\n receiver.newMaster(currentMaster, new Exception());\n }\n } else {\n msgLog.logMessage(\"String_Node_Str\" + path);\n }\n }\n } catch (RuntimeException e) {\n msgLog.logMessage(\"String_Node_Str\", e);\n e.printStackTrace();\n throw e;\n }\n}\n"
|
"public Composite createDataDragSource(Composite parent) {\n cmpStack = new Composite(parent, SWT.NONE);\n cmpStack.setLayoutData(new GridData(GridData.FILL_BOTH));\n stackLayout = new StackLayout();\n stackLayout.marginHeight = 0;\n stackLayout.marginWidth = 0;\n cmpStack.setLayout(stackLayout);\n cmpCubeTree = ChartUIUtil.createCompositeWrapper(cmpStack);\n cmpDataPreview = ChartUIUtil.createCompositeWrapper(cmpStack);\n Label label = new Label(cmpCubeTree, SWT.NONE);\n {\n label.setText(Messages.getString(\"String_Node_Str\"));\n label.setFont(JFaceResources.getBannerFont());\n }\n if (!dataProvider.isInXTabMeasureCell() && !dataProvider.isInMultiView()) {\n Label description = new Label(cmpCubeTree, SWT.WRAP);\n {\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n description.setLayoutData(gd);\n description.setText(Messages.getString(\"String_Node_Str\"));\n }\n }\n cubeTreeViewer = new TreeViewer(cmpCubeTree, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);\n cubeTreeViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));\n ((GridData) cubeTreeViewer.getTree().getLayoutData()).heightHint = 120;\n ViewsTreeProvider provider = new ViewsTreeProvider();\n cubeTreeViewer.setLabelProvider(provider);\n cubeTreeViewer.setContentProvider(provider);\n cubeTreeViewer.setInput(getCube());\n final DragSource dragSource = new DragSource(cubeTreeViewer.getTree(), DND.DROP_COPY);\n dragSource.setTransfer(new Transfer[] { SimpleTextTransfer.getInstance() });\n dragSource.addDragListener(new DragSourceListener() {\n private String text = null;\n public void dragFinished(DragSourceEvent event) {\n }\n public void dragSetData(DragSourceEvent event) {\n event.data = text;\n }\n public void dragStart(DragSourceEvent event) {\n text = createCubeExpression();\n if (text == null) {\n event.doit = false;\n }\n }\n });\n cubeTreeViewer.getTree().addListener(SWT.MouseDown, new Listener() {\n public void handleEvent(Event event) {\n if (event.button == 3 && event.widget instanceof Tree) {\n Tree tree = (Tree) event.widget;\n TreeItem treeItem = tree.getSelection()[0];\n if (treeItem.getData() instanceof LevelHandle || treeItem.getData() instanceof MeasureHandle) {\n tree.setMenu(createMenuManager(treeItem.getData()).createContextMenu(tree));\n tree.getMenu().setVisible(true);\n } else {\n tree.setMenu(null);\n }\n }\n }\n });\n label = new Label(cmpDataPreview, SWT.NONE);\n {\n label.setText(Messages.getString(\"String_Node_Str\"));\n label.setFont(JFaceResources.getBannerFont());\n }\n Label description = new Label(cmpDataPreview, SWT.WRAP);\n {\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n description.setLayoutData(gd);\n description.setText(Messages.getString(\"String_Node_Str\"));\n }\n tablePreview = new CustomPreviewTable(cmpDataPreview, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);\n {\n GridData gridData = new GridData(GridData.FILL_BOTH);\n gridData.widthHint = 400;\n gridData.heightHint = 120;\n tablePreview.setLayoutData(gridData);\n tablePreview.setHeaderAlignment(SWT.LEFT);\n tablePreview.addListener(CustomPreviewTable.MOUSE_RIGHT_CLICK_TYPE, this);\n }\n updateDragDataSource();\n return cmpStack;\n}\n"
|
"private static void buildDistanceMap(int to, boolean[] passable) {\n System.arraycopy(maxVal, 0, distance, 0, maxVal.length);\n int head = 0;\n int tail = 0;\n queue[tail++] = to;\n distance[to] = 0;\n while (head < tail) {\n int step = queue[head++];\n int nextDistance = distance[step] + 1;\n int start = (step % width == 0 ? 3 : 0);\n int end = ((step + 1) % width == 0 ? 3 : 0);\n for (int i = start; i < dirLR.length - end; i++) {\n int n = step + dirLR[i];\n if (n >= 0 && n < size && passable[n] && (distance[n] > nextDistance)) {\n queue[tail++] = n;\n distance[n] = nextDistance;\n }\n }\n }\n}\n"
|
"public void transform(NodeType node) {\n ElementParameterType elemParamType = ComponentUtilities.getNodeProperty(node, \"String_Node_Str\");\n String propertiesString = elemParamType.getValue();\n SerializerDeserializer.Deserialized<ComponentProperties> fromSerialized = Properties.Helper.fromSerializedPersistent(propertiesString, ComponentProperties.class, new PostDeserializeSetup() {\n\n public void setup(ComponentProperties properties) {\n properties.setValueEvaluator(new PropertyValueEvaluator() {\n public Object evaluate(Property property, Object storedValue) {\n if (storedValue instanceof String) {\n if (GenericTypeUtils.isEnumType(property)) {\n ComponentProperties newProperties = ComponentsUtils.getComponentProperties(node.getComponentName());\n Property newProperty = (Property) newProperties.getProperty(property.getName());\n if (newProperty == null) {\n newProperty = (Property) newProperties.getProperty(\"String_Node_Str\");\n }\n if (newProperty != null) {\n List<?> propertyPossibleValues = ((Property<?>) newProperty).getPossibleValues();\n if (propertyPossibleValues != null) {\n for (Object possibleValue : propertyPossibleValues) {\n if (possibleValue.toString().equals(storedValue)) {\n property.setStoredValue(possibleValue);\n return possibleValue;\n }\n }\n }\n }\n }\n }\n return storedValue;\n }\n });\n }\n });\n ComponentProperties newProperties = ComponentsUtils.getComponentProperties(node.getComponentName());\n updateSubProperties(fromSerialized.properties, newProperties);\n newProperties.copyValuesFrom(fromSerialized.properties, true, false);\n NamedThing nt = newProperties.getProperty(\"String_Node_Str\");\n if (nt != null && nt instanceof Property) {\n Property moduleNameProperty = (Property) nt;\n String moduleName = (String) moduleNameProperty.getValue();\n moduleName = TalendQuoteUtils.removeQuotes(moduleName);\n moduleName = TalendQuoteUtils.addQuotes(moduleName);\n moduleNameProperty.setStoredValue(moduleName);\n }\n nt = newProperties.getProperty(\"String_Node_Str\");\n if (nt != null && nt instanceof Property) {\n Property moduleNameProperty = (Property) nt;\n if (moduleNameProperty.getPossibleValues() == null || moduleNameProperty.getPossibleValues().isEmpty()) {\n List<String> columns = new ArrayList<String>();\n if (moduleNameProperty.getValue() instanceof String) {\n String column = (String) moduleNameProperty.getValue();\n columns.add(column);\n } else if (moduleNameProperty.getValue() instanceof List) {\n columns.addAll((Collection<? extends String>) moduleNameProperty.getValue());\n }\n moduleNameProperty.setPossibleValues(columns);\n }\n }\n elemParamType.setValue(newProperties.toSerialized());\n}\n"
|
"public void initTestSendRecv(WebRtcChannel webRtcChannel, WebRtcIpvMode webRtcIpvMode, WebRtcCandidateType webRtcCandidateType) throws InterruptedException {\n MediaPipeline mp = kurentoClient.createMediaPipeline();\n WebRtcEndpoint webRtcEndpoint = new WebRtcEndpoint.Builder(mp).build();\n webRtcEndpoint.connect(webRtcEndpoint);\n final CountDownLatch eosLatch = new CountDownLatch(1);\n webRtcEndpoint.addMediaFlowOutStateChangeListener(new EventListener<MediaFlowOutStateChangeEvent>() {\n public void onEvent(MediaFlowOutStateChangeEvent event) {\n if (event.getState().equals(MediaFlowState.FLOWING)) {\n eosLatch.countDown();\n }\n }\n });\n getPage(0).subscribeEvents(\"String_Node_Str\");\n getPage(0).initWebRtc(webRtcEndpoint, webRtcChannel, WebRtcMode.SEND_RCV, webRtcIpvMode, webRtcCandidateType);\n Assert.assertTrue(\"String_Node_Str\", getPage(0).waitForEvent(\"String_Node_Str\"));\n Assert.assertTrue(\"String_Node_Str\" + webRtcChannel, eosLatch.await(getPage(0).getTimeout(), TimeUnit.SECONDS));\n mp.release();\n}\n"
|
"protected static boolean handleValidateDataSetColumnDropContainer(EditPart dropPart) {\n if (dropPart.getParent() == null) {\n return false;\n }\n Object container = dropPart.getParent().getModel();\n return (container instanceof GridHandle || container instanceof TableHandle || container instanceof FreeFormHandle || container instanceof ListHandle || container instanceof MasterPageHandle || dropPart.getModel() instanceof ModuleHandle);\n}\n"
|
"public void removeEdge(String schema, String table, SqlgEdge edge) {\n SchemaTable schemaTable = SchemaTable.of(schema, table);\n Pair<SortedSet<String>, Map<SqlgEdge, Triple<SqlgVertex, SqlgVertex, Map<String, Object>>>> sqlgEdgeTripleMap = this.edgeCache.get(schemaTable);\n if (sqlgEdgeTripleMap != null && sqlgEdgeTripleMap.getRight().containsKey(edge)) {\n sqlgEdgeTripleMap.getRight().remove(edge);\n } else {\n List<SqlgEdge> edges = this.removeEdgeCache.get(schemaTable);\n if (edges == null) {\n edges = new ArrayList<>();\n this.removeEdgeCache.put(schemaTable, edges);\n }\n edges.add(edge);\n }\n}\n"
|
"private void doInitSerializable(final Object obj, final SerializableClassDescriptor descriptor) throws IOException, ClassNotFoundException {\n final Class<?> type = descriptor.getType();\n final SerializableClass info = registry.lookup(type);\n final ClassDescriptor superDescriptor = descriptor.getSuperClassDescriptor();\n if (superDescriptor instanceof SerializableClassDescriptor) {\n final SerializableClassDescriptor serializableSuperDescriptor = (SerializableClassDescriptor) superDescriptor;\n doInitSerializable(obj, serializableSuperDescriptor);\n }\n final int typeId = descriptor.getTypeID();\n final BlockUnmarshaller blockUnmarshaller = getBlockUnmarshaller();\n if (descriptor.isGap()) {\n if (info.hasReadObjectNoData()) {\n info.callReadObjectNoData(obj);\n }\n } else if (info.hasReadObject()) {\n final RiverObjectInputStream objectInputStream = getObjectInputStream();\n final SerializableClassDescriptor oldDescriptor = objectInputStream.swapClass(descriptor);\n final Object oldObj = objectInputStream.swapCurrent(obj);\n final RiverObjectInputStream.State restoreState = objectInputStream.start();\n boolean ok = false;\n try {\n if (typeId == ID_WRITE_OBJECT_CLASS) {\n info.callReadObject(obj, objectInputStream);\n blockUnmarshaller.readToEndBlockData();\n blockUnmarshaller.unblock();\n } else {\n objectInputStream.noCustomData();\n info.callReadObject(obj, objectInputStream);\n }\n objectInputStream.finish(restoreState);\n objectInputStream.swapCurrent(oldObj);\n objectInputStream.swapClass(oldDescriptor);\n ok = true;\n } finally {\n if (!ok) {\n objectInputStream.fullReset();\n }\n }\n } else {\n readFields(obj, descriptor);\n if (typeId == ID_WRITE_OBJECT_CLASS) {\n blockUnmarshaller.readToEndBlockData();\n blockUnmarshaller.unblock();\n }\n }\n}\n"
|
"public static GlobalProperties getGlobalPropertiesAfterConnection(OptimizerNode source, OptimizerNode target, ShipStrategy shipMode) {\n GlobalProperties gp = source.getGlobalProperties().createCopy();\n FieldList keyFields = null;\n PactConnection conn = target.getIncomingConnections().get(targetInputNum);\n if (conn.getScramblePartitionedFields() != null) {\n throw new CompilerException(\"String_Node_Str\");\n } else if (target.getPactContract() instanceof AbstractPact<?>) {\n keyFields = new FieldList(((AbstractPact<?>) target.getPactContract()).getKeyColumnNumbers(targetInputNum));\n }\n switch(shipMode) {\n case BROADCAST:\n gp.reset();\n break;\n case PARTITION_RANGE:\n gp.setPartitioning(PartitionProperty.RANGE_PARTITIONED, keyFields);\n break;\n case PARTITION_HASH:\n gp.setPartitioning(PartitionProperty.HASH_PARTITIONED, keyFields);\n gp.setOrdering(null);\n break;\n case FORWARD:\n if (source.getDegreeOfParallelism() > target.getDegreeOfParallelism()) {\n gp.setOrdering(null);\n }\n break;\n case NONE:\n throw new CompilerException(\"String_Node_Str\");\n case SFR:\n default:\n throw new CompilerException(\"String_Node_Str\" + shipMode.name());\n }\n return gp;\n}\n"
|
"public void download(File saveFile, boolean overwrite) throws SaveLocationException {\n list.remove(getDownloadItem(downloader));\n downloadManager.downloadTorrent(torrentFile, overwrite);\n}\n"
|
"public void notifyPacketHandlers(byte[] payload, int len) {\n for (int i = 0; i < packetHandlers.size(); i++) {\n try {\n packetHandlers.get(i).setPacketData(this, payload, len);\n } catch (Exception e) {\n }\n }\n}\n"
|
"public boolean onMessage(int source, int path, int target, int flags, Object object) {\n boolean canAdd = true;\n Queue<Object> m = messages.get(target).get(source);\n Integer c = counts.get(target).get(source);\n if (m.size() >= sendPendingMax) {\n canAdd = false;\n onMessageAttempts++;\n } else {\n onMessageAttempts = 0;\n m.offer(object);\n counts.get(target).put(source, c + 1);\n Integer tc = totalCounts.get(target).get(source);\n totalCounts.get(target).put(source, tc + 1);\n }\n return canAdd;\n}\n"
|
"private void readliness(String terminator) throws IOException {\n boolean cont = true;\n while (cont) {\n String raw = reader.readLine();\n if (raw != null) {\n logger.trace(\"String_Node_Str\", raw);\n try {\n this.messageProcessor.addReceivedLine(raw);\n if (this.messageProcessor.isMessageAvailable()) {\n Message message = this.messageProcessor.pull();\n message.debug(logger);\n processMessage(message);\n }\n } catch (Exception e) {\n logger.info(\"String_Node_Str\", raw, ipAddress, e.getMessage(), e);\n this.messageProcessor.reset();\n }\n if (terminator == null || raw.startsWith(terminator)) {\n cont = false;\n }\n } else {\n cont = false;\n }\n }\n}\n"
|
"protected final String generateSeed(int length) {\n StringBuilder sb = new StringBuilder();\n ChatColor[] vals = ChatColor.values();\n Random rand = new Random();\n for (int i = 0; i < length; i++) {\n sb.append(vals[rand.nextInt(vals.length)]);\n }\n return ChatColor.translateAlternateColorCodes('&', sb.toString());\n}\n"
|
"private <T> Future<T> checkSync(ClientInvocationFuture f, String uuid, int partitionId, boolean preventSync, T defaultValue) {\n boolean sync = isSyncComputation(preventSync);\n if (sync) {\n Object response = retrieveResultFromMessage(f);\n Executor userExecutor = getContext().getExecutionService().getUserExecutor();\n return new CompletedFuture<T>(getSerializationService(), response, userExecutor);\n } else {\n return new IExecutorDelegatingFuture<T>(f, getContext(), uuid, defaultValue, SUBMIT_TO_PARTITION_DECODER, partitionId);\n }\n}\n"
|
"void draw(SpriteBatch batch, BitmapFont font) {\n if (drawResource) {\n batch.draw(Assets.copperOre, x, y, width, height);\n if (closeEnough() && Player.ableToMove) {\n font.draw(batch, \"String_Node_Str\", 50, 50);\n }\n }\n}\n"
|
"private void setMaprTicketConfig(IMetadataConnection metadataConn, ClassLoader classLoader, boolean useKerberos) throws SQLException {\n System.setProperty(\"String_Node_Str\", \"String_Node_Str\");\n System.setProperty(\"String_Node_Str\", \"String_Node_Str\");\n System.setProperty(\"String_Node_Str\", \"String_Node_Str\");\n String mapRTicketUsername = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_USERNAME);\n String mapRTicketPassword = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_MAPRTICKET_PASSWORD);\n String mapRTicketCluster = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_MAPRTICKET_CLUSTER);\n String mapRTicketDuration = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_MAPRTICKET_DURATION);\n Long desiredTicketDurInSecs = 86400L;\n if (mapRTicketDuration != null && StringUtils.isNotBlank(mapRTicketDuration)) {\n desiredTicketDurInSecs = Long.parseLong(mapRTicketDuration);\n }\n try {\n Object mapRClientConfig = ReflectionUtils.newInstance(\"String_Node_Str\", classLoader, new Object[] {});\n if (useKerberos) {\n System.setProperty(\"String_Node_Str\", \"String_Node_Str\");\n ReflectionUtils.invokeMethod(mapRClientConfig, \"String_Node_Str\", new Object[] { mapRTicketCluster, desiredTicketDurInSecs });\n } else {\n String decryptedPassword = PasswordEncryptUtil.encryptPassword(mapRTicketPassword);\n ReflectionUtils.invokeMethod(mapRClientConfig, \"String_Node_Str\", new Object[] { false }, boolean.class);\n ReflectionUtils.invokeMethod(mapRClientConfig, \"String_Node_Str\", new Object[] { mapRTicketCluster, mapRTicketUsername, mapRTicketPassword, desiredTicketDurInSecs });\n }\n } catch (Exception e) {\n throw new SQLException(e);\n }\n}\n"
|
"public void onMouseOver(MouseOverEvent event) {\n Element from = event.getFromElement();\n Widget source = source(event);\n if (from == null || !source.getElement().isOrHasChild(from)) {\n listener.onMouseEnter(source(event));\n }\n}\n"
|
"public Object getRealAttributeValueFromObject(Object object, Object attribute) {\n boolean wasInstantiated = attribute != null && attribute instanceof ValueHolderInterface && ((ValueHolderInterface) attribute).isInstantiated();\n Object value = super.getRealAttributeValueFromObject(object, attribute);\n if (!wasInstantiated && (value != attribute)) {\n updateValueInObject(object, value, attribute);\n }\n return value;\n}\n"
|
"protected void prepareHandlers(final Context context) {\n addHandler(Attributes.View.OnClick, new EventProcessor<V>(context) {\n public void setOnEventListener(final V view, final ParserContext parserContext, final JsonElement attributeValue) {\n view.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n fireEvent(view, parserContext, EventType.OnClick, attributeValue);\n }\n });\n }\n });\n addHandler(Attributes.View.Background, new DrawableResourceProcessor<V>(context) {\n public void setDrawable(V view, Drawable drawable) {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {\n view.setBackgroundDrawable(drawable);\n } else {\n view.setBackground(drawable);\n }\n }\n });\n addHandler(Attributes.View.Height, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n ViewGroup.LayoutParams layoutParams = view.getLayoutParams();\n layoutParams.height = ParseHelper.parseDimension(attributeValue, context);\n view.setLayoutParams(layoutParams);\n }\n });\n addHandler(Attributes.View.Width, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n ViewGroup.LayoutParams layoutParams = view.getLayoutParams();\n layoutParams.width = ParseHelper.parseDimension(attributeValue, context);\n view.setLayoutParams(layoutParams);\n }\n });\n addHandler(Attributes.View.Weight, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n LinearLayout.LayoutParams layoutParams;\n if (view.getLayoutParams() instanceof LinearLayout.LayoutParams) {\n layoutParams = (LinearLayout.LayoutParams) view.getLayoutParams();\n layoutParams.weight = ParseHelper.parseFloat(attributeValue);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(attributeKey + \"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.LayoutGravity, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n ViewGroup.LayoutParams layoutParams = view.getLayoutParams();\n if (layoutParams instanceof LinearLayout.LayoutParams) {\n LinearLayout.LayoutParams linearLayoutParams = (LinearLayout.LayoutParams) layoutParams;\n linearLayoutParams.gravity = ParseHelper.parseGravity(attributeValue);\n view.setLayoutParams(layoutParams);\n } else if (layoutParams instanceof FrameLayout.LayoutParams) {\n FrameLayout.LayoutParams linearLayoutParams = (FrameLayout.LayoutParams) layoutParams;\n linearLayoutParams.gravity = ParseHelper.parseGravity(attributeValue);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(attributeKey + \"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.Padding, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n view.setPadding(dimension, dimension, dimension, dimension);\n }\n });\n addHandler(Attributes.View.PaddingLeft, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n view.setPadding(dimension, view.getPaddingTop(), view.getPaddingRight(), view.getPaddingBottom());\n }\n });\n addHandler(Attributes.View.PaddingTop, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n view.setPadding(view.getPaddingLeft(), dimension, view.getPaddingRight(), view.getPaddingBottom());\n }\n });\n addHandler(Attributes.View.PaddingRight, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n view.setPadding(view.getPaddingLeft(), view.getPaddingTop(), dimension, view.getPaddingBottom());\n }\n });\n addHandler(Attributes.View.PaddingBottom, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n view.setPadding(view.getPaddingLeft(), view.getPaddingTop(), view.getPaddingRight(), dimension);\n }\n });\n addHandler(Attributes.View.Margin, new DimensionAttributeProcessor<V>() {\n\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {\n ViewGroup.MarginLayoutParams layoutParams;\n layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();\n layoutParams.setMargins(dimension, dimension, dimension, dimension);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(\"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.MarginLeft, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {\n ViewGroup.MarginLayoutParams layoutParams;\n layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();\n layoutParams.setMargins(dimension, layoutParams.topMargin, layoutParams.rightMargin, layoutParams.bottomMargin);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(\"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.MarginTop, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {\n ViewGroup.MarginLayoutParams layoutParams;\n layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();\n layoutParams.setMargins(layoutParams.leftMargin, dimension, layoutParams.rightMargin, layoutParams.bottomMargin);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(\"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.MarginRight, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {\n ViewGroup.MarginLayoutParams layoutParams;\n layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();\n layoutParams.setMargins(layoutParams.leftMargin, layoutParams.topMargin, dimension, layoutParams.bottomMargin);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(\"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.MarginBottom, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {\n ViewGroup.MarginLayoutParams layoutParams;\n layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();\n layoutParams.setMargins(layoutParams.leftMargin, layoutParams.topMargin, layoutParams.rightMargin, dimension);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(\"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.MinHeight, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n view.setMinimumHeight(dimension);\n }\n });\n addHandler(Attributes.View.MinWidth, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n view.setMinimumWidth(dimension);\n }\n });\n addHandler(Attributes.View.Elevation, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n view.setElevation(dimension);\n }\n }\n });\n addHandler(Attributes.View.Alpha, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setAlpha(ParseHelper.parseFloat(attributeValue));\n }\n });\n addHandler(Attributes.View.Visibility, new JsonDataProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, JsonElement attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setVisibility(ParseHelper.parseVisibility(attributeValue));\n }\n });\n addHandler(Attributes.View.Invisibility, new JsonDataProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, JsonElement attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setVisibility(ParseHelper.parseInvisibility(attributeValue));\n }\n });\n addHandler(Attributes.View.Id, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setId(IdGenerator.getInstance().getUnique(attributeValue));\n }\n });\n addHandler(Attributes.View.ContentDescription, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setContentDescription(attributeValue);\n }\n });\n addHandler(Attributes.View.Clickable, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n boolean clickable = ParseHelper.parseBoolean(attributeValue);\n view.setClickable(clickable);\n }\n });\n addHandler(Attributes.View.Tag, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setTag(attributeValue);\n }\n });\n addHandler(Attributes.View.Border, new JsonDataProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, JsonElement attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n Drawable border = Utils.getBorderDrawble(attributeValue, context);\n if (border == null) {\n return;\n }\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {\n view.setBackgroundDrawable(border);\n } else {\n view.setBackground(border);\n }\n }\n });\n addHandler(Attributes.View.Enabled, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n boolean enabled = ParseHelper.parseBoolean(attributeValue);\n view.setEnabled(enabled);\n }\n });\n addHandler(Attributes.View.Style, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n Styles styles = parserContext.getStyles();\n LayoutHandler handler = parserContext.getLayoutBuilder().getHandler(Utils.getPropertyAsString(layout, ProteusConstants.TYPE));\n if (styles == null) {\n return;\n }\n String[] styleSet = attributeValue.split(ProteusConstants.STYLE_DELIMITER);\n for (String styleName : styleSet) {\n if (styles.contains(styleName)) {\n process(styles.getStyle(styleName), layout, proteusView, (handler != null ? handler : ViewParser.this), parserContext.getLayoutBuilder(), parserContext, parent, index);\n }\n }\n }\n private void process(Map<String, JsonElement> style, JsonObject layout, ProteusView proteusView, LayoutHandler handler, LayoutBuilder builder, ParserContext parserContext, ProteusView parent, int index) {\n for (Map.Entry<String, JsonElement> attribute : style.entrySet()) {\n if (layout.has(attribute.getKey())) {\n continue;\n }\n builder.handleAttribute(handler, parserContext, attribute.getKey(), attribute.getValue(), layout, proteusView, parent, index);\n }\n }\n });\n addHandler(Attributes.View.TransitionName, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n view.setTransitionName(attributeValue);\n }\n }\n });\n addHandler(Attributes.View.RequiresFadingEdge, new StringAttributeProcessor<V>() {\n private final String NONE = \"String_Node_Str\";\n private final String BOTH = \"String_Node_Str\";\n private final String VERTICAL = \"String_Node_Str\";\n private final String HORIZONTAL = \"String_Node_Str\";\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n switch(attributeValue) {\n case NONE:\n view.setVerticalFadingEdgeEnabled(false);\n view.setHorizontalFadingEdgeEnabled(false);\n break;\n case BOTH:\n view.setVerticalFadingEdgeEnabled(true);\n view.setHorizontalFadingEdgeEnabled(true);\n break;\n case VERTICAL:\n view.setVerticalFadingEdgeEnabled(true);\n view.setHorizontalFadingEdgeEnabled(false);\n break;\n case HORIZONTAL:\n view.setVerticalFadingEdgeEnabled(false);\n view.setHorizontalFadingEdgeEnabled(true);\n break;\n default:\n view.setVerticalFadingEdgeEnabled(false);\n view.setHorizontalFadingEdgeEnabled(false);\n break;\n }\n }\n });\n addHandler(Attributes.View.FadingEdgeLength, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setFadingEdgeLength(ParseHelper.parseInt(attributeValue));\n }\n });\n final HashMap<String, Integer> relativeLayoutParams = new HashMap<>();\n relativeLayoutParams.put(Attributes.View.Above.getName(), RelativeLayout.ABOVE);\n relativeLayoutParams.put(Attributes.View.AlignBaseline.getName(), RelativeLayout.ALIGN_BASELINE);\n relativeLayoutParams.put(Attributes.View.AlignBottom.getName(), RelativeLayout.ALIGN_BOTTOM);\n relativeLayoutParams.put(Attributes.View.AlignEnd.getName(), RelativeLayout.ALIGN_END);\n relativeLayoutParams.put(Attributes.View.AlignLeft.getName(), RelativeLayout.ALIGN_LEFT);\n relativeLayoutParams.put(Attributes.View.AlignParentBottom.getName(), RelativeLayout.ALIGN_PARENT_BOTTOM);\n relativeLayoutParams.put(Attributes.View.AlignParentEnd.getName(), RelativeLayout.ALIGN_PARENT_END);\n relativeLayoutParams.put(Attributes.View.AlignParentLeft.getName(), RelativeLayout.ALIGN_PARENT_LEFT);\n relativeLayoutParams.put(Attributes.View.AlignParentRight.getName(), RelativeLayout.ALIGN_PARENT_RIGHT);\n relativeLayoutParams.put(Attributes.View.AlignParentStart.getName(), RelativeLayout.ALIGN_PARENT_START);\n relativeLayoutParams.put(Attributes.View.AlignParentTop.getName(), RelativeLayout.ALIGN_PARENT_TOP);\n relativeLayoutParams.put(Attributes.View.AlignRight.getName(), RelativeLayout.ALIGN_RIGHT);\n relativeLayoutParams.put(Attributes.View.AlignStart.getName(), RelativeLayout.ALIGN_START);\n relativeLayoutParams.put(Attributes.View.AlignTop.getName(), RelativeLayout.ALIGN_TOP);\n relativeLayoutParams.put(Attributes.View.Below.getName(), RelativeLayout.BELOW);\n relativeLayoutParams.put(Attributes.View.CenterHorizontal.getName(), RelativeLayout.CENTER_HORIZONTAL);\n relativeLayoutParams.put(Attributes.View.CenterInParent.getName(), RelativeLayout.CENTER_IN_PARENT);\n relativeLayoutParams.put(Attributes.View.CenterVertical.getName(), RelativeLayout.CENTER_VERTICAL);\n relativeLayoutParams.put(Attributes.View.ToEndOf.getName(), RelativeLayout.END_OF);\n relativeLayoutParams.put(Attributes.View.ToLeftOf.getName(), RelativeLayout.LEFT_OF);\n relativeLayoutParams.put(Attributes.View.ToRightOf.getName(), RelativeLayout.RIGHT_OF);\n relativeLayoutParams.put(Attributes.View.ToStartOf.getName(), RelativeLayout.START_OF);\n StringAttributeProcessor<V> relativeLayoutProcessor = new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int id = IdGenerator.getInstance().getUnique(attributeValue);\n Integer rule = relativeLayoutParams.get(attributeKey);\n ParseHelper.addRelativeLayoutRule(view, rule, id);\n }\n };\n StringAttributeProcessor<V> relativeLayoutBooleanProcessor = new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int trueOrFalse = ParseHelper.parseRelativeLayoutBoolean(attributeValue);\n ParseHelper.addRelativeLayoutRule(view, relativeLayoutParams.get(attributeKey), trueOrFalse);\n }\n };\n addHandler(Attributes.View.Above, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignBaseline, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignBottom, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignEnd, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignLeft, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignRight, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignStart, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignTop, relativeLayoutProcessor);\n addHandler(Attributes.View.Below, relativeLayoutProcessor);\n addHandler(Attributes.View.ToEndOf, relativeLayoutProcessor);\n addHandler(Attributes.View.ToLeftOf, relativeLayoutProcessor);\n addHandler(Attributes.View.ToRightOf, relativeLayoutProcessor);\n addHandler(Attributes.View.ToStartOf, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignParentBottom, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.AlignParentEnd, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.AlignParentLeft, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.AlignParentRight, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.AlignParentStart, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.AlignParentTop, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.CenterHorizontal, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.CenterInParent, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.CenterVertical, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.Animation, new TweenAnimationResourceProcessor<V>(context) {\n public void setAnimation(V view, Animation animation) {\n view.setAnimation(animation);\n }\n });\n}\n"
|
"public void testNoXmlAccessorTypeOverride() {\n outputResolver = generateSchema(CONTEXT_PATH, PATH, 1);\n String src = PATH + \"String_Node_Str\";\n String result = validateAgainstSchema(src, EMPTY_NAMESPACE, outputResolver);\n assertTrue(\"String_Node_Str\" + result, result == null);\n}\n"
|
"public void handleQuery(ServerContext context, QueryRequest request, QueryResultHandler handler) {\n try {\n String queryId = request.getQueryId();\n if (queryId == null) {\n throw new BadRequestException(\"String_Node_Str\");\n }\n Map<String, Object> resultMap = null;\n if (queryId.equals(\"String_Node_Str\")) {\n String[] persistentJobNames = null;\n persistentJobNames = persistentScheduler.getJobNames(GROUP_NAME);\n String[] inMemoryJobNames = inMemoryScheduler.getJobNames(GROUP_NAME);\n List<Map<String, String>> resultList = new ArrayList<Map<String, String>>();\n if (persistentJobNames != null) {\n for (String job : persistentJobNames) {\n Map<String, String> idMap = new HashMap<String, String>();\n idMap.put(\"String_Node_Str\", job);\n resultList.add(idMap);\n }\n }\n if (inMemoryJobNames != null) {\n for (String job : inMemoryJobNames) {\n Map<String, String> idMap = new HashMap<String, String>();\n idMap.put(\"String_Node_Str\", job);\n resultList.add(idMap);\n }\n }\n resultMap = new HashMap<String, Object>();\n resultMap.put(QueryResult.FIELD_RESULT, resultList);\n } else {\n throw new BadRequestException(\"String_Node_Str\" + queryId);\n }\n for (Map<String, String> r : (List<Map<String, String>>) resultMap.get(QueryResult.FIELD_RESULT)) {\n handler.handleResource(new Resource(r.get(\"String_Node_Str\"), null, new JsonValue(r)));\n }\n handler.handleResult(new QueryResult());\n } catch (SchedulerException e) {\n handler.handleError(new InternalServerErrorException(e.getMessage(), e));\n } catch (JsonException e) {\n handler.handleError(new BadRequestException(\"String_Node_Str\", e));\n } catch (Throwable t) {\n handler.handleError(ResourceUtil.adapt(t));\n }\n}\n"
|
"private void stopSettingUpProvider() {\n ProviderAPI.stop();\n mProgressBar.setVisibility(GONE);\n mProgressBar.setProgress(0);\n progressbar_description.setVisibility(TextView.GONE);\n cancelSettingUpProvider();\n}\n"
|
"public void onEvent(int evt) {\n switch(evt) {\n case JournalClientEvents.EVT_INCOMPATIBLE_JOURNAL:\n case JournalClientEvents.EVT_CLIENT_HALT:\n case JournalClientEvents.EVT_AUTH_CONFIG_ERROR:\n case JournalClientEvents.EVT_CLIENT_EXCEPTION:\n halt();\n break;\n case JournalClient.EVT_SERVER_ERROR:\n if (running.get()) {\n server.joinCluster(statusListener);\n }\n break;\n default:\n break;\n }\n}\n"
|
"private void modifySourceStaticFieldInstructionsInTargetClass(MethodDeclaration newMethodDeclaration, ASTRewrite targetRewriter) {\n ExpressionExtractor extractor = new ExpressionExtractor();\n List<Expression> sourceVariableInstructions = extractor.getVariableInstructions(sourceMethod.getBody());\n List<Expression> newVariableInstructions = extractor.getVariableInstructions(newMethodDeclaration.getBody());\n int i = 0;\n for (Expression expression : sourceVariableInstructions) {\n SimpleName simpleName = (SimpleName) expression;\n IBinding binding = simpleName.resolveBinding();\n if (binding != null && binding.getKind() == IBinding.VARIABLE) {\n IVariableBinding variableBinding = (IVariableBinding) binding;\n if (variableBinding.isField() && (variableBinding.getModifiers() & Modifier.STATIC) != 0) {\n if (sourceTypeDeclaration.resolveBinding().isEqualTo(variableBinding.getDeclaringClass())) {\n AST ast = newMethodDeclaration.getAST();\n SimpleName qualifier = ast.newSimpleName(sourceTypeDeclaration.getName().getIdentifier());\n if (simpleName.getParent() instanceof FieldAccess) {\n FieldAccess fieldAccess = (FieldAccess) newVariableInstructions.get(i).getParent();\n targetRewriter.set(fieldAccess, FieldAccess.EXPRESSION_PROPERTY, qualifier, null);\n } else if (!(simpleName.getParent() instanceof QualifiedName) && !RefactoringUtility.isEnumConstantInSwitchCaseExpression(simpleName)) {\n SimpleName newSimpleName = ast.newSimpleName(simpleName.getIdentifier());\n QualifiedName newQualifiedName = ast.newQualifiedName(qualifier, newSimpleName);\n targetRewriter.replace(newVariableInstructions.get(i), newQualifiedName, null);\n }\n this.additionalTypeBindingsToBeImportedInTargetClass.add(sourceTypeDeclaration.resolveBinding());\n setPublicModifierToSourceField(variableBinding);\n } else {\n AST ast = newMethodDeclaration.getAST();\n SimpleName qualifier = null;\n if ((variableBinding.getModifiers() & Modifier.PUBLIC) != 0) {\n qualifier = ast.newSimpleName(variableBinding.getDeclaringClass().getName());\n this.additionalTypeBindingsToBeImportedInTargetClass.add(variableBinding.getDeclaringClass());\n } else {\n qualifier = ast.newSimpleName(sourceTypeDeclaration.getName().getIdentifier());\n this.additionalTypeBindingsToBeImportedInTargetClass.add(sourceTypeDeclaration.resolveBinding());\n }\n if (simpleName.getParent() instanceof FieldAccess) {\n FieldAccess fieldAccess = (FieldAccess) newVariableInstructions.get(i).getParent();\n targetRewriter.set(fieldAccess, FieldAccess.EXPRESSION_PROPERTY, qualifier, null);\n } else if (!(simpleName.getParent() instanceof QualifiedName)) {\n SimpleName newSimpleName = ast.newSimpleName(simpleName.getIdentifier());\n QualifiedName newQualifiedName = ast.newQualifiedName(qualifier, newSimpleName);\n targetRewriter.replace(newVariableInstructions.get(i), newQualifiedName, null);\n }\n }\n }\n }\n i++;\n }\n}\n"
|
"public void onSimulationComplete() {\n data.add(\"String_Node_Str\");\n data.add(\"String_Node_Str\");\n data.add(\"String_Node_Str\");\n data.add(\"String_Node_Str\");\n SortedSet<String> active_agent_ids = sim.getactiveParticipantIdSet(\"String_Node_Str\");\n Iterator<String> iter = active_agent_ids.iterator();\n PublicEnvironmentConnection ec = PublicEnvironmentConnection.getInstance();\n while (iter.hasNext()) {\n String groupID = iter.next();\n PublicGroupDataModel dm = ec.getGroupById(groupID);\n Map<String, List<Tuple<Double, Double>>> loansGiven = LoansGroup.getLoansGiven(dm);\n double totalAmountGiven = 0;\n if (loansGiven != null) {\n for (String debtors : loansGiven.keySet()) {\n if (ec.getGroupById(debtors) == null)\n break;\n double amountBorrowed = 0;\n for (Tuple<Double, Double> t : loansGiven.get(debtors)) {\n amountBorrowed += t.getKey() * (1 + t.getValue());\n }\n totalAmountGiven += amountBorrowed;\n }\n }\n Map<String, List<Tuple<Double, Double>>> loansTaken = LoansGroup.getLoansTaken(dm);\n double totalAmountTaken = 0;\n if (loansTaken != null) {\n for (String creditors : loansTaken.keySet()) {\n if (ec.getGroupById(creditors) == null)\n break;\n double amountBorrowed = 0;\n for (Tuple<Double, Double> t : loansTaken.get(creditors)) {\n amountBorrowed += t.getKey() * (1 + t.getValue());\n }\n totalAmountTaken += amountBorrowed;\n }\n }\n String spaces = \"String_Node_Str\";\n data.add(dm.getName() + spaces + Math.round(dm.getCurrentReservedFood()) + spaces + Math.round(totalAmountGiven) + spaces + Math.round(totalAmountTaken) + spaces + averageHappiness + spaces + LoansGroup.getGreediness(dm));\n }\n}\n"
|
"public boolean isValidWord(CharSequence typed) {\n return AutoCorrection.isValidWord(mSuggest.getUnigramDictionaries(), typed, false);\n}\n"
|
"public String generateInitializeCode() throws IllegalActionException {\n StringBuffer code = new StringBuffer();\n boolean variablesAsArrays = ((BooleanToken) getCodeGenerator().variablesAsArrays.getToken()).booleanValue();\n if (variablesAsArrays) {\n CompositeActor container = (CompositeActor) _director.getContainer();\n StringBuffer code2 = new StringBuffer();\n Iterator<?> ports = container.inputPortList().iterator();\n while (ports.hasNext()) {\n TypedIOPort port = (TypedIOPort) ports.next();\n int rate = DFUtilities.getTokenInitConsumption(port);\n if (rate > 0) {\n int bufferSize = _ports.getBufferSize(port);\n code2.append(generatePortName(port) + \"String_Node_Str\" + targetType(port.getType()) + \"String_Node_Str\" + java.lang.Math.max(port.getWidth(), port.getWidthInside()) + \"String_Node_Str\" + \"String_Node_Str\" + bufferSize + \"String_Node_Str\" + _eol);\n } else if (port.getWidth() > 1 || port.getWidthInside() > 1) {\n code2.append(generatePortName(port) + \"String_Node_Str\" + targetType(port.getType()) + \"String_Node_Str\" + java.lang.Math.max(port.getWidth(), port.getWidthInside()) + \"String_Node_Str\" + _eol);\n }\n }\n ports = container.outputPortList().iterator();\n while (ports.hasNext()) {\n TypedIOPort port = (TypedIOPort) ports.next();\n int rate = DFUtilities.getTokenInitProduction(port);\n if (rate > 0) {\n int bufferSize = _ports.getBufferSize(port);\n code2.append(generatePortName(port) + \"String_Node_Str\" + targetType(port.getType()) + \"String_Node_Str\" + java.lang.Math.max(port.getWidth(), port.getWidthInside()) + \"String_Node_Str\" + \"String_Node_Str\" + bufferSize + \"String_Node_Str\" + _eol);\n } else if (port.getWidth() > 1 || port.getWidthInside() > 1) {\n code2.append(generatePortName(port) + \"String_Node_Str\" + targetType(port.getType()) + \"String_Node_Str\" + java.lang.Math.max(port.getWidth(), port.getWidthInside()) + \"String_Node_Str\" + _eol);\n }\n }\n if (code2.length() > 0) {\n code.append(getCodeGenerator().comment(\"String_Node_Str\" + \"String_Node_Str\") + code2.toString());\n }\n code.append(getCodeGenerator().comment(\"String_Node_Str\" + \"String_Node_Str\"));\n Iterator<?> actors = container.deepEntityList().iterator();\n while (actors.hasNext()) {\n Actor actor = (Actor) actors.next();\n NamedProgramCodeGeneratorAdapter adapterObject = (NamedProgramCodeGeneratorAdapter) getCodeGenerator().getAdapter(actor);\n if (actor instanceof CompositeActor && ((CompositeActor) actor).isOpaque()) {\n code.append(getCodeGenerator().comment(\"String_Node_Str\" + actor.getFullName()));\n } else {\n code.append(_generatePortVariableDeclaration(adapterObject));\n if (variablesAsArrays) {\n code.append(getCodeGenerator().comment(\"String_Node_Str\"));\n ports = actor.outputPortList().iterator();\n while (ports.hasNext()) {\n TypedIOPort port = (TypedIOPort) ports.next();\n int rate = DFUtilities.getTokenInitProduction(port);\n int bufferSize = _ports.getBufferSize(port);\n if (port.isMultiport() && rate > 0) {\n code.append(generatePortName(port) + \"String_Node_Str\" + targetType(port.getType()) + \"String_Node_Str\" + java.lang.Math.max(port.getWidth(), port.getWidthInside()) + \"String_Node_Str\" + \"String_Node_Str\" + bufferSize + \"String_Node_Str\" + _eol);\n }\n }\n }\n }\n }\n }\n code.append(super.generateInitializeCode());\n return code.toString();\n}\n"
|
"public void writeSet(MethodWriter writer, IValue instance, IValue value) throws BytecodeException {\n if (this.className == null) {\n writer.writeInsn(Opcodes.AUTO_POP);\n return;\n }\n String extended = this.type.getExtendedName();\n writer.writeFieldInsn(Opcodes.PUTSTATIC, this.className, this.name.qualified, extended);\n}\n"
|
"static List<Status> getStatusesFromSearch(Twitter tw, String json) {\n try {\n JSONObject searchResults = new JSONObject(json);\n List<Status> users = new ArrayList<Status>();\n JSONArray arr = searchResults.getJSONArray(\"String_Node_Str\");\n for (int i = 0; i < arr.length(); i++) {\n JSONObject obj = arr.getJSONObject(i);\n Status s = new Status(obj, null);\n users.add(s);\n }\n return users;\n } catch (JSONException e) {\n throw new TwitterException.Parsing(json, e);\n }\n}\n"
|
"public void testGetHistoric() {\n String playback_id = \"String_Node_Str\";\n String definition_id = \"String_Node_Str\";\n String name = \"String_Node_Str\";\n long start = 1329217703L;\n long end = 1329221303L;\n long created_at = 1334790000L;\n String status = \"String_Node_Str\";\n int progress = 45;\n int sample = 42;\n String source1 = \"String_Node_Str\";\n String source2 = \"String_Node_Str\";\n String volume_info_type1 = \"String_Node_Str\";\n int volume_info_num1 = 123;\n String volume_info_type2 = \"String_Node_Str\";\n int volume_info_num2 = 456;\n api_client.setResponse(\"String_Node_Str\" + playback_id + \"String_Node_Str\" + definition_id + \"String_Node_Str\" + name + \"String_Node_Str\" + \"String_Node_Str\" + String.valueOf(start) + \"String_Node_Str\" + String.valueOf(end) + \"String_Node_Str\" + String.valueOf(created_at) + \"String_Node_Str\" + \"String_Node_Str\" + status + \"String_Node_Str\" + String.valueOf(progress) + \"String_Node_Str\" + feed1 + \"String_Node_Str\" + feed2 + \"String_Node_Str\" + \"String_Node_Str\" + String.valueOf(sample) + \"String_Node_Str\" + volume_info_type1 + \"String_Node_Str\" + String.valueOf(volume_info_num1) + \"String_Node_Str\" + \"String_Node_Str\" + volume_info_type2 + \"String_Node_Str\" + String.valueOf(volume_info_num2) + \"String_Node_Str\", 200);\n try {\n Historic h = user.getHistoric(DataForTests.historic_playback_id);\n assertEquals(\"String_Node_Str\", playback_id, h.getHash());\n assertEquals(\"String_Node_Str\", definition_id, h.getStreamHash());\n assertEquals(\"String_Node_Str\", name, h.getName());\n assertEquals(\"String_Node_Str\", start, h.getStartDate().getTime() / 1000);\n assertEquals(\"String_Node_Str\", end, h.getEndDate().getTime() / 1000);\n assertEquals(\"String_Node_Str\", status, h.getStatus());\n assertEquals(\"String_Node_Str\", progress, h.getProgress());\n assertEquals(\"String_Node_Str\", sample, h.getSample());\n ArrayList<String> feeds = h.getFeeds();\n assertEquals(\"String_Node_Str\", 2, feeds.size());\n assertTrue(\"String_Node_Str\", feeds.contains(feed1));\n assertTrue(\"String_Node_Str\", feeds.contains(feed2));\n HashMap<String, Integer> volume_info = h.getVolumeInfo();\n assertEquals(\"String_Node_Str\", 2, volume_info.size());\n assertTrue(\"String_Node_Str\", volume_info.containsKey(volume_info_type1));\n assertTrue(\"String_Node_Str\", volume_info.containsKey(volume_info_type2));\n assertEquals(\"String_Node_Str\", volume_info_num1, volume_info.get(volume_info_type1).intValue());\n assertEquals(\"String_Node_Str\", volume_info_num2, volume_info.get(volume_info_type2).intValue());\n } catch (EInvalidData e) {\n fail(\"String_Node_Str\" + e.getMessage());\n } catch (EAccessDenied e) {\n fail(\"String_Node_Str\" + e.getMessage());\n } catch (EAPIError e) {\n fail(\"String_Node_Str\" + e.getMessage());\n }\n}\n"
|
"public static String getDriverClass(Connection conn) {\n DatabaseConnection dbConn = SwitchHelpers.DATABASECONNECTION_SWITCH.doSwitch(conn);\n if (dbConn != null) {\n String driverClassName = dbConn.getDriverClass();\n if (driverClassName == null) {\n SupportDBUrlType dbType = SupportDBUrlStore.getInstance().findDBTypeByName(dbConn.getDatabaseType());\n if (dbType != null) {\n driverClassName = dbType.getDbDriver();\n }\n }\n return driverClassName;\n }\n MDMConnection mdmConn = SwitchHelpers.MDMCONNECTION_SWITCH.doSwitch(conn);\n if (mdmConn != null) {\n return \"String_Node_Str\";\n }\n return null;\n}\n"
|
"public DataSerializableFactory createFactory() {\n ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[TXN_ROLLBACK_BACKUP + 1];\n constructors[CLEAR_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new ClearBackupOperation();\n }\n };\n constructors[CLEAR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new ClearOperation();\n }\n };\n constructors[CONTAINS_ENTRY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new ContainsEntryOperation();\n }\n };\n constructors[COUNT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new CountOperation();\n }\n };\n constructors[ENTRY_SET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new EntrySetOperation();\n }\n };\n constructors[GET_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new GetAllOperation();\n }\n };\n constructors[KEY_SET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new KeySetOperation();\n }\n };\n constructors[PUT_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new PutBackupOperation();\n }\n };\n constructors[PUT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new PutOperation();\n }\n };\n constructors[REMOVE_ALL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new RemoveAllBackupOperation();\n }\n };\n constructors[REMOVE_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new RemoveAllOperation();\n }\n };\n constructors[REMOVE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new RemoveBackupOperation();\n }\n };\n constructors[REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new RemoveOperation();\n }\n };\n constructors[SIZE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new SizeOperation();\n }\n };\n constructors[VALUES] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new ValuesOperation();\n }\n };\n constructors[TXN_COMMIT_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnCommitBackupOperation();\n }\n };\n constructors[TXN_COMMIT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnCommitOperation();\n }\n };\n constructors[TXN_GENERATE_RECORD_ID] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnGenerateRecordIdOperation();\n }\n };\n constructors[TXN_LOCK_AND_GET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnLockAndGetOperation();\n }\n };\n constructors[TXN_PREPARE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnPrepareBackupOperation();\n }\n };\n constructors[TXN_PREPARE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnPrepareOperation();\n }\n };\n constructors[TXN_PUT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnPutOperation();\n }\n };\n constructors[TXN_REMOVE_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnRemoveAllOperation();\n }\n };\n constructors[TXN_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnRemoveOperation();\n }\n };\n constructors[TXN_ROLLBACK_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnRollbackBackupOperation();\n }\n };\n constructors[TXN_ROLLBACK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {\n public IdentifiedDataSerializable createNew(Integer arg) {\n return new TxnRollbackOperation();\n }\n };\n return new ArrayDataSerializableFactory(constructors);\n}\n"
|
"protected boolean doExecute() throws Exception {\n boolean result = true;\n folderMap = initStructure();\n for (File folder : folderMap.keySet()) {\n try {\n if (isWorksapcePath()) {\n tansferFile(folder);\n } else {\n if (folder.exists()) {\n FileUtils.copyDirectory(folder, folderMap.get(folder));\n }\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n File tdqMetadataFile = getWorkspacePath().append(OLD_MEATADATA_FOLDER_NAME).toFile();\n if (tdqMetadataFile.exists()) {\n FileUtils.deleteDirectory(tdqMetadataFile);\n }\n File fileAnalysis = getWorkspacePath().append(EResourceConstant.ANALYSIS.getPath()).toFile();\n File fileRule = getWorkspacePath().append(EResourceConstant.RULES.getPath()).toFile();\n try {\n String[] anaFileExtentionNames = { FactoriesUtil.ANA };\n String[] rulesFileEctentionNames = { FactoriesUtil.DQRULE };\n result &= FilesUtils.migrateFolder(fileAnalysis, anaFileExtentionNames, this.getReplaceStringMap(), log) && FilesUtils.migrateFolder(fileRule, rulesFileEctentionNames, this.getReplaceStringMap(), log);\n AnaResourceFileHelper.getInstance().clear();\n ResourceService.refreshStructure();\n } catch (Exception e) {\n result = false;\n log.error(e, e);\n }\n return result;\n}\n"
|
"protected NAWelcomeHome updateReadings() {\n NAWelcomeHome result = null;\n NAWelcomeHomeData homeDataBody = getBridgeHandler().getWelcomeDataBody(getId());\n if (homeDataBody != null) {\n dataTimeStamp = (int) Calendar.getInstance().getTimeInMillis() / 1000;\n result = homeDataBody.getHomes().stream().filter(device -> device.getId().equalsIgnoreCase(getId())).findFirst().orElse(null);\n if (result != null) {\n result.getCameras().forEach(camera -> childs.put(camera.getId(), camera));\n iPersons = 0;\n iUnknowns = 0;\n logger.debug(\"String_Node_Str\", getId());\n result.getPersons().forEach(person -> {\n iPersons += person.getOutOfSight() ? 0 : 1;\n if (person.getPseudo() != null) {\n childs.put(person.getId(), person);\n } else {\n iUnknowns += person.getOutOfSight() ? 0 : 1;\n }\n });\n result.getEvents().forEach(event -> {\n if (lastEvent == null || lastEvent.getTime() < event.getTime()) {\n lastEvent = event;\n }\n });\n }\n }\n return result;\n}\n"
|
"private void updateUI(IJobChangeEvent event) {\n final List<ReturnCode> information = new ArrayList<ReturnCode>();\n setEnabled(true);\n if (fExtensionDownloaded > 0) {\n for (IEcosComponent componet : fInstalledComponents) {\n List<File> validFiles = extractFiles(componet, information);\n if (!validFiles.isEmpty()) {\n String categoryName = componet.getCategry().getName();\n EEcosCategory ecosCategory = EEcosCategory.getEcosCategory(categoryName);\n if (ecosCategory != null) {\n EResourceConstant resourceType = ecosCategory.getResource();\n for (File oneFile : validFiles) {\n information.addAll(ImportFactory.doInport(resourceType, oneFile, componet.getName()));\n }\n }\n }\n }\n if (information.isEmpty()) {\n information.add(new ReturnCode(DefaultMessagesImpl.getString(\"String_Node_Str\"), false));\n }\n ImportInfoDialog.openImportInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DefaultMessagesImpl.getString(\"String_Node_Str\"), (ReturnCode[]) information.toArray(new ReturnCode[0]));\n CorePlugin.getDefault().refreshDQView();\n }\n}\n"
|
"public void execute(Hero hero, String action) {\n if (action.equals(AC_EAT)) {\n if (potionAttrib == null) {\n detach(hero.belongings.backpack);\n ((Hunger) hero.buff(Hunger.class)).satisfy(energy);\n GLog.i(message);\n hero.sprite.operate(hero.pos);\n hero.busy();\n SpellSprite.show(hero, SpellSprite.FOOD);\n Sample.INSTANCE.play(Assets.SND_EAT);\n hero.spend(1f);\n Statistics.foodEaten++;\n Badges.validateFoodEaten();\n } else\n super.execute(hero, action);\n } else if (action.equals(AC_EAT)) {\n ((Hunger) hero.buff(Hunger.class)).satisfy(Hunger.HUNGRY);\n detach(hero.belongings.backpack);\n hero.spend(1f);\n hero.busy();\n if (potionAttrib instanceof PotionOfFrost) {\n GLog.i(\"String_Node_Str\");\n switch(Random.Int(5)) {\n case 0:\n GLog.i(\"String_Node_Str\");\n Buff.affect(hero, Invisibility.class, Invisibility.DURATION);\n break;\n case 1:\n GLog.i(\"String_Node_Str\");\n Buff.affect(hero, Barkskin.class).level(hero.HT / 4);\n break;\n case 2:\n GLog.i(\"String_Node_Str\");\n Buff.detach(hero, Poison.class);\n Buff.detach(hero, Cripple.class);\n Buff.detach(hero, Weakness.class);\n Buff.detach(hero, Bleeding.class);\n break;\n case 3:\n GLog.i(\"String_Node_Str\");\n if (hero.HP < hero.HT) {\n hero.HP = Math.min(hero.HP + hero.HT / 4, hero.HT);\n hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);\n }\n break;\n }\n } else\n potionAttrib.apply(hero);\n Sample.INSTANCE.play(Assets.SND_EAT);\n hero.sprite.operate(hero.pos);\n switch(hero.heroClass) {\n case WARRIOR:\n if (hero.HP < hero.HT) {\n hero.HP = Math.min(hero.HP + 5, hero.HT);\n hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);\n }\n break;\n case MAGE:\n hero.belongings.charge(false);\n ScrollOfRecharging.charge(hero);\n break;\n case ROGUE:\n case HUNTRESS:\n break;\n }\n } else if (action.equals(AC_THROW)) {\n if (potionAttrib instanceof PotionOfLiquidFlame || potionAttrib instanceof PotionOfToxicGas || potionAttrib instanceof PotionOfParalyticGas || potionAttrib instanceof PotionOfFrost) {\n potionAttrib.execute(hero, action);\n } else {\n super.execute(hero, action);\n }\n } else {\n super.execute(hero, action);\n }\n}\n"
|
"private void renderElectro(TileEntityXenAmethyst ent, Tessellator t, double x, double y, double z) {\n double dx = ent.lastxCoord, dy = ent.lastyCoord, dz = ent.lastzCoord;\n double tx = 0.0, ty = 0.4, tz = 0.0;\n GL11.glPushMatrix();\n {\n GL11.glDisable(GL11.GL_CULL_FACE);\n GL11.glDisable(GL11.GL_LIGHTING);\n GL11.glEnable(GL11.GL_BLEND);\n GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);\n RenderUtils.loadTexture(ClientProps.VORTIGAUNT_RAY_PATH[RNG.nextInt(3)]);\n Vec3 v1 = RenderUtils.newV3(tx - WIDTH, ty, tz), v2 = RenderUtils.newV3(tx + WIDTH, ty, tz), v3 = RenderUtils.newV3(tx, ty - WIDTH, tz), v4 = RenderUtils.newV3(tx, ty + WIDTH, tz);\n double d = Math.sqrt(dx * dx + dy * dy + dz * dz) * 1.3;\n GL11.glTranslated(x + 0.5, y + 0.1, z + 0.5);\n OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f);\n t.startDrawingQuads();\n t.setBrightness(15728880);\n t.setColorRGBA_F(0.663F, 0.263F, 1.0F, 0.65F);\n RenderUtils.addVertex(v1, 0, 0);\n RenderUtils.addVertex(v2, 1, 0);\n RenderUtils.addVertex(v2.addVector(dx, dy, dz), 1, d);\n RenderUtils.addVertex(v1.addVector(dx, dy, dz), 0, d);\n RenderUtils.addVertex(v3, 0, 0);\n RenderUtils.addVertex(v4, 1, 0);\n RenderUtils.addVertex(v4.addVector(dx, dy, dz), 1, d);\n RenderUtils.addVertex(v3.addVector(dx, dy, dz), 0, d);\n t.draw();\n GL11.glEnable(GL11.GL_CULL_FACE);\n GL11.glEnable(GL11.GL_LIGHTING);\n GL11.glDisable(GL11.GL_BLEND);\n }\n GL11.glPopMatrix();\n}\n"
|
"private void performPullImage(final ImagePull wizard) {\n final Job pullImageJob = new Job(DVMessages.getFormattedString(PULL_IMAGE_JOB_TITLE, wizard.getImageId())) {\n\n protected IStatus run(final IProgressMonitor monitor) {\n final String id = wizard.getImageId();\n monitor.beginTask(DVMessages.getString(PULL_IMAGE_JOB_TITLE), 1);\n try {\n ((DockerConnection) connection).pullImage(id, new ImagePullProgressHandler(connection, id));\n monitor.worked(1);\n } catch (final DockerException e) {\n Display.getDefault().syncExec(new Runnable() {\n public void run() {\n MessageDialog.openError(Display.getCurrent().getActiveShell(), DVMessages.getFormattedString(ERROR_PULLING_IMAGE, id), e.getMessage());\n }\n });\n } catch (InterruptedException e) {\n } finally {\n monitor.done();\n }\n return Status.OK_STATUS;\n }\n };\n pullImageJob.schedule();\n}\n"
|
"public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {\n int returnValue;\n SQLiteDatabase db = mEnvironmentDbHelper.getWritableDatabase();\n switch(sUriMatcher.match(uri)) {\n case ENVIRONMENT_WITH_ID:\n selection = EnvironmentEntry._ID + \"String_Node_Str\";\n selectionArgs = new String[] { getIdFromUriAsString(uri) };\n case ENVIRONMENT:\n returnValue = db.update(EnvironmentEntry.TABLE_NAME, values, selection, selectionArgs);\n break;\n case ENVIRONMENT_WITH_ID_AND_GEOFENCES:\n long[] geofenceIds = insertEnvironmentLocation(uri, db, values);\n long newGeofenceId = geofenceIds[1];\n long oldGeofenceId = geofenceIds[0];\n selection = GeoFenceEntry._ID + \"String_Node_Str\";\n selectionArgs = new String[] { String.valueOf(oldGeofenceId) };\n returnValue = (newGeofenceId != oldGeofenceId) ? 1 : 0;\n returnValue += deleteEnvironmentVariableWithUsageSearch(EnvironmentEntry.COLUMN_GEOFENCE_ID, GeoFenceEntry._ID, GeoFenceEntry.TABLE_NAME, selection, selectionArgs, db);\n break;\n case ENVIRONMENT_WITH_ID_AND_WIFI_NETWORKS:\n environmentId = Long.parseLong(uri.getPathSegments().get(1));\n long newWifiId = db.insert(WiFiNetworksEntry.TABLE_NAME, null, values);\n long oldWifiId = changeEnvironmentVariableValue(EnvironmentEntry.COLUMN_IS_WIFI_ENABLED, 1, EnvironmentEntry.COLUMN_WIFI_ID, newWifiId, environmentId, db);\n selection = WiFiNetworksEntry._ID + \"String_Node_Str\";\n selectionArgs = new String[] { String.valueOf(oldWifiId) };\n returnValue = (newWifiId != oldWifiId) ? 1 : 0;\n returnValue += deleteEnvironmentVariableWithUsageSearch(EnvironmentEntry.COLUMN_WIFI_ID, WiFiNetworksEntry._ID, WiFiNetworksEntry.TABLE_NAME, selection, selectionArgs, db);\n break;\n case USER_WITH_ID_ENVIRONMENT_AND_PASSWORD:\n returnValue = updatePasswordForUserAndEnvironment(db, uri, values);\n break;\n default:\n throw new UnsupportedOperationException(\"String_Node_Str\" + uri);\n }\n getContext().getContentResolver().notifyChange(uri, null);\n return returnValue;\n}\n"
|
"public void releaseCows(Transaction cowTxId, int param) {\n NeoPrimitiveElement element = cowMap.get(cowTxId);\n if (element == null) {\n return;\n }\n ArrayMap<Integer, CowNodeElement> cowNodeElements = element.nodes;\n for (int nodeId : cowNodeElements.keySet()) {\n NodeImpl node = nodeManager.getNodeIfCached(nodeId);\n if (node != null) {\n if (param == Status.STATUS_COMMITTED) {\n node.commitCowMaps();\n } else if (param == Status.STATUS_ROLLEDBACK) {\n node.rollbackCowMaps();\n } else {\n throw new RuntimeException(\"String_Node_Str\" + param);\n }\n }\n }\n ArrayMap<Integer, CowRelElement> cowRelElements = element.relationships;\n for (int relId : cowRelElements.keySet()) {\n RelationshipImpl rel = nodeManager.getRelIfCached(relId);\n if (rel != null && rel.getCowTxId() != null) {\n if (param == Status.STATUS_COMMITTED) {\n rel.commitCowMaps();\n } else if (param == Status.STATUS_ROLLEDBACK) {\n rel.rollbackCowMaps();\n } else {\n throw new RuntimeException(\"String_Node_Str\" + param);\n }\n }\n }\n cowMap.remove(cowTxId);\n}\n"
|
"public void setSyncDelay(int ms) {\n mRequestDelayMs = Math.max(0, ms);\n Log.d(LOG_TAG, \"String_Node_Str\" + mRequestDelayMs);\n Handler handler = (null != mThreadHandler) ? mThreadHandler : new Handler(Looper.getMainLooper());\n handler.post(new Runnable() {\n public void run() {\n if (null != mSyncDelayTimer) {\n Log.d(LOG_TAG, \"String_Node_Str\");\n mSyncDelayTimer.cancel();\n synchronized (mSyncObject) {\n mSyncObject.notify();\n }\n }\n }\n });\n}\n"
|
"public void restartAllInstances() {\n Iterable<TwillController> twillControllers = twillRunnerService.lookup(Constants.Service.MASTER_SERVICES);\n for (TwillController twillController : twillControllers) {\n Futures.getUnchecked(twillController.restartAllInstances(serviceName));\n }\n}\n"
|
"public StringCalc compileString(Exp exp) {\n return (StringCalc) compileScalar(exp, false);\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.