id
stringlengths
36
36
text
stringlengths
1
1.25M
1ada6146-24ba-4423-a8c0-f8584112aec9
Collection<Authority> getAuthorities() throws AcServiceException;
71ac146a-3940-4102-8314-39d64744adcd
Authority getAuthorityByName(String name) throws AcServiceException;
92431c15-a344-4c42-8f39-60d576594320
void createAuthority(Authority auth) throws AcServiceException;
82b2a8a7-0cdc-4ab1-93d3-7c417ab13625
void updateAuthority(Authority auth) throws AcServiceException;
401e94f8-2e97-42d1-9642-320b3f1635c6
Authority getAuthorityByUrl(String name) throws AcServiceException;
5ff7e341-2140-4c43-a938-fdc3ba70f5c4
List<User> getUsersByAttributes(List<Attribute> attributes) throws AcServiceException;
f7db28db-7f63-4e0e-a086-179c802516d8
void setAttribute(long userId, Attribute attribute) throws AcServiceException;
56f034ff-5905-468c-a183-e10372de3c48
public Long getId() { return id; }
4a968827-f7a0-45b9-97bf-b08f584e00a5
public void setId(Long id) { this.id = id; }
769cdecf-0b4f-494b-8e9f-356aff54fd59
public Authority getAuthority() { return authority; }
8747d000-2f7b-4b8e-9892-795b4c0eb539
public void setAuthority(Authority authority) { this.authority = authority; }
38acba8d-68bf-4b45-9b04-4497ad4e76cb
public String getKey() { return key; }
375a0c61-4c7c-42e6-ae61-3af0a3994f53
public void setKey(String key) { this.key = key; }
84193b1e-6e98-457d-aad8-bc27d93137a8
public String getValue() { return value; }
bcd12474-a8bd-4c2f-903f-2ccff4cffeb2
public void setValue(String value) { this.value = value; }
def0722c-2cbd-44e8-a6d6-b097ed7151a8
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Attribute other = (Attribute) obj; if (this.authority != other.authority && (this.authority == null || !this.authority .equals(other.authority))) { r...
9f3321d1-37f6-403a-b93a-09cf6df88cbe
@Override public int hashCode() { int hash = 7; hash = 83 * hash + (this.authority != null ? this.authority.hashCode() : 0); hash = 83 * hash + (this.key != null ? this.key.hashCode() : 0); hash = 83 * hash + (this.value != null ? this.value.hashCode() : 0); return hash; }
b627c553-2c4a-40ff-9454-d9269c4ca508
@Override public String toString() { return "Attribute{authority=" + authority + ", key=" + key + ", value=" + value + '}'; }
b68b4da5-6967-4e3f-b65d-bbc46c1954b4
public String getName() { return name; }
21fbcfd9-edd7-4851-97ea-d7753f79c4ec
public void setName(String name) { this.name = name; }
250ee2ba-2c7d-461c-b859-8b5504335af1
public String getRedirectUrl() { return redirectUrl; }
86725fd7-a745-4835-96be-dda72aa13156
public void setRedirectUrl(String redirectUrl) { this.redirectUrl = redirectUrl; }
4fe1113b-6d20-49da-ab0b-c505d7a15adc
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Authority other = (Authority) obj; if ((this.name == null) ? (other.name != null) : !this.name .equals(other.name)) { return false; } return true; }
99a06399-fd42-4d5a-9522-535f3405af8f
@Override public int hashCode() { int hash = 5; hash = 17 * hash + (this.name != null ? this.name.hashCode() : 0); return hash; }
831e582d-de5c-4953-99b5-6bab20bf4dd1
@Override public String toString() { return "Authority{id=" + id + ", name=" + name + ", url=" + redirectUrl + '}'; }
d4d12747-7abe-49d2-bf74-1f5f8be8cfa9
public List<Attribute> getAttributes() { return attributes; }
3ab01946-f3b9-4191-a412-28bea6fc6848
public void setAttributes(List<Attribute> attributes) { this.attributes = attributes; }
f0e5a4a6-2792-4a52-b4fe-c44c1394293d
public String getAuthToken() { return authToken; }
288482de-bde5-40db-b152-b1216851af7b
public void setAuthToken(String authToken) { this.authToken = authToken; }
760382ee-e412-4783-9459-a7b6ed9f90ae
public long getExpTime() { return expTime; }
4b02f344-198b-499f-81fe-f5e00aa98e8b
public void setExpTime(long expTime) { this.expTime = expTime; }
6a3106b4-ccd4-409f-88d4-1bd1ecd7643c
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final User other = (User) obj; if ((this.authToken == null) ? (other.authToken != null) : !this.authToken.equals(other.authToken)) { return false; } if ((thi...
11013628-5be4-4252-8e6a-c987f3792ac1
@Override public int hashCode() { if (hash == null) { hash = 7; hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0); } return hash; }
9c998eff-e29e-4e9a-a6bf-23af559ac23a
@Override public String toString() { return "User{id=" + id + ", authToken=" + authToken + ", expTime=" + expTime + ", socialId=" + socialId + " ,attributes=" + attributes + '}'; }
f4ca1820-c513-4dab-a97e-513622e46924
public long getSocialId() { return socialId; }
db0b97e7-d9d1-43f1-b26c-ce558e3fd236
public void setSocialId(long socialId) { this.socialId = socialId; }
2e0bb2de-a274-4f78-ae87-c12b27ed693f
public ExcelReader(InputStream inputStream){ try { this.excel = Workbook.getWorkbook(inputStream); } catch (Exception e) { throw new CreateWorkBookException(e.getMessage()); } }
08408482-b029-4ae4-a6ad-30b4f38ead26
public List<List<String>> read(){ Sheet[] sheets = excel.getSheets(); List<List<String>> result = new ArrayList<List<String>>(); for (Sheet sheet : sheets) { int rows = sheet.getRows(); int columns = sheet.getColumns(); for(int i = 1;i < rows;i++){ List<String> list = new ArrayList<String>(); ...
de16b7ac-7fe7-4aac-9a4f-76fe3529adfc
public ExcelWriter(OutputStream outputStream) { initContext(outputStream, ""); }
e239f5b8-4ac8-458f-aca4-7b160fd3f3c0
public ExcelWriter(OutputStream outputStream, String sheetName) { initContext(outputStream, sheetName); }
de62dfd5-6a89-416f-afe0-d0a2eb6e5f7a
public <T> void write(List<T> entities,String[] title,String headContent,String imgPath){ createHead(headContent, imgPath); createTitle(title); createExcelData(entities); }
cd8b6a1b-cf7b-4748-b747-34fc323f623b
public <T> void export(List<T> entities, String[] title) { createTitle(title); createExcelData(entities); }
9728dc65-8703-439d-9bda-3f31842f4a32
private <T> void createExcelData(List<T> entities){ try { for (T entity : entities) { Class<?> clazz = entity.getClass(); Field[] fields = clazz.getDeclaredFields(); // 得到类的所有字段 int index = 0; for (Field field : fields) { // 得到属性的注解 ValueConvert convert = field.getAnnotation(ValueConvert....
af5a522e-af36-487b-8055-03362a56c8a5
private void initContext(OutputStream outputStream, String sheetName) { try { this.excel = Workbook.createWorkbook(outputStream); this.sheet = excel.createSheet(sheetName, 0); } catch (IOException e) { throw new CreateWorkBookException(e.getMessage()); } }
1d354f69-4d20-4d0a-a15f-afec9d6e5d4e
private void createTitle(String[] title) { for (int i = 0; i < title.length; i++) { try { Label label = new Label(i, row, title[i]); sheet.addCell(label); sheet.setColumnView(i, 20); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } } ++row; }
9072685d-f3f8-4e37-bb93-7fd5c6e1e46f
private void createHead(String headContent, String imgPath) { File img = new File(imgPath); // 设置标题格式 WritableFont wfTitle = new jxl.write.WritableFont(WritableFont.ARIAL, 35, WritableFont.BOLD, true); WritableCellFormat wcfTitle = new WritableCellFormat(wfTitle); // 设置水平对齐方式 try { wcfTitle.setAlignment...
6ea2eaa0-bd98-400e-980b-d5be9a025e8b
public void close() { if (null != excel) { try { excel.close(); } catch (WriteException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
ad593954-e61e-4919-afde-8bd482ede4ef
public CreateWorkBookException(String message){ super(message); }
2e5b0982-9253-4fe8-a709-96489e9eb80b
public ReflectException(String message){ super(message); }
2758d14e-2402-4105-97f3-97ce0592d534
public String method();
aa3a66de-a0f0-4855-92bf-9ea79d9e1bd1
public String getName() { return name; }
dec5807f-8810-4cb0-aa2a-82a6308a708b
public User setName(String name) { this.name = name; return this; }
f2927157-2905-4295-aa78-535e3d6a0e40
public String getPasswd() { return passwd; }
ecd94862-9d7a-4ee0-a354-e1ab695ba75d
public User setPasswd(String passwd) { this.passwd = passwd; return this; }
e6639ef9-f4e7-4fae-ab4b-8b187012f21d
public static void main(String[] args) { ExcelTest excel = new ExcelTest(); excel.exportTest(); // excel.exportTest2(); // excel.uploadTest2(); }
c9f6c594-1dbc-46dd-8c90-375752f9a093
public void exportTest() { try { OutputStream outputStream = new FileOutputStream(new File("D:\\test.xls")); ExcelWriter excel = new ExcelWriter(outputStream, "测试excel"); User u1 = new User().setName("张三").setPasswd("zhanshang"); User u2 = new User().setName("李四").setPasswd("lishi"); List<User> entitie...
8a2832a1-e755-4599-a12d-6bef3b47fc91
public void exportTest2() { try { OutputStream outputStream = new FileOutputStream(new File("D:\\test.xls")); ExcelWriter excel = new ExcelWriter(outputStream, "测试excel"); User u1 = new User().setName("张三").setPasswd("zhanshang"); User u2 = new User().setName("李四").setPasswd("lishi"); List<User> entiti...
b0f2ce95-b377-423b-8647-be6515fd386d
public void uploadTest2(){ try { InputStream inputStream = new FileInputStream(new File("D:\\test.xls")); ExcelReader reader = new ExcelReader(inputStream); List<List<String>> result = reader.read(); System.out.println(result.size()); } catch (FileNotFoundException e) { e.printStackTrace(); } }
9df257a6-dcb9-4145-a649-e4cc141ff338
public Player(double x, double y, double _direction, Image _entity) { pos = new Point2D(x,y); direction = _direction; weapon = _entity; }
59bc4015-efb3-4857-91d5-bc2948c1bbac
public Image getImage() { return weapon; }
b4ceb9db-150b-4b4a-8439-ace5b3d2161e
public void rotate(double angle) { this.direction = (this.direction + angle + CIRCLE) % (CIRCLE); }
cd3228de-ed90-4903-b91a-a98ba140c7a9
public void walk(double distance, Map map) { double dx = Math.cos(this.direction) * distance; double dy = Math.sin(this.direction) * distance; if (map.get(this.pos.x + dx, this.pos.y) <= 0) this.pos.x += dx; if (map.get(this.pos.x, this.pos.y + dy) <= 0) this.pos.y += dy; this.pa...
3ef5f71e-7f28-4ebd-a7be-0c060f0b98e9
public void update(ControlState controls, double seconds, Map map) { if (controls.keyLeft) this.rotate(-Math.PI * seconds); if (controls.keyRight) this.rotate(Math.PI * seconds); if (controls.keyUp) this.walk(3 * seconds, map); if (controls.keyDown) this.walk(-3 * seconds, map); }
b16ecc28-4888-43e9-bba7-ee6ca45b3670
public Ray() {}
15a2b60f-c741-465a-ac86-01d99210702b
public Ray(Point2D point, double _height, double _distance) { pos.setAsSelf(point); height = _height; distance = _distance; }
daebcd04-0ce1-4b4c-8d94-0cacac432620
public Ray(Point2D point, double _height, double _distance, double _offset, double _length2, double _shading) { pos.setAsSelf(point); height = _height; distance = _distance; offset = _offset; length2 = _length2; shading = _shading; }
c1beff9a-5ab1-4b9f-8eaa-159805256771
public Ray clone() { return new Ray(pos, height, distance, offset, length2, shading); }
2c32ee0b-4659-424f-a8e8-fbc13674565d
public Map(int size, Image _sky, Image _wall, Image _circle) { this.size = size; this.grid = new int[1024]; this.skybox = _sky; this.wallTexture = _wall; this.circle = _circle; this.light = 0; this.noWall.length2 = Double.POSITIVE_INFINITY; }
ef738386-32d9-4cc6-b8f2-52b1ae7cf096
public void randomize() { for (int i=0; i < this.size * this.size; i++) { float result = rand.nextFloat(); this.grid[i] = (result > 0.5) ? 1 : 0; } }
4b81cb2e-b89a-4fbf-8bef-d8a179724709
public double get(double x, double y) { int cleanX = (int)Math.floor(x); int cleanY = (int)Math.floor(y); if ((cleanX < 0 || cleanX > this.size - 1) || (cleanY < 0 || cleanY > this.size - 1)) return -1; return this.grid[cleanY * this.size + cleanX]; }
7582489c-57ed-45c7-b858-8efe3ff8d1e4
public void update(double seconds) { if (this.light > 0) { this.light = Math.max(this.light - 10 * seconds, 0); } else if (Math.random() * 5 < seconds) { this.light = 2; } }
e05adb77-92b3-437f-b9d5-f53778bbd727
public ArrayList<Ray> cast(Point2D point, double angle, double range) { this.currentAngle.sin = Math.sin(angle); this.currentAngle.cos = Math.cos(angle); this.currentRange = range; return this.ray(new Ray(point, 0, 0)); }
76a4850a-69ed-46b8-838a-0e48ee622282
public ArrayList<Ray> ray(Ray origin) { Ray stepX = this.stepCheck(this.currentAngle.sin, this.currentAngle.cos, origin.pos.x, origin.pos.y, false); // Flip the point here so we check towards the opposite (horizontal vs vertical) side [note the x/y are switched too] Ray stepY = this.stepCheck(this.currentAngle.co...
74150b10-c020-46dd-beaf-94acb5230faa
public Ray stepCheck(double rise, double run, double x, double y, boolean inverted) { if (run == 0) return this.noWall; double dx; /** * Imagine here we are in a box quadrant's center at 45 degrees facing SE * So cos(315) is positive (looking at StepX), while sin(315) is negative with * a slope of -1 ...
6c2a9703-f174-47b2-82a3-836619ab85a2
public Ray inspect(Ray step, int shiftX, int shiftY, double distance, double offset) { double dx = 0; double dy = 0; if (this.currentAngle.cos < 0) dx = shiftX; if (this.currentAngle.sin < 0) dy = shiftY; Ray nextStep = step.clone(); nextStep.height = this.get(step.pos.x - dx, step.pos.y - dy); nextSte...
1414de54-2c11-43aa-8248-9b39b48c9f68
public Point2D(double x, double y) { this.x = x; this.y = y; }
d86dce4c-4a38-40d0-8655-68de3e33ec35
public double X() { return x; }
ffd57627-0a36-46f1-ba17-3bbfa6ddba11
public double Y() { return y; }
90479a0b-eaed-40fb-8fa9-d2157df860a8
public void setX(double x) { this.x = x; }
1873dee9-fd69-41d4-ba70-2bc2fcb53065
public void setY(double y) { this.y = y; }
3a120d8e-5cab-4d77-80ec-0a125233ef09
public Point2D clone() { return new Point2D(this.x, this.y); }
b9b2d190-877a-4d91-82b8-9a069dc5fe92
public void setAsSelf(Point2D newPoint) { this.x = newPoint.x; this.y = newPoint.y; }
3e3c7e21-acc9-44e5-a344-1673ee5b687f
public static void main(String[] args) { new GhostHunter(); }
ea007428-f11f-4d41-9732-dc3df428b50a
public GhostHunter() { super("Ghost Hunter", 1024, 576); // Setup camera properties this.spacing = this.screenWidth / this.resolution; this.scale = (this.screenWidth + this.screenHeight)/1200; // Setup our main components player = new Player(-1, -1, 0, load("images/knife_hand.png")); /** * W...
18427ffb-2e3d-47a0-bc76-f35ebac22687
public Image load(String filename) { Toolkit tk = Toolkit.getDefaultToolkit(); return tk.getImage(filename); }
86b65fc3-78fa-481b-b66c-797a3294619d
public void gameUpdate() { map.update(interpolation); player.update(controls, interpolation/20, map); }
37da181b-b12c-4b06-9d30-1a429f9ff00f
public void gameDraw(double interpolation) { this.drawSky(this.player.direction, this.map.skybox, this.map.light); this.drawColumns(); }
3ef360ec-9f61-4592-a7a3-7fc102298ce4
public void drawSky(double direction, Image sky, double light) { int width = (int)(sky.getWidth(this) * ((double)this.screenHeight / (double)sky.getHeight(this)) * 2); int left =(int)((direction / CIRCLE) * -width); graphics().drawImage(sky, left, 0, width, this.screenHeight, this); ...
dbfd56be-3d75-4153-a993-4f2710b1250b
public void drawColumns() { for (int column = 0; column < this.resolution; column++){ /** * UNDERSTAND: these two calculations will return degrees varying from -32 to 32 degrees * Or roughly 64 degrees of view, which is roughly what the standard FOV for console games * is. http://en.wikipedia.org/wik...
10a4e608-c4a6-4fc7-ad8f-9046bc11e925
public void drawColumn(int column, ArrayList<Ray> ray, double angle) { Image texture = map.wallTexture; int left = (int)Math.ceil(column * this.spacing); int width = (int)Math.ceil(this.spacing); int hit = -1; // Make sure we got a hit while (hit++ < ray.size() && ray.get(hit).height <= 0 ) { // We ne...
3f4999c3-7170-4db2-80ae-8503dc0f90e7
public Wall project(double height, double angle, double distance) { double z = distance * Math.cos(angle); double wallHeight = this.screenHeight * height / z; double bottom = this.screenHeight / 2 * (1 + 1/z); return new Wall(bottom - wallHeight, wallHeight); }
fac9d620-f9a6-4d20-ac0e-828e86dfaaee
public void gameKeyDown(int k) { switch(k) { case KeyEvent.VK_LEFT: controls.keyLeft = true; break; case KeyEvent.VK_RIGHT: controls.keyRight = true; break; case KeyEvent.VK_UP: controls.keyUp = true; break; case KeyEvent.VK_DOWN: controls.keyDown = true; break; case KeyEvent.VK_...
d5f0fd01-f365-45ea-b760-28c87dd52a80
public void gameKeyUp(int k) { switch(k) { case KeyEvent.VK_LEFT: controls.keyLeft = false; break; case KeyEvent.VK_RIGHT: controls.keyRight = false; break; case KeyEvent.VK_UP: controls.keyUp = false; break; case KeyEvent.VK_DOWN: controls.keyDown = false; break; case KeyEvent.VK...
dcf4c718-63ef-4945-9934-03a47a4b022a
public Wall() {}
b6eda0ca-4f0d-483e-b12d-843c26528bfc
public Wall(double _top, double _height) { top = (int)Math.ceil(_top); height = (int)Math.ceil(_height); }
184444bb-076f-44b5-8041-d0f4903a3239
public ControlState() { }
40fb2a00-9ef6-4537-90b9-f1bc34af83ab
public Graphics2D graphics() { return g2d; }
8a1ea73c-c3ae-4b21-994f-760a6ad76961
abstract void gameUpdate();
8512a828-860d-4c90-ade6-6b3acf30a56e
abstract void gameDraw(double interpolation);
a145b644-3447-4004-8ae5-f86362ea46e3
abstract void gameKeyDown(int keyCode);