idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
667,417
public Mat run(Mat inputMat, ImageBlob imageBlob) {<NEW_LINE>int origin_w = inputMat.width();<NEW_LINE>int origin_h = inputMat.height();<NEW_LINE>imageBlob.getReshapeInfo().put("resize", new int[] { origin_w, origin_h });<NEW_LINE>int im_size_max = Math.max(origin_w, origin_h);<NEW_LINE>float scale = (float) (long_size) / (float) (im_size_max);<NEW_LINE>int width = Math.round(scale * origin_w);<NEW_LINE>int height = <MASK><NEW_LINE>Size sz = new Size(width, height);<NEW_LINE>Imgproc.resize(inputMat, inputMat, sz, 0, 0, interpMap.get(interp));<NEW_LINE>imageBlob.setNewImageSize(inputMat.height(), 2);<NEW_LINE>imageBlob.setNewImageSize(inputMat.width(), 3);<NEW_LINE>imageBlob.setScale(scale);<NEW_LINE>return inputMat;<NEW_LINE>}
Math.round(scale * origin_h);
1,811,279
public BuiltInScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, FunctionAndTypeManager functionAndTypeManager) {<NEW_LINE>DistinctType type = (DistinctType) boundVariables.getTypeVariable("T");<NEW_LINE>Type baseType = type.getBaseType();<NEW_LINE>FunctionHandle functionHandle = functionAndTypeManager.resolveOperator(IS_DISTINCT_FROM, fromTypes(baseType, baseType));<NEW_LINE>FunctionInvoker nullFlagfunctionInvoker = functionAndTypeManager.getFunctionInvokerProvider().createFunctionInvoker(functionHandle, Optional.of(new InvocationConvention(ImmutableList.of(NULL_FLAG, NULL_FLAG), FAIL_ON_NULL, false)));<NEW_LINE>FunctionInvoker blockPositionfunctionInvoker = functionAndTypeManager.getFunctionInvokerProvider().createFunctionInvoker(functionHandle, Optional.of(new InvocationConvention(ImmutableList.of(BLOCK_POSITION, BLOCK_POSITION), FAIL_ON_NULL, false)));<NEW_LINE>return new BuiltInScalarFunctionImplementation(ImmutableList.of(new ScalarFunctionImplementationChoice(false, ImmutableList.of(valueTypeArgumentProperty(NULL_FLAG), valueTypeArgumentProperty(NULL_FLAG)), ReturnPlaceConvention.STACK, nullFlagfunctionInvoker.methodHandle(), Optional.empty()), new ScalarFunctionImplementationChoice(false, ImmutableList.of(valueTypeArgumentProperty(BLOCK_AND_POSITION), valueTypeArgumentProperty(BLOCK_AND_POSITION)), ReturnPlaceConvention.STACK, blockPositionfunctionInvoker.methodHandle(), <MASK><NEW_LINE>}
Optional.empty())));
361,508
private void syncUpstreamsForService(SingularityRequest singularityRequest) {<NEW_LINE>final <MASK><NEW_LINE>LOG.debug("Starting syncing of upstreams for service: {}.", singularityRequestId);<NEW_LINE>if (!singularityRequest.isLoadBalanced()) {<NEW_LINE>LOG.debug("Singularity service {} is not load balanced. Terminating syncing.", singularityRequestId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Optional<String> maybeDeployId = deployManager.getActiveDeployId(singularityRequestId);<NEW_LINE>if (!maybeDeployId.isPresent()) {<NEW_LINE>LOG.debug("Active deploy for service {} is absent. Terminating syncing.", singularityRequestId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Optional<SingularityDeploy> maybeDeploy = deployManager.getDeploy(singularityRequestId, maybeDeployId.get());<NEW_LINE>if (!maybeDeploy.isPresent()) {<NEW_LINE>LOG.debug("Deploy for service {} with deployId {} is absent. Terminating syncing.", singularityRequestId, maybeDeployId.get());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Optional<SingularityLoadBalancerUpdate> maybeSyncUpstreamsUpdate = syncUpstreamsForServiceHelper(singularityRequest, maybeDeploy.get(), maybeDeploy.get().getLoadBalancerUpstreamGroup());<NEW_LINE>if (!maybeSyncUpstreamsUpdate.isPresent()) {<NEW_LINE>LOG.debug("Update of syncing of upstreams for service {} and deploy {} is absent. Terminating syncing.", singularityRequestId, maybeDeployId.get());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkSyncUpstreamsState(maybeSyncUpstreamsUpdate.get().getLoadBalancerRequestId(), singularityRequestId);<NEW_LINE>}
String singularityRequestId = singularityRequest.getId();
267,872
public Request<DescribeVpcClassicLinkRequest> marshall(DescribeVpcClassicLinkRequest describeVpcClassicLinkRequest) {<NEW_LINE>if (describeVpcClassicLinkRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeVpcClassicLinkRequest> request = new DefaultRequest<DescribeVpcClassicLinkRequest>(describeVpcClassicLinkRequest, "AmazonEC2");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2015-10-01");<NEW_LINE>java.util.List<String> vpcIdsList = describeVpcClassicLinkRequest.getVpcIds();<NEW_LINE>int vpcIdsListIndex = 1;<NEW_LINE>for (String vpcIdsListValue : vpcIdsList) {<NEW_LINE>if (vpcIdsListValue != null) {<NEW_LINE>request.addParameter("VpcId." + vpcIdsListIndex, StringUtils.fromString(vpcIdsListValue));<NEW_LINE>}<NEW_LINE>vpcIdsListIndex++;<NEW_LINE>}<NEW_LINE>java.util.List<Filter> filtersList = describeVpcClassicLinkRequest.getFilters();<NEW_LINE>int filtersListIndex = 1;<NEW_LINE>for (Filter filtersListValue : filtersList) {<NEW_LINE>Filter filterMember = filtersListValue;<NEW_LINE>if (filterMember != null) {<NEW_LINE>if (filterMember.getName() != null) {<NEW_LINE>request.addParameter("Filter." + filtersListIndex + ".Name", StringUtils.fromString(filterMember.getName()));<NEW_LINE>}<NEW_LINE>java.util.List<String> valuesList = filterMember.getValues();<NEW_LINE>int valuesListIndex = 1;<NEW_LINE>for (String valuesListValue : valuesList) {<NEW_LINE>if (valuesListValue != null) {<NEW_LINE>request.addParameter("Filter." + filtersListIndex + ".Value." + valuesListIndex, StringUtils.fromString(valuesListValue));<NEW_LINE>}<NEW_LINE>valuesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filtersListIndex++;<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Action", "DescribeVpcClassicLink");
1,624,089
public void loadConfig(Context context) {<NEW_LINE>SharedPreferences s = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);<NEW_LINE>mEnables[POSITION_ADJUST_BITRATE] = s.getBoolean(SP_KEY_ADJUST_BITRATE, mEnables[POSITION_ADJUST_BITRATE]);<NEW_LINE>mEnables[POSITION_EAR_MONITORING_ENABLE] = s.getBoolean(SP_KEY_EAR_MONITORING, mEnables[POSITION_EAR_MONITORING_ENABLE]);<NEW_LINE>mEnables[POSITION_MUTE_AUDIO] = s.getBoolean(SP_KEY_MUTE_AUDIO, mEnables[POSITION_MUTE_AUDIO]);<NEW_LINE>mEnables[POSITION_LANDSCAPE] = s.getBoolean(SP_KEY_LANDSCAPE, mEnables[POSITION_LANDSCAPE]);<NEW_LINE>mEnables[POSITION_WATER_MARK_ENABLE] = s.getBoolean<MASK><NEW_LINE>mEnables[POSITION_MIRROR_ENABLE] = s.getBoolean(SP_KEY_MIRROR, mEnables[POSITION_MIRROR_ENABLE]);<NEW_LINE>mEnables[POSITION_FLASH_ENABLE] = s.getBoolean(SP_KEY_FLASH_LIGHT, mEnables[POSITION_FLASH_ENABLE]);<NEW_LINE>mEnables[POSITION_FOCUS_ENABLE] = s.getBoolean(SP_KEY_FOCUS, mEnables[POSITION_FOCUS_ENABLE]);<NEW_LINE>mEnables[POSITION_PRIVACY_MODEL_ENABLE] = s.getBoolean(SP_KEY_PRIVACY_MODEL, mEnables[POSITION_PRIVACY_MODEL_ENABLE]);<NEW_LINE>mAudioQualityIndex = s.getInt(SP_KEY_AUDIO_QUALITY, mAudioQualityIndex);<NEW_LINE>}
(SP_KEY_WATER_MARK, mEnables[POSITION_WATER_MARK_ENABLE]);
99,952
public static IRubyObject compile(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) {<NEW_LINE>// def compile(content = nil, filename = DEFAULT_FILENAME, extra_position_info = false, &block)<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>final RubyString content = args[0].convertToString();<NEW_LINE>args[0] = content;<NEW_LINE>final RubyString filename = args.length > 1 ? args[1].convertToString() : RubyString.newEmptyString(runtime);<NEW_LINE>IRScriptBody scope = <MASK><NEW_LINE>JVMVisitor visitor = JVMVisitor.newForJIT(runtime);<NEW_LINE>JVMVisitorMethodContext methodContext = new JVMVisitorMethodContext();<NEW_LINE>byte[] bytes = visitor.compileToBytecode(scope, methodContext);<NEW_LINE>scope.getStaticScope().setModule(runtime.getTopSelf().getMetaClass());<NEW_LINE>RubyClass CompiledScript = (RubyClass) runtime.getModule("JRuby").getConstantAt("CompiledScript");<NEW_LINE>// JRuby::CompiledScript#initialize(filename, class_name, content, bytes)<NEW_LINE>return CompiledScript.newInstance(context, new IRubyObject[] { filename, runtime.newSymbol(scope.getId()), content, Java.getInstance(runtime, bytes) }, Block.NULL_BLOCK);<NEW_LINE>}
compileIR(context, args, block);
407,789
public void testNonXAOptionBRollback() throws Exception {<NEW_LINE>prepareTRA();<NEW_LINE>resetData(keyMDBRollback04);<NEW_LINE>String deliveryID = "TX_test2d";<NEW_LINE>// construct a FVTMessage<NEW_LINE>FVTMessage message = new FVTMessage();<NEW_LINE>message.addTestResult("CMTNonJMSRequired");<NEW_LINE>// Add a option A delivery.<NEW_LINE>Method m = MessageListener.class.getMethod("onStringMessage", new Class[] { String.class });<NEW_LINE>message.addDelivery("CMTNonJMSRequired", FVTMessage.BEFORE_DELIVERY, m);<NEW_LINE>message.add("CMTNonJMSRequired", "DB-" + keyMDBRollback04, m);<NEW_LINE>message.addDelivery("CMTNonJMSRequired", FVTMessage.AFTER_DELIVERY, null);<NEW_LINE>System.out.println(message.toString());<NEW_LINE>// d248457.1<NEW_LINE>XidImpl xid = XidImpl.createXid(24, 10);<NEW_LINE>provider.sendMessageWait(deliveryID, message, WorkEvent.WORK_COMPLETED, xid, FVTMessageProvider.DO_WORK);<NEW_LINE>XATerminator xaTerm = provider.getXATerminator();<NEW_LINE>xaTerm.rollback(xid);<NEW_LINE>// Get the first test result array for the endpoint instance 0<NEW_LINE>MessageEndpointTestResults results = provider.getTestResult(deliveryID);<NEW_LINE>assertTrue("isDeliveryTransacted returns true for a method with the Required attribute.", results.isDeliveryTransacted());<NEW_LINE>assertTrue("Number of messages delivered is 1", <MASK><NEW_LINE>assertTrue("Delivery option B is used for this test.", results.optionBMessageDeliveryUsed());<NEW_LINE>// assertTrue("This message delivery is in a global transaction context.", results.mdbInvokedInGlobalTransactionContext());<NEW_LINE>assertFalse("The RA XAResource should be enlisted in the global transaction.", results.raXaResourceEnlisted());<NEW_LINE>assertFalse("commit is not driven on the XAResource provided by TRA.", results.raXaResourceCommitWasDriven());<NEW_LINE>assertFalse("rollback is not driven on the XAResource provided by TRA.", results.raXaResourceRollbackWasDriven());<NEW_LINE>provider.releaseDeliveryId(deliveryID);<NEW_LINE>// verify keyMDBRollback04<NEW_LINE>assertTrue(keyMDBRollback04 + " -- intValue is not updated.", (verifyData(keyMDBRollback04) == 0));<NEW_LINE>}
results.getNumberOfMessagesDelivered() == 1);
370,171
//<NEW_LINE>@Override<NEW_LINE>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>String <MASK><NEW_LINE>PrintWriter out = response.getWriter();<NEW_LINE>out.println("Starting " + test + "<br>");<NEW_LINE>// The injection engine doesn't like this at the class level.<NEW_LINE>// injection<NEW_LINE>TraceComponent tc = Tr.register(JMSContext_118070Servlet.class);<NEW_LINE>Tr.entry(this, tc, test);<NEW_LINE>try {<NEW_LINE>getClass().getMethod(test, HttpServletRequest.class, HttpServletResponse.class).invoke(this, request, response);<NEW_LINE>System.out.println(" Starting : " + test);<NEW_LINE>out.println(test + " COMPLETED SUCCESSFULLY");<NEW_LINE>System.out.println(" Ending : " + test);<NEW_LINE>Tr.exit(this, tc, test);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (e instanceof InvocationTargetException) {<NEW_LINE>e = e.getCause();<NEW_LINE>}<NEW_LINE>out.println("<pre>ERROR in " + test + ":");<NEW_LINE>System.out.println(" Ending : " + test);<NEW_LINE>System.out.println(" <ERROR> " + e.getMessage() + " </ERROR>");<NEW_LINE>e.printStackTrace(out);<NEW_LINE>out.println("</pre>");<NEW_LINE>Tr.exit(this, tc, test, e);<NEW_LINE>}<NEW_LINE>}
test = request.getParameter("test");
723,634
private static Set<ProxyClassLoader> coalesceAppend(ClassLoader root, Set<ProxyClassLoader> existing, ClassLoader[] appended, ClassLoader[] systemCL) throws IllegalArgumentException {<NEW_LINE>int likelySize = existing.size() + appended.length;<NEW_LINE>LinkedHashSet<ClassLoader> uniq = new LinkedHashSet<ClassLoader>(likelySize);<NEW_LINE>uniq.addAll(existing);<NEW_LINE>if (uniq.containsAll(Arrays.asList(appended))) {<NEW_LINE>return existing;<NEW_LINE>}<NEW_LINE>// No change required.<NEW_LINE>for (ClassLoader l : appended) {<NEW_LINE>addRec(root, uniq, l);<NEW_LINE>}<NEW_LINE>// add all loaders (maybe recursively)<NEW_LINE>// validate the configuration<NEW_LINE>// it is valid if all heading non-ProxyClassLoaders are parents of the last one<NEW_LINE>boolean head = true;<NEW_LINE>Set<ProxyClassLoader> pcls = new LinkedHashSet<ProxyClassLoader>(uniq.size());<NEW_LINE>for (ClassLoader l : uniq) {<NEW_LINE>if (head) {<NEW_LINE>if (l instanceof ProxyClassLoader) {<NEW_LINE>// only PCLs after this point<NEW_LINE>head = false;<NEW_LINE>pcls.add((ProxyClassLoader) l);<NEW_LINE>} else {<NEW_LINE>if (isParentOf(systemCL[0], l)) {<NEW_LINE>systemCL[0] = l;<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Bad ClassLoader ordering: " + Arrays.asList(appended));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (l instanceof ProxyClassLoader) {<NEW_LINE>pcls<MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Bad ClassLoader ordering: " + Arrays.asList(appended));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return pcls;<NEW_LINE>}
.add((ProxyClassLoader) l);
718,277
private void deletePlannedPO() {<NEW_LINE>String sql = "DELETE FROM PP_MRP " + "WHERE EXISTS(SELECT 1 FROM M_Requisition " + " WHERE M_Requisition_ID = PP_MRP.M_Requisition_ID" + " AND DocStatus = 'DR' " + " AND Processed='N' " + " AND AD_Client_ID = ? " + " AND C_DocType_ID = ?)";<NEW_LINE>int noOfLinesDeleted = DB.executeUpdateEx(sql, new Object[] { getAD_Client_ID(), docTypeMRPRequisition }, get_TrxName());<NEW_LINE>log.fine("No. of Material Requirement Planning (PP_MRP) Line deleted : " + noOfLinesDeleted);<NEW_LINE>sql = "DELETE FROM M_RequisitionLine " + "WHERE EXISTS(SELECT 1 FROM M_Requisition " + " WHERE M_Requisition_ID = M_RequisitionLine.M_Requisition_ID" <MASK><NEW_LINE>noOfLinesDeleted = DB.executeUpdateEx(sql, new Object[] { getAD_Client_ID(), docTypeMRPRequisition }, get_TrxName());<NEW_LINE>log.fine("No. of MRP Requisition Line deleted : " + noOfLinesDeleted);<NEW_LINE>sql = "DELETE FROM M_Requisition " + "WHERE DocStatus = 'DR' " + "AND Processed='N' " + "AND AD_Client_ID = ? " + "AND C_DocType_ID = ?";<NEW_LINE>noOfLinesDeleted = DB.executeUpdateEx(sql, new Object[] { getAD_Client_ID(), docTypeMRPRequisition }, get_TrxName());<NEW_LINE>log.fine("No. of MRP Requisition deleted : " + noOfLinesDeleted);<NEW_LINE>}
+ " AND DocStatus = 'DR' " + " AND Processed='N' " + " AND AD_Client_ID = ? " + " AND C_DocType_ID = ?)";
1,810,654
public void run() {<NEW_LINE>try (ZContext ctx = new ZContext()) {<NEW_LINE>Socket client = ctx.createSocket(SocketType.DEALER);<NEW_LINE>// Set random identity to make tracing easier<NEW_LINE>String identity = String.format("%04X-%04X", rand.nextInt(), rand.nextInt());<NEW_LINE>client.setIdentity(identity.getBytes(ZMQ.CHARSET));<NEW_LINE>client.connect("tcp://localhost:5570");<NEW_LINE>Poller poller = ctx.createPoller(1);<NEW_LINE>poller.register(client, Poller.POLLIN);<NEW_LINE>int requestNbr = 0;<NEW_LINE>while (!Thread.currentThread().isInterrupted()) {<NEW_LINE>// Tick once per second, pulling in arriving messages<NEW_LINE>for (int centitick = 0; centitick < 100; centitick++) {<NEW_LINE>poller.poll(10);<NEW_LINE>if (poller.pollin(0)) {<NEW_LINE>ZMsg <MASK><NEW_LINE>msg.getLast().print(identity);<NEW_LINE>msg.destroy();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>client.send(String.format("request #%d", ++requestNbr), 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
msg = ZMsg.recvMsg(client);
722,760
final EnableDomainTransferLockResult executeEnableDomainTransferLock(EnableDomainTransferLockRequest enableDomainTransferLockRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableDomainTransferLockRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableDomainTransferLockRequest> request = null;<NEW_LINE>Response<EnableDomainTransferLockResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableDomainTransferLockRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableDomainTransferLockRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Route 53 Domains");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableDomainTransferLock");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EnableDomainTransferLockResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableDomainTransferLockResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,165,560
public void showErrorLog() {<NEW_LINE>// terminate timer<NEW_LINE>if (flashErrorIconTimer != null) {<NEW_LINE>// if timer was running, cancel it<NEW_LINE>flashErrorIconTimer.cancel();<NEW_LINE>// purge it from the task-list<NEW_LINE>flashErrorIconTimer.purge();<NEW_LINE>// free timer-object<NEW_LINE>flashErrorIconTimer = null;<NEW_LINE>}<NEW_LINE>// hide button<NEW_LINE>statusErrorButton.setVisible(false);<NEW_LINE>if (null == errorDlg) {<NEW_LINE>errorDlg = new CErrorLog(<MASK><NEW_LINE>errorDlg.setLocationRelativeTo(getFrame());<NEW_LINE>}<NEW_LINE>ZettelkastenApp.getApplication().show(errorDlg);<NEW_LINE>// we have to manually dispose the window and release the memory<NEW_LINE>// because next time this method is called, the showKwlDlg is still not null,<NEW_LINE>// i.e. the constructor is not called (because the if-statement above is not true)<NEW_LINE>errorDlg.dispose();<NEW_LINE>errorDlg = null;<NEW_LINE>}
getFrame(), this, settings);
1,521,013
public StructureDefinition snapshot(@IdParam(optional = true) IdType theId, @OperationParam(name = "definition") StructureDefinition theStructureDefinition, @OperationParam(name = "url") StringType theUrl, RequestDetails theRequestDetails) {<NEW_LINE>ValidateUtil.exactlyOneNotNullOrThrowInvalidRequestException(new Object[] { theId, theStructureDefinition, theUrl }, "Must supply either an ID or a StructureDefinition or a URL (but not more than one of these things)");<NEW_LINE>StructureDefinition sd;<NEW_LINE>if (theId == null && theStructureDefinition != null && theUrl == null) {<NEW_LINE>sd = theStructureDefinition;<NEW_LINE>} else if (theId != null && theStructureDefinition == null) {<NEW_LINE>sd = getDao().read(theId, theRequestDetails);<NEW_LINE>} else {<NEW_LINE>SearchParameterMap map = new SearchParameterMap();<NEW_LINE>map.setLoadSynchronousUpTo(2);<NEW_LINE>map.add(StructureDefinition.SP_URL, new UriParam(theUrl.getValue()));<NEW_LINE>IBundleProvider outcome = getDao().search(map, theRequestDetails);<NEW_LINE>Integer numResults = outcome.size();<NEW_LINE>assert numResults != null;<NEW_LINE>if (numResults == 0) {<NEW_LINE>throw new ResourceNotFoundException(Msg.code(1159) + "No StructureDefiniton found with url = '" + theUrl.getValue() + "'");<NEW_LINE>}<NEW_LINE>sd = (StructureDefinition) outcome.getResources(0<MASK><NEW_LINE>}<NEW_LINE>return getDao().generateSnapshot(sd, null, null, null);<NEW_LINE>}
, 1).get(0);
286,713
public void paint(GlyphView v, Graphics g, Shape a, int p0, int p1) {<NEW_LINE>sync(v);<NEW_LINE>Segment text;<NEW_LINE>TabExpander expander = v.getTabExpander();<NEW_LINE>Rectangle alloc = (a instanceof Rectangle) ? (Rectangle) a : a.getBounds();<NEW_LINE>// determine the x coordinate to render the glyphs<NEW_LINE>int x = alloc.x;<NEW_LINE>int p = v.getStartOffset();<NEW_LINE>if (p != p0) {<NEW_LINE>text = v.getText(p, p0);<NEW_LINE>int width = Utilities.getTabbedTextWidth(text, metrics, x, expander, p);<NEW_LINE>x += width;<NEW_LINE>}<NEW_LINE>// endif<NEW_LINE>// determine the y coordinate to render the glyphs<NEW_LINE>int y = alloc.y + metrics.getHeight() - metrics.getDescent();<NEW_LINE>// Calculate the background highlight, it gets painted first.<NEW_LINE>Color bg = TwoToneTextPane.getTwoToneColor(v.getElement().getAttributes());<NEW_LINE><MASK><NEW_LINE>if (bg == null) {<NEW_LINE>// No color set, guess black or white<NEW_LINE>float[] hsb = Color.RGBtoHSB(fg.getRed(), fg.getGreen(), fg.getBlue(), null);<NEW_LINE>bg = hsb[2] > 0.7 ? Color.BLACK : Color.WHITE;<NEW_LINE>}<NEW_LINE>// endif<NEW_LINE>g.setColor(bg);<NEW_LINE>// render the glyphs, first in bg highlight, then in fg<NEW_LINE>text = v.getText(p0, p1);<NEW_LINE>g.setFont(metrics.getFont());<NEW_LINE>Utilities.drawTabbedText(text, x + HORIZONTAL_OFFSET, y + VERTICAL_OFFSET, g, expander, p0);<NEW_LINE>g.setColor(fg);<NEW_LINE>Utilities.drawTabbedText(text, x, y, g, expander, p0);<NEW_LINE>}
Color fg = g.getColor();
1,658,247
final StartPolicyGenerationResult executeStartPolicyGeneration(StartPolicyGenerationRequest startPolicyGenerationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startPolicyGenerationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartPolicyGenerationRequest> request = null;<NEW_LINE>Response<StartPolicyGenerationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartPolicyGenerationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startPolicyGenerationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AccessAnalyzer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartPolicyGeneration");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartPolicyGenerationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartPolicyGenerationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
327,387
public void initialize() throws ContainerInitializationException {<NEW_LINE>Timer.start("SPRINGBOOT2_COLD_START");<NEW_LINE>SpringApplicationBuilder builder = // .REACTIVE, .SERVLET<NEW_LINE>new SpringApplicationBuilder(getEmbeddedContainerClasses()).// .REACTIVE, .SERVLET<NEW_LINE>web(springWebApplicationType);<NEW_LINE>if (springProfiles != null) {<NEW_LINE>builder.profiles(springProfiles);<NEW_LINE>}<NEW_LINE>applicationContext = builder.run();<NEW_LINE>if (springWebApplicationType == WebApplicationType.SERVLET) {<NEW_LINE>((AnnotationConfigServletWebServerApplicationContext) applicationContext<MASK><NEW_LINE>AwsServletRegistration reg = (AwsServletRegistration) getServletContext().getServletRegistration(DISPATCHER_SERVLET_REGISTRATION_NAME);<NEW_LINE>if (reg != null) {<NEW_LINE>reg.setLoadOnStartup(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.initialize();<NEW_LINE>initialized = true;<NEW_LINE>Timer.stop("SPRINGBOOT2_COLD_START");<NEW_LINE>}
).setServletContext(getServletContext());
1,560,275
public void generateActionSwitchEntry(ProxyMethodInfo m, CodeWriter writer) {<NEW_LINE>if (m.isProxyClose()) {<NEW_LINE>super.generateActionSwitchEntry(m, writer);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TypeInfo returnType = m.getReturnType();<NEW_LINE>writer.codeln(String.format("case \"%s\": {", m.getName())).indent().stmt("JsonObject contextSerialized = json.getJsonObject(\"context\")").codeln("if (contextSerialized == null)").indent().stmt("throw new IllegalStateException(\"Received action \" + action + \" without ServiceRequest \\\"context\\\"\")").unindent().stmt("ServiceRequest context = new ServiceRequest(contextSerialized)").stmt("JsonObject params = context.getParams()").codeln("try {").indent().code(String.format("service.%s(\n", m.getName()))<MASK><NEW_LINE>if (!m.isUseFutures()) {<NEW_LINE>Stream<String> methodParamsTail = Stream.of("context", serviceCallHandler);<NEW_LINE>writer.writeSeq(Stream.concat(((WebApiProxyMethodInfo) m).getParamsToExtract().stream().map(this::generateJsonParamExtractFromContext), methodParamsTail), ",\n");<NEW_LINE>writer.unindent().write(");\n");<NEW_LINE>} else {<NEW_LINE>Stream<String> methodParamsTail = Stream.of("context");<NEW_LINE>writer.writeSeq(Stream.concat(((WebApiProxyMethodInfo) m).getParamsToExtract().stream().map(this::generateJsonParamExtractFromContext), methodParamsTail), ",\n");<NEW_LINE>writer.write(")\n");<NEW_LINE>writer.write(".onComplete(" + serviceCallHandler + ");\n");<NEW_LINE>}<NEW_LINE>writer.unindent().unindent().codeln("} catch (Exception e) {").indent().stmt("HelperUtils.manageFailure(msg, e, includeDebugInfo)").unindent().codeln("}");<NEW_LINE>if (m.isProxyClose())<NEW_LINE>writer.stmt("close()");<NEW_LINE>writer.stmt("break");<NEW_LINE>writer.unindent();<NEW_LINE>writer.codeln("}");<NEW_LINE>}
.indent().indent();
1,098,827
protected static void logHaTask(long timeCost, Map<String, Pair<String, Map<String, StorageNodeHaInfo>>> allDnRoleInfos, Map<String, Pair<Boolean, String>> shouldHaFlags, Throwable haCheckEx) {<NEW_LINE>if (!StorageHaChecker.enablePrintHaCheckTaskLog) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String haStorageInstInfo = "";<NEW_LINE>boolean logWarning = false;<NEW_LINE>for (Map.Entry<String, Pair<String, Map<String, StorageNodeHaInfo>>> oneDnRoleInfo : allDnRoleInfos.entrySet()) {<NEW_LINE>if (StringUtils.isEmpty(haStorageInstInfo)) {<NEW_LINE>haStorageInstInfo += ",";<NEW_LINE>}<NEW_LINE>String storageInstId = oneDnRoleInfo.getKey();<NEW_LINE>Pair<Boolean, String> checkHaRs = shouldHaFlags.get(storageInstId);<NEW_LINE>Boolean shouldHa = checkHaRs.getKey();<NEW_LINE>String oldLeader = checkHaRs.getValue();<NEW_LINE>Pair<String, Map<String, StorageNodeHaInfo>> roleInfosPair = oneDnRoleInfo.getValue();<NEW_LINE>String newLeader = roleInfosPair.getKey();<NEW_LINE>if (shouldHa) {<NEW_LINE>logWarning = false;<NEW_LINE>String allRolInfos = buildStorageNodeHaInfoLogMsg(roleInfosPair.getValue());<NEW_LINE>haStorageInstInfo += String.format("{dnId=%s,shouldHa=%s,newLeader=%s,oldLeader=%s,roleInfos=[%s]}", storageInstId, shouldHa, newLeader, oldLeader, allRolInfos);<NEW_LINE>} else {<NEW_LINE>haStorageInstInfo += String.format(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>String logMsg = String.format("HaCheckTimeCost(ms): [%s], isSucc:[%s], allDnRoleInfo: [%s]", timeCost / (1000000), haCheckEx == null, haStorageInstInfo);<NEW_LINE>if (logWarning) {<NEW_LINE>CHECK_HA_LOGGER.warn(logMsg);<NEW_LINE>} else {<NEW_LINE>CHECK_HA_LOGGER.info(logMsg);<NEW_LINE>}<NEW_LINE>}
"{dnId=%s,shouldHa=%s,leader=%s}", storageInstId, shouldHa, newLeader);
1,403,732
public static FileSystemManager generateVfs() throws FileSystemException {<NEW_LINE>DefaultFileSystemManager vfs = new DefaultFileSystemManager();<NEW_LINE>vfs.addProvider("res", new org.apache.commons.vfs2.provider.res.ResourceFileProvider());<NEW_LINE>vfs.addProvider("zip", new org.apache.commons.vfs2.provider.zip.ZipFileProvider());<NEW_LINE>vfs.addProvider("gz", new org.apache.commons.vfs2.provider.gzip.GzipFileProvider());<NEW_LINE>vfs.addProvider("ram", new org.apache.commons.vfs2.provider.ram.RamFileProvider());<NEW_LINE>vfs.addProvider("file", new org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider());<NEW_LINE>vfs.addProvider("jar", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("http", new org.apache.commons.vfs2.provider.http.HttpFileProvider());<NEW_LINE>vfs.addProvider("https", new org.apache.commons.vfs2.provider.https.HttpsFileProvider());<NEW_LINE>vfs.addProvider("ftp", new org.apache.commons.vfs2.provider.ftp.FtpFileProvider());<NEW_LINE>vfs.addProvider("ftps", new org.apache.commons.vfs2.provider.ftps.FtpsFileProvider());<NEW_LINE>vfs.addProvider("war", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("par", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("ear", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("sar", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("ejb3", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("tmp", new org.apache.commons.vfs2.provider.temp.TemporaryFileProvider());<NEW_LINE>vfs.addProvider("tar", new org.apache.commons.vfs2.provider.tar.TarFileProvider());<NEW_LINE>vfs.addProvider("tbz2", new org.apache.commons.vfs2.provider.tar.TarFileProvider());<NEW_LINE>vfs.addProvider("tgz", new org.apache.commons.vfs2.provider.tar.TarFileProvider());<NEW_LINE>vfs.addProvider("bz2", new org.apache.commons.vfs2.provider.bzip2.Bzip2FileProvider());<NEW_LINE>vfs.addProvider("hdfs", new HdfsFileProvider());<NEW_LINE>vfs.addExtensionMap("jar", "jar");<NEW_LINE>vfs.addExtensionMap("zip", "zip");<NEW_LINE>vfs.addExtensionMap("gz", "gz");<NEW_LINE>vfs.addExtensionMap("tar", "tar");<NEW_LINE>vfs.addExtensionMap("tbz2", "tar");<NEW_LINE>vfs.addExtensionMap("tgz", "tar");<NEW_LINE>vfs.addExtensionMap("bz2", "bz2");<NEW_LINE>vfs.addMimeTypeMap("application/x-tar", "tar");<NEW_LINE>vfs.addMimeTypeMap("application/x-gzip", "gz");<NEW_LINE><MASK><NEW_LINE>vfs.setFileContentInfoFactory(new FileContentInfoFilenameFactory());<NEW_LINE>vfs.setFilesCache(new SoftRefFilesCache());<NEW_LINE>File cacheDir = computeTopCacheDir();<NEW_LINE>vfs.setReplicator(new UniqueFileReplicator(cacheDir));<NEW_LINE>vfs.setCacheStrategy(CacheStrategy.ON_RESOLVE);<NEW_LINE>vfs.init();<NEW_LINE>vfsInstances.add(new WeakReference<>(vfs));<NEW_LINE>return vfs;<NEW_LINE>}
vfs.addMimeTypeMap("application/zip", "zip");
559,208
private static SqlScalarFunction decimalSubtractOperator() {<NEW_LINE>TypeSignature decimalLeftSignature = new TypeSignature("decimal", typeVariable(<MASK><NEW_LINE>TypeSignature decimalRightSignature = new TypeSignature("decimal", typeVariable("b_precision"), typeVariable("b_scale"));<NEW_LINE>TypeSignature decimalResultSignature = new TypeSignature("decimal", typeVariable("r_precision"), typeVariable("r_scale"));<NEW_LINE>Signature signature = Signature.builder().operatorType(SUBTRACT).longVariableConstraints(longVariableExpression("r_precision", "min(38, max(a_precision - a_scale, b_precision - b_scale) + max(a_scale, b_scale) + 1)"), longVariableExpression("r_scale", "max(a_scale, b_scale)")).argumentTypes(decimalLeftSignature, decimalRightSignature).returnType(decimalResultSignature).build();<NEW_LINE>return new PolymorphicScalarFunctionBuilder(DecimalOperators.class).signature(signature).deterministic(true).choice(choice -> choice.implementation(methodsGroup -> methodsGroup.methods("subtractShortShortShort").withExtraParameters(DecimalOperators::calculateShortRescaleParameters)).implementation(methodsGroup -> methodsGroup.methods("subtractShortShortLong", "subtractLongLongLong", "subtractShortLongLong", "subtractLongShortLong").withExtraParameters(DecimalOperators::calculateLongRescaleParameters))).build();<NEW_LINE>}
"a_precision"), typeVariable("a_scale"));
1,620,302
private TornadoInstalledCode compileTask(SchedulableTask task) {<NEW_LINE>final CompilableTask executable = (CompilableTask) task;<NEW_LINE>final ResolvedJavaMethod resolvedMethod = TornadoCoreRuntime.getTornadoRuntime().resolveMethod(executable.getMethod());<NEW_LINE>final Sketch sketch = TornadoSketcher.lookup(resolvedMethod, task.meta().getDriverIndex(), task.meta().getDeviceIndex());<NEW_LINE>// copy meta data into task<NEW_LINE>final TaskMetaData taskMeta = executable.meta();<NEW_LINE>final Access[] sketchAccess = sketch.getArgumentsAccess();<NEW_LINE>final Access[] taskAccess = taskMeta.getArgumentsAccess();<NEW_LINE>System.arraycopy(sketchAccess, 0, taskAccess, 0, sketchAccess.length);<NEW_LINE>try {<NEW_LINE>OCLProviders providers = (OCLProviders) getBackend().getProviders();<NEW_LINE>TornadoProfiler profiler = task.getProfiler();<NEW_LINE>profiler.start(ProfilerType.TASK_COMPILE_GRAAL_TIME, taskMeta.getId());<NEW_LINE>final OCLCompilationResult result = OCLCompiler.compileSketchForDevice(sketch, executable, providers, getBackend());<NEW_LINE>profiler.stop(ProfilerType.TASK_COMPILE_GRAAL_TIME, taskMeta.getId());<NEW_LINE>profiler.sum(ProfilerType.TOTAL_GRAAL_COMPILE_TIME, profiler.getTaskTimer(ProfilerType.TASK_COMPILE_GRAAL_TIME, taskMeta.getId()));<NEW_LINE>RuntimeUtilities.<MASK><NEW_LINE>return null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>driver.fatal("unable to compile %s for device %s", task.getId(), getDeviceName());<NEW_LINE>driver.fatal("exception occured when compiling %s", ((CompilableTask) task).getMethod().getName());<NEW_LINE>driver.fatal("exception: %s", e.toString());<NEW_LINE>throw new TornadoBailoutRuntimeException("[Error During the Task Compilation] ", e);<NEW_LINE>}<NEW_LINE>}
maybePrintSource(result.getTargetCode());
251,591
public void applyLayout() {<NEW_LINE>if ((this.getNodes().size() == 0)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int layoutStyle = 0;<NEW_LINE>if (checkStyle(ZestStyles.NODES_NO_LAYOUT_RESIZE)) {<NEW_LINE>layoutStyle = LayoutStyles.NO_LAYOUT_NODE_RESIZING;<NEW_LINE>}<NEW_LINE>if (layoutAlgorithm == null) {<NEW_LINE>layoutAlgorithm = new TreeLayoutAlgorithm(layoutStyle);<NEW_LINE>}<NEW_LINE>layoutAlgorithm.setStyle(layoutAlgorithm.getStyle() | layoutStyle);<NEW_LINE>// calculate the size for the layout algorithm<NEW_LINE>// Dimension d = this.scalledLayer.getSize();<NEW_LINE>Dimension d = new Dimension();<NEW_LINE>d.width = (int) scaledWidth;<NEW_LINE>d.height = (int) scaledHeight;<NEW_LINE>d<MASK><NEW_LINE>d.height = d.height - 10;<NEW_LINE>// if (d.height <= 0) {<NEW_LINE>// d.height = (CONTAINER_HEIGHT);<NEW_LINE>// }<NEW_LINE>// d.scale(1 / this.scalledLayer.getScale());<NEW_LINE>if (d.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LayoutRelationship[] connectionsToLayout = getGraph().getConnectionsToLayout(getNodes());<NEW_LINE>LayoutEntity[] nodesToLayout = getGraph().getNodesToLayout(getNodes());<NEW_LINE>try {<NEW_LINE>Animation.markBegin();<NEW_LINE>layoutAlgorithm.applyLayout(nodesToLayout, connectionsToLayout, 25, 25, d.width - 50, d.height - 50, false, false);<NEW_LINE>Animation.run(ANIMATION_TIME);<NEW_LINE>getFigure().getUpdateManager().performUpdate();<NEW_LINE>} catch (InvalidLayoutConfiguration e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
.width = d.width - 10;
1,335,912
public void visitUnary(JCTree.JCUnary tree) {<NEW_LINE>super.visitUnary(tree);<NEW_LINE>if (_tp.isGenerate() && !shouldProcessForGeneration()) {<NEW_LINE>// Don't process tree during GENERATE, unless the tree was generated e.g., a bridge method<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Symbol op = IDynamicJdk.<MASK><NEW_LINE>boolean isOverload = op instanceof OverloadOperatorSymbol;<NEW_LINE>TreeMaker make = _tp.getTreeMaker();<NEW_LINE>if (!(op instanceof Symbol.MethodSymbol)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Handle operator overload expressions<NEW_LINE>Symbol.MethodSymbol operatorMethod = (Symbol.MethodSymbol) op;<NEW_LINE>while (operatorMethod instanceof OverloadOperatorSymbol) {<NEW_LINE>operatorMethod = ((OverloadOperatorSymbol) operatorMethod).getMethod();<NEW_LINE>}<NEW_LINE>if (isOverload && operatorMethod != null && tree.getTag() == JCTree.Tag.NEG) {<NEW_LINE>genUnaryMinus(tree, make, operatorMethod);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((isOverload && operatorMethod != null) || (tree.arg instanceof JCTree.JCArrayAccess && !_tp.getTypes().isArray(((JCTree.JCArrayAccess) tree.arg).indexed.type))) {<NEW_LINE>switch(tree.getTag()) {<NEW_LINE>case PREINC:<NEW_LINE>case PREDEC:<NEW_LINE>case POSTINC:<NEW_LINE>case POSTDEC:<NEW_LINE>genUnaryIncDec(tree, make, isOverload ? operatorMethod : null);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isJailbreakReceiver(tree)) {<NEW_LINE>Tree.Kind kind = tree.getKind();<NEW_LINE>if (kind == Tree.Kind.POSTFIX_INCREMENT || kind == Tree.Kind.POSTFIX_DECREMENT || kind == Tree.Kind.PREFIX_INCREMENT || kind == Tree.Kind.PREFIX_DECREMENT) {<NEW_LINE>// ++, -- operators not supported with jailbreak access to fields, only direct assignment<NEW_LINE>_tp.report(tree, Diagnostic.Kind.ERROR, ExtIssueMsg.MSG_INCREMENT_OP_NOT_ALLOWED_REFLECTION.get());<NEW_LINE>Types types = Types.instance(((BasicJavacTask) _tp.getJavacTask()).getContext());<NEW_LINE>tree.type = types.createErrorType(tree.type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = tree;<NEW_LINE>}
instance().getOperator(tree);
1,661,062
public void update() {<NEW_LINE>int lifeOffset = ParticleChannels.LifePercentOffset, strengthOffset = 0, forceOffset = 0;<NEW_LINE>for (int i = 0, c = controller.particles.size; i < c; ++i, strengthOffset += strengthChannel.strideSize, forceOffset += accelerationChannel.strideSize, lifeOffset += lifeChannel.strideSize) {<NEW_LINE>float strength = strengthChannel.data[strengthOffset + ParticleChannels.VelocityStrengthStartOffset] + strengthChannel.data[strengthOffset + ParticleChannels.VelocityStrengthDiffOffset] * strengthValue.getScale(lifeChannel.data[lifeOffset]);<NEW_LINE>TMP_V3.set(MathUtils.random(-1, 1f), MathUtils.random(-1, 1f), MathUtils.random(-1, 1f)).nor().scl(strength);<NEW_LINE>accelerationChannel.data[forceOffset + ParticleChannels.XOffset] += TMP_V3.x;<NEW_LINE>accelerationChannel.data[forceOffset + ParticleChannels.YOffset] += TMP_V3.y;<NEW_LINE>accelerationChannel.data[forceOffset + <MASK><NEW_LINE>}<NEW_LINE>}
ParticleChannels.ZOffset] += TMP_V3.z;
812,955
public void detachAllDisks() throws Exception {<NEW_LINE>if (s_logger.isTraceEnabled())<NEW_LINE>s_logger.trace(<MASK><NEW_LINE>VirtualDisk[] disks = getAllDiskDevice();<NEW_LINE>if (disks.length > 0) {<NEW_LINE>VirtualMachineConfigSpec reConfigSpec = new VirtualMachineConfigSpec();<NEW_LINE>VirtualDeviceConfigSpec[] deviceConfigSpecArray = new VirtualDeviceConfigSpec[disks.length];<NEW_LINE>for (int i = 0; i < disks.length; i++) {<NEW_LINE>deviceConfigSpecArray[i] = new VirtualDeviceConfigSpec();<NEW_LINE>deviceConfigSpecArray[i].setDevice(disks[i]);<NEW_LINE>deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.REMOVE);<NEW_LINE>}<NEW_LINE>reConfigSpec.getDeviceChange().addAll(Arrays.asList(deviceConfigSpecArray));<NEW_LINE>ManagedObjectReference morTask = _context.getService().reconfigVMTask(_mor, reConfigSpec);<NEW_LINE>boolean result = _context.getVimClient().waitForTask(morTask);<NEW_LINE>if (!result) {<NEW_LINE>if (s_logger.isTraceEnabled())<NEW_LINE>s_logger.trace("vCenter API trace - detachAllDisk() done(failed)");<NEW_LINE>throw new Exception("Failed to detach disk due to " + TaskMO.getTaskFailureInfo(_context, morTask));<NEW_LINE>}<NEW_LINE>_context.waitForTaskProgressDone(morTask);<NEW_LINE>}<NEW_LINE>if (s_logger.isTraceEnabled())<NEW_LINE>s_logger.trace("vCenter API trace - detachAllDisk() done(successfully)");<NEW_LINE>}
"vCenter API trace - detachAllDisk(). target MOR: " + _mor.getValue());
462,819
public final void pin(Watch watch) throws DataObjectNotFoundException {<NEW_LINE>EditorPin pin = (EditorPin) watch.getPin();<NEW_LINE>DataObject dobj = DataObject.find(pin.getFile());<NEW_LINE>EditorCookie ec = dobj.getLookup().lookup(EditorCookie.class);<NEW_LINE>JEditorPane[<MASK><NEW_LINE>if (openedPanes == null) {<NEW_LINE>throw new IllegalArgumentException("No editor panes opened for file " + pin.getFile());<NEW_LINE>}<NEW_LINE>LineCookie lineCookie = dobj.getLookup().lookup(LineCookie.class);<NEW_LINE>if (lineCookie == null) {<NEW_LINE>throw new IllegalArgumentException("No line cookie in " + pin.getFile());<NEW_LINE>}<NEW_LINE>Line.Set ls = lineCookie.getLineSet();<NEW_LINE>Line line;<NEW_LINE>try {<NEW_LINE>line = ls.getCurrent(pin.getLine());<NEW_LINE>} catch (IndexOutOfBoundsException e) {<NEW_LINE>throw new IllegalArgumentException("Wrong line: " + pin.getLine(), e);<NEW_LINE>}<NEW_LINE>for (JEditorPane pane : openedPanes) {<NEW_LINE>JEditorPane ep = EditorContextDispatcher.getDefault().getMostRecentEditor();<NEW_LINE>EditorUI editorUI = Utilities.getEditorUI(pane);<NEW_LINE>WatchAnnotationProvider.INSTANCE.pin(watch, editorUI, line);<NEW_LINE>}<NEW_LINE>}
] openedPanes = ec.getOpenedPanes();
524,789
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {<NEW_LINE>builder.addAutowiredProperty(SOFA_RUNTIME_CONTEXT);<NEW_LINE>builder.addAutowiredProperty(BINDING_CONVERTER_FACTORY);<NEW_LINE>builder.addAutowiredProperty(BINDING_ADAPTER_FACTORY);<NEW_LINE>String id = element.getAttribute(BEAN_ID_ELEMENT);<NEW_LINE>builder.addPropertyValue(BEAN_ID_PROPERTY, id);<NEW_LINE>String interfaceType = element.getAttribute(INTERFACE_ELEMENT);<NEW_LINE>builder.addPropertyValue(INTERFACE_PROPERTY, interfaceType);<NEW_LINE>builder.getBeanDefinition().getConstructorArgumentValues().addIndexedArgumentValue(0, interfaceType);<NEW_LINE>String uniqueId = element.getAttribute(UNIQUE_ID_ELEMENT);<NEW_LINE>builder.addPropertyValue(UNIQUE_ID_PROPERTY, uniqueId);<NEW_LINE>String repeatReferLimit = element.getAttribute(REPEAT_REFER_LIMIT_ELEMENT);<NEW_LINE>builder.addPropertyValue(REPEAT_REFER_LIMIT_PROPERTY, repeatReferLimit);<NEW_LINE>List<Element> childElements = DomUtils.getChildElements(element);<NEW_LINE>List<TypedStringValue> <MASK><NEW_LINE>for (Element childElement : childElements) {<NEW_LINE>try {<NEW_LINE>TransformerFactory transFactory = TransformerFactory.newInstance();<NEW_LINE>Transformer transformer = transFactory.newTransformer();<NEW_LINE>StringWriter buffer = new StringWriter();<NEW_LINE>transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");<NEW_LINE>transformer.transform(new DOMSource(childElement), new StreamResult(buffer));<NEW_LINE>String str = buffer.toString();<NEW_LINE>elementAsTypedStringValueList.add(new TypedStringValue(str, Element.class));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new ServiceRuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.addPropertyValue("documentEncoding", element.getOwnerDocument().getXmlEncoding());<NEW_LINE>builder.addPropertyValue(ELEMENTS, elementAsTypedStringValueList);<NEW_LINE>doParseInternal(element, parserContext, builder);<NEW_LINE>}
elementAsTypedStringValueList = new ArrayList<>();
955,125
public static DescribeTotalAndRateLineResponse unmarshall(DescribeTotalAndRateLineResponse describeTotalAndRateLineResponse, UnmarshallerContext context) {<NEW_LINE>describeTotalAndRateLineResponse.setRequestId(context.stringValue("DescribeTotalAndRateLineResponse.RequestId"));<NEW_LINE>List<String> categories = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeTotalAndRateLineResponse.Categories.Length"); i++) {<NEW_LINE>categories.add(context.stringValue("DescribeTotalAndRateLineResponse.Categories[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeTotalAndRateLineResponse.setCategories(categories);<NEW_LINE>List<Item> items = new ArrayList<Item>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeTotalAndRateLineResponse.Items.Length"); i++) {<NEW_LINE>Item item = new Item();<NEW_LINE>item.setData(context.floatValue<MASK><NEW_LINE>item.setId(context.stringValue("DescribeTotalAndRateLineResponse.Items[" + i + "].Id"));<NEW_LINE>item.setName(context.stringValue("DescribeTotalAndRateLineResponse.Items[" + i + "].Name"));<NEW_LINE>items.add(item);<NEW_LINE>}<NEW_LINE>describeTotalAndRateLineResponse.setItems(items);<NEW_LINE>return describeTotalAndRateLineResponse;<NEW_LINE>}
("DescribeTotalAndRateLineResponse.Items[" + i + "].Data"));
74,461
public void marshall(BehaviorCriteria behaviorCriteria, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (behaviorCriteria.getComparisonOperator() != null) {<NEW_LINE>String comparisonOperator = behaviorCriteria.getComparisonOperator();<NEW_LINE>jsonWriter.name("comparisonOperator");<NEW_LINE>jsonWriter.value(comparisonOperator);<NEW_LINE>}<NEW_LINE>if (behaviorCriteria.getValue() != null) {<NEW_LINE><MASK><NEW_LINE>jsonWriter.name("value");<NEW_LINE>MetricValueJsonMarshaller.getInstance().marshall(value, jsonWriter);<NEW_LINE>}<NEW_LINE>if (behaviorCriteria.getDurationSeconds() != null) {<NEW_LINE>Integer durationSeconds = behaviorCriteria.getDurationSeconds();<NEW_LINE>jsonWriter.name("durationSeconds");<NEW_LINE>jsonWriter.value(durationSeconds);<NEW_LINE>}<NEW_LINE>if (behaviorCriteria.getConsecutiveDatapointsToAlarm() != null) {<NEW_LINE>Integer consecutiveDatapointsToAlarm = behaviorCriteria.getConsecutiveDatapointsToAlarm();<NEW_LINE>jsonWriter.name("consecutiveDatapointsToAlarm");<NEW_LINE>jsonWriter.value(consecutiveDatapointsToAlarm);<NEW_LINE>}<NEW_LINE>if (behaviorCriteria.getConsecutiveDatapointsToClear() != null) {<NEW_LINE>Integer consecutiveDatapointsToClear = behaviorCriteria.getConsecutiveDatapointsToClear();<NEW_LINE>jsonWriter.name("consecutiveDatapointsToClear");<NEW_LINE>jsonWriter.value(consecutiveDatapointsToClear);<NEW_LINE>}<NEW_LINE>if (behaviorCriteria.getStatisticalThreshold() != null) {<NEW_LINE>StatisticalThreshold statisticalThreshold = behaviorCriteria.getStatisticalThreshold();<NEW_LINE>jsonWriter.name("statisticalThreshold");<NEW_LINE>StatisticalThresholdJsonMarshaller.getInstance().marshall(statisticalThreshold, jsonWriter);<NEW_LINE>}<NEW_LINE>if (behaviorCriteria.getMlDetectionConfig() != null) {<NEW_LINE>MachineLearningDetectionConfig mlDetectionConfig = behaviorCriteria.getMlDetectionConfig();<NEW_LINE>jsonWriter.name("mlDetectionConfig");<NEW_LINE>MachineLearningDetectionConfigJsonMarshaller.getInstance().marshall(mlDetectionConfig, jsonWriter);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>}
MetricValue value = behaviorCriteria.getValue();
228,612
public Request<ListDocumentClassifiersRequest> marshall(ListDocumentClassifiersRequest listDocumentClassifiersRequest) {<NEW_LINE>if (listDocumentClassifiersRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListDocumentClassifiersRequest)");<NEW_LINE>}<NEW_LINE>Request<ListDocumentClassifiersRequest> request = new DefaultRequest<ListDocumentClassifiersRequest>(listDocumentClassifiersRequest, "AmazonComprehend");<NEW_LINE>String target = "Comprehend_20171127.ListDocumentClassifiers";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter <MASK><NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (listDocumentClassifiersRequest.getFilter() != null) {<NEW_LINE>DocumentClassifierFilter filter = listDocumentClassifiersRequest.getFilter();<NEW_LINE>jsonWriter.name("Filter");<NEW_LINE>DocumentClassifierFilterJsonMarshaller.getInstance().marshall(filter, jsonWriter);<NEW_LINE>}<NEW_LINE>if (listDocumentClassifiersRequest.getNextToken() != null) {<NEW_LINE>String nextToken = listDocumentClassifiersRequest.getNextToken();<NEW_LINE>jsonWriter.name("NextToken");<NEW_LINE>jsonWriter.value(nextToken);<NEW_LINE>}<NEW_LINE>if (listDocumentClassifiersRequest.getMaxResults() != null) {<NEW_LINE>Integer maxResults = listDocumentClassifiersRequest.getMaxResults();<NEW_LINE>jsonWriter.name("MaxResults");<NEW_LINE>jsonWriter.value(maxResults);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
jsonWriter = JsonUtils.getJsonWriter(stringWriter);
366,575
final ListLaunchPathsResult executeListLaunchPaths(ListLaunchPathsRequest listLaunchPathsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listLaunchPathsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListLaunchPathsRequest> request = null;<NEW_LINE>Response<ListLaunchPathsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListLaunchPathsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listLaunchPathsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListLaunchPaths");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListLaunchPathsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListLaunchPathsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
619,516
public JsonProcessCompositeResponse processShipmentSchedules(@NonNull final JsonProcessShipmentRequest request) {<NEW_LINE>final ILoggable loggable = Loggables.withLogger(logger, Level.DEBUG);<NEW_LINE>final <MASK><NEW_LINE>loggable.addLog("processShipmentSchedules - start updating shipment schedules");<NEW_LINE>updateShipmentSchedules(shipmentRequest);<NEW_LINE>loggable.addLog("processShipmentSchedules - finished updating shipment schedules");<NEW_LINE>final Map<AsyncBatchId, List<CreateShipmentInfoCandidate>> asyncBatchId2ShipmentCandidates = getShipmentInfoCandidateByAsyncBatchId(request.getCreateShipmentRequest().getCreateShipmentInfoList());<NEW_LINE>final List<GenerateShipmentsRequest> generateShipmentsRequestList = asyncBatchId2ShipmentCandidates.keySet().stream().map(asyncBatchId -> toGenerateShipmentsRequest(asyncBatchId2ShipmentCandidates.get(asyncBatchId), asyncBatchId)).collect(ImmutableList.toImmutableList());<NEW_LINE>final ImmutableSet.Builder<InOutId> createdShipmentIdsCollector = ImmutableSet.builder();<NEW_LINE>final ImmutableList.Builder<JSONInvoiceInfoResponse> invoiceInfoResponseCollector = ImmutableList.builder();<NEW_LINE>for (final GenerateShipmentsRequest generateShipmentRequest : generateShipmentsRequestList) {<NEW_LINE>if (generateShipmentRequest.getScheduleIds().isEmpty()) {<NEW_LINE>loggable.addLog("processShipmentSchedules - skip generateShipmentRequest without ShipmentScheduleIds; generateShipmentRequest={}", generateShipmentRequest);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final AsyncBatchId currentBatchId = generateShipmentRequest.getAsyncBatchId();<NEW_LINE>loggable.addLog("processShipmentSchedules - start creating shipments with currentBatchId={}", AsyncBatchId.toRepoId(currentBatchId));<NEW_LINE>shipmentService.generateShipments(generateShipmentRequest);<NEW_LINE>final Set<InOutId> createdInoutIds = shipmentService.retrieveInOutIdsByScheduleIds(generateShipmentRequest.getScheduleIds());<NEW_LINE>loggable.addLog("processShipmentSchedules - finished creating shipments with currentBatchId={}; M_InOut_IDs={}", currentBatchId, createdInoutIds);<NEW_LINE>createdShipmentIdsCollector.addAll(createdInoutIds);<NEW_LINE>if (request.getInvoice()) {<NEW_LINE>loggable.addLog("processShipmentSchedules - start creating invoices with currentBatchId={}", AsyncBatchId.toRepoId(currentBatchId));<NEW_LINE>final List<JSONInvoiceInfoResponse> createInvoiceInfos = generateInvoicesForShipmentScheduleIds(generateShipmentRequest.getScheduleIds());<NEW_LINE>loggable.addLog("processShipmentSchedules - finished creating invoices with currentBatchId={}; invoiceIds={}", currentBatchId, createdInoutIds);<NEW_LINE>invoiceInfoResponseCollector.addAll(createInvoiceInfos);<NEW_LINE>}<NEW_LINE>if (request.getCloseShipmentSchedule()) {<NEW_LINE>loggable.addLog("processShipmentSchedules - start closing shipmentSchedules");<NEW_LINE>generateShipmentRequest.getScheduleIds().forEach(shipmentScheduleBL::closeShipmentSchedule);<NEW_LINE>loggable.addLog("processShipmentSchedules - finished closing shipmentSchedules");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final JsonProcessCompositeResponse.JsonProcessCompositeResponseBuilder responseBuilder = JsonProcessCompositeResponse.builder();<NEW_LINE>responseBuilder.shipmentResponse(buildCreateShipmentResponse(createdShipmentIdsCollector.build()));<NEW_LINE>if (request.getInvoice()) {<NEW_LINE>responseBuilder.invoiceInfoResponse(invoiceInfoResponseCollector.build());<NEW_LINE>}<NEW_LINE>return responseBuilder.build();<NEW_LINE>}
JsonCreateShipmentRequest shipmentRequest = request.getCreateShipmentRequest();
1,832,986
// snippet-start:[opensearch.java2.create_domain.main]<NEW_LINE>public static void createNewDomain(OpenSearchClient searchClient, String domainName) {<NEW_LINE>try {<NEW_LINE>ClusterConfig clusterConfig = ClusterConfig.builder().dedicatedMasterEnabled(true).dedicatedMasterCount(3).dedicatedMasterType("t2.small.search").instanceType("t2.small.search").instanceCount(5).build();<NEW_LINE>EBSOptions ebsOptions = EBSOptions.builder().ebsEnabled(true).volumeSize(10).volumeType(VolumeType.GP2).build();<NEW_LINE>NodeToNodeEncryptionOptions encryptionOptions = NodeToNodeEncryptionOptions.builder().enabled(true).build();<NEW_LINE>CreateDomainRequest domainRequest = CreateDomainRequest.builder().domainName(domainName).engineVersion("OpenSearch_1.0").clusterConfig(clusterConfig).ebsOptions(ebsOptions).<MASK><NEW_LINE>System.out.println("Sending domain creation request...");<NEW_LINE>CreateDomainResponse createResponse = searchClient.createDomain(domainRequest);<NEW_LINE>System.out.println("Domain status is " + createResponse.domainStatus().toString());<NEW_LINE>System.out.println("Domain Id is " + createResponse.domainStatus().domainId());<NEW_LINE>} catch (OpenSearchException e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
nodeToNodeEncryptionOptions(encryptionOptions).build();
378,835
public static void rgbToHsv_F32(Planar<GrayF32> rgb, Planar<GrayF32> hsv) {<NEW_LINE>GrayF32 <MASK><NEW_LINE>GrayF32 G = rgb.getBand(1);<NEW_LINE>GrayF32 B = rgb.getBand(2);<NEW_LINE>GrayF32 H = hsv.getBand(0);<NEW_LINE>GrayF32 S = hsv.getBand(1);<NEW_LINE>GrayF32 V = hsv.getBand(2);<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0,hsv.height,row->{<NEW_LINE>for (int row = 0; row < hsv.height; row++) {<NEW_LINE>int indexRgb = rgb.startIndex + row * rgb.stride;<NEW_LINE>int indexHsv = hsv.startIndex + row * hsv.stride;<NEW_LINE>int endRgb = indexRgb + hsv.width;<NEW_LINE>for (; indexRgb < endRgb; indexHsv++, indexRgb++) {<NEW_LINE>float r = R.data[indexRgb];<NEW_LINE>float g = G.data[indexRgb];<NEW_LINE>float b = B.data[indexRgb];<NEW_LINE>float max = r > g ? (r > b ? r : b) : (g > b ? g : b);<NEW_LINE>float min = r < g ? (r < b ? r : b) : (g < b ? g : b);<NEW_LINE>float delta = max - min;<NEW_LINE>V.data[indexHsv] = max;<NEW_LINE>if (max != 0)<NEW_LINE>S.data[indexHsv] = delta / max;<NEW_LINE>else {<NEW_LINE>H.data[indexHsv] = Float.NaN;<NEW_LINE>S.data[indexHsv] = 0;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>float h;<NEW_LINE>if (r == max)<NEW_LINE>h = (g - b) / delta;<NEW_LINE>else if (g == max)<NEW_LINE>h = 2 + (b - r) / delta;<NEW_LINE>else<NEW_LINE>h = 4 + (r - g) / delta;<NEW_LINE>h *= d60_F32;<NEW_LINE>if (h < 0)<NEW_LINE>h += PI2_F32;<NEW_LINE>H.data[indexHsv] = h;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
R = rgb.getBand(0);
1,645,915
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see com.aptana.formatter.IScriptFormatter#format(java.lang.String, int, int, int, boolean,<NEW_LINE>* org.eclipse.jface.text.formatter.IFormattingContext, java.lang.String)<NEW_LINE>*/<NEW_LINE>public TextEdit format(String source, int offset, int length, int indentationLevel, boolean isSelection, IFormattingContext context, String indentSufix) throws FormatterException {<NEW_LINE>if (!ScriptFormatterManager.hasFormatterFor(getMainContentType())) {<NEW_LINE>throw new FormatterException(FormatterMessages.Formatter_contentErrorMessage);<NEW_LINE>}<NEW_LINE>String input = source.substring(offset, offset + length);<NEW_LINE>IParser parser = checkoutParser();<NEW_LINE>String mainContentType = getMainContentType();<NEW_LINE>if (!(parser instanceof HTMLParser) && !(parser instanceof CompositeParser)) {<NEW_LINE>// Check it back in and request a specific HTML parser.<NEW_LINE>// This will happen when dealing with a master formatter that runs with a parser that does not extend from<NEW_LINE>// HTNLParser (like PHPParser).<NEW_LINE>checkinParser(parser, mainContentType);<NEW_LINE>mainContentType = IHTMLConstants.CONTENT_TYPE_HTML;<NEW_LINE>parser = checkoutParser(mainContentType);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>IParseState parseState = new HTMLParseState(input);<NEW_LINE>IParseNode parseResult = null;<NEW_LINE>try {<NEW_LINE>parseResult = parser.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>StatusLineMessageTimerManager.setErrorMessage(FormatterMessages.Formatter_formatterErrorStatus, ERROR_DISPLAY_TIMEOUT, true);<NEW_LINE>IdeLog.logError(HTMLFormatterPlugin.getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>// In case of a parse error (which is unlikely to HTML parsing), just try to indent the given source.<NEW_LINE>return indent(source, input, offset, length, indentationLevel);<NEW_LINE>} finally {<NEW_LINE>checkinParser(parser, mainContentType);<NEW_LINE>}<NEW_LINE>if (parseResult != null) {<NEW_LINE>final String output = format(input, parseResult, indentationLevel, isSelection);<NEW_LINE>if (output != null) {<NEW_LINE>if (!input.equals(output)) {<NEW_LINE>if (equalsIgnoreWhitespaces(input, output)) {<NEW_LINE>return new ReplaceEdit(offset, length, output);<NEW_LINE>} else {<NEW_LINE>logError(input, output);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// NOP<NEW_LINE>return new MultiTextEdit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (beaver.Parser.Exception e) {<NEW_LINE>StatusLineMessageTimerManager.setErrorMessage(NLS.bind(FormatterMessages.Formatter_formatterParsingErrorStatus, e.getMessage()), ERROR_DISPLAY_TIMEOUT, true);<NEW_LINE>if (FormatterPlugin.getDefault().isDebugging()) {<NEW_LINE>IdeLog.logError(HTMLFormatterPlugin.getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>StatusLineMessageTimerManager.setErrorMessage(FormatterMessages.Formatter_formatterErrorStatus, ERROR_DISPLAY_TIMEOUT, true);<NEW_LINE>IdeLog.logError(HTMLFormatterPlugin.getDefault(), t, IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
parse(parseState).getRootNode();
455,536
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String providerName, String privateEndpointConnectionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (providerName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (privateEndpointConnectionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, providerName, this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,851,615
public String createSearchString(File file) {<NEW_LINE>scrapedMovieFile = file;<NEW_LINE>// The general approach is search for 'tag' + '5-digit 0-padded number'.<NEW_LINE>// This gets pretty good results, usually a perfect match,<NEW_LINE>// or 2 to 5 results for clashing ids - still good for manual picking.<NEW_LINE>String baseId = findIDTagFromFile(file, isFirstWordOfFileIsID()).replace("-", "");<NEW_LINE>Pattern patternID = Pattern.compile("([0-9]*\\D+)(\\d+)");<NEW_LINE>Matcher matcher = patternID.matcher(baseId);<NEW_LINE>String groupOne = "";<NEW_LINE>String groupTwo = "";<NEW_LINE>while (matcher.find()) {<NEW_LINE><MASK><NEW_LINE>groupTwo = matcher.group(2);<NEW_LINE>}<NEW_LINE>if (groupOne == null || groupOne.isEmpty() || groupTwo == null || groupTwo.isEmpty())<NEW_LINE>return null;<NEW_LINE>int number = Integer.parseInt(groupTwo);<NEW_LINE>// some h.m.p. titles need extra padding<NEW_LINE>if (groupOne.equalsIgnoreCase("HODV")) {<NEW_LINE>return String.format("%s+%05d", groupOne, number);<NEW_LINE>}<NEW_LINE>return String.format("%s%05d", groupOne, number);<NEW_LINE>}
groupOne = matcher.group(1);
1,407,286
Iterable<MemoryRelationship> values(final Filter<MemoryRelationship> filter) {<NEW_LINE>if (filter != null) {<NEW_LINE>if (filter instanceof MemoryLabelFilter) {<NEW_LINE>final MemoryLabelFilter<MemoryRelationship> mt = (MemoryLabelFilter<MemoryRelationship>) filter;<NEW_LINE>final Set<MemoryIdentity> cache = new LinkedHashSet<>();<NEW_LINE>for (final String label : mt.getLabels()) {<NEW_LINE>final Set<MemoryIdentity> <MASK><NEW_LINE>if (set != null) {<NEW_LINE>cache.addAll(set);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Iterables.map(i -> masterData.get(i), cache);<NEW_LINE>}<NEW_LINE>if (filter instanceof SourceNodeFilter) {<NEW_LINE>final SourceNodeFilter<MemoryRelationship> s = (SourceNodeFilter<MemoryRelationship>) filter;<NEW_LINE>final MemoryIdentity id = s.getIdentity();<NEW_LINE>final Set<MemoryIdentity> set = getCacheForSource(id, false);<NEW_LINE>if (set != null) {<NEW_LINE>return Iterables.map(i -> masterData.get(i), new LinkedHashSet<>(set));<NEW_LINE>}<NEW_LINE>return Collections.EMPTY_LIST;<NEW_LINE>}<NEW_LINE>if (filter instanceof TargetNodeFilter) {<NEW_LINE>final TargetNodeFilter<MemoryRelationship> s = (TargetNodeFilter<MemoryRelationship>) filter;<NEW_LINE>final MemoryIdentity id = s.getIdentity();<NEW_LINE>final Set<MemoryIdentity> set = getCacheForTarget(id, false);<NEW_LINE>if (set != null) {<NEW_LINE>return Iterables.map(i -> masterData.get(i), new LinkedHashSet<>(set));<NEW_LINE>}<NEW_LINE>return Collections.EMPTY_LIST;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return masterData.values();<NEW_LINE>}
set = getCacheForType(label, false);
1,352,218
public Pair<Reader, FilePosition> resolve(URI uri, URI base, FilePosition uriPos) throws IOException {<NEW_LINE>if (uri == null) {<NEW_LINE>throw new NullPointerException("uri");<NEW_LINE>}<NEW_LINE>if (!uri.isAbsolute()) {<NEW_LINE>if (base == null) {<NEW_LINE>throw new IllegalArgumentException("Missing base URI to resolve relative URL: " + uri);<NEW_LINE>}<NEW_LINE>String scheme = base.getScheme();<NEW_LINE>if (!(Strings.eqIgnoreCase("resource", scheme) && base.isAbsolute())) {<NEW_LINE>throw new IllegalArgumentException("base URI: " + base);<NEW_LINE>}<NEW_LINE>uri = base.resolve(uri);<NEW_LINE>}<NEW_LINE>if (!uri.isAbsolute()) {<NEW_LINE>throw new IllegalArgumentException("URI not absolute: " + uri);<NEW_LINE>}<NEW_LINE>InputStream in;<NEW_LINE>String scheme = Strings.lower(uri.getScheme());<NEW_LINE>if ("content".equals(scheme)) {<NEW_LINE>String content = uri.getSchemeSpecificPart();<NEW_LINE>if (content == null) {<NEW_LINE>throw new IllegalArgumentException("URI missing content: " + uri);<NEW_LINE>}<NEW_LINE>return Pair.pair((Reader) new StringReader(content), FilePosition.startOfFile(new InputSource(uri)));<NEW_LINE>} else if ("resource".equals(scheme)) {<NEW_LINE>String path = uri.getPath();<NEW_LINE>if (path == null) {<NEW_LINE>throw new IllegalArgumentException("URI missing path: " + uri);<NEW_LINE>}<NEW_LINE>in = ConfigUtil.class.getResourceAsStream(path);<NEW_LINE>if (in == null) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("URI scheme not permitted: " + uri);<NEW_LINE>}<NEW_LINE>return Pair.pair((Reader) new InputStreamReader(in, Charsets.UTF_8.name()), FilePosition.startOfFile(new InputSource(uri)));<NEW_LINE>}
FileNotFoundException(uri.toString());
1,804,760
protected Model readModelWorker(Model model, String filenameOrURI, String baseURI, String syntax) {<NEW_LINE>// Doesn't call open() - we want to make the syntax guess based on the mapped URI.<NEW_LINE>String mappedURI = mapURI(filenameOrURI);<NEW_LINE>if (log.isDebugEnabled() && !mappedURI.equals(filenameOrURI))<NEW_LINE>log.debug("Map: " + filenameOrURI + " => " + mappedURI);<NEW_LINE>if (syntax == null && baseURI == null && mappedURI.startsWith("http:")) {<NEW_LINE>syntax = FileUtils.guessLang(mappedURI);<NEW_LINE>// Content negotation in next version (FileManager2)<NEW_LINE>model.read(mappedURI, syntax);<NEW_LINE>return model;<NEW_LINE>}<NEW_LINE>if (syntax == null) {<NEW_LINE>syntax = FileUtils.guessLang(mappedURI);<NEW_LINE>if (syntax == null || syntax.equals(""))<NEW_LINE>syntax = FileUtils.langXML;<NEW_LINE>if (log.isDebugEnabled())<NEW_LINE>log.debug("Syntax guess: " + syntax);<NEW_LINE>}<NEW_LINE>if (baseURI == null)<NEW_LINE>baseURI = chooseBaseURI(filenameOrURI);<NEW_LINE>TypedStream in = openNoMapOrNull(mappedURI);<NEW_LINE>if (in == null) {<NEW_LINE>FmtLog.<MASK><NEW_LINE>throw new NotFoundException("Not found: " + filenameOrURI);<NEW_LINE>}<NEW_LINE>if (in.getMimeType() != null) {<NEW_LINE>// syntax<NEW_LINE>}<NEW_LINE>model.read(in.getInput(), baseURI, syntax);<NEW_LINE>try {<NEW_LINE>in.getInput().close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>}
debug(log, "Failed to locate '%s'", mappedURI);
1,651,775
public List<Writable> map(List<Writable> writables) {<NEW_LINE>if (writables.size() != inputSchema.numColumns()) {<NEW_LINE>throw new IllegalStateException("Cannot execute transform: input writables list length (" + writables.size() + ") does not " + "match expected number of elements (schema: " + inputSchema.numColumns() + "). Transform = " + toString());<NEW_LINE>}<NEW_LINE>int idx = getColumnIdx();<NEW_LINE>int n = stateNames.size();<NEW_LINE>List<Writable> out = new ArrayList<>(<MASK><NEW_LINE>int i = 0;<NEW_LINE>for (Writable w : writables) {<NEW_LINE>if (i++ == idx) {<NEW_LINE>// Do conversion<NEW_LINE>String str = w.toString();<NEW_LINE>Integer classIdx = statesMap.get(str);<NEW_LINE>if (classIdx == null) {<NEW_LINE>throw new IllegalStateException("Cannot convert categorical value to one-hot: input value (\"" + str + "\") is not in the list of known categories (state names/categories: " + stateNames + ")");<NEW_LINE>}<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>if (j == classIdx)<NEW_LINE>out.add(new IntWritable(1));<NEW_LINE>else<NEW_LINE>out.add(new IntWritable(0));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// No change to this column<NEW_LINE>out.add(w);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>}
writables.size() + n);
496,031
protected void intro(EntityType model, CodeWriter writer) throws IOException {<NEW_LINE>String simpleName = model.getSimpleName();<NEW_LINE>Type queryType = typeMappings.<MASK><NEW_LINE>// package<NEW_LINE>if (!queryType.getPackageName().isEmpty()) {<NEW_LINE>writer.packageDecl(queryType.getPackageName());<NEW_LINE>}<NEW_LINE>// imports<NEW_LINE>writer.imports(NumberExpression.class.getPackage());<NEW_LINE>writer.imports(ConstructorExpression.class, generatedAnnotationClass);<NEW_LINE>Set<Integer> sizes = new HashSet<>();<NEW_LINE>for (Constructor c : model.getConstructors()) {<NEW_LINE>sizes.add(c.getParameters().size());<NEW_LINE>}<NEW_LINE>if (sizes.size() != model.getConstructors().size()) {<NEW_LINE>writer.imports(Expression.class);<NEW_LINE>}<NEW_LINE>// javadoc<NEW_LINE>writer.javadoc(queryType + " is a Querydsl Projection type for " + simpleName);<NEW_LINE>writer.line("@", generatedAnnotationClass.getSimpleName(), "(\"", getClass().getName(), "\")");<NEW_LINE>// class header<NEW_LINE>// writer.suppressWarnings("serial");<NEW_LINE>Type superType = new ClassType(TypeCategory.SIMPLE, ConstructorExpression.class, model);<NEW_LINE>writer.beginClass(queryType, superType);<NEW_LINE>writer.privateStaticFinal(Types.LONG_P, "serialVersionUID", model.hashCode() + "L");<NEW_LINE>}
getPathType(model, model, false);
240,544
private static List<Selection<?>> subselectionsForNormalizedField(GraphQLSchema schema, @NotNull String parentOutputType, List<ExecutableNormalizedField> executableNormalizedFields, VariableAccumulator variableAccumulator) {<NEW_LINE>ImmutableList.Builder<Selection<?>> selections = ImmutableList.builder();<NEW_LINE>// All conditional fields go here instead of directly to selections, so they can be grouped together<NEW_LINE>// in the same inline fragment in the output<NEW_LINE>Map<String, List<Field>> fieldsByTypeCondition = new LinkedHashMap<>();<NEW_LINE>for (ExecutableNormalizedField nf : executableNormalizedFields) {<NEW_LINE>if (nf.isConditional(schema)) {<NEW_LINE>selectionForNormalizedField(schema, nf, variableAccumulator).forEach((objectTypeName, field) -> fieldsByTypeCondition.computeIfAbsent(objectTypeName, ignored -> new ArrayList<>(<MASK><NEW_LINE>} else {<NEW_LINE>selections.add(selectionForNormalizedField(schema, parentOutputType, nf, variableAccumulator));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fieldsByTypeCondition.forEach((objectTypeName, fields) -> {<NEW_LINE>TypeName typeName = newTypeName(objectTypeName).build();<NEW_LINE>InlineFragment inlineFragment = newInlineFragment().typeCondition(typeName).selectionSet(selectionSet(fields)).build();<NEW_LINE>selections.add(inlineFragment);<NEW_LINE>});<NEW_LINE>return selections.build();<NEW_LINE>}
)).add(field));
1,629,035
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {<NEW_LINE>_logger.debug("postHandle");<NEW_LINE>final Apps app = (Apps) WebContext.getAttribute(WebConstants.AUTHORIZE_SIGN_ON_APP);<NEW_LINE>String sessionId = (String) WebContext.getAttribute(WebConstants.CURRENT_USER_SESSION_ID);<NEW_LINE>final UserInfo userInfo = WebContext.getUserInfo();<NEW_LINE>_logger.debug("sessionId : " + sessionId + <MASK><NEW_LINE>HistoryLoginApps historyLoginApps = new HistoryLoginApps();<NEW_LINE>historyLoginApps.setAppId(app.getId());<NEW_LINE>historyLoginApps.setSessionId(sessionId);<NEW_LINE>historyLoginApps.setAppName(app.getName());<NEW_LINE>historyLoginApps.setUserId(userInfo.getId());<NEW_LINE>historyLoginApps.setUsername(userInfo.getUsername());<NEW_LINE>historyLoginApps.setDisplayName(userInfo.getDisplayName());<NEW_LINE>historyLoginApps.setInstId(userInfo.getInstId());<NEW_LINE>historyLoginAppsService.insert(historyLoginApps);<NEW_LINE>WebContext.removeAttribute(WebConstants.CURRENT_SINGLESIGNON_URI);<NEW_LINE>WebContext.removeAttribute(WebConstants.SINGLE_SIGN_ON_APP_ID);<NEW_LINE>}
" ,appId : " + app.getId());
170,469
public static void main(String[] args) {<NEW_LINE>// Parse text to separate words<NEW_LINE>String INPUT_TEXT = "Hello World! Hello All! Hi World!";<NEW_LINE>// Create Multiset<NEW_LINE>Bag bag = new TreeBag(Arrays.asList(<MASK><NEW_LINE>// Print count words<NEW_LINE>// print [1:All!,2:Hello,1:Hi,2:World!]- in natural (alphabet) order<NEW_LINE>System.out.println(bag);<NEW_LINE>// Print all unique words<NEW_LINE>// print [All!, Hello, Hi, World!]- in natural (alphabet) order<NEW_LINE>System.out.println(bag.uniqueSet());<NEW_LINE>// Print count occurrences of words<NEW_LINE>// print 2<NEW_LINE>System.out.println("Hello = " + bag.getCount("Hello"));<NEW_LINE>// print 2<NEW_LINE>System.out.println("World = " + bag.getCount("World!"));<NEW_LINE>// print 1<NEW_LINE>System.out.println("All = " + bag.getCount("All!"));<NEW_LINE>// print 1<NEW_LINE>System.out.println("Hi = " + bag.getCount("Hi"));<NEW_LINE>// print 0<NEW_LINE>System.out.println("Empty = " + bag.getCount("Empty"));<NEW_LINE>// Print count all words<NEW_LINE>// print 6<NEW_LINE>System.out.println(bag.size());<NEW_LINE>// Print count unique words<NEW_LINE>// print 4<NEW_LINE>System.out.println(bag.uniqueSet().size());<NEW_LINE>}
INPUT_TEXT.split(" ")));
1,672,199
protected Property buildOfferItemQualifierRuleTypeProperty(Property qualifiersCanBeQualifiers, Property qualifiersCanBeTargets) {<NEW_LINE>String offerItemQualifierRuleType;<NEW_LINE>boolean canBeQualifiers = qualifiersCanBeQualifiers == null ? false : Boolean.parseBoolean(qualifiersCanBeQualifiers.getValue());<NEW_LINE>boolean canBeTargets = qualifiersCanBeTargets == null ? false : Boolean.parseBoolean(qualifiersCanBeTargets.getValue());<NEW_LINE>if (canBeTargets && canBeQualifiers) {<NEW_LINE>offerItemQualifierRuleType = OfferItemRestrictionRuleType.QUALIFIER_TARGET.getType();<NEW_LINE>} else if (canBeTargets) {<NEW_LINE>offerItemQualifierRuleType = OfferItemRestrictionRuleType.TARGET.getType();<NEW_LINE>} else if (canBeQualifiers) {<NEW_LINE>offerItemQualifierRuleType <MASK><NEW_LINE>} else {<NEW_LINE>offerItemQualifierRuleType = OfferItemRestrictionRuleType.NONE.getType();<NEW_LINE>}<NEW_LINE>Property property = new Property();<NEW_LINE>property.setName(OFFER_ITEM_QUALIFIER_RULE_TYPE);<NEW_LINE>property.setValue(offerItemQualifierRuleType);<NEW_LINE>return property;<NEW_LINE>}
= OfferItemRestrictionRuleType.QUALIFIER.getType();
1,802,261
public void service(HttpRequest request, HttpResponse response) throws Exception {<NEW_LINE>var writer = new PrintWriter(response.getWriter());<NEW_LINE>try {<NEW_LINE>DatabaseClient client = getClient();<NEW_LINE>try (ResultSet rs = client.singleUse().executeQuery(Statement.of("SELECT SingerId, AlbumId, AlbumTitle FROM Albums"))) {<NEW_LINE>writer.printf("Albums:%n");<NEW_LINE>while (rs.next()) {<NEW_LINE>writer.printf("%d %d %s%n", rs.getLong("SingerId"), rs.getLong("AlbumId"), rs.getString("AlbumTitle"));<NEW_LINE>}<NEW_LINE>} catch (SpannerException e) {<NEW_LINE>writer.printf("Error querying database: %s%n", e.getMessage());<NEW_LINE>response.setStatusCode(HttpStatusCodes.<MASK><NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.log(Level.SEVERE, "Spanner example failed", t);<NEW_LINE>writer.printf("Error setting up Spanner: %s%n", t.getMessage());<NEW_LINE>response.setStatusCode(HttpStatusCodes.STATUS_CODE_SERVER_ERROR, t.getMessage());<NEW_LINE>}<NEW_LINE>}
STATUS_CODE_SERVER_ERROR, e.getMessage());
573,627
private void configSecondaryVm(ConfigSecondaryVmMsg msg, NoErrorCompletion completion) {<NEW_LINE>checkStatus();<NEW_LINE>ConfigSecondaryVmCmd cmd = new ConfigSecondaryVmCmd();<NEW_LINE>cmd.setVmInstanceUuid(msg.getVmInstanceUuid());<NEW_LINE>cmd.setPrimaryVmHostIp(msg.getPrimaryVmHostIp());<NEW_LINE>cmd.setNbdServerPort(msg.getNbdServerPort());<NEW_LINE>new Http<>(configSecondaryVmPath, cmd, AgentResponse.class).call(new ReturnValueCompletion<AgentResponse>(msg, completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(AgentResponse ret) {<NEW_LINE>final ConfigPrimaryVmReply reply = new ConfigPrimaryVmReply();<NEW_LINE>if (!ret.isSuccess()) {<NEW_LINE>reply.setError(operr("unable to config secondary vm[uuid:%s] on kvm host [uuid:%s, ip:%s], because %s", msg.getVmInstanceUuid(), self.getUuid(), self.getManagementIp(), ret.getError()));<NEW_LINE>} else {<NEW_LINE>logger.debug(String.format("config secondary vm[uuid:%s] on kvm host[uuid:%s] success", msg.getVmInstanceUuid(), self.getUuid()));<NEW_LINE>}<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>completion.done();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode err) {<NEW_LINE>final ConfigPrimaryVmReply reply = new ConfigPrimaryVmReply();<NEW_LINE>reply.setError(err);<NEW_LINE><MASK><NEW_LINE>completion.done();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
bus.reply(msg, reply);
115,829
final DeleteAccountCustomizationResult executeDeleteAccountCustomization(DeleteAccountCustomizationRequest deleteAccountCustomizationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteAccountCustomizationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteAccountCustomizationRequest> request = null;<NEW_LINE>Response<DeleteAccountCustomizationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteAccountCustomizationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteAccountCustomizationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAccountCustomization");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteAccountCustomizationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteAccountCustomizationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");
1,391,186
private void carregarInformacoesFiltroArvoreTipoSimbolo(String codigoFonte) {<NEW_LINE>SymbolTypeFilter symbolTypeFilter = tree.getFilter().getSymbolTypeFilter();<NEW_LINE>Matcher avaliador = Pattern.compile("@FILTRO-ARVORE-TIPOS-DE-SIMBOLO[ ]*=[ ]*([ ]*(variavel|vetor|matriz|funcao)[ ]*)(,[ ]*(variavel|vetor|matriz|funcao)[ ]*)*;").matcher(codigoFonte);<NEW_LINE>if (avaliador.find()) {<NEW_LINE>String linha = avaliador.group();<NEW_LINE>String[] valores = linha.split("=")[1].replace(";"<MASK><NEW_LINE>symbolTypeFilter.rejectAll();<NEW_LINE>for (String tipoSimbolo : valores) {<NEW_LINE>symbolTypeFilter.accept(SymbolTypeFilter.SymbolType.valueOf(tipoSimbolo.trim().toUpperCase()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>symbolTypeFilter.acceptAll();<NEW_LINE>}<NEW_LINE>}
, "").split(",");
1,252,102
public void drawFakeItemStack(int x, int y, @Nonnull ItemStack stack) {<NEW_LINE>FontRenderer font = stack.getItem().getFontRenderer(stack);<NEW_LINE>if (font == null) {<NEW_LINE>font = fontRenderer;<NEW_LINE>}<NEW_LINE>boolean smallText <MASK><NEW_LINE>String str = null;<NEW_LINE>if (stack.getCount() >= 1000) {<NEW_LINE>String unit = "k";<NEW_LINE>int units = 1000;<NEW_LINE>int value = stack.getCount() / units;<NEW_LINE>if (smallText) {<NEW_LINE>if (value >= units) {<NEW_LINE>units *= 1000;<NEW_LINE>value /= 1000;<NEW_LINE>unit = "m";<NEW_LINE>}<NEW_LINE>double val = (stack.getCount() % units) / (double) units;<NEW_LINE>int bit = (int) Math.floor(val * 10);<NEW_LINE>if (bit > 0) {<NEW_LINE>unit = "." + bit + unit;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>str = value + unit;<NEW_LINE>} else if (stack.getCount() > 1) {<NEW_LINE>str = Integer.toString(stack.getCount());<NEW_LINE>}<NEW_LINE>itemRender.renderItemAndEffectIntoGUI(stack, x, y);<NEW_LINE>if (str != null) {<NEW_LINE>GlStateManager.disableLighting();<NEW_LINE>GlStateManager.disableDepth();<NEW_LINE>GlStateManager.disableBlend();<NEW_LINE>GlStateManager.pushMatrix();<NEW_LINE>GlStateManager.translate(x + 16, y + 16, 0);<NEW_LINE>if (smallText) {<NEW_LINE>float scale = 0.666666f;<NEW_LINE>GlStateManager.pushMatrix();<NEW_LINE>GlStateManager.scale(scale, scale, scale);<NEW_LINE>font.drawStringWithShadow(str, -font.getStringWidth(str) - 1, -8, 0xFFFFFF);<NEW_LINE>GlStateManager.popMatrix();<NEW_LINE>} else {<NEW_LINE>font.drawStringWithShadow(str, -font.getStringWidth(str), -8, 0xFFFFFF);<NEW_LINE>}<NEW_LINE>GlStateManager.popMatrix();<NEW_LINE>GlStateManager.enableLighting();<NEW_LINE>GlStateManager.enableDepth();<NEW_LINE>}<NEW_LINE>itemRender.renderItemOverlayIntoGUI(font, stack, x, y, "");<NEW_LINE>}
= InvpanelConfig.inventoryPanelScaleText.get();
1,795,195
private static LocalPermissioningConfiguration loadAccountPermissioning(final LocalPermissioningConfiguration permissioningConfiguration, final boolean localConfigAccountPermissioningEnabled, final String accountPermissioningConfigFilepath) throws Exception {<NEW_LINE>if (localConfigAccountPermissioningEnabled) {<NEW_LINE>final TomlParseResult accountPermissioningToml = readToml(accountPermissioningConfigFilepath);<NEW_LINE>final TomlArray accountAllowlistTomlArray = getAllowlistArray(accountPermissioningToml, ACCOUNTS_ALLOWLIST_KEY, ACCOUNTS_WHITELIST_KEY);<NEW_LINE>permissioningConfiguration.setAccountPermissioningConfigFilePath(accountPermissioningConfigFilepath);<NEW_LINE>if (accountAllowlistTomlArray != null) {<NEW_LINE>List<String> accountsAllowlistToml = accountAllowlistTomlArray.toList().parallelStream().map(Object::toString).collect(Collectors.toList());<NEW_LINE>accountsAllowlistToml.stream().filter(s -> !AccountLocalConfigPermissioningController.isValidAccountString(s)).findFirst().ifPresent(s -> {<NEW_LINE><MASK><NEW_LINE>});<NEW_LINE>permissioningConfiguration.setAccountAllowlist(accountsAllowlistToml);<NEW_LINE>} else {<NEW_LINE>throw new Exception(ACCOUNTS_ALLOWLIST_KEY + " config option missing in TOML config file " + accountPermissioningConfigFilepath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return permissioningConfiguration;<NEW_LINE>}
throw new IllegalArgumentException("Invalid account " + s);
972,765
private void createNewPLV(final I_M_PriceList_Version oldCustomerPLV, final I_M_PriceList_Version newBasePLV, final UserId userId) {<NEW_LINE>final I_M_PriceList_Version newCustomerPLV = copy().setSkipCalculatedColumns(true).setFrom(oldCustomerPLV<MASK><NEW_LINE>newCustomerPLV.setValidFrom(newBasePLV.getValidFrom());<NEW_LINE>newCustomerPLV.setM_DiscountSchema_ID(newBasePLV.getM_DiscountSchema_ID());<NEW_LINE>newCustomerPLV.setM_Pricelist_Version_Base_ID(oldCustomerPLV.getM_PriceList_Version_ID());<NEW_LINE>final PriceListId pricelistId = PriceListId.ofRepoId(oldCustomerPLV.getM_PriceList_ID());<NEW_LINE>final LocalDate validFrom = TimeUtil.asLocalDate(newBasePLV.getValidFrom());<NEW_LINE>if (pricelistId != null && validFrom != null) {<NEW_LINE>final I_M_PriceList priceList = getById(pricelistId);<NEW_LINE>final String plvName = Services.get(IPriceListBL.class).createPLVName(priceList.getName(), validFrom);<NEW_LINE>newCustomerPLV.setName(plvName);<NEW_LINE>}<NEW_LINE>saveRecord(newCustomerPLV);<NEW_LINE>final PriceListVersionId newCustomerPLVId = PriceListVersionId.ofRepoId(newCustomerPLV.getM_PriceList_Version_ID());<NEW_LINE>createProductPricesForPLV(userId, newCustomerPLVId);<NEW_LINE>cloneASIs(newCustomerPLVId);<NEW_LINE>save(newCustomerPLV);<NEW_LINE>}
).copyToNew(I_M_PriceList_Version.class);
271,551
private synchronized Map<PathObject, Geometry> calculateVoronoiFaces() {<NEW_LINE>if (pathObjects.size() < coordinateMap.size()) {<NEW_LINE>return calculateVoronoiFacesByLocations();<NEW_LINE>}<NEW_LINE>logger.debug("Calculating Voronoi faces for {} objects", getPathObjects().size());<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>var polygons = (List<Polygon>) subdivision.getVoronoiCellPolygons(GeometryTools.getDefaultFactory());<NEW_LINE>// var polygons = (List<Polygon>)subdivision.getVoronoiCellPolygons(new GeometryFactory());<NEW_LINE>var map = new HashMap<PathObject, Geometry>();<NEW_LINE>var mapToMerge = new HashMap<PathObject, List<Geometry>>();<NEW_LINE>// Get the polygons for each object<NEW_LINE>for (var polygon : polygons) {<NEW_LINE>if (polygon.isEmpty() || !(polygon instanceof Polygonal))<NEW_LINE>continue;<NEW_LINE>var coord = (Coordinate) polygon.getUserData();<NEW_LINE>var pathObject = coordinateMap.get(coord);<NEW_LINE>if (pathObject == null) {<NEW_LINE>logger.warn("No detection found for {}", coord);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>var existing = map.put(pathObject, polygon);<NEW_LINE>if (existing != null) {<NEW_LINE>var list = mapToMerge.computeIfAbsent(pathObject, g -> {<NEW_LINE>var l <MASK><NEW_LINE>l.add(existing);<NEW_LINE>return l;<NEW_LINE>});<NEW_LINE>list.add(polygon);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Merge anything that we need to<NEW_LINE>for (var entry : mapToMerge.entrySet()) {<NEW_LINE>var pathObject = entry.getKey();<NEW_LINE>var list = entry.getValue();<NEW_LINE>Geometry geometry = null;<NEW_LINE>try {<NEW_LINE>geometry = GeometryCombiner.combine(list).buffer(0.0);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.debug("Error doing fast geometry combine for Voronoi faces: " + e.getLocalizedMessage(), e);<NEW_LINE>try {<NEW_LINE>geometry = GeometryTools.union(list);<NEW_LINE>} catch (Exception e2) {<NEW_LINE>logger.debug("Error doing fallback geometry combine for Voronoi faces: " + e2.getLocalizedMessage(), e2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>map.put(pathObject, geometry);<NEW_LINE>}<NEW_LINE>// // Finally now reduce precision<NEW_LINE>// var reducer = new GeometryPrecisionReducer(GeometryTools.getDefaultFactory().getPrecisionModel());<NEW_LINE>// for (var key : map.keySet().toArray(PathObject[]::new))<NEW_LINE>// map.put(key, reducer.reduce(map.get(key)));<NEW_LINE>return map;<NEW_LINE>}
= new ArrayList<Geometry>();
104,186
protected void addConstraint(MetaClass metaClass, AccessConstraint constraint) {<NEW_LINE>List<AccessConstraint> constraints = builderConstraints.computeIfAbsent(metaClass.getName(), k <MASK><NEW_LINE>if (constraint.isCustom()) {<NEW_LINE>constraints.add(constraint);<NEW_LINE>} else {<NEW_LINE>AccessConstraint existingConstraint = constraints.stream().filter(c -> Objects.equals(c.getOperation(), constraint.getOperation())).findFirst().orElse(null);<NEW_LINE>if (existingConstraint != null) {<NEW_LINE>if (constraint instanceof JpqlAccessConstraint) {<NEW_LINE>if (existingConstraint instanceof JpqlAccessConstraint) {<NEW_LINE>constraints.add(constraint);<NEW_LINE>} else {<NEW_LINE>constraints.remove(existingConstraint);<NEW_LINE>constraints.add(constraint);<NEW_LINE>((BasicJpqlAccessConstraint) constraint).setPredicate(existingConstraint.getPredicate());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (existingConstraint instanceof JpqlAccessConstraint && existingConstraint.getPredicate() == null) {<NEW_LINE>((BasicJpqlAccessConstraint) existingConstraint).setPredicate(constraint.getPredicate());<NEW_LINE>} else {<NEW_LINE>constraints.add(constraint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>constraints.add(constraint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
-> new ArrayList<>());
1,476,883
private PJvmGc convertJvmGc(JvmGcMetricSnapshot jvmGcMetricSnapshot) {<NEW_LINE>final PJvmGc.Builder jvmGcBuilder = PJvmGc.newBuilder();<NEW_LINE>jvmGcBuilder.setJvmMemoryHeapMax(jvmGcMetricSnapshot.getJvmMemoryHeapMax());<NEW_LINE>jvmGcBuilder.setJvmMemoryHeapUsed(jvmGcMetricSnapshot.getJvmMemoryHeapUsed());<NEW_LINE>jvmGcBuilder.setJvmMemoryNonHeapMax(jvmGcMetricSnapshot.getJvmMemoryNonHeapMax());<NEW_LINE>jvmGcBuilder.setJvmMemoryNonHeapUsed(jvmGcMetricSnapshot.getJvmMemoryNonHeapUsed());<NEW_LINE>jvmGcBuilder.setJvmGcOldCount(jvmGcMetricSnapshot.getJvmGcOldCount());<NEW_LINE>jvmGcBuilder.setJvmGcOldTime(jvmGcMetricSnapshot.getJvmGcOldTime());<NEW_LINE>final PJvmGcType jvmGcType = this.jvmGcTypeConverter.toMessage(jvmGcMetricSnapshot.getType());<NEW_LINE>jvmGcBuilder.setType(jvmGcType);<NEW_LINE>if (jvmGcMetricSnapshot.getJvmGcDetailed() != null) {<NEW_LINE>final JvmGcDetailedMetricSnapshot jvmGcDetailedMetricSnapshot = jvmGcMetricSnapshot.getJvmGcDetailed();<NEW_LINE>final PJvmGcDetailed.Builder jvmGcDetailedBuilder = PJvmGcDetailed.newBuilder();<NEW_LINE>jvmGcDetailedBuilder.setJvmPoolNewGenUsed(jvmGcDetailedMetricSnapshot.getJvmPoolNewGenUsed());<NEW_LINE>jvmGcDetailedBuilder.setJvmPoolOldGenUsed(jvmGcDetailedMetricSnapshot.getJvmPoolOldGenUsed());<NEW_LINE>jvmGcDetailedBuilder.setJvmPoolSurvivorSpaceUsed(jvmGcDetailedMetricSnapshot.getJvmPoolSurvivorSpaceUsed());<NEW_LINE>jvmGcDetailedBuilder.setJvmPoolCodeCacheUsed(jvmGcDetailedMetricSnapshot.getJvmPoolCodeCacheUsed());<NEW_LINE>jvmGcDetailedBuilder.setJvmPoolPermGenUsed(jvmGcDetailedMetricSnapshot.getJvmPoolPermGenUsed());<NEW_LINE>jvmGcDetailedBuilder.<MASK><NEW_LINE>jvmGcDetailedBuilder.setJvmGcNewCount(jvmGcDetailedMetricSnapshot.getJvmGcNewCount());<NEW_LINE>jvmGcDetailedBuilder.setJvmGcNewTime(jvmGcDetailedMetricSnapshot.getJvmGcNewTime());<NEW_LINE>jvmGcBuilder.setJvmGcDetailed(jvmGcDetailedBuilder.build());<NEW_LINE>}<NEW_LINE>return jvmGcBuilder.build();<NEW_LINE>}
setJvmPoolMetaspaceUsed(jvmGcDetailedMetricSnapshot.getJvmPoolMetaspaceUsed());
8,775
public AggregationAuthorization unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AggregationAuthorization aggregationAuthorization = new AggregationAuthorization();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AggregationAuthorizationArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>aggregationAuthorization.setAggregationAuthorizationArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AuthorizedAccountId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>aggregationAuthorization.setAuthorizedAccountId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AuthorizedAwsRegion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>aggregationAuthorization.setAuthorizedAwsRegion(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("CreationTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>aggregationAuthorization.setCreationTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return aggregationAuthorization;<NEW_LINE>}
class).unmarshall(context));
1,827,121
public static String calcUIMode() {<NEW_LINE>// Can't use Constants.isSafeMode - it's not set by the time we<NEW_LINE>// get here.<NEW_LINE>if ("1".equals(System.getProperty(SystemProperties.SYSPROP_SAFEMODE))) {<NEW_LINE>// If we are in safe-mode, prefer the classic UI - less likely to cause problems.<NEW_LINE>return "az2";<NEW_LINE>}<NEW_LINE>String lastUI = COConfigurationManager.getStringParameter("ui", "az2");<NEW_LINE>COConfigurationManager.setParameter("lastUI", lastUI);<NEW_LINE>String forceUI = System.getProperty("force.ui");<NEW_LINE>if (forceUI != null) {<NEW_LINE>COConfigurationManager.setParameter("ui", forceUI);<NEW_LINE>return forceUI;<NEW_LINE>}<NEW_LINE>// Flip people who install this client over top of an existing az<NEW_LINE>// to az3ui. The installer will write a file to the program dir,<NEW_LINE>// while an upgrade won't<NEW_LINE>boolean installLogExists = FileUtil.getApplicationFile("installer.log").exists();<NEW_LINE>boolean alreadySwitched = COConfigurationManager.getBooleanParameter("installer.ui.alreadySwitched", false);<NEW_LINE>if (!alreadySwitched && installLogExists) {<NEW_LINE>COConfigurationManager.setParameter("installer.ui.alreadySwitched", true);<NEW_LINE>COConfigurationManager.setParameter("ui", "az3");<NEW_LINE>COConfigurationManager.setParameter("az3.virgin.switch", true);<NEW_LINE>return "az3";<NEW_LINE>}<NEW_LINE>boolean asked = COConfigurationManager.getBooleanParameter("ui.asked", false);<NEW_LINE>if (asked || COConfigurationManager.hasParameter("ui", true)) {<NEW_LINE>return COConfigurationManager.getStringParameter("ui", "az3");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return ("az3");<NEW_LINE>}
COConfigurationManager.setParameter("ui", "az3");
1,141,591
public void insert(InsertRowsOfOneDevicePlan insertRowsOfOneDevicePlan) throws WriteProcessException, TriggerExecutionException {<NEW_LINE>writeLock("InsertRowsOfOneDevice");<NEW_LINE>try {<NEW_LINE>boolean isSequence = false;<NEW_LINE>InsertRowPlan[] rowPlans = insertRowsOfOneDevicePlan.getRowPlans();<NEW_LINE>for (int i = 0, rowPlansLength = rowPlans.length; i < rowPlansLength; i++) {<NEW_LINE>InsertRowPlan plan = rowPlans[i];<NEW_LINE>if (!isAlive(plan.getTime()) || insertRowsOfOneDevicePlan.isExecuted(i)) {<NEW_LINE>// we do not need to write these part of data, as they can not be queried<NEW_LINE>// or the sub-plan has already been executed, we are retrying other sub-plans<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// init map<NEW_LINE>long timePartitionId = StorageEngine.getTimePartition(plan.getTime());<NEW_LINE>lastFlushTimeManager.ensureFlushedTimePartition(timePartitionId);<NEW_LINE>// as the plans have been ordered, and we have get the write lock,<NEW_LINE>// So, if a plan is sequenced, then all the rest plans are sequenced.<NEW_LINE>//<NEW_LINE>if (!isSequence) {<NEW_LINE>isSequence = plan.getTime() > lastFlushTimeManager.getFlushedTime(timePartitionId, plan.getDevicePath().getFullPath());<NEW_LINE>}<NEW_LINE>// is unsequence and user set config to discard out of order data<NEW_LINE>if (!isSequence && IoTDBDescriptor.getInstance().getConfig().isEnableDiscardOutOfOrderData()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lastFlushTimeManager.ensureLastTimePartition(timePartitionId);<NEW_LINE>// fire trigger before insertion<NEW_LINE>TriggerEngine.fire(TriggerEvent.BEFORE_INSERT, plan);<NEW_LINE>// insert to sequence or unSequence file<NEW_LINE>insertToTsFileProcessor(plan, isSequence, timePartitionId);<NEW_LINE>// fire trigger before insertion<NEW_LINE>TriggerEngine.<MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>writeUnlock();<NEW_LINE>}<NEW_LINE>}
fire(TriggerEvent.AFTER_INSERT, plan);
866,280
public static boolean verifyIOIOFileBlock(IOIO ioio, IcspMaster icsp, IOIOFileReader file) throws ConnectionLostException, InterruptedException, FormatException {<NEW_LINE>int[<MASK><NEW_LINE>int[] actualBlock = new int[64];<NEW_LINE>parseBlock(file.currentBlock(), fileBlock);<NEW_LINE>Scripts.readBlock(ioio, icsp, file.currentAddress(), 64, actualBlock);<NEW_LINE>if (!Arrays.equals(fileBlock, actualBlock)) {<NEW_LINE>for (int i = 0; i < 64; ++i) {<NEW_LINE>if (fileBlock[i] != actualBlock[i]) {<NEW_LINE>Log.w(TAG, "Failed verification, address = 0x" + file.currentAddress() + i);<NEW_LINE>Log.w(TAG, "Expected: 0x" + Integer.toHexString(fileBlock[i]));<NEW_LINE>Log.w(TAG, "Actual: 0x" + Integer.toHexString(actualBlock[i]));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
] fileBlock = new int[64];
51,488
public Docket api() {<NEW_LINE>final List<ResponseMessage> getMessages <MASK><NEW_LINE>getMessages.add(new ResponseMessageBuilder().code(500).message("500 message").responseModel(new ModelRef("Error")).build());<NEW_LINE>getMessages.add(new ResponseMessageBuilder().code(403).message("Forbidden").build());<NEW_LINE>getMessages.add(new ResponseMessageBuilder().code(401).message("Unauthorized").build());<NEW_LINE>Set<String> produces = new HashSet<>();<NEW_LINE>produces.add("application/json");<NEW_LINE>Set<String> consumes = new HashSet<>();<NEW_LINE>consumes.add("application/json");<NEW_LINE>return new Docket(DocumentationType.SWAGGER_2).host(HOST).select().apis(requestHandlers()).build().securitySchemes(Collections.singletonList(new ApiKey("JWT", AUTHORIZATION, HEADER.name()))).securityContexts(singletonList(SecurityContext.builder().securityReferences(singletonList(SecurityReference.builder().reference("JWT").scopes(new AuthorizationScope[0]).build())).build())).produces(produces).consumes(consumes).globalResponseMessage(RequestMethod.GET, getMessages).globalResponseMessage(RequestMethod.GET, getMessages);<NEW_LINE>}
= new ArrayList<ResponseMessage>();
103,632
private void onEndDialog(String path, ArrayList<HybridFileParcelable> filesToCopy, ArrayList<HybridFileParcelable> conflictingFiles) {<NEW_LINE>if (conflictingFiles != null && counter != conflictingFiles.size() && conflictingFiles.size() > 0) {<NEW_LINE>if (dialogState == UNKNOWN) {<NEW_LINE>showDialog(path, filesToCopy, conflictingFiles);<NEW_LINE>} else if (dialogState == DO_NOT_REPLACE) {<NEW_LINE><MASK><NEW_LINE>} else if (dialogState == REPLACE) {<NEW_LINE>replaceFiles(path, filesToCopy, conflictingFiles);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>CopyNode c = !copyFolder.hasStarted() ? copyFolder.startCopy() : copyFolder.goToNextNode();<NEW_LINE>if (c != null) {<NEW_LINE>counter = 0;<NEW_LINE>paths.add(c.getPath());<NEW_LINE>filesToCopyPerFolder.add(c.filesToCopy);<NEW_LINE>if (dialogState == UNKNOWN) {<NEW_LINE>onEndDialog(c.path, c.filesToCopy, c.conflictingFiles);<NEW_LINE>} else if (dialogState == DO_NOT_REPLACE) {<NEW_LINE>doNotReplaceFiles(c.path, c.filesToCopy, c.conflictingFiles);<NEW_LINE>} else if (dialogState == REPLACE) {<NEW_LINE>replaceFiles(c.path, c.filesToCopy, c.conflictingFiles);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>finishCopying(paths, filesToCopyPerFolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
doNotReplaceFiles(path, filesToCopy, conflictingFiles);
1,517,158
public void read(JmeImporter im) throws IOException {<NEW_LINE>InputCapsule ic = im.getCapsule(this);<NEW_LINE>name = ic.readString("name", null);<NEW_LINE>shaderNames.put(Shader.ShaderType.Vertex, ic.readString("vertName", null));<NEW_LINE>shaderNames.put(Shader.ShaderType.Fragment, ic.readString("fragName", null));<NEW_LINE>shaderNames.put(Shader.ShaderType.Geometry, ic.readString("geomName", null));<NEW_LINE>shaderNames.put(Shader.ShaderType.TessellationControl, ic.readString("tsctrlName", null));<NEW_LINE>shaderNames.put(Shader.ShaderType.TessellationEvaluation, ic.readString("tsevalName", null));<NEW_LINE>shaderPrologue = ic.readString("shaderPrologue", null);<NEW_LINE>lightMode = ic.readEnum("lightMode", LightMode.class, LightMode.Disable);<NEW_LINE>shadowMode = ic.readEnum("shadowMode", <MASK><NEW_LINE>renderState = (RenderState) ic.readSavable("renderState", null);<NEW_LINE>noRender = ic.readBoolean("noRender", false);<NEW_LINE>if (ic.getSavableVersion(TechniqueDef.class) == 0) {<NEW_LINE>// Old version<NEW_LINE>shaderLanguages.put(Shader.ShaderType.Vertex, ic.readString("shaderLang", null));<NEW_LINE>shaderLanguages.put(Shader.ShaderType.Fragment, shaderLanguages.get(Shader.ShaderType.Vertex));<NEW_LINE>} else {<NEW_LINE>// New version<NEW_LINE>shaderLanguages.put(Shader.ShaderType.Vertex, ic.readString("vertLanguage", null));<NEW_LINE>shaderLanguages.put(Shader.ShaderType.Fragment, ic.readString("fragLanguage", null));<NEW_LINE>shaderLanguages.put(Shader.ShaderType.Geometry, ic.readString("geomLanguage", null));<NEW_LINE>shaderLanguages.put(Shader.ShaderType.TessellationControl, ic.readString("tsctrlLanguage", null));<NEW_LINE>shaderLanguages.put(Shader.ShaderType.TessellationEvaluation, ic.readString("tsevalLanguage", null));<NEW_LINE>}<NEW_LINE>usesNodes = ic.readBoolean("usesNodes", false);<NEW_LINE>shaderNodes = ic.readSavableArrayList("shaderNodes", null);<NEW_LINE>shaderGenerationInfo = (ShaderGenerationInfo) ic.readSavable("shaderGenerationInfo", null);<NEW_LINE>}
ShadowMode.class, ShadowMode.Disable);
1,670,319
public ListQueuesResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ListQueuesResult listQueuesResult = new ListQueuesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return listQueuesResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("QueueUrl", targetDepth)) {<NEW_LINE>listQueuesResult.withQueueUrls(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>listQueuesResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return listQueuesResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
893,540
public void onClick(View v) {<NEW_LINE>final Context context = v.getContext();<NEW_LINE>if (v == developer) {<NEW_LINE>// open dev settings<NEW_LINE>Intent devIntent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);<NEW_LINE>devIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>ResolveInfo resolveInfo = context.getPackageManager().resolveActivity(devIntent, 0);<NEW_LINE>if (resolveInfo != null) {<NEW_LINE>context.startActivity(devIntent);<NEW_LINE>} else {<NEW_LINE>Toast.makeText(context, "Developer settings not available on device", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>} else if (v == battery) {<NEW_LINE>// try to find an app to handle battery settings<NEW_LINE>Intent batteryIntent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);<NEW_LINE>batteryIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>ResolveInfo resolveInfo = context.getPackageManager().resolveActivity(batteryIntent, 0);<NEW_LINE>if (resolveInfo != null) {<NEW_LINE>context.startActivity(batteryIntent);<NEW_LINE>} else {<NEW_LINE>Toast.makeText(context, "No app found to handle power usage intent", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>} else if (v == settings) {<NEW_LINE>// open android settings<NEW_LINE>Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS);<NEW_LINE>settingsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>context.startActivity(settingsIntent);<NEW_LINE>} else if (v == info) {<NEW_LINE>Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);<NEW_LINE>intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>intent.setData(Uri.parse("package:" <MASK><NEW_LINE>context.startActivity(intent);<NEW_LINE>} else if (v == uninstall) {<NEW_LINE>// open dialog to uninstall app<NEW_LINE>Uri packageURI = Uri.parse("package:" + context.getPackageName());<NEW_LINE>Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);<NEW_LINE>context.startActivity(uninstallIntent);<NEW_LINE>} else if (v == location) {<NEW_LINE>Intent locationIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);<NEW_LINE>locationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>context.startActivity(locationIntent);<NEW_LINE>}<NEW_LINE>}
+ context.getPackageName()));
36,540
private void loadNode1211() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionDiagnostics_LocaleIds, new QualifiedName(0, "LocaleIds"), new LocalizedText("en", "LocaleIds"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.LocaleId, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionDiagnostics_LocaleIds, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionDiagnostics_LocaleIds, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionDiagnostics_LocaleIds, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
942,854
public void readSpanValue(Buffer buffer, SpanBo span, SpanDecodingContext decodingContext) {<NEW_LINE>final byte version = buffer.readByte();<NEW_LINE>span.setVersion(version);<NEW_LINE>final SpanBitFiled bitFiled = new SpanBitFiled(buffer.readByte());<NEW_LINE>final short serviceType = buffer.readShort();<NEW_LINE>span.setServiceType(serviceType);<NEW_LINE>switch(bitFiled.getApplicationServiceTypeEncodingStrategy()) {<NEW_LINE>case PREV_EQUALS:<NEW_LINE>span.setApplicationServiceType(serviceType);<NEW_LINE>break;<NEW_LINE>case RAW:<NEW_LINE>span.setApplicationServiceType(buffer.readShort());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("applicationServiceType");<NEW_LINE>}<NEW_LINE>if (!bitFiled.isRoot()) {<NEW_LINE>span.setParentSpanId(buffer.readLong());<NEW_LINE>} else {<NEW_LINE>span.setParentSpanId(-1);<NEW_LINE>}<NEW_LINE>final long startTimeDelta = buffer.readVLong();<NEW_LINE>final long startTime = span.getCollectorAcceptTime() - startTimeDelta;<NEW_LINE>span.setStartTime(startTime);<NEW_LINE>span.setElapsed(buffer.readVInt());<NEW_LINE>span.setRpc(buffer.readPrefixedString());<NEW_LINE>span.<MASK><NEW_LINE>span.setRemoteAddr(buffer.readPrefixedString());<NEW_LINE>span.setApiId(buffer.readSVInt());<NEW_LINE>if (bitFiled.isSetErrorCode()) {<NEW_LINE>span.setErrCode(buffer.readInt());<NEW_LINE>}<NEW_LINE>if (bitFiled.isSetHasException()) {<NEW_LINE>int exceptionId = buffer.readSVInt();<NEW_LINE>String exceptionMessage = buffer.readPrefixedString();<NEW_LINE>span.setExceptionInfo(exceptionId, exceptionMessage);<NEW_LINE>}<NEW_LINE>if (bitFiled.isSetFlag()) {<NEW_LINE>span.setFlag(buffer.readShort());<NEW_LINE>}<NEW_LINE>if (bitFiled.isSetLoggingTransactionInfo()) {<NEW_LINE>span.setLoggingTransactionInfo(buffer.readByte());<NEW_LINE>}<NEW_LINE>span.setAcceptorHost(buffer.readPrefixedString());<NEW_LINE>if (bitFiled.isSetAnnotation()) {<NEW_LINE>List<AnnotationBo> annotationBoList = readAnnotationList(buffer, decodingContext);<NEW_LINE>span.setAnnotationBoList(annotationBoList);<NEW_LINE>}<NEW_LINE>List<SpanEventBo> spanEventBoList = readSpanEvent(buffer, decodingContext, SEQUENCE_SPAN_EVENT_FILTER);<NEW_LINE>span.addSpanEventBoList(spanEventBoList);<NEW_LINE>}
setEndPoint(buffer.readPrefixedString());
357,365
private static void addResourceEntry(int hash, IntObjectHashMap map, Loader loader) {<NEW_LINE>Object <MASK><NEW_LINE>if (o == null)<NEW_LINE>map.put(hash, loader);<NEW_LINE>else if (o instanceof Loader) {<NEW_LINE>if (ClassPath.ourLogTiming)<NEW_LINE>assert loader != o;<NEW_LINE>map.put(hash, new Loader[] { (Loader) o, loader });<NEW_LINE>} else {<NEW_LINE>Loader[] loadersArray = (Loader[]) o;<NEW_LINE>if (ClassPath.ourLogTiming)<NEW_LINE>assert ArrayUtilRt.find(loadersArray, loader) == -1;<NEW_LINE>Loader[] newArray = new Loader[loadersArray.length + 1];<NEW_LINE>System.arraycopy(loadersArray, 0, newArray, 0, loadersArray.length);<NEW_LINE>newArray[loadersArray.length] = loader;<NEW_LINE>map.put(hash, newArray);<NEW_LINE>}<NEW_LINE>}
o = map.get(hash);
1,342,448
protected void notifyListeners() {<NEW_LINE>// TODO could these be done earlier (or just once?)<NEW_LINE>JMeterContext threadContext = getThreadContext();<NEW_LINE>JMeterVariables threadVars = threadContext.getVariables();<NEW_LINE>SamplePackage pack = (SamplePackage) threadVars.getObject(JMeterThread.PACKAGE_OBJECT);<NEW_LINE>if (pack == null) {<NEW_LINE>// If child of TransactionController is a ThroughputController and TPC does<NEW_LINE>// not sample its children, then we will have this<NEW_LINE>// TODO Should this be at warn level ?<NEW_LINE>log.warn("Could not fetch SamplePackage");<NEW_LINE>} else {<NEW_LINE>SampleEvent event = new SampleEvent(res, threadContext.getThreadGroup().<MASK><NEW_LINE>// We must set res to null now, before sending the event for the transaction,<NEW_LINE>// so that we can ignore that event in our sampleOccurred method<NEW_LINE>res = null;<NEW_LINE>lnf.notifyListeners(event, pack.getSampleListeners());<NEW_LINE>}<NEW_LINE>}
getName(), threadVars, true);
747,892
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {<NEW_LINE>ServerHttpRequest request = exchange.getRequest();<NEW_LINE>URI requestUri = request.getURI();<NEW_LINE><MASK><NEW_LINE>// Record only http requests (including https)<NEW_LINE>if ((!"http".equals(scheme) && !"https".equals(scheme))) {<NEW_LINE>return chain.filter(exchange);<NEW_LINE>}<NEW_LINE>Object cachedBody = exchange.getAttribute(ServerWebExchangeUtils.CACHED_REQUEST_BODY_ATTR);<NEW_LINE>if (cachedBody != null) {<NEW_LINE>return chain.filter(exchange);<NEW_LINE>}<NEW_LINE>return ServerWebExchangeUtils.cacheRequestBodyAndRequest(exchange, (serverHttpRequest) -> {<NEW_LINE>final ServerRequest serverRequest = ServerRequest.create(exchange.mutate().request(serverHttpRequest).build(), messageReaders);<NEW_LINE>return serverRequest.bodyToMono((config.getBodyClass())).doOnNext(objectValue -> {<NEW_LINE>exchange.getAttributes().put(ServerWebExchangeUtils.CACHED_REQUEST_BODY_ATTR, objectValue);<NEW_LINE>}).then(Mono.defer(() -> {<NEW_LINE>ServerHttpRequest cachedRequest = exchange.getAttribute(CACHED_SERVER_HTTP_REQUEST_DECORATOR_ATTR);<NEW_LINE>Assert.notNull(cachedRequest, "cache request shouldn't be null");<NEW_LINE>exchange.getAttributes().remove(CACHED_SERVER_HTTP_REQUEST_DECORATOR_ATTR);<NEW_LINE>return chain.filter(exchange.mutate().request(cachedRequest).build());<NEW_LINE>}));<NEW_LINE>});<NEW_LINE>}
String scheme = requestUri.getScheme();
1,743,396
public static double[] deserializeDouble(ByteBuf buf) {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>int length = buf.readInt();<NEW_LINE>int numBits = buf.readInt();<NEW_LINE>double maxAbs = buf.readDouble();<NEW_LINE>int maxPoint = (int) Math.pow(2, numBits - 1) - 1;<NEW_LINE>int itemPerByte = 8 / numBits;<NEW_LINE>int bytePerItem = numBits / 8;<NEW_LINE>double[] arr = new double[length];<NEW_LINE>for (int i = 0; i < length; ) {<NEW_LINE>if (bytePerItem >= 1) {<NEW_LINE>byte[] itemBytes = new byte[bytePerItem];<NEW_LINE>buf.readBytes(itemBytes);<NEW_LINE>int point = deserializeInt(itemBytes);<NEW_LINE>double item = maxAbs / maxPoint * point;<NEW_LINE>arr[i] = item;<NEW_LINE>i++;<NEW_LINE>} else {<NEW_LINE>byte b = buf.readByte();<NEW_LINE>int[] points = deserializeInt(b, itemPerByte);<NEW_LINE>for (int point : points) {<NEW_LINE>if (i < length) {<NEW_LINE>arr[i] = maxAbs / maxPoint * point;<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// LOG.info("parsed double length: " + length + Arrays.toString(arr));<NEW_LINE>LOG.info(String.format("parse %d double, max abs: %f, max point: %d, cost %d ms", length, maxAbs, maxPoint, System<MASK><NEW_LINE>return arr;<NEW_LINE>}
.currentTimeMillis() - startTime));
962,214
private void initActions(Context context) {<NEW_LINE>playPauseAction = new PlaybackControlsRow.PlayPauseAction(context);<NEW_LINE>rewindAction = new PlaybackControlsRow.RewindAction(context);<NEW_LINE>fastForwardAction = new PlaybackControlsRow.FastForwardAction(context);<NEW_LINE>skipNextAction = new PlaybackControlsRow.SkipNextAction(context);<NEW_LINE>selectAudioAction = new SelectAudioAction(context, this);<NEW_LINE>selectAudioAction.setLabels(new String[] { context.getString(R.string.lbl_audio_track) });<NEW_LINE>closedCaptionsAction = new ClosedCaptionsAction(context, this);<NEW_LINE>closedCaptionsAction.setLabels(new String[] { context.getString(R.string.lbl_subtitle_track) });<NEW_LINE>adjustAudioDelayAction = new AdjustAudioDelayAction(context, this);<NEW_LINE>adjustAudioDelayAction.setLabels(new String[] { context.getString(R.string.lbl_audio_delay) });<NEW_LINE>playbackSpeedAction = new <MASK><NEW_LINE>playbackSpeedAction.setLabels(new String[] { context.getString(R.string.lbl_playback_speed) });<NEW_LINE>zoomAction = new ZoomAction(context, this);<NEW_LINE>zoomAction.setLabels(new String[] { context.getString(R.string.lbl_zoom) });<NEW_LINE>chapterAction = new ChapterAction(context, this);<NEW_LINE>chapterAction.setLabels(new String[] { context.getString(R.string.lbl_chapters) });<NEW_LINE>previousLiveTvChannelAction = new PreviousLiveTvChannelAction(context, this);<NEW_LINE>previousLiveTvChannelAction.setLabels(new String[] { context.getString(R.string.lbl_prev_item) });<NEW_LINE>channelBarChannelAction = new ChannelBarChannelAction(context, this);<NEW_LINE>channelBarChannelAction.setLabels(new String[] { context.getString(R.string.lbl_other_channels) });<NEW_LINE>guideAction = new GuideAction(context, this);<NEW_LINE>guideAction.setLabels(new String[] { context.getString(R.string.lbl_live_tv_guide) });<NEW_LINE>recordAction = new RecordAction(context, this);<NEW_LINE>recordAction.setLabels(new String[] { context.getString(R.string.lbl_record), context.getString(R.string.lbl_cancel_recording) });<NEW_LINE>}
PlaybackSpeedAction(context, this, playbackController);
1,642,427
public String sendCmd(final String cmd) {<NEW_LINE>try (final Socket clientSocket = new Socket(hostName, port);<NEW_LINE>final BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream(), ICmd.SICS_CMD_CHARSET));<NEW_LINE>final OutputStream out = clientSocket.getOutputStream()) {<NEW_LINE>clientSocket.setSoTimeout(readTimeoutMillis);<NEW_LINE>logger.debug("Writing cmd to the socket: {}", cmd);<NEW_LINE>out.write(cmd.getBytes(ICmd.SICS_CMD_CHARSET));<NEW_LINE>out.flush();<NEW_LINE>String result = null;<NEW_LINE>String lastReadLine = in.readLine();<NEW_LINE>if (returnLastLine) {<NEW_LINE>while (lastReadLine != null) {<NEW_LINE>result = lastReadLine;<NEW_LINE>lastReadLine = readWithTimeout(in);<NEW_LINE>}<NEW_LINE>logger.debug("Result (last line) as read from the socket: {}", result);<NEW_LINE>} else {<NEW_LINE>result = lastReadLine;<NEW_LINE>logger.debug("Result (first line) as read from the socket: {}", result);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (final UnknownHostException e) {<NEW_LINE>throw new EndPointException("Caught UnknownHostException: " + <MASK><NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new EndPointException("Caught IOException: " + e.getLocalizedMessage(), e);<NEW_LINE>}<NEW_LINE>}
e.getLocalizedMessage(), e);
228,336
public static int runExternalAndWait(Ruby runtime, IRubyObject[] rawArgs, Map mergeEnv) {<NEW_LINE>OutputStream output = runtime.getOutputStream();<NEW_LINE><MASK><NEW_LINE>InputStream input = runtime.getInputStream();<NEW_LINE>File pwd = new File(runtime.getCurrentDirectory());<NEW_LINE>LaunchConfig cfg = new LaunchConfig(runtime, rawArgs, true);<NEW_LINE>try {<NEW_LINE>Process process;<NEW_LINE>try {<NEW_LINE>if (cfg.shouldRunInShell()) {<NEW_LINE>log(runtime, "Launching with shell");<NEW_LINE>// execute command with sh -c ... this does shell expansion of wildcards<NEW_LINE>cfg.verifyExecutableForShell();<NEW_LINE>process = buildProcess(runtime, cfg.getExecArgs(), getCurrentEnv(runtime, mergeEnv), pwd);<NEW_LINE>} else {<NEW_LINE>log(runtime, "Launching directly (no shell)");<NEW_LINE>cfg.verifyExecutableForDirect();<NEW_LINE>}<NEW_LINE>final String[] execArgs = cfg.getExecArgs();<NEW_LINE>if (changeDirInsideJar(runtime, execArgs)) {<NEW_LINE>pwd = new File(System.getProperty("user.dir"));<NEW_LINE>}<NEW_LINE>process = buildProcess(runtime, execArgs, getCurrentEnv(runtime, mergeEnv), pwd);<NEW_LINE>} catch (SecurityException se) {<NEW_LINE>throw runtime.newSecurityError(se.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>handleStreams(runtime, process, input, output, error);<NEW_LINE>return process.waitFor();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw runtime.newIOErrorFromException(e);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw runtime.newThreadError("unexpected interrupt");<NEW_LINE>}<NEW_LINE>}
OutputStream error = runtime.getErrorStream();
1,764,286
protected void readDiversifications() {<NEW_LINE>if (suspendDivs()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>storage_mon.enter();<NEW_LINE>Map map = readMapFromFile("diverse");<NEW_LINE>List keys = (List) map.get("local");<NEW_LINE>if (keys != null) {<NEW_LINE>long now = SystemTime.getCurrentTime();<NEW_LINE>for (int i = 0; i < keys.size(); i++) {<NEW_LINE>storageKey d = storageKey.deserialise(this, (Map) keys.get(i));<NEW_LINE>long time_left = d.getExpiry() - now;<NEW_LINE>if (time_left > 0) {<NEW_LINE>local_storage_keys.put(d.getKey(), d);<NEW_LINE>} else {<NEW_LINE>log.log("SM: serialised sk: " + DHTLog.getString2(d.getKey().getBytes()) + " expired");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List divs = (List) map.get("remote");<NEW_LINE>if (divs != null) {<NEW_LINE>long now = SystemTime.getCurrentTime();<NEW_LINE>for (int i = 0; i < divs.size(); i++) {<NEW_LINE>diversification d = diversification.deserialise(this, (Map<MASK><NEW_LINE>long time_left = d.getExpiry() - now;<NEW_LINE>if (time_left > 0) {<NEW_LINE>diversification existing = (diversification) remote_diversifications.put(d.getKey(), d);<NEW_LINE>if (existing != null) {<NEW_LINE>divRemoved(existing);<NEW_LINE>}<NEW_LINE>divAdded(d);<NEW_LINE>} else {<NEW_LINE>log.log("SM: serialised div: " + DHTLog.getString2(d.getKey().getBytes()) + " expired");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>storage_mon.exit();<NEW_LINE>}<NEW_LINE>}
) divs.get(i));
1,339,228
private static String LPS(String input) {<NEW_LINE>if (input == null || input.length() == 0) {<NEW_LINE>return input;<NEW_LINE>}<NEW_LINE>boolean[][] arr = new boolean[input.length()][input.length()];<NEW_LINE><MASK><NEW_LINE>for (int g = 0; g < input.length(); g++) {<NEW_LINE>for (int i = 0, j = g; j < input.length(); i++, j++) {<NEW_LINE>if (g == 0) {<NEW_LINE>arr[i][j] = true;<NEW_LINE>} else if (g == 1) {<NEW_LINE>if (input.charAt(i) == input.charAt(j)) {<NEW_LINE>arr[i][j] = true;<NEW_LINE>} else {<NEW_LINE>arr[i][j] = false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (input.charAt(i) == input.charAt(j) && arr[i + 1][j - 1]) {<NEW_LINE>arr[i][j] = true;<NEW_LINE>} else {<NEW_LINE>arr[i][j] = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (arr[i][j]) {<NEW_LINE>start = i;<NEW_LINE>end = j;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return input.substring(start, end + 1);<NEW_LINE>}
int start = 0, end = 0;
940,707
public void onActivityResult(final JavaFileStorage.FileStorageSetupActivity setupAct, int requestCode, int resultCode, Intent data) {<NEW_LINE>logDebug("ActivityResult: " + requestCode + "/" + resultCode);<NEW_LINE>switch(requestCode) {<NEW_LINE>case REQUEST_SIGN_IN:<NEW_LINE>Activity activity = (Activity) setupAct;<NEW_LINE>Task<GoogleSignInAccount> completedTask = GoogleSignIn.getSignedInAccountFromIntent(data);<NEW_LINE>Log.d(TAG, "handleSignInResult:" + completedTask.isSuccessful());<NEW_LINE>try {<NEW_LINE>// Signed in successfully<NEW_LINE>GoogleSignInAccount account = completedTask.getResult(ApiException.class);<NEW_LINE>if (GoogleSignIn.hasPermissions(account, getScope())) {<NEW_LINE>initializeAccountOrPath(setupAct, account.getAccount().name);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (ApiException e) {<NEW_LINE>// Signed out, show unauthenticated UI.<NEW_LINE>Log.w(TAG, "handleSignInResult:error", e);<NEW_LINE>}<NEW_LINE>((Activity) setupAct).setResult(Activity.RESULT_CANCELED, data);<NEW_LINE>((Activity) setupAct).finish();<NEW_LINE>break;<NEW_LINE>case REQUEST_ACCOUNT_PICKER:<NEW_LINE>logDebug("ActivityResult: REQUEST_ACCOUNT_PICKER");<NEW_LINE>if (resultCode == Activity.RESULT_OK && data != null && data.getExtras() != null) {<NEW_LINE>String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);<NEW_LINE>if (accountName != null) {<NEW_LINE>logDebug("Initialize Account name=" + accountName);<NEW_LINE>initializeAccountOrPath(setupAct, accountName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logDebug("Error selecting account");<NEW_LINE>// Intent retData = new Intent();<NEW_LINE>// retData.putExtra(EXTRA_ERROR_MESSAGE, t.getMessage());<NEW_LINE>((Activity) setupAct).<MASK><NEW_LINE>((Activity) setupAct).finish();<NEW_LINE>case REQUEST_AUTHORIZATION:<NEW_LINE>if (resultCode == Activity.RESULT_OK) {<NEW_LINE>// for (String k: data.getExtras().keySet())<NEW_LINE>// {<NEW_LINE>// logDebug(data.getExtras().get(k).toString());<NEW_LINE>// }<NEW_LINE>String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);<NEW_LINE>if (accountName != null) {<NEW_LINE>logDebug("Account name=" + accountName);<NEW_LINE>initializeAccountOrPath(setupAct, accountName);<NEW_LINE>} else {<NEW_LINE>logDebug("Account name is null");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logDebug("Error authenticating");<NEW_LINE>// Intent retData = new Intent();<NEW_LINE>// retData.putExtra(EXTRA_ERROR_MESSAGE, t.getMessage());<NEW_LINE>((Activity) setupAct).setResult(Activity.RESULT_CANCELED, data);<NEW_LINE>((Activity) setupAct).finish();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setResult(Activity.RESULT_CANCELED, data);
1,094,869
// emulate code that read invalid memory<NEW_LINE>static void test_i386_invalid_mem_read() {<NEW_LINE>// ECX register<NEW_LINE>Long r_ecx = 0x1234L;<NEW_LINE>// EDX register<NEW_LINE>Long r_edx = 0x7890L;<NEW_LINE>System.out.print("===================================\n");<NEW_LINE>System.out.print("Emulate i386 code that read from invalid memory\n");<NEW_LINE>// Initialize emulator in X86-32bit mode<NEW_LINE>Unicorn u = new Unicorn(Unicorn.UC_ARCH_X86, Unicorn.UC_MODE_32);<NEW_LINE>// map 2MB memory for this emulation<NEW_LINE>u.mem_map(ADDRESS, 2 * 1024 * 1024, Unicorn.UC_PROT_ALL);<NEW_LINE>// write machine code to be emulated to memory<NEW_LINE>u.mem_write(ADDRESS, X86_CODE32_MEM_READ);<NEW_LINE>// initialize machine registers<NEW_LINE>u.reg_write(Unicorn.UC_X86_REG_ECX, r_ecx);<NEW_LINE>u.reg_write(Unicorn.UC_X86_REG_EDX, r_edx);<NEW_LINE>// tracing all basic blocks with customized callback<NEW_LINE>u.hook_add(new MyBlockHook(), 1, 0, null);<NEW_LINE>// tracing all instruction by having @begin > @end<NEW_LINE>u.hook_add(new MyCodeHook(), 1, 0, null);<NEW_LINE>// emulate machine code in infinite time<NEW_LINE>try {<NEW_LINE>u.emu_start(ADDRESS, ADDRESS + <MASK><NEW_LINE>} catch (UnicornException uex) {<NEW_LINE>int err = u.errno();<NEW_LINE>System.out.printf("Failed on u.emu_start() with error returned: %s\n", uex.getMessage());<NEW_LINE>}<NEW_LINE>// now print out some registers<NEW_LINE>System.out.print(">>> Emulation done. Below is the CPU context\n");<NEW_LINE>r_ecx = (Long) u.reg_read(Unicorn.UC_X86_REG_ECX);<NEW_LINE>r_edx = (Long) u.reg_read(Unicorn.UC_X86_REG_EDX);<NEW_LINE>System.out.printf(">>> ECX = 0x%x\n", r_ecx.intValue());<NEW_LINE>System.out.printf(">>> EDX = 0x%x\n", r_edx.intValue());<NEW_LINE>u.close();<NEW_LINE>}
X86_CODE32_MEM_READ.length, 0, 0);
1,628,818
public void marshall(Filter filter, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (filter == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(filter.getAction(), ACTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(filter.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(filter.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(filter.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(filter.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(filter.getOwnerId(), OWNERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(filter.getReason(), REASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(filter.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(filter.getUpdatedAt(), UPDATEDAT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
filter.getCriteria(), CRITERIA_BINDING);
1,812,158
private static long handleWeeklyRepeatAfterComplete(RRule rrule, Date original, boolean hasDueTime) {<NEW_LINE>List<WeekdayNum> byDay = rrule.getByDay();<NEW_LINE>long newDate = original.getTime();<NEW_LINE>newDate += DateUtilities.ONE_WEEK * (rrule.getInterval() - 1);<NEW_LINE>Calendar date = Calendar.getInstance();<NEW_LINE>date.setTimeInMillis(newDate);<NEW_LINE>Collections.sort(byDay, weekdayCompare);<NEW_LINE>WeekdayNum next = findNextWeekday(byDay, date);<NEW_LINE>do {<NEW_LINE>date.add(Calendar.DATE, 1);<NEW_LINE>} while (date.get(Calendar.DAY_OF_WEEK<MASK><NEW_LINE>long time = date.getTimeInMillis();<NEW_LINE>if (hasDueTime)<NEW_LINE>return Task.createDueDate(Task.URGENCY_SPECIFIC_DAY_TIME, time);<NEW_LINE>else<NEW_LINE>return Task.createDueDate(Task.URGENCY_SPECIFIC_DAY, time);<NEW_LINE>}
) != next.wday.javaDayNum);
624,790
private JPanel createTechnologyExtractorTasksPanel() {<NEW_LINE>JPanel jsonPathActionPanel = new JPanel();<NEW_LINE>jsonPathActionPanel.setLayout(new BoxLayout<MASK><NEW_LINE>Border margin = new EmptyBorder(5, 5, 0, 5);<NEW_LINE>jsonPathActionPanel.setBorder(margin);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>expressionField = new JLabeledTextField(getExpressionLabel());<NEW_LINE>jsonPathActionPanel.add(expressionField, BorderLayout.WEST);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JButton testerButton = new JButton(getTestButtonLabel());<NEW_LINE>testerButton.setActionCommand(TESTER_COMMAND);<NEW_LINE>testerButton.addActionListener(this);<NEW_LINE>jsonPathActionPanel.add(testerButton, BorderLayout.EAST);<NEW_LINE>resultField = new JTextArea();<NEW_LINE>resultField.setEditable(false);<NEW_LINE>resultField.setLineWrap(true);<NEW_LINE>resultField.setWrapStyleWord(true);<NEW_LINE>resultField.setMinimumSize(new Dimension(100, 150));<NEW_LINE>JPanel jsonPathTasksPanel = new JPanel(new BorderLayout(0, 5));<NEW_LINE>jsonPathTasksPanel.add(jsonPathActionPanel, BorderLayout.NORTH);<NEW_LINE>jsonPathTasksPanel.add(GuiUtils.makeScrollPane(resultField), BorderLayout.CENTER);<NEW_LINE>return jsonPathTasksPanel;<NEW_LINE>}
(jsonPathActionPanel, BoxLayout.X_AXIS));
297,821
public void addMetadata(QuickTimeDirectory directory) {<NEW_LINE>// Get creation/modification times<NEW_LINE>directory.setDate(TAG_CREATION_TIME, DateUtil.get1Jan1904EpochDate(creationTime));<NEW_LINE>directory.setDate(TAG_MODIFICATION_TIME, DateUtil.get1Jan1904EpochDate(modificationTime));<NEW_LINE>// Get duration and time scale<NEW_LINE>directory.setLong(TAG_DURATION, duration);<NEW_LINE>directory.setLong(TAG_TIME_SCALE, timescale);<NEW_LINE>directory.setRational(TAG_DURATION_SECONDS, new Rational(duration, timescale));<NEW_LINE>// Calculate preferred rate fixed point<NEW_LINE>double preferredRateInteger = (preferredRate & 0xFFFF0000) >> 16;<NEW_LINE>double preferredRateFraction = (preferredRate & 0x0000FFFF) / 16.0d;<NEW_LINE>directory.<MASK><NEW_LINE>// Calculate preferred volume fixed point<NEW_LINE>double preferredVolumeInteger = (preferredVolume & 0xFF00) >> 8;<NEW_LINE>double preferredVolumeFraction = (preferredVolume & 0x00FF) / 8.0d;<NEW_LINE>directory.setDouble(TAG_PREFERRED_VOLUME, preferredVolumeInteger + preferredVolumeFraction);<NEW_LINE>directory.setLong(TAG_PREVIEW_TIME, previewTime);<NEW_LINE>directory.setLong(TAG_PREVIEW_DURATION, previewDuration);<NEW_LINE>directory.setLong(TAG_POSTER_TIME, posterTime);<NEW_LINE>directory.setLong(TAG_SELECTION_TIME, selectionTime);<NEW_LINE>directory.setLong(TAG_SELECTION_DURATION, selectionDuration);<NEW_LINE>directory.setLong(TAG_CURRENT_TIME, currentTime);<NEW_LINE>directory.setLong(TAG_NEXT_TRACK_ID, nextTrackID);<NEW_LINE>}
setDouble(TAG_PREFERRED_RATE, preferredRateInteger + preferredRateFraction);
1,489,871
public AccountCreationResponse completeActivation(String code) {<NEW_LINE>ExpiringCode expiringCode = codeStore.retrieveCode(code, identityZoneManager.getCurrentIdentityZoneId());<NEW_LINE>if ((null == expiringCode) || ((null != expiringCode.getIntent()) && !REGISTRATION.name().equals(expiringCode.getIntent()))) {<NEW_LINE>throw new HttpClientErrorException(BAD_REQUEST);<NEW_LINE>}<NEW_LINE>Map<String, String> data = JsonUtils.readValue(expiringCode.getData(), new TypeReference<Map<String, String>>() {<NEW_LINE>});<NEW_LINE>ScimUser user = scimUserProvisioning.retrieve(data.get("user_id"), identityZoneManager.getCurrentIdentityZoneId());<NEW_LINE>user = scimUserProvisioning.verifyUser(user.getId(), user.getVersion(<MASK><NEW_LINE>String clientId = data.get("client_id");<NEW_LINE>String redirectUri = data.get("redirect_uri") != null ? data.get("redirect_uri") : "";<NEW_LINE>String redirectLocation = getRedirect(clientId, redirectUri);<NEW_LINE>return new AccountCreationResponse(user.getId(), user.getUserName(), user.getUserName(), redirectLocation);<NEW_LINE>}
), identityZoneManager.getCurrentIdentityZoneId());
668,235
/* Determines offset of node's label from left edge of the table.<NEW_LINE>*/<NEW_LINE>private void determineOffset(Object value, boolean isSelected, int row) {<NEW_LINE>JTree t = getTree();<NEW_LINE>boolean rv = t.isRootVisible();<NEW_LINE>int offsetRow = row;<NEW_LINE>if (!rv && (row > 0)) {<NEW_LINE>offsetRow--;<NEW_LINE>}<NEW_LINE>Rectangle bounds = t.getRowBounds(offsetRow);<NEW_LINE>offset = bounds.x;<NEW_LINE>TreeCellRenderer tcr = t.getCellRenderer();<NEW_LINE>Object node = t.getPathForRow(offsetRow).getLastPathComponent();<NEW_LINE>Component comp = tcr.getTreeCellRendererComponent(t, node, isSelected, t.isExpanded(offsetRow), t.getModel().isLeaf<MASK><NEW_LINE>if (comp instanceof JLabel) {<NEW_LINE>Icon icon = ((JLabel) comp).getIcon();<NEW_LINE>if (icon != null) {<NEW_LINE>offset += (((JLabel) comp).getIconTextGap() + icon.getIconWidth());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>offset -= positionX;<NEW_LINE>}
(node), offsetRow, false);
1,706,346
public void alterTableAddColumn(DdlWrite writer, String tableName, Column column, boolean onHistoryTable, String defaultValue) {<NEW_LINE>String convertedType = <MASK><NEW_LINE>DdlBuffer buffer = alterTable(writer, tableName).append(addColumn, column.getName());<NEW_LINE>buffer.append(convertedType);<NEW_LINE>// Add default value also to history table if it is not excluded<NEW_LINE>if (defaultValue != null) {<NEW_LINE>buffer.append(" default ");<NEW_LINE>buffer.append(defaultValue);<NEW_LINE>}<NEW_LINE>if (isTrue(column.isNotnull())) {<NEW_LINE>buffer.appendWithSpace(columnNotNull);<NEW_LINE>}<NEW_LINE>// DB2 History table must match exact!<NEW_LINE>if (!onHistoryTable) {<NEW_LINE>// check constraints cannot be added in one statement for h2<NEW_LINE>if (!StringHelper.isNull(column.getCheckConstraint())) {<NEW_LINE>String ddl = alterTableAddCheckConstraint(tableName, column.getCheckConstraintName(), column.getCheckConstraint());<NEW_LINE>writer.applyPostAlter().appendStatement(ddl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
convert(column.getType());
958,599
public String reportAllMicrophones() {<NEW_LINE>StringBuffer report = new StringBuffer();<NEW_LINE>report.append("\n############################");<NEW_LINE>report.append("\nMicrophone Report:\n");<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {<NEW_LINE>try {<NEW_LINE>List<MicrophoneInfo<MASK><NEW_LINE>for (MicrophoneInfo micInfo : micList) {<NEW_LINE>String micItem = MicrophoneInfoConverter.reportMicrophoneInfo(micInfo);<NEW_LINE>report.append(micItem);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return e.getMessage();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>report.append("\nMicrophoneInfo not available on V" + android.os.Build.VERSION.SDK_INT);<NEW_LINE>}<NEW_LINE>return report.toString();<NEW_LINE>}
> micList = mAudioManager.getMicrophones();
304,240
public // properties are read-only<NEW_LINE>void testJMSProducerSendMessage_NotWriteable_B_SecOff(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE>JMSContext jmsContextQCFBindings = qcfBindings.createContext();<NEW_LINE>emptyQueue(qcfBindings, queue1);<NEW_LINE>StreamMessage msgOut = jmsContextQCFBindings.createStreamMessage();<NEW_LINE>msgOut.reset();<NEW_LINE>JMSProducer producer = jmsContextQCFBindings.createProducer();<NEW_LINE>JMSConsumer jmsConsumer = jmsContextQCFBindings.createConsumer(queue1);<NEW_LINE>producer.send(queue1, msgOut);<NEW_LINE>StreamMessage msgIn = (<MASK><NEW_LINE>producer.setProperty("Role", "Tester");<NEW_LINE>boolean testFailed = false;<NEW_LINE>try {<NEW_LINE>producer.send(queue1, msgIn);<NEW_LINE>testFailed = true;<NEW_LINE>} catch (MessageNotWriteableRuntimeException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContextQCFBindings.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testJMSProducerSendMessage_NotWriteable_B_SecOff failed");<NEW_LINE>}<NEW_LINE>}
StreamMessage) jmsConsumer.receive(30000);
287,971
static String buildMessage(BeanResolutionContext resolutionContext, String message, boolean circular) {<NEW_LINE>BeanResolutionContext.Segment<?> currentSegment = resolutionContext.getPath().peek();<NEW_LINE>if (currentSegment instanceof AbstractBeanResolutionContext.ConstructorSegment) {<NEW_LINE>return buildMessage(resolutionContext, currentSegment.getArgument(), message, circular);<NEW_LINE>}<NEW_LINE>if (currentSegment instanceof AbstractBeanResolutionContext.MethodSegment) {<NEW_LINE>return buildMessageForMethod(resolutionContext, currentSegment.getDeclaringType(), currentSegment.getName(), currentSegment.<MASK><NEW_LINE>}<NEW_LINE>if (currentSegment instanceof AbstractBeanResolutionContext.FieldSegment) {<NEW_LINE>return buildMessageForField(resolutionContext, currentSegment.getDeclaringType(), currentSegment.getName(), message, circular);<NEW_LINE>}<NEW_LINE>if (currentSegment instanceof AbstractBeanResolutionContext.AnnotationSegment) {<NEW_LINE>return buildMessage(resolutionContext, currentSegment.getArgument(), message, circular);<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("Unknown segment: " + currentSegment);<NEW_LINE>}
getArgument(), message, circular);
858,467
public static void printMap(int loglevel, Map m) {<NEW_LINE>if (debug) {<NEW_LINE>String timestr = "";<NEW_LINE>String[] data = getTraceElements();<NEW_LINE>if (debugging(data[0], loglevel)) {<NEW_LINE>if (timing) {<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>timestr = "{" + (now - last) + "} ";<NEW_LINE>last = now;<NEW_LINE>}<NEW_LINE>Iterator i = m.keySet().iterator();<NEW_LINE>String[] lines = new String[m.size()];<NEW_LINE>int j = 0;<NEW_LINE>while (i.hasNext()) {<NEW_LINE>Object key = i.next();<NEW_LINE>lines[j++] = "\t\t- " + key + " => " + m.get(key);<NEW_LINE>}<NEW_LINE>_print(m.getClass(), loglevel, data[0] + "." + data[1] + "()" + data[2<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
], timestr, "Map:", lines);
21,327
public void marshall(HlsEncryptionSettings hlsEncryptionSettings, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (hlsEncryptionSettings == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(hlsEncryptionSettings.getConstantInitializationVector(), CONSTANTINITIALIZATIONVECTOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(hlsEncryptionSettings.getInitializationVectorInManifest(), INITIALIZATIONVECTORINMANIFEST_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsEncryptionSettings.getOfflineEncrypted(), OFFLINEENCRYPTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsEncryptionSettings.getSpekeKeyProvider(), SPEKEKEYPROVIDER_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsEncryptionSettings.getStaticKeyProvider(), STATICKEYPROVIDER_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsEncryptionSettings.getType(), TYPE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
hlsEncryptionSettings.getEncryptionMethod(), ENCRYPTIONMETHOD_BINDING);
623,267
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String factoryName, String datasetName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (factoryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (datasetName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter datasetName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, factoryName, datasetName, this.client.getApiVersion(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
674,889
public GetDetectorModelAnalysisResultsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetDetectorModelAnalysisResultsResult getDetectorModelAnalysisResultsResult = new GetDetectorModelAnalysisResultsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getDetectorModelAnalysisResultsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("analysisResults", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDetectorModelAnalysisResultsResult.setAnalysisResults(new ListUnmarshaller<AnalysisResult>(AnalysisResultJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDetectorModelAnalysisResultsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getDetectorModelAnalysisResultsResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,317,933
/*<NEW_LINE>* A javascript redirect is preferred over a 302 because it will preserve web fragements in the URL,<NEW_LINE>* i.e. foo.com/something#fragment.<NEW_LINE>*/<NEW_LINE>private void doClientSideRedirect(HttpServletResponse response, String loginURL, String state, String domain) throws IOException {<NEW_LINE>response.setStatus(HttpServletResponse.SC_OK);<NEW_LINE>PrintWriter pw = response.getWriter();<NEW_LINE>pw.println("<html xmlns=\"http://www.w3.org/1999/xhtml\">");<NEW_LINE>pw.println("<head>");<NEW_LINE>pw.println(createJavaScriptForRedirect(loginURL, state, domain));<NEW_LINE>pw.println("<title>Redirect To OP</title> ");<NEW_LINE>pw.println("</head>");<NEW_LINE>pw.println("<body></body>");<NEW_LINE>pw.println("</html>");<NEW_LINE>response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate, private, max-age=0");<NEW_LINE>// HTTP 1.0.<NEW_LINE>response.setHeader("Pragma", "no-cache");<NEW_LINE>// Proxies.<NEW_LINE><MASK><NEW_LINE>response.setContentType("text/html; charset=UTF-8");<NEW_LINE>pw.close();<NEW_LINE>}
response.setDateHeader("Expires", 0);
1,058,729
protected void prepare() {<NEW_LINE>for (ProcessInfoParameter para : getParameter()) {<NEW_LINE>String name = para.getParameterName();<NEW_LINE>if (para.getParameter() == null)<NEW_LINE>;<NEW_LINE>else if (name.equals(X_M_Product.COLUMNNAME_M_Product_ID)) {<NEW_LINE>p_M_Product_ID = para.getParameterAsInt();<NEW_LINE>} else if (name.equals(X_M_Warehouse.COLUMNNAME_M_Warehouse_ID)) {<NEW_LINE>p_M_Warehouse_ID = para.getParameterAsInt();<NEW_LINE>} else if (name.equals("DateTrx")) {<NEW_LINE>p_DateTrx = (Timestamp) para.getParameter();<NEW_LINE>} else if (name.equals(X_PP_Order_BOMLine.COLUMNNAME_QtyRequired)) {<NEW_LINE>p_QtyRequiered = <MASK><NEW_LINE>} else if (name.equals(X_PP_Product_BOMLine.COLUMNNAME_BackflushGroup)) {<NEW_LINE>p_BackflushGroup = (String) para.getParameter();<NEW_LINE>} else if (name.equals(X_T_BOMLine.COLUMNNAME_LevelNo)) {<NEW_LINE>p_LevelNo = para.getParameterAsInt();<NEW_LINE>} else<NEW_LINE>log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);<NEW_LINE>}<NEW_LINE>}
(BigDecimal) para.getParameter();
594,191
public static ExchangeMetaData adaptToExchangeMetaData(ExchangeMetaData exchangeMetaData, List<CryptowatchAssetPair> assetPairs, List<CryptowatchAsset> assets) {<NEW_LINE>Map<CurrencyPair, CurrencyPairMetaData> pairs = new HashMap<>();<NEW_LINE>Map<Currency, CurrencyMetaData> currencies = new HashMap<>();<NEW_LINE>if (exchangeMetaData != null) {<NEW_LINE>pairs.putAll(exchangeMetaData.getCurrencyPairs());<NEW_LINE>currencies.putAll(exchangeMetaData.getCurrencies());<NEW_LINE>}<NEW_LINE>pairs.putAll(// filter out the futures assets<NEW_LINE>assetPairs.stream().// filter out the futures assets<NEW_LINE>filter(pair -> !pair.getSymbol().endsWith("futures")).collect(Collectors.toMap(pair -> adaptToCurrencyPair(pair), pair -> adaptToCurrencyPairMetadata(pairs.get(adaptToCurrencyPair(pair))), (oldValue, newValue) -> newValue)));<NEW_LINE>currencies.putAll(assets.stream().collect(Collectors.toMap(asset -> adaptToCurrency(asset), asset -> adaptToCurrencyMetadata(currencies.get(adaptToCurrency(asset))), (oldValue<MASK><NEW_LINE>return new ExchangeMetaData(pairs, currencies, exchangeMetaData == null ? null : exchangeMetaData.getPublicRateLimits(), exchangeMetaData == null ? null : exchangeMetaData.getPrivateRateLimits(), exchangeMetaData == null ? null : exchangeMetaData.isShareRateLimits());<NEW_LINE>}
, newValue) -> newValue)));
34,842
public static Map<PartitionKey, LongIndicesView> split(long[] indices, List<PartitionKey> parts, boolean sorted) {<NEW_LINE>if (!sorted) {<NEW_LINE>Arrays.sort(indices);<NEW_LINE>}<NEW_LINE>Map<PartitionKey, LongIndicesView> <MASK><NEW_LINE>int featureIndex = 0;<NEW_LINE>int partIndex = 0;<NEW_LINE>// For each partition, we generate a update split.<NEW_LINE>// Although the split is empty for partitions those without any update data,<NEW_LINE>// we still need to generate a update split to update the clock info on ps.<NEW_LINE>while (featureIndex < indices.length || partIndex < parts.size()) {<NEW_LINE>int length = 0;<NEW_LINE>int endOffset = (int) parts.get(partIndex).getEndCol();<NEW_LINE>while (featureIndex < indices.length && indices[featureIndex] < endOffset) {<NEW_LINE>featureIndex++;<NEW_LINE>length++;<NEW_LINE>}<NEW_LINE>if (length > 0) {<NEW_LINE>LongIndicesView split = new LongIndicesView(indices, featureIndex - length, featureIndex);<NEW_LINE>ret.put(parts.get(partIndex), split);<NEW_LINE>}<NEW_LINE>partIndex++;<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
ret = new HashMap<>();
152,380
private static void renderBinary(GrayU8 binaryImage, boolean invert, DataBufferInt buffer) {<NEW_LINE>int rasterIndex = 0;<NEW_LINE>int[] data = buffer.getData();<NEW_LINE>int w = binaryImage.getWidth();<NEW_LINE>int h = binaryImage.getHeight();<NEW_LINE>if (invert) {<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>int indexSrc = binaryImage.startIndex + y * binaryImage.stride;<NEW_LINE>for (int x = 0; x < w; x++) {<NEW_LINE>data[rasterIndex++] = binaryImage.data[indexSrc<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>int indexSrc = binaryImage.startIndex + y * binaryImage.stride;<NEW_LINE>for (int x = 0; x < w; x++) {<NEW_LINE>data[rasterIndex++] = binaryImage.data[indexSrc++] != 0 ? 0xFFFFFFFF : 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
++] != 0 ? 0 : 0xFFFFFFFF;
934,993
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {<NEW_LINE>if (in.readableBytes() > 4) {<NEW_LINE>int packetStartIdx = in.readerIndex();<NEW_LINE>int payloadLength = in.readUnsignedMediumLE();<NEW_LINE>int sequenceId = in.readUnsignedByte();<NEW_LINE>if (payloadLength >= PACKET_PAYLOAD_LENGTH_LIMIT && aggregatedPacketPayload == null) {<NEW_LINE>aggregatedPacketPayload = ctx.alloc().compositeBuffer();<NEW_LINE>}<NEW_LINE>// payload<NEW_LINE>if (in.readableBytes() >= payloadLength) {<NEW_LINE>if (aggregatedPacketPayload != null) {<NEW_LINE>// read a split packet<NEW_LINE>aggregatedPacketPayload.addComponent(true, in.readRetainedSlice(payloadLength));<NEW_LINE>if (payloadLength < PACKET_PAYLOAD_LENGTH_LIMIT) {<NEW_LINE>// we have just read the last split packet and there will be no more split packet<NEW_LINE>try {<NEW_LINE>decodePacket(aggregatedPacketPayload, aggregatedPacketPayload.readableBytes(), sequenceId);<NEW_LINE>} finally {<NEW_LINE>ReferenceCountUtil.release(aggregatedPacketPayload);<NEW_LINE>aggregatedPacketPayload = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// read a non-split packet<NEW_LINE>decodePacket(in.readSlice<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>in.readerIndex(packetStartIdx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(payloadLength), payloadLength, sequenceId);
788,232
private // /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>void addBindings() {<NEW_LINE>amountTextField.textProperty().bindBidirectional(model.amount);<NEW_LINE>volumeTextField.textProperty(<MASK><NEW_LINE>totalToPayTextField.textProperty().bind(model.totalToPay);<NEW_LINE>addressTextField.amountAsCoinProperty().bind(model.dataModel.getMissingCoin());<NEW_LINE>amountTextField.validationResultProperty().bind(model.amountValidationResult);<NEW_LINE>priceCurrencyLabel.textProperty().bind(createStringBinding(() -> CurrencyUtil.getCounterCurrency(model.dataModel.getCurrencyCode())));<NEW_LINE>priceAsPercentageLabel.prefWidthProperty().bind(priceCurrencyLabel.widthProperty());<NEW_LINE>nextButton.disableProperty().bind(model.isNextButtonDisabled);<NEW_LINE>tradeFeeInBtcLabel.textProperty().bind(model.tradeFeeInBtcWithFiat);<NEW_LINE>tradeFeeInBsqLabel.textProperty().bind(model.tradeFeeInBsqWithFiat);<NEW_LINE>tradeFeeDescriptionLabel.textProperty().bind(model.tradeFeeDescription);<NEW_LINE>tradeFeeInBtcLabel.visibleProperty().bind(model.isTradeFeeVisible);<NEW_LINE>tradeFeeInBsqLabel.visibleProperty().bind(model.isTradeFeeVisible);<NEW_LINE>tradeFeeDescriptionLabel.visibleProperty().bind(model.isTradeFeeVisible);<NEW_LINE>tradeFeeDescriptionLabel.managedProperty().bind(tradeFeeDescriptionLabel.visibleProperty());<NEW_LINE>// funding<NEW_LINE>fundingHBox.visibleProperty().bind(model.dataModel.getIsBtcWalletFunded().not().and(model.showPayFundsScreenDisplayed));<NEW_LINE>fundingHBox.managedProperty().bind(model.dataModel.getIsBtcWalletFunded().not().and(model.showPayFundsScreenDisplayed));<NEW_LINE>waitingForFundsLabel.textProperty().bind(model.spinnerInfoText);<NEW_LINE>takeOfferBox.visibleProperty().bind(model.dataModel.getIsBtcWalletFunded().and(model.showPayFundsScreenDisplayed));<NEW_LINE>takeOfferBox.managedProperty().bind(model.dataModel.getIsBtcWalletFunded().and(model.showPayFundsScreenDisplayed));<NEW_LINE>takeOfferButton.disableProperty().bind(model.isTakeOfferButtonDisabled);<NEW_LINE>}
).bindBidirectional(model.volume);