Dataset Viewer
Auto-converted to Parquet Duplicate
Unnamed: 0
int64
0
9.45k
cwe_id
stringclasses
1 value
source
stringlengths
37
2.53k
target
stringlengths
19
2.4k
0
public boolean save(SystemUser systemUser){ Users user = systemUser.getId() != null ? userRepository.findById(systemUser.getId()).orElse(new Users()) : new Users(); user.setNumberPhone(systemUser.getNumberPhone()); if (systemUser.getId() == null || (systemUser.getPassword() != null && !systemUser.getPass...
public void save(SystemUser systemUser){ Users user = systemUser.getId() != null ? userRepository.findById(systemUser.getId()).orElse(new Users()) : new Users(); user.setNumberPhone(systemUser.getNumberPhone()); if (systemUser.getId() == null || (systemUser.getPassword() != null && !systemUser.getPasswor...
1
public Location getLocation(){ final Location center = new Location(0, 0); markers.forEach(marker -> { center.add(marker.getLocation()); }); center.div((float) markers.size()); return center; }
public Location getLocation(){ final Location center = new Location(0, 0); markers.forEach(marker -> center.add(marker.getLocation())); center.div((float) markers.size()); return center; }
2
public URI getUri(){ try { return new URI(request.getRequestURI()); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } }
public URI getUri(){ return URI.create(request.getRequestURI()); }
3
private static boolean isActivityShowing(Context context){ SharedPreferences preferences = context.getSharedPreferences(Verloop.SHARED_PREFERENCE_FILE_NAME, Context.MODE_PRIVATE); return preferences.getBoolean(Verloop.IS_SHOWN, false); }
private static boolean isActivityShowing(Context context){ return true; }
4
private R decodeRawResultSet(ResultSet rs) throws SQLException{ BiConsumer<C, Row> accumulator = collector.accumulator(); List<String> columnNames = new ArrayList<>(); RowDesc desc = new RowDesc(columnNames); C container = collector.supplier().get(); ResultSetMetaData metaData = rs.getMetaData(...
private R decodeRawResultSet(ResultSet rs) throws SQLException{ BiConsumer<C, Row> accumulator = collector.accumulator(); List<String> columnNames = new ArrayList<>(); RowDesc desc = new RowDesc(columnNames); C container = collector.supplier().get(); ResultSetMetaData metaData = rs.getMetaData(...
5
public boolean update(Context context, KvPairs pairs, AnyKey anyKey){ LOGGER.trace("update: " + pairs.getPair().getId() + (pairs.size() > 1 ? " ... " : " ") + anyKey.getAny().toString()); String table = anyKey.getKey().getTable(); if (table == null) { if (!kvSave(context, pairs, anyKey)) { ...
public boolean update(Context context, KvPairs pairs, AnyKey anyKey){ LOGGER.trace("update: " + pairs.getPair().getId() + (pairs.size() > 1 ? " ... " : " ") + anyKey.getAny().toString()); String table = anyKey.getKey().getTable(); if (table == null) { if (!kvSave(context, pairs, anyKey)) { ...
6
protected static boolean hasErrThree(String folder_, String relative_, String html_, String htmlTwo_, String htmlThree_, StringMap<String> filesSec_){ Configuration conf_ = EquallableExUtil.newConfiguration(); conf_.setPrefix("c:"); AnalyzedTestConfiguration a_ = build(conf_); setStack(a_); get...
protected static boolean hasErrThree(String folder_, String relative_, String html_, String htmlTwo_, String htmlThree_, StringMap<String> filesSec_){ Configuration conf_ = EquallableExUtil.newConfiguration(); conf_.setPrefix("c:"); AnalyzedTestConfiguration a_ = build(conf_); getHeaders(filesSec_, ...
7
public void process(JsonObject resultObject, RequestError requestError){ if (resultObject != null) { try { List<SourceEdit> edits = SourceEdit.fromJsonArray(resultObject.get("edits").getAsJsonArray()); int selectionOffset = resultObject.get("selectionOffset").getAsInt(); ...
public void process(JsonObject resultObject, RequestError requestError){ if (resultObject != null) { try { List<SourceEdit> edits = SourceEdit.fromJsonArray(resultObject.get("edits").getAsJsonArray()); int selectionOffset = resultObject.get("selectionOffset").getAsInt(); ...
8
protected void processOptions(Widget widget, ObjectNode schema){ Map<String, String> optionsMap = UiSchemaConstants.getWidgetOptionsMapping().get(widget.getWidgetType()); if (optionsMap != null) { ObjectNode options = JsonNodeFactory.instance.objectNode(); for (Map.Entry<String, String> entr...
protected void processOptions(Widget widget, ObjectNode schema){ Map<String, String> optionsMap = UiSchemaConstants.getWidgetOptionsMapping().get(widget.getWidgetType()); if (optionsMap != null) { ObjectNode options = JsonNodeFactory.instance.objectNode(); for (Map.Entry<String, String> entr...
9
protected void onStart(){ super.onStart(); Lists list = new Lists("Šoping lista test1", "grey", "22.06.2018 - 13:00"); Lists list2 = new Lists("Šoping lista test2", "green", "22.06.2018 - 14:00"); Lists list3 = new Lists("Šoping lista test3", "blue", "22.06.2018 - 15:00"); Lists list4 = new Lis...
protected void onStart(){ super.onStart(); ListModel list = new ListModel("Šoping lista test1", "grey", "22.06.2018 - 13:00"); ListModel list2 = new ListModel("Šoping lista test2", "green", "22.06.2018 - 14:00"); ListModel list3 = new ListModel("Šoping lista test3", "blue", "22.06.2018 - 15:00"); ...
10
public void removeLink(String uid, InetSocketAddress outLinkAddress){ this.inLinkClientUidToMinimaAddress.remove(uid); this.inLinks.remove(outLinkAddress); this.outLinks.remove(outLinkAddress); this.clientLinks.remove(outLinkAddress); log.debug(this.genPrintableState()); }
public void removeLink(InetSocketAddress outLinkAddress){ this.inLinks.remove(outLinkAddress); this.outLinks.remove(outLinkAddress); this.clientLinks.remove(outLinkAddress); log.debug(this.genPrintableState()); }
11
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View fragmentLayout = inflater.inflate(R.layout.fragment_movie_detail, container, false); ButterKnife.bind(this, fragmentLayout); movie = getMovie(); putMovieDataIntoViews(); Log.d(TAG, "onCreateV...
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View fragmentLayout = inflater.inflate(R.layout.fragment_movie_detail, container, false); ButterKnife.bind(this, fragmentLayout); movie = getMovie(); putMovieDataIntoViews(); return fragmentLayout...
12
public Map<String, Object> queryProjectCreatedByUser(User loginUser){ Map<String, Object> result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { return result; } List<Project> projects = projectMapper.queryProjectCreatedByUser(loginUser.getId()); result.put(Constants.DATA_LIST,...
public Result<List<Project>> queryProjectCreatedByUser(User loginUser){ if (isNotAdmin(loginUser)) { return Result.error(Status.USER_NO_OPERATION_PERM); } List<Project> projects = projectMapper.queryProjectCreatedByUser(loginUser.getId()); return Result.success(projects); }
13
public Parameters.Fhir subsumes(@ApiParam(value = "The id of the code system to invoke the operation on") @PathVariable("codeSystemId") String codeSystemId, @ApiParam(name = "body", value = "The lookup request parameters") @RequestBody Parameters.Fhir in){ SubsumptionRequest request = toRequest(in, SubsumptionRequ...
public Promise<Parameters.Fhir> subsumes(@ApiParam(value = "The id of the code system to invoke the operation on") @PathVariable("codeSystemId") String codeSystemId, @ApiParam(name = "body", value = "The lookup request parameters") @RequestBody Parameters.Fhir in){ SubsumptionRequest request = toRequest(in, Subsum...
14
public int onStartCommand(Intent intent, int flags, int startId){ if (mHandler == null) { mHandler = new Handler(this); } if (mThread != null) { mThread.interrupt(); } if (mInterface != null) { try { mInterface.close(); } catch (IOException e) { ...
public int onStartCommand(Intent intent, int flags, int startId){ if (mHandler == null) { mHandler = new Handler(this); } if (mThread != null) { mThread.interrupt(); } if (mInterface != null) { try { mInterface.close(); } catch (IOException e) { ...
15
public void testMissingLowerCorner() throws CswException{ HierarchicalStreamReader reader = mock(HierarchicalStreamReader.class); Stack<String> boundingBoxNodes = new Stack<String>(); boundingBoxNodes.push("-2.228 51.126"); boundingBoxNodes.push("UpperCorner"); boundingBoxNodes.push("-6.171 44....
public void testMissingLowerCorner() throws CswException{ HierarchicalStreamReader reader = mock(HierarchicalStreamReader.class); Stack<String> boundingBoxNodes = new Stack<>(); boundingBoxNodes.push("-2.228 51.126"); boundingBoxNodes.push("UpperCorner"); boundingBoxNodes.push("-6.171 44.792");...
16
private static List<MRelation> retrieve(final Properties ctx, final I_AD_RelationType type, final int recordId, final boolean normalDirection, final String trxName){ final StringBuilder wc = new StringBuilder(); wc.append(COLUMNNAME_AD_RelationType_ID + "=? AND "); if (normalDirection) { wc.appe...
private static List<I_AD_Relation> retrieve(final Properties ctx, final I_AD_RelationType type, final int recordId, final boolean normalDirection, final String trxName){ final IQueryBuilder<I_AD_Relation> queryBuilder = Services.get(IQueryBL.class).createQueryBuilder(I_AD_Relation.class, ctx, trxName).addOnlyActiv...
17
public void remove(SwitchId datapath){ log.info("Switch service receive remove request for {}", datapath); SwitchFsm fsm = controller.get(datapath); if (fsm == null) { log.info("Got DELETE request for not existing switch {}", datapath); return; } SwitchFsmContext context = Swi...
public void remove(SwitchId datapath){ log.info("Switch service receive remove request for {}", datapath); SwitchFsm fsm = controller.get(datapath); if (fsm == null) { log.info("Got DELETE request for not existing switch {}", datapath); return; } SwitchFsmContext context = Swi...
18
private void parseIntentExtras(Bundle extras){ call_direction_type = (Consts.CALL_DIRECTION_TYPE) extras.getSerializable(Consts.CALL_DIRECTION_TYPE_EXTRAS); currentSession = SessionManager.getCurrentSession(); call_type = (QBRTCTypes.QBConferenceType) extras.getSerializable(Consts.CALL_TYPE_EXTRAS); ...
private void parseIntentExtras(Bundle extras){ call_direction_type = (Consts.CALL_DIRECTION_TYPE) extras.getSerializable(Consts.CALL_DIRECTION_TYPE_EXTRAS); call_type = (QBRTCTypes.QBConferenceType) extras.getSerializable(Consts.CALL_TYPE_EXTRAS); opponentsList = (List<Integer>) extras.getSerializable(Co...
19
public void shouldHandleValidAQR(){ when(validator.validate(eq(ATTRIBUTE_QUERY), any(Messages.class))).thenReturn(messages()); when(transformer.apply(request)).thenReturn(matchingServiceRequestDto); when(matchingServiceClient.makeMatchingServiceRequest(matchingServiceRequestDto)).thenReturn(matchingServi...
public void shouldHandleValidAQR(){ MatchingServiceRequestDto matchingServiceRequestDto = MatchingServiceRequestDtoBuilder.aMatchingServiceRequestDto().withHashedPid(PID).build(); MatchingServiceResponseDto matchingServiceResponseDto = MatchingServiceResponseDtoBuilder.aMatchingServiceResponseDto().build(); ...
20
public Result generateToken(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "expireTime") String expireTime){ logger.info("login user {}, generate token , userId : {} , token expire time : {}", loginUser, userId, expireTime); ...
public Result<String> generateToken(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "expireTime") String expireTime){ logger.info("login user {}, generate token , userId : {} , token expire time : {}", loginUser, userId, expireTime...
21
public boolean getLoggingSwitch(){ try { ApplicationInfo appInfo = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); boolean b = appInfo.metaData.getBoolean("LOGGING"); return b; } catch (PackageManager.NameNotFoundException e) { e.prin...
public boolean getLoggingSwitch(){ try { ApplicationInfo appInfo = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); return appInfo.metaData.getBoolean("LOGGING"); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } ...
22
public Result execute(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processInstanceId") Integer processInstanceId, @RequestParam("executeType") ExecuteType executeType...
public Result<Void> execute(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processInstanceId") Integer processInstanceId, @RequestParam("executeType") ExecuteType execu...
23
public Object eval(Bindings bindings, ELContext context){ try { evalResult = super.eval(bindings, context); hasEvalResult = true; return evalResult; } catch (DeferredParsingException e) { throw new DeferredParsingException(this, getPartiallyResolved(bindings, context, e, fa...
public Object eval(Bindings bindings, ELContext context){ return EvalResultHolder.super.eval(() -> super.eval(bindings, context), bindings, context); }
24
private void loadData(){ Log.e("ScreenRUn", "Load!1"); makeJsonObjectRequestPostHome(0, loadLimit); }
private void loadData(){ makeJsonObjectRequestPostHome(0, loadLimit); }
25
public Vector<String> toGo(){ return new Vector<String>() { { add("goto " + to); } }; }
public List<String> toGo(){ return Collections.singletonList("goto " + to); }
26
private static VarRef populateFieldAccess(JCVariableDecl rootVar, JavacResolution javacResolution, JavacNode annotationNode, int level, Type type, JCFieldAccess fa, boolean isMeth, List<JCExpression> args, ListBuffer<JCStatement> statements) throws TypeNotConvertibleException, SafeCallUnexpectedStateException, SafeCall...
private static VarRef populateFieldAccess(JCVariableDecl rootVar, JavacResolution javacResolution, JavacNode annotationNode, int fieldVarLevel, int lastLevel, Type type, JCFieldAccess fa, boolean isMeth, List<JCExpression> args, ListBuffer<JCStatement> statements) throws TypeNotConvertibleException, SafeCallUnexpectedS...
27
private StatisticsResponse createFakeStatistics(){ StatisticsModel modelCourse = new StatisticsModel(0, 0, 0, 0, 0, 0, 0, 0); StatisticsModel modelLevel = new StatisticsModel(0, 0, 0, 0, 0, 0, 0, 0); StatisticsResponse statistics = new StatisticsResponse(modelCourse, modelLevel); return statistics; ...
private StatisticsResponse createFakeStatistics(){ StatisticsModel modelCourse = new StatisticsModel(); StatisticsResponse statistics = new StatisticsResponse(modelCourse); return statistics; }
28
public void buildCodec(Channel channel, ConnectionImpl connection){ ChannelPipeline pipeline = channel.pipeline(); PacketDecoder decoder = new PacketDecoder(connection); PacketEncoder encoder = new PacketEncoder(connection); pipeline.addAfter(ChannelHandlers.RAW_CAPTURE_RECEIVE, ChannelHandlers.DECO...
public void buildCodec(Channel channel, ConnectionImpl connection){ connection.initCodec(PacketCodec.instance); channel.pipeline().addAfter(ChannelHandlers.RAW_CAPTURE_RECEIVE, ChannelHandlers.DECODER_TRANSFORMER, new PacketDecoder(connection)).addAfter(ChannelHandlers.RAW_CAPTURE_SEND, ChannelHandlers.ENCODE...
29
public String trackSubdivision(Model model, HttpSession session, @PathVariable("subdivision.id") Long subdivisionId){ List<Buttons> buttons = buttonsService.getAllWhereParentIdIsNull(new Sort(Sort.Direction.ASC, "id")); model.addAttribute("buttons", buttons); List<Buttons> button = buttonsService.getAllW...
public String trackSubdivision(Model model, HttpSession session, @PathVariable("subdivision.id") Long subdivisionId){ List<Buttons> buttons = buttonsService.getAllWhereParentIdIsNull(new Sort(Sort.Direction.ASC, "id")); model.addAttribute("buttons", buttons); List<Buttons> button = buttonsService.getAllW...
30
public View getPrototypeView(Context context){ View prototypeView = super.getPrototypeView(context); Spinner variableSpinner = (Spinner) prototypeView.findViewById(R.id.change_variable_spinner); DataAdapter dataAdapter = ProjectManager.getInstance().getCurrentlyEditedScene().getDataContainer().createData...
public View getPrototypeView(Context context){ View prototypeView = super.getPrototypeView(context); Spinner variableSpinner = prototypeView.findViewById(R.id.change_variable_spinner); DataAdapter dataAdapter = ProjectManager.getInstance().getCurrentlyEditedScene().getDataContainer().createDataAdapter(co...
31
public OptionalInt getTotal(final Job<?, ?> job){ Predicate<JobAction> predicate; if (selectTools) { predicate = action -> StringContainsUtils.containsAnyIgnoreCase(action.getId(), getIds()); } else { predicate = action -> true; } return job.getActions(JobAction.class).stream(...
public OptionalInt getTotal(final Job<?, ?> job){ return job.getActions(JobAction.class).stream().filter(createToolFilter(selectTools, tools)).map(JobAction::getLatestAction).filter(Optional::isPresent).map(Optional::get).map(ResultAction::getResult).mapToInt(AnalysisResult::getTotalSize).reduce(Integer::sum); }
32
public void ending(Graphics g){ int tempY = y; int index = -1; if (!musicPlayed) { music.setSong(99); music.play(); musicPlayed = true; } if (!recorded) recordPosition(g); try { Thread.sleep(7); } catch (InterruptedException e) { S...
public void ending(Graphics g){ int tempY = y; int index = -1; if (!musicPlayed) { music.setSong(99); music.play(); musicPlayed = true; } if (!recorded) recordPosition(g); try { Thread.sleep(7); } catch (InterruptedException e) { S...
33
private Response handleError(String chargeId, GatewayError error){ switch(error.getErrorType()) { case UNEXPECTED_HTTP_STATUS_CODE_FROM_GATEWAY: case MALFORMED_RESPONSE_RECEIVED_FROM_GATEWAY: case GATEWAY_URL_DNS_ERROR: case GATEWAY_CONNECTION_TIMEOUT_ERROR: case GATEWA...
private Response handleError(String chargeId, GatewayError error){ switch(error.getErrorType()) { case GATEWAY_CONNECTION_TIMEOUT_ERROR: case OTHER: return serviceErrorResponse(error.getMessage()); default: logger.error("Charge {}: error {}", chargeId, error.get...
34
public Podcast patchUpdate(Podcast patchPodcast){ Podcast podcastToUpdate = this.findOne(patchPodcast.getId()); if (podcastToUpdate == null) throw new PodcastNotFoundException(); podcastToUpdate.setTitle(patchPodcast.getTitle()); podcastToUpdate.setUrl(patchPodcast.getUrl()); podcastTo...
public Podcast patchUpdate(Podcast patchPodcast){ Podcast podcastToUpdate = this.findOne(patchPodcast.getId()); if (podcastToUpdate == null) throw new PodcastNotFoundException(); if (!coverBusiness.hasSameCoverURL(patchPodcast, podcastToUpdate)) { patchPodcast.getCover().setUrl(coverBus...
35
void updateAllStreets(){ for (int i = 0; i < GameState.getInstance().getAllDeeds().size(); i++) { if (GameState.getInstance().getAllDeeds().get(i) instanceof Street) { final Street s = (Street) GameState.getInstance().getAllDeeds().get(i); if (s.getHouseCount() != 0) { ...
void updateAllStreets(){ for (int i = 0; i < GameState.getInstance().getAllDeeds().size(); i++) { if (GameState.getInstance().getAllDeeds().get(i) instanceof Street) { final Street s = (Street) GameState.getInstance().getAllDeeds().get(i); if (s.getHouseCount() != 0) { ...
36
public Time calculateTime(SpeedForm speedForm){ String majorUnit = ((majorUnit = speedForm.getDistanceMajorUnit()) != null) ? majorUnit : "kilometer"; String minorUnit = ((minorUnit = speedForm.getDistanceMinorUnit()) != null) ? minorUnit : "meter"; String speedUnit = ((speedUnit = speedForm.getSpeedUnit...
public Time calculateTime(SpeedForm speedForm){ UnitParser unitParser = new UnitParser(speedForm).invoke(); TimeCalculator timeCalculator = TimeCalculatorFactory.buildFromSpeed(speedForm, unitParser.getMajorUnit(), unitParser.getMinorUnit()); return timeCalculator.computeTime(); }
37
private CompactionUnit pickForSizeRatio(int maxLevel, List<SortedRun> runs){ int candidateCount = 0; int startIndex = 0; boolean pickByRatio = false; for (int i = 0; i < runs.size(); i++) { SortedRun run = runs.get(i); candidateCount = 1; long candidateSize = run.size(); ...
private CompactionUnit pickForSizeRatio(int maxLevel, List<SortedRun> runs){ for (int i = 0; i < runs.size(); i++) { int candidateCount = 1; long candidateSize = runs.get(i).size(); for (int j = i + 1; j < runs.size(); j++) { SortedRun next = runs.get(j); if (ca...
38
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_chatting_resolved); assignViews(); KeyboardUtil.attach(this, mPanelRoot); sendImgTv.setOnClickListener(new View.OnClickListener() { @Override public void ...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_chatting_resolved); assignViews(); KeyboardUtil.attach(this, mPanelRoot, new KeyboardUtil.OnKeyboardShowingListener() { @Override public void onKeyboardShowing...
39
public void onResult(User user){ if (user == null) { listener.onResult(LoginAttemptListener.INC_USERNAME); return; } if (user.getPassword().equals(enteredPassword)) { currentUser = user; listener.onResult(LoginAttemptListener.SUCCESS); } else { currentUse...
public void onResult(User user){ if (user == null) { listener.onResult(LoginAttemptListener.INC_USERNAME); return; } if (user.getPassword().equals(enteredPassword)) { masterVM.setCurrentUser(user); listener.onResult(LoginAttemptListener.SUCCESS); } else { ...
40
void startTask(HSSource gearSource, String[] tasks){ if (!mRunning) { mGearSource = gearSource; mTasks = new ArrayList<>(Arrays.asList(tasks)); mTask = new Task(); mTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, tasks); mResponse = new TaskResponse(); ...
void startTask(HSSource gearSource, String[] tasks){ if (!mRunning) { mGearSource = gearSource; mTasks = new ArrayList<>(Arrays.asList(tasks)); mTask = new Task(); mTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, tasks); mRunning = true; } }
41
public Map<String, Object> querySchedule(User loginUser, String projectName, Integer processDefineId, String searchVal, Integer pageNo, Integer pageSize){ HashMap<String, Object> result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); boolean hasProjectAndPerm = projectService...
public Result<PageListVO<Schedule>> querySchedule(User loginUser, String projectName, Integer processDefineId, String searchVal, Integer pageNo, Integer pageSize){ Project project = projectMapper.queryByName(projectName); CheckParamResult checkResult = projectService.hasProjectAndPerm(loginUser, project); ...
42
public Map<K, Object> executeOnKeys(Set<K> keys, EntryProcessor entryProcessor){ Set<Data> dataKeys = new HashSet<Data>(keys.size()); for (K key : keys) { dataKeys.add(toData(key)); } MapExecuteOnKeysRequest request = new MapExecuteOnKeysRequest(name, entryProcessor, dataKeys); MapEntr...
public Map<K, Object> executeOnKeys(Set<K> keys, EntryProcessor entryProcessor){ Set<Data> dataKeys = new HashSet<Data>(keys.size()); for (K key : keys) { dataKeys.add(toData(key)); } MapExecuteOnKeysRequest request = new MapExecuteOnKeysRequest(name, entryProcessor, dataKeys); MapEntr...
43
public List<ProviderMessageContent> buildMessageContents(Long notificationId, Date providerCreationDate, ConfigurationJobModel job, PolicyOverrideNotificationView notificationView, BlackDuckBucket blackDuckBucket, BlackDuckServicesFactory blackDuckServicesFactory){ long timeout = blackDuckServicesFactory.getBlackD...
public List<ProviderMessageContent> buildMessageContents(Long notificationId, Date providerCreationDate, ConfigurationJobModel job, PolicyOverrideNotificationView notificationView, BlackDuckBucket blackDuckBucket, BlackDuckServicesFactory blackDuckServicesFactory){ long timeout = blackDuckServicesFactory.getBlackD...
44
public void onAttach(Activity activity){ try { positiveListener = (PositiveListener) activity; } catch (ClassCastException exception) { throw new ClassCastException(activity.toString() + " must implement BaseDialogFragment.PositiveListener"); } if (activity instanceof NegativeListe...
public void onAttach(Activity activity){ if (activity instanceof MsgDialogCallBack) { mListener = (MsgDialogCallBack) activity; } super.onAttach(activity); }
45
public void setDelegate(){ final ExtensibleConfigurationPersister configurationPersister = new EmptyConfigurationPersister(); final boolean isMaster = false; final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry = new IgnoredDomainResourceRegistry(hostControllerInfo); final PathManagerSe...
public void setDelegate(){ final ExtensibleConfigurationPersister configurationPersister = new EmptyConfigurationPersister(); final boolean isMaster = false; final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry = new IgnoredDomainResourceRegistry(hostControllerInfo); final PathManagerSe...
46
private void createVideoView(@NonNull final View rootView){ String url = getURLToUse(); playerView = rootView.findViewById(R.id.recipeinfo_step_video); final ImageView ivThumbnail = rootView.findViewById(R.id.recipeinfo_step_video_thumbnail); if ((!AppUtil.isEmpty(url)) && (!"IMAGE_MEDIA".equals(url...
private void createVideoView(@NonNull final View rootView){ String url = getURLToUse(); final ImageView ivThumbnail = rootView.findViewById(R.id.recipeinfo_step_video_thumbnail); mPlayerView = rootView.findViewById(R.id.recipeinfo_step_video); if ((!AppUtil.isEmpty(url)) && (!"IMAGE_MEDIA".equals(ur...
47
public Object getFirstValueFromJSONArray(String key) throws Exception{ Object valueToReturn; try { object = parser.parse(new FileReader(file)); jsonObject = (JSONObject) object; if (jsonObject.containsKey(key)) { if (jsonObject.get(key) instanceof JSONArray) { ...
public Object getFirstValueFromJSONArray(String key) throws Exception{ Object valueToReturn; try { object = parser.parse(new FileReader(file)); jsonObject = (JSONObject) object; valueToReturn = accessJSON.getFirstValueFromJSONArray(jsonObject, key); } catch (ParseException e) {...
48
public void doList(List<UrlCapsule> urlCapsules, T params, int count){ StringBuilder a = new StringBuilder(); for (int i = 0; i < 10 && i < urlCapsules.size(); i++) { a.append(i + 1).append(urlCapsules.get(i).toEmbedDisplay()); } DiscordUserDisplay userInfoConsideringGuildOrNot = CommandUti...
public void doList(List<UrlCapsule> urlCapsules, T params, int count){ DiscordUserDisplay userInfoConsideringGuildOrNot = CommandUtil.getUserInfoEscaped(params.getE(), params.getDiscordId()); EmbedBuilder embedBuilder = configEmbed(new ChuuEmbedBuilder(params.getE()).setThumbnail(userInfoConsideringGuildOrNot...
49
public void onAddWordBtnClicked(){ String word = wordField.getText(); String translation = translationField.getText(); WordEntry wordEntry = new WordEntry(word, translation); if (word.isEmpty()) { Alert alert = new Alert(Alert.AlertType.INFORMATION, "Word field must not be empty.", ButtonTy...
public void onAddWordBtnClicked(){ String word = wordField.getText(); String translation = translationField.getText(); WordEntry wordEntry = new WordEntry(word, translation); if (word.isEmpty() || translation.isEmpty()) { Alert alert = new Alert(Alert.AlertType.INFORMATION, "Word and Transl...
50
private void testShardBoundaries(int[] expected, int numShards, int numDisks, int[] rangeBounds){ IPartitioner partitioner = Murmur3Partitioner.instance; List<Splitter.WeightedRange> ranges = new ArrayList<>(); for (int i = 0; i < rangeBounds.length; i += 2) ranges.add(new Splitter.WeightedRange(1.0, new...
private void testShardBoundaries(int[] expected, int numShards, int numDisks, int[] rangeBounds){ IPartitioner partitioner = Murmur3Partitioner.instance; List<Splitter.WeightedRange> ranges = new ArrayList<>(); for (int i = 0; i < rangeBounds.length; i += 2) ranges.add(new Splitter.WeightedRange(1.0, new...
51
public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException{ Slider s = (Slider) w; String snippetName = "slider"; String snippet = getSnippet(snippetName); String frequency = s.getFrequency() == 0 ? "200" : Integer.toString(s.getFrequency()); snippet = StringUtils.repl...
public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException{ Slider s = (Slider) w; String snippetName = "slider"; String snippet = getSnippet(snippetName); String frequency = s.getFrequency() == 0 ? "200" : Integer.toString(s.getFrequency()); snippet = preprocessSnippe...
52
public void addPost(OnePost post) throws SQLException{ post.setStatusId(1); String plsql = "BEGIN PACKAGE_FORUM.INSERT_POST(?, ?, ?, ?); END;"; System.out.println("wtf"); CallableStatement statement = DatabaseConnection.getConnection().prepareCall(plsql); System.out.println(post.getContent()); ...
public void addPost(OnePost post) throws SQLException{ post.setStatusId(1); String plsql = "BEGIN PACKAGE_FORUM.INSERT_POST(?, ?, ?, ?); END;"; CallableStatement statement = DatabaseConnection.getConnection().prepareCall(plsql); statement.setString(1, post.getContent()); statement.setInt(2, pos...
53
final Set<String> getConfigurationValues(@Nonnull final LinkerContext context, @Nonnull final String propertyName){ final HashSet<String> set = new HashSet<>(); final SortedSet<ConfigurationProperty> properties = context.getConfigurationProperties(); for (final ConfigurationProperty configurationPropert...
final Set<String> getConfigurationValues(@Nonnull final LinkerContext context, @Nonnull final String propertyName){ final HashSet<String> set = new HashSet<>(); final SortedSet<ConfigurationProperty> properties = context.getConfigurationProperties(); for (final ConfigurationProperty configurationPropert...
54
public void processPdfFiles(List<Pdf> pdfs, List<ScannableItem> scannedItems){ List<ScannableItem> uploadedItems = new ArrayList<ScannableItem>(); List<FileUploadResponse> responses = documentManagementService.uploadDocuments(pdfs); Map<String, String> response = DocumentManagementService.convertResponse...
public void processPdfFiles(List<Pdf> pdfs, List<ScannableItem> scannedItems){ List<FileUploadResponse> responses = documentManagementService.uploadDocuments(pdfs); Map<String, String> response = DocumentManagementService.convertResponseToMap(responses); scannedItems.forEach(item -> { log.info(i...
55
public static List<R> processIntersectingRetrievals(List<IndexCall<R>> retrievals, final int limit){ Preconditions.checkArgument(!retrievals.isEmpty()); Preconditions.checkArgument(limit >= 0, "Invalid limit: %s", limit); List<R> results; int multiplier = Math.min(16, (int) Math.pow(2, retrievals.si...
public static List<R> processIntersectingRetrievals(List<IndexCall<R>> retrievals, final int limit){ Preconditions.checkArgument(!retrievals.isEmpty()); Preconditions.checkArgument(limit >= 0, "Invalid limit: %s", limit); List<R> results; int multiplier = Math.min(16, (int) Math.pow(2, retrievals.si...
56
static String formatTemperature(Context context, double temperature, boolean isMetric){ double temp; if (!isMetric) { temp = 9 * temperature / 5 + 32; } else { temp = temperature; } return context.getString(R.string.format_temperature, temp); }
public static String formatTemperature(Context context, double temperature){ String suffix = "\u00B0"; if (!isMetric(context)) { temperature = (temperature * 1.8) + 32; } return String.format(context.getString(R.string.format_temperature), temperature); }
57
public Node visitFunctionDefinitionStatement(Mx_starParser.FunctionDefinitionStatementContext ctx){ String name = ctx.Identifier().getText(); String rtype = ctx.type().getText(); String trace = dom.getClassTrace(); if (!rtype.equals("void") && !typeList.hasType(rtype)) { assert false; ...
public Node visitFunctionDefinitionStatement(Mx_starParser.FunctionDefinitionStatementContext ctx){ String name = ctx.Identifier().getText(); String rtype = ctx.type().getText(); String trace = dom.getClassTrace(); if (!rtype.equals("void") && !typeList.hasType(rtype)) { assert false; ...
58
public Mono<CollectionModel<EntityModel<HouseholdSearch>>> getHouseholds(ServerWebExchange exchange){ MultiValueMap<String, String> queryParams = exchange.getRequest().getQueryParams(); String hostName = queryParams.getFirst("host"); String address = queryParams.getFirst("address"); Flux<HouseholdSe...
public Mono<CollectionModel<EntityModel<HouseholdSearch>>> getHouseholds(ServerWebExchange exchange){ MultiValueMap<String, String> queryParams = exchange.getRequest().getQueryParams(); Flux<HouseholdSearch> householdSearchFlux = householdSearchService.getHouseholdsByFilters(queryParams); return assemble...
59
public boolean updateEvent(String event, String email){ Person p = emailPersonMap.get(email); if (p == null) { return false; } switch(event) { case "checkIn": if (p.getData().isCheckedIn()) { return false; } updateDB(email); ...
public boolean updateEvent(String event, String email){ Person p = emailPersonMap.get(email); if (p == null) { return false; } switch(event) { case "checkIn": if (p.getData().isCheckedIn()) { return false; } p.getData().setChe...
60
public void onCreate(){ LogWrapper.log(Log.INFO, LOG_TAG, "Creating DNS VPN service"); VpnController.getInstance().setIntraVpnService(this); firebaseAnalytics = FirebaseAnalytics.getInstance(this); syncNumRequests(); }
public void onCreate(){ LogWrapper.log(Log.INFO, LOG_TAG, "Creating DNS VPN service"); VpnController.getInstance().setIntraVpnService(this); syncNumRequests(); }
61
public void testCreateSFSGeneratesFileSystemCredentials(){ AtomicBoolean tested = new AtomicBoolean(false); String expectedFileName = "expectedFile"; File expectedFile = new File(directory.getAbsolutePath() + File.separator + expectedFileName); FileSelectActivity activity = Robolectric.setupActivity...
public void testCreateSFSGeneratesFileSystemCredentials(){ AtomicBoolean tested = new AtomicBoolean(false); String expectedFileName = "expectedFile"; File expectedFile = new File(directory.getAbsolutePath() + File.separator + expectedFileName); CreateSecureFileSystem createSecureFileSystem = Robolec...
62
public boolean write(HttpObject o){ if (o instanceof HttpHeaders) { logBuilder.startResponse(); final HttpHeaders headers = (HttpHeaders) o; final HttpStatus status = headers.status(); if (status != null && status.codeClass() != HttpStatusClass.INFORMATIONAL) { logB...
public boolean write(HttpObject o){ if (o instanceof HttpHeaders) { logBuilder.startResponse(); final HttpHeaders headers = (HttpHeaders) o; final HttpStatus status = headers.status(); if (status != null && status.codeClass() != HttpStatusClass.INFORMATIONAL) { logB...
63
public String logout(){ Cookie[] cookies = request.getCookies(); for (Cookie c : cookies) { if (c.getName().equals("name")) { if (c.getValue() == null) { return "redirect:"; } } } cookie = new Cookie("name", ""); cookie.setMaxAge(0); ...
public String logout(){ cookie = new Cookie("name", ""); cookie.setMaxAge(0); cookie.setPath("/"); response.addCookie(cookie); return "redirect:"; }
64
public int countDragons(ArrayList<Combination> win){ int count = 0; for (int i = 0; i < 4; i++) { if (win.get(i).getSuit() == 'H') { if (win.get(i).getTile(0).getRank() > 4) count++; } } return count; }
public int countDragons(ArrayList<Combination> win){ int count = 0; for (int i = 0; i < 4; i++) { if (isDragonTiles(win.get(i))) count++; } return count; }
65
private static String internalDecode(ProtonBuffer buffer, final int length, CharsetDecoder decoder){ final char[] chars = new char[length]; final int bufferInitialPosition = buffer.getReadIndex(); int offset; for (offset = 0; offset < length; offset++) { final byte b = buffer.getByte(buffer...
private static String internalDecode(ProtonBuffer buffer, final int length, CharsetDecoder decoder, char[] scratch){ final int bufferInitialPosition = buffer.getReadIndex(); int offset; for (offset = 0; offset < length; offset++) { final byte b = buffer.getByte(bufferInitialPosition + offset); ...
66
public PartyDTO getPartyByPartyCode(String partyCode){ if (Strings.isNullOrEmpty(partyCode)) throw new InvalidDataException("Party Code is required"); final TMsParty tMsParty = partyRepository.findByPrtyCodeAndPrtyStatus(partyCode, Constants.STATUS_ACTIVE.getShortValue()); if (tMsParty == null) ...
public PartyDTO getPartyByPartyCode(String partyCode){ final TMsParty tMsParty = validateByPartyCode(partyCode); PartyDTO partyDTO = PartyMapper.INSTANCE.entityToDTO(tMsParty); setReferenceData(tMsParty, partyDTO); final List<PartyContactDTO> contactDTOList = partyContactService.getContactsByPartyCo...
67
public boolean checkRentalAvailable(Integer currentBookCnt){ if (this.rentalStatus != RentalStatus.RENT_UNAVAILABLE) { if (currentBookCnt + 1 > 5) { System.out.println("대출 가능한 도서의 수는 " + (5 - this.getRentedItems().size()) + "권 입니다."); return false; } else { ...
public boolean checkRentalAvailable(Integer newBookListCnt) throws Exception{ if (this.rentalStatus != RentalStatus.RENT_UNAVAILABLE) throw new Exception("연체 상태입니다."); if (this.getLateFee() == 0) throw new Exception("연체료를 정산 후, 도서를 대여하실 수 있습니다."); if (newBookListCnt + this.getRentedItem...
68
public void contextDestroyed(ServletContextEvent sce){ tokenService.deleteAllInBatch(); System.out.println("Servlet Context is destroyed...."); }
public void contextDestroyed(ServletContextEvent sce){ System.out.println("Servlet Context is destroyed...."); }
69
public ValueTypeDTO getValueType(final String valueTypeIdentifier){ if (checkIfIndexExists(ELASTIC_INDEX_VALUETYPE)) { final ObjectMapper mapper = new ObjectMapper(); registerModulesToMapper(mapper); final SearchRequest searchRequest = new SearchRequest(); searchRequest.indices(...
public ValueTypeDTO getValueType(final String valueTypeIdentifier){ if (checkIfIndexExists(ELASTIC_INDEX_VALUETYPE)) { final ObjectMapper mapper = new ObjectMapper(); registerModulesToMapper(mapper); final SearchRequest searchRequest = createSearchRequest(ELASTIC_INDEX_VALUETYPE); ...
70
public int getAgeSetIndex(CharID id){ BioSet bioSet = bioSetFacet.get(id); Optional<Region> region = regionFacet.getRegion(id); Race race = raceFacet.get(id); String raceName = race == null ? "" : race.getKeyName().trim(); List<String> values = bioSet.getValueInMaps(region, raceName, "BASEAGE")...
public int getAgeSetIndex(CharID id){ BioSet bioSet = bioSetFacet.get(id); Optional<Region> region = regionFacet.getRegion(id); Race race = raceFacet.get(id); String raceName = race == null ? "" : race.getKeyName().trim(); List<String> values = bioSet.getValueInMaps(region, raceName, "BASEAGE")...
71
private static Map<String, Object> overrideConfiguration(){ Map<String, Object> overrideData = new HashMap<String, Object>(); try { URI databaseURI = new URI(System.getenv("DATABASE_URL")); String username = "postgres"; String password = ""; if (databaseURI.getUserInfo() !=...
private static Map<String, Object> overrideConfiguration(){ Map<String, Object> overrideData = new HashMap<>(); try { URI databaseURI = new URI(System.getenv("DATABASE_URL")); String username = "postgres"; String password = ""; if (databaseURI.getUserInfo() != null) { ...
72
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View view = inflater.inflate(R.layout.fragment_alert_form, container, false); Button buttonPhoto = view.findViewById(R.id.take_photo_btn); Button buttonUploader = view.findViewById(R.id.upload_form); B...
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View view = inflater.inflate(R.layout.fragment_alert_form, container, false); Button buttonPhoto = view.findViewById(R.id.take_photo_btn); Button buttonUploader = view.findViewById(R.id.upload_form); B...
73
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{ resp.setCharacterEncoding(DEFAULT_ENCODING); String parameter = req.getParameter(USER); StringBuilder sql = new StringBuilder("SELECT STRAIGHT_JOIN f.follower_email FROM").append(Helper.TABLE_USER...
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{ resp.setCharacterEncoding(DEFAULT_ENCODING); String parameter = req.getParameter(USER); StringBuilder sql = new StringBuilder("SELECT * FROM ").append(DBHelper.TABLE_USER).append("u INNER JOIN (")...
74
public HttpResponse<Void> ferdigstill(FerdigstillJournalpostRequest ferdigstillJournalpostRequest){ var oppdaterJoarnalpostApiUrl = URL_JOURNALPOSTAPI_V1 + '/' + ferdigstillJournalpostRequest.getJournalpostId() + "/ferdigstill"; var oppdaterJournalpostResponseEntity = restTemplate.exchange(oppdaterJoarnalpost...
public void ferdigstill(FerdigstillJournalpostRequest ferdigstillJournalpostRequest){ var oppdaterJoarnalpostApiUrl = URL_JOURNALPOSTAPI_V1 + '/' + ferdigstillJournalpostRequest.getJournalpostId() + "/ferdigstill"; restTemplate.exchange(oppdaterJoarnalpostApiUrl, HttpMethod.PATCH, new HttpEntity<>(ferdigstill...
75
private LogicalExpression materializeExpression(LogicalExpression expression, IterOutcome lastStatus, VectorAccessible input, ErrorCollector collector) throws ClassTransformationException{ LogicalExpression materializedExpr; if (lastStatus != IterOutcome.NONE) { materializedExpr = ExpressionTreeMater...
private LogicalExpression materializeExpression(LogicalExpression expression, IterOutcome lastStatus, VectorAccessible input, ErrorCollector collector){ LogicalExpression materializedExpr; if (lastStatus != IterOutcome.NONE) { materializedExpr = ExpressionTreeMaterializer.materialize(expression, inpu...
76
public void processElement(ProcessContext c) throws IOException{ RecalibrationTables rt = c.element(); SAMFileHeader header = c.sideInput(headerView); File temp = IOUtils.createTempFile("temp-recalibrationtable-", ".tmp"); if (null == rt) { log.debug("Special case: zero reads in input."); ...
public void processElement(ProcessContext c) throws IOException{ RecalibrationTables rt = c.element(); SAMFileHeader header = c.sideInput(headerView); File temp = IOUtils.createTempFile("temp-recalibrationtable-", ".tmp"); if (null == rt) { log.debug("Special case: zero reads in input."); ...
77
public void shouldAppendToStream() throws Exception{ when(eventRepository.getCurrentSequenceIdForStream(STREAM_ID)).thenReturn(INITIAL_VERSION); eventStreamManager.append(STREAM_ID, singletonList(envelope().with(metadataOf(ID_VALUE, NAME_VALUE)).withPayloadOf(PAYLOAD_FIELD_VALUE, PAYLOAD_FIELD_NAME).build())....
public void shouldAppendToStream() throws Exception{ when(eventRepository.getCurrentSequenceIdForStream(STREAM_ID)).thenReturn(INITIAL_VERSION); eventStreamManager.append(STREAM_ID, Stream.of(envelope().with(metadataOf(ID_VALUE, NAME_VALUE)).withPayloadOf(PAYLOAD_FIELD_VALUE, PAYLOAD_FIELD_NAME).build())); ...
78
public NBTTagCompound getUpdateTag(){ final NBTTagCompound tagCompound = new NBTTagCompound(); writeToNBT(tagCompound); tagCompound.removeTag(ICoreSignature.UUID_MOST_TAG); tagCompound.removeTag(ICoreSignature.UUID_LEAST_TAG); tagCompound.removeTag(IBeamFrequency.BEAM_FREQUENCY_TAG); retur...
public NBTTagCompound getUpdateTag(){ final NBTTagCompound tagCompound = super.getUpdateTag(); tagCompound.removeTag(ICoreSignature.UUID_MOST_TAG); tagCompound.removeTag(ICoreSignature.UUID_LEAST_TAG); tagCompound.removeTag(IBeamFrequency.BEAM_FREQUENCY_TAG); return tagCompound; }
79
public int search(int[] A, int target){ if (A.length == 0) return -1; int start = 0; int end = A.length - 1; while (start < end) { int mid = (start + end) / 2; if (A[mid] == target) return mid; if (A[start] <= A[mid]) { if (target >= A[st...
public int search(int[] A, int target){ if (A.length == 0) return -1; int start = 0; int end = A.length - 1; while (start < end) { int mid = (start + end) / 2; if (A[mid] == target) return mid; if (A[start] <= A[mid]) { if (target >= A[st...
80
private void setReadMarkers(final String aReadMarkerEventId, final String aReadReceiptEventId, final ApiCallback<Void> callback){ Log.d(LOG_TAG, "## setReadMarkers(): readMarkerEventId " + aReadMarkerEventId + " readReceiptEventId " + aReadMarkerEventId); final String readMarkerEventId = MXSession.isMessageId...
private void setReadMarkers(final String aReadMarkerEventId, final String aReadReceiptEventId, final ApiCallback<Void> callback){ Log.d(LOG_TAG, "## setReadMarkers(): readMarkerEventId " + aReadMarkerEventId + " readReceiptEventId " + aReadMarkerEventId); final String readMarkerEventId = MXSession.isMessageId...
81
public String panel(Model model, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "5") Integer size, @RequestParam(defaultValue = "id") String sortBy, @RequestParam(defaultValue = "true") Boolean asc){ String userEmail = SecurityContextHolder.getContext().getAuthentication().getName(); ...
public String panel(@AuthenticationPrincipal User authUser, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "5") Integer size, @RequestParam(defaultValue = "id") String sortBy, @RequestParam(defaultValue = "true") Boolean asc, Model model){ User user = userService.getUserByEmail(authUs...
82
public Result updateProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("projectId") Integer projectId, @RequestParam("projectName") String projectName, @RequestParam(value = "description", required = false) String description){ logger.info("login user {} , updateProc...
public Result<Void> updateProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("projectId") Integer projectId, @RequestParam("projectName") String projectName, @RequestParam(value = "description", required = false) String description){ logger.info("login user {} , upda...
83
public List<BusinessUnitDTO> findAllSortedBUDTO(@RequestParam(value = QueryConstants.SORT_BY) final String sortBy, @RequestParam(value = QueryConstants.SORT_ORDER) final String sortOrder){ List<BusinessUnitDTO> returnList = new ArrayList<>(); for (Iterator<BusinessUnit> iterBU = findAllSortedInternal(sortBy, ...
public List<BusinessUnitDTO> findAllSortedBUDTO(@RequestParam(value = QueryConstants.SORT_BY) final String sortBy, @RequestParam(value = QueryConstants.SORT_ORDER) final String sortOrder){ List<BusinessUnitDTO> returnList = buildBuindessUnitDTOList(findAllSortedInternal(sortBy, sortOrder)); return returnList;...
84
public void testPythonMultipleOutputs() throws Exception{ Operation additionSubtraction = new PythonScriptOperation(PythonTest.class.getResource("/edu/wpi/grip/scripts/addition-subtraction.py")); Step step = new Step.Factory(eventBus, (origin) -> new MockExceptionWitness(eventBus, origin)).create(additionSubt...
public void testPythonMultipleOutputs() throws Exception{ Step step = new Step.Factory((origin) -> new MockExceptionWitness(eventBus, origin)).create(PythonScriptFile.create(PythonTest.class.getResource("/edu/wpi/grip/scripts/addition-subtraction.py")).toOperationMetaData(isf, osf)); Socket aSocket = step.get...
85
public List<Match> getNonOverlappingMatches(Clause clause){ var skipList = memoTable.get(clause); if (skipList == null) { return Collections.emptyList(); } var firstEntry = skipList.firstEntry(); var nonoverlappingMatches = new ArrayList<Match>(); if (firstEntry != null) { ...
public List<Match> getNonOverlappingMatches(Clause clause){ var skipList = memoTable.get(clause); if (skipList == null) { return Collections.emptyList(); } var firstEntry = skipList.firstEntry(); var nonoverlappingMatches = new ArrayList<Match>(); if (firstEntry != null) { ...
86
public boolean onTouchEvent(MotionEvent event){ int actionMasked = MotionEventCompat.getActionMasked(event); switch(event.getAction() & actionMasked) { case MotionEvent.ACTION_DOWN: { startClickTime = SystemClock.currentThreadTimeMillis(); break; ...
public boolean onTouchEvent(MotionEvent event){ int actionMasked = MotionEventCompat.getActionMasked(event); switch(event.getAction() & actionMasked) { case MotionEvent.ACTION_DOWN: { cx = event.getX(); cy = event.getY(); ripple(); ...
87
public static long findMyBoardingPass(String fileName){ List<String> passes = readInBoardingPasses(fileName); List<Long> seatIds = passes.stream().map(boardingPass -> getBoardingPassSeatId(boardingPass)).sorted().collect(Collectors.toList()); long mySeatId = -1; for (Long seatId : seatIds) { ...
public static long findMyBoardingPass(String fileName){ List<String> passes = readInBoardingPasses(fileName); return passes.stream().map(boardingPass -> getBoardingPassSeatId(boardingPass)).sorted().collect(Collectors.reducing(-1, (mySeatId, seatId) -> (mySeatId.longValue() == -1L || seatId.longValue() <= myS...
88
public void onNext(Integer t){ try { Thread.sleep(1); } catch (InterruptedException e) { } if (counter.getAndIncrement() % 100 == 0) { System.out.print("testIssue2890NoStackoverflow -> "); System.out.println(counter.get()); } ; }
public void onNext(Integer t){ try { Thread.sleep(1); } catch (InterruptedException e) { } if (counter.getAndIncrement() % 100 == 0) { System.out.print("testIssue2890NoStackoverflow -> "); System.out.println(counter.get()); } }
89
public Set<Car> findAllByOwnerId(long id) throws SQLException, NamingException{ Context ctx = new InitialContext(); Context envContext = (Context) ctx.lookup("java:comp/env"); DataSource dataSource = (DataSource) envContext.lookup("jdbc/TestDB"); Connection con = null; try { con = data...
public Set<Car> findAllByOwnerId(long id) throws SQLException, NamingException{ Connection con = null; try { con = dataSource.getConnection(); PreparedStatement findAllCarsByOwnerIdStatement = con.prepareStatement("SELECT * FROM cars WHERE owner_id = ?"); findAllCarsByOwnerIdStateme...
90
public int reserveGameId(){ Statement statement = null; ResultSet result = null; try { statement = connection.createStatement(); statement.executeUpdate("INSERT INTO games () VALUES ()"); result = statement.executeQuery("SELECT LAST_INSERT_ID();"); if (result.next()) {...
public int reserveGameId(){ return errorHandler(-1, (statement, result) -> { statement = connection.createStatement(); statement.executeUpdate("INSERT INTO games () VALUES ()"); result = statement.executeQuery("SELECT LAST_INSERT_ID();"); if (result.next()) { return...
91
public void buildtrace(ByteCodeGraph graph){ StmtNode stmt = buildstmt(graph); ParseInfo info = graph.parseinfo; List<Node> prednodes = new ArrayList<Node>(); List<Node> usenodes = new ArrayList<Node>(); Node defnode = null; int varindex = info.getintvalue("VAR"); int incconst = info....
public void buildtrace(ByteCodeGraph graph){ StmtNode stmt = buildstmt(graph); ParseInfo info = graph.parseinfo; List<Node> prednodes = new ArrayList<Node>(); List<Node> usenodes = new ArrayList<Node>(); Node defnode = null; int varindex = info.getintvalue("VAR"); int incconst = info....
92
public void Execute(Rover rover, Plateau plateau) throws ProgramException{ for (char command : getCommands().toCharArray()) { switch(command) { case 'L': rover.setDirection(Direction.GetLeft(rover.getDirection())); break; case 'R': ...
public void Execute(Rover rover, Plateau plateau) throws ProgramException{ for (char command : getCommands().toCharArray()) { switch(command) { case 'L': rover.setDirection(Direction.GetLeft(rover.getDirection())); break; case 'R': ...
93
public void onVspReceiveData(BluetoothGatt gatt, BluetoothGattCharacteristic ch){ mRxBuffer.write(ch.getStringValue(0)); while (mRxBuffer.read(mRxDest, "\r") != 0) { Log.i(TAG, "Data received: " + StringEscapeUtils.escapeJava(mRxDest.toString())); switch(mFifoAndVspManagerState) { ...
public void onVspReceiveData(BluetoothGatt gatt, BluetoothGattCharacteristic ch){ mRxBuffer.write(ch.getStringValue(0)); while (mRxBuffer.read(mRxDest, "\r") != 0) { Log.i(TAG, "Data received: " + StringEscapeUtils.escapeJava(mRxDest.toString())); if (mFifoAndVspManagerState == FifoAndVspMan...
94
protected BrokerPool startDB(){ try { Configuration config = new Configuration(); BrokerPool.configure(1, 5, config); return BrokerPool.getInstance(); } catch (Exception e) { fail(e.getMessage()); } return null; }
protected BrokerPool startDB() throws DatabaseConfigurationException, EXistException{ final Configuration config = new Configuration(); BrokerPool.configure(1, 5, config); return BrokerPool.getInstance(); }
95
public String getEncryptedData(String alias){ if (alias == null || "".equals(alias)) { return alias; } if (!initialize || encryptedData.isEmpty()) { if (log.isDebugEnabled()) { log.debug("There is no secret found for alias '" + alias + "' returning itself"); } ...
public String getEncryptedData(String alias){ if (alias == null || "".equals(alias)) { return alias; } if (!initialize || encryptedData.isEmpty()) { if (log.isDebugEnabled()) { log.debug("There is no secret found for alias '" + alias + "' returning itself"); } ...
96
public static PrivateKey readKeyFile(String filePath) throws IOException, PKCSException, NoSuchAlgorithmException, InvalidKeySpecException{ Security.addProvider(new BouncyCastleProvider()); File file = ResourceUtils.getFile(filePath); logger.info(String.format("path is %s and %s and %s ", filePath, file...
public static PrivateKey readKeyFile(String filePath) throws IOException, PKCSException, NoSuchAlgorithmException, InvalidKeySpecException{ Security.addProvider(new BouncyCastleProvider()); File file = ResourceUtils.getFile(filePath); PemReader pemReader = new PemReader(new InputStreamReader(new FileInpu...
97
public synchronized int read(byte[] data){ this.data = data; this.header = getHeaderParser().setData(data).parseHeader(); if (data != null) { rawData = ByteBuffer.wrap(data); rawData.rewind(); rawData.order(ByteOrder.LITTLE_ENDIAN); mainPixels = new byte[header.width *...
public synchronized int read(byte[] data){ this.header = getHeaderParser().setData(data).parseHeader(); if (data != null) { rawData = ByteBuffer.wrap(data); rawData.rewind(); rawData.order(ByteOrder.LITTLE_ENDIAN); mainPixels = new byte[header.width * header.height]; ...
98
public void terminateFault(){ System.out.println("TerminateFault: Begin"); dispenseCtrl.allowSelection(false); coinReceiver.refundCash(); mediator.controllerChanged(this, new MediatorNotification(NotificationType.RefreshMachineryPanel)); System.out.println("TerminateFault: End"); }
public void terminateFault(){ System.out.println("TerminateFault: Begin"); dispenseCtrl.allowSelection(false); mediator.controllerChanged(this, new MediatorNotification(NotificationType.RefreshMachineryPanel)); System.out.println("TerminateFault: End"); }
99
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); this.createSampleData(); this.getSupportFragmentManager().registerFragmentLifecycleCallbacks(new FragmentLifecycleCallbacks(), false); if (savedInstanceState == null) ...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); this.getSupportFragmentManager().registerFragmentLifecycleCallbacks(new FragmentLifecycleCallbacks(), false); if (savedInstanceState == null) { this.getSupportFrag...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
7