content stringlengths 40 137k |
|---|
"private void processJSONArray(CorpusClass corpusClass, boolean seperateFiles) {\n JSONParser jParser;\n String corpusClassPath = corpusClass.getTacitLocation();\n String tempDir = \"String_Node_Str\";\n String tempFile = \"String_Node_Str\";\n Date dateobj = new Date();\n StringBuilder sb = new StringBuilder();\n if (!doPreprocessing)\n tempFile = tempPPFileLoc + corpusClass.getClassName() + System.currentTimeMillis() + \"String_Node_Str\";\n else {\n tempDir = ppFilesLoc + System.getProperty(\"String_Node_Str\") + \"String_Node_Str\" + dateobj.getTime();\n new File(tempDir).mkdir();\n }\n jParser = new JSONParser();\n dateobj = new Date();\n File[] fileList = new File(corpusClassPath).listFiles();\n for (int i = 0; i < fileList.length; i++) {\n try {\n String fileName = fileList[i].getAbsolutePath();\n if (!fileList[i].getAbsolutePath().endsWith(\"String_Node_Str\"))\n continue;\n JSONArray objects = (JSONArray) jParser.parse(new FileReader(fileName));\n int j = 0;\n boolean first = true;\n boolean lineCheck = true;\n File summary = new File(\"String_Node_Str\");\n BufferedWriter bWriter = new BufferedWriter(new FileWriter(summary));\n for (Object obj : objects) {\n JSONObject twitterStream = (JSONObject) obj;\n if (first) {\n for (Object keys : twitterStream.keySet()) {\n String key = (String) keys;\n if (lineCheck) {\n System.out.println(key);\n bWriter.write(key);\n lineCheck = false;\n } else {\n System.out.println(\"String_Node_Str\" + key);\n bWriter.write(\"String_Node_Str\" + key);\n }\n }\n lineCheck = true;\n System.out.println(\"String_Node_Str\");\n bWriter.write(\"String_Node_Str\");\n first = false;\n }\n File file;\n List<String> outputs = processQuery(corpusClass, twitterStream);\n if (!outputs.isEmpty() && outputs.get(0) != null && !outputs.get(0).equals(\"String_Node_Str\")) {\n for (Object keys : twitterStream.keySet()) {\n String key = (String) keys;\n Object val = twitterStream.get(key);\n if (lineCheck) {\n System.out.println(\"String_Node_Str\" + val.toString() + \"String_Node_Str\");\n bWriter.write(\"String_Node_Str\" + val.toString() + \"String_Node_Str\");\n lineCheck = false;\n } else {\n System.out.println(\"String_Node_Str\" + val.toString() + \"String_Node_Str\");\n bWriter.write(\"String_Node_Str\" + val.toString() + \"String_Node_Str\");\n }\n }\n lineCheck = true;\n System.out.println(\"String_Node_Str\");\n bWriter.write(\"String_Node_Str\");\n dateobj = new Date();\n if (doPreprocessing) {\n file = new File(tempFile);\n } else {\n file = new File(tempDir + System.getProperty(\"String_Node_Str\") + corpusClass.getClassName() + j + \"String_Node_Str\" + df.format(dateobj));\n }\n if (file.exists()) {\n file.delete();\n }\n if (seperateFiles) {\n FileWriter fw = new FileWriter(file.getAbsoluteFile());\n BufferedWriter bw = new BufferedWriter(fw);\n String tweet = outputs.get(0);\n bw.write(tweet);\n bw.close();\n if (doPreprocessing) {\n outputFiles.add(processFile(tempFile, corpusClass.getClassName() + \"String_Node_Str\" + j + \"String_Node_Str\" + df.format(dateobj)));\n } else {\n outputFiles.add(checkfiletype(file.getAbsolutePath()));\n }\n } else {\n sb.append(outputs.get(0));\n }\n }\n j++;\n }\n bWriter.flush();\n bWriter.close();\n outputFiles.add(summary.getAbsolutePath());\n if (!seperateFiles) {\n File file = new File(tempFile);\n if (file.exists()) {\n file.delete();\n }\n FileWriter fw = new FileWriter(file.getAbsoluteFile());\n BufferedWriter bw = new BufferedWriter(fw);\n bw.write(sb.toString());\n bw.close();\n if (doPreprocessing) {\n outputFiles.add(processFile(tempFile, corpusClass.getClassName() + \"String_Node_Str\" + j + \"String_Node_Str\" + df.format(dateobj)));\n } else {\n outputFiles.add(checkfiletype(file.getAbsolutePath()));\n }\n }\n } catch (JsonParseException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }\n if (new File(tempFile).exists()) {\n new File(tempFile).delete();\n }\n}\n"
|
"public void doAfterCompose(T comp) throws Exception {\n _binder.initAnnotatedBindings();\n new AbstractAnnotatedMethodInvoker<AfterCompose>(AfterCompose.class, _afterComposeMethodCache) {\n\n protected boolean shouldLookupSuperclass(AfterCompose annotation) {\n return annotation.superclass();\n }\n }.invokeMethod(_binder, getViewModelInitArgs(evalx, comp));\n BinderKeeper keeper = BinderKeeper.getInstance(comp);\n if (keeper.isRootBinder(_binder)) {\n keeper.loadComponentForAllBinders();\n }\n}\n"
|
"private void processRequest(HttpServletRequest req, HttpServletResponse resp) {\n StringBuffer auditTrailSb = new StringBuffer();\n auditTrailSb.append(\"String_Node_Str\" + req.getRemoteAddr());\n auditTrailSb.append(\"String_Node_Str\" + req.getMethod() + \"String_Node_Str\");\n String responseType = BaseCmd.RESPONSE_TYPE_XML;\n Map<String, Object[]> params = new HashMap<String, Object[]>();\n params.putAll(req.getParameterMap());\n try {\n HttpSession session = req.getSession(false);\n Object[] responseTypeParam = params.get(\"String_Node_Str\");\n if (responseTypeParam != null) {\n responseType = (String) responseTypeParam[0];\n }\n Object[] commandObj = params.get(\"String_Node_Str\");\n if (commandObj != null) {\n String command = (String) commandObj[0];\n if (\"String_Node_Str\".equalsIgnoreCase(command)) {\n if (session != null) {\n Long userId = (Long) session.getAttribute(\"String_Node_Str\");\n Account account = (Account) session.getAttribute(\"String_Node_Str\");\n Long accountId = null;\n if (account != null) {\n accountId = account.getId();\n }\n auditTrailSb.insert(0, \"String_Node_Str\" + userId + \"String_Node_Str\" + accountId + \"String_Node_Str\" + session.getId() + \"String_Node_Str\");\n if (userId != null) {\n _apiServer.logoutUser(userId);\n }\n try {\n session.invalidate();\n } catch (IllegalStateException ise) {\n }\n }\n auditTrailSb.append(\"String_Node_Str\");\n auditTrailSb.append(\"String_Node_Str\" + HttpServletResponse.SC_OK);\n writeResponse(resp, getLogoutSuccessResponse(responseType), HttpServletResponse.SC_OK, responseType);\n return;\n } else if (\"String_Node_Str\".equalsIgnoreCase(command)) {\n auditTrailSb.append(\"String_Node_Str\");\n if (session != null) {\n try {\n session.invalidate();\n } catch (IllegalStateException ise) {\n }\n }\n session = req.getSession(true);\n String[] username = (String[]) params.get(\"String_Node_Str\");\n String[] password = (String[]) params.get(\"String_Node_Str\");\n String[] domainIdArr = (String[]) params.get(\"String_Node_Str\");\n if (domainIdArr == null) {\n domainIdArr = (String[]) params.get(\"String_Node_Str\");\n }\n String[] domainName = (String[]) params.get(\"String_Node_Str\");\n Long domainId = null;\n if ((domainIdArr != null) && (domainIdArr.length > 0)) {\n try {\n domainId = new Long(Long.parseLong(domainIdArr[0]));\n auditTrailSb.append(\"String_Node_Str\" + domainId);\n } catch (NumberFormatException e) {\n s_logger.warn(\"String_Node_Str\");\n auditTrailSb.append(\"String_Node_Str\" + HttpServletResponse.SC_UNAUTHORIZED + \"String_Node_Str\" + \"String_Node_Str\");\n String serializedResponse = _apiServer.getSerializedApiError(HttpServletResponse.SC_UNAUTHORIZED, \"String_Node_Str\", params, responseType);\n writeResponse(resp, serializedResponse, HttpServletResponse.SC_UNAUTHORIZED, responseType);\n }\n }\n String domain = null;\n if (domainName != null) {\n domain = domainName[0];\n auditTrailSb.append(\"String_Node_Str\" + domain);\n if (domain != null) {\n if (!domain.endsWith(\"String_Node_Str\")) {\n domain += '/';\n }\n if (!domain.startsWith(\"String_Node_Str\")) {\n domain = \"String_Node_Str\" + domain;\n }\n }\n }\n if (username != null) {\n String pwd = ((password == null) ? null : password[0]);\n try {\n _apiServer.loginUser(session, username[0], pwd, domainId, domain, params);\n auditTrailSb.insert(0, \"String_Node_Str\" + session.getAttribute(\"String_Node_Str\") + \"String_Node_Str\" + ((Account) session.getAttribute(\"String_Node_Str\")).getId() + \"String_Node_Str\" + session.getId() + \"String_Node_Str\");\n String loginResponse = getLoginSuccessResponse(session, responseType);\n writeResponse(resp, loginResponse, HttpServletResponse.SC_OK, responseType);\n return;\n } catch (CloudAuthenticationException ex) {\n try {\n session.invalidate();\n } catch (IllegalStateException ise) {\n }\n auditTrailSb.append(\"String_Node_Str\" + BaseCmd.ACCOUNT_ERROR + \"String_Node_Str\" + ex.getMessage() != null ? ex.getMessage() : \"String_Node_Str\");\n String serializedResponse = _apiServer.getSerializedApiError(BaseCmd.ACCOUNT_ERROR, ex.getMessage() != null ? ex.getMessage() : \"String_Node_Str\", params, responseType);\n writeResponse(resp, serializedResponse, BaseCmd.ACCOUNT_ERROR, responseType);\n return;\n }\n }\n }\n }\n auditTrailSb.append(req.getQueryString());\n boolean isNew = ((session == null) ? true : session.isNew());\n UserContext.registerContext(_accountMgr.getSystemUser().getId(), _accountMgr.getSystemAccount(), null, false);\n Long userId = null;\n if (!isNew) {\n userId = (Long) session.getAttribute(\"String_Node_Str\");\n String account = (String) session.getAttribute(\"String_Node_Str\");\n Long domainId = (Long) session.getAttribute(\"String_Node_Str\");\n Object accountObj = session.getAttribute(\"String_Node_Str\");\n String sessionKey = (String) session.getAttribute(\"String_Node_Str\");\n String[] sessionKeyParam = (String[]) params.get(\"String_Node_Str\");\n if ((sessionKeyParam == null) || (sessionKey == null) || !sessionKey.equals(sessionKeyParam[0])) {\n try {\n session.invalidate();\n } catch (IllegalStateException ise) {\n }\n auditTrailSb.append(\"String_Node_Str\" + HttpServletResponse.SC_UNAUTHORIZED + \"String_Node_Str\" + \"String_Node_Str\");\n String serializedResponse = _apiServer.getSerializedApiError(HttpServletResponse.SC_UNAUTHORIZED, \"String_Node_Str\", params, responseType);\n writeResponse(resp, serializedResponse, HttpServletResponse.SC_UNAUTHORIZED, responseType);\n return;\n }\n if ((userId != null) && (account != null) && (accountObj != null) && _apiServer.verifyUser(userId)) {\n String[] command = (String[]) params.get(\"String_Node_Str\");\n if (command == null) {\n s_logger.info(\"String_Node_Str\");\n auditTrailSb.append(\"String_Node_Str\" + HttpServletResponse.SC_BAD_REQUEST + \"String_Node_Str\" + \"String_Node_Str\");\n String serializedResponse = _apiServer.getSerializedApiError(HttpServletResponse.SC_BAD_REQUEST, \"String_Node_Str\", params, responseType);\n writeResponse(resp, serializedResponse, HttpServletResponse.SC_BAD_REQUEST, responseType);\n return;\n }\n UserContext.updateContext(userId, (Account) accountObj, session.getId());\n } else {\n try {\n session.invalidate();\n } catch (IllegalStateException ise) {\n }\n auditTrailSb.append(\"String_Node_Str\" + HttpServletResponse.SC_UNAUTHORIZED + \"String_Node_Str\" + \"String_Node_Str\");\n String serializedResponse = _apiServer.getSerializedApiError(HttpServletResponse.SC_UNAUTHORIZED, \"String_Node_Str\", params, responseType);\n writeResponse(resp, serializedResponse, HttpServletResponse.SC_UNAUTHORIZED, responseType);\n return;\n }\n }\n if (_apiServer.verifyRequest(params, userId)) {\n auditTrailSb.insert(0, \"String_Node_Str\" + UserContext.current().getCallerUserId() + \"String_Node_Str\" + UserContext.current().getCaller().getId() + \"String_Node_Str\" + (session != null ? session.getId() : null) + \"String_Node_Str\");\n try {\n String response = _apiServer.handleRequest(params, false, responseType, auditTrailSb);\n writeResponse(resp, response != null ? response : \"String_Node_Str\", HttpServletResponse.SC_OK, responseType);\n } catch (ServerApiException se) {\n String serializedResponseText = _apiServer.getSerializedApiError(se.getErrorCode(), se.getDescription(), params, responseType);\n writeResponse(resp, serializedResponseText, se.getErrorCode(), responseType);\n auditTrailSb.append(\"String_Node_Str\" + se.getErrorCode() + \"String_Node_Str\" + se.getDescription());\n }\n } else {\n if (session != null) {\n try {\n session.invalidate();\n } catch (IllegalStateException ise) {\n }\n }\n auditTrailSb.append(\"String_Node_Str\" + HttpServletResponse.SC_UNAUTHORIZED + \"String_Node_Str\" + \"String_Node_Str\");\n String serializedResponse = _apiServer.getSerializedApiError(HttpServletResponse.SC_UNAUTHORIZED, \"String_Node_Str\", params, responseType);\n writeResponse(resp, serializedResponse, HttpServletResponse.SC_UNAUTHORIZED, responseType);\n }\n } catch (InvalidParameterException ipe) {\n auditTrailSb.append(\"String_Node_Str\" + HttpServletResponse.SC_NOT_FOUND + \"String_Node_Str\" + ipe.getMessage());\n String serializedResponse = _apiServer.getSerializedApiError(HttpServletResponse.SC_NOT_FOUND, ipe.getMessage(), params, responseType);\n writeResponse(resp, serializedResponse, HttpServletResponse.SC_NOT_FOUND, responseType);\n } catch (Exception ex) {\n s_logger.error(\"String_Node_Str\", ex);\n auditTrailSb.append(\"String_Node_Str\");\n } finally {\n s_accessLogger.info(auditTrailSb.toString());\n UserContext.unregisterContext();\n }\n}\n"
|
"public int vote(Authentication authentication, Object object, ConfigAttributeDefinition config) {\n if (log.isDebugEnabled()) {\n MethodInvocation mi = (MethodInvocation) object;\n log.debug(\"String_Node_Str\" + mi.getMethod().toString());\n }\n if (AuthenticationUtil.isRunAsUserTheSystemUser()) {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\");\n }\n return AccessDecisionVoter.ACCESS_GRANTED;\n }\n List<ConfigAttributeDefintion> supportedDefinitions = extractSupportedDefinitions(config);\n if (supportedDefinitions.size() == 0) {\n return AccessDecisionVoter.ACCESS_ABSTAIN;\n }\n MethodInvocation invocation = (MethodInvocation) object;\n Method method = invocation.getMethod();\n Class[] params = method.getParameterTypes();\n Boolean hasMethodEntry = null;\n for (ConfigAttributeDefintion cad : supportedDefinitions) {\n NodeRef testNodeRef = null;\n if (cad.typeString.equals(ACL_DENY)) {\n return AccessDecisionVoter.ACCESS_DENIED;\n } else if (cad.typeString.equals(ACL_ALLOW)) {\n return AccessDecisionVoter.ACCESS_GRANTED;\n } else if (cad.typeString.equals(ACL_METHOD)) {\n if (hasMethodEntry == null) {\n hasMethodEntry = Boolean.FALSE;\n }\n if (cad.authority.equals(AuthenticationUtil.getRunAsUser())) {\n hasMethodEntry = Boolean.TRUE;\n } else if (authorityService.getAuthorities().contains(cad.authority)) {\n hasMethodEntry = Boolean.TRUE;\n }\n } else if (cad.parameter >= invocation.getArguments().length) {\n continue;\n } else if (cad.typeString.equals(ACL_NODE)) {\n if (StoreRef.class.isAssignableFrom(params[cad.parameter])) {\n if (invocation.getArguments()[cad.parameter] != null) {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\");\n }\n StoreRef storeRef = (StoreRef) invocation.getArguments()[cad.parameter];\n if (nodeService.exists(storeRef)) {\n testNodeRef = nodeService.getRootNode(storeRef);\n }\n }\n } else if (NodeRef.class.isAssignableFrom(params[cad.parameter])) {\n testNodeRef = (NodeRef) invocation.getArguments()[cad.parameter];\n if (log.isDebugEnabled()) {\n if (nodeService.exists(testNodeRef)) {\n log.debug(\"String_Node_Str\" + nodeService.getPath(testNodeRef));\n } else {\n log.debug(\"String_Node_Str\" + testNodeRef);\n }\n }\n } else if (ChildAssociationRef.class.isAssignableFrom(params[cad.parameter])) {\n if (invocation.getArguments()[cad.parameter] != null) {\n testNodeRef = ((ChildAssociationRef) invocation.getArguments()[cad.parameter]).getChildRef();\n if (log.isDebugEnabled()) {\n if (nodeService.exists(testNodeRef)) {\n log.debug(\"String_Node_Str\" + nodeService.getPath(testNodeRef));\n } else {\n log.debug(\"String_Node_Str\" + testNodeRef);\n }\n }\n }\n } else {\n throw new ACLEntryVoterException(\"String_Node_Str\");\n }\n } else if (cad.typeString.equals(ACL_PARENT)) {\n if (NodeRef.class.isAssignableFrom(params[cad.parameter])) {\n NodeRef child = (NodeRef) invocation.getArguments()[cad.parameter];\n if (child != null) {\n testNodeRef = nodeService.getPrimaryParent(child).getParentRef();\n if (log.isDebugEnabled()) {\n if (nodeService.exists(testNodeRef)) {\n log.debug(\"String_Node_Str\" + nodeService.getPath(testNodeRef));\n } else {\n log.debug(\"String_Node_Str\" + testNodeRef);\n }\n log.debug(\"String_Node_Str\" + nodeService.getPath(testNodeRef));\n }\n }\n } else if (ChildAssociationRef.class.isAssignableFrom(params[cad.parameter])) {\n if (invocation.getArguments()[cad.parameter] != null) {\n testNodeRef = ((ChildAssociationRef) invocation.getArguments()[cad.parameter]).getParentRef();\n if (log.isDebugEnabled()) {\n if (nodeService.exists(testNodeRef)) {\n log.debug(\"String_Node_Str\" + nodeService.getPath(testNodeRef));\n } else {\n log.debug(\"String_Node_Str\" + testNodeRef);\n }\n }\n }\n } else {\n throw new ACLEntryVoterException(\"String_Node_Str\");\n }\n }\n if (testNodeRef != null) {\n if (abstainForClassQNames.size() > 0) {\n if (nodeService.exists(testNodeRef)) {\n QName typeQName = nodeService.getType(testNodeRef);\n if (abstainForClassQNames.contains(typeQName)) {\n return AccessDecisionVoter.ACCESS_ABSTAIN;\n }\n }\n }\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\");\n }\n if (permissionService.hasPermission(testNodeRef, cad.required.toString()) == AccessStatus.DENIED) {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\");\n Thread.dumpStack();\n }\n return AccessDecisionVoter.ACCESS_DENIED;\n }\n }\n }\n if ((hasMethodEntry == null) || (hasMethodEntry.booleanValue())) {\n return AccessDecisionVoter.ACCESS_GRANTED;\n } else {\n return AccessDecisionVoter.ACCESS_DENIED;\n }\n}\n"
|
"protected void moveSelectionUp() {\n if (isSuggestionListShowing()) {\n if (suggestionMenu.getSelectedItemIndex() == -1) {\n suggestionMenu.selectItem(suggestionMenu.getNumItems() - 1);\n } else {\n suggestionMenu.selectItem(suggestionMenu.getSelectedItemIndex() - 1);\n }\n }\n}\n"
|
"private void tryExpunge() {\n if (shallExpunge())\n doExpunge();\n}\n"
|
"protected void onPause() {\n SuperActivityToast.cancelAllSuperActivityToasts();\n new ScanProcess().cancelService(this);\n Logger.d(TAG, \"String_Node_Str\");\n super.onPause();\n}\n"
|
"public boolean replaceEvent(GameEvent event, Ability source, Game game) {\n if (event.getType().equals(GameEvent.EventType.PLAY_TURN)) {\n for (UUID playerId : game.getPlayerList()) {\n game.getState().setValue(UbaMask.UBA_MASK_VALUE_KEY + source.getSourceId() + playerId, null);\n }\n return false;\n }\n MageObject sourceObject = source.getSourceObject(game);\n Player player = game.getPlayer(event.getPlayerId());\n if (player != null && sourceObject != null) {\n Card card = player.getLibrary().getFromTop(game);\n if (card != null) {\n if (player.moveCardsToExile(card, source, game, true, source.getSourceId(), sourceObject.getIdName())) {\n UbaMaskExiledCardsWatcher watcher = (UbaMaskExiledCardsWatcher) game.getState().getWatchers().get(UbaMaskExiledCardsWatcher.class.getName());\n if (watcher != null) {\n watcher.addExiledCard(event.getPlayerId(), card, game);\n }\n }\n exiledCardsByPlayer.add(new MageObjectReference(card.getId(), game));\n }\n }\n return true;\n}\n"
|
"public WxMpPayResult getJSSDKPayResult(String transactionId, String outTradeNo) {\n String nonce_str = System.currentTimeMillis() + \"String_Node_Str\";\n SortedMap<String, String> packageParams = new TreeMap<String, String>();\n packageParams.put(\"String_Node_Str\", wxMpConfigStorage.getAppId());\n packageParams.put(\"String_Node_Str\", wxMpConfigStorage.getPartnerId());\n if (transactionId != null && !\"String_Node_Str\".equals(transactionId.trim()))\n packageParams.put(\"String_Node_Str\", transactionId);\n else if (outTradeNo != null && !\"String_Node_Str\".equals(outTradeNo.trim()))\n packageParams.put(\"String_Node_Str\", outTradeNo);\n else\n throw new IllegalArgumentException(\"String_Node_Str\");\n packageParams.put(\"String_Node_Str\", nonce_str);\n String sign = WxCryptUtil.createSign(packageParams, wxMpConfigStorage.getPartnerKey());\n String xml = \"String_Node_Str\" + \"String_Node_Str\" + wxMpConfigStorage.getAppId() + \"String_Node_Str\" + \"String_Node_Str\" + wxMpConfigStorage.getPartnerId() + \"String_Node_Str\" + \"String_Node_Str\" + transactionId + \"String_Node_Str\" + \"String_Node_Str\" + outTradeNo + \"String_Node_Str\" + \"String_Node_Str\" + nonce_str + \"String_Node_Str\" + \"String_Node_Str\" + sign + \"String_Node_Str\" + \"String_Node_Str\";\n HttpPost httpPost = new HttpPost(\"String_Node_Str\");\n if (httpProxy != null) {\n RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();\n httpPost.setConfig(config);\n }\n StringEntity entity = new StringEntity(xml, Consts.UTF_8);\n httpPost.setEntity(entity);\n try {\n CloseableHttpResponse response = httpClient.execute(httpPost);\n String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response);\n XStream xstream = XStreamInitializer.getInstance();\n xstream.alias(\"String_Node_Str\", WxMpPayResult.class);\n WxMpPayResult wxMpPayResult = (WxMpPayResult) xstream.fromXML(responseContent);\n return wxMpPayResult;\n } catch (IOException e) {\n e.printStackTrace();\n }\n return new WxMpPayResult();\n}\n"
|
"public void onCreate() {\n String processName = ActivityThread.currentProcessName();\n Slog.i(\"String_Node_Str\", \"String_Node_Str\" + processName);\n if (!getApplicationInfo().packageName.equals(processName)) {\n return;\n }\n final WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);\n final Display display = wm.getDefaultDisplay();\n if (\"String_Node_Str\".equals(android.os.Build.TYPE)) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"String_Node_Str\");\n builder.setMessage(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n builder.setCancelable(false);\n builder.setPositiveButton(\"String_Node_Str\", null);\n Dialog dialog = builder.create();\n dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);\n dialog.show();\n }\n FakeView view = new FakeView(this);\n WindowManager.LayoutParams lp = new WindowManager.LayoutParams(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);\n if (ActivityManager.isHighEndGfx()) {\n lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;\n }\n lp.width = ViewGroup.LayoutParams.MATCH_PARENT;\n lp.height = ViewGroup.LayoutParams.MATCH_PARENT;\n int maxSize = display.getMaximumSizeDimension();\n maxSize *= 2;\n lp.x = maxSize;\n lp.y = maxSize;\n lp.setTitle(getPackageName());\n wm.addView(view, lp);\n bindService(new Intent(this, FakeCoreService.class), mServiceConnection, Context.BIND_AUTO_CREATE);\n bindService(new Intent(this, FakeCoreService2.class), mServiceConnection2, Context.BIND_AUTO_CREATE);\n bindService(new Intent(this, FakeCoreService3.class), mServiceConnection3, Context.BIND_AUTO_CREATE);\n mHandler.sendEmptyMessage(MSG_TICK);\n mStuffing = new int[STUFFING_SIZE_INTS];\n for (int i = 0; i < STUFFING_SIZE_BYTES / PAGE_SIZE; i++) {\n final int VAL = i * 2 + 100;\n final int OFF = (i * PAGE_SIZE) / 4;\n for (int j = 0; j < (PAGE_SIZE / 4); j++) {\n mStuffing[OFF + j] = VAL;\n }\n }\n}\n"
|
"public String getForInLoopVar() {\n return null;\n}\n"
|
"public Entry<K, V> next() {\n if (current == null)\n throw new NoSuchElementException();\n String[] properties = mObject.propertyNames();\n Entry<K, V> entry = null;\n int i = 0;\n for (; i < properties.length; i++) {\n if (current.equals(properties[i])) {\n final Object key = properties[i];\n entry = new Entry<String, V>() {\n\n public K getKey() {\n return (K) key;\n }\n public V getValue() {\n return get(key);\n }\n public V setValue(V object) {\n return put((K) key, object);\n }\n };\n break;\n }\n }\n if (i + 1 < properties.length)\n current = properties[i + 1];\n else\n current = null;\n if (entry != null)\n return entry;\n else\n throw new NoSuchElementException();\n}\n"
|
"public void Schedule() {\n AlarmManager alarmManager = GetAlarmManager(context);\n long recurInterval = LOWEST_RECUR_INTERVAL * 60 * 60 * 1000;\n alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, 0, recurInterval, GetPendingIntent(context, UPDATESOURCE.ALARM));\n}\n"
|
"private ImageRect addImage(TreeLogger logger, String imageName) throws UnableToCompleteException {\n logger = logger.branch(TreeLogger.TRACE, \"String_Node_Str\" + imageName + \"String_Node_Str\", null);\n BufferedImage image = null;\n try {\n URL imageUrl = getClass().getClassLoader().getResource(imageName);\n if (imageUrl == null) {\n logger.log(TreeLogger.ERROR, \"String_Node_Str\", null);\n throw new UnableToCompleteException();\n }\n byte[] imgBytes = Util.readURLAsBytes(imageUrl);\n md5.update(imgBytes);\n image = ImageIO.read(new ByteArrayInputStream(imgBytes));\n if (image == null) {\n logger.log(TreeLogger.ERROR, \"String_Node_Str\", null);\n throw new UnableToCompleteException();\n }\n } catch (IOException e) {\n logger.log(TreeLogger.ERROR, \"String_Node_Str\", null);\n throw new UnableToCompleteException();\n }\n ImageRect imageRect = new ImageRect(image);\n orderedImageRects.add(imageRect);\n return imageRect;\n}\n"
|
"public void evaluateHand() {\n byte[] tallyValues = new byte[14];\n byte[] tallySuits = new byte[4];\n byte fours = 0;\n byte threes = 0;\n byte pair1 = 0;\n byte pair2 = 0;\n for (int i = 0; i < 5; i++) {\n tallyValues[cards[i].getRank()]++;\n tallySuits[cards[i].getSuit()]++;\n }\n for (byte i = 12; i >= 0; i--) {\n if (tallyValues[i] == 4) {\n fours = i;\n } else if (tallyValues[i] == 3) {\n threes = i;\n } else if (tallyValues[i] == 2) {\n if (pair1 == 0)\n pair1 = i;\n else\n pair2 = i;\n }\n }\n List<Byte> sortedCardValues = new ArrayList<Byte>();\n for (byte i = 0; i < 5; i++) {\n sortedCardValues.add(cards[i].getRank());\n }\n Collections.sort(sortedCardValues);\n float tempRank = 0;\n if (sortedCardValues.get(0) + 4 == sortedCardValues.get(4)) {\n pattern = \"String_Node_Str\";\n tempRank = 56 + sortedCardValues.get(4);\n for (byte x = 0; x < 4; x++) {\n if (tallySuits[x] == 5) {\n tempRank += 56;\n pattern += \"String_Node_Str\";\n }\n }\n }\n if (fours > 0) {\n tempRank = 98 + fours;\n pattern = \"String_Node_Str\";\n } else if (threes > 0) {\n if (pair1 > 0) {\n tempRank = 84 + threes;\n pattern = \"String_Node_Str\";\n } else {\n tempRank = 42 + threes;\n pattern = \"String_Node_Str\";\n }\n } else if (pair1 > 0) {\n if (pair2 > 0) {\n tempRank = 28 + pair1 + (float) pair2 / 100 + (float) sortedCardValues.get(4) / 10000;\n pattern = \"String_Node_Str\";\n } else {\n tempRank = 14 + pair1 + (float) sortedCardValues.get(4) / 100 + (float) sortedCardValues.get(3) / 10000 + (float) sortedCardValues.get(2) / 1000000;\n pattern = \"String_Node_Str\";\n }\n }\n if (tempRank == 0) {\n for (byte i = 0; i < 4; i++) {\n if (tallySuits[i] == 5) {\n tempRank = 70 + sortedCardValues.get(4) + (float) sortedCardValues.get(3) / 100 + (float) sortedCardValues.get(2) / 10000 + (float) sortedCardValues.get(1) / 1000000 + (float) sortedCardValues.get(0) / 100000000;\n pattern = \"String_Node_Str\";\n }\n }\n }\n if (tempRank == 0) {\n tempRank = sortedCardValues.get(4) + (float) sortedCardValues.get(3) / 100 + (float) sortedCardValues.get(2) / 10000 + (float) sortedCardValues.get(1) / 1000000 + (float) sortedCardValues.get(0) / 100000000;\n pattern = \"String_Node_Str\";\n }\n handValue = tempRank;\n}\n"
|
"public static IDBResource valueOf(DBInfo dbInfo, String tableName) throws SQLException {\n IResourceId resId = new DBResourceId(dbInfo.getClusterName(), dbInfo.getDbName(), tableName, dbInfo.getMasterSlave());\n GlobalDBResource dbResource = null;\n if (tx != null && tx.isContain(resId)) {\n dbResource = (GlobalDBResource) tx.getDBResource(resId);\n } else {\n dbResource = (GlobalDBResource) DBResourceCache.getGlobalDBResource(resId);\n Connection conn = dbInfo.getDatasource().getConnection();\n conn.setAutoCommit(false);\n if (dbResource == null) {\n dbResource = new GlobalDBResource();\n dbResource.setId(resId);\n dbResource.setClusterName(dbInfo.getClusterName());\n dbResource.setDbName(dbInfo.getDbName());\n dbResource.setMasterSlave(dbInfo.getMasterSlave());\n DatabaseMetaData dbMeta = conn.getMetaData();\n String databaseProductName = dbMeta.getDatabaseProductName();\n String url = dbMeta.getURL().substring(13);\n String host = url.substring(0, url.indexOf(\"String_Node_Str\"));\n String catalog = conn.getCatalog();\n dbResource.setDatabaseProductName(databaseProductName);\n dbResource.setHost(host);\n dbResource.setCatalog(catalog);\n DBResourceCache.putGlobalDBResource(resId, dbResource);\n }\n dbResource.setConnection(conn);\n }\n instance.setConnection(conn);\n return instance;\n}\n"
|
"private void addConditionalExprBindings(TotalExprBinding result, IConditionalExpression key, List bindings, String groupName) throws EngineException {\n try {\n IConditionalExpression ce = key;\n if (!hasAggregationInFilter(key)) {\n result.addNewExpression(ce);\n return;\n }\n if (groupName != null)\n ce.setGroupName(groupName);\n String bindingName = TOTAL_PREFIX + totalColumnSuffix;\n totalColumnSuffix++;\n Binding columnBinding = new Binding(bindingName, ce);\n if (groupName != null) {\n columnBinding.addAggregateOn(groupName);\n }\n List allColumnBindings = new ArrayList();\n allColumnBindings.add(columnBinding);\n result.addColumnBindings(allColumnBindings);\n result.addNewExpression(org.eclipse.birt.core.data.ExpressionUtil.createJSRowExpression(bindingName));\n } catch (DataException e) {\n throw new EngineException(e.getLocalizedMessage());\n }\n}\n"
|
"public void draw(Graphics2D g2d, int x, int y, int width) {\n int currenty = y;\n for (int i = start; i < lines; i++) {\n m_aCommands.get(i).draw(g2d, x, currenty, width);\n currenty += m_aCommands.get(i).getHeight();\n }\n}\n"
|
"private static String getRelativePath(File file, File relativeToPath) {\n return StringUtils.replaceOnce(file.getAbsolutePath(), relativeToPath.getAbsolutePath() + File.separator, \"String_Node_Str\");\n}\n"
|
"protected void loadSinks() {\n list.addSink(Info.init());\n list.addSink(Widgets.init(images));\n list.addSink(Panels.init(images));\n list.addSink(Lists.init(images));\n list.addSink(Text.init());\n list.addSink(Popups.init());\n}\n"
|
"protected void addSuccessorParamsAndActionInterfaces() {\n int i = 1;\n for (IOAction a : this.curr.getTakeable().stream().sorted(IOACTION_COMPARATOR).collect(Collectors.toList())) {\n this.ib.addParameters(\"String_Node_Str\" + i + \"String_Node_Str\" + SuccessorInterfaceGenerator.getSuccessorInterfaceName(a));\n this.ib.addInterfaces(this.caseActions.get(a).getName() + \"String_Node_Str\" + i + \"String_Node_Str\");\n i++;\n }\n}\n"
|
"public void removeInputDataSources(DataSourceFilter dataSourceFilter) {\n synchronized (inputDataSources) {\n Iterator<InputDataSourceDesc> inputDataSourceIter = inputDataSources.iterator();\n boolean removed = false;\n while (inputDataSourceIter.hasNext()) {\n if (dataSourceFilter.accept(inputDataSourceIter.next().inputDataSource)) {\n inputDataSourceIter.remove();\n removed = true;\n }\n }\n if (removed && (outputStream != null))\n getOutputStream();\n }\n}\n"
|
"public Object extract(MultivaluedMap<String, String> parameters) {\n String v = parameters.getFirst(parameter);\n if (v != null && !v.trim().isEmpty()) {\n return getValue(v);\n } else if (defaultValue != null) {\n return defaultValue;\n }\n return defaultDefaultValue;\n}\n"
|
"public synchronized JobInfos getCompletedJobs() {\n try {\n if (jaxbContext == null)\n jaxbContext = JAXBContext.newInstance(JobInfos.class);\n Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();\n if (jobsFile != null && jobsFile.exists()) {\n JobInfos jobInfos = (JobInfos) unmarshaller.unmarshal(jobsFile);\n return jobInfos;\n }\n return null;\n }\n return null;\n}\n"
|
"protected ArrayList<DiscoveredCamera> doInBackground(Void... params) {\n startTime = new Date();\n try {\n final ScanRange scanRange = new ScanRange(netInfo.getGatewayIp(), netInfo.getNetmaskIp());\n totalDevices = scanRange.size();\n externalIp = NetworkInfo.getExternalIP();\n if (!pool.isShutdown()) {\n pool.execute(new OnvifRunnable());\n pool.execute(new UpnpRunnable());\n pool.execute(new NatRunnable(netInfo.getGatewayIp()));\n }\n IpScan ipScan = new IpScan(new ScanResult() {\n public void onActiveIp(String ip) {\n if (!pool.isShutdown()) {\n pool.execute(new IpScanRunnable(ip));\n }\n }\n public void onIpScanned(String ip) {\n scanPercentage += getPerDevicePercent();\n getScanActivity().updateScanPercentage(scanPercentage);\n }\n });\n ipScan.scanAll(scanRange);\n } catch (Exception e) {\n Log.e(TAG, e.getLocalizedMessage());\n e.printStackTrace();\n }\n int loopCount = 0;\n while (!onvifDone && !upnpDone || !natDone || singleIpStartedCount != singleIpEndedCount) {\n loopCount++;\n if (loopCount > 20)\n break;\n if (isCancelled())\n break;\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n return cameraList;\n}\n"
|
"private static IAggregationResultSet getMatchedResultSet(IAggregationResultSet[] resultSet, DimLevel[] levelNames) throws DataException {\n for (int i = 0; i < resultSet.length; i++) {\n IAggregationResultSet rSet = resultSet[i];\n if (levelNames.length != rSet.getLevelCount())\n continue;\n boolean match = true;\n for (int j = 0; j < rSet.getLevelCount(); j++) {\n if (!levelNames[j].equals(rSet.getLevel(j))) {\n match = false;\n break;\n }\n }\n if (match) {\n if (!isEdgeResultSet(rSet) && existAggregation(rSet.getAggregationDefinition(), aggregationName))\n return rSet;\n }\n }\n throw new DataException(ResourceConstants.INVALID_SORT_DEFN);\n}\n"
|
"public static <T> List<T> query(final T example) {\n final Example qbe = Example.create(example).enableLike(MatchMode.EXACT);\n final List<T> resultList = (List<T>) getTransaction(example).getTxState().getSession().createCriteria(example.getClass()).setReadOnly(readOnly).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY).setCacheable(true).add(qbe).list();\n return Lists.newArrayList(Sets.newHashSet(resultList));\n}\n"
|
"public void disconnect() {\n if (updateConnectionStatus(GodotConnectStatus.DISCONNECTING)) {\n FirebaseUser firebaseUser = mAuth.getCurrentUser();\n if (firebaseUser != null) {\n firebaseUser.unlink(GoogleAuthProvider.PROVIDER_ID).addOnCompleteListener(activity, new OnCompleteListener<AuthResult>() {\n\n public void onResult(Status status) {\n onDisconnected();\n }\n });\n } else {\n onDisconnected();\n }\n }\n}\n"
|
"public void testParsingBlankImport_538() throws Exception {\n if (GroovyUtils.GROOVY_LEVEL < 21) {\n return;\n }\n runNegativeTest(new String[] { \"String_Node_Str\", \"String_Node_Str\" }, \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n ModuleNode mn = getModuleNode(\"String_Node_Str\");\n assertNotNull(mn);\n assertFalse(mn.encounteredUnrecoverableError());\n List<ImportNode> imports = mn.getImports();\n ImportNode brokenImportNode = imports.get(0);\n if (GroovyUtils.GROOVY_LEVEL >= 21) {\n assertEquals(0, brokenImportNode.getStart());\n assertEquals(6, brokenImportNode.getEnd());\n } else {\n assertEquals(2, brokenImportNode.getStart());\n assertEquals(0, brokenImportNode.getEnd());\n }\n assertEquals(\"String_Node_Str\", brokenImportNode.getType().getName());\n ClassNode cn = mn.getClasses().get(0);\n assertNotNull(cn);\n assertTrue(cn.getName().equals(\"String_Node_Str\"));\n}\n"
|
"public void testRegister_Unregister_1() {\n TestProvider1 testProvider1 = new TestProvider1(TmfEvent.class);\n TmfDataProvider<TmfEvent>[] providers = (TmfDataProvider<TmfEvent>[]) TmfProviderManager.getProviders(TmfEvent.class);\n assertTrue(providers.length == 1);\n assertTrue(providers[0] == testProvider1);\n providers = (TmfDataProvider<TmfEvent>[]) TmfProviderManager.getProviders(TmfEvent.class, TestProvider1.class);\n assertTrue(providers.length == 1);\n assertTrue(providers[0] == testProvider1);\n testProvider1.dispose();\n providers = (TmfDataProvider<TmfEvent>[]) TmfProviderManager.getProviders(TmfEvent.class);\n assertTrue(providers.length == 0);\n providers = (TmfDataProvider<TmfEvent>[]) TmfProviderManager.getProviders(TmfEvent.class, TestProvider1.class);\n assertTrue(providers.length == 0);\n}\n"
|
"public static FlowResult processAddEPerson(Context context, Request request, Map objectModel) throws SQLException, AuthorizeException {\n FlowResult result = new FlowResult();\n result.setContinue(false);\n String email = request.getParameter(\"String_Node_Str\").trim();\n String first = request.getParameter(\"String_Node_Str\").trim();\n String last = request.getParameter(\"String_Node_Str\").trim();\n String phone = request.getParameter(\"String_Node_Str\").trim();\n boolean login = (request.getParameter(\"String_Node_Str\") != null) ? true : false;\n boolean certificate = (request.getParameter(\"String_Node_Str\") != null) ? true : false;\n if (email.length() == 0)\n result.addError(\"String_Node_Str\");\n if (first.length() == 0)\n result.addError(\"String_Node_Str\");\n if (last.length() == 0)\n result.addError(\"String_Node_Str\");\n EPerson potentialDupicate = EPerson.findByEmail(context, email);\n if (potentialDupicate != null) {\n result.addError(\"String_Node_Str\");\n }\n if (result.getErrors() == null) {\n EPerson newPerson = AuthenticationUtil.createNewEperson(objectModel, email);\n newPerson.setFirstName(first);\n newPerson.setLastName(last);\n newPerson.setMetadata(\"String_Node_Str\", phone);\n newPerson.setCanLogIn(login);\n newPerson.setRequireCertificate(certificate);\n newPerson.setSelfRegistered(false);\n newPerson.update();\n context.commit();\n result.setContinue(true);\n result.setOutcome(true);\n result.setMessage(T_add_eperson_success_notice);\n result.setParameter(\"String_Node_Str\", newPerson.getID());\n }\n return result;\n}\n"
|
"protected PrestoAttributes getAttributes() {\n return this;\n}\n"
|
"private void startTimer() {\n millisLeft = millisLeft - millisLeft % 1000 - 1;\n updateTime();\n countDownTimer = new CountDownTimer(millisLeft, 100) {\n public void onTick(long millisUntilFinished) {\n millisLeft = millisUntilFinished;\n updateTime();\n }\n public void onFinish() {\n }\n };\n setPaused(false);\n countDownTimer.start();\n}\n"
|
"private void updateConfiguration(String pid, String host, String port, String enabled) {\n try {\n Configuration configuration = this.configAdmin.getConfiguration(pid, null);\n Properties properties = new Properties();\n properties.put(HOST, host);\n properties.put(PORT, port);\n properties.put(ENABLED, enabled);\n configuration.update(properties);\n } catch (IOException e) {\n String message = String.format(\"String_Node_Str\", pid);\n logger.error(message);\n logger.trace(message, e);\n }\n}\n"
|
"public <E> DebugList<E> createNewDebugList() {\n return new DebugList<>(getPublisher(), debugReadWriteLock);\n}\n"
|
"public void updateEmptyShadeView(boolean visible) {\n int oldVisibility = mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility();\n int newVisibility = visible ? VISIBLE : GONE;\n if (oldVisibility != newVisibility) {\n if (newVisibility != GONE) {\n if (mEmptyShadeView.willBeGone()) {\n mEmptyShadeView.cancelAnimation();\n } else {\n mEmptyShadeView.setInvisible();\n }\n mEmptyShadeView.setVisibility(newVisibility);\n mEmptyShadeView.setWillBeGone(false);\n updateContentHeight();\n notifyHeightChangeListener(mDismissView);\n } else {\n mEmptyShadeView.setWillBeGone(true);\n mEmptyShadeView.performVisibilityAnimation(false, new Runnable() {\n public void run() {\n mEmptyShadeView.setVisibility(GONE);\n mEmptyShadeView.setWillBeGone(false);\n updateContentHeight();\n notifyHeightChangeListener(mDismissView);\n }\n };\n if (mAnimationsEnabled) {\n mEmptyShadeView.setWillBeGone(true);\n mEmptyShadeView.performVisibilityAnimation(false, onFinishedRunnable);\n } else {\n mEmptyShadeView.setInvisible();\n onFinishedRunnable.run();\n }\n }\n }\n}\n"
|
"public void insertIntTest() throws ConnectorException {\n ClusterName clusterName = getClusterName();\n TableMetadataBuilder tableMetadataBuilder = new TableMetadataBuilder(CATALOG, TABLE, clusterName.getName());\n TableMetadata tableMetadata = tableMetadataBuilder.addColumn(INTEGER_COLUMN, ColumnType.INT).addColumn(STRING_COLUMN, ColumnType.VARCHAR).build(false);\n sConnector.getMetadataEngine().createTable(getClusterName(), tableMetadata);\n LogicalWorkFlowCreator logicalWorkFlowCreator = new LogicalWorkFlowCreator(CATALOG, TABLE, clusterName);\n LinkedList<LogicalWorkFlowCreator.ConnectorField> selectColumns = new LinkedList<>();\n selectColumns.add(logicalWorkFlowCreator.createConnectorField(INTEGER_COLUMN, INTEGER_COLUMN, ColumnType.INT));\n selectColumns.add(logicalWorkFlowCreator.createConnectorField(STRING_COLUMN, STRING_COLUMN, ColumnType.VARCHAR));\n LogicalWorkflow logicalWorkFlow = logicalWorkFlowCreator.addColumnName(INTEGER_COLUMN).addColumnName(STRING_COLUMN).addWindow(WindowType.NUM_ROWS, 1).addSelect(selectColumns).getLogicalWorkflow();\n ResultHandlerTest resultSet = new ResultHandlerTest();\n StreamingRead reader = new StreamingRead(sConnector, logicalWorkFlow, resultSet);\n String queryId = String.valueOf(Math.abs(random.nextLong()));\n reader.setQueryId(queryId);\n reader.start();\n waitSeconds(20);\n StreamingInserter streamingInserter = new StreamingInserter(sConnector, clusterName, tableMetadata, new RowToInsertDefault());\n streamingInserter.numOfElement(10).elementPerSecond(5);\n streamingInserter.addTypeToInsert(ColumnType.INT).addTypeToInsert(ColumnType.VARCHAR);\n streamingInserter.start();\n waitSeconds(15);\n streamingInserter.end();\n waitSeconds(10);\n reader.end();\n ResultSet resSet = resultSet.getResultSet(queryId);\n List<Integer> numsRecovered = new ArrayList<Integer>(10);\n for (Row recoveredRow : resSet.getRows()) {\n if (recoveredRow.getCell(STRING_COLUMN).getValue().equals(\"String_Node_Str\")) {\n numsRecovered.add((Integer) recoveredRow.getCell(INTEGER_COLUMN).getValue());\n }\n }\n assertEquals(10, numsRecovered.size());\n List<ColumnMetadata> columnMetadata = resSet.getColumnMetadata();\n assertEquals(INTEGER_COLUMN, columnMetadata.get(0).getName().getName());\n for (int i = 0; i < 10; i++) {\n assertTrue(numsRecovered.contains(new Integer(i)));\n }\n assertTrue(columnMetadata.size() == 2);\n assertEquals(ColumnType.INT, columnMetadata.get(0).getColumnType());\n assertTrue(resSet.getRows().get(0).getCell(INTEGER_COLUMN).getValue() instanceof Integer);\n}\n"
|
"protected IpAddress allocateIP(Account ipOwner, boolean isSystem, long zoneId) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {\n Account caller = UserContext.current().getCaller();\n _accountMgr.checkAccess(caller, null, false, ipOwner);\n DataCenter zone = _configMgr.getZone(zoneId);\n return _networkMgr.allocateIp(ipOwner, isSystem, caller, callerUserId, zone);\n}\n"
|
"public void execute(RepositoryNode sourceNode, RepositoryNode targetNode) throws Exception {\n if (!validateAction(sourceNode, targetNode)) {\n return;\n }\n if (targetNode.getType() == ENodeType.REPOSITORY_ELEMENT) {\n targetNode = targetNode.getParent();\n }\n IPath path = RepositoryNodeUtilities.getPath(targetNode);\n if (sourceNode.getType().equals(ENodeType.REPOSITORY_ELEMENT)) {\n Item originalItem = sourceNode.getObject().getProperty().getItem();\n List<IRepositoryViewObject> allVersion = factory.getAllVersion(originalItem.getProperty().getId());\n if (allVersion.size() == 1) {\n copySingleVersionItem(originalItem, path);\n } else if (allVersion.size() > 1) {\n PastSelectorDialog dialog = new PastSelectorDialog(Display.getCurrent().getActiveShell(), allVersion, sourceNode);\n if (dialog.open() == Window.OK) {\n Set<IRepositoryViewObject> selectedVersionItems = dialog.getSelectedVersionItems();\n String id = null;\n String label = null;\n boolean isfirst = true;\n boolean needSys = true;\n for (IRepositoryViewObject object : selectedVersionItems) {\n Item selectedItem = object.getProperty().getItem();\n final Item copy = factory.copy(selectedItem, path);\n if (isfirst) {\n id = copy.getProperty().getId();\n label = copy.getProperty().getLabel();\n isfirst = false;\n }\n copy.getProperty().setId(id);\n copy.getProperty().setLabel(label);\n copy.getProperty().setDisplayName(label);\n if (needSys && originalItem instanceof RoutineItem) {\n String lastestVersion = getLastestVersion(selectedVersionItems);\n if (lastestVersion.equals(copy.getProperty().getVersion())) {\n synDuplicatedRoutine((RoutineItem) copy);\n needSys = false;\n }\n }\n RepositoryWorkUnit<Object> workUnit = new RepositoryWorkUnit<Object>(\"String_Node_Str\", this) {\n protected void run() throws LoginException, PersistenceException {\n if (copy instanceof ProcessItem) {\n RelationshipItemBuilder.getInstance().addOrUpdateItem((ProcessItem) copy);\n }\n factory.save(copy);\n }\n };\n try {\n new ProgressMonitorDialog(null).run(true, true, iRunnableWithProgress);\n } catch (InvocationTargetException e) {\n ExceptionHandler.process(e);\n } catch (InterruptedException e) {\n }\n }\n }\n }\n }\n}\n"
|
"private void move(boolean separateStacks, boolean drop) throws Exception {\n int toIndex = -1, newIndex;\n synchronized (this) {\n if (shortcutType == ShortcutType.MOVE_TO_SPECIFIC_HOTBAR_SLOT) {\n InvTweaksShortcutMapping hotbarShortcut = isActive(ShortcutType.MOVE_TO_SPECIFIC_HOTBAR_SLOT);\n if (hotbarShortcut != null && !hotbarShortcut.getKeyCodes().isEmpty()) {\n String keyName = Keyboard.getKeyName(hotbarShortcut.getKeyCodes().get(0));\n int destIndex = -1 + Integer.parseInt(keyName.replace(\"String_Node_Str\", \"String_Node_Str\"));\n container.move(fromSection, fromIndex, InvTweaksContainerSection.INVENTORY_HOTBAR, destIndex);\n }\n } else {\n toIndex = getNextIndex(separateStacks, drop);\n if (toIndex != -1) {\n switch(shortcutType) {\n case MOVE_ONE_STACK:\n {\n yu slot = container.getSlot(fromSection, fromIndex);\n if (fromSection != InvTweaksContainerSection.CRAFTING_OUT && toSection != InvTweaksContainerSection.ENCHANTMENT) {\n while (hasStack(slot) && toIndex != -1) {\n success = container.move(fromSection, fromIndex, toSection, toIndex);\n newIndex = getNextIndex(separateStacks, drop);\n toIndex = (newIndex != toIndex) ? newIndex : -1;\n }\n } else {\n container.move(fromSection, fromIndex, toSection, toIndex);\n }\n break;\n }\n case MOVE_ONE_ITEM:\n {\n container.moveSome(fromSection, fromIndex, toSection, toIndex, 1);\n break;\n }\n case MOVE_ALL_ITEMS:\n {\n aan stackToMatch = copy(fromStack);\n moveAll(fromSection, toSection, separateStacks, drop, stackToMatch);\n if (fromSection == InvTweaksContainerSection.INVENTORY_NOT_HOTBAR && toSection == InvTweaksContainerSection.CHEST) {\n moveAll(InvTweaksContainerSection.INVENTORY_HOTBAR, toSection, separateStacks, drop, stackToMatch);\n }\n break;\n }\n case MOVE_EVERYTHING:\n {\n moveAll(fromSection, toSection, separateStacks, drop, null);\n if (fromSection == InvTweaksContainerSection.INVENTORY_HOTBAR && toSection == InvTweaksContainerSection.CHEST) {\n moveAll(InvTweaksContainerSection.INVENTORY_NOT_HOTBAR, toSection, separateStacks, drop, null);\n }\n break;\n }\n }\n }\n }\n }\n}\n"
|
"private boolean connResponse(Channel channel) {\n try {\n String host = null;\n int port;\n String method = channel.getMethod();\n if (responseChannel == null) {\n SocketChannel socketChannel = null;\n if (\"String_Node_Str\".equals(method)) {\n host = channel.getHost();\n port = channel.getPort();\n socketChannel = connect(host, port);\n } else {\n host = channel.getHost();\n port = channel.getPort();\n socketChannel = connect(host, port);\n }\n if (socketChannel == null) {\n return false;\n }\n responseChannel = new Channel(false);\n responseChannel.setListener(this);\n responseChannel.setSocket(socketChannel);\n Selector selector = ProxyServer.getInstance().getSeletor();\n SelectionKey sk = socketChannel.register(selector, SelectionKey.OP_READ, this);\n responseChannel.setSelectionKey(sk);\n } else {\n Log.d(TAG, \"String_Node_Str\" + responseChannel.getName());\n responseChannel.reset();\n }\n StringBuffer stringBuffer = new StringBuffer();\n if (\"String_Node_Str\".equals(method)) {\n stringBuffer.append(CONNECT_OK);\n responseChannel.setStatus(Status.CONTENT);\n byte[] sendBytes = stringBuffer.toString().getBytes();\n ByteBuffer byteBuffer = ByteBuffer.wrap(sendBytes);\n requestChannel.write(byteBuffer);\n } else {\n stringBuffer.append(method + \"String_Node_Str\");\n String url = channel.getUrl();\n if (!url.startsWith(\"String_Node_Str\")) {\n url = url.substring(url.indexOf('/', 8));\n }\n Log.d(TAG, \"String_Node_Str\" + url);\n stringBuffer.append(url).append(\"String_Node_Str\").append(channel.getProtocol()).append(CRLF);\n Map<String, String> headers = channel.getHeaders();\n Iterator<String> iterator = headers.keySet().iterator();\n stringBuffer.append(\"String_Node_Str\").append(url).append(CRLF);\n while (iterator.hasNext()) {\n String key = iterator.next();\n stringBuffer.append(key).append(\"String_Node_Str\").append(headers.get(key)).append(CRLF);\n }\n stringBuffer.append(CRLF);\n String text = stringBuffer.toString();\n Log.d(TAG, text);\n byte[] sendBytes = text.getBytes();\n ByteBuffer byteBuffer = ByteBuffer.wrap(sendBytes);\n responseChannel.write(byteBuffer);\n }\n } catch (Exception e) {\n Log.e(TAG, \"String_Node_Str\", e);\n return false;\n }\n return true;\n}\n"
|
"public boolean evaluate(Object value, Object n, boolean calculatePercent) throws DataException {\n if (FilterPassController.getForceReset()) {\n doReset();\n filterPassController.setForceReset(false);\n }\n if (N == -1) {\n try {\n if (calculatePercent) {\n double temp = Double.valueOf(n.toString()).doubleValue() / 100;\n if (temp > 1 || temp < 0)\n throw new DataException(ResourceConstants.INVALID_TOP_BOTTOM_PERCENT_ARGUMENT);\n N = (int) Math.round(temp * getRowCount());\n } else\n N = Double.valueOf(n.toString()).intValue();\n } catch (NumberFormatException e) {\n }\n if (N < 0)\n throw new DataException(ResourceConstants.INVALID_TOP_BOTTOM_N_ARGUMENT);\n }\n if (getPassLevel() == FIRST_PASS) {\n return doFirstPass(value);\n } else if (getPassLevel() == SECOND_PASS) {\n return doSecondPass();\n }\n return false;\n}\n"
|
"private void performTraversals() {\n final View host = mView;\n if (DBG) {\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n host.debug();\n }\n if (host == null || !mAdded)\n return;\n mIsInTraversal = true;\n mWillDrawSoon = true;\n boolean windowSizeMayChange = false;\n boolean newSurface = false;\n boolean surfaceChanged = false;\n WindowManager.LayoutParams lp = mWindowAttributes;\n int desiredWindowWidth;\n int desiredWindowHeight;\n final int viewVisibility = getHostVisibility();\n final boolean viewVisibilityChanged = !mFirst && (mViewVisibility != viewVisibility || mNewSurfaceNeeded);\n WindowManager.LayoutParams params = null;\n if (mWindowAttributesChanged) {\n mWindowAttributesChanged = false;\n surfaceChanged = true;\n params = lp;\n }\n CompatibilityInfo compatibilityInfo = mDisplayAdjustments.getCompatibilityInfo();\n if (compatibilityInfo.supportsScreen() == mLastInCompatMode) {\n params = lp;\n mFullRedrawNeeded = true;\n mLayoutRequested = true;\n if (mLastInCompatMode) {\n params.privateFlags &= ~WindowManager.LayoutParams.PRIVATE_FLAG_COMPATIBLE_WINDOW;\n mLastInCompatMode = false;\n } else {\n params.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_COMPATIBLE_WINDOW;\n mLastInCompatMode = true;\n }\n }\n mWindowAttributesChangesFlag = 0;\n Rect frame = mWinFrame;\n if (mFirst) {\n mFullRedrawNeeded = true;\n mLayoutRequested = true;\n if (shouldUseDisplaySize(lp)) {\n Point size = new Point();\n mDisplay.getRealSize(size);\n desiredWindowWidth = size.x;\n desiredWindowHeight = size.y;\n } else {\n Configuration config = mContext.getResources().getConfiguration();\n desiredWindowWidth = dipToPx(config.screenWidthDp);\n desiredWindowHeight = dipToPx(config.screenHeightDp);\n }\n mAttachInfo.mUse32BitDrawingCache = true;\n mAttachInfo.mHasWindowFocus = false;\n mAttachInfo.mWindowVisibility = viewVisibility;\n mAttachInfo.mRecomputeGlobalAttributes = false;\n mLastConfiguration.setTo(host.getResources().getConfiguration());\n mLastSystemUiVisibility = mAttachInfo.mSystemUiVisibility;\n if (mViewLayoutDirectionInitial == View.LAYOUT_DIRECTION_INHERIT) {\n host.setLayoutDirection(mLastConfiguration.getLayoutDirection());\n }\n host.dispatchAttachedToWindow(mAttachInfo, 0);\n mAttachInfo.mTreeObserver.dispatchOnWindowAttachedChange(true);\n dispatchApplyInsets(host);\n } else {\n desiredWindowWidth = frame.width();\n desiredWindowHeight = frame.height();\n if (desiredWindowWidth != mWidth || desiredWindowHeight != mHeight) {\n if (DEBUG_ORIENTATION)\n Log.v(mTag, \"String_Node_Str\" + host + \"String_Node_Str\" + frame);\n mFullRedrawNeeded = true;\n mLayoutRequested = true;\n windowSizeMayChange = true;\n }\n }\n if (viewVisibilityChanged) {\n mAttachInfo.mWindowVisibility = viewVisibility;\n host.dispatchWindowVisibilityChanged(viewVisibility);\n if (viewVisibility != View.VISIBLE || mNewSurfaceNeeded) {\n endDragResizing();\n destroyHardwareResources();\n }\n if (viewVisibility == View.GONE) {\n mHasHadWindowFocus = false;\n }\n }\n if (mAttachInfo.mWindowVisibility != View.VISIBLE) {\n host.clearAccessibilityFocus();\n }\n getRunQueue().executeActions(mAttachInfo.mHandler);\n boolean insetsChanged = false;\n boolean layoutRequested = mLayoutRequested && (!mStopped || mReportNextDraw);\n if (layoutRequested) {\n final Resources res = mView.getContext().getResources();\n if (mFirst) {\n mAttachInfo.mInTouchMode = !mAddedTouchMode;\n ensureTouchModeLocally(mAddedTouchMode);\n } else {\n if (!mPendingOverscanInsets.equals(mAttachInfo.mOverscanInsets)) {\n insetsChanged = true;\n }\n if (!mPendingContentInsets.equals(mAttachInfo.mContentInsets)) {\n insetsChanged = true;\n }\n if (!mPendingStableInsets.equals(mAttachInfo.mStableInsets)) {\n insetsChanged = true;\n }\n if (!mPendingVisibleInsets.equals(mAttachInfo.mVisibleInsets)) {\n mAttachInfo.mVisibleInsets.set(mPendingVisibleInsets);\n if (DEBUG_LAYOUT)\n Log.v(mTag, \"String_Node_Str\" + mAttachInfo.mVisibleInsets);\n }\n if (!mPendingOutsets.equals(mAttachInfo.mOutsets)) {\n insetsChanged = true;\n }\n if (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT || lp.height == ViewGroup.LayoutParams.WRAP_CONTENT) {\n windowSizeMayChange = true;\n if (shouldUseDisplaySize(lp)) {\n Point size = new Point();\n mDisplay.getRealSize(size);\n desiredWindowWidth = size.x;\n desiredWindowHeight = size.y;\n } else {\n Configuration config = res.getConfiguration();\n desiredWindowWidth = dipToPx(config.screenWidthDp);\n desiredWindowHeight = dipToPx(config.screenHeightDp);\n }\n }\n }\n windowSizeMayChange |= measureHierarchy(host, lp, res, desiredWindowWidth, desiredWindowHeight);\n }\n if (collectViewAttributes()) {\n params = lp;\n }\n if (mAttachInfo.mForceReportNewAttributes) {\n mAttachInfo.mForceReportNewAttributes = false;\n params = lp;\n }\n if (mFirst || mAttachInfo.mViewVisibilityChanged) {\n mAttachInfo.mViewVisibilityChanged = false;\n int resizeMode = mSoftInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST;\n if (resizeMode == WindowManager.LayoutParams.SOFT_INPUT_ADJUST_UNSPECIFIED) {\n final int N = mAttachInfo.mScrollContainers.size();\n for (int i = 0; i < N; i++) {\n if (mAttachInfo.mScrollContainers.get(i).isShown()) {\n resizeMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;\n }\n }\n if (resizeMode == 0) {\n resizeMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN;\n }\n if ((lp.softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST) != resizeMode) {\n lp.softInputMode = (lp.softInputMode & ~WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST) | resizeMode;\n params = lp;\n }\n }\n }\n if (params != null) {\n if ((host.mPrivateFlags & View.PFLAG_REQUEST_TRANSPARENT_REGIONS) != 0) {\n if (!PixelFormat.formatHasAlpha(params.format)) {\n params.format = PixelFormat.TRANSLUCENT;\n }\n }\n mAttachInfo.mOverscanRequested = (params.flags & WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN) != 0;\n }\n if (mApplyInsetsRequested) {\n mApplyInsetsRequested = false;\n mLastOverscanRequested = mAttachInfo.mOverscanRequested;\n dispatchApplyInsets(host);\n if (mLayoutRequested) {\n windowSizeMayChange |= measureHierarchy(host, lp, mView.getContext().getResources(), desiredWindowWidth, desiredWindowHeight);\n }\n }\n if (layoutRequested) {\n mLayoutRequested = false;\n }\n boolean windowShouldResize = layoutRequested && windowSizeMayChange && ((mWidth != host.getMeasuredWidth() || mHeight != host.getMeasuredHeight()) || (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT && frame.width() < desiredWindowWidth && frame.width() != mWidth) || (lp.height == ViewGroup.LayoutParams.WRAP_CONTENT && frame.height() < desiredWindowHeight && frame.height() != mHeight));\n windowShouldResize |= mDragResizing && mResizeMode == RESIZE_MODE_FREEFORM;\n windowShouldResize |= !mPendingBackDropFrame.equals(mWinFrame);\n windowShouldResize |= mActivityRelaunched;\n final boolean computesInternalInsets = mAttachInfo.mTreeObserver.hasComputeInternalInsetsListeners() || mAttachInfo.mHasNonEmptyGivenInternalInsets;\n boolean insetsPending = false;\n int relayoutResult = 0;\n final boolean isViewVisible = viewVisibility == View.VISIBLE;\n if (mFirst || windowShouldResize || insetsChanged || viewVisibilityChanged || params != null || mForceNextWindowRelayout) {\n mForceNextWindowRelayout = false;\n if (isViewVisible) {\n insetsPending = computesInternalInsets && (mFirst || viewVisibilityChanged);\n }\n if (mSurfaceHolder != null) {\n mSurfaceHolder.mSurfaceLock.lock();\n mDrawingAllowed = true;\n }\n boolean hwInitialized = false;\n boolean contentInsetsChanged = false;\n boolean hadSurface = mSurface.isValid();\n try {\n if (DEBUG_LAYOUT) {\n Log.i(mTag, \"String_Node_Str\" + host.getMeasuredWidth() + \"String_Node_Str\" + host.getMeasuredHeight() + \"String_Node_Str\" + params);\n }\n if (mAttachInfo.mHardwareRenderer != null) {\n if (mAttachInfo.mHardwareRenderer.pauseSurface(mSurface)) {\n mDirty.set(0, 0, mWidth, mHeight);\n }\n mChoreographer.mFrameInfo.addFlags(FrameInfo.FLAG_WINDOW_LAYOUT_CHANGED);\n }\n final int surfaceGenerationId = mSurface.getGenerationId();\n relayoutResult = relayoutWindow(params, viewVisibility, insetsPending);\n if (DEBUG_LAYOUT)\n Log.v(mTag, \"String_Node_Str\" + frame.toShortString() + \"String_Node_Str\" + mPendingOverscanInsets.toShortString() + \"String_Node_Str\" + mPendingContentInsets.toShortString() + \"String_Node_Str\" + mPendingVisibleInsets.toShortString() + \"String_Node_Str\" + mPendingStableInsets.toShortString() + \"String_Node_Str\" + mPendingOutsets.toShortString() + \"String_Node_Str\" + mSurface);\n if (mPendingConfiguration.seq != 0) {\n if (DEBUG_CONFIGURATION)\n Log.v(mTag, \"String_Node_Str\" + mPendingConfiguration);\n updateConfiguration(new Configuration(mPendingConfiguration), !mFirst);\n mPendingConfiguration.seq = 0;\n }\n final boolean overscanInsetsChanged = !mPendingOverscanInsets.equals(mAttachInfo.mOverscanInsets);\n contentInsetsChanged = !mPendingContentInsets.equals(mAttachInfo.mContentInsets);\n final boolean visibleInsetsChanged = !mPendingVisibleInsets.equals(mAttachInfo.mVisibleInsets);\n final boolean stableInsetsChanged = !mPendingStableInsets.equals(mAttachInfo.mStableInsets);\n final boolean outsetsChanged = !mPendingOutsets.equals(mAttachInfo.mOutsets);\n final boolean surfaceSizeChanged = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_SURFACE_RESIZED) != 0;\n if (contentInsetsChanged) {\n mAttachInfo.mContentInsets.set(mPendingContentInsets);\n if (DEBUG_LAYOUT)\n Log.v(mTag, \"String_Node_Str\" + mAttachInfo.mContentInsets);\n }\n if (overscanInsetsChanged) {\n mAttachInfo.mOverscanInsets.set(mPendingOverscanInsets);\n if (DEBUG_LAYOUT)\n Log.v(mTag, \"String_Node_Str\" + mAttachInfo.mOverscanInsets);\n contentInsetsChanged = true;\n }\n if (stableInsetsChanged) {\n mAttachInfo.mStableInsets.set(mPendingStableInsets);\n if (DEBUG_LAYOUT)\n Log.v(mTag, \"String_Node_Str\" + mAttachInfo.mStableInsets);\n contentInsetsChanged = true;\n }\n if (contentInsetsChanged || mLastSystemUiVisibility != mAttachInfo.mSystemUiVisibility || mApplyInsetsRequested || mLastOverscanRequested != mAttachInfo.mOverscanRequested || outsetsChanged) {\n mLastSystemUiVisibility = mAttachInfo.mSystemUiVisibility;\n mLastOverscanRequested = mAttachInfo.mOverscanRequested;\n mAttachInfo.mOutsets.set(mPendingOutsets);\n mApplyInsetsRequested = false;\n dispatchApplyInsets(host);\n }\n if (visibleInsetsChanged) {\n mAttachInfo.mVisibleInsets.set(mPendingVisibleInsets);\n if (DEBUG_LAYOUT)\n Log.v(mTag, \"String_Node_Str\" + mAttachInfo.mVisibleInsets);\n }\n if (!hadSurface) {\n if (mSurface.isValid()) {\n newSurface = true;\n mFullRedrawNeeded = true;\n mPreviousTransparentRegion.setEmpty();\n if (mAttachInfo.mHardwareRenderer != null) {\n try {\n hwInitialized = mAttachInfo.mHardwareRenderer.initialize(mSurface);\n if (hwInitialized && (host.mPrivateFlags & View.PFLAG_REQUEST_TRANSPARENT_REGIONS) == 0) {\n mSurface.allocateBuffers();\n }\n } catch (OutOfResourcesException e) {\n handleOutOfResourcesException(e);\n return;\n }\n }\n }\n } else if (!mSurface.isValid()) {\n if (mLastScrolledFocus != null) {\n mLastScrolledFocus.clear();\n }\n mScrollY = mCurScrollY = 0;\n if (mView instanceof RootViewSurfaceTaker) {\n ((RootViewSurfaceTaker) mView).onRootViewScrollYChanged(mCurScrollY);\n }\n if (mScroller != null) {\n mScroller.abortAnimation();\n }\n if (mAttachInfo.mHardwareRenderer != null && mAttachInfo.mHardwareRenderer.isEnabled()) {\n mAttachInfo.mHardwareRenderer.destroy();\n }\n } else if ((surfaceGenerationId != mSurface.getGenerationId() || surfaceSizeChanged) && mSurfaceHolder == null && mAttachInfo.mHardwareRenderer != null) {\n mFullRedrawNeeded = true;\n try {\n mAttachInfo.mHardwareRenderer.updateSurface(mSurface);\n } catch (OutOfResourcesException e) {\n handleOutOfResourcesException(e);\n return;\n }\n }\n final boolean freeformResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_FREEFORM) != 0;\n final boolean dockedResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_DOCKED) != 0;\n final boolean dragResizing = freeformResizing || dockedResizing;\n if (mDragResizing != dragResizing) {\n if (dragResizing) {\n startDragResizing(mPendingBackDropFrame, mWinFrame.equals(mPendingBackDropFrame), mPendingVisibleInsets, mPendingStableInsets);\n mResizeMode = freeformResizing ? RESIZE_MODE_FREEFORM : RESIZE_MODE_DOCKED_DIVIDER;\n } else {\n endDragResizing();\n }\n }\n if (!USE_MT_RENDERER) {\n if (dragResizing) {\n mCanvasOffsetX = mWinFrame.left;\n mCanvasOffsetY = mWinFrame.top;\n } else {\n mCanvasOffsetX = mCanvasOffsetY = 0;\n }\n }\n } catch (RemoteException e) {\n }\n if (DEBUG_ORIENTATION)\n Log.v(TAG, \"String_Node_Str\" + frame + \"String_Node_Str\" + mSurface);\n mAttachInfo.mWindowLeft = frame.left;\n mAttachInfo.mWindowTop = frame.top;\n if (mWidth != frame.width() || mHeight != frame.height()) {\n mWidth = frame.width();\n mHeight = frame.height();\n }\n if (mSurfaceHolder != null) {\n if (mSurface.isValid()) {\n mSurfaceHolder.mSurface = mSurface;\n }\n mSurfaceHolder.setSurfaceFrameSize(mWidth, mHeight);\n mSurfaceHolder.mSurfaceLock.unlock();\n if (mSurface.isValid()) {\n if (!hadSurface) {\n mSurfaceHolder.ungetCallbacks();\n mIsCreating = true;\n mSurfaceHolderCallback.surfaceCreated(mSurfaceHolder);\n SurfaceHolder.Callback[] callbacks = mSurfaceHolder.getCallbacks();\n if (callbacks != null) {\n for (SurfaceHolder.Callback c : callbacks) {\n c.surfaceCreated(mSurfaceHolder);\n }\n }\n surfaceChanged = true;\n }\n if (surfaceChanged) {\n mSurfaceHolderCallback.surfaceChanged(mSurfaceHolder, lp.format, mWidth, mHeight);\n SurfaceHolder.Callback[] callbacks = mSurfaceHolder.getCallbacks();\n if (callbacks != null) {\n for (SurfaceHolder.Callback c : callbacks) {\n c.surfaceChanged(mSurfaceHolder, lp.format, mWidth, mHeight);\n }\n }\n }\n mIsCreating = false;\n } else if (hadSurface) {\n mSurfaceHolder.ungetCallbacks();\n SurfaceHolder.Callback[] callbacks = mSurfaceHolder.getCallbacks();\n mSurfaceHolderCallback.surfaceDestroyed(mSurfaceHolder);\n if (callbacks != null) {\n for (SurfaceHolder.Callback c : callbacks) {\n c.surfaceDestroyed(mSurfaceHolder);\n }\n }\n mSurfaceHolder.mSurfaceLock.lock();\n try {\n mSurfaceHolder.mSurface = new Surface();\n } finally {\n mSurfaceHolder.mSurfaceLock.unlock();\n }\n }\n }\n final ThreadedRenderer hardwareRenderer = mAttachInfo.mHardwareRenderer;\n if (hardwareRenderer != null && hardwareRenderer.isEnabled()) {\n if (hwInitialized || mWidth != hardwareRenderer.getWidth() || mHeight != hardwareRenderer.getHeight()) {\n hardwareRenderer.setup(mWidth, mHeight, mAttachInfo, mWindowAttributes.surfaceInsets);\n }\n }\n if (!mStopped || mReportNextDraw) {\n boolean focusChangedDueToTouchMode = ensureTouchModeLocally((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_IN_TOUCH_MODE) != 0);\n if (focusChangedDueToTouchMode || mWidth != host.getMeasuredWidth() || mHeight != host.getMeasuredHeight() || contentInsetsChanged) {\n int childWidthMeasureSpec = getRootMeasureSpec(mWidth, lp.width);\n int childHeightMeasureSpec = getRootMeasureSpec(mHeight, lp.height);\n if (DEBUG_LAYOUT)\n Log.v(mTag, \"String_Node_Str\" + mWidth + \"String_Node_Str\" + host.getMeasuredWidth() + \"String_Node_Str\" + mHeight + \"String_Node_Str\" + host.getMeasuredHeight() + \"String_Node_Str\" + contentInsetsChanged);\n performMeasure(childWidthMeasureSpec, childHeightMeasureSpec);\n int width = host.getMeasuredWidth();\n int height = host.getMeasuredHeight();\n boolean measureAgain = false;\n if (lp.horizontalWeight > 0.0f) {\n width += (int) ((mWidth - width) * lp.horizontalWeight);\n childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY);\n measureAgain = true;\n }\n if (lp.verticalWeight > 0.0f) {\n height += (int) ((mHeight - height) * lp.verticalWeight);\n childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);\n measureAgain = true;\n }\n if (measureAgain) {\n if (DEBUG_LAYOUT)\n Log.v(mTag, \"String_Node_Str\" + width + \"String_Node_Str\" + height);\n performMeasure(childWidthMeasureSpec, childHeightMeasureSpec);\n }\n layoutRequested = true;\n }\n }\n } else {\n maybeHandleWindowMove(frame);\n }\n final boolean didLayout = layoutRequested && (!mStopped || mReportNextDraw);\n boolean triggerGlobalLayoutListener = didLayout || mAttachInfo.mRecomputeGlobalAttributes;\n if (didLayout) {\n performLayout(lp, desiredWindowWidth, desiredWindowHeight);\n if ((host.mPrivateFlags & View.PFLAG_REQUEST_TRANSPARENT_REGIONS) != 0) {\n host.getLocationInWindow(mTmpLocation);\n mTransparentRegion.set(mTmpLocation[0], mTmpLocation[1], mTmpLocation[0] + host.mRight - host.mLeft, mTmpLocation[1] + host.mBottom - host.mTop);\n host.gatherTransparentRegion(mTransparentRegion);\n if (mTranslator != null) {\n mTranslator.translateRegionInWindowToScreen(mTransparentRegion);\n }\n if (!mTransparentRegion.equals(mPreviousTransparentRegion)) {\n mPreviousTransparentRegion.set(mTransparentRegion);\n mFullRedrawNeeded = true;\n try {\n mWindowSession.setTransparentRegion(mWindow, mTransparentRegion);\n } catch (RemoteException e) {\n }\n }\n }\n if (DBG) {\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n host.debug();\n }\n }\n if (triggerGlobalLayoutListener) {\n mAttachInfo.mRecomputeGlobalAttributes = false;\n mAttachInfo.mTreeObserver.dispatchOnGlobalLayout();\n }\n if (computesInternalInsets) {\n final ViewTreeObserver.InternalInsetsInfo insets = mAttachInfo.mGivenInternalInsets;\n insets.reset();\n mAttachInfo.mTreeObserver.dispatchOnComputeInternalInsets(insets);\n mAttachInfo.mHasNonEmptyGivenInternalInsets = !insets.isEmpty();\n if (insetsPending || !mLastGivenInsets.equals(insets)) {\n mLastGivenInsets.set(insets);\n final Rect contentInsets;\n final Rect visibleInsets;\n final Region touchableRegion;\n if (mTranslator != null) {\n contentInsets = mTranslator.getTranslatedContentInsets(insets.contentInsets);\n visibleInsets = mTranslator.getTranslatedVisibleInsets(insets.visibleInsets);\n touchableRegion = mTranslator.getTranslatedTouchableArea(insets.touchableRegion);\n } else {\n contentInsets = insets.contentInsets;\n visibleInsets = insets.visibleInsets;\n touchableRegion = insets.touchableRegion;\n }\n try {\n mWindowSession.setInsets(mWindow, insets.mTouchableInsets, contentInsets, visibleInsets, touchableRegion);\n } catch (RemoteException e) {\n }\n }\n }\n if (mFirst) {\n if (DEBUG_INPUT_RESIZE)\n Log.v(mTag, \"String_Node_Str\" + mView.hasFocus());\n if (mView != null) {\n if (!mView.hasFocus()) {\n mView.requestFocus(View.FOCUS_FORWARD);\n if (DEBUG_INPUT_RESIZE)\n Log.v(mTag, \"String_Node_Str\" + mView.findFocus());\n } else {\n if (DEBUG_INPUT_RESIZE)\n Log.v(mTag, \"String_Node_Str\" + mView.findFocus());\n }\n }\n }\n final boolean changedVisibility = (viewVisibilityChanged || mFirst) && isViewVisible;\n final boolean hasWindowFocus = mAttachInfo.mHasWindowFocus && isViewVisible;\n final boolean regainedFocus = hasWindowFocus && mLostWindowFocus;\n if (regainedFocus) {\n mLostWindowFocus = false;\n } else if (!hasWindowFocus && mHadWindowFocus) {\n mLostWindowFocus = true;\n }\n if (changedVisibility || regainedFocus) {\n host.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);\n }\n mFirst = false;\n mWillDrawSoon = false;\n mNewSurfaceNeeded = false;\n mActivityRelaunched = false;\n mViewVisibility = viewVisibility;\n mHadWindowFocus = hasWindowFocus;\n if (hasWindowFocus && !isInLocalFocusMode()) {\n final boolean imTarget = WindowManager.LayoutParams.mayUseInputMethod(mWindowAttributes.flags);\n if (imTarget != mLastWasImTarget) {\n mLastWasImTarget = imTarget;\n InputMethodManager imm = InputMethodManager.peekInstance();\n if (imm != null && imTarget) {\n imm.onPreWindowFocus(mView, hasWindowFocus);\n imm.onPostWindowFocus(mView, mView.findFocus(), mWindowAttributes.softInputMode, !mHasHadWindowFocus, mWindowAttributes.flags);\n }\n }\n }\n if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_FIRST_TIME) != 0) {\n mReportNextDraw = true;\n }\n boolean cancelDraw = mAttachInfo.mTreeObserver.dispatchOnPreDraw() || !isViewVisible;\n if (!cancelDraw) {\n if (mPendingTransitions != null && mPendingTransitions.size() > 0) {\n for (int i = 0; i < mPendingTransitions.size(); ++i) {\n mPendingTransitions.get(i).startChangingAnimations();\n }\n mPendingTransitions.clear();\n }\n performDraw();\n } else {\n if (isViewVisible) {\n scheduleTraversals();\n } else if (mPendingTransitions != null && mPendingTransitions.size() > 0) {\n for (int i = 0; i < mPendingTransitions.size(); ++i) {\n mPendingTransitions.get(i).endChangingAnimations();\n }\n mPendingTransitions.clear();\n }\n }\n mIsInTraversal = false;\n}\n"
|
"public static void onSurfaceChanged() {\n ratio = (float) Screen.getWidth() / Screen.getHeight();\n hasChangedProjection = true;\n Matrix4.createOrtho(orthogonalProjection, 0, 1, 1, 0, 1, 10);\n Matrix4.createLookAt(orthogonalModelView, 0, 0, 1, 0, 0, 0, 0, 1, 0);\n Matrix4.multiply(orthogonalMVP, orthogonalProjection, orthogonalModelView);\n}\n"
|
"public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {\n return supportsMediaType(mediaType);\n}\n"
|
"public BorderInfo resolveTableLeftBorder(IStyle tableLeft, IStyle rowLeft, IStyle columnLeft, IStyle cellLeft) {\n return resolveBorder(tableLeftBorderCache, new BorderStyleInfo[] { new BorderStyleInfo(cellLeft, POSITION_LEFT), new BorderStyleInfo(columnLeft, POSITION_LEFT), new BorderStyleInfo(rowLeft, POSITION_LEFT), new BorderStyleInfo(tableLeft, POSITION_LEFT) });\n}\n"
|
"public void repaint(Player p) {\n if (!player.getInventory().toString().equals(p.getInventory().toString()) || !isSameEquip(p) || player.getMoney() != p.getMoney()) {\n player = p;\n repaint();\n }\n}\n"
|
"private Object buildObjectValuesFromDOMRecord(DOMRecord record, AbstractSession session, ObjectBuildingQuery query, JoinedAttributeManager joinManager) {\n Node root = record.getDOM();\n NodeList nodes = root.getChildNodes();\n Collection unmappedChildren = getUnmappedChildNodes(nodes);\n Iterator iter = unmappedChildren.iterator();\n int i = 0;\n int length = unmappedChildren.size();\n while (iter.hasNext()) {\n Object objectValue = null;\n org.w3c.dom.Node next = (Node) iter.next();\n if (next.getNodeType() == Node.TEXT_NODE) {\n if ((i == (length - 1)) || (next.getNodeValue().trim().length() > 0)) {\n objectValue = next.getNodeValue();\n if (getConverter() != null) {\n objectValue = getConverter().convertDataValueToObjectValue(objectValue, session, record.getUnmarshaller());\n }\n return objectValue;\n }\n } else if (next.getNodeType() == Node.ELEMENT_NODE) {\n ClassDescriptor referenceDescriptor = null;\n DOMRecord nestedRecord = (DOMRecord) record.buildNestedRow((Element) next);\n if (!useXMLRoot) {\n return buildObjectForNonXMLRoot(getDescriptor(nestedRecord, session, null), getConverter(), query, record, nestedRecord, joinManager, session, next, null, null);\n }\n String schemaType = ((Element) next).getAttributeNS(XMLConstants.SCHEMA_INSTANCE_URL, XMLConstants.SCHEMA_TYPE_ATTRIBUTE);\n QName schemaTypeQName = null;\n XPathFragment frag = new XPathFragment();\n if ((null != schemaType) && (schemaType.length() > 0)) {\n frag.setXPath(schemaType);\n if (frag.hasNamespace()) {\n String prefix = frag.getPrefix();\n XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();\n String url = xmlPlatform.resolveNamespacePrefix(next, prefix);\n frag.setNamespaceURI(url);\n schemaTypeQName = new QName(url, frag.getLocalName());\n }\n if (referenceDescriptor == null) {\n try {\n QName qname = new QName(nestedRecord.getNamespaceURI(), nestedRecord.getLocalName());\n referenceDescriptor = getDescriptor(nestedRecord, session, qname);\n } catch (XMLMarshalException e) {\n referenceDescriptor = null;\n }\n }\n if (referenceDescriptor != null) {\n ObjectBuilder builder = referenceDescriptor.getObjectBuilder();\n objectValue = builder.buildObject(query, nestedRecord, joinManager);\n Object updated = ((XMLDescriptor) referenceDescriptor).wrapObjectInXMLRoot(objectValue, next.getNamespaceURI(), next.getLocalName(), next.getPrefix(), false);\n if (getConverter() != null) {\n updated = getConverter().convertDataValueToObjectValue(objectValue, session, record.getUnmarshaller());\n }\n return updated;\n } else if ((referenceDescriptor != null) && (getKeepAsElementPolicy() != UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) {\n return buildObjectAndWrapInXMLRoot(referenceDescriptor, getConverter(), query, record, nestedRecord, joinManager, session, next, null, null);\n } else {\n Node textchild = ((Element) next).getFirstChild();\n if ((textchild != null) && (textchild.getNodeType() == Node.TEXT_NODE)) {\n String stringValue = ((Text) textchild).getNodeValue();\n if ((stringValue != null) && stringValue.length() > 0) {\n Object convertedValue = stringValue;\n if (schemaTypeQName != null) {\n Class theClass = (Class) XMLConversionManager.getDefaultXMLTypes().get(schemaTypeQName);\n if (theClass != null) {\n convertedValue = ((XMLConversionManager) session.getDatasourcePlatform().getConversionManager()).convertObject(convertedValue, theClass, schemaTypeQName);\n }\n }\n if (getConverter() != null) {\n convertedValue = getConverter().convertDataValueToObjectValue(convertedValue, session, record.getUnmarshaller());\n }\n XMLRoot rootValue = new XMLRoot();\n rootValue.setLocalName(next.getLocalName());\n rootValue.setSchemaType(schemaTypeQName);\n rootValue.setNamespaceURI(next.getNamespaceURI());\n rootValue.setObject(convertedValue);\n return rootValue;\n }\n }\n }\n }\n }\n i++;\n }\n return null;\n}\n"
|
"private void updateSnapshot(CommoditySnapshotValue commoditySnapshotValue, GenericDao<CommoditySnapshot> snapshotDao, List<CommoditySnapshot> commoditySnapshots) {\n CommoditySnapshot commoditySnapshot = commoditySnapshots.get(0);\n if (isReplace) {\n commoditySnapshot.setValue(commoditySnapshotValue.getValue());\n } else {\n commoditySnapshot.incrementValue(commoditySnapshotValue.getValue());\n }\n commoditySnapshot.setSynced(false);\n snapshotDao.update(commoditySnapshot);\n}\n"
|
"void listenMembershipEvents(Address ownerConnectionAddress) {\n initialListFetchedLatch = new CountDownLatch(1);\n ClientMessage clientMessage = ClientAddMembershipListenerCodec.encodeRequest(false);\n Connection connection = connectionManager.getConnection(ownerConnectionAddress);\n if (connection == null) {\n throw new IllegalStateException(\"String_Node_Str\" + ownerConnectionAddress);\n }\n}\n"
|
"public List<RanChangeSet> getRanChangeSetList() throws JDBCException {\n try {\n String databaseChangeLogTableName = escapeTableName(getDefaultSchemaName(), getDatabaseChangeLogTableName());\n List<RanChangeSet> ranChangeSetList = new ArrayList<RanChangeSet>();\n if (doesChangeLogTableExist()) {\n log.info(\"String_Node_Str\" + databaseChangeLogTableName);\n String sql = \"String_Node_Str\" + databaseChangeLogTableName + \"String_Node_Str\".toUpperCase();\n Statement statement = getConnection().createStatement();\n ResultSet rs = statement.executeQuery(sql);\n while (rs.next()) {\n String fileName = rs.getString(\"String_Node_Str\");\n String author = rs.getString(\"String_Node_Str\");\n String id = rs.getString(\"String_Node_Str\");\n String md5sum = rs.getString(\"String_Node_Str\");\n Date dateExecuted = rs.getTimestamp(\"String_Node_Str\");\n String tag = rs.getString(\"String_Node_Str\");\n RanChangeSet ranChangeSet = new RanChangeSet(fileName, id, author, md5sum, dateExecuted, tag);\n ranChangeSetList.add(ranChangeSet);\n }\n rs.close();\n statement.close();\n }\n return ranChangeSetList;\n } catch (SQLException e) {\n if (!getJdbcTemplate().executesStatements()) {\n return new ArrayList<RanChangeSet>();\n } else {\n throw new JDBCException(e);\n }\n }\n}\n"
|
"private void addApplicationSignUp(ApplicationContext applicationContext, String applicationKey, List<String> clusterIds) {\n try {\n if (log.isInfoEnabled()) {\n log.info(String.format(\"String_Node_Str\", applicationContext.getApplicationId()));\n }\n ComponentContext components = applicationContext.getComponents();\n if (components != null) {\n ApplicationSignUp applicationSignUp = new ApplicationSignUp();\n applicationSignUp.setApplicationId(applicationContext.getApplicationId());\n applicationSignUp.setTenantId(applicationContext.getTenantId());\n String[] clusterIdsArray = clusterIds.toArray(new String[clusterIds.size()]);\n applicationSignUp.setClusterIds(clusterIdsArray);\n List<ArtifactRepository> artifactRepositoryList = new ArrayList<ArtifactRepository>();\n CartridgeContext[] cartridgeContexts = components.getCartridgeContexts();\n if (cartridgeContexts != null) {\n updateArtifactRepositoryList(artifactRepositoryList, cartridgeContexts);\n }\n CartridgeContext[] cartridgeContextsOfGroups = getCartridgeContextsOfGroupsRecursively(components.getGroupContexts());\n if (cartridgeContextsOfGroups != null) {\n updateArtifactRepositoryList(artifactRepositoryList, cartridgeContextsOfGroups);\n }\n ArtifactRepository[] artifactRepositoryArray = artifactRepositoryList.toArray(new ArtifactRepository[artifactRepositoryList.size()]);\n applicationSignUp.setArtifactRepositories(artifactRepositoryArray);\n encryptRepositoryPasswords(applicationSignUp, applicationKey);\n StratosManagerServiceClient serviceClient = StratosManagerServiceClient.getInstance();\n serviceClient.addApplicationSignUp(applicationSignUp);\n if (log.isInfoEnabled()) {\n log.info(String.format(\"String_Node_Str\", applicationContext.getApplicationId()));\n }\n }\n } catch (Exception e) {\n String message = \"String_Node_Str\";\n log.error(message, e);\n throw new RuntimeException(message, e);\n }\n}\n"
|
"public JsonResult<LanguageBo> saveForCreated(LanguageBo languageBo) {\n UserResource resource = (UserResource) session.getAttribute(WebConst.SESSION_RESOURCE);\n if (languageService.findExistLanguage(languageBo.getCode())) {\n return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(), resource.getMessage(\"String_Node_Str\"));\n }\n if (languageService.findExistLanguageName(languageBo.getName())) {\n return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(), resource.getMessage(\"String_Node_Str\"));\n }\n languageService.save(languageBo);\n return get(languageBo.getCode());\n}\n"
|
"public Header onGetInitialHeader() {\n for (int i = 0; i < mHeaders.size(); i++) {\n Header h = mHeaders.get(i);\n if (h.fragment != null) {\n return h;\n }\n }\n throw new IllegalStateException(\"String_Node_Str\");\n}\n"
|
"public static List<ImageDescriptor> createChart(ColumnIndicator column, boolean isCreate) {\n CompositeIndicator compositeIndicator = new CompositeIndicator(column);\n Map<String, List<IndicatorUnit>> separatedMap = compositeIndicator.getIndicatorComposite();\n List<ImageDescriptor> returnFiles = new ArrayList<ImageDescriptor>();\n if (separatedMap.get(CompositeIndicator.SIMPLE_STATISTICS).size() != 0) {\n CategoryDataset dataset = createSimpleDataset(separatedMap.get(CompositeIndicator.SIMPLE_STATISTICS), isCreate);\n returnFiles.add(create3DBarChart(CompositeIndicator.SIMPLE_STATISTICS, dataset, true));\n }\n if (separatedMap.get(CompositeIndicator.TEXT_STATISTICS).size() != 0) {\n CategoryDataset dataset = createTextedDataset(separatedMap.get(CompositeIndicator.TEXT_STATISTICS), isCreate);\n returnFiles.add(create3DBarChart(CompositeIndicator.TEXT_STATISTICS, dataset, true));\n }\n if (separatedMap.get(CompositeIndicator.FREQUENCE_STATISTICS).size() != 0) {\n CategoryDataset dataset = createFrequenceDataset(separatedMap.get(CompositeIndicator.FREQUENCE_STATISTICS), isCreate);\n returnFiles.add(createBarChart(CompositeIndicator.FREQUENCE_STATISTICS, dataset));\n }\n if (separatedMap.get(CompositeIndicator.SUMMARY_STATISTICS).size() != 0) {\n CategoryDataset dataset = createSummaryDataset(separatedMap.get(CompositeIndicator.SUMMARY_STATISTICS), isCreate);\n if (dataset instanceof BoxAndWhiskerCategoryDataset) {\n returnFiles.add(createBoxAndWhiskerChart(CompositeIndicator.SUMMARY_STATISTICS, (BoxAndWhiskerCategoryDataset) dataset));\n } else {\n returnFiles.add(create3DBarChart(CompositeIndicator.SUMMARY_STATISTICS, dataset, false));\n }\n }\n if (separatedMap.get(CompositeIndicator.PATTERN_MATCHING).size() != 0) {\n CategoryDataset dataset = createPatternMatchDataset(separatedMap.get(CompositeIndicator.PATTERN_MATCHING), isCreate);\n returnFiles.add(createStacked3DBarChart(CompositeIndicator.PATTERN_MATCHING, dataset));\n }\n return returnFiles;\n}\n"
|
"private Raster readDatasetRaster(GDALCommonIIOImageMetadata item, Rectangle srcRegion, Rectangle dstRegion, int[] selectedBands, SampleModel destSampleModel) throws IOException {\n SampleModel destSm = destSampleModel != null ? destSampleModel : item.getSampleModel();\n SampleModel sampleModel = null;\n DataBuffer imgBuffer = null;\n final String datasetName = item.getDatasetName();\n final Dataset dataset = GDALUtilities.acquireDataSet(datasetName, gdalconst.GA_ReadOnly);\n Band pBand = null;\n if (dataset == null)\n throw new IOException(\"String_Node_Str\" + datasetName);\n try {\n int dstWidth = dstRegion.width;\n int dstHeight = dstRegion.height;\n int srcRegionXOffset = srcRegion.x;\n int srcRegionYOffset = srcRegion.y;\n int srcRegionWidth = srcRegion.width;\n int srcRegionHeight = srcRegion.height;\n if (LOGGER.isLoggable(Level.FINE))\n LOGGER.fine(\"String_Node_Str\" + srcRegion.toString());\n final int nBands = selectedBands != null ? selectedBands.length : destSm.getNumBands();\n int[] banks = new int[nBands];\n int[] offsets = new int[nBands];\n final int pixels = dstWidth * dstHeight;\n int bufferType = 0, bufferSize = 0;\n int typeSizeInBytes = 0;\n pBand = dataset.GetRasterBand(1);\n bufferType = pBand.getDataType();\n typeSizeInBytes = gdal.GetDataTypeSize(bufferType) / 8;\n bufferSize = nBands * pixels * typeSizeInBytes;\n boolean splitBands = false;\n if (bufferSize < 0 || destSm instanceof BandedSampleModel) {\n bufferSize = pixels * typeSizeInBytes;\n splitBands = true;\n }\n int dataBufferType = -1;\n byte[][] byteBands = new byte[nBands][];\n for (int k = 0; k < nBands; k++) {\n if (k > 0 && !splitBands)\n break;\n final byte[] dataBuffer = new byte[bufferSize];\n final int returnVal;\n if (!splitBands) {\n final int[] bandsMap = new int[nBands];\n if (selectedBands != null) {\n for (int i = 0; i < nBands; i++) bandsMap[i] = selectedBands[i] + 1;\n } else {\n for (int i = 0; i < nBands; i++) bandsMap[i] = i + 1;\n }\n returnVal = dataset.ReadRaster(srcRegionXOffset, srcRegionYOffset, srcRegionWidth, srcRegionHeight, dstWidth, dstHeight, bufferType, dataBuffer, bandsMap, nBands * typeSizeInBytes, dstWidth * nBands * typeSizeInBytes, typeSizeInBytes);\n byteBands[k] = dataBuffer;\n } else {\n Band rBand = null;\n try {\n rBand = dataset.GetRasterBand(k + 1);\n returnVal = rBand.ReadRaster(srcRegionXOffset, srcRegionYOffset, srcRegionWidth, srcRegionHeight, dstWidth, dstHeight, bufferType, dataBuffer);\n byteBands[k] = dataBuffer;\n } finally {\n if (rBand != null) {\n try {\n rBand.delete();\n } catch (Throwable e) {\n if (LOGGER.isLoggable(Level.FINEST))\n LOGGER.log(Level.FINEST, e.getLocalizedMessage(), e);\n }\n }\n }\n }\n if (returnVal == gdalconstConstants.CE_None) {\n if (!splitBands)\n for (int band = 0; band < nBands; band++) {\n banks[band] = band;\n offsets[band] = band;\n }\n else {\n banks[k] = k;\n offsets[k] = 0;\n }\n } else {\n LOGGER.info(new StringBuilder(\"String_Node_Str\").append(gdal.GetLastErrorMsg()).toString());\n LOGGER.info(new StringBuilder(\"String_Node_Str\").append(gdal.GetLastErrorNo()).toString());\n LOGGER.info(new StringBuilder(\"String_Node_Str\").append(gdal.GetLastErrorType()).toString());\n GDALUtilities.closeDataSet(dataset);\n throw new RuntimeException(gdal.GetLastErrorMsg());\n }\n }\n if (bufferType == gdalconstConstants.GDT_Byte) {\n if (!splitBands) {\n imgBuffer = new DataBufferByte(byteBands[0], nBands * pixels);\n } else {\n imgBuffer = new DataBufferByte(byteBands, pixels);\n }\n dataBufferType = DataBuffer.TYPE_BYTE;\n } else {\n ByteBuffer[] bands = new ByteBuffer[nBands];\n for (int k = 0; (splitBands && k < nBands) || (k < 1 && !splitBands); k++) {\n bands[k] = ByteBuffer.wrap(byteBands[k], 0, byteBands[k].length);\n }\n if (bufferType == gdalconstConstants.GDT_Int16 || bufferType == gdalconstConstants.GDT_UInt16) {\n if (!splitBands) {\n short[] shorts = new short[nBands * pixels];\n bands[0].order(ByteOrder.nativeOrder());\n final ShortBuffer buff = bands[0].asShortBuffer();\n buff.get(shorts, 0, nBands * pixels);\n if (bufferType == gdalconstConstants.GDT_Int16)\n imgBuffer = new DataBufferShort(shorts, nBands * pixels);\n else\n imgBuffer = new DataBufferUShort(shorts, nBands * pixels);\n } else {\n short[][] shorts = new short[nBands][];\n for (int i = 0; i < nBands; i++) {\n shorts[i] = new short[pixels];\n bands[i].order(ByteOrder.nativeOrder());\n bands[i].asShortBuffer().get(shorts[i], 0, pixels);\n }\n if (bufferType == gdalconstConstants.GDT_Int16)\n imgBuffer = new DataBufferShort(shorts, pixels);\n else\n imgBuffer = new DataBufferUShort(shorts, pixels);\n }\n if (bufferType == gdalconstConstants.GDT_UInt16)\n dataBufferType = DataBuffer.TYPE_USHORT;\n else\n dataBufferType = DataBuffer.TYPE_SHORT;\n } else if (bufferType == gdalconstConstants.GDT_Int32 || bufferType == gdalconstConstants.GDT_UInt32) {\n if (!splitBands) {\n int[] ints = new int[nBands * pixels];\n bands[0].order(ByteOrder.nativeOrder());\n final IntBuffer buff = bands[0].asIntBuffer();\n buff.get(ints, 0, nBands * pixels);\n imgBuffer = new DataBufferInt(ints, nBands * pixels);\n } else {\n int[][] ints = new int[nBands][];\n for (int i = 0; i < nBands; i++) {\n ints[i] = new int[pixels];\n bands[i].order(ByteOrder.nativeOrder());\n bands[i].asIntBuffer().get(ints[i], 0, pixels);\n }\n imgBuffer = new DataBufferInt(ints, pixels);\n }\n dataBufferType = DataBuffer.TYPE_INT;\n } else if (bufferType == gdalconstConstants.GDT_Float32) {\n if (!splitBands) {\n float[] floats = new float[nBands * pixels];\n bands[0].order(ByteOrder.nativeOrder());\n final FloatBuffer buff = bands[0].asFloatBuffer();\n buff.get(floats, 0, nBands * pixels);\n imgBuffer = new DataBufferFloat(floats, nBands * pixels);\n } else {\n float[][] floats = new float[nBands][];\n for (int i = 0; i < nBands; i++) {\n floats[i] = new float[pixels];\n bands[i].order(ByteOrder.nativeOrder());\n bands[i].asFloatBuffer().get(floats[i], 0, pixels);\n }\n imgBuffer = new DataBufferFloat(floats, pixels);\n }\n dataBufferType = DataBuffer.TYPE_FLOAT;\n } else if (bufferType == gdalconstConstants.GDT_Float64) {\n if (!splitBands) {\n double[] doubles = new double[nBands * pixels];\n bands[0].order(ByteOrder.nativeOrder());\n final DoubleBuffer buff = bands[0].asDoubleBuffer();\n buff.get(doubles, 0, nBands * pixels);\n imgBuffer = new DataBufferDouble(doubles, nBands * pixels);\n } else {\n double[][] doubles = new double[nBands][];\n for (int i = 0; i < nBands; i++) {\n doubles[i] = new double[pixels];\n bands[i].order(ByteOrder.nativeOrder());\n bands[i].asDoubleBuffer().get(doubles[i], 0, pixels);\n }\n imgBuffer = new DataBufferDouble(doubles, pixels);\n }\n dataBufferType = DataBuffer.TYPE_DOUBLE;\n } else {\n LOGGER.info(\"String_Node_Str\" + bufferType);\n }\n }\n if (splitBands)\n sampleModel = new BandedSampleModel(dataBufferType, dstWidth, dstHeight, dstWidth, banks, offsets);\n else\n sampleModel = new PixelInterleavedSampleModel(dataBufferType, dstWidth, dstHeight, nBands, dstWidth * nBands, offsets);\n } finally {\n if (pBand != null) {\n try {\n pBand.delete();\n } catch (Throwable e) {\n if (LOGGER.isLoggable(Level.FINEST))\n LOGGER.log(Level.FINEST, e.getLocalizedMessage(), e);\n }\n }\n if (dataset != null) {\n try {\n GDALUtilities.closeDataSet(dataset);\n } catch (Throwable e) {\n if (LOGGER.isLoggable(Level.FINEST))\n LOGGER.log(Level.FINEST, e.getLocalizedMessage(), e);\n }\n }\n }\n return Raster.createWritableRaster(sampleModel, imgBuffer, null);\n}\n"
|
"private String byteArrayToHexString(byte[] array) {\n StringBuilder hexString = new StringBuilder();\n for (byte b : array) {\n int intVal = b & 0xff;\n if (intVal < 0x10) {\n hexString.append('0');\n }\n hexString.append(Integer.toHexString(intVal));\n }\n return hexString.toString();\n}\n"
|
"private void computeRepNodeType(IRepositoryNode[] selectedRepositoryNodes, IRepositoryNode targetNode) throws PersistenceException {\n if (selectedRepositoryNodes != null) {\n for (IRepositoryNode sourceNode : selectedRepositoryNodes) {\n if (targetNode == sourceNode.getParent()) {\n continue;\n }\n if (isSameType(sourceNode, targetNode)) {\n if (sourceNode.getType() == ENodeType.REPOSITORY_ELEMENT) {\n if (sourceNode instanceof AnalysisRepNode) {\n moveAnalysisRepNode(sourceNode, targetNode);\n } else if (sourceNode instanceof ReportRepNode) {\n moveReportRepNode(sourceNode, targetNode);\n } else if (sourceNode instanceof DBConnectionRepNode) {\n moveConnectionRepNode(sourceNode, targetNode);\n } else if (sourceNode instanceof SysIndicatorDefinitionRepNode) {\n if (!((SysIndicatorDefinitionRepNode) sourceNode).isSystemIndicator()) {\n moveUDIRepNode(sourceNode, targetNode);\n }\n } else if (sourceNode instanceof PatternRepNode) {\n movePatternRepNode(sourceNode, targetNode);\n } else {\n moveCommonRepNode(sourceNode, targetNode);\n }\n } else if (sourceNode.getType() == ENodeType.SIMPLE_FOLDER) {\n moveFolderRepNode(sourceNode, targetNode);\n }\n closeEditorIfOpened(sourceNode);\n }\n }\n }\n}\n"
|
"private void processData() {\n String timeStampString = fData.get(CustomTraceDefinition.TAG_TIMESTAMP);\n String timeStampInputFormat = fData.get(TIMESTAMP_INPUT_FORMAT_KEY);\n Date date = null;\n if (timeStampInputFormat != null && timeStampString != null) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(timeStampInputFormat);\n try {\n date = dateFormat.parse(timeStampString);\n fOriginalTimestamp = fEffectiveTimestamp = new TmfTimestamp(date.getTime(), TIMESTAMP_SCALE);\n } catch (ParseException e) {\n fOriginalTimestamp = fEffectiveTimestamp = TmfTimestamp.Zero;\n }\n } else {\n fOriginalTimestamp = fEffectiveTimestamp = TmfTimestamp.Zero;\n }\n int i = 0;\n fColumnData = new String[fDefinition.outputs.size()];\n for (OutputColumn outputColumn : fDefinition.outputs) {\n String value = fData.get(outputColumn.name);\n if (outputColumn.name.equals(CustomTraceDefinition.TAG_TIMESTAMP) && date != null) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(fDefinition.timeStampOutputFormat);\n fColumnData[i++] = dateFormat.format(date);\n } else {\n fColumnData[i++] = (value != null ? value : \"String_Node_Str\");\n }\n }\n String message = fData.get(CustomTraceDefinition.TAG_MESSAGE);\n ;\n setContent(new TmfEventContent(this, message));\n fData = null;\n}\n"
|
"public void refresh() {\n if (selectedNode != null) {\n generatedCode = \"String_Node_Str\";\n boolean isJoblet = AbstractProcessProvider.isExtensionProcessForJoblet(selectedNode.getProcess());\n if (!isJoblet && PluginChecker.isJobLetPluginLoaded()) {\n IJobletProviderService jobletSservice = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);\n if (jobletSservice != null && jobletSservice.isJobletComponent(selectedNode)) {\n isJoblet = true;\n }\n }\n if (isJoblet) {\n document.set(generatedCode);\n return;\n }\n generatingNode = null;\n for (INode node : selectedNode.getProcess().getGeneratingNodes()) {\n if (node.getUniqueName().equals(selectedNode.getUniqueName())) {\n generatingNode = node;\n }\n }\n if (generatingNode == null) {\n document.set(Messages.getString(\"String_Node_Str\"));\n return;\n }\n if (codeGenerator == null) {\n ICodeGeneratorService service = DesignerPlugin.getDefault().getCodeGeneratorService();\n codeGenerator = service.createCodeGenerator();\n }\n viewStartAction.setChecked(false);\n viewMainAction.setChecked(false);\n viewEndAction.setChecked(false);\n viewAllAction.setChecked(false);\n switch(codeView) {\n case CODE_START:\n viewStartAction.setChecked(true);\n break;\n case CODE_MAIN:\n viewMainAction.setChecked(true);\n break;\n case CODE_END:\n viewEndAction.setChecked(true);\n break;\n case CODE_ALL:\n viewAllAction.setChecked(true);\n break;\n default:\n }\n synchronized (this) {\n Job job = new Job(Messages.getString(\"String_Node_Str\")) {\n protected IStatus run(IProgressMonitor monitor) {\n switch(codeView) {\n case CODE_START:\n try {\n generatedCode = codeGenerator.generateComponentCode(generatingNode, ECodePart.BEGIN);\n } catch (SystemException e) {\n ExceptionHandler.process(e);\n }\n break;\n case CODE_MAIN:\n try {\n generatedCode = codeGenerator.generateComponentCode(generatingNode, ECodePart.MAIN);\n } catch (SystemException e) {\n ExceptionHandler.process(e);\n }\n break;\n case CODE_END:\n try {\n generatedCode = codeGenerator.generateComponentCode(generatingNode, ECodePart.END);\n } catch (SystemException e) {\n ExceptionHandler.process(e);\n }\n break;\n case CODE_ALL:\n try {\n generatedCode = codeGenerator.generateComponentCode(generatingNode, ECodePart.BEGIN);\n } catch (SystemException e) {\n ExceptionHandler.process(e);\n }\n try {\n generatedCode += codeGenerator.generateComponentCode(generatingNode, ECodePart.MAIN);\n } catch (SystemException e) {\n ExceptionHandler.process(e);\n }\n try {\n generatedCode += codeGenerator.generateComponentCode(generatingNode, ECodePart.END);\n } catch (SystemException e) {\n e.printStackTrace();\n }\n break;\n default:\n }\n return org.eclipse.core.runtime.Status.OK_STATUS;\n }\n };\n job.setPriority(Job.INTERACTIVE);\n job.schedule();\n job.addJobChangeListener(new JobChangeAdapter() {\n public void done(IJobChangeEvent event) {\n new UIJob(\"String_Node_Str\") {\n public IStatus runInUIThread(IProgressMonitor monitor) {\n document.set(generatedCode);\n return org.eclipse.core.runtime.Status.OK_STATUS;\n }\n }.schedule();\n }\n });\n }\n}\n"
|
"public static void createStore(String fileName) {\n createEmptyStore(fileName, VERSION);\n NodeStore.createStore(fileName + \"String_Node_Str\");\n RelationshipStore.createStore(fileName + \"String_Node_Str\");\n PropertyStore.createStore(fileName + \"String_Node_Str\");\n RelationshipTypeStore.createStore(fileName + \"String_Node_Str\");\n NeoStore neoStore = new NeoStore(fileName);\n neoStore.nextId();\n neoStore.nextId();\n neoStore.nextId();\n long time = System.currentTimeMillis();\n neoStore.setCreationTime(time);\n neoStore.setRandomNumber(r.nextLong());\n neoStore.setVersion(0);\n neoStore.close();\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Permanent sourcePermanent = game.getPermanent(source.getSourceId());\n if (sourcePermanent != null) {\n int zcc = game.getState().getZoneChangeCounter(sourcePermanent.getId());\n if (zcc == source.getSourceObjectZoneChangeCounter() || zcc == source.getSourceObjectZoneChangeCounter() + 1) {\n Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));\n if (permanent != null) {\n return permanent.addAttachment(source.getSourceId(), game);\n } else {\n Player player = game.getPlayer(getTargetPointer().getFirst(game, source));\n if (player != null) {\n return player.addAttachment(source.getSourceId(), game);\n }\n if (!source.getTargets().isEmpty() && source.getTargets().get(0) instanceof TargetCard) {\n Card card = game.getCard(getTargetPointer().getFirst(game, source));\n if (card != null) {\n return card.addAttachment(source.getSourceId(), game);\n }\n }\n }\n }\n }\n return false;\n}\n"
|
"public NearCacheStatsImpl getNearCacheStats() {\n long ownedEntryCount = 0;\n long ownedEntryMemory = 0;\n for (NearCacheRecord record : cache.values()) {\n ownedEntryCount++;\n ownedEntryMemory += record.getCost();\n }\n stats.setOwnedEntryCount(ownedEntryCount);\n stats.setOwnedEntryMemoryCost(ownedEntryMemory);\n return stats;\n}\n"
|
"public void recordUncompressedFiles(ExtFile apkFile, Collection<String> uncompressedExtensions) throws AndrolibException {\n try {\n Directory unk = apkFile.getDirectory();\n Set<String> files = unk.getFiles(true);\n String ext;\n for (String file : files) {\n if (isAPKFileNames(file) && !NO_COMPRESS_PATTERN.matcher(file).find()) {\n if (unk.getCompressionLevel(file) == 0) {\n ext = FilenameUtils.getExtension(file);\n if (!uncompressedExtensions.contains(ext)) {\n uncompressedExtensions.add(ext);\n }\n }\n }\n }\n } catch (DirectoryException ex) {\n throw new AndrolibException(ex);\n }\n}\n"
|
"public Object getSidedGuiElement(boolean isClientSide, int guiId, EntityPlayer player, World world, int x, int y, int z) {\n switch(GuiIds.values()[guiId]) {\n case FOOD_CONTAINER:\n ItemStack heldItem = player.getHeldItem();\n if (heldItem != null && heldItem.getItem() instanceof ItemFoodContainer) {\n FoodContainerInventory foodContainerInventory = ((ItemFoodContainer) heldItem.getItem()).getInventory(heldItem);\n return isClientSide ? new GuiFoodContainer(player.inventory, foodContainerInventory) : new ContainerFoodContainer(player.inventory, foodContainerInventory);\n }\n break;\n default:\n break;\n }\n return null;\n}\n"
|
"public static void copy(final ParameterValueGroup values, final ParameterValueGroup destination) throws InvalidParameterNameException, InvalidParameterValueException {\n final Integer ZERO = 0;\n final Map<String, Integer> occurrences = new HashMap<>();\n for (final GeneralParameterValue value : values.values()) {\n final String name = value.getDescriptor().getName().getCode();\n if (value instanceof ParameterValueGroup) {\n final GeneralParameterDescriptor descriptor;\n descriptor = destination.getDescriptor().descriptor(name);\n if (descriptor instanceof ParameterDescriptorGroup) {\n final ParameterValueGroup groups = (ParameterValueGroup) descriptor.createValue();\n copy((ParameterValueGroup) value, groups);\n values.groups(name).add(groups);\n } else {\n throw new InvalidParameterNameException(Errors.format(Errors.Keys.UnexpectedParameter_1, name), name);\n }\n } else {\n final ParameterValue<?> source = (ParameterValue<?>) value;\n final ParameterValue<?> target;\n Integer occurrence = occurrences.get(name);\n if (occurrence == null) {\n occurrence = ONE;\n try {\n target = destination.parameter(name);\n } catch (ParameterNotFoundException cause) {\n throw new InvalidParameterNameException(Errors.format(Errors.Keys.UnexpectedParameter_1, name), cause, name);\n }\n } else {\n target = (ParameterValue<?>) getOrCreate(destination, name, occurrence);\n occurrence++;\n }\n occurrences.put(name, occurrence);\n final Object v = source.getValue();\n final Unit<?> unit = source.getUnit();\n if (unit == null) {\n target.setValue(v);\n } else if (v instanceof Number) {\n target.setValue(((Number) v).doubleValue(), unit);\n } else if (v instanceof double[]) {\n target.setValue((double[]) v, unit);\n } else {\n throw new InvalidParameterValueException(Errors.format(Errors.Keys.IllegalArgumentValue_2, name, v), name, v);\n }\n }\n }\n}\n"
|
"public static void initArtifacts() {\n Category.ARTIFACT.probs = INITIAL_ARTIFACT_PROBS;\n if (Ghost.Quest.processed)\n Category.ARTIFACT.probs[10] = 1;\n spawnedArtifacts = new ArrayList<String>();\n}\n"
|
"private static NativeLinkableNode processBuildRule(CxxPlatform cxxPlatform, Map<BuildTarget, Linker.LinkableDepType> wanted, BuildRule rule, Linker.LinkableDepType type, NativeLinkableNode.Pass pass) {\n if (!(rule instanceof NativeLinkable)) {\n return NativeLinkableNode.of(rule, pass);\n }\n NativeLinkable linkable = (NativeLinkable) rule;\n NativeLinkable.Linkage depLinkage = linkable.getPreferredLinkage(cxxPlatform);\n Linker.LinkableDepType depType;\n switch(depLinkage) {\n case STATIC:\n {\n depType = type == Linker.LinkableDepType.STATIC ? Linker.LinkableDepType.STATIC : Linker.LinkableDepType.STATIC_PIC;\n break;\n }\n case ANY:\n {\n depType = type;\n break;\n }\n default:\n {\n throw new IllegalStateException();\n }\n }\n if (pass == AbstractNativeLinkableNode.Pass.ANY || depType == Linker.LinkableDepType.SHARED) {\n Linker.LinkableDepType oldType = wanted.put(rule.getBuildTarget(), depType);\n Preconditions.checkState(oldType == null || oldType == depType);\n }\n if (depType == Linker.LinkableDepType.SHARED) {\n pass = AbstractNativeLinkableNode.Pass.SHARED_ONLY;\n }\n return NativeLinkableNode.of(rule, pass);\n}\n"
|
"public void load() {\n try {\n this.code = new String(Files.readAllBytes(this.toPath()), StandardCharsets.UTF_8);\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n}\n"
|
"private void createVersionFields(Composite parent) {\n GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);\n importFromVersion = new Button(parent, SWT.RADIO);\n importFromVersion.setText(Messages.getString(\"String_Node_Str\"));\n importFromVersion.setLayoutData(layoutData);\n Composite existVersionGroup = new Composite(parent, SWT.NONE);\n GridLayout existVersionLayout = new GridLayout();\n existVersionLayout.numColumns = 3;\n existVersionGroup.setLayout(existVersionLayout);\n existVersionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n distributionCombo = new LabelledCombo(existVersionGroup, Messages.getString(\"String_Node_Str\"), Messages.getString(\"String_Node_Str\"), new String[0], 2, true);\n distributionCombo.setVisibleItemCount(VISIBLE_DISTRIBUTION_COUNT);\n versionCombo = new LabelledCombo(existVersionGroup, Messages.getString(\"String_Node_Str\"), Messages.getString(\"String_Node_Str\"), new String[0], 2, true);\n versionCombo.setVisibleItemCount(VISIBLE_VERSION_COUNT);\n Composite checkParent = new Composite(existVersionGroup, SWT.NONE);\n layoutData = new GridData(GridData.FILL_HORIZONTAL);\n layoutData.horizontalSpan = 3;\n checkParent.setLayoutData(layoutData);\n GridLayout layout2 = new GridLayout(groupsAndDispaly.size(), false);\n checkParent.setLayout(layout2);\n layout2.marginWidth = 0;\n existVersionCheckBoxList = new ArrayList<Button>();\n for (ECustomVersionGroup group : groupsAndDispaly.keySet()) {\n final Button button = new Button(checkParent, SWT.CHECK);\n button.setData(group);\n button.setText(groupsAndDispaly.get(group));\n button.setSelection(true);\n existVersionCheckBoxList.add(button);\n existVersionSelectionMap.put(group, true);\n button.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent e) {\n existVersionSelectionMap.put((ECustomVersionGroup) button.getData(), button.getSelection());\n }\n });\n }\n importFromZipBtn = new Button(parent, SWT.RADIO);\n importFromZipBtn.setText(Messages.getString(\"String_Node_Str\"));\n layoutData = new GridData(GridData.FILL);\n importFromZipBtn.setLayoutData(layoutData);\n Composite zipGroup = new Composite(parent, SWT.NONE);\n layoutData = new GridData(GridData.FILL_HORIZONTAL);\n zipGroup.setLayoutData(layoutData);\n layout = new GridLayout();\n layout.numColumns = 3;\n layout.marginLeft = 10;\n zipGroup.setLayout(layout);\n Label label = new Label(zipGroup, SWT.NONE);\n label.setText(Messages.getString(\"String_Node_Str\"));\n zipLocationText = new Text(zipGroup, SWT.BORDER);\n zipLocationText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n browseButton = new Button(zipGroup, SWT.PUSH);\n browseButton.setText(Messages.getString(\"String_Node_Str\"));\n checkParent = new Composite(zipGroup, SWT.NONE);\n layoutData = new GridData(GridData.FILL_HORIZONTAL);\n layoutData.horizontalSpan = 3;\n checkParent.setLayoutData(layoutData);\n layout2 = new GridLayout(groupsAndDispaly.size(), false);\n checkParent.setLayout(layout2);\n layout2.marginWidth = 0;\n fromZipCheckBoxList = new ArrayList<Button>();\n for (ECustomVersionGroup group : groupsAndDispaly.keySet()) {\n final Button button = new Button(checkParent, SWT.CHECK);\n button.setData(group);\n button.setText(groupsAndDispaly.get(group));\n button.setSelection(true);\n fromZipCheckBoxList.add(button);\n fromZipSelectionMap.put(group, true);\n button.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent e) {\n fromZipSelectionMap.put((ECustomVersionGroup) button.getData(), button.getSelection());\n }\n });\n }\n importFromVersion.setSelection(true);\n enableZipGroupe(false);\n}\n"
|
"public static void applyFontStyles(Map<String, String> cssProps, ProcessorContext context, IStylesContainer stylesContainer, IPropertyContainer element) {\n float em = CssUtils.parseAbsoluteLength(cssProps.get(CssConstants.FONT_SIZE));\n float rem = context.getCssContext().getRootFontSize();\n if (em != 0) {\n element.setProperty(Property.FONT_SIZE, em);\n }\n if (cssProps.get(CssConstants.FONT_FAMILY) != null) {\n element.setProperty(Property.FONT, cssProps.get(CssConstants.FONT_FAMILY));\n }\n if (cssProps.get(CssConstants.FONT_WEIGHT) != null) {\n element.setProperty(Property.FONT_WEIGHT, cssProps.get(CssConstants.FONT_WEIGHT));\n }\n if (cssProps.get(CssConstants.FONT_STYLE) != null) {\n element.setProperty(Property.FONT_STYLE, cssProps.get(CssConstants.FONT_STYLE));\n }\n String cssColorPropValue = cssProps.get(CssConstants.COLOR);\n if (cssColorPropValue != null) {\n TransparentColor transparentColor;\n if (!CssConstants.TRANSPARENT.equals(cssColorPropValue)) {\n float[] rgbaColor = CssUtils.parseRgbaColor(cssColorPropValue);\n Color color = new DeviceRgb(rgbaColor[0], rgbaColor[1], rgbaColor[2]);\n float opacity = rgbaColor[3];\n transparentColor = new TransparentColor(color, opacity);\n } else {\n transparentColor = new TransparentColor(Color.BLACK, 0f);\n }\n element.setProperty(Property.FONT_COLOR, transparentColor);\n }\n String direction = cssProps.get(CssConstants.DIRECTION);\n if (CssConstants.RTL.equals(direction)) {\n element.setProperty(Property.BASE_DIRECTION, BaseDirection.RIGHT_TO_LEFT);\n element.setProperty(Property.TEXT_ALIGNMENT, TextAlignment.RIGHT);\n } else if (CssConstants.LTR.equals(direction)) {\n element.setProperty(Property.BASE_DIRECTION, BaseDirection.LEFT_TO_RIGHT);\n element.setProperty(Property.TEXT_ALIGNMENT, TextAlignment.LEFT);\n }\n if (stylesContainer instanceof IElementNode && ((IElementNode) stylesContainer).parentNode() instanceof IElementNode && CssConstants.RTL.equals(((IElementNode) ((IElementNode) stylesContainer).parentNode()).getStyles().get(CssConstants.DIRECTION))) {\n element.setProperty(Property.HORIZONTAL_ALIGNMENT, HorizontalAlignment.RIGHT);\n }\n String align = cssProps.get(CssConstants.TEXT_ALIGN);\n if (CssConstants.LEFT.equals(align)) {\n element.setProperty(Property.TEXT_ALIGNMENT, TextAlignment.LEFT);\n } else if (CssConstants.RIGHT.equals(align)) {\n element.setProperty(Property.TEXT_ALIGNMENT, TextAlignment.RIGHT);\n } else if (CssConstants.CENTER.equals(align)) {\n element.setProperty(Property.TEXT_ALIGNMENT, TextAlignment.CENTER);\n } else if (CssConstants.JUSTIFY.equals(align)) {\n element.setProperty(Property.TEXT_ALIGNMENT, TextAlignment.JUSTIFIED);\n element.setProperty(Property.SPACING_RATIO, 1f);\n }\n String textDecorationProp = cssProps.get(CssConstants.TEXT_DECORATION);\n if (textDecorationProp != null) {\n String[] textDecorations = textDecorationProp.split(\"String_Node_Str\");\n List<Underline> underlineList = new ArrayList<>();\n for (String textDecoration : textDecorations) {\n if (CssConstants.BLINK.equals(textDecoration)) {\n logger.error(LogMessageConstant.TEXT_DECORATION_BLINK_NOT_SUPPORTED);\n } else if (CssConstants.LINE_THROUGH.equals(textDecoration)) {\n underlineList.add(new Underline(null, .75f, 0, 0, 1 / 4f, PdfCanvasConstants.LineCapStyle.BUTT));\n } else if (CssConstants.OVERLINE.equals(textDecoration)) {\n underlineList.add(new Underline(null, .75f, 0, 0, 9 / 10f, PdfCanvasConstants.LineCapStyle.BUTT));\n } else if (CssConstants.UNDERLINE.equals(textDecoration)) {\n underlineList.add(new Underline(null, .75f, 0, 0, -1 / 10f, PdfCanvasConstants.LineCapStyle.BUTT));\n } else if (CssConstants.NONE.equals(textDecoration)) {\n underlineList = null;\n break;\n }\n }\n element.setProperty(Property.UNDERLINE, underlineList);\n }\n String textIndent = cssProps.get(CssConstants.TEXT_INDENT);\n if (textIndent != null) {\n UnitValue textIndentValue = CssUtils.parseLengthValueToPt(textIndent, em, rem);\n if (textIndentValue != null) {\n if (textIndentValue.isPointValue()) {\n element.setProperty(Property.FIRST_LINE_INDENT, textIndentValue.getValue());\n } else {\n logger.error(MessageFormat.format(LogMessageConstant.CSS_PROPERTY_IN_PERCENTS_NOT_SUPPORTED, CssConstants.TEXT_INDENT));\n }\n }\n }\n String letterSpacing = cssProps.get(CssConstants.LETTER_SPACING);\n if (letterSpacing != null && !letterSpacing.equals(CssConstants.NORMAL)) {\n UnitValue letterSpacingValue = CssUtils.parseLengthValueToPt(letterSpacing, em, rem);\n if (letterSpacingValue.isPointValue()) {\n element.setProperty(Property.CHARACTER_SPACING, letterSpacingValue.getValue());\n } else {\n }\n }\n String wordSpacing = cssProps.get(CssConstants.WORD_SPACING);\n if (wordSpacing != null) {\n UnitValue wordSpacingValue = CssUtils.parseLengthValueToPt(wordSpacing, em, rem);\n if (wordSpacingValue != null) {\n if (wordSpacingValue.isPointValue()) {\n element.setProperty(Property.WORD_SPACING, wordSpacingValue.getValue());\n } else {\n }\n }\n }\n String lineHeight = cssProps.get(CssConstants.LINE_HEIGHT);\n if (lineHeight != null && !CssConstants.NORMAL.equals(lineHeight)) {\n UnitValue lineHeightValue = CssUtils.parseLengthValueToPt(lineHeight, em, rem);\n if (CssUtils.isNumericValue(lineHeight)) {\n Float mult = CssUtils.parseFloat(lineHeight);\n if (mult != null) {\n element.setProperty(Property.LEADING, new Leading(Leading.MULTIPLIED, (float) mult));\n }\n } else {\n UnitValue lineHeightValue = CssUtils.parseLengthValueToPt(lineHeight, em, rem);\n if (lineHeightValue != null && lineHeightValue.isPointValue()) {\n element.setProperty(Property.LEADING, new Leading(Leading.FIXED, lineHeightValue.getValue()));\n } else if (lineHeightValue != null) {\n element.setProperty(Property.LEADING, new Leading(Leading.MULTIPLIED, lineHeightValue.getValue() / 100));\n }\n }\n } else {\n element.setProperty(Property.LEADING, new Leading(Leading.MULTIPLIED, 1.2f));\n }\n}\n"
|
"private boolean putDiskCache(String key, Bitmap bitmap) {\n if (bitmap == null)\n return false;\n OutputStream out = null;\n String ekey = toMD5(key);\n DiskLruCache.Snapshot snapshot = null;\n try {\n snapshot = mCache.get(ekey);\n if (snapshot == null) {\n DiskLruCache.Editor editor = mCache.edit(ekey);\n if (editor == null)\n return false;\n out = new BufferedOutputStream(editor.newOutputStream(0), IO_BUFFER_SIZE);\n Bitmap.CompressFormat format;\n if (key.endsWith(\"String_Node_Str\") || key.endsWith(\"String_Node_Str\")) {\n format = Bitmap.CompressFormat.PNG;\n } else if (SAFUtils.isICSOrHigher() && key.equals(\"String_Node_Str\")) {\n format = Bitmap.CompressFormat.WEBP;\n } else {\n format = Bitmap.CompressFormat.JPEG;\n }\n bitmap.compress(format, IMAGE_QUANLITY, out);\n editor.commit();\n mCache.flush();\n out.close();\n } else {\n snapshot.getInputStream(0).close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n IOUtils.closeQuietly(out);\n }\n return true;\n}\n"
|
"float standradWeight(float height){\n\treturn Math.max((height * 100) - 105, 0);\n}\n"
|
"public void testAddToRI1() {\n long expected = TEST_TIME_NOW;\n expected = ISOChronology.getInstanceUTC().years().add(expected, 1);\n expected = ISOChronology.getInstanceUTC().months().add(expected, 2);\n expected = ISOChronology.getInstanceUTC().weeks().add(expected, 3);\n expected = ISOChronology.getInstanceUTC().days().add(expected, 4);\n expected = ISOChronology.getInstanceUTC().hours().add(expected, 5);\n expected = ISOChronology.getInstanceUTC().minutes().add(expected, 6);\n expected = ISOChronology.getInstanceUTC().seconds().add(expected, 7);\n expected = ISOChronology.getInstanceUTC().millis().add(expected, 8);\n MutableDuration test = new MutableDuration(1, 2, 3, 4, 5, 6, 7, 8);\n Instant added = test.addTo(new Instant(), 1);\n assertEquals(expected, added.getMillis());\n}\n"
|
"public void testAvroFormattedStream() throws Exception {\n createStream(\"String_Node_Str\");\n Schema schema = Schema.recordOf(\"String_Node_Str\", Schema.Field.of(\"String_Node_Str\", Schema.of(Schema.Type.STRING)), Schema.Field.of(\"String_Node_Str\", Schema.of(Schema.Type.INT)), Schema.Field.of(\"String_Node_Str\", Schema.of(Schema.Type.DOUBLE)));\n FormatSpecification formatSpecification = new FormatSpecification(Formats.AVRO, schema, Collections.<String, String>emptyMap());\n StreamProperties properties = new StreamProperties(\"String_Node_Str\", Long.MAX_VALUE, formatSpecification);\n setStreamProperties(\"String_Node_Str\", properties);\n org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(schema.toString());\n sendStreamEvent(\"String_Node_Str\", createAvroEvent(avroSchema, \"String_Node_Str\", 5, 3.14));\n sendStreamEvent(\"String_Node_Str\", createAvroEvent(avroSchema, \"String_Node_Str\", 10, 2.34));\n sendStreamEvent(\"String_Node_Str\", createAvroEvent(avroSchema, \"String_Node_Str\", 1, 1.23));\n sendStreamEvent(\"String_Node_Str\", createAvroEvent(avroSchema, \"String_Node_Str\", 50, 45.67));\n sendStreamEvent(\"String_Node_Str\", createAvroEvent(avroSchema, \"String_Node_Str\", 100, 98.76));\n Double xPrice = 5 * 3.14 + 10 * 2.34;\n Double yPrice = 1.23;\n Double zPrice = 50 * 45.67 + 100 * 98.76;\n ExploreExecutionResult result = exploreClient.submit(\"String_Node_Str\" + \"String_Node_Str\").get();\n Assert.assertTrue(result.hasNext());\n Assert.assertEquals(Lists.newArrayList(new ColumnDesc(\"String_Node_Str\", \"String_Node_Str\", 1, null), new ColumnDesc(\"String_Node_Str\", \"String_Node_Str\", 2, null), new ColumnDesc(\"String_Node_Str\", \"String_Node_Str\", 3, null)), result.getResultSchema());\n List<Object> rowColumns = result.next().getColumns();\n Assert.assertEquals(\"String_Node_Str\", rowColumns.get(0).toString());\n Assert.assertEquals(150L, rowColumns.get(1));\n Assert.assertTrue(Math.abs(zPrice - (Double) rowColumns.get(2)) < 0.0000001);\n rowColumns = result.next().getColumns();\n Assert.assertEquals(\"String_Node_Str\", rowColumns.get(0).toString());\n Assert.assertEquals(15L, rowColumns.get(1));\n Assert.assertTrue(Math.abs(xPrice - (Double) rowColumns.get(2)) < 0.0000001);\n rowColumns = result.next().getColumns();\n Assert.assertEquals(\"String_Node_Str\", rowColumns.get(0).toString());\n Assert.assertEquals(1L, rowColumns.get(1));\n Assert.assertTrue(Math.abs(yPrice - (Double) rowColumns.get(2)) < 0.0000001);\n Assert.assertFalse(result.hasNext());\n}\n"
|
"public String[] getASMTransformerClass() {\n return new String[] { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" };\n}\n"
|
"private void initLoopEntry() {\n Map<String, LoopEntry> entryMap = new HashMap<String, LoopEntry>();\n FunctionRegister funcRegister = new FunctionRegister();\n Function function = null;\n if (this.loopPath.indexOf(\"String_Node_Str\") >= 0 && this.loopPath.indexOf(\"String_Node_Str\") >= 0) {\n if (nodePaths.length > 0) {\n String strTmp = loopPath.substring(loopPath.lastIndexOf(\"String_Node_Str\"));\n String strFuncName = strTmp.substring(strTmp.indexOf(\"String_Node_Str\") + 2, strTmp.indexOf(\"String_Node_Str\"));\n if (funcRegister.isFuncRegistered(strFuncName)) {\n function = funcRegister.getFunction(strFuncName);\n }\n }\n loopPath = loopPath.substring(0, loopPath.lastIndexOf(\"String_Node_Str\"));\n }\n for (int m = 0; m < nodePaths.length; m++) {\n String column = nodePaths[m];\n String resultCol = this.loopPath;\n boolean isAsXML = this.asXMLs[m];\n String tmpLoopPath = null;\n String[] splits = column.split(\"String_Node_Str\");\n for (String tmp : splits) {\n if (tmp.equals(\"String_Node_Str\")) {\n resultCol = resultCol.substring(0, resultCol.lastIndexOf(\"String_Node_Str\"));\n tmpLoopPath = resultCol;\n } else if (tmp.equals(\"String_Node_Str\")) {\n tmpLoopPath = resultCol;\n } else {\n if (tmp.indexOf(\"String_Node_Str\") >= 0 && tmp.indexOf(\"String_Node_Str\") >= 0) {\n resultCol = resultCol.substring(0, resultCol.lastIndexOf(\"String_Node_Str\"));\n tmpLoopPath = resultCol;\n String strFuncName = tmp.substring(tmp.indexOf(\"String_Node_Str\") + 2, tmp.indexOf(\"String_Node_Str\"));\n if (funcRegister.isFuncRegistered(strFuncName)) {\n function = funcRegister.getFunction(strFuncName);\n }\n } else {\n resultCol += \"String_Node_Str\" + tmp;\n }\n }\n }\n if (tmpLoopPath == null) {\n tmpLoopPath = loopPath;\n }\n if (!entryMap.containsKey(tmpLoopPath)) {\n entryMap.put(tmpLoopPath, new LoopEntry(tmpLoopPath));\n }\n if (function == null) {\n entryMap.get(tmpLoopPath).addPath(resultCol, column, isAsXML, isDot);\n } else {\n entryMap.get(tmpLoopPath).addPath(column, column, isAsXML);\n entryMap.get(tmpLoopPath).addFunction(column, function);\n function = null;\n }\n }\n String[] splits = loopPath.split(\"String_Node_Str\");\n String path = \"String_Node_Str\";\n LoopEntry tmpentry = null;\n for (String tmp : splits) {\n if (tmp.trim().length() > 0) {\n path += \"String_Node_Str\" + tmp;\n if (entryMap.containsKey(path)) {\n if (tmpentry == null) {\n tmpentry = entryMap.get(path);\n this.entry = tmpentry;\n } else {\n tmpentry.setSubLoop(entryMap.get(path));\n tmpentry = entryMap.get(path);\n }\n }\n }\n }\n}\n"
|
"public RepeatStatus executeStep(ChunkContext chunkContext, JobExecutionStatusHolder jobExecutionStatusHolder) throws Exception {\n String clusterName = getJobParameters(chunkContext).getString(JobConstants.CLUSTER_NAME_JOB_PARAM);\n boolean success = clusteringService.setAutoElasticity(clusterName, refreshAllNodes);\n putIntoJobExecutionContext(chunkContext, JobConstants.CLUSTER_EXISTING_NODES_JOB_PARAM, success);\n if (!success) {\n throw TaskException.EXECUTION_FAILED(\"String_Node_Str\" + clusterName + \"String_Node_Str\");\n }\n return RepeatStatus.FINISHED;\n}\n"
|
"private void constructHittingSetTree(OWLDescription unsatClass, Set<OWLAxiom> mups, Set<Set<OWLAxiom>> allMups, Set<Set<OWLAxiom>> satPaths, Set<OWLAxiom> currentPathContents, int maxExplanations) throws OWLException {\n logger.debug(\"String_Node_Str\" + allMups.size() + \"String_Node_Str\" + mups);\n if (progressMonitor.isCancelled()) {\n return;\n }\n List<OWLAxiom> orderedMups = getOrderedMUPS(new ArrayList<OWLAxiom>(mups), allMups);\n while (!orderedMups.isEmpty()) {\n if (progressMonitor.isCancelled()) {\n return;\n }\n OWLAxiom axiom = orderedMups.get(0);\n orderedMups.remove(0);\n if (allMups.size() == maxExplanations) {\n if (log.isLoggable(Level.FINE))\n log.fine(\"String_Node_Str\" + maxExplanations + \"String_Node_Str\");\n return;\n }\n if (log.isLoggable(Level.FINE))\n log.fine(\"String_Node_Str\" + axiom + \"String_Node_Str\" + currentPathContents.size() + \"String_Node_Str\" + currentPathContents);\n Set<OWLOntology> ontologies = OntologyUtils.removeAxiom(axiom, getReasoner().getLoadedOntologies(), getOntologyManager());\n Set<OWLEntity> sig = getSignature(axiom);\n List<OWLDeclarationAxiom> temporaryDeclarations = new ArrayList<OWLDeclarationAxiom>(sig.size());\n for (OWLEntity e : sig) {\n boolean referenced = false;\n for (Iterator<OWLOntology> i = ontologies.iterator(); !referenced && i.hasNext(); ) {\n for (Iterator<OWLAxiom> j = i.next().getReferencingAxioms(e).iterator(); !referenced && j.hasNext(); ) {\n OWLAxiom a = j.next();\n referenced = a.isLogicalAxiom() || (a instanceof OWLDeclarationAxiom);\n }\n }\n if (!referenced) {\n OWLDeclarationAxiom declaration = getOntologyManager().getOWLDataFactory().getOWLDeclarationAxiom(e);\n temporaryDeclarations.add(declaration);\n }\n }\n for (OWLDeclarationAxiom decl : temporaryDeclarations) {\n OntologyUtils.addAxiom(decl, getReasoner().getLoadedOntologies(), getOntologyManager());\n }\n currentPathContents.add(axiom);\n boolean earlyTermination = false;\n for (Set<OWLAxiom> satPath : satPaths) {\n if (currentPathContents.containsAll(satPath)) {\n earlyTermination = true;\n if (log.isLoggable(Level.FINE))\n log.fine(\"String_Node_Str\");\n break;\n }\n }\n if (!earlyTermination) {\n Set<OWLAxiom> newMUPS = null;\n for (Set<OWLAxiom> foundMUPS : allMups) {\n Set<OWLAxiom> foundMUPSCopy = new HashSet<OWLAxiom>(foundMUPS);\n foundMUPSCopy.retainAll(currentPathContents);\n if (foundMUPSCopy.isEmpty()) {\n newMUPS = foundMUPS;\n break;\n }\n }\n if (newMUPS == null) {\n newMUPS = getExplanation(unsatClass);\n }\n if (newMUPS.contains(axiom)) {\n throw new OWLRuntimeException(\"String_Node_Str\" + axiom);\n }\n if (!newMUPS.isEmpty()) {\n allMups.add(newMUPS);\n progressMonitor.foundExplanation(newMUPS);\n constructHittingSetTree(unsatClass, newMUPS, allMups, satPaths, currentPathContents, maxExplanations);\n orderedMups = getOrderedMUPS(orderedMups, allMups);\n } else {\n if (log.isLoggable(Level.FINE))\n log.fine(\"String_Node_Str\");\n satPaths.add(new HashSet<OWLAxiom>(currentPathContents));\n }\n }\n currentPathContents.remove(axiom);\n if (log.isLoggable(Level.FINE))\n log.fine(\"String_Node_Str\" + axiom);\n for (OWLDeclarationAxiom decl : temporaryDeclarations) {\n OntologyUtils.removeAxiom(decl, getReasoner().getLoadedOntologies(), getOntologyManager());\n }\n OntologyUtils.addAxiom(axiom, ontologies, getOntologyManager());\n }\n}\n"
|
"public static String getName(UUID uuid) {\n if (uuidExists(uuid)) {\n return loopSearch(uuid);\n }\n String name;\n if ((name = getNameOnlinePlayer(uuid)) != null) {\n return name;\n }\n if ((name = getNameOfflinePlayer(uuid)) != null) {\n return name;\n }\n if (online) {\n try {\n NameFetcher fetcher = new NameFetcher(Arrays.asList(uuid));\n name = fetcher.call().get(uuid);\n add(name, uuid);\n return name;\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n return \"String_Node_Str\";\n }\n return \"String_Node_Str\";\n}\n"
|
"public boolean isCompliant(DataSet dataSet, int numVariables, int numCategoricalVariables) {\n return numVariables >= 2 && numVariables == numCategoricalVariables;\n}\n"
|
"public Cipher encryptstream() throws Exception {\n Cipher c = Cipher.getInstance(mode);\n c.init(Cipher.ENCRYPT_MODE, aesKey);\n return c;\n}\n"
|
"public void getTypedCache() {\n CacheManager cacheManager = getCacheManager();\n MutableConfiguration<String, Long> config = new MutableConfiguration<String, Long>().setTypes(String.class, Long.class);\n cacheManager.configureCache(\"String_Node_Str\", config);\n Cache<String, Long> cache = cacheManager.getCache(\"String_Node_Str\", String.class, Long.class);\n assertNotNull(cache);\n assertEquals(String.class, cache.getConfiguration().getKeyType());\n assertEquals(Long.class, cache.getConfiguration().getValueType());\n}\n"
|
"public boolean setLockModeType(String lockModeType, AbstractSession session) {\n if (lockModeType != null) {\n OptimisticLockingPolicy lockingPolicy = session.getDescriptor(getReferenceClass()).getOptimisticLockingPolicy();\n if (lockingPolicy == null || !(lockingPolicy instanceof VersionLockingPolicy)) {\n if (!lockModeType.equals(PESSIMISTIC_READ) && !lockModeType.equals(PESSIMISTIC_WRITE) && !lockModeType.equals(NONE)) {\n return true;\n }\n }\n this.lockModeType = lockModeType;\n setIsPrePrepared(false);\n setIsPrepared(false);\n setWasDefaultLockMode(false);\n }\n return false;\n}\n"
|
"public static List<Interval> invert(Collection<Interval> intervals) {\n Interval remainder = new Interval(Integer.MIN_VALUE, Integer.MAX_VALUE);\n Set<Interval> sorted = new TreeSet(union(intervals));\n List<Interval> result = new ArrayList<>();\n for (Interval i : sorted) {\n if (i.isAll()) {\n return Collections.singletonList(Interval.none());\n }\n if (i.a <= remainder.a) {\n if (i.b > remainder.a)\n remainder.a = i.b != Integer.MAX_VALUE ? i.b + 1 : i.b;\n } else {\n result.add(new Interval(remainder.a, i.a - 1));\n if (i.b < remainder.b) {\n remainder.a = i.b != Integer.MAX_VALUE ? i.b + 1 : i.b;\n } else {\n remainder = null;\n break;\n }\n }\n }\n if (remainder != null) {\n result.add(remainder);\n }\n return result;\n}\n"
|
"public boolean isGeometry() {\n return (dbLink == null || dbLink.getDatatype() == null || dbLink.getDatatype().isUnknown() || dbLink.getDatatype().isGeometry());\n}\n"
|
"public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {\n Item item = submission.getItem();\n Collection collection = submission.getCollection();\n String actionURL = contextPath + \"String_Node_Str\" + collection.getHandle() + \"String_Node_Str\" + knot.getId() + \"String_Node_Str\";\n Request request = ObjectModelHelper.getRequest(objectModel);\n boolean https = request.isSecure();\n String server = request.getServerName();\n int port = request.getServerPort();\n String exitURL = (https) ? \"String_Node_Str\" : \"String_Node_Str\";\n exitURL += server;\n if (!(port == 80 || port == 443))\n exitURL += \"String_Node_Str\" + port;\n exitURL += actionURL + \"String_Node_Str\" + knot.getId() + \"String_Node_Str\";\n Division div = body.addDivision(\"String_Node_Str\", \"String_Node_Str\");\n div.setHead(T_submission_head);\n Division progressDiv = div.addInteractiveDivision(\"String_Node_Str\", actionURL, Division.METHOD_POST);\n addSubmissionProgressList(progressDiv);\n progressDiv.addHidden(\"String_Node_Str\").setValue(knot.getId());\n Division offsiteDiv = div.addInteractiveDivision(\"String_Node_Str\", CREATIVE_COMMONS_URL, Division.METHOD_POST);\n offsiteDiv.setHead(T_head);\n offsiteDiv.addPara(T_info1);\n offsiteDiv.addHidden(\"String_Node_Str\").setValue(knot.getId());\n offsiteDiv.addHidden(\"String_Node_Str\").setValue(\"String_Node_Str\");\n offsiteDiv.addHidden(\"String_Node_Str\").setValue(exitURL);\n Para ccPara = offsiteDiv.addPara(\"String_Node_Str\", \"String_Node_Str\");\n ccPara.addButton(\"String_Node_Str\").setValue(T_submit_to_creative_commons);\n Division onsiteDiv = div.addInteractiveDivision(\"String_Node_Str\", actionURL, Division.METHOD_POST);\n List form = onsiteDiv.addList(\"String_Node_Str\", List.TYPE_FORM);\n form.addLabel(T_license);\n if (CreativeCommons.hasLicense(context, item)) {\n String url = CreativeCommons.getLicenseURL(item);\n form.addItem().addXref(url, url);\n form.addItem().addButton(\"String_Node_Str\").setValue(T_submit_remove);\n form.addItem().addHidden(\"String_Node_Str\").setValue(url);\n } else {\n form.addItem().addHighlight(\"String_Node_Str\").addContent(T_no_license);\n }\n addControlButtons(form);\n onsiteDiv.addHidden(\"String_Node_Str\").setValue(knot.getId());\n}\n"
|
"public void testPeristingEvents() {\n provider = new JdbcChannelProviderImpl();\n provider.initialize(derbyProps);\n Map<String, List<MockEvent>> eventMap = new HashMap<String, List<MockEvent>>();\n Set<MockEvent> events = new HashSet<MockEvent>();\n for (int i = 1; i < 1001; i++) {\n events.add(MockEventUtils.generateMockEvent(i, i, i, 61 % i, 5));\n }\n Iterator<MockEvent> meIt = events.iterator();\n while (meIt.hasNext()) {\n MockEvent me = meIt.next();\n String chName = me.getChannel();\n List<MockEvent> eventList = eventMap.get(chName);\n if (eventList == null) {\n eventList = new ArrayList<MockEvent>();\n eventMap.put(chName, eventList);\n }\n eventList.add(me);\n provider.persistEvent(me.getChannel(), me);\n }\n for (String chName : eventMap.keySet()) {\n List<MockEvent> meList = eventMap.get(chName);\n Iterator<MockEvent> it = meList.iterator();\n while (it.hasNext()) {\n MockEvent me = it.next();\n Event event = provider.removeEvent(chName);\n assertEquals(me, event);\n }\n Event nullEvent = provider.removeEvent(chName);\n Assert.assertNull(nullEvent);\n }\n provider.close();\n provider = null;\n}\n"
|
"void startMonitoringRoutes(Context appContext) {\n mDefaultAudioVideo = new RouteInfo(mSystemCategory);\n mDefaultAudioVideo.mNameResId = com.android.internal.R.string.default_audio_route_name;\n mDefaultAudioVideo.mSupportedTypes = ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_LIVE_VIDEO;\n mDefaultAudioVideo.updatePresentationDisplay();\n addRouteStatic(mDefaultAudioVideo);\n updateWifiDisplayStatus(mDisplayService.getWifiDisplayStatus());\n appContext.registerReceiver(new WifiDisplayStatusChangedReceiver(), new IntentFilter(DisplayManager.ACTION_WIFI_DISPLAY_STATUS_CHANGED));\n appContext.registerReceiver(new VolumeChangeReceiver(), new IntentFilter(AudioManager.VOLUME_CHANGED_ACTION));\n mDisplayService.registerDisplayListener(this, mHandler);\n AudioRoutesInfo newAudioRoutes = null;\n try {\n newAudioRoutes = mAudioService.startWatchingRoutes(mAudioRoutesObserver);\n } catch (RemoteException e) {\n }\n if (newAudioRoutes != null) {\n updateAudioRoutes(newAudioRoutes);\n }\n rebindAsUser(UserHandle.myUserId());\n if (mSelectedRoute == null) {\n selectDefaultRouteStatic();\n }\n}\n"
|
"public MessageProducer createProducer(final PartitionSelector partitionSelector, final boolean ordered) {\n if (partitionSelector == null) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n return this.addChild(new SimpleMessageProducer(this, this.remotingClient, partitionSelector, this.producerZooKeeper, this.sessionIdGenerator.generateId()));\n}\n"
|
"private void NotifyDownloadFinished() {\n if (imageDownloadFinished != null)\n imageDownloadFinished.DownloadFinished(ThreadId, bitmap);\n}\n"
|
"public void logIt(String[] s, int type, String messageName, Hashtable ssoProperties) {\n LogMessageProviderBase provider = null;\n if (logStatus && (s != null)) {\n try {\n provider = (LogMessageProviderBase) MessageProviderFactory.getProvider(\"String_Node_Str\");\n com.sun.identity.log.LogRecord lr = null;\n SSOToken ssot = AccessController.doPrivileged(AdminTokenAction.getInstance());\n if (ssoProperties == null) {\n lr = provider.createLogRecord(messageName, s, ssot);\n } else {\n lr = provider.createLogRecord(messageName, s, ssoProperties);\n }\n com.sun.identity.log.Logger logger;\n switch(type) {\n case LOG_ACCESS:\n logger = (com.sun.identity.log.Logger) Logger.getLogger(\"String_Node_Str\");\n logger.log(lr, ssot);\n break;\n case LOG_ERROR:\n logger = (com.sun.identity.log.Logger) Logger.getLogger(\"String_Node_Str\");\n logger.log(lr, ssot);\n break;\n default:\n logger = (com.sun.identity.log.Logger) Logger.getLogger(\"String_Node_Str\");\n logger.log(lr, ssot);\n break;\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n debug.error(\"String_Node_Str\" + ex.getMessage());\n }\n }\n initializeAuditor();\n String orgName = (String) ssoProperties.get(\"String_Node_Str\");\n String realmName = DNMapper.orgNameToRealmName(orgName);\n boolean isAuditing = false;\n if (isAuthenticationOnlyEvent(messageName)) {\n if (auditor.isAuditing(realmName, AuditConstants.AUTHENTICATION_TOPIC)) {\n isAuditing = true;\n }\n }\n if (isActivityOnlyEvent(messageName)) {\n if (auditor.isAuditing(realmName, AuditConstants.ACTIVITY_TOPIC)) {\n isAuditing = true;\n }\n }\n if (isAuditing) {\n if (!auditor.isLogoutEvent(messageName)) {\n String description = null;\n if (provider != null) {\n description = provider.getAllHashMessageIDs().get(messageName).getDescription();\n }\n String userName = (String) ssoProperties.get(\"String_Node_Str\");\n String contextID = (String) ssoProperties.get(LogConstants.CONTEXT_ID);\n String LoginIDSid = (String) ssoProperties.get(LogConstants.LOGIN_ID_SID);\n Set<String> trackingIds = null;\n if (StringUtils.isNotEmpty(contextID)) {\n trackingIds = new HashSet<>();\n trackingIds.add(contextID);\n }\n if (StringUtils.isNotEmpty(LoginIDSid)) {\n InternalSession session = AuthD.getSession(new SessionID(LoginIDSid));\n String sessionContext;\n if (session != null) {\n if (trackingIds == null) {\n trackingIds = new HashSet<>();\n }\n sessionContext = session.getProperty(Constants.AM_CTX_ID);\n trackingIds.add(sessionContext);\n }\n }\n AMIdentity identity = null;\n if (StringUtils.isNotEmpty(userName) && StringUtils.isNotEmpty(realmName)) {\n identity = IdUtils.getIdentity(userName, realmName);\n }\n String authentication = null;\n String principal;\n if (identity != null) {\n authentication = identity.getUniversalId();\n if (contextID != null) {\n principal = getPrincipalFromUniversalId(identity.getName());\n } else {\n principal = identity.getName();\n }\n } else {\n principal = userName;\n }\n String moduleName = (String) ssoProperties.get(\"String_Node_Str\");\n AuthenticationAuditEventBuilder.Status result = null;\n List<AuthenticationAuditEntry> entries = null;\n if (StringUtils.isNotEmpty(moduleName)) {\n Map<String, String> info = null;\n String ip = (String) ssoProperties.get(LogConstants.IP_ADDR);\n if (StringUtils.isNotEmpty(ip)) {\n info = new HashMap<>();\n info.put(IP_ADDRESS.toString(), ip);\n }\n if (StringUtils.isNotEmpty(description)) {\n if (info == null) {\n info = new HashMap<>();\n }\n info.put(EVENT_DATA.toString(), description);\n }\n AuthenticationAuditEntry authenticationAuditEntry = new AuthenticationAuditEntry();\n authenticationAuditEntry.setModuleId(moduleName);\n messageName = AM_LOGIN_CHAIN_COMPLETED.toString();\n if (info != null) {\n authenticationAuditEntry.setInfo(info);\n }\n entries = Collections.singletonList(authenticationAuditEntry);\n if (contextID == null) {\n result = FAILED;\n } else {\n result = SUCCESSFUL;\n }\n }\n auditor.audit(messageName, AuditRequestContext.getTransactionIdValue(), authentication, principal, realmName, trackingIds, entries, result);\n }\n }\n}\n"
|
"protected void closeComplex() throws IOException {\n writer.write(FormattedWriterRecord.CR);\n for (int x = 0; x < numberOfTabs; x++) {\n writeValue(tab(), false);\n }\n writer.write('}');\n}\n"
|
"public static int convertBorderWeight(int width) {\n int w = -1;\n if (width <= 750) {\n w = 1;\n } else if (width >= 1499 && width < 2249) {\n w = 2;\n } else if (width >= 2249) {\n w = 3;\n } else {\n w = 2;\n }\n return w;\n}\n"
|
"public List<ScriptPack> getScriptPacks(String packagePrefix) {\n List<ScriptPack> ret = new ArrayList<>();\n for (int i = 0; i < script_info.size(); i++) {\n ret.addAll(script_info.get(i).getPacks(this, i, packagePrefix, allAbcs));\n }\n return ret;\n}\n"
|
"public int getNodeIndex() {\n return nodeIndex;\n}\n"
|
"public boolean isAllowed(Point2D p) {\n Map map = ModelManager.getBattlefield().getMap();\n if (distFromCliff > 0) {\n boolean hasCliff = false;\n for (Tile t : map.getInCircle(p, distFromCliff)) {\n if (t.hasCliff()) {\n hasCliff = true;\n break;\n }\n }\n if (!hasCliff) {\n return false;\n }\n }\n if (slopeMin > 0 || slopeMax > 0) {\n double dist = map.getNormalVectorAt(p).get2D().getLength();\n double angle = AngleUtil.RIGHT - new Point2D(dist, 1).getAngle();\n if (slopeMin > 0 && angle < AngleUtil.toRadians(slopeMin)) {\n return false;\n }\n if (slopeMax > 0 && angle > AngleUtil.toRadians(slopeMax)) {\n return false;\n }\n }\n if (!textures.isEmpty()) {\n int i = 0;\n for (String s : textures) {\n AtlasLayer l;\n int texIndex = Integer.parseInt(s);\n if (texIndex >= 8)\n l = map.getCover().getLayers().get(texIndex - 8);\n else\n l = map.getAtlas().getLayers().get(texIndex);\n if (l.getInAtlasSpace(p) < textureMin.get(i) * 255 || l.getInAtlasSpace(p) > textureMax.get(i) * 255) {\n return false;\n }\n i++;\n }\n }\n return true;\n}\n"
|
"protected Void body() throws Exception {\n ConfigSpecImpl newConfigSpec = new ConfigSpecImpl();\n if (cpuNumber > 0) {\n newConfigSpec.setNumCPUs(cpuNumber);\n }\n if (memory > 0) {\n VmConfigUtil.setMemoryAndBalloon(newConfigSpec, memory);\n if (targetDs != null) {\n VirtualDisk vmSwapDisk = VcVmUtil.findVirtualDisk(vmId, swapDisk.getExternalAddress());\n logger.info(\"String_Node_Str\" + swapDisk.getDatastoreName());\n logger.info(\"String_Node_Str\" + targetDs.getName());\n vcVm.detachVirtualDisk(new DeviceId(swapDisk.getExternalAddress()), true);\n AllocationType allocType = swapDisk.getAllocType() == null ? null : AllocationType.valueOf(swapDisk.getAllocType());\n DiskCreateSpec[] addDisks = { new DiskCreateSpec(new DeviceId(swapDisk.getExternalAddress()), targetDs, swapDisk.getName(), DiskMode.independent_persistent, DiskSize.sizeFromMB(newSwapSizeInMB), allocType) };\n vcVm.changeDisks(null, addDisks);\n }\n }\n vcVm.reconfigure(newConfigSpec);\n return null;\n}\n"
|
"private IDiskArray getDimFilterPositions(List dimFilterList) throws IOException, DataException {\n IDiskArray result = new BufferedPrimitiveDiskArray(Math.min(dimPosition.size(), Constants.LIST_BUFFER_SIZE));\n for (int i = 0; i < dimPosition.size(); i++) {\n Integer pos = (Integer) dimPosition.get(i);\n if (isDimPositionSelected(pos.intValue(), dimFilterList))\n result.add(pos);\n }\n return result;\n}\n"
|
"public Set<Utilization> findLatestUtilization(long facilityId) {\n final Facility facility = getFacility(facilityId);\n final Map<CapacityType, Set<Usage>> usagesByCapacityType = FacilityUtil.usagesByCapacityType(facility);\n return utilizationRepository.findLatestUtilization(facilityId).stream().filter(u -> usagesByCapacityType.getOrDefault(u.capacityType, emptySet()).contains(u.usage)).filter(u -> facility.builtCapacity.getOrDefault(u.capacityType, 0) > 0).collect(toSet());\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.