blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 7 5.41M | extension stringclasses 11
values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6965ba1e6329f23ca0dc160f3b5facf49143cc2c | 0cf94e28169f5eaadd909fb3bfafb1a7ae61da81 | /src/main/java/code/PigLatin.java | 0e1bb36c5d2ee0e012990cc89c8cf03a8f83244c | [] | no_license | AndrewLupanov1991/codewars | 3b40e4a1e26afb06b51453d19d8e13b01cb41009 | f4fd8af5ba04b09a58b8de50d1872760fa77c843 | refs/heads/master | 2023-04-02T06:05:19.026693 | 2021-04-10T17:53:33 | 2021-04-10T17:53:33 | 356,646,341 | 0 | 0 | null | 2021-04-10T17:53:34 | 2021-04-10T17:08:10 | null | UTF-8 | Java | false | false | 768 | java | package code;
public class PigLatin {
public static String pigIt(String str) {
if (str.isEmpty()) {
return null;
}
String[] input = str.split(" ");
StringBuilder sb = new StringBuilder("");
String s = "!";
for (int i =0; i<input.length;i++) {
StringBuilder buf = new StringBuilder(input[i]);
if (buf.toString().equals(s) || buf.toString().equals("?") ) {
sb.append(buf.toString());
sb.append(" ");
continue;
}
sb.append(buf.substring(1,buf.length()));
sb.append(buf.charAt(0));
sb.append("ay");
sb.append(" ");
}
return sb.toString().trim();
}
}
| [
"pkmgl164@gmail.com"
] | pkmgl164@gmail.com |
79cc17ecd45a1c3be19654cfbdd4a81e2ec1533c | f8dc94201562bc9a0db5bc126ab4ad46d1edde19 | /doulin-service/src/main/java/com/doulin/service/TCarService.java | 33ad6d39ee82786e3d477c883d6046f880934957 | [] | no_license | 15638836857/boot-doulin | 1653c68f606eafdf36511ceb12540efc764cc6ad | c81eae312055f3b71b14496b7fe66925079b6e25 | refs/heads/master | 2023-05-12T13:57:51.454787 | 2021-05-19T11:54:27 | 2021-05-19T11:54:27 | 368,855,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | package com.doulin.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.doulin.entity.TCar;
import com.doulin.entity.vo.VQuery;
/**
* TCarService
*
* @Author malinging
* @Date 2021-04-09
**/
public interface TCarService extends IService<TCar> {
IPage<TCar> page(VQuery query);
}
| [
"15638836857@163.com"
] | 15638836857@163.com |
52601132bede4fec3908bec8f06d56a3d3b8f169 | 46c4cb9cc9434181ba0912c6d8d26dfdcf5dd8d0 | /src/Main.java | 8945e5bc26689f0dd946208515498ae68d4341fd | [] | no_license | datiechui-wzy/test | bd9da7f6b883c14aeb1546d7dae4a8a3ba1be66a | 601370613850f69c86296d39413fb1026cf8f4d9 | refs/heads/master | 2023-02-17T11:47:22.469563 | 2021-01-21T16:08:05 | 2021-01-21T16:08:05 | 331,662,974 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 186 | java | public class Main{
public static void main(String[] args) {
int[] i = {1,2,3,5};
for (int is:i
) {
System.out.println(is);
}
}
}
| [
"datiechui-wzy"
] | datiechui-wzy |
e65a27b71dd4b16977a3ebb69158ee744bb2ef08 | cdc7f7723934478d8fa764f64845e642f2a1bcff | /SyncCounter.java | 356c4ecda8d7d9e8503df893dc96500171ebd5db | [] | no_license | gavinuhran/Concurrency | 584dbc12b4359ed3ad6fae69bd2ace99577ec67b | c26b9514ba86d0baaa1900efacc445f3aad204ec | refs/heads/master | 2020-05-30T01:20:53.777179 | 2019-05-30T20:06:09 | 2019-05-30T20:06:09 | 189,475,137 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 241 | java | public class SyncCounter
{
private int count;
public SyncCounter()
{
count = 0;
}
public synchronized void increment()
{
count++;
}
public int getCount()
{
return count;
}
}
| [
"Barbara@RyzenBuild"
] | Barbara@RyzenBuild |
f1fb21f9386fcebc782e716443e2d64545b9d456 | 1232a5f9a4bf1aa877fd5d10b58f1041d6ac0083 | /src/com/fortunatePun/client/GreetingService.java | 3ff90772e8944bd385570a2c5a5c719fafc4f828 | [] | no_license | rbruggner/fortunatePun | 135b2d77cbc4cc6c2d9ffff812c7d404a0f9a0b6 | 2e4294dc6987da60632888b0ad6acd447abdd4b4 | refs/heads/master | 2021-01-01T20:05:29.551347 | 2014-01-26T22:55:40 | 2014-01-26T22:55:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package com.fortunatePun.client;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
* The client side stub for the RPC service.
*/
@RemoteServiceRelativePath("greet")
public interface GreetingService extends RemoteService {
String greetServer(String name) throws IllegalArgumentException;
}
| [
"rbruggner@gmail.com"
] | rbruggner@gmail.com |
c6dd098a090470e96ea6a6bc9f04da856e4976bb | cdfd3044e3c249f7f4f8824e6d3f6bae26ca393a | /src/main/java/com/gogo/base/lock/service/GenerateLockServiceImpl.java | c276b004cefa8ba8bbe38dce354f59278f98c6ef | [] | no_license | liujinwene/hibernate-demo | 3dac826212dba09dad2324ac39a1531b5f227990 | 0e7c79d19d7f30693f08fb739ed48ce2ee2d44d0 | refs/heads/master | 2021-01-19T20:50:31.972419 | 2017-04-18T10:19:21 | 2017-04-18T10:19:21 | 88,566,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 764 | java | package com.gogo.base.lock.service;
import java.util.concurrent.locks.Lock;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gogo.base.lock.MysqlNamedLock;
import com.gogo.base.lock.NamedLock;
@Service
public class GenerateLockServiceImpl implements GenerateLockService {
@Autowired
private SessionFactory sessionFactory;
@Override
public Lock getLock(Byte lockType, String key) throws Exception {
return null;
}
@Override
public NamedLock getNamedLock(String key) {
return new MysqlNamedLock(key, sessionFactory.openSession());
}
@Override
public String getKey(String type, String numberNo) {
return type + "-" + numberNo;
}
}
| [
"ljw@qq.com"
] | ljw@qq.com |
c9671717ede886a78a82fc4de58771e5eacf33d8 | fd1a20b6a131475b3eab4122b01b3256dd74aed5 | /Programowanie1/src/pl/mateusz/siedlecki/programowanie1/JavaStart/LambdaIInterfejsy/IncrementalPrinter.java | 7599c09a8fef1e7835c076925c43609abeeee3a8 | [] | no_license | SiedleckiMateusz/programowanie1 | 668c32ea90fa4c0ea53da32e50857128ca2f3151 | 558e4bf828b2954e99d32189a099df88ca1f632c | refs/heads/master | 2020-08-28T04:00:49.476384 | 2019-11-17T12:09:02 | 2019-11-17T12:09:02 | 217,581,677 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 162 | java | package pl.mateusz.siedlecki.programowanie1.JavaStart.LambdaIInterfejsy;
@FunctionalInterface
interface IncrementalPrinter<T> {
public T doSomething(T t);
}
| [
"siedleckimateus@gmail.com"
] | siedleckimateus@gmail.com |
d83b9eeaedcbc9d6f021ce83fbfc814f73abf4ab | 5e9d9f9c2d1d81e1e09d056ffb9ba139e29cf747 | /Inference_Andriod_App/src/org/tensorflow/yolo/model/BoxPosition.java | 1a289b4d8c919c9b94e7959fae8c9da4f0a490c6 | [
"WTFPL"
] | permissive | EmpireofKings/Weapon-Detector | ea56381779e43b451a234e56dd036cfa39edd7d4 | 966fc8cb1dd6778d747fcffdc3660fff0542742c | refs/heads/master | 2020-08-26T19:12:05.135576 | 2018-07-01T12:17:52 | 2018-07-01T12:17:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,731 | java | package org.tensorflow.yolo.model;
public class BoxPosition {
private float left;
private float top;
private float right;
private float bottom;
private float width;
private float height;
public BoxPosition(float left, float top, float width, float height) {
this.left = left;
this.top = top;
this.width = width;
this.height = height;
init();
}
public BoxPosition(BoxPosition boxPosition) {
this.left = boxPosition.left;
this.top = boxPosition.top;
this.width = boxPosition.width;
this.height = boxPosition.height;
init();
}
public void init() {
float tmpLeft = this.left;
float tmpTop = this.top;
float tmpRight = this.left + this.width;
float tmpBottom = this.top + this.height;
this.left = Math.min(tmpLeft, tmpRight); // left should have lower value as right
this.top = Math.min(tmpTop, tmpBottom); // top should have lower value as bottom
this.right = Math.max(tmpLeft, tmpRight);
this.bottom = Math.max(tmpTop, tmpBottom);
}
public float getLeft() {
return left;
}
public float getTop() {
return top;
}
public float getWidth() {
return width;
}
public float getHeight() {
return height;
}
public float getRight() {
return right;
}
public float getBottom() {
return bottom;
}
@Override
public String toString() {
return "BoxPosition{" +
"left=" + left +
", top=" + top +
", width=" + width +
", height=" + height +
'}';
}
}
| [
"gauravsawant9@gmail.com"
] | gauravsawant9@gmail.com |
497a13efa20068a7fbc2e5805bf28e6df98095f4 | 4d9b435644715734dd33067c655378d3385eaf41 | /app/src/main/java/com/marktony/zhihudaily/data/source/remote/GuokrHandpickNewsRemoteDataSource.java | 5ca0697655d0f2ffb070a5d2c42d94496d2ac080 | [
"Apache-2.0"
] | permissive | vanishiment/PaperPlane | aa61b7dc9f17a2ada5d571bc7a340e2e7841f00b | 44b44937dd7e773279552005c47aedce2256d609 | refs/heads/master | 2021-05-15T05:57:32.219087 | 2018-01-02T15:39:00 | 2018-01-02T15:39:00 | 116,030,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,927 | java | /*
* Copyright 2016 lizhaotailang
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.marktony.zhihudaily.data.source.remote;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.marktony.zhihudaily.data.GuokrHandpickNews;
import com.marktony.zhihudaily.data.GuokrHandpickNewsResult;
import com.marktony.zhihudaily.data.source.datasource.GuokrHandpickDataSource;
import com.marktony.zhihudaily.retrofit.RetrofitService;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by lizhaotailang on 2017/5/24.
*
* Implementation of the {@link GuokrHandpickNews} data source that accesses network.
*/
public class GuokrHandpickNewsRemoteDataSource implements GuokrHandpickDataSource{
@Nullable
private static GuokrHandpickNewsRemoteDataSource INSTANCE = null;
// Prevent direct instantiation.
private GuokrHandpickNewsRemoteDataSource() {}
public static GuokrHandpickNewsRemoteDataSource getInstance() {
if (INSTANCE == null) {
INSTANCE = new GuokrHandpickNewsRemoteDataSource();
}
return INSTANCE;
}
@Override
public void getGuokrHandpickNews(boolean forceUpdate, boolean clearCache, int offset, int limit, @NonNull LoadGuokrHandpickNewsCallback callback) {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(RetrofitService.GUOKR_HANDPICK_BASE)
.addConverterFactory(GsonConverterFactory.create())
.build();
RetrofitService.GuokrHandpickService service = retrofit.create(RetrofitService.GuokrHandpickService.class);
service.getGuokrHandpick(offset, limit)
.enqueue(new Callback<GuokrHandpickNews>() {
@Override
public void onResponse(Call<GuokrHandpickNews> call, Response<GuokrHandpickNews> response) {
callback.onNewsLoad(response.body().getResult());
}
@Override
public void onFailure(Call<GuokrHandpickNews> call, Throwable t) {
callback.onDataNotAvailable();
}
});
}
@Override
public void getFavorites(@NonNull LoadGuokrHandpickNewsCallback callback) {
// Not required for the remote data source because the {@link TasksRepository} handles
// converting from a {@code taskId} to a {@link task} using its cached data.
}
@Override
public void getItem(int itemId, @NonNull GetNewsItemCallback callback) {
// Not required for the remote data source because the {@link TasksRepository} handles
// converting from a {@code taskId} to a {@link task} using its cached data.
}
@Override
public void favoriteItem(int itemId, boolean favorite) {
// Not required for the remote data source because the {@link TasksRepository} handles
// converting from a {@code taskId} to a {@link task} using its cached data.
}
@Override
public void saveAll(@NonNull List<GuokrHandpickNewsResult> list) {
// Not required for the remote data source because the {@link TasksRepository} handles
// converting from a {@code taskId} to a {@link task} using its cached data.
}
}
| [
"1362137760@qq.com"
] | 1362137760@qq.com |
e4f7ef1c933e68d2d52cb3083f87e19e5d8e8b3a | 122fab20cf5f87ae6fc546035f0dce05120d2c50 | /src/controller/GroupCommand.java | c898e383c6b6aca63dd080b94952d775192a06e5 | [] | no_license | PresCoke/Paint | 3c33a6d598c3ccbc41d7949868449ea742737d39 | 54e4458740ba615576321ba4a5ff0586136a6c6f | refs/heads/master | 2021-01-23T13:29:42.967210 | 2015-08-11T23:30:28 | 2015-08-11T23:30:28 | 40,570,148 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 394 | java | package controller;
import model.ShapeComposite;
public class GroupCommand extends PaintCommands {
model.ShapeComposite committedGroup;
public GroupCommand(model.ShapeComposite group)
{
committedGroup = (ShapeComposite) group.clone();
}
public void Execute() {
PaintController.commitGroup();
}
public void UnExecute() {
PaintController.disassembleGroup(committedGroup);
}
}
| [
"Begg.James.A@gmail.com"
] | Begg.James.A@gmail.com |
99bc149b0ace68d27f7fe1334599b6a5814ddfc1 | 111fb36d6f9dd225d70e79bd01109b3c86e980ee | /src/main/java/com/example/sidecar_postgres/controller/AthleteController.java | 1abe2a3ad4c2320ffbb8d4a63ab0f70c2a2b118b | [] | no_license | MikeFlorentini/sidecar-postgres-demo | 091a2e6bc7ea48ea1513cec0bb4bbbfb67a2e369 | 59c8cd34829f76416d0903f160355d85f874dcff | refs/heads/master | 2020-09-29T19:33:29.793709 | 2019-12-10T13:48:24 | 2019-12-10T13:48:24 | 227,106,176 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,955 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.example.sidecar_postgres.controller;
import com.example.sidecar_postgres.entity.Athlete;
import com.example.sidecar_postgres.repository.AthleteRepository;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
*
* @author mike
*/
@RestController
@Transactional
public class AthleteController {
@Autowired
private AthleteRepository repository;
@GetMapping(value = "/athlete/{id}")
public String getAthlete(@PathVariable(value = "id") String id) {
Athlete newAthlete = this.repository.getOne(Long.valueOf(id));
return newAthlete.toString();
}
@GetMapping(value = "/allAthletes")
public List<Athlete> showAllAthletes() {
List<Athlete> list = this.repository.findAll();
return list;
}
@GetMapping(value = "/hello")
public String sayHello() {
return "Hi buddy! I welcome you, bro!";
}
@GetMapping("/athlete/delete/{id}")
public String deleteAthlete(@PathVariable(name = "id") String id) {
Athlete athlete = this.repository.getOne(Long.valueOf(id));
this.repository.delete(athlete);
return "deleted Athlete with id " + id;
}
@PostMapping("/athlete")
public String createAthlete(@RequestBody Athlete athlete) {
this.repository.save(athlete);
return athlete.toString();
}
}
| [
"m.mende@live.de"
] | m.mende@live.de |
65953e26c9de2e72a3706d8fc5cde8ce2d3b9f8d | d340613f6e8e8fd07c9dce6a1026cd2b2e9ff0aa | /JavaFundamental/src/com/java/logic/Vabionachi.java | efde299cb55e117c000cfe0d04778d9726e971af | [] | no_license | junaedi-harmiansyah/java-logic | 5657c5264aa859da237d377aab5b473ab23b92ee | ba1e35fda13be2c498cbfdcd1ee411c366641baf | refs/heads/master | 2023-04-21T11:23:55.889122 | 2021-05-05T09:45:08 | 2021-05-05T09:45:08 | 318,685,765 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 447 | java | package com.java.logic;
import java.util.Scanner;
public class Vabionachi {
public static void main(String args[]) {
int a = 0, b = 1, c;
Scanner sc = new Scanner(System.in);
System.out.println("Masukan jumlah loop= ");
Integer input = sc.nextInt();
System.out.println(a);
System.out.println(b);
for (int i = 0; i <= input; i++) {
c = a + b;
a = b;
b = c;
System.out.println(c);
}
}
}
| [
"ZenBook@DESKTOP-ML4IK6E"
] | ZenBook@DESKTOP-ML4IK6E |
fc132bb774ade88764284d47d2b7c8213fe4dd70 | 417c19b71787e911220f8773e4c43ab7824030df | /LinkedDataFragments/src/Step1/QueryExec.java | 1ff59052678d2c3fedf7ede9d39c6d56af2e2324 | [] | no_license | F-Mercier/linked-data-fragments | c67d4f813048161fc2b5b32c650e8cf38896b5b8 | bcbaaa023693a0d4e698fa9d69dd77a8aebd78cd | refs/heads/master | 2021-01-11T16:06:42.588417 | 2017-04-28T15:50:04 | 2017-04-28T15:50:04 | 80,007,726 | 1 | 1 | null | 2017-07-30T15:00:44 | 2017-01-25T11:18:43 | Java | UTF-8 | Java | false | false | 50 | java | package Step1;
public class QueryExec {
}
| [
"sitraka.fidi@gmail.com"
] | sitraka.fidi@gmail.com |
2d552d2891aaf12bf046ddf9240ce5eabb86ae6b | 8cf110b0c782f51c524b9028cf9bfbe6a77583f8 | /src/main/java/org/cyberpwn/react/util/InstabilityCause.java | a29b3787369a5289d1a3bb9139bdd3baba2972fe | [] | no_license | cyberpwnn/ReactPlugin | 10ec8472a765bff892d67cf2adddf897eee38c73 | 39372922cb843c1ca4bb74a9d4403b3d116baac1 | refs/heads/master | 2021-09-08T03:15:28.304728 | 2018-03-06T13:39:06 | 2018-03-06T13:39:06 | 60,807,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,089 | java | package org.cyberpwn.react.util;
public enum InstabilityCause
{
CHUNK_GEN(false, "Mass Chunk Gen", "The server is generating a lot of chunks, causing the server to lag, and even spike.", "Create a world border, or pregenerate your world within a border to optimize chunk loading. Take a look at the plugin World Border."),
DROPS(false, "Item Drop Lag", "The server is spending an excess time ticking drops.", "Tweak react settings to handle drops."),
FIRE("Fire Lag", "The server is struggling to handle all of the fire catching and burning on your server. This can cause decent lag.", "Consider configuring react to cull excess fire, or extinguish it yourself manually (view details)"),
WORLD_BORDER(false, "World Border", "The server is lagging from world border. However, since this is typically important, react will not interfere. No reactions will be called when world border FILL is running.", "Ensure no one is online while this is running."),
ENTITIES(false, "Entity Overload", "It appears there is a large amount of entities on the server. This can cause the server to consume more memory, and lag the server for several reasons.", "Consider adjusting the react configuration to cull excess entities, or manually purge them yourself. (view)"),
PLUGIN(false, "Plugin Blocker", "A Plugin appears to be freezing the server, or causing a lot of lag/spikes. View the details.", "Consider adjusting that plugin's config, or simply removing it if you don't need it, or if there is a better plugin for it's purpose."),
REDSTONE("Redstone Overload", "The server is struggling to handle all of the redstone calculations that are active right now.", "Consider adjusting the react config to prevent this from causing lag, or consider preventing players from using redstone clocks."),
LIQUID("Liquid Overload", "The server is using a lot of resources to handle liquid flow. This can be caused by someone placing a lot of liquid, or world editing massive areas intending for liquid to flow long distances.", "Consider adjusting the react configuration to crack down on liquid flowing, or prevent players from using this in world edit."),
HOPPER("Hopper Overload", "The server is using a lot of resources to handle hoppers. This can be caused by someone using a lot of hoppers", "Consider adjusting the spigot configuration to crack down on hopper limits"),
TNT_EXPLOSIONS(false, "TNT Lag", "The server is consuming a lot of memory for explosions from tnt. The server may also be lagging from tnt also.", "To fix this, you may want to change some of the react configuration to crack down on massive amounts of tnt exploading at once."),
CHUNKS(false, "Chunk Lag", "The server has too many chunks loaded for the server memory to handle. This can be caused by too many players, or a plugin preventing a relative massive amount of chunks from unloading.", "Consider upgrading your memory, however if this is not possible, try unloading worlds, or removing any plugins that prevent a massive amount of chunk unloads."),
MEMORY("Low Memory", "The server is consuming too much memory very often. This causes the server to look for garbage more often than normal. Upgrading your memory would be advised.", "You can upgrade your memory, however if this is not an option, consider unloading/removing worlds, removing plugins that are not needed, or even decreasing the player limit."),
PHYSICS("Physics Overload", "The server is struggling to handle a lot of pistons and falling blocks (sand/gravel)", "Consider configuring react to handle this, or check the details, and manually remove it."),
LAG("Unknown Lag Source", "The server is struggling to handle something. React is trying several things, as it is unclear for a source.", "Possibly someone might know? Possibly another program or service is running on the host that is degrading tps?"),
PLAYERS(false, "Player Overload", "The server is struggling to calculate the amount of players online on average. This usually has nothing to do with lag from anything else.", "If you have a lot of players, it may be a good idea to distribute them across multiple servers on a hub network. Look online for 'Spigot Bungeecord'.");
private final String name;
private final String problem;
private final String fix;
private final boolean talkative;
private InstabilityCause(String name, String problem, String fix)
{
this.name = name;
this.problem = problem;
this.fix = fix;
talkative = true;
}
private InstabilityCause(boolean tktk, String name, String problem, String fix)
{
this.name = name;
this.problem = problem;
this.fix = fix;
talkative = tktk;
}
public String getName()
{
return name;
}
public String getProblem()
{
return problem;
}
public String getFix()
{
return fix;
}
public boolean isTalkative()
{
return talkative;
}
public static String[] ign()
{
GList<String> k = new GList<String>();
for(InstabilityCause i : InstabilityCause.values())
{
if(i.isTalkative())
{
k.add(i.toString());
}
}
return k.toArray(new String[k.size()]);
}
}
| [
"danielmillst@gmail.com"
] | danielmillst@gmail.com |
bcc8e353e2d4c4475d267367a8bbfd00dc403b6d | c740828ba1dd4afe3b697c8fe5d4cc009e40c81d | /实验6/源代码/hibernate-prj2/src/cn/edu/zjut/action/UserAction.java | e6c68197428e72ac3d8067978d7c6075f3ae1299 | [] | no_license | MeinAugenstern/javaee | 94797a59439b3cf2e08af4d944eab79da1ca434c | e5f0f2e65fc12f122ef7d2df2588bc90dc9e1ee3 | refs/heads/main | 2023-01-28T02:34:21.808631 | 2020-12-04T14:11:52 | 2020-12-04T14:11:52 | 309,082,704 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 967 | java | package cn.edu.zjut.action;
import cn.edu.zjut.po.*;
import cn.edu.zjut.service.*;
public class UserAction {
private Customer loginUser;
public Customer getLoginUser() {
return loginUser;
}
public void setLoginUser(Customer loginUser) {
this.loginUser = loginUser;
}
public String login() {
UserService userServ = new UserService();
if (userServ.login(loginUser))
return "loginsuccess";
else
return "loginfail";
}
public String register() {
UserService userServ = new UserService();
if (userServ.register(loginUser))
return "registersuccess";
else
return "registerfail";
}
public String update() {
UserService userServ = new UserService();
if (userServ.update(loginUser))
return "updatesuccess";
else
return "updatefail";
}
public String delete() {
UserService userServ = new UserService();
if (userServ.delete(loginUser))
return "deletesuccess";
else
return "deletefail";
}
}
| [
"62041845+MeinAugenstern@users.noreply.github.com"
] | 62041845+MeinAugenstern@users.noreply.github.com |
ce3d03647693ba29c5301800a6c9176444ed10a8 | eb464a3b34e4256eea6f5a1d6bcc9936f597c554 | /src/main/java/com/sjtc/weiwen/system/dao/entity/SysRolePermissionEntity.java | ca99e29259c012bf4975640bc69c28ec08499841 | [] | no_license | 92wangzq/weiwen | a247968ad9e35c32664d38c2d7c538fb6e72f464 | bcb4d0c637fd1a695096bf56eef49a2e6f52eb91 | refs/heads/master | 2020-03-30T07:30:33.939884 | 2018-10-30T12:37:20 | 2018-10-30T12:37:20 | 150,944,587 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 531 | java | package com.sjtc.weiwen.system.dao.entity;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@EqualsAndHashCode
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class SysRolePermissionEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 5598273519427427435L;
private String permissionOid;
private String roleOid;
} | [
"Administrator@SJTC_WZQ-PC"
] | Administrator@SJTC_WZQ-PC |
b8ca8cf3ff2ed5cdb40f37ad468a33e5ad668644 | 0348bc8d7e7454840fccc9c91f621a5a232b71c5 | /sources/com/badlogic/gdx/math/WindowedMean.java | a9c553830a67e7cdb23be61306a8c27c7984c4c5 | [] | no_license | nhannguyen95/jump-monster | c5927a0f0bd2b4c96a10f9ee5dcc0e8e5717aebe | 8b7debabfe06cdd4d7cdbcb6253167acd6aea9fd | refs/heads/master | 2020-05-03T07:42:02.128702 | 2019-03-30T03:47:19 | 2019-03-30T03:47:19 | 178,505,506 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,120 | java | package com.badlogic.gdx.math;
public final class WindowedMean {
int added_values = 0;
boolean dirty = true;
int last_value;
float mean = 0.0f;
float[] values;
public WindowedMean(int window_size) {
this.values = new float[window_size];
}
public boolean hasEnoughData() {
return this.added_values >= this.values.length;
}
public void clear() {
this.added_values = 0;
this.last_value = 0;
for (int i = 0; i < this.values.length; i++) {
this.values[i] = 0.0f;
}
this.dirty = true;
}
public void addValue(float value) {
if (this.added_values < this.values.length) {
this.added_values++;
}
float[] fArr = this.values;
int i = this.last_value;
this.last_value = i + 1;
fArr[i] = value;
if (this.last_value > this.values.length - 1) {
this.last_value = 0;
}
this.dirty = true;
}
public float getMean() {
if (!hasEnoughData()) {
return 0.0f;
}
if (this.dirty) {
float mean = 0.0f;
for (float f : this.values) {
mean += f;
}
this.mean = mean / ((float) this.values.length);
this.dirty = false;
}
return this.mean;
}
public float getOldest() {
return this.last_value == this.values.length + -1 ? this.values[0] : this.values[this.last_value + 1];
}
public float getLatest() {
return this.values[this.last_value + -1 == -1 ? this.values.length - 1 : this.last_value - 1];
}
public float standardDeviation() {
if (!hasEnoughData()) {
return 0.0f;
}
float mean = getMean();
float sum = 0.0f;
for (int i = 0; i < this.values.length; i++) {
sum += (this.values[i] - mean) * (this.values[i] - mean);
}
return (float) Math.sqrt((double) (sum / ((float) this.values.length)));
}
public int getWindowSize() {
return this.values.length;
}
}
| [
"nhannguyenmath95@gmail.com"
] | nhannguyenmath95@gmail.com |
fcd7bce5cd2550b233b399907dc0b48ff3ae3df1 | 4a0b8c547e36bd0dd2aba42ffee24f3ea388621c | /main/java/Restaurant.java | 4a0b1df2b282212f47d04b9308d0ee417a951bb9 | [] | no_license | AmruthaAjay/C3_Project_amruthaajay | 0818b05021a16035807ef6983aaef74beeef198a | 22e3c4caade2747382800d5fc5bc18722a86039f | refs/heads/main | 2023-03-10T22:38:42.716166 | 2021-03-01T07:14:38 | 2021-03-01T07:14:38 | 342,836,523 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,878 | java | import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.List;
public class Restaurant {
private String name;
private String location;
public LocalTime openingTime;
public LocalTime closingTime;
private List<Item> menu = new ArrayList<Item>();
public Restaurant(String name, String location, LocalTime openingTime, LocalTime closingTime) {
this.name = name;
this.location = location;
this.openingTime = openingTime;
this.closingTime = closingTime;
}
public boolean isRestaurantOpen(LocalTime currentTime) {
return currentTime.isAfter(openingTime) && currentTime.isBefore(closingTime);
}
public LocalTime getCurrentTime(){ return LocalTime.now(); }
public List<Item> getMenu() {
return menu;
}
private Item findItemByName(String itemName){
for(Item item: menu) {
if(item.getName().equals(itemName))
return item;
}
return null;
}
public void addToMenu(String name, int price, boolean check) {
Item newItem = new Item(name,price,check);
menu.add(newItem);
}
public void removeFromMenu(String itemName) throws itemNotFoundException {
Item itemToBeRemoved = findItemByName(itemName);
if (itemToBeRemoved == null)
throw new itemNotFoundException(itemName);
menu.remove(itemToBeRemoved);
}
public void displayDetails(){
System.out.println("Restaurant:"+ name + "\n"
+"Location:"+ location + "\n"
+"Opening time:"+ openingTime +"\n"
+"Closing time:"+ closingTime +"\n"
+"Menu:"+"\n"+getMenu());
}
public String getName() {
return name;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
3ac8c91e94a8bd854969946e0285de52b51c5732 | faa5438abd09fe6e7c27e9c6ca4491510a9227c7 | /quickstart-msgframe-v2/src/main/java/org/quickstart/msgframe/v2/consumer/ConsumerProcessorImpl.java | a4311418ff6f67f9306c656745847330e2da1a9e | [
"Apache-2.0"
] | permissive | lcc214321/quickstart-mq | 65f56d68cbb20c8023437608f15691f1fde446bb | cc38b71a6370ac11da891f472074bcd1bdb61608 | refs/heads/master | 2022-11-06T08:34:57.864359 | 2020-06-12T13:59:33 | 2020-06-12T13:59:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,203 | java | package org.quickstart.msgframe.v2.consumer;
import java.io.Serializable;
import java.util.Random;
import org.quickstart.msgframe.v2.common.Stu;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ai.aif.msgframe.common.exception.ConsumerException;
import com.ai.aif.msgframe.common.message.MsgFMessage;
import com.ai.aif.msgframe.common.message.MsgFObjectMessage;
import com.ai.aif.msgframe.consumer.facade.IConsumerProcessor;
public class ConsumerProcessorImpl implements IConsumerProcessor {
private static final Logger logger = LoggerFactory.getLogger(ConsumerProcessorImpl.class);
private static final Random random = new Random();
@SuppressWarnings("rawtypes")
@Override
public void process(MsgFMessage msg) throws ConsumerException {
logger.info("receive message:{}", msg);
Object ss = msg.getHeaderMap().get("");
if (msg instanceof MsgFObjectMessage) {
Stu stu = (Stu) ((MsgFObjectMessage) msg).getMsg();
logger.info("MsgFObjectMessage,name={},age={}", stu.getName(), stu.getAge());
logger.info(Thread.currentThread().getName() + " Receive New Messages: ");
}
// throw new RuntimeException();
// try {
// Thread.currentThread().sleep(60 * 1000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// throw new ConsumerException("ss");
// return msg.getMsgId();
// return new Boolean(false);
// if (random.nextBoolean()) {
// throw new ConsumerException("我是返回模拟异常");
// }
// return "我是返回模拟值:" + Integer.valueOf(((MsgFTextMessage) msg).getText());
// 返回Boolean类型的false,代表消息消费失败,重新消费,其他表示消费成功
// return new Boolean(true);
}
/* (non-Javadoc)
* @see com.ai.aif.msgframe.consumer.facade.IConsumerProcessor#processNeedReturn(com.ai.aif.msgframe.common.message.MsgFMessage)
*/
@Override
public Serializable processNeedReturn(MsgFMessage arg0) {
// TODO Auto-generated method stub
return null;
}
}
| [
"youngzil@163.com"
] | youngzil@163.com |
2aa90468736f7d6c298ca77bf8dc9e1c06d3b6d5 | b7966f4fdd04a066811a0389f4111b0b9014f6ee | /app/src/main/java/com/greencross/greencare/charting/buffer/AbstractBuffer.java | bd2b85c389de5f92261fd45f2166af4872f29943 | [] | no_license | tddyko/HealthCareSolution | f370eb3f23aaa84abdceda16567ccf63f2a4fd82 | 901f65f12f07e4144bed70a66e54f828fecf3fc8 | refs/heads/master | 2023-08-23T07:14:31.704097 | 2021-09-25T09:36:09 | 2021-09-25T09:36:09 | 410,231,710 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,995 | java |
package com.greencross.greencare.charting.buffer;
/**
* Buffer class to boost performance while drawing. Concept: Replace instead of
* recreate.
*
* @author Philipp Jahoda
* @param <T> The data the buffer accepts to be fed with.
*/
public abstract class AbstractBuffer<T> {
/** index in the buffer */
protected int index = 0;
/** float-buffer that holds the data points to draw, order: x,y,x,y,... */
public final float[] buffer;
/** animation phase x-axis */
protected float phaseX = 1f;
/** animation phase y-axis */
protected float phaseY = 1f;
/** indicates from which x-index the visible data begins */
protected int mFrom = 0;
/** indicates to which x-index the visible data ranges */
protected int mTo = 0;
/**
* Initialization with buffer-size.
*
* @param size
*/
public AbstractBuffer(int size) {
index = 0;
buffer = new float[size];
}
/** limits the drawing on the x-axis */
public void limitFrom(int from) {
if (from < 0)
from = 0;
mFrom = from;
}
/** limits the drawing on the x-axis */
public void limitTo(int to) {
if (to < 0)
to = 0;
mTo = to;
}
/**
* Resets the buffer index to 0 and makes the buffer reusable.
*/
public void reset() {
index = 0;
}
/**
* Returns the size (length) of the buffer array.
*
* @return
*/
public int size() {
return buffer.length;
}
/**
* Set the phases used for animations.
*
* @param phaseX
* @param phaseY
*/
public void setPhases(float phaseX, float phaseY) {
this.phaseX = phaseX;
this.phaseY = phaseY;
}
/**
* Builds up the buffer with the provided data and resets the buffer-index
* after feed-completion. This needs to run FAST.
*
* @param data
*/
public abstract void feed(T data);
}
| [
"corian1516@gmail.com"
] | corian1516@gmail.com |
42949c74071861b784a61637559baeae52c12e86 | 0470e26d526019e108f1c68862cf25bc878a3b8d | /demo/src/main/java/com/wq/demo/config/ResourceConfigure.java | bc9830c3bf78874e8a9483482c967cf8817ba0e1 | [] | no_license | jxhud/exercise | da02d081f33052bd5b2d3dadce376f5d76daff00 | 4650903f11dd8c6b3b7dbde619b142c2f07c340c | refs/heads/master | 2020-04-17T21:36:41.999740 | 2019-04-04T09:10:52 | 2019-04-04T09:10:52 | 166,958,021 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 993 | java | package com.wq.demo.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
@Configuration
@EnableResourceServer
public class ResourceConfigure extends ResourceServerConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {
http.csrf().disable().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED)
.and().authorizeRequests().antMatchers("/free/**").permitAll().and()
.authorizeRequests().anyRequest().authenticated()
.and().formLogin().permitAll();//必须认证过后才可以访问
}
} | [
"syzx2016@outlook.com"
] | syzx2016@outlook.com |
8a8c11f64e6a13f8bebf2a2a628e4dab19be310a | 4bb83687710716d91b5da55054c04f430474ee52 | /dsrc/sku.0/sys.server/compiled/game/script/theme_park/tatooine/mos_taike/old_guard_destroy.java | 6d01eee84bcf7d750029a8f61f883492a8276b5d | [] | no_license | geralex/SWG-NGE | 0846566a44f4460c32d38078e0a1eb115a9b08b0 | fa8ae0017f996e400fccc5ba3763e5bb1c8cdd1c | refs/heads/master | 2020-04-06T11:18:36.110302 | 2018-03-19T15:42:32 | 2018-03-19T15:42:32 | 157,411,938 | 1 | 0 | null | 2018-11-13T16:35:01 | 2018-11-13T16:35:01 | null | UTF-8 | Java | false | false | 9,420 | java | package script.theme_park.tatooine.mos_taike;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.chat;
import script.library.ai_lib;
import script.library.utils;
import script.library.locations;
import script.library.quests;
public class old_guard_destroy extends script.base_script
{
public old_guard_destroy()
{
}
public int OnAttach(obj_id self) throws InterruptedException
{
attachScript(self, "npc.converse.npc_converse_menu");
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
return SCRIPT_CONTINUE;
}
public int OnStartNpcConversation(obj_id self, obj_id speaker) throws InterruptedException
{
String CONVO = "theme_park_mos_taike/old_guard";
int questNum = getIntObjVar(speaker, "mos_taike.old_guard_quest");
if (questNum == 0)
{
questNum = 1;
setObjVar(speaker, "mos_taike.old_guard_quest", questNum);
}
if (ai_lib.isInCombat(self) || ai_lib.isInCombat(speaker))
{
return SCRIPT_OVERRIDE;
}
if (hasObjVar(speaker, "mos_taike.old_guard.objid"))
{
obj_id boss = getObjIdObjVar(speaker, "mos_taike.old_guard.objid");
if (boss == self)
{
if (hasObjVar(speaker, "mos_taike.old_guard.questDone"))
{
String reward = "npc_reward_" + questNum;
string_id message = new string_id(CONVO, reward);
chat.chat(self, message);
dictionary parms = new dictionary();
parms.put("player", speaker);
messageTo(self, "giveReward", parms, 0, true);
return SCRIPT_OVERRIDE;
}
else
{
string_id work = new string_id(CONVO, "gotowork");
chat.chat(self, work);
return SCRIPT_CONTINUE;
}
}
else
{
string_id cant = new string_id(CONVO, "cantwork");
chat.chat(self, cant);
return SCRIPT_CONTINUE;
}
}
else
{
String npcGreet = "npc_1_" + questNum;
String response1 = "player_1_" + questNum;
String response2 = "player_2_" + questNum;
String response3 = "player_3_" + questNum;
string_id greeting = new string_id(CONVO, npcGreet);
string_id response[] = new string_id[3];
response[0] = new string_id(CONVO, response1);
response[1] = new string_id(CONVO, response2);
response[2] = new string_id(CONVO, response3);
npcStartConversation(speaker, self, "questConvo", greeting, response);
}
return SCRIPT_CONTINUE;
}
public int OnNpcConversationResponse(obj_id self, String convo, obj_id player, string_id response) throws InterruptedException
{
String datatable = "datatables/theme_park/mos_taike_old_guard.iff";
String CONVO = "theme_park_mos_taike/old_guard";
int questNum = getIntObjVar(player, "mos_taike.old_guard_quest");
String response1 = "player_1_" + questNum;
String response2 = "player_2_" + questNum;
String response3 = "player_3_" + questNum;
if ((response.getAsciiId()).equals(response1))
{
location target = getTargetLocation(self);
if (target == null)
{
String noLoc = "npc_noloc_" + questNum;
string_id message = new string_id(CONVO, noLoc);
chat.chat(self, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
else
{
String npcAnswer1 = "npc_2_" + questNum;
string_id message = new string_id(CONVO, npcAnswer1);
npcSpeak(player, message);
npcEndConversation(player);
location here = getLocation(self);
setObjVar(player, "mos_taike.old_guard.objid", self);
setObjVar(player, "mos_taike.old_guard.targetLoc", target);
setObjVar(player, "mos_taike.old_guard.loc", here);
attachScript(player, "theme_park.tatooine.mos_taike.player_destroy");
return SCRIPT_CONTINUE;
}
}
if ((response.getAsciiId()).equals(response2))
{
String npcAnswer2 = "npc_3_" + questNum;
string_id message = new string_id(CONVO, npcAnswer2);
npcSpeak(player, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
if ((response.getAsciiId()).equals(response3))
{
npcAddConversationResponse(player, new string_id(CONVO, response1));
npcAddConversationResponse(player, new string_id(CONVO, response2));
npcRemoveConversationResponse(player, new string_id(CONVO, response3));
String npcAnswer3 = "npc_4_" + questNum;
string_id message = new string_id(CONVO, npcAnswer3);
npcSpeak(player, message);
return SCRIPT_CONTINUE;
}
return SCRIPT_CONTINUE;
}
public location getTargetLocation(obj_id self) throws InterruptedException
{
location target = new location();
int x = 0;
while (x < 10)
{
location here = getLocation(self);
region quest = locations.getCityRegion(here);
location questLoc = locations.getGoodLocationOutsideOfRegion(quest, 100f, 100f, 100f);
if (questLoc != null)
{
target = questLoc;
}
x = x + 1;
}
return target;
}
public int OnGiveItem(obj_id self, obj_id item, obj_id giver) throws InterruptedException
{
String datatable = "datatables/theme_park/mos_taike_old_guard.iff";
String CONVO = "theme_park_mos_taike/old_guard";
if (!hasObjVar(giver, "mos_taike.oldGuard.workingFor"))
{
debugSpeakMsg(self, "I don't know you.");
return SCRIPT_CONTINUE;
}
else
{
obj_id boss = getObjIdObjVar(giver, "mos_taike.oldGuard.workingFor");
if (boss != self)
{
debugSpeakMsg(self, "You work for someone else.");
return SCRIPT_OVERRIDE;
}
}
int questNum = 1;
questNum = getIntObjVar(self, "quest");
questNum = questNum - 1;
String giveMe = dataTableGetString(datatable, 0, questNum);
String itemName = getTemplateName(item);
if (item == null)
{
return SCRIPT_OVERRIDE;
}
else if (itemName.equals(giveMe))
{
questNum = questNum + 1;
String reward = "npc_reward_" + questNum;
string_id message = new string_id(CONVO, reward);
chat.chat(self, message);
dictionary parms = new dictionary();
parms.put("player", giver);
messageTo(self, "giveReward", parms, 0, true);
return SCRIPT_OVERRIDE;
}
else
{
string_id notit = new string_id(CONVO, "not_it");
chat.chat(self, notit);
return SCRIPT_OVERRIDE;
}
}
public int OnReceivedItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException
{
destroyObject(item);
return SCRIPT_CONTINUE;
}
public int giveReward(obj_id self, dictionary params) throws InterruptedException
{
obj_id player = params.getObjId("player");
String datatable = "datatables/theme_park/mos_taike_old_guard.iff";
String CONVO = "theme_park_mos_taike/old_guard";
int questNum = getIntObjVar(player, "mos_taike.old_guard_quest");
String reward = dataTableGetString(datatable, 1, questNum);
obj_id playerInv = utils.getInventoryContainer(player);
createObject(reward, playerInv, "");
removeObjVar(player, "mos_taike.old_guard");
detachScript(player, "theme_park.tatooine.mos_taike.player_destroy");
questNum = questNum + 1;
setObjVar(player, "mos_taike.old_guard_quest", questNum);
return SCRIPT_CONTINUE;
}
public boolean checkForItem(obj_id self, obj_id inv) throws InterruptedException
{
String datatable = "datatables/theme_park/mos_taike_old_guard.iff";
int questNum = getIntObjVar(self, "mos_taike.old_guard_quest");
questNum = questNum - 1;
String giveMe = dataTableGetString(datatable, 0, questNum);
boolean hadIt = false;
obj_id[] contents = getContents(inv);
for (int i = 0; i < contents.length; i++)
{
String itemInInventory = getTemplateName(contents[i]);
if (itemInInventory.equals(giveMe))
{
destroyObject(contents[i]);
hadIt = true;
}
else
{
hadIt = false;
}
}
return hadIt;
}
}
| [
"tmoflash@gmail.com"
] | tmoflash@gmail.com |
92aa9ef86fceba38021d8573fc7e441f8f6718a1 | e97dcb6036b03d26d44353d48bd02066e679b3c9 | /generator/src/main/java/org/gonevertical/archetypes/generator/utils/XmlNodeUtils.java | 04cfa0530764ed493623a3e41364d0cf0cc78366 | [] | no_license | enterstudio/Archetypes | 903ca05e61fad6d1534b6d97b29e22c4bf6e85ea | c449625c8e935e2dee1d12a8edcc5b5e3cde3767 | refs/heads/master | 2021-05-13T22:55:36.790288 | 2017-02-28T02:38:53 | 2017-02-28T02:38:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,965 | java | package org.gonevertical.archetypes.generator.utils;
import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class XmlNodeUtils {
public XmlNodeUtils() {
}
public String findNodeValue(String filePath, String xpathExp) {
String value = null;
try {
value = findNodeValueOrThrow(filePath, xpathExp);
} catch (XPathExpressionException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (TransformerException e) {
e.printStackTrace();
}
return value;
}
public String findNodeValueOrThrow(String filePath, String xpathExp) throws SAXException, IOException,
ParserConfigurationException, XPathExpressionException, TransformerException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
Document document = dbf.newDocumentBuilder().parse(new File(filePath));
XPathFactory xpf = XPathFactory.newInstance();
XPath xpath = xpf.newXPath();
XPathExpression expression = xpath.compile(xpathExp);
Node foundNode = (Node) expression.evaluate(document, XPathConstants.NODE);
if (foundNode == null) {
System.out.println("XPath didn't find " + xpathExp);
return null;
}
String value = foundNode.getTextContent();
System.out.println("foundNode=" + foundNode.getTextContent());
return value;
}
}
| [
"branflake2267@gmail.com"
] | branflake2267@gmail.com |
8e36553813251204fea85e14abecdce3922bcc69 | 59ab90e7da19f65dd7072ceb3c26bdc368162c7d | /app/src/main/java/com/gold/kds517/smartviewmac/models/CategoryModelSeries.java | 5ae6bef43e4afe63e8e1f7f941909224783e093a | [] | no_license | wubi517/SmartViewComboMac | 66bf85aa48e4f24307db0e74a510a8a9e0d42d5a | b19996bc5dba5ea9135bab319dfc680461c37bd5 | refs/heads/master | 2022-04-07T04:30:09.468435 | 2020-02-27T13:52:41 | 2020-02-27T13:52:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,221 | java | package com.gold.kds517.smartviewmac.models;
import java.io.Serializable;
/**
* Created by RST on 7/19/2017.
*/
public class CategoryModelSeries implements Serializable {
String id, name, type, url, group;
int featured, parent_control;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public int getFeatured() {
return featured;
}
public void setFeatured(int featured) {
this.featured = featured;
}
public int getParent_control() {
return parent_control;
}
public void setParent_control(int parent_control) {
this.parent_control = parent_control;
}
}
| [
"yejong2013@gmail.com"
] | yejong2013@gmail.com |
7886fb062822d218c78346d973964252456bcab8 | 48e52032fe88c9f54e549ffd931b0ab62862a45e | /src/headfirst/designpatterns/stratergy/ModelDuck.java | 9cd0b049975a4dd3f2f27a4b11475e30d635712d | [] | no_license | santdash/HeadFirstDesignPatterns | 777cfdec3492aceeed13a326dc12fc80edf70242 | d2eeccb60dd1e12190c869351b9555e093cab0ba | refs/heads/master | 2020-03-07T14:49:37.749403 | 2018-03-31T16:44:43 | 2018-03-31T16:44:43 | 127,536,783 | 0 | 0 | null | 2018-03-31T16:44:44 | 2018-03-31T13:58:18 | Java | UTF-8 | Java | false | false | 317 | java | package headfirst.designpatterns.stratergy;
/**
* Created by dashsan on 3/13/2017.
*/
public class ModelDuck extends Duck {
public ModelDuck() {
super(new Quack(), new FlyNoWay());
}
@Override
public void display() {
System.out.println("I am model duck");
}
}
| [
"santdash@yahoo.com"
] | santdash@yahoo.com |
af85d878a35295c0acf0921348bb4bc330b20b24 | 0d71dd0aa1c7e336008f9da88e9ac10a5668fa19 | /ws.sede/src/main/java/it/ltc/services/sede/data/ordine/FactoryDaoSpedizioni.java | 6ff8a76418d6888db54feb66fe4a3a745fcc257e | [] | no_license | Dufler/webservices | 6f27cd674b605bceded296cefb56006ec3ac50b8 | 2efecfe088f6d0d5c67ecdec3cacd92932ecc0d1 | refs/heads/master | 2022-12-24T14:52:16.132351 | 2019-06-04T13:31:32 | 2019-06-04T13:31:32 | 130,059,064 | 0 | 0 | null | 2022-12-16T05:12:30 | 2018-04-18T12:30:05 | Java | UTF-8 | Java | false | false | 744 | java | package it.ltc.services.sede.data.ordine;
import org.springframework.stereotype.Component;
import it.ltc.database.model.utente.CommessaUtenti;
import it.ltc.database.model.utente.UtenteUtenti;
import it.ltc.model.shared.dao.ISpedizioneDao;
import it.ltc.services.custom.dao.FactoryDao;
@Component
public class FactoryDaoSpedizioni extends FactoryDao<ISpedizioneDao> {
@Override
protected ISpedizioneDao findDao(UtenteUtenti user, CommessaUtenti commessa) {
ISpedizioneDao dao;
SpedizioneLegacyDao daoLegacy = new SpedizioneLegacyDao(commessa.getNomeRisorsa());
daoLegacy.setUtente(user.getUsername());
//FIXME - Qui viene inserita in maniera fissa la versione legacy.
dao = daoLegacy;
return dao;
}
}
| [
"Damiano@Damiano-PC"
] | Damiano@Damiano-PC |
84059dd4a7b6de1a7be802c5824360d7b61c4b24 | 136742f117e5ed62e427a429807d9d6619d6c4d3 | /gen/com/ace/production/R.java | 7dadb5977e220de0be3c4d23ebe85bec347907cf | [] | no_license | moonzwu/PayTong | 72c64dbf2128d3d22169ad0a5e1281932cdf27e0 | f511ea87d5d9beb4f6e7f9cc01b46659df76167c | refs/heads/master | 2021-01-23T14:44:54.072704 | 2012-02-29T16:13:00 | 2012-02-29T16:13:00 | 3,415,925 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,410 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.ace.production;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
}
public static final class id {
public static final int btn_remove=0x7f050008;
public static final int btn_set=0x7f050007;
public static final int date_payment=0x7f050005;
public static final int edit_bank=0x7f050001;
public static final int edit_repayment=0x7f050003;
public static final int id_bank=0x7f050000;
public static final int id_payment_date=0x7f050004;
public static final int id_repayment=0x7f050002;
public static final int rl_controller=0x7f050006;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040000;
public static final int txt_bank=0x7f040001;
public static final int txt_btn_remove=0x7f040005;
public static final int txt_btn_setting=0x7f040004;
public static final int txt_payment_date=0x7f040003;
public static final int txt_repayment=0x7f040002;
}
}
| [
"moonz.wu@gmail.com"
] | moonz.wu@gmail.com |
941c5e09aa209ffd57081c04bfd7a66b115f360b | 830dffdde6cbbd8a9a2b72244b6814980f274e59 | /patterns/hexagonal-architecture-example/src/main/java/com/baeldung/pattern/hexagonal/persistence/AddressRepository.java | 405aabc9ae0b70d49710b0c33bc0b3767b3c1160 | [
"MIT"
] | permissive | pmuthyala/tutorials | ae1f9001e65f0cd29ee961fd2bea9023dd1153b2 | 60e1c16dcbfaf5eaf98d6f810fe99b9ec6e89f41 | refs/heads/master | 2022-02-15T08:08:48.750222 | 2022-02-12T11:35:34 | 2022-02-12T11:35:34 | 457,453,422 | 0 | 0 | MIT | 2022-02-09T17:08:36 | 2022-02-09T17:08:35 | null | UTF-8 | Java | false | false | 273 | java | package com.baeldung.pattern.hexagonal.persistence;
import java.util.Optional;
import com.baeldung.pattern.hexagonal.domain.model.Address;
public interface AddressRepository {
Optional<Address> findByAddressId(String addressId);
Address save(Address address);
}
| [
"prashanth@divyas-MacBook-Air.local"
] | prashanth@divyas-MacBook-Air.local |
5d9c50669225ca03d095c3114ac11564d4dd4c24 | f4f6ca1032b9bc9cadcb8113fe8d65b84d301781 | /SpringBootAdmin/src/main/java/com/surveysampling/SpringBootAdminApplication.java | 03bb5712a8e27695300eacc9ebee72ad2a56b5aa | [] | no_license | ssi-hu-janos-sechna/IkProfessionalDays2017 | 18230ba3cc6d2213b3a2b5a0f352d137b3c24d64 | 6e4ef340ddb92be45bc32a5c33f94f9926495966 | refs/heads/master | 2021-01-22T20:08:58.020512 | 2017-04-11T09:31:06 | 2017-04-11T09:31:06 | 85,289,120 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 418 | java | package com.surveysampling;
import de.codecentric.boot.admin.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableAdminServer
@SpringBootApplication
public class SpringBootAdminApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootAdminApplication.class, args);
}
}
| [
"janos.sechna@surveysampling.com"
] | janos.sechna@surveysampling.com |
d8d734bb214cec04c07e269c39840095f8d14057 | 93d5095d16ec29272837ddd8ccc6b864518fb3e0 | /Manager/src/main/java/com/master/gm/service/count/ComprehensiveDataServiceIF.java | 67ee68816f88a70b9fcc1177173ef6898e66b4ca | [] | no_license | zhyusgethup/learnAndDo | 58006c32fb289c22c0f076260d5a8dbf5385d339 | 8015901339ade1e9c57cd2dd76ca82657b0f3c80 | refs/heads/master | 2023-01-27T17:33:26.204611 | 2019-06-11T07:23:23 | 2019-06-11T07:23:23 | 158,785,359 | 0 | 0 | null | 2023-01-11T19:00:47 | 2018-11-23T05:37:06 | JavaScript | UTF-8 | Java | false | false | 735 | java | package com.master.gm.service.count;
import java.util.List;
import com.gmdesign.exception.GmException;
/**
*
* @ClassName ComprehensiveDataServiceIF
* @Description 综合数据查询业务接口
* @author DJL
* @date 2015-12-10 下午4:25:24
*
*/
public interface ComprehensiveDataServiceIF {
List<Object[]> Comprehensive(String sid, String start, String end, String platform)throws GmException;
List<Object[]> LTVData(String sid, String start, String end, String platform)throws GmException;
List<Object[]> LTVDataForMoney(String sid, String start, String end, String platform)throws GmException;
List<Object[]> LRRate(String sid, String start, String end, String platform, boolean lr)throws GmException;
}
| [
"2649160284@qq.com"
] | 2649160284@qq.com |
14125c82bdcc82373d3ce3af389bd68967baa37e | 41678fe5830c483e6ca141113ca9cbebaf7738bc | /src/analizadorlexico/IntermediateCode/Operation.java | 74b6372966f520d03a04c6dd3c63b86d3d11b7ef | [] | no_license | NivxB/CompiladorMiniADA | c9d24baefd5dd9ea9b0b805b070e6f77d50d38b9 | 38dc971a01ba0f730636891a184c7a005ad6ca2f | refs/heads/master | 2021-01-19T08:25:28.759948 | 2016-06-22T04:29:55 | 2016-06-22T04:29:55 | 51,666,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 545 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package analizadorlexico.IntermediateCode;
/**
*
* @author Kevin Barahona
*/
public abstract class Operation {
public static final int SIMPLE_OPERATION = 0;
public static final int LABEL_OPERATION = 1;
public static final int IF_OPERATION = 2;
public static final int GOTO_OPERATION = 3;
public abstract String getStringValue();
}
| [
"kevinbarahn@gmail.com"
] | kevinbarahn@gmail.com |
0a0fbb5092d6480cbea4361d8e8313ba6a7943f3 | b786a99adaef0d2b38e6ecd744cd671181730b46 | /src/org/ironrhino/core/remoting/server/HttpInvokerServer.java | ebc5d59f7e40e70687c1b251838afecb6b2d694c | [] | no_license | jeasonyoung/ironrhino | 25c23147c6928a318eb81713120f1e6653689bbe | 63e5a6107774d4e5ffcf7601cb76ed3a82cf008b | refs/heads/master | 2020-04-05T18:28:39.566907 | 2016-07-19T04:47:23 | 2016-07-19T04:47:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,699 | java | package org.ironrhino.core.remoting.server;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLDecoder;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.ironrhino.core.remoting.FstHttpInvokerSerializationHelper;
import org.ironrhino.core.remoting.RemotingContext;
import org.ironrhino.core.remoting.ServiceRegistry;
import org.ironrhino.core.remoting.ServiceStats;
import org.ironrhino.core.util.JsonUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.serializer.support.SerializationFailedException;
import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter;
import org.springframework.remoting.support.RemoteInvocation;
import org.springframework.remoting.support.RemoteInvocationResult;
public class HttpInvokerServer extends HttpInvokerServiceExporter {
protected static final String CONTENT_TYPE_FST_SERIALIZED_OBJECT = "application/x-fst-serialized-object";
protected static final String HTTP_HEADER_CONTENT_TYPE = "Content-Type";
private Logger logger = LoggerFactory.getLogger(getClass());
private static ThreadLocal<Class<?>> serviceInterface = new ThreadLocal<>();
private static ThreadLocal<Object> service = new ThreadLocal<>();
private Map<Class<?>, Object> proxies = new HashMap<>();
@Value("${httpInvoker.loggingPayload:false}")
private boolean loggingPayload;
@Autowired(required = false)
private ServiceRegistry serviceRegistry;
@Autowired(required = false)
private ServiceStats serviceStats;
public void setServiceRegistry(ServiceRegistry serviceRegistry) {
this.serviceRegistry = serviceRegistry;
}
public void setServiceStats(ServiceStats serviceStat) {
this.serviceStats = serviceStat;
}
@Override
public void handleRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Enumeration<String> en = request.getHeaderNames();
while (en.hasMoreElements()) {
String name = en.nextElement();
if (name.startsWith(RemotingContext.HTTP_HEADER_PREFIX)) {
String key = URLDecoder.decode(name.substring(RemotingContext.HTTP_HEADER_PREFIX.length()), "UTF-8");
String value = URLDecoder.decode(request.getHeader(name), "UTF-8");
RemotingContext.put(key, value);
}
}
String uri = request.getRequestURI();
try {
String interfaceName = uri.substring(uri.lastIndexOf('/') + 1);
Class<?> clazz = Class.forName(interfaceName);
serviceInterface.set(clazz);
RemoteInvocation invocation = readRemoteInvocation(request);
Object proxy = getProxyForService();
if (proxy != null) {
if (loggingPayload) {
logger.info("invoking {}.{}() with:\n{}", clazz.getName(), invocation.getMethodName(),
JsonUtils.toJson(invocation.getArguments()));
}
long time = System.currentTimeMillis();
RemoteInvocationResult result = invokeAndCreateResult(invocation, proxy);
time = System.currentTimeMillis() - time;
writeRemoteInvocationResult(request, response, result);
if (serviceStats != null) {
StringBuilder method = new StringBuilder(invocation.getMethodName()).append("(");
Class<?>[] parameterTypes = invocation.getParameterTypes();
for (int i = 0; i < parameterTypes.length; i++) {
method.append(parameterTypes[i].getSimpleName());
if (i < parameterTypes.length - 1)
method.append(',');
}
method.append(")");
serviceStats.serverSideEmit(interfaceName, method.toString(), time);
}
if (loggingPayload) {
MDC.remove("url");
if (!result.hasException()) {
Object value = result.getValue();
if (value != null) {
logger.info("returned in {}ms:\n{}", time, JsonUtils.toJson(value));
} else {
logger.info("returned in {}ms: null", time);
}
} else {
Throwable throwable = result.getException();
if (throwable.getCause() != null)
throwable = throwable.getCause();
logger.error(throwable.getMessage(), throwable);
}
}
} else {
String msg = "No Service:" + getServiceInterface().getName();
logger.error("No Service:" + getServiceInterface());
response.sendError(HttpServletResponse.SC_NOT_FOUND, msg);
}
} catch (SerializationFailedException sfe) {
logger.error(sfe.getMessage(), sfe);
RemoteInvocationResult result = new RemoteInvocationResult();
result.setException(sfe);
writeRemoteInvocationResult(request, response, result);
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, ex.getMessage());
} finally {
serviceInterface.remove();
RemotingContext.clear();
}
}
@Override
public void prepare() {
if (serviceRegistry != null) {
for (Map.Entry<String, Object> entry : serviceRegistry.getExportServices().entrySet()) {
try {
Class<?> intf = Class.forName(entry.getKey());
serviceInterface.set(intf);
service.set(entry.getValue());
proxies.put(intf, super.getProxyForService());
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
serviceInterface.remove();
service.remove();
}
}
@Override
public Object getService() {
return service.get();
}
@Override
public Class<?> getServiceInterface() {
return serviceInterface.get();
}
@Override
protected Object getProxyForService() {
return proxies.get(getServiceInterface());
}
@Override
protected RemoteInvocation readRemoteInvocation(HttpServletRequest request, InputStream is)
throws IOException, ClassNotFoundException {
boolean useFstSerialization = CONTENT_TYPE_FST_SERIALIZED_OBJECT
.equals(request.getHeader(HTTP_HEADER_CONTENT_TYPE));
if (useFstSerialization) {
return FstHttpInvokerSerializationHelper.readRemoteInvocation(is);
} else {
return super.readRemoteInvocation(request, is);
}
}
@Override
protected void writeRemoteInvocationResult(HttpServletRequest request, HttpServletResponse response,
RemoteInvocationResult result, OutputStream os) throws IOException {
boolean useFstSerialization = CONTENT_TYPE_FST_SERIALIZED_OBJECT
.equals(request.getHeader(HTTP_HEADER_CONTENT_TYPE));
if (useFstSerialization)
FstHttpInvokerSerializationHelper.writeRemoteInvocationResult(result, os);
else
super.writeRemoteInvocationResult(request, response, result, os);
}
}
| [
"zhouyanming@gmail.com"
] | zhouyanming@gmail.com |
b98aac5fe3db2066ef3562c99354fb59e803e711 | 62bd6eb7a3f44dfc98058091dc98cf04167cfcad | /src/main/java/vavi/apps/x68k/DMAC.java | 21d8464c2b3a31e2be92982d34b04144727da110 | [] | no_license | umjammer/vavi-apps-x68k | dbbf16f45121af389f21d62bf2f867a42acb122a | b0e8852613e46a0341ef72da25454c180fd7630c | refs/heads/master | 2021-05-07T08:04:36.279048 | 2009-10-12T20:59:53 | 2009-10-12T20:59:53 | 109,251,038 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 33,859 | java | /*
* X68000 Emulator in Java
*
* Copyright (C) 2003,2004 by M.Kamada
*/
package vavi.apps.x68k;
class DMAC extends MemoryMappedDevice implements X68000Device, InterruptDevice {
private DMACChannel channel[];
private int bt, br;
private int interrupt_request[];
private int interrupt_acknowledged[];
protected X68000 x68000;
public DMAC() {
}
public boolean init(X68000 x68000) {
this.x68000 = x68000;
channel = new DMACChannel[4];
for (int i = 0; i <= 3; i++) {
channel[i] = new DMACChannel(i);
}
interrupt_request = new int[8];
interrupt_acknowledged = new int[8];
reset();
return true;
}
public void reset() {
for (int i = 0; i <= 3; i++) {
channel[i].reset();
}
for (int i = 0; i <= 7; i++) {
interrupt_request[i] = 0;
interrupt_acknowledged[i] = 0;
}
}
private void interrupt(int i) {
interrupt_request[i]++;
x68000.interrupt_request_dmac++;
}
public int acknowledge() {
for (int i = 0; i <= 7; i++) {
int request = interrupt_request[i];
if (request != interrupt_acknowledged[i]) {
interrupt_acknowledged[i] = request;
return (i & 1) == 0 ? channel[i >> 1].niv : channel[i >> 1].eiv;
}
}
return 0;
}
public void done(int vector) {
for (int i = 0; i <= 7; i++) {
if (interrupt_request[i] != interrupt_acknowledged[i]) {
x68000.interrupt_request_dmac++;
return;
}
}
}
public byte read_byte(int a) {
if ((a & 255) == 255) {
return (byte) (bt + br);
}
return channel[a >> 6 & 3].read_byte(a);
}
public short read_short_big(int a) {
return channel[a >> 6 & 3].read_short_big(a);
}
public int read_int_big(int a) {
return channel[a >> 6 & 3].read_int_big(a);
}
public void write_byte(int a, byte b) {
if ((a & 255) == 255) {
bt = b & 12;
br = b & 3;
return;
}
channel[a >> 6 & 3].write_byte(a, b);
}
public void write_short_big(int a, short s) {
channel[a >> 6 & 3].write_short_big(a, s);
}
public void write_int_big(int a, int i) {
channel[a >> 6 & 3].write_int_big(a, i);
}
public void fallPCL3() {
channel[3].fallPCL();
}
public void risePCL3() {
channel[3].risePCL();
}
class DMACChannel {
int ch;
int coc;
int blc;
int ndt;
int err;
int act;
int dit;
int pct;
int pcs;
int error_code;
int xrm;
int dtyp;
int dps;
int pcl;
int dir;
int btd;
int size;
int chain;
int reqg;
int mac;
int dac;
int str;
int cnt;
int hlt;
int sab;
int ite;
int niv;
int eiv;
int cp;
int mfc2;
int mfc1;
int mfc0;
int dfc2;
int dfc1;
int dfc0;
int bfc2;
int bfc1;
int bfc0;
int mtc;
int btc;
int mar;
int dar;
int bar;
DMACChannel(int ch) {
this.ch = ch;
pcs = 0;
}
void reset() {
coc = 0;
blc = 0;
ndt = 0;
err = 0;
act = 0;
dit = 0;
pct = 0;
error_code = 0;
xrm = 0;
dtyp = 0;
dps = 0;
pcl = 0;
dir = 0;
btd = 0;
size = 0;
chain = 0;
reqg = 0;
mac = 0;
dac = 0;
str = 0;
cnt = 0;
hlt = 0;
sab = 0;
ite = 0;
niv = 15;
eiv = 15;
cp = 0;
mfc2 = 0;
mfc1 = 0;
mfc0 = 0;
dfc2 = 0;
dfc1 = 0;
dfc0 = 0;
bfc2 = 0;
bfc1 = 0;
bfc0 = 0;
mtc = 0;
btc = 0;
mar = 0;
dar = 0;
bar = 0;
}
byte read_byte(int a) {
switch (a & 63) {
case 0:
return (byte) (coc + blc + ndt + err + act + dit + pct + pcs);
case 1:
return (byte) error_code;
case 4:
return (byte) (xrm + dtyp + dps + pcl);
case 5:
return (byte) (dir + btd + size + chain + reqg);
case 6:
return (byte) (mac + dac);
case 7:
return (byte) (str + cnt + hlt + sab + ite);
case 37:
return (byte) niv;
case 39:
return (byte) eiv;
case 45:
return (byte) cp;
case 41:
return (byte) (mfc2 + mfc1 + mfc0);
case 49:
return (byte) (dfc2 + dfc1 + dfc0);
case 57:
return (byte) (bfc2 + bfc1 + bfc0);
case 10:
return (byte) (mtc >> 8);
case 11:
return (byte) mtc;
case 26:
return (byte) (btc >> 8);
case 27:
return (byte) btc;
case 12:
return (byte) (mar >> 24);
case 13:
return (byte) (mar >> 16);
case 14:
return (byte) (mar >> 8);
case 15:
return (byte) mar;
case 20:
return (byte) (dar >> 24);
case 21:
return (byte) (dar >> 16);
case 22:
return (byte) (dar >> 8);
case 23:
return (byte) dar;
case 28:
return (byte) (bar >> 24);
case 29:
return (byte) (bar >> 16);
case 30:
return (byte) (bar >> 8);
case 31:
return (byte) bar;
}
return 0;
}
short read_short_big(int a) {
switch (a & 63) {
case 10:
return (short) mtc;
case 26:
return (short) btc;
case 12:
return (short) (mar >> 16);
case 14:
return (short) mar;
case 20:
return (short) (dar >> 16);
case 22:
return (short) dar;
case 28:
return (short) (bar >> 16);
case 30:
return (short) bar;
}
return (short) ((read_byte(a) << 8) + (read_byte(a + 1) & 255));
}
int read_int_big(int a) {
switch (a & 63) {
case 12:
return mar;
case 20:
return dar;
case 28:
return bar;
}
return (read_byte(a) << 24) + ((read_byte(a + 1) & 255) << 16) + ((read_byte(a + 2) & 255) << 8) + (read_byte(a + 3) & 255);
}
void write_byte(int a, byte b) {
switch (a & 63) {
case 0:
if (b == -1) {
coc = 0;
blc = 0;
ndt = 0;
err = 0;
}
return;
case 4:
if (act != 0) {
error(2);
return;
}
xrm = b & 192;
dtyp = b & 48;
dps = b & 8;
pcl = b & 3;
return;
case 5:
dir = b & 128;
btd = b & 64;
size = b & 48;
chain = b & 12;
reqg = b & 3;
return;
case 6:
if (act != 0) {
error(2);
return;
}
mac = b & 12;
dac = b & 3;
return;
case 7:
hlt = b & 32;
ite = b & 8;
if ((b & 64) != 0) {
if (act == 0 && (b & 128) == 0 || blc != 0) {
error(2);
return;
}
if (chain != 0) {
error(1);
return;
}
cnt = 64;
}
if ((b & 16) != 0) {
if (act == 0 && (b & 128) == 0) {
return;
}
coc = 0;
blc = 0;
ndt = 0;
hlt = 0;
cnt = 0;
error(17);
return;
}
if ((b & 128) != 0) {
if (coc + blc + ndt + err + act != 0) {
error(2);
return;
}
if ((dtyp == 0 || dtyp == 16) && dps == 8 && size == 0 && (reqg == 2 || reqg == 3) || xrm == 64 || mac == 12 || dac == 3 || chain == 4 || size == 3 && !((dtyp == 0 || dtyp == 16) && dps == 0)) {
error(1);
return;
}
act = 8;
if (chain == 8) {
if (btc == 0) {
error(15);
return;
}
if ((bar & 1) != 0) {
error(7);
return;
}
try {
mar = x68000.read_int_big(bar, bfc2);
bar += 4;
mtc = x68000.read_short_big(bar, bfc2) & 65535;
bar += 2;
} catch (MC68000Exception e) {
error(11);
return;
}
btc--;
} else if (chain == 12) {
if ((bar & 1) != 0) {
error(7);
return;
}
try {
mar = x68000.read_int_big(bar, bfc2);
bar += 4;
mtc = x68000.read_short_big(bar, bfc2) & 65535;
bar += 2;
bar = x68000.read_int_big(bar, bfc2);
} catch (MC68000Exception e) {
error(11);
return;
}
}
if (mtc == 0) {
error(13);
return;
}
if ((size == 16 || size == 32) && (mar & 1) != 0) {
error(5);
return;
}
if ((size == 16 || size == 32) && dps == 8 && (dar & 1) != 0) {
error(6);
return;
}
switch (reqg) {
case 0:
case 1:
while (act != 0) {
transfer();
}
break;
case 3:
transfer();
break;
}
}
return;
case 37:
niv = b & 255;
return;
case 39:
eiv = b & 255;
return;
case 45:
cp = b & 3;
return;
case 41:
if (act != 0) {
error(2);
return;
}
mfc2 = b & 4;
mfc1 = b & 2;
mfc0 = b & 1;
return;
case 49:
if (act != 0) {
error(2);
return;
}
dfc2 = b & 4;
dfc1 = b & 2;
dfc0 = b & 1;
return;
case 57:
bfc2 = b & 4;
bfc1 = b & 2;
bfc0 = b & 1;
return;
case 10:
if (act != 0) {
error(2);
return;
}
mtc = (mtc & 255) + ((b & 255) << 8);
return;
case 11:
if (act != 0) {
error(2);
return;
}
mtc = (mtc & 65280) + (b & 255);
return;
case 26:
btc = (btc & 255) + ((b & 255) << 8);
return;
case 27:
btc = (btc & 65280) + (b & 255);
return;
case 12:
if (act != 0) {
error(2);
return;
}
mar = (mar & 16777215) + ((b & 255) << 24);
return;
case 13:
if (act != 0) {
error(2);
return;
}
mar = (mar & -16711681) + ((b & 255) << 16);
return;
case 14:
if (act != 0) {
error(2);
return;
}
mar = (mar & -65281) + ((b & 255) << 8);
return;
case 15:
if (act != 0) {
error(2);
return;
}
mar = (mar & -256) + (b & 255);
return;
case 20:
if (act != 0) {
error(2);
return;
}
dar = (dar & 16777215) + ((b & 255) << 24);
return;
case 21:
if (act != 0) {
error(2);
return;
}
dar = (dar & -16711681) + ((b & 255) << 16);
return;
case 22:
if (act != 0) {
error(2);
return;
}
dar = (dar & -65281) + ((b & 255) << 8);
return;
case 23:
if (act != 0) {
error(2);
return;
}
dar = (dar & -256) + (b & 255);
return;
case 28:
bar = (bar & 16777215) + ((b & 255) << 24);
return;
case 29:
bar = (bar & -16711681) + ((b & 255) << 16);
return;
case 30:
bar = (bar & -65281) + ((b & 255) << 8);
return;
case 31:
bar = (bar & -256) + (b & 255);
return;
}
}
void write_short_big(int a, short s) {
switch (a & 63) {
case 10:
if (act != 0) {
error(2);
return;
}
mtc = s & 65535;
return;
case 26:
btc = s & 65535;
return;
case 12:
if (act != 0) {
error(2);
return;
}
mar = (mar & 65535) + ((s & 65535) << 16);
return;
case 14:
if (act != 0) {
error(2);
return;
}
mar = (mar & -65536) + (s & 65535);
return;
case 20:
if (act != 0) {
error(2);
return;
}
dar = (dar & 65535) + ((s & 65535) << 16);
return;
case 22:
if (act != 0) {
error(2);
return;
}
dar = (dar & -65536) + (s & 65535);
return;
case 28:
bar = (bar & 65535) + ((s & 65535) << 16);
return;
case 30:
bar = (bar & -65536) + (s & 65535);
return;
}
write_byte(a, (byte) (s >> 8));
write_byte(a + 1, (byte) s);
}
void write_int_big(int a, int i) {
switch (a & 63) {
case 12:
if (act != 0) {
error(2);
return;
}
mar = i;
return;
case 20:
if (act != 0) {
error(2);
return;
}
dar = i;
return;
case 28:
bar = i;
return;
}
write_byte(a, (byte) (i >> 24));
write_byte(a + 1, (byte) (i >> 16));
write_byte(a + 2, (byte) (i >> 8));
write_byte(a + 3, (byte) i);
}
void complete() {
err = 0;
act = 0;
str = 0;
cnt = 0;
sab = 0;
error_code = 0;
if (ite != 0) {
interrupt(ch << 1);
}
}
private void error(int code) {
err = 16;
act = 0;
str = 0;
cnt = 0;
sab = 0;
error_code = code;
if (ite != 0) {
interrupt((ch << 1) + 1);
}
}
void transfer() {
int code = 0;
try {
switch (size) {
case 0:
case 48:
if (dps == 0) {
if (dir == 0) {
code = 9;
byte data = x68000.read_byte(mar, mfc2);
if (mac == 4) {
mar += 1;
} else if (mac == 8) {
mar -= 1;
}
code = 10;
x68000.write_byte(dar, data, dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
} else {
code = 10;
byte data = x68000.read_byte(dar, dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
code = 9;
x68000.write_byte(mar, data, mfc2);
if (mac == 4) {
mar += 1;
} else if (mac == 8) {
mar -= 1;
}
}
} else {
if (dir == 0) {
code = 9;
byte data = x68000.read_byte(mar, mfc2);
if (mac == 4) {
mar += 1;
} else if (mac == 8) {
mar -= 1;
}
code = 10;
x68000.write_byte(dar, data, dfc2);
if (dac == 1) {
dar += 1;
} else if (dac == 2) {
dar -= 1;
}
} else {
code = 10;
byte data = x68000.read_byte(dar, dfc2);
if (dac == 1) {
dar += 1;
} else if (dac == 2) {
dar -= 1;
}
code = 9;
x68000.write_byte(mar, (byte) data, mfc2);
if (mac == 4) {
mar += 1;
} else if (mac == 8) {
mar -= 1;
}
}
}
break;
case 16:
if (dps == 0) {
if (dir == 0) {
code = 9;
short data = x68000.read_short_big(mar, mfc2);
if (mac == 4) {
mar += 2;
} else if (mac == 8) {
mar -= 2;
}
code = 10;
x68000.write_byte(dar, (byte) (data >> 8), dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
x68000.write_byte(dar, (byte) data, dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
} else {
code = 10;
short data = (short) (x68000.read_byte(dar, dfc2) << 8);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
data += x68000.read_byte(dar, dfc2) & 255;
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
code = 9;
x68000.write_short_big(mar, data, mfc2);
if (mac == 4) {
mar += 2;
} else if (mac == 8) {
mar -= 2;
}
}
} else {
if (dir == 0) {
code = 9;
short data = x68000.read_short_big(mar, mfc2);
if (mac == 4) {
mar += 2;
} else if (mac == 8) {
mar -= 2;
}
code = 10;
x68000.write_short_big(dar, data, dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
} else {
code = 10;
short data = x68000.read_short_big(dar, dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
code = 9;
x68000.write_short_big(mar, data, mfc2);
if (mac == 4) {
mar += 2;
} else if (mac == 8) {
mar -= 2;
}
}
}
break;
case 32:
if (dps == 0) {
if (dir == 0) {
code = 9;
int data = x68000.read_int_big(mar, mfc2);
if (mac == 4) {
mar += 4;
} else if (mac == 8) {
mar -= 4;
}
code = 10;
x68000.write_byte(dar, (byte) (data >> 24), dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
x68000.write_byte(dar, (byte) (data >> 16), dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
x68000.write_byte(dar, (byte) (data >> 8), dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
x68000.write_byte(dar, (byte) data, dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
} else {
code = 10;
int data = x68000.read_byte(dar, dfc2) << 24;
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
data += (x68000.read_byte(dar, dfc2) & 255) << 16;
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
data += (x68000.read_byte(dar, dfc2) & 255) << 8;
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
data += x68000.read_byte(dar, dfc2) & 255;
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
code = 9;
x68000.write_int_big(mar, data, mfc2);
if (mac == 4) {
mar += 4;
} else if (mac == 8) {
mar -= 4;
}
}
} else {
if (dir == 0) {
code = 9;
int data = x68000.read_int_big(mar, mfc2);
if (mac == 4) {
mar += 4;
} else if (mac == 8) {
mar -= 4;
}
code = 10;
x68000.write_short_big(dar, (short) (data >> 16), dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
x68000.write_short_big(dar, (short) data, dfc2);
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
} else {
code = 10;
int data = x68000.read_short_big(dar, dfc2) << 16;
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
data += x68000.read_short_big(dar, dfc2) & 65535;
if (dac == 1) {
dar += 2;
} else if (dac == 2) {
dar -= 2;
}
code = 9;
x68000.write_int_big(mar, data, mfc2);
if (mac == 4) {
mar += 4;
} else if (mac == 8) {
mar -= 4;
}
}
}
break;
}
} catch (MC68000Exception e) {
error(code);
return;
}
mtc--;
if (mtc != 0) {
return;
}
if (chain == 8) {
if (btc == 0) {
coc = 128;
blc = 64;
ndt = 0;
complete();
return;
}
try {
mar = x68000.read_int_big(bar, bfc2);
bar += 4;
mtc = x68000.read_short_big(bar, bfc2) & 65535;
bar += 2;
} catch (MC68000Exception e) {
error(11);
return;
}
btc--;
if (mtc == 0) {
error(13);
return;
}
if ((size == 16 || size == 32) && (mar & 1) != 0) {
error(5);
return;
}
return;
}
if (chain == 12) {
if (bar == 0) {
coc = 128;
blc = 64;
ndt = 0;
complete();
return;
}
if ((bar & 1) != 0) {
error(7);
return;
}
try {
mar = x68000.read_int_big(bar, bfc2);
bar += 4;
mtc = x68000.read_short_big(bar, bfc2) & 65535;
bar += 2;
bar = x68000.read_int_big(bar, bfc2);
} catch (MC68000Exception e) {
error(11);
return;
}
if (mtc == 0) {
error(13);
return;
}
if ((size == 16 || size == 32) && (mar & 1) != 0) {
error(5);
return;
}
return;
}
if (cnt != 0) {
blc = 64;
cnt = 0;
if (ite != 0) {
interrupt(ch << 1);
}
mtc = btc;
mar = bar;
if (mtc == 0) {
error(13);
return;
}
if ((size == 16 || size == 32) && (mar & 1) != 0) {
error(5);
return;
}
return;
}
coc = 128;
blc = 0;
ndt = 0;
complete();
return;
}
void fallPCL() {
pcs = 0;
pct = 2;
if (act == 0 || hlt != 0) {
return;
}
transfer();
}
void risePCL() {
pcs = 1;
}
}
}
| [
"umjammer@00cfdfb4-7834-11de-ac83-69fcb5c178b1"
] | umjammer@00cfdfb4-7834-11de-ac83-69fcb5c178b1 |
fac6d4272fdf177b2db9b5a98ecf873444f9fb65 | 3cd63aba77b753d85414b29279a77c0bc251cea9 | /main/plugins/org.talend.designer.components.libs/libs_src/salesforceBulkAPI/com/sforce/soap/partner/PerformQuickActions_element.java | cddb82e93965a2e761c42a616e60f1cd12e08c0d | [
"Apache-2.0"
] | permissive | 195858/tdi-studio-se | 249bcebb9700c6bbc8905ccef73032942827390d | 4fdb5cfb3aeee621eacfaef17882d92d65db42c3 | refs/heads/master | 2021-04-06T08:56:14.666143 | 2018-10-01T14:11:28 | 2018-10-01T14:11:28 | 124,540,962 | 1 | 0 | null | 2018-10-01T14:11:29 | 2018-03-09T12:59:25 | Java | UTF-8 | Java | false | false | 3,841 | java | package com.sforce.soap.partner;
/**
* Generated by ComplexTypeCodeGenerator.java. Please do not edit.
*/
public class PerformQuickActions_element implements com.sforce.ws.bind.XMLizable , IPerformQuickActions_element{
/**
* Constructor
*/
public PerformQuickActions_element() {}
/**
* element : quickActions of type {urn:partner.soap.sforce.com}PerformQuickActionRequest
* java type: com.sforce.soap.partner.PerformQuickActionRequest[]
*/
private static final com.sforce.ws.bind.TypeInfo quickActions__typeInfo =
new com.sforce.ws.bind.TypeInfo("urn:partner.soap.sforce.com","quickActions","urn:partner.soap.sforce.com","PerformQuickActionRequest",0,-1,true);
private boolean quickActions__is_set = false;
private com.sforce.soap.partner.PerformQuickActionRequest[] quickActions = new com.sforce.soap.partner.PerformQuickActionRequest[0];
@Override
public com.sforce.soap.partner.PerformQuickActionRequest[] getQuickActions() {
return quickActions;
}
@Override
public void setQuickActions(com.sforce.soap.partner.IPerformQuickActionRequest[] quickActions) {
this.quickActions = castArray(com.sforce.soap.partner.PerformQuickActionRequest.class, quickActions);
quickActions__is_set = true;
}
protected void setQuickActions(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
__in.peekTag();
if (__typeMapper.isElement(__in, quickActions__typeInfo)) {
setQuickActions((com.sforce.soap.partner.PerformQuickActionRequest[])__typeMapper.readObject(__in, quickActions__typeInfo, com.sforce.soap.partner.PerformQuickActionRequest[].class));
}
}
/**
*/
@Override
public void write(javax.xml.namespace.QName __element,
com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException {
__out.writeStartTag(__element.getNamespaceURI(), __element.getLocalPart());
writeFields(__out, __typeMapper);
__out.writeEndTag(__element.getNamespaceURI(), __element.getLocalPart());
}
protected void writeFields(com.sforce.ws.parser.XmlOutputStream __out,
com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException {
__typeMapper.writeObject(__out, quickActions__typeInfo, quickActions, quickActions__is_set);
}
@Override
public void load(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
__typeMapper.consumeStartTag(__in);
loadFields(__in, __typeMapper);
__typeMapper.consumeEndTag(__in);
}
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
setQuickActions(__in, __typeMapper);
}
@Override
public String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
sb.append("[PerformQuickActions_element ");
sb.append(" quickActions='").append(com.sforce.ws.util.Verbose.toString(quickActions)).append("'\n");
sb.append("]\n");
return sb.toString();
}
@SuppressWarnings("unchecked")
private <T,U> T[] castArray(Class<T> clazz, U[] array) {
if (array == null) {
return null;
}
T[] retVal = (T[]) java.lang.reflect.Array.newInstance(clazz, array.length);
for (int i=0; i < array.length; i++) {
retVal[i] = (T)array[i];
}
return retVal;
}
}
| [
"jzhao@talend.com"
] | jzhao@talend.com |
aba731481d66c776425b193122ba42d1fae075d3 | e18dfb7c785b1a0b630b1ee2382698f16026ea04 | /src/main/java/com/iwc/shop/common/utils/SystemPath.java | 8ad0815a531c2a5cdd12790d3919fa1d0538cf9f | [
"MIT"
] | permissive | zyjwall/Shop-for-JavaWeb | d21d4c2cb629bb7b695da9022eea2c93737fa349 | d0f65ce485e40444ff9e218c9ca3fefc203b68ea | refs/heads/master | 2020-07-16T00:38:54.608100 | 2019-09-21T09:06:59 | 2019-09-21T09:06:59 | 205,683,519 | 0 | 0 | MIT | 2019-09-01T13:55:14 | 2019-09-01T13:55:14 | null | UTF-8 | Java | false | false | 1,407 | java | /**
* Copyright © 2012-2014 <a href="http://www.iwantclick.com">iWantClick</a>iwc.shop All rights reserved.
*/
package com.iwc.shop.common.utils;
/**
* @author wanye
* @date Dec 14, 2008
* @version v 1.0
* @description 得到当前应用的系统路径
*/
public class SystemPath {
public static String getSysPath() {
String path = Thread.currentThread().getContextClassLoader()
.getResource("").toString();
String temp = path.replaceFirst("file:/", "").replaceFirst(
"WEB-INF/classes/", "");
String separator = System.getProperty("file.separator");
String resultPath = temp.replaceAll("/", separator + separator);
return resultPath;
}
public static String getClassPath() {
String path = Thread.currentThread().getContextClassLoader()
.getResource("").toString();
String temp = path.replaceFirst("file:/", "");
String separator = System.getProperty("file.separator");
String resultPath = temp.replaceAll("/", separator + separator);
return resultPath;
}
public static String getSystempPath() {
return System.getProperty("java.io.tmpdir");
}
public static String getSeparator() {
return System.getProperty("file.separator");
}
public static void main(String[] args) {
System.out.println(getSysPath());
System.out.println(System.getProperty("java.io.tmpdir"));
System.out.println(getSeparator());
System.out.println(getClassPath());
}
}
| [
"908601756@qq.com"
] | 908601756@qq.com |
004dbbd60b3b0604b4f3edb42a7c72d1164a52be | 74eaf55447265e97c66b9f2f59b8bbdfebb488e1 | /src/test/java/com/springboot/LinBootApplicationTests.java | a04ea0045f2f3bc1c9ba889f03ffa556a2cf4b22 | [] | no_license | xueshuiyy/springboot-lin | 85c90ba70f0ac33e47c1c5cc9bdc841941dca02d | bef856dd7b2f1bb49b3ff61e8c0f034d64175709 | refs/heads/master | 2022-07-18T19:48:18.760318 | 2019-06-09T14:12:15 | 2019-06-09T14:12:15 | 187,582,996 | 0 | 0 | null | 2022-06-21T01:08:57 | 2019-05-20T06:46:46 | Java | UTF-8 | Java | false | false | 332 | java | package com.springboot;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class LinBootApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"xueshuiyy@126.com"
] | xueshuiyy@126.com |
87da7c8f657dadc09854cc6a7595ec1c36c48271 | 228e4d395448351087249528b1697c5b53f75012 | /shareLearn/src/main/java/com/volley/req/LoginParser.java | 9f5311abb92010b30daaf117a749637720a343bd | [] | no_license | czqaiwsm/androidStudioShareGit | bdde7b26e561143825b0ae15cc11004bd64ac443 | d9129bb927f00d98513d7ad79ae8352cb6ea0d17 | refs/heads/master | 2020-04-18T01:51:54.455211 | 2017-10-23T14:20:23 | 2017-10-23T14:20:23 | 67,393,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 663 | java | package com.volley.req;
import com.google.gson.reflect.TypeToken;
import com.share.learn.utils.AppLog;
import com.volley.req.net.inferface.IParser;
import com.volley.req.parser.JsonParserBase;
import com.volley.req.parser.ParserUtil;
import org.json.JSONObject;
public class LoginParser implements IParser {
@Override
public Object fromJson(JSONObject object) {
return null;
}
@Override
public JsonParserBase<UserInfo> fromJson(String json) {
AppLog.Logi("responJson:"+json);
JsonParserBase<UserInfo> result = ParserUtil.fromJsonBase(json, new TypeToken<JsonParserBase<UserInfo>>() {
}.getType());
return result;
}
}
| [
"1148392049@qq.com"
] | 1148392049@qq.com |
761c0ca19a218de70236e2d7c0788e65d804c4da | aa8789725c99ff93d47de417cf02c544162e4ce0 | /NetBeansProjects/UnitConversionClient/src/ru/galuzin/unitconversionclient/UnitConversionClient.java | 93c8e186dc63c52de7e60ab27aaee4bded721533 | [] | no_license | skallod/javaEElearning | 3539e3558eb0af6c03ea6d5940ca8d5c5da8dd1b | 2c0478ad4df69f868aaa8345520ca3f7680bf923 | refs/heads/master | 2022-12-27T17:22:41.176955 | 2021-03-11T14:56:26 | 2021-03-11T14:56:26 | 50,860,329 | 0 | 0 | null | 2022-12-16T01:23:13 | 2016-02-01T18:20:26 | Java | UTF-8 | Java | false | false | 909 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.galuzin.unitconversionclient;
/**
*
* @author User
*/
public class UnitConversionClient {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
double inches = centimetersToInches(10);
System.out.println("inches "+inches);
}
private static double centimetersToInches(double centimeters) {
ru.galuzin.unitconversionclient.UnitConversion_Service service = new ru.galuzin.unitconversionclient.UnitConversion_Service();
ru.galuzin.unitconversionclient.UnitConversion port = service.getUnitConversionPort();
return port.centimetersToInches(centimeters);
}
}
| [
"galuzin.leonid@gmail.com"
] | galuzin.leonid@gmail.com |
516a7175698b1c7b4e8e5651af8a26742e25ea38 | 362e2d0e1902eb14d0be9edbe72296698091e0df | /Practica10/src/practica10/ColorPanel.java | 88026c074c8387e9d2ba5b77c23726d6bb86e8e4 | [] | no_license | Antobio17/SMM | d2c9fe3fc91104118d0d606752ffb440bd6ecff7 | 219080b59f2e9aafe7cc8a0273d4fa5f6c66c23d | refs/heads/master | 2023-05-14T09:38:30.544612 | 2021-06-07T13:46:02 | 2021-06-07T13:46:02 | 365,561,162 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,016 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package practica10;
import java.awt.Color;
/**
*
* @author Antonio Jiménez Rodríguez
*/
public class ColorPanel extends javax.swing.JPanel {
/**
* Creates new form ColorPanel
* @param color
*/
public ColorPanel(Color color) {
initComponents();
buttonColor.setBackground(color);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
buttonColor = new javax.swing.JButton();
buttonColor.setMaximumSize(new java.awt.Dimension(25, 25));
buttonColor.setMinimumSize(new java.awt.Dimension(25, 25));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonColor, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonColor, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
);
}// </editor-fold>//GEN-END:initComponents
/**
*
* @param color
*/
public void setColor(Color color){
buttonColor.setBackground(color);
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonColor;
// End of variables declaration//GEN-END:variables
}
| [
"antoniojr997@gmail.com"
] | antoniojr997@gmail.com |
a4badc6017344226f9c27b60889e5813f3abcb11 | e6256a444f1f1002557a9a4e38989aaa9a5e507e | /src/main/java/Controller/AppController.java | 3336f1440b29f2354c9e1a70d7b64b815b7f455a | [] | no_license | hridendra27/frontHandHandle | d7831bf72c77586f3a692d239de4fed59e8c327a | d1c899a98f1d5694bb768115dd78a050f4899bd7 | refs/heads/master | 2021-04-18T21:45:22.730255 | 2018-03-31T12:17:42 | 2018-03-31T12:17:42 | 126,820,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,236 | java | package Controller;
import java.util.ArrayList;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.scheduling.annotation.EnableAsync;
//import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import Lib_Query.*;
import Model.DataModel;
import Services.DataServices;
//@CrossOrigin(origins="*")
@RestController
@EnableWebMvc
@EnableAsync
public class AppController {
DataServices cs=new DataServices();
@RequestMapping(value="/tasks",method = RequestMethod.GET,headers="Accept=application/json")
public @ResponseBody HashMap<String,Object> apps (){
HashMap <String,Object> hm =new HashMap<String,Object>( );
hm.put("Hello", "World");
System.out.println(hm);
return hm;
}
@RequestMapping(value = "/checkl", method = RequestMethod.POST)
public @ResponseBody HashMap<String,Object> apps1 (HttpServletRequest request, HttpServletResponse response){
HashMap <String,Object> hm =new HashMap<String,Object>();
hm.put("Hello", "World");
hm.put("id", request.getParameter("data1"));
System.out.println(request);
System.out.println(hm);
return hm;
}
@RequestMapping(value="/datamodel",method = RequestMethod.POST,headers="Accept=application/json")
public @ResponseBody HashMap<String,Object> modelsetting (@RequestBody DataModel dm){
HashMap<String,Object> hash=new HashMap<String, Object>();
//Random UserName
dm.setUsername(ValidationData.userNameGenration(dm.getFirstname(),dm.getLastname()) );
//Password Validation
hash.put("Password",((ValidationData.passwordValidation (dm.getPassword()))) );
//Mobile Validation
hash.put("Mobile",(ValidationData.mobileNoValidation (dm.getMobileno())));
// Email Validation
hash.put("Eamil",(ValidationData.emailValidation(dm.getEmail())));
// Call Service
try {
if (hash.get("Password").equals("Strong")&&(hash.get("Mobile").equals("true")&& hash.get("Eamil").equals("true"))) {
String s= cs.addDataService(dm);
hash.put("Message",s);
hash.put("USER_NAME",dm.getUsername());
if (s==ValidationData.SRN)
{
hash.put("Satatus", "UnSuccessful");
hash.put ("message 1","User Exist");
}
}else {
hash.put("Status","Error");
hash.put("Message",ValidationData.ERROR);
}
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
return hash;
}
// Retrive Data By UserName
@RequestMapping (value="/retrivebyusername", method=RequestMethod.POST, headers="Accept=application/json")
public HashMap<String,Object> retriveDataByUserName (@RequestBody DataModel usermodel){
HashMap<String,Object> hm=new HashMap<String, Object>();
try {
//ArrayList<String> s= cs. retriveDataService (usermodel);
HashMap<String,Object> hash=new HashMap<String, Object>(cs. retriveDataService (usermodel));
hash.put("Status", "success");
return hash;
/*if (s.isEmpty()) {
hash.put("Status","UnSuccesful");
hash.put("Message",ValidationData.UNNF);
hash.remove("Data", null);
}else {
//hash.put("Status","success");
//hash.put("Message","Your data");
hash.put("Data", s);
}*/
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
hm.put("Status","UnSuccesful");
hm.put("Message",ValidationData.UNNF);
return hm;
}
}
//Edit Delete
@RequestMapping (value="/edit/delete", method=RequestMethod.POST, headers="Accept=application/json")
public HashMap<String ,Object> userDelete (@RequestBody DataModel usermodel){
HashMap<String,Object> hash=new HashMap<String, Object>();
try {
int i=cs.deleteDataService (usermodel);
if (i==1) {
hash.put("Status","success");
hash.put("Message",ValidationData.SD);
}else {
hash.put("Status","Error");
hash.put("Message",ValidationData.UNNF);
}
} catch (Exception e) {
e.printStackTrace();
}
return hash;
}
//Edit Udpate
@RequestMapping (value="/edit/update", method=RequestMethod.POST,headers="Accept=application/json")
public HashMap<String,Object> userUpdate (@RequestBody DataModel usermodel){
HashMap<String,Object> hash=new HashMap<String, Object>();
try {
int i = cs.updateDataService(usermodel);
if (i==1) {
hash.put("Status","success");
hash.put("Message",ValidationData.SU);
}else {
hash.put("Status","Error");
hash.put("Message",ValidationData.SUN);
hash.put("Message1",ValidationData.UNNF+"OR Duplicate Data");
}
} catch (Exception e) {
e.printStackTrace();
}
return hash;
}
//Retrive User All
@RequestMapping (value="/retriveall", method=RequestMethod.POST,headers="Accept=application/json")
public ArrayList<String> retriveall (){
ArrayList<String> al=new ArrayList<String>(cs.dataRetrivalUser());
return al;
}
//Session Result Set
@RequestMapping("/sessionset")
public ArrayList<String> sessionSet (){
HashMap<String,Object> hash=new HashMap<String, Object>();
ArrayList<String> al=new ArrayList<String>();
try {
al = cs.sessionResultSet();
if (al.isEmpty()) {
hash.put("Status","UnSuccesful");
hash.put("Message",ValidationData.ERROR);
hash.remove("Data", null);
}else {
hash.put("Status","success");
hash.put("Message","Your data");
hash.put("Data", al);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(al);
return al;
}
}
| [
"hridendra27@gmail.com"
] | hridendra27@gmail.com |
f3b85e4e6abc3e04f7382878597f5e79dc9d7265 | 9fa3100439e632cef6fda878ba0e5d5988e123ed | /TreeLab2_Student/src/testerClasses/CloneTester.java | 06da6e66af2ecdb94d01cb8276f32460b395fc7e | [] | no_license | LuisUfret/TreesLab | 6b91ffcab854fe63ee71b58dd77418081cb52b86 | b2846550bdaece14841505bd6f5907c1a803d003 | refs/heads/master | 2020-03-12T18:29:56.638053 | 2018-04-24T04:28:51 | 2018-04-24T04:28:51 | 130,761,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | package testerClasses;
import labUtils.Utils;
import treeClasses.LinkedTree;
import treeInterfaces.Position;
public class CloneTester {
public static void main(String[] args) throws CloneNotSupportedException {
LinkedTree<String> t = new LinkedTree<>();
// add nodes and data to the tree
Position<String> p = t.addRoot("ROOT");
t.addChild(p, "Rosa");
p = t.addChild(p, "Maria");
Position<String> p1 = t.addChild(p, "Juana");
p1 = t.addChild(p1, "Lola");
t.addChild(p1, "Pepote");
p1 = t.addChild(p1, "Manolo");
p1=t.addChild(p1, "Eligio");
t.addChild(p1, "Eda");
t.addChild(p1, "Deborah");
p1 = t.addChild(p, "Pergamino");
t.addChild(p, "Bienvenido");
t.addChild(p1, "Manolin");
t.addChild(p1, "Juaniquillo");
t.addChild(p1, "Andres");
p1 = t.addChild(t.root(), "Mariola");
p = p1;
p1 = t.addChild(p1, "Leslo");
p1 = t.addChild(p1, "Papin");
p1 = t.addChild(p1, "Ana");
t.addChild(p, "Elegancia");
Utils.displayTree("The tree is: ", t);
Utils.displayTree("The tree cloned is: ", t.clone());
}
}
| [
"luisufret@10.31.47.31"
] | luisufret@10.31.47.31 |
2f3cd405eb32fdb3d16bcdfa084e1037e924b016 | 403aca6b4e2a60e773820fafa2a79ffe2ee4805b | /src/src/net/idtoki/serteca/controller/LocalidadController.java | d88a71b0e2f5bd9d942e7c3da5eec4b6fab27771 | [] | no_license | esle-elkartea/lankidetza00004 | e57a32c2d00416f86da45458db030558ef4e7f5a | a02a4ddf45050fbe85dbf41af146ae86f0b0cf22 | refs/heads/master | 2020-12-24T11:53:20.234029 | 2016-06-24T09:38:34 | 2016-06-24T09:38:34 | 61,873,745 | 0 | 0 | null | null | null | null | ISO-8859-10 | Java | false | false | 4,480 | java | package net.idtoki.serteca.controller;
import java.io.IOException;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.torque.util.Criteria;
import net.idtoki.serteca.group.LocalidadGroupBean;
import net.idtoki.serteca.helper.ClienteHelper;
import net.idtoki.serteca.helper.LocalidadHelper;
import net.idtoki.serteca.helper.TrabajadorHelper;
import net.idtoki.serteca.manager.LocalidadManager;
import net.idtoki.serteca.model.LocalidadPeer;
import net.zylk.tools.ajax.AjaxUtils;
import net.zylk.tools.ajax.AjaxUtils.DinamicGridBean;
import net.zylk.web.WebUtils;
/**
* The skeleton for this class was autogenerated by Torque on:
*
* [Wed Feb 01 12:46:43 CET 2006]
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*/
public class LocalidadController
extends net.idtoki.serteca.controller.BaseLocalidadController
{
private static final Logger logger = Logger.getLogger("net.idtoki.serteca.controller.LocalidadController");
public void init()
{
super.init();
//Aqui se registran los metodos que no se quieran repetir de otros sitios.
//por ejemplo igual quieres tener los metodos de generacion de ajax
// en un paquete aparte y no copiarlos por aqui, sino tenerlos disponibles
//para todas las aplicaciones sin repetirlos en todos los sitios, pues los registras
//y punto!!
}
public void serviceLocalidadTableContent(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
utf8RequestService(request);
DinamicGridBean dgb = WebUtils.getDinamicGridBeanParam(request,14,7);
Criteria c = LocalidadManager.buildSearchCriteria(dgb);
String CampoOrdenacion = "";
CampoOrdenacion = WebUtils.getStringParam(request, "sort_col");
String OrdenOrdenacion = "";
OrdenOrdenacion = WebUtils.getStringParam(request, "sort_dir");
if((OrdenOrdenacion != null )&& (OrdenOrdenacion.compareTo("ASC")==0))
if ((CampoOrdenacion != null)) //&& (CampoOrdenacion.compareTo("nombre")==0))
{
c.addAscendingOrderByColumn(LocalidadPeer.TABLE_NAME + "." + CampoOrdenacion.toString().toUpperCase());
//c.addAscendingOrderByColumn(LocalidadPeer.NOMBRE);
}
if ((OrdenOrdenacion != null) && (OrdenOrdenacion.compareTo("DESC")==0))
if ((CampoOrdenacion != null)) //&& (CampoOrdenacion.compareTo("nombre")==0))
{
//c.addDescendingOrderByColumn(LocalidadPeer.NOMBRE);
c.addDescendingOrderByColumn(LocalidadPeer.TABLE_NAME + "." + CampoOrdenacion.toString().toUpperCase());
}
System.out.println("El criterio es ---->" + c.toString());
//resultado de la consulta lo guardamos en un TrabajadorGroupBean
LocalidadGroupBean tgb = LocalidadManager.getLocalidads(c);
logger.info("El tamaņo es ---->" + tgb.getTotalSize());
dgb.setTotalSize(tgb.getTotalSize());
String[] methodos= new String[] {
LocalidadHelper.ID_GET_METHOD_NAME,
LocalidadHelper.NOMBRE_GET_METHOD_NAME+"LocalidadParsed",
LocalidadHelper.PROVINCIA_ID_GET_METHOD_NAME+"LocalidadParsed"
};
xmlResponseService(response,AjaxUtils.buildXmlAjaxResponseTableContentFromListObj(
tgb.getAlmacen(),
methodos,
LocalidadHelper.ID_GET_METHOD_NAME, dgb,"ISO-8859-1"));
}
public void serviceLocalidadUlContent(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
utf8RequestService(request);
String[] methodos= new String[] {
LocalidadHelper.ID_GET_METHOD_NAME,
LocalidadHelper.NOMBRE_GET_METHOD_NAME+"LocalidadParsed"
};
String param = WebUtils.getStringParam(request, "value");
if(param==null || param.length() <= 0)
param = WebUtils.getStringParam(request, new ClienteHelper().getLocalidadIdName());
if(param==null || param.length() <= 0)
param = WebUtils.getStringParam(request, new TrabajadorHelper().getLocalidadIdName());
LocalidadGroupBean mgb = LocalidadManager.getLocalidads(LocalidadManager.buildSearchCriteria(param));
simpleResponseService(response, AjaxUtils.buildAjaxULContentFromListObj(mgb.getAlmacen(),methodos, LocalidadHelper.COMPLEX_ID_GET_METHOD,"Localidad"));
}
}
| [
"noreply@esle.eu"
] | noreply@esle.eu |
d8d2c65c908a7604422995e590f1ae6804d6481c | 6c32583e563d6b9f8a79c53cc2341bbbd24b817d | /src/main/java/com/repostit/repostit/RepostitApplication.java | 37341fdaf65cae0c6efbcceb5e93536df8c7f6cb | [] | no_license | Mayesamomo/SpringBoot- | 0f5aa0ceee0417711bace43f9a15fec24dfcb006 | 2d48a3b906d372a4ce78997de6d1c84484293471 | refs/heads/master | 2022-05-15T23:30:48.584278 | 2020-03-30T10:15:54 | 2020-03-30T10:15:54 | 247,927,824 | 0 | 0 | null | 2022-03-31T19:03:50 | 2020-03-17T09:23:47 | Java | UTF-8 | Java | false | false | 393 | java | package com.repostit.repostit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication
@EnableAsync
public class RepostitApplication {
public static void main(String[] args) {
SpringApplication.run(RepostitApplication.class, args);
}
}
| [
"48134632+Mayesamomo@users.noreply.github.com"
] | 48134632+Mayesamomo@users.noreply.github.com |
c5260d91a04e1d2140f1f711bbd9a9157a127cb9 | b994ff350b30622356ba537c6be59c99a7e02eda | /src/factory/ViewAppDetails.java | 310dd9f3012fc0fdbdd5fb4f8e802a9e269203aa | [] | no_license | vidhoonv/ctracker | 28801ceb023fc55eb171c5263f64cef700f35a77 | f117ba56c865c766ed2c9f3dd33ff24aaae11668 | refs/heads/master | 2021-01-10T20:03:43.472782 | 2012-11-27T15:58:14 | 2012-11-27T15:58:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,526 | java | /*
* ViewAppDetails.java
*
* Created on 12 October, 2009, 11:42 PM
*/
package factory;
import ctracker.*;
import java.sql.*;
/**
*
* @author Vidhoon
*/
public class ViewAppDetails extends javax.swing.JFrame {
/** Creates new form ViewAppDetails */
public ViewAppDetails() {
initComponents();
connector ob=new connector();
try
{
Connection my=ob.connect();
Statement s=my.createStatement();
ResultSet rs = s.executeQuery("select appid from appinfo");
while(rs.next())
{
applist.addItem(rs.getString("appid"));
}
}
catch(Exception e)
{
System.out.println(e);
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
applist = new javax.swing.JComboBox();
jScrollPane1 = new javax.swing.JScrollPane();
det = new javax.swing.JTextArea();
getdetails = new javax.swing.JButton();
ana = new javax.swing.JButton();
ud = new javax.swing.JButton();
close = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("APP ID");
det.setColumns(20);
det.setLineWrap(true);
det.setRows(5);
jScrollPane1.setViewportView(det);
getdetails.setText("Fetch");
getdetails.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
getdetailsMouseClicked(evt);
}
});
getdetails.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
getdetailsActionPerformed(evt);
}
});
ana.setText("Add New App");
ana.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
anaMouseClicked(evt);
}
});
ud.setText("Update Details");
ud.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
udMouseClicked(evt);
}
});
close.setText("close");
close.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
closeMouseClicked(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(81, 81, 81)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 117, Short.MAX_VALUE)
.addComponent(applist, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(149, 149, 149))
.addGroup(layout.createSequentialGroup()
.addGap(67, 67, 67)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(94, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(301, Short.MAX_VALUE)
.addComponent(getdetails)
.addGap(48, 48, 48))
.addGroup(layout.createSequentialGroup()
.addGap(45, 45, 45)
.addComponent(ana)
.addGap(42, 42, 42)
.addComponent(ud)
.addGap(38, 38, 38)
.addComponent(close)
.addContainerGap(26, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(25, 25, 25)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(applist, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(11, 11, 11)
.addComponent(getdetails)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ana)
.addComponent(ud)
.addComponent(close))
.addGap(19, 19, 19))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void getdetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_getdetailsActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_getdetailsActionPerformed
private void closeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeMouseClicked
this.setVisible(false);
// TODO add your handling code here:
}//GEN-LAST:event_closeMouseClicked
private void anaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_anaMouseClicked
// TODO add your handling code here:
ReleaseNewApp ob=new ReleaseNewApp();
ob.setVisible(true);
}//GEN-LAST:event_anaMouseClicked
private void udMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_udMouseClicked
// TODO add your handling code here:
UpdateAppInfo ob=new UpdateAppInfo();
ob.setVisible(true);
}//GEN-LAST:event_udMouseClicked
private void getdetailsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_getdetailsMouseClicked
// TODO add your handling code here:
det.setText("");
String aid,an,ac,ad,aen,ap,ainfo=null;
aid=(String)applist.getSelectedItem();
connector ob=new connector();
int a=Integer.parseInt(aid);
try
{
Connection my=ob.connect();
Statement s=my.createStatement();
ResultSet rs = s.executeQuery("select * from appinfo where appid="+a);
if(rs.next())
{
// applist.addItem(rs.getString("appid"));
an="App Name: "+rs.getString("appname");
ac="Cost: "+rs.getString("appcost");
ad="Desc: "+rs.getString("appdesc");
aen="Enhancements: "+rs.getString("appen");
ap="Power: "+rs.getString("apppow");
ainfo=an+"\n"+ac+"\n"+ad+"\n"+aen+"\n"+ap+"\n\n" ;
det.setText(ainfo);
}
}
catch(Exception e)
{
System.out.println(e);
}
}//GEN-LAST:event_getdetailsMouseClicked
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ViewAppDetails().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton ana;
private javax.swing.JComboBox applist;
private javax.swing.JButton close;
private javax.swing.JTextArea det;
private javax.swing.JButton getdetails;
private javax.swing.JLabel jLabel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JButton ud;
// End of variables declaration//GEN-END:variables
}
| [
"vidhu2366@gmail.com"
] | vidhu2366@gmail.com |
1c26617d3f62ec27a65e4562988666360550e73e | 765db637b5c8d39ddd225c94197a4d26c72e2d26 | /module_btc/src/main/java/com/quincysx/crypto/utils/Base58.java | 8e02cec1fa345139516051e9432111aa9869ef1c | [] | no_license | Seasonallan/PSAndroid | 4ff6a6bf9ede9c34d78b8b07ef53d3d6a6fa9949 | abfe5337b5dbb565a97831c9cd3e6501a5e20655 | refs/heads/master | 2023-06-23T03:27:08.517222 | 2023-06-11T04:19:07 | 2023-06-11T04:19:07 | 233,226,047 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,779 | java | package com.quincysx.crypto.utils;
import java.math.BigInteger;
/**
* @author QuincySx
* @date 2018/3/1 下午5:04
*/
public final class Base58 {
private static final char[] BASE58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray();
// private static final char[] BASE58 = "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz".toCharArray();
private static final int BASE58_CHUNK_DIGITS = 10;//how many base 58 digits fits in long
private static final BigInteger BASE58_CHUNK_MOD = BigInteger.valueOf(0x5fa8624c7fba400L); //58^BASE58_CHUNK_DIGITS
private static final byte[] BASE58_VALUES = new byte[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1,
-1, 9, 10, 11, 12, 13, 14, 15, 16, -1, 17, 18, 19, 20, 21, -1,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1,
-1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, -1, 44, 45, 46,
47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
public static byte[] decode(String input) {
if (input == null) {
return null;
}
input = input.trim();
if (input.length() == 0) {
return new byte[0];
}
BigInteger resultNum = BigInteger.ZERO;
int nLeadingZeros = 0;
while (nLeadingZeros < input.length() && input.charAt(nLeadingZeros) == BASE58[0]) {
nLeadingZeros++;
}
long acc = 0;
int nDigits = 0;
int p = nLeadingZeros;
while (p < input.length()) {
int v = BASE58_VALUES[input.charAt(p) & 0xff];
if (v >= 0) {
acc *= 58;
acc += v;
nDigits++;
if (nDigits == BASE58_CHUNK_DIGITS) {
resultNum = resultNum.multiply(BASE58_CHUNK_MOD).add(BigInteger.valueOf(acc));
acc = 0;
nDigits = 0;
}
p++;
} else {
break;
}
}
if (nDigits > 0) {
long mul = 58;
while (--nDigits > 0) {
mul *= 58;
}
resultNum = resultNum.multiply(BigInteger.valueOf(mul)).add(BigInteger.valueOf(acc));
}
final int BASE58_SPACE = -2;
while (p < input.length() && BASE58_VALUES[input.charAt(p) & 0xff] == BASE58_SPACE) {
p++;
}
if (p < input.length()) {
return null;
}
byte[] plainNumber = resultNum.toByteArray();
int plainNumbersOffs = plainNumber[0] == 0 ? 1 : 0;
byte[] result = new byte[nLeadingZeros + plainNumber.length - plainNumbersOffs];
System.arraycopy(plainNumber, plainNumbersOffs, result, nLeadingZeros, plainNumber.length - plainNumbersOffs);
return result;
}
public static String encode(byte[] input) {
if (input == null) {
return null;
}
StringBuilder str = new StringBuilder((input.length * 350) / 256 + 1);
BigInteger bn = new BigInteger(1, input);
long rem;
while (true) {
BigInteger[] divideAndRemainder = bn.divideAndRemainder(BASE58_CHUNK_MOD);
bn = divideAndRemainder[0];
rem = divideAndRemainder[1].longValue();
if (bn.compareTo(BigInteger.ZERO) == 0) {
break;
}
for (int i = 0; i < BASE58_CHUNK_DIGITS; i++) {
str.append(BASE58[(int) (rem % 58)]);
rem /= 58;
}
}
while (rem != 0) {
str.append(BASE58[(int) (rem % 58)]);
rem /= 58;
}
str.reverse();
int nLeadingZeros = 0;
while (nLeadingZeros < input.length && input[nLeadingZeros] == 0) {
str.insert(0, BASE58[0]);
nLeadingZeros++;
}
return str.toString();
}
}
| [
"451360508@qq.com"
] | 451360508@qq.com |
7de8e61fc6e4c911ded64103b919fcc5a086b27a | 8c5e53b7f3c21dfc14718fc1ac6aab94b54ca88f | /src/wcp-tag/src/main/java/com/farm/doc/tag/ReadIsShowForUser.java | 050414296cb9ef9531b9e9e21a8fd9949bcbcfb0 | [] | no_license | zwzdream/wcpTest | 57294a779a058028433ed9bffb4e9e23995e27fe | f0fed9d40d29ad7942d8056b68e76c9a22081c53 | refs/heads/master | 2020-03-22T19:05:07.199958 | 2018-07-11T01:24:02 | 2018-07-11T01:24:02 | 140,503,479 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,613 | java | package com.farm.doc.tag;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import com.farm.core.auth.domain.LoginUser;
import com.farm.doc.server.FarmDocManagerInter;
import com.farm.doc.server.FarmDocOperateRightInter;
import com.farm.util.spring.BeanFactory;
import com.farm.web.constant.FarmConstant;
public class ReadIsShowForUser extends TagSupport {
private String docId;
/**
*
*/
private static final long serialVersionUID = 1L;
private final static FarmDocOperateRightInter aloneIMP = (FarmDocOperateRightInter) BeanFactory
.getBean("farmDocOperateRightImpl");
private final static FarmDocManagerInter docIMP = (FarmDocManagerInter) BeanFactory
.getBean("farmDocManagerImpl");
@Override
public int doEndTag() throws JspException {
return EVAL_PAGE;
}
@SuppressWarnings("deprecation")
@Override
public int doStartTag() throws JspException {
HttpServletRequest request = (HttpServletRequest) super.pageContext
.getRequest();
LoginUser user = (LoginUser) request.getSession().getAttribute(
FarmConstant.SESSION_USEROBJ);
// EVAL_BODY_INCLUDE
// 则执行自定义标签的标签体;
// 返回SKIP_BODY则忽略自定义标签的标签体,直接解释执行自定义标签的结果标记。
if (aloneIMP.isRead(user, docIMP.getDocOnlyBean(docId))) {
return EVAL_BODY_INCLUDE;
}
return SKIP_BODY;
}
public String getDocId() {
return docId;
}
public void setDocId(String docId) {
this.docId = docId;
}
}
| [
"1411872139@qq.com"
] | 1411872139@qq.com |
6423a57fa7b5d8a4202915ba8e892236b90bd107 | 598ec63b84657efe570d02dd3dfbdd5ee3ce332f | /src/main/java/simplejasper/Utils.java | 99396c10c0387a80969f52b5bf695988f91096a0 | [] | no_license | rodrigomanhaes/simplejasper | 4b31a360ff5be30419f576c1ae7bdf28eca81cff | 80cd00547145319eefc156715e15a06792aa12e3 | refs/heads/master | 2023-04-30T19:24:02.799858 | 2023-01-24T01:33:15 | 2023-01-24T01:34:27 | 205,642,164 | 0 | 0 | null | 2023-04-14T18:13:22 | 2019-09-01T07:10:34 | Java | UTF-8 | Java | false | false | 3,772 | java | package simplejasper;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.Base64;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
public class Utils {
public static void writeToFile(String reportName, String content, String extension) {
String path = jasperPath(reportName, extension);
createParentDir(path);
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(path)));
writer.write(content);
writer.close();
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
public static void writeToFile(String name, byte[] content) {
String path = jasperPath(name);
createParentDir(name);
try {
OutputStream output = new FileOutputStream(new File(path));
output.write(content);
output.close();
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
public static Map<String, Object> parseJSON(String jsonContent)
{
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.readValue(jsonContent, new TypeReference<HashMap<String, Object>>() {});
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public static String decode64(String encodedContent, Charset charset) {
byte[] decodedBytes = Base64.getDecoder().decode(ruby2java(encodedContent));
return new String(decodedBytes, charset);
}
public static byte[] decode64(String encodedContent) {
return Base64.getDecoder().decode(ruby2java(encodedContent));
}
public static String encode64(byte[] data) {
return Base64.getEncoder().encodeToString(data);
}
private static String ruby2java(String encodedString) {
return encodedString.replaceAll("\n", "");
};
private static void createParentDir(String name) {
new File(new File(name).getParent()).mkdir();
}
public static String jasperDir(String reportName) {
String baseDir = System.getenv("JASPER_DIR");
String[] splitted = reportName.split("/");
return splitted.length == 2 ? baseDir + "/" + splitted[0] : baseDir;
}
public static String singleFileName(String reportName, String extension) {
String[] splitted = reportName.split("/");
String fileName = splitted.length == 2 ? splitted[1] : reportName;
String withoutExtension = fileName.replaceFirst("[.][^.]+$", "");
return withoutExtension + "." + extension;
}
public static String jasperPath(String reportName, String extension) {
return System.getenv("JASPER_DIR") + "/" + reportName + "." + extension;
}
public static String jasperPath(String reportName) {
return System.getenv("JASPER_DIR") + "/" + reportName;
}
public static String environment(String variable, String defaultValue) {
String originalValue = System.getenv(variable);
return originalValue == null || originalValue.isBlank() ? defaultValue : originalValue;
}
public static void setDefaultLocale() {
String language = environment("JASPER_LANGUAGE", null);
String country = environment("JASPER_COUNTRY", null);
if (language != null && country != null) {
Locale.setDefault(new Locale(language, country));
}
}
}
| [
"rmanhaes@gmail.com"
] | rmanhaes@gmail.com |
41f206b09231728d1c3ed2966de2f2aa877ea0dd | 15792626ceb9b3e7393ea649acc4ebe663f08276 | /autoload-cache-manager/autoload-cache-manager-jedis/src/main/java/com/jarvis/cache/redis/JedisClusterPipeline.java | ae97ab8e98f3e4e1a7be93da5510760cd2386a2e | [
"Apache-2.0"
] | permissive | yuanhotel/AutoLoadCache | a0283e419cb041c71f5b12d4720a605891497898 | 6facc33327160d5b003bd21a06532de040fcdcc6 | refs/heads/master | 2020-05-21T05:53:34.538503 | 2020-03-23T07:39:07 | 2020-03-23T07:39:07 | 53,541,958 | 0 | 0 | Apache-2.0 | 2020-04-07T03:08:02 | 2016-03-10T00:23:40 | Java | UTF-8 | Java | false | false | 3,629 | java | package com.jarvis.cache.redis;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import redis.clients.jedis.Client;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisClusterInfoCache;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.PipelineBase;
import redis.clients.jedis.Response;
import redis.clients.jedis.exceptions.JedisRedirectionException;
import redis.clients.util.JedisClusterCRC16;
import redis.clients.util.SafeEncoder;
import java.io.Closeable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
/**
* 在集群模式下提供批量操作的功能。由于集群模式存在节点的动态添加删除,且client不能实时感知,所以需要有重试功能
* <p>
* 该类非线程安全
* <p>
*
*
*/
@Getter
@Slf4j
public class JedisClusterPipeline extends PipelineBase implements Closeable {
private final JedisClusterInfoCache clusterInfoCache;
/**
* 根据顺序存储每个命令对应的Client
*/
private final Queue<Client> clients;
/**
* 用于缓存连接
*/
private final Map<JedisPool, Jedis> jedisMap;
public JedisClusterPipeline(JedisClusterInfoCache clusterInfoCache) {
this.clusterInfoCache = clusterInfoCache;
this.clients = new LinkedList<>();
this.jedisMap = new HashMap<>(3);
}
/**
* 同步读取所有数据. 与syncAndReturnAll()相比,sync()只是没有对数据做反序列化
*/
protected void sync() {
innerSync(null);
}
/**
* 同步读取所有数据 并按命令顺序返回一个列表
*
* @return 按照命令的顺序返回所有的数据
*/
protected List<Object> syncAndReturnAll() {
List<Object> responseList = new ArrayList<>(clients.size());
innerSync(responseList);
return responseList;
}
private void innerSync(List<Object> formatted) {
try {
Response<?> response;
Object data;
for (Client client : clients) {
response = generateResponse(client.getOne());
if (null != formatted) {
data = response.get();
formatted.add(data);
}
}
} catch (JedisRedirectionException jre) {
throw jre;
} finally {
close();
}
}
@Override
public void close() {
clean();
clients.clear();
for (Jedis jedis : jedisMap.values()) {
flushCachedData(jedis);
jedis.close();
}
jedisMap.clear();
}
private void flushCachedData(Jedis jedis) {
try {
jedis.getClient().getAll();
} catch (RuntimeException ex) {
// 其中一个client出问题,后面出问题的几率较大
}
}
@Override
protected Client getClient(String key) {
byte[] bKey = SafeEncoder.encode(key);
return getClient(bKey);
}
@Override
protected Client getClient(byte[] key) {
Client client = getClient(JedisClusterCRC16.getSlot(key));
clients.add(client);
return client;
}
private Client getClient(int slot) {
JedisPool pool = clusterInfoCache.getSlotPool(slot);
// 根据pool从缓存中获取Jedis
Jedis jedis = jedisMap.get(pool);
if (null == jedis) {
jedis = pool.getResource();
jedisMap.put(pool, jedis);
}
return jedis.getClient();
}
}
| [
"153163285@qq.com"
] | 153163285@qq.com |
dc4196e911401f5a841aec511e20ee46b3260190 | 6013a4716823562b40f38a93631f6a96847f93e0 | /mcc-project-data/src/main/java/com/bah/mcc/util/JWTHelper.java | 6ed039b3f98115acd5e59d165797d0feb8aa2be8 | [] | no_license | dbohuslov/mcc-project-data | 48debc215750f5abf353ee9ceb6dea6a95589244 | 1b3dcf0558bd581d6f22b5db2a4ebf1e3a7f4110 | refs/heads/master | 2023-03-12T10:39:22.209690 | 2021-03-04T11:43:22 | 2021-03-04T11:43:22 | 344,127,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,186 | java | package com.bah.mcc.util;
import java.util.Date;
import java.util.Map;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.exceptions.JWTCreationException;
import com.auth0.jwt.exceptions.JWTVerificationException;
import com.auth0.jwt.interfaces.Claim;
import com.auth0.jwt.interfaces.DecodedJWT;
public class JWTHelper {
/*
* https://github.com/auth0/java-jwt
*/
public static String createToken(String scopes) {
try {
Algorithm algorithm = Algorithm.HMAC256("secret");
long fiveHoursInMillis = 1000 * 60 * 60 * 5;
Date expireDate = new Date(System.currentTimeMillis() + fiveHoursInMillis);
String token = JWT.create()
.withSubject("apiuser")
.withIssuer("me@me.com")
.withClaim("scopes", scopes)
.withExpiresAt(expireDate)
.sign(algorithm);
return token;
} catch (JWTCreationException exception){
return null;
}
}
public static boolean verifyToken(String token) {
try {
Algorithm algorithm = Algorithm.HMAC256("secret");
JWTVerifier verifier = JWT.require(algorithm)
.withIssuer("me@me.com")
.build();
DecodedJWT jwt = verifier.verify(token);
return true;
} catch (JWTVerificationException exception){
return false;
}
}
public static Map<String, Claim> getClaims(String token) {
try {
Algorithm algorithm = Algorithm.HMAC256("secret");
JWTVerifier verifier = JWT.require(algorithm)
.withIssuer("me@me.com")
.build(); //Reusable verifier instance
DecodedJWT jwt = verifier.verify(token);
return jwt.getClaims();
} catch (JWTVerificationException exception){
return null;
}
}
public static String getScopes(String token) {
try {
Algorithm algorithm = Algorithm.HMAC256("secret");
JWTVerifier verifier = JWT.require(algorithm)
.withIssuer("me@me.com")
.build(); //Reusable verifier instance
DecodedJWT jwt = verifier.verify(token);
return jwt.getClaim("scopes").asString();
} catch (JWTVerificationException exception){
return null;
}
}
}
| [
"dbohuslov@comcast.net"
] | dbohuslov@comcast.net |
d1488c665160496817ca85ca9ec710ad1067bf96 | 9fef7df3c3600f596929f2ed8e35cf34dd447cf2 | /src/java/com/wordpress/ricardoanalistadesistemas/sorveteria/controller/SorveteControllerMB.java | 8e15b94c2320e9b2d503c0252160075a82300cc7 | [] | no_license | ricardoaraujob32/Sorveteria | df8a1ea228aff53d070064163e699b4010a956c4 | 0156b30ee7774769fd0c92dbf1eb20c4c8387b4c | refs/heads/master | 2020-04-13T12:44:08.740013 | 2019-02-11T01:06:40 | 2019-02-11T01:06:40 | 163,210,804 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,942 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.wordpress.ricardoanalistadesistemas.sorveteria.controller;
import com.wordpress.ricardoanalistadesistemas.sorveteria.dao.GenericDAOException;
import com.wordpress.ricardoanalistadesistemas.sorveteria.dao.SorveteDAO;
import com.wordpress.ricardoanalistadesistemas.sorveteria.dao.SorveteDAOImpl;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;
import com.wordpress.ricardoanalistadesistemas.sorveteria.model.Sorvete;
/**
*
* @author ricardobalduino
*/
@Named(value = "sorveteControllerMB")
@SessionScoped
@ManagedBean
public class SorveteControllerMB implements Serializable {
private SorveteDAO dao;
private Sorvete sorveteAtual;
private List<Sorvete> listaSorvetes;
/**
* Creates a new instance of SorveteControllerMB
*/
public SorveteControllerMB() {
sorveteAtual = new Sorvete();
listaSorvetes = new ArrayList<>();
try {
dao = new SorveteDAOImpl();
} catch (GenericDAOException ex) {
Logger.getLogger( SorveteControllerMB.class.getName() ).log(Level.SEVERE, null, ex);
}
}
/**
* @return the sorveteAtual
*/
public Sorvete getSorveteAtual() {
return sorveteAtual;
}
/**
* @param sorveteAtual the sorveteAtual to set
*/
public void setSorveteAtual(Sorvete sorveteAtual) {
this.sorveteAtual = sorveteAtual;
}
/**
* @return the listaSorvetes
*/
public List<Sorvete> getListaSorvetes() {
return listaSorvetes;
}
/**
* @param listaSorvetes the listaSorvetes to set
*/
public void setListaSorvetes(List<Sorvete> listaSorvetes) {
this.listaSorvetes = listaSorvetes;
}
public void adicionar(Sorvete s){
FacesMessage msg = new FacesMessage( FacesMessage.SEVERITY_INFO, "Sorvete foi adicionado com sucesso", "");
try {
dao.adicionar(s);
} catch (GenericDAOException ex) {
Logger.getLogger(SorveteControllerMB.class.getName()).log(Level.SEVERE, null, ex);
msg.setSummary("Erro ao acessar este sorvete");
} finally {
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}
public void salvar(long id, Sorvete s){
FacesMessage msg = new FacesMessage( FacesMessage.SEVERITY_INFO, "Sorvete foi adicionado com sucesso", "");
try {
dao.salvar(id, s);
} catch (GenericDAOException ex) {
Logger.getLogger(SorveteControllerMB.class.getName()).log(Level.SEVERE, null, ex);
msg.setSummary("Erro ao acessar este sorvete");
} finally {
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}
public void remover(long id){
FacesMessage msg = new FacesMessage( FacesMessage.SEVERITY_INFO, "Sorvete foi adicionado com sucesso", "");
try {
dao.remover(id);
} catch (GenericDAOException ex) {
Logger.getLogger(SorveteControllerMB.class.getName()).log(Level.SEVERE, null, ex);
msg.setSummary("Erro ao acessar este sorvete");
} finally {
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}
public List<Sorvete> pesquisarPorSabor(String sabor){
List<Sorvete> lista = new ArrayList<>();
FacesMessage msg = new FacesMessage( FacesMessage.SEVERITY_INFO, "Sorvete foi adicionado com sucesso", "");
try {
lista = dao.pesquisarPorSabor(sabor);
} catch (GenericDAOException ex) {
Logger.getLogger(SorveteControllerMB.class.getName()).log(Level.SEVERE, null, ex);
msg.setSummary("Erro ao acessar este sorvete");
} finally {
FacesContext.getCurrentInstance().addMessage(null, msg);
return lista;
}
}
public Sorvete pesquisarPorId(long id){
Sorvete s = new Sorvete();
FacesMessage msg = new FacesMessage( FacesMessage.SEVERITY_INFO, "Sorvete foi adicionado com sucesso", "");
try {
s = dao.pesquisarPorId(id);
} catch (GenericDAOException ex) {
Logger.getLogger(SorveteControllerMB.class.getName()).log(Level.SEVERE, null, ex);
} finally {
FacesContext.getCurrentInstance().addMessage(null, msg);
return s;
}
}
}
| [
"ricardoaraujob32@gmail.com"
] | ricardoaraujob32@gmail.com |
affaea3051c617f3c763cfc937a23fadbc56d3cc | be30d124733f354d8929f20150898227950a2911 | /oop1Pjt/src/whatMethod/ObjectClass.java | 66a909b3e34e8ce11c1786e14c8849fe78989d62 | [] | no_license | zehye/studyJava | 399db168cbc7064a26054c0321d6942cd4df71f3 | 4c5c0ae675d8841ef4ac38af6d20284437e910da | refs/heads/master | 2020-07-06T00:55:21.186347 | 2019-08-27T10:13:25 | 2019-08-27T10:13:25 | 202,837,915 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 123 | java | package whatMethod;
public class ObjectClass {
public void getInfo() {
System.out.println(" -- getInfo() -- ");
}
}
| [
"zehye.01@gmail.com"
] | zehye.01@gmail.com |
d4a577f805e410207e69d03a7907f88ccc3e50aa | 69ae7a2942faa1963f9ab68485524cf4fd4141d1 | /PracaInzynierska/app/src/main/java/lewczyk/pracainzynierska/CoachExercise/CoachExerciseList/CoachExerciseListActivity.java | dba9fe3f880edbb5af13289ec36fb7b0d16623e7 | [] | no_license | MarcinLewczyk/PracaInzynierska | 76697858a8dfbcdcbd5377575f6d364d8a67c702 | 61e7c581a0b0656dd21b99c021297feb62d69706 | refs/heads/master | 2020-12-02T18:03:03.607890 | 2017-12-17T16:04:08 | 2017-12-17T16:04:08 | 96,464,959 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,862 | java | package lewczyk.pracainzynierska.CoachExercise.CoachExerciseList;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Spinner;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.OnItemSelected;
import lewczyk.pracainzynierska.Adapters.CoachExerciseAdapter;
import lewczyk.pracainzynierska.CoachExercise.CoachNewExercise.CoachNewExerciseActivity;
import lewczyk.pracainzynierska.Data.DefaultId;
import lewczyk.pracainzynierska.R;
public class CoachExerciseListActivity extends AppCompatActivity implements CoachExerciseListView{
@BindView(R.id.coachExerciseDifficultLevelSpinner) Spinner difficultSpinner;
@BindView(R.id.coachExerciseEquipmentRequirementSpinner) Spinner equipmentSpinner;
@BindView(R.id.coachExerciseTypeSpinner) Spinner typeSpinner;
@BindView(R.id.coachExerciseListView) ListView exercisesList;
private int DEFAULT_ID = DefaultId.DEFAULT_ID.defaultNumber;
private String selectedDifficult, selectedEquipment, selectedType;
private CoachExerciseListPresenter presenter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
presenter = new CoachExerciseListPresenter(this);
setContentView(R.layout.activity_coach_exercise_list);
ButterKnife.bind(this);
setViewSettings();
}
private void setViewSettings() {
setTitle(getString(R.string.exercises_list));
setSpinnersContent();
}
private void setSpinnersContent() {
String nothing = getString(R.string.no_filter);
List<String> difficultCategories = presenter.getAllDifficultLevelNames();
List<String> equipmentCategories = presenter.getAllEquipmentRequirementsNames();
List<String> typeCategories = presenter.getAllExerciseTypesNames();
difficultCategories.add(nothing);
equipmentCategories.add(nothing);
typeCategories.add(nothing);
ArrayAdapter<String> difficultAdapter = new ArrayAdapter<>(this, R.layout.spinner_layout, difficultCategories);
ArrayAdapter<String> equipmentAdapter = new ArrayAdapter<>(this, R.layout.spinner_layout, equipmentCategories);
ArrayAdapter<String> typeAdapter = new ArrayAdapter<>(this, R.layout.spinner_layout, typeCategories);
difficultAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
equipmentAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
typeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
difficultSpinner.setAdapter(difficultAdapter);
equipmentSpinner.setAdapter(equipmentAdapter);
typeSpinner.setAdapter(typeAdapter);
// Setting "no filter" on spinners
difficultSpinner.setSelection(difficultCategories.size() - 1);
equipmentSpinner.setSelection(equipmentCategories.size() - 1);
typeSpinner.setSelection(typeCategories.size() - 1);
}
@OnClick(R.id.coachExerciseAddButton)
public void addButtonPressed(){
Intent intent = new Intent(this, CoachNewExerciseActivity.class);
intent.putExtra("exerciseId", DEFAULT_ID);
startActivity(intent);
finish();
}
@OnClick(R.id.coachExerciseListSearchButton)
public void searchButtonPressed(){
setListViewContent(presenter.getFilteredExerciseList());
}
private void setListViewContent(ArrayList content) {
CoachExerciseAdapter adapter = new CoachExerciseAdapter(content, this);
exercisesList.setAdapter(adapter);
}
@OnItemSelected(R.id.coachExerciseDifficultLevelSpinner)
public void difficultSpinnerSelected(int position){
selectedDifficult = (String) difficultSpinner.getItemAtPosition(position);
}
@Override
public String getSelectedDifficult(){
return selectedDifficult;
}
@OnItemSelected(R.id.coachExerciseEquipmentRequirementSpinner)
public void equipmentSpinnerSelected(int position){
selectedEquipment = (String) equipmentSpinner.getItemAtPosition(position);
}
@Override
public String getSelectedEquipmentRequirements(){
return selectedEquipment;
}
@OnItemSelected(R.id.coachExerciseTypeSpinner)
public void typeSpinnerSelected(int position){
selectedType = (String) typeSpinner.getItemAtPosition(position);
}
@Override
public String getSelectedExerciseType(){
return selectedType;
}
@Override
public Context getContext(){
return this;
}
} | [
"lewczyk.marcin@gmail.com"
] | lewczyk.marcin@gmail.com |
6cc975c69a74e9b2199a676c04bad53c176b33c8 | 8137aacb145ceca06a77ce152a17f145305b2cab | /app/src/main/java/com/design/design/design/FacebookActivity.java | 19198f1245daae4c3a63fc8161b3f9326172c2f3 | [] | no_license | kleviscipi/design | 8dd6a227603e7b82a885c4785a9e8ef18e85cfff | acc83c4d41c6051bd13a65ac5c8ccfd2e37c1502 | refs/heads/master | 2021-01-13T03:45:54.028023 | 2016-12-28T16:56:48 | 2016-12-28T16:56:48 | 77,212,419 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,604 | java | package com.design.design.design;
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEventsLogger;
import android.content.Intent;
import android.media.Image;
import android.net.Uri;
import android.renderscript.ScriptGroup;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import java.io.FileNotFoundException;
import java.io.InputStream;
public class FacebookActivity extends AppCompatActivity {
private ImageView img;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_facebook);
img = (ImageView) findViewById(R.id.imageView);
Button b1 = (Button) findViewById(R.id.buttonfb);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
Uri screenshotUri = Uri.parse("android.resource://com.design.design.design/*");
try {
InputStream stream = getContentResolver().openInputStream(screenshotUri);
}catch (FileNotFoundException e){
e.printStackTrace();
}
sharingIntent.setType("image/jpeg");
sharingIntent.putExtra(Intent.EXTRA_STREAM,screenshotUri);
startActivity(Intent.createChooser(sharingIntent,"SHare image using"));
}
});
}
}
| [
"cipiklevis@gmail.com"
] | cipiklevis@gmail.com |
a86c6e4adea9fe93aa8f04b33ca5c84fad1b864d | 623b8eb08aa8c4a7679cc20b0728844f801f9ce6 | /src/main/java/com/xiaoyi/bis/user/domain/Order.java | 9bb7a56246628e6dc6c9784dccc422574e95d6a2 | [] | no_license | LiuYPGitHub/xiaoyi2 | e8a9ef1b63161804e742d5ac08819cc2b97ed3f7 | f713cfe91d5b6bc8102876e644e503666f028a34 | refs/heads/master | 2022-07-10T08:26:01.686314 | 2019-12-12T02:48:34 | 2019-12-12T02:48:34 | 227,505,173 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,165 | java | package com.xiaoyi.bis.user.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
/**
* @Description:用户订单
* @Author:kk
* @Date:2019/10/28 10:35
*/
@Data
@ToString
@TableName("ty_orders")
public class Order implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "ID")
private int id;
private String orderName;
private String orderNum;
private String orderType;
private String orderChannel;
private String siteName;
private String orgCode;
private String channel;
private String channelName;
private String courseName;
private String classType;
private String userName;
private String userMobile;
private String payType;
private String payStatus;
private String cost;
private String primeCost;
private String refundName;
private String refundDate;
private Date orderFinishDate;
private Date orderExpireDate;
private Date createDate;
}
| [
"Philo@DESKTOP-OPRVRF1"
] | Philo@DESKTOP-OPRVRF1 |
50c7e829045d7bc2c568bd907d494f4acbb83cab | e3fd4a51e8400304b371eb20720ae20b6fef450f | /src/main/java/com/starfish/demo/controllers/DataAccessController.java | de3a7c2a23803cbf2f6b4a941a69fe480a3ac844 | [] | no_license | joshuamokut/WebPageParser | 6bbc791d8a4efdf24b576118a36e2132905877e8 | d82a697fff64de20c2dfe1765aee2ac984a69177 | refs/heads/master | 2022-09-05T07:43:23.168335 | 2020-03-19T06:59:58 | 2020-03-19T06:59:58 | 246,964,891 | 0 | 0 | null | 2022-09-01T23:21:29 | 2020-03-13T01:36:45 | Java | UTF-8 | Java | false | false | 928 | java | package com.starfish.demo.controllers;
import com.starfish.demo.DTO.WebPageSetDTO;
import com.starfish.demo.services.DataAccessService;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.Set;
@AllArgsConstructor
@RestController
@RequestMapping(value = "/backend")
public class DataAccessController {
DataAccessService dataAccessService;
@GetMapping("/find")
public WebPageSetDTO getExternalLinks(@RequestParam String weblink) {
return dataAccessService.findWebPageData(weblink);
}
@PostMapping("/add")
public ResponseEntity<String> addResult(@RequestBody Map<String, Set<String>> result) {
dataAccessService.saveNewWebPageData(result);
return new ResponseEntity<>("Results added", HttpStatus.CREATED);
}
}
| [
"joshuamokut@gmail.com"
] | joshuamokut@gmail.com |
1bec6ec33f459c7baf3ce78294c00c8b90143fd7 | 043a614cb910dad84f20d54d2a8bed0537f05692 | /abstractfactory/src/main/java/org/headfirst/patterns/ReggianoCheese.java | ab27856fd8097b00fa3d9b858aeb2679e49593f2 | [] | no_license | michaelzherdev/headfirst-patterns | 6b0eefe4d6e755da271bd9af578bab60a06b4a43 | 0cb2f20468fc46eb6020787a5cd182b69237bfba | refs/heads/master | 2021-08-08T13:33:00.545944 | 2017-11-10T12:04:15 | 2017-11-10T12:04:15 | 110,242,531 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java | package org.headfirst.patterns;
public class ReggianoCheese implements Cheese {
public String toString() {
return "Reggiano Cheese";
}
}
| [
"m.zherdev@bank-trc.ru"
] | m.zherdev@bank-trc.ru |
90099506391aa383a15c2d4f59c36557c7c99d18 | 117ddb52f98eb69d8e8c9fb383c185c052c4c198 | /app/src/androidTest/java/com/oanaunciuleanu/musicapp/ExampleInstrumentedTest.java | 5546eddf731c5e9df62bbdb1cd72124dc266a70c | [] | no_license | oanaunc/MusicApp | bc7a2847fd512888af06af101584da13eb6b196f | da021376ef2a5e7dc16bef734762cb7c4900f276 | refs/heads/master | 2021-04-26T22:20:23.973965 | 2018-03-06T12:21:18 | 2018-03-06T12:21:18 | 123,727,367 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 755 | java | package com.oanaunciuleanu.musicapp;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.oanaunciuleanu.musicapp", appContext.getPackageName());
}
}
| [
"34318423+oanaunc@users.noreply.github.com"
] | 34318423+oanaunc@users.noreply.github.com |
c45739af6a5a67065572958a6d2ff317e59c0972 | 52eefa7fcbbd953f1fa7e80ee81670065ab2074b | /app/src/main/java/com/zhketech/project/global/Constant.java | 944c8fbddd563f921673370a08d6929d25f509c5 | [] | no_license | wpfsean/SipClient | fa74428cd99d61bff8f2e43e4bba27dfd2e60cf8 | c94c580de3f7d4978561bc253bac95448d3f27e1 | refs/heads/master | 2020-03-17T02:55:54.253028 | 2018-05-16T08:14:29 | 2018-05-16T08:14:29 | 133,212,513 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package com.zhketech.project.global;
/**
* Created by Root on 2018/5/3.
*
* 定义全局变量
*
*/
public class Constant {
public Constant(){
throw new UnsupportedOperationException("not can constructed");
}
//server ip
public static final String IP_SERVER = "192.168.0.16";
//
}
| [
"wpfsean@126.com"
] | wpfsean@126.com |
a28dcd5076deda1da5cff9ce5b9ad1ace7268b75 | 0ee14fbc109f9c97fc30b03293b9d1959cfbf744 | /app/src/main/java/com/app/androidlivetv/IntroActivity.java | 9d6abcfcba93c7f3b06eecd2390968da7b390dcd | [] | no_license | hendyyou/AndroidLiveTV | e0c694e35b9192cc6d0aadd682d40f9b00bd9e22 | 02addc372ff4bd8c1f6b1b16e251cbe5f17b8777 | refs/heads/master | 2020-04-01T13:11:12.654287 | 2018-09-17T04:41:14 | 2018-09-17T04:41:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,937 | java | package com.app.androidlivetv;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.app.fragment.IntroFragment;
import com.app.util.IsRTL;
import com.facebook.ads.AbstractAdListener;
import com.facebook.ads.Ad;
import com.facebook.ads.AdError;
import com.facebook.ads.AdSettings;
import com.facebook.ads.InterstitialAd;
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
public class IntroActivity extends AppCompatActivity {
View circle1, circle2, circle3;
ViewPager pager;
PagerAdapter pagerAdapter;
Button btnNext, btnSkip;
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_intro);
IsRTL.ifSupported(IntroActivity.this);
circle1 = findViewById(R.id.circle1);
circle2 = findViewById(R.id.circle2);
circle3 = findViewById(R.id.circle3);
final InterstitialAd interstitialAd = new InterstitialAd(this, "193554061465594_193654451455555");
interstitialAd.setAdListener(new AbstractAdListener() {
@Override
public void onError(Ad ad, AdError adError) {
super.onError(ad, adError);
Toast.makeText(IntroActivity.this, adError.getErrorMessage(), Toast.LENGTH_SHORT).show();
}
@Override
public void onAdLoaded(Ad ad) {
super.onAdLoaded(ad);
interstitialAd.show();
}
});
AdSettings.addTestDevice("768ef5d6-74f7-4b77-8df1-09f0c16fb186");
interstitialAd.loadAd();
btnNext = findViewById(R.id.button_next);
btnSkip = findViewById(R.id.button_skip);
pager = findViewById(R.id.view_pager);
pagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
pager.setAdapter(pagerAdapter);
setIndicator(0);
pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
setIndicator(position);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
btnSkip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(IntroActivity.this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
}
});
btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(IntroActivity.this, SignInActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
}
});
}
private void setIndicator(int index) {
switch (index) {
case 0:
circle1.setBackgroundResource(R.drawable.circle_fill);
circle2.setBackgroundResource(R.drawable.circle);
circle3.setBackgroundResource(R.drawable.circle);
break;
case 1:
circle2.setBackgroundResource(R.drawable.circle_fill);
circle1.setBackgroundResource(R.drawable.circle);
circle3.setBackgroundResource(R.drawable.circle);
break;
case 2:
circle3.setBackgroundResource(R.drawable.circle_fill);
circle1.setBackgroundResource(R.drawable.circle);
circle2.setBackgroundResource(R.drawable.circle);
break;
}
}
private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
ScreenSlidePagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
IntroFragment tp;
tp = IntroFragment.newInstance(position);
return tp;
}
@Override
public int getCount() {
return 3;
}
}
}
| [
"mohammadfaizan980@gmail.com"
] | mohammadfaizan980@gmail.com |
56bf0430d58ff0a7e315bbb30816397a0a6872ea | 318948b712fcb8ea4e9859eea103b799a09e2165 | /src/ch/blutch/alloblutch/controllers/AdminGenreBean.java | d812729c98d508b9233bbc73f00d4543d28f7376 | [] | no_license | blutch89/2013-alloblutch | 33e762304581c33b715d30d1d20cac31666a6442 | f2bb64240267fbef018c0ad08ca0634a59e74ed4 | refs/heads/master | 2021-01-20T06:14:56.083317 | 2017-08-26T15:34:22 | 2017-08-26T15:34:22 | 101,493,512 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 3,755 | java | package ch.blutch.alloblutch.controllers;
import java.io.IOException;
import java.io.Serializable;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import ch.blutch.alloblutch.model.dao.GenreDAO;
import ch.blutch.alloblutch.model.entity.Genre;
import ch.blutch.alloblutch.model.entity.LinkType;
import ch.blutch.alloblutch.model.entity.Movie;
import ch.blutch.alloblutch.model.entity.MoviePersonLink;
import ch.blutch.alloblutch.model.entity.Person;
import ch.blutch.alloblutch.utils.Log4JUtils;
import ch.blutch.alloblutch.utils.ParamUtils;
import ch.blutch.alloblutch.utils.UploadUtils;
@ManagedBean
@RequestScoped
public class AdminGenreBean implements Serializable {
private GenreDAO genreDAO;
// Pour la partie ajout
private Genre genre = new Genre();
// Pour la partie list
private Genre selectedGenre;
// Pour la partie edit
private String genreIdParam;
@PostConstruct
private void postConstruct() {
Log4JUtils.getLogger().trace("Création du managed bean: AdminGenreBean");
genreDAO = new GenreDAO(Genre.class);
genreIdParam = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("editid");
// Si la page demandée est la page de modification de genre, charger le genre concerné
if (genreIdParam != null) {
genre = genreDAO.findById(Long.parseLong(genreIdParam));
}
}
@PreDestroy
public void preDestroy() {
Log4JUtils.getLogger().trace("Destruction du managed bean: AdminGenreBean");
}
public String addGenre() {
genreDAO.saveOrUpdate(genre);
Log4JUtils.getLogger().info("AdminGenreBean: genre ajouté");
genre = new Genre();
return null;
}
public List<Genre> getAllGenresByAlphabeticalOrder() {
return genreDAO.findAllByAlphabeticalOrder();
}
public void gotoEditGenrePage() {
try {
FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.getExternalContext().redirect(facesContext.getExternalContext().getRequestContextPath() + "/web-pages/admin-genres/admin-edit-genre.xhtml?editid=" + this.selectedGenre.getId());
} catch (IOException e) {
Log4JUtils.getLogger().warn("AdminGenreBean: impossible de rediriger l'utilisateur vers la page de modification de genre");
}
}
public void gotoAddGenrePage() {
try {
FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.getExternalContext().redirect(facesContext.getExternalContext().getRequestContextPath() + "/web-pages/admin-genres/admin-add-genre.xhtml");
} catch (IOException e) {
Log4JUtils.getLogger().warn("AdminGenreBean: impossible de rediriger l'utilisateur vers la page d'ajout de genre");
}
}
public String editGenre() {
genreDAO.saveOrUpdate(genre);
Log4JUtils.getLogger().info("AdminGenreBean: genre modifié");
genre = new Genre();
return "/web-pages/admin-genres/admin-list-genres.xhtml";
}
public String deleteGenre() {
genreDAO.delete(this.selectedGenre);
return null;
}
public Genre getGenre() {
return genre;
}
public void setGenre(Genre genre) {
this.genre = genre;
}
public Genre getSelectedGenre() {
return selectedGenre;
}
public void setSelectedGenre(Genre selectedGenre) {
this.selectedGenre = selectedGenre;
}
public String getGenreIdParam() {
return genreIdParam;
}
public void setGenreIdParam(String genreIdParam) {
this.genreIdParam = genreIdParam;
}
}
| [
"gigon.thomas.b@gmail.com"
] | gigon.thomas.b@gmail.com |
0a5dc077fe97fc3b33460b75cafe0d08be201904 | 848a5312b33f39a2d395d67818b3ef5bed239286 | /WebBootMVCEmployee/src/main/java/com/vwits/demo/WebBootMvcEmployeeApplication.java | 6d5f9f12fa116caf0efb83f5814051f95c9976b8 | [] | no_license | Priyanka-Patil20/Training | c1e178c51e8a825ce7b634cb6a9a9a6c55be1a4d | 48cda6452f26f4fcc969568d4d8bd946a426a1c5 | refs/heads/main | 2023-02-16T08:41:54.045150 | 2021-01-07T13:49:21 | 2021-01-07T13:49:21 | 327,266,216 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package com.vwits.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
@SpringBootApplication
public class WebBootMvcEmployeeApplication {
public static void main(String[] args) {
SpringApplication.run(WebBootMvcEmployeeApplication.class, args);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
ba56367793ade8c435c76a48f7b06cce7f4f4de8 | fb6915b71ea90af42da282aaee4a0e11e698c7b4 | /src/main/java/com/argsno/understaingjvm/ch2/RuntimeConstantPoolOOM.java | b23ceabe0c18ca7aae6031fe41c830333698c243 | [] | no_license | argsno/understanding-jvm | e75812eeb5dffb2fb3687fba88ef1f34441bb2c4 | 5e81675b771d93729a9d69c27d30691ed3a5defc | refs/heads/master | 2020-05-20T09:16:13.108507 | 2019-05-27T11:55:04 | 2019-05-27T11:55:04 | 185,496,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 595 | java | package com.argsno.understaingjvm.ch2;
import java.util.ArrayList;
import java.util.List;
/**
* VM Args:-XX:PermSize=10M -XX:MaxPermSize=10M
* Java 8 环境下已经失效了
* @author zzm
*/
public class RuntimeConstantPoolOOM {
public static void main(String[] args) {
// 使用List保持着常量池引用,避免Full GC回收常量池行为
List<String> list = new ArrayList<String>();
// 10MB的PermSize在integer范围内足够产生OOM了
int i = 0;
while (true) {
list.add(String.valueOf(i++).intern());
}
}
}
| [
"argsno@gmail.com"
] | argsno@gmail.com |
15e5db535d5098848b9f7b7cf9ae90f2bee80b26 | b6697b3f425abb4fa180be7802914bb7113a2b62 | /src/main/java/com/ptm/user/service/enitity/package-info.java | eba61c47d88757d2b8eddc8db5208f932e6619c3 | [] | no_license | diwakarzend/pay2user | 102ee8106a3dac4a40a6961e169fc2e74dcda1ae | fbc46463ee936e1037ea850addd9d748dcd96f8d | refs/heads/master | 2023-01-10T01:55:37.878786 | 2020-09-20T10:19:42 | 2020-09-20T10:19:42 | 296,899,897 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 69 | java | /**
* JPA domain objects.
*/
package com.ptm.user.service.enitity;
| [
"raghuvansi.raghuvansi@gmail.com"
] | raghuvansi.raghuvansi@gmail.com |
0ba05194af265f722d066118faea078cf7d2d429 | ed81484598b4fa864a979aa0c75af79afe179106 | /Assembler/src/operands/ByteHexadecimalOperand.java | fe59ab059adfd94a7d7736a6d5f45f3a2946c8c6 | [] | no_license | MarcMagdi/SIC-Assembler | 44fa2d1f5300c84c83d9310cc794c1795b43a921 | 3b2623ca6f0a4866cb5b0da3b3e167a1cae80095 | refs/heads/master | 2021-01-25T11:28:37.179660 | 2017-06-10T09:51:46 | 2017-06-10T09:51:46 | 93,929,417 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,489 | java | package operands;
import com.sun.media.sound.InvalidFormatException;
import parser.PatternUtilities;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Faculty of Engineering, Alexandria University
* Computer and Systems Engineering Department
* CS 372 : Systems and Components Programming
* Project Phase I : SIC Assembler
* Created by Bishoy N. Gendy (programajor) on Thursday 13/04/2017.
*/
public class ByteHexadecimalOperand implements Operand, RegexValidator {
private String hexadecimal;
public ByteHexadecimalOperand(String hexadecimal) {
this.hexadecimal = hexadecimal;
}
@Override
public String getInstructionCode(String operationCodeInHexadecimal) throws InvalidFormatException {
if(hexadecimal.length() <= 14) {
return hexadecimal.toUpperCase();
} else {
throw new InvalidFormatException("Maximum of 14 Hexadecimal digits");
}
}
@Override
public String getValue() {
return hexadecimal;
}
@Override
public boolean isValid(String operand, String operation) {
return operand.matches(PatternUtilities.BYTE_HEXADECIMAL_OPERAND);
}
@Override
public Operand getNewInstance(String operand) {
Pattern pattern = Pattern.compile(PatternUtilities.BYTE_HEXADECIMAL_OPERAND);
Matcher matcher = pattern.matcher(operand);
matcher.find();
return new ByteHexadecimalOperand(matcher.group(2));
}
}
| [
"Mavloper@gmail.com"
] | Mavloper@gmail.com |
6582242b05793ce9f09fa889311c3645c5cbc56b | 86e5e26e4d8e2da5fe86609eed185d52f4c658aa | /Project 4/src/GUI.java | 871f5700a4fd267aafaaac8a5591fbc2b70ad947 | [] | no_license | ben203/CMSC-242 | a9c5ca3794ed1736f2408b882117a2c08ca318a4 | fdf84f733e2ca568a64861abeb4ed62c307997ac | refs/heads/main | 2023-06-03T14:20:53.506730 | 2021-06-22T13:44:42 | 2021-06-22T13:44:42 | 379,280,203 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,966 | java | /**
*
* File: GUI.java
* Author: Bedemariam Degef
* Date: October 7, 2019
* Purpose:This class handles the database interactions
*
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
public class GUI extends JFrame implements ActionListener {
// A new frame for the GUI
private JFrame frame = new JFrame();
// Options for the dialog boxes
private JComboBox<String> choose = new JComboBox<>(options);
private static String[] options = { "Insert", "Delete", "Find", "Update" };
private static String[] grades = { "A", "B", "C", "D", "F" };
private static String[] credit = { "3", "6" };
// Labels on the GUI
private JLabel id = new JLabel("Id: ");
private JLabel name = new JLabel("Name: ");
private JLabel major = new JLabel("Major: ");
private JLabel selection = new JLabel("Choose Selection: ");
// Text fields for user input and button to process the request
private JTextField textFieldForId = new JTextField();
private JTextField textFieldForname = new JTextField();
private JTextField textFieldFormajor = new JTextField();
private JButton computeButton = new JButton("Process Request");
// A hashmap object to store the data
private HashMap<String, Student> database = new HashMap<>();
/**
* A constructor that creates the GUI
*
*/
public GUI() {
super("Project4");
frame.setSize(300, 200);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setLayout(new GridLayout(6, 2));
frame.add(id);
frame.add(textFieldForId);
frame.add(name);
frame.add(textFieldForname);
frame.add(major);
frame.add(textFieldFormajor);
frame.add(selection);
frame.add(choose);
computeButton.addActionListener(this);
frame.add(computeButton);
frame.setVisible(true);
}
/**
* A main method to execute the program
*
* @param args
*/
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
new GUI();
}
});
}
/**
* The action performed when the process request button is clicked
*
*/
public void actionPerformed(ActionEvent event) {
// Reads the text inputs
String id = textFieldForId.getText();
String name = textFieldForname.getText();
String major = textFieldFormajor.getText();
// A new student object is created
Student st = new Student(name, major);
// Selected command from the drop box
String selected = (String) choose.getSelectedItem();
// Performs selected tasks
switch (selected) {
case "Insert":
if (database.containsKey(id)) {
JOptionPane.showMessageDialog(null, "The student is already in the database");
} else {
database.put(id, st);
JOptionPane.showMessageDialog(null, "The student is added to the database");
}
break;
case "Delete":
if (database.containsKey(id)) {
database.remove(id);
JOptionPane.showMessageDialog(null, "The student is removed from the database");
} else {
JOptionPane.showMessageDialog(null, "The student is not in our database");
}
break;
case "Find":
if (database.containsKey(id)) {
st = database.get(id);
JOptionPane.showMessageDialog(null, st.toString());
} else {
JOptionPane.showMessageDialog(null, "The student is not in our database");
}
break;
case "Update":
if (database.containsKey(id)) {
String grade = (String) JOptionPane.showInputDialog(null, "Choose Grades: ", "",
JOptionPane.INFORMATION_MESSAGE, null, grades, "");
String creditHours = (String) JOptionPane.showInputDialog(null, "Choose Credit: ", "",
JOptionPane.INFORMATION_MESSAGE, null, credit, "");
st.courseCompleted(grade.charAt(0), Integer.parseInt(creditHours));
database.put(id, st);
} else {
JOptionPane.showMessageDialog(null, "The student is not in our database");
}
break;
}
}
} | [
"noreply@github.com"
] | noreply@github.com |
ed86e2ccbfdfe21c327d7a2018389a439933bdcc | 6d3843a3364928728ab0918460839aecd4fe210f | /fireplace-backend/src/main/java/fireplace/backend/infrastructuur/impl/MessageServiceService.java | d738036e6a8ec5c98667181f7a22cbe54ea15c70 | [] | no_license | TimmyGilissen/fireplace | 63bdfe4fdb2da564b7e1351a2e2c64c15f7f87d4 | 1a8f0c298d2f9e3620e138b946e89f5b1906c915 | refs/heads/master | 2016-08-12T11:07:03.559564 | 2015-12-28T20:56:22 | 2015-12-28T20:56:22 | 48,394,585 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 859 | java | package fireplace.backend.infrastructuur.impl;
import fireplace.backend.infrastructuur.MessageService;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.AmqpAdmin;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MessageServiceService implements MessageService {
@Autowired
private AmqpAdmin admin;
@Autowired
private AmqpTemplate template;
@Override
public void sendMessage(String message) {
try {
admin.declareQueue( new Queue("fireplace") );
// write message
template.convertAndSend( message );
} catch (AmqpException e) {
throw e;
}
}
}
| [
"timmy.gilissen@gmail.com"
] | timmy.gilissen@gmail.com |
e656ece6571ab56fa9ff806c82e345d8fe891035 | da33a16e291dfa7d150bf75552160a67a7a9508d | /at.poquito.assetmanager-impl/src/at/poquito/assetmanager/rest/AssetManagerExceptionMapper.java | 47ad851bf509387ddeb9a8231c025ec416117a53 | [
"MIT"
] | permissive | poquito/assetmanager | 98850f10c5979b6dc98834d9c4fa9d6781904a17 | 16f86d9ed21b7fb7d0ba37811862645eaa1b04e9 | refs/heads/master | 2021-11-23T03:56:42.869297 | 2021-10-31T22:11:05 | 2021-10-31T22:11:05 | 22,812,193 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | package at.poquito.assetmanager.rest;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import at.poquito.assetmanager.AssetManagerException;
@Provider
public class AssetManagerExceptionMapper implements ExceptionMapper<AssetManagerException> {
@Override
public Response toResponse(AssetManagerException exception) {
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(exception.getMessage()).build();
}
}
| [
"mrodler@users.noreply.github.com"
] | mrodler@users.noreply.github.com |
8b81d8a363eb7b0bf56fc524179c1a9a54733d1b | 5d37ea540af1f4dfaad7542cc70483cfb7232f66 | /app/src/main/java/com/example/tomz/electroniccity/page/bn_tab_home/account/address/DefaultAddressRequest.java | 5072a057c8ff5d4c7a91c9ae5e7ba88f01446b8d | [] | no_license | tommydoang/eci | 538b7d645617dd12d3f0937229fa11583cc5e33d | eb24130d993fe080530f9999ff2f25e70cf7fb15 | refs/heads/master | 2018-12-22T20:48:12.959582 | 2018-10-27T17:35:59 | 2018-10-27T17:35:59 | 149,403,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 783 | java | package com.example.tomz.electroniccity.page.bn_tab_home.account.address;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class DefaultAddressRequest {
public DefaultAddressRequest() { }
public static class req{
@Expose
@SerializedName("id_custommer")
private String userAddress;
@Expose
@SerializedName("isDefault")
private String isDefault;
public req(String userAddress, String isDefault) {
this.userAddress = userAddress;
this.isDefault = isDefault;
}
public String getUserAddress() {
return userAddress;
}
public String getIsDefault() {
return isDefault;
}
}
}
| [
"tommydoang47@gmail.com"
] | tommydoang47@gmail.com |
4fa4fc6c5cc58cea75043a76e54cce17e762267a | 3f16791cc87b9ed835e84beaff4e50ed78cec4d8 | /src/UberSimulation/User.java | b9be1896f30f0e056a5efd39f6a48433f1df0771 | [] | no_license | SACHSTech/ics4u-oop-assignment-jenniferluk | 399843b9eeded6b88d77aa4688bcd2af728cdf0e | 12bcb46f304b34df43dd63292dcd064cfac1136d | refs/heads/main | 2023-02-10T13:20:49.865424 | 2021-01-06T19:59:00 | 2021-01-06T19:59:00 | 321,712,211 | 0 | 0 | null | 2023-07-06T00:55:50 | 2020-12-15T15:39:55 | Java | UTF-8 | Java | false | false | 1,002 | java | package UberStimulation;
import java.util.*;
import UberSimulation.*;
public class User{
// instance variables
private String username;
private String userphoneNum;
private String useremail;
private String userpassword;
/**
* User constructor. Creates an instance of the object, user.
*
* @param username - a string that displays the name of the user
* @param userphoneNum - a string that displays the user's phone number
* @param useremail - a string that displays the user's email
* @param userpassword - a string that displays the user'string password
*/
public User(String username, String userphoneNum, String useremail, String userpassword) {
this.username = username;
this.userphoneNum = userphoneNum;
this.useremail = useremail;
this.userpassword = userpassword;
}
/**
* Gettor method that returns user's password.
*
* @return the user's password.
*/
public String getPassword(){
return userpassword;
}
} | [
"jennifer.luk21@ycdsbk12.ca"
] | jennifer.luk21@ycdsbk12.ca |
d0884546ac2fa5b2f748734b7cf5b0641b0143c6 | c761c916247b2a3788b16a9f899f67f7d50f2ef7 | /app/src/main/java/com/vivo/wechatcommentsdemo/utils/MD5Encode.java | d279fd56392b89aab28820ef0f29bbfab0ba0f95 | [] | no_license | XiaLeon/WeChatCommentsDemo | 17647561a179fbc588d519acaf127161b115dfde | fe3d9bd7119fd1a787d3385758b50c6057df2a61 | refs/heads/master | 2021-08-15T07:43:32.460887 | 2017-11-17T15:18:27 | 2017-11-17T15:18:27 | 111,116,133 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 972 | java | package com.vivo.wechatcommentsdemo.utils;
import android.text.TextUtils;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* Created by Administrator on 2017/11/13.
*/
public class MD5Encode {
public static String encode(String source) {
if (TextUtils.isEmpty(source)) {
return "";
}
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
byte[] bytes = md5.digest(source.getBytes());
String result = "";
for (byte b : bytes) {
String temp = Integer.toHexString(b & 0xff);
if (temp.length() == 1) {
temp = "0" + temp;
}
result += temp;
}
return result;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return "";
}
}
| [
"Administrator@tgdn-4390.(none)"
] | Administrator@tgdn-4390.(none) |
fec8940e58197d1ac7351a5296bc2a3cc44e8ff8 | e4147ea44305754730e3eb12d58f8f0a2a3c8829 | /src/test/java/com/hendersongroup/security/DomainUserDetailsServiceIntTest.java | 0e037bb8cad019c904c34faf7169fbb453152ab4 | [] | no_license | nimo1981/corecmjan | ac95da7248e0f8cb0059e68201b9fdad8f4e816b | 888ede5b60a19e07db7cc101a708803075ac5f52 | refs/heads/master | 2021-09-02T07:16:31.619656 | 2017-12-31T10:45:25 | 2017-12-31T10:45:25 | 115,857,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,649 | java | package com.hendersongroup.security;
import com.hendersongroup.CorecmjanApp;
import com.hendersongroup.domain.User;
import com.hendersongroup.repository.UserRepository;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.util.Locale;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Test class for DomainUserDetailsService.
*
* @see DomainUserDetailsService
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = CorecmjanApp.class)
@Transactional
public class DomainUserDetailsServiceIntTest {
private static final String USER_ONE_LOGIN = "test-user-one";
private static final String USER_ONE_EMAIL = "test-user-one@localhost";
private static final String USER_TWO_LOGIN = "test-user-two";
private static final String USER_TWO_EMAIL = "test-user-two@localhost";
private static final String USER_THREE_LOGIN = "test-user-three";
private static final String USER_THREE_EMAIL = "test-user-three@localhost";
@Autowired
private UserRepository userRepository;
@Autowired
private UserDetailsService domainUserDetailsService;
private User userOne;
private User userTwo;
private User userThree;
@Before
public void init() {
userOne = new User();
userOne.setLogin(USER_ONE_LOGIN);
userOne.setPassword(RandomStringUtils.random(60));
userOne.setActivated(true);
userOne.setEmail(USER_ONE_EMAIL);
userOne.setFirstName("userOne");
userOne.setLastName("doe");
userOne.setLangKey("en");
userRepository.save(userOne);
userTwo = new User();
userTwo.setLogin(USER_TWO_LOGIN);
userTwo.setPassword(RandomStringUtils.random(60));
userTwo.setActivated(true);
userTwo.setEmail(USER_TWO_EMAIL);
userTwo.setFirstName("userTwo");
userTwo.setLastName("doe");
userTwo.setLangKey("en");
userRepository.save(userTwo);
userThree = new User();
userThree.setLogin(USER_THREE_LOGIN);
userThree.setPassword(RandomStringUtils.random(60));
userThree.setActivated(false);
userThree.setEmail(USER_THREE_EMAIL);
userThree.setFirstName("userThree");
userThree.setLastName("doe");
userThree.setLangKey("en");
userRepository.save(userThree);
}
@Test
@Transactional
public void assertThatUserCanBeFoundByLogin() {
UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN);
assertThat(userDetails).isNotNull();
assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN);
}
@Test
@Transactional
public void assertThatUserCanBeFoundByLoginIgnoreCase() {
UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN.toUpperCase(Locale.ENGLISH));
assertThat(userDetails).isNotNull();
assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN);
}
@Test
@Transactional
public void assertThatUserCanBeFoundByEmail() {
UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL);
assertThat(userDetails).isNotNull();
assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN);
}
@Test
@Transactional
public void assertThatUserCanBeFoundByEmailIgnoreCase() {
UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL.toUpperCase(Locale.ENGLISH));
assertThat(userDetails).isNotNull();
assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN);
}
@Test
@Transactional
public void assertThatEmailIsPrioritizedOverLogin() {
UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_EMAIL.toUpperCase(Locale.ENGLISH));
assertThat(userDetails).isNotNull();
assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN);
}
@Test(expected = UserNotActivatedException.class)
@Transactional
public void assertThatUserNotActivatedExceptionIsThrownForNotActivatedUsers() {
domainUserDetailsService.loadUserByUsername(USER_THREE_LOGIN);
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
f7cf753403e42b0e352f178fcc46a5b538a031f7 | 118cbd2b842c47bd1fa990f9b11b48c07fb3e1a8 | /lab_5/src/Lab3/Participant.java | 7650a236de3122079e1ca5900623a7f6652c7d67 | [] | no_license | Kompot04/Lab_5 | 11a99146bc4c371b101596bfeca44b802eea8c28 | b583310739bfd0dd8572e97352fc675ea402efe4 | refs/heads/master | 2023-05-09T00:14:55.525128 | 2021-05-31T10:36:05 | 2021-05-31T10:36:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,339 | java | package Lab3;
import Lab5.DAO;
import java.time.LocalDate;
import java.util.*;
import java.util.function.Predicate;
public class Participant {
private int id;
String name;
String region;
Map<LocalDate, Integer> incomeReg= new HashMap<>();
Map<String, String> vote = new HashMap<>();
static Comparator<Participant> conditionByName= (w, e)->w.getName().compareTo(e.getName());
static Comparator<Participant> conditionByRegion= (w, e)->w.getRegion().compareTo(e.getRegion());
static Comparator<Participant> conditionByIncome= (w, e)->w.totalIncome()- (e.totalIncome());
public Participant(String name, String region) {
this.name = name;
this.region = region;
}
public String getName() {
return name;
}
public String getRegion() {
return region;
}
public void addIncome(LocalDate date, int income){
if(incomeReg.containsKey(date)){
int previousValue = incomeReg.get(date).intValue();
incomeReg.put(date, previousValue+income);
}
else {
incomeReg.put(date, income);
}
}
public int incomeReport(LocalDate date1, LocalDate date2){
int result=0;
for(LocalDate temp:incomeReg.keySet()){
if(temp.isAfter(date1)&& temp.isBefore(date2)){
int tempIncome = incomeReg.get(temp);
result+=tempIncome;
}
}
System.out.println(result);
return result;
}
public int totalIncome(){
int result=0;
for(LocalDate temp:incomeReg.keySet()){
int tempIncome = incomeReg.get(temp);
result+=tempIncome;
}
System.out.println("Загальний доход: " + result);
return result;
}
public void addVote(String who, String forWhom) {
if(vote.containsKey(who)){
System.out.println("This participant already voted!");
}
vote.put(who, forWhom);
}
public void setId(int id) {
if(id == -1){
this.id=id;
}else{
System.out.println("error");
}
}
public int getId() {
return id;
}
public void show(){
System.out.println("Name: "+this.name+ " Region: "+ this.region);
}
}
| [
"lenb9660@gmail.com"
] | lenb9660@gmail.com |
10756a2356a0a0a3699c4727d484a84d60be73b1 | a5f3c1dbd415c944ac78e681a4410cf1032d8e0c | /core/src/main/java/org/cru/contentscoring/core/provider/VanityPathUriProvider.java | b22009f13621812b67cea4ef621230c25725d862 | [] | no_license | CruGlobal/cru-aem-content-scoring | a309fae5397738cc29271f23b3e75ea67e179c46 | ec436fd28301ade5e87e67e8d9ef47eed52e3d32 | refs/heads/master | 2022-12-10T02:12:31.770260 | 2022-11-28T14:25:01 | 2022-11-28T14:25:01 | 126,240,587 | 0 | 1 | null | 2022-12-02T14:56:38 | 2018-03-21T21:06:05 | Java | UTF-8 | Java | false | false | 1,694 | java | package org.cru.contentscoring.core.provider;
import org.apache.http.client.utils.URIBuilder;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Objects;
public class VanityPathUriProvider {
private static final Logger LOG = LoggerFactory.getLogger(VanityPathUriProvider.class);
private final String environment;
public VanityPathUriProvider(final String environment) {
this.environment = environment;
}
public URI toURI(final String path, final ResourceResolver resourceResolver) {
UriProviderUtil util = UriProviderUtil.getInstance(environment);
Resource slingMap = util.determineSlingMap(path, resourceResolver);
if (slingMap != null) {
String protocol = Objects.requireNonNull(slingMap.getParent()).getName();
String domain = slingMap.getName();
String pathPartToRemove = Objects.requireNonNull(
slingMap.getValueMap().get("sling:internalRedirect", String.class));
String externalPath = path;
if (path.startsWith(pathPartToRemove)) {
externalPath = path.substring(pathPartToRemove.length());
}
try {
return new URIBuilder()
.setScheme(protocol)
.setHost(domain)
.setPath(externalPath)
.build();
} catch (URISyntaxException e) {
LOG.error("Bad URI", e);
}
}
return null;
}
}
| [
"william.randall@cru.org"
] | william.randall@cru.org |
26f46c7991d91054f69daf29915dae0f6d2042df | 46b79f2d6d03473f374c957bdbc85d32f8772dc0 | /10-01-cargo-booking-elk-solution/src/main/java/com/way2learnonline/booking/domain/model/valueobjects/Voyage.java | bfcc9bf9b7c7b78a4ed83872a824347231882ff7 | [] | no_license | anish8129/Notes2 | b9f452cd9f3393de3ccd932d3e6ea591776de2a5 | aa902ecc19e3df5f0ddd7928390e1029136f0c6d | refs/heads/master | 2022-12-28T17:21:39.910175 | 2020-10-01T17:55:43 | 2020-10-01T17:55:43 | 299,244,174 | 0 | 1 | null | 2020-10-01T17:55:44 | 2020-09-28T08:39:38 | Java | UTF-8 | Java | false | false | 530 | java | package com.way2learnonline.booking.domain.model.valueobjects;
import javax.persistence.Column;
import javax.persistence.Embeddable;
/**
* Class representing the Cargo Voyage
*/
@Embeddable
public class Voyage {
@Column(name = "voyage_number")
private String voyageNumber;
public Voyage(){}
public Voyage(String voyageId){
this.voyageNumber = voyageId;
}
public String getVoyageId(){return this.voyageNumber;}
public void setVoyageId(String voyageId){this.voyageNumber = voyageId;}
}
| [
"aniprasad@debug-33.engr.tivo.com"
] | aniprasad@debug-33.engr.tivo.com |
78026490cb50521379ae4da80c19965188d2c2b4 | 1db39421d10471380d7f6e9e57cc4229b2224709 | /src/com/flairwork/studyquran/pro/CompareActivity.java | ff7e0e4d60cc6c0178f7c74fe3e17f4523eff634 | [] | no_license | FlairWork/Quran360Android | 6c98145ec5c7230976df08f0a6796dd58e5d52e7 | 5d10e7d1e72045a0475dc5145ef910f660a72ff5 | refs/heads/master | 2020-06-05T00:06:43.891464 | 2013-07-20T02:26:28 | 2013-07-20T02:26:28 | 8,594,171 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 8,576 | java | /*
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flairwork.studyquran.pro;
import greendroid.app.GDListActivity;
import greendroid.widget.ActionBarItem;
import greendroid.widget.NormalActionBarItem;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import com.flairwork.studyquran.pro.widget.MenuDialog;
import com.flairwork.studyquran.pro.R;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.ClipboardManager;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ContextMenu.ContextMenuInfo;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;
import android.widget.AdapterView.AdapterContextMenuInfo;
public class CompareActivity extends GDListActivity {
private AlertDialog alert;
private static final int COPY_ID = Menu.FIRST;
private ClipboardManager clipboard;
private String chapterId;
private String verseId;
private EditText chapterNoField;
private EditText verseNoField;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
setContentView(R.layout.compare);
setTitle("Compare");
chapterNoField = (EditText) findViewById(R.id.EditCompareChapterNo);
verseNoField = (EditText) findViewById(R.id.EditCompareVerseNo);
chapterId = chapterNoField.getText().toString();
verseId = verseNoField.getText().toString();
//fillData();
//Get the listView ( from: ListActivity )
final ListView lv = getListView();
lv.setTextFilterEnabled(true);
registerForContextMenu(getListView());
getListView().setFastScrollEnabled(true);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Menu");
builder.setItems(MenuDialog.menu_items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
//Toast.makeText(getApplicationContext(), MenuDialog.menu_items[item], Toast.LENGTH_SHORT).show();
//route to proper activity
MenuDialog.RouteActivity(getApplicationContext(), item);
}
});
alert = builder.create();
addActionBarItem(getActionBar()
.newActionBarItem(NormalActionBarItem.class)
.setDrawable(R.drawable.menu)
.setContentDescription(R.string.menu), R.id.action_bar_menu);
}
public void CompareAction(View button) {
// Do click handling here
chapterId = chapterNoField.getText().toString();
verseId = verseNoField.getText().toString();
fillData();
}
private void fillData() {
if (chapterId != null && verseId != null) {
setTitle("Compare ("+chapterId+":"+verseId+")");
try {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
URL url = new URL("http://web.quran360.com/services/VerseCompare.php?langCode="+prefs.getString("DATABASE_LANG_CODE", Config.DATABASE_LANG_CODE)+"&sura="+chapterId+"&ayah="+verseId+"&format=xml");
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
// Create a new ContentHandler and apply it to the XML-Reader
VerseCompareXmlHandler myVerseCompareXmlHandler = new VerseCompareXmlHandler();
xr.setContentHandler(myVerseCompareXmlHandler);
xr.parse(new InputSource(url.openStream()));
VerseCompareParsedXmlDataSet verseParsedXmlDataSet = myVerseCompareXmlHandler.getParsedData();
//System.out.println("XML "+verseParsedXmlDataSet.toString());
//Needed for the listItems
ArrayList<HashMap<String, String>> verseComparelist = new ArrayList<HashMap<String, String>>();
for(int i=0; i < verseParsedXmlDataSet.suraIDs.size(); i++){
//System.out.println("ID: "+verseParsedXmlDataSet.IDs.get(i));
//System.out.println("TranslationName: "+verseParsedXmlDataSet.translationNames.get(i));
//System.out.println("SuraID: "+verseParsedXmlDataSet.chapterIds.get(i));
//System.out.println("VerseID: "+verseParsedXmlDataSet.verseIds.get(i));
//System.out.println("AyahText: "+verseParsedXmlDataSet.ayahTexts.get(i));
HashMap<String, String> map = new HashMap<String, String>();
map.put("TranslationName", verseParsedXmlDataSet.translationNames.get(i));
//map.put("VerseID", verseParsedXmlDataSet.verseIds.get(i));
map.put("AyahText", verseParsedXmlDataSet.ayahTexts.get(i));
verseComparelist.add(map);
}
//Make a new listadapter
ListAdapter adapter = new SimpleAdapter(this, verseComparelist , R.layout.read_verse_compare_list,
new String[] { "TranslationName", "AyahText" },
new int[] { R.id.TranslationName, R.id.AyahText });
setListAdapter(adapter);
} catch (Exception e) {
e.printStackTrace();
System.out.println("XML Error "+e.getCause());
Toast.makeText(getApplicationContext(), "Internet connection required.", Toast.LENGTH_SHORT).show();
}
}
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
//Toast.makeText(getApplicationContext(), id+"", Toast.LENGTH_SHORT).show();
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.add(0, COPY_ID, 0, R.string.menu_copy);
//menu.add(0, COMPARE_ID, 1, R.string.menu_compare);
}
@SuppressWarnings("unchecked")
@Override
public boolean onContextItemSelected(MenuItem item) {
switch(item.getItemId()) {
case COPY_ID:
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
HashMap<String, String> map = (HashMap<String, String>) getListView().getItemAtPosition(info.position);
String translationName = map.get("TranslationName");
String verseText = map.get("AyahText");
clipboard.setText("'"+verseText+"' Al-Quran ("+chapterId+":"+verseId+") Translation: "+translationName+"");
return true;
}
return super.onContextItemSelected(item);
}
@Override
public boolean onHandleActionBarItemClick(ActionBarItem item, int position) {
switch (item.getItemId()) {
case R.id.action_bar_menu:
alert.show();
return true;
default:
return super.onHandleActionBarItemClick(item, position);
}
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
}
}
| [
"hanifw@yahoo.com"
] | hanifw@yahoo.com |
088066ee155a39ec45b557de42e8947d188a51fd | ea20d5c31d48f78c040a5d9f45d681694b413e9c | /src/main/java/com/wipro/datedemo/ServletInitializer.java | e02385e568f4220b457661b997ce55bd9251e770 | [] | no_license | sunilmehtav/dayDifference | 74a72080619d7946926c691a714e0cc69c8e630c | 9f885b5e97fde4c3ca08fbfa7cd1a0cf69137c03 | refs/heads/master | 2020-06-26T13:56:52.959778 | 2019-07-30T08:17:00 | 2019-07-30T08:17:00 | 199,651,084 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package com.wipro.datedemo;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(DatedemoApplication.class);
}
}
| [
"sunilmehtav@gmail.com"
] | sunilmehtav@gmail.com |
e742556bcd31a9ae6e43c1fc2f27fb02cbc84463 | da382e719818a7f8d7f98a31b58bfecc94173604 | /app/src/main/java/com/example/administrator/batheasy/ConsumeAdapter.java | 766955e2bffd0adb190aa6f47a97b3a531d159b7 | [] | no_license | LiangGaoUser/BathEasy | 9ab316e3ec4e78814f0b9d86dd8524e670064c00 | 0aa209ccfb3e91f882ea29c46e028a33998fbb00 | refs/heads/master | 2020-05-01T13:24:00.339789 | 2019-03-25T01:28:30 | 2019-03-25T01:28:30 | 177,490,476 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,444 | java | package com.example.administrator.batheasy;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.util.List;
public class ConsumeAdapter extends ArrayAdapter {
private int resouceId;
public ConsumeAdapter(@NonNull Context context, int resource, @NonNull List<Consume> objects) {
super(context, resource, objects);
resouceId=resource;
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
Consume consume= (Consume) getItem(position);
View view= LayoutInflater.from(getContext()).inflate(resouceId,null);
TextView consume_place=(TextView)view.findViewById(R.id.consume_place);
TextView consume_money=(TextView)view.findViewById(R.id.consume_money);
TextView consume_time=(TextView)view.findViewById(R.id.consume_time);
TextView consume_result=(TextView)view.findViewById(R.id.consume_result);
consume_place.setText(consume.getConsume_place());
consume_money.setText(consume.getConsume_money());
consume_time.setText(consume.getConsume_time());
consume_result.setText(consume.getConsume_result());
return view;
}
}
| [
"1920746538@qq.com"
] | 1920746538@qq.com |
0de546e4bf1965d04e655b556267a24e8e22327f | 5adc7bd35964c3dd929b9f87ff16fad5e97d2243 | /src/org/zqt/ui/holder/MoreHolder.java | b6acdabf4a2b5988f5ffe783870922967a3d2a32 | [] | no_license | QQiTong/qtmarket | 7090780e5627710aec840bda3ce84e0c10afbfd9 | 8bfec7dd36b02708eb3a1acd25051d553ee5b584 | refs/heads/master | 2022-12-25T17:49:29.544789 | 2022-12-14T14:23:23 | 2022-12-14T14:23:23 | 32,377,187 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,550 | java | package org.zqt.ui.holder;
import java.util.concurrent.atomic.AtomicBoolean;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
import org.zqt.R;
import org.zqt.manager.ThreadManager;
import org.zqt.ui.adapter.DefaultAdapter;
import org.zqt.utils.UIUtils;
public class MoreHolder extends BaseHolder<Integer> implements OnClickListener {
public static final int HAS_MORE = 0;
public static final int NO_MORE = 1;
public static final int ERROR = 2;
private RelativeLayout mLoading, mError;
private DefaultAdapter mAdapter;
public MoreHolder(DefaultAdapter adapter, boolean hasMore) {
setData(hasMore ? HAS_MORE : NO_MORE);
mAdapter = adapter;
}
@Override
protected View initView() {
View view = UIUtils.inflate(R.layout.list_more_loading);
mLoading = (RelativeLayout) view.findViewById(R.id.rl_more_loading);
mError = (RelativeLayout) view.findViewById(R.id.rl_more_error);
mError.setOnClickListener(this);
return view;
}
@Override
public void refreshView() {
Integer data = getData();
mLoading.setVisibility(data == HAS_MORE ? View.VISIBLE : View.GONE);
mError.setVisibility(data == ERROR ? View.VISIBLE : View.GONE);
}
@Override
public View getRootView() {
if (getData() == HAS_MORE) {
loadMore();
}
return super.getRootView();
}
public MoreHolder setAdapter(DefaultAdapter adapter) {
mAdapter = adapter;
return this;
}
@Override
public void onClick(View v) {
loadMore();
}
public void loadMore() {
mAdapter.loadMore();
}
}
| [
"sfs"
] | sfs |
83cc87966e4a647eb0f7a74e85d825c67dfb5ab2 | 55fd6d231c66f420e4f8c0db135f37ce2e23a8f2 | /park-common/src/main/java/com/park/cloud/common/domain/vo/cms/RepPdaUserCountVO.java | 994253df55fa28b30e8d3ba996335ae807d0017e | [] | no_license | QianUser/park | 0cc1e3c78595eca5537bdef85e9e2fecad329173 | 726879bb498f24be7b3399449b27c4547002607c | refs/heads/master | 2023-02-02T19:28:02.689427 | 2020-11-27T11:15:11 | 2020-12-22T06:52:33 | 323,564,629 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 704 | java | package com.park.cloud.common.domain.vo.cms;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @ClassNameRepPdaUserCountVO
* @Description TODO
* @Author liangshuang
* @Date 2020/3/19 13:40
**/
@ApiModel
@Data
public class RepPdaUserCountVO {
@ApiModelProperty(value = "派单总数")
private Integer peccancyNum;
@ApiModelProperty(value = "派单总金额")
private Integer orderPrice;
@ApiModelProperty(value = "派单完成率")
private BigDecimal finishRatio;
@ApiModelProperty(value = "平均完成时间")
private Integer averageFinishTime;
}
| [
"1070599782@qq.com"
] | 1070599782@qq.com |
32aff24b7adc50e6d13d854eadabfd4ded8e970f | 700c678608767c8068971954309fc0985ad8d670 | /app/src/main/java/app/isfaaghyth/moviedb/data/helper/DatabaseHelper.java | e8833a9529a3f5088dbfeacce4f61b48865796b0 | [] | no_license | fentonmartin/dicoding-moviedb | 8f085dd9f146563b22ae0fdb65c3f3b2eb0c4093 | 76765f180090362a8bdd07700ed26d07fb8bb97a | refs/heads/master | 2020-07-16T10:21:45.822647 | 2019-09-13T13:13:16 | 2019-09-13T13:13:16 | 205,770,624 | 0 | 0 | null | 2019-09-02T03:31:46 | 2019-09-02T03:31:46 | null | UTF-8 | Java | false | false | 940 | java | package app.isfaaghyth.moviedb.data.helper;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import app.isfaaghyth.moviedb.data.local.DatabaseConstruct;
/**
* Created by isfaaghyth on 7/30/18.
* github: @isfaaghyth
*/
public class DatabaseHelper extends SQLiteOpenHelper {
public DatabaseHelper(Context context){
super(context, DatabaseConstruct.DB_NAME, null, DatabaseConstruct.DB_VERSION);
}
@Override public void onCreate(SQLiteDatabase db) {
db.execSQL(doCreateDatabase());
}
@Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL(dropDatabase());
onCreate(db);
}
private String doCreateDatabase() {
return DatabaseConstruct.createTable();
}
private String dropDatabase() {
return DatabaseConstruct.dropTable();
}
} | [
"isfaaghyth@users.noreply.github.com"
] | isfaaghyth@users.noreply.github.com |
600dc498d85be62d4af0518e16863a170d732250 | 290ff2fadc08e842b02a597d3d1f245a6222fa4c | /app/src/main/java/com/exercise/wunder/jeanpaul/wunder/repository/local/CarsLocalRepo.java | 4a78e064a8b46e6f8b239ba85082c9c48abcfb21 | [] | no_license | jeanpok8/Wunder_App | a6bcea5aa836dd15249648ed88c783555ee8dac5 | 165e76d6e8fb1b0c99443eb10f706761e5459c02 | refs/heads/master | 2020-03-30T01:23:25.821598 | 2018-09-27T11:08:34 | 2018-09-27T11:08:34 | 150,573,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | package com.exercise.wunder.jeanpaul.wunder.repository.local;
import com.exercise.wunder.jeanpaul.wunder.model.CarInfo;
import com.exercise.wunder.jeanpaul.wunder.model.LocationsInfo;
import java.util.List;
import io.reactivex.Observable;
/**
* Created by jean paul on 9/20/18.
*/
public interface CarsLocalRepo {
Observable<List<CarInfo>> getAllCars();
void addCars(List<CarInfo> cars);
}
| [
"jeanpok8@gmail.com"
] | jeanpok8@gmail.com |
025afd5608515c2f7e12f9a071b731360eb4e8fd | cd91fabfd5ead18f033b797355554f50be9794eb | /src/test/java/com/emt/lab/EmtLabApplicationTests.java | df45da5127591a28529cadb49fc5e5f120cd97bd | [] | no_license | EdvinLekovic/emt-lab | 3166e3d67fcfc4d5f116c89fdeb5ac3096fd6886 | 11bfcd94f9057089c192c9ffaca417ef57281c0b | refs/heads/master | 2023-03-28T01:56:09.081428 | 2021-03-28T17:00:57 | 2021-03-28T17:00:57 | 352,212,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 212 | java | package com.emt.lab;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class EmtLabApplicationTests {
@Test
void contextLoads() {
}
}
| [
"edvinleko12@gmail.com"
] | edvinleko12@gmail.com |
70f071b8b5a3b3849a30c1e3e0369cfc763d2df9 | cb2f8219a7e9173b7d6f0a555ab1e7c43d777f23 | /bataille_navale/src/main/java/fr/ensma/ia/bataille_navale/noyau/actions/attaques/Explosion.java | 745c16fc9bc450d77d716291e1615e51312eea7d | [] | no_license | Kehny91/BatailleNavaleCode | 150c096750ff161654877819e8834e0522f48d27 | 775c9a85fce9d650d3446c11aadf2cc62ef44306 | refs/heads/master | 2020-12-18T09:48:23.971582 | 2020-04-01T14:17:24 | 2020-04-01T14:17:24 | 235,336,111 | 0 | 0 | null | 2020-10-13T19:00:05 | 2020-01-21T12:21:07 | Java | UTF-8 | Java | false | false | 4,037 | java | package fr.ensma.ia.bataille_navale.noyau.actions.attaques;
import java.util.List;
import fr.ensma.ia.bataille_navale.ExceptionBadInput;
import fr.ensma.ia.bataille_navale.noyau.jeu.Case;
import fr.ensma.ia.bataille_navale.noyau.jeu.EDirection;
public class Explosion extends AttaqueAbs{
@Override
public Resultat doAction() {
Case hitHere = cible;
tirSimpleSurCase(hitHere, 3);
//Les 4 cote direct
for (EDirection dir : EDirection.values()) {
try {
hitHere = cible.voisin(dir);
tirSimpleSurCase(hitHere, 2);
} catch (ExceptionBadInput e) {}
}
//Les 4 angles
try {
hitHere = cible.voisin(EDirection.Nord).voisin(EDirection.Ouest);
tirSimpleSurCase(hitHere, 2);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Nord).voisin(EDirection.Est);
tirSimpleSurCase(hitHere, 2);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Sud).voisin(EDirection.Ouest);
tirSimpleSurCase(hitHere, 2);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Sud).voisin(EDirection.Est);
tirSimpleSurCase(hitHere, 2);
} catch (ExceptionBadInput e) {}
//Exterieur Nord
try {
hitHere = cible.voisin(EDirection.Nord).voisin(EDirection.Nord);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Nord).voisin(EDirection.Nord).voisin(EDirection.Est);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Nord).voisin(EDirection.Nord).voisin(EDirection.Est).voisin(EDirection.Est);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Nord).voisin(EDirection.Nord).voisin(EDirection.Ouest);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Nord).voisin(EDirection.Nord).voisin(EDirection.Ouest).voisin(EDirection.Ouest);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
//Exterieur Sud
try {
hitHere = cible.voisin(EDirection.Sud).voisin(EDirection.Sud);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Sud).voisin(EDirection.Sud).voisin(EDirection.Est);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Sud).voisin(EDirection.Sud).voisin(EDirection.Est).voisin(EDirection.Est);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Sud).voisin(EDirection.Sud).voisin(EDirection.Ouest);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Sud).voisin(EDirection.Sud).voisin(EDirection.Ouest).voisin(EDirection.Ouest);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
//Exterieur Est
try {
hitHere = cible.voisin(EDirection.Est).voisin(EDirection.Est);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Est).voisin(EDirection.Est).voisin(EDirection.Nord);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Est).voisin(EDirection.Est).voisin(EDirection.Sud);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
//Exterieur Ouest
try {
hitHere = cible.voisin(EDirection.Ouest).voisin(EDirection.Ouest);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Ouest).voisin(EDirection.Ouest).voisin(EDirection.Nord);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
try {
hitHere = cible.voisin(EDirection.Ouest).voisin(EDirection.Ouest).voisin(EDirection.Sud);
tirSimpleSurCase(hitHere, 1);
} catch (ExceptionBadInput e) {}
return new Resultat();
}
}
| [
"lexou_k@hotmail.com"
] | lexou_k@hotmail.com |
fb8808e18e6b93b906c2f4d102be85dea8298824 | 716ad87d89b5d6187812d3ddf5f81a208c2c8f66 | /google-api-grpc/proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/ListAutoscalingPoliciesResponse.java | 2f5031e15b3d75e2bb7cbf6c8530f21e8f6bca85 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | polita/google-cloud-java | 7e1d2f6a4bd6fbdc6b9f3ccab72fe89fd530396c | 797f6e0278d5181b1999c6685d37d2716ac48625 | refs/heads/master | 2022-08-24T02:50:49.626734 | 2019-09-30T22:23:54 | 2019-09-30T22:23:54 | 211,908,657 | 0 | 1 | Apache-2.0 | 2022-07-06T20:18:12 | 2019-09-30T16:49:46 | Java | UTF-8 | Java | false | true | 36,326 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/dataproc/v1beta2/autoscaling_policies.proto
package com.google.cloud.dataproc.v1beta2;
/**
*
*
* <pre>
* A response to a request to list autoscaling policies in a project.
* </pre>
*
* Protobuf type {@code google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse}
*/
public final class ListAutoscalingPoliciesResponse extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse)
ListAutoscalingPoliciesResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use ListAutoscalingPoliciesResponse.newBuilder() to construct.
private ListAutoscalingPoliciesResponse(
com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private ListAutoscalingPoliciesResponse() {
policies_ = java.util.Collections.emptyList();
nextPageToken_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private ListAutoscalingPoliciesResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
policies_ =
new java.util.ArrayList<com.google.cloud.dataproc.v1beta2.AutoscalingPolicy>();
mutable_bitField0_ |= 0x00000001;
}
policies_.add(
input.readMessage(
com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.parser(),
extensionRegistry));
break;
}
case 18:
{
java.lang.String s = input.readStringRequireUtf8();
nextPageToken_ = s;
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
policies_ = java.util.Collections.unmodifiableList(policies_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dataproc.v1beta2.AutoscalingPoliciesProto
.internal_static_google_cloud_dataproc_v1beta2_ListAutoscalingPoliciesResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dataproc.v1beta2.AutoscalingPoliciesProto
.internal_static_google_cloud_dataproc_v1beta2_ListAutoscalingPoliciesResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse.class,
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse.Builder.class);
}
private int bitField0_;
public static final int POLICIES_FIELD_NUMBER = 1;
private java.util.List<com.google.cloud.dataproc.v1beta2.AutoscalingPolicy> policies_;
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public java.util.List<com.google.cloud.dataproc.v1beta2.AutoscalingPolicy> getPoliciesList() {
return policies_;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public java.util.List<? extends com.google.cloud.dataproc.v1beta2.AutoscalingPolicyOrBuilder>
getPoliciesOrBuilderList() {
return policies_;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public int getPoliciesCount() {
return policies_.size();
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public com.google.cloud.dataproc.v1beta2.AutoscalingPolicy getPolicies(int index) {
return policies_.get(index);
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public com.google.cloud.dataproc.v1beta2.AutoscalingPolicyOrBuilder getPoliciesOrBuilder(
int index) {
return policies_.get(index);
}
public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2;
private volatile java.lang.Object nextPageToken_;
/**
*
*
* <pre>
* Output only. This token is included in the response if there are more
* results to fetch.
* </pre>
*
* <code>string next_page_token = 2;</code>
*/
public java.lang.String getNextPageToken() {
java.lang.Object ref = nextPageToken_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
nextPageToken_ = s;
return s;
}
}
/**
*
*
* <pre>
* Output only. This token is included in the response if there are more
* results to fetch.
* </pre>
*
* <code>string next_page_token = 2;</code>
*/
public com.google.protobuf.ByteString getNextPageTokenBytes() {
java.lang.Object ref = nextPageToken_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
nextPageToken_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
for (int i = 0; i < policies_.size(); i++) {
output.writeMessage(1, policies_.get(i));
}
if (!getNextPageTokenBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < policies_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policies_.get(i));
}
if (!getNextPageTokenBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse)) {
return super.equals(obj);
}
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse other =
(com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse) obj;
if (!getPoliciesList().equals(other.getPoliciesList())) return false;
if (!getNextPageToken().equals(other.getNextPageToken())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getPoliciesCount() > 0) {
hash = (37 * hash) + POLICIES_FIELD_NUMBER;
hash = (53 * hash) + getPoliciesList().hashCode();
}
hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER;
hash = (53 * hash) + getNextPageToken().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse
parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
* <pre>
* A response to a request to list autoscaling policies in a project.
* </pre>
*
* Protobuf type {@code google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse)
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dataproc.v1beta2.AutoscalingPoliciesProto
.internal_static_google_cloud_dataproc_v1beta2_ListAutoscalingPoliciesResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dataproc.v1beta2.AutoscalingPoliciesProto
.internal_static_google_cloud_dataproc_v1beta2_ListAutoscalingPoliciesResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse.class,
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse.Builder.class);
}
// Construct using
// com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getPoliciesFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (policiesBuilder_ == null) {
policies_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
policiesBuilder_.clear();
}
nextPageToken_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.dataproc.v1beta2.AutoscalingPoliciesProto
.internal_static_google_cloud_dataproc_v1beta2_ListAutoscalingPoliciesResponse_descriptor;
}
@java.lang.Override
public com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse
getDefaultInstanceForType() {
return com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse build() {
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse buildPartial() {
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse result =
new com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (policiesBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
policies_ = java.util.Collections.unmodifiableList(policies_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.policies_ = policies_;
} else {
result.policies_ = policiesBuilder_.build();
}
result.nextPageToken_ = nextPageToken_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse) {
return mergeFrom((com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse other) {
if (other
== com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse.getDefaultInstance())
return this;
if (policiesBuilder_ == null) {
if (!other.policies_.isEmpty()) {
if (policies_.isEmpty()) {
policies_ = other.policies_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensurePoliciesIsMutable();
policies_.addAll(other.policies_);
}
onChanged();
}
} else {
if (!other.policies_.isEmpty()) {
if (policiesBuilder_.isEmpty()) {
policiesBuilder_.dispose();
policiesBuilder_ = null;
policies_ = other.policies_;
bitField0_ = (bitField0_ & ~0x00000001);
policiesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getPoliciesFieldBuilder()
: null;
} else {
policiesBuilder_.addAllMessages(other.policies_);
}
}
}
if (!other.getNextPageToken().isEmpty()) {
nextPageToken_ = other.nextPageToken_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage =
(com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse)
e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List<com.google.cloud.dataproc.v1beta2.AutoscalingPolicy> policies_ =
java.util.Collections.emptyList();
private void ensurePoliciesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
policies_ =
new java.util.ArrayList<com.google.cloud.dataproc.v1beta2.AutoscalingPolicy>(policies_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dataproc.v1beta2.AutoscalingPolicy,
com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.Builder,
com.google.cloud.dataproc.v1beta2.AutoscalingPolicyOrBuilder>
policiesBuilder_;
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public java.util.List<com.google.cloud.dataproc.v1beta2.AutoscalingPolicy> getPoliciesList() {
if (policiesBuilder_ == null) {
return java.util.Collections.unmodifiableList(policies_);
} else {
return policiesBuilder_.getMessageList();
}
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public int getPoliciesCount() {
if (policiesBuilder_ == null) {
return policies_.size();
} else {
return policiesBuilder_.getCount();
}
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public com.google.cloud.dataproc.v1beta2.AutoscalingPolicy getPolicies(int index) {
if (policiesBuilder_ == null) {
return policies_.get(index);
} else {
return policiesBuilder_.getMessage(index);
}
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public Builder setPolicies(
int index, com.google.cloud.dataproc.v1beta2.AutoscalingPolicy value) {
if (policiesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePoliciesIsMutable();
policies_.set(index, value);
onChanged();
} else {
policiesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public Builder setPolicies(
int index, com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.Builder builderForValue) {
if (policiesBuilder_ == null) {
ensurePoliciesIsMutable();
policies_.set(index, builderForValue.build());
onChanged();
} else {
policiesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public Builder addPolicies(com.google.cloud.dataproc.v1beta2.AutoscalingPolicy value) {
if (policiesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePoliciesIsMutable();
policies_.add(value);
onChanged();
} else {
policiesBuilder_.addMessage(value);
}
return this;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public Builder addPolicies(
int index, com.google.cloud.dataproc.v1beta2.AutoscalingPolicy value) {
if (policiesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePoliciesIsMutable();
policies_.add(index, value);
onChanged();
} else {
policiesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public Builder addPolicies(
com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.Builder builderForValue) {
if (policiesBuilder_ == null) {
ensurePoliciesIsMutable();
policies_.add(builderForValue.build());
onChanged();
} else {
policiesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public Builder addPolicies(
int index, com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.Builder builderForValue) {
if (policiesBuilder_ == null) {
ensurePoliciesIsMutable();
policies_.add(index, builderForValue.build());
onChanged();
} else {
policiesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public Builder addAllPolicies(
java.lang.Iterable<? extends com.google.cloud.dataproc.v1beta2.AutoscalingPolicy> values) {
if (policiesBuilder_ == null) {
ensurePoliciesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policies_);
onChanged();
} else {
policiesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public Builder clearPolicies() {
if (policiesBuilder_ == null) {
policies_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
policiesBuilder_.clear();
}
return this;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public Builder removePolicies(int index) {
if (policiesBuilder_ == null) {
ensurePoliciesIsMutable();
policies_.remove(index);
onChanged();
} else {
policiesBuilder_.remove(index);
}
return this;
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.Builder getPoliciesBuilder(
int index) {
return getPoliciesFieldBuilder().getBuilder(index);
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public com.google.cloud.dataproc.v1beta2.AutoscalingPolicyOrBuilder getPoliciesOrBuilder(
int index) {
if (policiesBuilder_ == null) {
return policies_.get(index);
} else {
return policiesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public java.util.List<? extends com.google.cloud.dataproc.v1beta2.AutoscalingPolicyOrBuilder>
getPoliciesOrBuilderList() {
if (policiesBuilder_ != null) {
return policiesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(policies_);
}
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.Builder addPoliciesBuilder() {
return getPoliciesFieldBuilder()
.addBuilder(com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.getDefaultInstance());
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.Builder addPoliciesBuilder(
int index) {
return getPoliciesFieldBuilder()
.addBuilder(
index, com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.getDefaultInstance());
}
/**
*
*
* <pre>
* Output only. Autoscaling policies list.
* </pre>
*
* <code>repeated .google.cloud.dataproc.v1beta2.AutoscalingPolicy policies = 1;</code>
*/
public java.util.List<com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.Builder>
getPoliciesBuilderList() {
return getPoliciesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dataproc.v1beta2.AutoscalingPolicy,
com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.Builder,
com.google.cloud.dataproc.v1beta2.AutoscalingPolicyOrBuilder>
getPoliciesFieldBuilder() {
if (policiesBuilder_ == null) {
policiesBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dataproc.v1beta2.AutoscalingPolicy,
com.google.cloud.dataproc.v1beta2.AutoscalingPolicy.Builder,
com.google.cloud.dataproc.v1beta2.AutoscalingPolicyOrBuilder>(
policies_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
policies_ = null;
}
return policiesBuilder_;
}
private java.lang.Object nextPageToken_ = "";
/**
*
*
* <pre>
* Output only. This token is included in the response if there are more
* results to fetch.
* </pre>
*
* <code>string next_page_token = 2;</code>
*/
public java.lang.String getNextPageToken() {
java.lang.Object ref = nextPageToken_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
nextPageToken_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* Output only. This token is included in the response if there are more
* results to fetch.
* </pre>
*
* <code>string next_page_token = 2;</code>
*/
public com.google.protobuf.ByteString getNextPageTokenBytes() {
java.lang.Object ref = nextPageToken_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
nextPageToken_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* Output only. This token is included in the response if there are more
* results to fetch.
* </pre>
*
* <code>string next_page_token = 2;</code>
*/
public Builder setNextPageToken(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
nextPageToken_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. This token is included in the response if there are more
* results to fetch.
* </pre>
*
* <code>string next_page_token = 2;</code>
*/
public Builder clearNextPageToken() {
nextPageToken_ = getDefaultInstance().getNextPageToken();
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. This token is included in the response if there are more
* results to fetch.
* </pre>
*
* <code>string next_page_token = 2;</code>
*/
public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
nextPageToken_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse)
}
// @@protoc_insertion_point(class_scope:google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse)
private static final com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse();
}
public static com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<ListAutoscalingPoliciesResponse> PARSER =
new com.google.protobuf.AbstractParser<ListAutoscalingPoliciesResponse>() {
@java.lang.Override
public ListAutoscalingPoliciesResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ListAutoscalingPoliciesResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<ListAutoscalingPoliciesResponse> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<ListAutoscalingPoliciesResponse> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.dataproc.v1beta2.ListAutoscalingPoliciesResponse
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| [
"sduskis@google.com"
] | sduskis@google.com |
950112da75137bd7a1c24cb2539dd91f02ee2aa8 | 6eddc5a7dfa8779ac1730c4dd6e1e08f6db95df4 | /app/press/io/OnDiskCompressedFile.java | e1665792e7f64a917125549245f90af7a92d1389 | [] | no_license | judu/press | 9a1735cae14bed7cc55c252d04b0ddb8a0d054fd | bff1eaedaed3d365ed89e23724fbee6a287f332a | refs/heads/master | 2021-01-17T21:37:22.739367 | 2011-05-05T17:54:08 | 2011-05-05T17:54:08 | 1,707,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,934 | java | package press.io;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileFilter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.Writer;
import play.exceptions.UnexpectedException;
import play.vfs.VirtualFile;
import press.PluginConfig;
import press.PressException;
import press.PressLogger;
public class OnDiskCompressedFile extends CompressedFile {
private Writer writer;
private VirtualFile file;
private File tmpOutputFile;
public OnDiskCompressedFile(String filePath) {
super(filePath);
file = FileIO.getVirtualFile(filePath);
}
@Override
public InputStream inputStream() {
if (!exists()) {
throw new PressException("Can't create InputStream. File does not exist");
}
return file.inputstream();
}
@Override
public String name() {
return file.getName();
}
@Override
public boolean exists() {
return file.exists();
}
@Override
public Writer startWrite() {
if (writer != null) {
return writer;
}
try {
//
// We create a temp file to which the output will be written to
// first, and then rename it to the target file name (because
// compression can take a while)
// If the temp file is already being written by another thread, this
// method will block until it is complete and then return null
//
tmpOutputFile = getTmpOutputFile(file);
if (tmpOutputFile == null) {
return null;
}
// Create the directory if it doesn't already exist
VirtualFile dir = VirtualFile.open(file.getRealFile().getParent());
if (!dir.exists()) {
if (!dir.getRealFile().mkdirs()) {
throw new PressException(
"Could not create directory for compressed file output "
+ file.getRealFile().getAbsolutePath());
}
}
// Return a writer for the temporary file
writer = new BufferedWriter(new FileWriter(tmpOutputFile));
return writer;
} catch (IOException e) {
throw new UnexpectedException(e);
}
}
@Override
public void close() {
if (writer == null) {
throw new UnexpectedException(
"Writer has not yet been created. Call getWriter() and write to it.");
}
// Output was written to a temporary file, so rename it to overwrite the
// true destination file.
String msg = "Output written to temporary file\n%s\n"
+ "Moving from tmp path to final path:\n%s";
String tmpPath = tmpOutputFile.getAbsolutePath();
String finalPath = file.getRealFile().getAbsolutePath();
PressLogger.trace(msg, tmpPath, finalPath);
if (!tmpOutputFile.renameTo(file.getRealFile())) {
String ex = "Successfully wrote compressed file to temporary path\n" + tmpPath;
ex += "\nBut could not move it to final path\n" + finalPath;
throw new PressException(ex);
}
try {
tmpOutputFile = null;
writer.flush();
writer.close();
} catch (IOException e) {
throw new UnexpectedException(e);
}
}
private static File getTmpOutputFile(VirtualFile file) {
String origPath = file.getRealFile().getAbsolutePath();
File tmp = new File(origPath + ".tmp");
// If the temp file already exists
if (tmp.exists()) {
long tmpLastModified = tmp.lastModified();
long now = System.currentTimeMillis();
// If the temp file is older than the destination file, or if it is
// older than the allowed compression time, it must be a remnant of
// a previous server crash so we can overwrite it
if (tmpLastModified < file.lastModified()) {
return tmp;
}
if (now - tmpLastModified > PluginConfig.maxCompressionTimeMillis) {
return tmp;
}
// Otherwise it must be currently being written by another thread,
// so wait for it to finish
while (tmp.exists()) {
if (System.currentTimeMillis() - now > PluginConfig.maxCompressionTimeMillis) {
throw new PressException("Timeout waiting for compressed file to be generated");
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
// Return null to indicate that the file was already generated by
// another thread
return null;
}
return tmp;
}
public static int clearFileCache(String compressedDir, String extension) {
PressLogger.trace("Deleting cached files");
// Get the cache directory
VirtualFile dir = FileIO.getVirtualFile(compressedDir);
if (!dir.exists() || !dir.isDirectory()) {
return 0;
}
// Get a list of all compressed files, and delete them
FileFilter compressedFileFilter = new PressFileFilter(extension);
File[] files = dir.getRealFile().listFiles(compressedFileFilter);
int deleted = 0;
for (File file : files) {
if (file.delete()) {
deleted++;
}
}
PressLogger.trace("Deleted %d cached files", deleted);
return deleted;
}
@Override
public long length() {
if (!exists()) {
throw new PressException("Can't get length. File does not exist");
}
return file.length();
}
}
| [
"dirk@mccormick.cx"
] | dirk@mccormick.cx |
870be71dfa0e063481d6fcdfb7dd726df809804c | 45139da1430384cde65230d6f08e5112c262155f | /Egg_Herencia_03/src/main/java/Herencia/ej4/CalculoFormas.java | 8b842291229c53a189949689ae59c8a600db3eca | [] | no_license | Stdela/Egg_Educacion_Java | 99baa49d0bab02e0dbabe3a43a00573354ab7db8 | 87c242fdfe1a0af5a6e90a817d6c65794eaf4456 | refs/heads/main | 2023-08-17T16:29:25.929337 | 2021-08-31T12:10:37 | 2021-08-31T12:10:37 | 401,379,439 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 882 | java |
package Herencia.ej4;
//Se plantea desarrollar un programa que nos permita calcular el área y el perímetro
//de formas geométricas, en este caso un circulo y un rectángulo. Ya que este
//calculo se va a repetir en las dos formas geométricas, vamos a crear una Interfaz,
//llamada calculosFormas que tendrá, los dos métodos para calcular el área, el
//perímetro y el valor de PI como constante.
//
//Desarrollar el ejercicio para que las formas implementen los métodos de la
//interfaz y se calcule el área y el perímetro de los dos. En el main se crearán las
//formas y se mostrará el resultado final.
//
//Área circulo: PI * radio ^ 2 / Perímetro circulo: PI * diámetro.
//Área rectángulo: base * altura / Perímetro rectángulo: (base + altura) * 2.
public interface CalculoFormas {
void calcularPerimetro();
void calcularArea();
}
| [
"noreply@github.com"
] | noreply@github.com |
8567fc90a83c59f3054959fd42a026c3cbfaf79d | 3df64274e3cf15f59f14dbd812ee33c225c10bd0 | /src/MineSweeping.java | 9a61d30de36e16a6b24a86771ff54971b68c8618 | [] | no_license | hao0612/hao | cbaa6d94b464d419f2d8118e6e8aa0d4edeeb397 | 2c1aeb3b4247cc15b86ce1ea1642c95b4b1a3ada | refs/heads/master | 2020-12-04T14:04:13.949140 | 2020-01-04T16:28:37 | 2020-01-04T16:28:37 | 220,362,583 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,352 | java | import java.util.Scanner;
/*import java.util.Scanner;*/
public class MineSweeping {
private static Mine mine = null;
private static int mineCount = 0;
private static int findMineCount = 0;
public static void main(String[] args) {
mine = new Mine();
Scanner sc = new Scanner(System.in);
System.out.println("欢迎进入扫雷游戏。请选择游戏难度:1:低级;2:中级;3:高级");
int selNum = sc.nextInt();
Mine arr[][] = null;
a: while (true) {
switch (selNum) {
case 1:
// 创建矩阵的二维数组
arr = new Mine[9][9];
// 设置地雷个数10
mineCount = 10;
// 随机生成10个雷并随机放在二维数组中
arr = addMine(arr);
// 地雷信息存放到数组中
arr = addMineInfo(arr);
// 绘制
draw(arr);
// 扫雷开始
boolean outFalg = inXY(arr, sc);
// 结束游戏
if (outFalg) {
break a;
} else {
// 重新开始
break;
}
case 2:
// 创建矩阵的二维数组
arr = new Mine[16][16];
// 设置地雷个数40
mineCount = 40;
// 随机生成40个雷并随机放在二维数组中
arr = addMine(arr);
// 地雷信息存放到数组中
arr = addMineInfo(arr);
draw(arr);
// 扫雷开始
outFalg = inXY(arr, sc);
// 结束游戏
if (outFalg) {
break a;
} else {
// 重新开始
break;
}
case 3:
// 创建矩阵的二维数组
arr = new Mine[16][30];
// 设置地雷个数99
mineCount = 99;
// 随机生成99个雷并随机放在二维数组中
arr = addMine(arr);
// 地雷信息存放到数组中
arr = addMineInfo(arr);
draw(arr);
// 扫雷开始
outFalg = inXY(arr, sc);
// 结束游戏
if (outFalg) {
break a;
} else {
// 重新开始
break;
}
}
}
}
/**
*
* @param mineCount
* @param nineArr矩阵的二维数组
* @return 放入地雷后的二维数组
*/
private static Mine[][] addMine(Mine[][] nineArr) {
for (int i = 0; i < nineArr.length; i++) {
for (int j = 0; j < nineArr[0].length; j++) {
nineArr[i][j] = new Mine(false, 0, 0);
}
}
for (int i = 0; i < mineCount;) {
int intRandom1 = (int) (nineArr.length * Math.random());
int intRandom2 = (int) (nineArr[0].length * Math.random());
// 判断当前位置是否是地雷
if (!nineArr[intRandom1][intRandom2].isMine()) {
nineArr[intRandom1][intRandom2].setMine(true);
i++;
}
}
return nineArr;
}
/**
*
* @param nineArr矩阵数组
* @return 地雷信息添加后的数组
*/
private static Mine[][] addMineInfo(Mine[][] nineArr) {
// 周围地雷个数
for (int i = 0; i < nineArr.length; i++) {
for (int j = 0; j < nineArr[0].length; j++) {
int count = 0;
// 判断左上位置是否为地雷
if (i > 0 && j > 0) {
if (nineArr[i - 1][j - 1].isMine()) {
count++;
}
}
// 判断正上位置是否为地雷
if (i > 0) {
if (nineArr[i - 1][j].isMine()) {
count++;
}
}
// 判断右上位置是否为地雷
if (i > 0 && j < nineArr.length - 1) {
if (nineArr[i - 1][j + 1].isMine()) {
count++;
}
}
// 判断左边位置是否为地雷
if (j > 0) {
if (nineArr[i][j - 1].isMine()) {
count++;
}
}
// 判断右边位置是否为地雷
if (j < nineArr[i].length - 1) {
if (nineArr[i][j + 1].isMine()) {
count++;
}
}
// 判断左下位置是否为地雷
if (i < nineArr.length - 1 && j > 0) {
if (nineArr[i + 1][j - 1].isMine()) {
count++;
}
}
// 判断正下位置是否为地雷
if (i < nineArr.length - 1) {
if (nineArr[i + 1][j].isMine()) {
count++;
}
}
// 判断右下位置是否为地雷
if (i < nineArr.length - 1 && j < nineArr[i].length - 1) {
if (nineArr[i + 1][j + 1].isMine()) {
count++;
}
}
nineArr[i][j].setOtherMineCount(count);
}
}
return nineArr;
}
/**
* 打印所有信息
*
* @param arr
* 地雷信息
*/
private static void draw(Mine[][] arr) {
System.out.print(" ");
// 打印横向的标尺
for (int i = 0; i < arr[0].length; i++) {
if (i < 9) {
System.out.print(" " + (i + 1) + " ");
} else {
System.out.print((i + 1) + " ");
}
}
System.out.println();
for (int i = 0; i < arr.length; i++) {
// 打印纵向坐标
if (i < 9) {
System.out.print(" " + (i + 1));
} else {
System.out.print(i + 1);
}
System.out.print("|");
for (int j = 0; j < arr[0].length; j++) {
if (arr[i][j].isShowFalg()&&(!arr[i][j].isMine())) {
System.out.print("-" + arr[i][j].getOtherMineCount() + "-");
} else if (arr[i][j].isMine() && arr[i][j].isShowFalg()) {
System.out.print("-" + "●" + "-");
} else {
System.out.print("-□-");
}
}
System.out.print("|");
System.out.println();
}
}
/**
*
* @param sc控制台输入流
* @param nineArr地雷信息
* @return true:退出游戏;false重新开始游戏、继续游戏
*/
private static boolean inXY(Mine[][] arr, Scanner sc) {
while (true) {
System.out.println("扫雷开始,若输入雷的坐标请输入M/m+横坐标+纵坐标,空格隔开;输入-1退出游戏");
System.out.println("若输入要点的坐标请输入P/p+横坐标+纵坐标,空格隔开;输入-1退出游戏");
String inSelect = sc.next();
int xVal = sc.nextInt() - 1;
// 横坐标非法检查
if (xVal < 0 || xVal >= arr.length) {
System.out.println("您输入的横坐标非法,请重新输入。");
continue;
}
if (xVal == -1) {
return true;
}
int yVal = sc.nextInt() - 1;
// 横坐标非法检查
if (yVal < 0 || yVal >= arr[0].length) {
System.out.println("您输入的纵坐标非法,请重新输入。");
continue;
}
if (yVal == -1) {
return true;
}
// 判断是否赢得游戏
if (inSelect.equalsIgnoreCase("M")) {
System.out.println(arr[xVal][yVal].toString());
if (checkWine(arr, xVal, yVal)) {
findMineCount++;
arr[xVal][yVal].setShowFalg(true);
System.out.println("输入正确,已找到地雷个数:" + findMineCount + "\t共有地雷:" + mineCount + "个。再接再厉。");
} else {
mine.setWinCount(mine.getWinCount() - 1);
System.out.println("输入错误,您已经输了!!!!重新开始游戏输入Y/y,退出游戏输入其他。");
if (sc.next().equalsIgnoreCase("")) {
return false;
} else {
return true;
}
}
} else if (inSelect.equalsIgnoreCase("P")) {
if (checkWine(arr, xVal, yVal)) {
mine.setWinCount(mine.getWinCount() - 1);
System.out.println("踩到地雷,您已经输了!!!!重新开始游戏输入Y/y,退出游戏输入其他。");
if (sc.next().equalsIgnoreCase("")) {
return false;
} else {
return true;
}
}
// 判定输入信息,返回
arr = check(arr, xVal, yVal);
}
if (checkWin()) {
System.out.println("您已经赢得游戏,已找到地雷个数:" + findMineCount + "\t共有地雷:" + mineCount + "个。");
System.out.println("输入错误,您已经输了!!!!重新开始游戏输入Y/y,退出游戏输入其他。");
if (sc.next().equalsIgnoreCase("")) {
return false;
} else {
return true;
}
}
draw(arr);
}
}
/**
*
* @param arr
* 地雷现有信息
* @param xVal
* 输入的横坐标
* @param yVal
* 输入的纵坐标
* @return null:踩到地雷;arr:数组最新信息添加
*/
private static Mine[][] check(Mine[][] arr, int xVal, int yVal) {
// System.out.println(xVal + "\t" + yVal);
// 当前点设置为显示
if (!arr[xVal][yVal].isMine()) {
arr[xVal][yVal].setShowFalg(true);
}
// 判断当前点是否为0,未0时显示周边的非雷位置的信息
if (arr[xVal][yVal].getOtherMineCount() == 0) {
// 把当前点是否已经判断标记设置为true
arr[xVal][yVal].setUsedFalg(true);
// 判断左上是否存在
if (xVal >= 1 && yVal >= 1) {
// 左上设置为显示
//arr[xVal - 1][yVal - 1].setShowFalg(true);
// 判断下一个点是否已经经过判断
if (!arr[xVal - 1][yVal - 1].isUsedFalg()) {
// 判断左上是否为0,如果是0继续判断周围部分坐标信息
if (arr[xVal - 1][yVal - 1].getOtherMineCount() == 0) {
check(arr, xVal - 1, yVal - 1);
}
}
}
// 判断正上是否存在
if (xVal >= 1) {
// 正上设置为显示
//arr[xVal - 1][yVal].setShowFalg(true);
// 判断下一个点是否已经经过判断
if (!arr[xVal - 1][yVal].isUsedFalg()) {
// 判断正上是否为0,如果是0继续判断周围部分坐标信息
if (arr[xVal - 1][yVal].getOtherMineCount() == 0) {
check(arr, xVal - 1, yVal);
}
}
}
// 判断右上是否存在
if (xVal >= 1 && yVal < arr[0].length - 1) {
// 右上设置为显示
//arr[xVal - 1][yVal + 1].setShowFalg(true);
// 判断下一个点是否已经经过判断
if (!arr[xVal - 1][yVal + 1].isUsedFalg()) {
// 判断右上是否为0,如果是0继续判断周围部分坐标信息
if (arr[xVal - 1][yVal + 1].getOtherMineCount() == 0) {
check(arr, xVal - 1, yVal + 1);
}
}
}
// 判断左边是否存在
if (yVal >= 1) {
// 左边设置为显示
arr[xVal][yVal - 1].setShowFalg(true);
if (!arr[xVal][yVal - 1].isUsedFalg()) {
// 判断左边是否为0,如果是0继续判断周围部分坐标信息
if (arr[xVal][yVal - 1].getOtherMineCount() == 0) {
check(arr, xVal, yVal - 1);
}
}
}
// 判断右边是否存在
if (yVal < arr[0].length - 1) {
// 右边设置为显示
//arr[xVal][yVal + 1].setShowFalg(true);
if (!arr[xVal][yVal + 1].isUsedFalg()) {
// 判断左上是否为0,如果是0继续判断周围部分坐标信息
if (arr[xVal][yVal + 1].getOtherMineCount() == 0) {
check(arr, xVal, yVal + 1);
}
}
}
// 判断左下是否存在
if (xVal < arr.length - 1 && yVal >= 1) {
// 当前坐标设置为显示
//arr[xVal + 1][yVal - 1].setShowFalg(true);
if (!arr[xVal + 1][yVal - 1].isUsedFalg()) {
// 判断左上是否为0,如果是0继续判断周围部分坐标信息
if (arr[xVal + 1][yVal - 1].getOtherMineCount() == 0) {
check(arr, xVal + 1, yVal - 1);
}
}
}
// 判断正下是否存在
if (xVal < arr.length - 1) {
// 当前坐标设置为显示
//arr[xVal + 1][yVal].setShowFalg(true);
if (!arr[xVal + 1][yVal].isUsedFalg()) {
// 判断左上是否为0,如果是0继续判断周围部分坐标信息
if (arr[xVal + 1][yVal].getOtherMineCount() == 0) {
check(arr, xVal + 1, yVal);
}
}
}
// 判断右下是否存在
if (xVal < arr.length - 1 && yVal < arr[0].length - 1) {
// 当前坐标设置为显示
//arr[xVal + 1][yVal + 1].setShowFalg(true);
if (!arr[xVal + 1][yVal].isUsedFalg()) {
// 判断左上是否为0,如果是0继续判断周围部分坐标信息
if (arr[xVal + 1][yVal + 1].getOtherMineCount() == 0) {
check(arr, xVal + 1, yVal + 1);
}
}
}
}
return arr;
}
/**
*
* @param arr:地雷信息
* @param xVal:输入的横坐标
* @param yVal:输入的纵坐标
* @return true:踩到地雷;false:不是地雷
*/
private static boolean checkWine(Mine[][] arr, int xVal, int yVal) {
if (arr[xVal][yVal].isMine()) {
return true;
} else {
return false;
}
}
/**
*
* @return true:赢得游戏;false:没赢
*/
private static boolean checkWin() {
if (findMineCount == mineCount) {
// 胜场+1
mine.setWinCount(mine.getWinCount() + 1);
return true;
}
return false;
}
}
| [
"973858423@qq.com"
] | 973858423@qq.com |
962f76486c43f0739126644d7be6221305346706 | ff3fccd1a66d7400c76875ab332b404f76e82465 | /framework/src/main/java/com/ocpsoft/projectStarter/ActionsFileCreator.java | 745864d54ba8b4b565b6000964bd7cfa2b8619ee | [] | no_license | ocpsoft/keyword-testing | f655040b6e6708572c404ee8223ee307c68dda00 | 1705f79b83c19376a5c497d4971ea33c34d79825 | refs/heads/master | 2020-04-09T14:20:13.984245 | 2013-11-04T21:47:47 | 2013-11-04T21:47:47 | 7,279,779 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,161 | java | package com.ocpsoft.projectStarter;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.net.URL;
import java.util.Arrays;
import org.jboss.forge.parser.JavaParser;
import org.jboss.forge.parser.java.JavaClass;
import com.ocpsoft.utils.Constants;
import com.ocpsoft.utils.Utility;
public class ActionsFileCreator {
public final static String className = "Actions";
public static void createActionsClassViaParser(String filePath, String packageName) {
JavaClass actionsClass = JavaParser.create(JavaClass.class);
actionsClass
.setName(className)
.setPublic()
.setPackage(packageName)
.addImport(Arrays.class);
actionsClass.addImport(URL.class);
actionsClass.addImport(Constants.DefaultSeleniumAnnotationClass);
try{
PrintStream writetoTest = new PrintStream(
new FileOutputStream(filePath + className + ".java"));
writetoTest.print(Utility.formatJavaClassFile(actionsClass));
writetoTest.close();
System.out.println("Successfully created " + className + ".java file in " + packageName);
}
catch (Exception e) {
System.err.println("Failure in ActionFileCreator: " + e);
}
}
}
| [
"Craig.Schwarzwald@gmail.com"
] | Craig.Schwarzwald@gmail.com |
a836f7d1a279f53e0653cc4b6319f0beb43d4446 | 9856541e29e2597f2d0a7ef4729208190d9bbebe | /spring-beans/src/main/java/org/springframework/beans/factory/config/MapFactoryBean.java | 5696c324fad00c65c3244da5c301e83c51752a76 | [
"Apache-2.0"
] | permissive | lakeslove/springSourceCodeTest | 74bffc0756fa5ea844278827d86a085b9fe4c14e | 25caac203de57c4b77268be60df2dcb2431a03e1 | refs/heads/master | 2020-12-02T18:10:14.048955 | 2017-07-07T00:41:55 | 2017-07-07T00:41:55 | 96,483,747 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,469 | java | /*
* Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.config;
import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.TypeConverter;
import org.springframework.core.GenericCollectionTypeResolver;
/**
* Simple factory for shared Map instances. Allows for central setup
* of Maps via the "map" element in XML bean definitions.
*
* @author Juergen Hoeller
* @since 09.12.2003
* @see SetFactoryBean
* @see ListFactoryBean
*/
public class MapFactoryBean extends AbstractFactoryBean<Map<Object, Object>> {
private Map<?, ?> sourceMap;
@SuppressWarnings("rawtypes")
private Class<? extends Map> targetMapClass;
/**
* Set the source Map, typically populated via XML "map" elements.
*/
public void setSourceMap(Map<?, ?> sourceMap) {
this.sourceMap = sourceMap;
}
/**
* Set the class to use for the target Map. Can be populated with a fully
* qualified class name when defined in a Spring application context.
* <p>Default is a linked HashMap, keeping the registration order.
* @see java.util.LinkedHashMap
*/
@SuppressWarnings("rawtypes")
public void setTargetMapClass(Class<? extends Map> targetMapClass) {
if (targetMapClass == null) {
throw new IllegalArgumentException("'targetMapClass' must not be null");
}
if (!Map.class.isAssignableFrom(targetMapClass)) {
throw new IllegalArgumentException("'targetMapClass' must implement [java.util.Map]");
}
this.targetMapClass = targetMapClass;
}
@Override
@SuppressWarnings("rawtypes")
public Class<Map> getObjectType() {
return Map.class;
}
@Override
@SuppressWarnings("unchecked")
protected Map<Object, Object> createInstance() {
if (this.sourceMap == null) {
throw new IllegalArgumentException("'sourceMap' is required");
}
Map<Object, Object> result = null;
if (this.targetMapClass != null) {
result = BeanUtils.instantiateClass(this.targetMapClass);
}
else {
result = new LinkedHashMap<Object, Object>(this.sourceMap.size());
}
Class<?> keyType = null;
Class<?> valueType = null;
if (this.targetMapClass != null) {
keyType = GenericCollectionTypeResolver.getMapKeyType(this.targetMapClass);
valueType = GenericCollectionTypeResolver.getMapValueType(this.targetMapClass);
}
if (keyType != null || valueType != null) {
TypeConverter converter = getBeanTypeConverter();
for (Map.Entry<?, ?> entry : this.sourceMap.entrySet()) {
Object convertedKey = converter.convertIfNecessary(entry.getKey(), keyType);
Object convertedValue = converter.convertIfNecessary(entry.getValue(), valueType);
result.put(convertedKey, convertedValue);
}
}
else {
result.putAll(this.sourceMap);
}
return result;
}
}
| [
"lakeslove@126.com"
] | lakeslove@126.com |
a80c92e585d7a03c54b40575b83ec562392c511e | abd88dc42d29ac1717c2fc833125080f144a4eb4 | /src/main/java/edu/miu/cs/cs425/eshopping/util/GeneratePdf.java | b95bbeb31e021e879650fbaafac2babcae7161c0 | [] | no_license | Ghebrehiywet/eShopper | 2c5408f51eeffb11218c492c6f86d98869b8d471 | 77ae0bd633bf6c6d5040dd942946274ed025dd51 | refs/heads/master | 2023-04-13T20:09:31.122522 | 2020-10-20T20:54:04 | 2020-10-20T20:54:04 | 265,422,545 | 1 | 3 | null | 2023-03-27T22:19:21 | 2020-05-20T02:07:52 | Java | UTF-8 | Java | false | false | 8,534 | java | package edu.miu.cs.cs425.eshopping.util;
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import edu.miu.cs.cs425.eshopping.model.Item;
import edu.miu.cs.cs425.eshopping.model.Order;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.math.BigDecimal;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
public class GeneratePdf {
public static ByteArrayInputStream orderReport(List<Order> orders) {
Order oneOrder = orders.stream().findFirst().get();
ByteArrayOutputStream out = new ByteArrayOutputStream();
Document document = new Document();
try {
Font topHeaderFont = FontFactory.getFont(FontFactory.HELVETICA_BOLD);
topHeaderFont.setColor(BaseColor.BLACK);
topHeaderFont.setSize(16);
Font headerFont = FontFactory.getFont(FontFactory.HELVETICA_BOLD);
PdfPTable tableHeader = new PdfPTable(4);
tableHeader.setWidthPercentage(100);
tableHeader.setWidths(new int[]{2, 2, 2, 2});
PdfPCell tableHeaderCell;
tableHeaderCell = new PdfPCell(new Phrase("SEGY eShopper Inc.", topHeaderFont));
tableHeaderCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
tableHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableHeaderCell.setColspan(3);
tableHeaderCell.setBorder(0);
tableHeader.addCell(tableHeaderCell);
tableHeaderCell = new PdfPCell(new Phrase("RECEIPT", topHeaderFont));
tableHeaderCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
tableHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableHeaderCell.setColspan(1);
tableHeaderCell.setBorder(0);
tableHeader.addCell(tableHeaderCell);
PdfPCell shippingAddress;
shippingAddress = new PdfPCell(new Phrase("Shipping \nAddress", headerFont));
shippingAddress.setVerticalAlignment(Element.ALIGN_MIDDLE);
shippingAddress.setHorizontalAlignment(Element.ALIGN_LEFT);
shippingAddress.setBorder(2);
tableHeader.addCell(shippingAddress);
PdfPCell receiptDetail;
receiptDetail = new PdfPCell(new Phrase("RECEIPT #", topHeaderFont));
receiptDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
receiptDetail.setHorizontalAlignment(Element.ALIGN_RIGHT);
receiptDetail.setBorder(0);
tableHeader.addCell(receiptDetail);
receiptDetail = new PdfPCell(new Phrase(oneOrder.getId().toString(), topHeaderFont));
receiptDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
receiptDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
receiptDetail.setBorder(0);
tableHeader.addCell(receiptDetail);
PdfPTable tableBody = new PdfPTable(4);
tableBody.setWidthPercentage(100);
tableBody.setWidths(new int[]{1, 3, 2, 2});
Font headFont = FontFactory.getFont(FontFactory.HELVETICA_BOLD);
PdfPCell hcell;
hcell = new PdfPCell(new Phrase("No.", headFont));
hcell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableBody.addCell(hcell);
hcell = new PdfPCell(new Phrase("Product Name", headFont));
hcell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableBody.addCell(hcell);
hcell = new PdfPCell(new Phrase("Quantity", headFont));
hcell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableBody.addCell(hcell);
hcell = new PdfPCell(new Phrase("Price", headFont));
hcell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableBody.addCell(hcell);
BigDecimal totalPrice = new BigDecimal(0);
Integer index = 0;
for (Order order : orders) {
PdfPCell cell;
for (Item itm : order.getCartItem().getItem()) {
BigDecimal price = itm.getProduct().getPrice().multiply(new BigDecimal(itm.getQuantity()));
totalPrice = totalPrice.add(price);
cell = new PdfPCell(new Phrase((++index).toString()));
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableBody.addCell(cell);
cell = new PdfPCell(new Phrase(itm.getProduct().getTitle()));
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableBody.addCell(cell);
cell = new PdfPCell(new Phrase(itm.getQuantity().toString()));
cell.setPaddingLeft(5);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableBody.addCell(cell);
cell = new PdfPCell(new Phrase(itm.getItemPrice().toString()));
cell.setPaddingLeft(5);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableBody.addCell(cell);
// cell = new PdfPCell(new Phrase(String.valueOf(order.getOrderDate().toString())));
// cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
// cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
// cell.setPaddingRight(5);
// tableBody.addCell(cell);
}
}
hcell = new PdfPCell(new Phrase("Total"));
hcell.setPaddingLeft(5);
hcell.setVerticalAlignment(Element.ALIGN_MIDDLE);
hcell.setHorizontalAlignment(Element.ALIGN_RIGHT);
hcell.setColspan(3);
tableBody.addCell(hcell);
hcell = new PdfPCell(new Phrase(totalPrice.toString()));
hcell.setPaddingLeft(5);
hcell.setVerticalAlignment(Element.ALIGN_MIDDLE);
hcell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableBody.addCell(hcell);
Font footerFont = FontFactory.getFont(FontFactory.HELVETICA_BOLD);
footerFont.setColor(BaseColor.BLACK);
footerFont.setSize(15);
PdfPTable tableFooter = new PdfPTable(4);
tableFooter.setWidthPercentage(100);
tableFooter.setWidths(new int[]{2, 2, 2, 2});
PdfPCell tableFooterCell;
tableFooterCell = new PdfPCell(new Phrase("Thank You!", headerFont));
tableFooterCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
tableFooterCell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableFooterCell.setColspan(3);
tableFooterCell.setBorder(0);
tableFooter.addCell(tableFooterCell);
tableFooterCell = new PdfPCell(new Phrase("Terms & Conditions", headerFont));
tableFooterCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
tableFooterCell.setHorizontalAlignment(Element.ALIGN_CENTER);
tableFooterCell.setColspan(1);
tableFooterCell.setBorder(0);
tableFooter.addCell(tableFooterCell);
PdfPTable tableSpace = new PdfPTable(1);
tableSpace.setWidthPercentage(100);
PdfPCell emptyCell = new PdfPCell(new Phrase(" \n "));
emptyCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
emptyCell.setHorizontalAlignment(Element.ALIGN_CENTER);
emptyCell.setColspan(1);
emptyCell.setPadding(10);
emptyCell.setBorder(0);
tableSpace.addCell(emptyCell);
PdfWriter.getInstance(document, out);
document.open();
document.add(tableHeader);
document.add(tableSpace);
document.add(tableBody);
document.add(tableSpace);
document.add(tableSpace);
document.add(tableFooter);
document.close();
} catch (DocumentException ex) {
Logger.getLogger(GeneratePdf.class.getName()).log(Level.SEVERE, null, ex);
}
return new ByteArrayInputStream(out.toByteArray());
}
}
| [
"g.hiwetmit@gmail.com"
] | g.hiwetmit@gmail.com |
caa797142a7e7d42d44936e057e38d35311181c3 | 1a4da9969f7bf77a34417f4b58fcd71a2c3587b1 | /Lstack/src/com/company/Node.java | 135380334c22f97796112e012daf5e7565151c01 | [] | no_license | jitendra80830/DataStructure_Using_Java | dac98e1fba20e6e1bccd8b3ff5b5559aa64015bd | 3198c6e08a51727bdb20ade5d4196d84192f6a4e | refs/heads/master | 2023-04-01T22:51:02.599688 | 2021-04-15T08:21:35 | 2021-04-15T08:21:35 | 318,781,358 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 150 | java | package com.company;
public class Node<T> {
T data;
Node<T> next;
Node(T item){
this.data=item;
this.next=null;
}
}
| [
"jitendrakumar89973@gmail.com"
] | jitendrakumar89973@gmail.com |
e795c4a9f4d954929092074a8eb45e32a3457683 | 6f8edf68044debaa9fa5662da0a71a00c5182581 | /java/com/norbl/util/TimeUtil.java | 006566d5f67230ff19b4d9264cc0c3c62d04878a | [] | no_license | cran/cloudRmpi | 45e4be633688ba3bf1e07e0d1eb721b319b3c217 | fd9ffa631ba612045aef04b66c0df6d27da23de1 | refs/heads/master | 2021-01-18T15:21:41.301819 | 2012-05-12T00:00:00 | 2012-05-12T00:00:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,450 | java | /*
Copyright 2011 Northbranchlogic, Inc.
This file is part of Parallel Processing with EC2 (ppe).
ppe is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ppe is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ppe. If not, see <http://www.gnu.org/licenses/>.
*/
package com.norbl.util;
import java.text.*;
import java.util.*;
/**
*
* @author Barnet Wagman
*/
public class TimeUtil {
public static int toYMD(long tm) {
return(Integer.parseInt(
(new SimpleDateFormat("yyyyMMdd")).format(
new Date(tm)))
);
}
public static long toYMDHMSM(long tm) {
return(Long.parseLong(
(new SimpleDateFormat("yyyyMMddHHmmssSSS")).format(
new Date(tm)))
);
}
public static String toDateTimeString(long tm) {
return((new SimpleDateFormat("yyyy MM dd HH mm ss")).format(
new Date(tm))
);
}
}
| [
"csardi.gabor@gmail.com"
] | csardi.gabor@gmail.com |
a9bd4f5dd28b7855c3ea22343e05cb77bd5f7794 | 0102d71077d95821e90d1405d10ca807d7b00373 | /src/main/java/com/mytest/mytestapp/employmentInformation.java | c649bb09dc2261ca231abaa15376aac665dcdb3e | [] | no_license | Kelliesuddards/BasicTest | e888a9743e50f57a5d42a8a3893303a59dee777d | 1e54092cdbe965aa874142ce2ecfc63e9d0a00a1 | refs/heads/master | 2021-07-22T17:21:57.045890 | 2017-11-03T18:02:20 | 2017-11-03T18:02:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,908 | java | package com.mytest.mytestapp;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class employmentInformation {
public static WebElement employmentStatus = null;
public static WebElement employmentStatus (WebDriver driver) {
employmentStatus = driver.findElement(By.xpath("//*[@id=\"agselectemployment-status\"]"));
return employmentStatus;
}
public static WebElement employerName = null;
public static WebElement employerName (WebDriver driver) {
employerName = driver.findElement(By.xpath("//*[@id=\"employer-name\"]"));
return employerName;
}
public static WebElement jobTitle = null;
public static WebElement jobTitle (WebDriver driver) {
jobTitle = driver.findElement(By.xpath("//*[@id=\"employee-title\"]"));
return jobTitle;
}
public static WebElement startDate = null;
public static WebElement startDate (WebDriver driver) {
startDate = driver.findElement(By.xpath("//*[@id=\"employee-start-date\"] "));
return startDate;
}
public static WebElement employerPhone = null;
public static WebElement employerPhone (WebDriver driver) {
employerPhone = driver.findElement(By.xpath("//*[@id=\"employer-phone-number\"]"));
return employerPhone;
}
public static WebElement monthlyIncome = null;
public static WebElement monthlyIncome (WebDriver driver) {
monthlyIncome = driver.findElement(By.xpath("//*[@id=\"gross-monthly-income\"]"));
return monthlyIncome;
}
public static WebElement nextButton = null;
public static WebElement nextButton (WebDriver driver) {
nextButton = driver.findElement(By.xpath(" //*[@id=\"content\"]/div/div/div[4]/div/div[2]/form/div/div[1]/button"));
return nextButton;
}
} | [
"kmsuddards@gmail.com"
] | kmsuddards@gmail.com |
915db655b96a9f5ee9bad2c254d1d399c46c09d3 | 6d5310eb2fbc46002343cd25b3277a31365d041a | /art/src/main/java/me/jessyan/art/ui/util/Utils.java | 5f4f36de8ba6a68ebe556f4e1d384786f32c0ac4 | [] | no_license | dreamervq/artMvp | 26b77e6045bc865ba08e5a6853df6a0913ffa0b3 | a5f8fcc7cf7d6cda8b8bd2417553623fd52336a5 | refs/heads/master | 2023-01-31T23:52:57.959030 | 2020-12-17T07:32:28 | 2020-12-17T07:32:28 | 318,366,284 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,824 | java |
package me.jessyan.art.ui.util;
import android.app.Activity;
import android.app.ActivityOptions;
import android.os.Build;
import java.lang.reflect.Method;
public class Utils {
private Utils() {
}
/**
* Convert a translucent themed Activity
* {@link android.R.attr#windowIsTranslucent} to a fullscreen opaque
* Activity.
* <p>
* Call this whenever the background of a translucent Activity has changed
* to become opaque. Doing so will allow the {@link android.view.Surface} of
* the Activity behind to be released.
* <p>
* This call has no effect on non-translucent activities or on activities
* with the {@link android.R.attr#windowIsFloating} attribute.
*/
public static void convertActivityFromTranslucent(Activity activity) {
try {
Method method = Activity.class.getDeclaredMethod("convertFromTranslucent");
method.setAccessible(true);
method.invoke(activity);
} catch (Throwable t) {
}
}
/**
* Convert a translucent themed Activity
* {@link android.R.attr#windowIsTranslucent} back from opaque to
* translucent following a call to
* {@link #convertActivityFromTranslucent(Activity)} .
* <p>
* Calling this allows the Activity behind this one to be seen again. Once
* all such Activities have been redrawn
* <p>
* This call has no effect on non-translucent activities or on activities
* with the {@link android.R.attr#windowIsFloating} attribute.
*/
public static void convertActivityToTranslucent(Activity activity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
convertActivityToTranslucentAfterL(activity);
} else {
convertActivityToTranslucentBeforeL(activity);
}
}
/**
* Calling the convertToTranslucent method on platforms before Android 5.0
*/
public static void convertActivityToTranslucentBeforeL(Activity activity) {
try {
Class<?>[] classes = Activity.class.getDeclaredClasses();
Class<?> translucentConversionListenerClazz = null;
for (Class clazz : classes) {
if (clazz.getSimpleName().contains("TranslucentConversionListener")) {
translucentConversionListenerClazz = clazz;
}
}
Method method = Activity.class.getDeclaredMethod("convertToTranslucent",
translucentConversionListenerClazz);
method.setAccessible(true);
method.invoke(activity, new Object[] {
null
});
} catch (Throwable t) {
}
}
/**
* Calling the convertToTranslucent method on platforms after Android 5.0
*/
private static void convertActivityToTranslucentAfterL(Activity activity) {
try {
Method getActivityOptions = Activity.class.getDeclaredMethod("getActivityOptions");
getActivityOptions.setAccessible(true);
Object options = getActivityOptions.invoke(activity);
Class<?>[] classes = Activity.class.getDeclaredClasses();
Class<?> translucentConversionListenerClazz = null;
for (Class clazz : classes) {
if (clazz.getSimpleName().contains("TranslucentConversionListener")) {
translucentConversionListenerClazz = clazz;
}
}
Method convertToTranslucent = Activity.class.getDeclaredMethod("convertToTranslucent",
translucentConversionListenerClazz, ActivityOptions.class);
convertToTranslucent.setAccessible(true);
convertToTranslucent.invoke(activity, null, options);
} catch (Throwable t) {
}
}
}
| [
"707415019@qq.com"
] | 707415019@qq.com |
779b60bc0afd1f01adb571abbe0ddbe9d5d9dcba | d51ebe48e8bd1d39756dac1d970c3cc944806622 | /common/dto/message/BroadcastType.java | b7037c8b03b171c33c22c0c5911aec5f21649c23 | [] | no_license | odin-asen/Durak_alt | d3f99efafa13e0ce29dabd31fae16c001512f158 | a823a8a8cfebd7ae299214a7b07a491b3c9a4517 | refs/heads/master | 2016-08-07T11:39:49.262965 | 2013-02-11T01:28:06 | 2013-02-11T01:28:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 171 | java | package common.dto.message;
/**
* User: Timm Herrmann
* Date: 17.10.12
* Time: 02:31
*/
public enum BroadcastType {
CHAT_MESSAGE,
LOGIN_LIST,
SERVER_SHUTDOWN
}
| [
"chewbacca88@gmx.de"
] | chewbacca88@gmx.de |
4464fbef0e98b9c7cb528b73513a3c9224bd6bbd | 8cba1119e1798268755dbee4b2df7ab92c85fae6 | /app/src/main/java/com/example/lephat/a5_musicplayer/MusiService.java | 77d97959102d1ee7b99bd4ae8ea55b41e22642bc | [] | no_license | Phatest1/5_MusicPlayer | d021c864b8f02b61dbe6c28c171f0dfdf508b4b6 | cb2b56c8fc41af18c7c5de36aef86ec393e134a3 | refs/heads/master | 2021-08-23T09:07:55.903903 | 2017-12-04T12:27:33 | 2017-12-04T12:27:33 | 112,632,405 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 747 | java | package com.example.lephat.a5_musicplayer;
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.support.annotation.Nullable;
/**
* Created by Le Phat on 06-Nov-17.
*/
public class MusiService extends Service implements MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener,MediaPlayer.OnCompletionListener {
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onPrepared(MediaPlayer mp) {
}
@Override
public void onCompletion(MediaPlayer mp) {
}
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
return false;
}
}
| [
"tanphat1309@gmail.com"
] | tanphat1309@gmail.com |
66289bb76d44f15bce977b3795d88113bd71c756 | 0168c9710b51e7772cae56d6e5489d2c626c91d2 | /Getoffyourphone-master/app/build/generated/not_namespaced_r_class_sources/debug/r/androidx/viewpager/R.java | 08e7154ad01b9d91045b28869d0c8014ed5d6021 | [] | no_license | baldeepsingh11/AppDev | d2b099ba2b9669ec5f3b6ad092a3f207ea0c74c7 | 80e94193fd8be6edb43ff7934024b5f1234976db | refs/heads/master | 2022-11-30T20:18:14.641243 | 2020-08-18T17:01:32 | 2020-08-18T17:01:32 | 261,158,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,449 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package androidx.viewpager;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f030029;
public static final int font = 0x7f0300ea;
public static final int fontProviderAuthority = 0x7f0300ec;
public static final int fontProviderCerts = 0x7f0300ed;
public static final int fontProviderFetchStrategy = 0x7f0300ee;
public static final int fontProviderFetchTimeout = 0x7f0300ef;
public static final int fontProviderPackage = 0x7f0300f0;
public static final int fontProviderQuery = 0x7f0300f1;
public static final int fontStyle = 0x7f0300f2;
public static final int fontVariationSettings = 0x7f0300f3;
public static final int fontWeight = 0x7f0300f4;
public static final int ttcIndex = 0x7f03025b;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f0501b5;
public static final int notification_icon_bg_color = 0x7f0501b6;
public static final int ripple_material_light = 0x7f0501c4;
public static final int secondary_text_default_material_light = 0x7f0501c6;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f060066;
public static final int compat_button_inset_vertical_material = 0x7f060067;
public static final int compat_button_padding_horizontal_material = 0x7f060068;
public static final int compat_button_padding_vertical_material = 0x7f060069;
public static final int compat_control_corner_material = 0x7f06006a;
public static final int compat_notification_large_icon_max_height = 0x7f06006b;
public static final int compat_notification_large_icon_max_width = 0x7f06006c;
public static final int notification_action_icon_size = 0x7f060131;
public static final int notification_action_text_size = 0x7f060132;
public static final int notification_big_circle_margin = 0x7f060133;
public static final int notification_content_margin_start = 0x7f060134;
public static final int notification_large_icon_height = 0x7f060135;
public static final int notification_large_icon_width = 0x7f060136;
public static final int notification_main_column_padding_top = 0x7f060137;
public static final int notification_media_narrow_margin = 0x7f060138;
public static final int notification_right_icon_size = 0x7f060139;
public static final int notification_right_side_padding_top = 0x7f06013a;
public static final int notification_small_icon_background_padding = 0x7f06013b;
public static final int notification_small_icon_size_as_large = 0x7f06013c;
public static final int notification_subtext_size = 0x7f06013d;
public static final int notification_top_pad = 0x7f06013e;
public static final int notification_top_pad_large_text = 0x7f06013f;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f070099;
public static final int notification_bg = 0x7f07009a;
public static final int notification_bg_low = 0x7f07009b;
public static final int notification_bg_low_normal = 0x7f07009c;
public static final int notification_bg_low_pressed = 0x7f07009d;
public static final int notification_bg_normal = 0x7f07009e;
public static final int notification_bg_normal_pressed = 0x7f07009f;
public static final int notification_icon_background = 0x7f0700a0;
public static final int notification_template_icon_bg = 0x7f0700a1;
public static final int notification_template_icon_low_bg = 0x7f0700a2;
public static final int notification_tile_bg = 0x7f0700a3;
public static final int notify_panel_notification_icon_bg = 0x7f0700a4;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f08002f;
public static final int action_divider = 0x7f080031;
public static final int action_image = 0x7f080032;
public static final int action_text = 0x7f080038;
public static final int actions = 0x7f080039;
public static final int async = 0x7f08003f;
public static final int blocking = 0x7f080044;
public static final int chronometer = 0x7f080055;
public static final int forever = 0x7f080084;
public static final int icon = 0x7f08008d;
public static final int icon_group = 0x7f08008e;
public static final int info = 0x7f080092;
public static final int italic = 0x7f080094;
public static final int line1 = 0x7f0800aa;
public static final int line3 = 0x7f0800ab;
public static final int normal = 0x7f0800ed;
public static final int notification_background = 0x7f0800ee;
public static final int notification_main_column = 0x7f0800ef;
public static final int notification_main_column_container = 0x7f0800f0;
public static final int right_icon = 0x7f080101;
public static final int right_side = 0x7f080102;
public static final int tag_transition_group = 0x7f080144;
public static final int tag_unhandled_key_event_manager = 0x7f080145;
public static final int tag_unhandled_key_listeners = 0x7f080146;
public static final int text = 0x7f080147;
public static final int text2 = 0x7f080148;
public static final int time = 0x7f080150;
public static final int title = 0x7f080151;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f09000e;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f0b005a;
public static final int notification_action_tombstone = 0x7f0b005b;
public static final int notification_template_custom_big = 0x7f0b005c;
public static final int notification_template_icon_group = 0x7f0b005d;
public static final int notification_template_part_chronometer = 0x7f0b005e;
public static final int notification_template_part_time = 0x7f0b005f;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0d00db;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0e014e;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0e014f;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e0150;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0e0151;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0e0152;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0e01fb;
public static final int Widget_Compat_NotificationActionText = 0x7f0e01fc;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f030029 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f0300ec, 0x7f0300ed, 0x7f0300ee, 0x7f0300ef, 0x7f0300f0, 0x7f0300f1 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300ea, 0x7f0300f2, 0x7f0300f3, 0x7f0300f4, 0x7f03025b };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"anfalansari1@gmail.com"
] | anfalansari1@gmail.com |
995cc09c69e3660175a806011b27edfbb0a930e4 | 82ed0cd03b00795ff990a756c72151ee34abc15e | /src/main/java/app/controllers/StudenRESTController.java | ca29c744e18e2ca172dd7530c043ddb6bef6034d | [] | no_license | markokarapandzic/Spring-Boot-and-Angular-App | 1d489f6a653426d6f3ab1f91b15f3602075fa634 | 6a6f762a9891cd407c0b4edef68e716452984df9 | refs/heads/master | 2021-09-15T14:16:36.777336 | 2018-06-04T13:15:25 | 2018-06-04T13:15:25 | 135,614,598 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,127 | java | package app.controllers;
import java.util.Collection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import app.jpa.Student;
import app.reps.StudentRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@RestController
<<<<<<< HEAD
@Api(tags = { "Student CRUD operacije" })
public class StudenRESTController {
@Autowired
private StudentRepository studentRepository;
@Autowired
private JdbcTemplate jdbcTemplate;
@GetMapping("student")
@ApiOperation(value = "Vrаća kolekciju svih studenata iz baze podataka")
public Collection<Student> getStudenti() {
return studentRepository.findAll();
}
=======
@Api(tags = {"Student CRUD operacije"})
public class StudenRESTController {
@Autowired
private StudentRepository studentRepository;
@Autowired
private JdbcTemplate jdbcTemplate;
@GetMapping("student")
@ApiOperation(value = "Vrаća kolekciju svih studenata iz baze podataka")
public Collection<Student> getStudenti(){
return studentRepository.findAll();
}
>>>>>>> 893a665a351922e68162071c88fee34f9d9a67f0
@GetMapping("student/{id}")
@ApiOperation(value = "Vrаća studenta iz baze podataka ciji je ID vrednost prosleđena kao path varijabla")
public Student getStudent(@PathVariable("id") Integer id) {
return studentRepository.getOne(id);
}
<<<<<<< HEAD
@GetMapping("studentIndex/{index}")
@ApiOperation(value = "Vrаća studenta iz baze podataka koji ima odgovarajuci broj indexa")
public Collection<Student> getStudentByBrIndexa(@PathVariable("index") String index) {
return studentRepository.findByBrIndexaContainingIgnoreCase(index);
}
@GetMapping("studentPrezime/{prezime}")
@ApiOperation(value = "Vrаća studenta iz baze podataka koji ima odgovarajuce prezime")
public Collection<Student> getStudentByPrezime(@PathVariable("prezime") String prezime) {
return studentRepository.findByPrezimeContainingIgnoreCase(prezime);
}
@DeleteMapping("student/{id}")
@CrossOrigin
@ApiOperation(value = "Briše studenta iz baze podataka ciji je ID vrednost prosleđena kao path varijabla")
public ResponseEntity<Student> deleteStudent(@PathVariable("id") Integer id) {
if (studentRepository.existsById(id)) {
studentRepository.deleteById(id);
if (id == -100)
jdbcTemplate.execute(
"INSERT INTO \"student\"(\"id\", \"ime\", \"prezime\", \"broj_indexa\", \"grupa\", \"projekat\")\r\n"
+ "VALUES(-100, 'Test Ime, 'Test Prezime', 'Test Index', '1', '1')");
=======
@GetMapping("studentIndex/{index}")
@ApiOperation(value = "Vrаća studenta iz baze podataka koji ima odgovarajuci broj indexa")
public Collection<Student> getStudentByBrIndexa(@PathVariable("index") String index){
return studentRepository.findByBrIndexaContainingIgnoreCase(index);
}
@GetMapping("studentPrezime/{prezime}")
@ApiOperation(value = "Vrаća studenta iz baze podataka koji ima odgovarajuce prezime")
public Collection<Student> getStudentByPrezime(@PathVariable("prezime") String prezime){
return studentRepository.findByPrezimeContainingIgnoreCase(prezime);
}
@DeleteMapping("student/{id}")
@CrossOrigin
@ApiOperation(value = "Briše studenta iz baze podataka ciji je ID vrednost prosleđena kao path varijabla")
public ResponseEntity<Student> deleteStudent(@PathVariable("id") Integer id){
if(studentRepository.existsById(id)) {
studentRepository.deleteById(id);
if(id == -100)
jdbcTemplate.execute("INSERT INTO \"student\"(\"id\", \"ime\", \"prezime\", \"broj_indexa\", \"grupa\", \"projekat\")\r\n" +
"VALUES(-100, 'Test Ime, 'Test Prezime', 'Test Index', '1', '1')");
>>>>>>> 893a665a351922e68162071c88fee34f9d9a67f0
return new ResponseEntity<>(HttpStatus.OK);
}
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
<<<<<<< HEAD
// insert - Ovde koristimo POST metodu
@PostMapping("student")
@CrossOrigin
@ApiOperation(value = "Insertuje studenta u bazu podataka")
public ResponseEntity<Student> insertArtikl(@RequestBody Student student) {
if (studentRepository.existsById(student.getId())) {
return new ResponseEntity<>(HttpStatus.CONFLICT);
=======
//insert - Ovde koristimo POST metodu
@PostMapping("student")
@CrossOrigin
@ApiOperation(value = "Insertuje studenta u bazu podataka")
public ResponseEntity<Student> insertArtikl(@RequestBody Student student){
if(studentRepository.existsById(student.getId())) {
return new ResponseEntity<> (HttpStatus.CONFLICT);
>>>>>>> 893a665a351922e68162071c88fee34f9d9a67f0
}
studentRepository.save(student);
return new ResponseEntity<>(HttpStatus.OK);
}
<<<<<<< HEAD
// update - Ovde koristimo PUT metodu
@PutMapping("student")
@CrossOrigin
@ApiOperation(value = "Modifikuje studenta iz baze podataka")
public ResponseEntity<Student> updateArtikl(@RequestBody Student student) {
if (studentRepository.existsById(student.getId())) {
studentRepository.save(student);
return new ResponseEntity<>(HttpStatus.OK);
}
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
=======
//update - Ovde koristimo PUT metodu
@PutMapping("student")
@CrossOrigin
@ApiOperation(value = "Modifikuje studenta iz baze podataka")
public ResponseEntity<Student> updateArtikl(@RequestBody Student student){
if(studentRepository.existsById(student.getId())) {
studentRepository.save(student);
return new ResponseEntity<> (HttpStatus.OK);
}
return new ResponseEntity<> (HttpStatus.NO_CONTENT);
}
>>>>>>> 893a665a351922e68162071c88fee34f9d9a67f0
}
| [
"karapandzicmarko1@gmail.com"
] | karapandzicmarko1@gmail.com |
171a472827857f2b34f4a147b6dc7c2264b6651c | ec007f4e8660990deb7ce0fc6d060829cdfc56ef | /SubSets.java | a14534b983feb2fdf9e9771b8e2254a0a42dcc15 | [] | no_license | DribbleLife11/LeetCode_Well-Chosen_Code | 28e0c92cdf7e7d5b7beedc50ad8ad980a173052d | e1424a7f42129e38b361748c772eaca8f080cb88 | refs/heads/master | 2022-12-07T21:50:42.377123 | 2020-09-08T14:22:11 | 2020-09-08T14:22:11 | 280,676,180 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 761 | java | class Solution {
List<List<Integer>> output = new ArrayList();
int n, k;
public void backtrack(int first, ArrayList<Integer> curr, int[] nums) {
// if the combination is done
if (curr.size() == k)
output.add(new ArrayList(curr));
for (int i = first; i < n; ++i) {
// add i into the current combination
curr.add(nums[i]);
// use next integers to complete the combination
backtrack(i + 1, curr, nums);
// backtrack
curr.remove(curr.size() - 1);
}
}
public List<List<Integer>> subsets(int[] nums) {
n = nums.length;
for (k = 0; k < n + 1; ++k) {
backtrack(0, new ArrayList<Integer>(), nums);
}
return output;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
7e0bdca38f5a7ab7b9ca249af3f113e99593e472 | afdc302e3925552b4f320684322efcc8feb1b1e4 | /jhotdraw8/src/main/java/org/jhotdraw/text/XmlBooleanConverter.java | 5e9cea9118801a2009d5624b728b3a36ee5eff12 | [] | no_license | neerajmathur/JHotDraw7 | 384c87948393dbac58ce63794784fb98aa6e225e | c8dbaec7dc9f5a39dcb0f713b71147cf742854f0 | refs/heads/master | 2021-01-10T07:02:41.438254 | 2016-03-09T17:24:10 | 2016-03-09T17:24:10 | 54,486,674 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,883 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.jhotdraw.text;
import java.io.IOException;
import java.nio.CharBuffer;
import java.text.ParseException;
import org.jhotdraw.draw.io.IdFactory;
/**
* Converts a {@code Boolean} into the XML String representation.
* <p>
* Reference:
* <a href="http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#double">W3C: XML
* Schema Part 2: Datatypes Second Edition: 3.2.5 double</a>
* </p>
*
* @author Werner Randelshofer
* @version $Id$
*/
public class XmlBooleanConverter implements Converter<Boolean> {
private static final long serialVersionUID = 1L;
private final String trueString = "true";
private final String falseString = "false";
/**
* Creates a new instance.
*/
public XmlBooleanConverter() {
}
@Override
public void toString(Appendable buf, IdFactory idFactory, Boolean value) throws IOException {
buf.append(value ? trueString : falseString);
}
@Override
public Boolean fromString(CharBuffer in, IdFactory idFactory) throws ParseException {
int pos = in.position();
StringBuilder out = new StringBuilder();
while (in.remaining() > 0 && !Character.isWhitespace(in.charAt(0))) {
out.append(in.get());
}
String str = out.toString();
if (str.equals(trueString)) {
return true;
} else if (str.equals(falseString)) {
return false;
} else {
in.position(pos);
throw new ParseException("\"" + trueString + "\" or \"" + falseString + "\" expected instead of \"" + str + "\".", pos);
}
}
@Override
public Boolean getDefaultValue() {
return false;
}
}
| [
"rawcoder@fc158eef-6c16-0410-b9c5-873085b46621"
] | rawcoder@fc158eef-6c16-0410-b9c5-873085b46621 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.