blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
a3f5f86129500bba0817bce6447433241605faa2
80047bd90713f8031a949683b7dbb62b56c4938c
/app/src/androidTest/java/com/example/kenny/shoppingcart/ApplicationTest.java
772f0181dade91d6c2d591d02c8cb4340743c001
[]
no_license
KennyDykes/ShoppingCart
e68514fb18f8a5995a49e214425f2d1831c1d151
5318c8666bb5b2a516c459395e06932b04534ae1
refs/heads/master
2021-01-19T13:52:51.990747
2018-06-13T15:07:08
2018-06-13T15:07:08
37,831,854
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
package com.example.kenny.shoppingcart; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "kdykes@fau.edu" ]
kdykes@fau.edu
8ab0a6a165581e91351e7899f3e1f88abd60e498
f2155dbd395486b9aec75805bbecc3abae32f094
/lessons1213/src/main/java/lt/lessons/baltictalents/model/Role.java
b58d412568462f0c09d0a646d298f90f48ac885b
[]
no_license
Gyti5/lessons
03b5b4809abeb2e4ae8ede399dde278f31dadac1
8896d0f44e04b1c3ecd2bf23103befe5d7f1ea41
refs/heads/master
2020-04-23T23:59:27.508607
2019-02-19T21:50:24
2019-02-19T21:50:24
171,551,716
0
0
null
null
null
null
UTF-8
Java
false
false
652
java
package lt.lessons.baltictalents.model; import com.fasterxml.jackson.annotation.JsonBackReference; import lombok.Getter; import lombok.Setter; import lombok.ToString; import javax.persistence.*; import java.io.Serializable; import java.util.Set; @Entity @Table(name = "roles") @ToString public class Role extends BaseEntity { @Column( name = "name", nullable = false ) @Getter @Setter private String name; @ManyToMany(mappedBy = "roles") @Getter @Setter @JsonBackReference private Set<User> users; public enum RoleName { ADMIN, EDITOR, USER, ANONYMOUS } }
[ "44171174+Gyti5@users.noreply.github.com" ]
44171174+Gyti5@users.noreply.github.com
523c032a2cbd8a04d00059233956da408e521ca6
20981a19e8a53dfdee394a5f9d2c62639ff7affb
/src/main/java/com/dkcy/jhipsterfirst/web/rest/errors/InternalServerErrorException.java
db9af52048793110e950b3e2ade527f6d989715d
[]
no_license
dkcy/jhipsterFirst
f38e09804e569abb29a2b779e6976ed0c891af5b
670fb6c46e1daec83a80afe0418ce00acb6b4727
refs/heads/master
2020-05-14T13:10:38.771411
2019-04-17T02:51:47
2019-04-17T02:51:47
181,806,925
0
0
null
null
null
null
UTF-8
Java
false
false
507
java
package com.dkcy.jhipsterfirst.web.rest.errors; import org.zalando.problem.AbstractThrowableProblem; import org.zalando.problem.Status; /** * Simple exception with a message, that returns an Internal Server Error code. */ public class InternalServerErrorException extends AbstractThrowableProblem { private static final long serialVersionUID = 1L; public InternalServerErrorException(String message) { super(ErrorConstants.DEFAULT_TYPE, message, Status.INTERNAL_SERVER_ERROR); } }
[ "dk@Daniels-MBP.home" ]
dk@Daniels-MBP.home
aeeb73aa22b1300ef99cb880b241b73c9783db8b
12c3646f642260b0b85b8a7e7e644a9e0fa0a417
/src/main/java/com/huabang/ofo/dao/HbUserCashsMapper.java
36f6ef1a9ea4c39e2908f09840a97f8eb1482a76
[]
no_license
caijunyang/qiqu
6e326119358afa53afa42e2ba77d2325d9ecb6af
b37142b72f02b284102fe8400d00ecc468362381
refs/heads/master
2020-04-09T06:30:34.995479
2019-01-15T03:40:16
2019-01-15T03:40:16
160,115,760
1
1
null
2018-12-05T06:41:40
2018-12-03T01:33:20
JavaScript
UTF-8
Java
false
false
1,043
java
package com.huabang.ofo.dao; import java.util.List; import org.apache.ibatis.annotations.Param; import com.huabang.ofo.domain.HbUserCash; import com.huabang.ofo.domain.HbUserCashExample; public interface HbUserCashsMapper { int countByExample(HbUserCashExample example); int deleteByExample(HbUserCashExample example); int deleteByPrimaryKey(String userId); int insert(HbUserCash record); int insertSelective(HbUserCash record); List<HbUserCash> selectByExample(HbUserCashExample example); HbUserCash selectByPrimaryKey(String userId); int updateByExampleSelective(@Param("record") HbUserCash record, @Param("example") HbUserCashExample example); int updateByExample(@Param("record") HbUserCash record, @Param("example") HbUserCashExample example); int updateByPrimaryKeySelective(HbUserCash record); int updateByPrimaryKey(HbUserCash record); HbUserCash selectByPrimaryKey2(String userId); void returnCash(@Param("outtradeno")String outtradeno); }
[ "yang.xx520@qq.com" ]
yang.xx520@qq.com
130957f8decc308d64c34cf6e26c99bb13b1f449
7f99b607eb664a69170568a9e37ceadec4c2ed9c
/src/net/encode/wurmesp/XrayColors.java
dfed83b9d236af9d8e429a737c5a7f3554eec9ae
[ "Unlicense" ]
permissive
LegionUA/WurmEsp
3cecfbd0af6c6e0fc00fca3f116b5faa2b455675
1ff398f10f06b6b50a6529a134715b79caced38b
refs/heads/master
2021-06-21T01:52:41.574391
2017-08-04T03:25:27
2017-08-04T03:25:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,829
java
package net.encode.wurmesp; import java.awt.Color; import java.util.HashMap; import java.util.Map; import com.wurmonline.mesh.Tiles; import com.wurmonline.mesh.Tiles.Tile; public class XrayColors { private static final Map<Tiles.Tile, Color> mappings = new HashMap<Tile, Color>(); static { addMapping(Tiles.Tile.TILE_CAVE_WALL, Color.DARK_GRAY); addMapping(Tiles.Tile.TILE_CAVE_WALL_REINFORCED, Color.DARK_GRAY); addMapping(Tiles.Tile.TILE_CAVE, Color.PINK); addMapping(Tiles.Tile.TILE_CAVE_FLOOR_REINFORCED, Color.PINK); addMapping(Tiles.Tile.TILE_CAVE_EXIT, Color.PINK); addMapping(Tiles.Tile.TILE_CAVE_WALL_ORE_IRON, Color.RED.darker()); addMapping(Tiles.Tile.TILE_CAVE_WALL_LAVA, Color.RED); addMapping(Tiles.Tile.TILE_CAVE_WALL_ORE_COPPER, Color.GREEN); addMapping(Tiles.Tile.TILE_CAVE_WALL_ORE_TIN, Color.GRAY); addMapping(Tiles.Tile.TILE_CAVE_WALL_ORE_GOLD, Color.YELLOW.darker()); addMapping(Tiles.Tile.TILE_CAVE_WALL_ORE_ADAMANTINE, Color.CYAN); addMapping(Tiles.Tile.TILE_CAVE_WALL_ORE_GLIMMERSTEEL, Color.YELLOW.brighter()); addMapping(Tiles.Tile.TILE_CAVE_WALL_ORE_SILVER, Color.LIGHT_GRAY); addMapping(Tiles.Tile.TILE_CAVE_WALL_ORE_LEAD, Color.PINK.darker().darker()); addMapping(Tiles.Tile.TILE_CAVE_WALL_ORE_ZINC, new Color(235, 235, 235)); addMapping(Tiles.Tile.TILE_CAVE_WALL_SLATE, Color.BLACK); addMapping(Tiles.Tile.TILE_CAVE_WALL_MARBLE, Color.WHITE); addMapping(Tiles.Tile.TILE_CAVE_WALL_SANDSTONE, Color.YELLOW.darker().darker()); addMapping(Tiles.Tile.TILE_CAVE_WALL_ROCKSALT, Color.WHITE.darker()); } private static void addMapping(Tiles.Tile tile, Color color) { mappings.put(tile, color); } public static Color getColorFor(Tiles.Tile tile) { return (Color)mappings.getOrDefault(tile, Color.PINK); } }
[ "encode@decode.net" ]
encode@decode.net
c8416516e20cdea9ead4925ef0e708050702cd13
b84a42b6c7c6cbfe82bfb3b59670890399cd7181
/spring-framework/src/main/java/com/lizza/spring_01_beanfactory/factory/BeanFactory.java
91b5ef361e4553bc03d31c51f3c6f9ee3c40eae8
[]
no_license
lizza-glory/learning
1572301aa488afd76a4d9c484f27db522f00913a
935a5abf861c3a772ce59b207eb0e6acf362dc71
refs/heads/master
2023-04-09T14:47:15.954665
2020-10-20T23:42:42
2020-10-20T23:42:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,244
java
package com.lizza.spring_01_beanfactory.factory; import java.io.InputStream; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Properties; /** * @Desc: * @author: lizza1643@gmail.com * @date: 2020-03-06 */ public class BeanFactory { private static Properties prop; private static Map<String, Object> beans; static { prop = new Properties(); beans = new HashMap<>(); InputStream is = BeanFactory.class.getClassLoader().getResourceAsStream("spring_01_beans.properties"); try { prop.load(is); Enumeration<Object> keys = prop.keys(); // 保证创建的是单例bean while (keys.hasMoreElements()) { String name = keys.nextElement().toString(); String path = prop.getProperty(name); Object object = Class.forName(path).newInstance(); beans.put(name, object); } } catch (Exception e) { e.printStackTrace(); throw new ExceptionInInitializerError("配置文件初始化失败!"); } } public static <T> T getBean(String beanName) { return (T) beans.get(beanName); } }
[ "liutao_glory@126.com" ]
liutao_glory@126.com
8d5d5227a6b25609f00959cce10f7c2a22023c56
771eb4b0c3ffb6770c97a8dd0023b51e22597dbe
/src/chap07/textbook/s070702/KumhoTire.java
df932c4e5dae5d64d684a618bd3a6f7e5935bf82
[]
no_license
hyunho1105/java20200929
f4da0a268791de5760a4bb566395f30bcd020dd7
b38c1e3523ba6aa8be4cc28b52b385b59e7a7f08
refs/heads/master
2023-01-02T13:12:37.267260
2020-10-30T08:47:34
2020-10-30T08:47:34
299,485,597
0
0
null
null
null
null
UTF-8
Java
false
false
522
java
package chap07.textbook.s070702; public class KumhoTire extends Tire { //필드 //생성자 public KumhoTire(String location, int maxRotation) { super(location, maxRotation); } //메소드 @Override public boolean roll() { ++accumulatedRotation; if(accumulatedRotation < maxRotation) { System.out.println(location + " KumhoTire 수명 : " + (maxRotation-accumulatedRotation) + "회"); return true; } else { System.out.println("***" + location + "KumhoTire 펑크 ***"); return false; } } }
[ "hyunho1105@gmail.com" ]
hyunho1105@gmail.com
0f076df68fcc3b4670795be583350df5bd00bc14
cf5d64a21fc8922c474f9fb9f7da60e841604c1c
/src/main/java/com/example/crudjdbcexample/controller/EmployeeController.java
ac316c15d0f96c9f6506c42978639f271d58652c
[]
no_license
aponchicw/crud-jdbc-example
621369360d52cc9bcb528b4b8974831bd8deaf1a
95816768401f67c17befa15d85fb1398ca3fc8ac
refs/heads/master
2023-05-11T06:16:15.188525
2021-05-27T14:04:11
2021-05-27T14:04:11
370,565,737
0
0
null
null
null
null
UTF-8
Java
false
false
2,742
java
package com.example.crudjdbcexample.controller; import com.example.crudjdbcexample.dao.jdbc.JdbcTemplateEmployeeDaoImpl; import com.example.crudjdbcexample.models.Employee; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/v1") @AllArgsConstructor public class EmployeeController extends BaseController { private final JdbcTemplateEmployeeDaoImpl jdbcTemplateEmployeeDao; @ApiOperation(value = "Получение списка заказов пользователя") @RequestMapping(value = "/employees/all", method = RequestMethod.GET) public ResponseEntity<?> getOrders(@RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber, @RequestParam(value = "pageSize", defaultValue = "12") Integer pageSize, @RequestParam(value = "search", required = false) String search, @RequestHeader(value = "userId", required = false) Long userId) { return buildResponse(jdbcTemplateEmployeeDao.getEmployees(userId, pageNumber, pageSize, search), HttpStatus.OK); } @ApiOperation(value = "Удалить сотрудника") @RequestMapping(value = "/employees", method = RequestMethod.DELETE) public ResponseEntity<?> deleteEmployee(@RequestParam(value = "employeeId") Long employeeId) { jdbcTemplateEmployeeDao.deleteEmployee(employeeId); return buildSuccessResponse("Employee is deleted!"); } @ApiOperation(value = "Посмотреть данные о сотруднике") @RequestMapping(value = "/employees/{id}", method = RequestMethod.GET) public ResponseEntity<?> getEmployee(@PathVariable Long id) { return buildResponse(jdbcTemplateEmployeeDao.getEmployee(id), HttpStatus.OK); } @ApiOperation(value = "Добавить сотрудника") @RequestMapping(value = "/employees", method = RequestMethod.POST) public ResponseEntity<?> createEmployee(@RequestBody Employee employee) { jdbcTemplateEmployeeDao.createEmployee(employee); return buildSuccessResponse("Employee is Created!"); } @ApiOperation(value = "Изменение контента сотрудника") @RequestMapping(value = "/employees", method = RequestMethod.PATCH) public ResponseEntity<String> updateOrder(@RequestBody Employee employee) { jdbcTemplateEmployeeDao.updateEmployeeDetails(employee); return ResponseEntity.status(HttpStatus.OK).body("Employee Updated!"); } }
[ "aponchicw@gmail.com" ]
aponchicw@gmail.com
3f750f09b5e73513dff13eab413b81060decbfb2
a855cbde92a73b9914f267b272ece8a59452f4e6
/Proyecto/src/main/java/com/example/demo/model/pojos/CentroDeCosto.java
81d269ee25b6d5d950eed2327dc2e2d75cb1d35e
[]
no_license
SAlejandr/Proyecto
b4647be0e29a7eea7f349ae43dd18a219426ab53
8525ba3718266e3803e2fccb7a4764271a9eebf1
refs/heads/master
2023-01-21T17:38:27.450651
2020-11-17T18:52:49
2020-11-17T18:52:49
313,705,410
0
0
null
null
null
null
UTF-8
Java
false
false
637
java
package com.example.demo.model.pojos; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode.Include; import lombok.NoArgsConstructor; import lombok.NonNull; @Data @Builder @AllArgsConstructor @NoArgsConstructor @EqualsAndHashCode(onlyExplicitlyIncluded = true) @Entity public class CentroDeCosto implements Serializable { @Id @Include private int codCentro; @Column(name = "nom_centro") private String nombre; }
[ "alejandro@alejandro-Aspire-F5-572G" ]
alejandro@alejandro-Aspire-F5-572G
12c741d09cf7875f97423cbeb712991647516f72
c81ab8adc930c1be427461ab501f74ea302d666c
/src/main/java/sb/tasks/repo/PropertyRepo.java
a10186343d88374c00f51b1231412969b3317814
[ "MIT" ]
permissive
bochkov/tasks
d3916c302fc47fdd9c75f592ecb98a77507114e6
a0681c85bb46c19fb9aa51588066e17e86dbfefc
refs/heads/master
2023-08-22T10:56:32.573300
2023-08-04T08:01:54
2023-08-04T08:01:54
97,558,444
0
1
null
null
null
null
UTF-8
Java
false
false
201
java
package sb.tasks.repo; import org.springframework.data.mongodb.repository.MongoRepository; import sb.tasks.model.Property; public interface PropertyRepo extends MongoRepository<Property, String> { }
[ "bochkovsa@gmail.com" ]
bochkovsa@gmail.com
0fc52f85973a62085ee0a8a6fb6957f6ea7847fe
028ea525a8282209812543dd8cef33e05fa458fe
/src/main/java/com/shubham/structural/bridgePattern/TV.java
d2a48c33d8c7a4373c4e1481d25cb16c9a0f4910
[]
no_license
abhimanyu2707/design-patterns
8b7de53070b4ff834a1e36a82badae11af3d274b
84f7e3db052f0ece38a0e41bd322f691bcac2299
refs/heads/master
2023-03-15T11:55:36.277213
2020-04-29T10:07:16
2020-04-29T10:07:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
188
java
package com.shubham.structural.bridgePattern; abstract class TV { Remote remote; TV(Remote remote) { this.remote = remote; } abstract void on(); abstract void off(); }
[ "agrawalshubham1103@gmail.com" ]
agrawalshubham1103@gmail.com
0b17bbfb950f4150f49c4727169ea60747c7e1ed
8138aa68f4f77e154c522511ddc04c825588c250
/src/main/java/com/souche/insurance/model/CheniuResult.java
ac5d11b7a5807585d406aeb0aadeb35f18dcfaa2
[]
no_license
P79N6A/book-platform
b5163ee4954dfd1b7138825195a6dd75fdc712dd
5e9a7f9e00e4fd4e7b97fbb1b81c6be28989cc27
refs/heads/master
2020-04-09T17:14:31.645256
2018-12-05T06:55:42
2018-12-05T06:55:42
160,475,043
0
1
null
2018-12-05T07:00:45
2018-12-05T07:00:45
null
UTF-8
Java
false
false
1,880
java
package com.souche.insurance.model; import com.souche.optimus.core.web.Result; /** * xumingming 16/3/29. */ public class CheniuResult<T> extends Result { private int resultId; private String message; private T data; public int getResultId() { return resultId; } public CheniuResult<T> setResultId(int resultId) { this.resultId = resultId; return this; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public static <T> CheniuResult<T> success(T data, String message) { CheniuResult<T> r = new CheniuResult<T>(); r.setData(data); r.setSuccess(true); r.setCode("200"); r.setMsg(message); r.setResultId(0); return r; } public static <T> CheniuResult<T> success() { CheniuResult<T> r = new CheniuResult<T>(); r.setSuccess(true); r.setCode("200"); r.setMsg("success"); r.setResultId(0); return r; } public static <T> CheniuResult<T> fail(String msg, int resultId) { CheniuResult<T> r = new CheniuResult<T>(); r.setSuccess(false); r.setMsg(msg); r.setResultId(resultId); return r; } public static <T> CheniuResult<T> fail(T data, String msg, int resultId) { CheniuResult<T> r = new CheniuResult<T>(); r.setSuccess(false); r.setData(data); r.setMsg(msg); r.setResultId(resultId); return r; } public static <T> CheniuResult<T> fail(T data, String msg, int resultId,String code) { CheniuResult<T> r = new CheniuResult<T>(); r.setSuccess(false); r.setData(data); r.setCode(code); r.setMsg(msg); r.setResultId(resultId); return r; } }
[ "xiegengsheng@souche.com" ]
xiegengsheng@souche.com
b6304fe1f7104dbf2086eb422141fa16065c61d5
864852532c1d1b9bcac834b625b6308f903986d7
/app/src/main/java/com/wzm/tasking/activity/UpdateAvatar.java
149973082c603c7cf15f9f5f9d96f71936bc7396
[]
no_license
ForeverLF/QiTalk
90ee4a56a54988234e2e17017dec0530280b6950
04d35b40503413349671c878373f7fb9279cfe11
refs/heads/master
2020-04-01T16:19:33.276050
2018-08-23T05:52:30
2018-08-23T05:52:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,173
java
package com.wzm.tasking.activity; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.PixelFormat; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.WindowManager; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.wzm.tasking.MainActivity; import com.wzm.tasking.R; import com.wzm.tasking.tools.ThemeManager; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import cn.jpush.im.android.api.JMessageClient; import cn.jpush.im.android.api.callback.GetAvatarBitmapCallback; /** * Created by ${WZM} on 17/7/16 * * @desc :更新用户头像 */ public class UpdateAvatar extends AppCompatActivity { private static final int CHOOSE_PICTURE = 0; private static final int TAKE_PICTURE = 1; private static final int CROP_PICTURE = 2; private static final String IMAGE_FILE_LOCATION = "file:///sdcard/temp.jpg"; private Uri imageUri;//to store the big bitmap private ProgressDialog mProgressDialog; private Toolbar mToolbar; private ImageView mImageView; private Button mBt_save; private static Bitmap mBitmap; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); initTheme(); initView(); initData(); initListener(); } private void initTheme() { int th = MainActivity.th; if (th == 7) { setTheme(ThemeManager.getTheme(7)); WindowManager manager = (WindowManager) getSystemService(Context.WINDOW_SERVICE); WindowManager.LayoutParams params = new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT); TextView tv = new TextView(this); tv.setBackgroundColor(0xbb000000); manager.addView(tv, params); } else { setTheme(ThemeManager.getTheme(th)); } } private void initView() { setContentView(R.layout.activity_update_avatar); mToolbar = (Toolbar) findViewById(R.id.toolbar_update_avatar); mBt_save = (Button) findViewById(R.id.bt_save); mImageView = (ImageView) findViewById(R.id.img_show_image); } private void initData() { setSupportActionBar(mToolbar); imageUri = Uri.parse(IMAGE_FILE_LOCATION); mProgressDialog = ProgressDialog.show(UpdateAvatar.this, "提示:", "正在加载中。。。"); mProgressDialog.setCanceledOnTouchOutside(true); JMessageClient.getMyInfo().getBigAvatarBitmap(new GetAvatarBitmapCallback() { @Override public void gotResult(int i, String s, Bitmap bitmap) { if (i == 0) { if (bitmap != null) { mBitmap = bitmap; mImageView.setImageBitmap(bitmap); } } mProgressDialog.dismiss(); } }); } private void initListener() { mToolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); mBt_save.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { saveBitmap(mBitmap, JMessageClient.getMyInfo().getUserName()); } }); } private void saveBitmap(Bitmap bitmap, String string) { if (bitmap == null) { Toast.makeText(this, getResources().getString(R.string.bitmap_is_null), Toast.LENGTH_SHORT).show(); return; } String filePath = Environment.getExternalStorageDirectory() + File.separator; File f = new File(filePath, string + ".png"); if (f.exists()) { f.delete(); } try { f.createNewFile(); FileOutputStream out = new FileOutputStream(f); bitmap.compress(Bitmap.CompressFormat.PNG, 90, out); out.flush(); out.close(); Toast.makeText(this, getResources().getString(R.string.save_success), Toast.LENGTH_SHORT).show(); } catch (IOException e) { e.printStackTrace(); } Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); Uri uri = Uri.fromFile(f); intent.setData(uri); this.sendBroadcast(intent); } }
[ "2209011667@qq.com" ]
2209011667@qq.com
ff49ae30178315b719300f3c1a28a6b956fc5087
cf14d358033f3c9281a510a418c08a628cb1c783
/hw17-webflux-angular/hw17-library-server/src/test/java/ru/otus/hw17webfluxangular/repository/AuthorsDaoImplTest.java
1a1233d35c75dd83a404237d498f54ee157d17d2
[]
no_license
woworks/otus-spring-2018
19f540bb40de57ece90290d0ef4b38333957bb54
8b7333374567d7cdc7ec796650e87d6857f475f7
refs/heads/master
2020-03-21T19:10:27.011285
2018-11-25T21:44:09
2018-11-25T21:44:09
138,933,103
0
0
null
2018-11-25T21:44:10
2018-06-27T21:06:57
Java
UTF-8
Java
false
false
2,520
java
package ru.otus.hw17webfluxangular.repository; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.jdbc.EmbeddedDatabaseConnection; import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager; import org.springframework.context.annotation.ComponentScan; import org.springframework.test.context.junit.jupiter.SpringExtension; import ru.otus.hw17webfluxangular.domain.Author; import ru.otus.hw17webfluxangular.domain.Book; import ru.otus.hw17webfluxangular.repository.AuthorsDao; import ru.otus.hw17webfluxangular.repository.BooksDao; import java.sql.SQLException; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; @ExtendWith(SpringExtension.class) @DataJpaTest @AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.H2) @ComponentScan("ru.otus.hw17webfluxangular.repository") class AuthorsDaoImplTest { private static final String NAME = "Charles Dickens"; private static final String TITLE = "Oliver Twist"; @Autowired private TestEntityManager entityManager; @Autowired private AuthorsDao authorsDao; @Autowired private BooksDao booksDao; @Test void insert() throws SQLException { Author author1 = new Author(NAME); this.entityManager.persist(author1); this.entityManager.flush(); Author author2 = this.authorsDao.getByName(NAME).get(); assertEquals(author1, author2); } @Test void getByName() throws SQLException { Author author = new Author(NAME); this.entityManager.persist(author); this.entityManager.flush(); Author author2 = this.authorsDao.getByName(NAME).get(); assertEquals(author, author2); } @Test void findAll() { List<Author> authorList = this.authorsDao.findAll(); assertEquals(5, authorList.size()); } @Test void getAuthorByBook() { Book book = new Book(); book.setTitle(TITLE); Author author1 = new Author(NAME); book.setAuthor(author1); this.authorsDao.save(author1); this.booksDao.save(book); Author author2 = this.authorsDao.getAuthorByBook(book).get(); assertEquals(author1, author2); } }
[ "artemslastin@gmail.com" ]
artemslastin@gmail.com
0f1330d863ee35df811c3343b68d180a3b90d63d
609df5b25431cb1eb0497c3d3d88de2d171cf2b5
/Anim-Effect/src/main/java/com/kk/taurus/animeffect/anims/AnimatorSlideLeft.java
302885f91fe91f22f033966bea3c0c10f826dafa
[ "Apache-2.0" ]
permissive
jiajunhui/AnimEffect
057d29b8a19fce0f37d3aa16fe20d0d868993655
f62b4f40766e38afda5e455c1ff2d3b674ef1307
refs/heads/master
2020-06-10T17:46:36.247697
2016-12-12T03:27:07
2016-12-12T03:27:07
75,917,942
1
0
null
null
null
null
UTF-8
Java
false
false
1,265
java
/* * Copyright 2016 jiajunhui * * 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.kk.taurus.animeffect.anims; import android.animation.Animator; import android.animation.ObjectAnimator; import android.view.View; import com.kk.taurus.animeffect.base.BaseAnimator; /** * Created by Taurus on 2016/12/8. */ public class AnimatorSlideLeft extends BaseAnimator { @Override public Animator[] togetherAnimators(View view) { return new Animator[]{ ObjectAnimator.ofFloat(view, PropertyType.TranslationX.getValue(), -300, 0).setDuration(getDuration()), ObjectAnimator.ofFloat(view, PropertyType.Alpha.getValue(), 0, 1).setDuration(getDuration()*3/2) }; } }
[ "309812983@qq.com" ]
309812983@qq.com
fb8c13aadca5419a6aefcf4b61632ce2be148636
17c35fe361445c4a960072d211d86064193f1ec1
/src/main/java/other_oj/poj1273.java
b11dd25cc57e2df4e39dcc95a0084853c75a9a66
[]
no_license
iotacecil/algLearn
3044afa7993d9a5cce44409316261be88a224e7c
1d7859a3545d1bc37ce816f3a434b16027be8201
refs/heads/master
2022-06-13T02:56:16.124667
2019-09-23T13:52:50
2019-09-23T13:52:50
139,341,898
0
0
null
2020-10-13T04:35:59
2018-07-01T15:50:05
Java
UTF-8
Java
false
false
1,901
java
package other_oj; import java.util.ArrayDeque; import java.util.Arrays; import java.util.Queue; import java.util.Scanner; /* 5 4 1 2 40 1 4 20 2 4 20 2 3 30 3 4 10 */ public class poj1273 { private static int edmondsKarp(int[][] G,int start,int end){ int rst = 0; int[] prev = new int[G.length]; while (bfs(G,prev,start,end)){ int min = Integer.MAX_VALUE; for (int i = end; i !=start ; i=prev[i]) { min = Math.min(min,G[prev[i]][i]); } for (int i = end; i !=start ; i = prev[i]) { G[prev[i]][i] -= min; G[i][prev[i]] += min; } rst += min; } return rst; } private static boolean bfs(int[][] G, int[] prev, int start, int end) { Arrays.fill(prev,-1); prev[start] = 0; Queue<Integer> que = new ArrayDeque<Integer>(); que.add(start); while (!que.isEmpty()){ int first = que.poll(); for (int i = 1; i <=end ; i++) { // 还没访问过 而且有边 if(prev[i] == -1 && G[first][i] != 0){ que.add(i); prev[i] = first; if(i == end)return true; } } } return false; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int N = sc.nextInt(); int M = sc.nextInt(); int[][] G = new int[M + 1][M + 1]; for (int i = 0; i < N; i++) { int from = sc.nextInt(); int to = sc.nextInt(); int cap = sc.nextInt(); G[from][to] += cap; } int start = 1; System.out.println(edmondsKarp(G, start, M)); } } }
[ "iotacecil@gmail.com" ]
iotacecil@gmail.com
7c83d04b4ba86425b57e0e6a0ba6df42d7cf7358
4b6ea4ae6d1340871900996520d1725fc4b2c4e4
/src/ankh/view/Random_Card.java
bed2348dacbee1bf5d3e11a4d667cb9c95e82621
[]
no_license
parthh/DiskWorld-Ankh-Morpork-Board-Game
380d0c47f896357f68c7c28d8a579ff8cd7c29b4
b1150e91903b5380ca590b971012ae1f3548d0a2
refs/heads/master
2021-01-10T05:22:29.851536
2016-04-07T18:00:24
2016-04-07T18:00:24
55,716,266
0
0
null
null
null
null
UTF-8
Java
false
false
663
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 ankh.view; /** * * @author admin */ public class Random_Card { int id; String random_title; String random_desc; public void set_data(int id,String title,String desc) { this.id = id; this.random_title = title; this.random_desc = desc; } public String get_title() { return random_title; } public String get_desc() { return random_desc; } }
[ "gadhiyaparthh@gmail.com" ]
gadhiyaparthh@gmail.com
f66d804eac761c0efa79b07be75eeb20f4fff15a
b0d7d92cd4274076868393c7e228e35b741c5500
/app/src/main/java/com/echo/allscenarioapp/api/RemoveMemberFromGroupAPi.java
8d57e6534fe25d0b8503a6816e1a51114403276b
[]
no_license
jayshah3165/ChatModel
cfd3c183f7b819f33528740c58f93d853145f421
2633f10058c9df72b5d83de779fffb6d2bcf37ff
refs/heads/master
2020-05-24T00:05:25.989484
2019-05-17T04:32:35
2019-05-17T04:32:35
187,008,842
0
0
null
null
null
null
UTF-8
Java
false
false
4,107
java
package com.echo.allscenarioapp.api; import android.app.Activity; import android.content.Context; import com.echo.allscenarioapp.backend.ResponseListener; import com.echo.allscenarioapp.backend.ResponseModelService; import com.echo.allscenarioapp.utils.Const; import com.echo.allscenarioapp.utils.Pref; import com.echo.allscenarioapp.utils.Utils; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.http.Field; import retrofit2.http.FormUrlEncoded; import retrofit2.http.POST; /** * Created by EchoIT on 9/21/2018. */ public class RemoveMemberFromGroupAPi { private final static String API = Const.REMOVE_MEMBER_FROM_GROUP_API; private ResponseListener responseListener = null; private Context context = null; private static IRequestData iRequestData = null; public RemoveMemberFromGroupAPi(Context _context, ResponseListener _responseListener) { this.context = _context; responseListener = _responseListener; iRequestData = Utils.retrofit.create(IRequestData.class); } // Request Api Param private interface IRequestData { @FormUrlEncoded @POST(API) Call<ResponseModelService> getResponseData( @Field("user_id") String user_id, @Field("group_id") String group_id, @Field("member_id") String member_id, @Field("conversation_id") String conversation_id, @Field("device_type") String device_type, @Field("token") String token, @Field("language") String language ); } public Void execute(String group_id,String member_id,String conversation_id) { try { Call<ResponseModelService> call = iRequestData.getResponseData( Pref.getStringValue(context, Const.PREF_USERID, ""),group_id,member_id,conversation_id, Const.DEVICE_TYPE,Pref.getStringValue(context, Const.PREF_GCMTOKEN, ""), Pref.getStringValue(context, Const.PREF_LANGUAGE, Const.EN)); call.enqueue(new Callback<ResponseModelService>() { @Override public void onResponse(Call<ResponseModelService> call, Response<ResponseModelService> response) { int status = 0; String mesg = ""; try { Utils.print("Message==>"+ response.body().success + "::" + response.body().message + ""); status = response.body().success; mesg = response.body().message; if (status == 1) { } } catch (Exception e) { e.printStackTrace(); } doCallBack(status, mesg); } @Override public void onFailure(Call<ResponseModelService> call, Throwable t) { Utils.print("Upload error:"+ t.getMessage()); doCallBack(-2, t.getMessage()); } }); } catch (Exception e) { e.printStackTrace(); } return null; } /* * Send control back to the caller which includes * Status: Successful or Failure Message: Its an Object, if required */ private void doCallBack(final int code, final String mesg) { ((Activity) context).runOnUiThread(new Runnable() { @Override public void run() { if (code == 1) { responseListener.onResponse(API, Const.API_RESULT.SUCCESS, null); } else if (code >= 0) { Utils.showToastMessage(context, mesg, false); responseListener.onResponse(API, Const.API_RESULT.FAIL, null); } else if (code < 0) { responseListener.onResponse(API, Const.API_RESULT.FAIL, null); } } }); } }
[ "rahul@echoinnovateit.com" ]
rahul@echoinnovateit.com
bd951b87ad773f3c1dbf9b233dcbe5883b0fe3bc
8bc47976dc44baaffbbe3a730f1e8ef8485f41a3
/threedollar-application-service/src/main/java/com/depromeet/threedollar/application/ThreeDollarApplicationRoot.java
48f20e049695139dc92163d6af215b42fe8ea406
[]
no_license
eunbeeLee/3dollars-in-my-pocket-backend
2da367b983febc3fbb8862818edf2c72ee3604b7
1240f8d5d80e282f043793d110985281b526b12d
refs/heads/main
2023-08-25T15:41:46.861818
2021-10-21T15:20:04
2021-10-21T15:20:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
package com.depromeet.threedollar.application; import com.depromeet.threedollar.domain.ThreeDollarDomainRoot; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @ComponentScan(basePackageClasses = { ThreeDollarApplicationRoot.class, ThreeDollarDomainRoot.class, }) @Configuration public class ThreeDollarApplicationRoot { }
[ "will.seungho@gmail.com" ]
will.seungho@gmail.com
d85fa3b882d5d3aa7d9a6b7b27a6ce9a8c6aeb14
8e0476a857c4b32195a8c22f321edb00edd6224d
/src/main/java/com/taotao/portal/pojo/Item.java
992bde818d2ef793885de9f6a6c2756cb637212b
[]
no_license
dingfeiyang/taotao-portal
92d1c0159b119b03cc57264baeabd8e6fa0255c3
9267311572140ba08e0c7e3e0dee41c459846f59
refs/heads/master
2020-04-25T20:42:47.887336
2019-02-28T06:53:00
2019-02-28T06:53:00
173,057,198
0
0
null
null
null
null
UTF-8
Java
false
false
1,271
java
package com.taotao.portal.pojo; public class Item { private String id; private String title; private String sell_point; private long price; private String image; private String category_name; private String item_des; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getSell_point() { return sell_point; } public void setSell_point(String sell_point) { this.sell_point = sell_point; } public long getPrice() { return price; } public void setPrice(long price) { this.price = price; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public String getCategory_name() { return category_name; } public void setCategory_name(String category_name) { this.category_name = category_name; } public String getItem_des() { return item_des; } public void setItem_des(String item_des) { this.item_des = item_des; } public String[] getImages(){ if(image!=""){ String images[] = image.split(","); return images; }else{ return null; } } }
[ "1415809737@qq.com" ]
1415809737@qq.com
18ed68cbc3606095f8a61572b4c87c457901d7b1
98d313cf373073d65f14b4870032e16e7d5466f0
/gradle-open-labs/example/src/main/java/se/molybden/Class15487.java
fd55cfd25312b4770f166061c1c4f68b766b4168
[]
no_license
Molybden/gradle-in-practice
30ac1477cc248a90c50949791028bc1cb7104b28
d7dcdecbb6d13d5b8f0ff4488740b64c3bbed5f3
refs/heads/master
2021-06-26T16:45:54.018388
2016-03-06T20:19:43
2016-03-06T20:19:43
24,554,562
0
0
null
null
null
null
UTF-8
Java
false
false
110
java
public class Class15487{ public void callMe(){ System.out.println("called"); } }
[ "jocce.nilsson@gmail.com" ]
jocce.nilsson@gmail.com
707ef53e2ee07639e72c1635770f47a3447acb62
0c45ba3dcc593ca18ceca549eb8f85c4ce60c8b6
/src/main/java/com/situ/store/product/service/CategoryService.java
1726ceba8d43082d7d1bc7964ca7d164cabd7d9d
[]
no_license
choutuzibuliwo/test
36a74c0ffa8c77ac14fff0e0b7379a5ad54d766c
a038553fcaa5b1c86767f0842f09cf7888d29ce0
refs/heads/master
2022-12-23T16:12:28.432627
2019-07-16T01:34:56
2019-07-16T02:05:46
197,097,522
0
0
null
2022-12-16T08:48:10
2019-07-16T01:24:15
Java
UTF-8
Java
false
false
1,077
java
package com.situ.store.product.service; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.situ.store.product.mapper.CategoryMapper; import com.situ.store.product.model.CategoryModel; @Service public class CategoryService { @Autowired private CategoryMapper categoryMapper; public int insert(CategoryModel model) { return categoryMapper.insert(model); } public int delete(CategoryModel model) { return categoryMapper.delete(model); } public int deleteModel(CategoryModel model) { return categoryMapper.deleteModel(model); } public int update(CategoryModel model) { return categoryMapper.update(model); } public CategoryModel select(CategoryModel model) { return categoryMapper.select(model); } public List<CategoryModel> selectAll(CategoryModel model){ return categoryMapper.selectAll(model); } public int selectCount(CategoryModel model) { return categoryMapper.selectCount(model); } }
[ "lenovo@LAPTOP-SIJ6IOAN" ]
lenovo@LAPTOP-SIJ6IOAN
7151518218bf533539472232ab45a77a12db2f20
aec805d8529a6dc5eaeddf6f01fda8445f8ae3a0
/pinyougou-parent/pinyougou-manager-web-9101/src/main/java/com/pinyougou/manager/controller/LoginController.java
cbf1f2a6530dd629c937bb72f2dfb52fe2133e91
[]
no_license
love550185890/pinyougou
d051bf4a5d5e5c8a14e68adf6590a7d59f74bb8c
127e354181eec5f3e6cd9302b6b2e90c122614f3
refs/heads/master
2022-12-21T08:55:01.981735
2019-10-03T00:20:23
2019-10-03T00:20:23
211,529,315
0
1
null
2019-09-28T16:47:07
2019-09-28T16:27:41
JavaScript
UTF-8
Java
false
false
686
java
package com.pinyougou.manager.controller; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.Map; /** * @Description * @Author 550185890@qq.com * @Date 2019年9月26日03:59:47 */ @RestController @RequestMapping("/login") public class LoginController { @RequestMapping("/name") public Map name(){ Map map = new HashMap(); String name = SecurityContextHolder.getContext().getAuthentication().getName(); map.put("loginName",name); return map; } }
[ "lsf_320@126.com" ]
lsf_320@126.com
0177781e62c4509036338a069496ab3a56095424
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/11/11_1cb26dec15cc2ced3cab69a16d2087695594486f/PreferTheirConceptNumericToConceptShareScenarioTest/11_1cb26dec15cc2ced3cab69a16d2087695594486f_PreferTheirConceptNumericToConceptShareScenarioTest_t.java
ccb23114027326293e7cab84c2686e492c7f3494
[]
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
2,978
java
/** * The contents of this file are subject to the OpenMRS Public License * Version 1.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://license.openmrs.org * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * Copyright (C) OpenMRS, LLC. All Rights Reserved. */ package org.openmrs.module.metadatasharing; import java.util.Collections; import java.util.List; import java.util.Locale; import org.junit.Assert; import org.junit.Test; import org.openmrs.Concept; import org.openmrs.ConceptName; import org.openmrs.ConceptNumeric; import org.openmrs.api.context.Context; import org.openmrs.module.metadatasharing.handler.Handler; import org.openmrs.module.metadatasharing.wrapper.PackageImporter; public class PreferTheirConceptNumericToConceptShareScenarioTest extends BaseShareTest { @Test public void importPackageMappingItemsMatchedByUuids() throws Exception { runShareTest(new ShareTestHelper() { @Override public List<?> prepareExportServer() throws Exception { ConceptNumeric c = new ConceptNumeric(); c.setDatatype(Context.getConceptService().getConceptDatatypeByName("Numeric")); c.addName(new ConceptName("ConceptNumericConcept", Locale.US)); c.setHiNormal(Double.valueOf(1)); c.setUuid("23423a2982236623"); Context.getConceptService().saveConcept(c); return Collections.nCopies(1, c); } @Override public void prepareImportServer() throws Exception { Concept c = new Concept(); c.addName(new ConceptName("ConceptNumericConcept", Locale.US)); c.setUuid("23423a2982236623"); Context.getConceptService().saveConcept(c); } @Override public void runOnImportServerBeforeImport(PackageImporter importer) throws Exception { for (ImportedItem importedItem : importer.getImportedItems(0)) { if (importedItem.getExisting() == null) continue; if ((Handler.getUuid(importedItem.getIncoming()).equals("23423a2982236623"))) { importedItem.setImportType(ImportType.PREFER_THEIRS); } } } @Override public void runOnImportServerAfterImport() throws Exception { assertMappedCorrectly(); } }); } private void assertMappedCorrectly() { Concept concept = Context.getConceptService().getConceptByUuid("23423a2982236623"); if (!(concept instanceof ConceptNumeric)) { Assert.fail(); } Assert.assertEquals("Numeric", concept.getDatatype().getName()); } /** * @see org.openmrs.module.metadatasharing.BaseShareTest#getInitialDataset() */ @Override public String getInitialDataset() { return null; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b7d7e898da8c858fd6dc7ee7684a26346a54aa0c
48a3bc9d97bf7eb8f2bc1e89fb19daabb6b78f19
/Clase8/src/app/client/login/LoginTemplate.java
0bd30552209e3f06062876a4095d92bd4c2164c5
[]
no_license
CrissUD/InterfazGraficaJavaClase8
dd3ef45294d6cc4876b8cad79ebb18344da3a238
e68b7991cd4c0c92bee94055f2f39ccd02c2eff2
refs/heads/master
2022-12-17T15:56:06.282026
2020-09-28T13:45:58
2020-09-28T13:45:58
263,199,979
17
2
null
null
null
null
UTF-8
Java
false
false
12,496
java
package app.client.login; import app.services.ObjGraficosService; import app.services.RecursosService; import java.awt.Color; import java.awt.Image; import javax.swing.ImageIcon; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; public class LoginTemplate extends JFrame { private static final long serialVersionUID = 1L; // Declaración Objetos Gráficos private JPanel pDerecha, pIzquierda; private JLabel lTituloApp, lEslogan, lTituloLogin, lNotificaciones; private JLabel lFondo, lSvg1, lLogo, lUsuario, lClave, lFacebook, lTwitter, lYoutube; private JTextField tNombreUsuario; private JPasswordField tClaveUsuario; private JComboBox<String> cbTipoUsuario; private JButton bEntrar, bCerrar, bRegistrarse, bOpcion1, bOpcion2, bOpcion3; private JCheckBox checkSi, checkNo; private ButtonGroup grupo; // Declaración objetos Decoradores private ImageIcon iFondo, iLogo; private ImageIcon iSvg1, iUsuario2, iClave2, iPunto1, iFacebook1, iTwitter1, iYoutube1, iDimAux; // Declaración servicios private ObjGraficosService sObjGraficos; private RecursosService sRecursos; private LoginComponent loginComponent; public LoginTemplate(LoginComponent loginComponent){ this.loginComponent = loginComponent; sObjGraficos = ObjGraficosService.getService(); sRecursos = RecursosService.getService(); this.crearObjetosDecoradores(); this.crearJPanels(); this.crearJTextFields(); this.crearJPasswordFields(); this.crearJComboBoxes(); this.crearJButtons(); this.crearJCheckBoxes(); this.crearJLabels(); setLayout(null); setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(1000, 500); setLocationRelativeTo(this); setUndecorated(true); setLayout(null); setVisible(true); } public void crearObjetosDecoradores() { iFondo = new ImageIcon("Clase8/resources/images/fondo.png"); iLogo = new ImageIcon("Clase8/resources/images/logo.png"); iUsuario2 = new ImageIcon("Clase8/resources/images/usuario2.png"); iClave2 = new ImageIcon("Clase8/resources/images/clave2.png"); iPunto1 = new ImageIcon("Clase8/resources/images/punto1.png"); iFacebook1 = new ImageIcon("Clase8/resources/images/facebook1.png"); iTwitter1 = new ImageIcon("Clase8/resources/images/twitter1.png"); iYoutube1 = new ImageIcon("Clase8/resources/images/youtube1.png"); iSvg1 = new ImageIcon("Clase8/resources/images/imagen1.png"); } public void crearJPanels() { pIzquierda = sObjGraficos.construirJPanel(0, 0, 600, 500, Color.WHITE, null); this.add(pIzquierda); pDerecha = sObjGraficos.construirJPanel(600, 0, 400, 500, Color.WHITE, null); this.add(pDerecha); } public void crearJTextFields() { tNombreUsuario = sObjGraficos.construirJTextField( "Nombre Usuario", (pDerecha.getWidth() - 260) / 2, 130, 260, 40, null, Color.WHITE, sRecursos.getColorPrincipal(), sRecursos.getColorGrisOscuro(), sRecursos.getBInferiorAzul(), "c" ); pDerecha.add(tNombreUsuario); } public void crearJButtons() { // BOTÓN ENTRAR----------------------------------------------------------------------------- bEntrar = sObjGraficos.construirJButton( "Entrar", (pDerecha.getWidth() - 250) / 2, 330, 250, 45, sRecursos.getCMano(), null, null, sRecursos.getColorPrincipal(), Color.WHITE, null, "c", true ); bEntrar.addActionListener(loginComponent); pDerecha.add(bEntrar); // BOTÓN REGISTRARSE----------------------------------------------------------------------- bRegistrarse = sObjGraficos.construirJButton( "Registrarse", 240, 460, 145, 35, sRecursos.getCMano(), null, null, sRecursos.getColorPrincipal(), Color.WHITE, null, "c", true ); bRegistrarse.addActionListener(loginComponent); pDerecha.add(bRegistrarse); // BOTÓN CERRAR----------------------------------------------------------------------------- iDimAux = new ImageIcon( sRecursos.getICerrar().getImage() .getScaledInstance(30, 30, Image.SCALE_AREA_AVERAGING) ); bCerrar = sObjGraficos.construirJButton( null, 350, 10, 45, 30, sRecursos.getCMano(), iDimAux, null, null, null, null, "c", false ); bCerrar.addActionListener(loginComponent); pDerecha.add(bCerrar); iDimAux = new ImageIcon( iPunto1.getImage() .getScaledInstance(20, 20, Image.SCALE_AREA_AVERAGING) ); // BOTÓN OPCIÓN 1----------------------------------------------------------------------------- bOpcion1 = sObjGraficos.construirJButton( null, 10, 220, 30, 20, sRecursos.getCMano(), iDimAux, null, null, null, null, "c", false ); bOpcion1.addActionListener(loginComponent); pIzquierda.add(bOpcion1); // BOTÓN OPCIÓN 2----------------------------------------------------------------------------- bOpcion2 = sObjGraficos.construirJButton( null, 10, 250, 30, 20, sRecursos.getCMano(), iDimAux, null, null, null, null, "c", false ); pIzquierda.add(bOpcion2); // BOTÓN OPCIÓN 3----------------------------------------------------------------------------- bOpcion3 = sObjGraficos.construirJButton( null, 10, 280, 30, 20, sRecursos.getCMano(), iDimAux, null, null, null, null, "c", false ); pIzquierda.add(bOpcion3); } public void crearJLabels() { // LABEL LOGO----------------------------------------------------------------------------- iDimAux = new ImageIcon( iLogo.getImage() .getScaledInstance(40, 40, Image.SCALE_AREA_AVERAGING) ); lLogo = sObjGraficos.construirJLabel( null, 50, 20, 40, 40, sRecursos.getCMano(), iDimAux, null, null, null, null, "c" ); pIzquierda.add(lLogo); // LABEL TITULO APP----------------------------------------------------------------------------- lTituloApp = sObjGraficos.construirJLabel( "Login de Usuario", 100, 20, 220, 30, null, null, sRecursos.getFontTPrincipal(), null, Color.WHITE, null, "c" ); pIzquierda.add(lTituloApp); // LABEL SVG----------------------------------------------------------------------------- iDimAux = new ImageIcon( iSvg1.getImage() .getScaledInstance(500, 345, Image.SCALE_AREA_AVERAGING) ); lSvg1 = sObjGraficos.construirJLabel( null, 100, 100, 500, 345, null, iDimAux, null, null, null, null, "c" ); pIzquierda.add(lSvg1); // LABEL ESLOGAN----------------------------------------------------------------------------- lEslogan = sObjGraficos.construirJLabel( "Te ayudamos en todo", (pDerecha.getWidth() - 130) / 2, 60, 130, 20, null, null, sRecursos.getFontSubtitulo(), null, sRecursos.getColorGrisOscuro(), null, "c" ); pDerecha.add(lEslogan); // LABEL TITULO LOGIN----------------------------------------------------------------------------- lTituloLogin = sObjGraficos.construirJLabel( "Registra tus Datos", (pDerecha.getWidth() - 150) / 2, 80, 150, 30, null, null, sRecursos.getFontTitulo(), null, sRecursos.getColorGrisOscuro(), null, "c" ); pDerecha.add(lTituloLogin); // LABEL NOTIFICACIONES----------------------------------------------------------------------------- lNotificaciones = sObjGraficos.construirJLabel( "¿Recibir Notificaciones?", (pDerecha.getWidth() - 140) / 2, 400, 140, 20, null, null, sRecursos.getFontSubtitulo(), null, sRecursos.getColorGrisOscuro(), null, "c" ); pDerecha.add(lNotificaciones); // LABEL USUARIO----------------------------------------------------------------------------- iDimAux = new ImageIcon( iUsuario2.getImage() .getScaledInstance(30, 30, Image.SCALE_AREA_AVERAGING) ); lUsuario = sObjGraficos.construirJLabel( null, 40, 140, 30, 30, null, iDimAux, null, null, null, null, "c" ); pDerecha.add(lUsuario); // LABEL CLAVE----------------------------------------------------------------------------- iDimAux = new ImageIcon( iClave2.getImage() .getScaledInstance(30, 30, Image.SCALE_AREA_AVERAGING) ); lClave = sObjGraficos.construirJLabel( null, 40, 270, 30, 30, null, iDimAux, null, null, null, null, "c" ); pDerecha.add(lClave); // LABEL FACEBOOK----------------------------------------------------------------------------- iDimAux = new ImageIcon( iFacebook1.getImage() .getScaledInstance(30, 30, Image.SCALE_AREA_AVERAGING) ); lFacebook = sObjGraficos.construirJLabel( null, 20, 460, 30, 30, sRecursos.getCMano(), iDimAux, null, null, null, null, "c" ); pIzquierda.add(lFacebook); // LABEL TWITTER----------------------------------------------------------------------------- iDimAux = new ImageIcon( iTwitter1.getImage() .getScaledInstance(30, 30, Image.SCALE_AREA_AVERAGING) ); lTwitter = sObjGraficos.construirJLabel( null, 60, 460, 30, 30, sRecursos.getCMano(), iDimAux, null, null, null, null, "c" ); pIzquierda.add(lTwitter); // LABEL YOUTUBE----------------------------------------------------------------------------- iDimAux = new ImageIcon( iYoutube1.getImage() .getScaledInstance(30, 30, Image.SCALE_AREA_AVERAGING) ); lYoutube = sObjGraficos.construirJLabel( null, 100, 460, 30, 30, sRecursos.getCMano(), iDimAux, null, null, null, null, "c" ); pIzquierda.add(lYoutube); // LABEL FONDO----------------------------------------------------------------------------- iDimAux = new ImageIcon( iFondo.getImage() .getScaledInstance(600, 600, Image.SCALE_AREA_AVERAGING) ); lFondo = sObjGraficos.construirJLabel( null, 0, 0, 600, 600, null, iDimAux, null, null, null, null, "c" ); pIzquierda.add(lFondo); } public void crearJPasswordFields() { tClaveUsuario = sObjGraficos.construirJPasswordField( "Clave Usuario", (pDerecha.getWidth() - 260) / 2, 260, 260, 40, null, null, sRecursos.getColorPrincipal(), sRecursos.getColorGrisOscuro(), sRecursos.getBInferiorAzul(), "c" ); pDerecha.add(tClaveUsuario); } public void crearJComboBoxes() { cbTipoUsuario = sObjGraficos.construirJComboBox( "Cliente_Cajero_Administrador", (pDerecha.getWidth() - 220) / 2, 210, 220, 30, null, Color.WHITE, sRecursos.getColorPrincipal(), "c" ); pDerecha.add(cbTipoUsuario); } public void crearJCheckBoxes() { checkSi = sObjGraficos.construirJCheckBox( "Si", (pDerecha.getWidth() - 45) / 2 - 15, 375, 45, 25, sRecursos.getCMano(), null, null ); pDerecha.add(checkSi); checkNo = sObjGraficos.construirJCheckBox( "No", (pDerecha.getWidth() + 45) / 2 - 15, 375, 45, 25, sRecursos.getCMano(), null, null ); pDerecha.add(checkNo); grupo = new ButtonGroup(); grupo.add(checkSi); grupo.add(checkNo); } public JButton getBCerrar() { return this.bCerrar; } public JButton getBEntrar() { return this.bEntrar; } public JButton getBRegistrarse() { return this.bRegistrarse; } public JButton getBOpcion1() { return this.bOpcion1; } public JTextField getTNombreUsuario() { return this.tNombreUsuario; } public JPasswordField getTClaveUsuario() { return this.tClaveUsuario; } public JComboBox<String> getCbTipoUsuario() { return this.cbTipoUsuario; } public JCheckBox getCheckSi() { return this.checkSi; } public JCheckBox getCheckNo() { return this.checkNo; } }
[ "cfpatinoc@correo.udistrital.edu.co" ]
cfpatinoc@correo.udistrital.edu.co
3e1ee727dcd3b19d6e95393f85dffbae4ce412b4
a24789efd2cb74131111acf2baf3ffff2d6e8280
/JavaCode/contest/weekly/n0_200/n168/N3.java
a40eebf80a51ce1e37cf6d91eee8165a7400bdf3
[ "Apache-2.0" ]
permissive
MikuSugar/LeetCode
15e6c7a73b296a74f4c86435c832f99021a3b6d7
e9cf36e52ae38d92b97e3c5c026c97e300c07971
refs/heads/master
2023-06-26T10:39:50.001158
2023-06-21T08:31:37
2023-06-21T08:31:37
164,054,066
6
0
null
null
null
null
UTF-8
Java
false
false
2,191
java
package JavaCode.contest.weekly.n0_200.n168; import java.util.HashMap; import java.util.Map; /** * author:fangjie * time:2019/12/22 */ public class N3 { public int maxFreq(String s, int maxLetters, int minSize, int maxSize) { char[] strs=s.toCharArray(); int[] book=new int[26]; int left=0,right=0; int res=0; Map<String,Integer> map=new HashMap<>(); while (right<strs.length) { book[strs[right++]-'a']++; int cnt=getCnt(book); while (getCnt(book)>maxLetters) { book[strs[left++]-'a']--; } while ((right-left)>maxSize) { book[strs[left++]-'a']--; } for (int i=left;i<right&&(right-i)>=minSize;i++) { String cur=s.substring(i,right); int c=map.getOrDefault(cur,0)+1; map.put(cur,c); res=Math.max(res,c); } } return res; } private int getCnt(int[] book) { int res=0; for (int i:book) { res+=i>0?1:0; } return res; } } /* 给你一个字符串 s ,请你返回满足以下条件且出现次数最大的 任意 子串的出现次数: 子串中不同字母的数目必须小于等于 maxLetters 。 子串的长度必须大于等于 minSize 且小于等于 maxSize 。 示例 1: 输入:s = "aababcaab", maxLetters = 2, minSize = 3, maxSize = 4 输出:2 解释:子串 "aab" 在原字符串中出现了 2 次。 它满足所有的要求:2 个不同的字母,长度为 3 (在 minSize 和 maxSize 范围内)。 示例 2: 输入:s = "aaaa", maxLetters = 1, minSize = 3, maxSize = 3 输出:2 解释:子串 "aaa" 在原字符串中出现了 2 次,且它们有重叠部分。 示例 3: 输入:s = "aabcabcab", maxLetters = 2, minSize = 2, maxSize = 3 输出:3 示例 4: 输入:s = "abcde", maxLetters = 2, minSize = 3, maxSize = 3 输出:0 提示: 1 <= s.length <= 10^5 1 <= maxLetters <= 26 1 <= minSize <= maxSize <= min(26, s.length) s 只包含小写英文字母。 */
[ "syfangjie@live.cn" ]
syfangjie@live.cn
0ec4530b1a8cac8246096822046af12fcbf4a351
95f0dadf9c7e0d6d0ae7ae6f904cbd24366d1f27
/src/main/java/com/maxwell/hangman/HangmanApplication.java
22f13d0246ba3fa2ce25e4977e792a614ae2513c
[]
no_license
maxwellknoxx/hangman
d04ccc982a791fd48595bea150bb1b1a208e5f66
9c3cd48ca7dd57a32060fb2e6d47d3bd307058e1
refs/heads/master
2020-05-21T17:26:18.065611
2019-08-22T00:10:24
2019-08-22T00:10:24
186,123,508
0
0
null
null
null
null
UTF-8
Java
false
false
313
java
package com.maxwell.hangman; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class HangmanApplication { public static void main(String[] args) { SpringApplication.run(HangmanApplication.class, args); } }
[ "maxwell.knoxx@live.com" ]
maxwell.knoxx@live.com
23e6c741cd5c6bf895b9030cc1e6697e21258d61
e2e386f1b222b4ee65008864b8ad246e870ff17d
/gmall-mbg/src/main/java/cn/fxpaul/gmall/ums/service/impl/MemberMemberTagRelationServiceImpl.java
e7b4984a2a9c046b705668e9daf256ffc05c62f6
[]
no_license
FXPaUl-only/gmall
9377e648072ad0a734cb98df8bd27125ac1302f0
80e1a770b7a7e7b06705c978f324b141319e286d
refs/heads/master
2022-07-03T13:58:04.560153
2020-03-17T08:29:12
2020-03-17T08:29:12
247,758,842
0
0
null
2022-06-21T03:00:15
2020-03-16T16:06:27
Java
UTF-8
Java
false
false
639
java
package cn.fxpaul.gmall.ums.service.impl; import cn.fxpaul.gmall.ums.entity.MemberMemberTagRelation; import cn.fxpaul.gmall.ums.mapper.MemberMemberTagRelationMapper; import cn.fxpaul.gmall.ums.service.MemberMemberTagRelationService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 用户和标签关系表 服务实现类 * </p> * * @author fxpaul * @since 2020-03-17 */ @Service public class MemberMemberTagRelationServiceImpl extends ServiceImpl<MemberMemberTagRelationMapper, MemberMemberTagRelation> implements MemberMemberTagRelationService { }
[ "18786672393@163.com" ]
18786672393@163.com
7801fd590df63f60e070ab93da040b1a34468cc8
c72926747e039656819e1e972573adbe1430d4bf
/message/src/message/update_profile.java
4cf2d1600ab0219a00196a247bebab74dad020b1
[]
no_license
Zypher01/Cognizance2020-1
e6323a0b069061332c2198ad3d8d281b300fadb4
5d231730ad564d9cc2746f337e4a8d3209c5a2e4
refs/heads/master
2023-01-22T21:26:06.258591
2020-12-04T11:20:59
2020-12-04T11:20:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
31,609
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * update_profile.java * * Created on Sep 25, 2019, 3:50:16 PM */ package message; import java.awt.Image; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.sql.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.ImageIcon; import javax.swing.JOptionPane; /** * * @author class-12 */ public class update_profile extends javax.swing.JFrame { File sm;String u_name,iid,uname; boolean password=false,user=false,image=false,about_me=false,email=false; /** Creates new form update_profile */ public update_profile() { initComponents(); } /** 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() { jFileChooser1 = new javax.swing.JFileChooser(); jPanel1 = new javax.swing.JPanel(); jLabel6 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); jPasswordField4 = new javax.swing.JPasswordField(); jLabel1 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jPasswordField1 = new javax.swing.JPasswordField(); jPasswordField2 = new javax.swing.JPasswordField(); jTextField2 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jPasswordField3 = new javax.swing.JPasswordField(); jLabel7 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jLabel8 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } }); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "profile pic", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM)); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE) ); jButton2.setText("update profile pic"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jLabel1.setText("your id"); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jTextField1.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { jTextField1FocusLost(evt); } }); jLabel3.setText("re-type your new password"); jLabel3.setOpaque(true); jLabel2.setText("type your new password"); jLabel2.setOpaque(true); jLabel4.setText("your user name"); jLabel5.setText("about me"); jTextArea1.setColumns(20); jTextArea1.setLineWrap(true); jTextArea1.setRows(5); jTextArea1.addCaretListener(new javax.swing.event.CaretListener() { public void caretUpdate(javax.swing.event.CaretEvent evt) { jTextArea1CaretUpdate(evt); } }); jScrollPane1.setViewportView(jTextArea1); jPasswordField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField1ActionPerformed(evt); } }); jPasswordField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField2ActionPerformed(evt); } }); jPasswordField2.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { jPasswordField2FocusLost(evt); } }); jPasswordField2.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { jPasswordField2KeyPressed(evt); } }); jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); jTextField2.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { jTextField2FocusLost(evt); } }); jButton1.setText("submit"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jPasswordField3.setNextFocusableComponent(jPasswordField1); jPasswordField3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField3ActionPerformed(evt); } }); jPasswordField3.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { jPasswordField3FocusLost(evt); } }); jLabel7.setText("type your password"); jLabel7.setOpaque(true); jButton3.setText("update your id"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton4.setText("update your user name"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jButton5.setText("update your password"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jButton6.setText("update your info"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jLabel8.setText("type your password"); jLabel8.setOpaque(true); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGap(177, 177, 177) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4) .addComponent(jLabel5) .addComponent(jLabel1) .addComponent(jLabel8)) .addGap(46, 46, 46) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE) .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE) .addComponent(jPasswordField4, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jLabel2) .addComponent(jLabel7)) .addGap(9, 9, 9) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPasswordField2, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE) .addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE) .addComponent(jPasswordField3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE)))) .addGap(6, 6, 6) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(38, 38, 38) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton3) .addComponent(jButton4) .addComponent(jButton5) .addComponent(jButton6))) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton1) .addComponent(jButton2)))) .addGap(10, 10, 10)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addGap(43, 43, 43) .addComponent(jButton2))) .addGap(17, 17, 17) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1) .addComponent(jButton3)) .addGap(7, 7, 7) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4) .addComponent(jButton4)) .addGap(9, 9, 9) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jPasswordField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7) .addComponent(jButton5)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jButton6) .addContainerGap()) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton1) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jPasswordField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8)) .addContainerGap()))) .addGroup(layout.createSequentialGroup() .addComponent(jLabel5) .addContainerGap())))) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed try{ jFileChooser1.showOpenDialog(null); sm=jFileChooser1.getSelectedFile(); if(sm==null){image=false;} String Path=sm.getAbsolutePath(); ImageIcon a=new ImageIcon(new ImageIcon(Path).getImage().getScaledInstance(100, 98, Image.SCALE_SMOOTH)); jLabel6.setIcon(a); if(image){image=false;jButton2.setName("update image");} else{image=true;jButton2.setName("do not update image");}} catch(Exception ex){}// TODO add your handling code here: }//GEN-LAST:event_jButton2ActionPerformed private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed }//GEN-LAST:event_jTextField1ActionPerformed private void jTextField1FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField1FocusLost try { Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/messenger?zeroDateTimeBehavior=convertToNull", "root", "root"); Statement s=con.createStatement(); String id,uid; id=jTextField1.getText(); id=id.trim(); ResultSet r=s.executeQuery("select id from id where id =\""+id+"\";"); if(r.next()){uid=r.getString(1); if(uid.equals(u_name)){ jButton1.setEnabled(true); } else{int a=JOptionPane.showConfirmDialog(null, "id is already in use\n use another id?", "error", 0, 0); if(a==0){jTextField1.setText("");} jButton1.setEnabled(false);}} else if(id.equals("")){JOptionPane.showMessageDialog(null, "id cannot be empty", "error", 0); jButton1.setEnabled(false);} else{jButton1.setEnabled(true);}// TODO add your handling code here: } catch (Exception ex) { Logger.getLogger(sign_up.class.getName()).log(Level.SEVERE, null, ex); } // TODO add your handling code here: }//GEN-LAST:event_jTextField1FocusLost private void jTextArea1CaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_jTextArea1CaretUpdate // TODO add your handling code here: }//GEN-LAST:event_jTextArea1CaretUpdate private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPasswordField1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jPasswordField1ActionPerformed private void jPasswordField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPasswordField2ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jPasswordField2ActionPerformed private void jPasswordField2FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jPasswordField2FocusLost String pass,re_pass,uname; pass=new String(jPasswordField1.getPassword()); uname=jTextField2.getText(); re_pass=new String(jPasswordField2.getPassword()); if(!pass.equals(re_pass)){JOptionPane.showMessageDialog(null, "password not matching re type password", "error", 0); jButton1.setEnabled(false);} else if(pass.trim().equals("")){JOptionPane.showMessageDialog(null, "password must only contain A-Z or a-z or 0-9 or @ or . \n not anyother special character or spaces or be empty", "error", 0); jButton1.setEnabled(false);} else{jButton1.setEnabled(true);} // TODO add your handling code here: }//GEN-LAST:event_jPasswordField2FocusLost private void jPasswordField2KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jPasswordField2KeyPressed // TODO add your handling code here: }//GEN-LAST:event_jPasswordField2KeyPressed private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed uname=jTextField1.getText(); // TODO add your handling code here: }//GEN-LAST:event_jTextField2ActionPerformed private void jTextField2FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField2FocusLost try { Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/messenger?zeroDateTimeBehavior=convertToNull", "root", "root"); Statement s=con.createStatement(); String id,uid; id=jTextField2.getText(); id=id.trim(); ResultSet r=s.executeQuery("select u_name from id where u_name =\""+id+"\";"); if(r.next()){uid=r.getString(1); if(uid.equals(u_name)){ jButton1.setEnabled(true); } else{JOptionPane.showMessageDialog(null, "user name is already taken", "error", 0); jButton1.setEnabled(false);}} else if(id.equals("")){JOptionPane.showMessageDialog(null, "user name cannot be empty", "error", 0); jButton1.setEnabled(false);} else{jButton1.setEnabled(true);}// TODO add your handling code here: } catch (Exception ex) { Logger.getLogger(sign_up.class.getName()).log(Level.SEVERE, null, ex); } // TODO add your handling code here: }//GEN-LAST:event_jTextField2FocusLost private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed try{ Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/messenger?zeroDateTimeBehavior=convertToNull", "root", "root"); Statement s=con.createStatement(); Statement s1=con.createStatement(); uname=jTextField2.getText(); String pass=new String(jPasswordField4.getPassword()); ResultSet r=s.executeQuery("select * from id where id ='"+iid+"';"); if(r.next()){ if(r.getString("password").equals(pass)){ } else{JOptionPane.showMessageDialog(null, "wrong password", "error", 0);} } System.out.println(uname); if(image){ PreparedStatement st=con.prepareStatement("update "+u_name+"_profile set img=?;"); FileInputStream t=new FileInputStream(sm); st.setBinaryStream(1, (InputStream)t, (int)sm.length()); st.execute(); } if(email){ String id=jTextField1.getText(); s.executeUpdate("update id set id='"+id+"' where id='"+iid+"';"); } if(user){ s.executeUpdate("update id set u_name='"+uname+"' where u_name='"+u_name+"';"); r=s.executeQuery("select * from "+u_name+";"); while(r.next()){ String friend,type; friend=r.getString(1); type=r.getString(2); s1.executeUpdate("update "+friend+" set member_of='"+uname+"' where member_of='"+u_name+"';"); if(type.equals("friend")){ try{ s1.executeUpdate("alter table msg_"+u_name+"_"+friend+" rename msg_"+uname+"_"+friend+";"); s1.executeUpdate("alter table msg_"+uname+"_"+friend+" change "+u_name+" "+uname+" varchar(40) default 'unread'"); s1.executeUpdate("update msg_"+uname+"_"+friend+" set id='"+uname+"' where id='"+u_name+"';"); } catch(Exception ex){ System.out.println(ex); s1.executeUpdate("alter table msg_"+friend+"_"+u_name+" rename msg_"+friend+"_"+uname+";"); s1.executeUpdate("alter table msg_"+friend+"_"+uname+" change "+u_name+" "+uname+" varchar(40) default 'unread';"); s1.executeUpdate("update msg_"+friend+"_"+uname+" set id='"+uname+"' where id='"+u_name+"';"); }} else{s1.executeUpdate("update "+friend+"_req set requests='"+uname+"' where requests='"+u_name+"';");} s1.executeUpdate("alter table "+u_name+" rename "+uname+";"); s1.executeUpdate("alter table "+u_name+"_profile rename "+uname+"_profile;"); s1.executeUpdate("alter table "+u_name+"_req rename "+uname+"_req;"); } } if(about_me){ String id=jTextArea1.getText(); s.executeUpdate("update "+uname+"_profile set about_me ='"+id+"' where id='"+uname+"';"); } if(password){ pass=new String(jPasswordField1.getPassword());System.out.println("update id set password='"+pass+"' where u_name='"+uname+"';"); String q="update id set password='"+pass+"' where u_name='"+uname+"';"; s1.executeUpdate(q); } my_profile a=new my_profile(); a.u_name=uname; a.setVisible(true); this.dispose(); } catch(Exception e){ System.out.println(e); } }//GEN-LAST:event_jButton1ActionPerformed private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened try{String id,about,pass;byte[] img; Connection con =message.getConnection(); Statement s=con.createStatement(); ResultSet r=s.executeQuery("select * from id where u_name=\""+u_name+"\";"); if(r.next()){ id=r.getString("id"); uname=r.getString("u_name"); jTextField1.setText(id); jTextField2.setText(uname); pass=r.getString("password"); iid=id; } r=s.executeQuery("select * from "+u_name+"_profile;"); if(r.next()){ about=r.getString("about_me"); img=r.getBytes("img"); ImageIcon image = new ImageIcon(new ImageIcon(img).getImage().getScaledInstance(150, 120, Image.SCALE_SMOOTH)); jLabel6.setIcon(image);jTextArea1.append(about); } } catch(Exception e){System.out.println(e);}// TODO add your handling code here: jPasswordField1.setVisible(false); jPasswordField2.setVisible(false); jPasswordField3.setVisible(false); jLabel2.setVisible(false); jLabel3.setVisible(false); jLabel7.setVisible(false); jTextField1.setEnabled(false); jTextField2.setEnabled(false); jTextArea1.setEnabled(false); }//GEN-LAST:event_formWindowOpened private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed jPasswordField3.setVisible(true); jLabel7.setVisible(true); if(password){password=false;jPasswordField3.setVisible(false);jButton5.setName("update password"); jLabel7.setVisible(false);} else{password=true;jButton5.setName("do not update password"); } // TODO add your handling code here: }//GEN-LAST:event_jButton5ActionPerformed private void jPasswordField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPasswordField3ActionPerformed try { Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/messenger?zeroDateTimeBehavior=convertToNull", "root", "root"); Statement s=con.createStatement(); String pass; pass=new String(jPasswordField3.getPassword()); ResultSet r=s.executeQuery("select * from id where id ='"+iid+"';"); if(r.next()){ if(r.getString("password").equals(pass)){ jPasswordField2.setVisible(true); jPasswordField1.setVisible(true); jPasswordField1.setText(""); jPasswordField2.setText(""); jLabel2.setVisible(true); jLabel3.setVisible(true); if(password==false){password=true;} else{password=false; jPasswordField2.setVisible(false); jPasswordField1.setVisible(false); jPasswordField1.setText(""); jPasswordField2.setText(""); jLabel2.setVisible(false); jLabel3.setVisible(false);} } else{JOptionPane.showMessageDialog(null, "wrong password", "error", 0);} } } catch (Exception ex) { System.out.println(ex); } // TODO add your handling code here: }//GEN-LAST:event_jPasswordField3ActionPerformed private void jPasswordField3FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jPasswordField3FocusLost try { Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/messenger?zeroDateTimeBehavior=convertToNull", "root", "root"); Statement s=con.createStatement(); String pass; pass=new String(jPasswordField3.getPassword()); ResultSet r=s.executeQuery("select * from id where id ='"+iid+"';"); if(r.next()){ if(r.getString("password").equals(pass)){ jPasswordField2.setVisible(true); jPasswordField1.setVisible(true); jPasswordField1.setText(""); jPasswordField2.setText(""); jLabel2.setVisible(true); jLabel3.setVisible(true); if(password==false){password=true;} else{password=false; jPasswordField2.setVisible(false); jPasswordField1.setVisible(false); jPasswordField1.setText(""); jPasswordField2.setText(""); jLabel2.setVisible(false); jLabel3.setVisible(false);} } else{JOptionPane.showMessageDialog(null, "wrong password", "error", 0);} } } catch (Exception ex) { System.out.println(ex); } // TODO add your handling code here: }//GEN-LAST:event_jPasswordField3FocusLost private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed jTextArea1.setEnabled(true); if(about_me){about_me=false;jTextField1.setEnabled(false);jButton6.setName("update info");} else{about_me=true;jButton6.setName("do not update info");} // TODO add your handling code here: }//GEN-LAST:event_jButton6ActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed jTextField1.setEnabled(true); if(email){email=false;jTextField1.setEnabled(false);jButton3.setName("update id");} else{email=true;jButton3.setName("do not update id");}// TODO add your handling code here: }//GEN-LAST:event_jButton3ActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed jTextField2.setEnabled(true); if(user){user=false;jTextField2.setEnabled(false);jButton4.setName("update user name");} else{user=true;jButton4.setName("do not update user name");} // TODO add your handling code here: }//GEN-LAST:event_jButton4ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new update_profile().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JFileChooser jFileChooser1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JPanel jPanel1; private javax.swing.JPasswordField jPasswordField1; private javax.swing.JPasswordField jPasswordField2; private javax.swing.JPasswordField jPasswordField3; private javax.swing.JPasswordField jPasswordField4; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; // End of variables declaration//GEN-END:variables }
[ "dhruvmillu02@gmail.com" ]
dhruvmillu02@gmail.com
7892c76465b05e136b3bc28413d62907164bd5f5
75edf9c7d5d1e666135ab0d797a292f9781790b6
/sld_ch_base/release/pagecompile/ish/cartridges/sld_005fch_005fbase/default_/syndication/NewProductBonusPointsMappingRuleFooterInc_jsp.java
31e4637d9a62764dfd6f77d914b42120c45ce54c
[]
no_license
arthurAddamsSiebert/cartridges
7808f484de6b06c98c59be49f816164dba21366e
cc1141019a601f76ad15727af442718f1f6bb6cb
refs/heads/master
2020-06-11T08:58:02.419907
2019-06-26T12:16:31
2019-06-26T12:16:31
193,898,014
0
1
null
2019-11-02T23:33:49
2019-06-26T12:15:29
Java
UTF-8
Java
false
false
6,411
java
/* * Generated by the Jasper component of Apache Tomcat * Version: JspCServletContext/1.0 * Generated at: 2019-02-13 15:29:13 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package ish.cartridges.sld_005fch_005fbase.default_.syndication; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import java.util.*; import java.io.*; import com.intershop.beehive.core.internal.template.*; import com.intershop.beehive.core.internal.template.isml.*; import com.intershop.beehive.core.capi.log.*; import com.intershop.beehive.core.capi.resource.*; import com.intershop.beehive.core.capi.util.UUIDMgr; import com.intershop.beehive.core.capi.util.XMLHelper; import com.intershop.beehive.foundation.util.*; import com.intershop.beehive.core.internal.url.*; import com.intershop.beehive.core.internal.resource.*; import com.intershop.beehive.core.internal.wsrp.*; import com.intershop.beehive.core.capi.pipeline.PipelineDictionary; import com.intershop.beehive.core.capi.naming.NamingMgr; import com.intershop.beehive.core.capi.pagecache.PageCacheMgr; import com.intershop.beehive.core.capi.request.SessionMgr; import com.intershop.beehive.core.internal.request.SessionMgrImpl; import com.intershop.beehive.core.pipelet.PipelineConstants; public final class NewProductBonusPointsMappingRuleFooterInc_jsp extends com.intershop.beehive.core.internal.template.AbstractTemplate implements org.apache.jasper.runtime.JspSourceDependent { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; private javax.el.ExpressionFactory _el_expressionfactory; private org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public void _jspInit() { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } public void _jspDestroy() { } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html;charset=utf-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 0, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; boolean _boolean_result=false; TemplateExecutionConfig context = getTemplateExecutionConfig(); createTemplatePageConfig(context.getServletRequest()); printHeader(out); setEncodingType("text/html"); out.write("</table>"); _boolean_result=false;try {_boolean_result=((Boolean)((disableErrorMessages().isDefined(getObject("CurrentChannelPermissionMap:SLD_SYNDICATE_CATALOGS"))))).booleanValue();} catch (Exception e) {Logger.debug(this,"Boolean expression in line {} could not be evaluated. False returned. Consider using the 'isDefined' ISML function.",4,e);}if (_boolean_result) { out.write("<table class=\"w e s\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td align=\"right\">\n<table border=\"0\" cellspacing=\"4\" cellpadding=\"0\">\n<tr>\n<td class=\"button\">\n<input type=\"hidden\" name=\"ProviderID\" value=\""); {String value = null;try{value=context.getFormattedValue(getObject("ProviderID"),null,null);}catch(Exception e){value=null;Logger.error(this,"ISPRINT has an invalid expression. Returning empty string. Line: {11}",e);}if (value==null) value="";value = encodeString(value);out.write(value);} out.write("\"/>\n<input type=\"hidden\" name=\"TypeCode\" value=\""); {String value = null;try{value=context.getFormattedValue(getObject("SourceDeclaration:TypeCode"),null,null);}catch(Exception e){value=null;Logger.error(this,"ISPRINT has an invalid expression. Returning empty string. Line: {12}",e);}if (value==null) value="";value = encodeString(value);out.write(value);} out.write("\"/>\n<input type=\"hidden\" name=\"ProductDataDeclarationID\" value=\""); {String value = null;try{value=context.getFormattedValue(getObject("SourceDeclaration:UUID"),null,null);}catch(Exception e){value=null;Logger.error(this,"ISPRINT has an invalid expression. Returning empty string. Line: {13}",e);}if (value==null) value="";value = encodeString(value);out.write(value);} out.write("\"/>\n<input type=\"submit\" name=\"create_bonus_points_rule\" value=\""); out.print(context.getFormattedValue(localizeText(context.getFormattedValue("NewProductBonusPointsMappingRuleFooterInc.Apply.button",null)),null)); out.write("\" class=\"button\"/>\n</td>\n<td class=\"button\">\n<input type=\"reset\" name=\"reset\" value=\""); out.print(context.getFormattedValue(localizeText(context.getFormattedValue("NewProductBonusPointsMappingRuleFooterInc.Reset.button",null)),null)); out.write("\" class=\"button\"/>\n</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>"); } printFooter(out); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { out.clearBuffer(); } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }
[ "root@Inteshoppa1v11.yyrtatjsacuefh5ihlz5gkzqpd.ax.internal.cloudapp.net" ]
root@Inteshoppa1v11.yyrtatjsacuefh5ihlz5gkzqpd.ax.internal.cloudapp.net
0975bd87d7e9b0d1c96a72285a21be72d1e7e8a8
2b3c6278b935a3fc3641f2e78627b139a27e9869
/src/flight/package-info.java
6bd4e3c9e984a7cc7be08e29b888e53a39609feb
[]
no_license
kmart8/FrequentFliers
cded51cf79ad5cde7100cb54d86a9ae83f727226
d13087759b53da63fd9a5b88f3e618c1da66835b
refs/heads/master
2021-04-18T16:46:46.616027
2020-05-09T03:10:00
2020-05-09T03:10:00
249,563,813
1
0
null
null
null
null
UTF-8
Java
false
false
229
java
/** * Classes which handle Flights. * * Handles the Flight class, the array list Flights, and the Flight Manager. * * @author William Keenan, Chris Collins * @version 1.0 2020-05-06 * @since 2020-04-30 */ package flight;
[ "wjkeenan@wpi.edu" ]
wjkeenan@wpi.edu
cc9163730a98eb2772b3335379497b475afd2747
3e29b79a75f5c0109c62613700cb750d9fbbf952
/WeekBExample/src/com/revature/example/User.java
ca5cb0a8698fcf0acd8634c1affbe5e6c9f850aa
[]
no_license
LuckyOwlBen/Portfolio
10521b6bf6ad59733e598ce0302f6f957d13d3c0
04209e3a9b42782fb011bd6c5aeddf8a64f8b47b
refs/heads/master
2021-07-18T19:11:48.932087
2019-10-10T18:00:32
2019-10-10T18:00:32
211,872,063
0
0
null
2020-09-07T13:19:13
2019-09-30T13:55:10
Java
UTF-8
Java
false
false
2,288
java
package com.revature.example; public class User { public User(String firstName, String lastName, String userName, String passWord) { super(); this.firstName = firstName; this.lastName = lastName; this.userName = userName; this.passWord = passWord; } private String firstName; private String lastName; private String userName; private String passWord; public User() { super(); } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getPassWord() { return passWord; } public void setPassWord(String passWord) { this.passWord = passWord; } @Override public String toString() { return "User [firstName=" + firstName + ", lastName=" + lastName + ", userName=" + userName + ", passWord=" + passWord + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((firstName == null) ? 0 : firstName.hashCode()); result = prime * result + ((lastName == null) ? 0 : lastName.hashCode()); result = prime * result + ((passWord == null) ? 0 : passWord.hashCode()); result = prime * result + ((userName == null) ? 0 : userName.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; User other = (User) obj; if (firstName == null) { if (other.firstName != null) return false; } else if (!firstName.equals(other.firstName)) return false; if (lastName == null) { if (other.lastName != null) return false; } else if (!lastName.equals(other.lastName)) return false; if (passWord == null) { if (other.passWord != null) return false; } else if (!passWord.equals(other.passWord)) return false; if (userName == null) { if (other.userName != null) return false; } else if (!userName.equals(other.userName)) return false; return true; } }
[ "benmalmberg2@gmail.com" ]
benmalmberg2@gmail.com
c76e63d65e4e417b1d70641969c347d1e3679ab3
1637b50b1eebe3ac6aacfdfbede9d029e6fbbd06
/src/java/edu/uci/ics/hyracks/imru/elastic/swap/SwapTargetRequest.java
dbdf35199dc8774abe270c64213b0acfb2bda987
[]
no_license
dbgroup-at-ucsc/imru
2cb205d083a5776badf7f166436796bdf4bd64cc
4144aeae60d143472beda70cfc74edd4dbd19ee7
refs/heads/master
2021-01-23T13:18:29.874892
2014-02-07T06:58:32
2014-02-07T06:58:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
724
java
package edu.uci.ics.hyracks.imru.elastic.swap; import java.io.Serializable; public class SwapTargetRequest extends DynamicCommand { public int outgoingPartitionOfSender; public int newTargetPartition; public int[] incompeleteIncomingPartitions; // of this partition @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("up=" + outgoingPartitionOfSender + ", target=" + newTargetPartition + ", children=["); if (incompeleteIncomingPartitions != null) { for (int i : incompeleteIncomingPartitions) sb.append(i + ","); } sb.append("]"); return "Swap " + sb.toString(); } }
[ "rwang.me@gmail.com" ]
rwang.me@gmail.com
b602f7eef9ed4feeca073639067665833f01ed99
2962610d726e3c4eddb8fee0ecbd896c94ff79ec
/src/springbook/user/sqlservice/HashMapSqlRegistry.java
f650062bb77e24823d1c25be467e1fb63919a59a
[]
no_license
gramman75/springbook
28003324cac49538f58ece8637e1c85371879781
dc5a94d33197550cced701bc7153e9602e889f6c
refs/heads/master
2021-01-22T09:48:18.968507
2016-08-09T12:41:23
2016-08-09T12:41:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
528
java
package springbook.user.sqlservice; import java.util.HashMap; import java.util.Map; public class HashMapSqlRegistry implements SqlRegistry { private Map<String, String> sqlMap = new HashMap<String, String>(); @Override public void registerSql(String key, String sql) { sqlMap.put(key, sql); } @Override public String findSql(String key) throws SqlNotFoundException { String sql = sqlMap.get(key); if (sql == null){ throw new SqlNotFoundException(key + "is not found"); } else{ return sql; } } }
[ "gramman75@gmail.com" ]
gramman75@gmail.com
a653f1acd5a98df272dacb7b52647ed90be2ed26
6aa9d7704cb02eacdfd91d0ffda21e25e2b75ee1
/src/main/java/com/example/entity/Guest.java
a97622c7400746eb9ec246e4ce0a7ba87dba129c
[]
no_license
mapimienta/Learning-Spring-with-Spring-Boot
f692dde5bc6d5a0b96fdfd09ae7bba1dd79b6695
de93eb1a5e366cc82a80c35e0e0d96952514d51f
refs/heads/master
2021-06-15T07:50:38.428760
2017-03-23T00:46:53
2017-03-23T00:46:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,026
java
package com.example.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="GUEST") public class Guest { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="GUEST_ID") private long id; @Column(name="FIRST_NAME") private String firstName; @Column(name="LAST_NAME") private String lastName; @Column(name="EMAIL_ADDRESS") private String emailAddress; @Column(name="ADDRESS") private String address; @Column(name="COUNTRY") private String country; @Column(name="STATE") private String state; @Column(name="PHONE_NUMBER") private String phoneNumber; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmailAddress() { return emailAddress; } public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } }
[ "selin@selin-mn1.linkedin.biz" ]
selin@selin-mn1.linkedin.biz
999d3db9983a648511c3d0416a92ba66e397e3ce
1b1915c52a96dea465f2d823cdad46432adf7e4f
/src/main/java/com/fererlab/pattern/behavioral/state/FanOffState.java
22ef6f31233cc84676a5c1c69663601986c8efeb
[ "MIT" ]
permissive
canmogol/design-patterns
d90bf07a29ce57ebbb20a2a743b4eb6ea8adf963
16146bd7425afd554418db0d421937738595561a
refs/heads/master
2022-07-09T11:49:25.275404
2021-04-27T20:17:35
2021-04-27T20:17:35
52,745,546
1
0
MIT
2022-06-29T19:16:14
2016-02-28T21:33:42
Java
UTF-8
Java
false
false
417
java
package com.fererlab.pattern.behavioral.state; public class FanOffState extends State { private final Fan fan; public FanOffState(Fan fan) { this.fan = fan; } @Override public void handleRequest() { System.out.println("Turning fan on to low"); fan.setState(fan.getFanLowState()); } @Override public String toString() { return "Fan is off"; } }
[ "canmogol@gmail.com" ]
canmogol@gmail.com
dc25d2d656e39ca8b52e610a6240fa1fba7fa806
1d9d9a16447ccfb9d015805c327e90a92fbee688
/OOP/src/tute4/Account.java
152c7730af41aa8fed8537f169fb69654ba6efcc
[]
no_license
SChanakyax/OOP
6cc5fcb4b0de3dba55cf70c79131be53b393659a
dfab8ddade0105f3320924d014540da50e02cc96
refs/heads/master
2023-04-12T04:04:40.310513
2021-05-18T12:30:29
2021-05-18T12:30:29
368,521,788
0
0
null
null
null
null
UTF-8
Java
false
false
562
java
package tute4; public abstract class Account { private String accNo; protected String name; protected double balance; public Account() { } public Account(String accNo, String name, double balance) { this.accNo = accNo; this.name = name; this.balance = balance; } public void Deposit(double de) { this.balance += de; } public abstract double calculateInterest(); public void display() { System.out.println("AccNo : " + this.accNo + " name : " + this.name + " Balance : " + this.balance); } }
[ "chanakyachana@gmail.com" ]
chanakyachana@gmail.com
d39064c479a866477afe4fe8cfd229a9c355375c
522fa4e624fc706b7634cbba60fc2e237050e47e
/src/EasyDateAI.java
efa1dac5e551c2c975e9d1c90d99429f39cdc759
[]
no_license
aryaninamdar/AP_Computer_Science
65fd91bff30145170ba93c18bcfff59b75a9aba6
837ef1c46c65db5c5089b444258ab9196af461d4
refs/heads/master
2023-06-02T04:14:29.849126
2021-06-18T19:03:32
2021-06-18T19:03:32
378,242,276
0
0
null
null
null
null
UTF-8
Java
false
false
3,998
java
/** * EasyDate * * @author Aryan Inamdar * @version 2/6/21 */ public class EasyDateAI { private int month; private int day; private int year; EasyDateAI myBirthday = new EasyDateAI(5, 18, 2005); EasyDateAI momBirthday = new EasyDateAI(4, 22, 1976); EasyDateAI todayDate = new EasyDateAI(2, 6, 2021); /** default constructor * sets month to 1, day to 1 and year to 2000 */ public EasyDateAI( ) { setDate( 1, 1, 2000 ); } /** overloaded constructor * @param mm initial value for month * @param dd initial value for day * @param yyyy initial value for year * * passes parameters to set methods */ public EasyDateAI( int mm, int dd, int yyyy ) { setMonth( mm ); setYear( yyyy ); setDay( dd ); } /* accessor methods ============*/ int getMonth( ) { return month; } int getDay( ) { return day; } int getYear( ) { return year; } /* mutator methods ================== */ /** * Method setMonth * * @param mm. If mm is between 1 and 12, * sets month to mm */ public void setMonth( int mm ) { month = ( mm >= 1 && mm <= 12 ? mm : month ); } /** setDay * @param dd new value for day * if dd is legal day for current month, sets day to dd */ public void setDay( int dd ) { day = ( dd >= 1 && isValidDay( dd ) ? dd : day ); } /** setYear * @param yyyy new value for year * sets year to yyyy */ public void setYear( int yyyy ) { year = yyyy; } /** sets date to the next day */ public void nextDay( ) { if ( ! isValidDay( ++day ) ) { day = 1; if ( ++month > 12 ) { month = 1; year++; } } } private boolean isValidDay( int newDay ) { int [] daysInMonth = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; if ( newDay > daysInMonth[month] ) { if ( month == 2 && isLeapYear( ) && newDay == 29 ) return true; else return false; } else return true; } private boolean isLeapYear( ) { return !( year % 4 != 0 ||( year % 100 == 0 && year % 400 != 0 ) ); } /** setDate * @param mm new value for month * @param dd new value for day * @param yyyy new value for year * passes parameters to setMonth, setDay, and setYear */ public void setDate( int mm, int dd, int yyyy ) { setYear( yyyy ); // set year first (could be leap year) setMonth( mm ); // set month next setDay( dd ); // set day } /** toString * @return String * returns date in mm/dd/yyyy format */ public String toString( ) { return month + "/" + day + "/" + year; } /** equals * @param d Object to compare to this object * @return true if d is equal to this object * false, otherwise */ public boolean equals( Object d ) { if ( !( d instanceof EasyDateAI ) ) return false; EasyDateAI d1 = (EasyDateAI)d; if ( month == d1.month && day == d1.day && year == d1.year ) return true; else return false; } /** * Method prevDay * and adjusts month and year if needed * 210126 */ public void prevDay( ) { int[] daysInMonth = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; if (--day < 1) { if (--month < 1) { month = 12; year--; } day = daysInMonth[month]; } } }
[ "65751549+aryaninamdar@users.noreply.github.com" ]
65751549+aryaninamdar@users.noreply.github.com
5b80fc863c5f79fcb2d1a93d0a44605dfa3645fa
00018d4240f1285a4b5b79701f8aebd3d9cde318
/kafka_producer/src/main/java/ClassZ.java
34f134c4305c97dd3600c9ba96bff48e28061fd1
[]
no_license
BoraOrkun/kafka
ac07d321e047c57b17df3332062f0f0ad994fa2e
eae93a776d9b9caa5740f3e4d9fddd95ad531220
refs/heads/master
2023-04-01T14:31:36.686166
2021-03-31T20:13:27
2021-03-31T20:13:27
353,476,401
0
0
null
null
null
null
UTF-8
Java
false
false
476
java
public class ClassZ { private Integer key; private Integer value; public ClassZ() { } public ClassZ(Integer key, Integer value) { this.key = key; this.value = value; } public Integer getKey() { return key; } public void setKey(Integer key) { this.key = key; } public Integer getValue() { return value; } public void setValue(Integer value) { this.value = value; } }
[ "boorkun@gmail.com" ]
boorkun@gmail.com
54abd2e02f6858716c052df41bc083e754b6dd2d
58da62dfc6e145a3c836a6be8ee11e4b69ff1878
/src/main/java/com/alipay/api/domain/MiniAppVersionQueryInfo.java
bc1a05b1d3a1796bbc328fe7ec0807a43897a2e2
[ "Apache-2.0" ]
permissive
zhoujiangzi/alipay-sdk-java-all
00ef60ed9501c74d337eb582cdc9606159a49837
560d30b6817a590fd9d2c53c3cecac0dca4449b3
refs/heads/master
2022-12-26T00:27:31.553428
2020-09-07T03:39:05
2020-09-07T03:39:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
589
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 100 * * @author auto create * @since 1.0, 2018-12-17 17:25:52 */ public class MiniAppVersionQueryInfo extends AlipayObject { private static final long serialVersionUID = 8534781492196975251L; /** * 小程序版本号 */ @ApiField("app_version") private String appVersion; public String getAppVersion() { return this.appVersion; } public void setAppVersion(String appVersion) { this.appVersion = appVersion; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
96c5ef697585a7bddc4743f47b549ca89cdb238f
d82451d18cca1fbe641058098bbeb40e4e44e08f
/day08-code/src/cn/itcast/day08/demo02/Demo07StringCount.java
f1ef2bf9c65fb84433e4dbbe04ac039def1b98d7
[]
no_license
NeilyoSummer/JavaNotes
54fc3fdadb5444af96b0364490a12c11342510cc
0952b703a03899c43e5dfa4d550184b8009c1240
refs/heads/master
2020-04-06T16:43:01.721648
2018-11-24T09:34:44
2018-11-24T09:34:44
157,631,452
0
0
null
null
null
null
UTF-8
Java
false
false
1,757
java
package cn.itcast.day08.demo02; import java.util.Scanner; /* 题目: 键盘输入一个字符串,并且统计其中各种字符串出现的次数。 种类:大写字母、小写字母、数字、其他 思路: 1. 既然用到键盘输入,肯定是Scanner 2. 键盘输入的是字符串,那么String str = sc.next(); 3. 定义四个变量,分别代表四种字符各自的出现次数。 4. 需要对字符串一个字、一个字检查;String -> char[],方法就是toCharArray() 5. 遍历char[]字符数组,对向前字符的种类进行判断,并且用四个变量进行++动作。 */ public class Demo07StringCount { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("请输入一个字符串:"); String input = sc.next(); //获取键盘输入的一个字符串 int countUpper = 0; // 大写字母 int countLower = 0; // 小写字母 int countNumber = 0; // 数字 int countOther = 0; // 其他字符 char[] charArray = input.toCharArray(); for (int i = 0; i < charArray.length; i++) { char ch = charArray[i]; if ('A' <= ch && ch <= 'Z') { countUpper++; } else if('a' <= ch && ch <= 'z') { countLower++; } else if('0' <= ch && ch <= '9') { countNumber++; } else { countOther++; } } System.out.println("大写字母有:" + countUpper); System.out.println("小写字母有:" + countLower); System.out.println("数字有:" + countNumber); System.out.println("其他有:" + countOther); } }
[ "alexskywin@163.com" ]
alexskywin@163.com
28e202f5239e46bbd7e96afce560aa139b460d4e
59b47c39aca8e7cd58af0f7af82b1bb6e8ab9d10
/controllers/src/main/java/com/netcracker/ruslan/controllers/AdminController.java
54d0c774b247b1bd68fd74e58d7943de8a38aba3
[]
no_license
RuslanClay/RUSLAN_SITARIS
70f4c17d8626e0fa346c00eb75da14b08184ea0c
096fbcdf9fcfaf6e0182d18f0f993025f84b6703
refs/heads/master
2023-04-29T11:06:31.697391
2021-05-07T13:16:26
2021-05-07T13:16:26
365,238,054
0
0
null
null
null
null
UTF-8
Java
false
false
4,516
java
package com.netcracker.denisik.controllers; import com.netcracker.denisik.entity.*; import com.netcracker.denisik.repository.*; import com.netcracker.denisik.services.DBFileService; import com.netcracker.denisik.services.RoomService; import com.netcracker.denisik.services.ServicesService; import lombok.Setter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.util.HashSet; import java.util.Set; @Controller @RequestMapping("/admin") @Setter(onMethod_ = @Autowired) public class AdminController { private CarRepository carRepository; private ServicesService servicesService; private RoomService roomService; private TypeRoomRepository typeRoomRepository; private DBFileRepository fileRepository; private DBFileService dbFileService; private FacilitiesRepository facilitiesRepository; private RoomRepository roomRepository; @GetMapping("/addEntity") @PreAuthorize("hasAuthority('ADMIN')") public String addEntity(){ return "admin/addEntity"; } @PostMapping("/addCar") @PreAuthorize("hasAuthority('ADMIN')") public String addCar(@RequestParam String mark, @RequestParam Integer price){ Car car = new Car(); car.setMark(mark); car.setPrice(price); car.setCarStatus(CarStatus.FREE); carRepository.save(car); return "redirect:/admin/addEntity"; } @PostMapping(value = "/addService") @PreAuthorize("hasAuthority('ADMIN')") public String addService(@RequestParam String name, @RequestParam Integer price){ servicesService.addService(name,price); return "redirect:/admin/addEntity"; } @PostMapping("/addRoom") @PreAuthorize("hasAuthority('ADMIN')") public String addRoom(@RequestParam Integer costDay,@RequestParam Integer numSeats, @RequestParam Long typeId){ TypeRoom typeRoom = typeRoomRepository.findOne(typeId); roomService.addRoom(costDay, numSeats, typeRoom); return "redirect:/admin/addEntity"; } @PostMapping("/addTypeRoom") @PreAuthorize("hasAuthority('ADMIN')") public String addTypeRoom(@RequestParam String name, @RequestParam MultipartFile[] picture) throws Exception { if(!typeRoomRepository.existsByTypeRoom(name)){ TypeRoom typeRoom = new TypeRoom(); typeRoom.setTypeRoom(name); Set<DBFile> files = new HashSet<>(); for (MultipartFile pic: picture ) { DBFile file = new DBFile(); file.setData(pic.getBytes()); file.setFileType(pic.getContentType()); file.setFileName(pic.getOriginalFilename()); dbFileService.save(file); files.add(file); } typeRoom.setPictures(files); typeRoomRepository.save(typeRoom); } else { throw new Exception("TypeRoom with such name already exists"); } return "admin/addEntity"; } @PostMapping("/addFacility") @PreAuthorize("hasAuthority('ADMIN')") public String addFacility(@RequestParam String name){ Facilities facilities = new Facilities(); facilities.setFacility(name); facilitiesRepository.save(facilities); return "admin/addEntity"; } @PostMapping("/bindFacilityAndType") @PreAuthorize("hasAuthority('ADMIN')") public String bindFacilities(@RequestParam Long fId,@RequestParam Long tId) throws Exception { Facilities facilities = facilitiesRepository.findOne(fId); TypeRoom typeRoom = typeRoomRepository.findOne(tId); if(facilities != null && typeRoom != null){ facilities.getTypeRoomSet().add(typeRoom); typeRoom.getFacilitiesSet().add(facilities); facilitiesRepository.save(facilities); typeRoomRepository.save(typeRoom); } else { throw new Exception("not found"); } return "admin/addEntity"; } @PostMapping("/deleteRoom") @PreAuthorize("hasAuthority('ADMIN')") public String deleteRoom(@RequestParam Long roomId) { Room room = roomRepository.findOne(roomId); room.setIsActive(false); roomRepository.save(room); return "redirect:/hotel"; } }
[ "glinistyr@mail.ru" ]
glinistyr@mail.ru
5054eba9c78f88fff55b73401ed26a7057152967
95effc68ec6b24ad41297376ff89f05f92fbb062
/src/test/java/com/yandex/money/test/FeeTest.java
f1e6714f0cb290e27283849e191d76506f75098a
[ "MIT" ]
permissive
tsirkunov/yandex-money-sdk-java
73af73f8111f1b78cc8b774acaad4ef0278093e0
3c4e8f468b5986432e152626e86d66e63af31f24
refs/heads/master
2021-01-18T06:20:06.517470
2015-09-04T10:59:13
2015-09-04T10:59:13
42,990,476
0
1
null
2015-09-23T09:09:16
2015-09-23T09:09:15
null
UTF-8
Java
false
false
7,065
java
/* * The MIT License (MIT) * * Copyright (c) 2015 NBCO Yandex.Money LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.yandex.money.test; import com.yandex.money.api.exceptions.IllegalAmountException; import com.yandex.money.api.model.showcase.AmountType; import com.yandex.money.api.model.showcase.Fee; import com.yandex.money.api.model.showcase.StdFee; import org.testng.Assert; import org.testng.annotations.Test; import java.math.BigDecimal; public final class FeeTest { @Test public void testNegativeNetAmount() { final Fee fee = new StdFee(new BigDecimal("0.03"), new BigDecimal("15.00"), BigDecimal.ZERO, null, AmountType.AMOUNT); // 15.01 is minimum amount try { Assert.assertEquals(fee.netAmount(new BigDecimal("15.00")), new BigDecimal("0.01")); Assert.assertTrue(false, "Test failed."); } catch (IllegalAmountException e) { Assert.assertEquals(e.minimumAmount, new BigDecimal("15.01")); } try { Assert.assertEquals(fee.netAmount(new BigDecimal("0.02")), new BigDecimal("0.01")); Assert.assertTrue(false, "Test failed."); } catch (IllegalAmountException e) { Assert.assertEquals(e.minimumAmount, new BigDecimal("15.01")); } } @Test public void testMinimalNetAmount() throws IllegalAmountException { final Fee fee = new StdFee(new BigDecimal("0.03"), new BigDecimal("15.00"), BigDecimal.ZERO, null, AmountType.AMOUNT); Assert.assertEquals(fee.amount(new BigDecimal("0.05")), new BigDecimal("15.05")); Assert.assertEquals(fee.netAmount(new BigDecimal("15.46")), new BigDecimal("0.45")); Assert.assertEquals(fee.netAmount(new BigDecimal("15.01")), new BigDecimal("0.01")); } @Test public void testNoCommission() throws IllegalAmountException { final BigDecimal amount = new BigDecimal("0.099"); final Fee fee = new StdFee(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, null, AmountType.AMOUNT); Assert.assertEquals(amount, fee.amount(amount)); Assert.assertEquals(amount, fee.netAmount(amount)); } @Test public void testAPercent() throws IllegalAmountException { final Fee fee = new StdFee(new BigDecimal("0.005"), BigDecimal.ZERO, BigDecimal.ZERO, null, AmountType.AMOUNT); test("100.50", "100.00", fee); test("0.02", "0.01", fee); } @Test public void testBFixedCommission() throws IllegalAmountException { test("115.00", "100.00", new StdFee(BigDecimal.ZERO, new BigDecimal("15.00"), BigDecimal.ZERO, null, AmountType.AMOUNT)); test("15.01", "0.01", new StdFee(BigDecimal.ZERO, new BigDecimal("15.00"), BigDecimal.ZERO, null, AmountType.AMOUNT)); test("1.01", "1.00", new StdFee(BigDecimal.ZERO, new BigDecimal("0.001"), BigDecimal.ZERO, null, AmountType.AMOUNT)); } @Test public void testCMinCommission() throws IllegalAmountException { test("115.00", "100.00", new StdFee(BigDecimal.ZERO, BigDecimal.ZERO, new BigDecimal("15.00"), null, AmountType.AMOUNT)); test("15.01", "0.01", new StdFee(BigDecimal.ZERO, BigDecimal.ZERO, new BigDecimal("15.00"), null, AmountType.AMOUNT)); test("1.01", "1.00", new StdFee(BigDecimal.ZERO, BigDecimal.ZERO, new BigDecimal("0.001"), null, AmountType.AMOUNT)); test("100.60", "100.00", new StdFee(new BigDecimal("0.005"), BigDecimal.ZERO, new BigDecimal("0.60"), null, AmountType.AMOUNT)); } @Test public void testDMaxCommission() throws IllegalAmountException { test("100.04", "100.00", new StdFee(new BigDecimal("0.005"), BigDecimal.ZERO, BigDecimal.ZERO, new BigDecimal("0.04"), AmountType.AMOUNT)); test("100.01", "100.00", new StdFee(new BigDecimal("0.005"), BigDecimal.ZERO, BigDecimal.ZERO, new BigDecimal("0.004"), AmountType.AMOUNT)); } @Test public void testRounding() throws IllegalAmountException { // провоцируем периодические дроби test("3.44", "3.33", new StdFee(new BigDecimal("0.0333"), BigDecimal.ZERO, BigDecimal.ZERO, null, AmountType.AMOUNT)); test("5.30", "5.00", new StdFee(new BigDecimal("0.06"), BigDecimal.ZERO, BigDecimal.ZERO, null, AmountType.AMOUNT)); } /** * Тест по контольным значениям ТК 01-24549 из testlink */ @Test public void testP2p() throws IllegalAmountException { final Fee fee = new StdFee(new BigDecimal("0.005"), BigDecimal.ZERO, BigDecimal.ZERO, null, AmountType.AMOUNT); test("3.02", "3.00", fee); test("1005.00", "1000.00", fee); test("0.02", "0.01", fee); test("1010.03", "1005.00", fee); test("1004.99", "999.99", fee); test("1010.01", "1004.99", fee); test("1000.00", "995.02", fee); test("1010.06", "1005.03", fee); test("999.98", "995.00", fee); Assert.assertEquals(fee.netAmount(new BigDecimal("3.01")), new BigDecimal("3.00")); Assert.assertEquals(fee.netAmount(new BigDecimal("1005.03")), new BigDecimal("1000.03")); Assert.assertEquals(fee.amount(new BigDecimal("1005.00")), new BigDecimal("1010.03")); Assert.assertEquals(fee.amount(new BigDecimal("995.00")), new BigDecimal("999.98")); Assert.assertEquals(fee.netAmount(new BigDecimal("999.97")), new BigDecimal("995.00")); } private void test(String amount, String netAmount, Fee fee) throws IllegalAmountException { BigDecimal bAmount = new BigDecimal(amount); BigDecimal bNetAmount = new BigDecimal(netAmount); Assert.assertEquals(fee.amount(bNetAmount), bAmount); Assert.assertEquals(fee.netAmount(bAmount), bNetAmount); } }
[ "vyasevich@yamoney.ru" ]
vyasevich@yamoney.ru
db39b29ff483a6d876448adabc290eff264a7862
ab57622a2ab5ab5f7cb19659eb50d353d27d7474
/toolchain/symo4pd.toolchain.docgen/src/symo4pd/toolchain/docgen/handler/DocGenHandler.java
624e12fb8aa23760815c132ee3a46624461f3b57
[]
no_license
AxelBerres/SYMO4PD
07cd36b1ec887ea121df7f2e73fbfcc84a617ab2
184af7c22248ba8b987afbc9e176df729f11a30e
refs/heads/master
2020-04-15T15:50:28.837810
2019-04-12T18:12:59
2019-04-12T18:12:59
44,385,565
0
0
null
null
null
null
UTF-8
Java
false
false
2,481
java
package symo4pd.toolchain.docgen.handler; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.emf.codegen.ecore.genmodel.GenModel; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.ui.handlers.HandlerUtil; import symo4pd.toolchain.docgen.EcoreDocGenerator; import symo4pd.toolchain.docgen.exception.DocGeneratorException; /** * The {@link DocGenHandler} is the command handler for the * {@link symo4pd.toolchain.codegen.generatecommand} and therefore, entry point * of this plug-in. It opens a {@link DirectoryDialog} for choosing the * directory, where the model documentation is generated. Further, the selected * {@link GenModel} is passed to the {@link EcoreDocGenerator}. * * @author Michael.Shamiyeh * */ public class DocGenHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { // Create dialog to select the documentation directory: FileDialog fileDialog = new FileDialog(HandlerUtil.getActiveShell(event), SWT.SAVE); fileDialog.setText("Select Documentation File"); fileDialog.setFilterNames(new String[] { "Text Files", "All Files (*.*)" }); fileDialog.setFilterExtensions(new String[] { "*.txt", "*.*" }); fileDialog.setFileName("ecore_doc.txt"); String fileDirectory = fileDialog.open(); if (fileDirectory != null && !fileDirectory.isEmpty()) { // Get the selected GenModel instance: IStructuredSelection selection = (IStructuredSelection)HandlerUtil.getCurrentSelection(event); GenModel selectedGenModel = (GenModel)selection.getFirstElement(); // Start the documentation generation process: try { EcoreDocGenerator.getInstance().generate(fileDirectory, selectedGenModel); new MessageDialog(HandlerUtil.getActiveShell(event), "Doc-Generator", null, "Documentation file successfully generated!", MessageDialog.INFORMATION, new String[] {"OK"}, 0).open(); } catch (DocGeneratorException e) { new MessageDialog(HandlerUtil.getActiveShell(event), "Doc-Generator", null, "Documentation could not be generated:\\n" + e.getMessage(), MessageDialog.ERROR, new String[] {"OK"}, 0).open(); e.printStackTrace(); } } return null; } }
[ "michael.shamiyeh@bauhaus-luftfahrt.net" ]
michael.shamiyeh@bauhaus-luftfahrt.net
a51ecfe4a23bb07261fc9c257ef6ace72df2276e
79f807e9c34f29a398b6a9417ddc9a3f6ec042db
/src/main/java/br/databasereports/entity/Professor.java
95c40a102cbc7b4b5c1f946499e143267bc46102
[]
no_license
profgenesislima/DatabaseReportsAPI
b54190cb82e48626c427126550f5ed3bf9771a7f
ba050f0cfd4cc615982fd4f5df5d1ee1673624e3
refs/heads/master
2022-06-21T23:51:10.527339
2019-06-06T00:19:53
2019-06-06T00:19:53
181,354,905
0
0
null
2020-10-13T12:59:31
2019-04-14T18:55:20
Java
UTF-8
Java
false
false
172
java
package br.databasereports.entity; import lombok.Data; @Data public class Professor { private int codigo; private String nome; private Faculdade faculdade; }
[ "profgenesislima@gmail.com" ]
profgenesislima@gmail.com
d91cc026bd92c159f569a873b4773f26949b7a4b
83148140a1bf76077a7e9f71d424b5108edfc453
/QuickestPhoneBooster/app/src/main/java/utility/quickest/phonebooster/util/ThreadUtil.java
b3af72eb9c8c82d618ef4a93909b22c2cb8b98f9
[]
no_license
kotdark/clone_phone_booster
adcf593aae69cd5dc3b070bf8072c6a1006ba58d
8b6d84055739b1269ce64e1d59c7f4bc0adbcd88
refs/heads/master
2020-03-17T13:24:03.837851
2018-05-18T07:10:44
2018-05-18T07:10:44
133,630,146
1
0
null
null
null
null
UTF-8
Java
false
false
5,916
java
package utility.quickest.phonebooster.util; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; import android.text.TextUtils; import com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor; import com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor.UncaughtThrowableStrategy; import java.util.concurrent.Future; import java.util.concurrent.FutureTask; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /* compiled from: ThreadUtil */ public final class ThreadUtil { private static final Handler f14715a = new Handler(Looper.getMainLooper()); private static final ThreadPoolExecutor f14716b = new ThreadPoolExecutor(1, 1, 30, TimeUnit.SECONDS, new LinkedBlockingQueue(), new C2545q()); private static final ThreadPoolExecutor f14717c = new ThreadPoolExecutor(1, 1, 30, TimeUnit.SECONDS, new LinkedBlockingQueue(), new C2546r()); private static final ThreadPoolExecutor f14718d = new ThreadPoolExecutor(5, 5, 30, TimeUnit.SECONDS, new LinkedBlockingQueue(), new C2547s()); private static final ThreadPoolExecutor f14719e = new FifoPriorityThreadPoolExecutor(3, 3, 30, TimeUnit.SECONDS, new C2548t(), UncaughtThrowableStrategy.IGNORE); private static final ThreadPoolExecutor f14720f = new FifoPriorityThreadPoolExecutor(5, 5, 30, TimeUnit.SECONDS, new C2549u(), UncaughtThrowableStrategy.IGNORE); private static final HandlerThread f14721g = new HandlerThread("CalculateTemperature"); private static volatile Handler f14722h = null; private static final HandlerThread f14723i = new HandlerThread("CalculateBattery"); private static volatile Handler f14724j = null; private static final ThreadPoolExecutor f14725k = new ThreadPoolExecutor(1, 1, 30, TimeUnit.SECONDS, new LinkedBlockingQueue(), new C2550v()); private static final ThreadPoolExecutor f14726l = new ThreadPoolExecutor(1, 1, 30, TimeUnit.SECONDS, new LinkedBlockingQueue(), new C2551w()); private static final HandlerThread f14727m = new HandlerThread("FetchSwitch"); private static volatile Handler f14728n = null; static { f14716b.allowCoreThreadTimeOut(true); f14717c.allowCoreThreadTimeOut(true); f14718d.allowCoreThreadTimeOut(true); f14719e.allowCoreThreadTimeOut(true); f14720f.allowCoreThreadTimeOut(true); f14721g.start(); f14723i.start(); f14725k.allowCoreThreadTimeOut(true); f14726l.allowCoreThreadTimeOut(true); f14727m.start(); } public static boolean m19100a() { return Looper.myLooper() == Looper.getMainLooper(); } public static void m19102b() { } public static void m19099a(boolean z, Runnable runnable) { if (runnable != null) { if (z || !ThreadUtil.m19100a()) { f14715a.post(runnable); } else { runnable.run(); } } } public static void m19098a(Runnable runnable, long j) { if (runnable != null) { if (j < 0) { j = 0; } f14715a.postDelayed(runnable, j); } } public static Future<?> m19097a(String str, Runnable runnable) { if (runnable == null) { throw new IllegalArgumentException("runnable is null!"); } if (str != null) { str = str.trim(); } FutureTask futureTask = new FutureTask(new C2552x(runnable, 0, null)); if (TextUtils.isEmpty(str)) { str = "UnknownThread"; } new Thread(futureTask, str).start(); return futureTask; } public static Future<?> m19096a(Runnable runnable) { if (runnable != null) { return f14716b.submit(new C2552x(runnable, 0, null)); } throw new IllegalArgumentException("runnable is null!"); } public static Future<?> m19101b(Runnable runnable) { if (runnable != null) { return f14717c.submit(new C2552x(runnable, 0, null)); } throw new IllegalArgumentException("runnable is null!"); } public static Future<?> m19103c(Runnable runnable) { if (runnable != null) { return f14718d.submit(new C2552x(runnable, 0, null)); } throw new IllegalArgumentException("runnable is null!"); } public static ThreadPoolExecutor m19104c() { return f14719e; } public static ThreadPoolExecutor m19106d() { return f14720f; } public static Handler m19107e() { if (f14722h == null) { synchronized (f14721g) { if (f14722h == null) { f14722h = new Handler(f14721g.getLooper()); } } } return f14722h; } public static Handler m19109f() { if (f14724j == null) { synchronized (f14723i) { if (f14724j == null) { f14724j = new Handler(f14723i.getLooper()); } } } return f14724j; } public static Future<?> m19105d(Runnable runnable) { if (runnable != null) { return f14725k.submit(new C2552x(runnable, 0, null)); } throw new IllegalArgumentException("runnable is null!"); } public static Future<?> m19108e(Runnable runnable) { if (runnable != null) { return f14726l.submit(new C2552x(runnable, 0, null)); } throw new IllegalArgumentException("runnable is null!"); } public static Handler m19110g() { if (f14728n == null) { synchronized (f14727m) { if (f14728n == null) { f14728n = new Handler(f14727m.getLooper()); } } } return f14728n; } }
[ "tranduyvn91@gmail.com" ]
tranduyvn91@gmail.com
13584ed5407dc39fd533528416e9f8a803807d90
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/neo4j--neo4j/088508d8bf02eec0cac6e0e3fea7ce2c74293798/after/InputNode.java
e4d847e486ed04775fff4673feff1da07d4f118e
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
2,125
java
/** * Copyright (c) 2002-2014 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * 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 program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.unsafe.impl.batchimport.input; import java.util.Arrays; import java.util.Collection; import org.neo4j.helpers.Pair; /** * Represents a node from an input source, for example a .csv file. */ public class InputNode extends InputEntity { private final String[] labels; private final Long labelField; /** * @param id * @param properties * @param labels * @param labelField is a hack to bypass String[] labels, consumers should check that field first. */ public InputNode( long id, Object[] properties, Long firstPropertyId, String[] labels, Long labelField ) { super( id, properties, firstPropertyId ); this.labels = labels; this.labelField = labelField; } public String[] labels() { return labels; } public boolean hasLabelField() { return labelField != null; } public Long labelField() { return labelField; } @Override protected void toStringFields( Collection<Pair<String, ?>> fields ) { super.toStringFields( fields ); if ( hasLabelField() ) { fields.add( Pair.of( "labelField", labelField ) ); } else { fields.add( Pair.of( "labels", Arrays.toString( labels ) ) ); } } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
15db8f624af24eff6c74df7de2ed819b01a5f482
35786690420eb030eb71c445fc46c4ed0fd12006
/src/com/green/bank/util/AccountInvalidException.java
f445030c9e914f41d41e10fa36d5ba9795001d8b
[]
no_license
pminhtri11/Online-Banking-App
abc7c42a8dcf2f47cafc4eee44978d8865d1cf8f
68274bca849e9a8802dbd6bb85b03aeeafc53249
refs/heads/master
2022-12-23T07:42:35.918872
2020-09-28T05:20:03
2020-09-28T05:20:03
298,280,976
0
0
null
null
null
null
UTF-8
Java
false
false
160
java
package com.green.bank.util; public class AccountInvalidException extends Exception { public AccountInvalidException(String message) { super(message); } }
[ "minhtri11tk@gmail.com" ]
minhtri11tk@gmail.com
ef841f610552f2c2890c1c992c34f504759673f4
a24a0b4aaed1c9ebc7ff250ae58c99434c589fd7
/UserInterfaceAPIFIX/src/org/spookit/api/userinterface/Str.java
a484040764e50e4ebff9cac5b66d026f5ae972fd
[]
no_license
Spookit/UserInterfaceAPI
917fd4475ec519db286bf6da693436bc903417b3
12a1e2f42e1930d4412decd598458363ca3a44ba
refs/heads/master
2020-04-28T04:38:58.715772
2019-03-11T11:37:21
2019-03-11T11:37:21
174,987,153
0
1
null
null
null
null
UTF-8
Java
false
false
6,775
java
package org.spookit.api.userinterface; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.function.Consumer; import org.bukkit.ChatColor; public class Str implements Iterable<String>,CharSequence,Serializable,Comparable<Str> { /** * */ private static final long serialVersionUID = 1L; ArrayList<String> strings = new ArrayList<>(); public Str(Collection<? extends String> a) { strings.addAll(a); } public Str(Str another) { this(another.strings); } public Str() { } public Str(String...strings) { this.strings.addAll(Arrays.asList(strings)); } public Str append(String arg0) { strings.add(arg0); return this; } public Str clone() { return new Str(strings); } public Collection<? extends String> asList() { return new ArrayList<>(strings); } public String toString(String delimiter) { boolean first = true; String appender =new String(); for (String s : clone().strings) { if (first) { first = false; appender+=s; } else { appender+=delimiter+s; } } return appender; } public String toString(String delimiter,String endDelimiter) { boolean first = true; String appender =new String(); int index = 0; for (String s : clone().strings) { if (first) { first = false; appender+=s; } else if (index == clone().strings.size()-1) { appender+=endDelimiter+s; } else { appender+=delimiter+s; } index++; } return appender; } public String toString(char c) { return toString(String.valueOf(c)); } public String toString() { return toString(""); } public Str clone(Consumer<Str> a) { Str str = clone(); a.accept(str); return str; } public Str replaceFirst(String regex,String target) { return clone(a->{ a.strings.replaceAll(b->{ return b.replaceFirst(regex, target); }); }); } public Str replaceAll(String regex,String target) { return clone(a->{ a.strings.replaceAll(b->{ return b.replaceAll(regex, target); }); }); } public Str replace(String arg0,String target) { return clone(a->{ a.strings.replaceAll(b->{ return b.replace(arg0, target); }); }); } public Str replace(char c,char t) { return clone(a->{ a.strings.replaceAll(b->{ return b.replace(c, t); }); }); } public Str colorize() { return clone(a->{ a.strings.replaceAll(b->{ return ChatColor.translateAlternateColorCodes('&', b); }); }); } public Str stripColor() { return clone(a->{ a.strings.replaceAll(b->{ return ChatColor.stripColor(b); }); }); } public Str forceColor() { return replace('&','\u00A7'); } public Str forceStripColor() { return replace('\u00A7','&'); } public boolean contains(String arg0) { for (String s : clone().strings) { if (s.contains(arg0)) return true; } return false; } public Str concat(String... a) { return clone(b->{ b.strings.addAll(Arrays.asList(a)); }); } public char[] toCharArray() { return toString().toCharArray(); } public Str split(String delimiter,int limit) { ArrayList<String> splitment = new ArrayList<>(); for (String s : this) { splitment.addAll(Arrays.asList(s.split(delimiter,limit))); } return new Str(splitment); } public Str split(String delimiter) { ArrayList<String> splitment = new ArrayList<>(); for (String s : this) { splitment.addAll(Arrays.asList(s.split(delimiter))); } return new Str(splitment); } public Str concat(Str a) { return clone(b->{ b.strings.addAll(a.strings); }); } public Str concat(Collection<? extends String> a) { return clone(b->{ b.strings.addAll(a); }); } public void finalize() { } public boolean startsWith(String a) { return !isEmpty() && strings.get(0).startsWith(a); } public boolean endsWith(String a) { return !isEmpty() && strings.get(strings.size()-1).endsWith(a); } public boolean equals(Object o) { if (o instanceof String) { return toString().equals(o); } if (o instanceof Str) { return ((Str)o).toString().equals(toString()); } return super.equals(o); } public boolean equalsIgnoreCase(Object o) { if (o instanceof String) { return toString().equalsIgnoreCase((String)o); } if (o instanceof Str) { return toString().equalsIgnoreCase(((Str)o).toString()); } return equals(o); } public boolean isEmpty() { for (String s : this) { if (!s.isEmpty()) return false; } return true; } public Str substr(int start) { return clone(a->a.strings.subList(start, a.strings.size())); } public Str substr(int start,int end) { return clone(a->a.strings.subList(start, end)); } @Override public Iterator<String> iterator() { return strings.iterator(); } @Override public char charAt(int index) { return toString().charAt(index); } @Override public int length() { return toString().length(); } @Override public CharSequence subSequence(int start, int end) { return toString().subSequence(start, end); } public int size() { return strings.size(); } public static Str valueOf(Object o) { return new Str(String.valueOf(o)); } public String[] toArray() { return strings.toArray(new String[strings.size()]); } public Str center() { return clone(a->{ ArrayList<String> centered = new ArrayList<>(); for (String s : new ArrayList<>(a.strings)) { centered.addAll(Center.multicenter(s)); } a.strings = centered; }); } public static String c(String a) { return ChatColor.translateAlternateColorCodes('&',a); } @Override public int compareTo(Str arg0) { int arg1 = this.strings.size(); int arg2 = arg0.strings.size(); int arg3 = Math.min(arg1, arg2); String[] arg4 = this.strings.toArray(new String[arg1]); String[] arg5 = arg0.strings.toArray(new String[arg2]); for (int arg6 = 0; arg6 < arg3; ++arg6) { String arg7 = arg4[arg6]; String arg8 = arg5[arg6]; if (arg7 != arg8) { return arg7.compareTo(arg8); } } return arg1 - arg2; } public int compareToIgnoreCase(Str arg0) { int arg1 = this.strings.size(); int arg2 = arg0.strings.size(); int arg3 = Math.min(arg1, arg2); String[] arg4 = this.strings.toArray(new String[arg1]); String[] arg5 = arg0.strings.toArray(new String[arg2]); for (int arg6 = 0; arg6 < arg3; ++arg6) { String arg7 = arg4[arg6].toLowerCase(); String arg8 = arg5[arg6].toLowerCase(); if (arg7 != arg8) { return arg7.compareTo(arg8); } } return arg1 - arg2; } }
[ "sunaryayalasatriathito@gmail.com" ]
sunaryayalasatriathito@gmail.com
3766a970e67fddb03c32d26987a5a6bae8398b05
0721305fd9b1c643a7687b6382dccc56a82a2dad
/src/app.zenly.locator_4.8.0_base_source_from_JADX/sources/zendesk/belvedere/C13529p.java
239d9da47376448d477f8437ca786d8e436832ac
[]
no_license
a2en/Zenly_re
09c635ad886c8285f70a8292ae4f74167a4ad620
f87af0c2dd0bc14fd772c69d5bc70cd8aa727516
refs/heads/master
2020-12-13T17:07:11.442473
2020-01-17T04:32:44
2020-01-17T04:32:44
234,470,083
1
0
null
null
null
null
UTF-8
Java
false
false
16,268
java
package zendesk.belvedere; import android.content.Context; import android.net.Uri; import android.os.AsyncTask; import java.lang.ref.WeakReference; import java.util.List; /* renamed from: zendesk.belvedere.p */ class C13529p extends AsyncTask<Uri, Void, List<MediaResult>> { /* renamed from: a */ private final WeakReference<C13492c<List<MediaResult>>> f35073a; /* renamed from: b */ private final Context f35074b; /* renamed from: c */ private final C13530q f35075c; /* renamed from: d */ private final String f35076d; private C13529p(Context context, C13530q qVar, C13492c<List<MediaResult>> cVar, String str) { this.f35074b = context; this.f35075c = qVar; this.f35076d = str; this.f35073a = new WeakReference<>(cVar); } /* renamed from: a */ static void m35835a(Context context, C13530q qVar, C13492c<List<MediaResult>> cVar, List<Uri> list) { m35836a(context, qVar, cVar, list, null); } /* renamed from: a */ static void m35836a(Context context, C13530q qVar, C13492c<List<MediaResult>> cVar, List<Uri> list, String str) { new C13529p(context, qVar, cVar, str).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Uri[]) list.toArray(new Uri[list.size()])); } /* access modifiers changed from: protected */ /* JADX WARNING: Code restructure failed: missing block: B:14:0x005a, code lost: r0 = e; */ /* JADX WARNING: Code restructure failed: missing block: B:15:0x005b, code lost: r12 = r9; */ /* JADX WARNING: Code restructure failed: missing block: B:16:0x005e, code lost: r0 = e; */ /* JADX WARNING: Code restructure failed: missing block: B:17:0x005f, code lost: r12 = r9; */ /* JADX WARNING: Code restructure failed: missing block: B:25:0x0098, code lost: r0 = move-exception; */ /* JADX WARNING: Code restructure failed: missing block: B:26:0x0099, code lost: r1 = r0; r12 = r9; */ /* JADX WARNING: Code restructure failed: missing block: B:27:0x009d, code lost: r0 = e; */ /* JADX WARNING: Code restructure failed: missing block: B:28:0x009e, code lost: r25 = r15; r1 = 1; */ /* JADX WARNING: Code restructure failed: missing block: B:30:0x00a3, code lost: r0 = e; */ /* JADX WARNING: Code restructure failed: missing block: B:31:0x00a4, code lost: r25 = r15; r1 = 1; */ /* JADX WARNING: Code restructure failed: missing block: B:92:?, code lost: r11.close(); */ /* JADX WARNING: Code restructure failed: missing block: B:93:0x0155, code lost: r0 = move-exception; */ /* JADX WARNING: Code restructure failed: missing block: B:94:0x0156, code lost: zendesk.belvedere.C13480L.m35693a(r5, r4, r0); */ /* JADX WARNING: Code restructure failed: missing block: B:97:?, code lost: r12.close(); */ /* JADX WARNING: Code restructure failed: missing block: B:98:0x0160, code lost: r0 = move-exception; */ /* JADX WARNING: Code restructure failed: missing block: B:99:0x0161, code lost: zendesk.belvedere.C13480L.m35693a(r5, r3, r0); */ /* JADX WARNING: Failed to process nested try/catch */ /* JADX WARNING: Removed duplicated region for block: B:105:0x0147 A[SYNTHETIC] */ /* JADX WARNING: Removed duplicated region for block: B:25:0x0098 A[ExcHandler: all (r0v31 'th' java.lang.Throwable A[CUSTOM_DECLARE]), Splitter:B:8:0x004f] */ /* JADX WARNING: Removed duplicated region for block: B:65:0x0107 A[SYNTHETIC, Splitter:B:65:0x0107] */ /* JADX WARNING: Removed duplicated region for block: B:70:0x0112 A[SYNTHETIC, Splitter:B:70:0x0112] */ /* JADX WARNING: Removed duplicated region for block: B:80:0x0133 A[SYNTHETIC, Splitter:B:80:0x0133] */ /* JADX WARNING: Removed duplicated region for block: B:85:0x013e A[SYNTHETIC, Splitter:B:85:0x013e] */ /* JADX WARNING: Removed duplicated region for block: B:91:0x0151 A[SYNTHETIC, Splitter:B:91:0x0151] */ /* JADX WARNING: Removed duplicated region for block: B:96:0x015c A[SYNTHETIC, Splitter:B:96:0x015c] */ /* renamed from: a */ /* Code decompiled incorrectly, please refer to instructions dump. */ public java.util.List<zendesk.belvedere.MediaResult> doInBackground(android.net.Uri... r27) { /* r26 = this; r1 = r26 r2 = r27 java.lang.String r3 = "Error closing FileOutputStream" java.lang.String r4 = "Error closing InputStream" java.lang.String r5 = "Belvedere" java.util.ArrayList r6 = new java.util.ArrayList r6.<init>() r0 = 1048576(0x100000, float:1.469368E-39) byte[] r7 = new byte[r0] int r8 = r2.length r0 = 0 r11 = r0 r12 = r11 r10 = 0 L_0x0018: if (r10 >= r8) goto L_0x0166 r15 = r2[r10] android.content.Context r0 = r1.f35074b // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } android.content.ContentResolver r0 = r0.getContentResolver() // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } java.io.InputStream r11 = r0.openInputStream(r15) // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } zendesk.belvedere.q r0 = r1.f35075c // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } android.content.Context r13 = r1.f35074b // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } java.lang.String r14 = r1.f35076d // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } java.io.File r14 = r0.mo38910a(r13, r15, r14) // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } r0 = 2 if (r11 == 0) goto L_0x00aa if (r14 == 0) goto L_0x00aa java.util.Locale r13 = java.util.Locale.US // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } java.lang.String r9 = "Copying media file into private cache - Uri: %s - Dest: %s" java.lang.Object[] r0 = new java.lang.Object[r0] // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } r17 = 0 r0[r17] = r15 // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } r16 = 1 r0[r16] = r14 // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } java.lang.String r0 = java.lang.String.format(r13, r9, r0) // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } zendesk.belvedere.C13480L.m35692a(r5, r0) // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } java.io.FileOutputStream r9 = new java.io.FileOutputStream // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } r9.<init>(r14) // Catch:{ FileNotFoundException -> 0x011d, IOException -> 0x00f1 } L_0x004f: int r0 = r11.read(r7) // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } if (r0 <= 0) goto L_0x0062 r12 = 0 r9.write(r7, r12, r0) // Catch:{ FileNotFoundException -> 0x005e, IOException -> 0x005a, all -> 0x0098 } goto L_0x004f L_0x005a: r0 = move-exception r12 = r9 goto L_0x00f2 L_0x005e: r0 = move-exception r12 = r9 goto L_0x011e L_0x0062: android.content.Context r0 = r1.f35074b // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } zendesk.belvedere.MediaResult r0 = zendesk.belvedere.C13530q.m35843b(r0, r15) // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } zendesk.belvedere.MediaResult r12 = new zendesk.belvedere.MediaResult // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } zendesk.belvedere.q r13 = r1.f35075c // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } android.content.Context r2 = r1.f35074b // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } android.net.Uri r2 = r13.mo38908a(r2, r14) // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } java.lang.String r17 = r14.getName() // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } java.lang.String r18 = r0.mo38842c() // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } long r19 = r0.mo38848f() // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } long r21 = r0.mo38850h() // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } long r23 = r0.mo38841b() // Catch:{ FileNotFoundException -> 0x00a3, IOException -> 0x009d, all -> 0x0098 } r13 = r12 r1 = 1 r25 = r15 r15 = r2 r16 = r25 r13.<init>(r14, r15, r16, r17, r18, r19, r21, r23) // Catch:{ FileNotFoundException -> 0x0096, IOException -> 0x0094, all -> 0x0098 } r6.add(r12) // Catch:{ FileNotFoundException -> 0x0096, IOException -> 0x0094, all -> 0x0098 } goto L_0x00d2 L_0x0094: r0 = move-exception goto L_0x00a1 L_0x0096: r0 = move-exception goto L_0x00a7 L_0x0098: r0 = move-exception r1 = r0 r12 = r9 goto L_0x014f L_0x009d: r0 = move-exception r25 = r15 r1 = 1 L_0x00a1: r12 = r9 goto L_0x00f5 L_0x00a3: r0 = move-exception r25 = r15 r1 = 1 L_0x00a7: r12 = r9 goto L_0x0121 L_0x00aa: r25 = r15 r1 = 1 java.util.Locale r2 = java.util.Locale.US // Catch:{ FileNotFoundException -> 0x00ec, IOException -> 0x00ea } java.lang.String r9 = "Unable to resolve uri. InputStream null = %s, File null = %s" java.lang.Object[] r0 = new java.lang.Object[r0] // Catch:{ FileNotFoundException -> 0x00ec, IOException -> 0x00ea } if (r11 != 0) goto L_0x00b7 r13 = 1 goto L_0x00b8 L_0x00b7: r13 = 0 L_0x00b8: java.lang.Boolean r13 = java.lang.Boolean.valueOf(r13) // Catch:{ FileNotFoundException -> 0x00ec, IOException -> 0x00ea } r15 = 0 r0[r15] = r13 // Catch:{ FileNotFoundException -> 0x00ec, IOException -> 0x00ea } if (r14 != 0) goto L_0x00c3 r13 = 1 goto L_0x00c4 L_0x00c3: r13 = 0 L_0x00c4: java.lang.Boolean r13 = java.lang.Boolean.valueOf(r13) // Catch:{ FileNotFoundException -> 0x00ec, IOException -> 0x00ea } r0[r1] = r13 // Catch:{ FileNotFoundException -> 0x00ec, IOException -> 0x00ea } java.lang.String r0 = java.lang.String.format(r2, r9, r0) // Catch:{ FileNotFoundException -> 0x00ec, IOException -> 0x00ea } zendesk.belvedere.C13480L.m35696c(r5, r0) // Catch:{ FileNotFoundException -> 0x00ec, IOException -> 0x00ea } r9 = r12 L_0x00d2: if (r11 == 0) goto L_0x00dd r11.close() // Catch:{ IOException -> 0x00d8 } goto L_0x00dd L_0x00d8: r0 = move-exception r1 = r0 zendesk.belvedere.C13480L.m35693a(r5, r4, r1) L_0x00dd: if (r9 == 0) goto L_0x00e8 r9.close() // Catch:{ IOException -> 0x00e3 } goto L_0x00e8 L_0x00e3: r0 = move-exception r1 = r0 zendesk.belvedere.C13480L.m35693a(r5, r3, r1) L_0x00e8: r12 = r9 goto L_0x011b L_0x00ea: r0 = move-exception goto L_0x00f5 L_0x00ec: r0 = move-exception goto L_0x0121 L_0x00ee: r0 = move-exception r1 = r0 goto L_0x014f L_0x00f1: r0 = move-exception L_0x00f2: r25 = r15 r1 = 1 L_0x00f5: java.util.Locale r2 = java.util.Locale.US // Catch:{ all -> 0x00ee } java.lang.String r9 = "IO Error copying file, uri: %s" java.lang.Object[] r1 = new java.lang.Object[r1] // Catch:{ all -> 0x00ee } r13 = 0 r1[r13] = r25 // Catch:{ all -> 0x00ee } java.lang.String r1 = java.lang.String.format(r2, r9, r1) // Catch:{ all -> 0x00ee } zendesk.belvedere.C13480L.m35693a(r5, r1, r0) // Catch:{ all -> 0x00ee } if (r11 == 0) goto L_0x0110 r11.close() // Catch:{ IOException -> 0x010b } goto L_0x0110 L_0x010b: r0 = move-exception r1 = r0 zendesk.belvedere.C13480L.m35693a(r5, r4, r1) L_0x0110: if (r12 == 0) goto L_0x011b r12.close() // Catch:{ IOException -> 0x0116 } goto L_0x011b L_0x0116: r0 = move-exception r1 = r0 zendesk.belvedere.C13480L.m35693a(r5, r3, r1) L_0x011b: r13 = 0 goto L_0x0147 L_0x011d: r0 = move-exception L_0x011e: r25 = r15 r1 = 1 L_0x0121: java.util.Locale r2 = java.util.Locale.US // Catch:{ all -> 0x00ee } java.lang.String r9 = "File not found error copying file, uri: %s" java.lang.Object[] r1 = new java.lang.Object[r1] // Catch:{ all -> 0x00ee } r13 = 0 r1[r13] = r25 // Catch:{ all -> 0x00ee } java.lang.String r1 = java.lang.String.format(r2, r9, r1) // Catch:{ all -> 0x00ee } zendesk.belvedere.C13480L.m35693a(r5, r1, r0) // Catch:{ all -> 0x00ee } if (r11 == 0) goto L_0x013c r11.close() // Catch:{ IOException -> 0x0137 } goto L_0x013c L_0x0137: r0 = move-exception r1 = r0 zendesk.belvedere.C13480L.m35693a(r5, r4, r1) L_0x013c: if (r12 == 0) goto L_0x0147 r12.close() // Catch:{ IOException -> 0x0142 } goto L_0x0147 L_0x0142: r0 = move-exception r1 = r0 zendesk.belvedere.C13480L.m35693a(r5, r3, r1) L_0x0147: int r10 = r10 + 1 r1 = r26 r2 = r27 goto L_0x0018 L_0x014f: if (r11 == 0) goto L_0x015a r11.close() // Catch:{ IOException -> 0x0155 } goto L_0x015a L_0x0155: r0 = move-exception r2 = r0 zendesk.belvedere.C13480L.m35693a(r5, r4, r2) L_0x015a: if (r12 == 0) goto L_0x0165 r12.close() // Catch:{ IOException -> 0x0160 } goto L_0x0165 L_0x0160: r0 = move-exception r2 = r0 zendesk.belvedere.C13480L.m35693a(r5, r3, r2) L_0x0165: throw r1 L_0x0166: return r6 */ throw new UnsupportedOperationException("Method not decompiled: zendesk.belvedere.C13529p.doInBackground(android.net.Uri[]):java.util.List"); } /* access modifiers changed from: protected */ /* renamed from: a */ public void onPostExecute(List<MediaResult> list) { super.onPostExecute(list); C13492c cVar = (C13492c) this.f35073a.get(); if (cVar != null) { cVar.internalSuccess(list); } else { C13480L.m35696c("Belvedere", "Callback null"); } } }
[ "developer@appzoc.com" ]
developer@appzoc.com
3683daf7b195227e6980c13e1fd24b2943c076ee
f6b4c465d2d817be9a10a5473cdc0d1d03b8a0c7
/microservices/process-service/src/main/java/de/qaware/oss/cloud/service/process/integration/AutostartBean.java
fd1022a52f5837c377019720a06253c71d9a2984
[ "MIT" ]
permissive
lreimer/cloud-native-javaee
4b12b5ccdd6d710046565ed6e030e0249a206ce4
c0cb500b0b4f17675f39f904ef3760efbe41a883
refs/heads/master
2022-05-31T12:51:21.293077
2022-05-13T09:21:09
2022-05-13T09:21:09
58,712,872
8
9
MIT
2018-06-08T20:37:21
2016-05-13T07:32:20
Java
UTF-8
Java
false
false
604
java
package de.qaware.oss.cloud.service.process.integration; import javax.annotation.PostConstruct; import javax.ejb.Singleton; import javax.ejb.Startup; import javax.inject.Inject; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import java.util.logging.Logger; @Singleton @Startup public class AutostartBean { @Inject private Logger logger; @PersistenceContext private EntityManager entityManager; @PostConstruct void autostart() { logger.info("Autostarting Process service entity manager."); entityManager.clear(); } }
[ "mario-leander.reimer@qaware.de" ]
mario-leander.reimer@qaware.de
2103579cb99cf9358a8a37d6ce36c538ef23fad7
04122e1782d4226f5185b24a2685ed29bb232c84
/Java/FastCampus/preCourse/ch08/Template/TemplateEx/PlayerTest.java
a4443570cd6553fd4908878fb2484d69a921d3cf
[]
no_license
limjoonchul/TIL
ab1d4adaae7acd6337cc9c833e6afe730ad24704
d92564ea4eeb37607af652c0af129ef23d4197ce
refs/heads/master
2023-05-06T20:21:09.820487
2021-05-12T12:23:26
2021-05-12T12:23:26
274,395,769
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package com.company.ch08.Template.TemplateEx; public class PlayerTest { public static void main(String[] args) { Player lowPlayer = new LowLevelPlayer(); Player midPlayer = new MidLevelPlayer(); Player highPlayer = new HighLevelPlayer(); lowPlayer.go(1); midPlayer.go(2); highPlayer.go(3); } }
[ "dlawnscjf511@naver.com" ]
dlawnscjf511@naver.com
e50950df2b47ae0e77db970e778c293b9818faa9
048a5a1043c574a4df39220c25558b0aa9c6b914
/src/day61_Maps/RemovePalindrome.java
2361db77f76a42513ab95dfdb149a159016787c2
[]
no_license
arvindmits/Java
97e37e6009be9364a22520f177983ab486202534
68175f96220cb812cb98f226a0dc5bcb3e8634fe
refs/heads/master
2023-03-16T06:36:47.530532
2021-01-04T19:10:06
2021-01-04T19:10:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
849
java
package day61_Maps; import library.Util; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; /* warmup tasks: 1. write a program that can remove the palindrome string from a list of String DO NOT use Lambda expressions */ public class RemovePalindrome { public static void main(String[] args) { String[] words = {"level", "kayak", "ana", "java", "python", "cybertek"}; List<String> list = new ArrayList<>(); list.addAll( Arrays.asList(words)); Iterator<String> it = list.iterator(); while( it.hasNext() ){ String each = it.next(); String reverse = Util.reverseString(each); if ( each.equals(reverse)){ it.remove(); } } System.out.println( list); } }
[ "dgn.rumeysaa@gmail.com" ]
dgn.rumeysaa@gmail.com
c90b3aadb43b522601f047b675180e149db9ccf9
4a7dccf38e0c106fd4da00e96ac972c2a76ae1ed
/gerrit-server/src/main/java/com/google/gerrit/server/index/change/ChangeField.java
c6835135112ef1a944ccebef14f131f4d6cf5e82
[ "Apache-2.0" ]
permissive
power9li/gerrit-mirro
22fb54b4b42fb633e356513209f7c10c8bb4eab5
d33d4104ea38cb27e66b72a3aac1f37bc785582e
refs/heads/master
2022-12-22T13:52:18.433071
2016-10-14T06:57:59
2016-10-14T06:57:59
70,809,607
0
2
Apache-2.0
2022-12-10T22:01:23
2016-10-13T13:31:42
Java
UTF-8
Java
false
false
28,872
java
// Copyright (C) 2013 The Android Open Source Project // // 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.google.gerrit.server.index.change; import static com.google.common.base.MoreObjects.firstNonNull; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.stream.Collectors.toSet; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Optional; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableTable; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.google.common.collect.Table; import com.google.gerrit.reviewdb.client.Account; import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.reviewdb.client.ChangeMessage; import com.google.gerrit.reviewdb.client.Comment; import com.google.gerrit.reviewdb.client.PatchSet; import com.google.gerrit.reviewdb.client.PatchSetApproval; import com.google.gerrit.server.ReviewerSet; import com.google.gerrit.server.StarredChangesUtil; import com.google.gerrit.server.index.FieldDef; import com.google.gerrit.server.index.FieldType; import com.google.gerrit.server.index.SchemaUtil; import com.google.gerrit.server.notedb.ReviewerStateInternal; import com.google.gerrit.server.query.change.ChangeData; import com.google.gerrit.server.query.change.ChangeData.ChangedLines; import com.google.gerrit.server.query.change.ChangeQueryBuilder; import com.google.gerrit.server.query.change.ChangeStatusPredicate; import com.google.gwtorm.protobuf.CodecFactory; import com.google.gwtorm.protobuf.ProtobufCodec; import com.google.gwtorm.server.OrmException; import com.google.protobuf.CodedOutputStream; import org.eclipse.jgit.revwalk.FooterLine; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; /** * Fields indexed on change documents. * <p> * Each field corresponds to both a field name supported by * {@link ChangeQueryBuilder} for querying that field, and a method on * {@link ChangeData} used for populating the corresponding document fields in * the secondary index. * <p> * Field names are all lowercase alphanumeric plus underscore; index * implementations may create unambiguous derived field names containing other * characters. */ public class ChangeField { public static final int NO_ASSIGNEE = -1; /** Legacy change ID. */ public static final FieldDef<ChangeData, Integer> LEGACY_ID = new FieldDef.Single<ChangeData, Integer>("legacy_id", FieldType.INTEGER, true) { @Override public Integer get(ChangeData input, FillArgs args) { return input.getId().get(); } }; /** Newer style Change-Id key. */ public static final FieldDef<ChangeData, String> ID = new FieldDef.Single<ChangeData, String>(ChangeQueryBuilder.FIELD_CHANGE_ID, FieldType.PREFIX, false) { @Override public String get(ChangeData input, FillArgs args) throws OrmException { Change c = input.change(); if (c == null) { return null; } return c.getKey().get(); } }; /** Change status string, in the same format as {@code status:}. */ public static final FieldDef<ChangeData, String> STATUS = new FieldDef.Single<ChangeData, String>(ChangeQueryBuilder.FIELD_STATUS, FieldType.EXACT, false) { @Override public String get(ChangeData input, FillArgs args) throws OrmException { Change c = input.change(); if (c == null) { return null; } return ChangeStatusPredicate.canonicalize(c.getStatus()); } }; /** Project containing the change. */ public static final FieldDef<ChangeData, String> PROJECT = new FieldDef.Single<ChangeData, String>( ChangeQueryBuilder.FIELD_PROJECT, FieldType.EXACT, true) { @Override public String get(ChangeData input, FillArgs args) throws OrmException { Change c = input.change(); if (c == null) { return null; } return c.getProject().get(); } }; /** Project containing the change, as a prefix field. */ public static final FieldDef<ChangeData, String> PROJECTS = new FieldDef.Single<ChangeData, String>( ChangeQueryBuilder.FIELD_PROJECTS, FieldType.PREFIX, false) { @Override public String get(ChangeData input, FillArgs args) throws OrmException { Change c = input.change(); if (c == null) { return null; } return c.getProject().get(); } }; /** Reference (aka branch) the change will submit onto. */ public static final FieldDef<ChangeData, String> REF = new FieldDef.Single<ChangeData, String>( ChangeQueryBuilder.FIELD_REF, FieldType.EXACT, false) { @Override public String get(ChangeData input, FillArgs args) throws OrmException { Change c = input.change(); if (c == null) { return null; } return c.getDest().get(); } }; /** Topic, a short annotation on the branch. */ public static final FieldDef<ChangeData, String> EXACT_TOPIC = new FieldDef.Single<ChangeData, String>( "topic4", FieldType.EXACT, false) { @Override public String get(ChangeData input, FillArgs args) throws OrmException { return getTopic(input); } }; /** Topic, a short annotation on the branch. */ public static final FieldDef<ChangeData, String> FUZZY_TOPIC = new FieldDef.Single<ChangeData, String>( "topic5", FieldType.FULL_TEXT, false) { @Override public String get(ChangeData input, FillArgs args) throws OrmException { return getTopic(input); } }; /** Submission id assigned by MergeOp. */ public static final FieldDef<ChangeData, String> SUBMISSIONID = new FieldDef.Single<ChangeData, String>( ChangeQueryBuilder.FIELD_SUBMISSIONID, FieldType.EXACT, false) { @Override public String get(ChangeData input, FillArgs args) throws OrmException { Change c = input.change(); if (c == null) { return null; } return c.getSubmissionId(); } }; /** Last update time since January 1, 1970. */ public static final FieldDef<ChangeData, Timestamp> UPDATED = new FieldDef.Single<ChangeData, Timestamp>( "updated2", FieldType.TIMESTAMP, true) { @Override public Timestamp get(ChangeData input, FillArgs args) throws OrmException { Change c = input.change(); if (c == null) { return null; } return c.getLastUpdatedOn(); } }; /** List of full file paths modified in the current patch set. */ public static final FieldDef<ChangeData, Iterable<String>> PATH = new FieldDef.Repeatable<ChangeData, String>( // Named for backwards compatibility. ChangeQueryBuilder.FIELD_FILE, FieldType.EXACT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return firstNonNull(input.currentFilePaths(), ImmutableList.<String> of()); } }; public static Set<String> getFileParts(ChangeData cd) throws OrmException { List<String> paths = cd.currentFilePaths(); if (paths == null) { return ImmutableSet.of(); } Splitter s = Splitter.on('/').omitEmptyStrings(); Set<String> r = new HashSet<>(); for (String path : paths) { for (String part : s.split(path)) { r.add(part); } } return r; } /** Hashtags tied to a change */ public static final FieldDef<ChangeData, Iterable<String>> HASHTAG = new FieldDef.Repeatable<ChangeData, String>( ChangeQueryBuilder.FIELD_HASHTAG, FieldType.EXACT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return input.hashtags().stream() .map(String::toLowerCase) .collect(toSet()); } }; /** Hashtags with original case. */ public static final FieldDef<ChangeData, Iterable<byte[]>> HASHTAG_CASE_AWARE = new FieldDef.Repeatable<ChangeData, byte[]>( "_hashtag", FieldType.STORED_ONLY, true) { @Override public Iterable<byte[]> get(ChangeData input, FillArgs args) throws OrmException { return input.hashtags().stream() .map(t -> t.getBytes(UTF_8)) .collect(toSet()); } }; /** Components of each file path modified in the current patch set. */ public static final FieldDef<ChangeData, Iterable<String>> FILE_PART = new FieldDef.Repeatable<ChangeData, String>( ChangeQueryBuilder.FIELD_FILEPART, FieldType.EXACT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return getFileParts(input); } }; /** Owner/creator of the change. */ public static final FieldDef<ChangeData, Integer> OWNER = new FieldDef.Single<ChangeData, Integer>( ChangeQueryBuilder.FIELD_OWNER, FieldType.INTEGER, false) { @Override public Integer get(ChangeData input, FillArgs args) throws OrmException { Change c = input.change(); if (c == null) { return null; } return c.getOwner().get(); } }; /** The user assigned to the change. */ public static final FieldDef<ChangeData, Integer> ASSIGNEE = new FieldDef.Single<ChangeData, Integer>( ChangeQueryBuilder.FIELD_ASSIGNEE, FieldType.INTEGER, false) { @Override public Integer get(ChangeData input, FillArgs args) throws OrmException { Account.Id id = input.change().getAssignee(); return id != null ? id.get() : NO_ASSIGNEE; } }; /** Reviewer(s) associated with the change. */ public static final FieldDef<ChangeData, Iterable<String>> REVIEWER = new FieldDef.Repeatable<ChangeData, String>( "reviewer2", FieldType.EXACT, true) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return getReviewerFieldValues(input.reviewers()); } }; @VisibleForTesting static List<String> getReviewerFieldValues(ReviewerSet reviewers) { List<String> r = new ArrayList<>(reviewers.asTable().size() * 2); for (Table.Cell<ReviewerStateInternal, Account.Id, Timestamp> c : reviewers.asTable().cellSet()) { String v = getReviewerFieldValue(c.getRowKey(), c.getColumnKey()); r.add(v); r.add(v + ',' + c.getValue().getTime()); } return r; } public static String getReviewerFieldValue(ReviewerStateInternal state, Account.Id id) { return state.toString() + ',' + id; } public static ReviewerSet parseReviewerFieldValues(Iterable<String> values) { ImmutableTable.Builder<ReviewerStateInternal, Account.Id, Timestamp> b = ImmutableTable.builder(); for (String v : values) { int f = v.indexOf(','); if (f < 0) { continue; } int l = v.lastIndexOf(','); if (l == f) { continue; } b.put( ReviewerStateInternal.valueOf(v.substring(0, f)), Account.Id.parse(v.substring(f + 1, l)), new Timestamp(Long.valueOf(v.substring(l + 1, v.length())))); } return ReviewerSet.fromTable(b.build()); } /** Commit ID of any patch set on the change, using prefix match. */ public static final FieldDef<ChangeData, Iterable<String>> COMMIT = new FieldDef.Repeatable<ChangeData, String>( ChangeQueryBuilder.FIELD_COMMIT, FieldType.PREFIX, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return getRevisions(input); } }; /** Commit ID of any patch set on the change, using exact match. */ public static final FieldDef<ChangeData, Iterable<String>> EXACT_COMMIT = new FieldDef.Repeatable<ChangeData, String>( ChangeQueryBuilder.FIELD_EXACTCOMMIT, FieldType.EXACT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return getRevisions(input); } }; private static Set<String> getRevisions(ChangeData cd) throws OrmException { Set<String> revisions = new HashSet<>(); for (PatchSet ps : cd.patchSets()) { if (ps.getRevision() != null) { revisions.add(ps.getRevision().get()); } } return revisions; } /** Tracking id extracted from a footer. */ public static final FieldDef<ChangeData, Iterable<String>> TR = new FieldDef.Repeatable<ChangeData, String>( ChangeQueryBuilder.FIELD_TR, FieldType.EXACT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { try { List<FooterLine> footers = input.commitFooters(); if (footers == null) { return ImmutableSet.of(); } return Sets.newHashSet( args.trackingFooters.extract(footers).values()); } catch (IOException e) { throw new OrmException(e); } } }; /** List of labels on the current patch set. */ @Deprecated public static final FieldDef<ChangeData, Iterable<String>> LABEL = new FieldDef.Repeatable<ChangeData, String>( ChangeQueryBuilder.FIELD_LABEL, FieldType.EXACT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return getLabels(input, false); } }; /** List of labels on the current patch set including change owner votes. */ public static final FieldDef<ChangeData, Iterable<String>> LABEL2 = new FieldDef.Repeatable<ChangeData, String>( "label2", FieldType.EXACT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return getLabels(input, true); } }; private static Iterable<String> getLabels(ChangeData input, boolean owners) throws OrmException { Set<String> allApprovals = new HashSet<>(); Set<String> distinctApprovals = new HashSet<>(); for (PatchSetApproval a : input.currentApprovals()) { if (a.getValue() != 0 && !a.isLegacySubmit()) { allApprovals.add(formatLabel(a.getLabel(), a.getValue(), a.getAccountId())); if (owners && input.change().getOwner().equals(a.getAccountId())) { allApprovals.add(formatLabel(a.getLabel(), a.getValue(), ChangeQueryBuilder.OWNER_ACCOUNT_ID)); } distinctApprovals.add(formatLabel(a.getLabel(), a.getValue())); } } allApprovals.addAll(distinctApprovals); return allApprovals; } public static Set<String> getAuthorParts(ChangeData cd) throws OrmException { try { return SchemaUtil.getPersonParts(cd.getAuthor()); } catch (IOException e) { throw new OrmException(e); } } public static Set<String> getCommitterParts(ChangeData cd) throws OrmException { try { return SchemaUtil.getPersonParts(cd.getCommitter()); } catch (IOException e) { throw new OrmException(e); } } /** * The exact email address, or any part of the author name or email address, * in the current patch set. */ public static final FieldDef<ChangeData, Iterable<String>> AUTHOR = new FieldDef.Repeatable<ChangeData, String>( ChangeQueryBuilder.FIELD_AUTHOR, FieldType.FULL_TEXT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return getAuthorParts(input); } }; /** * The exact email address, or any part of the committer name or email address, * in the current patch set. */ public static final FieldDef<ChangeData, Iterable<String>> COMMITTER = new FieldDef.Repeatable<ChangeData, String>( ChangeQueryBuilder.FIELD_COMMITTER, FieldType.FULL_TEXT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return getCommitterParts(input); } }; public static class ChangeProtoField extends FieldDef.Single<ChangeData, byte[]> { public static final ProtobufCodec<Change> CODEC = CodecFactory.encoder(Change.class); private ChangeProtoField() { super("_change", FieldType.STORED_ONLY, true); } @Override public byte[] get(ChangeData input, FieldDef.FillArgs args) throws OrmException { Change c = input.change(); if (c == null) { return null; } return CODEC.encodeToByteArray(c); } } /** Serialized change object, used for pre-populating results. */ public static final ChangeProtoField CHANGE = new ChangeProtoField(); public static class PatchSetApprovalProtoField extends FieldDef.Repeatable<ChangeData, byte[]> { public static final ProtobufCodec<PatchSetApproval> CODEC = CodecFactory.encoder(PatchSetApproval.class); private PatchSetApprovalProtoField() { super("_approval", FieldType.STORED_ONLY, true); } @Override public Iterable<byte[]> get(ChangeData input, FillArgs args) throws OrmException { return toProtos(CODEC, input.currentApprovals()); } } /** * Serialized approvals for the current patch set, used for pre-populating * results. */ public static final PatchSetApprovalProtoField APPROVAL = new PatchSetApprovalProtoField(); public static String formatLabel(String label, int value) { return formatLabel(label, value, null); } public static String formatLabel(String label, int value, Account.Id accountId) { return label.toLowerCase() + (value >= 0 ? "+" : "") + value + (accountId != null ? "," + formatAccount(accountId) : ""); } private static String formatAccount(Account.Id accountId) { if (ChangeQueryBuilder.OWNER_ACCOUNT_ID.equals(accountId)) { return ChangeQueryBuilder.ARG_ID_OWNER; } return Integer.toString(accountId.get()); } /** Commit message of the current patch set. */ public static final FieldDef<ChangeData, String> COMMIT_MESSAGE = new FieldDef.Single<ChangeData, String>(ChangeQueryBuilder.FIELD_MESSAGE, FieldType.FULL_TEXT, false) { @Override public String get(ChangeData input, FillArgs args) throws OrmException { try { return input.commitMessage(); } catch (IOException e) { throw new OrmException(e); } } }; /** Summary or inline comment. */ public static final FieldDef<ChangeData, Iterable<String>> COMMENT = new FieldDef.Repeatable<ChangeData, String>(ChangeQueryBuilder.FIELD_COMMENT, FieldType.FULL_TEXT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { Set<String> r = new HashSet<>(); for (Comment c : input.publishedComments()) { r.add(c.message); } for (ChangeMessage m : input.messages()) { r.add(m.getMessage()); } return r; } }; /** Whether the change is mergeable. */ public static final FieldDef<ChangeData, String> MERGEABLE = new FieldDef.Single<ChangeData, String>( ChangeQueryBuilder.FIELD_MERGEABLE, FieldType.EXACT, true) { @Override public String get(ChangeData input, FillArgs args) throws OrmException { Boolean m = input.isMergeable(); if (m == null) { return null; } return m ? "1" : "0"; } }; /** The number of inserted lines in this change. */ public static final FieldDef<ChangeData, Integer> ADDED = new FieldDef.Single<ChangeData, Integer>( ChangeQueryBuilder.FIELD_ADDED, FieldType.INTEGER_RANGE, true) { @Override public Integer get(ChangeData input, FillArgs args) throws OrmException { return input.changedLines().isPresent() ? input.changedLines().get().insertions : null; } }; /** The number of deleted lines in this change. */ public static final FieldDef<ChangeData, Integer> DELETED = new FieldDef.Single<ChangeData, Integer>( ChangeQueryBuilder.FIELD_DELETED, FieldType.INTEGER_RANGE, true) { @Override public Integer get(ChangeData input, FillArgs args) throws OrmException { return input.changedLines().isPresent() ? input.changedLines().get().deletions : null; } }; /** The total number of modified lines in this change. */ public static final FieldDef<ChangeData, Integer> DELTA = new FieldDef.Single<ChangeData, Integer>( ChangeQueryBuilder.FIELD_DELTA, FieldType.INTEGER_RANGE, false) { @Override public Integer get(ChangeData input, FillArgs args) throws OrmException { Optional<ChangedLines> changedLines = input.changedLines(); return changedLines.isPresent() ? changedLines.get().insertions + changedLines.get().deletions : null; } }; /** Users who have commented on this change. */ public static final FieldDef<ChangeData, Iterable<Integer>> COMMENTBY = new FieldDef.Repeatable<ChangeData, Integer>( ChangeQueryBuilder.FIELD_COMMENTBY, FieldType.INTEGER, false) { @Override public Iterable<Integer> get(ChangeData input, FillArgs args) throws OrmException { Set<Integer> r = new HashSet<>(); for (ChangeMessage m : input.messages()) { if (m.getAuthor() != null) { r.add(m.getAuthor().get()); } } for (Comment c : input.publishedComments()) { r.add(c.author.getId().get()); } return r; } }; /** * Star labels on this change in the format: &lt;account-id&gt;:&lt;label&gt; */ public static final FieldDef<ChangeData, Iterable<String>> STAR = new FieldDef.Repeatable<ChangeData, String>( ChangeQueryBuilder.FIELD_STAR, FieldType.EXACT, true) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { return Iterables.transform( input.stars().entries(), (Map.Entry<Account.Id, String> e) -> { return StarredChangesUtil.StarField.create( e.getKey(), e.getValue()).toString(); }); } }; /** Users that have starred the change with any label. */ public static final FieldDef<ChangeData, Iterable<Integer>> STARBY = new FieldDef.Repeatable<ChangeData, Integer>( ChangeQueryBuilder.FIELD_STARBY, FieldType.INTEGER, false) { @Override public Iterable<Integer> get(ChangeData input, FillArgs args) throws OrmException { return Iterables.transform(input.stars().keySet(), Account.Id::get); } }; /** Opaque group identifiers for this change's patch sets. */ public static final FieldDef<ChangeData, Iterable<String>> GROUP = new FieldDef.Repeatable<ChangeData, String>( ChangeQueryBuilder.FIELD_GROUP, FieldType.EXACT, false) { @Override public Iterable<String> get(ChangeData input, FillArgs args) throws OrmException { Set<String> r = Sets.newHashSetWithExpectedSize(1); for (PatchSet ps : input.patchSets()) { r.addAll(ps.getGroups()); } return r; } }; public static class PatchSetProtoField extends FieldDef.Repeatable<ChangeData, byte[]> { public static final ProtobufCodec<PatchSet> CODEC = CodecFactory.encoder(PatchSet.class); private PatchSetProtoField() { super("_patch_set", FieldType.STORED_ONLY, true); } @Override public Iterable<byte[]> get(ChangeData input, FieldDef.FillArgs args) throws OrmException { return toProtos(CODEC, input.patchSets()); } } /** Serialized patch set object, used for pre-populating results. */ public static final PatchSetProtoField PATCH_SET = new PatchSetProtoField(); /** Users who have edits on this change. */ public static final FieldDef<ChangeData, Iterable<Integer>> EDITBY = new FieldDef.Repeatable<ChangeData, Integer>( ChangeQueryBuilder.FIELD_EDITBY, FieldType.INTEGER, false) { @Override public Iterable<Integer> get(ChangeData input, FillArgs args) throws OrmException { return input.editsByUser().stream() .map(Account.Id::get) .collect(toSet()); } }; /** Users who have draft comments on this change. */ public static final FieldDef<ChangeData, Iterable<Integer>> DRAFTBY = new FieldDef.Repeatable<ChangeData, Integer>( ChangeQueryBuilder.FIELD_DRAFTBY, FieldType.INTEGER, false) { @Override public Iterable<Integer> get(ChangeData input, FillArgs args) throws OrmException { return input.draftsByUser().stream() .map(Account.Id::get) .collect(toSet()); } }; /** * Users the change was reviewed by since the last author update. * <p> * A change is considered reviewed by a user if the latest update by that user * is newer than the latest update by the change author. Both top-level change * messages and new patch sets are considered to be updates. * <p> * If the latest update is by the change owner, then the special value {@link * #NOT_REVIEWED} is emitted. */ public static final FieldDef<ChangeData, Iterable<Integer>> REVIEWEDBY = new FieldDef.Repeatable<ChangeData, Integer>( ChangeQueryBuilder.FIELD_REVIEWEDBY, FieldType.INTEGER, true) { @Override public Iterable<Integer> get(ChangeData input, FillArgs args) throws OrmException { Set<Account.Id> reviewedBy = input.reviewedBy(); if (reviewedBy.isEmpty()) { return ImmutableSet.of(NOT_REVIEWED); } List<Integer> result = new ArrayList<>(reviewedBy.size()); for (Account.Id id : reviewedBy) { result.add(id.get()); } return result; } }; public static final Integer NOT_REVIEWED = -1; private static String getTopic(ChangeData input) throws OrmException { Change c = input.change(); if (c == null) { return null; } return firstNonNull(c.getTopic(), ""); } private static <T> List<byte[]> toProtos(ProtobufCodec<T> codec, Collection<T> objs) throws OrmException { List<byte[]> result = Lists.newArrayListWithCapacity(objs.size()); ByteArrayOutputStream out = new ByteArrayOutputStream(256); try { for (T obj : objs) { out.reset(); CodedOutputStream cos = CodedOutputStream.newInstance(out); codec.encode(obj, cos); cos.flush(); result.add(out.toByteArray()); } } catch (IOException e) { throw new OrmException(e); } return result; } }
[ "power9li@github.com" ]
power9li@github.com
fd0c4ef4e871ed26880d6f7d71a0e8592db6e10c
7a68d435283b8ae5e020f7a52a32391c9579d4a7
/JavaTest/src/com/core/utilities/DateCaluclator.java
b4314079310c254d07c2980a56c23e9a1802bd73
[]
no_license
farooksoft/JavaTest
4a4e84a6dcbe00cf9aed0110c6b3ec07569035f7
c59efac9d647f65c15dd03d8294b33c8432ce689
refs/heads/master
2021-01-01T19:09:12.540289
2017-07-27T10:58:02
2017-07-27T10:58:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
782
java
package com.core.utilities; import java.util.Calendar; public class DateCaluclator { public static void main(String[] args) { // pass the number of months here int i = 17; // observe im passing 3 moths, like wise u can pass any // number getDate(i); } private static void getDate(int i) { Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH); int day = cal.get(Calendar.DATE); System.out.println(year + " : " + month + " : " + day); cal.add(Calendar.MONTH, -i); int m_year = cal.get(Calendar.YEAR); int m_month = cal.get(Calendar.MONTH); int m_day = cal.get(Calendar.DATE); System.out.println(m_year + " : " + m_month + " : " + m_day); } }
[ "naath.r@gmail.com" ]
naath.r@gmail.com
fb22dd64c8ea65dc5bb56f223915dde130543ef6
23afdf79e776e2a9f9846655feab69570b90e5a5
/2.JavaCore/src/com/javarush/task/task13/task1303/Solution.java
796adeac838758cc2ce1c15e4e37724c4df5e7c3
[]
no_license
mahamantra/JavaRushTasks
335c03201a95c08f8a6d1ddfc85309cf869ac07b
9f5b5957852873e2242dd875c9ebb69cb429d545
refs/heads/master
2020-05-25T19:51:19.058051
2019-09-20T14:23:23
2019-09-20T14:23:23
187,961,700
0
0
null
null
null
null
UTF-8
Java
false
false
674
java
package com.javarush.task.task13.task1303; /* Пиво с колой не мешать */ public class Solution { public static void main(String[] args) throws Exception { print(new Beer()); print(new Cola()); } private static void print(Drink drink) { System.out.println(drink.getClass().getSimpleName()); } public interface Drink { boolean isAlcoholic(); } public static class Beer implements Drink{ public boolean isAlcoholic(){return true;} } public static class Cola implements Drink{ @Override public boolean isAlcoholic() { return false; } } }
[ "elenapoker888@gmail.com" ]
elenapoker888@gmail.com
195cd7985cc5b4000c279230507a71329f09a9de
94f3fe305d9caede4bda2508bcfd5e4ec4050245
/app/src/main/java/com/way/screenrecord/safesax/RootElement.java
09176cde73d89bcafe83b4b4121412121ce6e713
[]
no_license
paulrajgithub/ScreenRecord
feda4f70901a02f692377b5e946a9775865f58ea
d5889a05dc303aab2e090fb4505d073eb5c2cf4f
refs/heads/master
2021-01-18T17:15:53.208901
2016-03-20T03:30:54
2016-03-20T03:30:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,347
java
/** * Copyright (C) 2007 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.way.screenrecord.safesax; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.Locator; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; /** * The root XML element. The entry point for this API. Not safe for concurrent * use. * * <p>For example, passing this XML: * * <pre> * &lt;feed xmlns='http://www.w3.org/2005/Atom'> * &lt;entry> * &lt;id>crazybob&lt;/id> * &lt;/entry> * &lt;/feed> * </pre> * * to this code: * * <pre> * static final String ATOM_NAMESPACE = "http://www.w3.org/2005/Atom"; * * ... * * RootElement root = new RootElement(ATOM_NAMESPACE, "feed"); * Element entry = root.getChild(ATOM_NAMESPACE, "entry"); * entry.getChild(ATOM_NAMESPACE, "id").setEndTextElementListener( * new EndTextElementListener() { * public void end(String body) { * System.out.println("Entry ID: " + body); * } * }); * * XMLReader reader = ...; * reader.setContentHandler(root.getContentHandler()); * reader.parse(...); * </pre> * * would output: * * <pre> * Entry ID: crazybob * </pre> */ public class RootElement extends Element { final Handler handler = new Handler(); /** Proxy the locator so the user can retrieve it before parsing starts. */ final Locator locator = new Locator() { public String getPublicId() { Locator locator = handler.locator; return locator == null ? null : locator.getPublicId(); } public String getSystemId() { Locator locator = handler.locator; return locator == null ? null : locator.getSystemId(); } public int getLineNumber() { Locator locator = handler.locator; return locator == null ? -1 : locator.getLineNumber(); } public int getColumnNumber() { Locator locator = handler.locator; return locator == null ? -1 : locator.getColumnNumber(); } }; /** * Constructs a new root element with the given name. * * @param uri the namespace * @param localName the local name */ public RootElement(String uri, String localName) { super(null, uri, localName, 0); } /** * Constructs a new root element with the given name. Uses an empty string as * the namespace. * * @param localName the local name */ public RootElement(String localName) { this("", localName); } /** * Gets the SAX {@code ContentHandler}. Pass this to your SAX parser. */ public ContentHandler getContentHandler() { return this.handler; } /** * Gets the SAX locator which can be used to find the current position * within the XML. */ public Locator getLocator() { return locator; } class Handler extends DefaultHandler { Locator locator; int depth = -1; Element current = null; StringBuilder bodyBuilder = null; @Override public void setDocumentLocator(Locator locator) { this.locator = locator; } @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { int depth = ++this.depth; if (depth == 0) { // This is the root element. startRoot(uri, localName, attributes); return; } // Prohibit mixed text and elements. if (bodyBuilder != null) { throw new BadXmlException("Encountered mixed content" + " within text element named " + current + ".", locator); } // If we're one level below the current element. if (depth == current.depth + 1) { // Look for a child to push onto the stack. Children children = current.children; if (children != null) { Element child = children.get(uri, localName); if (child != null) { start(child, attributes); } } } } void startRoot(String uri, String localName, Attributes attributes) throws SAXException { Element root = RootElement.this; if (root.uri.compareTo(uri) != 0 || root.localName.compareTo(localName) != 0) { throw new BadXmlException("Root element name does" + " not match. Expected: " + root + ", Got: " + Element.toString(uri, localName), locator); } start(root, attributes); } void start(Element e, Attributes attributes) { // Push element onto the stack. this.current = e; if (e.startElementListener != null) { e.startElementListener.start(attributes); } if (e.endTextElementListener != null) { this.bodyBuilder = new StringBuilder(); } e.resetRequiredChildren(); e.visited = true; } @Override public void characters(char[] buffer, int start, int length) throws SAXException { if (bodyBuilder != null) { bodyBuilder.append(buffer, start, length); } } @Override public void endElement(String uri, String localName, String qName) throws SAXException { Element current = this.current; // If we've ended the current element... if (depth == current.depth) { current.checkRequiredChildren(locator); // Invoke end element listener. if (current.endElementListener != null) { current.endElementListener.end(); } // Invoke end text element listener. if (bodyBuilder != null) { String body = bodyBuilder.toString(); bodyBuilder = null; // We can assume that this listener is present. current.endTextElementListener.end(body); } // Pop element off the stack. this.current = current.parent; } depth--; } } }
[ "1320438999@qq.com" ]
1320438999@qq.com
2cb6437286f9761a1cd8f6adec51e297188c965a
5938512241265be9e1095e0873ab8ab35f9a75de
/app/src/main/java/com/pmh/iotblog/Fragments/SignInFragment.java
b8870ad81f16117641783526200fee47896bd189
[]
no_license
pmh142857/android-app
1b862fac0b6339ac766e59e28c243fb7888203a7
bc72fc39a9898addfea199446c83f45ddb8d4fef
refs/heads/master
2022-11-28T03:53:17.784203
2020-08-06T08:57:48
2020-08-06T08:57:48
280,627,541
1
0
null
null
null
null
UTF-8
Java
false
false
6,750
java
package com.pmh.iotblog.Fragments; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import com.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; import com.pmh.iotblog.AuthActivity; import com.pmh.iotblog.Constant; import com.pmh.iotblog.HomeActivity; import com.pmh.iotblog.R; import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; import java.util.Map; public class SignInFragment extends Fragment { private View view; private TextInputLayout layoutEmail, layoutPassword; private TextInputEditText txtEmail,txtPassword; private TextView txtSignUp; private Button btnSignIn; private ProgressDialog dialog; public SignInFragment(){ } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = inflater.inflate(R.layout.layout_sign_in,container,false); init(); return view; } private void init() { layoutPassword = view.findViewById(R.id.textLayoutPasswordSignIn); layoutEmail = view.findViewById(R.id.textLayoutEmailSignIn); txtPassword = view.findViewById(R.id.txtPasswordSignIn); txtSignUp = view.findViewById(R.id.txtSignUp); txtEmail = view.findViewById(R.id.txtEmailSignIn); btnSignIn = view.findViewById(R.id.btnSignIn); dialog = new ProgressDialog(getContext()); dialog.setCancelable(false); txtSignUp.setOnClickListener(v->{ //change fragments getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.frameAuthContainer,new SignUpFragment()).commit() ; }); btnSignIn.setOnClickListener(v->{ // validate fields first if (validate() ){ login(); } }); // txtEmail.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { if(!txtEmail.getText().toString().isEmpty()){ layoutEmail.setErrorEnabled(false); } } @Override public void afterTextChanged(Editable editable) { } }); // txtPassword.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { if(txtPassword.getText().toString().length()>7){ layoutPassword.setErrorEnabled(false); } } @Override public void afterTextChanged(Editable editable) { } }); } private boolean validate(){ if (txtEmail.getText().toString().isEmpty()){ layoutEmail.setErrorEnabled(true); layoutEmail.setError("Email is Reguired"); return false; } if (txtPassword.getText().toString().length()< 8){ layoutPassword.setErrorEnabled(true); layoutPassword.setError("Required at least 8 characters"); return false; } return true; } // login public void login(){ dialog.setMessage("Logging in"); dialog.show(); StringRequest request = new StringRequest(Request.Method.POST, Constant.LOGIN,response ->{ // get response if connection success, // sua doi cac anh xa gia tri try { JSONObject object = new JSONObject(response); if (object.getBoolean("success")){ JSONObject user = object.getJSONObject("user"); //make shared preference user SharedPreferences userPref = getActivity().getApplicationContext() .getSharedPreferences("user",getContext().MODE_PRIVATE ); SharedPreferences.Editor editor = userPref.edit(); editor.putString("token",object.getString("token")); editor.putString("name",user.getString("name")); // luu id nguoi dung post, hien menu option editor.putInt("id",user.getInt("id")); editor.putString("lastname",user.getString("lastname")); editor.putString("photo",user.getString("photo")); editor.putBoolean("isLoggedIn",true); editor.apply(); //if success goto intent Home and Toast startActivity(new Intent(((AuthActivity) getContext()), HomeActivity.class)); ((AuthActivity) getContext()).finish(); Toast.makeText(getContext(), "Login Success", Toast.LENGTH_SHORT).show(); } } catch (JSONException e) { e.printStackTrace(); } dialog.dismiss(); },error -> { // error if connection not success error.printStackTrace(); dialog.dismiss(); }){ // add parameters @Override protected Map<String, String> getParams() throws AuthFailureError { HashMap <String, String> map = new HashMap<>(); map.put("email",txtEmail.getText().toString().trim()); map.put("password",txtPassword.getText().toString()); return map; } }; //add this request to request Context context; RequestQueue queue = Volley.newRequestQueue(getContext()); queue.add(request); } }
[ "thehunter153180@gmail.com" ]
thehunter153180@gmail.com
0d813a490bfa317a5cccf5db69fb5727ece66de4
867731a4ff5fb43a7d2e0c05e0cead7e047df3c9
/src/main/java/com/tutorial/crud/repository/ProyectoRepository.java
9c9c4b9a26538e3419d0f75c457ce6b477ef520c
[]
no_license
MetalSkink/crudLoginBack
e289bd87f2b1d49022c5c69f0685137337aa9f57
b4af8cdebf93217f2c3f8cac014720d0005881aa
refs/heads/main
2023-05-30T07:34:22.215059
2021-06-01T00:26:05
2021-06-01T00:26:05
356,062,988
0
0
null
null
null
null
UTF-8
Java
false
false
438
java
package com.tutorial.crud.repository; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.tutorial.crud.entity.Proyecto; @Repository public interface ProyectoRepository extends JpaRepository<Proyecto, Integer>{ //Optional<Proyecto> findByNombreProyecto(String nombreProyecto); //boolean existByNombreProyecto(String nombreProyecto); }
[ "xavier_ortega98@hotmail.com" ]
xavier_ortega98@hotmail.com
02c8bf9cd075a1f7e40de9de58d6847d7ea01e8a
65f3c1147cf53c2e4f54f998afb943b1cdfb2550
/src/pageobject/backend/AdvertisingPage.java
611bfa3e803c80e908c475ac3629f05fe3507cc5
[]
no_license
zerah-doan/framework
1d5de607a9e184175448cdf8d6b55959a137ebab
b24e1f648220f1b1510217a319090008d863bdeb
refs/heads/master
2021-01-01T17:46:29.529355
2017-07-24T06:20:39
2017-07-24T06:20:39
98,155,561
0
0
null
null
null
null
UTF-8
Java
false
false
5,785
java
package pageobject.backend; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import framework.action.WebActions; import util.Log; public class AdvertisingPage { @FindBy(xpath = "//a[./text()='Add New Advertisement']") private WebElement btnAddAdv; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@name='supplier_name']") private WebElement txtCompany; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@name='supplier_street']") private WebElement txtStreet; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@name='supplier_zip']") private WebElement txtZip; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@name='supplier_city']") private WebElement txtCity; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@name='supplier_name']") private WebElement drpCountry; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@name='supplier_phone']") private WebElement txtTelephone; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@name='supplier_email']") private WebElement txtEmail; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@name='supplier_url']") private WebElement txtUrl; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@id='fileUpload']") private WebElement txtLogo; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@data-value-field='closing_date']") private WebElement txtExpiration; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//input[@data-bind='value:weight']") private WebElement txtWeight; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//a[./text()='Update']") private WebElement btnUpdate; @FindBy(xpath = "//*[@id='advertisements-grid']//table//tr//a[./text()='Cancel']") private WebElement btnCancelUpdate; @FindBy(xpath = "//div[./text()='Save Category']") private WebElement btnSaveCat; private WebActions action; public AdvertisingPage(WebDriver driver) { PageFactory.initElements(driver, this); this.action = new WebActions(driver); } public void goToPage() { action.click(By.xpath("//*[@id='proair-nav-bar']/ul/li[./a/text()='Advertisements']")); action.waitForAngular(); action.waitForAngular(); action.waitForAngular(); } public void addAdvertising(String company, String street, String zip, String city, String phone, String email) { Log.logInfo("Add advertising user"); action.click(btnAddAdv); action.waitForAngular(); fillRequiredInfo(company, street, zip, city, phone, email); action.click(btnUpdate); action.waitForAngular(); } public void editAdvertising(String oldCompany, String company, String street, String zip, String city, String phone, String email) { Log.logInfo("Edit advertising user: " + oldCompany); clickEditAdvertising(oldCompany); action.waitForAngular(); fillRequiredInfo(company, street, zip, city, phone, email); action.click(btnUpdate); action.waitForAngular(); } public void fillRequiredInfo(String company, String street, String zip, String city, String phone, String email) { action.type(txtCompany, company); action.type(txtStreet, street); action.type(txtZip, zip); action.type(txtCity, city); action.type(txtTelephone, phone); action.type(txtEmail, email); } public void fillNotRequiredInfo(String url, String logo, String exp, String country, String region, int weight) { } public void openCategoryByRow(int row) { action.click(By.xpath("//*[@id='advertisements-grid']//table//tr[" + row + "]//a[./text()='Category']")); action.waitForAngular(); } public void openCategory(String company) { action.click(By .xpath("//*[@id='advertisements-grid']//table//tr[count(//*[@id='advertisements-grid']//table//tr[.//text()='" + company + "']/preceding-sibling::*)+1]//a[./text()='Category']")); action.waitForAngular(); action.waitForAngular(); } public void clickEditAdvertising(String company) { action.click(By .xpath("//*[@id='advertisements-grid']//table//tr[count(//*[@id='advertisements-grid']//table//tr[.//text()='" + company + "']/preceding-sibling::*)+1]//a[./text()='Edit']")); action.waitForAngular(); } public void deleteAdvertising(String company) { Log.logInfo("Delete advertising user: " + company); action.click(By .xpath("//*[@id='advertisements-grid']//table//tr[count(//*[@id='advertisements-grid']//table//tr[.//text()='" + company + "']/preceding-sibling::*)+1]//a[./text()='Delete']")); action.confirmPopup(true); } public boolean isCompanyExisting(String company) { return action.isDisplayed(By.xpath("//*[@id='advertisements-grid']//table//tr[.//text()='" + company + "']")); } public boolean isCompanyNotExisting(String company) { return action .isNotDisplayed(By.xpath("//*[@id='advertisements-grid']//table//tr[.//text()='" + company + "']")); } public void selectCategory(String company, List<String> cats) { Log.logInfo("Select category for company: " + company); openCategory(company); List<WebElement> allCat = action.findElements(By.xpath("//form[@name='userForm']//input[@type='checkbox']")); String catTitle; for (WebElement cat : allCat) { catTitle = cat.findElement(By.xpath("./following-sibling::p")).getText(); if (cats.contains(catTitle) && !cat.isSelected()) { Log.logInfo("---Select category: " + catTitle); action.click(cat); action.type(cat.findElement(By.xpath("../following-sibling::input")), catTitle + " description"); } } action.click(btnSaveCat); action.waitForAngular(); } }
[ "Quang@vn-soxes-nb-056.soxes.switzerland" ]
Quang@vn-soxes-nb-056.soxes.switzerland
98ba206e922ac7ff3c8891f41ce74edc81088083
15ec42f35e4dbc6fc38bd6c0d0b2fb22523e479f
/app/src/main/java/com/example/digiservice/model/DeviceInfo.java
bbacdb3fe701f645e1a19bc3f5326da9bac5ab5e
[]
no_license
azharsiddiq36/ServiceApp
06aef74790d45fc6949587aba18ef04b66e2960b
cc71c41357f2b464dd140c530e9074d9e31acca7
refs/heads/master
2023-06-24T16:59:12.645787
2021-07-23T02:26:54
2021-07-23T02:26:54
361,321,354
0
0
null
null
null
null
UTF-8
Java
false
false
262
java
package com.example.digiservice.model; import java.io.Serializable; public class DeviceInfo implements Serializable { public String device; public String os_version; public String app_version; public String serial; public String regid; }
[ "azharsiddiq36@gmail.com" ]
azharsiddiq36@gmail.com
71bc1c48c4e0f73acf3072c46033538fd548e476
e88fb99d7b64d88ff0edb7af54956c3deb75ac06
/src/Parser.java
51c55327560c7a3eef72ff0aa6c719a242320d18
[]
no_license
FAISSALH3/JavaAssemblerByFH
a64cbd9d5df37a5a89b0b1d903ee6eeb3b7107b2
066c9f6195ead2b99a90b6a9dca1a003e92007de
refs/heads/main
2023-01-29T16:52:53.128387
2020-12-14T03:47:18
2020-12-14T03:47:18
321,225,073
0
0
null
null
null
null
UTF-8
Java
false
false
3,106
java
import java.io.*; public class Parser { public String currentCommand = "";// current command public String inputFile; // file being assembled public int LineCount = 0; // current line number in the file public String currentLine;// current line in file private BufferedReader fileReader; // input file reader // command types enum CommandType { A_COMMAND, // A instruction C_COMMAND, // C instruction L_COMMAND // (Symbol) } public Parser(String file) throws FileNotFoundException // open input file and get ready to parse it { inputFile = file; fileReader = new BufferedReader(new FileReader(file)); LineCount = 0; } public boolean advance() throws IOException { while (true) { currentLine = fileReader.readLine(); LineCount++; if (currentLine == null) return false; currentCommand = currentLine.replaceAll("//.*$", "").trim(); if (currentCommand.equals("")) continue; return true; } } // returns the type of the current command // A_COMMAND for @xxx // C_COMMAND for dest=comp;jump // L_COMMAND for a label, (xxx) public CommandType commandType() { if (currentCommand.startsWith("@")) { return CommandType.A_COMMAND; } else if (currentCommand.startsWith("(")) { return CommandType.L_COMMAND; } else { return CommandType.C_COMMAND; } } // returns symbol or decimal xxx of the current command // only applies to A_COMMAND or L_COMMAND public String symbol() { return currentCommand.substring(1).replace(")", ""); } // returns dest field of current command (8 possibilities) // only applies to C_COMMAND public String dest() { String dest = ""; if (currentCommand.contains("=")) { String[] array = currentCommand.split("="); dest = array[0]; } return dest; } // returns the comp field of the current command (28 possibilities) // only applies to C_COMMAND public String comp() { String comp; if (currentCommand.contains("=")) { String[] array = currentCommand.split("="); String[] array1 = array[1].split(";"); comp = array1[0]; } else { String[] array = currentCommand.split(";"); comp = array[0]; } return comp; } // returns the jump field of the current command (8 possibilities) // only applies to C_COMMAND public String jump() { String jump = ""; if (currentCommand.contains(";")) { String[] array = currentCommand.split(";"); jump = array[1]; } return jump; } // close input file public void close() throws IOException { fileReader.close(); return; } }
[ "faissalhamdi@hotmail.com" ]
faissalhamdi@hotmail.com
9d23ca2ccbb0f8d1c1d6ec96ac0d5c772a16f3bf
26f18fbcefcdf27369f9d69969a641abfe8c003b
/EventBus/app/src/main/java/com/tilismtech/eventbus/Activity2.java
2f9d84a1f5a3b7d20a288407f46c4d746af1681d
[]
no_license
adnan94/SampleProjectsAndroid
0926255b43da1ca890207e490a9662d6cdf5464a
581ec1d6ecfc51e064cb251abe8c9eaa29b7bc55
refs/heads/master
2023-03-08T12:47:10.732236
2023-02-25T05:10:53
2023-02-25T05:10:53
141,850,932
0
0
null
2023-03-02T21:36:20
2018-07-21T22:54:45
Java
UTF-8
Java
false
false
467
java
package com.tilismtech.eventbus; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import org.greenrobot.eventbus.EventBus; public class Activity2 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_2); EventBus.getDefault().post(new MyMessageEvent("Eventbus Working")); finish(); } }
[ "adnan.ahmed94k@gmail.com" ]
adnan.ahmed94k@gmail.com
632b7242c421db39785a66a55903a9faa5ef5c13
fb174ae7f9cc2f41b491662b63d29d1c984cc2c7
/src/utilities/GetCurrentMonth.java
d17f7dff9b9b16217d2c3227ae06762d3727d538
[]
no_license
nitintajane3/Project
26b175deb2a5b791869b843707ffcbeef206dca4
b7c586487198c0e611e71a28d1dc1c4f588cd70f
refs/heads/master
2020-03-24T20:25:32.992227
2018-10-30T11:21:55
2018-10-30T11:21:55
142,977,153
0
0
null
null
null
null
UTF-8
Java
false
false
431
java
package utilities; import org.openqa.selenium.WebElement; public class GetCurrentMonth { public static String Month(WebElement vairblename) throws InterruptedException { Thread.sleep(1000); String labelname = vairblename.getText(); String substringdevde = labelname.substring(0,3); String removeingspace = substringdevde.replaceAll("-","").trim(); return removeingspace; } }
[ "nitintajane3@gmail.com" ]
nitintajane3@gmail.com
35a76c88fd0c6ae65a61ff27013a0f4dc22c06f0
8f85fad0ce168c5cda44f84d18e09f7071acaf10
/kodilla-patterns2/src/main/java/com/kodilla/patterns2/decorator/pizza/BasicPizzaOrder.java
605d9f5ec0ca76c22ddf3a36c3036920c5c68d7c
[]
no_license
kaminski-org/dariusz-kaminski-kodilla-java
bb1c71be5adb21ef40b89c1b7147bc2b6175b265
699f95927a162e554fc3dea408e44278115d28e2
refs/heads/master
2022-09-14T14:46:00.511208
2019-08-10T16:48:33
2019-08-10T16:48:33
267,944,513
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package com.kodilla.patterns2.decorator.pizza; import java.math.BigDecimal; public class BasicPizzaOrder implements PizzaOrder { @Override public BigDecimal getCost() { return new BigDecimal(15.0); } @Override public String getIngredients() { return "Pizza with: tomato sauce and cheese"; } }
[ "kaminski.darek@icloud.com" ]
kaminski.darek@icloud.com
4d1fd6428d1ea18b6a6da1b757c6c343341aec48
fc1a1c82e633d91851595a2585670f8ff9697e24
/src/main/java/com/davidopluslau/barhub/db/MenuUtils.java
ba084d13e758aca4e4e20ebf65e67114470ac145
[]
no_license
davidopluslau/bar-hub
8b18f4198ca00a3b1b78247e309683d9140fa7a1
15cd3cbc581c5c247c86e39ed822b6a86a3e3eff
refs/heads/master
2022-09-13T15:49:17.430365
2019-10-26T17:42:38
2019-10-26T17:42:38
157,300,218
0
0
null
2022-09-08T01:01:41
2018-11-13T01:13:40
Java
UTF-8
Java
false
false
650
java
package com.davidopluslau.barhub.db; import static com.davidopluslau.barhub.db.generated.Tables.MENU_TABLE; import com.networknt.service.SingletonServiceFactory; public class MenuUtils { private static DatabaseProvider db; public MenuUtils() { } public static String getCurrentMenuVersion() { return getDb().dsl().select(MENU_TABLE.VERSION) .from(MENU_TABLE) .orderBy(MENU_TABLE.VERSION.desc()) .limit(1) .fetchOneInto(String.class); } private static DatabaseProvider getDb() { if (db == null) { db = SingletonServiceFactory.getBean(DatabaseProvider.class); } return db; } }
[ "dlau@spotify.com" ]
dlau@spotify.com
b183644472a633c73af034ac13102aee364d8eb7
dd2177acaf523ea22f12254e1a3e052588edc3d5
/ScoreInputInterface/src/scoreinputinterface/Main.java
9feee97c66044550c33a836159354cb043032972
[]
no_license
snowmancc/SomeJavaPractice
108d31aa8a82afba2ff7458bb0509d3a4cb5cda6
b03669f5ad767b99c624ae7e84873251bfaf3b69
refs/heads/master
2020-07-30T01:08:22.752562
2019-09-21T17:57:48
2019-09-21T17:57:48
210,030,344
0
0
null
null
null
null
UTF-8
Java
false
false
3,106
java
package scoreinputinterface; import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("請輸入人數"); int member = scanner.nextInt(); Student[] students = new Student[member]; for(int i= 0; i < member; i++) { System.out.println("請輸入學生座號: "); int address = scanner.nextInt(); System.out.println("請輸入學生成績: "); int score = scanner.nextInt(); students[i] = new Student(address, score); } int op; System.out.println("請選擇功能 1.排序 2.打亂 3.離開"); while((op = scanner.nextInt()) != 3) { if(op == 1) { sort(students, choiceCompare(scanner), choiceOrder(scanner)); print(students); } else if(op == 2) { int ranNum = (int)(Math.random()); for(int i = 0; i < students.length; i++) { ranNum = (int)(Math.random() * (students.length - i) + i); Student tmp = students[i]; students[i] = students[ranNum]; students[ranNum] = tmp; } print(students); } System.out.println("請選擇功能 1.排序 2.打亂 3.離開"); } } public static void swap(Student[] students, int a1, int a2) { Student tmp = students[a1]; students[a1] = students[a2]; students[a2] = tmp; } public static SortOrderInterface choiceOrder(Scanner scanner) { System.out.println("請輸入要排序方式 1.大到小 2.小到大"); int choice = scanner.nextInt(); if (choice == 1) { return new SortBigToSmall(); } else if (choice == 2) { return new SortSmallToBig(); } return null; } public static void sort(Student[] students,CompareInterface compare, SortOrderInterface order) { for(int i = 0; i < students.length - 1; i++) { for(int j = 0; j < students.length - i - 1; j++){ if(compare.compare(students[j], students[j + 1], order)) { swap(students, j, j + 1); } } } } public static void print(Student[] students) { for(int i = 0; i < students.length; i ++) { System.out.println(students[i]); } } public static CompareInterface choiceCompare(Scanner scanner) { System.out.println("請輸入要排序依據 1.座號 2.成績"); int choice = scanner.nextInt(); if (choice == 1) { return new CompareAddress(); } else if (choice == 2) { return new CompareScore(); } return null; } }
[ "c11037at@gmail.com" ]
c11037at@gmail.com
7f6023f69727447e1541dcf4593aafab090d58c7
9552eeea8217e26ac5d2cdf8c197dbec231014fc
/src/main/java/com/selectica/Package201506161/definitions/CFR1BO/conditions/ConditionExecuteTaskESignatureResetScript.java
ef6c096e959cb38a186608b4ec557cc5a0af3357
[]
no_license
epavlovskaya/rcfLenaBaseDemo
05db6503c494b71edb4d748a00ef866fd7768ac2
3675d57a0fd6c2936e62b64606ad3c0f374e327d
refs/heads/master
2021-01-25T10:00:38.924510
2015-06-16T09:52:21
2015-06-16T09:52:21
37,266,126
0
0
null
null
null
null
UTF-8
Java
false
false
365
java
package com.selectica.Package201506161.definitions.CFR1BO.conditions; import com.selectica.Package201506161.eclm.definitions.shared.conditions.ESignatureResetAvailableCondition; import com.selectica.rcfscripts.AbstractBOReadScript; /**ESignatureResetAvailable*/ public class ConditionExecuteTaskESignatureResetScript extends ESignatureResetAvailableCondition { }
[ "user@rcfproj.aws.selectica.net" ]
user@rcfproj.aws.selectica.net
def5bd3c62600cfb89c0c961b4884b4a3d2e0988
8efbf453a82b79e9388d17eaae9886a98f310b32
/app/src/androidTest/java/com/example/mynews/MainActivityTest.java
6822ffd2cd46ceadb4a0e880b5b16cf096fd3837
[]
no_license
RayanYanat/MyNews2.0
3674501d29e2b6569461f5b96ae6a3d3506f3862
65292f4cdf9b5188d60c7ada871dee0be6c000b7
refs/heads/master
2023-05-28T13:16:32.246907
2021-06-23T13:06:30
2021-06-23T13:06:30
275,803,795
0
0
null
null
null
null
UTF-8
Java
false
false
954
java
package com.example.mynews; import androidx.test.rule.ActivityTestRule; import org.junit.Rule; import org.junit.Test; import controllers.MainActivity; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; public class MainActivityTest { @Rule public ActivityTestRule<MainActivity> mainActivityTestRule = new ActivityTestRule<>(MainActivity.class); @Test public void interfaceDisplayTest() throws Exception { onView(withId(R.id.activity_main_drawer_layout)).check(matches(isDisplayed())); onView(withId(R.id.activity_main_toolbar)).check(matches(isDisplayed())); onView(withId(R.id.tabs)).check(matches(isDisplayed())); onView(withId(R.id.view_pager)).check(matches(isDisplayed())); } }
[ "rayan.yanat@gmail.com" ]
rayan.yanat@gmail.com
1548ae5cf6f3261737189c68ab903c227158d586
5f4181429c78ef56cb811572892fc6b8c24d4620
/src/main/java/lms/mapper/LmsProductExportItemMapper.java
a045657f56ed76e1618707ddd0d3b1f24878cf70
[ "Apache-2.0" ]
permissive
FiveTwoTeam/LogisticsManagementSystem
0b01ceaacea0bdee45a7f4945efe58416585be96
92ec705575bd5a42a29a993ed74ce67a4f6a5b90
refs/heads/master
2021-05-05T15:57:54.627591
2017-09-28T07:02:58
2017-09-28T07:02:58
103,207,328
1
2
null
null
null
null
UTF-8
Java
false
false
1,121
java
package lms.mapper; import lms.model.LmsProductExportItem; import lms.model.LmsProductExportItemExample; import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; import java.util.List; public interface LmsProductExportItemMapper { int countByExample(LmsProductExportItemExample example); int deleteByExample(LmsProductExportItemExample example); int deleteByPrimaryKey(BigDecimal id); int insert(LmsProductExportItem record); int insertSelective(LmsProductExportItem record); List<LmsProductExportItem> selectByExample(LmsProductExportItemExample example); LmsProductExportItem selectByPrimaryKey(BigDecimal id); int updateByExampleSelective(@Param("record") LmsProductExportItem record, @Param("example") LmsProductExportItemExample example); int updateByExample(@Param("record") LmsProductExportItem record, @Param("example") LmsProductExportItemExample example); int updateByPrimaryKeySelective(LmsProductExportItem record); int updateByPrimaryKey(LmsProductExportItem record); List<LmsProductExportItem> findproductAndProductExportMap(); }
[ "13413423055@163.com" ]
13413423055@163.com
f362e39a90bc0b7b448a9749300c20154bf3353e
07d9edd46c8bda2ece49dc47960c018d32cdbc92
/monitorMqtt/monitorMqtt-impl/src/main/java/com/wecon/box/util/GroupOp.java
207cfb9ed3aa966b85933a2f47f69ea52d79cb55
[]
no_license
caijinwei/monitorMqtt
429f548d7ab656c06076668b7b11b0f127903ad7
00105cb79cebe2e1bf8125e96e793901a1ee1897
refs/heads/master
2020-03-10T02:07:07.503798
2018-05-10T17:35:06
2018-05-10T17:35:06
129,128,383
1
0
null
null
null
null
UTF-8
Java
false
false
2,137
java
package com.wecon.box.util; import com.wecon.common.util.CommonUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by whp on 2017/8/28. */ public class GroupOp { /** * 根据通讯口ID分组 * @param cfgList * @param filterKeys * @return */ public static Map<String, List<Map>> groupCfgFilterByCom(List<Map> cfgList, String... filterKeys){ if(null == cfgList || cfgList.size() == 0){ return null; } return groupCfgByKey("com", cfgList, filterKeys); } /** * 根据机器码分组 * @param cfgList * @param filterKeys * @return */ public static Map<String, List<Map>> groupCfgByMachineCode(List<Map> cfgList , String... filterKeys){ if(null == cfgList || cfgList.size() == 0){ return null; } return groupCfgByKey("machine_code", cfgList, filterKeys); } /** * 根据用户名分组 * @param cfgList * @return */ public static Map<String, List<Map>> groupCfgByUserName(List<Map> cfgList){ if(null == cfgList || cfgList.size() == 0){ return null; } return groupCfgByKey("username", cfgList); } private static Map<String, List<Map>> groupCfgByKey(String byKey, List<Map> cfgList , String... filterKeys){ Map<String, List<Map>> gCfgMap = new HashMap<String, List<Map>>(); for(Map m : cfgList){ Object byKeyOj = m.get(byKey); if(CommonUtils.isNullOrEmpty(byKeyOj)) continue; List<Map> mCfgLst = gCfgMap.get(byKeyOj); if(null == mCfgLst){ mCfgLst = new ArrayList<>(); } if(filterKeys.length > 0){ Map mr = new HashMap(); for (String key : filterKeys){ mr.put(key, m.get(key)); } mCfgLst.add(mr); }else{ mCfgLst.add(m); } gCfgMap.put(byKeyOj.toString(), mCfgLst); } return gCfgMap; } }
[ "cai950724@163.com" ]
cai950724@163.com
af97afa09d2d8b0443c270e916aae5131d01fcc2
9531f71fa3d65d6873142b0103a2e520b4c607f0
/src/DAO/GenericDAO.java
81e1f716fecd9ea771263c813de2a2a7647a3bfd
[]
no_license
GuibsonKrause/Peixaria_Hibernate
2078fd2f74aa64263d54f9167c1ab09cf82c75dc
27b6929e8d796c2f74c4a62d624cb0739fec4e3e
refs/heads/master
2021-04-27T10:20:01.506826
2019-12-17T02:22:09
2019-12-17T02:22:09
122,535,236
0
0
null
null
null
null
UTF-8
Java
false
false
2,754
java
package DAO; import java.io.Serializable; import java.sql.SQLException; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.criterion.Projections; /** * * @author gkrause */ public class GenericDAO { public GenericDAO() { } public void inserir( Object obj ) throws SQLException, ClassNotFoundException { Session sessao; sessao = hibernate.HibernateConnection.getSessionFactory().openSession(); sessao.beginTransaction(); sessao.save(obj); sessao.getTransaction().commit(); sessao.close(); } public void alterar ( Object obj ) throws ClassNotFoundException, SQLException { Session sessao; sessao = hibernate.HibernateConnection.getSessionFactory().openSession(); sessao.beginTransaction(); sessao.update(obj); sessao.getTransaction().commit(); sessao.close(); } public void excluir ( Object obj ) throws SQLException { Session sessao; sessao = hibernate.HibernateConnection.getSessionFactory().openSession(); sessao.beginTransaction(); sessao.delete(obj); sessao.getTransaction().commit(); sessao.close(); } public List listar(Class classe) { List lista; Session sessao; sessao = hibernate.HibernateConnection.getSessionFactory().openSession(); sessao.beginTransaction(); Criteria cons = sessao.createCriteria(classe); lista = cons.list(); sessao.getTransaction().commit(); sessao.close(); return lista; } public int contar(Class classe) { int total; Session sessao; sessao = hibernate.HibernateConnection.getSessionFactory().openSession(); sessao.beginTransaction(); Criteria cons = sessao.createCriteria(classe); total = ((Number) cons.setProjection(Projections.rowCount()).uniqueResult()).intValue(); sessao.getTransaction().commit(); sessao.close(); return total; } public Object get(Class classe, Serializable id ) throws SQLException { List lista; Session sessao; sessao = hibernate.HibernateConnection.getSessionFactory().openSession(); sessao.beginTransaction(); Object obj = sessao.get(classe, id); sessao.getTransaction().commit(); sessao.close(); return obj; } }
[ "oliveira.guibson@hotmail.com" ]
oliveira.guibson@hotmail.com
4c4c50250e336d0e62813bf1bc81896664ab101f
447520f40e82a060368a0802a391697bc00be96f
/apks/playstore_apps/com_spotify_music/source/com/spotify/libgl/prog/ShaderException.java
a3be779137927dc00eccb800f3514d8c70189e00
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
357
java
package com.spotify.libgl.prog; public class ShaderException extends Exception { private static final long serialVersionUID = 7205457241285638425L; public ShaderException(String paramString) { super(paramString); } public ShaderException(String paramString, Throwable paramThrowable) { super(paramString, paramThrowable); } }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
93cf4a7047a3936309be0118bfc232f34ad379ce
b05fb9d0124116c337b9b030eb09b3b5f45c62cd
/app/src/main/java/com/ilkayaktas/projectname/views/activities/appbarlayout/AppBarLayoutMvpPresenter.java
210b6184ddb283e8dad6e2e7eb905c02a0a05234
[]
no_license
ilkayaktas/ProjectVelodrome
4ad7fb67c00d996234a72598c70a1dae87236e59
ba521df4b8c02ee838462a4a0f840b725be99d94
refs/heads/master
2021-10-10T01:20:59.788109
2019-01-05T12:43:38
2019-01-05T12:43:38
100,288,852
4
1
null
null
null
null
UTF-8
Java
false
false
284
java
package com.ilkayaktas.projectname.views.activities.appbarlayout; import com.ilkayaktas.projectname.views.activities.base.MvpPresenter; /** * Created by ilkay on 12/03/2017. */ public interface AppBarLayoutMvpPresenter<V extends AppBarLayoutMvpView> extends MvpPresenter<V> { }
[ "ilkayaktas@gmail.com" ]
ilkayaktas@gmail.com
bf2cfa72c630911ccc5439803fee554b295c6025
f7c40474ef3370b8c2fd7329a014e159df514178
/src/main/java/pom/NHLHomepage.java
d541969f61c65588f47335957940b18d8594b773
[]
no_license
sheikh210/-2021SummerWDEAutomationFramework
8b83e412a6c28d601f7a5ee812a46cf753cb40f9
5087da5fc1368826f2f2cfd48890e21affce15c5
refs/heads/master
2023-07-31T13:29:42.517410
2021-09-16T03:31:38
2021-09-16T03:31:38
406,601,029
1
0
null
null
null
null
UTF-8
Java
false
false
216
java
package pom; import baseAPI.BasePage; import org.openqa.selenium.support.PageFactory; public class NHLHomepage extends BasePage { public NHLHomepage() { PageFactory.initElements(driver, this); } }
[ "ssheikh210@gmail.com" ]
ssheikh210@gmail.com
5d0cfe04a31f1b6c6282d0585e3a10aca5f2ba06
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_a06d0527c5701477635ca5fabca8ac04cec72629/ProjectManager/2_a06d0527c5701477635ca5fabca8ac04cec72629_ProjectManager_t.java
558481a41a1a90430c962902bbca87bccd65a016
[]
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,735
java
/* * This file is part of the Alitheia system, developed by the SQO-OSS * consortium as part of the IST FP6 SQO-OSS project, number 033331. * * Copyright 2007-2008 by the SQO-OSS consortium members <info@sqo-oss.eu> * * 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. * * 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 eu.sqooss.impl.service.web.services; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Hashtable; import java.util.List; import java.util.Map; import eu.sqooss.impl.service.web.services.datatypes.WSDeveloper; import eu.sqooss.impl.service.web.services.datatypes.WSDirectory; import eu.sqooss.impl.service.web.services.datatypes.WSFileGroup; import eu.sqooss.impl.service.web.services.datatypes.WSProjectFile; import eu.sqooss.impl.service.web.services.datatypes.WSProjectVersion; import eu.sqooss.impl.service.web.services.datatypes.WSStoredProject; import eu.sqooss.impl.service.web.services.datatypes.WSVersionStats; import eu.sqooss.impl.service.web.services.utils.ProjectManagerDatabase; import eu.sqooss.impl.service.web.services.utils.ProjectSecurityWrapper; import eu.sqooss.service.db.DBService; import eu.sqooss.service.db.Directory; import eu.sqooss.service.db.ProjectFile; import eu.sqooss.service.db.ProjectVersion; import eu.sqooss.service.db.StoredProject; import eu.sqooss.service.logging.Logger; import eu.sqooss.service.security.SecurityManager; public class ProjectManager extends AbstractManager { private Logger logger; private ProjectManagerDatabase dbWrapper; private ProjectSecurityWrapper securityWrapper; public ProjectManager(Logger logger, DBService db, SecurityManager security) { super(db); this.logger = logger; this.dbWrapper = new ProjectManagerDatabase(db); this.securityWrapper = new ProjectSecurityWrapper(security, db); } /** * @see eu.sqooss.service.web.services.WebServices#getEvaluatedProjects(String, String) */ public WSStoredProject[] getEvaluatedProjects(String userName, String password) { logger.info("Gets the evaluated project list! user: " + userName); db.startDBSession(); try { securityWrapper.checkDBReadAccess(userName, password); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSStoredProject[] result = dbWrapper.getEvaluatedProjects(); db.commitDBSession(); return (WSStoredProject[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getStoredProjects(String, String) */ public WSStoredProject[] getStoredProjects(String userName, String password) { logger.info("Gets the stored project list! user: " + userName); db.startDBSession(); try { securityWrapper.checkDBReadAccess(userName, password); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSStoredProject[] result = dbWrapper.getStoredProjects(new Hashtable<String, Object>()); db.commitDBSession(); return (WSStoredProject[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getProjectByName(String, String, String) */ public WSStoredProject getProjectByName(String userName, String password, String projectName) { logger.info("Retrieve project! user: " + userName + "; project name: " + projectName); db.startDBSession(); try { securityWrapper.checkDBProjectsReadAccess( userName, password, null, projectName); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); Map<String, Object> properties = new Hashtable<String, Object>(1); properties.put("name", projectName); WSStoredProject[] projects = dbWrapper.getStoredProjects(properties); db.commitDBSession(); if ((projects != null) && (projects.length != 0)) { return projects[0]; } else { return null; } } /** * @see eu.sqooss.service.web.services.WebServices#getProjectVersionsByProjectId(String, String, long) */ public WSProjectVersion[] getProjectVersionsByProjectId(String userName, String password, long projectId) { logger.info("Retrieve stored project versions! user: " + userName + "; project's id: " + projectId); db.startDBSession(); try { securityWrapper.checkDBProjectsReadAccess( userName, password, new long[] {projectId}, null); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSProjectVersion[] result = dbWrapper.getProjectVersionsByProjectId(projectId); db.commitDBSession(); return (WSProjectVersion[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getProjectVersionsByIds(String, String, long[]) */ public WSProjectVersion[] getProjectVersionsByIds(String userName, String password, long[] projectVersionsIds) { logger.info("Retrieve project versions! user: " + userName + "; project versions' ids: " + Arrays.toString(projectVersionsIds)); db.startDBSession(); try { securityWrapper.checkProjectVersionsReadAccess( userName, password, projectVersionsIds); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSProjectVersion[] result = dbWrapper.getProjectVersionsByIds( asCollection(projectVersionsIds)); db.commitDBSession(); return (WSProjectVersion[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getProjectVersionsByVersionNumbers(String, String, long, long[]) */ public WSProjectVersion[] getProjectVersionsByVersionNumbers( String userName, String password, long projectId, long[] versionNumbers) { logger.info("Retrieve project versions by project id and version numbers! user: " + userName + "; project id: " + projectId + "; version numbers: " + Arrays.toString(versionNumbers)); db.startDBSession(); try { securityWrapper.checkDBReadAccess(userName, password); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSProjectVersion[] result = dbWrapper.getProjectVersionsByVersionNumbers( projectId, asCollection(versionNumbers)); db.commitDBSession(); return (WSProjectVersion[]) normalizeWSArrayResult(result); } public long getVersionsCount( String userName, String password, long projectId) { logger.info("Retrieve total number of versions! user: " + userName + "; project id: " + Long.toString(projectId)); db.startDBSession(); try { long[] projectIds = {projectId}; securityWrapper.checkDBProjectsReadAccess( userName, password, projectIds, null); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); long result = StoredProject.getVersionsCount(projectId); db.commitDBSession(); return result; } /** * @see eu.sqooss.service.web.services.WebServices#getFirstProjectVersions(String, String, long[]) */ public WSProjectVersion[] getFirstProjectVersions(String userName, String password, long[] projectsIds) { db.startDBSession(); StringBuilder b = new StringBuilder(); for (long l : projectsIds) { b.append(l); b.append(","); } logger.info("Retrieving first projectVersions " + b.toString()); try { securityWrapper.checkDBProjectsReadAccess(userName, password, projectsIds, null); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); String paramProjectIds = "project_ids"; String query = "select pv " + "from ProjectVersion pv " + "where pv.project.id in (:" + paramProjectIds + ")" + " and pv.version= " + " (select min(pv1.version) " + " from ProjectVersion pv1 " + " where pv1.project in (:" + paramProjectIds + ")) "; Map<String, Collection> queryParameters = new Hashtable<String, Collection>(1); queryParameters.put(paramProjectIds, asCollection(projectsIds)); List<ProjectVersion> projectVersions = (List<ProjectVersion>) db.doHQL(query, null, queryParameters); b = new StringBuilder(); for (ProjectVersion v : projectVersions) { b.append(v.getVersion()); b.append(","); } logger.debug("Got versions " + b.toString()); WSProjectVersion[] result = WSProjectVersion.asArray(projectVersions); db.commitDBSession(); return (WSProjectVersion[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getLastProjectVersions(String, String, long[]) */ public WSProjectVersion[] getLastProjectVersions(String userName, String password, long[] projectsIds) { logger.info("Retrieve last project version! user: " + userName + "; project id: " + Arrays.toString(projectsIds)); db.startDBSession(); try { securityWrapper.checkDBProjectsReadAccess(userName, password, projectsIds, null); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSProjectVersion[] result = dbWrapper.getLastProjectVersions( asCollection(projectsIds)); db.commitDBSession(); return (WSProjectVersion[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getProjectsByIds(String, String, long[]) */ public WSStoredProject[] getProjectsByIds(String userName, String password, long[] projectsIds) { logger.info("Retrieve stored projects! user: " + userName + "; projects' ids: " + Arrays.toString(projectsIds) ); db.startDBSession(); try { securityWrapper.checkDBProjectsReadAccess(userName, password, projectsIds, null); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSStoredProject[] result = dbWrapper.getProjectsByIds(asCollection(projectsIds)); db.commitDBSession(); return (WSStoredProject[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getFilesByProjectId(String, String, String) */ public WSProjectFile[] getFilesByProjectId(String userName, String password, long projectId) { logger.warn("Deprecated getFilesByProjectId called. PID=" + projectId); db.startDBSession(); try { securityWrapper.checkDBProjectsReadAccess( userName, password, new long[] {projectId}, null); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSProjectFile[] result = dbWrapper.getFilesByProjectId(projectId); db.commitDBSession(); return (WSProjectFile[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getFilesByProjectVersionId(String, String, long) */ public WSProjectFile[] getFilesByProjectVersionId(String userName, String password, long projectVersionId) { logger.info("Get file list for project version ID " + projectVersionId); db.startDBSession(); try { securityWrapper.checkProjectVersionsReadAccess( userName, password, new long[] {projectVersionId}); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); ProjectVersion v = db.findObjectById(ProjectVersion.class, projectVersionId); List<ProjectFile> files = ProjectFile.getFilesForVersion(v); WSProjectFile[] result = new WSProjectFile[files.size()]; int i = 0; for (ProjectFile f : files) { result[i++]=WSProjectFile.getInstance(f); } db.commitDBSession(); return (WSProjectFile[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getFileGroupsByProjectId(String, String, long) */ public WSFileGroup[] getFileGroupsByProjectId(String userName, String password, long projectId) { logger.info("Get a file group list for the project! user: " + userName + "; project id: " + projectId); db.startDBSession(); try { securityWrapper.checkDBProjectsReadAccess( userName, password, new long[] {projectId}, null); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSFileGroup[] result = dbWrapper.getFileGroupsByProjectId(projectId); db.commitDBSession(); return (WSFileGroup[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getFilesNumberByProjectVersionId(String, String, long) */ public long getFilesNumberByProjectVersionId(String userName, String password, long projectVersionId) { logger.info("Get files's number for project version! user: " + userName + "; project version id: " + projectVersionId); db.startDBSession(); try { securityWrapper.checkProjectVersionsReadAccess( userName, password, new long[] {projectVersionId}); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); long result = dbWrapper.getFilesNumberByProjectVersionId(projectVersionId); db.commitDBSession(); return result; } /** * @see eu.sqooss.service.web.services.WebServices#getDirectoriesByIds(String, String, long[]) */ public WSDirectory[] getDirectoriesByIds(String userName, String password, long[] directoriesIds) { logger.info("Get directories by ids! user: " + userName + "; directories' ids: " + Arrays.toString(directoriesIds)); db.startDBSession(); try { securityWrapper.checkDBReadAccess(userName, password); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSDirectory[] result = dbWrapper.getDirectoriesByIds( asCollection(directoriesIds)); db.commitDBSession(); return (WSDirectory[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getDevelopersByIds(String, String, long[]) */ public WSDeveloper[] getDevelopersByIds(String userName, String password, long[] developersIds) { logger.info("Get developers by ids! useR: " + userName + "; developers' ids: " + Arrays.toString(developersIds)); db.startDBSession(); try { securityWrapper.checkDBReadAccess(userName, password); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); WSDeveloper[] result = dbWrapper.getDevelopersByIds( asCollection(developersIds)); db.commitDBSession(); return (WSDeveloper[]) normalizeWSArrayResult(result); } /** * @see eu.sqooss.service.web.services.WebServices#getVersionsStatistics(String, String, long[]) */ public WSVersionStats[] getVersionsStatistics( String userName, String password, long[] projectVersionsIds) { // Log this call logger.info("Get versions statistics!" + " user: " + userName + ";" + " version Ids: " + Arrays.toString(projectVersionsIds)); // Match against the current security policy db.startDBSession(); try { securityWrapper.checkProjectVersionsReadAccess( userName, password, projectVersionsIds); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); // Retrieve the result(s) if (projectVersionsIds != null) { List<WSVersionStats> result = new ArrayList<WSVersionStats>(); for (Long nextId : projectVersionsIds) { ProjectVersion nextVersion = db.findObjectById(ProjectVersion.class, nextId); if (nextVersion != null) { WSVersionStats stats = new WSVersionStats(); stats.setVersionId(nextVersion.getId()); stats.setDeletedCount(ProjectVersion.getFilesCount( nextVersion, ProjectFile.STATE_DELETED)); stats.setModifiedCount(ProjectVersion.getFilesCount( nextVersion, ProjectFile.STATE_MODIFIED)); stats.setAddedCount(ProjectVersion.getFilesCount( nextVersion, ProjectFile.STATE_ADDED)); result.add(stats); } } if (result.size() > 0) { db.commitDBSession(); return result.toArray(new WSVersionStats[result.size()]); } } db.commitDBSession(); return null; } /** * @see eu.sqooss.service.web.services.WebServices#getRootFolder(String, String, long) */ public WSDirectory getRootDirectory( String userName, String password, long projectId) { // Log this call logger.info("Get root directory!" + " user: " + userName +";" + " project Id: " + projectId); // Match against the current security policy db.startDBSession(); try { securityWrapper.checkDBProjectsReadAccess( userName, password, new long[] {projectId}, null); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); // Retrieve the result(s) WSDirectory result = null; Map<String, Object> params = new HashMap<String, Object>(); params.put("path", "/"); List<Directory> directories = db.findObjectsByProperties( Directory.class, params); if ((directories != null) && (directories.size() > 0)) result = WSDirectory.getInstance(directories.get(0)); db.commitDBSession(); return result; } /** * @see eu.sqooss.service.web.services.WebServices#getFilesInDirectory(String, String, long, long) */ public WSProjectFile[] getFilesInDirectory(String userName, String password, long projectVersionId, long directoryId) { // Log this call logger.info("Get files in directory!" + " user: " + userName +";" + " directory Id: " + directoryId); // Match against the current security policy db.startDBSession(); try { securityWrapper.checkProjectVersionsReadAccess( userName, password, new long[] {projectVersionId}); } catch (SecurityException se) { db.commitDBSession(); throw se; } super.updateUserActivity(userName); // Retrieve the result(s) WSProjectFile[] result = null; ProjectVersion version = db.findObjectById(ProjectVersion.class, projectVersionId); Directory directory = db.findObjectById(Directory.class, directoryId); try { List<ProjectFile> files = ProjectFile.getFilesForVersion(version, directory); if (files.size() > 0) { result = new WSProjectFile[files.size()]; int index = 0; for (ProjectFile nextFile : files) result[index++] = WSProjectFile.getInstance(nextFile); } } catch (IllegalArgumentException ex) {} db.commitDBSession(); return result; } } //vi: ai nosi sw=4 ts=4 expandtab
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
cf3e73b6a0983d705950d5253955f1b1237b46a8
72d66403fe94f2da38c9a0f158b1f38f78e000ee
/android/app/src/main/java/com/bibilgi/MainApplication.java
f4af1ffcdb35bdc02c8a9f4b49d3063bcb3efb7d
[ "Apache-2.0" ]
permissive
serhatboyraz/bibilgimobile
4793f465cc80dd2a0d9328168a99a5b094a659cd
f1fcd2ab6aef2ecac33aac6ca58033c741b21a39
refs/heads/master
2021-06-21T05:03:36.159365
2017-07-20T13:51:28
2017-07-20T13:51:28
91,730,136
11
2
null
2017-07-16T21:05:40
2017-05-18T19:26:45
JavaScript
UTF-8
Java
false
false
1,258
java
package com.bibilgi; import android.app.Application; import com.facebook.react.ReactApplication; import com.oblador.vectoricons.VectorIconsPackage; import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import java.util.Arrays; import java.util.List; import org.pgsqlite.SQLitePluginPackage; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new VectorIconsPackage(), new ReactNativePushNotificationPackage(), new SQLitePluginPackage() ); } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); } }
[ "abdurrahmaneker58@gmail.com" ]
abdurrahmaneker58@gmail.com
a4ad2312f2f1fd21ed3835f700d2758b77c31afe
a980ecf1dc43e2fe5b81fbce7c42483a631eeb85
/app/src/main/java/com/delaroystudios/locationgeo/GeofenceBroadcastReceiver.java
e80ffd70aa506b0b3e8848055a22598711f8dd36
[]
no_license
vallisahana/Location-Routing
e939ca573b00e780c1317dd4f716ded9c9b1aad5
00483d8fe462959dcc290eaeb212bd9a253b6598
refs/heads/master
2022-12-19T00:06:24.218358
2020-09-09T13:59:59
2020-09-09T13:59:59
276,661,381
1
0
null
null
null
null
UTF-8
Java
false
false
6,395
java
package com.delaroystudios.locationgeo; /* * Copyright (C) 2017 The Android Open Source Project * * 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. */ import android.app.NotificationManager; import android.app.PendingIntent; import android.app.TaskStackBuilder; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.graphics.BitmapFactory; import android.media.AudioManager; import android.util.Log; import androidx.core.app.NotificationCompat; import com.google.android.gms.location.Geofence; import com.google.android.gms.location.GeofencingEvent; public class GeofenceBroadcastReceiver extends BroadcastReceiver { public static final String TAG = GeofenceBroadcastReceiver.class.getSimpleName(); /*** * Handles the Broadcast message sent when the Geofence Transition is triggered * Careful here though, this is running on the main thread so make sure you start an AsyncTask for * anything that takes longer than say 10 second to run * * @param context * @param intent */ @Override public void onReceive(Context context, Intent intent) { // Get the Geofence Event from the Intent sent through GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent); if (geofencingEvent.hasError()) { Log.e(TAG, String.format("Error code : %d", geofencingEvent.getErrorCode())); return; } // Get the transition type. int geofenceTransition = geofencingEvent.getGeofenceTransition(); // Check which transition type has triggered this event if (geofenceTransition == Geofence.GEOFENCE_TRANSITION_ENTER) { setRingerMode(context, AudioManager.RINGER_MODE_SILENT); } else if (geofenceTransition == Geofence.GEOFENCE_TRANSITION_EXIT) { setRingerMode(context, AudioManager.RINGER_MODE_NORMAL); } else { // Log the error. Log.e(TAG, String.format("Unknown transition : %d", geofenceTransition)); // No need to do anything else return; } // Send the notification sendNotification(context, geofenceTransition); } /** * Posts a notification in the notification bar when a transition is detected * Uses different icon drawables for different transition types * If the user clicks the notification, control goes to the MainActivity * * @param context The calling context for building a task stack * @param transitionType The geofence transition type, can be Geofence.GEOFENCE_TRANSITION_ENTER * or Geofence.GEOFENCE_TRANSITION_EXIT */ private void sendNotification(Context context, int transitionType) { // Create an explicit content Intent that starts the main Activity. Intent notificationIntent = new Intent(context, MainActivity.class); // Construct a task stack. TaskStackBuilder stackBuilder = TaskStackBuilder.create(context); // Add the main Activity to the task stack as the parent. stackBuilder.addParentStack(MainActivity.class); // Push the content Intent onto the stack. stackBuilder.addNextIntent(notificationIntent); // Get a PendingIntent containing the entire back stack. PendingIntent notificationPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); // Get a notification builder NotificationCompat.Builder builder = new NotificationCompat.Builder(context); // Check the transition type to display the relevant icon image if (transitionType == Geofence.GEOFENCE_TRANSITION_ENTER) { builder.setSmallIcon(R.drawable.ic_volume_off_white_24dp) .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_volume_off_white_24dp)) .setContentTitle(context.getString(R.string.silent_mode_activated)); } else if (transitionType == Geofence.GEOFENCE_TRANSITION_EXIT) { builder.setSmallIcon(R.drawable.ic_volume_up_white_24dp) .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_volume_up_white_24dp)) .setContentTitle(context.getString(R.string.back_to_normal)); } // Continue building the notification builder.setContentText(context.getString(R.string.touch_to_relaunch)); builder.setContentIntent(notificationPendingIntent); // Dismiss notification once the user touches it. builder.setAutoCancel(true); // Get an instance of the Notification manager NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); // Issue the notification mNotificationManager.notify(0, builder.build()); } /** * Changes the ringer mode on the device to either silent or back to normal * * @param context The context to access AUDIO_SERVICE * @param mode The desired mode to switch device to, can be AudioManager.RINGER_MODE_SILENT or * AudioManager.RINGER_MODE_NORMAL */ private void setRingerMode(Context context, int mode) { NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); // Check for DND permissions for API 24+ if (android.os.Build.VERSION.SDK_INT < 24 || (android.os.Build.VERSION.SDK_INT >= 24 && !nm.isNotificationPolicyAccessGranted())) { AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); audioManager.setRingerMode(mode); } } }
[ "sahana0413@gmail.com" ]
sahana0413@gmail.com
f9813a8f2f1ad081ce4d604863820334c78dbe5e
db62fc6f3ecdd357974a589193a24a1279ab3315
/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/extensions/openssh/OpenSSHPosixRenameExtension.java
92533f6f5f85aef700d07dc512a4fb0bddddeeb1
[ "Apache-2.0" ]
permissive
apache/mina-sshd
03672180b9aec9b211599a9522fcc501a437c21c
3739a8e23784c173f237b2da2a3f358233268d2b
refs/heads/master
2023-09-03T04:14:34.273696
2023-09-02T17:22:11
2023-09-02T17:22:11
688,360
742
353
Apache-2.0
2023-09-14T03:17:49
2010-05-26T23:38:08
Java
UTF-8
Java
false
false
1,180
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.sshd.sftp.client.extensions.openssh; import java.io.IOException; import org.apache.sshd.sftp.client.extensions.SftpClientExtension; /** * Implements the &quot;posix-rename@openssh.com&quot; extension */ public interface OpenSSHPosixRenameExtension extends SftpClientExtension { void posixRename(String oldPath, String newPath) throws IOException; }
[ "lgoldstein@apache.org" ]
lgoldstein@apache.org
eae74967e72f6b92c4a811e221f40858031af322
d1dd8d24dd5e3d56411b44b710b3f3aaf1158e42
/FoodOrderingSystem/src/main/java/com/hcl/repository/IAddressDAO.java
2c7da189ae9afedc901d95ae078d96582c7f45f3
[]
no_license
Harshitha0941/Group5-RestEasy
506f51e1ae51dbc71f0ecd1803527910d0b08a8c
d2ae0331b6d1f2429fff22d27348dc75ea86f51f
refs/heads/master
2023-05-31T20:13:37.448493
2021-07-04T15:26:23
2021-07-04T15:26:23
382,833,382
0
0
null
null
null
null
UTF-8
Java
false
false
256
java
package com.hcl.repository; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; import com.hcl.model.Address; @Repository public interface IAddressDAO extends CrudRepository<Address, Integer>{ }
[ "harshithaamanaganti@gmail.com" ]
harshithaamanaganti@gmail.com
931fe456eb690cc964f57d3b6a48b9418f4fc709
c37076ae3ed292263a23637157f122aeb78f0fb6
/diy_page/src/com/tpzj/TPZJDESKParser.java
b07acb49d125610247bda212232843bf2788b325
[]
no_license
mo3athBaioud/bluestome
ad1b992775dcebcfc5ed81cfb49e7d29ef9e12fb
7de9ab0ad517f0e1da2a147e9079103824a99af3
refs/heads/master
2021-01-10T06:06:43.903950
2012-11-28T09:36:48
2012-11-28T09:36:48
43,675,743
1
0
null
null
null
null
UTF-8
Java
false
false
28,424
java
package com.tpzj; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import org.htmlparser.Node; import org.htmlparser.NodeFilter; import org.htmlparser.Parser; import org.htmlparser.Tag; import org.htmlparser.filters.HasAttributeFilter; import org.htmlparser.filters.NodeClassFilter; import org.htmlparser.filters.OrFilter; import org.htmlparser.tags.CompositeTag; import org.htmlparser.tags.Div; import org.htmlparser.tags.ImageTag; import org.htmlparser.tags.LinkTag; import org.htmlparser.tags.TableTag; import org.htmlparser.tags.Span; import org.htmlparser.util.NodeList; import com.chinamilitary.bean.Article; import com.chinamilitary.bean.ArticleDoc; import com.chinamilitary.bean.ImageBean; import com.chinamilitary.bean.LinkBean; import com.chinamilitary.bean.PicfileBean; import com.chinamilitary.bean.ResultBean; import com.chinamilitary.bean.WebsiteBean; import com.chinamilitary.dao.ArticleDao; import com.chinamilitary.dao.ImageDao; import com.chinamilitary.dao.PicFileDao; import com.chinamilitary.dao.WebSiteDao; import com.chinamilitary.factory.DAOFactory; import com.chinamilitary.memcache.MemcacheClient; import com.chinamilitary.test.TestHttpClient; import com.chinamilitary.util.CacheUtils; import com.chinamilitary.util.CommonUtil; import com.chinamilitary.util.HttpClientUtils; import com.chinamilitary.util.IOUtil; import com.chinamilitary.util.StringUtils; import com.common.Constants; import com.utils.FileUtils; public class TPZJDESKParser { static String URL_ = "http://desk.tpzj.com/"; static String URL = "http://desk.tpzj.com"; static String IMAGE_URL = "http://image6.tuku.cn/"; static Integer D_PARENT_ID = 801; static String PIC_SAVE_PATH = Constants.FILE_SERVER; final static String FILE_SERVER = Constants.FILE_SERVER; static List<LinkBean> LINKLIST = new ArrayList<LinkBean>(); static List<Article> ARTICLELIST = new ArrayList<Article>(); static HashMap<String, LinkBean> LINKHASH = new HashMap<String, LinkBean>(); static MemcacheClient client = MemcacheClient.getInstance(); static ArticleDao articleDao = DAOFactory.getInstance().getArticleDao(); static WebSiteDao webSiteDao = DAOFactory.getInstance().getWebSiteDao(); static ImageDao imageDao = DAOFactory.getInstance().getImageDao(); static PicFileDao picFiledao = DAOFactory.getInstance().getPicFileDao(); /** * 获取分类链接 * * @param url * @throws Exception */ static void catalog(String url) throws Exception { // WebsiteBean bean Parser parser = new Parser(); parser.setURL(url); parser.setEncoding("GB2312"); NodeFilter fileter = new NodeClassFilter(Div.class); NodeList list = parser.extractAllNodesThatMatch(fileter) .extractAllNodesThatMatch( new HasAttributeFilter("class", "nav fl")); if (null != list && list.size() > 0) { Div table = (Div) list.elementAt(0); Parser p2 = new Parser(); p2.setInputHTML(table.getChildrenHTML()); NodeFilter linkFilter = new NodeClassFilter(LinkTag.class); NodeList linkList = p2.extractAllNodesThatMatch(linkFilter); if (linkList != null && linkList.size() > 0) { WebsiteBean tmp = null; for (int i = 0; i < linkList.size(); i++) { LinkTag link = (LinkTag) linkList.elementAt(i); if (link.getLink().endsWith(".html")) { System.out.println(link.getLinkText()); tmp = new WebsiteBean(); tmp.setName(link.getLinkText()); if (!link.getLink().startsWith("http://")) { System.out.println(URL + link.getLink() + "\n"); tmp.setUrl(URL + link.getLink()); } else { System.out.println(link.getLink() + "\n"); tmp.setUrl(link.getLink()); } tmp.setParentId(D_PARENT_ID); boolean b = webSiteDao.insert(tmp); if (b) { client.add(tmp.getUrl(), tmp.getUrl()); System.out.println("成功"); } else { System.out.println("失败"); } } } } if (null != p2) p2 = null; } if (null != parser) parser = null; } /** * 获取分类下的分页信息 * * @param url * @param attribute * @param value * @return * @throws Exception */ static ResultBean hasPaging(String url, String cls, String value) throws Exception { boolean b = false; ResultBean result = new ResultBean(); Parser parser = new Parser(); parser.setURL(url); // 获取指定ID的DIV内容 NodeFilter filter = new NodeClassFilter(Div.class); NodeList list = parser.extractAllNodesThatMatch(filter) .extractAllNodesThatMatch(new HasAttributeFilter(cls, value)); if (list != null && list.size() > 0) { Parser p2 = new Parser(); p2.setInputHTML(list.toHtml()); NodeFilter filter2 = new NodeClassFilter(LinkTag.class); NodeList list2 = p2.extractAllNodesThatMatch(filter2); if (null != list && list2.size() > 0) { String tmp = null; LinkBean l1 = null; for (int i = 0; i < list2.size(); i++) { l1 = new LinkBean(); LinkTag link2 = (LinkTag) list2.elementAt(i); if (!link2.getLink().startsWith("http://")) { if(link2.getLink().equalsIgnoreCase("#")){ tmp = url; }else{ tmp = URL_ + link2.getLink(); } } else { tmp = link2.getLink(); } tmp = tmp.replace("&amp;", "&"); l1.setLink(tmp); l1.setTitle(link2.getLinkText()); result.put(tmp, l1); } result.setBool(true); }else{ LinkBean l1 = new LinkBean(); l1.setLink(url); result.put(url, l1); result.setBool(true); } if (null != p2) p2 = null; } else { LinkBean l1 = new LinkBean(); l1.setLink(url); result.put(url, l1); result.setBool(true); } return result; } /** * 获取分类下的分页信息 * * @param url * @param attribute * @param value * @return * @throws Exception */ static ResultBean hasPaging2(String url) throws Exception { boolean b = false; ResultBean result = new ResultBean(); Parser parser = new Parser(); parser.setURL(url); // 获取指定ID的DIV内容 NodeFilter filter = new NodeClassFilter(Span.class); NodeList list = parser.extractAllNodesThatMatch(filter) .extractAllNodesThatMatch( new HasAttributeFilter("class", "num fl TC")); int num = 0; if (list != null && list.size() > 0) { Parser p2 = new Parser(); p2.setInputHTML(list.toHtml()); NodeFilter filter2 = new NodeClassFilter(LinkTag.class); NodeList list2 = p2.extractAllNodesThatMatch(filter2); LinkTag link = (LinkTag) list2.elementAt(list2.size() - 1); if (null != link) { try { num = Integer.valueOf(link.getLinkText()); } catch (Exception e) { num = 1; } LinkBean lbean = null; for (int i = 1; i < num + 1; i++) { String tmp = url; lbean = new LinkBean(); if (i == 1) { lbean.setLink(url); } else { tmp = tmp.replace(".html", "_" + i + ".html"); lbean = new LinkBean(); lbean.setLink(tmp); } result.put(tmp, lbean); } result.setBool(true); } if (null != p2) p2 = null; } else { result.setBool(b); } return result; } /** * 获取指定URL下的源码 * * @param url1 * @return */ public static String ViewSourceFrame(String url1) throws Exception { String url = url1; String linesep = System.getProperty("line.separator"); String htmlLine; String htmlSource = ""; java.net.URL source = new URL(url); InputStream in = new BufferedInputStream(source.openStream()); BufferedReader br = new BufferedReader(new InputStreamReader(in)); while ((htmlLine = br.readLine()) != null) { htmlSource = htmlSource + htmlLine + linesep; } return htmlSource; } /** * 获取指定列表中页面源码 * * @param webList */ static void initHTML(List<WebsiteBean> webList) { Long start = System.currentTimeMillis(); for (WebsiteBean bean : webList) { try { Long start1 = System.currentTimeMillis(); String content = ViewSourceFrame(bean.getUrl()); if (null != content && !"".equalsIgnoreCase(content)) { // processWithDoc(bean.getId(), content); Long end1 = System.currentTimeMillis(); System.out.println("单条耗时:" + (end1 - start1) + "长度:" + content.getBytes().length); } } catch (Exception e) { System.out.println("Exception:" + e.getMessage()); continue; } } Long end = System.currentTimeMillis(); System.out.print("总耗时:" + (end - start)); } /** * 获取分类下数据 * * @param link * @param webId * @throws Exception */ public static void secondURL(LinkBean link, int webId) throws Exception { Parser parser = new Parser(); parser.setURL(link.getLink()); parser.setEncoding("GB2312"); // 获取指定ID的TableTag内容 NodeFilter filter = new NodeClassFilter(Span.class); NodeList list = parser.extractAllNodesThatMatch(filter) .extractAllNodesThatMatch( new HasAttributeFilter("class", "title fs12 fl TC")); //pic-list fl of if (list != null && list.size() > 0) { Parser p2 = null; for (int i = 0; i < list.size(); i++) { Article article = null; String url = null; Span ltmp = (Span) list.elementAt(i); NodeList tmp = ltmp.getChildren(); // System.out.println("*************Start****************"); // for(int j=0;j<tmp.size();j++){ // Node node = (Node)tmp.elementAt(j); // System.out.println(j+":"+node.toHtml()); // } // System.out.println("*************End****************"); if (null != tmp && tmp.size() > 0) { LinkTag tmplink = (LinkTag) tmp.elementAt(1); if (null != tmplink) { if (!tmplink.getLink().startsWith("http://")) { url = URL + tmplink.getLink(); } else { url = tmplink.getLink(); } String tmpurl = getRealArticleURL(url); if (null == client.get(url)) { article = new Article(); article.setWebId(webId); article.setArticleUrl(url); article.setText("NED"); // NED_WALLCOO article.setIntro("NN"); if (null != tmpurl) { article.setActicleRealUrl(tmpurl); } article.setTitle(tmplink.getLinkText()); // System.out.println("*****************Start***************"); // System.out.println("ArticleUrl:"+article.getArticleUrl()); // System.out.println("ActicleXmlUrl:"+article.getActicleXmlUrl()); // System.out.println("Title:"+article.getTitle()); // System.out.println("Text:"+article.getText()); // System.out.println("*****************End***************\n"); int key = articleDao.insert(article); if (key > 0) { System.out.print(tmplink.getLinkText() + "\t|" + url+"\t"+tmpurl); client.add(url, url); } } else { System.err.println(">> 已存在相同的内容 [" + tmplink.getLinkText() + "]"); } } if (null != p2) p2 = null; } } } if (null != parser) parser = null; } static String getRealArticleURL(String url1) throws Exception { String url = null; Parser p1 = new Parser(); p1.setURL(url1); NodeFilter filter = new NodeClassFilter(CompositeTag.class); NodeList list = p1.extractAllNodesThatMatch(filter) .extractAllNodesThatMatch( new HasAttributeFilter("class", "abot")); if (null != list && list.size() > 0) { LinkTag link = (LinkTag) list.elementAt(0); System.out.println(link.getLinkText() + "|" + link.getLink()); if (!link.getLink().startsWith("http://")) { url = URL + link.getLink(); } else { url = link.getLink(); } } if (null != p1) p1 = null; return url; } /** * 获取图片地址下数据 * * @param link * @param webId * @throws Exception */ public static boolean getImage(Article article) throws Exception { boolean b = true; ResultBean result = hasPaging(article.getActicleRealUrl(), "class", "pg"); if (result.isBool()) { Iterator it = result.getMap().keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); System.out.println("文章地址:"+key); LinkBean link = result.getMap().get(key); if(!getImage(link,article.getTitle(),article.getId())){ b = false; break; } break; } } return b; } /** * 获取分类下数据 * * @param link * @param webId * @throws Exception */ public static boolean getImage(LinkBean link,String title, int artId) throws Exception { Parser parser = new Parser(); parser.setURL(link.getLink()); parser.setEncoding("UTF-8"); boolean resultB = true; // 获取指定ID的TableTag内容 NodeFilter filter = new NodeClassFilter(CompositeTag.class); NodeList list = parser .extractAllNodesThatMatch(filter) .extractAllNodesThatMatch(new HasAttributeFilter("class", "picbd")); if (null != list && list.size() > 0) { Parser p2 = null; String length = "0"; int size = 0; for (int i = 0; i < list.size(); i++) { LinkTag ltmp = (LinkTag) list.elementAt(i); ImageBean imgBean = null; String url = null; String imgSrc = null; if (!ltmp.getLink().startsWith("http://")) { url = URL + ltmp.getLink(); } else { url = ltmp.getLink(); } imgSrc = getImageURL(url); if (null != imgSrc) { if (null == client.get(url)) { imgBean = new ImageBean(); imgBean = new ImageBean(); imgBean.setArticleId(artId); imgBean.setHttpUrl(imgSrc); NodeList tmp = ltmp.getChildren(); if (tmp != null && tmp.size() > 0) { ImageTag imgTag = (ImageTag) tmp.elementAt(0); if (null != imgTag.getImageURL()) imgBean.setImgUrl(imgTag.getImageURL()); if (null != imgTag.getAttribute("alt")) imgBean .setTitle(imgTag .getAttribute("alt")); else imgBean.setTitle(title); } imgBean.setLink("NED"); try { size = Integer.parseInt(length); imgBean.setFileSize(Long.valueOf(size)); imgBean.setStatus(3); } catch (Exception e) { e.printStackTrace(); System.err.println(">> IMAGE SIZE ERROR"); size = 0; imgBean.setFileSize(0l); imgBean.setStatus(1); } // System.out.println("Title:"+imgBean.getTitle()); // System.out.println("ArticleId:"+imgBean.getArticleId()); // System.out.println("大图地址:"+imgBean.getHttpUrl()); // System.out.println("小图地址:"+imgBean.getImgUrl()); int key = imageDao.insert(imgBean); if (key > 0) { System.out.println(imgBean.getTitle() + "\t|"+ url); client.add(url, url); } } else { System.err.println(">> 已存在相同的内容 [" + ltmp.getLinkText() + "]"); } } else { resultB = false; break; } if (null != p2) p2 = null; } } return resultB; } /** * 获取图片实际地址 * * @param url * @return */ static String getImageURL(String url) { String result = null; try { Parser p1 = new Parser(); p1.setURL(url); NodeFilter filter = new NodeClassFilter(CompositeTag.class); NodeList list = p1.extractAllNodesThatMatch(filter) .extractAllNodesThatMatch( new HasAttributeFilter("class", "abpic")); if (null != list && list.size() == 1) { LinkTag link = (LinkTag) list.elementAt(0); result = link.getLink(); } } catch (Exception e) { e.printStackTrace(); } return result; } /** * 获取图片地址下数据 * * @param link * @param webId * @throws Exception */ public static void getImage(LinkBean link, int webId, int articleId) throws Exception { Parser parser = new Parser(); parser.setURL(link.getLink()); parser.setEncoding("UTF-8"); String length = "0"; int size = 0; // 获取指定ID的TableTag内容 NodeFilter filter = new NodeClassFilter(TableTag.class); NodeList list = parser.extractAllNodesThatMatch(filter) .extractAllNodesThatMatch( new HasAttributeFilter("id", "DataList1")); if (list != null && list.size() > 0) { NodeFilter linkFilter = new NodeClassFilter(LinkTag.class); NodeFilter imageFilter = new NodeClassFilter(ImageTag.class); OrFilter lastFilter = new OrFilter(); lastFilter .setPredicates(new NodeFilter[] { linkFilter, imageFilter }); Parser p2 = new Parser(); p2.setInputHTML(list.toHtml()); p2.setEncoding("UTF-8"); NodeList list4 = p2.parse(lastFilter); if (list4 != null || list4.size() > 0) { for (int i = 0; i < list4.size(); i++) { // 地址 if (list4.elementAt(i) instanceof LinkTag) { LinkTag nl = (LinkTag) list4.elementAt(i); NodeList cnl = nl.getChildren(); if (cnl != null && cnl.size() > 0) { // 小图 可能存在部分图片无法访问,需要判断 ImageBean imgBean = null; if (cnl.elementAt(0) instanceof ImageTag) { ImageTag it = (ImageTag) cnl.elementAt(0); String url = IMAGE_URL + getImageUrl(nl.getLink()); if (null == client.get(url)) { length = HttpClientUtils .getHttpHeaderResponse(url, "Content-Length"); imgBean = new ImageBean(); imgBean.setArticleId(articleId); imgBean.setHttpUrl(url); imgBean.setImgUrl(it.getImageURL()); imgBean.setTitle(it.getAttribute("alt")); try { size = Integer.parseInt(length); imgBean.setFileSize(Long.valueOf(size)); imgBean.setStatus(3); } catch (Exception e) { e.printStackTrace(); System.err .println(">> IMAGE SIZE ERROR"); size = 0; imgBean.setFileSize(0l); imgBean.setStatus(1); } imgBean.setLink("NED"); imgBean.setOrderId(i); imgBean.setArticleId(articleId); // HttpClientUtils int result = imageDao.insert(imgBean); if (result > 0) { System.out.println(">> add article[" + articleId + "] image id[" + result + "] to DB"); imgBean.setId(result); client.add(url, url); } else { System.err.println(">> 未添加[" + url + "]到数据库中"); } } else { System.err.println(">> 缓存中已存在相同的内容 [" + nl.getLink() + "]"); } } } } Thread.sleep(1000); } } } } static String getImageUrl(String link) { int start = link.indexOf("="); int end = link.length(); String imgUrl = link.substring(start + 1, end); return imgUrl; } static String getTitle(String title, String defaultTitle) { if (null == title || "".equalsIgnoreCase(title)) { return defaultTitle + ":" + System.currentTimeMillis(); } return title; } static void init() { try { List<WebsiteBean> webList = webSiteDao.findByParentId(701); for (WebsiteBean bean : webList) { List<Article> articleList = articleDao .findByWebId(bean.getId()); for (Article article : articleList) { if (null == client.get(article.getArticleUrl())) { client.add(article.getArticleUrl(), article .getArticleUrl()); } } } } catch (Exception e) { e.printStackTrace(); } } static void update() throws Exception { List<WebsiteBean> webList = webSiteDao.findByParentId(D_PARENT_ID); for (WebsiteBean bean : webList) { ResultBean result = hasPaging2(bean.getUrl()); if (result.isBool()) { Iterator it = result.getMap().keySet().iterator(); System.out.println("分页数量:"+result.getMap().size()); while (it.hasNext()) { String key = (String) it.next(); LinkBean link = result.getMap().get(key); System.out.println("key:"+key); try { secondURL(link, bean.getId()); } catch (Exception e) { e.printStackTrace(); System.out.println("key:" + key); continue; } } } } } public static void main(String[] args) { // init(); try { // catalog(URL); update(); // vistDesk(); loadImg(); // imgDownload(); // movefile(); } catch (Exception e) { e.printStackTrace(); } } static void loadImg() throws Exception { List<WebsiteBean> webList = webSiteDao.findByParentId(D_PARENT_ID); for (WebsiteBean bean : webList) { List<Article> list = articleDao.findByWebId(bean.getId(),"NED"); // List<Article> list = articleDao.findByWebId(bean.getId()); System.out.println(bean.getId()+"|文章数量"+list.size()); for (Article art : list) { // List<ImageBean> imgList = imageDao.findImage(art.getId()); // if(imgList.size() == 0){ // art.setText("NED"); // if (articleDao.update(art)) { // System.out // .println("更新记录[" + art.getTitle() + "|"+art.getId()+"]成功"); // } // }else{ if (getImage(art)) { if(!art.getText().equalsIgnoreCase("FD")){ art.setText("FD"); if (articleDao.update(art)) { System.out .println("更新记录[" + art.getTitle() + "|"+art.getId()+"]成功"); } } } // } // break; } } } static void imgDownload() throws Exception { List<WebsiteBean> webList = webSiteDao.findByParentId(D_PARENT_ID); for (WebsiteBean bean : webList) { List<Article> list = articleDao.findByWebId(bean.getId(),"FD"); System.out.println(">> 网站["+bean.getId()+"|"+bean.getName()+"|"+bean.getUrl()+"]\t下文章数量"+list.size()); for (Article art : list) { List<ImageBean> imglist = imageDao.findImage(art.getId()); System.out.println(">> 文章["+art.getId()+"|"+art.getTitle()+"]\t下的图片数量"+imglist.size()); for (ImageBean img : imglist) { if(img.getLink().equalsIgnoreCase("NED")){ if (download(img)) { img.setStatus(1); img.setLink("FD"); if (imageDao.update(img)) { System.out.println(">> 更新图片对象[" + art.getId() + "|"+img.getId()+"]\t成功"); } } } } } } } static boolean download(ImageBean imgBean) { PicFileDao dao = null; PicfileBean bean = null; dao = DAOFactory.getInstance().getPicFileDao(); bean = new PicfileBean(); String s_fileName = imgBean.getImgUrl().substring( imgBean.getImgUrl().lastIndexOf("/") + 1, imgBean.getImgUrl().length()); String fileName = imgBean.getHttpUrl().substring( imgBean.getHttpUrl().lastIndexOf("/") + 1, imgBean.getHttpUrl().length()); s_fileName = s_fileName.replace(".", "_s."); try { if (client.get(CacheUtils.getShowImgKey(PIC_SAVE_PATH + StringUtils.gerDir(String.valueOf(imgBean.getArticleId())) + imgBean.getArticleId() + File.separator + fileName.replace(".", "_s."))) == null) { IOUtil.createPicFile(imgBean.getImgUrl(), PIC_SAVE_PATH + StringUtils.gerDir(String.valueOf(imgBean.getArticleId())) + imgBean.getArticleId() + File.separator + fileName.replace(".", "_s.")); } if (client.get(CacheUtils.getBigPicFileKey(PIC_SAVE_PATH + StringUtils.gerDir(String.valueOf(imgBean.getArticleId())) + imgBean.getArticleId() + File.separator + fileName)) == null) { IOUtil.createPicFile(imgBean.getHttpUrl(), PIC_SAVE_PATH + StringUtils.gerDir(String.valueOf(imgBean.getArticleId())) + imgBean.getArticleId() + File.separator + fileName); } bean.setArticleId(imgBean.getArticleId()); bean.setImageId(imgBean.getId()); bean.setTitle(imgBean.getTitle()); bean.setSmallName(File.separator + StringUtils.gerDir(String.valueOf(imgBean.getArticleId())) + imgBean.getArticleId() + File.separator + s_fileName); bean.setName( File.separator + StringUtils.gerDir(String.valueOf(imgBean.getArticleId())) + imgBean.getArticleId() + File.separator + fileName); bean.setUrl(PIC_SAVE_PATH); try { boolean b = picFiledao.insert(bean); if (b) { client.add(CacheUtils.getBigPicFileKey(bean.getUrl() + bean.getName()), bean); client.add(CacheUtils.getSmallPicFileKey(bean.getUrl() + bean.getSmallName()), bean); } else { return false; } } catch (Exception e) { System.out.println("数据库异常"); e.printStackTrace(); return false; } } catch (IOException e) { System.out.println("网络连接,文件IO异常"); e.printStackTrace(); return false; } return true; } static void movefile() throws Exception{ List<WebsiteBean> webList = webSiteDao.findByParentId(D_PARENT_ID); PicfileBean bean = null; for(WebsiteBean website:webList){ System.out.println(website.getId()+"|"+website.getName()+"|"+website.getUrl()); List<Article> artList = articleDao.findByWebId(website.getId(), "FD"); System.out.println("文章数量:"+artList.size()); for(Article article:artList){ List<ImageBean> list = imageDao.findImage(article.getId()); for(ImageBean img:list){ bean = picFiledao.findByImgIdAndArticleId(img.getId(), article.getId()); if(null != bean){ if(moveFile(bean)){ System.out.println(bean.getId()+"|"+bean.getArticleId()+"|"+bean.getImageId()); System.out.println("after move file name:"+bean.getName()); System.out.println("after move file smallName:"+bean.getSmallName()); System.out.println("-------------------------------------------------------------"); } } } } } } static boolean moveFile(PicfileBean bean) { boolean isBig = false; boolean isSmall = false; int start = bean.getName().lastIndexOf(File.separator)+1; int smnStart = bean.getSmallName().lastIndexOf(File.separator)+1; String prx = StringUtils.gerDir(String.valueOf(bean.getArticleId())); String fileName = prx+bean.getArticleId()+File.separator+bean.getName().substring(start); String smallFileName = prx+bean.getArticleId()+File.separator+bean.getSmallName().substring(smnStart); String source = bean.getUrl() + bean.getName(); String smgSource = bean.getUrl() + bean.getSmallName(); String target = FILE_SERVER+fileName; String smgTarget = FILE_SERVER + smallFileName; bean.setUrl(FILE_SERVER); if(FileUtils.copyFile(source, target)){ System.out.println(">> 大图成功!!!"); if(FileUtils.deleteFile(source)){ System.out.println(">> 删除源大图["+source+"]成功"); } bean.setName(fileName); isBig = true; } if(FileUtils.copyFile(smgSource, smgTarget)){ System.out.println(">> 小图成功!!!"); if(FileUtils.deleteFile(smgSource)){ System.out.println(">> 删除源小图["+smgSource+"]成功"); } bean.setSmallName(smallFileName); isSmall = true; } if(isBig){ if(isBig || isSmall){ try{ if(picFiledao.update(bean)){ System.out.println(">> 更新图片文件["+bean.getId()+"]记录成功!"); } }catch(Exception e){ e.printStackTrace(); } } } return isBig; } /** * 测试方法 * @throws Exception */ static void test() throws Exception{ ResultBean result = hasPaging2("http://desk.tpzj.com/html/260/index.html"); if (result.isBool()) { Iterator it = result.getMap().keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); System.out.println("key:" + key); LinkBean link = (LinkBean) result.getMap().get(key); secondURL(link, 0); } } } }
[ "bluestomez@8d0e2b01-6282-6274-ba5d-974b8f8e99e7" ]
bluestomez@8d0e2b01-6282-6274-ba5d-974b8f8e99e7
54b9414c69a17c80768abe0f74380af9711f595a
3802210088dac1806aa21e3af212b5a00b01141f
/src/test/java/edu/cmu/cs/vbc/prog/checkstyle/checks/DescendantTokenCheck.java
f3682f1d3af5dd5d0e0082b26135a92e4928db6e
[]
no_license
chupanw/vbc
5618f8fd9fcfc4f9dda06826f925cddfb2d3191c
1221ef110e2b46951ab01319e97fa5d7dd84a724
refs/heads/master
2020-12-25T01:44:30.531879
2020-11-20T02:31:17
2020-11-20T02:31:17
50,115,858
5
1
null
2016-04-05T01:06:21
2016-01-21T15:17:05
Java
UTF-8
Java
false
false
14,994
java
//////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. // Copyright (C) 2001-2015 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library 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 // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser 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 edu.cmu.cs.vbc.prog.checkstyle.checks; import antlr.collections.AST; import edu.cmu.cs.vbc.prog.checkstyle.api.Check; import edu.cmu.cs.vbc.prog.checkstyle.api.DetailAST; import edu.cmu.cs.vbc.prog.checkstyle.api.TokenTypes; import java.util.Arrays; import java.util.Set; /** * <p> * Checks for restricted tokens beneath other tokens. * </p> * <p> * Examples of how to configure the check: * </p> * <pre> * &lt;!-- String literal equality check --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="EQUAL,NOT_EQUAL"/&gt; * &lt;property name="limitedTokens" value="STRING_LITERAL"/&gt; * &lt;property name="maximumNumber" value="0"/&gt; * &lt;property name="maximumDepth" value="1"/&gt; * &lt;/module&gt; * * &lt;!-- Switch with no default --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="LITERAL_SWITCH"/&gt; * &lt;property name="maximumDepth" value="2"/&gt; * &lt;property name="limitedTokens" value="LITERAL_DEFAULT"/&gt; * &lt;property name="minimumNumber" value="1"/&gt; * &lt;/module&gt; * * &lt;!-- Assert statement may have side effects --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="LITERAL_ASSERT"/&gt; * &lt;property name="limitedTokens" value="ASSIGN,DEC,INC,POST_DEC, * POST_INC,PLUS_ASSIGN,MINUS_ASSIGN,STAR_ASSIGN,DIV_ASSIGN,MOD_ASSIGN, * BSR_ASSIGN,SR_ASSIGN,SL_ASSIGN,BAND_ASSIGN,BXOR_ASSIGN,BOR_ASSIGN, * METHOD_CALL"/&gt; * &lt;property name="maximumNumber" value="0"/&gt; * &lt;/module&gt; * * &lt;!-- Initialiser in for performs no setup - use while instead? --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="FOR_INIT"/&gt; * &lt;property name="limitedTokens" value="EXPR"/&gt; * &lt;property name="minimumNumber" value="1"/&gt; * &lt;/module&gt; * * &lt;!-- Condition in for performs no check --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="FOR_CONDITION"/&gt; * &lt;property name="limitedTokens" value="EXPR"/&gt; * &lt;property name="minimumNumber" value="1"/&gt; * &lt;/module&gt; * * &lt;!-- Switch within switch --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="LITERAL_SWITCH"/&gt; * &lt;property name="limitedTokens" value="LITERAL_SWITCH"/&gt; * &lt;property name="maximumNumber" value="0"/&gt; * &lt;property name="minimumDepth" value="1"/&gt; * &lt;/module&gt; * * &lt;!-- Return from within a catch or finally block --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="LITERAL_FINALLY,LITERAL_CATCH"/&gt; * &lt;property name="limitedTokens" value="LITERAL_RETURN"/&gt; * &lt;property name="maximumNumber" value="0"/&gt; * &lt;/module&gt; * * &lt;!-- Try within catch or finally block --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="LITERAL_CATCH,LITERAL_FINALLY"/&gt; * &lt;property name="limitedTokens" value="LITERAL_TRY"/&gt; * &lt;property name="maximumNumber" value="0"/&gt; * &lt;/module&gt; * * &lt;!-- Too many cases within a switch --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="LITERAL_SWITCH"/&gt; * &lt;property name="limitedTokens" value="LITERAL_CASE"/&gt; * &lt;property name="maximumDepth" value="2"/&gt; * &lt;property name="maximumNumber" value="10"/&gt; * &lt;/module&gt; * * &lt;!-- Too many local variables within a method --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="METHOD_DEF"/&gt; * &lt;property name="limitedTokens" value="VARIABLE_DEF"/&gt; * &lt;property name="maximumDepth" value="2"/&gt; * &lt;property name="maximumNumber" value="10"/&gt; * &lt;/module&gt; * * &lt;!-- Too many returns from within a method --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="METHOD_DEF"/&gt; * &lt;property name="limitedTokens" value="LITERAL_RETURN"/&gt; * &lt;property name="maximumNumber" value="3"/&gt; * &lt;/module&gt; * * &lt;!-- Too many fields within an interface --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="INTERFACE_DEF"/&gt; * &lt;property name="limitedTokens" value="VARIABLE_DEF"/&gt; * &lt;property name="maximumDepth" value="2"/&gt; * &lt;property name="maximumNumber" value="0"/&gt; * &lt;/module&gt; * * &lt;!-- Limit the number of exceptions a method can throw --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="LITERAL_THROWS"/&gt; * &lt;property name="limitedTokens" value="IDENT"/&gt; * &lt;property name="maximumNumber" value="1"/&gt; * &lt;/module&gt; * * &lt;!-- Limit the number of expressions in a method --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="METHOD_DEF"/&gt; * &lt;property name="limitedTokens" value="EXPR"/&gt; * &lt;property name="maximumNumber" value="200"/&gt; * &lt;/module&gt; * * &lt;!-- Disallow empty statements --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="EMPTY_STAT"/&gt; * &lt;property name="limitedTokens" value="EMPTY_STAT"/&gt; * &lt;property name="maximumNumber" value="0"/&gt; * &lt;property name="maximumDepth" value="0"/&gt; * &lt;property name="maximumMessage" * value="Empty statement is not allowed."/&gt; * &lt;/module&gt; * * &lt;!-- Too many fields within a class --&gt; * &lt;module name="DescendantToken"&gt; * &lt;property name="tokens" value="CLASS_DEF"/&gt; * &lt;property name="limitedTokens" value="VARIABLE_DEF"/&gt; * &lt;property name="maximumDepth" value="2"/&gt; * &lt;property name="maximumNumber" value="10"/&gt; * &lt;/module&gt; * </pre> * * @author Tim Tyler &lt;tim@tt1.org&gt; * @author Rick Giles */ public class DescendantTokenCheck extends Check { /** * A key is pointing to the warning message text in "messages.properties" * file. */ public static final String MSG_KEY_MIN = "descendant.token.min"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ public static final String MSG_KEY_MAX = "descendant.token.max"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ public static final String MSG_KEY_SUM_MIN = "descendant.token.sum.min"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ public static final String MSG_KEY_SUM_MAX = "descendant.token.sum.max"; /** minimum depth */ private int minimumDepth; /** maximum depth */ private int maximumDepth = Integer.MAX_VALUE; /** minimum number */ private int minimumNumber; /** maximum number */ private int maximumNumber = Integer.MAX_VALUE; /** Whether to sum the number of tokens found. */ private boolean sumTokenCounts; /** limited tokens */ private int[] limitedTokens = new int[0]; /** error message when minimum count not reached */ private String minimumMessage; /** error message when maximum count exceeded */ private String maximumMessage; /** * Counts of descendant tokens. * Indexed by (token ID - 1) for performance. */ private int[] counts = new int[0]; @Override public int[] getDefaultTokens() { return new int[0]; } @Override public void visitToken(DetailAST ast) { //reset counts Arrays.fill(counts, 0); countTokens(ast, 0); // name of this token final String name = TokenTypes.getTokenName(ast.getType()); if (sumTokenCounts) { int total = 0; for (int element : limitedTokens) { total += counts[element - 1]; } if (total < minimumNumber) { log(ast.getLineNo(), ast.getColumnNo(), (null == minimumMessage) ? MSG_KEY_SUM_MIN : minimumMessage, String.valueOf(total), String.valueOf(minimumNumber), name); } if (total > maximumNumber) { log(ast.getLineNo(), ast.getColumnNo(), (null == maximumMessage) ? MSG_KEY_SUM_MAX : maximumMessage, String.valueOf(total), String.valueOf(maximumNumber), name); } } else { for (int element : limitedTokens) { final int tokenCount = counts[element - 1]; if (tokenCount < minimumNumber) { final String descendantName = TokenTypes .getTokenName(element); log(ast.getLineNo(), ast.getColumnNo(), (null == minimumMessage) ? MSG_KEY_MIN : minimumMessage, String.valueOf(tokenCount), String.valueOf(minimumNumber), name, descendantName); } if (tokenCount > maximumNumber) { final String descendantName = TokenTypes .getTokenName(element); log(ast.getLineNo(), ast.getColumnNo(), (null == maximumMessage) ? MSG_KEY_MAX : maximumMessage, String.valueOf(tokenCount), String.valueOf(maximumNumber), name, descendantName); } } } } /** * Counts the number of occurrences of descendant tokens. * @param ast the root token for descendants. * @param depth the maximum depth of the counted descendants. */ private void countTokens(AST ast, int depth) { if (depth <= maximumDepth) { //update count if (depth >= minimumDepth) { final int type = ast.getType(); if (type <= counts.length) { counts[type - 1]++; } } AST child = ast.getFirstChild(); final int nextDepth = depth + 1; while (child != null) { countTokens(child, nextDepth); child = child.getNextSibling(); } } } @Override public int[] getAcceptableTokens() { // Any tokens set by property 'tokens' are acceptable final Set<String> tokenNames = getTokenNames(); final int[] result = new int[tokenNames.size()]; int i = 0; for (String name : tokenNames) { result[i++] = TokenTypes.getTokenId(name); } return result; } /** * Sets the tokens which occurance as descendant is limited. * @param limitedTokensParam - list of tokens to ignore. */ public void setLimitedTokens(String[] limitedTokensParam) { limitedTokens = new int[limitedTokensParam.length]; int maxToken = 0; for (int i = 0; i < limitedTokensParam.length; i++) { limitedTokens[i] = TokenTypes.getTokenId(limitedTokensParam[i]); if (limitedTokens[i] > maxToken) { maxToken = limitedTokens[i]; } } counts = new int[maxToken]; } /** * Sets the minimum depth for descendant counts. * @param minimumDepth the minimum depth for descendant counts. */ public void setMinimumDepth(int minimumDepth) { this.minimumDepth = minimumDepth; } /** * Sets the maximum depth for descendant counts. * @param maximumDepth the maximum depth for descendant counts. */ public void setMaximumDepth(int maximumDepth) { this.maximumDepth = maximumDepth; } /** * Sets a minimum count for descendants. * @param minimumNumber the minimum count for descendants. */ public void setMinimumNumber(int minimumNumber) { this.minimumNumber = minimumNumber; } /** * Sets a maximum count for descendants. * @param maximumNumber the maximum count for descendants. */ public void setMaximumNumber(int maximumNumber) { this.maximumNumber = maximumNumber; } /** * Sets the error message for minimum count not reached. * @param message the error message for minimum count not reached. * Used as a <code>MessageFormat</code> pattern with arguments * <ul> * <li>{0} - token count</li> * <li>{1} - minimum number</li> * <li>{2} - name of token</li> * <li>{3} - name of limited token</li> * </ul> */ public void setMinimumMessage(String message) { minimumMessage = message; } /** * Sets the error message for maximum count exceeded. * @param message the error message for maximum count exceeded. * Used as a <code>MessageFormat</code> pattern with arguments * <ul> * <li>{0} - token count</li> * <li>{1} - maximum number</li> * <li>{2} - name of token</li> * <li>{3} - name of limited token</li> * </ul> */ public void setMaximumMessage(String message) { maximumMessage = message; } /** * Sets whether to use the sum of the tokens found, rather than the * individual counts. * @param sum whether to use the sum. */ public void setSumTokenCounts(boolean sum) { sumTokenCounts = sum; } }
[ "chupanw@cs.cmu.edu" ]
chupanw@cs.cmu.edu
cc63b3f0e2b33539da264b6e19d287782afa37f4
c06f9f871c4718e711608c0a2d02e78f0db3c7f5
/02Fabryka/src/factoryClassRegistrationReflection/Main.java
7b1f8231d4a2c5cd39afb5a9ae90e5c9c6217be7
[]
no_license
jbuczynski/DesignPatterns
9392ed58eaeea267191bae8027f48b0acc0ecc02
ddfe3cf40c192117984f90d5fa0b94efc8f7ea12
refs/heads/master
2020-06-20T01:56:42.423014
2016-11-27T12:16:36
2016-11-27T12:16:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
315
java
package factoryClassRegistrationReflection; class Main { static { try { Class.forName("OneProduct"); Class.forName("AnotherProduct"); } catch (ClassNotFoundException any) { any.printStackTrace(); } } public static void main(String args[]) { // TODO: wykorzystanie fabryki } }
[ "t.borzyszkowski@gmail.com" ]
t.borzyszkowski@gmail.com
d9730621dc1748e14c7d0313c644b6f0889e5c6e
76ac9ab1fface222c4ed461a8df040311bdb2bb0
/src/main/java/com/adkun/markdown/controller/MdController.java
d9e6f2267e9e0d686351a1927c77d0e9ea91fe17
[]
no_license
ADkun/markdown-editor
1092fa67e631876f83b72e416a71b4a2e25407a5
15be13529c087e33cf43240dff95fab0a4d32ea7
refs/heads/master
2023-03-19T14:46:47.617253
2021-03-08T20:13:30
2021-03-08T20:13:30
345,761,198
0
0
null
null
null
null
UTF-8
Java
false
false
786
java
package com.adkun.markdown.controller; import com.adkun.markdown.common.ResponseModel; import com.adkun.markdown.markdown.MdParser; import com.adkun.markdown.markdown.MdTools; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @CrossOrigin(origins = "${adkun.web.path}", allowedHeaders = "*", allowCredentials = "true") public class MdController { @GetMapping("/parse") public ResponseModel mdParseHtml(String md) { List<String> list = MdTools.splitStr(md); MdParser parser = new MdParser(list); String res = parser.parseMdToHtml(); return new ResponseModel(res); } }
[ "adgnn@foxmail.com" ]
adgnn@foxmail.com
79d51bf532d4fc34ae754bdc002226e0ee8a441c
3bd543c20e59b480a420b96c25129a2ed70ca747
/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanFactory.java
56b00aad44f1f34fd1d77e1adab853c3b3322221
[ "Apache-2.0" ]
permissive
pengwei52/spring-framework-4.3.18.RELEASE
527710f642b22e3d1e5fda0e1c6745cf9f418d97
fd4ca1f313b16e57076bdccfbb38b52dabf52f75
refs/heads/master
2020-08-28T02:47:37.623269
2019-10-25T15:41:52
2019-10-25T15:41:52
217,565,397
0
0
null
null
null
null
UTF-8
Java
false
false
3,603
java
/* * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.beans.factory.xml; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.Resource; /** * Convenience extension of {@link DefaultListableBeanFactory} that reads bean definitions * from an XML document. Delegates to {@link XmlBeanDefinitionReader} underneath; effectively * equivalent to using an XmlBeanDefinitionReader with a DefaultListableBeanFactory. * * <p>The structure, element and attribute names of the required XML document * are hard-coded in this class. (Of course a transform could be run if necessary * to produce this format). "beans" doesn't need to be the root element of the XML * document: This class will parse all bean definition elements in the XML file. * * <p>This class registers each bean definition with the {@link DefaultListableBeanFactory} * superclass, and relies on the latter's implementation of the {@link BeanFactory} interface. * It supports singletons, prototypes, and references to either of these kinds of bean. * See {@code "spring-beans-3.x.xsd"} (or historically, {@code "spring-beans-2.0.dtd"}) for * details on options and configuration style. * * <p><b>For advanced needs, consider using a {@link DefaultListableBeanFactory} with * an {@link XmlBeanDefinitionReader}.</b> The latter allows for reading from multiple XML * resources and is highly configurable in its actual XML parsing behavior. * * @author Rod Johnson * @author Juergen Hoeller * @author Chris Beams * @since 15 April 2001 * @see org.springframework.beans.factory.support.DefaultListableBeanFactory * @see XmlBeanDefinitionReader * @deprecated as of Spring 3.1 in favor of {@link DefaultListableBeanFactory} and * {@link XmlBeanDefinitionReader} */ @Deprecated @SuppressWarnings({"serial", "all"}) public class XmlBeanFactory extends DefaultListableBeanFactory { // 自定义XML读取器,实现个性化的BeanDefinitionReader读取,对资源文件进行读取和注册。 private final XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this); /** * Create a new XmlBeanFactory with the given resource, * which must be parsable using DOM. * @param resource XML resource to load bean definitions from * @throws BeansException in case of loading or parsing errors */ public XmlBeanFactory(Resource resource) throws BeansException { this(resource, null); } /** * Create a new XmlBeanFactory with the given input stream, * which must be parsable using DOM. * @param resource XML resource to load bean definitions from * @param parentBeanFactory parent bean factory * @throws BeansException in case of loading or parsing errors */ public XmlBeanFactory(Resource resource, BeanFactory parentBeanFactory) throws BeansException { super(parentBeanFactory); this.reader.loadBeanDefinitions(resource); } }
[ "pengwei@sunline.cn" ]
pengwei@sunline.cn
1ab0ed64e95936b11617c8e0e914f4b9f2cd2649
af2586177df56b25e2fa3f8518dc3db4b36c4948
/com.gz.medicine.common.util/src/main/java/com/gz/medicine/common/util/MyX509TrustManager.java
152f9239f2e50b92022a8ed7ffeec0377fb5bc27
[]
no_license
8431/GZUTIL
8b7c3c1578c9ec8394a8713fce1574a2799033f6
a681e9953f82a108a4e219dccac8efef1ddbcbf1
refs/heads/master
2021-04-03T09:40:07.807911
2018-03-12T08:40:26
2018-03-12T08:40:26
124,858,411
0
0
null
null
null
null
UTF-8
Java
false
false
692
java
package com.gz.medicine.common.util; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import javax.net.ssl.X509TrustManager; /** * 信任管理器 * @author 李欣桦 * @date 2014-11-21下午9:15:08 */ public class MyX509TrustManager implements X509TrustManager { // 检查客户端证书 public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { } // 检查服务器端证书 public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { } // 返回受信任的X509证书数组 public X509Certificate[] getAcceptedIssuers() { return null; } }
[ "287186411@qq.com" ]
287186411@qq.com
ded718ffd8e80890a62cfc477566625da069ed63
8144aa0c43754c67e20e03192d2426170569c454
/TaCools/AppStudent/src/main/java/com/taku/safe/protocol/respond/RespAction.java
63b23ad430dbfe3a8a8503efadab237dc152942a
[ "Apache-2.0" ]
permissive
soulcure/projects
566f15746dcf1907ffab8fb4814d7cc9b8c6081b
c28be355f88998f75b0b0ce8d98b92fdb1c23eed
refs/heads/master
2020-05-16T04:08:45.066950
2019-06-15T14:06:56
2019-06-15T14:06:56
182,753,955
0
0
null
null
null
null
UTF-8
Java
false
false
606
java
package com.taku.safe.protocol.respond; /** * Created by colin on 2018/1/11. */ public class RespAction { private String title; private String date; private String teacher; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } public String getTeacher() { return teacher; } public void setTeacher(String teacher) { this.teacher = teacher; } }
[ "287268221@qq.com" ]
287268221@qq.com
89484d1c3b64212800cb4d2060759f566ec7c36e
245dea07434441985ce30d3cbfeb4ee1df23e774
/TestFireBase-master/app/src/main/java/com/example/testfirebase/ui/tools/ToolsViewModel.java
638a0c6b2a55f74fd89fc6cf238e2445b1feefcd
[]
no_license
BeatlesBOB/Appytodo
5e7b4221971026d8dfc1d52b8e7e73cfc2ccfc03
ecb7901b88958661dd793dd113ba2e329204aa16
refs/heads/master
2020-09-20T21:18:47.676530
2019-12-18T23:01:26
2019-12-18T23:01:26
224,592,564
0
1
null
2019-12-18T23:01:27
2019-11-28T07:16:17
Java
UTF-8
Java
false
false
451
java
package com.example.testfirebase.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; } }
[ "nathaallard@wificampus-034188.grenet.fr" ]
nathaallard@wificampus-034188.grenet.fr
fc7d790068121cb18348003400ec56bfc8dbc634
b6686fe4fb1050804387967c73eeb16c8d5971a4
/app/src/main/java/com/bluescape/model/util/StrokeVertexBuilder.java
4520bf19216f6b133718663b1dad242d722c8ff9
[]
no_license
spasapula/BlueScape_Android_TV
3dcbafb5ee997c2374bc6045d3bcc326e67bbfff
de0869fb55bd3feb6cb2f3597d198b2aa03bd9e8
refs/heads/master
2020-04-27T02:54:04.149209
2015-08-12T06:56:15
2015-08-12T06:56:15
40,584,912
1
0
null
null
null
null
UTF-8
Java
false
false
5,351
java
package com.bluescape.model.util; import android.graphics.PointF; import com.bluescape.AppConstants; import com.bluescape.model.widget.BaseWidgetModel; import com.bluescape.model.widget.StrokeModel; import com.bluescape.model.widget.TexturedWidgetModel; import com.bluescape.util.MathHelper; import java.util.ArrayList; public class StrokeVertexBuilder { private static final String TAG = StrokeVertexBuilder.class.getSimpleName(); // Incoming Vars from StrokeModel private ArrayList<Float> mArrayLocs; private float mStrokeModelLineWidth; private float mStrokeModelZOrder; private transient ArrayList<Float> mVertices; private BaseWidgetModel model; private transient float[] mVertices_array; private ArrayList<PointF> mPoints; public StrokeVertexBuilder(ArrayList<Float> mArrayLocs, float mStrokeModelLineWidth, float mStrokeModelZOrder, BaseWidgetModel parentModel) { // mStrokeModel = strokeModel; this.mArrayLocs = mArrayLocs; this.model = parentModel; this.mStrokeModelLineWidth = mStrokeModelLineWidth; this.mStrokeModelZOrder = mStrokeModelZOrder; //AppConstants.LOG(AppConstants.CRITICAL, TAG, "Stroke ZOrder " + mStrokeModelZOrder); } public void buildVertices() { // int nCoordinates = mStrokeModel.getArrayLocs().size(); int nCoordinates = mArrayLocs.size(); // Check if stroke model has points else skip building vertices // Also writing code in Message Handler to Skip if stroke locs are 0 as // this causes null pointer exceptions later in // com.bluescape.drawables.BaseWidgetDrawable.setVertexBuffer(BaseWidgetDrawable.java:139) if (nCoordinates > 0) { mPoints = new ArrayList<>(); mVertices = new ArrayList<>(nCoordinates * 6); for (int i = 0; i < nCoordinates; i += 2) { // PointF point = new PointF(mStrokeModel.getArrayLocs().get(i), // mStrokeModel.getArrayLocs().get(i + 1)); float x = mArrayLocs.get(i); float y = mArrayLocs.get(i + 1); PointF point = clampPoint(x, y); if(point!=null) mPoints.add(point); } convertPointsToVertices(); mVertices_array = new float[mVertices.size()]; for (int i = 0; i < mVertices.size(); i++) mVertices_array[i] = mVertices.get(i).floatValue(); } else { // AppConstants.LOG(AppConstants.CRITICAL, TAG, // "Size of Array Locs in mStrokeModel.getArrayLocs().size() is 0 Stroke Data issues: " // + mStrokeModel.getArrayLocs().size()); AppConstants.LOG(AppConstants.CRITICAL, TAG, "Size of Array Locs in mStrokeModel.getArrayLocs().size() is 0 Stroke Data issues: " + mArrayLocs.size()); } } protected PointF clampPoint(float x, float y) { PointF point; if(model!=null){ float width = 500; float height = 300; if(model instanceof TexturedWidgetModel){ TexturedWidgetModel twm = (TexturedWidgetModel) model; width = twm.getActualWidth(); height = twm.getActualHeight(); } if(x<0){ x =0; } if(x>width){ x = width; } if(y<0) { y =0; } if(y>height) { y = height; } } point = new PointF(x, y); return point; } public float[] getVertices() { return mVertices_array; } private void buildVerticesFromThreePoints(PointF middlePoint, PointF leftPoint, PointF rightPoint) { PointF leftVector = MathHelper.subtractPointVector(middlePoint, leftPoint); PointF rightVector = MathHelper.subtractPointVector(middlePoint, rightPoint); // Calculate the right offset PointF subtractedVector = MathHelper.subtractPointVector(rightVector, leftVector); PointF strokeDirection = MathHelper.normalizePointVector(subtractedVector); PointF perpendicularStrokeDirection = MathHelper.perpendicularVector(strokeDirection); // PointF offset = // MathHelper.vectorMultiplyByScalar(perpendicularStrokeDirection, // mStrokeModel.getLineWidth()/2); PointF offset = MathHelper.vectorMultiplyByScalar(perpendicularStrokeDirection, mStrokeModelLineWidth / 2); createVertices(middlePoint, offset); } private void convertPointsToVertices() { int pointIndex; PointF leftPoint, midPoint, rightPoint; if (mPoints.size() == 1) rightPoint = mPoints.get(0); else rightPoint = mPoints.get(1); midPoint = mPoints.get(0); leftPoint = midPoint; // Process first point buildVerticesFromThreePoints(midPoint, leftPoint, rightPoint); // Process middle for (pointIndex = 1; pointIndex < mPoints.size() - 1; pointIndex++) { midPoint = mPoints.get(pointIndex); leftPoint = mPoints.get(pointIndex - 1); rightPoint = mPoints.get(pointIndex + 1); buildVerticesFromThreePoints(midPoint, leftPoint, rightPoint); } // Process last point if (pointIndex < mPoints.size()) { midPoint = mPoints.get(pointIndex); rightPoint = midPoint; leftPoint = mPoints.get(pointIndex - 1); buildVerticesFromThreePoints(midPoint, leftPoint, rightPoint); } } private void createVertices(PointF point, PointF offset) { mVertices.add(point.x + offset.x); mVertices.add(point.y + offset.y); // mVertices.add((float)mStrokeModel.getZOrder()); mVertices.add(mStrokeModelZOrder);//TODO how does this relate to the matrix multiplication in the draw? mVertices.add(point.x - offset.x); mVertices.add(point.y - offset.y); // mVertices.add((float)mStrokeModel.getZOrder()); mVertices.add(mStrokeModelZOrder); } }
[ "spasapula@encoress.com" ]
spasapula@encoress.com
edc65a8d5b342a66813b133587b30ec7f0d8bd90
3cb36e8c641ec436d27bdb3ab9c1cef3944ef0f7
/src/main/java/com/cxy/monitor/controller/PredictController.java
a16df9b88301f4fec597e197824d6d1e3000e3c2
[]
no_license
Carrot97/Monitoring
6c332c53ed1361f97ead83606eb1f524ad7ba0e7
77d98b27dbf42858f11ae90bf0a7f161652341ed
refs/heads/master
2023-02-10T06:07:55.599497
2021-01-09T12:14:49
2021-01-09T12:14:49
328,147,723
1
0
null
null
null
null
UTF-8
Java
false
false
725
java
package com.cxy.monitor.controller; import com.cxy.monitor.bean.Statistics; import com.cxy.monitor.service.PredictService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @CrossOrigin @RestController public class PredictController { @Autowired PredictService predictService; @GetMapping(value = "/predict") public List<Statistics> getNewData() { System.out.println("收到predict请求"); List<Statistics> data = predictService.getData(); return data; } }
[ "lixuhuiustb@163.com" ]
lixuhuiustb@163.com
dfcfd776e4eadb0738d6c0631930c4b3d914375c
988121d3a4148a65f09be2c1e0dde08f063db3da
/runners/spark/2/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/DatasetSourceBatch.java
766d143d6d7dc4ee76b3a707076a5e7f6f960983
[ "BSD-3-Clause", "MIT", "LicenseRef-scancode-protobuf", "Apache-2.0", "Python-2.0" ]
permissive
lukecwik/incubator-beam
4dfb03b4efb5e302e1ad1c77f91e298f9a2b9e05
e8559c4eb9358e57ebe74652858191f1bddf65bd
refs/heads/master
2023-08-29T09:16:41.460308
2022-10-28T23:19:00
2022-10-28T23:19:00
52,895,685
3
1
Apache-2.0
2023-09-14T10:35:56
2016-03-01T17:24:29
Java
UTF-8
Java
false
false
6,656
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.beam.runners.spark.structuredstreaming.translation.batch; import static org.apache.beam.runners.spark.structuredstreaming.Constants.BEAM_SOURCE_OPTION; import static org.apache.beam.runners.spark.structuredstreaming.Constants.DEFAULT_PARALLELISM; import static org.apache.beam.runners.spark.structuredstreaming.Constants.PIPELINE_OPTIONS; import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument; import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import org.apache.beam.runners.core.construction.SerializablePipelineOptions; import org.apache.beam.runners.core.serialization.Base64Serializer; import org.apache.beam.runners.spark.structuredstreaming.translation.helpers.RowHelpers; import org.apache.beam.runners.spark.structuredstreaming.translation.helpers.SchemaHelpers; import org.apache.beam.sdk.io.BoundedSource; import org.apache.beam.sdk.io.BoundedSource.BoundedReader; import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.util.WindowedValue; import org.apache.spark.sql.catalyst.InternalRow; import org.apache.spark.sql.sources.v2.ContinuousReadSupport; import org.apache.spark.sql.sources.v2.DataSourceOptions; import org.apache.spark.sql.sources.v2.DataSourceV2; import org.apache.spark.sql.sources.v2.ReadSupport; import org.apache.spark.sql.sources.v2.reader.DataSourceReader; import org.apache.spark.sql.sources.v2.reader.InputPartition; import org.apache.spark.sql.sources.v2.reader.InputPartitionReader; import org.apache.spark.sql.types.StructType; /** * This is a spark structured streaming {@link DataSourceV2} implementation that wraps an {@link * BoundedSource}.As Continuous streaming is tagged experimental in spark (no aggregation support + * no exactly once guaranty), this class does no implement {@link ContinuousReadSupport}. */ public class DatasetSourceBatch implements DataSourceV2, ReadSupport { @Override public DataSourceReader createReader(DataSourceOptions options) { return new DatasetReader<>(options); } /** This class is mapped to Beam {@link BoundedSource}. */ private static class DatasetReader<T> implements DataSourceReader, Serializable { private int numPartitions; private BoundedSource<T> source; private SerializablePipelineOptions serializablePipelineOptions; @SuppressWarnings("unchecked") private DatasetReader(DataSourceOptions options) { if (!options.get(BEAM_SOURCE_OPTION).isPresent()) { throw new RuntimeException("Beam source was not set in DataSource options"); } this.source = Base64Serializer.deserializeUnchecked( options.get(BEAM_SOURCE_OPTION).get(), BoundedSource.class); if (!options.get(DEFAULT_PARALLELISM).isPresent()) { throw new RuntimeException("Spark default parallelism was not set in DataSource options"); } this.numPartitions = Integer.parseInt(options.get(DEFAULT_PARALLELISM).get()); checkArgument(numPartitions > 0, "Number of partitions must be greater than zero."); if (!options.get(PIPELINE_OPTIONS).isPresent()) { throw new RuntimeException("Beam pipelineOptions were not set in DataSource options"); } this.serializablePipelineOptions = new SerializablePipelineOptions(options.get(PIPELINE_OPTIONS).get()); } @Override public StructType readSchema() { // TODO: find a way to extend schema with a WindowedValue schema return SchemaHelpers.binarySchema(); } @Override public List<InputPartition<InternalRow>> planInputPartitions() { PipelineOptions options = serializablePipelineOptions.get(); List<InputPartition<InternalRow>> result = new ArrayList<>(); long desiredSizeBytes; try { desiredSizeBytes = source.getEstimatedSizeBytes(options) / numPartitions; List<? extends BoundedSource<T>> splits = source.split(desiredSizeBytes, options); for (BoundedSource<T> split : splits) { result.add( (InputPartition<InternalRow>) () -> new DatasetPartitionReader<>(split, serializablePipelineOptions)); } return result; } catch (Exception e) { throw new RuntimeException( "Error in splitting BoundedSource " + source.getClass().getCanonicalName(), e); } } } /** This class can be mapped to Beam {@link BoundedReader}. */ private static class DatasetPartitionReader<T> implements InputPartitionReader<InternalRow> { private boolean started; private boolean closed; private final BoundedSource<T> source; private BoundedReader<T> reader; DatasetPartitionReader( BoundedSource<T> source, SerializablePipelineOptions serializablePipelineOptions) { this.started = false; this.closed = false; this.source = source; // reader is not serializable so lazy initialize it try { reader = source.createReader(serializablePipelineOptions.get().as(PipelineOptions.class)); } catch (IOException e) { throw new RuntimeException("Error creating BoundedReader ", e); } } @Override public boolean next() throws IOException { if (!started) { started = true; return reader.start(); } else { return !closed && reader.advance(); } } @Override public InternalRow get() { WindowedValue<T> windowedValue = WindowedValue.timestampedValueInGlobalWindow( reader.getCurrent(), reader.getCurrentTimestamp()); return RowHelpers.storeWindowedValueInRow(windowedValue, source.getOutputCoder()); } @Override public void close() throws IOException { closed = true; reader.close(); } } }
[ "echauchot@apache.org" ]
echauchot@apache.org
20db8cae2deaffc98b108dd00d94c6d008ceea59
9348cf1ae1a53e848965a2edfe8b79e2b446f24b
/src/main/java/com/tavant/springboot/dao/ProductLinesDAO.java
1571693330be6b81cc450d2bbedae5f5958d9c28
[]
no_license
anuraj08/springboot
606b2c5baa31a6b611139d311e70b68cb7cb7b1e
325f2adbc1eb52e5541b9453d61289c1449376a3
refs/heads/master
2023-02-11T20:09:30.058681
2021-01-06T05:56:09
2021-01-06T05:56:09
327,215,178
0
0
null
null
null
null
UTF-8
Java
false
false
571
java
package com.tavant.springboot.dao; import java.util.List; import java.util.Optional; import com.tavant.springboot.model.ProductLines; public interface ProductLinesDAO { public String addProductLines(ProductLines productLines); public String deleteProductLine(String productLine); public Optional<ProductLines> updateProductLine(String productLine, ProductLines productLines); public Optional<ProductLines> getProductLineById(String productLine); public Optional<List<ProductLines>> getProductLine(); public boolean ProductLineExistById(String productLine); }
[ "anura@192.168.1.2" ]
anura@192.168.1.2
4e3e7de2b84e9e85fac8e2512899f4c34a840b45
2170cbf14269bc14ee1f701401dc1844a996b008
/composite/src/by/bsu/composite/main/Main.java
b66a0a46f1588f73f3e10ca168a010d3c8d80bed
[]
no_license
PavelSharlan/EpamCourses
35cfd81cc62ee5d8bcb857f507d558531ccffe6b
ec250fccf663f757579c688d194127cfe5bcb626
refs/heads/master
2021-01-12T13:57:43.323553
2016-10-09T19:55:54
2016-10-09T19:55:54
69,253,473
0
1
null
null
null
null
UTF-8
Java
false
false
1,007
java
package by.bsu.composite.main; import by.bsu.composite.component.Army; import by.bsu.composite.component.Warrior; import by.bsu.composite.entity.Race; import by.bsu.composite.war.ClanWar; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; import static by.bsu.composite.entity.WarriorKind.*; public class Main { private static final Logger LOGGER = LogManager.getLogger(Main.class); public static void main(String[] args) { Army alliance = new Army(Race.ALLIANCE); Army horde = new Army(Race.HORDE); Warrior palladin1 = new Warrior(PALADIN); Warrior palladin2 = new Warrior(PALADIN); Warrior shaman = new Warrior(SHADOW_SHAMAN); Warrior rogue = new Warrior(ROGUE); Warrior warlock = new Warrior(WARLOCK); alliance.add(palladin1); alliance.add(palladin2); horde.add(shaman); horde.add(rogue); horde.add(warlock); ClanWar.startWar(alliance, horde); } }
[ "kakawka706@gmail.com" ]
kakawka706@gmail.com
b22d1cb4bc93ed7788633e5ab0697042a24b9365
4c908f4410c2cba63a8ce58d760474e3afe10a84
/JDK7/Java 7 Recipes/code7recipt/chapter18/src/org/java7recipes/chapter18/recipe18_17/MailApplet.java
5d81e52743cbe4e11feed6532554c93c7e5ae182
[]
no_license
dhirajprakash/Java
932dfe11f6b9e283c13aa853de9d0576ddb9b894
daae451b0d83433415ca4ba6335da8515488a899
refs/heads/master
2021-05-11T14:49:26.083725
2019-11-23T18:42:54
2019-11-23T18:42:54
117,710,001
0
0
null
null
null
null
UTF-8
Java
false
false
3,777
java
package org.java7recipes.chapter18.recipe18_17; import java.applet.*; import java.awt.*; import java.awt.event.*; import java.util.Properties; import javax.mail.Message; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; /** * Recipe 18-17 * * Loading external libraries for an applet. * * @author juneau */ public class MailApplet extends Applet implements ActionListener { TextField from; TextField to; TextField smtp; TextArea message; Label mailLabel; Label fromLabel; Label toLabel; Label smtpLabel; Label blank; Label messageLabel; Button messageButton; public void init() { // Construct the button messageButton = new Button("Send"); mailLabel = new Label("Please fill out the form below to send email."); fromLabel = new Label("From:"); from = new TextField(); toLabel = new Label("To:"); to = new TextField(); smtpLabel = new Label("SMTP Host:"); smtp = new TextField(); messageLabel = new Label("Message:"); message = new TextArea(null,10,30); blank = new Label(); // Set the layout this.setLayout(new GridLayout(11,2)); // Add button to layout this.add(mailLabel); this.add(fromLabel); this.add(from); this.add(toLabel); this.add(to); this.add(smtpLabel); this.add(smtp); this.add(messageLabel); this.add(message); this.add(messageButton); // Set the action event equal to this class since it // implements ActionListener messageButton.addActionListener(this); this.setSize(300, 500); this.setVisible(true); } /** * Action method for this applet. This method will be called when this * class is set as an action listener. * * @param e */ public void actionPerformed(ActionEvent e) { sendMail(); this.mailLabel.setText("Message successfully sent"); this.mailLabel.setForeground(Color.GREEN); repaint(); } private boolean sendMail() { boolean result = false; try { // Send email here // servlet configuration initialization parameters String from = this.from.getText(); System.out.println(from); String to = this.to.getText(); String smtp = this.smtp.getText(); String message = this.message.getText(); //Set the host smtp address Properties props = new Properties(); props.put("mail.smtp.host", smtp); // create some properties and get the default Session Session session = Session.getDefaultInstance(props, null); session.setDebug(false); // create a message Message msg = new MimeMessage(session); // set the from and to address InternetAddress addressFrom = new InternetAddress(from); msg.setFrom(addressFrom); InternetAddress[] address = new InternetAddress[1]; address[0] = new InternetAddress(to); msg.setRecipients(Message.RecipientType.TO, address); msg.setSubject("*** Applet Email ***"); // Append Footer msg.setContent(message, "text/plain"); // Uncomment for production Transport.send(msg); result = true; } catch (javax.mail.MessagingException ex) { ex.printStackTrace(); result = false; } return result; } }
[ "plamen_stilyianov@yahoo.com" ]
plamen_stilyianov@yahoo.com
9b1193de2fe095ceeaf7941e50dbc735eeae68d7
9b35f1f1a65e5209484356efdcea0fa2d66599bf
/java/Basic_007_arithmeticOperators.java
bcc57affdfd110252b3793420e04c49845cd565a
[]
no_license
sakanamax/javaLearn
389c6fe0d9ffd24ea0d26ce4768f25cee3352eb4
a9aaa67d6c624985900b576cd656ea77ff61f66f
refs/heads/master
2021-03-12T21:38:04.907352
2014-01-07T13:42:16
2014-01-07T13:42:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,113
java
//這個範例主要進行算術運算子練習 class Basic_007_arithmeticOperators { public static void main(String[] args){ //宣告整數 x 以及 y int x,y; //給與 x, y 值 x = 20; y = 7; //列出 x, y 的值 System.out.println("x="+x); System.out.println("y="+y); //開始進行算術運算子 加減乘除 的部份 System.out.println("x + y= " + (x+y)); System.out.println("x - y= " + (x-y)); System.out.println("x * y= " + (x*y)); System.out.println("x / y= " + (x/y)); //使用 % 來取得 x 除以 y 的餘數 System.out.println("x % y= " + (x%y)); System.out.println("-----------------------------------------------"); //接下來試試看遞增 遞減 int a, b, c; a = 10; //顯示a 的值 System.out.println("a= "+a); //使用 a++ 遞增 但是 ++ 放在後面 a++; System.out.println("After a++, a= " + a); //這邊因為是使用 a++, 會先將a的值給b 之後才會+1 b=a++; System.out.println("b=a++, b= "+ b); System.out.println("now, a= " + a); //這邊因為是使用 ++a, 所以先會 +1 再給c 的值 c=++a; System.out.println("c=++a, c= " + c); } }
[ "sakana@cycu.org.tw" ]
sakana@cycu.org.tw
d2d3dbe54c3f3340d3fe0d425933c5850ccd5253
64420f22cc9607a72aae596f8ac216d9914f31c7
/spring-boot-restful-starter-master/src/main/java/cn/com/hohistar/tutorial/springboot/starter/configuration/RabbitConfig.java
5639def6dd67c15d8896a67afeb724b42b4290fa
[]
no_license
muruoyi/SpringCLoudAction
a45814235824120a21708a6df80957059036f330
dbea65581aee14c4cc319bec93f8cd7128b5dd52
refs/heads/master
2020-11-30T11:23:39.449717
2019-12-29T08:38:38
2019-12-29T08:38:38
230,387,185
1
0
null
null
null
null
UTF-8
Java
false
false
2,336
java
package cn.com.hohistar.tutorial.springboot.starter.configuration; import org.springframework.amqp.core.Binding; import org.springframework.amqp.core.BindingBuilder; import org.springframework.amqp.core.Queue; import org.springframework.amqp.core.TopicExchange; import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory; import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; import org.springframework.amqp.support.converter.MessageConverter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class RabbitConfig { @Bean public ConnectionFactory connectionFactory() { CachingConnectionFactory connectionFactory = new CachingConnectionFactory("localhost", 5672); connectionFactory.setUsername("guest"); connectionFactory.setPassword("guest"); return connectionFactory; } @Bean public MessageConverter jsonMessageConverter(){ return new Jackson2JsonMessageConverter(); } @Bean public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() { SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); factory.setConnectionFactory(connectionFactory()); factory.setMessageConverter(new Jackson2JsonMessageConverter()); factory.setConcurrentConsumers(3); factory.setMaxConcurrentConsumers(10); return factory; } //声明队列 @Bean public Queue queue1() { return new Queue("hello.queue1", true); } @Bean public Queue queue2() { return new Queue("hello.queue2", true); } //声明交互器 @Bean TopicExchange topicExchange() { return new TopicExchange("topicExchange"); } //绑定 @Bean public Binding binding1() { return BindingBuilder.bind(queue1()).to(topicExchange()).with("key.1"); } @Bean public Binding binding2() { return BindingBuilder.bind(queue2()).to(topicExchange()).with("key.#"); } }
[ "438599621@qq.com" ]
438599621@qq.com
8ffa87456e2667adabb3932e7c18bb42eac5ba72
918c2ab91ecd40623cdb96debb218c6a69d9e1dc
/src/main/java/subscriber/SubscriberMessageReaderThread.java
1f2279301024f858d7b7d58e543243565a70ae32
[]
no_license
TheoHappy/MB-Socket
2cb29f8f05a7ef94c3e3f53ee9a2f9b5febca8aa
045bb7a7a8d915e920f672e83a18b6c4264e1863
refs/heads/master
2023-08-07T02:02:34.332861
2021-10-07T19:52:47
2021-10-07T19:52:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
package subscriber; import broker.BrokerSocket; public class SubscriberMessageReaderThread implements Runnable { private BrokerSocket transport; public SubscriberMessageReaderThread(BrokerSocket transport) { this.transport = transport; } public void run() { String messageFromServer; while (!(messageFromServer = transport.readAsync()).equals("disconnect")) System.out.println(messageFromServer); System.out.println("Disconnected from broker"); } }
[ "teodore473@gmail.com" ]
teodore473@gmail.com
af8bd3c35f949430014c4c6ec56cc9e86977671d
39054d11cbedb9c572e158346c9aa6386d9f3cea
/src/com/yzxt/yh/module/sys/bean/User.java
37412b2445da3525c6c3ea32783b07095299ed40
[]
no_license
liuchaoyang/yhhbsz
7d8e5959c795350c3d34a2679242b668769f4b98
929f395d47022f0db15e0df30017a662b4fd6e90
refs/heads/master
2020-04-15T16:52:27.486669
2019-02-17T09:20:28
2019-02-17T09:20:28
164,853,859
0
0
null
null
null
null
UTF-8
Java
false
false
5,098
java
package com.yzxt.yh.module.sys.bean; import java.io.Serializable; import java.sql.Timestamp; import java.util.Collection; import java.util.Date; public class User implements Serializable { private static final long serialVersionUID = 1L; private String id; private Integer state; private Integer type; private String account; private String code; public String getCode() { return code; } public void setCode(String code) { this.code = code; } private String phone; private String email; private String idCard; private String name; private Integer sex; private Integer jjLinkman; public Integer getJjLinkman() { return jjLinkman; } public void setJjLinkman(Integer jjLinkman) { this.jjLinkman = jjLinkman; } public Integer getSex() { return sex; } public void setSex(Integer sex) { this.sex = sex; } private String address; public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } private String imgFileId; private String orgId; private String createBy; private Timestamp createTime; private String updateBy; private Timestamp updateTime; // 非持久化数据扩展 private String password; private String funcs; private Collection<String> roles; private String imgFilePath; private Date startDay; private Date endDay; private String doctorId; private FileDesc iconFile; private String orgName; public FileDesc getIconFile() { return iconFile; } public void setIconFile(FileDesc iconFile) { this.iconFile = iconFile; } public Date getStartDay() { return startDay; } public void setStartDay(Date startDay) { this.startDay = startDay; } public Date getEndDay() { return endDay; } public void setEndDay(Date endDay) { this.endDay = endDay; } public String getDoctorId() { return doctorId; } public void setDoctorId(String doctorId) { this.doctorId = doctorId; } public String getId() { return id; } public void setId(String id) { this.id = id; } public Integer getState() { return state; } public void setState(Integer state) { this.state = state; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } public String getAccount() { return account; } public void setAccount(String account) { this.account = account; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getIdCard() { return idCard; } public void setIdCard(String idCard) { this.idCard = idCard; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getImgFileId() { return imgFileId; } public void setImgFileId(String imgFileId) { this.imgFileId = imgFileId; } public String getOrgId() { return orgId; } public void setOrgId(String orgId) { this.orgId = orgId; } public String getCreateBy() { return createBy; } public void setCreateBy(String createBy) { this.createBy = createBy; } public Timestamp getCreateTime() { return createTime; } public void setCreateTime(Timestamp createTime) { this.createTime = createTime; } public String getUpdateBy() { return updateBy; } public void setUpdateBy(String updateBy) { this.updateBy = updateBy; } public Timestamp getUpdateTime() { return updateTime; } public void setUpdateTime(Timestamp updateTime) { this.updateTime = updateTime; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getFuncs() { return funcs; } public void setFuncs(String funcs) { this.funcs = funcs; } public Collection<String> getRoles() { return roles; } public void setRoles(Collection<String> roles) { this.roles = roles; } public String getImgFilePath() { return imgFilePath; } public void setImgFilePath(String imgFilePath) { this.imgFilePath = imgFilePath; } public String getOrgName() { return orgName; } public void setOrgName(String orgName) { this.orgName = orgName; } }
[ "875818589@qq.com" ]
875818589@qq.com
83a9b34654f7fc3647ebf43282b07e87424b6f8c
16d97ec3948c5ac2f083cec7e5667491ad1b302e
/WidgetEscritorio/app/src/main/java/com/rafaels/widgetescritorio/ConfiguraWidget.java
153176ab551745142dedba73f6355514b1ce394a
[]
no_license
RafaelSMartin/AndroidMaster
f7a3bae2ca250ffd5b4fdcfac11d8211393dbb2a
efd5aeb06703c368780bfcd8049c31f31f096f54
refs/heads/master
2021-09-06T21:22:10.566931
2018-02-11T16:08:17
2018-02-11T16:08:17
114,761,987
0
0
null
null
null
null
UTF-8
Java
false
false
1,956
java
package com.rafaels.widgetescritorio; import android.appwidget.AppWidgetManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.EditText; import android.widget.Toast; /** * Created by Rafael S Martin on 11/02/2018. */ public class ConfiguraWidget extends AppCompatActivity { int widgetId; EditText editText; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.configura_widget); editText = (EditText) findViewById(R.id.editText1); setResult(RESULT_CANCELED); Bundle extras = getIntent().getExtras(); if (extras == null) { finish(); } widgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); if (widgetId == AppWidgetManager.INVALID_APPWIDGET_ID) { finish(); } } public void buttonOK(View view) { int cont; try { cont = Integer.parseInt(editText.getText().toString()); } catch (Exception e) { Toast.makeText(this, "No es un número", Toast.LENGTH_SHORT).show(); return; } SharedPreferences prefs = getSharedPreferences("contadores", Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putInt("cont_" + widgetId, cont); editor.commit(); MiAppWidgetProvider.actualizaWidget(this, widgetId); Intent resultValue = new Intent(); resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetId); setResult(RESULT_OK, resultValue); finish(); } }
[ "noreply@github.com" ]
noreply@github.com
57f0f703cbf21ffcfc2e8b72601250cafe167dc2
aa528cb6af4d5d552c685378f9ee0f9b92400e5c
/src/com/yodlee/design/patterns/creational/strategy/Employee.java
3e50611a8cd63fc380b7d7505829b5e6b7b2a8c0
[]
no_license
techiepark/design-patterns
d07f4ed6ca8a1b863a4185ba657560a2c15680c6
ef69d8972bff096d76405b732a1e84e418cc9b44
refs/heads/master
2020-04-21T12:38:51.835608
2018-11-15T11:23:23
2018-11-15T11:23:23
169,570,006
1
0
null
2019-02-07T12:42:26
2019-02-07T12:42:26
null
UTF-8
Java
false
false
1,057
java
package com.yodlee.design.patterns.creational.strategy; public class Employee { private int id; private String name; private int age; private double salary; public Employee(int id, String name, int age){ this.id = id; this.name = name; this.age = age; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public double getSalary() { return salary; } public void setSalary(double salary) { this.salary = salary; } @Override public String toString() { return "Employee{" + "id=" + id + ", name='" + name + '\'' + ", age=" + age + ", salary=" + salary + '}'; } }
[ "pradeep.kumar44@gmail.com" ]
pradeep.kumar44@gmail.com