Unnamed: 0
int64
0
9.45k
cwe_id
stringclasses
1 value
source
stringlengths
37
2.53k
target
stringlengths
19
2.4k
700
private void updateSearchStatus(Model model, List<PriceBean> priceBeans, Locale locale){ if (priceBeans != null && !priceBeans.isEmpty()) { Integer count = new Integer(priceBeans.size()); model.addAttribute(MVCConstants.SUCCESS, messageSource.getMessage("commerce.screen.common.search.success", nu...
private void updateSearchStatus(Model model, List<PriceBean> priceBeans, Locale locale){ if (priceBeans != null && !priceBeans.isEmpty()) { model.addAttribute(MVCConstants.SUCCESS, messageSource.getMessage("commerce.screen.common.search.success", null, locale)); logger.info("The retrieved price r...
701
public void addViewControllers(ViewControllerRegistry registry){ registry.addViewController("/FixMsgGenerator").setViewName("FixMsgGenerator"); registry.addViewController("/FixBlotterApp").setViewName("FixBlotterApp"); registry.addViewController("/login").setViewName("login"); }
public void addViewControllers(ViewControllerRegistry registry){ registry.addViewController("/FixWebUI").setViewName("FixWebUI"); registry.addViewController("/login").setViewName("login"); }
702
private void setScrollBehavior(final FloatingActionButton fab, final RecyclerView rv){ rv.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public final void onScrolled(RecyclerView recyclerView, int dx, int dy) { if (Build.VERSION.SDK_INT < 14) { ...
private void setScrollBehavior(final FloatingActionButton fab, final RecyclerView rv){ rv.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public final void onScrolled(RecyclerView recyclerView, int dx, int dy) { if (Build.VERSION.SDK_INT < 14) { ...
703
public void onItemClick(AdapterView<?> parent, View view, int position, long id){ try { appSession.setData("whocallme", "contact"); Contact contact = new ContactImpl(); contact.setRemoteActorPublicKey(contactid.get(position)); contact.setAlias(contactname.get(position)); ...
public void onItemClick(AdapterView<?> parent, View view, int position, long id){ try { appSession.setData("whocallme", "contact"); appSessionSetDataContact(position); changeActivity(Activities.CHT_CHAT_OPEN_MESSAGE_LIST, appSession.getAppPublicKey()); } catch (Exception e) { ...
704
private Image getImage(Task task, GoogleNamedAccountCredentials credentials) throws IOException{ task.updateStatus(BASE_PHASE, "Looking up image " + description.getBootImage()); Images imagesApi = computeApiFactory.createImages(credentials); SettableFuture<Image> foundImage = SettableFuture.create(); ...
private Image getImage(Task task, GoogleNamedAccountCredentials credentials) throws IOException{ task.updateStatus(BASE_PHASE, "Looking up image " + description.getBootImage()); Images imagesApi = computeApiFactory.createImages(credentials); GetFirstBatchComputeRequest<Compute.Images.Get, Image> batchReq...
705
protected UUID execute(){ try { HdfsFileStatus fileStatus = dfsClient.getFileInfo(filePath); if (fileStatus == null) { resultOut.println("ReadFile Action fails, file doesn't exist!"); } DFSInputStream dfsInputStream = dfsClient.open(filePath); byte[] buffer...
protected void execute(){ try { HdfsFileStatus fileStatus = dfsClient.getFileInfo(filePath); if (fileStatus == null) { resultOut.println("ReadFile Action fails, file doesn't exist!"); } DFSInputStream dfsInputStream = dfsClient.open(filePath); byte[] buffer...
706
public byte[] encryptText(byte[] plainText, byte[] key) throws Exception{ setRcon(); byte[] cipher; this.word = expandKey(key); byte[] roundKey = getRoundKey(0); cipher = XORBytes(plainText, roundKey); for (int i = 1; i < ROUNDS; i++) { cipher = subBytes(cipher); cipher =...
public byte[] encryptText(byte[] plainText, byte[] key) throws Exception{ setRcon(); this.word = expandKey(key); byte[] roundKey = getRoundKey(0); byte[] cipher = XOR(plainText, roundKey); for (int i = 1; i < ROUNDS; i++) { cipher = substituteBytes(cipher); cipher = shiftRows(...
707
public FxNode eval(FxChildWriter dest, FxEvalContext ctx, FxNode src){ FxObjNode srcObj = (FxObjNode) src; boolean expr = FxNodeValueUtils.getBooleanOrThrow(srcObj, "expr"); FxNode templateNode; if (expr) { templateNode = srcObj.get("then"); } else { templateNode = srcObj.get(...
public void eval(FxChildWriter dest, FxEvalContext ctx, FxNode src){ FxObjNode srcObj = (FxObjNode) src; boolean expr = FxNodeValueUtils.getBooleanOrThrow(srcObj, "expr"); FxNode templateNode; if (expr) { templateNode = srcObj.get("then"); } else { templateNode = srcObj.get("e...
708
public void mouseReleased(MouseEvent _e){ Object[] array_ = grList.toArray(); boolean sel_ = SwingUtilities.isLeftMouseButton(_e); if (!_e.isShiftDown()) { grList.setFirstIndex(index); grList.setLastIndex(index); CustCellRender r_ = grList.getRender(); Object v_ = arra...
public void mouseReleased(MouseEvent _e){ boolean sel_ = SwingUtilities.isLeftMouseButton(_e); if (!_e.isShiftDown()) { grList.setFirstIndex(index); grList.setLastIndex(index); CustCellRender<T> r_ = grList.getRender(); T v_ = grList.getList().get(index); PreparedL...
709
public boolean removeGoodFromBasket(String userId, String goodId){ Transaction transaction = transactionManager.createTransaction(); try { Long longUserId = Long.parseLong(userId); long longGoodId = Long.parseLong(goodId); Optional<Basket> basketOptional = userDao.findBasketByUserId...
public boolean removeGoodFromBasket(String userId, String goodId){ Transaction transaction = transactionManager.createTransaction(); try { Long longUserId = Long.parseLong(userId); long longGoodId = Long.parseLong(goodId); Optional<Basket> basketOptional = userDao.findBasketByUserId...
710
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_messenger); messageList = new ArrayList<>(); chatList = new ArrayList<>(); newMessage = (RecyclerView) findViewById(R.id.newMessage); layoutManager = new LinearLayoutMan...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_messenger); mNewMessageView = (RecyclerView) findViewById(R.id.newMessage); mNewMessageAdapter = new MessageAdapter(this, mNewMessageList); RecyclerView.LayoutManager newMess...
711
public void testReadRegression(){ PMML pmml = buildDummyRegressionModel(); Pair<DecisionForest, CategoricalValueEncodings> forestAndEncodings = RDFPMMLUtils.read(pmml); DecisionForest forest = forestAndEncodings.getFirst(); assertEquals(1, forest.getTrees().length); assertArrayEquals(new double...
public void testReadRegression(){ PMML pmml = buildDummyRegressionModel(); Pair<DecisionForest, CategoricalValueEncodings> forestAndEncodings = RDFPMMLUtils.read(pmml); CategoricalValueEncodings encodings = forestAndEncodings.getSecond(); assertTrue(encodings.getCategoryCounts().isEmpty()); }
712
public void testTrue(){ Proposition t = Proposition.True; Assert.assertEquals(t.not(), Proposition.False); Assert.assertEquals(t.eval(new Context()), Boolean.TRUE); Assert.assertEquals(t.toString(), "true"); }
public void testTrue(){ Proposition t = Proposition.True; Assert.assertEquals(t.eval(new Context()), Boolean.TRUE); Assert.assertEquals(t.toString(), "true"); }
713
public void downloadCoverImage(@PathVariable String id, HttpServletResponse response) throws IOException{ Book book = bookService.findBookById(Long.valueOf(id)); if (book.getCover() != null) { byte[] byteArray = new byte[book.getCover().length]; int i = 0; for (Byte wrappedByte : bo...
public void downloadCoverImage(@PathVariable String id, HttpServletResponse response) throws IOException{ Book book = bookService.findBookById(Long.valueOf(id)); if (book.getCover() != null) { byte[] byteArray = new byte[book.getCover().length]; int i = 0; for (Byte wrappedByte : bo...
714
public void setEraseMode(boolean isErase){ mEraseMode = isErase; if (mEraseMode) { if (mPaintColor != Color.WHITE) { setColor("#FFFFFF"); } } else { System.out.println("PREV ERASE " + previousColor); System.out.println("CURR ERASE " + mPaintColor); ...
public void setEraseMode(boolean isErase){ mEraseMode = isErase; if (mEraseMode) { if (mPaintColor != Color.WHITE) { setColor("#FFFFFF"); } } else { mPaintColor = previousColor; mDrawPaint.setColor(mPaintColor); } }
715
public void testRangeOverwrite() throws Exception{ ServerContext sc = getContext(); StreamLog log = new StreamLogFiles(sc, false); final int numIter = 500; List<LogData> entries = new ArrayList<>(); for (long x = 0; x < numIter; x++) { entries.add(getEntry(x)); } String logDi...
public void testRangeOverwrite() throws Exception{ StreamLogFiles log = new StreamLogFiles(sc.getStreamLogParams(), sc.getStreamLogDataStore()); final int numIter = 500; List<LogData> entries = new ArrayList<>(); for (long x = 0; x < numIter; x++) { entries.add(getEntry(x)); } log...
716
public Map<String, Object> updateAlertgroup(User loginUser, int id, String groupName, String desc, String alertInstanceIds){ Map<String, Object> result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { return result; } AlertGroup alertGroup = alertGroupMapper.selectById(id); if (...
public Result<Void> updateAlertgroup(User loginUser, int id, String groupName, String desc, String alertInstanceIds){ if (isNotAdmin(loginUser)) { return Result.error(Status.USER_NO_OPERATION_PERM); } AlertGroup alertGroup = alertGroupMapper.selectById(id); if (alertGroup == null) { ...
717
public Election registerElection(final Election election){ try { jdbcTemplate.update(REGISTER_ELECTION_QUERY, new Object[] { election.getElectionTitle(), election.getElectionId(), election.getElectionDescription(), election.getAdminVoterId(), "1" }, new int[] { Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,...
public void registerElection(final Election election){ try { jdbcTemplate.update(REGISTER_ELECTION_QUERY, new Object[] { election.getElectionTitle(), election.getElectionId(), election.getElectionDescription(), election.getAdminVoterId(), "1" }, new int[] { Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Typ...
718
public MappingJacksonValue lessons(){ MappingJacksonValue result = new MappingJacksonValue(this.lessonService.findAll()); return result; }
public MappingJacksonValue lessons(){ return new MappingJacksonValue(this.lessonService.findAll()); }
719
public void mention(Room room, PingMessageEvent event, RunnerService service, String sitename, String siteurl, boolean isReply){ if (CheckUtils.checkIfUserIsBlacklisted(event.getUserId())) return; Message message = event.getMessage(); List<Command> commands = new ArrayList<>(Arrays.asList(new Ad...
public void mention(Room room, PingMessageEvent event, RunnerService service, String sitename, String siteurl, boolean isReply){ if (CheckUtils.checkIfUserIsBlacklisted(event.getUserId())) return; Message message = event.getMessage(); List<Command> commands = new ArrayList<>(Arrays.asList(new Ad...
720
public Account createStaffAccount(String username, UnencryptedPassword password, String firstname, String lastname, EmailAddress email, DepartmentIdentifier departmentId, List<RoleType> roleTypes){ var encryptedPassword = EncryptedPassword.of(passwordEncoder.encode(password.asString())); var roleList = roleTy...
public Account createStaffAccount(String username, UnencryptedPassword password, String firstname, String lastname, EmailAddress email, DepartmentIdentifier departmentId, List<RoleType> roleTypes){ var encryptedPassword = EncryptedPassword.of(passwordEncoder.encode(password.asString())); var roleList = roleTy...
721
public void onAttach(Activity activity){ super.onAttach(activity); mAppContext = activity.getApplicationContext(); ((MyApp) mAppContext).inject(this); mDropboxCloudProvider.initDropboxApi(); }
public void onAttach(Activity activity){ super.onAttach(activity); mDropboxCloudProvider.initDropboxApi(); }
722
public void onResponse(Call<List<documentFile>> call, Response<List<documentFile>> response){ if (response.isSuccessful()) { if (response.body().get(0).getFileName() == null) { } else { String file_name = response.body().get(0).getFileName(); RetrofitService networkServi...
public void onResponse(Call<List<sendFileExtension>> call, Response<List<sendFileExtension>> response){ if (response.isSuccessful()) { hi = response.body().get(0).getExtension() + ""; extension.setValue(response.body().get(0).getExtension() + ""); giveFile2(file_name); } }
723
public void processAffect10Test(){ AnalyzedTestConfiguration context_ = getConfigurationQuick(new StringMap<String>()); addImportingPage(context_); StringMap<LocalVariable> localVars_ = new StringMap<LocalVariable>(); LocalVariable lv_ = new LocalVariable(); ArrayStruct in_ = setArrays(lv_); ...
public void processAffect10Test(){ AnalyzedTestConfiguration context_ = getConfigurationQuick(new StringMap<String>()); StringMap<LocalVariable> localVars_ = new StringMap<LocalVariable>(); LocalVariable lv_ = new LocalVariable(); ArrayStruct in_ = setArrays(lv_); localVars_.put("v", lv_); ...
724
public String execute(HttpServletRequest request, HttpServletResponse response){ String email = (String) request.getParameter("email"); String password = (String) request.getParameter("password"); User user = userService.findByEmail(email); if (user == null) { return LOGIN_PAGE; } else...
public String execute(HttpServletRequest request, HttpServletResponse response){ String email = (String) request.getParameter("email"); String password = (String) request.getParameter("password"); User user = userService.findByEmail(email); if (user == null || !user.getPassword().equals(password)) {...
725
private static Map<String, HalFormsTemplate> findTemplates(ResourceSupport resource){ Map<String, HalFormsTemplate> templates = new HashMap<String, HalFormsTemplate>(); if (resource.hasLink(Link.REL_SELF)) { for (Affordance affordance : resource.getLink(Link.REL_SELF).map(Link::getAffordances).orElse...
private static Map<String, HalFormsTemplate> findTemplates(ResourceSupport resource){ Map<String, HalFormsTemplate> templates = new HashMap<String, HalFormsTemplate>(); if (resource.hasLink(Link.REL_SELF)) { for (Affordance affordance : resource.getLink(Link.REL_SELF).map(Link::getAffordances).orElse...
726
public Result countQueueState(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "projectId", required = false, defaultValue = "0") int projectId){ logger.info("count command state, user:{}, project id {}", loginUser.getUserName(), projectId); Map<String, Object...
public Result<Map<String, Integer>> countQueueState(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "projectId", required = false, defaultValue = "0") int projectId){ logger.info("count command state, user:{}, project id {}", loginUser.getUserName(), projectId); ...
727
private int getLevel(K key){ for (int i = 0; i < levels(); i++) { if (ccList.get(i).contains(key)) { return i; } } return levels(); }
private int getLevel(K key){ return IntStream.range(0, levels()).filter(i -> (ccList.get(i).contains(key))).findAny().orElse(levels()); }
728
void initializePartitionMetrics(){ Gauge<Long> partitionCount = new Gauge<Long>() { @Override public Long getValue() { return clusterMapCallback.getPartitionCount(); } }; registry.register(MetricRegistry.name(HelixClusterManager.class, "partitionCount"), partiti...
void initializePartitionMetrics(){ Gauge<Long> partitionCount = clusterMapCallback::getPartitionCount; registry.register(MetricRegistry.name(HelixClusterManager.class, "partitionCount"), partitionCount); Gauge<Long> partitionReadWriteCount = clusterMapCallback::getPartitionReadWriteCount; registry....
729
public void onBindViewHolder(@NonNull ViewHolder holder, int position){ holder.bind(captArray.get(position), position); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.i(TAG, "onClick: on bind " + position); ...
public void onBindViewHolder(@NonNull ViewHolder holder, int position){ VldObject vldObject = vldObjectList.get(position); holder.bind(vldObject); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = ne...
730
public void handle(CommandWithArgs commandWithArgs){ if (commandWithArgs.hasNoErrors()) { adapter.newLine(); adapter.writeLine("Available commands are:"); adapter.newLine(); Arrays.stream(Command.values()).filter(Command::isRecognizable).forEach(command -> adapter.writeLine(comm...
public void handle(CommandWithArgs commandWithArgs){ adapter.writeLine("Available commands are:"); adapter.newLine(); Arrays.stream(Command.values()).filter(Command::isRecognizable).forEach(command -> adapter.writeLine(command.toString() + ": " + command.getEquivalents())); adapter.newLine(); }
731
public void testFilterProjection() throws Exception{ EqOperator op = (EqOperator) functions.get(new FunctionIdent(EqOperator.NAME, ImmutableList.<DataType>of(DataTypes.INTEGER, DataTypes.INTEGER))); Function function = new Function(op.info(), Arrays.<Symbol>asList(Literal.of(2), new InputColumn(1))); Fil...
public void testFilterProjection() throws Exception{ EqOperator op = (EqOperator) functions.get(new FunctionIdent(EqOperator.NAME, ImmutableList.of(DataTypes.INTEGER, DataTypes.INTEGER))); Function function = new Function(op.info(), Arrays.asList(Literal.of(2), new InputColumn(1))); FilterProjection proj...
732
public void should_return_exception_when_fetching_given_manager_has_no_ticket_to_parking_boy(){ Car car = new Car(); List<ParkingLot> parkingLots = new ArrayList<>(); parkingLots.add(new ParkingLot()); ParkingBoy parkingBoy = new ParkingBoy(parkingLots); parkingBoy.park(car); ParkingManage...
public void should_return_exception_when_fetching_given_manager_has_no_ticket_to_parking_boy(){ Car car = new Car(); List<ParkingLot> parkingLots = new ArrayList<>(); parkingLots.add(new ParkingLot()); ParkingBoy parkingBoy = new ParkingBoy(parkingLots); parkingBoy.park(car); ParkingManage...
733
public Result updateProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam(value = "processInstanceJson", required = false) String processInstanceJson, @RequestP...
public Result<Void> updateProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam(value = "processInstanceJson", required = false) String processInstanceJson, @Re...
734
public Page<User> listByPage(int pageNum, String sortField, String sortDir, String keyword){ Sort sort = Sort.by(sortField); sort = sortDir.equals("asc") ? sort.ascending() : sort.descending(); Pageable pageable = PageRequest.of(pageNum - 1, USERS_PER_PAGE, sort); if (keyword != null) { ret...
public void listByPage(int pageNum, PagingAndSortingHelper helper){ helper.listEntities(pageNum, USERS_PER_PAGE, userRepo); }
735
private String transcode(final String key, final Profile profile, final String streamId, final LambdaLogger logger) throws IOException, InterruptedException{ final String outputFileName = String.format("/tmp/%s-%s-%s", streamId, profile.getProfileName(), key.substring(key.lastIndexOf('/') + 1)); final StringB...
private String transcode(final String key, final Profile profile, final String streamId, final LambdaLogger logger) throws IOException, InterruptedException{ final Transcoder transcoder = new Transcoder("/tmp/ffmpeg", logger); final String outputFileName = String.format("/tmp/%s-%s-%s", streamId, profile.getP...
736
public boolean equals(Object obj){ if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } CodeAndType other = (CodeAndType) obj; if (storageCode == null) { if (other.storageCode ...
public boolean equals(Object obj){ if (this == obj) { return true; } CodeAndType other = (CodeAndType) obj; if (!storageCode.equals(other.storageCode)) { return false; } if (!storageType.equals(other.storageType)) { return false; } return true; }
737
void Play(String path){ if (mediaPlayer != null) mediaPlayer.stop(); mediaPlayer = new MediaPlayer(new Media(path)); mediaPlayer.play(); mediaPlayer.setOnReady(() -> { musicSlider.setMin(0); musicSlider.setMax(mediaPlayer.getMedia().getDuration().toSeconds()); mu...
void Play(String path){ if (mediaPlayer != null) mediaPlayer.stop(); mediaPlayer = new MediaPlayer(new Media(path)); mediaPlayer.play(); mediaPlayer.setOnReady(() -> { musicSlider.setMin(0); musicSlider.setMax(mediaPlayer.getMedia().getDuration().toSeconds()); mu...
738
public void onEvent(PriceEvent event, long sequence, boolean endOfBatch){ if (aggrConfig == null) { System.out.println("PrimaryBidAskEH cannot analyse pricing. No config in table aggrconfig. Sequence: " + sequence); event.addAuditEvent("PrimaryBidAskEH. Cannot analyse pricing. No config in table ...
public void onEvent(PriceEvent event, long sequence, boolean endOfBatch){ event.setEventState(PriceEvent.EventState.COMPARISON_COMPLETED); if (PriceEventHelper.aggrConfig == null) { System.out.println("PrimaryBidAskEH cannot analyse pricing. No config in table aggrconfig. Sequence: " + sequence); ...
739
private DataModel initData(){ DataModel dataModel = new DataModel(); for (ExpVariables var : ExpVariables.values()) { if (ExpVariables.DAY_NUM == var) { continue; } DataBean bean = readData(var); dataModel.putData(var, bean.getData()); if (headers == n...
private DataModel initData(){ DataModel dataModel = new DataModel(); for (ExpVariables var : ExpVariables.values()) { DataBean bean = readData(var); dataModel.putData(var, bean.getData()); if (headers == null || indexes == null) { headers = bean.getHeaders(); ...
740
public void setup() throws IOException{ cliOps = new HashMap<>(); cliOps.put(BROKERS_OPTION, ""); plan = new ExecutionPlan(); plan.init(clusterState, true, System.out); topicManager = new TopicManager(adminClient, schemaRegistryManager); }
public void setup() throws IOException{ cliOps = new HashMap<>(); cliOps.put(BROKERS_OPTION, ""); plan = ExecutionPlan.init(clusterState, System.out); topicManager = new TopicManager(adminClient, schemaRegistryManager); }
741
public void doGet(HttpServletRequest request, HttpServletResponse response){ HttpSession session = request.getSession(); User user = (User) session.getAttribute("loggedInUser"); SessionHelper.endSession(user.getId(), session); SessionHelper.printSessions(); log.info("User " + user.getLogin() + ...
public void doGet(HttpServletRequest request, HttpServletResponse response){ HttpSession session = request.getSession(); User user = (User) session.getAttribute("loggedInUser"); SessionHelper.endSession(user.getId(), session); log.info("User " + user.getLogin() + " logouted"); try { re...
742
private List<Map<String, String>> querySource(String query, int maxResults) throws InternalErrorException, FileNotFoundException, IOException{ List<Map<String, String>> subjects = new ArrayList<>(); int index = query.indexOf("="); int indexContains = query.indexOf("contains"); if (index != -1) { ...
private void querySource(String query, int maxResults, List<Map<String, String>> subjects) throws InternalErrorException, FileNotFoundException, IOException{ int index = query.indexOf("="); int indexContains = query.indexOf("contains"); if (index != -1) { String queryType = query.substring(0, in...
743
public void setSelector(String name){ if (name != null && this.selector != null && this.selector.isSame(name)) { return; } DataSourceSelector selector = DataSourceSelectorFactory.getSelector(name, this); if (selector != null) { setDataSourceSelector(selector); } }
public void setSelector(String name){ DataSourceSelector selector = DataSourceSelectorFactory.getSelector(name, this); if (selector != null) { selector.init(); setDataSourceSelector(selector); } }
744
public void setOrder(String order){ if ("wander".equals(order)) { this.wandering = true; } else { this.wandering = false; } this.order = order; }
public void setOrder(String order){ this.wandering = "wander".equals(order); this.order = order; }
745
public void renderForground(int left, int top){ String pid = getString(); if (!isFullyExtended()) { GL11.glEnable(GL12.GL_RESCALE_NORMAL); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240 / 1.0F, 240 / 1.0F); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEn...
public void renderForground(int left, int top){ String pid = getString(); if (isFullyExtended()) { mc.fontRenderer.drawString(name, left + 9, top + 8, 0x404040); if (pid == null || pid.isEmpty()) mc.fontRenderer.drawString(TextUtil.translate("gui.craftingManager.noConnection"), ...
746
public void disabledPeriodic(){ Scheduler.getInstance().run(); }
public void disabledPeriodic(){ }
747
public void sendEventToSourceReader(int subtaskId, SourceEvent event){ callInCoordinatorThread(() -> { try { operatorCoordinatorContext.sendEvent(new SourceEventWrapper(event), subtaskId); return null; } catch (TaskNotRunningException e) { throw new FlinkRun...
public void sendEventToSourceReader(int subtaskId, SourceEvent event){ callInCoordinatorThread(() -> { operatorCoordinatorContext.sendEvent(new SourceEventWrapper(event), subtaskId); return null; }, String.format("Failed to send event %s to subtask %d", event, subtaskId)); }
748
protected void noSlowDownOnKill(){ try { boolean selected = noSlowDownOnKill.isSelected(); GNT4Codes codes = GNT4Codes.getInstance(); if (selected) { codes.activateNoSlowdownOnKillCode(uncompressedDirectory); } else { codes.inactivateNoSlowdownOnKillCod...
protected void noSlowDownOnKill(){ try { boolean selected = noSlowDownOnKill.isSelected(); if (selected) { codes.activateCode(GNT4Codes.NO_SLOWDOWN_ON_KILL); } else { codes.inactivateCode(GNT4Codes.NO_SLOWDOWN_ON_KILL); } } catch (Exception e) { ...
749
private Function<String, Set<String>> buildUmaFieldMapper(List<UmaResource> resources, FieldClass fieldClass){ var validUmaFields = resources.stream().map(uma -> { var scopes = new HashSet<>(uma.getScopes()); var fields = this.csvConfig.getFields(fieldClass, scopes); return Pair.of(uma.g...
private Function<String, Set<String>> buildUmaFieldMapper(List<UmaResource> resources, FieldClass fieldClass){ var validUmaFields = resources.stream().collect(Collectors.toMap(UmaResource::getUmaResourceId, uma -> this.csvConfig.getFields(fieldClass, uma.getScopes()))); var publicFields = this.csvConfig.getPu...
750
private int uniqueSides(){ int distinctIntegers = 0; for (int j = 0; j < sides.length; j++) { double thisInt = sides[j]; boolean seenThisIntBefore = false; for (int i = 0; i < j; i++) { if (thisInt == sides[i]) { seenThisIntBefore = true; }...
private int uniqueSides(){ return (int) Arrays.stream(sides).distinct().count(); }
751
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_start); Date date = new Date(); nowMonth = date.toString().split(" ")[1]; myDB = openOrCreateDatabase("my.db", MODE_PRIVATE, null); myDB.execSQL("CREATE TABLE IF NOT EXI...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_start); Date date = new Date(); nowMonth = date.toString().split(" ")[1]; myDB = openOrCreateDatabase("my.db", MODE_PRIVATE, null); myDB.execSQL("CREATE TABLE IF NOT EXI...
752
public void close(){ super.close(); if (m_analogChannel != null && m_allocatedChannel) { m_analogChannel.close(); } m_analogChannel = null; }
public void close(){ if (m_analogChannel != null && m_allocatedChannel) { m_analogChannel.close(); } m_analogChannel = null; }
753
public void testReadUpdateByNewRecordFrom() throws IOException, ParseException{ TransactionMessageBodyReader reader = new TransactionMessageBodyReader(new CswRecordConverter()); CswTransactionRequest request = reader.readFrom(CswTransactionRequest.class, null, null, null, null, IOUtils.toInputStream(UPDATE_RE...
public void testReadUpdateByNewRecordFrom() throws IOException, ParseException{ TransactionMessageBodyReader reader = new TransactionMessageBodyReader(cswRecordConverter, CswQueryFactoryTest.getCswMetacardType()); CswTransactionRequest request = reader.readFrom(CswTransactionRequest.class, null, null, null, n...
754
public void generateDataVersion(String dataVersion){ if (MFM.isSystemDebug()) { System.out.println("MFMSettings.generateDataVersion dataVersion IN is: " + dataVersion); } dataVersion = trimMAMEVersion(dataVersion); Double dataVersionDouble = Double.valueOf(dataVersion.substring(dataVersion....
public void generateDataVersion(String dataVersionIn){ if (MFM.isSystemDebug()) { System.out.println("MFMSettings.generateDataVersion dataVersion IN is: " + dataVersionIn); } String dataVersion = trimMAMEVersion(dataVersionIn); if (!dataVersion.contains(ALL_UNDERSCORE) && (MAMEInfo.isProces...
755
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.i(TAG, "onCreate()"); findViewById(R.id.btn_new_capture).setOnClickListener(v -> goToNewCapture()); findViewById(R.id.btn_continue_capture).setOnClickListener(v ->...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.i(TAG, "onCreate()"); findViewById(R.id.btn_new_capture).setOnClickListener(v -> goToNewCapture()); findViewById(R.id.btn_continue_capture).setOnClickListener(v ->...
756
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_high_hand); mMenuButton = (Button) findViewById(R.id.menu_button); mPlayButton = (Button) findViewById(R.id.play_button); mPlayer1Hand = (TextView) findViewById(R.id.player_1...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_high_hand); mMenuButton = (Button) findViewById(R.id.menu_button); mPlayButton = (Button) findViewById(R.id.play_button); mPlayer1Hand = (TextView) findViewById(R.id.player_1...
757
public void setLogs(boolean enable){ if (rtspClient != null) { rtspClient.setLogs(enable); } }
public void setLogs(boolean enable){ rtspClient.setLogs(enable); }
758
public static void fileUpload(WebDriver d, String attrType, String attrValue, String fileDir, String desc){ WebElement el = CommandHelpers.getElementBy(d, attrType, attrValue); el.sendKeys(fileDir); CommandHelpers.printSteps(PropsCommands.fileUpload, desc); }
public static void fileUpload(WebDriver d, String attrType, String attrValue, String fileDir, String desc){ WebElement el = CommandHelpers.getElementBy(d, attrType, attrValue); fileUpload(el, fileDir, desc); }
759
public boolean onStartJob(JobParameters params){ final PrefState prefs = new PrefState(this); final int food = prefs.getFoodState(); if (food != 0) { prefs.setFoodState(0); final Random rng = new Random(); if (rng.nextFloat() <= CAT_CAPTURE_PROB) { final Cat cat; ...
public boolean onStartJob(JobParameters params){ final PrefState prefs = new PrefState(this); final int food = prefs.getFoodState(); if (food != 0) { prefs.setFoodState(0); final Random rng = new Random(); final Cat cat; final List<Cat> cats = prefs.getCats(); ...
760
private CustList<ArgumentWrapper> fectchPosArgs(IdMap<RendDynOperationNode, ArgumentsPair> _nodes){ CustList<ArgumentWrapper> out_ = new CustList<ArgumentWrapper>(); CustList<RendDynOperationNode> chidren_ = getChildrenNodes(); RendDynOperationNode last_ = getLast(chidren_); if (last_ instanceof Ren...
private CustList<ArgumentWrapper> fectchPosArgs(IdMap<RendDynOperationNode, ArgumentsPair> _nodes){ CustList<RendDynOperationNode> chidren_ = getChildrenNodes(); RendDynOperationNode last_ = getLast(chidren_); if (last_ instanceof RendNamedArgumentOperation) { chidren_ = ((RendNamedArgumentOpera...
761
private void buildCsvRow(Map<String, String> row, Map<String, Field> fieldMap, Object instance, String[] headers, CsvExportCustomizer exportCustomizer){ row.clear(); for (String fieldName : headers) { Field field = fieldMap.get(fieldName); Object value = PropertyUtil.safeGetProperty(instance...
private void buildCsvRow(Map<String, String> row, Map<String, Field> fieldMap, Object instance, String[] headers, CsvExportCustomizer exportCustomizer){ row.clear(); for (String fieldName : headers) { Field field = fieldMap.get(fieldName); Object value = PropertyUtil.safeGetProperty(instance...
762
void selectSubscriptions(List<String> subscriptionIds){ if (CollectionUtils.isNotEmpty(subscriptionIds) && CollectionUtils.isNotEmpty(this.entity.getSubscriptions())) { entity.getSubscriptions().stream().filter(s -> Utils.containsIgnoreCase(subscriptionIds, s.getId())).forEach(t -> { t.setSe...
void selectSubscriptions(List<String> subscriptionIds){ if (CollectionUtils.isNotEmpty(subscriptionIds) && CollectionUtils.isNotEmpty(this.entity.getSubscriptions())) { entity.getSubscriptions().stream().filter(s -> Utils.containsIgnoreCase(subscriptionIds, s.getId())).forEach(t -> t.setSelected(true)); ...
763
public static void saveStringToSecureStorage(Context context, String fileName, String string, SecretKey key) throws Exception{ checkArgs(context, fileName, string); Cipher input = Cipher.getInstance("AES/GCM/NoPadding"); input.init(Cipher.ENCRYPT_MODE, key); IvParameterSpec ivParams = input.getParam...
public static void saveStringToSecureStorage(Context context, String fileName, String string, Cipher cipher) throws Exception{ checkArgs(context, fileName, string); CipherOutputStream cipherOutputStream = new CipherOutputStream(new FileOutputStream(FileSystemManager.getEncryptedDataFilePath(context, fileName)...
764
public static String getHostOnly(String urlstr){ try { URL u = new URL(urlstr); String ret = u.getHost(); return ret; } catch (MalformedURLException e) { return ""; } }
public static String getHostOnly(String urlstr){ try { URL u = new URL(urlstr); return u.getHost(); } catch (MalformedURLException e) { return ""; } }
765
private List<ColumnMetaData> getColumnMetadataList(String query){ final AtsdConnectionInfo connectionInfo = ((AtsdConnection) connection).getConnectionInfo(); final String url = addQueryParameter(connectionInfo, query); final ContentDescription contentDescription = new ContentDescription(url, connectionI...
private List<ColumnMetaData> getColumnMetadataList(String query){ final AtsdConnectionInfo connectionInfo = ((AtsdConnection) connection).getConnectionInfo(); final String url = addQueryParameter(connectionInfo, query); final ContentDescription contentDescription = new ContentDescription(url, connectionI...
766
public int getScore(){ int score = 0; for (int i = 0; i < 10; i++) { Frame frame = frames.get(i); if (isStrike(frame)) { Frame secondFrame = frames.get(i + 1); if (isStrike(secondFrame)) { Frame thirdFrame = frames.get(i + 2); score...
public int getScore(){ int score = 0; for (int frameIndex = 0; frameIndex < 10; frameIndex++) { Frame frame = frames.get(frameIndex); if (isStrike(frame)) { score += getTotalStrikeBonus(frameIndex); } else if (isSpare(frame)) { Frame secondFrame = frames.ge...
767
protected void persistResult(Site site, List<Item<ProductData>> items){ List<String> detail = new ArrayList<String>(); for (Item<ProductData> item : items) { ProductData productData = item.getContent(); detail.add(Serialization.serialize(productData)); } StreamUtil.write(new File(P...
protected void persistResult(Site site, List<Item<ProductData>> items){ List<String> detail = new ArrayList<String>(); for (Item<ProductData> item : items) { detail.add(Serialization.serialize(item)); } StreamUtil.write(new File(PROJECTS + site.getProject().getName() + separator + "lazada-p...
768
public void validateSuccessfullPublishingAndUndeliverableRoutingKey() throws Exception{ Map<String, List<String>> routingMap = new HashMap<>(); routingMap.put("key1", Arrays.asList("queue1", "queue2")); Map<String, String> exchangeToRoutingKeymap = new HashMap<>(); exchangeToRoutingKeymap.put("myExc...
public void validateSuccessfullPublishingAndUndeliverableRoutingKey() throws Exception{ Map<String, List<String>> routingMap = new HashMap<>(); routingMap.put("key1", Arrays.asList("queue1", "queue2")); Map<String, String> exchangeToRoutingKeymap = new HashMap<>(); exchangeToRoutingKeymap.put("myExc...
769
private void handleReleased(Trigger trigger){ if (isAnyMenuOpen()) return; bindings.stream().filter(binding -> { if (trigger.key == null) { return binding.isTriggered(trigger.btn); } else { return binding.isTriggered(trigger.key); } }).findAny...
private void handleReleased(Trigger trigger){ bindings.stream().filter(binding -> { if (trigger.key == null) { return binding.isTriggered(trigger.btn); } else { return binding.isTriggered(trigger.key); } }).findAny().map(InputBinding::getAction).ifPresent(c...
770
private void setMods(List<CurseMod> mods){ GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.BOTH; gbc.insets.set(2, 2, 2, 2); contentPanel.removeAll(); prevButton.setEnabled(page > 0); nextButto...
private void setMods(List<CurseMod> mods){ GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.BOTH; gbc.insets.set(2, 2, 2, 2); contentPanel.removeAll(); prevButton.setEnabled(page > 0); nextButto...
771
public String processSubmit(@ModelAttribute("study") Study study, ModelMap model, SessionStatus session) throws IOException{ try { User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName()); if (!study.userCanWrite(user)) { throw ...
public String processSubmit(@ModelAttribute("study") Study study, ModelMap model, SessionStatus session) throws IOException{ studyService.save(study); session.setComplete(); model.clear(); return "redirect:/miso/study/" + study.getId(); }
772
public String toString(){ final String result; if (spell == null) { result = ""; } else { result = spell.getDisplayName(); } return result; }
public String toString(){ return (spell == null) ? "" : spell.getDisplayName(); }
773
private String fizzbuzz(int i){ if (i == 0) return "0"; else if (i == 1) return "1"; else if (i == 2) return "2"; else if (i % 3 == 0 && i % 5 == 0) return "fizzbuzz"; else if (i % 3 == 0) return "fizz"; else if (i == 4) return "4"; ...
private String fizzbuzz(int i){ if (i == 0) return String.valueOf(i); else if (i % 3 == 0 && i % 5 == 0) return "fizzbuzz"; else if (i % 3 == 0) return "fizz"; else if (i % 5 == 0) return "buzz"; else return String.valueOf(i); }
774
public void onClick(View v){ double summ; try { summ = Const.round(Double.parseDouble(et_sum.getText().toString()), 2); } catch (NumberFormatException e) { Toast.makeText(getContext(), R.string.incorrect_summ, Toast.LENGTH_SHORT).show(); return; } if (et_person.getTex...
public void onClick(View v){ double summ; try { summ = Const.round(Double.parseDouble(et_sum.getText().toString()), 2); } catch (NumberFormatException e) { Toast.makeText(getContext(), R.string.incorrect_summ, Toast.LENGTH_SHORT).show(); return; } if (et_person.getTex...
775
public Thread newThread(Runnable r){ Thread thread = new Thread(r, QUERY_POOL_NAME + "-" + suffix.incrementAndGet()); thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { @Override public void uncaughtException(Thread t, Throwable e) { LOGGER.debug("UNCAU...
public Thread newThread(Runnable r){ Thread thread = new Thread(r, QUERY_POOL_NAME + "-" + suffix.incrementAndGet()); thread.setUncaughtExceptionHandler((t, e) -> LOGGER.debug("UNCAUGHT exception in thread {}", t.getName(), e)); return thread; }
776
public Map<String, Object> queryResourceByProgramType(User loginUser, ResourceType type, ProgramType programType){ Map<String, Object> result = new HashMap<>(); String suffix = ".jar"; int userId = loginUser.getId(); if (isAdmin(loginUser)) { userId = 0; } if (programType != null)...
public Result<List<ResourceComponent>> queryResourceByProgramType(User loginUser, ResourceType type, ProgramType programType){ Map<String, Object> result = new HashMap<>(); String suffix = ".jar"; int userId = loginUser.getId(); if (isAdmin(loginUser)) { userId = 0; } if (programT...
777
public void exportJobs(final HttpServletRequest request, @AuditParam("namespace") @PathVariable String namespace, final HttpServletResponse response) throws SaturnJobConsoleException{ File exportJobFile = null; try { exportJobFile = jobService.exportJobs(namespace); String currentTime = new ...
public void exportJobs(final HttpServletRequest request, @AuditParam("namespace") @PathVariable String namespace, final HttpServletResponse response) throws SaturnJobConsoleException{ File exportJobFile = jobService.exportJobs(namespace); String currentTime = new SimpleDateFormat("yyyyMMddHHmmss").format(new ...
778
private void createNewJobDirectory(PersistedJobRequest persistedJobRequest){ final JobId id = persistedJobRequest.getId(); try { final Path jobDir = jobsDirectory.resolve(id.toString()); Files.createDirectory(jobDir); log.debug(id + ": created job dir: " + jobDir.toString()); ...
private void createNewJobDirectory(PersistedJobRequest persistedJobRequest){ final JobId id = persistedJobRequest.getId(); try { final Path jobDir = jobsDirectory.resolve(id.toString()); createDirectory(jobDir); log.debug(id + ": created job dir: " + jobDir); final Path job...
779
public void takeDamage(int damageValue, Weapon weapon){ if (damageValue <= 0) return; if (equipment.canBlockHit()) { equipment.blockHitFrom(weapon); return; } int damageToTake = damageValue - equipment.calculateTotalDamageResistance(); damageToTake = Math.max(damageTo...
public void takeDamage(int damageValue, Weapon weapon){ if (damageValue <= 0) return; if (equipment.canBlockHit()) { equipment.blockHitFrom(weapon); return; } int damageToTake = damageValue - equipment.calculateTotalDamageResistance(); hp -= damageToTake; }
780
private Navigation initCommon(String locale_, String folder_, String relative_, String content_, String html_, StringMap<String> filesSec_){ StringMap<String> files_ = new StringMap<String>(); files_.put(EquallableExUtil.formatFile(folder_, locale_, relative_), content_); files_.put("page1.html", html_);...
private Navigation initCommon(String locale_, String folder_, String relative_, String content_, String html_, StringMap<String> filesSec_){ StringMap<String> files_ = new StringMap<String>(); files_.put(EquallableExUtil.formatFile(folder_, locale_, relative_), content_); files_.put("page1.html", html_);...
781
public void render(final long time, final float someOtherParameter){ if (Arez.shouldCheckApiInvariants()) { Guards.apiInvariant(() -> !this.$$arez$$_disposed, () -> "Method invoked on invalid component '" + $$arez$$_name() + "'"); } try { $$arez$$_context().safeTrack(this.$$arez$$_rende...
public void render(final long time, final float someOtherParameter){ if (Arez.shouldCheckApiInvariants()) { Guards.apiInvariant(() -> !this.$$arez$$_disposed, () -> "Method invoked on invalid component '" + $$arez$$_name() + "'"); } try { $$arez$$_context().safeTrack(this.$$arez$$_rende...
782
public Query apply(Function input, LuceneQueryBuilder.Context context){ RefAndLiteral refAndLiteral = RefAndLiteral.of(input); if (refAndLiteral == null) { return null; } String colName = refAndLiteral.reference().column().fqn(); MappedFieldType fieldType = context.getFieldTypeOrNull(c...
public Query apply(Function input, LuceneQueryBuilder.Context context){ RefAndLiteral refAndLiteral = RefAndLiteral.of(input); if (refAndLiteral == null) { return null; } String colName = refAndLiteral.reference().column().fqn(); MappedFieldType fieldType = context.getFieldTypeOrNull(c...
783
private void decodeHeadersAndProperties(final ByteBuf buffer, boolean lazyProperties){ messageIDPosition = buffer.readerIndex(); messageID = buffer.readLong(); int b = buffer.readByte(); if (b != DataConstants.NULL) { final int length = buffer.readInt(); if (keysInterner != null) {...
private void decodeHeadersAndProperties(final ByteBuf buffer, boolean lazyProperties){ messageIDPosition = buffer.readerIndex(); messageID = buffer.readLong(); address = SimpleString.readNullableSimpleString(buffer, coreMessageObjectPools == null ? null : coreMessageObjectPools.getAddressDecoderPool()); ...
784
private Entry examineClassFile(InputStream is, URL url){ Entry entry = null; try { ClassInfo info = scanClassFile(is, url); entry = new Entry(info.getClassname(), null); cache.addEntry(entry); entry.setData(info); } catch (IOException e) { logger.log(Level.FIN...
private Entry examineClassFile(InputStream is, URL url){ Entry entry = null; try { ClassInfo info = scanClassFile(is, url); entry = new Entry(info.getClassname(), null); cache.addEntry(entry); entry.setData(info); } catch (IOException e) { logger.log(Level.FIN...
785
public int loadCSVData(String csvFilePath) throws CensusAnalyserException{ if (!this.checkFileExtention(csvFilePath)) { throw new CensusAnalyserException("File type is not correct", CensusAnalyserException.ExceptionType.FILE_TYPE_INCORRECT); } checkForWrongDelimiter(csvFilePath); try { ...
public int loadCSVData(String csvFilePath) throws CensusAnalyserException{ List<CSVStateCensus> CSVStateDataList; if (!this.checkFileExtention(csvFilePath)) { throw new CensusAnalyserException("File type is not correct", ExceptionType.FILE_TYPE_INCORRECT); } checkForWrongDelimiter(csvFilePa...
786
public Object createFromResultSet(ResultSetHelper rs) throws SQLException{ Object object = newEntityInstance(); for (int i = 0; i < fieldColumnMappings.size(); i++) { FieldColumnMapping fieldColumnMapping = fieldColumnMappings.get(i); fieldColumnMapping.setFromResultSet(object, rs); ...
public Object createFromResultSet(ResultSetHelper rs) throws SQLException{ Object object = newEntityInstance(); for (int i = 0; i < fieldColumnMappings.size(); i++) { fieldColumnMappings.get(i).setFromResultSet(object, rs, i + 1); if (i == lastPrimaryKeyIndex) { Object existing ...
787
public StringBuilder appendProducts(StringBuilder initial, List<ProductWithCount> products, ResourceBundle rb, boolean withDelivery, int deliveryPrice){ long totalSum = 0L; for (ProductWithCount productWithCount : products) { Product product = productService.fromProductWithCount(productWithCount.getI...
public StringBuilder appendProducts(StringBuilder initial, List<ProductWithCount> products, ResourceBundle rb, boolean withDelivery, int deliveryPrice){ long totalSum = 0L; for (ProductWithCount productWithCount : products) { Product product = productService.fromProductWithCount(productWithCount.getI...
788
public List<ArtworksDbMapper> getAllArtworks(){ ArtworksDbMapper artwork = null; List<ArtworksDbMapper> artworksList = new LinkedList<ArtworksDbMapper>(); String query = "SELECT * FROM " + TABLE_ARTWORKS; SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery(query, null); ...
public List<ArtworksDbMapper> getAllArtworks(){ List<ArtworksDbMapper> artworksList = new LinkedList<ArtworksDbMapper>(); String query = "SELECT * FROM " + TABLE_ARTWORKS; SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery(query, null); if (cursor != null && cursor.move...
789
public void onViewClicked(View view){ switch(view.getId()) { case R.id.img_back: finish(); break; case R.id.bn_back: finish(); } }
public void onViewClicked(View view){ switch(view.getId()) { case R.id.img_back: case R.id.bn_back: finishAffinity(); } }
790
protected void configure(){ bind(CommandTypeRegistry.class).to(CommandTypeRegistryImpl.class).in(Singleton.class); bind(CommandManager3.class).to(CommandManagerImpl3.class).in(Singleton.class); GinMapBinder.newMapBinder(binder(), String.class, WsAgentComponent.class).addBinding("Command Manager").to(Comm...
protected void configure(){ bind(CommandTypeRegistry.class).to(CommandTypeRegistryImpl.class).in(Singleton.class); bind(CommandManager3.class).to(CommandManagerImpl3.class).in(Singleton.class); GinMapBinder.newMapBinder(binder(), String.class, WsAgentComponent.class).addBinding("Command Manager").to(Comm...
791
private static Map<String, ClientRegistration> toUnmodifiableConcurrentMap(List<ClientRegistration> registrations){ final ConcurrentHashMap<String, ClientRegistration> result = new ConcurrentHashMap<>(); for (ClientRegistration registration : registrations) { if (result.containsKey(registration.getRe...
private static Map<String, ClientRegistration> toUnmodifiableConcurrentMap(List<ClientRegistration> registrations){ ConcurrentHashMap<String, ClientRegistration> result = new ConcurrentHashMap<>(); for (ClientRegistration registration : registrations) { result.put(registration.getRegistrationId(), re...
792
protected JSONObject getEpicData(String epicKey){ JSONObject canonicalRs = new JSONObject(); JSONArray nativeRs = new JSONArray(); JSONObject innerRs = new JSONObject(); String jiraCredentials = this.featureSettings.getJiraCredentials(); String jiraBaseUrl = this.featureSettings.getJiraBaseUrl(...
protected JSONObject getEpicData(String epicKey){ JSONObject canonicalRs = new JSONObject(); String jiraCredentials = this.featureSettings.getJiraCredentials(); String jiraBaseUrl = this.featureSettings.getJiraBaseUrl(); String jiraQueryEndpoint = this.featureSettings.getJiraQueryEndpoint(); St...
793
public void registerAttributes(ManagementResourceRegistration registration){ final OperationStepHandler writeHandler = new ReloadRequiredWriteAttributeHandler(ATTRIBUTES); for (AttributeDefinition attr : ATTRIBUTES) { registration.registerReadWriteAttribute(attr, null, writeHandler); } if (...
public void registerAttributes(ManagementResourceRegistration registration){ final OperationStepHandler writeHandler = new ReloadRequiredWriteAttributeHandler(ATTRIBUTES); for (AttributeDefinition attr : ATTRIBUTES) { registration.registerReadWriteAttribute(attr, null, writeHandler); } if (...
794
public void testCheckpointWindowIds() throws Exception{ FSStorageAgent sa = new FSStorageAgent(testMeta.getPath(), null); long[] windowIds = new long[] { 123L, 345L, 234L }; for (long windowId : windowIds) { sa.save(windowId, 1, windowId); } Arrays.sort(windowIds); long[] windowsI...
public void testCheckpointWindowIds() throws Exception{ FSStorageAgent sa = new FSStorageAgent(testMeta.getPath(), null); long[] windowIds = new long[] { 123L, 345L, 234L }; for (long windowId : windowIds) { sa.save(windowId, 1, windowId); } Arrays.sort(windowIds); long[] windowsI...
795
private Node createRightPanel() throws FileNotFoundException, IOException{ Book book = BookReader.read("livres/livre.json"); BookGenerator.generateBook(book.getRootNode(), book.getItems(), book.getCharacters(), "build/livre"); Label labelDifficulte = new Label("Difficulté : " + (100 - Fourmi.estimerDiffi...
private Node createRightPanel(){ VBox statsLayout = new VBox(); return statsLayout; }
796
public void deleteAll(View view){ AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); alertDialog.setTitle("Confirmation"); alertDialog.setMessage("Are you sure you want to delete all users?"); alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() { @Over...
public void deleteAll(View view){ AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); alertDialog.setTitle("Confirmation"); alertDialog.setMessage("Are you sure you want to delete all users?"); alertDialog.setPositiveButton("YES", (dialog, which) -> new UserHttpTask(getApplication()).ex...
797
protected List<CloudResourceStatus> checkResources(ResourceType type, AwsContext context, AuthenticatedContext auth, Iterable<CloudResource> resources){ AmazonEc2Client client = getAmazonEc2Client(auth); List<CloudResource> volumeResources = StreamSupport.stream(resources.spliterator(), false).filter(r -> r.g...
protected List<CloudResourceStatus> checkResources(ResourceType type, AwsContext context, AuthenticatedContext auth, Iterable<CloudResource> resources){ AmazonEc2Client client = getAmazonEc2Client(auth); Pair<List<String>, List<CloudResource>> volumes = volumeResourceCollector.getVolumeIdsByVolumeResources(re...
798
public Page<IpAccessControlList> getPage(final String targetUrl, final TwilioRestClient client){ String resourceUrl = "https://" + Joiner.on(".").skipNulls().join(Domains.TRUNKING.toString(), client.getRegion(), "twilio", "com") + "/v1/Trunks/" + this.pathTrunkSid + "/IpAccessControlLists"; if (!targetUrl.sta...
public Page<IpAccessControlList> getPage(final String targetUrl, final TwilioRestClient client){ Request request = new Request(HttpMethod.GET, targetUrl); return pageForRequest(client, request); }
799
public int setChannel(int channel){ if (getChannel() + channel >= 0 && getChannel() + channel <= 10) { return this.channel = getChannel() + channel; } else if (getChannel() + channel < 0) { return this.channel = 10; } else return this.channel = 0; }
public int setChannel(int channel){ return channelCheck(10, 0, channel); }