blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 132
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 28
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
352
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
61245e5d3ab26b2ba3ab68b47bc7e12fb3409f5e
|
d5d677f8cbdeda52539d3e87c2385dba7cb11d15
|
/src/meal/menu/topping/Guaccamole.java
|
588078c41c45bcdf9343a8a4c035fd8817682163
|
[] |
no_license
|
anhkhoido/RestaurantSimulator
|
e058ef0bde27ff3990449d1a73eb88c91e2acf30
|
ebb87926997ceac92049b70395bd6864eba00591
|
refs/heads/master
| 2023-02-14T03:31:27.024382
| 2021-01-15T22:15:55
| 2021-01-15T22:15:55
| 329,380,886
| 0
| 0
| null | 2021-01-15T22:15:56
| 2021-01-13T17:21:30
|
Java
|
UTF-8
|
Java
| false
| false
| 521
|
java
|
package meal.menu.topping;
import meal.Meal;
public class Guaccamole extends ToppingDecorator {
private Meal meal;
public Guaccamole(Meal meal) {
this.meal = meal;
}
public Meal getMeal() {
return meal;
}
public void setMeal(Meal meal) {
this.meal = meal;
}
@Override
public String getDescription() {
return meal.getDescription() + " Guaccamole,";
}
@Override
public double getPrice() {
return meal.getPrice() + 0.50;
}
}
|
[
"anhkhoido@gmail.com"
] |
anhkhoido@gmail.com
|
589c059b90c644bddde9362f30644a2301ff5cdf
|
47127cddd954336a49c881d7abf591c53f18e12f
|
/src/com/_520/spring/createBean/factoryBean/Cat4.java
|
608d472419e39db862e2f43222385aef6175bf34
|
[] |
no_license
|
Werdio66/spring-hello1
|
2f9bf65cad1fb9fedf89d53774c6898947dbe43e
|
538b21114f908a5a6dfa9c3dbb1db96f5c10050a
|
refs/heads/master
| 2022-12-22T19:36:13.248104
| 2019-10-21T09:39:22
| 2019-10-21T09:39:22
| 216,531,514
| 0
| 0
| null | 2022-12-16T04:40:20
| 2019-10-21T09:39:13
|
Java
|
UTF-8
|
Java
| false
| false
| 75
|
java
|
package com._520.spring.createBean.factoryBean;
public class Cat4 {
}
|
[
"1171472801@qq.com"
] |
1171472801@qq.com
|
cea1cf370f68cb6d0a82e3c14bbed641b27ded66
|
6cfcae621353075f528bc8efce4038b4da0ecfca
|
/Hospital_Fixed_Asset_Management_System/src/main/java/domain/T_Depreciationmethod.java
|
fc6a5284c16e6af08e64625bc3d78512cc538cf4
|
[] |
no_license
|
yuanguojie/new1
|
83da3fbc1a0188b2398213b1fd178c8110150ecc
|
05d22d0275d4c459c906de8a67e47827f863f63f
|
refs/heads/master
| 2022-12-23T19:33:19.128059
| 2020-04-06T13:16:13
| 2020-04-06T13:16:13
| 135,657,848
| 0
| 0
| null | 2022-12-16T04:23:58
| 2018-06-01T02:29:23
|
CSS
|
UTF-8
|
Java
| false
| false
| 739
|
java
|
package domain;
public class T_Depreciationmethod {
private Integer id;
private String name;
private String func;
private String operation;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getFunc() {
return func;
}
public void setFunc(String func) {
this.func = func == null ? null : func.trim();
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
}
|
[
"2279884298@qq.com"
] |
2279884298@qq.com
|
fe1c14436248bd1f2b7dda9b480c706197259ae3
|
53f03930656a675ad689e5538f14b2bbba8c03b7
|
/src/main/java/com/ycit/manage/security/AppUserFilter.java
|
c56b4df93d6376940d35b6a79689d985fc013487
|
[] |
no_license
|
ycit/manage
|
09b9b384afd007c679c8fa789d44a6da106d567a
|
063fc75d74e00fc3c7d637449f6a36382222d891
|
refs/heads/master
| 2020-03-14T02:11:33.247165
| 2018-05-18T09:41:56
| 2018-05-18T09:41:56
| 131,394,300
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 736
|
java
|
package com.ycit.manage.security;
import org.apache.shiro.web.filter.authc.UserFilter;
import org.apache.shiro.web.util.WebUtils;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
/**
* 应用 用户 未认证处理
*
* @author xlch
* @Date 2018-03-21 12:36
*/
public class AppUserFilter extends UserFilter {
private static final String ERROR_JSON = "{\"code\":401,\"url\":\"%s\"}";
@Override
protected boolean onAccessDenied(ServletRequest req, ServletResponse response) throws Exception {
HttpServletResponse httpResponse = WebUtils.toHttp(response);
httpResponse.sendRedirect("/back/login");
return false;
}
}
|
[
"chenxl@vastio.com"
] |
chenxl@vastio.com
|
ea9c8523674aeadb457a2855a7619405f1ad00ad
|
f4284127785246fb45e07a34dcf27b81659391a2
|
/src/mesSources/interfaceGraphique/Marqueur.java
|
5c63260b18305ffa1da7b8be92daacfd0a689bfc
|
[] |
no_license
|
tsnobip/ProjetBanc
|
0c2937d0757e7f16381f97110b05a8d3a899b201
|
146639fe42476bd0a26a0a2fd5fc3a9a8570e5fc
|
refs/heads/master
| 2021-01-19T07:42:42.792753
| 2012-11-04T15:27:31
| 2012-11-04T15:27:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,118
|
java
|
package mesSources.interfaceGraphique;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Image;
//import astro
import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import com.bbn.openmap.app.Main;
import mesSources.model.Circle;
import mesSources.model.Point;
public class Marqueur extends ImageIcon{
private final static String ICON_NORMAL_PATH="green";
private final static String ICON_CLICKED_PATH="green-dot";
private final String ICON_SHADOW_PATH="shadow";
private boolean SHADOWED=false;
//X-Y Coordinates visually pointed by he marker
private int X;
private int Y;
// X-Y Coordinates of the upper-left corner of the marker
private int X_CORNER;
private int Y_CORNER;
// Lat-Lon Coordinates visually pointed by the marker
private int X_GEO;
private int Y_GEO;
private PopUp_Frame pop;
public enum state{NORMAL,CLICKED}
public Marqueur(int X_GEO,int Y_GEO){
super(MainLoader.class.getResource("/"+ICON_NORMAL_PATH+".png"));
// new Image(MainLoader.class.getResource("/"+ICON_NORMAL_PATH+".png")
this.setImage(new ImageIcon(MainLoader.class.getResource("/"+ICON_NORMAL_PATH+".png")).getImage());
this.X_GEO=X_GEO;
this.Y_GEO=Y_GEO;
// La on met ta fonction de calcul
this.X=this.X_GEO;
this.Y=this.Y_GEO;
X_CORNER= X-(this.getIconWidth()/2);
Y_CORNER=Y-this.getIconHeight();
}
public void setPopUp(boolean display, JDesktopPane desk){
if (display) {
pop = new PopUp_Frame(X,Y);
pop.pack();
pop.setFrameIcon(null);
// JInternalFrame
// pop.putClientProperty("JInternalFrame.isPalette", true);
desk.add(pop,JDesktopPane.PALETTE_LAYER);
pop.setVisible(true);
} else {
pop.setVisible(false);
}
}
public boolean isSHADOWED() {
return SHADOWED;
}
public void setSHADOWED(boolean sHADOWED) {
SHADOWED = sHADOWED;
}
public void setState(state state){
switch (state){
case CLICKED:this.setImage(new ImageIcon(MainLoader.class.getResource("/"+ICON_CLICKED_PATH+".png")).getImage());
SHADOWED=true;
break;
case NORMAL:this.setImage(new ImageIcon(MainLoader.class.getResource("/"+ICON_NORMAL_PATH+".png")).getImage());
SHADOWED=false;
break;
}
}
public void paintIcon(Component c, Graphics g) {
if(SHADOWED){
new ImageIcon(MainLoader.class.getResource("/"+ICON_SHADOW_PATH+".png")).paintIcon(c, g, X_CORNER, Y_CORNER);
}
paintIcon(c, g, X_CORNER, Y_CORNER);
}
public boolean isClickIn(int x_click,int y_click){
Circle cir=new Circle(new Point(X, Y-(23*(this.getIconHeight()/32))), (this.getIconWidth()/2)-6);
return cir.contains(new Point(x_click, y_click));
}
public int getY() {
return Y;
}
public int getX() {
return X;
}
public void setY(int y) {
Y = y;
}
public int getX_CORNER() {
X_CORNER= X-(this.getIconWidth()/2);
return X_CORNER;
}
public int getY_CORNER() {
Y_CORNER=Y-this.getIconHeight();
return Y_CORNER;
}
public void setX(int x) {
X = x;
}
}
|
[
"Ulysse PRYGIEL@pc-ulybu"
] |
Ulysse PRYGIEL@pc-ulybu
|
7f0572396e4626278cb5ffa358629052a55548b1
|
49359f499b7ed1a82a2c8ffca5e4531ff99b4448
|
/app/src/main/java/pro/games_box/weatherviewer/api/ApiError.java
|
1de9e70fe3eb5414097a2a4fbf637614e84cbc7a
|
[] |
no_license
|
Jokaerro/WeatherViewer
|
a590653c7564396933fa0c1543a0e5efea2b0b1b
|
cc80eb029d9cde98bbf6aecaef9c525472b819d5
|
refs/heads/master
| 2021-01-19T06:22:11.983633
| 2017-04-20T12:02:06
| 2017-04-20T12:02:06
| 87,457,145
| 0
| 0
| null | 2017-04-13T20:39:15
| 2017-04-06T17:35:16
|
Java
|
UTF-8
|
Java
| false
| false
| 407
|
java
|
package pro.games_box.weatherviewer.api;
import com.google.gson.annotations.Expose;
/**
* Created by TESLA on 06.04.2017.
*/
public class ApiError {
@Expose
private String message;
@Expose
private String description;
public ApiError() {
}
public String getMessage() {
return message;
}
public String getDescription(){
return description;
}
}
|
[
"korvin7.64@gmail.com"
] |
korvin7.64@gmail.com
|
0aff2499ba4e186d93f662acddb7ada4940a2792
|
ec537e378965588e65b3e329960e15c801de786d
|
/src/main/java/com/brightsdiamonds/domain/StaticImage.java
|
3b62be56df7cae77fa4820caffa956f275f6544a
|
[] |
no_license
|
dhoang132/brightsdiamonds
|
98f5da8e18088b867f6ae6b9013520a975373aa7
|
4525b28e833782e8ef9db25c14691f8f6b003bfe
|
refs/heads/master
| 2022-12-21T20:29:26.657735
| 2019-08-26T01:22:40
| 2019-08-26T01:22:40
| 144,410,068
| 0
| 0
| null | 2022-12-16T11:31:03
| 2018-08-11T18:41:46
|
Java
|
UTF-8
|
Java
| false
| false
| 832
|
java
|
package com.brightsdiamonds.domain;
public class StaticImage {
private int id;
private byte[] imageData;
private String fileName;
public int getId() {
return id;
}
public StaticImage() {
super();
}
public StaticImage(int id, byte[] imageData, String fileName) {
super();
this.id = id;
this.imageData = imageData;
this.fileName = fileName;
}
public void setId(int id) {
this.id = id;
}
public byte[] getImageData() {
return imageData;
}
public void setImageData(byte[] imageData) {
this.imageData = imageData;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
@Override
public String toString() {
return "ProductImage [id=" + id + ", imageData=" + imageData + ", fileName=" + fileName + "]";
}
}
|
[
"dhoang132@yahoo.com"
] |
dhoang132@yahoo.com
|
4ec79f13fc84cdc7541368f0ffa8c12ff1d59453
|
c55a8144442ce1ed9f7929be7d6293ebf276f51e
|
/Game3/src/sui/event/MouseAdapter.java
|
4e3352519a4de87c39b74857e07353d5bb3cd6f5
|
[] |
no_license
|
EricEidel/Game3
|
fcb13c46bdfe778ddfd397ad7251a008f1190be4
|
399175d86ffd4c8b8d17ed6f73087c47d9dbefd8
|
refs/heads/master
| 2021-01-10T19:39:04.121899
| 2013-07-27T05:15:25
| 2013-07-27T05:15:25
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,556
|
java
|
package sui.event;
/**
* A convenience class for MouseListener which receives
* mouse events. Implementation of these methods are optional.
*
*
* @author davedes
* @since b.0.2
*/
public class MouseAdapter implements MouseListener {
/**
* Notification that the mouse has moved.
*
* @param e the event associated with this listener
*/
public void mouseMoved(MouseEvent e) {}
/**
* Notification that the mouse has been dragged.
* Dragging the mouse will not call a mouseMoved
* event, and will instead call mouseDragged.
*
* @param e the event associated with this listener
*/
public void mouseDragged(MouseEvent e) {}
/**
* Notification that the mouse has been pressed.
*
* @param e the event associated with this listener
*/
public void mousePressed(MouseEvent e) {}
/**
* Notification that the mouse has been released.
*
* @param e the event associated with this listener
*/
public void mouseReleased(MouseEvent e) {}
/**
* Notification that the mouse has entered the bounds
* of the component.
*
* @param e the event associated with this listener
*/
public void mouseEntered(MouseEvent e) {}
/**
* Notification that the mouse has exited the bounds
* of the component.
*
* @param e the event associated with this listener
*/
public void mouseExited(MouseEvent e) {}
}
|
[
"Eric Big Pc"
] |
Eric Big Pc
|
6df6384414bd29f3f51ae8b6fbb58ecb3204a135
|
9100ac076370edee44b778d4d67c22cab4192088
|
/workspace/day02/src/com/igeek/array/ArrayTest2.java
|
ebc9010a2bd2d3896943c8f9269908d0744d346e
|
[] |
no_license
|
easemeng/java
|
a515514b83da288cda18c74bb2a45c037d263579
|
dcc5a27b0b60a33ce1e5063b4eb244f2287dcbaa
|
refs/heads/master
| 2020-04-09T02:33:28.580362
| 2018-12-17T13:13:59
| 2018-12-17T13:13:59
| 159,945,154
| 2
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 318
|
java
|
package com.igeek.array;
public class ArrayTest2 {
@SuppressWarnings("unused")
public static void main(String[] args) {
//二维数组 。 动态的创建方式 。
int [][] arrays = new int[2][3];
//里面嵌套N个一维数组 。 {1,2,3}
int [][] staticArrays = {{1,2,3},{1,2,3},{1,2,3}};
}
}
|
[
"zj0303ym@qq.com"
] |
zj0303ym@qq.com
|
f2754aa3a913d818490dbcc16c2b30083fd82b0a
|
a3f980d6fdbf77522879cf367362781c2c22a723
|
/app/src/main/java/com/example/tugasakhir/Simpleton.java
|
0364615cb82477b3b9300a69f865adacbed3a66c
|
[] |
no_license
|
metatoda42/Quotes_Kelompok-9
|
73581e909abaf401ff6d39a2bf94fb14d2d9f4e4
|
23b1dca71461948564ba6eff14f17c6e150cae9c
|
refs/heads/master
| 2023-06-02T15:58:32.750266
| 2021-06-23T15:47:53
| 2021-06-23T15:47:53
| 376,688,379
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,191
|
java
|
package com.example.tugasakhir;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.LruCache;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
public class Simpleton {
private static Simpleton instance;
private RequestQueue requestQueue;
private static Context ctx;
private Simpleton(Context context) {
ctx = context;
requestQueue = getRequestQueue();
}
public static synchronized Simpleton getInstance(Context context) {
if (instance == null) {
instance = new Simpleton(context);
}
return instance;
}
public RequestQueue getRequestQueue() {
if (requestQueue == null) {
// getApplicationContext() is key, it keeps you from leaking the
// Activity or BroadcastReceiver if someone passes one in.
requestQueue = Volley.newRequestQueue(ctx.getApplicationContext());
}
return requestQueue;
}
public <T> void addToRequestQueue(Request<T> req) {
getRequestQueue().add(req);
}
}
|
[
"72773349+metatoda42@users.noreply.github.com"
] |
72773349+metatoda42@users.noreply.github.com
|
2dc4d2a1f6c60a5d67a9c8fccb4ec1c9bc03a293
|
6d09a2af96afe5e87b11d7161c474aa6fd745199
|
/springboot/spring-boot-logging/src/main/java/com/example/springbootlogging/SpringBootLoggerController.java
|
7b7bd8ff5450a3a16e15f2665844ded8bd0ed4b7
|
[] |
no_license
|
umeshwale/code-playarea
|
5228698a4ea93c4656becdf6a90d0fb6ab1fc72a
|
7de3835d9213ee51f693f55e2a7b11b85c1d542b
|
refs/heads/master
| 2023-08-03T18:13:18.460724
| 2021-09-27T06:21:32
| 2021-09-27T06:21:32
| 297,268,862
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 664
|
java
|
package com.example.springbootlogging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SpringBootLoggerController {
Logger logger = LoggerFactory.getLogger(SpringBootLoggerController.class);
@RequestMapping(value = "/log")
public String getLogs() {
logger.debug("DEBUG Logs");
logger.trace("TRACE Logs");
logger.info("INFO Logs");
logger.error("ERROR Logs");
logger.warn("WARN Logs");
return "Logs will be displayed on console";
}
}
|
[
"upwale@gmail.com"
] |
upwale@gmail.com
|
062a0dddba15b33f04f3121fbc8fb7160d30a8c0
|
d7101799b482e51b9460962220db8826550a1488
|
/app/src/main/java/com/doransoft/np/homeservice/modules/main/fragments/serviceDetails/di/ServiceDetailModule.java
|
025b8241c8be81c285d19b5dd3331670db1255f1
|
[] |
no_license
|
puja110/Home-service-application-mvp-apis
|
dca2221a8fc369e2beba3b6e61ba469aba4309c2
|
b83b63445475c55cf4138023942724101996e6d0
|
refs/heads/master
| 2020-04-09T12:12:04.520956
| 2018-12-06T07:56:34
| 2018-12-06T07:56:34
| 160,339,571
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,679
|
java
|
package com.doransoft.np.homeservice.modules.main.fragments.serviceDetails.di;
import android.support.v7.app.AppCompatActivity;
import com.doransoft.np.homeservice.application.network.AppNetwork;
import com.doransoft.np.homeservice.helper.PreferencesManager;
import com.doransoft.np.homeservice.helper.SchedulerProvider;
import com.doransoft.np.homeservice.modules.main.fragments.service.di.ServiceScope;
import com.doransoft.np.homeservice.modules.main.fragments.serviceDetails.mvp.ServiceDetailInteractor;
import com.doransoft.np.homeservice.modules.main.fragments.serviceDetails.mvp.ServiceDetailPresenter;
import com.doransoft.np.homeservice.modules.main.fragments.serviceDetails.mvp.ServiceDetailView;
import dagger.Module;
import dagger.Provides;
@Module
public class ServiceDetailModule {
public final AppCompatActivity activity;
public ServiceDetailModule(AppCompatActivity activity) {
this.activity = activity;
}
@ServiceDetailScope
@Provides
ServiceDetailView provideServiceDetailView() {
return new ServiceDetailView(activity);
}
@Provides
@ServiceDetailScope
ServiceDetailPresenter provideServiceDetailPresenter(SchedulerProvider schedulerProvider, ServiceDetailView serviceDetailView, ServiceDetailInteractor serviceDetailInteractor){
return new ServiceDetailPresenter(activity,schedulerProvider,serviceDetailView,serviceDetailInteractor);
}
@Provides
@ServiceDetailScope
ServiceDetailInteractor provideServiceDetailInteractor(PreferencesManager preferencesManager, AppNetwork appNetwork){
return new ServiceDetailInteractor(preferencesManager,appNetwork);
}
}
|
[
"csta.puja@gmail.com"
] |
csta.puja@gmail.com
|
508c687784fa4f92e84194849c9e3683fd9f2a61
|
14b389df8efcde6eb5c043bd9afec6c9772d03dd
|
/src/day21/test10/MyAnno2.java
|
de56471be19a17d5fcd84faebd57772f9b353131
|
[] |
no_license
|
if123456/work
|
3ea03fd5722e2ed125c31f875aa0023848addbec
|
26258d5563135cee402bef2fd68f98183ac2f498
|
refs/heads/master
| 2020-12-11T08:24:24.900033
| 2020-01-18T09:28:18
| 2020-01-18T09:28:18
| 233,799,873
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 312
|
java
|
package day21.test10;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface MyAnno2 {
String type() default "java";
}
|
[
"l"
] |
l
|
86e2dc5aedb0c1d746988704cf74bd5e59ce8170
|
545544a7b0989f5ae399b2a8c043665b14ceda69
|
/src/Uri/_8_Mearch/PlayingCricket/CricketMain.java
|
d070b1fa2e5a6b593f1ff447291247b49f9f21b0
|
[] |
no_license
|
uzzal-mondal/Uri_Problem_Solve
|
13367367eedd3cb8dfbc5dbe50f475a8566dfddb
|
3e89a894fb2cd62ee444e5880829e840cd4959ef
|
refs/heads/main
| 2023-07-25T08:14:37.265180
| 2021-06-19T14:18:13
| 2021-06-19T14:18:13
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,668
|
java
|
package Uri._8_Mearch.PlayingCricket;
import java.util.Random;
public class CricketMain {
public static void main(String[] args) {
System.out.println("Mirpur National Stadium");
Player p1 = new Player();
p1.setName("Mash");
p1.setTeam("Bangladesh");
Player p2 = new Player();
p2.setName("David Warner");
p2.setTeam("Australia");
//toss.
Random toss = new Random();
int tossValue = toss.nextInt(2);
// System.out.println(tossValue);
if (tossValue == 1) {
System.out.println(p1.getName() + " Won the Toss.");
} else {
System.out.println(p2.getName() + " Won the Toss.");
}
//make choose.
Random choose = new Random();
int batOrBall = choose.nextInt(2);
if (batOrBall == 1) {
switch (tossValue) {
case 0:
System.out.println(p2.getTeam() + " decided to Bat first.");
for (int i = 0; i < 6; i++) {
p2.over = new int[6];
p2.over[i] = choose.nextInt(7);
p2.score = p2.score + p2.over[i];
System.out.println(p2.getName() + " Total score is " + p2.score);
}
System.out.println(p1.getName() + "need " + " Total score is " + (p2.score + 1) + "runs to win");
for (int i = 0; i < 6; i++) {
p1.over = new int[6];
p1.over[i] = choose.nextInt(7);
p1.score = p1.score + p1.over[i];
System.out.println(p1.getName() + " Total score is " + p1.score);
if (p1.score > p2.score) {
System.out.println(p1.getName() + " won the match");
break;
}
}
if (p1.score < p2.score) {
System.out.println(p2.getName() + " won the match");
break;
}
break;
default:
System.out.println(p1.getTeam() + " decided to Bat first.");
for (int i = 0; i < 6; i++) {
p1.over = new int[6];
p1.over[i] = choose.nextInt(7);
p1.score = p2.score + p2.over[i];
System.out.println(p1.getName() + " Total score is " + p1.score);
}
System.out.println(p1.getName() + "need " + " Total score is " + (p1.score + 1) + "runs to win");
for (int i = 0; i < 6; i++) {
p2.over = new int[6];
p2.over[i] = choose.nextInt(7);
p2.score = p1.score + p1.over[i];
System.out.println(p2.getName() + " Total score is " + p2.score);
if (p2.score > p1.score) {
System.out.println(p2.getName() + " won the match");
break;
}
}
if (p1.score < p2.score) {
System.out.println(p1.getName() + " won the match");
break;
}
break;
}
} else {
switch (tossValue) {
case 0:
System.out.println(p2.getTeam() + " decided to Bowl first.");
for (int i = 0; i < 6; i++) {
p1.over = new int[6];
p1.over[i] = choose.nextInt(7);
p1.score = p1.score + p1.over[i];
System.out.println(p2.getName() + " Total score is " + p1.score);
}
System.out.println(p1.getName() + " need " + " Total score is " + (p1.score + 1) + "runs to win");
break;
default:
System.out.println(p1.getTeam() + " decided to Bowl first.");
for (int i = 0; i < 6; i++) {
p2.over = new int[6];
p2.over[i] = choose.nextInt(7);
p2.score = p2.score + p2.over[i];
System.out.println(p2.getName() + " Total score is " + p2.score);
}
System.out.println(p2.getName() + " need " + " Total score is " + (p2.score + 1) + "runs to win");
break;
}
}
}
}
|
[
"uzzalcontact@gmail.com"
] |
uzzalcontact@gmail.com
|
0af94cac68072310e1b567dff39dd16cf806983f
|
af97d7f325abe423dccbf7bf0f491dce5ad67cd9
|
/PscmWeb/src/main/java/com/banry/pscm/web/mvc/pscm/labour/LaborInOutController.java
|
8da296ec47dc70e15dedd7baae47ebe30fb0643a
|
[] |
no_license
|
csycxc/Pscm
|
016ea02b4ceffd116a0dd6be07525ee8df617632
|
e2045acd8d321f50e5d8a90856c0d990dad27bda
|
refs/heads/master
| 2020-04-09T22:54:38.348631
| 2018-12-06T08:20:28
| 2018-12-06T08:20:28
| 160,642,202
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 10,127
|
java
|
package com.banry.pscm.web.mvc.pscm.labour;
import com.alibaba.fastjson.JSON;
import com.banry.pscm.service.contract.ContractService;
import com.banry.pscm.service.labour.LaborInOut;
import com.banry.pscm.service.labour.LaborInOutService;
import com.banry.pscm.service.labour.LaborInOutWithBLOBs;
import com.banry.pscm.service.util.ContractAtt;
import com.banry.pscm.service.util.ContractAttService;
import com.banry.pscm.service.util.UtilException;
import com.banry.pscm.web.mvc.model.DataTableModel;
import com.banry.pscm.web.utils.SystemConstants;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@Controller
@RequestMapping("/laborInOut")
public class LaborInOutController {
@Autowired
private LaborInOutService laborInOutService;
@Autowired
private ContractService contractService;
@Autowired
private SystemConstants constants;
@Autowired
private ContractAttService contractAttService;
private static Logger log = LoggerFactory.getLogger(LaborInOutController.class);
@RequestMapping(value = "/deleteLaborInOut", method = RequestMethod.POST)
@ResponseBody
public int deleteLaborInOutByInId(HttpServletRequest request, String inId,String inIdPhoto) {
//附件不为空时先删除附件
if(inIdPhoto != null && !"".equals(inIdPhoto)){
deleteContractAtt(inIdPhoto);
}
return laborInOutService.deleteLaborInOutByInId(inId);
}
@RequestMapping(value = "/selectLaborInOutsByTrainCode", method = RequestMethod.GET)
@ResponseBody
public Object selectLaborsByTrainCode(String trainCode) {
DataTableModel dt = new DataTableModel();
List<HashMap> list = laborInOutService.selectLaborInOutsByTrainCode(trainCode);
dt.setData(list);
return dt;
}
/**
* 删除照片 表(contract_att)中的记录,和磁盘上的附件
* @param deleteFileName
*/
public void deleteContractAtt(String deleteFileName){
String ids[] = deleteFileName.split(",");
for (String id : ids) {
List<ContractAtt> list = null;
try {
list = contractAttService.findByFileInNames(id);
if(list.size()>0){
String fileName = list.get(0).getFileInName()+list.get(0).getType();//待删除的文件名
String filePath = constants.getUploadDirReal() + constants.getAttach() + fileName;
File file = new File(filePath);
if(file.exists()){ file.delete(); }else{
log.info("硬盘上该文件不存在,删除失败!");
}
}
contractAttService.deleteContractAtt(id);
} catch (UtilException e) {
e.printStackTrace();
}
}
}
@RequestMapping(value = "/getLaborInOutByDownContractCodeOrTrainCode", method = RequestMethod.GET)
@ResponseBody
public Object getLaborInOutByDownContractCodeOrTrainCode(String downContractCode,String trainCode) {
log.info("downContractCode==============="+downContractCode);
log.info("trainCode==============="+trainCode);
DataTableModel dt = new DataTableModel();
List<HashMap> list = new ArrayList<HashMap>();
if(downContractCode == null || "".equals(downContractCode) || "undefined".equals(downContractCode)){
dt.setData(list);
return dt;
}
if(trainCode == null || "".equals(trainCode) || "undefined".equals(trainCode))
list = laborInOutService.getLaborInOutByDownContractCode(downContractCode);
else
list = laborInOutService.getLaborInOutByTrainCode(trainCode);
dt.setData(list);
return dt;
}
@RequestMapping(value = "/getLaborInOutForWorkAttendance", method = RequestMethod.GET)
@ResponseBody
public Object getLaborInOutForWorkAttendance(String downContractCode,String trainCode,String inOrOut) {
log.info("downContractCode==============="+downContractCode+"trainCode="+trainCode+"inOrOut="+inOrOut);
DataTableModel dt = new DataTableModel();
List<HashMap> list = null;
if(downContractCode == null || "".equals(downContractCode) || "undefined".equals(downContractCode)){
dt.setData(list);
return dt;
}
if(trainCode == null || "".equals(trainCode) || "undefined".equals(trainCode))
list = laborInOutService.getLaborInOutByDownContractCodeAndInOrOut(downContractCode,inOrOut);
else
list = laborInOutService.getLaborInOutByTrainCodeAndInOrOut(trainCode,inOrOut);
dt.setData(list);
return dt;
}
@RequestMapping(value = "/saveLaborInOutOfReamrk", method = RequestMethod.POST)
@ResponseBody
public int saveLaborInOutOfReamrk(String inId,String reamrk) {
LaborInOutWithBLOBs labor = new LaborInOutWithBLOBs();
labor.setInId(inId);
labor.setReamrk(reamrk);
return laborInOutService.updateLaborInOutSelective(labor);
}
@RequestMapping(value = "/saveLaborInOutLetIn", method = RequestMethod.POST)
@ResponseBody
public int saveLaborInOutLetIn(@RequestBody String jsonData) {
log.info("jsonData======"+jsonData);
//{'laborInOutList':[{"inId":"1542676429422","examScore":90,"inDate":""},{"inId":"1542763444642","examScore":55,"inDate":""}]}
JSONObject jsonObj = JSONObject.fromObject(jsonData);
JSONArray jsonArray = (JSONArray) jsonObj.get("laborInOutList");
List<LaborInOutWithBLOBs> list = new ArrayList<LaborInOutWithBLOBs>();
for (int i=0; i < jsonArray.size(); i++) {
LaborInOutWithBLOBs laborInOutWithBLOBs = new LaborInOutWithBLOBs();
JSONObject jsonObject = jsonArray.getJSONObject(i);
String inDate = jsonObject.getString("inDate");
laborInOutWithBLOBs.setInId(jsonObject.getString("inId"));
Double examScore = null;
if(jsonObject.getString("examScore") != null && !"".equals(jsonObject.getString("examScore"))){
examScore = Double.parseDouble(jsonObject.getString("examScore"));
laborInOutWithBLOBs.setExamScore(examScore);
}
if((examScore != null && examScore>60)&&(inDate == null || "".equals(inDate))){
list.add(laborInOutWithBLOBs);
}
}
if(list.size()>0){
return laborInOutService.letInLaborInOut(list);
}else{
return 0;
}
}
@RequestMapping(value = "/singleLaborInOutForOut", method = RequestMethod.POST)
@ResponseBody
public Object singleLaborInOutForOut(String inId) {
log.info("inId======"+inId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
LaborInOutWithBLOBs oldLaborInOut = laborInOutService.selectLaborInOutById(inId);
if(oldLaborInOut != null && (oldLaborInOut.getOutDate() == null || "".equals(oldLaborInOut.getOutDate()))){
Date date = new Date();
LaborInOutWithBLOBs laborInOut = new LaborInOutWithBLOBs();
laborInOut.setInId(inId);
laborInOut.setOutDate(date);
laborInOutService.updateLaborInOutSelective(laborInOut);
return JSON.parse("{outDate: '"+sdf.format(date)+"'}");
}else{
return JSON.parse("{outDate:''}");
}
}
@RequestMapping(value = "/singleLaborInOutForIn", method = RequestMethod.POST)
@ResponseBody
public Object singleLaborInOutForIn(String inId) {
log.info("inId======"+inId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
LaborInOutWithBLOBs oldLaborInOut = laborInOutService.selectLaborInOutById(inId);
if(
oldLaborInOut != null && (oldLaborInOut.getInDate() == null || "".equals(oldLaborInOut.getInDate())) &&
(oldLaborInOut.getExamScore() != null && !"".equals(oldLaborInOut.getExamScore())&&oldLaborInOut.getExamScore() > 60)
){
Date date = new Date();
LaborInOutWithBLOBs laborInOut = new LaborInOutWithBLOBs();
laborInOut.setInId(inId);
laborInOut.setInDate(date);
laborInOutService.updateLaborInOutSelective(laborInOut);
return JSON.parse("{inDate: '"+sdf.format(date)+"'}");
}else{
return JSON.parse("{inDate:''}");
}
}
@RequestMapping(value = "/saveLaborInOutLetOut", method = RequestMethod.POST)
@ResponseBody
public int saveLaborInOutLetOut(@RequestBody String jsonData) {
log.info("jsonData======"+jsonData);
JSONObject jsonObj = JSONObject.fromObject(jsonData);
JSONArray jsonArray = (JSONArray) jsonObj.get("laborInOutList");
List<LaborInOutWithBLOBs> list = new ArrayList<LaborInOutWithBLOBs>();
for (int i=0; i < jsonArray.size(); i++) {
LaborInOutWithBLOBs laborInOutWithBLOBs = new LaborInOutWithBLOBs();
JSONObject jsonObject = jsonArray.getJSONObject(i);
String outDate = jsonObject.getString("outDate");
laborInOutWithBLOBs.setInId(jsonObject.getString("inId"));
if(outDate == null || "".equals(outDate)){
list.add(laborInOutWithBLOBs);
}
}
if(list.size()>0){
return laborInOutService.letOutLaborInOut(list);
}else{
return 0;
}
}
}
|
[
"chensy@banry.com.cn"
] |
chensy@banry.com.cn
|
6d381f83ee8c2e238ec15885cb0a051187b66c39
|
c80f25f9c8faa1ea9db5bb1b8e36c3903a80a58b
|
/laosiji-sources/feng/android/sources/com/meizu/cloud/pushsdk/networking/internal/SynchronousCall.java
|
4fac84c0756f4631d474edbefcd9259b02d4af51
|
[] |
no_license
|
wenzhaot/luobo_tool
|
05c2e009039178c50fd878af91f0347632b0c26d
|
e9798e5251d3d6ba859bb15a00d13f085bc690a8
|
refs/heads/master
| 2020-03-25T23:23:48.171352
| 2019-09-21T07:09:48
| 2019-09-21T07:09:48
| 144,272,972
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,249
|
java
|
package com.meizu.cloud.pushsdk.networking.internal;
import com.feng.car.utils.FengConstant;
import com.meizu.cloud.pushsdk.networking.common.ANRequest;
import com.meizu.cloud.pushsdk.networking.common.ANResponse;
import com.meizu.cloud.pushsdk.networking.common.ResponseType;
import com.meizu.cloud.pushsdk.networking.error.ANError;
import com.meizu.cloud.pushsdk.networking.http.Response;
import com.meizu.cloud.pushsdk.networking.utils.SourceCloseUtil;
import com.meizu.cloud.pushsdk.networking.utils.Utils;
public final class SynchronousCall {
private SynchronousCall() {
}
public static <T> ANResponse<T> execute(ANRequest request) {
switch (request.getRequestType()) {
case 0:
return executeSimpleRequest(request);
case 1:
return executeDownloadRequest(request);
case 2:
return executeUploadRequest(request);
default:
return new ANResponse(new ANError());
}
}
private static <T> ANResponse<T> executeSimpleRequest(ANRequest request) {
ANResponse<T> response;
Response okHttpResponse = null;
try {
okHttpResponse = InternalNetworking.performSimpleRequest(request);
if (okHttpResponse == null) {
response = new ANResponse(Utils.getErrorForConnection(new ANError()));
} else if (request.getResponseAs() == ResponseType.OK_HTTP_RESPONSE) {
response = new ANResponse((Object) okHttpResponse);
response.setOkHttpResponse(okHttpResponse);
SourceCloseUtil.close(okHttpResponse, request);
} else if (okHttpResponse.code() >= FengConstant.SINGLE_IMAGE_MAX_WIDTH) {
response = new ANResponse(Utils.getErrorForServerResponse(new ANError(okHttpResponse), request, okHttpResponse.code()));
response.setOkHttpResponse(okHttpResponse);
SourceCloseUtil.close(okHttpResponse, request);
} else {
response = request.parseResponse(okHttpResponse);
response.setOkHttpResponse(okHttpResponse);
SourceCloseUtil.close(okHttpResponse, request);
}
} catch (Throwable se) {
response = new ANResponse(Utils.getErrorForConnection(new ANError(se)));
} catch (Exception e) {
response = new ANResponse(Utils.getErrorForNetworkOnMainThreadOrConnection(e));
} finally {
SourceCloseUtil.close(okHttpResponse, request);
}
return response;
}
private static <T> ANResponse<T> executeDownloadRequest(ANRequest request) {
try {
Response okHttpResponse = InternalNetworking.performDownloadRequest(request);
if (okHttpResponse == null) {
return new ANResponse(Utils.getErrorForConnection(new ANError()));
}
ANResponse<T> response;
if (okHttpResponse.code() >= FengConstant.SINGLE_IMAGE_MAX_WIDTH) {
response = new ANResponse(Utils.getErrorForServerResponse(new ANError(okHttpResponse), request, okHttpResponse.code()));
response.setOkHttpResponse(okHttpResponse);
return response;
}
response = new ANResponse((Object) "success");
response.setOkHttpResponse(okHttpResponse);
return response;
} catch (Throwable se) {
return new ANResponse(Utils.getErrorForConnection(new ANError(se)));
} catch (Exception e) {
return new ANResponse(Utils.getErrorForNetworkOnMainThreadOrConnection(e));
}
}
private static <T> ANResponse<T> executeUploadRequest(ANRequest request) {
ANResponse<T> response;
Response okHttpResponse = null;
try {
okHttpResponse = InternalNetworking.performUploadRequest(request);
if (okHttpResponse == null) {
response = new ANResponse(Utils.getErrorForConnection(new ANError()));
} else if (request.getResponseAs() == ResponseType.OK_HTTP_RESPONSE) {
response = new ANResponse((Object) okHttpResponse);
response.setOkHttpResponse(okHttpResponse);
SourceCloseUtil.close(okHttpResponse, request);
} else if (okHttpResponse.code() >= FengConstant.SINGLE_IMAGE_MAX_WIDTH) {
response = new ANResponse(Utils.getErrorForServerResponse(new ANError(okHttpResponse), request, okHttpResponse.code()));
response.setOkHttpResponse(okHttpResponse);
SourceCloseUtil.close(okHttpResponse, request);
} else {
response = request.parseResponse(okHttpResponse);
response.setOkHttpResponse(okHttpResponse);
SourceCloseUtil.close(okHttpResponse, request);
}
} catch (ANError se) {
response = new ANResponse(Utils.getErrorForConnection(se));
} catch (Exception e) {
response = new ANResponse(Utils.getErrorForNetworkOnMainThreadOrConnection(e));
} finally {
SourceCloseUtil.close(okHttpResponse, request);
}
return response;
}
}
|
[
"tanwenzhao@vipkid.com.cn"
] |
tanwenzhao@vipkid.com.cn
|
5c87f520605b2449b792b8a278f76a15ae9d9c3d
|
4cf861f36a14e9575703c98a99ee9db150310775
|
/bankroll-api/src/main/java/com/goldbao/bankroll/model/bankroll/BankrollRuleDay.java
|
9d2dbe0cf0d315a83e3c5c53daacecc67cf6b692
|
[] |
no_license
|
qiuxin-qx/bankroll-api
|
1b0710f639fe101bbbae81a21e97648eef816201
|
ed3cca0bc836e672f9ce99efe8e558df4e7dc15d
|
refs/heads/master
| 2021-01-10T04:52:34.417365
| 2016-03-25T09:45:38
| 2016-03-25T09:45:38
| 54,707,109
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,714
|
java
|
package com.goldbao.bankroll.model.bankroll;
import com.goldbao.bankroll.model.Model;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 配资规则 - 按天
*/
@Entity
@Table(name = "bk_bankroll_rule_day")
@AttributeOverride(name = "id", column = @Column(name = "rule_id"))
public class BankrollRuleDay extends Model implements Serializable {
/**
*
*/
private static final long serialVersionUID = 7767558094351830445L;
private Integer lever;
@Column(name = "warning_line")
private BigDecimal warningLine;
@Column(name = "open_line")
private BigDecimal openLine;
@Column(name = "min_use_days")
private Integer minUseDays;
@Column(name = "max_use_days")
private Integer maxUseDays;
@Column(name = "manage_fee_rate")
private BigDecimal manageFeeRate;
@Column(name = "max_money")
private BigDecimal maxMoney;
@ManyToOne(cascade = CascadeType.PERSIST)
@JoinColumn(name = "solution_id")
private BankrollSolutionDay solution;
/**
* 杠杆倍率
*/
public Integer getLever() {
return lever;
}
/**
* 杠杆倍率
*/
public void setLever(Integer lever) {
this.lever = lever;
}
/**
* 警告线,这里返回比例值,比如配资金额为1000元,警告线比例1.10
* 则警告线为1000*1.10 = 1100<br/>
* 最高不能超过2.00
*/
public BigDecimal getWarningLine() {
return warningLine;
}
/**
* 警告线,这里返回比例值,比如配资金额为1000元,警告线比例1.10
* 则警告线为1000*1.10 = 1100<br/>
* 最高不能超过2.00
*/
public void setWarningLine(BigDecimal warningLine) {
this.warningLine = warningLine;
}
/**
* 平仓线,这里返回比例值,比如配资金额为1000元,平仓线比例1.08<br/>
* 则平仓线为1000*1.08 = 1080<br/>
* 最高不能超过2.00
*/
public BigDecimal getOpenLine() {
return openLine;
}
/**
* 平仓线,这里返回比例值,比如配资金额为1000元,平仓线比例1.08<br/>
* 则平仓线为1000*1.08 = 1080<br/>
* 最高不能超过2.00
*/
public void setOpenLine(BigDecimal openLine) {
this.openLine = openLine;
}
/**
* 最少使用时间【天】
*/
public Integer getMinUseDays() {
return minUseDays;
}
/**
* 最少使用时间【天】
*/
public void setMinUseDays(Integer minUseDays) {
this.minUseDays = minUseDays;
}
/**
* 最多使用时间【天】
*/
public Integer getMaxUseDays() {
return maxUseDays;
}
/**
* 最多使用时间【天】
*/
public void setMaxUseDays(Integer maxUseDays) {
this.maxUseDays = maxUseDays;
}
/**
* 管理费率
*/
public BigDecimal getManageFeeRate() {
return manageFeeRate;
}
/**
* 管理费率
*/
public void setManageFeeRate(BigDecimal manageFeeRate) {
this.manageFeeRate = manageFeeRate;
}
/**
* 允许最大配资金额
*/
public BigDecimal getMaxMoney() {
return maxMoney;
}
/**
* 允许最大配资金额
*/
public void setMaxMoney(BigDecimal maxMoney) {
this.maxMoney = maxMoney;
}
public BankrollSolutionDay getSolution() {
return solution;
}
public void setSolution(BankrollSolutionDay solution) {
this.solution = solution;
}
}
|
[
"18720091873@163.com"
] |
18720091873@163.com
|
d7748990bf9169d30abca267632713dfbbad37c6
|
69a5692a97e841133206e4817e65b4dc09b56622
|
/ourdus-spring/src/main/java/ourdus/ourdusspring/dto/product/review/ReviewDTO.java
|
51ddefd427dd3622ed852ac6db91cc821faadb7f
|
[] |
no_license
|
Ourdus/OurdusBE
|
b8016ca73f486a3f5747ca1d0b3fc025d3d93eff
|
5ecfe58a41b62c915c64d7cfe29be9a2888ce7eb
|
refs/heads/main
| 2023-05-07T22:38:01.922305
| 2021-06-01T01:25:58
| 2021-06-01T01:25:58
| 331,016,543
| 4
| 1
| null | 2021-03-17T10:35:38
| 2021-01-19T15:00:57
|
Java
|
UTF-8
|
Java
| false
| false
| 866
|
java
|
package ourdus.ourdusspring.dto.product.review;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import ourdus.ourdusspring.domain.product.review.Review;
import java.time.LocalDateTime;
@Getter
@Setter
@NoArgsConstructor
public class ReviewDTO {
private Long id;
private String content;
private LocalDateTime date;
private int rate;
private Long productId;
private Long orderDetailId;
private String userName;
public ReviewDTO(Review review) {
this.id = review.getId();
this.content = review.getContent();
this.date = review.getDate();
this.rate = review.getRate();
this.productId = review.getProduct().getId();
this.orderDetailId = review.getOrderDetail().getId();
this.userName = review.getOrderDetail().getOrder().getUser().getName();
}
}
|
[
"hjwoou@gmail.com"
] |
hjwoou@gmail.com
|
2ef52a2e7b078db87d7e0b1e448248e2a4c6925b
|
652916f3467722148e7bafdcfd965eaae1287308
|
/LocationLessonOne/app/src/main/java/com/github/filipebezerra/toys/playservices/mylocation/main/LessonOneMainActivity.java
|
f421fdfdf467104c690a8a33107e9239145e21ba
|
[
"Apache-2.0"
] |
permissive
|
filipebezerra/GooglePlayServices-Toys
|
a0fd1a08b8d04b5bc2618d491171863c07263da6
|
27576ab7d87b8babd88be3e829edb4910a9b4cd8
|
refs/heads/master
| 2021-01-14T13:08:25.686218
| 2015-07-30T06:37:21
| 2015-07-30T06:37:21
| 38,254,172
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,444
|
java
|
package com.github.filipebezerra.toys.playservices.mylocation.main;
import android.location.Location;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.github.filipebezerra.toys.playservices.mylocation.R;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.location.LocationServices;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import timber.log.Timber;
public class LessonOneMainActivity extends AppCompatActivity
implements ConnectionCallbacks, OnConnectionFailedListener {
private static final String TAG = LessonOneMainActivity.class.getName();
private static final String KEY_LAST_LOCATION = TAG + ".KEY_LAST_LOCATION";
private static final String KEY_LAST_UPDATE_TIME = TAG + ".KEY_LAST_UPDATE_TIME";
private GoogleApiClient mGoogleApiClient;
private Location mLastLocation;
private Calendar mLastUpdate;
@Bind(R.id.toolbar) protected Toolbar mToolbar;
@Bind(R.id.latitude_value_text_view) protected TextView mLatitudeTextView;
@Bind(R.id.longitude_value_text_view) protected TextView mLongitudeTextView;
@Bind(R.id.last_update_text_view) protected TextView mLastUpdateTextView;
@Override
protected void onCreate(Bundle inState) {
super.onCreate(inState);
setContentView(R.layout.activity_lesson_one_main);
ButterKnife.bind(this);
Timber.tag(TAG);
setSupportActionBar(mToolbar);
buildGoogleApiClient();
if (inState != null && inState.containsKey(KEY_LAST_LOCATION)) {
mLastLocation = inState.getParcelable(KEY_LAST_LOCATION);
mLastUpdate.setTimeInMillis(inState.getLong(KEY_LAST_UPDATE_TIME));
updateUiLocationIfHasLocation();
}
setTitle(getString(R.string.title_lesson_two_main_activity));
}
private synchronized void buildGoogleApiClient() {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
}
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override
protected void onStop() {
if (mGoogleApiClient.isConnected()) {
mGoogleApiClient.disconnect();
}
super.onStop();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (mLastLocation != null) {
outState.putParcelable(KEY_LAST_LOCATION, mLastLocation);
outState.putLong(KEY_LAST_UPDATE_TIME, mLastUpdate.getTimeInMillis());
}
}
@Override
public void onConnected(Bundle bundle) {
Timber.d("Connected to Google Play Services");
retrieveLastLocation();
updateUiLocationIfHasLocation();
}
@Override
public void onConnectionSuspended(int cause) {
Timber.d("Connection with Google Play Services suspended");
}
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Timber.d("Connection with Google Play Services failed");
}
@OnClick(R.id.my_location_fab)
public void requestMyLocation() {
retrieveLastLocation();
updateUiLocationIfHasLocation();
}
private void updateUiLocationIfHasLocation() {
if (mLastLocation != null) {
mLatitudeTextView.setText(String.valueOf(mLastLocation.getLatitude()));
mLongitudeTextView.setText(String.valueOf(mLastLocation.getLongitude()));
mLastUpdateTextView.setText(SimpleDateFormat.getDateTimeInstance()
.format(mLastUpdate.getTime()));
}
}
private void retrieveLastLocation() {
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
if (mLastLocation != null) {
mLastUpdate = Calendar.getInstance();
}
}
}
|
[
"filipebzerra@gmail.com"
] |
filipebzerra@gmail.com
|
ddb39621ce5ee345834c44948a5e0e85914e59fe
|
348f57df60fd8ff6bb5c6dd9349814540ec35f9d
|
/buycar/Project code/CarsManager_MainUI/src/com/cars/manager/db/afinal/annotation/view/Select.java
|
cd4063b202d85ec9334922773bcce5a31f22649d
|
[] |
no_license
|
biao0102/car
|
19a74319c2fe0402a019b9243a1795ca2944b4ec
|
bb6613777da524318f5d1f8e93bdd8a7d7821033
|
refs/heads/master
| 2021-01-17T05:53:52.900381
| 2015-07-17T06:45:52
| 2015-07-17T06:45:52
| 39,239,188
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,047
|
java
|
/**
* Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.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.cars.manager.db.afinal.annotation.view;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Select {
public String selected();
public String noSelected() default "";
}
|
[
"15811495984@163.com"
] |
15811495984@163.com
|
af5a5d73fa72b396ec56d02cadd3ca382b3a8f12
|
642cb4ce82e92729e69447ea26086d57d0266296
|
/sdks/java/http_client/v1/src/test/java/org/openapitools/client/model/V1QueueTest.java
|
b5ec60a3dc3c51a08ff2cef5b71251c95093f391
|
[
"Apache-2.0"
] |
permissive
|
vamsikavuru/polyaxon
|
243c91b2a2998260f6b21e864b02347629c4867f
|
f1695c98f320c2e5c9fdf72e7f7885954df755a9
|
refs/heads/master
| 2022-08-24T05:22:04.806006
| 2020-05-28T14:50:54
| 2020-05-28T15:04:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,587
|
java
|
// Copyright 2018-2020 Polyaxon, Inc.
//
// 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.
/*
* Polyaxon SDKs and REST API specification.
* Polyaxon SDKs and REST API specification.
*
* The version of the OpenAPI document: 1.0.92
* Contact: contact@polyaxon.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.threeten.bp.OffsetDateTime;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for V1Queue
*/
public class V1QueueTest {
private final V1Queue model = new V1Queue();
/**
* Model tests for V1Queue
*/
@Test
public void testV1Queue() {
// TODO: test V1Queue
}
/**
* Test the property 'uuid'
*/
@Test
public void uuidTest() {
// TODO: test uuid
}
/**
* Test the property 'agent'
*/
@Test
public void agentTest() {
// TODO: test agent
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
/**
* Test the property 'priority'
*/
@Test
public void priorityTest() {
// TODO: test priority
}
/**
* Test the property 'concurrency'
*/
@Test
public void concurrencyTest() {
// TODO: test concurrency
}
/**
* Test the property 'createdAt'
*/
@Test
public void createdAtTest() {
// TODO: test createdAt
}
/**
* Test the property 'updatedAt'
*/
@Test
public void updatedAtTest() {
// TODO: test updatedAt
}
}
|
[
"mouradmourafiq@gmail.com"
] |
mouradmourafiq@gmail.com
|
368bbb3af6e2a79824844547198becab490672c0
|
a0afd519f94b7dcfa95eff4b1af9d07d7593ba36
|
/backend/rent-flicks/src/test/java/com/rentflicks/service/TestMovieService.java
|
29543590a665632473207888ff1e49178674787f
|
[] |
no_license
|
AniruddhaSAtre/rent-flicks
|
1c73aab3b05b173724c2538726847cf34e4cbb2c
|
d64fb784eb0f1f4d8a46ff95e5ab3b51f7540ed4
|
refs/heads/master
| 2021-01-13T00:52:42.957748
| 2015-11-28T17:17:43
| 2015-11-28T17:17:43
| 45,072,230
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,466
|
java
|
package com.rentflicks.service;
import static org.junit.Assert.assertTrue;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.rentflicks.RentFlicksApplication;
import com.rentflicks.model.Movie;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = RentFlicksApplication.class)
public class TestMovieService {
@Autowired
private MovieService movieService;
// Add WebApplicationContext field here.
// The setUp() method is omitted.
public boolean compareMovies(Movie first, Movie second) {
boolean movieCheck = first.getMovieId().equals(second.getMovieId());
boolean actorCheck = first.getActor().equals(second.getActor());
boolean titleCheck = first.getTitle().equals(second.getTitle());
boolean plotCheck = first.getPlot().equals(second.getPlot());
boolean yearCheck = first.getYear().equals(second.getYear());
boolean directorCheck = first.getDirector().equals(second.getDirector());
boolean criticRatingCheck = first.getCriticRating().equals(second.getCriticRating());
boolean imageCheck = first.getImage().equals(second.getImage());
if (movieCheck && actorCheck && titleCheck && plotCheck && yearCheck && directorCheck && criticRatingCheck
&& imageCheck)
return true;
return false;
}
@Test
public void testGetMovies() throws Exception {
boolean condition = false;
List<Movie> movies = movieService.getMovies();
Movie m = movies.get(1);
Movie resp = movieService.findOne(m.getMovieId());
if (compareMovies(m, resp))
condition = true;
assertTrue(condition);
}
@Test
public void testValidAddMovie() throws Exception {
boolean condition = false;
Movie movie = new Movie();
movie.setActor("test");
movie.setCriticRating((float) 3.5);
movie.setDirector("test");
movie.setImage("test");
movie.setPlot("test");
movie.setTitle("test");
movie.setYear(2013);
Movie response = movieService.addMovie(movie);
List<Movie> movies = movieService.getMovies();
for (Movie m : movies) {
if (m.getMovieId() == response.getMovieId())
condition = true;
}
assertTrue(condition);
}
@Test
public void testInvalidAddMovie() throws Exception {
boolean condition = false;
Movie movie = new Movie();
try {
movieService.addMovie(movie);
} catch (Exception e) {
condition = true;
}
assertTrue(condition);
}
@Test
public void testValidFindOne() throws Exception {
boolean condition = false;
Movie r = movieService.findOne(2);
if (r.getMovieId() == 2)
condition = true;
assertTrue(condition);
}
@Test
public void testInvalidFindOne() throws Exception {
boolean condition = false;
if (movieService.findOne(0) == null)
condition = true;
assertTrue(condition);
}
@Test
public void testValidGetMoviesByTitle() throws Exception {
boolean condition = false;
Movie movie = movieService.getMovies().get(0);
if (compareMovies(movieService.getMoviesByTitle(movie.getTitle()).get(0), movie))
condition = true;
assertTrue(condition);
}
@Test
public void testInvalidGetMoviesByTitle() throws Exception {
boolean condition = false;
List<Movie> m = movieService.getMoviesByTitle("invalid title");
if (m.size() == 0)
condition = true;
assertTrue(condition);
}
}
|
[
"aniruddha9atre@gmail.com"
] |
aniruddha9atre@gmail.com
|
a8ea8ce29756e81009b175c567b014ba49b30c91
|
35dbf93d56cdb3cdd4304c456d4cee3a3a0701c0
|
/src/main/java/io/huna/patterns/factory/abstractfactory/ingredient/Dough.java
|
7379cd9b9e64b16686dcc4d947b1def8c673d904
|
[] |
no_license
|
hun-a/java-tutorials
|
792c684d227be1193e3af2a8cd33fbbaa142988f
|
afb7b31f1785d16c7c38a08e43b358a685e12387
|
refs/heads/master
| 2022-04-11T07:29:30.215088
| 2020-03-24T12:22:17
| 2020-03-24T12:22:17
| 238,248,353
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 89
|
java
|
package io.huna.patterns.factory.abstractfactory.ingredient;
public interface Dough {
}
|
[
"seunghun.chan@gmail.com"
] |
seunghun.chan@gmail.com
|
f0a1c4cb155941680f1c23b5ac578d8a5fad2652
|
f5df70ed16c0963cdd5eabd1ac2d99543d42ea07
|
/N-java/src/main/java/Njava/concurrent/priority/PriorityRunnable.java
|
7379956fc7e5994a37253448aee93e24cab071fa
|
[] |
no_license
|
skaengus2012/N-java
|
e30129658048c2786fa0accbae36df289051395c
|
ac5e1a88c0ab062d351c2b4bf363d7483fa875a4
|
refs/heads/master
| 2021-01-22T22:20:50.202590
| 2018-07-14T09:54:35
| 2018-07-14T09:54:35
| 85,533,414
| 8
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 807
|
java
|
package Njava.concurrent.priority;
import Njava.function.exceptionLambda.IExRunnable;
import io.reactivex.annotations.NonNull;
/**
* Priority runnable.
*
* Created by Doohyun on 2017. 4. 16..
*/
public final class PriorityRunnable extends PrioritySleepTask implements Runnable{
private IExRunnable runnable;
/**
* Construct
*
* @param runnable
* @param sleepTime
* @param priority
*/
public PriorityRunnable(@NonNull IExRunnable runnable, @NonNull Integer sleepTime, @NonNull Integer priority) {
super(sleepTime, priority);
this.runnable = runnable;
}
@Override
public void run() {
try {
sleep();
runnable.run();
} catch (Exception e){
e.printStackTrace();
}
}
}
|
[
"skaengus2012@naver.com"
] |
skaengus2012@naver.com
|
0bcb7b380720f27668cb52d868edc36fa4570e4f
|
54d4b72e4b37cdcec0a0b2b46b83717e15eb0d9c
|
/app/src/main/java/com/broadchance/entity/serverentity/PreSetImg.java
|
92459b3a05f33b91bfb61759643c5663d6830a06
|
[] |
no_license
|
devryan915/wdecgrec_as
|
6af887efb55908fd515411d238334b841ac79ab7
|
4b41de5f9fc09cc04a3e93f0a5634119e7fec4f1
|
refs/heads/master
| 2020-06-22T19:50:15.544052
| 2016-12-12T03:45:24
| 2016-12-12T03:45:24
| 74,725,426
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 310
|
java
|
package com.broadchance.entity.serverentity;
public class PreSetImg extends Object
{
public PreSetImg(){}
private int ID;
public int getID() { return ID;}
public void setID(int _ID){this.ID = _ID;}
private String Url;
public String getUrl() { return Url;}
public void setUrl(String _Url){this.Url = _Url;}
}
|
[
"devryan@163.com"
] |
devryan@163.com
|
0799c70e62503820d2d569b4781ba721efe29527
|
4561279a925dd281a4ed12fa6caa23f655819b11
|
/ch6_6/src/test/java/com/ch/ch6_6/Ch66ApplicationTests.java
|
220c7f5bba582056d6dc0b469b4fba717e6da45f
|
[] |
no_license
|
2001tanzhiwen/springboot_from_entry_to_application-TsinghuaPublisher
|
8a79c6dc679775c965665df051dd001f9aab40e7
|
ffb1c16da77aa6cfe02b565a13dec9f833104890
|
refs/heads/main
| 2023-03-17T21:24:58.454868
| 2020-11-20T08:43:29
| 2020-11-20T08:43:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 327
|
java
|
package com.ch.ch6_6;
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 Ch66ApplicationTests {
@Test
public void contextLoads() {
}
}
|
[
"stupidaxe@163.com"
] |
stupidaxe@163.com
|
58dce08c5c09159bb1694f41fc0dd0af0ec9d0dc
|
135d248546775a2db1ad132178a92a759086e158
|
/src/main/java/com/yuen/fight/action/impl/MidRoundAction.java
|
c3e53cadf4424bf657d8f8c08661dbd37fd34d69
|
[] |
no_license
|
orangeevan/fight
|
0def675a0ed68437d7d7ef0da253934071e20570
|
8c5a7110483f46d82699515b8b6eca42d38efd45
|
refs/heads/master
| 2023-04-21T10:02:29.828635
| 2021-05-06T08:33:41
| 2021-05-06T08:33:41
| 362,714,425
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,250
|
java
|
package com.yuen.fight.action.impl;
import com.yuen.fight.Creature;
import com.yuen.fight.IBoard;
import com.yuen.fight.action.IAction;
import com.yuen.fight.handler.impl.MwnFightHandler;
/**
* @author: yuanchengyan
* @description:
* @since 10:29 2021/4/28
*/
public class MidRoundAction extends IAction<MidRoundAction.Board, MwnFightHandler.BoardBox> {
@Override
public boolean isEnd() {
if (box.getDefender().isDead()) {
return true;
}
if (box.getDefender().isDead()) {
return true;
}
return board.round >= 100;
}
@Override
public void circleEnd() {
super.circleEnd();
board.round++;
}
@Override
public void end() {
System.err.println("MidRoundAction- end -"+board.round);
}
@Override
public void action() {
Creature attacker = box.getAttacker();
Creature defender = box.getDefender();
//TODO 战斗逻辑
System.err.println("MidRoundAction- action -"+board.round);
}
public static class Board implements IBoard<MwnFightHandler.BoardBox> {
int round = 0;
@Override
public void initBoard(MwnFightHandler.BoardBox box) {
}
}
}
|
[
"494926093@qq.com"
] |
494926093@qq.com
|
1ff78d4b7ecbde50bd6e8819e69796c9808acc89
|
701980910117b797b5f7ca5a61a7262ccbc3ee7b
|
/core/src/main/java/com/matthewmitchell/peercoinj/core/PeerEventListener.java
|
721956ae0f6c29a01dc2fb9b3c1f6e4750b27908
|
[
"Apache-2.0"
] |
permissive
|
MatthewLM/peercoinj
|
c76f356e8cfa5b0cdc133a3bc91df867468e9c28
|
c385a2347dfad73fa8959362c115970b62e0e8de
|
refs/heads/master
| 2023-04-06T19:27:20.008332
| 2023-03-20T16:07:05
| 2023-03-20T16:07:05
| 22,102,786
| 11
| 30
| null | 2015-07-27T16:57:10
| 2014-07-22T12:19:41
|
Java
|
UTF-8
|
Java
| false
| false
| 3,864
|
java
|
/**
* Copyright 2011 Google Inc.
*
* 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.matthewmitchell.peercoinj.core;
import javax.annotation.Nullable;
import java.util.List;
/**
* <p>Implementors can listen to events like blocks being downloaded/transactions being broadcast/connect/disconnects,
* they can pre-filter messages before they are procesesed by a {@link Peer} or {@link PeerGroup}, and they can
* provide transactions to remote peers when they ask for them.</p>
*/
public interface PeerEventListener {
/**
* Called on a Peer thread when a block is received.<p>
*
* The block may have transactions or may be a header only once getheaders is implemented.
*
* @param peer the peer receiving the block
* @param block the downloaded block
* @param blocksLeft the number of blocks left to download
*/
public void onBlocksDownloaded(Peer peer, Block block, int blocksLeft);
/**
* Called when a download is started with the initial number of blocks to be downloaded.
*
* @param peer the peer receiving the block
* @param blocksLeft the number of blocks left to download
*/
public void onChainDownloadStarted(Peer peer, int blocksLeft);
/**
* Called when a peer is connected. If this listener is registered to a {@link Peer} instead of a {@link PeerGroup},
* peerCount will always be 1.
*
* @param peer
* @param peerCount the total number of connected peers
*/
public void onPeerConnected(Peer peer, int peerCount);
/**
* Called when a peer is disconnected. Note that this won't be called if the listener is registered on a
* {@link PeerGroup} and the group is in the process of shutting down. If this listener is registered to a
* {@link Peer} instead of a {@link PeerGroup}, peerCount will always be 0.
*
* @param peer
* @param peerCount the total number of connected peers
*/
public void onPeerDisconnected(Peer peer, int peerCount);
/**
* <p>Called when a message is received by a peer, before the message is processed. The returned message is
* processed instead. Returning null will cause the message to be ignored by the Peer returning the same message
* object allows you to see the messages received but not change them. The result from one event listeners
* callback is passed as "m" to the next, forming a chain.</p>
*
* <p>Note that this will never be called if registered with any executor other than
* {@link com.matthewmitchell.peercoinj.utils.Threading#SAME_THREAD}</p>
*/
public Message onPreMessageReceived(Peer peer, Message m);
/**
* Called when a new transaction is broadcast over the network.
*/
public void onTransaction(Peer peer, Transaction t);
/**
* <p>Called when a peer receives a getdata message, usually in response to an "inv" being broadcast. Return as many
* items as possible which appear in the {@link GetDataMessage}, or null if you're not interested in responding.</p>
*
* <p>Note that this will never be called if registered with any executor other than
* {@link com.matthewmitchell.peercoinj.utils.Threading#SAME_THREAD}</p>
*/
@Nullable
public List<Message> getData(Peer peer, GetDataMessage m);
}
|
[
"matthewmitchell@thelibertyportal.com"
] |
matthewmitchell@thelibertyportal.com
|
57603d27fb6adf69fb659648a8bf23ae9274368e
|
5d49684e21696e1c7fc2832be6ddf56a0e808e84
|
/src/main/java/com/cytmxk/test/picture/PictureUtils.java
|
0b54ed2ff4c3a20fb290ed10c5c5b543bd139881
|
[] |
no_license
|
forevercy/test
|
2284a879357ef4b593ef209c272f9333b35b6ee4
|
2a8b29dc1e3b75ffbab62cc02673a673a07fef09
|
refs/heads/master
| 2021-04-29T00:22:20.194867
| 2017-04-02T06:18:06
| 2017-04-02T06:18:06
| 77,706,834
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 27,642
|
java
|
package com.cytmxk.test.picture;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader.TileMode;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
import android.view.Display;
import android.widget.ImageView;
public class PictureUtils {
@SuppressWarnings("deprecation")
public static BitmapDrawable getScaledDrawable(Activity activity,
String path) {
Display display = activity.getWindowManager().getDefaultDisplay();
float destWidth = display.getWidth();
float destHeight = display.getHeight();
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(path, options);
float srcWidth = options.outWidth;
float srcHeight = options.outHeight;
int inSampleSize = 1;
if (srcWidth > destWidth || srcHeight > destHeight) {
if (srcWidth > srcHeight) {
inSampleSize = Math.round(srcHeight / destHeight);
} else {
inSampleSize = Math.round(srcWidth / destWidth);
}
}
options = new BitmapFactory.Options();
options.inSampleSize = inSampleSize;
Bitmap bitmap = BitmapFactory.decodeFile(path, options);
return new BitmapDrawable(activity.getResources(), bitmap);
}
public static int calculateInSampleSize(BitmapFactory.Options options,
int reqWidth, int reqHeight) {
// 源图片的高度和宽度
final int height = options.outHeight;
final int width = options.outWidth;
int inSampleSize = 1;
if (height > reqHeight || width > reqWidth) {
// 计算出实际宽高和目标宽高的比率
final int heightRatio = Math.round((float) height
/ (float) reqHeight);
final int widthRatio = Math.round((float) width / (float) reqWidth);
// 选择宽和高中最小的比率作为inSampleSize的值,这样可以保证最终图片的宽和高
// 一定都会大于等于目标的宽和高。
inSampleSize = heightRatio < widthRatio ? heightRatio : widthRatio;
}
return inSampleSize;
}
public static Bitmap decodeSampledBitmapFromBytes(byte[] bytes,
int reqWidth, int reqHeight) {
// 第一次解析将inJustDecodeBounds设置为true,来获取图片大小
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options);
// 调用上面定义的方法计算inSampleSize值
options.inSampleSize = calculateInSampleSize(options, reqWidth,
reqHeight);
// 使用获取到的inSampleSize值再次解析图片
options.inJustDecodeBounds = false;
return BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options);
}
public static byte[] rotatePicture(byte[] data, float degrees) {
Matrix m = new Matrix();
m.postRotate(degrees);
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),
bitmap.getHeight(), m, true);
ByteArrayOutputStream out = new ByteArrayOutputStream();
bitmap.compress(CompressFormat.JPEG, 100, out);
return out.toByteArray();
}
public static void cleanImageView(ImageView iamgeview) {
if (!(iamgeview.getDrawable() instanceof BitmapDrawable)) {
return;
}
BitmapDrawable bitmapDrawable = (BitmapDrawable) iamgeview
.getDrawable();
bitmapDrawable.getBitmap().recycle();
iamgeview.setImageDrawable(null);
}
/**
* Bitmap → byte[]
*
* @param bitmap
* @return
*/
public static byte[] bitmapToBytes(Bitmap bitmap) {
ByteArrayOutputStream output = new ByteArrayOutputStream();
boolean isSuccess = bitmap.compress(CompressFormat.JPEG, 100, output);
byte[] bs = null;
if (isSuccess) {
bs = output.toByteArray();
}
try {
output.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return bs;
}
/**
* byte[] → Bitmap
*
* @param b
* @return
*/
public Bitmap Bytes2Bimap(byte[] b) {
if (b.length != 0) {
return BitmapFactory.decodeByteArray(b, 0, b.length);
} else {
return null;
}
}
/**
* Bitmap缩放
*
* @param bitmap
* @param width
* @param height
* @return
*/
public static Bitmap zoomBitmap(Bitmap bitmap, int width, int height) {
int w = bitmap.getWidth();
int h = bitmap.getHeight();
Matrix matrix = new Matrix();
float scaleWidth = ((float) width / w);
float scaleHeight = ((float) height / h);
matrix.postScale(scaleWidth, scaleHeight);
Bitmap newbmp = Bitmap.createBitmap(bitmap, 0, 0, w, h, matrix, true);
return newbmp;
}
/**
* 通过给出的bitmap进行质量压缩
*
* @param bitmap
* @param percentage
* 1-100
* @return
*/
public static Bitmap compressBitmap(Bitmap bitmap, int percentage) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
// 通过这里改变压缩类型,其有不同的结果
bitmap.compress(CompressFormat.JPEG, percentage, bos);
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
return BitmapFactory.decodeStream(bis);
}
/**
* 获取图片的byte数
*
* @param bitmap
* @return
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
public static int getBitmapSize(Bitmap bitmap) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { // API 19
return bitmap.getAllocationByteCount();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { // API12
return bitmap.getByteCount();
}
return bitmap.getRowBytes() * bitmap.getHeight(); // earlier version
}
/**
* 将Drawable转化为Bitmap
*
* @param drawable
* @return
*/
public static Bitmap drawableToBitmap(Drawable drawable) {
// 取 drawable 的长宽
int w = drawable.getIntrinsicWidth();
int h = drawable.getIntrinsicHeight();
// 取 drawable 的颜色格式
Config config = drawable.getOpacity() != PixelFormat.OPAQUE ? Config.ARGB_8888
: Config.RGB_565;
// 建立对应 bitmap
Bitmap bitmap = Bitmap.createBitmap(w, h, config);
// 建立对应 bitmap 的画布
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, w, h);
// 把 drawable 内容画到画布中
drawable.draw(canvas);
return bitmap;
}
/**
* 获得圆角图片
*
* @param bitmap
* @param roundPx
* @return
*/
public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, float roundPx) {
int w = bitmap.getWidth();
int h = bitmap.getHeight();
Bitmap output = Bitmap.createBitmap(w, h, Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, w, h);
final RectF rectF = new RectF(rect);
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
return output;
}
/**
* 获得带倒影的图片
*
* @param bitmap
* @return
*/
public static Bitmap createReflectionImageWithOrigin(Bitmap bitmap) {
final int reflectionGap = 4;
int w = bitmap.getWidth();
int h = bitmap.getHeight();
Matrix matrix = new Matrix();
matrix.preScale(1, -1);
Bitmap reflectionImage = Bitmap.createBitmap(bitmap, 0, h / 2, w,
h / 2, matrix, false);
Bitmap bitmapWithReflection = Bitmap.createBitmap(w, (h + h / 2),
Config.ARGB_8888);
Canvas canvas = new Canvas(bitmapWithReflection);
canvas.drawBitmap(bitmap, 0, 0, null);
Paint deafalutPaint = new Paint();
canvas.drawRect(0, h, w, h + reflectionGap, deafalutPaint);
canvas.drawBitmap(reflectionImage, 0, h + reflectionGap, null);
Paint paint = new Paint();
LinearGradient shader = new LinearGradient(0, bitmap.getHeight(), 0,
bitmapWithReflection.getHeight() + reflectionGap, 0x70ffffff,
0x00ffffff, TileMode.CLAMP);
paint.setShader(shader);
// Set the Transfer mode to be porter duff and destination in
paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN));
// Draw a rectangle using the paint with our linear gradient
canvas.drawRect(0, h, w, bitmapWithReflection.getHeight()
+ reflectionGap, paint);
return bitmapWithReflection;
}
/**
* 将图片first和second由左向右合并
*
* @param first
* @param second
* @return
*/
public static Bitmap mergeBitmapLtr(Bitmap first, Bitmap second) {
int mergeWidth = first.getWidth() + second.getWidth();
int mergeHeight = first.getHeight() >= second.getHeight() ? first
.getHeight() : second.getHeight();
// 创建空得背景bitmap
// 生成画布图像
Bitmap resultBitmap = Bitmap.createBitmap(mergeWidth, mergeHeight,
first.getConfig());
Canvas canvas = new Canvas(resultBitmap);// 使用空白图片生成canvas
// 将bmp1绘制在画布上
Rect srcRect = new Rect(0, 0, first.getWidth(), first.getHeight());// 截取bmp1中的矩形区域
Rect dstRect = new Rect(0, 0, first.getWidth(), first.getHeight());// bmp1在目标画布中的位置
canvas.drawBitmap(first, srcRect, dstRect, null);
// 将bmp2绘制在画布上
srcRect = new Rect(0, 0, second.getWidth(), second.getHeight());// 截取bmp1中的矩形区域
dstRect = new Rect(first.getWidth(), 0, mergeWidth, second.getHeight());// bmp2在目标画布中的位置
canvas.drawBitmap(second, srcRect, dstRect, null);
// 将bmp1,bmp2合并显示
return resultBitmap;
}
/**
* 将图片first和second从上到下合并
*
* @param first
* @param second
* @return
*/
public static Bitmap mergeBitmapTtb(Bitmap first, Bitmap second) {
int mergeWidth = first.getWidth() >= second.getWidth() ? first
.getWidth() : second.getWidth();
int mergeHeight = first.getHeight() + second.getHeight();
// 创建空得背景bitmap
// 生成画布图像
Bitmap resultBitmap = Bitmap.createBitmap(mergeWidth, mergeHeight,
first.getConfig());
Canvas canvas = new Canvas(resultBitmap);// 使用空白图片生成canvas
// 将bmp1绘制在画布上
Rect srcRect = new Rect(0, 0, first.getWidth(), first.getHeight());// 截取bmp1中的矩形区域
Rect dstRect = new Rect(0, 0, first.getWidth(), first.getHeight());// bmp1在目标画布中的位置
canvas.drawBitmap(first, srcRect, dstRect, null);
// 将bmp2绘制在画布上
srcRect = new Rect(0, 0, second.getWidth(), second.getHeight());// 截取bmp1中的矩形区域
dstRect = new Rect(0, first.getHeight(), second.getWidth(), mergeHeight);// bmp2在目标画布中的位置
canvas.drawBitmap(second, srcRect, dstRect, null);
// 将bmp1,bmp2合并显示
return resultBitmap;
}
/**
* 创建纯白色位图
*
* @param width
* @param height
* @param config
* @return
*/
public static Bitmap creatWhiteBitmap(int width, int height, Config config) {
Bitmap bitmap = Bitmap.createBitmap(width, height, config);
int[] pix = new int[width * height];
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
int index = y * width + x;
int r = ((pix[index] >> 16) & 0xff) | 0xff;
int g = ((pix[index] >> 8) & 0xff) | 0xff;
int b = (pix[index] & 0xff) | 0xff;
pix[index] = 0xff000000 | (r << 16) | (g << 8) | b;
}
}
bitmap.setPixels(pix, 0, width, 0, 0, width, height);
return bitmap;
}
/**
* 创建纯黑色位图
*
* @param width
* @param height
* @param config
* @return
*/
public static Bitmap createBlackBitmap(int width, int height, Config config) {
Bitmap bitmap = Bitmap.createBitmap(width, height, config);
int[] pix = new int[width * height];
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
int index = y * width + x;
pix[index] = 0xff000000;
}
}
bitmap.setPixels(pix, 0, width, 0, 0, width, height);
return bitmap;
}
/**
* 保存图片到应用的外部缓存
*
* @param context
* @param bitmap
* @param bitName
* @param format
*/
public static void saveBitmap(Context context, Bitmap bitmap,
String bitName, CompressFormat format) {
// 获取图片存储路径
File cacheDir = FileUtils.getDiskCacheDir(context, "picture");
if (!cacheDir.exists()) {
cacheDir.mkdirs();
}
switch (format) {
case JPEG:
bitName += ".jpg";
break;
case PNG:
bitName += ".png";
break;
case WEBP:
bitName += ".webp";
break;
default:
break;
}
File file = new File(cacheDir, bitName);
if (file.exists()) {
file.delete();
}
FileOutputStream out = null;
try {
out = new FileOutputStream(file);
if (bitmap.compress(format, 100, out)) {
out.flush();
out.close();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
private static long sRSElapsedTime = 0;
public static long getRSElapsedTimeBlur() {
return sRSElapsedTime;
}
public static void clearRSElapsedTimeBlur() {
sRSElapsedTime = 0;
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public static Bitmap RSBlurBitmap(Context context, Bitmap bitmap) {
long startMs = System.currentTimeMillis();
// Let's create an empty bitmap with the same size of the bitmap we want
// to blur
Bitmap outBitmap = Bitmap.createBitmap(bitmap.getWidth(),
bitmap.getHeight(), Config.ARGB_8888);
// Instantiate a new Renderscript
RenderScript rs = RenderScript.create(context);
// Create an Intrinsic Blur Script using the Renderscript
ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs,
Element.U8_4(rs));
// Create the Allocations (in/out) with the Renderscript and the in/out
// bitmaps
Allocation allIn = Allocation.createFromBitmap(rs, bitmap);
Allocation allOut = Allocation.createFromBitmap(rs, outBitmap);
// Set the radius of the blur
blurScript.setRadius(25.f);
// Perform the Renderscript
blurScript.setInput(allIn);
blurScript.forEach(allOut);
// Copy the final bitmap created by the out Allocation to the outBitmap
allOut.copyTo(outBitmap);
// recycle the original bitmap
bitmap.recycle();
// After finishing everything, we destroy the Renderscript.
rs.destroy();
sRSElapsedTime = System.currentTimeMillis() - startMs;
return outBitmap;
}
//相对于上面的blurBitmap方法,可以去掉对Renderscript的依赖(还有最低API版本的限制)。
//但是可恶的是,理模糊操作竟然花费了147ms!这还不是最慢的SW模糊算法,我都不敢用高斯模糊了
private static long sFastElapsedTime = 0;
public static long getFastElapsedTimeBlur() {
return sFastElapsedTime;
}
public static void clearFastElapsedTimeBlur() {
sFastElapsedTime = 0;
}
public static Bitmap fastBlur(Bitmap bitmap) {
long startMs = System.currentTimeMillis();
Bitmap overlay = Bitmap.createBitmap((int) (bitmap.getWidth()),
(int) (bitmap.getHeight()), Config.ARGB_8888);
Canvas canvas = new Canvas(overlay);
canvas.drawBitmap(bitmap, 0, 0, null);
overlay = fastBlur(overlay, 25, true);
sFastElapsedTime = System.currentTimeMillis() - startMs;
return overlay;
}
private static Bitmap fastBlur(Bitmap sentBitmap, int radius, boolean canReuseInBitmap) {
// Stack Blur v1.0 from
// http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html
//
// Java Author: Mario Klingemann <mario at quasimondo.com>
// http://incubator.quasimondo.com
// created Feburary 29, 2004
// Android port : Yahel Bouaziz <yahel at kayenko.com>
// http://www.kayenko.com
// ported april 5th, 2012
// This is a compromise between Gaussian Blur and Box blur
// It creates much better looking blurs than Box Blur, but is
// 7x faster than my Gaussian Blur implementation.
//
// I called it Stack Blur because this describes best how this
// filter works internally: it creates a kind of moving stack
// of colors whilst scanning through the image. Thereby it
// just has to add one new block of color to the right side
// of the stack and remove the leftmost color. The remaining
// colors on the topmost layer of the stack are either added on
// or reduced by one, depending on if they are on the right or
// on the left side of the stack.
//
// If you are using this algorithm in your code please add
// the following line:
//
// Stack Blur Algorithm by Mario Klingemann <mario@quasimondo.com>
Bitmap bitmap;
if (canReuseInBitmap) {
bitmap = sentBitmap;
} else {
bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
}
if (radius < 1) {
return (null);
}
int w = bitmap.getWidth();
int h = bitmap.getHeight();
int[] pix = new int[w * h];
bitmap.getPixels(pix, 0, w, 0, 0, w, h);
int wm = w - 1;
int hm = h - 1;
int wh = w * h;
int div = radius + radius + 1;
int r[] = new int[wh];
int g[] = new int[wh];
int b[] = new int[wh];
int rsum, gsum, bsum, x, y, i, p, yp, yi, yw;
int vmin[] = new int[Math.max(w, h)];
int divsum = (div + 1) >> 1;
divsum *= divsum;
int dv[] = new int[256 * divsum];
for (i = 0; i < 256 * divsum; i++) {
dv[i] = (i / divsum);
}
yw = yi = 0;
int[][] stack = new int[div][3];
int stackpointer;
int stackstart;
int[] sir;
int rbs;
int r1 = radius + 1;
int routsum, goutsum, boutsum;
int rinsum, ginsum, binsum;
for (y = 0; y < h; y++) {
rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;
for (i = -radius; i <= radius; i++) {
p = pix[yi + Math.min(wm, Math.max(i, 0))];
sir = stack[i + radius];
sir[0] = (p & 0xff0000) >> 16;
sir[1] = (p & 0x00ff00) >> 8;
sir[2] = (p & 0x0000ff);
rbs = r1 - Math.abs(i);
rsum += sir[0] * rbs;
gsum += sir[1] * rbs;
bsum += sir[2] * rbs;
if (i > 0) {
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
} else {
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
}
}
stackpointer = radius;
for (x = 0; x < w; x++) {
r[yi] = dv[rsum];
g[yi] = dv[gsum];
b[yi] = dv[bsum];
rsum -= routsum;
gsum -= goutsum;
bsum -= boutsum;
stackstart = stackpointer - radius + div;
sir = stack[stackstart % div];
routsum -= sir[0];
goutsum -= sir[1];
boutsum -= sir[2];
if (y == 0) {
vmin[x] = Math.min(x + radius + 1, wm);
}
p = pix[yw + vmin[x]];
sir[0] = (p & 0xff0000) >> 16;
sir[1] = (p & 0x00ff00) >> 8;
sir[2] = (p & 0x0000ff);
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
rsum += rinsum;
gsum += ginsum;
bsum += binsum;
stackpointer = (stackpointer + 1) % div;
sir = stack[(stackpointer) % div];
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
rinsum -= sir[0];
ginsum -= sir[1];
binsum -= sir[2];
yi++;
}
yw += w;
}
for (x = 0; x < w; x++) {
rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;
yp = -radius * w;
for (i = -radius; i <= radius; i++) {
yi = Math.max(0, yp) + x;
sir = stack[i + radius];
sir[0] = r[yi];
sir[1] = g[yi];
sir[2] = b[yi];
rbs = r1 - Math.abs(i);
rsum += r[yi] * rbs;
gsum += g[yi] * rbs;
bsum += b[yi] * rbs;
if (i > 0) {
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
} else {
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
}
if (i < hm) {
yp += w;
}
}
yi = x;
stackpointer = radius;
for (y = 0; y < h; y++) {
// Preserve alpha channel: ( 0xff000000 & pix[yi] )
pix[yi] = (0xff000000 & pix[yi]) | (dv[rsum] << 16) | (dv[gsum] << 8) | dv[bsum];
rsum -= routsum;
gsum -= goutsum;
bsum -= boutsum;
stackstart = stackpointer - radius + div;
sir = stack[stackstart % div];
routsum -= sir[0];
goutsum -= sir[1];
boutsum -= sir[2];
if (x == 0) {
vmin[y] = Math.min(y + r1, hm) * w;
}
p = x + vmin[y];
sir[0] = r[p];
sir[1] = g[p];
sir[2] = b[p];
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
rsum += rinsum;
gsum += ginsum;
bsum += binsum;
stackpointer = (stackpointer + 1) % div;
sir = stack[stackpointer];
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
rinsum -= sir[0];
ginsum -= sir[1];
binsum -= sir[2];
yi += w;
}
}
bitmap.setPixels(pix, 0, w, 0, 0, w, h);
return (bitmap);
}
/**
* 获取裁剪后的圆形图片
* @param radius半径
*/
public static Bitmap getCircleBitmap(Resources res, Bitmap bmp, int radius) {
Bitmap squareBitmap;
Bitmap scaledSquareBmp;
int diameter = radius * 2;
// 为了防止宽高不相等,造成圆形图片变形,因此截取长方形中处于中间位置最大的正方形图片
int bmpWidth = bmp.getWidth();
int bmpHeight = bmp.getHeight();
if (bmpHeight > bmpWidth) {// 高大于宽
squareBitmap = Bitmap.createBitmap(bmp, 0, (bmpHeight - bmpWidth) / 2, bmpWidth, bmpWidth);
} else if (bmpHeight < bmpWidth) {// 宽大于高
squareBitmap = Bitmap.createBitmap(bmp, (bmpWidth - bmpHeight) / 2, 0, bmpHeight,bmpHeight);
} else {
squareBitmap = bmp;
}
if (squareBitmap.getWidth() != diameter) {
scaledSquareBmp = Bitmap.createScaledBitmap(squareBitmap, diameter,diameter, true);
} else {
scaledSquareBmp = squareBitmap;
}
int mScaledSquareBmpLength = scaledSquareBmp.getWidth();
int mBorderThickness = mScaledSquareBmpLength / 18;//圆环宽度
Bitmap output = Bitmap.createBitmap(mScaledSquareBmpLength + mBorderThickness*2,
mScaledSquareBmpLength + mBorderThickness*2,
Config.ARGB_8888);
Canvas canvas = new Canvas(output);
Paint paint = new Paint();
Rect srcRect = new Rect(0, 0, mScaledSquareBmpLength,mScaledSquareBmpLength);
Rect dstRect = new Rect(mBorderThickness, mBorderThickness, mScaledSquareBmpLength + mBorderThickness,mScaledSquareBmpLength + mBorderThickness);
paint.setAntiAlias(true);
paint.setFilterBitmap(true);
paint.setDither(true);
canvas.drawARGB(0, 0, 0, 0);
canvas.drawCircle(mScaledSquareBmpLength / 2 + mBorderThickness,
mScaledSquareBmpLength / 2 + mBorderThickness,
mScaledSquareBmpLength / 2,
paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(scaledSquareBmp, srcRect, dstRect, paint);
//overlapBitmap(res, canvas, R.drawable.ic_people_border, mScaledSquareBmpLength + mBorderThickness*2, mScaledSquareBmpLength + mBorderThickness*2);
drawCircleBorder(canvas, mScaledSquareBmpLength / 2 + mBorderThickness, mBorderThickness, 0xaa0000ff);
bmp = null;
squareBitmap = null;
scaledSquareBmp = null;
return output;
}
/**
* 画边缘圆环
*/
public static void drawCircleBorder(Canvas canvas, int radius,int borderThickness, int color) {
Paint paint = new Paint();
paint.setAntiAlias(true); //去锯齿
paint.setFilterBitmap(true); //对位图进行滤波处理
paint.setDither(true); ////防抖动
paint.setColor(color);
/* 设置paint的 style 为STROKE:空心 */
paint.setStyle(Paint.Style.STROKE);
/* 设置paint的外框宽度 */
paint.setStrokeWidth(borderThickness);
canvas.drawCircle(radius, radius, radius - borderThickness / 2, paint);
}
/**
* 在画布上重叠画上一张图片
*
* @param canvas
* @param top
* @param x
* @param y
* @return
*/
public static void overlapBitmap(Resources res, Canvas canvas, int resid, int width,
int height) {
Bitmap scaledBmp;
Bitmap top = BitmapFactory.decodeResource(res, resid);
if ((top.getWidth() != width) || (top.getHeight() != height)) {
scaledBmp = Bitmap.createScaledBitmap(top, width, height, true);
} else {
scaledBmp = top;
}
canvas.drawBitmap(scaledBmp, 0, 0, null); // x、y为top写入点的x、y坐标
}
/**
* 将图片first和second重叠
*
* @param first
* @param second
* @param x
* @param y
* @return
*/
public static Bitmap overlapBitmap(Bitmap first, Bitmap second, float x,
float y) {
Bitmap bitmap3 = Bitmap.createBitmap(first.getWidth(),
first.getHeight(), first.getConfig());
Canvas canvas = new Canvas(bitmap3);
canvas.drawBitmap(first, new Matrix(), null);
canvas.drawBitmap(second, x, y, null); // x、y为bitmap2写入点的x、y坐标
return bitmap3;
}
}
|
[
"1559409678@qq.com"
] |
1559409678@qq.com
|
361b91ed25d18987a8d9fcc885e1c6ac178b65ae
|
480bef579483c8cb3a35f995362b6d8f372786a7
|
/app/src/main/java/com/example/administrator/myapplication/BottomAct.java
|
a48ec3bb0ea45833cc25f3e905b75cf926b82e96
|
[] |
no_license
|
xujianhong/Sample
|
d5a615ef3f4a030899d52841d335d3bd549df6dc
|
a005f095840a501d9c43fe2154e39d3039451cad
|
refs/heads/master
| 2020-12-30T14:12:46.417529
| 2017-10-11T09:42:33
| 2017-10-11T09:42:33
| 91,289,281
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,517
|
java
|
package com.example.administrator.myapplication;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import com.example.administrator.myapplication.Tab.CommonFragmentPagerAdapter;
import com.example.administrator.myapplication.Tab.MyViewPager;
import com.example.administrator.myapplication.fragment.MainFragment;
import java.util.ArrayList;
/**
* Created by jianhongxu on 2016/12/1.
*/
public class BottomAct extends AppCompatActivity implements ViewPager.OnPageChangeListener, View.OnClickListener {
MyViewPager mp_main;
RadioButton rb_menu_main, rb_menu_me;
ImageButton ib_classmangement;
CommonFragmentPagerAdapter pagerAdapter;
Button btn_check,btn_class,btn_homework;
RelativeLayout rl_menu;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.act_bottom);
initViews();
}
private void initViews() {
btn_check = (Button)findViewById(R.id.btn_check);
btn_check.setOnClickListener(this);
btn_class = (Button)findViewById(R.id.btn_class);
btn_class.setOnClickListener(this);
btn_homework = (Button)findViewById(R.id.btn_homework);
btn_homework.setOnClickListener(this);
rl_menu =(RelativeLayout)findViewById(R.id.rl_menu);
mp_main = (MyViewPager)findViewById(R.id.mp_main);
rb_menu_main =(RadioButton)findViewById(R.id.rb_menu_main);
rb_menu_me =(RadioButton)findViewById(R.id.rb_menu_me);
ib_classmangement = (ImageButton)findViewById(R.id.ib_classmangement);
closeMenu();
ib_classmangement.setOnClickListener(this);
rb_menu_main.setChecked(true);
rb_menu_main.setOnClickListener(this);
rb_menu_me.setOnClickListener(this);
ArrayList<Fragment> fragments = new ArrayList<>();
fragments.add(new MainFragment());
fragments.add(new MainFragment());
FragmentManager mFragmentManager = getSupportFragmentManager();
pagerAdapter = new CommonFragmentPagerAdapter(mFragmentManager,fragments);
mp_main.setAdapter(pagerAdapter);
mp_main.setOffscreenPageLimit(2);
mp_main.addOnPageChangeListener(this);
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
//state的状态有三个,0表示什么都没做,1正在滑动,2滑动完毕
if (state == 2) {
switch (mp_main.getCurrentItem()) {
case 0:
if(!rb_menu_main.isChecked()){
rb_menu_main.setChecked(true);
}
rb_menu_me.setChecked(false);
break;
case 1:
if(!rb_menu_me.isChecked()){
rb_menu_me.setChecked(true);
}
rb_menu_main.setChecked(false);
break;
default:
break;
}
}
else if(state == 1){
if(isshow)
closeMenu();
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.rb_menu_main:
if(!rb_menu_main.isChecked()){
rb_menu_main.setChecked(true);
}
rb_menu_me.setChecked(false);
mp_main.setCurrentItem(0);
if(isshow)
closeMenu();
break;
case R.id.rb_menu_me:
if(!rb_menu_me.isChecked()){
rb_menu_me.setChecked(true);
}
rb_menu_main.setChecked(false);
mp_main.setCurrentItem(1);
if(isshow)
closeMenu();
break;
case R.id.ib_classmangement:
if(isshow){
closeMenu();
}else
openMenu();
break;
case R.id.btn_check:
Log.e("BottomAct","btn_check");
break;
case R.id.btn_class:
Log.e("BottomAct","btn_class");
break;
case R.id.btn_homework:
Log.e("BottomAct","btn_homework");
break;
}
}
boolean isshow = false;
/**
* 缩放
*/
public void closeMenu() {
isshow = false;
rl_menu.animate().scaleX(0.1f).scaleY(0.1f).translationY(dip2px(40)).setDuration(300).start();
}
/**
* 放大
*/
public void openMenu() {
isshow = true;
rl_menu.animate().scaleX(1f).scaleY(1f).translationY(0).setDuration(300).start();
}
public int dip2px(float dipValue) {
final float scale = this.getResources().getDisplayMetrics().density;
return (int) (dipValue * scale + 0.5f);
}
}
|
[
"571152503@qq.com"
] |
571152503@qq.com
|
c1de78b5139ffb867089f03ace1a00ec2f6175f6
|
3c439bc13f6f300c876a808fcc183112a956e957
|
/minimalcontentprovider/src/main/java/com/example/minimalcontentprovider/MyDbOpenHepler.java
|
fd4d3f7238360cee9df7cdd31fc56725812b343a
|
[] |
no_license
|
FrLinXu/Android_Test
|
4cb06d9ddc1d63e3b7b67181b7c9a6595335fda2
|
48d85878c91e4463d35459f7c7cfaa87f61b4d39
|
refs/heads/master
| 2020-04-06T17:52:57.002120
| 2018-11-26T10:30:19
| 2018-11-26T10:30:19
| 157,676,699
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,607
|
java
|
package com.example.minimalcontentprovider;
import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
/**
* Author by Deil, Date on 2018/11/22.
* PS: Not easy to write code, please indicate.
*/
public class MyDbOpenHepler extends SQLiteOpenHelper{
private static final String TAG = "MyDbOpenHepler";
private static final String SQL_CREATE_ENTRIES =
"CREATE TABLE words(_ID INTEGER PRIMARY KEY, " +
" name VARCHAR(30), " +
" frequency integer " +
")";
private static final String SQL_DELETE_ENTRIES =
"DROP TABLE IF EXISTS wrods ";
public static final int DATABASE_VERSION = 3;
public static final String DATABASE_NAME = "words.db";
public MyDbOpenHepler (Context context)
{
super(context, DATABASE_NAME, null, DATABASE_VERSION);
Log.d(TAG, "MyDbOpenHepler: create.....");
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(SQL_CREATE_ENTRIES);
initDb(db);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL(SQL_DELETE_ENTRIES);
onCreate(db);
}
private void initDb(SQLiteDatabase db) {
ContentValues values = new ContentValues();
values.put("name", "大黄");
values.put("frequency", 0);
db.insert("words", null, values);
values.clear();
values.put("name", "小明");
values.put("frequency", 0);
db.insert("words", null, values);
values.clear();
values.put("name", "小牛");
values.put("frequency", 0);
db.insert("words", null, values);
values.clear();
values.put("name", "大明");
values.put("frequency", 0);
db.insert("words", null, values);
values.clear();
}
public void insert(Word word){
ContentValues contentValues = new ContentValues();
contentValues.put("name",word.getName());
contentValues.put("frequency",word.getFrequency());
this.getReadableDatabase().insert("words",null,contentValues);
}
public void update(Word word,String id){
ContentValues contentValues = new ContentValues();
contentValues.put("name",word.getName());
contentValues.put("frequency",word.getFrequency());
this.getReadableDatabase().update("words",contentValues,"id = ?",new String[] {id});
}
}
|
[
"805130732@qq.com"
] |
805130732@qq.com
|
bcee702480fb0e7379b508eb98ad82191450cb95
|
816e53ced1f741006ed5dd568365aba0ec03f0cf
|
/TeamBattle/temp/src/minecraft/net/minecraft/network/NetHandlerPlayServer.java
|
c917e0b63209064312f4c6e5eba193c8b4f2743a
|
[] |
no_license
|
TeamBattleClient/TeamBattleRemake
|
ad4eb8379ebc673ef1e58d0f2c1a34e900bd85fe
|
859afd1ff2cd7527abedfbfe0b3d1dae09d5cbbc
|
refs/heads/master
| 2021-03-12T19:41:51.521287
| 2015-03-08T21:34:32
| 2015-03-08T21:34:32
| 31,624,440
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 46,859
|
java
|
package net.minecraft.network;
import com.google.common.base.Charsets;
import com.google.common.collect.Lists;
import io.netty.buffer.Unpooled;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.Random;
import java.util.concurrent.Callable;
import net.minecraft.block.material.Material;
import net.minecraft.command.server.CommandBlockLogic;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityMinecartCommandBlock;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerBeacon;
import net.minecraft.inventory.ContainerMerchant;
import net.minecraft.inventory.ContainerRepair;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemEditableBook;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemWritableBook;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.network.EnumConnectionState;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.INetHandlerPlayServer;
import net.minecraft.network.play.client.C00PacketKeepAlive;
import net.minecraft.network.play.client.C01PacketChatMessage;
import net.minecraft.network.play.client.C02PacketUseEntity;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C07PacketPlayerDigging;
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
import net.minecraft.network.play.client.C09PacketHeldItemChange;
import net.minecraft.network.play.client.C0APacketAnimation;
import net.minecraft.network.play.client.C0BPacketEntityAction;
import net.minecraft.network.play.client.C0CPacketInput;
import net.minecraft.network.play.client.C0DPacketCloseWindow;
import net.minecraft.network.play.client.C0EPacketClickWindow;
import net.minecraft.network.play.client.C0FPacketConfirmTransaction;
import net.minecraft.network.play.client.C10PacketCreativeInventoryAction;
import net.minecraft.network.play.client.C11PacketEnchantItem;
import net.minecraft.network.play.client.C12PacketUpdateSign;
import net.minecraft.network.play.client.C13PacketPlayerAbilities;
import net.minecraft.network.play.client.C14PacketTabComplete;
import net.minecraft.network.play.client.C15PacketClientSettings;
import net.minecraft.network.play.client.C16PacketClientStatus;
import net.minecraft.network.play.client.C17PacketCustomPayload;
import net.minecraft.network.play.server.S00PacketKeepAlive;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
import net.minecraft.network.play.server.S23PacketBlockChange;
import net.minecraft.network.play.server.S2FPacketSetSlot;
import net.minecraft.network.play.server.S32PacketConfirmTransaction;
import net.minecraft.network.play.server.S3APacketTabComplete;
import net.minecraft.network.play.server.S40PacketDisconnect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.management.UserListBansEntry;
import net.minecraft.stats.AchievementList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityBeacon;
import net.minecraft.tileentity.TileEntityCommandBlock;
import net.minecraft.tileentity.TileEntitySign;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatAllowedCharacters;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.IntHashMap;
import net.minecraft.util.ReportedException;
import net.minecraft.world.WorldServer;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class NetHandlerPlayServer implements INetHandlerPlayServer {
private static final Logger field_147370_c = LogManager.getLogger();
public final NetworkManager field_147371_a;
private final MinecraftServer field_147367_d;
public EntityPlayerMP field_147369_b;
private int field_147368_e;
private int field_147365_f;
private boolean field_147366_g;
private int field_147378_h;
private long field_147379_i;
private static Random field_147376_j = new Random();
private long field_147377_k;
private int field_147374_l;
private int field_147375_m;
private IntHashMap field_147372_n = new IntHashMap();
private double field_147373_o;
private double field_147382_p;
private double field_147381_q;
private boolean field_147380_r = true;
private static final String __OBFID = "CL_00001452";
public NetHandlerPlayServer(MinecraftServer p_i1530_1_, NetworkManager p_i1530_2_, EntityPlayerMP p_i1530_3_) {
this.field_147367_d = p_i1530_1_;
this.field_147371_a = p_i1530_2_;
p_i1530_2_.func_150719_a(this);
this.field_147369_b = p_i1530_3_;
p_i1530_3_.field_71135_a = this;
}
public void func_147233_a() {
this.field_147366_g = false;
++this.field_147368_e;
this.field_147367_d.field_71304_b.func_76320_a("keepAlive");
if((long)this.field_147368_e - this.field_147377_k > 40L) {
this.field_147377_k = (long)this.field_147368_e;
this.field_147379_i = this.func_147363_d();
this.field_147378_h = (int)this.field_147379_i;
this.func_147359_a(new S00PacketKeepAlive(this.field_147378_h));
}
if(this.field_147374_l > 0) {
--this.field_147374_l;
}
if(this.field_147375_m > 0) {
--this.field_147375_m;
}
if(this.field_147369_b.func_154331_x() > 0L && this.field_147367_d.func_143007_ar() > 0 && MinecraftServer.func_130071_aq() - this.field_147369_b.func_154331_x() > (long)(this.field_147367_d.func_143007_ar() * 1000 * 60)) {
this.func_147360_c("You have been idle for too long!");
}
}
public NetworkManager func_147362_b() {
return this.field_147371_a;
}
public void func_147360_c(String p_147360_1_) {
final ChatComponentText var2 = new ChatComponentText(p_147360_1_);
this.field_147371_a.func_150725_a(new S40PacketDisconnect(var2), new GenericFutureListener[]{new GenericFutureListener() {
private static final String __OBFID = "CL_00001453";
public void operationComplete(Future p_operationComplete_1_) {
NetHandlerPlayServer.this.field_147371_a.func_150718_a(var2);
}
}});
this.field_147371_a.func_150721_g();
}
public void func_147358_a(C0CPacketInput p_147358_1_) {
this.field_147369_b.func_110430_a(p_147358_1_.func_149620_c(), p_147358_1_.func_149616_d(), p_147358_1_.func_149618_e(), p_147358_1_.func_149617_f());
}
public void func_147347_a(C03PacketPlayer p_147347_1_) {
WorldServer var2 = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK);
this.field_147366_g = true;
if(!this.field_147369_b.field_71136_j) {
double var3;
if(!this.field_147380_r) {
var3 = p_147347_1_.func_149467_d() - this.field_147382_p;
if(p_147347_1_.func_149464_c() == this.field_147373_o && var3 * var3 < 0.01D && p_147347_1_.func_149472_e() == this.field_147381_q) {
this.field_147380_r = true;
}
}
if(this.field_147380_r) {
double var5;
double var7;
double var9;
if(this.field_147369_b.field_70154_o != null) {
float var34 = this.field_147369_b.field_70177_z;
float var4 = this.field_147369_b.field_70125_A;
this.field_147369_b.field_70154_o.func_70043_V();
var5 = this.field_147369_b.field_70165_t;
var7 = this.field_147369_b.field_70163_u;
var9 = this.field_147369_b.field_70161_v;
if(p_147347_1_.func_149463_k()) {
var34 = p_147347_1_.func_149462_g();
var4 = p_147347_1_.func_149470_h();
}
this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i();
this.field_147369_b.func_71127_g();
this.field_147369_b.field_70139_V = 0.0F;
this.field_147369_b.func_70080_a(var5, var7, var9, var34, var4);
if(this.field_147369_b.field_70154_o != null) {
this.field_147369_b.field_70154_o.func_70043_V();
}
this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b);
if(this.field_147380_r) {
this.field_147373_o = this.field_147369_b.field_70165_t;
this.field_147382_p = this.field_147369_b.field_70163_u;
this.field_147381_q = this.field_147369_b.field_70161_v;
}
var2.func_72870_g(this.field_147369_b);
return;
}
if(this.field_147369_b.func_70608_bn()) {
this.field_147369_b.func_71127_g();
this.field_147369_b.func_70080_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, this.field_147369_b.field_70177_z, this.field_147369_b.field_70125_A);
var2.func_72870_g(this.field_147369_b);
return;
}
var3 = this.field_147369_b.field_70163_u;
this.field_147373_o = this.field_147369_b.field_70165_t;
this.field_147382_p = this.field_147369_b.field_70163_u;
this.field_147381_q = this.field_147369_b.field_70161_v;
var5 = this.field_147369_b.field_70165_t;
var7 = this.field_147369_b.field_70163_u;
var9 = this.field_147369_b.field_70161_v;
float var11 = this.field_147369_b.field_70177_z;
float var12 = this.field_147369_b.field_70125_A;
if(p_147347_1_.func_149466_j() && p_147347_1_.func_149467_d() == -999.0D && p_147347_1_.func_149471_f() == -999.0D) {
p_147347_1_.func_149469_a(false);
}
double var13;
if(p_147347_1_.func_149466_j()) {
var5 = p_147347_1_.func_149464_c();
var7 = p_147347_1_.func_149467_d();
var9 = p_147347_1_.func_149472_e();
var13 = p_147347_1_.func_149471_f() - p_147347_1_.func_149467_d();
if(!this.field_147369_b.func_70608_bn() && (var13 > 1.65D || var13 < 0.1D)) {
this.func_147360_c("Illegal stance");
field_147370_c.warn(this.field_147369_b.func_70005_c_() + " had an illegal stance: " + var13);
return;
}
if(Math.abs(p_147347_1_.func_149464_c()) > 3.2E7D || Math.abs(p_147347_1_.func_149472_e()) > 3.2E7D) {
this.func_147360_c("Illegal position");
return;
}
}
if(p_147347_1_.func_149463_k()) {
var11 = p_147347_1_.func_149462_g();
var12 = p_147347_1_.func_149470_h();
}
this.field_147369_b.func_71127_g();
this.field_147369_b.field_70139_V = 0.0F;
this.field_147369_b.func_70080_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, var11, var12);
if(!this.field_147380_r) {
return;
}
var13 = var5 - this.field_147369_b.field_70165_t;
double var15 = var7 - this.field_147369_b.field_70163_u;
double var17 = var9 - this.field_147369_b.field_70161_v;
double var19 = Math.min(Math.abs(var13), Math.abs(this.field_147369_b.field_70159_w));
double var21 = Math.min(Math.abs(var15), Math.abs(this.field_147369_b.field_70181_x));
double var23 = Math.min(Math.abs(var17), Math.abs(this.field_147369_b.field_70179_y));
double var25 = var19 * var19 + var21 * var21 + var23 * var23;
if(var25 > 100.0D && (!this.field_147367_d.func_71264_H() || !this.field_147367_d.func_71214_G().equals(this.field_147369_b.func_70005_c_()))) {
field_147370_c.warn(this.field_147369_b.func_70005_c_() + " moved too quickly! " + var13 + "," + var15 + "," + var17 + " (" + var19 + ", " + var21 + ", " + var23 + ")");
this.func_147364_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, this.field_147369_b.field_70177_z, this.field_147369_b.field_70125_A);
return;
}
float var27 = 0.0625F;
boolean var28 = var2.func_72945_a(this.field_147369_b, this.field_147369_b.field_70121_D.func_72329_c().func_72331_e((double)var27, (double)var27, (double)var27)).isEmpty();
if(this.field_147369_b.field_70122_E && !p_147347_1_.func_149465_i() && var15 > 0.0D) {
this.field_147369_b.func_70664_aZ();
}
this.field_147369_b.func_70091_d(var13, var15, var17);
this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i();
this.field_147369_b.func_71000_j(var13, var15, var17);
double var29 = var15;
var13 = var5 - this.field_147369_b.field_70165_t;
var15 = var7 - this.field_147369_b.field_70163_u;
if(var15 > -0.5D || var15 < 0.5D) {
var15 = 0.0D;
}
var17 = var9 - this.field_147369_b.field_70161_v;
var25 = var13 * var13 + var15 * var15 + var17 * var17;
boolean var31 = false;
if(var25 > 0.0625D && !this.field_147369_b.func_70608_bn() && !this.field_147369_b.field_71134_c.func_73083_d()) {
var31 = true;
field_147370_c.warn(this.field_147369_b.func_70005_c_() + " moved wrongly!");
}
this.field_147369_b.func_70080_a(var5, var7, var9, var11, var12);
boolean var32 = var2.func_72945_a(this.field_147369_b, this.field_147369_b.field_70121_D.func_72329_c().func_72331_e((double)var27, (double)var27, (double)var27)).isEmpty();
if(var28 && (var31 || !var32) && !this.field_147369_b.func_70608_bn()) {
this.func_147364_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, var11, var12);
return;
}
AxisAlignedBB var33 = this.field_147369_b.field_70121_D.func_72329_c().func_72314_b((double)var27, (double)var27, (double)var27).func_72321_a(0.0D, -0.55D, 0.0D);
if(!this.field_147367_d.func_71231_X() && !this.field_147369_b.field_71134_c.func_73083_d() && !var2.func_72829_c(var33)) {
if(var29 >= -0.03125D) {
++this.field_147365_f;
if(this.field_147365_f > 80) {
field_147370_c.warn(this.field_147369_b.func_70005_c_() + " was kicked for floating too long!");
this.func_147360_c("Flying is not enabled on this server");
return;
}
}
} else {
this.field_147365_f = 0;
}
this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i();
this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b);
this.field_147369_b.func_71122_b(this.field_147369_b.field_70163_u - var3, p_147347_1_.func_149465_i());
} else if(this.field_147368_e % 20 == 0) {
this.func_147364_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, this.field_147369_b.field_70177_z, this.field_147369_b.field_70125_A);
}
}
}
public void func_147364_a(double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, float p_147364_8_) {
this.field_147380_r = false;
this.field_147373_o = p_147364_1_;
this.field_147382_p = p_147364_3_;
this.field_147381_q = p_147364_5_;
this.field_147369_b.func_70080_a(p_147364_1_, p_147364_3_, p_147364_5_, p_147364_7_, p_147364_8_);
this.field_147369_b.field_71135_a.func_147359_a(new S08PacketPlayerPosLook(p_147364_1_, p_147364_3_ + 1.6200000047683716D, p_147364_5_, p_147364_7_, p_147364_8_, false));
}
public void func_147345_a(C07PacketPlayerDigging p_147345_1_) {
WorldServer var2 = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK);
this.field_147369_b.func_143004_u();
if(p_147345_1_.func_149506_g() == 4) {
this.field_147369_b.func_71040_bB(false);
} else if(p_147345_1_.func_149506_g() == 3) {
this.field_147369_b.func_71040_bB(true);
} else if(p_147345_1_.func_149506_g() == 5) {
this.field_147369_b.func_71034_by();
} else {
boolean var3 = false;
if(p_147345_1_.func_149506_g() == 0) {
var3 = true;
}
if(p_147345_1_.func_149506_g() == 1) {
var3 = true;
}
if(p_147345_1_.func_149506_g() == 2) {
var3 = true;
}
int var4 = p_147345_1_.func_149505_c();
int var5 = p_147345_1_.func_149503_d();
int var6 = p_147345_1_.func_149502_e();
if(var3) {
double var7 = this.field_147369_b.field_70165_t - ((double)var4 + 0.5D);
double var9 = this.field_147369_b.field_70163_u - ((double)var5 + 0.5D) + 1.5D;
double var11 = this.field_147369_b.field_70161_v - ((double)var6 + 0.5D);
double var13 = var7 * var7 + var9 * var9 + var11 * var11;
if(var13 > 36.0D) {
return;
}
if(var5 >= this.field_147367_d.func_71207_Z()) {
return;
}
}
if(p_147345_1_.func_149506_g() == 0) {
if(!this.field_147367_d.func_96290_a(var2, var4, var5, var6, this.field_147369_b)) {
this.field_147369_b.field_71134_c.func_73074_a(var4, var5, var6, p_147345_1_.func_149501_f());
} else {
this.field_147369_b.field_71135_a.func_147359_a(new S23PacketBlockChange(var4, var5, var6, var2));
}
} else if(p_147345_1_.func_149506_g() == 2) {
this.field_147369_b.field_71134_c.func_73082_a(var4, var5, var6);
if(var2.func_147439_a(var4, var5, var6).func_149688_o() != Material.field_151579_a) {
this.field_147369_b.field_71135_a.func_147359_a(new S23PacketBlockChange(var4, var5, var6, var2));
}
} else if(p_147345_1_.func_149506_g() == 1) {
this.field_147369_b.field_71134_c.func_73073_c(var4, var5, var6);
if(var2.func_147439_a(var4, var5, var6).func_149688_o() != Material.field_151579_a) {
this.field_147369_b.field_71135_a.func_147359_a(new S23PacketBlockChange(var4, var5, var6, var2));
}
}
}
}
public void func_147346_a(C08PacketPlayerBlockPlacement p_147346_1_) {
WorldServer var2 = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK);
ItemStack var3 = this.field_147369_b.field_71071_by.func_70448_g();
boolean var4 = false;
int var5 = p_147346_1_.func_149576_c();
int var6 = p_147346_1_.func_149571_d();
int var7 = p_147346_1_.func_149570_e();
int var8 = p_147346_1_.func_149568_f();
this.field_147369_b.func_143004_u();
if(p_147346_1_.func_149568_f() == 255) {
if(var3 == null) {
return;
}
this.field_147369_b.field_71134_c.func_73085_a(this.field_147369_b, var2, var3);
} else if(p_147346_1_.func_149571_d() >= this.field_147367_d.func_71207_Z() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.field_147367_d.func_71207_Z())) {
ChatComponentTranslation var9 = new ChatComponentTranslation("build.tooHigh", new Object[]{Integer.valueOf(this.field_147367_d.func_71207_Z())});
var9.func_150256_b().func_150238_a(EnumChatFormatting.RED);
this.field_147369_b.field_71135_a.func_147359_a(new S02PacketChat(var9));
var4 = true;
} else {
if(this.field_147380_r && this.field_147369_b.func_70092_e((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.field_147367_d.func_96290_a(var2, var5, var6, var7, this.field_147369_b)) {
this.field_147369_b.field_71134_c.func_73078_a(this.field_147369_b, var2, var3, var5, var6, var7, var8, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j());
}
var4 = true;
}
if(var4) {
this.field_147369_b.field_71135_a.func_147359_a(new S23PacketBlockChange(var5, var6, var7, var2));
if(var8 == 0) {
--var6;
}
if(var8 == 1) {
++var6;
}
if(var8 == 2) {
--var7;
}
if(var8 == 3) {
++var7;
}
if(var8 == 4) {
--var5;
}
if(var8 == 5) {
++var5;
}
this.field_147369_b.field_71135_a.func_147359_a(new S23PacketBlockChange(var5, var6, var7, var2));
}
var3 = this.field_147369_b.field_71071_by.func_70448_g();
if(var3 != null && var3.field_77994_a == 0) {
this.field_147369_b.field_71071_by.field_70462_a[this.field_147369_b.field_71071_by.field_70461_c] = null;
var3 = null;
}
if(var3 == null || var3.func_77988_m() == 0) {
this.field_147369_b.field_71137_h = true;
this.field_147369_b.field_71071_by.field_70462_a[this.field_147369_b.field_71071_by.field_70461_c] = ItemStack.func_77944_b(this.field_147369_b.field_71071_by.field_70462_a[this.field_147369_b.field_71071_by.field_70461_c]);
Slot var10 = this.field_147369_b.field_71070_bA.func_75147_a(this.field_147369_b.field_71071_by, this.field_147369_b.field_71071_by.field_70461_c);
this.field_147369_b.field_71070_bA.func_75142_b();
this.field_147369_b.field_71137_h = false;
if(!ItemStack.func_77989_b(this.field_147369_b.field_71071_by.func_70448_g(), p_147346_1_.func_149574_g())) {
this.func_147359_a(new S2FPacketSetSlot(this.field_147369_b.field_71070_bA.field_75152_c, var10.field_75222_d, this.field_147369_b.field_71071_by.func_70448_g()));
}
}
}
public void func_147231_a(IChatComponent p_147231_1_) {
field_147370_c.info(this.field_147369_b.func_70005_c_() + " lost connection: " + p_147231_1_);
this.field_147367_d.func_147132_au();
ChatComponentTranslation var2 = new ChatComponentTranslation("multiplayer.player.left", new Object[]{this.field_147369_b.func_145748_c_()});
var2.func_150256_b().func_150238_a(EnumChatFormatting.YELLOW);
this.field_147367_d.func_71203_ab().func_148539_a(var2);
this.field_147369_b.func_71123_m();
this.field_147367_d.func_71203_ab().func_72367_e(this.field_147369_b);
if(this.field_147367_d.func_71264_H() && this.field_147369_b.func_70005_c_().equals(this.field_147367_d.func_71214_G())) {
field_147370_c.info("Stopping singleplayer server as player logged out");
this.field_147367_d.func_71263_m();
}
}
public void func_147359_a(final Packet p_147359_1_) {
if(p_147359_1_ instanceof S02PacketChat) {
S02PacketChat var2 = (S02PacketChat)p_147359_1_;
EntityPlayer.EnumChatVisibility var3 = this.field_147369_b.func_147096_v();
if(var3 == EntityPlayer.EnumChatVisibility.HIDDEN) {
return;
}
if(var3 == EntityPlayer.EnumChatVisibility.SYSTEM && !var2.func_148916_d()) {
return;
}
}
try {
this.field_147371_a.func_150725_a(p_147359_1_, new GenericFutureListener[0]);
} catch (Throwable var5) {
CrashReport var6 = CrashReport.func_85055_a(var5, "Sending packet");
CrashReportCategory var4 = var6.func_85058_a("Packet being sent");
var4.func_71500_a("Packet class", new Callable() {
private static final String __OBFID = "CL_00001454";
public String call() {
return p_147359_1_.getClass().getCanonicalName();
}
// $FF: synthetic method
public Object call() {
return this.call();
}
});
throw new ReportedException(var6);
}
}
public void func_147355_a(C09PacketHeldItemChange p_147355_1_) {
if(p_147355_1_.func_149614_c() >= 0 && p_147355_1_.func_149614_c() < InventoryPlayer.func_70451_h()) {
this.field_147369_b.field_71071_by.field_70461_c = p_147355_1_.func_149614_c();
this.field_147369_b.func_143004_u();
} else {
field_147370_c.warn(this.field_147369_b.func_70005_c_() + " tried to set an invalid carried item");
}
}
public void func_147354_a(C01PacketChatMessage p_147354_1_) {
if(this.field_147369_b.func_147096_v() == EntityPlayer.EnumChatVisibility.HIDDEN) {
ChatComponentTranslation var4 = new ChatComponentTranslation("chat.cannotSend", new Object[0]);
var4.func_150256_b().func_150238_a(EnumChatFormatting.RED);
this.func_147359_a(new S02PacketChat(var4));
} else {
this.field_147369_b.func_143004_u();
String var2 = p_147354_1_.func_149439_c();
var2 = StringUtils.normalizeSpace(var2);
for(int var3 = 0; var3 < var2.length(); ++var3) {
if(!ChatAllowedCharacters.func_71566_a(var2.charAt(var3))) {
this.func_147360_c("Illegal characters in chat");
return;
}
}
if(var2.startsWith("/")) {
this.func_147361_d(var2);
} else {
ChatComponentTranslation var5 = new ChatComponentTranslation("chat.type.text", new Object[]{this.field_147369_b.func_145748_c_(), var2});
this.field_147367_d.func_71203_ab().func_148544_a(var5, false);
}
this.field_147374_l += 20;
if(this.field_147374_l > 200 && !this.field_147367_d.func_71203_ab().func_152596_g(this.field_147369_b.func_146103_bH())) {
this.func_147360_c("disconnect.spam");
}
}
}
private void func_147361_d(String p_147361_1_) {
this.field_147367_d.func_71187_D().func_71556_a(this.field_147369_b, p_147361_1_);
}
public void func_147350_a(C0APacketAnimation p_147350_1_) {
this.field_147369_b.func_143004_u();
if(p_147350_1_.func_149421_d() == 1) {
this.field_147369_b.func_71038_i();
}
}
public void func_147357_a(C0BPacketEntityAction p_147357_1_) {
this.field_147369_b.func_143004_u();
if(p_147357_1_.func_149513_d() == 1) {
this.field_147369_b.func_70095_a(true);
} else if(p_147357_1_.func_149513_d() == 2) {
this.field_147369_b.func_70095_a(false);
} else if(p_147357_1_.func_149513_d() == 4) {
this.field_147369_b.func_70031_b(true);
} else if(p_147357_1_.func_149513_d() == 5) {
this.field_147369_b.func_70031_b(false);
} else if(p_147357_1_.func_149513_d() == 3) {
this.field_147369_b.func_70999_a(false, true, true);
this.field_147380_r = false;
} else if(p_147357_1_.func_149513_d() == 6) {
if(this.field_147369_b.field_70154_o != null && this.field_147369_b.field_70154_o instanceof EntityHorse) {
((EntityHorse)this.field_147369_b.field_70154_o).func_110206_u(p_147357_1_.func_149512_e());
}
} else if(p_147357_1_.func_149513_d() == 7 && this.field_147369_b.field_70154_o != null && this.field_147369_b.field_70154_o instanceof EntityHorse) {
((EntityHorse)this.field_147369_b.field_70154_o).func_110199_f(this.field_147369_b);
}
}
public void func_147340_a(C02PacketUseEntity p_147340_1_) {
WorldServer var2 = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK);
Entity var3 = p_147340_1_.func_149564_a(var2);
this.field_147369_b.func_143004_u();
if(var3 != null) {
boolean var4 = this.field_147369_b.func_70685_l(var3);
double var5 = 36.0D;
if(!var4) {
var5 = 9.0D;
}
if(this.field_147369_b.func_70068_e(var3) < var5) {
if(p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.INTERACT) {
this.field_147369_b.func_70998_m(var3);
} else if(p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.ATTACK) {
if(var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.field_147369_b) {
this.func_147360_c("Attempting to attack an invalid entity");
this.field_147367_d.func_71236_h("Player " + this.field_147369_b.func_70005_c_() + " tried to attack an invalid entity");
return;
}
this.field_147369_b.func_71059_n(var3);
}
}
}
}
public void func_147342_a(C16PacketClientStatus p_147342_1_) {
this.field_147369_b.func_143004_u();
C16PacketClientStatus.EnumState var2 = p_147342_1_.func_149435_c();
switch(NetHandlerPlayServer.SwitchEnumState.field_151290_a[var2.ordinal()]) {
case 1:
if(this.field_147369_b.field_71136_j) {
this.field_147369_b = this.field_147367_d.func_71203_ab().func_72368_a(this.field_147369_b, 0, true);
} else if(this.field_147369_b.func_71121_q().func_72912_H().func_76093_s()) {
if(this.field_147367_d.func_71264_H() && this.field_147369_b.func_70005_c_().equals(this.field_147367_d.func_71214_G())) {
this.field_147369_b.field_71135_a.func_147360_c("You have died. Game over, man, it\'s game over!");
this.field_147367_d.func_71272_O();
} else {
UserListBansEntry var3 = new UserListBansEntry(this.field_147369_b.func_146103_bH(), (Date)null, "(You just lost the game)", (Date)null, "Death in Hardcore");
this.field_147367_d.func_71203_ab().func_152608_h().func_152687_a(var3);
this.field_147369_b.field_71135_a.func_147360_c("You have died. Game over, man, it\'s game over!");
}
} else {
if(this.field_147369_b.func_110143_aJ() > 0.0F) {
return;
}
this.field_147369_b = this.field_147367_d.func_71203_ab().func_72368_a(this.field_147369_b, 0, false);
}
break;
case 2:
this.field_147369_b.func_147099_x().func_150876_a(this.field_147369_b);
break;
case 3:
this.field_147369_b.func_71029_a(AchievementList.field_76004_f);
}
}
public void func_147356_a(C0DPacketCloseWindow p_147356_1_) {
this.field_147369_b.func_71128_l();
}
public void func_147351_a(C0EPacketClickWindow p_147351_1_) {
this.field_147369_b.func_143004_u();
if(this.field_147369_b.field_71070_bA.field_75152_c == p_147351_1_.func_149548_c() && this.field_147369_b.field_71070_bA.func_75129_b(this.field_147369_b)) {
ItemStack var2 = this.field_147369_b.field_71070_bA.func_75144_a(p_147351_1_.func_149544_d(), p_147351_1_.func_149543_e(), p_147351_1_.func_149542_h(), this.field_147369_b);
if(ItemStack.func_77989_b(p_147351_1_.func_149546_g(), var2)) {
this.field_147369_b.field_71135_a.func_147359_a(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), true));
this.field_147369_b.field_71137_h = true;
this.field_147369_b.field_71070_bA.func_75142_b();
this.field_147369_b.func_71113_k();
this.field_147369_b.field_71137_h = false;
} else {
this.field_147372_n.func_76038_a(this.field_147369_b.field_71070_bA.field_75152_c, Short.valueOf(p_147351_1_.func_149547_f()));
this.field_147369_b.field_71135_a.func_147359_a(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), false));
this.field_147369_b.field_71070_bA.func_75128_a(this.field_147369_b, false);
ArrayList var3 = new ArrayList();
for(int var4 = 0; var4 < this.field_147369_b.field_71070_bA.field_75151_b.size(); ++var4) {
var3.add(((Slot)this.field_147369_b.field_71070_bA.field_75151_b.get(var4)).func_75211_c());
}
this.field_147369_b.func_71110_a(this.field_147369_b.field_71070_bA, var3);
}
}
}
public void func_147338_a(C11PacketEnchantItem p_147338_1_) {
this.field_147369_b.func_143004_u();
if(this.field_147369_b.field_71070_bA.field_75152_c == p_147338_1_.func_149539_c() && this.field_147369_b.field_71070_bA.func_75129_b(this.field_147369_b)) {
this.field_147369_b.field_71070_bA.func_75140_a(this.field_147369_b, p_147338_1_.func_149537_d());
this.field_147369_b.field_71070_bA.func_75142_b();
}
}
public void func_147344_a(C10PacketCreativeInventoryAction p_147344_1_) {
if(this.field_147369_b.field_71134_c.func_73083_d()) {
boolean var2 = p_147344_1_.func_149627_c() < 0;
ItemStack var3 = p_147344_1_.func_149625_d();
boolean var4 = p_147344_1_.func_149627_c() >= 1 && p_147344_1_.func_149627_c() < 36 + InventoryPlayer.func_70451_h();
boolean var5 = var3 == null || var3.func_77973_b() != null;
boolean var6 = var3 == null || var3.func_77960_j() >= 0 && var3.field_77994_a <= 64 && var3.field_77994_a > 0;
if(var4 && var5 && var6) {
if(var3 == null) {
this.field_147369_b.field_71069_bz.func_75141_a(p_147344_1_.func_149627_c(), (ItemStack)null);
} else {
this.field_147369_b.field_71069_bz.func_75141_a(p_147344_1_.func_149627_c(), var3);
}
this.field_147369_b.field_71069_bz.func_75128_a(this.field_147369_b, true);
} else if(var2 && var5 && var6 && this.field_147375_m < 200) {
this.field_147375_m += 20;
EntityItem var7 = this.field_147369_b.func_71019_a(var3, true);
if(var7 != null) {
var7.func_70288_d();
}
}
}
}
public void func_147339_a(C0FPacketConfirmTransaction p_147339_1_) {
Short var2 = (Short)this.field_147372_n.func_76041_a(this.field_147369_b.field_71070_bA.field_75152_c);
if(var2 != null && p_147339_1_.func_149533_d() == var2.shortValue() && this.field_147369_b.field_71070_bA.field_75152_c == p_147339_1_.func_149532_c() && !this.field_147369_b.field_71070_bA.func_75129_b(this.field_147369_b)) {
this.field_147369_b.field_71070_bA.func_75128_a(this.field_147369_b, true);
}
}
public void func_147343_a(C12PacketUpdateSign p_147343_1_) {
this.field_147369_b.func_143004_u();
WorldServer var2 = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK);
if(var2.func_72899_e(p_147343_1_.func_149588_c(), p_147343_1_.func_149586_d(), p_147343_1_.func_149585_e())) {
TileEntity var3 = var2.func_147438_o(p_147343_1_.func_149588_c(), p_147343_1_.func_149586_d(), p_147343_1_.func_149585_e());
if(var3 instanceof TileEntitySign) {
TileEntitySign var4 = (TileEntitySign)var3;
if(!var4.func_145914_a() || var4.func_145911_b() != this.field_147369_b) {
this.field_147367_d.func_71236_h("Player " + this.field_147369_b.func_70005_c_() + " just tried to change non-editable sign");
return;
}
}
int var6;
int var8;
for(var8 = 0; var8 < 4; ++var8) {
boolean var5 = true;
if(p_147343_1_.func_149589_f()[var8].length() > 15) {
var5 = false;
} else {
for(var6 = 0; var6 < p_147343_1_.func_149589_f()[var8].length(); ++var6) {
if(!ChatAllowedCharacters.func_71566_a(p_147343_1_.func_149589_f()[var8].charAt(var6))) {
var5 = false;
}
}
}
if(!var5) {
p_147343_1_.func_149589_f()[var8] = "!?";
}
}
if(var3 instanceof TileEntitySign) {
var8 = p_147343_1_.func_149588_c();
int var9 = p_147343_1_.func_149586_d();
var6 = p_147343_1_.func_149585_e();
TileEntitySign var7 = (TileEntitySign)var3;
System.arraycopy(p_147343_1_.func_149589_f(), 0, var7.field_145915_a, 0, 4);
var7.func_70296_d();
var2.func_147471_g(var8, var9, var6);
}
}
}
public void func_147353_a(C00PacketKeepAlive p_147353_1_) {
if(p_147353_1_.func_149460_c() == this.field_147378_h) {
int var2 = (int)(this.func_147363_d() - this.field_147379_i);
this.field_147369_b.field_71138_i = (this.field_147369_b.field_71138_i * 3 + var2) / 4;
}
}
private long func_147363_d() {
return System.nanoTime() / 1000000L;
}
public void func_147348_a(C13PacketPlayerAbilities p_147348_1_) {
this.field_147369_b.field_71075_bZ.field_75100_b = p_147348_1_.func_149488_d() && this.field_147369_b.field_71075_bZ.field_75101_c;
}
public void func_147341_a(C14PacketTabComplete p_147341_1_) {
ArrayList var2 = Lists.newArrayList();
Iterator var3 = this.field_147367_d.func_71248_a(this.field_147369_b, p_147341_1_.func_149419_c()).iterator();
while(var3.hasNext()) {
String var4 = (String)var3.next();
var2.add(var4);
}
this.field_147369_b.field_71135_a.func_147359_a(new S3APacketTabComplete((String[])var2.toArray(new String[var2.size()])));
}
public void func_147352_a(C15PacketClientSettings p_147352_1_) {
this.field_147369_b.func_147100_a(p_147352_1_);
}
public void func_147349_a(C17PacketCustomPayload p_147349_1_) {
PacketBuffer var2;
ItemStack var3;
ItemStack var4;
if("MC|BEdit".equals(p_147349_1_.func_149559_c())) {
var2 = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e()));
try {
var3 = var2.func_150791_c();
if(var3 == null) {
return;
}
if(!ItemWritableBook.func_150930_a(var3.func_77978_p())) {
throw new IOException("Invalid book tag!");
}
var4 = this.field_147369_b.field_71071_by.func_70448_g();
if(var4 != null) {
if(var3.func_77973_b() == Items.field_151099_bA && var3.func_77973_b() == var4.func_77973_b()) {
var4.func_77983_a("pages", var3.func_77978_p().func_150295_c("pages", 8));
}
return;
}
} catch (Exception var38) {
field_147370_c.error("Couldn\'t handle book info", var38);
return;
} finally {
var2.release();
}
return;
} else if("MC|BSign".equals(p_147349_1_.func_149559_c())) {
var2 = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e()));
try {
var3 = var2.func_150791_c();
if(var3 == null) {
return;
}
if(!ItemEditableBook.func_77828_a(var3.func_77978_p())) {
throw new IOException("Invalid book tag!");
}
var4 = this.field_147369_b.field_71071_by.func_70448_g();
if(var4 != null) {
if(var3.func_77973_b() == Items.field_151164_bB && var4.func_77973_b() == Items.field_151099_bA) {
var4.func_77983_a("author", new NBTTagString(this.field_147369_b.func_70005_c_()));
var4.func_77983_a("title", new NBTTagString(var3.func_77978_p().func_74779_i("title")));
var4.func_77983_a("pages", var3.func_77978_p().func_150295_c("pages", 8));
var4.func_150996_a(Items.field_151164_bB);
}
return;
}
} catch (Exception var36) {
field_147370_c.error("Couldn\'t sign book", var36);
return;
} finally {
var2.release();
}
return;
} else {
DataInputStream var40;
int var42;
if("MC|TrSel".equals(p_147349_1_.func_149559_c())) {
try {
var40 = new DataInputStream(new ByteArrayInputStream(p_147349_1_.func_149558_e()));
var42 = var40.readInt();
Container var45 = this.field_147369_b.field_71070_bA;
if(var45 instanceof ContainerMerchant) {
((ContainerMerchant)var45).func_75175_c(var42);
}
} catch (Exception var35) {
field_147370_c.error("Couldn\'t select trade", var35);
}
} else if("MC|AdvCdm".equals(p_147349_1_.func_149559_c())) {
if(!this.field_147367_d.func_82356_Z()) {
this.field_147369_b.func_145747_a(new ChatComponentTranslation("advMode.notEnabled", new Object[0]));
} else if(this.field_147369_b.func_70003_b(2, "") && this.field_147369_b.field_71075_bZ.field_75098_d) {
var2 = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e()));
try {
byte var43 = var2.readByte();
CommandBlockLogic var46 = null;
if(var43 == 0) {
TileEntity var5 = this.field_147369_b.field_70170_p.func_147438_o(var2.readInt(), var2.readInt(), var2.readInt());
if(var5 instanceof TileEntityCommandBlock) {
var46 = ((TileEntityCommandBlock)var5).func_145993_a();
}
} else if(var43 == 1) {
Entity var48 = this.field_147369_b.field_70170_p.func_73045_a(var2.readInt());
if(var48 instanceof EntityMinecartCommandBlock) {
var46 = ((EntityMinecartCommandBlock)var48).func_145822_e();
}
}
String var49 = var2.func_150789_c(var2.readableBytes());
if(var46 != null) {
var46.func_145752_a(var49);
var46.func_145756_e();
this.field_147369_b.func_145747_a(new ChatComponentTranslation("advMode.setCommand.success", new Object[]{var49}));
}
} catch (Exception var33) {
field_147370_c.error("Couldn\'t set command block", var33);
} finally {
var2.release();
}
} else {
this.field_147369_b.func_145747_a(new ChatComponentTranslation("advMode.notAllowed", new Object[0]));
}
} else if("MC|Beacon".equals(p_147349_1_.func_149559_c())) {
if(this.field_147369_b.field_71070_bA instanceof ContainerBeacon) {
try {
var40 = new DataInputStream(new ByteArrayInputStream(p_147349_1_.func_149558_e()));
var42 = var40.readInt();
int var47 = var40.readInt();
ContainerBeacon var50 = (ContainerBeacon)this.field_147369_b.field_71070_bA;
Slot var6 = var50.func_75139_a(0);
if(var6.func_75216_d()) {
var6.func_75209_a(1);
TileEntityBeacon var7 = var50.func_148327_e();
var7.func_146001_d(var42);
var7.func_146004_e(var47);
var7.func_70296_d();
}
} catch (Exception var32) {
field_147370_c.error("Couldn\'t set beacon", var32);
}
}
} else if("MC|ItemName".equals(p_147349_1_.func_149559_c()) && this.field_147369_b.field_71070_bA instanceof ContainerRepair) {
ContainerRepair var41 = (ContainerRepair)this.field_147369_b.field_71070_bA;
if(p_147349_1_.func_149558_e() != null && p_147349_1_.func_149558_e().length >= 1) {
String var44 = ChatAllowedCharacters.func_71565_a(new String(p_147349_1_.func_149558_e(), Charsets.UTF_8));
if(var44.length() <= 30) {
var41.func_82850_a(var44);
}
} else {
var41.func_82850_a("");
}
}
}
}
public void func_147232_a(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_) {
if(p_147232_2_ != EnumConnectionState.PLAY) {
throw new IllegalStateException("Unexpected change in protocol!");
}
}
// $FF: synthetic class
static final class SwitchEnumState {
// $FF: synthetic field
static final int[] field_151290_a = new int[C16PacketClientStatus.EnumState.values().length];
private static final String __OBFID = "CL_00001455";
static {
try {
field_151290_a[C16PacketClientStatus.EnumState.PERFORM_RESPAWN.ordinal()] = 1;
} catch (NoSuchFieldError var3) {
;
}
try {
field_151290_a[C16PacketClientStatus.EnumState.REQUEST_STATS.ordinal()] = 2;
} catch (NoSuchFieldError var2) {
;
}
try {
field_151290_a[C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT.ordinal()] = 3;
} catch (NoSuchFieldError var1) {
;
}
}
}
}
|
[
"honzajurak@hotmail.co.uk"
] |
honzajurak@hotmail.co.uk
|
79548dc4ae00941563c0a8426831b9e803b7ce39
|
d502ba2480aea84241f3bd98578a887849df9df8
|
/Arsen Aleksanyan/Design Patterns/FlyweightAndProxy/src/com/synisys/designpatterns/flyweight/naturalproducts/Apple.java
|
d59e79901e365917fc1d278406867a9611bfb4ea
|
[] |
no_license
|
synergytrainings/design-patterns
|
821ba0e4c6c0c09ef892312256f6cdcf7e0736f4
|
f0fd39de32c3f9f7f6b13377904a0c29589720bc
|
refs/heads/master
| 2020-12-25T19:26:01.181499
| 2015-04-17T05:15:03
| 2015-04-17T05:15:17
| 25,835,095
| 4
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 581
|
java
|
package com.synisys.designpatterns.flyweight.naturalproducts;
import com.synisys.designpatterns.flyweight.utils.Vitamin;
class Apple extends NaturalProduct {
Apple(){
vitmainWeights.put(Vitamin.A, 0.003);
vitmainWeights.put(Vitamin.B1, 0.017);
vitmainWeights.put(Vitamin.B2, 0.026);
vitmainWeights.put(Vitamin.B3, 0.091);
vitmainWeights.put(Vitamin.B5, 0.061);
vitmainWeights.put(Vitamin.B6, 0.041);
vitmainWeights.put(Vitamin.B9, 0.003);
vitmainWeights.put(Vitamin.C, 4.6);
vitmainWeights.put(Vitamin.E, 0.18);
vitmainWeights.put(Vitamin.K, 0.0022);
}
}
|
[
"alexanyan.arsen@arm.synisys.com"
] |
alexanyan.arsen@arm.synisys.com
|
4fdc30781cf072b79e987d5d59b04dc3036e95d8
|
5ffbd75147bd0f2ddb0c520d2a95255d2d8973f1
|
/drouter/src/main/java/d/drouter/RouterResponse.java
|
1dc4abc623f6d79cef55eb22855873d2b03afd46
|
[] |
no_license
|
wu464995183/DRouter
|
4b4474fda4b311842af9aa654aac2e6b2e7dfab7
|
f7aeb6acb7499d1da6a8760bffdb0c19dfc5711a
|
refs/heads/master
| 2020-03-31T12:48:10.121101
| 2018-10-16T09:23:58
| 2018-10-16T09:23:58
| 152,229,841
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 886
|
java
|
package d.drouter;
public class RouterResponse {
private int mErrorCode;
private String mErrorMassage;
public RouterResponse(Builder builder) {
this.mErrorCode = builder.mErrorCode;
this.mErrorMassage = builder.mErrorMassage;
}
public int getErrorCode() {
return mErrorCode;
}
public String getErrorMassage() {
return mErrorMassage;
}
public static class Builder {
private int mErrorCode;
private String mErrorMassage;
public Builder errorCode(int mErrorCode) {
this.mErrorCode = mErrorCode;
return this;
}
public Builder errorMassage(String mErrorMassage) {
this.mErrorMassage = mErrorMassage;
return this;
}
public RouterResponse build() {
return new RouterResponse(this);
}
}
}
|
[
"wu464995183@gmail.com"
] |
wu464995183@gmail.com
|
8f599d6fd3e7156d50c9875fc80cec22843b9852
|
61829d2c63ae8c8638f6c95db0fc029d0ff05660
|
/2016_1/Compilador/src/br/com/ceducarneiro/compilador/Token.java
|
144f8952cb657446bfe81fa2fe9ada7242293043
|
[] |
no_license
|
edu1910/compiladores
|
b404d1f493bf436165958ac23cef735519fe5c88
|
49041b352cb07618d9ab87356432d175fd63633a
|
refs/heads/master
| 2021-01-21T04:41:12.502507
| 2016-06-16T23:42:55
| 2016-06-16T23:42:55
| 53,173,044
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 841
|
java
|
package br.com.ceducarneiro.compilador;
public class Token {
private String lexema;
private TipoToken tipo;
public Token(TipoToken tipo) {
setTipo(tipo);
}
public Token(TipoToken tipo, String lexema) {
setTipo(tipo);
setLexema(lexema);
}
public String getLexema() {
return lexema;
}
public void setLexema(String lexema) {
this.lexema = lexema;
}
public TipoToken getTipo() {
return tipo;
}
public void setTipo(TipoToken tipo) {
this.tipo = tipo;
}
@Override
public String toString() {
String str;
if (lexema != null) {
str = String.format("<%s,'%s'>", tipo.name(), lexema);
} else {
str = String.format("<%s>", tipo.name());
}
return str;
}
}
|
[
"edu1910@gmail.com"
] |
edu1910@gmail.com
|
84dc56f7d0e7b56705fc622fdfd15e97ed25cc87
|
c2e1c6958a779729e2a21d0441355b6b0db18351
|
/Consorcio/src/utils/Dentre.java
|
3e669d529e458ea93953acf56a22e2f1ee9445b4
|
[] |
no_license
|
MauroEmiliano/universidad
|
aae6ab49725cea0b53d9e226e68e6efb1edf8145
|
e8838b40b62ac07f937ae3b710af71caf929ffc5
|
refs/heads/master
| 2021-09-04T09:21:44.152455
| 2018-01-17T17:25:18
| 2018-01-17T17:25:18
| 112,340,869
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,186
|
java
|
package utils;
import java.io.*;
public class Dentre{
public static String texto(String mensaje)
{
try
{
System.out.print(mensaje);
String entrada = new BufferedReader(
new InputStreamReader( System.in)).readLine();
return entrada;
}
catch(IOException e)
{
System.out.print(e);
System.exit(1);
return e.toString();
}
}
/* Metodo que permite entrar UN caracter y, como el anterior, se le pasa como
argumento el texto para solicitar dicho caracter */
public static char caracter(String mensaje)
{
String aux = texto( mensaje );
return aux.charAt(0);
}
public static int entero(String mensaje)
{
Integer dato = new Integer(texto(mensaje));
return dato.intValue();
}
public static long largo(String mensaje)
{
Long dato = new Long(texto(mensaje));
return dato.longValue();
}
public static float flotante(String mensaje)
{
Float dato = new Float(texto(mensaje));
return dato.floatValue();
}
public static double doble(String mensaje)
{
Double dato = new Double(texto(mensaje));
return dato.doubleValue();
}
}
|
[
"mauroemif@gmail.com"
] |
mauroemif@gmail.com
|
05cb66a464bc780291c150302df070b377b0e287
|
25391e4adb0dd6838c45c60016b22888534ac27d
|
/src/main/java/com/muhammedtopgul/ch01/greeting02/GreetingProvider.java
|
032ffa6d922c2cb74049fd6ed4483a9c6d3992f9
|
[] |
no_license
|
muhammed-topgul/spring-core
|
6b1b35adb36b7b6c198b28169f57389f7d85ac0f
|
0242e66d1ff8af84a9c7fb122ada875e9316a9eb
|
refs/heads/master
| 2023-06-14T09:11:47.847086
| 2021-07-14T07:44:39
| 2021-07-14T07:44:39
| 380,594,020
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 177
|
java
|
package com.muhammedtopgul.ch01.greeting02;
/*
* created by Muhammed Topgul
* on 27/06/2021
* at 13:20
*/
public interface GreetingProvider {
String getGreeting();
}
|
[
"muhammedtopgul.29@gmail.com"
] |
muhammedtopgul.29@gmail.com
|
919b58768aa889c65513a6d0eefa00e1a804e137
|
1a2a9ab9755f2abb991a1aa654f7c6348c8db141
|
/src/main/java/com/jackila/dbdemo/Executor/TaskOne.java
|
77d1a600386cc52a65a7370d970e5c442e0b262b
|
[] |
no_license
|
jackila/java-practice
|
6a377b2d5209d19e6df34a1e8fb8b25afc113453
|
018ee4d192289665de1b17452c9258e9bc693f1d
|
refs/heads/master
| 2020-03-07T14:28:13.752093
| 2018-03-31T11:50:13
| 2018-03-31T11:50:13
| 127,527,287
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 355
|
java
|
package com.jackila.dbdemo.Executor;
/**
* create by jackila ON 22/01/2018
*/
public class TaskOne implements Runnable {
@Override
public void run() {
System.out.println("Executing Task One");
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
|
[
"626686039@qq.com"
] |
626686039@qq.com
|
56b9355dc48686b8c4b7adbe97c18a97c4566b16
|
190439b8aeae794f3cb9d4744ebec840f490c47a
|
/DistributedGraphql-cityService/src/main/java/alros/demo/distributedgraphql/resolver/Query.java
|
d0c36e1cdbd82c525ad10683836e698251dca686
|
[] |
no_license
|
skayvanfar/distributed-graphql
|
f7e7dc4baac8a0a19b289bb3ae986755ff4fa003
|
f4ee297ea04a1ec25f1490477a52b88bca68955d
|
refs/heads/main
| 2023-06-20T02:25:58.372897
| 2021-07-04T13:51:17
| 2021-07-04T13:51:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 903
|
java
|
package alros.demo.distributedgraphql.resolver;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import alros.demo.distributedgraphql.City;
import graphql.kickstart.tools.GraphQLQueryResolver;
@Component
public class Query implements GraphQLQueryResolver {
private static final Logger LOG = LoggerFactory.getLogger(Query.class);
@Autowired
private CityRepository countryRepository;
public List<City> allCities() {
LOG.info("allCities");
return countryRepository.getAllCities();
}
public City city(String id) {
LOG.info("city {}", id);
return countryRepository.getCity(id);
}
public List<City> citiesInCountry(String countryId) {
LOG.info("citiesInCountry {}", countryId);
return countryRepository.citiesInCountry(countryId);
}
}
|
[
"alberto.rossotto@gmail.com"
] |
alberto.rossotto@gmail.com
|
544fde0d0a8e6b16298d44c2c5b8babf0886555e
|
e438bd23bb30ffe7dc2be31550165af56671ae73
|
/friendsbook-data-boot/src/main/java/com/friendsbook/data/boot/FriendsbookDataApplication.java
|
0185dbe3285205c3764061ac31bc263e91e847c2
|
[] |
no_license
|
innoproject/friendsbook-parent
|
76550535edaff33487ed6f33aaaecca1da80c1e3
|
98b4f19349efdc2e809d4fb9e79b9bea4a48315d
|
refs/heads/master
| 2021-01-20T03:56:46.211552
| 2017-08-25T14:44:59
| 2017-08-25T14:44:59
| 101,378,285
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 80
|
java
|
package com.friendsbook.data.boot;
public class FriendsbookDataApplication {
}
|
[
"viveksingh@Viveks-MacBook-Air.local"
] |
viveksingh@Viveks-MacBook-Air.local
|
fd342f478c1d41af07ca3e36754d881f30f2a2b4
|
550b8d4ad05b663af287be0ece488fab333da402
|
/src/main/java/com/buy/together/util/MailSend.java
|
fe519df449bc981aa070b0fc9fee307ba4a47be3
|
[] |
no_license
|
qjsrodkfhd/finalProjectBuyTogether
|
951bc0c5a381cc8eaf8dd20859691ef1542ac160
|
7457608b41ff1a34ff82200e09969dcbbcb45333
|
refs/heads/master
| 2022-12-23T10:25:46.537815
| 2017-08-05T13:29:19
| 2017-08-05T13:29:19
| 75,138,775
| 0
| 12
| null | 2022-12-16T05:49:11
| 2016-11-30T01:32:14
|
CSS
|
UTF-8
|
Java
| false
| false
| 2,281
|
java
|
package com.buy.together.util;
import java.util.Date;
import java.util.Properties;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class MailSend {
public String sendMail(String toEmail, String randomKey) throws Exception {
//인증번호(4자리) 생성
Properties p = System.getProperties();
p.put("mail.smtp.starttls.enable", "true");// gmail은 무조건 true 고정
p.put("mail.smtp.host", "smtp.gmail.com");// smtp 서버 주소
p.put("mail.smtp.auth", "true");// gmail은 무조건 true 고정
p.put("mail.smtp.port", "587");// gmail 포트
Authenticator auth = new MyAuthentication();
// session 생성 및 MimeMessage생성
Session session = Session.getDefaultInstance(p, auth);
MimeMessage msg = new MimeMessage(session);
// 편지보낸시간
msg.setSentDate(new Date());
InternetAddress from = new InternetAddress();
from = new InternetAddress("nnnnnight@gmail.com");
// 이메일 발신자
msg.setFrom(from);
// 이메일 내용
String message = "같이 사냥의 임시 비밀번호는 " + "[" + randomKey + "]" + "입니다.";
// 이메일 수신자
InternetAddress to = new InternetAddress(toEmail);
msg.setRecipient(Message.RecipientType.TO, to);
// 이메일 제목
msg.setSubject("같이 사냥의 임시 비밀번호 발송입니다.", "UTF-8");
// 이메일 내용
msg.setText(message, "UTF-8");
// 이메일 헤더
msg.setHeader("content-Type", "text/html");
// 메일보내기
javax.mail.Transport.send(msg);
System.out.println("메일 전송 완료");
System.out.println(message);
return randomKey;
}
}
class MyAuthentication extends Authenticator {
PasswordAuthentication pa;
public MyAuthentication() {
String id = "nnnnnight@gmail.com";// 구글 ID
String pw = "a2164527";// 구글 비밀번호
// ID와 비밀번호를 입력한다.
pa = new PasswordAuthentication(id, pw);
}
// 시스템에서 사용하는 인증정보
public PasswordAuthentication getPasswordAuthentication() {
return pa;
}
}
|
[
"sungk1003@naver.com"
] |
sungk1003@naver.com
|
230542af5bb426d815e3ab709e5d9abb31a68e22
|
26da0aea2ab0a2266bbee962d94a96d98a770e5f
|
/nam/nam-view/src/main/java/nam/model/messaging/MessagingRecord_OverviewsSection.java
|
d6a178e196550e5ccaf1eebf786c033832cc8c28
|
[
"Apache-2.0"
] |
permissive
|
tfisher1226/ARIES
|
1de2bc076cf83488703cf18f7e3f6e3c5ef1b40b
|
814e3a4b4b48396bcd6d082e78f6519679ccaa01
|
refs/heads/master
| 2021-01-10T02:28:07.807313
| 2015-12-10T20:30:00
| 2015-12-10T20:30:00
| 44,076,313
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,033
|
java
|
package nam.model.messaging;
import java.io.Serializable;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
import org.apache.commons.lang.StringUtils;
import org.aries.ui.AbstractWizardPage;
import nam.model.Messaging;
import nam.model.util.MessagingUtil;
@SessionScoped
@Named("messagingOverviewsSection")
public class MessagingRecord_OverviewsSection extends AbstractWizardPage<Messaging> implements Serializable {
private Messaging messaging;
public MessagingRecord_OverviewsSection() {
setName("Overviews");
setUrl("overviews");
}
public Messaging getMessaging() {
return messaging;
}
public void setMessaging(Messaging messaging) {
this.messaging = messaging;
}
@Override
public void initialize(Messaging messaging) {
setEnabled(true);
setBackEnabled(true);
setNextEnabled(true);
setFinishEnabled(false);
setMessaging(messaging);
}
@Override
public void validate() {
if (messaging == null) {
validator.missing("Messaging");
} else {
}
}
}
|
[
"tfisher@kattare.com"
] |
tfisher@kattare.com
|
bac964cfa73a82c19b61c19726173f75577f3dc3
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/3/3_05727e20282af37bdd3a776e169861ba7e05b6fd/ContactMessageList/3_05727e20282af37bdd3a776e169861ba7e05b6fd_ContactMessageList_s.java
|
60f7d7b2fdda7ef78fd9b1f7e78b66d398f7ffc3
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 23,615
|
java
|
/*
* ContactMessageList.java
*
* Created on 19.02.2005, 23:54
* Copyright (c) 2005-2008, Eugene Stahov (evgs), http://bombus-im.org
*
* This program 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 2
* of the License, or (at your option) any later version.
*
* You can also redistribute and/or modify this program under the
* terms of the Psi License, specified in the accompanied COPYING
* file, as published by the Psi Project; either dated January 1st,
* 2005, or (at your option) any later version.
*
* This program 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 this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package Client;
//#ifndef WMUC
import Conference.MucContact;
//#endif
//#ifdef HISTORY
//# import History.HistoryAppend;
//#ifdef LAST_MESSAGES
//# import History.HistoryStorage;
//#endif
//#ifdef HISTORY_READER
//# import History.HistoryReader;
//#endif
//#endif
import Menu.RosterItemActions;
import Messages.MessageList;
import locale.SR;
import ui.MainBar;
import java.util.*;
import Menu.MenuCommand;
//#ifdef CLIPBOARD
//# import util.ClipBoard;
//#endif
//#ifdef ARCHIVE
import Archive.MessageArchive;
//#endif
import Menu.JuickThingsMenu;
import Messages.MessageItem;
import images.RosterIcons;
import ui.VirtualList;
//#ifdef FILE_TRANSFER
import io.file.transfer.TransferAcceptFile;
import io.file.transfer.TransferDispatcher;
//#endif
import ui.VirtualCanvas;
import ui.VirtualElement;
public class ContactMessageList extends MessageList {
public Contact contact;
MenuCommand cmdSubscribe=new MenuCommand(SR.MS_SUBSCRIBE, MenuCommand.SCREEN, 1, RosterIcons.ICON_ACCEPTAUTH);
MenuCommand cmdDecline = new MenuCommand(SR.MS_DECLINE, MenuCommand.SCREEN, 2, RosterIcons.ICON_DECLINEAUTH);
MenuCommand cmdAcceptFile = new MenuCommand("Accept", MenuCommand.SCREEN, 1, RosterIcons.ICON_ACCEPTFILE);
MenuCommand cmdDeclineFile = new MenuCommand(SR.MS_DECLINE, MenuCommand.SCREEN, 2, RosterIcons.ICON_DECLINEFILE);
MenuCommand cmdMessage=new MenuCommand(SR.MS_NEW_MESSAGE,MenuCommand.SCREEN,3, RosterIcons.ICON_NEW);
MenuCommand cmdResume=new MenuCommand(SR.MS_RESUME,MenuCommand.SCREEN,1, RosterIcons.ICON_RESUME);
MenuCommand cmdReply=new MenuCommand(SR.MS_REPLY,MenuCommand.SCREEN,4, RosterIcons.ICON_REPLY);
MenuCommand cmdQuote=new MenuCommand(SR.MS_QUOTE,MenuCommand.SCREEN,5, RosterIcons.ICON_QUOTE);
//#ifdef ARCHIVE
MenuCommand cmdArch=new MenuCommand(SR.MS_ADD_ARCHIVE,MenuCommand.SCREEN,6, RosterIcons.ICON_CHATARCHIVE);
//#endif
MenuCommand cmdPurge=new MenuCommand(SR.MS_CLEAR_LIST, MenuCommand.SCREEN, 7, RosterIcons.ICON_CLEAR);
MenuCommand cmdSelect=new MenuCommand(SR.MS_SELECT, MenuCommand.SCREEN, 8, RosterIcons.ICON_SELECT);
MenuCommand cmdActions=new MenuCommand(SR.MS_CONTACT,MenuCommand.SCREEN,9, RosterIcons.ICON_CONTACT);
MenuCommand cmdActive=new MenuCommand(SR.MS_ACTIVE_CONTACTS,MenuCommand.SCREEN,10, RosterIcons.ICON_ACTIVECONTACTS);
//#if TEMPLATES
//# MenuCommand cmdTemplate=new MenuCommand(SR.MS_SAVE_TEMPLATE,MenuCommand.SCREEN,11, RosterIcons.ICON_TEMPLATES);
//#endif
//#ifdef FILE_IO
MenuCommand cmdSaveChat=new MenuCommand(SR.MS_SAVE_CHAT, MenuCommand.SCREEN, 12, RosterIcons.ICON_SAVECHAT);
//#endif
//#ifdef HISTORY
//#ifdef HISTORY_READER
//# MenuCommand cmdReadHistory=new MenuCommand(SR.MS_HISTORY, MenuCommand.SCREEN, 13, RosterIcons.ICON_HISTORY);
//#endif
//# // if (cf.lastMessages && !contact.isHistoryLoaded()) loadRecentList();
//#endif
//#ifdef CLIPBOARD
//# MenuCommand cmdSendBuffer=new MenuCommand(SR.MS_SEND_BUFFER, MenuCommand.SCREEN, 14, RosterIcons.ICON_SENDBUF);
//#endif
//#ifdef CLIPBOARD
//# private ClipBoard clipboard=ClipBoard.getInstance();
//#endif
private boolean on_end;
private boolean composing=true;
private boolean startSelection;
/** Creates a new instance of MessageList
* @param c
*/
public ContactMessageList(Contact c) {
super(c.msgs);
this.contact = c;
sd.roster.activeContact=contact;
MainBar mb=new MainBar(contact);
setMainBarItem(mb);
on_end = false;
contact.setIncoming(0);
//#ifdef FILE_TRANSFER
contact.fileQuery=false;
//#endif
//#ifdef HISTORY
//#ifdef LAST_MESSAGES
//# if (cf.lastMessages && !contact.isHistoryLoaded()) loadRecentList();
//#endif
//#endif
if (contact.msgs.size()>0)
moveCursorTo(firstUnread());
show();
}
public final int firstUnread(){
int unreadIndex=0;
for (Enumeration e=contact.msgs.elements(); e.hasMoreElements();) {
Msg msg = ((MessageItem)e.nextElement()).msg;
if (msg.unread)
break;
if (contact.mark == unreadIndex)
break;
unreadIndex++;
}
return unreadIndex;
}
public final void commandState() {
menuName = contact.toString();
menuCommands.removeAllElements();
if (startSelection) addMenuCommand(cmdSelect);
if (contact.msgSuspended!=null) addMenuCommand(cmdResume);
Msg msg = null;
if (!contact.msgs.isEmpty()) {
msg = ((MessageItem) contact.msgs.elementAt(cursor)).msg;
}
if (msg != null) {
if (msg.messageType == Msg.MESSAGE_TYPE_AUTH) {
addMenuCommand(cmdSubscribe);
addMenuCommand(cmdDecline);
}
}
//#ifdef FILE_TRANSFER
if (msg != null) {
if (msg.messageType == Msg.MESSAGE_TYPE_FILE_REQ) {
addMenuCommand(cmdAcceptFile);
addMenuCommand(cmdDeclineFile);
}
}
//#endif
addMenuCommand(cmdMessage);
if (msg != null) {
//#ifndef WMUC
if (contact instanceof MucContact && contact.origin==Contact.ORIGIN_GROUPCHAT) {
addMenuCommand(cmdReply);
}
//#endif
addMenuCommand(cmdQuote);
addMenuCommand(cmdPurge);
if (!startSelection)
addMenuCommand(cmdSelect);
}
super.commandState();
if (contact.origin!=Contact.ORIGIN_GROUPCHAT)
addMenuCommand(cmdActions);
addMenuCommand(cmdActive);
if (msg != null) {
//#ifdef ARCHIVE
//#ifdef PLUGINS
//# if (sd.Archive)
//#endif
addMenuCommand(cmdArch);
//#endif
//#if TEMPLATES
//#ifdef PLUGINS
//# if (sd.Archive)
//#endif
//# addMenuCommand(cmdTemplate);
//#endif
}
//#ifdef CLIPBOARD
//# if (cf.useClipBoard && !clipboard.isEmpty()) {
//# addMenuCommand(cmdSendBuffer);
//# }
//#endif
//#ifdef HISTORY
//# if (cf.saveHistory)
//# if (cf.msgPath!=null)
//# if (cf.msgPath.length() != 0)
//# if (contact.msgs.size()>0)
//# addMenuCommand(cmdSaveChat);
//#ifdef HISTORY_READER
//# if (cf.saveHistory) // && cf.lastMessages)
//# addMenuCommand(cmdReadHistory);
//#endif
//#endif
//#ifdef JUICK
//#ifdef PLUGINS
//# if(sd.Juick) {
//#endif
//# // http://code.google.com/p/bm2/issues/detail?id=94
//# if (msg != null && msg.isJuickMsg)
//# Juick.commandState(this);
//#ifdef PLUGINS
//# }
//#endif
//#endif
addMenuCommand(cmdBack);
}
public void forceScrolling() { //by voffk
if (contact != null)
if (contact.moveToLatest) {
contact.moveToLatest = false;
if (on_end)
moveCursorEnd();
}
}
protected void beginPaint() {
if (contact != null)
sd.roster.activeContact = contact;
markRead(cursor);
forceScrolling();
on_end = (cursor==(getItemCount() - 1));
}
public void markRead(int msgIndex) {
if (msgIndex>getItemCount()) return;
// if (msgIndex<contact.lastUnread) return;
sd.roster.countNewMsgs();
//#ifdef LOGROTATE
//# getRedraw(contact.redraw);
//#endif
}
//#ifdef LOGROTATE
//#
//# private void getRedraw(boolean redraw) {
//# if (!redraw) {
//# return;
//# }
//#
//# if (contact != null)
//# contact.redraw = false;
//# // messages.removeAllElements();
//# redraw();
//# }
//#endif
public int getItemCount(){ return (contact == null || contact.msgs == null)? 0 :contact.msgs.size(); }
public VirtualElement getItemRef(int index) {
MessageItem mi = (MessageItem) messages.elementAt(index);
mi.setEven( (index & 1) == 0);
if (mi.msg.unread) {
if (contact != null)
contact.resetNewMsgCnt();
}
mi.msg.unread = false;
return mi;
}
public Msg getMessage(int index) {
if (index >= getItemCount()) {
return null;
}
Msg msg = ((MessageItem) contact.msgs.elementAt(index)).msg;
if (msg.unread) {
contact.resetNewMsgCnt();
}
msg.unread = false;
return msg;
}
public void focusedItem(int index){
markRead(index);
}
public void menuAction(MenuCommand c, VirtualList d) {
commandState();
super.menuAction(c,d);
/** login-insensitive commands */
//#ifdef ARCHIVE
if (c==cmdArch) {
try {
MessageArchive.store(getMessage(cursor),1);
} catch (Exception e) {/*no messages*/}
}
//#endif
//#if TEMPLATES
//# if (c==cmdTemplate) {
//# try {
//# MessageArchive.store(getMessage(cursor),2);
//# } catch (Exception e) {/*no messages*/}
//# }
//#endif
if (c==cmdPurge) {
//if (messages.isEmpty()) return;
if (startSelection) {
for (Enumeration select=contact.msgs.elements(); select.hasMoreElements(); ) {
Msg mess = ((MessageItem) select.nextElement()).msg;
if (mess.selected) {
contact.msgs.removeElement(mess);
}
}
startSelection = false;
messages.removeAllElements();
} else {
clearReadedMessageList();
}
}
if (c==cmdSelect) {
startSelection=true;
Msg mess=((MessageItem) contact.msgs.elementAt(cursor)).msg;
mess.selected = !mess.selected;
mess.oldHighlite = mess.highlite;
mess.highlite = mess.selected;
//redraw();
return;
}
//#ifdef HISTORY
//#ifdef HISTORY_READER
//# if (c==cmdReadHistory) {
//# new HistoryReader(contact);
//# return;
//# }
//#endif
//#endif
//#if (FILE_IO && HISTORY)
//# if (c==cmdSaveChat) saveMessages();
//#endif
//#ifdef FILE_TRANSFER
if (c == cmdAcceptFile)
new TransferAcceptFile(TransferDispatcher.getInstance().getTransferByJid(contact.jid.getJid()));
if (c == cmdDeclineFile)
TransferDispatcher.getInstance().getTransferByJid(contact.jid.getJid()).cancel();
//#endif
/** login-critical section */
if (!sd.roster.isLoggedIn()) return;
if (c==cmdMessage) {
contact.msgSuspended = null;
messageEditResume();
}
if (c==cmdResume) messageEditResume();
if (c==cmdQuote) Quote();
if (c==cmdReply) Reply();
if (c==cmdActions) {
new RosterItemActions(contact);
}
if (c==cmdActive) {
savePosition();
new ActiveContacts(contact);
}
if (c == cmdSubscribe) {
sd.roster.doSubscribe(contact);
contact.addMessage(new Msg(Msg.MESSAGE_TYPE_SYSTEM, contact.bareJid, null, "Subscribed"));
}
if (c==cmdDecline) {
sd.roster.sendPresence(contact.bareJid, "unsubscribed", null, false);
contact.addMessage(new Msg(Msg.MESSAGE_TYPE_SYSTEM, contact.bareJid, null, "Unsubscribed"));
}
//#ifdef CLIPBOARD
//# if (c==cmdSendBuffer) {
//# String from=sd.account.toString();
//# String body=clipboard.getClipBoard();
//# //String subj=null;
//#
//# String id=String.valueOf((int) System.currentTimeMillis());
//# Msg msg=new Msg(Msg.MESSAGE_TYPE_OUT,from,null,body);
//# msg.id=id;
//# msg.itemCollapsed=true;
//#
//# try {
//# if (body!=null && body.length()>0) {
//# sd.roster.sendMessage(contact, id, body, null, null);
//# if (contact.origin!=Contact.ORIGIN_GROUPCHAT) contact.addMessage(msg);
//# }
//# } catch (Exception e) {
//# contact.addMessage(new Msg(Msg.MESSAGE_TYPE_OUT,from,null,"clipboard NOT sended"));
//# }
//# redraw();
//# }
//#endif
//#ifdef JUICK
//# Juick.menuAction(c, this);
//#endif
}
public void clearReadedMessageList() {
smartPurge();
//messages.removeAllElements();
moveCursorHome();
redraw();
}
public void eventLongOk() {
super.eventLongOk();
Reply();
}
public void messageEditResume() {
if (!sd.roster.isLoggedIn())
return;
Roster.me = new MessageEdit(this, contact, contact.msgSuspended);
Roster.me.show();
contact.msgSuspended = null;
}
public void Reply() {
if (!sd.roster.isLoggedIn()) {
return;
}
Msg msg = getMessage(cursor);
//#ifndef WMUC
if (contact instanceof MucContact && contact.origin == Contact.ORIGIN_GROUPCHAT) {
try {
if (msg != null
&& msg.messageType != Msg.MESSAGE_TYPE_OUT
&& msg.messageType != Msg.MESSAGE_TYPE_SUBJ) {
Roster.me = new MessageEdit(this, contact, msg.from + ":");
Roster.me.show();
return;
}
} catch (Exception e) { /* no messages */ }
}
//#endif
//#ifdef JUICK
//#ifdef PLUGINS
//# if (sd.Juick)
//#endif
//# if (Juick.haveJuickThings(msg)) {
//# String target = Juick.getTargetForJuickReply(msg);
//#
//# if (target.length() == 0) {
//# new JuickThingsMenu((VirtualList)this, contact);
//# return;
//# }
//#
//# switch (target.charAt(0)) {
//# case '#':
//# Juick.juickAction(this, "", msg);
//# return;
//# case '@':
//# Juick.juickAction(this, "PM", msg);
//# return;
//# }
//# }
//#
//#endif
messageEditResume();
}
public void captionPressed() {
savePosition();
sd.roster.searchActiveContact(1); //next contact with messages
}
public void Quote() {
if (!sd.roster.isLoggedIn()) return;
try {
String msg=new StringBuffer()
.append((char)0xbb) //
.append(" ")
.append(getMessage(cursor).quoteString())
.append("\n")
.append(" ")
.toString();
Roster.me = new MessageEdit(this, contact, msg);
Roster.me.show();
msg = null;
} catch (Exception e) {/*no messages*/}
}
//#ifdef HISTORY
//#ifdef LAST_MESSAGES
//# public final void loadRecentList() {
//# contact.setHistoryLoaded(true);
//# HistoryStorage hs = new HistoryStorage(contact.bareJid);
//# Vector history=hs.importData();
//# for (Enumeration messages2=history.elements(); messages2.hasMoreElements(); ) {
//# Msg message=(Msg) messages2.nextElement();
//# if (!isMsgExists(message)) {
//# message.history=true;
//# contact.msgs.insertElementAt(new MessageItem(message, cf.smiles), 0);
//# }
//# message=null;
//# }
//# history=null;
//# }
//#
//# private boolean isMsgExists(Msg msg) {
//# if (msg == null) return true;
//# for (Enumeration contactMsgs = contact.msgs.elements(); contactMsgs.hasMoreElements(); ) {
//# Msg message=((MessageItem) contactMsgs.nextElement()).msg;
//# if (message.body.equals(msg.body)) {
//# return true;
//# }
//# message=null;
//# }
//# return false;
//# }
//#endif
//#
//# private void saveMessages() {
//# StringBuffer histRecord=new StringBuffer("chatlog_");
//#ifndef WMUC
//# if (contact instanceof MucContact) {
//# if (contact.origin>=Contact.ORIGIN_GROUPCHAT) {
//# histRecord.append(contact.bareJid);
//# } else {
//# String nick=contact.getJid();
//# int rp=nick.indexOf('/');
//# histRecord.append(nick.substring(rp+1)).append("_").append(nick.substring(0, rp));
//# nick=null;
//# }
//# } else {
//#endif
//# histRecord.append(contact.bareJid);
//#ifndef WMUC
//# }
//#endif
//# StringBuffer messageList=new StringBuffer();
//# if (startSelection) {
//# for (Enumeration select=contact.msgs.elements(); select.hasMoreElements(); ) {
//# Msg mess=((MessageItem) select.nextElement()).msg;
//# if (mess.selected) {
//# messageList.append(mess.quoteString()).append("\n").append("\n");
//# mess.selected=false;
//# mess.highlite = mess.oldHighlite;
//# }
//# }
//# startSelection = false;
//# } else {
//# for (Enumeration cmessages=contact.msgs.elements(); cmessages.hasMoreElements(); ) {
//# Msg message=((MessageItem) cmessages.nextElement()).msg;
//# messageList.append(message.quoteString()).append("\n").append("\n");
//# }
//# }
//# HistoryAppend.getInstance().addMessageList(messageList.toString(), histRecord.toString());
//# messageList=null;
//# histRecord=null;
//# }
//#endif
public final void smartPurge() {
Vector msgs=contact.msgs;
int cur = cursor + 1;
moveCursorTo(cur);
try {
if (msgs.size()>0){
int virtCursor=msgs.size();
boolean delete = false;
int i=msgs.size();
while (true) {
if (i<0) break;
if (i<cur) {
if (!delete) {
//System.out.println("not found else");
if (((MessageItem)msgs.elementAt(virtCursor)).msg.dateGmt+1000<System.currentTimeMillis()) {
//System.out.println("can delete: "+ delPos);
msgs.removeElementAt(virtCursor);
//delPos--;
delete=true;
}
} else {
//System.out.println("delete: "+ delPos);
msgs.removeElementAt(virtCursor);
//delPos--;
}
}
virtCursor--;
i--;
}
contact.activeMessage = msgs.size() - 1; //drop activeMessage count
}
} catch (Exception e) {
//#ifdef DEBUG
//# e.printStackTrace();
//#endif
}
contact.clearVCard();
contact.lastSendedMessage=null;
contact.lastUnread=0;
contact.resetNewMsgCnt();
}
public void savePosition() {
contact.mark = on_end ? -1 : cursor;
}
public void destroyView(){
/*
if (startSelection) {
for (Enumeration select=contact.msgs.elements(); select.hasMoreElements(); ) {
Msg mess=(Msg) select.nextElement();
mess.selected=false;
mess.highlite = mess.oldHighlite;
}
startSelection = false;
}
*/
savePosition();
sd.roster.activeContact=null;
sd.roster.reEnumRoster(); //to reset unread messages icon for this conference in roster
parentView = sd.roster;
super.destroyView();
}
public void userKeyPressed(int keyCode) {
switch (keyCode) {
case 3:
savePosition();
new ActiveContacts(null);
return;
case 4:
if (cf.useTabs) {
savePosition();
sd.roster.searchActiveContact(-1);
return;
}
break;
case 6:
if (cf.useTabs) {
savePosition();
sd.roster.searchActiveContact(1);
return;
}
break;
case VirtualCanvas._KEY_POUND:
Reply();
return;
case 9:
Quote();
return;
}
super.userKeyPressed(keyCode);
}
public void longKey(int key) {
switch(key) {
case 0:
clearReadedMessageList();
return;
}
super.longKey(key);
}
public void keyGreen() {
if (!sd.roster.isLoggedIn()) {
return;
}
Roster.me = new MessageEdit(this, contact, contact.msgSuspended);
Roster.me.show();
contact.msgSuspended = null;
}
public void keyClear() {
if (!messages.isEmpty()) {
clearReadedMessageList();
}
}
// TODO: fix this shit
public String touchLeftCommand(){ return (Config.getInstance().swapMenu)?((contact.msgSuspended!=null)?SR.MS_RESUME:SR.MS_NEW):SR.MS_MENU; }
public String touchRightCommand(){ return (Config.getInstance().swapMenu)?SR.MS_MENU:SR.MS_BACK; }
public void touchRightPressed(){ if (cf.swapMenu) showMenu(); else destroyView(); }
public void touchLeftPressed(){ if (cf.swapMenu) messageEditResume(); else showMenu(); }
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
89d65a1996a99d705e63001fbef982d5993c6d9c
|
9d6068d44b186fd4ae1fddd00698a59e6e9d3db0
|
/app-exe-jsaf/src/main/java/jsaf/util/AbstractEnvironment.java
|
25f373016623efe34b2522747d2af0ad74f34af9
|
[] |
no_license
|
akwolf/app-extractor
|
205497208623bdd1cc12714f8d0bf78c84e0c8b9
|
ec86be0c9e95d2657fe4228f7542a52ce664b3c3
|
refs/heads/master
| 2016-09-06T13:46:38.560331
| 2013-08-30T03:47:04
| 2013-08-30T03:47:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,085
|
java
|
// Copyright (C) 2012 jOVAL.org. All rights reserved.
// This software is licensed under the LGPL 3.0 license available at http://www.gnu.org/licenses/lgpl.txt
package jsaf.util;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Properties;
import java.util.regex.Matcher;
import jsaf.intf.system.IEnvironment;
/**
* A base-class for environments.
*
* @author David A. Solin
* @version %I% %G%
*/
public abstract class AbstractEnvironment implements IEnvironment {
protected boolean caseInsensitive;
protected Properties props;
protected AbstractEnvironment() {
this(false);
}
protected AbstractEnvironment(boolean caseInsensitive) {
this.caseInsensitive = caseInsensitive;
props = new Properties();
}
// Implement IEnvironment
public String expand(String data) {
if (data.indexOf('%') < 0) {
return data;
}
String originalData = data;
Iterator <String>names = props.stringPropertyNames().iterator();
while (names.hasNext()) {
String name = names.next();
String pattern = new StringBuffer(caseInsensitive ? "(?i)%" : "%").append(name).append("%").toString();
data = data.replaceAll(pattern, Matcher.quoteReplacement(props.getProperty(name)));
}
if (data.equals(originalData)) {
return data; // Some unexpandable pattern exists in there
} else {
return expand(data); // Recurse, in case a variable includes another
}
}
public String getenv(String var) {
if (caseInsensitive) {
for (String key : this) {
if (key.equalsIgnoreCase(var)) {
return props.getProperty(key);
}
}
return null;
} else {
return props.getProperty(var);
}
}
public Iterator<String> iterator() {
return props.stringPropertyNames().iterator();
}
public String[] toArray() {
ArrayList<String> list = new ArrayList<String>();
for (String key : this) {
list.add(new StringBuffer(key).append("=").append(getenv(key)).toString());
}
return list.toArray(new String[list.size()]);
}
}
|
[
"akwolf@yeah.net"
] |
akwolf@yeah.net
|
1ca14f9eb113da64106e644bb8b88245c74b87cc
|
281dc00e5689c74bb0d5b19a8c43232d94a6fced
|
/homework3/src/main/java/com/cta/homework3/gateway/filter/HeaderHttpResponseFilter.java
|
a79d28bc41d2a822e634a419d49936a009c77982
|
[] |
no_license
|
tigerChen19/javaCourses
|
9037d73bf0432e150a4566113661f8b19d82237f
|
607c6a722eca96826f8b8675099748900e9054a6
|
refs/heads/main
| 2023-07-03T14:50:27.760945
| 2021-08-01T08:25:50
| 2021-08-01T08:25:50
| 379,829,067
| 0
| 0
| null | 2021-08-01T08:25:50
| 2021-06-24T06:41:53
|
Java
|
UTF-8
|
Java
| false
| false
| 293
|
java
|
package com.cta.homework3.gateway.filter;
import io.netty.handler.codec.http.FullHttpResponse;
public class HeaderHttpResponseFilter implements HttpResponseFilter {
@Override
public void filter(FullHttpResponse response) {
response.headers().set("kk", "java-1-nio");
}
}
|
[
"17692920@qq.com"
] |
17692920@qq.com
|
99bc6486a213cc75eae97b8b655983ed9073194c
|
3ee6d6a1ca3f19b56eab7936a1e2839fc4b29e78
|
/study/src/com/test0422/Test3.java
|
6680681729d708c58d15407438d31b48d2d2d5b5
|
[] |
no_license
|
daegi/study-dg
|
2764592b0f0914ec64b0a418a0417a1d6091651f
|
ad9862ecb60aca7265481daf7735d9dfd826e5f6
|
refs/heads/master
| 2021-01-19T13:52:59.044839
| 2014-07-25T03:27:26
| 2014-07-25T03:27:26
| 32,976,520
| 0
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 1,070
|
java
|
package com.test0422;
import java.io.File;
import java.util.Scanner;
public class Test3 {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
String pathname;
try {
System.out.print("파일 도는 폴더명(예: c:\\windows)?");
pathname=sc.next();
File f= new File(pathname);
if(! f.exists()){
System.out.println("존재하지 않은 파일 또는 경로입니다");
System.exit(0);
}
if(f.isFile()){
//파일인 경우
System.out.println(f.getName()+":"+f.length()+"Bytes.");
}else if(f.isDirectory()){
//폴더인 경우
//폴더안의 모든 폴더 및 파일 리스트 얻기
File[] fs=f.listFiles();
for(int i=0; i<fs.length;i++){
File ff=fs[i];
if(ff.isFile()){
System.out.println(ff.getName()+":"+ff.length()+"Bytes.");
}else if (ff.isDirectory()){
System.out.println("폴더명:"+ff.getName());
}
}
}
} catch (Exception e) {
System.out.println(e.toString());
}
}
}
|
[
"choyc82@cf0b24a7-709c-1eb7-a6c0-50069b54bc80"
] |
choyc82@cf0b24a7-709c-1eb7-a6c0-50069b54bc80
|
9125a25f1109ac1e587421e222080957cc063ec2
|
6cdf915922d58e9d806a8231bc0f4a83f5a72aba
|
/src/main/java/com/cb/minibike/service/LogService.java
|
c37fcb3f6a1c098bf01e93f528ae231831b5bbce
|
[] |
no_license
|
cilibili/minibike
|
6c5b0ec64aed26c71674c37ab232032f6aa1310f
|
64823cc2116aac53012747c0d150eff2f4df9930
|
refs/heads/master
| 2020-06-17T11:23:15.193139
| 2019-07-09T03:27:09
| 2019-07-09T03:27:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 104
|
java
|
package com.cb.minibike.service;
public interface LogService {
public void saveLog(String log );
}
|
[
"348569072@qq.com"
] |
348569072@qq.com
|
f28db5f0b3ecf8e34d0963a4e52104c5882e6cb8
|
aff5d04c67d56fd1a97629e76a83c4d65cd8dd7b
|
/src/main/java/vip/ddm/ddm/dao/FullDownMapper.java
|
6434529ae5d3f0352f00ea52fa26fd268416c5e7
|
[] |
no_license
|
haoyuehong/ddm
|
01575252cdfadfd7aa025b7590348761d7630ead
|
6b1f0c1c0337bba74ccee1451cbc81c486317cf7
|
refs/heads/master
| 2020-03-26T13:55:31.557410
| 2018-09-12T07:11:51
| 2018-09-12T07:11:51
| 144,963,466
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,902
|
java
|
package vip.ddm.ddm.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import vip.ddm.ddm.model.FullDown;
import vip.ddm.ddm.vo.FullDownVo;
import java.util.List;
public interface FullDownMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table full_down
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table full_down
*
* @mbg.generated
*/
int insert(FullDown record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table full_down
*
* @mbg.generated
*/
int insertSelective(FullDown record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table full_down
*
* @mbg.generated
*/
FullDown selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table full_down
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(FullDown record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table full_down
*
* @mbg.generated
*/
int updateByPrimaryKey(FullDown record);
List<FullDownVo> findList(@Param("fullDown") FullDown fullDown,@Param("storeIds") List<Integer> storeIds);
@Select("select * from full_down where id = #{fullDownId} and status = #{status}")
FullDown findByIdAndStatus(@Param("fullDownId") Integer fullDownId, @Param("status") Integer status);
@Select("select * from full_down where status = #{status}")
List<FullDown> findByStatus(int status);
}
|
[
"799550298@qq.com"
] |
799550298@qq.com
|
af0a22e69fa9ee21f070fc169ae055065638e8a4
|
f6f857ce9d5995e3370cb3838bec7284f50e6b7a
|
/src/main/java/com/github/scuwr/snitchvisualizer/handlers/SVTickHandler.java
|
ef7886e25f70f7c042e9ad561d7f5f54b844ad55
|
[
"MIT"
] |
permissive
|
ProgrammerDan/Snitch-Visualizer
|
6e22feeba97e9916e48d42a6045c8f541b195537
|
81e2bb5b9ff81be5bd8dbdaf17092679b8cc2834
|
refs/heads/master
| 2020-12-25T04:17:27.275155
| 2015-04-14T15:52:07
| 2015-04-14T15:52:07
| 32,806,309
| 0
| 0
| null | 2015-04-14T15:52:07
| 2015-03-24T15:10:54
|
Java
|
UTF-8
|
Java
| false
| false
| 1,507
|
java
|
package com.github.scuwr.snitchvisualizer.handlers;
import java.util.Date;
import net.minecraft.client.Minecraft;
import net.minecraftforge.event.entity.player.PlayerEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Tick Handler for Snitch Visualizer
*
* I was unable to query server-side ticks, so I set the tick value very high to
* prevent the player from being kicked due to spamming
*
* In other words, the game is laggy and thinks you're spamming if it sends out too many
* messages in a given amount of time.
*
* @author Scuwr
*
*/
public class SVTickHandler{
public int playerTicks = 0;
public static double waitTime = 4;
public static int tickTimeout = 20;
public static Date start = new Date();
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event){
new SVPlayerHandler().onPlayerEvent(event);
/*if(playerTicks <= 40) playerTicks++;
if(SVChatHandler.updateSnitchList && playerTicks > 40){
Minecraft.getMinecraft().thePlayer.sendChatMessage("/jalist " + SVChatHandler.jalistIndex);
playerTicks = 0;
SVChatHandler.jalistIndex++;
}*/
if(((new Date()).getTime() - (waitTime*1000)) > start.getTime() && SVChatHandler.updateSnitchList){
Minecraft.getMinecraft().thePlayer.sendChatMessage("/jalist " + SVChatHandler.jalistIndex);
SVChatHandler.jalistIndex++;
start = new Date();
}
}
}
|
[
"theScuwr@gmail.com"
] |
theScuwr@gmail.com
|
402b1061d2bfce13d3253f6a3fc26f3e7a89fe33
|
8f0e091169ae645a6ee8eb0e51c0bfe3368ea984
|
/app/src/androidTest/java/com/example/taskmanager/ExampleInstrumentedTest.java
|
568934eea895f653e7c7d7ca0abf2f156c42e0f4
|
[] |
no_license
|
Rakhshanipr/TaskManager
|
31a5cca05cb3b25c62ef139e2e81f0039605fe1e
|
87129fe34837990b962b33b2c1a1799655fb7898
|
refs/heads/master
| 2023-03-03T19:42:56.209569
| 2021-02-03T12:05:34
| 2021-02-03T12:05:34
| 329,834,366
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 760
|
java
|
package com.example.taskmanager;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.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() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.taskmanager", appContext.getPackageName());
}
}
|
[
"you@example.com"
] |
you@example.com
|
0f183474525593d9e2863419c8929e9c052307c2
|
b0eaf03f81e483e8cf7f0863cc6a34f63046d735
|
/src/inteligenciaartificial_pia/Solucion.java
|
d066747835c56ad5ef860e45f28e1d00de9f31c1
|
[] |
no_license
|
salva09/Equipo5_PIA_IA
|
29c764501618c65f73c9f63d60cbc9b8d20c6e9c
|
a74213db2b967a7e06bed009e23dc74cb3648bb1
|
refs/heads/main
| 2023-04-26T11:10:37.146525
| 2021-05-22T13:33:46
| 2021-05-22T13:33:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 17,848
|
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 inteligenciaartificial_pia;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import javax.swing.JLabel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.text.BadLocationException;
import javax.swing.text.Style;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument;
/**
*
* @author ASUS
*/
public class Solucion extends javax.swing.JFrame {
ArrayList<JSpinner> heuristicos = new ArrayList();
Map<String, Float> heuristica = new TreeMap<>();
Grafo grafo = EdicionGrafo.auxiliar;
/**
* Creates new form Solucion
*/
public Solucion() {
initComponents();
hPanel.setVisible(false);
hText.setVisible(false);
Volver.setVisible(false);
resolver.setVisible(false);
this.setSize(this.getWidth(), 300);
}
/**
* 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() {
nodoText = new javax.swing.JLabel();
nodosPanel = new javax.swing.JPanel();
metaText = new javax.swing.JLabel();
nodoMeta = new javax.swing.JSpinner();
inicialText = new javax.swing.JLabel();
nodoInicial = new javax.swing.JSpinner();
Aceptar = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
hPanel = new javax.swing.JScrollPane();
heuristicaPanel = new javax.swing.JPanel();
hText = new javax.swing.JLabel();
Volver = new javax.swing.JButton();
resolver = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
nodoText.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
nodoText.setText("Nodos");
nodosPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder(java.awt.Color.lightGray, java.awt.Color.gray));
metaText.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
metaText.setText("Nodo meta:");
nodoMeta.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
nodoMeta.setModel(new javax.swing.SpinnerNumberModel());
inicialText.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
inicialText.setText("Nodo inicial:");
nodoInicial.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
nodoInicial.setModel(new javax.swing.SpinnerNumberModel());
javax.swing.GroupLayout nodosPanelLayout = new javax.swing.GroupLayout(nodosPanel);
nodosPanel.setLayout(nodosPanelLayout);
nodosPanelLayout.setHorizontalGroup(
nodosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(nodosPanelLayout.createSequentialGroup()
.addGap(117, 117, 117)
.addGroup(nodosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(metaText)
.addComponent(inicialText))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(nodosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(nodoInicial)
.addComponent(nodoMeta, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
nodosPanelLayout.setVerticalGroup(
nodosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(nodosPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(nodosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(inicialText)
.addComponent(nodoInicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(nodosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(metaText)
.addComponent(nodoMeta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(20, Short.MAX_VALUE))
);
Aceptar.setText("Aceptar");
Aceptar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
AceptarActionPerformed(evt);
}
});
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Datos de Entrada");
hPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder(java.awt.Color.lightGray, java.awt.Color.gray));
heuristicaPanel.setLayout(new java.awt.GridBagLayout());
hPanel.setViewportView(heuristicaPanel);
hText.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
hText.setText("Heuristica");
Volver.setText("Volver");
Volver.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
VolverActionPerformed(evt);
}
});
resolver.setText("Resolver");
resolver.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
resolverActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(nodosPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(nodoText)
.addComponent(hText))
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(hPanel))
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(182, Short.MAX_VALUE)
.addComponent(Volver)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(resolver)
.addGap(162, 162, 162))
.addGroup(layout.createSequentialGroup()
.addGap(206, 206, 206)
.addComponent(Aceptar)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(29, 29, 29)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(nodoText)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(nodosPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(Aceptar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(hText)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(hPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Volver)
.addComponent(resolver))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void AceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AceptarActionPerformed
nodosPanel.setVisible(false);
nodoText.setVisible(false);
Aceptar.setVisible(false);
hPanel.setVisible(true);
hText.setVisible(true);
Volver.setVisible(true);
resolver.setVisible(true);
GridBagLayout modeloL = new GridBagLayout();
GridBagConstraints espacio = new GridBagConstraints();
heuristicaPanel.removeAll();
heuristicaPanel.setLayout(modeloL);
heuristicos = new ArrayList<>();
int x = 0, y = 0;
for (Nodo nodo : grafo.getNodos()) {
JLabel num = new JLabel("h(" + String.valueOf(nodo.getNum()) + ") = ");
espacio.gridx = x;
espacio.gridy = y;
espacio.gridwidth = 1;
espacio.gridheight = 1;
heuristicaPanel.add(num, espacio);
JSpinner h = new JSpinner();
Dimension dim = new Dimension(60, 20);
h.setPreferredSize(dim);
SpinnerNumberModel modeloS = new SpinnerNumberModel(0.0, 0, Float.POSITIVE_INFINITY, 1.0);
h.setModel(modeloS);
h.setEditor(new JSpinner.NumberEditor(h, "##.####################"));
x += 1;
espacio.gridx = x;
espacio.gridy = y;
if (String.valueOf(nodo.getNum()).equals(nodoMeta.getValue().toString())) {
h.setEnabled(false);
}
h.setName(String.valueOf(nodo.getNum()));
heuristicos.add(h);
heuristicaPanel.add(h, espacio);
heuristicaPanel.updateUI();
x = 0;
y += 1;
}
}//GEN-LAST:event_AceptarActionPerformed
private void VolverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_VolverActionPerformed
nodosPanel.setVisible(true);
nodoText.setVisible(true);
Aceptar.setVisible(true);
hPanel.setVisible(false);
hText.setVisible(false);
Volver.setVisible(false);
resolver.setVisible(false);
//heuristicaPanel.removeAll();
}//GEN-LAST:event_VolverActionPerformed
private void resolverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resolverActionPerformed
algoritmoA(nodoInicial.getValue().toString(), nodoMeta.getValue().toString());
EdicionGrafo.ver.setVisible(true);
dispose();
}//GEN-LAST:event_resolverActionPerformed
public void algoritmoA(String inicial, String meta) {
StyledDocument documento = EdicionGrafo.resultado.getStyledDocument();
Style estilo = EdicionGrafo.resultado.addStyle("Estilo", null);
obtenerHeuristica();
//String inicial = JOptionPane.showInputDialog("Nodo Inicial: ");
//String meta = JOptionPane.showInputDialog("Nodo Meta: ");
float costo_acumulado = 0;
int pos;
int bandera;
String nodo_actual = inicial;
ArrayList<Nodo> nodos = grafo.getNodos();
ArrayList<String> nodos_visitados = new ArrayList<>();
//Busqueda
while (!nodo_actual.equals(meta)) {
Map<String, Float> hijos = new TreeMap<>();
System.out.println("Nodo actual: " + nodo_actual);
nodos_visitados.add(nodo_actual);
bandera = 0;
//calculamos el costo del nodo actual, hacia sus hijos
for (int i = 0; i < nodos.size(); i++) {
if (nodo_actual.equals(String.valueOf(nodos.get(i).getNum()))) {
Iterator it = nodos.get(i).getAdyacentes().keySet().iterator();
while (it.hasNext()) {
//nombre del nodo adyacente
float cant_hijos;
String key = it.next().toString();
if (nodos_visitados.contains(key) == false) {
cant_hijos = costo_acumulado + nodos.get(i).getAdyacentes().get(key) + heuristica.get(key);
System.out.println("AQUIIII " + nodos.get(i).getAdyacentes().get(key));
hijos.put(key, cant_hijos);
}
}
}
}
Iterator c = hijos.keySet().iterator();
String auxKey = c.next().toString();
float auxCost = hijos.get(auxKey);
Iterator b = hijos.keySet().iterator();
while (b.hasNext()) {
String key = b.next().toString();
if (hijos.get(key) <= auxCost) {
auxKey = "";
auxKey = key;
auxCost = hijos.get(key);
}
}
costo_acumulado = hijos.get(auxKey) - heuristica.get(auxKey);
nodo_actual = auxKey;
System.out.println(" Costo: " + (hijos.get(auxKey) - heuristica.get(auxKey)));
}
StyleConstants.setForeground(estilo, Color.black);
try {
documento.insertString(documento.getLength(), "Costo Total: ", estilo);
} catch (BadLocationException e) {
}
StyleConstants.setForeground(estilo, Color.red);
try {
documento.insertString(documento.getLength(), String.valueOf(costo_acumulado), estilo);
} catch (BadLocationException e) {
}
System.out.println("Costo TOTAL: " + costo_acumulado);
nodos_visitados.add(meta);
EdicionGrafo.visitados = nodos_visitados;
}
public void obtenerHeuristica() {
heuristica = new TreeMap<>();
for (JSpinner h : heuristicos) {
heuristica.put(h.getName(), Float.valueOf(h.getValue().toString()));
}
System.out.println(heuristica);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Solucion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Solucion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Solucion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Solucion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Solucion().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton Aceptar;
private javax.swing.JButton Volver;
private javax.swing.JScrollPane hPanel;
private javax.swing.JLabel hText;
private javax.swing.JPanel heuristicaPanel;
private javax.swing.JLabel inicialText;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel metaText;
private javax.swing.JSpinner nodoInicial;
private javax.swing.JSpinner nodoMeta;
private javax.swing.JLabel nodoText;
private javax.swing.JPanel nodosPanel;
private javax.swing.JButton resolver;
// End of variables declaration//GEN-END:variables
}
|
[
"smc_gaytan@hotmail.com"
] |
smc_gaytan@hotmail.com
|
6f83d6c2002ef3dde382a7d8c4f5b3779256db21
|
1c23fafcc016df84bfb35ef71f9fcece82bb34cd
|
/TypeVal.java
|
27a8f29259de4ed2909a34a0f35fb5fa7d2b4f15
|
[] |
no_license
|
kaustrie/Undergrad
|
48f005b9b0ab489e7eb2b8cf384cd9382a11ea5f
|
2714511128996abf1390c8584b8ab6ef7057a44f
|
refs/heads/master
| 2021-01-13T01:46:27.357440
| 2015-08-28T01:14:26
| 2015-08-28T01:14:26
| 35,045,012
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,065
|
java
|
public enum TypeVal
/* This class is used to record the declared types of functions and their parameters in
HashMap<String,TypeVal> funTypeTable
HashMap<String,HashMap<String,TypeVal>> paramTypeTable
HashMap<String,HashMap<Integer,TypeVal>> paramNumTypeTable
which are included in the class "ParserTypeChecker.java".
The enumerated values are also returned from typeEval() function.
*/
{
Int,
Float,
Boolean,
Correct, // represents type correctness of a function definition
Error; // represents the type error value
boolean isNumberType()
{
return this == Int || this == Float;
}
public String toString()
{
switch (this)
{
case Int: return "int";
case Float: return "float";
case Boolean: return "boolean";
case Correct: return "Correct";
default: return "Error";
}
}
public static TypeVal toTypeVal(String type)
{
if ( type.equals("int") )
return Int;
else if ( type.equals("float") )
return Float;
else if ( type.equals("boolean") )
return Boolean;
else
return null;
}
}
|
[
"kaustrie80@gmail.com"
] |
kaustrie80@gmail.com
|
07057b9e076df1dd91548f2a544ce9307d524eb2
|
6fe96d24fd53fdd2da34abacda174a1ebf5cf36b
|
/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageXmlDataReview.java
|
19ee86e5191030dcca79c3c8a1bccf7bdf7a758a
|
[
"Apache-2.0",
"GPL-1.0-or-later",
"MPL-2.0",
"EPL-1.0",
"LicenseRef-scancode-proprietary-license",
"LGPL-2.0-or-later",
"CDDL-1.0",
"MIT"
] |
permissive
|
msucil/midpoint
|
05ffd33d0c909bc7d564c9db8a0407ef42efb726
|
3200d31730a49d53c73b35c90a89fbe1c034183b
|
refs/heads/master
| 2020-06-11T09:16:43.152507
| 2019-06-26T12:02:50
| 2019-06-26T12:02:50
| 193,911,474
| 1
| 0
|
Apache-2.0
| 2019-06-26T13:37:31
| 2019-06-26T13:37:30
| null |
UTF-8
|
Java
| false
| false
| 2,858
|
java
|
/*
* Copyright (c) 2010-2018 Evolveum
*
* 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.evolveum.midpoint.web.page.admin.users;
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.web.application.AuthorizationAction;
import com.evolveum.midpoint.web.application.PageDescriptor;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.page.admin.PageAdmin;
import com.evolveum.midpoint.web.page.admin.reports.component.AceEditorPanel;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.IModel;
/**
* Created by honchar.
*/
@PageDescriptor(url = "/admin/xmlDataReview", action = {
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_USERS_ALL_URL,
label = "PageAdminUsers.auth.usersAll.label",
description = "PageAdminUsers.auth.usersAll.description"),
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_USER_HISTORY_XML_REVIEW_URL,
label = "PageUser.auth.userHistoryXmlReview.label",
description = "PageUser.auth.userHistoryXmlReview.description")})
public class PageXmlDataReview extends PageAdmin {
private static final String ID_ACE_EDITOR_CONTAINER = "aceEditorContainer";
private static final String ID_ACE_EDITOR_PANEL = "aceEditorPanel";
private static final String ID_BUTTON_BACK = "back";
public PageXmlDataReview(IModel<String> title, IModel<String> data){
initLayout(title, data);
}
private void initLayout(IModel<String> title, IModel<String> data){
WebMarkupContainer container = new WebMarkupContainer(ID_ACE_EDITOR_CONTAINER);
container.setOutputMarkupId(true);
add(container);
AceEditorPanel aceEditorPanel = new AceEditorPanel(ID_ACE_EDITOR_PANEL, title, data);
aceEditorPanel.getEditor().setReadonly(true);
aceEditorPanel.setOutputMarkupId(true);
container.add(aceEditorPanel);
AjaxButton back = new AjaxButton(ID_BUTTON_BACK, createStringResource("PageBase.button.back")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
add(back);
}
}
|
[
"honchar@evolveum.com"
] |
honchar@evolveum.com
|
f15bcdba9d0fddbed848140ec6374977465ca4db
|
91693332d08bd19e3722c1e4b11f023ea5bf80a4
|
/src/main/java/pages/InterestedInPage.java
|
230e8d347464c9a6d9b82bb7860e8979a7f1fc7a
|
[] |
no_license
|
stritenko/AngelList
|
358f6f7d7eb44e697ec3da8d1b2a0aa94a5b151c
|
475e68767a006acde535708fa6f3e15e59231429
|
refs/heads/master
| 2021-08-23T06:30:44.894295
| 2017-12-03T22:37:44
| 2017-12-03T22:37:44
| 112,968,464
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 522
|
java
|
package pages;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
/**
* Created by Marina on 12/3/2017.
*/
public class InterestedInPage extends ParentPage {
@FindBy(xpath=".//*[@id='root']/div[4]/div/form/div/div[6]/a")
WebElement skipButton;
public InterestedInPage(WebDriver webDriver) {
super(webDriver);
}
public void clickOnskipButton(){
actionWithOurElements.clickOnElement(skipButton);
}
}
|
[
"stritenko@mail.ru"
] |
stritenko@mail.ru
|
43942433f8210c67711f98980d01859d728abf36
|
9a62169ace507c0be95adf3f86c849b0dc144c3e
|
/tests/softtest/test/c/gcc/regression/UFM_PRE.java
|
bcb1404fe72d4c33bbeec1f0b59bc03b37ff741c
|
[] |
no_license
|
13001090108/DTSEmbed_LSC
|
84b2e7edbf1c7f5162b19f06c892a5b42d3ad88e
|
38cc44c10304458e923a1a834faa6b0ca216c0e2
|
refs/heads/master
| 2020-04-02T05:27:57.577850
| 2018-10-22T06:28:28
| 2018-10-22T06:28:28
| 154,078,761
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 22,435
|
java
|
package softtest.test.c.gcc.regression;
import java.util.Arrays;
import java.util.Collection;
import java.util.Set;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import softtest.fsm.c.FSMLoader;
import softtest.fsm.c.FSMMachine;
import softtest.fsmanalysis.c.FSMAnalysisVisitor;
import softtest.interpro.c.InterContext;
import softtest.symboltable.c.MethodNameDeclaration;
import softtest.test.c.rules.ModelTestBase;
@RunWith(Parameterized.class)
public class UFM_PRE extends ModelTestBase {
public UFM_PRE(String source,String compiletype, String result)
{
super(source, compiletype, result);
}
@BeforeClass
public static void setUpBaseChild()
{
fsmPath="softtest/rules/gcc/fault/UFM_PRE-0.1.xml";
FSMMachine fsm = FSMLoader.loadXML(fsmPath);
fsm.setType("fault");
//每次加入自动机前都清空一下原来的fsms
FSMAnalysisVisitor.clearFSMS();
FSMAnalysisVisitor.addFSMS(fsm);
//加载库函数摘要
LIB_SUMMARYS_PATH="gcc_lib/npd_summary.xml";
libManager.loadSingleLibFile(LIB_SUMMARYS_PATH);
Set<MethodNameDeclaration> libDecls = libManager.compileLib(pre.getLibIncludes());
interContext = InterContext.getInstance();
interContext.addLibMethodDecl(libDecls);
}
@Parameters
public static Collection<Object[]> testcaseAndResults()
{
return Arrays.asList(new Object[][] {
///////////////// 0 ///////////////////
{
"#include <stdlib.h>" +"\n"+
"" +"\n"+
"void func2(int*);" +"\n"+
"int func3(int*);" +"\n"+
"" +"\n"+
"void func1()" +"\n"+
"{" +"\n"+
" int *ptr;" +"\n"+
"" +"\n"+
" ptr = (int*)malloc(sizeof(int));" +"\n"+
" func2(ptr);" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func2(int *ptr)" +"\n"+
"{" +"\n"+
"" +"\n"+
" free(ptr);" +"\n"+
" func3(ptr); //DEFECT" +"\n"+
"}" +"\n"+
"" +"\n"+
"int func3(int *ptr)" +"\n"+
"{" +"\n"+
" return *ptr;" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 1 ///////////////////
{
"#include <stdlib.h>" +"\n"+
"" +"\n"+
"void func2(int, int*);" +"\n"+
"int func3(int*);" +"\n"+
"" +"\n"+
"void func1(int flag)" +"\n"+
"{" +"\n"+
" int *ptr;" +"\n"+
"" +"\n"+
" ptr = (int*)malloc(sizeof(int));" +"\n"+
" if (flag > 0) {" +"\n"+
" free(ptr);" +"\n"+
" }" +"\n"+
" func2(ptr,0); //DEFECT" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func2(int *ptr,int n)" +"\n"+
"{" +"\n"+
" func3(ptr);" +"\n"+
"}" +"\n"+
"" +"\n"+
"int func3(int *ptr)" +"\n"+
"{" +"\n"+
" return *ptr;" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 2 ///////////////////
{
"#include <stdlib.h>" +"\n"+
"" +"\n"+
"#define SIZE 5" +"\n"+
"" +"\n"+
"void func2(int, int*);" +"\n"+
"int func3(int*);" +"\n"+
"" +"\n"+
"void func1(int flag)" +"\n"+
"{" +"\n"+
" int *ptr;" +"\n"+
"" +"\n"+
" ptr = (int*)malloc(SIZE*sizeof(int));" +"\n"+
" if (flag > 0) {" +"\n"+
" free(ptr);" +"\n"+
" }" +"\n"+
" func2(0, ptr); //DEFECT" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func2(int n, int *ptr)" +"\n"+
"{" +"\n"+
" func3(ptr);" +"\n"+
"}" +"\n"+
"" +"\n"+
"int func3(int *ptr)" +"\n"+
"{" +"\n"+
" return ptr[SIZE-1];" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 3 ///////////////////
//hcj函数摘要问题,待改进
{
"#include <stdlib.h>" +"\n"+
"" +"\n"+
"int *g_ptr = NULL;" +"\n"+
"" +"\n"+
"void func2(int);" +"\n"+
"void func3();" +"\n"+
"" +"\n"+
"void func1(int flag)" +"\n"+
"{" +"\n"+
" g_ptr = (int*)malloc(sizeof(int));" +"\n"+
" func2(flag);" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func2(int flag)" +"\n"+
"{" +"\n"+
" if (flag > 0) {" +"\n"+
" free(g_ptr);" +"\n"+
" func3(); //DEFECT" +"\n"+
" } else {" +"\n"+
" func3(); //FP" +"\n"+
" return;" +"\n"+
" }" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func3()" +"\n"+
"{" +"\n"+
" (*g_ptr)++;" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 4 ///////////////////
//hcj函数摘要问题,待改进
{
"#include <stdlib.h>" +"\n"+
"" +"\n"+
"#define SIZE 5" +"\n"+
"" +"\n"+
"int *g_ptr = NULL;" +"\n"+
"" +"\n"+
"void func2(int);" +"\n"+
"void func3();" +"\n"+
"" +"\n"+
"void func1(int flag)" +"\n"+
"{" +"\n"+
" g_ptr = (int*)malloc(SIZE*sizeof(int));" +"\n"+
" func2(flag);" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func2(int flag)" +"\n"+
"{" +"\n"+
" if (flag > 0) {" +"\n"+
" free(g_ptr);" +"\n"+
" func3(); //DEFECT" +"\n"+
" } else {" +"\n"+
" func3(); //FP" +"\n"+
" return;" +"\n"+
" }" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func3()" +"\n"+
"{" +"\n"+
" g_ptr[SIZE-1]++;" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 5 ///////////////////
{
"#include <stdio.h>" +"\n"+
"#include <stdlib.h>" +"\n"+
"typedef struct{" +"\n"+
" char* p;" +"\n"+
"}S;" +"\n"+
"S s;" +"\n"+
"char* p;" +"\n"+
"void f(){" +"\n"+
" *(s.p)='a';" +"\n"+
"}" +"\n"+
"" +"\n"+
"void f1(){" +"\n"+
" f();" +"\n"+
"}" +"\n"+
"void f2(){" +"\n"+
" free(s.p);" +"\n"+
"}" +"\n"+
"void f3(){" +"\n"+
" s.p=malloc(11);" +"\n"+
" f2();" +"\n"+
" f1();" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 6 ///////////////////
{
"#include <stdio.h>" +"\n"+
"#include <malloc.h>" +"\n"+
"typedef struct{" +"\n"+
" char* p;" +"\n"+
"}S;" +"\n"+
"S s;" +"\n"+
"char* p;" +"\n"+
"void f(){" +"\n"+
" *p='a';" +"\n"+
"}" +"\n"+
"" +"\n"+
"void f1(){" +"\n"+
" f();" +"\n"+
"}" +"\n"+
"void f2(){" +"\n"+
" free(p);" +"\n"+
"}" +"\n"+
"void f3(){" +"\n"+
" p=malloc(11);" +"\n"+
" f2();" +"\n"+
" f1();" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 7 ///////////////////
{
" #include <stdlib.h>" +"\n"+
" struct s{" +"\n"+
" int *j;" +"\n"+
" };" +"\n"+
" struct e{" +"\n"+
" struct s * x; " +"\n"+
" }g;" +"\n"+
" " +"\n"+
" void func() {" +"\n"+
" *g.x =1;" +"\n"+
" " +"\n"+
" }" +"\n"+
" " +"\n"+
" int *foo(int t) {" +"\n"+
" " +"\n"+
" (g.x)->j = (int *)malloc(1);" +"\n"+
" if (!t) {" +"\n"+
" free(g.x);" +"\n"+
" }" +"\n"+
" func();" +"\n"+
" return 0;" +"\n"+
" }"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 0 ///////////////////
{
"#include <stdlib.h>" +"\n"+
"char *p[10];" +"\n"+
"void foo_6_5() {" +"\n"+
" *p[0] = 'a';" +"\n"+
"}" +"\n"+
"int bar_6_5() {" +"\n"+
" p[0] = (char *)malloc(sizeof(char));" +"\n"+
" free(p[0]);" +"\n"+
" foo_6_5();" +"\n"+
" return 0;" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
});
}
}
|
[
"lishaochun@bupt.edu.cn"
] |
lishaochun@bupt.edu.cn
|
7b47b7e4aa28cb6f686b15a7eac4c8baebc2a1ec
|
1671d87c2e414de8186570983c65c220888f20b1
|
/第一阶段/day08/src/com/atguigu/lgl/ArrayUtils_Luo2.java
|
1517e240c3050d69b7dec6c27d31af52de4fb77b
|
[] |
no_license
|
qisirendexudoudou/BigData_0722
|
4f25b508b4c20088d4155abb2d52e1d39c8b0e81
|
e474e6ebcbbfedd12f859f0198238f58b73e5bec
|
refs/heads/master
| 2022-07-21T17:41:47.611707
| 2019-11-16T05:59:11
| 2019-11-16T05:59:11
| 221,875,869
| 0
| 0
| null | 2022-06-21T02:14:43
| 2019-11-15T08:10:07
|
Java
|
UTF-8
|
Java
| false
| false
| 2,279
|
java
|
package com.atguigu.lgl;
import java.util.Arrays;
public class ArrayUtils_Luo2 {
public static void main(String[] args) {
int[] numbers1 = {3,1,7,9,5,11};
ArrayUtils_Luo run2 = new ArrayUtils_Luo();
System.out.println(run2.maxNumber(numbers1));
System.out.println(run2.minNumber(numbers1));
System.out.println(run2.sum(numbers1));
System.out.println(run2.ever(numbers1));
System.out.println(Arrays.toString(run2.copyNumber(numbers1)));
System.out.println(Arrays.toString(run2.fanzhuan(numbers1)));
System.out.println(run2.findNumber(numbers1,9));
System.out.println(Arrays.toString(run2.sort(numbers1,true)));
System.out.println(Arrays.toString(run2.sort(numbers1,false)));
}
//排序
public int[] sort(int[] a,boolean boo){
if (boo){
for (int i = 0; i < a.length-1; i++) {
for (int j = 0; j < a.length-i-1; j++) {
if (a[j] > a[j+1]) {
int tmpe = a[j];
a[j] = a[j+1];
a[j+1] = tmpe;
}
}
}
}else {
for (int i = 0; i < a.length-1; i++) {
for (int j = 0; j < a.length-i-1; j++) {
if (a[j] < a[j+1]) {
int tmpe = a[j];
a[j] = a[j+1];
a[j+1] = tmpe;
}
}
}
}
return a;
}
//查找
public int findNumber(int[] a,int b){
int index = -1;
for (int i = 0; i < a.length; i++) {
if ( a[i] == b) {
index = i;
}
}
return index;
}
//反转
public int[] fanzhuan(int[] a){
for (int i = 0,j=a.length-1; i < a.length/2; i++,j--) {
int tmpe = a[i];
a[i] = a[j];
a[j] = tmpe;
}
return a;
}
//复制
public int[] copyNumber(int[] a){
int[] copyNumber = new int[a.length];
for (int i = 0; i < copyNumber.length; i++) {
copyNumber[i] = a[i];
}
return copyNumber;
}
//求平均值
public int ever(int[] a){
return sum(a)/a.length;
}
//求和
public int sum(int[] a){
int sum = 0;
for (int i = 0; i < a.length; i++) {
sum += a[i];
}
return sum;
}
//最小值
public int minNumber(int[] a){
int minNum = a[0];
for (int i = 0; i < a.length; i++) {
if (a[i] < minNum) {
minNum = a[i];
}
}
return minNum;
}
//最大值
public int maxNumber(int[] a){
int maxNum = a[0];
for (int i = 0; i < a.length; i++) {
if (a[i] > maxNum) {
maxNum = a[i];
}
}
return maxNum;
}
}
|
[
"546223079@qq.com"
] |
546223079@qq.com
|
c7db4299aab2fc8ef426f42e4561fb41bca6f268
|
297096090165fdc3bd77db64cccf63c9d32dea99
|
/src/main/java/com/example/filedown/service/FileService.java
|
7c5b5a93a01d61d1974fc86415142724c9f5e3cb
|
[] |
no_license
|
XDFHTY/filedown
|
b5ba863ce39b6455546445c1a50f45e24ed8cac5
|
ed007b41a36ffc79f88179c372408d8eaa49d4ab
|
refs/heads/master
| 2021-03-31T02:17:36.386009
| 2018-03-11T10:04:54
| 2018-03-11T10:04:54
| 124,743,591
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 454
|
java
|
package com.example.filedown.service;
import com.example.filedown.entity.DownWx;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public interface FileService {
//添加微信助手下载记录
public int addDownWX(DownWx downWx);
//文件下载
public void downLoad(HttpServletRequest request, HttpServletResponse response, String name) throws IOException;
}
|
[
"a1668281642@gmail.com"
] |
a1668281642@gmail.com
|
19055505ad692938509058acfd43310eb895bff3
|
771c18a45d0faf10dfb440e4fcff4c317e09a0a2
|
/src/main/java/dev/paie/util/PaieUtils.java
|
55fc21d09dac2a5874a35b0c9acfb64437e9e12d
|
[] |
no_license
|
AlexisVernay/sirh-gestion-paie
|
eb4d835f0e9ba5de6e38712ef96106c33d9cec4c
|
747da89c2bc304a49a8dd2964202702c74ddbb4a
|
refs/heads/master
| 2020-03-12T14:21:08.438207
| 2018-04-30T10:26:15
| 2018-04-30T10:26:15
| 130,665,176
| 0
| 0
| null | 2018-04-23T08:30:32
| 2018-04-23T08:30:32
| null |
UTF-8
|
Java
| false
| false
| 896
|
java
|
package dev.paie.util;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
import org.springframework.stereotype.Component;
@Component
public class PaieUtils {
/**
* Formate un nombre sous la forme xx.xx (exemple : 2.00, 1.90). L'arrondi
* se fait en mode "UP" => 1.904 devient 1.91
*
* @param decimal
* nombre à formater
* @return le nombre formaté
*/
public String formaterBigDecimal(BigDecimal decimal) {
DecimalFormat df = new DecimalFormat();
// forcer le séparateur "." même sur un poste en français
df.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.UK));
df.setMaximumFractionDigits(2);
df.setRoundingMode(RoundingMode.UP);
df.setMinimumFractionDigits(2);
df.setGroupingUsed(false);
return df.format(decimal);
}
}
|
[
"alexisvernay38@gmail.com"
] |
alexisvernay38@gmail.com
|
48917aa4432bd82611a4919bd105e0e36422c615
|
c5dd9e8ad4c17aeb469b26c9cf70932de76d3467
|
/src/co/unal/sm/test/TestPersona.java
|
2cec3702536661603a45bcc1fd9aab546510815c
|
[] |
no_license
|
ApoyosMovilidadUNAL/ProyectoArquitectura
|
e87541e44df7185b3ae42fd9a86bd272ab6652e8
|
b02ae7e761fda657afb90418df206af5f1dacccc
|
refs/heads/master
| 2021-08-16T11:26:56.354599
| 2017-11-19T18:08:10
| 2017-11-19T18:08:10
| 104,141,909
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 739
|
java
|
package co.unal.sm.test;
import co.unal.sm.servicios.ConsumoServicio;
public class TestPersona {
public static void main(String[] args) {
// Persona persona = new Persona();
//
// persona.setNombre("Jhader");
// persona.setApellido("Hurtado");
// persona.setCorreo("jmhurtadoc@unal.edu.co");
// persona.setIdentificacion("1016054188");
//
// Boolean creacion = ClienteServicio.crearCliente(persona);
// System.out.println(creacion);
// @SuppressWarnings("unused")
// PruebaServicio pruebaServicio = new PruebaServicio();
//
// PruebaServicio.prueba();
@SuppressWarnings("unused")
ConsumoServicio consumoServicio = new ConsumoServicio();
ConsumoServicio.obtenerConsumo("jmhurtadoc@unal.edu.co");
}
}
|
[
"jmhurtadoc@unal.edu.co"
] |
jmhurtadoc@unal.edu.co
|
902941c29aded4b422e009d64d521d0e886c8621
|
689ca185a5cf34dbd79980b329ff116bed6a7e8d
|
/src/secao3/Snippet6Foo2.java
|
ae2d5163638c867413dc14852dd73ccb15552e54
|
[] |
no_license
|
fredericobsb/certificacao_java11
|
f892a7b40adf3e0ef0181b73cb7e9515b805548c
|
dcb06d05ed6780c41a87ea9f1b95f57a0e999c00
|
refs/heads/master
| 2023-03-29T08:33:40.842972
| 2021-04-06T11:26:00
| 2021-04-06T11:26:00
| 303,218,092
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 522
|
java
|
package secao3;
public class Snippet6Foo2 {
public static void main(String[] args) {
byte b7 = 0b0000_0001;
char c7 = 0x0_07F;
short s7 = 011_11;
int i7 = 1_000_000;
long d7 = 1_000_000L;
float f7 = 1_000.000_000f;
double l7 = 1.000_0000e10;
System.out.println("b7 = " + b7);
System.out.println("c7 = " + c7);
System.out.println("s7 = " + s7);
System.out.println("i7 = " + i7);
System.out.println("l7 = " + l7);
System.out.println("f7 = " + f7);
System.out.println("d7 = " + d7);
}
}
|
[
"frederico.ramos@ctis.com.br"
] |
frederico.ramos@ctis.com.br
|
25aa18628509051b0dc9a01576e4a9c628fc6e49
|
e4bbfca751cab3ae300734bc5563304fa5b7ab8c
|
/src/main/java/com/leospiritlee/base/collections/AddingGroups.java
|
8e0d7a061c33144626e63ce96a0be1233f758c7e
|
[] |
no_license
|
leospiritlee/JavaStudyDemo
|
7fe59a44f988f49a668d7443a0fb1549f5c802fc
|
b6ea657c2670cdd2eb0d32c37e8373a539ee7687
|
refs/heads/master
| 2021-01-05T14:36:03.697926
| 2020-04-12T06:53:18
| 2020-04-12T06:53:18
| 241,051,896
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,143
|
java
|
package com.leospiritlee.base.collections;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* @Project: JavaStudyDemo
* @ClassName AddingGroups
* @description: TODO
* @author: leospiritlee
* @create: 2020-02-28 18:59
**/
public class AddingGroups {
public static void main(String[] args) {
Collection<Integer> collection =
new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5));
Integer[] moreInts = { 6, 7, 8, 9, 10 };
collection.addAll(Arrays.asList(moreInts));
// Runs significantly faster, but you can't
// construct a Collection this way:
Collections.addAll(collection, 11, 12, 13, 14, 15);
Collections.addAll(collection, moreInts);
// Produces a list "backed by" an array:
List<Integer> list = Arrays.asList(16,17,18,19,20);
list.set(1, 99); // OK -- modify an element
// list.add(21); // Runtime error; the underlying
// array cannot be resized.
System.out.println(collection);
System.out.println(list);
}
}
|
[
"leospiritlee@gmail.com"
] |
leospiritlee@gmail.com
|
67c59c3f69ed7b4b583db86b79a0496b49181a95
|
42aa3166508e973c881086aa411b7b61e447b3ab
|
/HerbertSchildtWork/src/Chapter1/IfDemo.java
|
07b9206fc3a8d7181f04f4c0a7e4110c5a25f93e
|
[] |
no_license
|
JadenTurnbull/JavaBeginner
|
1eb7708d03c8fd24eb3c2c462cde0ac4ee65f073
|
0658328b1db049ed26d3f0d0e4b035acfd6a1862
|
refs/heads/main
| 2023-08-02T15:09:17.856672
| 2021-09-29T08:38:19
| 2021-09-29T08:38:19
| 389,636,016
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 867
|
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 Chapter1;
/**
*
* @author jaden
*/
public class IfDemo {
public static void main(String args[]) {
int a, b, c;
a = 2;
b = 3;
if(a < b) System.out.println("a is less than b");
if(a == b) System.out.println("won't display");
System.out.println();
c = a - b;
System.out.println("c contains -1");
if(c >= 0) System.out.println("c is non-negative");
if(c < 0) System.out.println("c is negative");
System.out.println();
c = b - a;
System.out.println("c contains 1");
if(c >= 0) System.out.println("c is non-negative");
if(c < 0) System.out.println("c is negative");
}
}
|
[
"jaden.turnbull@gmail.com"
] |
jaden.turnbull@gmail.com
|
d2690e99ae41ccf4f84b95cac40aa768f62cc2de
|
6b0cc0c8f9619c24a8ca30606d2fb41fc8fb9dc7
|
/fabric/fabric-commands/src/main/java/io/fabric8/commands/ProfileRefreshAction.java
|
534f5a5a1db318c8ef7ddedc9133d1d4259ff87a
|
[
"Apache-2.0"
] |
permissive
|
brozow/fabric8
|
ae52aa1270bd21eed48b82f724ddb70213e6de50
|
82ecd4d0493e704c6a3de27d22437b2b2009472a
|
refs/heads/master
| 2020-12-25T10:42:27.785835
| 2014-07-11T07:42:28
| 2014-07-11T13:22:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,409
|
java
|
/**
* Copyright 2005-2014 Red Hat, Inc.
*
* Red Hat licenses this file to you 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 io.fabric8.commands;
import io.fabric8.api.FabricService;
import io.fabric8.api.Profile;
import io.fabric8.api.Version;
import io.fabric8.utils.FabricValidations;
import io.fabric8.zookeeper.ZkDefs;
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.karaf.shell.console.AbstractAction;
@Command(name = "profile-refresh", scope = "fabric", description = "Performs a change to the profile, that triggers the deployment agent. It's intended to be used for scanning for snapshot changes", detailedDescription = "classpath:profileRefresh.txt")
public class ProfileRefreshAction extends AbstractAction {
@Argument(index = 0, name = "profile", description = "The target profile to edit", required = true, multiValued = false)
private String profileName;
@Argument(index = 1, name = "version", description = "The version of the profile to edit. Defaults to the current default version.", required = false, multiValued = false)
private String versionName = ZkDefs.DEFAULT_VERSION;
private final FabricService fabricService;
ProfileRefreshAction(FabricService fabricService) {
this.fabricService = fabricService;
}
public FabricService getFabricService() {
return fabricService;
}
@Override
protected Object doExecute() throws Exception {
FabricValidations.validateProfileName(profileName);
Version version = versionName != null ? fabricService.getVersion(versionName) : fabricService.getDefaultVersion();
Profile profile = version.getProfile(profileName);
if (profile == null) {
throw new IllegalArgumentException("No profile found with name:" + profileName + " and version:" + version.getId());
}
profile.refresh();
return null;
}
}
|
[
"claus.ibsen@gmail.com"
] |
claus.ibsen@gmail.com
|
697ef96cba1ac3c970bca27e85362479400a5f03
|
710e1d895802347f9bdd21542ec263ae3504fdef
|
/Project0408/src/GameManager.java
|
b3e4ad5df6be70fcbf1df0037674fdf499164957
|
[] |
no_license
|
jammmm91/JAVA
|
c1b63bd63fed750282b6fb1cebc7e19d9e01eb9b
|
212b24caca6ceb38b640825256ecdcd0f23911a2
|
refs/heads/master
| 2023-07-09T00:58:06.847519
| 2021-08-14T09:15:24
| 2021-08-14T09:15:24
| 353,534,968
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,743
|
java
|
import java.util.Random;
public class GameManager {
public void play() {
Player[] player = {new PlayerType1("피카츄"), new PlayerType1("꼬부기"), new PlayerType1("파이리"), new PlayerType1("이상해씨"), new PlayerType1("미뇽")};
Enemy[] enemy = {new EnemyType1("피죤"), new EnemyType1("꼬렛"), new EnemyType1("냐옹"), new EnemyType1("야돈"), new EnemyType1("뮤")};
Random r = new Random();
for (int i = 0; i < 999999; i++) {
System.out.println("\n" + (i + 1) + "턴\n");
// 플레이어 턴
for (int playerIndex = 0; playerIndex < player.length; playerIndex++) {
int attackTarget = r.nextInt(enemy.length);
if (player[playerIndex].isLive() && enemy[attackTarget].isLive()) {
player[playerIndex].attack(enemy[attackTarget]);
}
}
// 적 턴
for (int enemyIndex = 0; enemyIndex < enemy.length; enemyIndex++) {
int attackTarget = r.nextInt(player.length);
if (enemy[enemyIndex].isLive() && player[attackTarget].isLive()) {
enemy[enemyIndex].attack(player[attackTarget]);
}
}
// 게임 종료 여부 확인
boolean isPlayerLive = false;
for (int playerIndex = 0; playerIndex < player.length; playerIndex++) {
if (player[playerIndex].isLive()) {
isPlayerLive = true;
}
}
boolean isEnemyLive = false;
for (int enemyIndex = 0; enemyIndex < enemy.length; enemyIndex++) {
if (enemy[enemyIndex].isLive()) {
isEnemyLive = true;
}
}
if (isPlayerLive && !isEnemyLive) {
System.out.println("플레이어 승리");
break;
} else if (!isPlayerLive && isEnemyLive) {
System.out.println("적 승리");
break;
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
}
}
}
}
|
[
"ganjinam00@naver.com"
] |
ganjinam00@naver.com
|
ff861cc4e49adf78c9deb62398e7b11ef1e5c104
|
5431875a111b1a17045a7e1b337dd1b23e95139c
|
/src/main/java/com/vg/eventmanagement/requests/AddEvent.java
|
755919665985c4b764268b285cccb7277823b37b
|
[] |
no_license
|
viraag/event-management-backend
|
e5db9ded93618a1dbaea3b3ad4b16b2c4c216169
|
9ce78828c525d55ef9dd1d52314266668bd8894b
|
refs/heads/master
| 2022-11-28T07:13:52.089870
| 2020-08-16T06:05:14
| 2020-08-16T06:05:14
| 286,762,646
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,523
|
java
|
package com.vg.eventmanagement.requests;
import java.io.Serializable;
import java.time.ZoneId;
import java.time.ZonedDateTime;
public class AddEvent implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private long organizerId;
private String eventName;
private String description;
private ZonedDateTime startTime;
private ZonedDateTime endTime;
private ZoneId zoneId;
private Boolean started;
private String venuename;
private String streetAddress;
private String streetAddress2;
private String city;
private String state;
private String country;
private String postalCode;
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ZonedDateTime getStartTime() {
return startTime;
}
public void setStartTime(ZonedDateTime startTime) {
this.startTime = startTime;
}
public ZonedDateTime getEndTime() {
return endTime;
}
public void setEndTime(ZonedDateTime endTime) {
this.endTime = endTime;
}
public ZoneId getZoneId() {
return zoneId;
}
public void setZoneId(ZoneId zoneId) {
this.zoneId = zoneId;
}
public Boolean getStarted() {
return started;
}
public void setStarted(Boolean started) {
this.started = started;
}
public long getOrganizerId() {
return organizerId;
}
public void setOrganizerId(long organizerId) {
this.organizerId = organizerId;
}
public String getVenuename() {
return venuename;
}
public void setVenuename(String venuename) {
this.venuename = venuename;
}
public String getStreetAddress() {
return streetAddress;
}
public void setStreetAddress(String streetAddress) {
this.streetAddress = streetAddress;
}
public String getStreetAddress2() {
return streetAddress2;
}
public void setStreetAddress2(String streetAddress2) {
this.streetAddress2 = streetAddress2;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
}
|
[
"viraagsingh007@gmail.com"
] |
viraagsingh007@gmail.com
|
f2a5c6a484b70f03671998e177028177917588a9
|
ebbefa670b78d837b27a5cc2c128d8fc46b6e4c7
|
/app/src/main/java/com/example/arcgis_for_android/ui/tools/ToolsViewModel.java
|
f57de3e0b5f0964b02d6955b634771cf263d3a19
|
[] |
no_license
|
lichuan1984/GIS
|
23eaffcc7dd1e3cae54a00da252ebca998fe6f82
|
f98afaf58673443c424d90bf82259e09925255a8
|
refs/heads/master
| 2020-12-27T13:14:05.206762
| 2020-02-03T13:38:11
| 2020-02-03T13:38:11
| 237,914,851
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 457
|
java
|
package com.example.arcgis_for_android.ui.tools;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class ToolsViewModel extends ViewModel {
private MutableLiveData<String> mText;
public ToolsViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is tools fragment");
}
public LiveData<String> getText() {
return mText;
}
}
|
[
"lichuan_10@163.com"
] |
lichuan_10@163.com
|
8a1966cc75ec3a9de6853839b1456a37d4b63c6f
|
daa6543d35cc0e0aa27cd02a8e97c2a94de46660
|
/src/DataStructures/MultiTreeNode.java
|
c0f34a21deefe93baf582842667b0e8f174e5d00
|
[] |
no_license
|
Se213/DS_Library_Spring2019
|
397ed0e7a46e7abf1112eb67e199acdb55b16f18
|
476475b80e92cb4bba1e327a8507469f36563fc4
|
refs/heads/master
| 2021-02-19T02:51:25.898919
| 2020-03-05T21:18:54
| 2020-03-05T21:18:54
| 245,269,896
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,950
|
java
|
package DataStructures;
import java.util.ArrayList;
/**
* A MultiTreeNode is a tree node that can have any number of children
* @author clatulip
*/
public class MultiTreeNode<T> {
/**
* Stores the element that is of type <generic>
*/
private T element;
/**
* Stores links to other MultiTreeNodes in an indexed list
*/
private ArrayList<MultiTreeNode<T>> children;
/**
* Default constructor creates an empty node
*/
public MultiTreeNode() {
children = new ArrayList<>();
element = null;
}
/**
* Creates a node containing element
* @param elem element to be stored
*/
public MultiTreeNode(T elem) {
children = new ArrayList<>();
element = elem;
}
/**
* Add a child node to this node, by adding it to the list
* @param child
*/
public void addChild(MultiTreeNode<T> child) {
children.add(child);
}
/**
* Remove a child node from this node, by removing it from the list
* @param child
*/
public void removeChild(MultiTreeNode<T> child) {
children.remove(child);
}
/**
* Find out how many child nodes this node has
* @return size (int) of the arrayList of MultiTreeNodes
*/
public int getNumChildren() {
return children.size();
}
/**
* Get the child node at index specified. Note that if the index isn't valid
* then null is returned. No exception is thrown.
* @param index int
* @return MultiTreeNode that was at specified index
*/
public MultiTreeNode<T> getChild(int index) {
if (index >= children.size()) return null;
return children.get(index);
}
/**
* Returns an ArrayList of all the child nodes
* @return arrayList that contains all the children of this node
*/
public ArrayList<MultiTreeNode<T>> getChildren() {
return children;
}
/**
* Returns the element stored in this node
* @return element stored in the node
*/
public T getElement() {
return element;
}
/**
* Sets the element in this node to the passed in element
* @param elem of generic type
*/
public void setElement(T elem) {
element = elem;
}
/**
* Creates a string out of the element, the number of children, and each child
* @return a string representing this node and it's offspring
*/
@Override
public String toString() {
/*String temp = "MultiTreeNode{" + "element=" + element + ", num_children=" + children.size() + ", children=";
for (int i = 0; i < children.size(); i++) {
temp = temp.concat("\t child " + i + ": " + children.get(i).toString() + ", ");
}
temp = temp.concat("}");
return temp;*/
return element.toString();
}
}
|
[
"60899312+Se213@users.noreply.github.com"
] |
60899312+Se213@users.noreply.github.com
|
6cdcf9b0b1b3af23ca571536b3ff46b1dc5dd477
|
7bea2dd6272d16cc5e55ee8fe2c646108f69dbd5
|
/src/com/test/mvc/blog/Blog.java
|
09b85255bcc7b4874298a15b3d3c6931732f1226
|
[] |
no_license
|
ChnZhangkai/vip1-bm
|
f6ff48c99762abc2f029e2c1675a3c9e53c5dcf7
|
aaf87ab4c75230f677c00c4891392a44eaa2358f
|
refs/heads/master
| 2020-05-14T18:01:43.800890
| 2019-04-17T14:04:28
| 2019-04-17T14:04:28
| 181,902,978
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,616
|
java
|
package com.test.mvc.blog;
import java.sql.Timestamp;
import com.jfinal.log.Log;
import com.platform.annotation.Table;
import com.platform.mvc.base.BaseModel;
/**
* 博客表 model
* @author 董华健 dongcb678@163.com
*/
@SuppressWarnings("unused")
@Table(tableName = "test_blog")
public class Blog extends BaseModel<Blog> {
private static final long serialVersionUID = 6761767368352810428L;
private static final Log log = Log.getLog(Blog.class);
public static final Blog dao = new Blog().dao();
/**
* 字段描述:标题
* 字段类型:character varying 长度:200
*/
public static final String column_title = "title";
/**
* 字段描述:内容
* 字段类型:text 长度:null
*/
public static final String column_content = "content";
/**
* 字段描述:创建时间
* 字段类型:timestamp with time zone 长度:null
*/
public static final String column_createtime = "createtime";
/**
* sqlId : test.blog.splitPageFrom
* 描述:分页from
*/
public static final String sqlId_splitPageFrom = "test.blog.splitPageFrom";
private String title;
private String content;
private String createtime;
public void setTitle(String title){
set(column_title, title);
}
public String getTitle() {
return get(column_title);
}
public void setContent(String content){
set(column_content, content);
}
public String getContent() {
return get(column_content);
}
public void setCreatetime(Timestamp createtime){
set(column_createtime, createtime);
}
public Timestamp getCreatetime() {
return get(column_createtime);
}
}
|
[
"649959626@qq.com"
] |
649959626@qq.com
|
4043b17f5f30a479fe2ea4254e835e3d790e5d38
|
bf7ff3400b21429843b37769a8623d1e43113c33
|
/src/net/fornwall/eclipsecoder/archive/ProblemFetcherJob.java
|
e5d96579a790d2fc7e990c0fb05796e544f4a478
|
[] |
no_license
|
fornwall/eclipsecoder-archive
|
50934db743cfb8d1cfd8c0587cf672f3cba6f4e6
|
ce9d2476eb32eba23fd12e8615ee8ea30cf64d72
|
refs/heads/master
| 2021-01-21T04:26:50.862673
| 2016-08-02T13:10:42
| 2016-08-02T13:10:42
| 2,284,707
| 2
| 5
| null | 2016-07-31T19:32:20
| 2011-08-28T19:34:52
|
Java
|
UTF-8
|
Java
| false
| false
| 3,426
|
java
|
package net.fornwall.eclipsecoder.archive;
import java.net.UnknownHostException;
import java.util.List;
import javax.security.auth.login.LoginException;
import net.fornwall.eclipsecoder.languages.LanguageSupport;
import net.fornwall.eclipsecoder.languages.LanguageSupportFactory;
import net.fornwall.eclipsecoder.preferences.EclipseCoderPlugin;
import net.fornwall.eclipsecoder.stats.ProblemStatement;
import net.fornwall.eclipsecoder.util.Utilities;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
/**
* A job to fetch a problem description from the online TopCoder problem
* archive.
*/
public class ProblemFetcherJob extends Job {
private ProblemStats stats;
public ProblemFetcherJob(ProblemStats stats) {
super(Messages.checkingOutProblem);
this.stats = stats;
setUser(true);
}
@Override
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask(Messages.checkingOutProblem, 100);
try {
String language = EclipseCoderPlugin.getDefault().getPreferenceStore()
.getString(EclipseCoderPlugin.PREFERENCE_LANGUAGE);
List<String> availabe = LanguageSupportFactory.supportedLanguages();
if (language == null || !availabe.contains(language)) {
if (availabe.isEmpty()) {
return new Status(IStatus.ERROR, EclipseCoderPlugin.PLUGIN_ID, IStatus.OK,
Messages.noLanguageSupportFound, null);
}
// fall back to first available if it exists
language = availabe.get(0);
}
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
final String finalLanguage = language;
monitor.subTask(Messages.loggingIntoProblemArchive);
monitor.worked(10);
ProblemScraper scraper = null;
try {
scraper = new ProblemScraper(EclipseCoderPlugin.tcUserName(), EclipseCoderPlugin.tcPassword());
} catch (LoginException loginProblem) {
return ProblemScraper.createLoginFailedStatus(loginProblem);
} catch (UnknownHostException e) {
return new Status(IStatus.ERROR, EclipseCoderPlugin.PLUGIN_ID, IStatus.OK,
Messages.unableToConnectToTopCoder, e);
}
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
monitor.worked(20);
monitor.subTask(Messages.downloadingProblem);
String html = scraper.getHtmlProblemStatement(stats);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
monitor.worked(30);
monitor.subTask(Messages.downloadingTestCases);
List<ProblemScraper.StringPair> testCasesStrings = scraper.getExamples(stats);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
monitor.worked(15);
monitor.subTask(Messages.parsingProblem);
final ProblemStatement problemStatement = ProblemParser.parseProblem(html, testCasesStrings);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
monitor.worked(15);
monitor.subTask(Messages.creatingLanguageSupport);
final LanguageSupport languageSupport = LanguageSupportFactory.createLanguageSupport(finalLanguage);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
Utilities.runInDisplayThread(new Runnable() {
@Override
public void run() {
languageSupport.createProject(problemStatement).openSourceFileInEditor();
}
});
return Status.OK_STATUS;
} catch (Exception exc) {
Utilities.showException(exc);
return Status.CANCEL_STATUS;
}
}
}
|
[
"fredrik@fornwall.net"
] |
fredrik@fornwall.net
|
94df8f9d86eecf28e46b476bc51e4c915af7a896
|
edea1336b3d7d6337b942b8771d72de23a487454
|
/lzrdm1000/Generated JUIC files/trolltech/examples/Ui_ValueControls.java
|
344b1828bc2044b5c242dd2fed46dc553fe58fcb
|
[] |
no_license
|
lodsb/lzrdm1000
|
0ef3eff1e3a451cba22838ee88b9d1b516f267c7
|
72e2c8f45369734a7f29c2367f96e375195cb508
|
refs/heads/master
| 2020-07-05T03:20:15.639857
| 2011-05-04T15:18:42
| 2011-05-04T15:18:42
| 1,701,728
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 12,341
|
java
|
/********************************************************************************
** Form generated from reading ui file 'valuecontrols.jui'
**
** Created: Di Apr 14 23:02:41 2009
** by: Qt User Interface Compiler version 4.4.2
**
** WARNING! All changes made in this file will be lost when recompiling ui file!
********************************************************************************/
package trolltech.examples;
import com.trolltech.qt.core.*;
import com.trolltech.qt.gui.*;
public class Ui_ValueControls
{
public QVBoxLayout verticalLayout;
public QWidget ColorizeControlWidget;
public QFormLayout formLayout;
public QLabel label;
public QSlider colorizeRedSlider;
public QLabel label_2;
public QSlider colorizeGreenSlider;
public QLabel label_3;
public QSlider colorizeBlueSlider;
public QWidget DropShadowControlWidget;
public QFormLayout formLayout_2;
public QLabel label_4;
public QSlider dropShadowRedSlider;
public QLabel label_5;
public QSlider dropShadowGreenSlider;
public QLabel label_6;
public QSlider dropShadowBlueSlider;
public QLabel label_7;
public QSlider dropShadowXSlider;
public QLabel label_8;
public QSlider dropShadowYSlider;
public QLabel label_9;
public QSlider dropShadowRadiusSlider;
public QLabel label_10;
public QSlider dropShadowAlphaSlider;
public QWidget ConvolutionControlWidget;
public QGridLayout gridLayout;
public QLineEdit kernel_1x1;
public QLineEdit kernel_2x1;
public QLineEdit kernel_3x1;
public QLineEdit kernel_1x2;
public QLineEdit kernel_2x2;
public QLineEdit kernel_3x2;
public QLineEdit kernel_1x3;
public QLineEdit kernel_2x3;
public QLineEdit kernel_3x3;
public Ui_ValueControls() { super(); }
public void setupUi(QWidget ValueControls)
{
ValueControls.setObjectName("ValueControls");
ValueControls.setEnabled(true);
ValueControls.resize(new QSize(321, 420).expandedTo(ValueControls.minimumSizeHint()));
QSizePolicy sizePolicy = new QSizePolicy(com.trolltech.qt.gui.QSizePolicy.Policy.Preferred, com.trolltech.qt.gui.QSizePolicy.Policy.Preferred);
sizePolicy.setHorizontalStretch((byte)0);
sizePolicy.setVerticalStretch((byte)0);
sizePolicy.setHeightForWidth(ValueControls.sizePolicy().hasHeightForWidth());
ValueControls.setSizePolicy(sizePolicy);
verticalLayout = new QVBoxLayout(ValueControls);
verticalLayout.setObjectName("verticalLayout");
ColorizeControlWidget = new QWidget(ValueControls);
ColorizeControlWidget.setObjectName("ColorizeControlWidget");
formLayout = new QFormLayout(ColorizeControlWidget);
formLayout.setObjectName("formLayout");
label = new QLabel(ColorizeControlWidget);
label.setObjectName("label");
formLayout.addWidget(label);
colorizeRedSlider = new QSlider(ColorizeControlWidget);
colorizeRedSlider.setObjectName("colorizeRedSlider");
colorizeRedSlider.setValue(64);
colorizeRedSlider.setMaximum(255);
colorizeRedSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout.addWidget(colorizeRedSlider);
label_2 = new QLabel(ColorizeControlWidget);
label_2.setObjectName("label_2");
formLayout.addWidget(label_2);
colorizeGreenSlider = new QSlider(ColorizeControlWidget);
colorizeGreenSlider.setObjectName("colorizeGreenSlider");
colorizeGreenSlider.setValue(32);
colorizeGreenSlider.setMaximum(255);
colorizeGreenSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout.addWidget(colorizeGreenSlider);
label_3 = new QLabel(ColorizeControlWidget);
label_3.setObjectName("label_3");
formLayout.addWidget(label_3);
colorizeBlueSlider = new QSlider(ColorizeControlWidget);
colorizeBlueSlider.setObjectName("colorizeBlueSlider");
colorizeBlueSlider.setValue(99);
colorizeBlueSlider.setMaximum(255);
colorizeBlueSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout.addWidget(colorizeBlueSlider);
verticalLayout.addWidget(ColorizeControlWidget);
DropShadowControlWidget = new QWidget(ValueControls);
DropShadowControlWidget.setObjectName("DropShadowControlWidget");
formLayout_2 = new QFormLayout(DropShadowControlWidget);
formLayout_2.setObjectName("formLayout_2");
formLayout_2.setFieldGrowthPolicy(com.trolltech.qt.gui.QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow);
label_4 = new QLabel(DropShadowControlWidget);
label_4.setObjectName("label_4");
formLayout_2.addWidget(label_4);
dropShadowRedSlider = new QSlider(DropShadowControlWidget);
dropShadowRedSlider.setObjectName("dropShadowRedSlider");
dropShadowRedSlider.setMaximum(255);
dropShadowRedSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowRedSlider);
label_5 = new QLabel(DropShadowControlWidget);
label_5.setObjectName("label_5");
formLayout_2.addWidget(label_5);
dropShadowGreenSlider = new QSlider(DropShadowControlWidget);
dropShadowGreenSlider.setObjectName("dropShadowGreenSlider");
dropShadowGreenSlider.setMaximum(255);
dropShadowGreenSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowGreenSlider);
label_6 = new QLabel(DropShadowControlWidget);
label_6.setObjectName("label_6");
formLayout_2.addWidget(label_6);
dropShadowBlueSlider = new QSlider(DropShadowControlWidget);
dropShadowBlueSlider.setObjectName("dropShadowBlueSlider");
dropShadowBlueSlider.setMaximum(255);
dropShadowBlueSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowBlueSlider);
label_7 = new QLabel(DropShadowControlWidget);
label_7.setObjectName("label_7");
formLayout_2.addWidget(label_7);
dropShadowXSlider = new QSlider(DropShadowControlWidget);
dropShadowXSlider.setObjectName("dropShadowXSlider");
dropShadowXSlider.setMaximum(999);
dropShadowXSlider.setValue(600);
dropShadowXSlider.setMinimum(0);
dropShadowXSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowXSlider);
label_8 = new QLabel(DropShadowControlWidget);
label_8.setObjectName("label_8");
formLayout_2.addWidget(label_8);
dropShadowYSlider = new QSlider(DropShadowControlWidget);
dropShadowYSlider.setObjectName("dropShadowYSlider");
dropShadowYSlider.setValue(99);
dropShadowYSlider.setMaximum(999);
dropShadowYSlider.setValue(600);
dropShadowYSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowYSlider);
label_9 = new QLabel(DropShadowControlWidget);
label_9.setObjectName("label_9");
formLayout_2.addWidget(label_9);
dropShadowRadiusSlider = new QSlider(DropShadowControlWidget);
dropShadowRadiusSlider.setObjectName("dropShadowRadiusSlider");
dropShadowRadiusSlider.setMaximum(299);
dropShadowRadiusSlider.setValue(30);
dropShadowRadiusSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowRadiusSlider);
label_10 = new QLabel(DropShadowControlWidget);
label_10.setObjectName("label_10");
formLayout_2.addWidget(label_10);
dropShadowAlphaSlider = new QSlider(DropShadowControlWidget);
dropShadowAlphaSlider.setObjectName("dropShadowAlphaSlider");
dropShadowAlphaSlider.setValue(99);
dropShadowAlphaSlider.setMaximum(255);
dropShadowAlphaSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowAlphaSlider);
verticalLayout.addWidget(DropShadowControlWidget);
ConvolutionControlWidget = new QWidget(ValueControls);
ConvolutionControlWidget.setObjectName("ConvolutionControlWidget");
gridLayout = new QGridLayout(ConvolutionControlWidget);
gridLayout.setObjectName("gridLayout");
kernel_1x1 = new QLineEdit(ConvolutionControlWidget);
kernel_1x1.setObjectName("kernel_1x1");
gridLayout.addWidget(kernel_1x1, 0, 0, 1, 1);
kernel_2x1 = new QLineEdit(ConvolutionControlWidget);
kernel_2x1.setObjectName("kernel_2x1");
gridLayout.addWidget(kernel_2x1, 0, 1, 1, 1);
kernel_3x1 = new QLineEdit(ConvolutionControlWidget);
kernel_3x1.setObjectName("kernel_3x1");
gridLayout.addWidget(kernel_3x1, 0, 2, 1, 1);
kernel_1x2 = new QLineEdit(ConvolutionControlWidget);
kernel_1x2.setObjectName("kernel_1x2");
gridLayout.addWidget(kernel_1x2, 1, 0, 1, 1);
kernel_2x2 = new QLineEdit(ConvolutionControlWidget);
kernel_2x2.setObjectName("kernel_2x2");
gridLayout.addWidget(kernel_2x2, 1, 1, 1, 1);
kernel_3x2 = new QLineEdit(ConvolutionControlWidget);
kernel_3x2.setObjectName("kernel_3x2");
gridLayout.addWidget(kernel_3x2, 1, 2, 1, 1);
kernel_1x3 = new QLineEdit(ConvolutionControlWidget);
kernel_1x3.setObjectName("kernel_1x3");
gridLayout.addWidget(kernel_1x3, 2, 0, 1, 1);
kernel_2x3 = new QLineEdit(ConvolutionControlWidget);
kernel_2x3.setObjectName("kernel_2x3");
gridLayout.addWidget(kernel_2x3, 2, 1, 1, 1);
kernel_3x3 = new QLineEdit(ConvolutionControlWidget);
kernel_3x3.setObjectName("kernel_3x3");
gridLayout.addWidget(kernel_3x3, 2, 2, 1, 1);
verticalLayout.addWidget(ConvolutionControlWidget);
retranslateUi(ValueControls);
ValueControls.connectSlotsByName();
} // setupUi
void retranslateUi(QWidget ValueControls)
{
ValueControls.setWindowTitle(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Form"));
label.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Red"));
label_2.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Green"));
label_3.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Blue"));
label_4.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Red"));
label_5.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Green"));
label_6.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Blue"));
label_7.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "X Distance"));
label_8.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Y Distance"));
label_9.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Blur Radius"));
label_10.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Alpha"));
kernel_1x1.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_2x1.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_3x1.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_1x2.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_2x2.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.2"));
kernel_3x2.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_1x3.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_2x3.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_3x3.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
} // retranslateUi
}
|
[
"nonomonomusic@fd5aab1e-e55a-11dd-9ba5-89a75009fd5d"
] |
nonomonomusic@fd5aab1e-e55a-11dd-9ba5-89a75009fd5d
|
db74e8ca8572747c39bd11b7b0c26c9d279bfefa
|
fca014e12b71d5ba73ac01f5e9b2439a41fdee94
|
/app/src/main/java/babiy/reminder/Thursday_Activity.java
|
bf16a8e6e147533d3bc9a5b848def8d281f10de5
|
[] |
no_license
|
Inhorn/Planner
|
8faddbbd3cc48dd5ccaf5ed8d743c3215d78f61f
|
b2fe5e49263895b3b110275451dc9e65184a2286
|
refs/heads/master
| 2021-06-15T00:30:26.330030
| 2017-03-23T17:08:02
| 2017-03-23T17:08:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,271
|
java
|
package babiy.reminder;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import java.util.List;
public class Thursday_Activity extends AppCompatActivity implements View.OnClickListener{
Button btnCrete;
DatabaseHandler db;
ListView lvTasks;
List<Task> listTask;
static int ID = 0;
static final int REQUEST_ADD_TASK = 1;
static final int REQUEST_EDIT_TASK = 2;
static final int REQUEST_DELL_ALL = 3;
@Override
protected void onCreate(Bundle savedInstanceState) {
setTitle(MainActivity.DAY);
super.onCreate(savedInstanceState);
setTitle(getString(R.string.labelThursday));
setContentView(R.layout.activity_thursday);
btnCrete = (Button) findViewById(R.id.btnCreate);
btnCrete.setOnClickListener(this);
db = new DatabaseHandler(this);
showTasks();
}
public void showTasks() {
listTask = db.getAllTasks(MainActivity.DAY);
lvTasks = (ListView) findViewById(R.id.lvList);
ArrayAdapter<Task> adapter = new ArrayAdapter<>(this, R.layout.item, listTask);
registerForContextMenu(lvTasks);
lvTasks.setAdapter(adapter);
lvTasks.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
ID = position;
return false;
}
});
}
@Override
public void onClick(View v) {
Intent intent = new Intent(this, Edit_Activity.class);
startActivityForResult(intent, REQUEST_ADD_TASK);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_day, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
Intent intent;
switch (id) {
case R.id.deleteAllInDay:
intent = new Intent(this, DeleteAll.class);
startActivityForResult(intent, REQUEST_DELL_ALL);
break;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (data == null) {
return;
}
if (resultCode == RESULT_OK) {
String task;
switch (requestCode) {
case REQUEST_ADD_TASK:
task = data.getStringExtra("task");
db.addTask(new Task(task, MainActivity.DAY));
showTasks();
break;
case REQUEST_EDIT_TASK:
Task newTask = listTask.get(ID);
task = data.getStringExtra("task");
newTask.setTask(task);
db.editTask(newTask);
showTasks();
break;
case REQUEST_DELL_ALL:
db.delAllDay(MainActivity.DAY);
finish();
startActivity(getIntent());
break;
}
}
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
getMenuInflater().inflate(R.menu.context_menu, menu);
}
@Override
public boolean onContextItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.itemDelete:
db.deleteTask(listTask.get(ID));
showTasks();
break;
case R.id.itemEdit:
Intent intent = new Intent(this, Edit_Activity.class);
startActivityForResult(intent, REQUEST_EDIT_TASK);
break;
}
return super.onContextItemSelected(item);
}
}
|
[
"secuna00inhorn@gmail.com"
] |
secuna00inhorn@gmail.com
|
b1dda52964fb0f308a7c856e134cfcd23d159cef
|
69bc25110a86af77c6f18e92eded56d19ce0fe0f
|
/src/com/eyoubika/spider/web/action/EpianhongSpiderAction.java
|
13fabf8d4015785b90dd2a0ab6f4ec29c9a09a2b
|
[] |
no_license
|
ljx728/eyoubika
|
1ee14ab22b0989410f6a8d5452619c595e0ebf2b
|
d356e1f8c0107f2e7d9984cd25d9415aa792d452
|
refs/heads/master
| 2020-04-11T18:26:25.224214
| 2018-12-16T12:33:18
| 2018-12-16T12:33:18
| 161,998,793
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,221
|
java
|
package com.eyoubika.spider.web.action;
import java.io.UnsupportedEncodingException;
import java.util.Properties;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.eyoubika.common.BaseAction;
import com.eyoubika.common.YbkException;
import com.eyoubika.util.ConverterUtil;
import com.eyoubika.spider.web.VO.FetchVO;
import com.eyoubika.spider.service.IEpianhongSpiderService;
import com.eyoubika.spider.service.INjwjsSpiderService;
/*==========================================================================================*
* Description: 定义了用户控制器
* Class: UserAction
* Author: lijiaxuan
* Copyright: CaiDan (c) 2015 jiaxuan.li@eyoubika.com
* History: 1.0 created by lijiaxuan at 2015-5-21 14:17:33
*==========================================================================================*/
public class EpianhongSpiderAction extends BaseAction {
private FetchVO fetchVO;
private IEpianhongSpiderService epianhongSpiderService;
public FetchVO getFetchVO() {
return fetchVO;
}
public void setFetchVO(FetchVO fetchVO) {
this.fetchVO = fetchVO;
}
public IEpianhongSpiderService getEpianhongSpiderService() {
return epianhongSpiderService;
}
public void setEpianhongSpiderService(
IEpianhongSpiderService epianhongSpiderService) {
this.epianhongSpiderService = epianhongSpiderService;
}
/*--------------------------------------------------------------------------------------*
* Description: 用户注册
* Method: register
* Parameters: void
* History: 1.0 created by lijiaxuan at 2015-5-21 14:22:16
*--------------------------------------------------------------------------------------*/
public String fetchQuotations(){
HttpServletRequest request = ServletActionContext.getRequest();
ConverterUtil.RequestToVO(request, fetchVO);
this.jsonData = epianhongSpiderService.fetchQuotations(fetchVO);
return SUCCESS;
}
public String fetchSbcs(){
HttpServletRequest request = ServletActionContext.getRequest();
ConverterUtil.RequestToVO(request, fetchVO);
this.jsonData = epianhongSpiderService.fetchSbcs(fetchVO);
return SUCCESS;
}
}
|
[
"ljx728@foxmail.com"
] |
ljx728@foxmail.com
|
0ef21552c40b93f2becabc2f367e0285b66a6430
|
dbb5eeb30acb0cf24dd47cfb8533697af9164c25
|
/Java file/chap03/src/sec02/verify/exam10/Exam10.java
|
319b9ed4ccb7da9795ff33ab146aca5402e03e1e
|
[] |
no_license
|
eunjoo-ny/Jenny_Eunjoo_2020
|
4377d248e438855ba9f15b910b95e64318e8ebb6
|
f4b25a00adc10823642d63126ea22141b6f40d25
|
refs/heads/master
| 2023-02-10T09:08:24.204399
| 2021-01-11T11:52:28
| 2021-01-11T11:52:28
| 317,743,136
| 0
| 0
| null | null | null | null |
WINDOWS-1252
|
Java
| false
| false
| 280
|
java
|
package sec02.verify.exam10;
public class Exam10 {
public static void main(String[] args) {
int var1 = 10;
int var2 = 3;
int var3 = 14;
double var4 = var1 * var1 * Double.parseDouble(var2 + "." + var3);
System.out.println("¿øÀÇ ³ÐÀÌ:" + var4);
}
}
|
[
"ea2319@nyu.edu"
] |
ea2319@nyu.edu
|
009c32574217b1c1dc7cd6a142785b879059ba50
|
c99cdda169f47ee571739260988b7de581a7e6e8
|
/common/network-common/src/main/java/org/apache/spark/network/TransportContext.java
|
8b31e44422079dc6e3de677a8026ed60225fcad1
|
[
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"Python-2.0",
"MIT",
"CC0-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"CDDL-1.0",
"MPL-1.1",
"BSD-2-Clause",
"CDDL-1.1",
"LGPL-2.1-only",
"LicenseRef-scancode-other-permissive",
"NAIST-2003",
"GCC-exception-3.1",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-other-copyleft",
"CC-BY-SA-3.0",
"LGPL-2.0-or-later",
"GPL-2.0-only",
"EPL-1.0",
"Classpath-exception-2.0",
"LicenseRef-scancode-unicode",
"CPL-1.0",
"CC-PDDC",
"LicenseRef-scancode-unknown"
] |
permissive
|
Lorraine318/spark2.1.0
|
3790ef6ed077c02ec23dc23dcd6fb214aefe6f0b
|
7d9b87569d5a5c6dfe32802fa9e8015a0e9e23fe
|
refs/heads/master
| 2022-12-08T04:05:42.825345
| 2020-04-09T08:39:14
| 2020-04-09T08:39:14
| 252,354,284
| 0
| 0
|
Apache-2.0
| 2022-12-05T23:45:33
| 2020-04-02T04:21:58
|
Scala
|
UTF-8
|
Java
| false
| false
| 9,617
|
java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.spark.network;
import java.util.ArrayList;
import java.util.List;
import io.netty.channel.Channel;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.timeout.IdleStateHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.spark.network.client.TransportClient;
import org.apache.spark.network.client.TransportClientBootstrap;
import org.apache.spark.network.client.TransportClientFactory;
import org.apache.spark.network.client.TransportResponseHandler;
import org.apache.spark.network.protocol.MessageDecoder;
import org.apache.spark.network.protocol.MessageEncoder;
import org.apache.spark.network.server.RpcHandler;
import org.apache.spark.network.server.TransportChannelHandler;
import org.apache.spark.network.server.TransportRequestHandler;
import org.apache.spark.network.server.TransportServer;
import org.apache.spark.network.server.TransportServerBootstrap;
import org.apache.spark.network.util.NettyUtils;
import org.apache.spark.network.util.TransportConf;
import org.apache.spark.network.util.TransportFrameDecoder;
/**
* Contains the context to create a {@link TransportServer}, {@link TransportClientFactory}, and to
* setup Netty Channel pipelines with a
* {@link org.apache.spark.network.server.TransportChannelHandler}.
*
* There are two communication protocols that the TransportClient provides, control-plane RPCs and
* data-plane "chunk fetching". The handling of the RPCs is performed outside of the scope of the
* TransportContext (i.e., by a user-provided handler), and it is responsible for setting up streams
* which can be streamed through the data plane in chunks using zero-copy IO.
*
* The TransportServer and TransportClientFactory both create a TransportChannelHandler for each
* channel. As each TransportChannelHandler contains a TransportClient, this enables server
* processes to send messages back to the client on an existing channel.
*/
//传输上下文
public class TransportContext {
private static final Logger logger = LoggerFactory.getLogger(TransportContext.class);
//传输上下文的配置信息 transportConf
private final TransportConf conf;
//对客户端请求消息进行处理的rpcHandler,对调用传输客户端transportClient的sendRPC方法发送的消息进行处理的程序。
private final RpcHandler rpcHandler;
private final boolean closeIdleConnections;
/**
* Force to create MessageEncoder and MessageDecoder so that we can make sure they will be created
* before switching the current context class loader to ExecutorClassLoader.
*
* Netty's MessageToMessageEncoder uses Javassist to generate a matcher class and the
* implementation calls "Class.forName" to check if this calls is already generated. If the
* following two objects are created in "ExecutorClassLoader.findClass", it will cause
* "ClassCircularityError". This is because loading this Netty generated class will call
* "ExecutorClassLoader.findClass" to search this class, and "ExecutorClassLoader" will try to use
* RPC to load it and cause to load the non-exist matcher class again. JVM will report
* `ClassCircularityError` to prevent such infinite recursion. (See SPARK-17714)
*/
//在消息放入管道前,先对消息内容进行编码,防止管道另一端读取时丢包和解析错误。
private static final MessageEncoder ENCODER = MessageEncoder.INSTANCE;
//对从管道中读取的ByteBuf进行解析,防止丢包和解析错误。
private static final MessageDecoder DECODER = MessageDecoder.INSTANCE;
public TransportContext(TransportConf conf, RpcHandler rpcHandler) {
this(conf, rpcHandler, false);
}
public TransportContext(
TransportConf conf,
RpcHandler rpcHandler,
boolean closeIdleConnections) {
this.conf = conf;
this.rpcHandler = rpcHandler;
this.closeIdleConnections = closeIdleConnections;
}
/**
* Initializes a ClientFactory which runs the given TransportClientBootstraps prior to returning
* a new Client. Bootstraps will be executed synchronously, and must run successfully in order
* to create a Client.
*
* 初始化一个ClientFactory,该ClientFactory在返回之前运行给定的TransportClientBootstraps
* 一个新客户。 引导程序将同步执行,并且必须按顺序成功运行
* 创建一个客户端。
*/
public TransportClientFactory createClientFactory(List<TransportClientBootstrap> bootstraps) {
//参数传递的transportContext的引用
return new TransportClientFactory(this, bootstraps);
}
public TransportClientFactory createClientFactory() {
return createClientFactory(new ArrayList<>());
}
/** Create a server which will attempt to bind to a specific port.
* 创建将尝试绑定到特定端口的服务器
* */
//创建传输服务端transportServer的实例。
public TransportServer createServer(int port, List<TransportServerBootstrap> bootstraps) {
return new TransportServer(this, null, port, rpcHandler, bootstraps);
}
/** Create a server which will attempt to bind to a specific host and port. */
public TransportServer createServer(
String host, int port, List<TransportServerBootstrap> bootstraps) {
return new TransportServer(this, host, port, rpcHandler, bootstraps);
}
/** Creates a new server, binding to any available ephemeral port. */
public TransportServer createServer(List<TransportServerBootstrap> bootstraps) {
return createServer(0, bootstraps);
}
public TransportServer createServer() {
return createServer(0, new ArrayList<>());
}
public TransportChannelHandler initializePipeline(SocketChannel channel) {
return initializePipeline(channel, rpcHandler);
}
/**
* Initializes a client or server Netty Channel Pipeline which encodes/decodes messages and
* has a {@link org.apache.spark.network.server.TransportChannelHandler} to handle request or
* response messages.
*
* @param channel The channel to initialize.
* @param channelRpcHandler The RPC handler to use for the channel.
*
* @return Returns the created TransportChannelHandler, which includes a TransportClient that can
* be used to communicate on this channel. The TransportClient is directly associated with a
* ChannelHandler to ensure all users of the same channel get the same TransportClient object.
*/
//管道初始化 无论客户端和服务端都可以走这
public TransportChannelHandler initializePipeline(
SocketChannel channel,
RpcHandler channelRpcHandler) {
try {
TransportChannelHandler channelHandler = createChannelHandler(channel, channelRpcHandler);
channel.pipeline()
.addLast("encoder", ENCODER)
//对从管道中读取的ByteBuf按照数据帧进行解析
.addLast(TransportFrameDecoder.HANDLER_NAME, NettyUtils.createFrameDecoder())
.addLast("decoder", DECODER)
//心跳handler 读 写 读或者写 如果超出,触发自定义里面的事件
.addLast("idleStateHandler", new IdleStateHandler(0, 0, conf.connectionTimeoutMs() / 1000))
// NOTE: Chunks are currently guaranteed to be returned in the order of request, but this
// would require more logic to guarantee if this were not part of the same event loop.
.addLast("handler", channelHandler);
return channelHandler;
} catch (RuntimeException e) {
logger.error("Error while initializing Netty pipeline", e);
throw e;
}
}
/**
* Creates the server- and client-side handler which is used to handle both RequestMessages and
* ResponseMessages. The channel is expected to have been successfully created, though certain
* properties (such as the remoteAddress()) may not be available yet.
*/
//真正创建了TransportClient
private TransportChannelHandler createChannelHandler(Channel channel, RpcHandler rpcHandler) {
//用于处理服务端的响应,并且对发出请求的客户端进行响应的处理程序
TransportResponseHandler responseHandler = new TransportResponseHandler(channel);
//RPC客户端
TransportClient client = new TransportClient(channel, responseHandler);
//用于处理客户端的请求并在写完块数据后返回的处理程序
TransportRequestHandler requestHandler = new TransportRequestHandler(channel, client,
rpcHandler, conf.maxChunksBeingTransferred());
//代理由TransportRequestHandler处理的请求和由TransportResponseHandler处理的响应,并加入传输层的处理
return new TransportChannelHandler(client, responseHandler, requestHandler,
conf.connectionTimeoutMs(), closeIdleConnections);
}
public TransportConf getConf() { return conf; }
}
|
[
"Lorraine72@163.com"
] |
Lorraine72@163.com
|
15ce5193b2ec3b7ff26508efff7e24456fa41164
|
07ae17e3daf4245fe1c66e7d3c0a8cba1c583b32
|
/providers/ecc-s3/src/test/java/org/jclouds/ecc/ECCWalrusAsyncClientTestDisabled.java
|
cb9236cdaea5ede56cdaa7389bb0a7e480e9b61a
|
[
"Apache-2.0"
] |
permissive
|
PradyumnaNagendra/jclouds
|
0a14535e8c135702341453fc059e74db7a3c8b62
|
f7576dfc697e54a68baf09967bccc8f708735992
|
refs/heads/master
| 2020-04-12T10:02:21.260099
| 2011-01-19T01:56:24
| 2011-01-19T01:56:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,335
|
java
|
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.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 org.jclouds.ecc;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(enabled = false, groups = "unit", testName = "ECCWalrusAsyncClientTest")
public class ECCWalrusAsyncClientTestDisabled extends org.jclouds.walrus.WalrusAsyncClientTestDisabled {
public ECCWalrusAsyncClientTestDisabled() {
this.provider = "ecc";
this.url = "commondatastorage.googleapis.com";
}
// TODO parameterize this test so that it can pass
}
|
[
"adrian@jclouds.org"
] |
adrian@jclouds.org
|
35720715e152837b8bff3a81ccc230498a3089f3
|
61f80445c43d45203d0852deed9fa926813df89f
|
/examples/featuremodeling/org.eclipselabs.spray.featuremodeling.domain/src/ca/uwaterloo/gp/fmp/util/FmpSwitch.java
|
8fc9c0bbd7a8bd56502f85b5daf1db90dc5acdcc
|
[] |
no_license
|
joergreichert/spray
|
c19319d2795caa7198633073915ab6feedf15ffd
|
f07afb5a39d908dc5e02f455f90db9cfccbcfba1
|
refs/heads/master
| 2021-01-15T23:45:46.239393
| 2017-01-14T12:42:06
| 2017-01-14T12:42:06
| 34,267,449
| 1
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 9,310
|
java
|
/**
*/
package ca.uwaterloo.gp.fmp.util;
import ca.uwaterloo.gp.fmp.*;
import java.util.List;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* The <b>Switch</b> for the model's inheritance hierarchy.
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
* to invoke the <code>caseXXX</code> method for each class of the model,
* starting with the actual class of the object
* and proceeding up the inheritance hierarchy
* until a non-null result is returned,
* which is the result of the switch.
* <!-- end-user-doc -->
* @see ca.uwaterloo.gp.fmp.FmpPackage
* @generated
*/
public class FmpSwitch {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static FmpPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FmpSwitch() {
if (modelPackage == null) {
modelPackage = FmpPackage.eINSTANCE;
}
}
/**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
public Object doSwitch(EObject theEObject) {
return doSwitch(theEObject.eClass(), theEObject);
}
/**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
protected Object doSwitch(EClass theEClass, EObject theEObject) {
if (theEClass.eContainer() == modelPackage) {
return doSwitch(theEClass.getClassifierID(), theEObject);
}
else {
List eSuperTypes = theEClass.getESuperTypes();
return
eSuperTypes.isEmpty() ?
defaultCase(theEObject) :
doSwitch((EClass)eSuperTypes.get(0), theEObject);
}
}
/**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
protected Object doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case FmpPackage.FEATURE: {
Feature feature = (Feature)theEObject;
Object result = caseFeature(feature);
if (result == null) result = caseClonable(feature);
if (result == null) result = caseNode(feature);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.FEATURE_GROUP: {
FeatureGroup featureGroup = (FeatureGroup)theEObject;
Object result = caseFeatureGroup(featureGroup);
if (result == null) result = caseNode(featureGroup);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.NODE: {
Node node = (Node)theEObject;
Object result = caseNode(node);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.REFERENCE: {
Reference reference = (Reference)theEObject;
Object result = caseReference(reference);
if (result == null) result = caseClonable(reference);
if (result == null) result = caseNode(reference);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.PROJECT: {
Project project = (Project)theEObject;
Object result = caseProject(project);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.TYPED_VALUE: {
TypedValue typedValue = (TypedValue)theEObject;
Object result = caseTypedValue(typedValue);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.CLONABLE: {
Clonable clonable = (Clonable)theEObject;
Object result = caseClonable(clonable);
if (result == null) result = caseNode(clonable);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.CONSTRAINT: {
Constraint constraint = (Constraint)theEObject;
Object result = caseConstraint(constraint);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Feature</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Feature</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseFeature(Feature object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Feature Group</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Feature Group</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseFeatureGroup(FeatureGroup object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Node</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseNode(Node object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Reference</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Reference</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseReference(Reference object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Project</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Project</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseProject(Project object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Typed Value</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Typed Value</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseTypedValue(TypedValue object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Clonable</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Clonable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseClonable(Clonable object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Constraint</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Constraint</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseConstraint(Constraint object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch, but this is the last case anyway.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
public Object defaultCase(EObject object) {
return null;
}
} //FmpSwitch
|
[
"de.abg.reichert.joerg@googlemail.com"
] |
de.abg.reichert.joerg@googlemail.com
|
6d9a941dad411d7385c9db85f984f06cc4c8edb6
|
6e0f1b371d5f4c35ce4845b03f7273533cc9f0bc
|
/src/main/java/com/ivo/mrp/entity/packaging/SupplierPackage.java
|
c389e3970472004a0fc61aa25bdb618102f2cb8f
|
[] |
no_license
|
badby001/mrp
|
4067068a00989ffa713d0e501e59ef456625bd43
|
0e8e6c0601023f4087afc0575515eeba8eecced9
|
refs/heads/master
| 2022-12-17T14:53:19.114740
| 2020-09-27T03:32:49
| 2020-09-27T03:32:49
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,607
|
java
|
package com.ivo.mrp.entity.packaging;
import com.ivo.common.model.AutoIncreaseEntityModel;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 包材的供应商
* @author wj
* @version 1.0
*/
@Setter
@Getter
@Entity
@Table(name = "MRP3_Supplier_Package")
public class SupplierPackage extends AutoIncreaseEntityModel {
/**
* 月份
*/
private String month;
/**
* 机种
*/
private String project;
/**
* 单片/连片类型
*/
private String linkType;
/**
* 连片数
*/
private Double linkQty;
/**
* 包装数量
*/
private Double panelQty;
/**
* 厂别类型
*/
private String type;
/**
* MODEL
*/
private String model;
/**
* 切片数
*/
private Double cut;
@OneToMany(mappedBy="supplierPackage", cascade= CascadeType.ALL)
private List<SupplierPackageDetail> supplierList = new ArrayList<>();
/**
* 有效性标识
*/
private boolean validFlag = true;
/**
* 备注
*/
private String memo = "";
/**
* 创建者
*/
private String creator = "";
/**
* 创建时间
*/
private Date createDate = new Date();
/**
* 修改者
*/
private String updater = "";
/**
* 修改时间
*/
private Date updateDate = new Date();
}
|
[
"1556879688@qq.com"
] |
1556879688@qq.com
|
f94ca9b4d5c053904ac3ae63d8e87129c21ff3ff
|
df74cc468248274f5427303b76803d786897f40f
|
/Team_project/src/test/java/stepDefenetion/BIT_About_stepDef.java
|
c78fca003cf59cc592e5d82f905043e8a7177edb
|
[] |
no_license
|
JavidNasib/test_project
|
4af575a88c7fa356a5630f6a903f6c85bee12a17
|
30d23311b8f281d26685354ef0be68b025328ccb
|
refs/heads/master
| 2022-12-28T10:08:41.146509
| 2020-01-18T16:37:23
| 2020-01-18T16:37:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,449
|
java
|
package stepDefenetion;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.*;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import pages.BIT_About_page;
import pages.BIT_HomePage_page;
import utils.SingletonBrowser;
import utils.Utility;
public class BIT_About_stepDef {
SingletonBrowser sb = SingletonBrowser.getSingletonBrowser();
WebDriver driver = sb.getDriver();
BIT_About_page about = new BIT_About_page(driver);
@Given("User clicks on About")
public void user_clicks_on_About() {
about.clickAbout.click();
}
// @Then("User verifies head title of page {string}")
public void user_verifies_head_title_of_page(String expectedHeader) {
String actualHeader = about.aboutHeadTitle.getText();
System.out.println(expectedHeader);
System.out.println(actualHeader);
assertEquals(expectedHeader, actualHeader);
}
// @Then("User verifies headlines of page like About us and Background")
public void user_verifies_headlines_of_page_like_About_us_and_Background(io.cucumber.datatable.DataTable dataTable) throws InterruptedException {
Thread.sleep(4000);
List<String> actualTopMenus=Utility.webElementToStringList(about.aboutHeadlines) ;
List<String> expectedTopMenus1=dataTable.asList();
List<String> expectedTopMenus=new ArrayList<String>();
for (String string : expectedTopMenus1) {
expectedTopMenus.add(string);
}
Collections.sort(actualTopMenus);
Collections.sort(expectedTopMenus);
System.out.println(actualTopMenus);
System.out.println(expectedTopMenus);
assertTrue(actualTopMenus.equals(expectedTopMenus));
}
// @Then("User check article of About and Background")
public void user_check_article_of_About_and_Background(io.cucumber.datatable.DataTable dataTable) throws InterruptedException {
Thread.sleep(4000);
List<String> actualTopMenus=Utility.webElementToStringList(about.aboutArticles) ;
List<String> expectedTopMenus1=dataTable.asList();
List<String> expectedTopMenus=new ArrayList<String>();
for (String string : expectedTopMenus1) {
expectedTopMenus.add(string);
}
Collections.sort(actualTopMenus);
Collections.sort(expectedTopMenus);
System.out.println(actualTopMenus);
System.out.println(expectedTopMenus);
assertTrue(actualTopMenus.equals(expectedTopMenus));
}
@Given("User verifies footer section")
public void user_verifies_footer_section(io.cucumber.datatable.DataTable dataTable) throws InterruptedException {
Thread.sleep(4000);
List<String> actualTopMenus=Utility.webElementToStringList(about.footerSections) ;
List<String> expectedTopMenus1=dataTable.asList();
List<String> expectedTopMenus=new ArrayList<String>();
for (String string : expectedTopMenus1) {
expectedTopMenus.add(string);
}
Collections.sort(actualTopMenus);
Collections.sort(expectedTopMenus);
System.out.println(actualTopMenus);
System.out.println(expectedTopMenus);
assertTrue(actualTopMenus.equals(expectedTopMenus));
}
}
|
[
"cavidn82@gmail.com"
] |
cavidn82@gmail.com
|
71940c3fbf1b9928e40f66fae8a6d930c1368a52
|
b701a2f316441d59906d4341b8c7c235d2a62f3e
|
/src/main/java/org/apache/xmlbeans/impl/values/XmlLanguageImpl.java
|
e2c500886bba7c12d8a93ae64af797f8e61ad704
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.0-or-later",
"LGPL-3.0-only",
"LGPL-2.1-or-later",
"MPL-1.1",
"MPL-2.0",
"MIT"
] |
permissive
|
apache/xmlbeans
|
826547e0f386481cbfd4319a0dee537a98aa7cba
|
99d86814497f29a5ae7aa8e85d4db04a23eaae06
|
refs/heads/trunk
| 2023-08-22T08:16:22.853301
| 2023-08-18T09:55:35
| 2023-08-18T09:55:35
| 270,479
| 39
| 58
|
Apache-2.0
| 2023-05-26T18:52:27
| 2009-08-06T08:06:50
|
Java
|
UTF-8
|
Java
| false
| false
| 1,004
|
java
|
/* Copyright 2004 The Apache Software Foundation
*
* 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.apache.xmlbeans.impl.values;
import org.apache.xmlbeans.XmlLanguage;
import org.apache.xmlbeans.SchemaType;
public class XmlLanguageImpl extends JavaStringHolderEx implements XmlLanguage
{
public XmlLanguageImpl()
{ super(XmlLanguage.type, false); }
public XmlLanguageImpl(SchemaType type, boolean complex)
{ super(type, complex); }
}
|
[
"ericvas@apache.org"
] |
ericvas@apache.org
|
d7fe3ba6e6b426e1a09e2566f107376aed815ceb
|
eb39f5c1fadc317b9bf0cc0cbaeeba04f41c9757
|
/src/main/java/com/hack/dao/GroupDao.java
|
64b81dbebc75a4a23a56c22c1c48ab32b88b89a9
|
[] |
no_license
|
Moonergfp/hackthon
|
17dbd62bc9e4af7243899c36dd1284272dfac598
|
e956db60b0d8a40277f26b2859b16706d78ccb2c
|
refs/heads/master
| 2021-01-12T08:24:00.209674
| 2017-08-31T02:55:05
| 2017-08-31T02:55:05
| 76,563,974
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,789
|
java
|
package com.hack.dao;
import com.hack.cons.TableCons;
import com.hack.domain.GroupDb;
import com.hack.domain.UserDb;
import com.hack.vo.GroupMem;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.jdbc.core.SqlProvider;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.*;
import java.util.List;
import java.util.Map;
import static org.apache.ibatis.jdbc.SelectBuilder.*;
public interface GroupDao {
String INSERT_FILEDS = "group_name,remark,des,group_pic";
String SELECT_FIELDS = "id," + INSERT_FILEDS;
String INSERT_VALUES = "#{groupName},#{remark},#{des},#{groupPic}";
@Insert("insert into " + TableCons.GROUP_TABLE + "(" + INSERT_FILEDS + ") values (" + INSERT_VALUES + ")")
@Options(useGeneratedKeys = true)
int insert(GroupDb groupDb);
@Select("select " + SELECT_FIELDS + " from " + TableCons.GROUP_TABLE + " where id=#{id}")
GroupDb getById(int id);
@SelectProvider(type = SqlProvider.class, method = "getByIds")
List<GroupDb> getByIds(@Param("groupIdList") List<Integer> groupIdList);
// @SelectProvider(type = SqlProvider.class, method = "getUserGroupAndMems")
// List<GroupMem> getUserGroupAndMems(int userId);
class SqlProvider {
public String getByIds(Map<String,Object> param) {
List<Integer> ids = ( List<Integer>) param.get("groupIdList");
BEGIN();
SELECT(SELECT_FIELDS);
FROM(TableCons.GROUP_TABLE);
WHERE("id in ("+ StringUtils.join(ids,",")+")");
return SQL();
}
}
}
|
[
"476090843@qq.com"
] |
476090843@qq.com
|
4a3f21877803b36f8a7dda2039d38428d0c26c8e
|
bbfcba3e764e86784239a616949735d3cf681fd2
|
/src/model/Time.java
|
2a6eee9a9d339ea6904704d00ed45cfe7b878b5b
|
[
"MIT"
] |
permissive
|
MaelChemeque/pizza-rescue
|
45b8ffa5dc5d8c36e1f7289dde0edeb3e7ebde2f
|
0a765a74ec3806d2c6b0dfea2b8a560d2382bace
|
refs/heads/main
| 2023-02-16T14:42:59.428188
| 2021-01-06T03:04:45
| 2021-01-06T03:04:45
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,304
|
java
|
package model;
import java.io.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class Time {
static String currentTime;
static String lastTime;
static {
lastTime = "2000/10/10 10/10/10";
}
public static void calcNow() {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
currentTime = dtf.format(now);
}
public static int calcAddableLife() {
// if (lastTime.equals("2000/10/10 10/10/10")) {
String tmp = deserializeLastTime();
if (tmp != null)
lastTime = tmp;
// }
// System.out.println(lastTime);
calcNow();
for (int i = 0; i < 13; i++) {
if (currentTime.charAt(i) > lastTime.charAt(i))
return 5;
}
int lastTimeMinutes = Integer.parseInt(lastTime.substring(14, 16));
int currentTimeMinutes = Integer.parseInt(currentTime.substring(14, 16));
int lastTimeSeconds = Integer.parseInt(lastTime.substring(17));
int currentTimeSeconds = Integer.parseInt(currentTime.substring(17));
if (currentTimeSeconds < lastTimeSeconds) {
currentTimeSeconds += 60;
currentTimeMinutes--;
}
int distance = (currentTimeMinutes - lastTimeMinutes) * 60 + currentTimeSeconds - lastTimeSeconds;
return Math.min(5, distance / 30);
// return 0;
}
public static void serializeTime() {
File directory = new File("../user");
// System.out.println(currentTime);
if (!directory.exists()) {
directory.mkdir();
// System.out.println("user directory created");
}
calcNow();
try (FileOutputStream fos = new FileOutputStream("../user/last_time_played");
ObjectOutputStream oos = new ObjectOutputStream(fos)) {
oos.writeObject(currentTime);
// System.out.println("The file user/last_time_played has been serialized in
// user directory");
} catch (IOException e) {
e.printStackTrace();
}
}
private static void init() {
lastTime = "2000/10/10 10/10/10";
}
public static String deserializeLastTime() {
String path = "../user/last_time_played";
File file = new File(path);
if (file.length() == 0) {
return null;
}
String lastTime = null;
try (FileInputStream fis = new FileInputStream(path); ObjectInputStream ois = new ObjectInputStream(fis)) {
// if(fis.available())
lastTime = (String) ois.readObject();
// System.out.println("user's last time played has been deserialized");
} catch (FileNotFoundException e) {
System.err.println("The file : " + path + " cannot be found.");
e.printStackTrace();
} catch (IOException e) {
System.err.println("The file : " + path + " cannot be read.");
e.printStackTrace();
} catch (ClassNotFoundException e) {
System.err.println("The object class you have tried to deserialize doesn't exist");
e.printStackTrace();
}
return lastTime;
}
}
|
[
"f.taghayor@gmail.com"
] |
f.taghayor@gmail.com
|
655e737a7e8c3a38f713d482c1f86baff785761c
|
ccaf260884a5b378a4b4178a5489d18f022eaac0
|
/Group15_AI3/src/CombinedModel.java
|
971fce69dc09cf67fa612d3ff9f848c5edb73697
|
[] |
no_license
|
mmolignano/ai3
|
ac650a27434eeb74c5988217091dac458e72485a
|
0a2e9789ad268e06b7ceb0c627504d3e308e643d
|
refs/heads/master
| 2021-01-20T15:49:22.643334
| 2010-02-22T22:51:48
| 2010-02-22T22:51:48
| 33,311,395
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,127
|
java
|
/**
* Class keeps track of a unigram, bigram, and trigram model. When predicting
* it takes a look at all three, if unigram and bigram match, it uses that,
* otherwise it uses trigram.
*
* @author Michael Molignano, Chris Pardy, Rich Pavis, John Sandbrook
*
*/
public class CombinedModel implements Model {
private UnigramModel um;
private BigramModel bm;
private TrigramModel tm;
public CombinedModel(){
this.um = new UnigramModel();
this.bm = new BigramModel();
this.tm = new TrigramModel();
}
@Override
public String predict(String previousChars, boolean peek) {
String up = this.um.predict(previousChars, peek);
String bp = this.bm.predict(previousChars, peek);
String tp = this.tm.predict(previousChars, peek);
// Return tp unless up and bp are the same
if (up.equals(bp)) {
return up;
}
return tp;
}
@Override
public void train(String trainFile) {
this.um.train(trainFile);
this.bm.train(trainFile);
this.tm.train(trainFile);
}
@Override
public void peek(String testFile) {
this.um.peek(testFile);
this.bm.peek(testFile);
this.tm.peek(testFile);
}
}
|
[
"Emuking@c842427a-1736-11df-914e-2594af177612"
] |
Emuking@c842427a-1736-11df-914e-2594af177612
|
946d2fc763df2300c641da0d40ab2f2135aaaafd
|
ea34626c69071ee4a158650d97bd0be7c1199d42
|
/src/jmetal/problems/LIRCMOP/LIRCMOP7.java
|
ded0b86266b0fc4668ac5ec427edbac851c307f3
|
[] |
no_license
|
gzhuxiangyi/ToM
|
6bf2efc22458239ac821e1c97e18a3d2d6162047
|
2b942fd66c5dd22cb46de37589c5c3aa949eab85
|
refs/heads/main
| 2023-03-18T12:34:52.300404
| 2021-03-11T01:45:33
| 2021-03-11T01:45:33
| 346,389,711
| 4
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,104
|
java
|
// LIRCMOP7.java
//
// Author:
// wenji li Email: wenji_li@126.com
package jmetal.problems.LIRCMOP;
import jmetal.core.Problem;
import jmetal.core.Solution;
import jmetal.core.Variable;
import jmetal.encodings.solutionType.BinaryRealSolutionType;
import jmetal.encodings.solutionType.RealSolutionType;
import jmetal.util.JMException;
/**
* Class representing problem LIRCMOP7
*/
public class LIRCMOP7 extends Problem {
/**
* Creates an LIRCMOP7 problem (30 variables and 2 objectives)
*
* @param solutionType
* The solution type must "Real" or "BinaryReal".
*/
public LIRCMOP7(String solutionType) throws ClassNotFoundException {
this(solutionType, 30, 2);
} // LIRCMOP7
/**
* Creates an LIRCMOP7 problem instance
*
* @param numberOfVariables
* Number of variables
* @param numberOfObjectives
* Number of objective functions
* @param solutionType
* The solution type must "Real" or "BinaryReal".
*/
public LIRCMOP7(String solutionType, Integer numberOfVariables,
Integer numberOfObjectives) throws ClassNotFoundException {
numberOfVariables_ = numberOfVariables.intValue();
numberOfObjectives_ = numberOfObjectives.intValue();
numberOfConstraints_ = 3;
problemName_ = "LIRCMOP7";
lowerLimit_ = new double[numberOfVariables_];
upperLimit_ = new double[numberOfVariables_];
for (int var = 0; var < numberOfVariables; var++) {
lowerLimit_[var] = 0.0;
upperLimit_[var] = 1.0;
} // for
if (solutionType.compareTo("BinaryReal") == 0)
solutionType_ = new BinaryRealSolutionType(this);
else if (solutionType.compareTo("Real") == 0)
solutionType_ = new RealSolutionType(this);
else {
System.out.println("Error: solution type " + solutionType
+ " invalid");
System.exit(-1);
}
}
/**
* Evaluates a solution
*
* @param solution
* The solution to evaluate
* @throws JMException
*/
public void evaluate(Solution solution) throws JMException {
double sum1, sum2, yj;
int j;
sum1 = sum2 = 0.0;
int nx = numberOfVariables_;
double[] x = new double[numberOfVariables_];
double[] f = new double[numberOfObjectives_];
Variable[] gen = solution.getDecisionVariables();
for (int i = 0; i < numberOfVariables_; i++)
x[i] = gen[i].getValue();
for (j = 2; j <= nx; j++) {
if (j % 2 == 1) {
yj = x[j-1] - Math.sin(0.5 * j / nx * Math.PI * x[0]);
sum1 += yj * yj;
} else {
yj = x[j-1] - Math.cos(0.5 * j / nx * Math.PI * x[0]);
sum2 += yj * yj;
}
}
//double gx = 2.0 - Math.exp(- Math.pow((x[1] - 0.2) / 0.004,2)) - 0.8 * Math.exp(- Math.pow((x[1] - 0.6) / 0.4,2));
double gx = 0.7057;
f[0] = x[0] + 10 * sum1 + gx ;
f[1] = 1.0 - Math.sqrt(x[0]) + 10 * sum2 + gx;
for (int i = 0; i < numberOfObjectives_; i++)
solution.setObjective(i, f[i]);
} // evaluate
/**
* Evaluates the constraint overhead of a solution
*
* @param solution
* The solution
* @throws JMException
*/
public void evaluateConstraints(Solution solution) throws JMException {
double r = 0.1, theta = -0.25 * Math.PI;
double[] a_array = new double[]{2.0,2.5,2.5};
double[] b_array = new double[]{6.0,12.0,10.0};
double[] xOffset = new double[]{1.2,2.25,3.5};
double[] yOffset = new double[]{1.2,2.25,3.5};
double f1 = solution.getObjective(0);
double f2 = solution.getObjective(1);
double[] constraint = new double[numberOfConstraints_];
for(int i = 0; i < xOffset.length; i++){
constraint[i] = Math.pow(((f1 - xOffset[i]) * Math.cos(theta) - (f2 - yOffset[i]) * Math.sin(theta))/a_array[i] ,2)
+ Math.pow(((f1 - xOffset[i]) * Math.sin(theta) + (f2 - yOffset[i]) * Math.cos(theta))/b_array[i],2)
- r;
}
double total = 0.0;
int number = 0;
for(int i = 0 ; i < numberOfConstraints_; i++){
if (constraint[i] < 0.0){
total+=constraint[i] ;
number++;
solution.setConstraint(i,constraint[i]);
}
}
solution.setOverallConstraintViolation(total);
solution.setNumberOfViolatedConstraint(number);
} // evaluateConstraints
}
|
[
"gzhuxiang_yi@163.com"
] |
gzhuxiang_yi@163.com
|
f5808a6deabee5fe7adbad6943581d2f44443484
|
32b9d8cc999aa1e2c7b4075ed32727e772a3ae1c
|
/morning-product/morning-product-service/src/main/java/org/pussinboots/morning/product/service/impl/RecommendServiceImpl.java
|
f728147a6d794af214c63c3ce86fc2a839ceb8b6
|
[] |
no_license
|
HinsYang/Morning
|
33b6706901fd92bd891d260403ff551dfa68fbae
|
cd115ac3a2b0bfcadd7305abf2b520d0e7290f33
|
refs/heads/master
| 2021-05-11T23:59:28.069375
| 2019-02-19T17:53:05
| 2019-02-19T17:53:05
| 171,512,823
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 725
|
java
|
package org.pussinboots.morning.product.service.impl;
import org.pussinboots.morning.product.entity.Recommend;
import org.pussinboots.morning.product.mapper.RecommendMapper;
import org.pussinboots.morning.product.service.IRecommendService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
*
* 项目名称:morning-product-service
* 类名称:RecommendServiceImpl
* 类描述:Recommend / 推荐位表 业务逻辑层接口实现
* 创建人:yeungchihang
* 创建时间:2017年4月11日 下午3:17:47
*
*/
@Service
public class RecommendServiceImpl extends ServiceImpl<RecommendMapper, Recommend> implements IRecommendService {
}
|
[
"Hins@yangzhiheng.hnisi.com.cn"
] |
Hins@yangzhiheng.hnisi.com.cn
|
20bdf77b91d35a7435e2a9df684add6fad5911f4
|
ebe222e23b4022e29c95ea5823ff7b646ef51d5a
|
/zxingScan/src/main/java/com/runtai/zxinglib/zxing/decode/DecodeFormatManager.java
|
d2a3f144712a192bd6504eb2cb8d10a4a5af764c
|
[] |
no_license
|
hailinliu/Dexintong
|
902a0875bc6060b9031235e7af1d2cff2c062930
|
abacf20126b79d0f42a67c626634a2c73b97fbf3
|
refs/heads/master
| 2021-05-15T04:18:45.814739
| 2018-02-04T14:53:35
| 2018-02-04T14:53:35
| 114,599,643
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,699
|
java
|
/*
* Copyright (C) 2010 ZXing 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 com.runtai.zxinglib.zxing.decode;
import com.google.zxing.BarcodeFormat;
import java.util.Collection;
import java.util.EnumSet;
import java.util.Set;
public class DecodeFormatManager {
// 1D解码
static final Set<BarcodeFormat> PRODUCT_FORMATS;
static final Set<BarcodeFormat> INDUSTRIAL_FORMATS;
static final Set<BarcodeFormat> ONE_D_FORMATS;
// 二维码解码
static final Set<BarcodeFormat> QR_CODE_FORMATS;
static {
PRODUCT_FORMATS = EnumSet.of(BarcodeFormat.UPC_A, BarcodeFormat.UPC_E, BarcodeFormat.EAN_13, BarcodeFormat.EAN_8, BarcodeFormat.RSS_14, BarcodeFormat.RSS_EXPANDED);
INDUSTRIAL_FORMATS = EnumSet.of(BarcodeFormat.CODE_39, BarcodeFormat.CODE_93, BarcodeFormat.CODE_128, BarcodeFormat.ITF, BarcodeFormat.CODABAR);
ONE_D_FORMATS = EnumSet.copyOf(PRODUCT_FORMATS);
ONE_D_FORMATS.addAll(INDUSTRIAL_FORMATS);
QR_CODE_FORMATS = EnumSet.of(BarcodeFormat.QR_CODE);
}
public static Collection<BarcodeFormat> getQrCodeFormats() {
return QR_CODE_FORMATS;
}
public static Collection<BarcodeFormat> getBarCodeFormats() {
return ONE_D_FORMATS;
}
}
|
[
"1135231523@qq.com"
] |
1135231523@qq.com
|
8fa561c3facb880c6ccce3f9875073fd5f358aeb
|
40e5c87ec4351dfbb6f9d13a44ce9df86b9e7dc4
|
/app/src/main/java/edu/miracosta/finalprojecttest/view_learn_more/PlantsListActivity.java
|
c094609564745f431a4c4b4afcbe7b4e7b2114db
|
[] |
no_license
|
jacobv25/Final_Project_Test
|
2571c538590c175ff9ae35070918095e708debe5
|
12999180febc97d5db41474258d17a3148cf8ddb
|
refs/heads/master
| 2020-05-17T04:48:29.984410
| 2019-05-14T22:07:35
| 2019-05-14T22:07:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,760
|
java
|
package edu.miracosta.finalprojecttest.view_learn_more;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ListView;
import java.io.IOException;
import java.util.List;
import edu.miracosta.finalprojecttest.R;
import edu.miracosta.finalprojecttest.model.JSONLoader;
import edu.miracosta.finalprojecttest.model.enviroment.Plant;
public class PlantsListActivity extends ListActivity {
//TODO: Create a custom list adapter.
//TODO: This one should be easier than the inventory list adapter.
//TODO: See Pet Protector for help.
private List<Plant> allPlants;
private ListView plantsListView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
allPlants = JSONLoader.loadJSONFromAssetPlant(this);
} catch (IOException e) {
Log.e("Final Project", "Error loading JSON" + e.getMessage());
}
plantsListView = findViewById(R.id.plantsListView);
setListAdapter(new PlantsListAdapter(this, R.layout.plant_list_item, allPlants));
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
Intent detailsIntent = new Intent(this, ActivityDetails.class);
// ListItems correspond to the List entries by position
Plant selectedPlant = allPlants.get(position);
detailsIntent.putExtra("Name", selectedPlant.getPlantName());
detailsIntent.putExtra("Description", selectedPlant.getPlantDetails());
detailsIntent.putExtra("ImageName", selectedPlant.getPlantImage());
startActivity(detailsIntent);
}
}
|
[
"32970534+jacobv25@users.noreply.github.com"
] |
32970534+jacobv25@users.noreply.github.com
|
bfb1dc2e85b12f250cec7bd6e4b5585f65074086
|
c86269a24ae3d97262af2a154a8cf859bcc5766d
|
/travel-ui/src/main/java/vchrisb/spring/TravelUiApplication.java
|
aeac76f62576997e1d1f5b9b3a8754db663c9029
|
[
"MIT"
] |
permissive
|
KumareshBabuNS/cf-scs-demo
|
4657e5c0a7b264a9bf617e3467cb6fcbf9693f2d
|
dad63f97790068077fd7a73c64d517959855ee6b
|
refs/heads/master
| 2021-01-01T17:34:34.214913
| 2017-07-21T21:13:28
| 2017-07-21T21:13:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 406
|
java
|
package vchrisb.spring;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
public class TravelUiApplication {
public static void main(String[] args) {
SpringApplication.run(TravelUiApplication.class, args);
}
}
|
[
"vchrisb@users.noreply.github.com"
] |
vchrisb@users.noreply.github.com
|
384a82eda079de9cbed3e83c36ff89955d56b059
|
28042a70f18edda4df9d14eb7335ca544564c923
|
/src/main/java/com/kazuki43zoo/jpetstore/ui/controller/OrderForm.java
|
c4091b789e86ca0d925b442fcd884617288e9022
|
[] |
no_license
|
jiangjj/mybatis-spring-boot-jpetstore
|
aadb8887bf09431189251f9b947f6e40347dee94
|
dcaa49ed4ce8a5a7972b2a2d6a8c8902e6259343
|
refs/heads/master
| 2021-01-18T22:37:35.314723
| 2017-04-02T13:05:26
| 2017-04-02T13:05:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,402
|
java
|
/**
* Copyright 2016 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 com.kazuki43zoo.jpetstore.ui.controller;
import com.kazuki43zoo.jpetstore.component.validation.NumericCharacters;
import com.kazuki43zoo.jpetstore.domain.Account;
import com.kazuki43zoo.jpetstore.domain.Order;
import lombok.Getter;
import lombok.Setter;
import com.kazuki43zoo.jpetstore.ui.Cart;
import org.springframework.beans.BeanUtils;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
* @author Kazuki Shimizu
*/
@Getter
@Setter
public class OrderForm implements Serializable {
private static final long serialVersionUID = 6321792448424424931L;
@NotNull
@Size(max = 40)
private String cardType;
@NotNull
@Size(max = 80)
@NumericCharacters
private String creditCard;
@NotNull
@Pattern(regexp = "^\\d{2}/\\d{4}$")
private String expiryDate;
@NotNull
@Size(max = 40)
private String billToFirstName;
@NotNull
@Size(max = 40)
private String billToLastName;
@Size(max = 40)
private String billAddress1;
@Size(max = 40)
private String billAddress2;
@Size(max = 40)
private String billCity;
@Size(max = 40)
private String billState;
@Size(max = 20)
@NumericCharacters
private String billZip;
@Size(max = 20)
private String billCountry;
private boolean shippingAddressRequired;
@NotNull
@Size(max = 40)
private String shipToFirstName;
@NotNull
@Size(max = 40)
private String shipToLastName;
@NotNull
@Size(max = 40)
private String shipAddress1;
@Size(max = 40)
private String shipAddress2;
@NotNull
@Size(max = 40)
private String shipCity;
@Size(max = 40)
private String shipState;
@NotNull
@Size(max = 20)
@NumericCharacters
private String shipZip;
@NotNull
@Size(max = 20)
private String shipCountry;
void initialize(Account account) {
this.billToFirstName = account.getFirstName();
this.billToLastName = account.getLastName();
this.billAddress1 = account.getAddress1();
this.billAddress2 = account.getAddress2();
this.billCity = account.getCity();
this.billState = account.getState();
this.billZip = account.getZip();
this.billCountry = account.getCountry();
this.shipToFirstName = account.getFirstName();
this.shipToLastName = account.getLastName();
this.shipAddress1 = account.getAddress1();
this.shipAddress2 = account.getAddress2();
this.shipCity = account.getCity();
this.shipState = account.getState();
this.shipZip = account.getZip();
this.shipCountry = account.getCountry();
}
Order toOrder(Cart cart) {
Order order = new Order();
BeanUtils.copyProperties(this, order);
order.setTotalPrice(cart.getSubTotal());
cart.getCartItems().forEach(x -> order.addLine(x.toOrderLine()));
return order;
}
}
|
[
"kazuki43zoo@gmail.com"
] |
kazuki43zoo@gmail.com
|
051ad196d8516f4c43d0d6e6c320f26cac4fca51
|
b07642404c4f50a8dd4dcf6d523604777d64c8c8
|
/2020-04-30/chap13/sec01/exam09/MapExample.java
|
4def72c79278a671d95d68947dfd98cb298fc57f
|
[] |
no_license
|
khh2hoya/JAVAStudy
|
99ed61e1ae49084cdb1bd2da9a835115d98a1eb0
|
990f531bd9213b72d8d9af830fdc49e4d23cf917
|
refs/heads/master
| 2021-05-23T16:47:57.592426
| 2020-06-08T07:20:06
| 2020-06-08T07:20:06
| 253,387,208
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 896
|
java
|
package sec01.exam09;
import java.util.*;
public class MapExample {
public static void main(String[] args) {
// TODO Auto-generated method stub
Map<String,Integer> map = new HashMap<String,Integer>();
map.put("blue",96);
map.put("hong",99);
map.put("white",92);
map.put("khh",42);
String name = null;
int maxScore = 0;
int totalScore = 0;
Set<Map.Entry<String, Integer>> entrySet = map.entrySet();
Iterator<Map.Entry<String,Integer>> entryIterator = entrySet.iterator();
while(entryIterator.hasNext()) {
Map.Entry<String,Integer> entry = entryIterator.next();
int value = entry.getValue();
totalScore += value;
if( value > maxScore ) {
maxScore = value;
name = entry.getKey();
}
}
System.out.println("이름:" + name);
System.out.println("최고정수:" + maxScore);
System.out.println("총점:" + totalScore);
}
}
|
[
"khh2hoya@gmail.com"
] |
khh2hoya@gmail.com
|
7b828c1afb5a7bcf3750290a1cbee284b00ce25e
|
80dbe293f549c773d3e227e90c01833213b99ab5
|
/chapter7_8/KiloConverterWindowPhase2/KilometerConverterDemo.java
|
af3c29073854b8de665048f1f7e76e8354f01c84
|
[] |
no_license
|
htankhai/Org.StartingoutwithJava
|
9174cf162481c7edb628a62602e7ceba8ee48a10
|
215c96f55e92829d0b29119b739a56ebec653055
|
refs/heads/master
| 2020-04-15T00:45:45.784385
| 2015-06-20T22:08:59
| 2015-06-20T22:08:59
| 37,787,735
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 362
|
java
|
package KiloConverterWindowPhase2;
import KiloConverterWindowPhase2.KiloConverterWindow;
/**
This program creates an instance of the
KiloConverterWindow class, which displays
a window on the screen.
*/
public class KilometerConverterDemo{
public static void main(String[] args)
{
KiloConverterWindow kc = new KiloConverterWindow();
}
}
|
[
"htan.khai@yahoo.com"
] |
htan.khai@yahoo.com
|
702c98e76c0441e3fc12522c951aed8400431396
|
d8759216411241a72c669012661b092deb0b0ffc
|
/sources/gnu/expr/Language.java
|
d7650e057b997e3481ac2440549b92786f0843e4
|
[] |
no_license
|
indraja95/SmartParkingSystem
|
eba63c2d6d8f36860edbd4d1f09f37749d2302df
|
dc5c868a1d74794108a16d69cea606845f96080d
|
refs/heads/master
| 2023-04-01T18:58:15.337029
| 2021-04-02T22:48:53
| 2021-04-02T22:48:53
| 313,754,222
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 25,585
|
java
|
package gnu.expr;
import gnu.bytecode.ArrayType;
import gnu.bytecode.ClassType;
import gnu.bytecode.CodeAttr;
import gnu.bytecode.PrimType;
import gnu.bytecode.Type;
import gnu.kawa.lispexpr.ClassNamespace;
import gnu.kawa.reflect.ClassMemberLocation;
import gnu.kawa.reflect.StaticFieldLocation;
import gnu.lists.AbstractFormat;
import gnu.lists.CharSeq;
import gnu.lists.Consumer;
import gnu.lists.Convert;
import gnu.lists.FString;
import gnu.lists.PrintConsumer;
import gnu.mapping.CallContext;
import gnu.mapping.CharArrayInPort;
import gnu.mapping.Environment;
import gnu.mapping.EnvironmentKey;
import gnu.mapping.InPort;
import gnu.mapping.Location;
import gnu.mapping.Named;
import gnu.mapping.NamedLocation;
import gnu.mapping.Namespace;
import gnu.mapping.OutPort;
import gnu.mapping.Procedure;
import gnu.mapping.SimpleSymbol;
import gnu.mapping.Symbol;
import gnu.mapping.Values;
import gnu.mapping.WrappedException;
import gnu.text.Lexer;
import gnu.text.SourceMessages;
import gnu.text.SyntaxException;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.Writer;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import kawa.repl;
import org.shaded.apache.http.HttpStatus;
public abstract class Language {
public static final int FUNCTION_NAMESPACE = 2;
public static final int NAMESPACE_PREFIX_NAMESPACE = 4;
public static final int PARSE_CURRENT_NAMES = 2;
public static final int PARSE_EXPLICIT = 64;
public static final int PARSE_FOR_APPLET = 16;
public static final int PARSE_FOR_EVAL = 3;
public static final int PARSE_FOR_SERVLET = 32;
public static final int PARSE_IMMEDIATE = 1;
public static final int PARSE_ONE_LINE = 4;
public static final int PARSE_PROLOG = 8;
public static final int VALUE_NAMESPACE = 1;
protected static final InheritableThreadLocal<Language> current = new InheritableThreadLocal<>();
static int envCounter;
protected static int env_counter = 0;
protected static Language global;
static String[][] languages = {new String[]{"scheme", ".scm", ".sc", "kawa.standard.Scheme"}, new String[]{"krl", ".krl", "gnu.kawa.brl.BRL"}, new String[]{"brl", ".brl", "gnu.kawa.brl.BRL"}, new String[]{"emacs", "elisp", "emacs-lisp", ".el", "gnu.jemacs.lang.ELisp"}, new String[]{"xquery", ".xquery", ".xq", ".xql", "gnu.xquery.lang.XQuery"}, new String[]{"q2", ".q2", "gnu.q2.lang.Q2"}, new String[]{"xslt", "xsl", ".xsl", "gnu.kawa.xslt.XSLT"}, new String[]{"commonlisp", "common-lisp", "clisp", "lisp", ".lisp", ".lsp", ".cl", "gnu.commonlisp.lang.CommonLisp"}};
public static boolean requirePedantic;
protected Environment environ;
protected Environment userEnv;
public abstract Lexer getLexer(InPort inPort, SourceMessages sourceMessages);
public abstract boolean parse(Compilation compilation, int i) throws IOException, SyntaxException;
static {
Environment.setGlobal(BuiltinEnvironment.getInstance());
}
public static Language getDefaultLanguage() {
Language lang = (Language) current.get();
return lang != null ? lang : global;
}
public static void setCurrentLanguage(Language language) {
current.set(language);
}
public static Language setSaveCurrent(Language language) {
Language save = (Language) current.get();
current.set(language);
return save;
}
public static void restoreCurrent(Language saved) {
current.set(saved);
}
public static String[][] getLanguages() {
return languages;
}
public static void registerLanguage(String[] langMapping) {
String[][] newLangs = new String[(languages.length + 1)][];
System.arraycopy(languages, 0, newLangs, 0, languages.length);
newLangs[newLangs.length - 1] = langMapping;
languages = newLangs;
}
public static Language detect(InputStream in) throws IOException {
if (!in.markSupported()) {
return null;
}
StringBuffer sbuf = new StringBuffer();
in.mark(200);
while (sbuf.length() < 200) {
int c = in.read();
if (c < 0 || c == 10 || c == 13) {
break;
}
sbuf.append((char) c);
}
in.reset();
return detect(sbuf.toString());
}
public static Language detect(InPort port) throws IOException {
StringBuffer sbuf = new StringBuffer();
port.mark(HttpStatus.SC_MULTIPLE_CHOICES);
port.readLine(sbuf, 'P');
port.reset();
return detect(sbuf.toString());
}
public static Language detect(String line) {
String str = line.trim();
int k = str.indexOf("kawa:");
if (k >= 0) {
int i = k + 5;
int j = i;
while (j < str.length() && Character.isJavaIdentifierPart(str.charAt(j))) {
j++;
}
if (j > i) {
Language lang = getInstance(str.substring(i, j));
if (lang != null) {
return lang;
}
}
}
if (str.indexOf("-*- scheme -*-") >= 0) {
return getInstance("scheme");
}
if (str.indexOf("-*- xquery -*-") >= 0) {
return getInstance("xquery");
}
if (str.indexOf("-*- emacs-lisp -*-") >= 0) {
return getInstance("elisp");
}
if (str.indexOf("-*- common-lisp -*-") >= 0 || str.indexOf("-*- lisp -*-") >= 0) {
return getInstance("common-lisp");
}
if ((str.charAt(0) == '(' && str.charAt(1) == ':') || (str.length() >= 7 && str.substring(0, 7).equals("xquery "))) {
return getInstance("xquery");
}
if (str.charAt(0) == ';' && str.charAt(1) == ';') {
return getInstance("scheme");
}
return null;
}
public static Language getInstanceFromFilenameExtension(String filename) {
int dot = filename.lastIndexOf(46);
if (dot > 0) {
Language lang = getInstance(filename.substring(dot));
if (lang != null) {
return lang;
}
}
return null;
}
public static Language getInstance(String name) {
int langCount = languages.length;
int i = 0;
while (i < langCount) {
String[] names = languages[i];
int nameCount = names.length - 1;
int j = nameCount;
do {
j--;
if (j >= 0) {
if (name != null) {
}
break;
}
i++;
} while (!names[j].equalsIgnoreCase(name));
try {
break;
return getInstance(names[0], Class.forName(names[nameCount]));
} catch (ClassNotFoundException e) {
}
}
return null;
}
protected Language() {
Convert.setInstance(KawaConvert.getInstance());
}
public static Language getInstance(String langName, Class langClass) {
Throwable th;
Method method;
try {
Class[] args = new Class[0];
try {
method = langClass.getDeclaredMethod("get" + (Character.toTitleCase(langName.charAt(0)) + langName.substring(1).toLowerCase()) + "Instance", args);
} catch (Exception e) {
method = langClass.getDeclaredMethod("getInstance", args);
}
return (Language) method.invoke(null, Values.noArgs);
} catch (Exception e2) {
String langName2 = langClass.getName();
if (e2 instanceof InvocationTargetException) {
th = ((InvocationTargetException) e2).getTargetException();
} else {
th = e2;
}
throw new WrappedException("getInstance for '" + langName2 + "' failed", th);
}
}
public boolean isTrue(Object value) {
return value != Boolean.FALSE;
}
public Object booleanObject(boolean b) {
return b ? Boolean.TRUE : Boolean.FALSE;
}
public Object noValue() {
return Values.empty;
}
public boolean hasSeparateFunctionNamespace() {
return false;
}
public final Environment getEnvironment() {
return this.userEnv != null ? this.userEnv : Environment.getCurrent();
}
public final Environment getNewEnvironment() {
StringBuilder append = new StringBuilder().append("environment-");
int i = envCounter + 1;
envCounter = i;
return Environment.make(append.append(i).toString(), this.environ);
}
public Environment getLangEnvironment() {
return this.environ;
}
public NamedLocation lookupBuiltin(Symbol name, Object property, int hash) {
if (this.environ == null) {
return null;
}
return this.environ.lookup(name, property, hash);
}
public void define(String sym, Object p) {
this.environ.define(getSymbol(sym), null, p);
}
/* access modifiers changed from: protected */
public void defAliasStFld(String name, String cname, String fname) {
StaticFieldLocation.define(this.environ, getSymbol(name), null, cname, fname);
}
/* access modifiers changed from: protected */
public void defProcStFld(String name, String cname, String fname) {
StaticFieldLocation.define(this.environ, getSymbol(name), hasSeparateFunctionNamespace() ? EnvironmentKey.FUNCTION : null, cname, fname).setProcedure();
}
/* access modifiers changed from: protected */
public void defProcStFld(String name, String cname) {
defProcStFld(name, cname, Compilation.mangleNameIfNeeded(name));
}
public final void defineFunction(Named proc) {
Object name = proc.getSymbol();
this.environ.define(name instanceof Symbol ? (Symbol) name : getSymbol(name.toString()), hasSeparateFunctionNamespace() ? EnvironmentKey.FUNCTION : null, proc);
}
public void defineFunction(String name, Object proc) {
this.environ.define(getSymbol(name), hasSeparateFunctionNamespace() ? EnvironmentKey.FUNCTION : null, proc);
}
public Object getEnvPropertyFor(Field fld, Object value) {
if (hasSeparateFunctionNamespace() && Compilation.typeProcedure.getReflectClass().isAssignableFrom(fld.getType())) {
return EnvironmentKey.FUNCTION;
}
return null;
}
public Object getEnvPropertyFor(Declaration decl) {
if (!hasSeparateFunctionNamespace() || !decl.isProcedureDecl()) {
return null;
}
return EnvironmentKey.FUNCTION;
}
public void loadClass(String name) throws ClassNotFoundException {
try {
try {
Object inst = Class.forName(name).newInstance();
ClassMemberLocation.defineAll(inst, this, Environment.getCurrent());
if (inst instanceof ModuleBody) {
((ModuleBody) inst).run();
}
} catch (Exception ex) {
throw new WrappedException("cannot load " + name, ex);
}
} catch (ClassNotFoundException ex2) {
throw ex2;
}
}
public Symbol getSymbol(String name) {
return this.environ.getSymbol(name);
}
public Object lookup(String name) {
return this.environ.get((Object) name);
}
public AbstractFormat getFormat(boolean readable) {
return null;
}
public Consumer getOutputConsumer(Writer out) {
OutPort oport = out instanceof OutPort ? (OutPort) out : new OutPort(out);
oport.objectFormat = getFormat(false);
return oport;
}
public String getName() {
String name = getClass().getName();
int dot = name.lastIndexOf(46);
if (dot >= 0) {
return name.substring(dot + 1);
}
return name;
}
public Compilation getCompilation(Lexer lexer, SourceMessages messages, NameLookup lexical) {
return new Compilation(this, messages, lexical);
}
public final Compilation parse(InPort port, SourceMessages messages, int options) throws IOException, SyntaxException {
return parse(getLexer(port, messages), options, (ModuleInfo) null);
}
public final Compilation parse(InPort port, SourceMessages messages, ModuleInfo info) throws IOException, SyntaxException {
return parse(getLexer(port, messages), 8, info);
}
public final Compilation parse(InPort port, SourceMessages messages, int options, ModuleInfo info) throws IOException, SyntaxException {
return parse(getLexer(port, messages), options, info);
}
public final Compilation parse(Lexer lexer, int options, ModuleInfo info) throws IOException, SyntaxException {
SourceMessages messages = lexer.getMessages();
NameLookup lexical = (options & 2) != 0 ? NameLookup.getInstance(getEnvironment(), this) : new NameLookup(this);
boolean immediate = (options & 1) != 0;
Compilation tr = getCompilation(lexer, messages, lexical);
if (requirePedantic) {
tr.pedantic = true;
}
if (!immediate) {
tr.mustCompile = true;
}
tr.immediate = immediate;
tr.langOptions = options;
if ((options & 64) != 0) {
tr.explicit = true;
}
if ((options & 8) != 0) {
tr.setState(1);
}
tr.pushNewModule(lexer);
if (info != null) {
info.setCompilation(tr);
}
if (!parse(tr, options)) {
return null;
}
if (tr.getState() != 1) {
return tr;
}
tr.setState(2);
return tr;
}
public void resolve(Compilation comp) {
}
public Type getTypeFor(Class clas) {
return Type.make(clas);
}
public final Type getLangTypeFor(Type type) {
if (!type.isExisting()) {
return type;
}
Class clas = type.getReflectClass();
if (clas != null) {
return getTypeFor(clas);
}
return type;
}
public String formatType(Type type) {
return type.getName();
}
public static Type string2Type(String name) {
if (name.endsWith("[]")) {
Type t = string2Type(name.substring(0, name.length() - 2));
if (t == null) {
return null;
}
return ArrayType.make(t);
} else if (Type.isValidJavaTypeName(name)) {
return Type.getType(name);
} else {
return null;
}
}
public Type getTypeFor(String name) {
return string2Type(name);
}
public final Type getTypeFor(Object spec, boolean lenient) {
if (spec instanceof Type) {
return (Type) spec;
}
if (spec instanceof Class) {
return getTypeFor((Class) spec);
}
if (lenient && ((spec instanceof FString) || (spec instanceof String) || (((spec instanceof Symbol) && ((Symbol) spec).hasEmptyNamespace()) || (spec instanceof CharSeq)))) {
return getTypeFor(spec.toString());
}
if (spec instanceof Namespace) {
String uri = ((Namespace) spec).getName();
if (uri != null && uri.startsWith("class:")) {
return getLangTypeFor(string2Type(uri.substring(6)));
}
}
return null;
}
public final Type asType(Object spec) {
Type type = getTypeFor(spec, true);
return type == null ? (Type) spec : type;
}
public final Type getTypeFor(Expression exp) {
return getTypeFor(exp, true);
}
public Type getTypeFor(Expression exp, boolean lenient) {
if (exp instanceof QuoteExp) {
Object value = ((QuoteExp) exp).getValue();
if (value instanceof Type) {
return (Type) value;
}
if (value instanceof Class) {
return Type.make((Class) value);
}
return getTypeFor(value, lenient);
} else if (exp instanceof ReferenceExp) {
ReferenceExp rexp = (ReferenceExp) exp;
Declaration decl = Declaration.followAliases(rexp.getBinding());
String name = rexp.getName();
if (decl != null) {
Expression exp2 = decl.getValue();
if ((exp2 instanceof QuoteExp) && decl.getFlag(16384) && !decl.isIndirectBinding()) {
return getTypeFor(((QuoteExp) exp2).getValue(), lenient);
}
if ((exp2 instanceof ClassExp) || (exp2 instanceof ModuleExp)) {
decl.setCanRead(true);
return ((LambdaExp) exp2).getClassType();
} else if (decl.isAlias() && (exp2 instanceof QuoteExp)) {
Object val = ((QuoteExp) exp2).getValue();
if (val instanceof Location) {
Location loc = (Location) val;
if (loc.isBound()) {
return getTypeFor(loc.get(), lenient);
}
if (!(loc instanceof Named)) {
return null;
}
name = ((Named) loc).getName();
}
} else if (!decl.getFlag(65536)) {
return getTypeFor(exp2, lenient);
}
}
Object val2 = getEnvironment().get((Object) name);
if (val2 instanceof Type) {
return (Type) val2;
}
if (val2 instanceof ClassNamespace) {
return ((ClassNamespace) val2).getClassType();
}
int len = name.length();
if (len > 2 && name.charAt(0) == '<' && name.charAt(len - 1) == '>') {
return getTypeFor(name.substring(1, len - 1));
}
return null;
} else if ((exp instanceof ClassExp) || (exp instanceof ModuleExp)) {
return ((LambdaExp) exp).getClassType();
} else {
return null;
}
}
public static Type unionType(Type t1, Type t2) {
if (t1 == Type.toStringType) {
t1 = Type.javalangStringType;
}
if (t2 == Type.toStringType) {
t2 = Type.javalangStringType;
}
if (t1 == t2) {
return t1;
}
if (!(t1 instanceof PrimType) || !(t2 instanceof PrimType)) {
return Type.objectType;
}
char sig1 = t1.getSignature().charAt(0);
char sig2 = t2.getSignature().charAt(0);
if (sig1 == sig2) {
return t1;
}
if ((sig1 == 'B' || sig1 == 'S' || sig1 == 'I') && (sig2 == 'I' || sig2 == 'J')) {
return t2;
}
if ((sig2 == 'B' || sig2 == 'S' || sig2 == 'I') && (sig1 == 'I' || sig1 == 'J')) {
return t1;
}
if (sig1 == 'F' && sig2 == 'D') {
return t2;
}
if (sig2 == 'F' && sig1 == 'D') {
return t1;
}
return Type.objectType;
}
public Declaration declFromField(ModuleExp mod, Object fvalue, gnu.bytecode.Field fld) {
Object obj;
Object make;
String fname = fld.getName();
Type ftype = fld.getType();
boolean isAlias = ftype.isSubtype(Compilation.typeLocation);
boolean externalAccess = false;
boolean isFinal = (fld.getModifiers() & 16) != 0;
boolean isImportedInstance = fname.endsWith("$instance");
if (isImportedInstance) {
make = fname;
} else if (!isFinal || !(fvalue instanceof Named)) {
if (fname.startsWith(Declaration.PRIVATE_PREFIX)) {
externalAccess = true;
fname = fname.substring(Declaration.PRIVATE_PREFIX.length());
}
make = Compilation.demangleName(fname, true).intern();
} else {
make = ((Named) fvalue).getSymbol();
}
if (obj instanceof String) {
String uri = mod.getNamespaceUri();
String sname = (String) obj;
if (uri == null) {
obj = SimpleSymbol.valueOf(sname);
} else {
obj = Symbol.make(uri, sname);
}
}
Declaration fdecl = mod.addDeclaration(obj, isAlias ? Type.objectType : getTypeFor(ftype.getReflectClass()));
boolean isStatic = (fld.getModifiers() & 8) != 0;
if (isAlias) {
fdecl.setIndirectBinding(true);
if ((ftype instanceof ClassType) && ((ClassType) ftype).isSubclass("gnu.mapping.ThreadLocation")) {
fdecl.setFlag(268435456);
}
} else if (isFinal && (ftype instanceof ClassType)) {
if (ftype.isSubtype(Compilation.typeProcedure)) {
fdecl.setProcedureDecl(true);
} else if (((ClassType) ftype).isSubclass("gnu.mapping.Namespace")) {
fdecl.setFlag(2097152);
}
}
if (isStatic) {
fdecl.setFlag(2048);
}
fdecl.field = fld;
if (isFinal && !isAlias) {
fdecl.setFlag(16384);
}
if (isImportedInstance) {
fdecl.setFlag(1073741824);
}
fdecl.setSimple(false);
if (externalAccess) {
fdecl.setFlag(524320);
}
return fdecl;
}
public int getNamespaceOf(Declaration decl) {
return 1;
}
public boolean hasNamespace(Declaration decl, int namespace) {
return (getNamespaceOf(decl) & namespace) != 0;
}
public void emitPushBoolean(boolean value, CodeAttr code) {
code.emitGetStatic(value ? Compilation.trueConstant : Compilation.falseConstant);
}
public void emitCoerceToBoolean(CodeAttr code) {
emitPushBoolean(false, code);
code.emitIfNEq();
code.emitPushInt(1);
code.emitElse();
code.emitPushInt(0);
code.emitFi();
}
public Object coerceFromObject(Class clas, Object obj) {
return getTypeFor(clas).coerceFromObject(obj);
}
public Object coerceToObject(Class clas, Object obj) {
return getTypeFor(clas).coerceToObject(obj);
}
public static synchronized void setDefaults(Language lang) {
synchronized (Language.class) {
setCurrentLanguage(lang);
global = lang;
if (Environment.getGlobal() == BuiltinEnvironment.getInstance()) {
Environment.setGlobal(Environment.getCurrent());
}
}
}
public Procedure getPrompter() {
Object property = null;
if (hasSeparateFunctionNamespace()) {
property = EnvironmentKey.FUNCTION;
}
Procedure prompter = (Procedure) getEnvironment().get(getSymbol("default-prompter"), property, null);
return prompter != null ? prompter : new SimplePrompter();
}
public final Object eval(String string) throws Throwable {
return eval((InPort) new CharArrayInPort(string));
}
public final Object eval(Reader in) throws Throwable {
return eval(in instanceof InPort ? (InPort) in : new InPort(in));
}
public final Object eval(InPort port) throws Throwable {
CallContext ctx = CallContext.getInstance();
int oldIndex = ctx.startFromContext();
try {
eval(port, ctx);
return ctx.getFromContext(oldIndex);
} catch (Throwable ex) {
ctx.cleanupFromContext(oldIndex);
throw ex;
}
}
public final void eval(String string, Writer out) throws Throwable {
eval((Reader) new CharArrayInPort(string), out);
}
public final void eval(String string, PrintConsumer out) throws Throwable {
eval(string, getOutputConsumer(out));
}
public final void eval(String string, Consumer out) throws Throwable {
eval((Reader) new CharArrayInPort(string), out);
}
public final void eval(Reader in, Writer out) throws Throwable {
eval(in, getOutputConsumer(out));
}
public void eval(Reader in, Consumer out) throws Throwable {
InPort port = in instanceof InPort ? (InPort) in : new InPort(in);
CallContext ctx = CallContext.getInstance();
Consumer save = ctx.consumer;
try {
ctx.consumer = out;
eval(port, ctx);
} finally {
ctx.consumer = save;
}
}
/* JADX INFO: finally extract failed */
public void eval(InPort port, CallContext ctx) throws Throwable {
SourceMessages messages = new SourceMessages();
Language saveLang = setSaveCurrent(this);
try {
ModuleExp.evalModule(getEnvironment(), ctx, parse(port, messages, 3), null, null);
restoreCurrent(saveLang);
if (messages.seenErrors()) {
throw new RuntimeException("invalid syntax in eval form:\n" + messages.toString(20));
}
} catch (Throwable th) {
restoreCurrent(saveLang);
throw th;
}
}
public void runAsApplication(String[] args) {
setDefaults(this);
repl.main(args);
}
}
|
[
"indraja.nutalapati@gmail.com"
] |
indraja.nutalapati@gmail.com
|
b66fde54558a52b450117d52c1a1fcbeac902ace
|
593279007695e43b4c3b03eb7b6e74f791f15cca
|
/Server.java
|
3c84455cac0641327c637c05fe15b5f9ddcc52fe
|
[
"MIT"
] |
permissive
|
haniano/dandyhacks-2021
|
f4b238eec6e977e80e1d5aff8750145a01b71742
|
23c2dbff51d397058cf6320b3d6caba27ca4ad15
|
refs/heads/master
| 2023-09-01T12:54:15.605352
| 2021-11-03T18:58:59
| 2021-11-03T18:58:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,588
|
java
|
import java.net.*;
import java.io.*;
public class Server extends Player{
private InetAddress ip;
private ServerSocket server;
public Server(String name) {
super(name, false);
try {
this.ip = InetAddress.getLocalHost();
this.server = new ServerSocket(0, 1, ip);
System.out.printf("You have created a server at %s on port %d\n", ip.getHostAddress(), server.getLocalPort());
System.out.println("Waiting for connection...");
this.socket = server.accept();
updatePlayerDataStreams(); //this must be called here so that in and out are correctly initialized
String oppName = in.readUTF();
System.out.println(oppName + " connected from " + this.socket.getInetAddress() + ":" + this.socket.getPort());
out.writeUTF(name);
} catch (IOException e) {
e.printStackTrace();
}
while (!isOver) {
if(myTurn) {
sendMove();
game.board.printBothBoards(game.oppBoard);
}else {
receiveMove();
game.board.printBothBoards(game.oppBoard);
}
}
if (this.winner) {
System.out.println("Congrats! You Win!");
} else {
System.out.println(this.oppName + " Wins. Better luck next time");
}
try {
server.close();
} catch (IOException e) {
e.printStackTrace();
}
closeConnection();
}
}
|
[
"ianclingerman@gmail.com"
] |
ianclingerman@gmail.com
|
87be30c1681af38435b33810eac04113d364454b
|
47b38aab1bfab49ae78242c9e4db547abd9eb333
|
/src/main/java/com/gamification/domain/BadgeCard.java
|
de903d10e137405981341297d5e81e9428cb6490
|
[] |
no_license
|
sbsromero/Microservicios-MultiplicationProject
|
46798cbbb578186d3d61770b7b5b477853640351
|
92ca1c73f18bdcfc11a16eae34fe6ff4dcfe173f
|
refs/heads/master
| 2020-05-30T10:44:54.188804
| 2019-06-01T02:08:28
| 2019-06-01T02:08:28
| 189,679,810
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 724
|
java
|
package com.gamification.domain;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
@RequiredArgsConstructor
@ToString
@EqualsAndHashCode
@Getter
@Entity
public class BadgeCard {
@Id
@GeneratedValue
@Column(name = "BADGE_ID")
private final Long badgeId;
private final Long userId;
private final long badgeTimestap;
private final Badge badge;
public BadgeCard() {
this(null, null, 0, null);
}
public BadgeCard(Long userId, Badge badge) {
this(null, userId, System.currentTimeMillis(), badge);
}
}
|
[
"sromero@sumset.com"
] |
sromero@sumset.com
|
9107182a85f107aa11f1ac0509b515855663e075
|
d241d1cb2391a9e685732a18ccf50e44d0a47305
|
/backend/src/main/java/com/sidiq/fullstackjava/controller/StudentController.java
|
350b71d6bd4288eb15ccac4ce476434952caff6c
|
[] |
no_license
|
muhammadashshiddiqi/springreact_restapi
|
e22bbcb90fd401a3cf7d5102afb87fa56aaa14db
|
33359d1af571294aabdc46ed2f9d726561068be5
|
refs/heads/main
| 2023-09-03T23:28:09.613457
| 2021-11-01T02:10:46
| 2021-11-01T02:10:46
| 423,304,778
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 729
|
java
|
package com.sidiq.fullstackjava.controller;
import com.sidiq.fullstackjava.model.Student;
import com.sidiq.fullstackjava.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/student")
@CrossOrigin
public class StudentController {
@Autowired
private StudentService studentService;
@PostMapping("/add")
public String add(@RequestBody Student student){
studentService.saveStudent(student);
return "new student is added";
}
@GetMapping("/getAll")
public List<Student> getAllStudents(){
return studentService.getAllStudents();
}
}
|
[
"ashshiddiqi94@gmail.com"
] |
ashshiddiqi94@gmail.com
|
96ecc93b8e77cf8d7506a1b847167e36aa81a867
|
c36be0750ef91e4ffb1f7a70a2d4e83a11efc766
|
/app/src/main/java/com/example/qiangxu/qsbk/adapters/DetailAdapter.java
|
659e622a60dc806f0c2ce12b622a7becab6be4c0
|
[] |
no_license
|
xiaoqiangchongchongchong/QSBK
|
6aea1d97156a9faf48ffd1c0e83ba3465a6b00c8
|
3442ce026e494121d3a072c320b1820bb0f47c72
|
refs/heads/master
| 2021-01-10T01:18:52.602378
| 2016-01-03T15:36:19
| 2016-01-03T15:36:19
| 48,689,382
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,067
|
java
|
package com.example.qiangxu.qsbk.adapters;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.example.qiangxu.qsbk.domain.LeftMenuTitle;
import com.example.qiangxu.qsbk.fragments.BlankFragment;
import com.example.qiangxu.qsbk.fragments.DetailFragment;
import java.util.List;
/**
* Created by QiangXu on 2015/12/30.
*/
public class DetailAdapter extends FragmentPagerAdapter {
private List<LeftMenuTitle> list;
private long suggestId;
public DetailAdapter(FragmentManager fm, List<LeftMenuTitle> list, long suggestId ) {
super(fm);
this.list = list;
this.suggestId = suggestId;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Fragment getItem(int position) {
return DetailFragment.newInstance(list.get(position), suggestId);
}
@Override
public CharSequence getPageTitle(int position) {
return list.get(position).getTitle();
}
}
|
[
"xuqiangjiaohe@163.com"
] |
xuqiangjiaohe@163.com
|
8ec499cf167d30f8f790add437c62d5586dc9609
|
c01ce12554baa70ee1538abbc5dfa7b4dd1b1c0a
|
/app/src/main/java/com/example/StaggeredGridLayoutManager/CustomRecyclerviewAdapter.java
|
9dbda3f6c9d8c4ef3481096209aa8807ce72aedd
|
[] |
no_license
|
suvojitd79/StaggeredGridLayoutManager-
|
d69054f37569c0fd60a9bc40b51f36e5b203ae20
|
a30bc3f79c93f7b22f019cf4c0f00ed3ec83f1fe
|
refs/heads/master
| 2020-05-24T09:18:15.894821
| 2019-05-17T16:41:05
| 2019-05-17T16:41:05
| 187,202,956
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,053
|
java
|
package com.example.StaggeredGridLayoutManager;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import java.util.List;
class CustomRecyclerViewAdapter extends RecyclerView.Adapter<CustomRecyclerViewAdapter.CustomRecyclerViewHolder>{
private List<Data> imageModels = new ArrayList<>();
public void setImageModels(List<Data> imageModels){
Log.d("99",imageModels.size()+"");
this.imageModels = imageModels;
notifyDataSetChanged();
}
@NonNull
@Override
public CustomRecyclerViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.image_layout,viewGroup,false);
return new CustomRecyclerViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull CustomRecyclerViewHolder customRecyclerViewHolder, int i) {
customRecyclerViewHolder.setImageView(imageModels.get(i).getImageModel().getSmall());
customRecyclerViewHolder.setTextView(imageModels.get(i).getAlt_description());
}
@Override
public int getItemCount() {
return imageModels.size();
}
class CustomRecyclerViewHolder extends RecyclerView.ViewHolder{
ImageView imageView;
TextView textView;
public CustomRecyclerViewHolder(@NonNull View itemView) {
super(itemView);
imageView = itemView.findViewById(R.id.image);
textView = itemView.findViewById(R.id.textView);
}
public void setImageView(String uri) {
Picasso.get().load(uri)
.into(imageView);
}
public void setTextView(String text) {
this.textView.setText(text);
}
}
}
|
[
"suvojitd79@gmail.com"
] |
suvojitd79@gmail.com
|
2a02bb5540d1d46580174f1795ef4ec61363d4b0
|
a1a51aad102f9f82647bb4624940bf1fd0486def
|
/engines/dyn4j/src/org/dyn4j/collision/manifold/ManifoldSolver.java
|
0a90d8833cefc1c923e2e64f811d56481d140000
|
[] |
no_license
|
Madzi/featurea
|
337c187b19c69e82956a4b8d711eb40dbbf07f7a
|
4ee44d5910617c1233a77e0787d85717ee5347a0
|
refs/heads/master
| 2020-12-11T05:58:44.584623
| 2016-07-25T20:54:07
| 2016-07-25T20:54:07
| 64,206,389
| 0
| 1
| null | 2016-07-26T09:00:15
| 2016-07-26T09:00:15
| null |
UTF-8
|
Java
| false
| false
| 3,675
|
java
|
/*
* Copyright (c) 2010-2016 William Bittle http://www.dyn4j.org/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted
* provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions
* and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
* and the following disclaimer in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of dyn4j nor the names of its contributors may be used to endorse or
* promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.dyn4j.collision.manifold;
import org.dyn4j.collision.narrowphase.NarrowphaseDetector;
import org.dyn4j.collision.narrowphase.Penetration;
import org.dyn4j.geometry.Convex;
import org.dyn4j.geometry.Shape;
import org.dyn4j.geometry.Transform;
/**
* Finds a contact {@link Manifold} for two given {@link Convex} {@link Shape}s that are in collision.
* <p>
* A contact {@link Manifold} is a collection of contact points for a collision. For two dimensions, this will never
* be more than two contacts.
* <p>
* A {@link ManifoldSolver} relies on the {@link Penetration} object returned from a {@link NarrowphaseDetector} to
* determine the contact {@link Manifold}. The {@link Manifold}s have ids to facilitate caching of contact information.
* <p>
* It's possible that no contact points are returned, in which case the {@link #getManifold(Penetration, Convex, Transform, Convex, Transform, Manifold)}
* method will return false.
* @author William Bittle
* @version 3.2.0
* @since 1.0.0
* @see Manifold
*/
public interface ManifoldSolver {
/**
* Returns true if there exists a valid contact manifold between the two {@link Convex} {@link Shape}s.
* <p>
* When returning true, this method fills in the {@link Manifold} object with the points, depth, and normal.
* <p>
* The given {@link Manifold} object will be cleared using the {@link Manifold#clear()} method. This allows reuse of the
* {@link Manifold} if desired.
* <p>
* The {@link Penetration} object will be left unchanged by this method.
* @param penetration the {@link Penetration}
* @param convex1 the first {@link Convex} {@link Shape}
* @param transform1 the first {@link Shape}'s {@link Transform}
* @param convex2 the second {@link Convex} {@link Shape}
* @param transform2 the second {@link Shape}'s {@link Transform}
* @param manifold the {@link Manifold} object to fill
* @return boolean
*/
public abstract boolean getManifold(Penetration penetration, Convex convex1, Transform transform1, Convex convex2, Transform transform2, Manifold manifold);
}
|
[
"kolesnikovichdn@gmail.com"
] |
kolesnikovichdn@gmail.com
|
42639437b5d3d893fddee2493e23cd618a87eeba
|
07d7c849331b6535ee64ead7c89eaf48a7eacca7
|
/src/abstract$factory/demo2/Cpu.java
|
6fd128c7f7f52994d11f3f55382bf8fee3afb2bc
|
[] |
no_license
|
PhilosophyBuns/design-pattern
|
de5c0bd9ff1befa8bcf7de58d791b5c32323365c
|
c497f033139a4646466c2933d3b29183f794bbb7
|
refs/heads/master
| 2020-04-03T11:57:42.515620
| 2018-10-29T15:43:55
| 2018-10-29T15:43:55
| 155,236,900
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 86
|
java
|
package abstract$factory.demo2;
public interface Cpu {
public void calculate();
}
|
[
"841736714@qq.com"
] |
841736714@qq.com
|
70ab61b1c8ec4552e966f0c7c2674ad8d38aa6b6
|
22b1fe6a0af8ab3c662551185967bf2a6034a5d2
|
/experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/sub1/Class_0306.java
|
1d70dcf2116cd16a2718b2f2f47b4247744ff752
|
[
"Apache-2.0"
] |
permissive
|
lesaint/experimenting-annotation-processing
|
b64ed2182570007cb65e9b62bb2b1b3f69d168d6
|
1e9692ceb0d3d2cda709e06ccc13290262f51b39
|
refs/heads/master
| 2021-01-23T11:20:19.836331
| 2014-11-13T10:37:14
| 2014-11-13T10:37:14
| 26,336,984
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 151
|
java
|
package fr.javatronic.blog.massive.annotation1.sub1;
import fr.javatronic.blog.processor.Annotation_001;
@Annotation_001
public class Class_0306 {
}
|
[
"sebastien.lesaint@gmail.com"
] |
sebastien.lesaint@gmail.com
|
f7fbae17131dc30d701c34c2a791ac8745e21a89
|
7b00734dbc373b51cdf86e43126641c1d47c0256
|
/test12Thread/src/test/com/Test01ThreadEx.java
|
59d2f4f167293f00b91de27b4a4e354dd95cde2c
|
[] |
no_license
|
Ehyunnn/javaProject
|
72273bb1b10b9d6cf2921dc0510f372bdb87b94b
|
6dba501a449c3e7b53a3b5e3ae010e8fbc44ed54
|
refs/heads/master
| 2020-03-22T09:05:56.897929
| 2018-07-06T08:05:48
| 2018-07-06T08:05:48
| 139,814,309
| 0
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 314
|
java
|
package test.com;
public class Test01ThreadEx extends Thread {
@Override
public void run() {
for (int i = 10; i < 20; i++) {
System.out.println("run" + i);
try {
Thread.sleep(1000); // 1초간 잠깐 쉬엇다가 해라 ~
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
|
[
"ehyun_2@naver.com"
] |
ehyun_2@naver.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.