blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2600371ca15f058085099cc5e26ebf0476ff7533 | 8a9c1d6b8f0c5394e79119e6b9ed7b82ce087087 | /src/main/java/com/embl/poc/embl/repository/PersonRepository.java | 2986c042cabaaeeb7fa1cc43708ca99a97ea9a2e | [] | no_license | wasifhasan/EMBL | 538e4aacb8a9a94653dfd1df0bb563eb3825890f | 0a5a403e935ee1452373df44afeaaebf06d3fc62 | refs/heads/master | 2023-03-05T22:08:10.337707 | 2021-02-15T09:41:48 | 2021-02-15T09:41:48 | 338,945,029 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package com.embl.poc.embl.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.embl.poc.embl.model.Person;
/**
* The Repository interface which has all basic CRUD methods
* this interface is used to store,retrieve,edit, delete values in database
*
* @author Syed.Hasan
*/
public interface PersonRepository extends JpaRepository<Person, Long> {
}
| [
"syed.hasan@ukg.com"
] | syed.hasan@ukg.com |
365165e16a480e0972ef4440f818f25490b61087 | 60128740301e33de873f8172841ee5cad609e1ab | /src/com/jenika/oop/Lab6/Hospital.java | 0c1fa5fffe8e38b8e74053222db03575b00987fc | [] | no_license | janegarciu/Java | 921617014dff05f51748de85f8167aa21a530e95 | 853a307d2b6bb1f50f82eb3da1976a0ef84e8972 | refs/heads/master | 2020-08-01T15:39:11.371707 | 2019-12-11T15:14:09 | 2019-12-11T15:14:09 | 211,035,727 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 329 | java | package com.jenika.oop.Lab6;
import java.util.ArrayList;
public class Hospital {
protected String name;
protected Address address;
protected Phone phone;
protected ArrayList<Department> department = new ArrayList<Department>();
public void addDepartement(Department s){
department.add(s);
}
}
| [
"eugenia.garciu@isa.utm.md"
] | eugenia.garciu@isa.utm.md |
c4740af143a70292b5b78457cc4324fc3eb6b9e2 | b646008f3114fdee23703759d0abfe0228ac83ad | /DButils.java | 1b150b8cb1543bcc9f28a31092b5b49627c873e9 | [] | no_license | harishsoftware-ec-apps/wallmart | 6d5b344acd52106c33e55d883761a8703891db03 | 1b2c96bef7a962ccc802d72acf0ca00f6608d895 | refs/heads/master | 2023-06-08T02:19:30.092549 | 2021-07-01T07:00:10 | 2021-07-01T07:00:10 | 381,932,215 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 51 | java | updated DB
Hello welcome to git
this is database
| [
"harish99c@gmail.com"
] | harish99c@gmail.com |
093bfcd619b9f463aaf683f0274cec20255a65a9 | 541225bf9c8cb693e1a4fd00b4956cce24fc38cf | /src/view/command/Command.java | 9b98366001dc55ce0440f39170a9465fa127acac | [] | no_license | entropeanut/Empires | ee7a6a93667fd1af760e807c6807c12380f2929e | 12dc87b7b9b4d9b1c85ee5989a5a79c8829c7dfa | refs/heads/master | 2021-05-14T01:36:22.212494 | 2018-01-07T13:42:06 | 2018-01-07T13:42:06 | 116,567,391 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 183 | java | package view.command;
import model.Empire;
import server.Controller;
public abstract class Command {
public abstract void execute(Controller controller, Empire empire);
}
| [
"35192962+entropeanut@users.noreply.github.com"
] | 35192962+entropeanut@users.noreply.github.com |
8bc21ba6ba78295fb1ff243ec9ccf66b4c61c6b0 | 532fb1352c05ad5fd2efce76113c2d0daa74926c | /app/src/main/java/com/zhhl/marketauthority/bean/ApplyPermission.java | 9cd75edeae189b97b56557107a3d3fa00b3ecc20 | [] | no_license | 624205157/MarketAuthority | 0e8385e3ce9a7351d5a3e8e3a6e679792c1f6147 | 0399c5ad719e0709d573871e39dd1855dfc28306 | refs/heads/master | 2021-07-11T04:28:00.626476 | 2019-12-17T01:58:11 | 2019-12-17T01:58:11 | 227,495,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 832 | java | package com.zhhl.marketauthority.bean;
/**
* Created by 陈泽宇 on 2019/12/10.
* Describe:申请许可
*/
public class ApplyPermission {
private String sort;//类别
private String children;//子项
private String level;//级别
private String type;//品种
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
public String getChildren() {
return children;
}
public void setChildren(String children) {
this.children = children;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
| [
"624205157@qq.com"
] | 624205157@qq.com |
d5cc171cb4db266a045e0bc7883ac8d4fe311890 | 7b5abbbf6f8671c0285f8d81a8f02b854d6e381a | /MyViewPager/src/com/lwj/myviewpager/ViewPagerAdapter.java | a53ebf6de5f17572f1971c3479ddd1efd3948a2b | [] | no_license | wslbqzj/MyPractices | e18a1d13727e2e39f45b99941a2e47717670c67c | e68ef4a40832adab06ec06a310b1ef3da3e2582a | refs/heads/master | 2021-01-20T20:05:20.473846 | 2016-06-16T08:22:10 | 2016-06-16T08:22:10 | 61,274,189 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,191 | java | package com.lwj.myviewpager;
import java.util.ArrayList;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
public class ViewPagerAdapter extends PagerAdapter{
//界面列表
private ArrayList<View> views;
public ViewPagerAdapter(ArrayList<View> views)
{
this.views = views;
}
//获得当前界面数
@Override
public int getCount() {
// TODO Auto-generated method stub
if (views != null) {
return views.size();
}
else return 0;
}
//判断是否由对象生成界面
@Override
public boolean isViewFromObject(View arg0, Object arg1) {
// TODO Auto-generated method stub
return (arg0 == arg1);
}
//销毁position位置的界面
@Override
public void destroyItem(View container, int position, Object object) {
((ViewPager) container).removeView(views.get(position));
}
//初始化position位置的界面
@Override
public Object instantiateItem(View container, int position) {
((ViewPager) container).addView(views.get(position), 0);
return views.get(position);
}
}
| [
"1330068893@qq.com"
] | 1330068893@qq.com |
eb4f3950df323fd76aac8daa74219012f036fbfc | 16e9222f84d55dd99935f1be2356d2fddbd61a84 | /MyNotificationApplication/app/src/main/java/com/example/mynotificationapplication/NotificationHelper.java | 322433205e5521ade63945bd43dd6c3feff9de50 | [] | no_license | san-coding/android_projects | 455ff91db81a926426a5aeda6d01e2e1852cc306 | 06b1695876dcdaae49344e00ae99826eaf543b63 | refs/heads/main | 2023-08-30T12:00:36.736972 | 2021-11-16T08:52:42 | 2021-11-16T08:52:42 | 423,525,033 | 2 | 0 | null | 2021-11-01T15:52:31 | 2021-11-01T15:52:30 | null | UTF-8 | Java | false | false | 2,500 | java | package com.example.mynotificationapplication;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import java.util.Random;
public class NotificationHelper extends ContextWrapper {
private static final String TAG = "NotificationHelper";
public NotificationHelper(Context base) {
super(base);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
createChannels();
}
}
private String CHANNEL_NAME = "High priority channel";
private String CHANNEL_ID = "com.example.notifications" + CHANNEL_NAME;
private void createChannels() {
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH);
notificationChannel.enableLights(true);
notificationChannel.enableVibration(true);
notificationChannel.setDescription("this is the description of the channel.");
notificationChannel.setLightColor(Color.RED);
notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.createNotificationChannel(notificationChannel);
}
public void sendHighPriorityNotification(String title, String body, Class activityName) {
Intent intent = new Intent(this, activityName);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 267, intent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)
// .setContentTitle(title)
// .setContentText(body)
.setSmallIcon(R.drawable.ic_launcher_background)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setStyle(new NotificationCompat.BigTextStyle().setSummaryText("summary").setBigContentTitle(title).bigText(body))
.setContentIntent(pendingIntent)
.setAutoCancel(true)
.build();
NotificationManagerCompat.from(this).notify(new Random().nextInt(), notification);
}
}
| [
"dhanyahari07@gmail.com"
] | dhanyahari07@gmail.com |
45d5edb054a8e229fb338f5a1cdb409d978b716d | 950aafa50a115a7351e4dd35474df4291a1fd535 | /cloud-provider-payment/src/main/java/org/example/Payment8001Main.java | 3bbeab36b597901b3706b40e586f452f385c8867 | [] | no_license | wangyouzhan/spring-cloud-shangguigu | e017ef089869428342ae3259550d784d428b5afe | 32612993254695a527ccf2ee7b8e2062058072d8 | refs/heads/main | 2023-06-15T05:57:22.164406 | 2021-07-13T03:22:16 | 2021-07-13T03:22:16 | 379,101,512 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 498 | java | package org.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@EnableEurekaClient
@SpringBootApplication
@EnableDiscoveryClient
public class Payment8001Main {
public static void main(String[] args) {
SpringApplication.run(Payment8001Main.class, args);
}
}
| [
"936804097@qq.com"
] | 936804097@qq.com |
1fb225557e39c1b70f290d84b9a889100ecb44ae | a0e31b6e910bae0f5dd10ef6c72eb01080333d5b | /calculatorAPI/src/main/java/com/springboot/h2/ctrl/MathExpressionController.java | cb192f3face293e8d141f9d281c3bdf64eb8d9d3 | [] | no_license | rgrg27/Calculator-REST-API | 904b94f3404cfcc27551499f9187f63689731436 | b0fe78eade4a527753d8e3314830adfbf3e2eca2 | refs/heads/master | 2022-11-18T02:02:36.105375 | 2020-07-07T17:59:48 | 2020-07-07T17:59:48 | 277,699,429 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,758 | java | package com.springboot.h2.ctrl;
import java.util.List;
import javax.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.springboot.h2.model.MathExpression;
import com.springboot.h2.serv.MathExpressionService;
import com.springboot.h2.serv.OpratorService;
@RestController // Useful to create the RESTful webservices.
public class MathExpressionController {
private final Logger log = LoggerFactory.getLogger(this.getClass());
// @Autowired annotation provides the automatic dependency injection.
@Autowired
MathExpressionService service;
@Autowired
OpratorService opratorService;
// Save Operator entity in the h2 database.
// @PostMapping annotation handles the http post request matched with the given uri.
// @RequestBody annotation binds the http request body to the domain object.
// @Valid annotation validates a model after binding the user input to it.
@PostMapping(value= "/expression")
public String save(final@RequestBody @Valid MathExpression exp){
service.save(exp);
opratorService.updateOpratorTable(exp);
return service.calulateExp(exp);
}
// Get all expressions from the database.
// @GetMapping annotation handles the http get request matched with the given uri.
@GetMapping(value= "/expression/all", produces= "application/vnd.jcg.api.v1+json")
public List<String> getAll() {
log.info("Getting expressions from the database.");
return service.getAllString();
}
}
| [
"rgrg27@gmail.com"
] | rgrg27@gmail.com |
ee0a124ab1912dc167ac44f6cee79983ec24340a | 3a29d7b85b6fa44cafe9a99f4d4f8d439a9f956c | /x_teamwork_assemble_control/target/x_teamwork_assemble_control/describe/sources/com/x/teamwork/assemble/control/jaxrs/global/PriorityNotExistsException.java | 6f35114693840a64837fd8d9aa9d067921f3a130 | [] | no_license | wadelu/o2oa-teamwork | 9476644c0642b124e5d112f03375ff6bdede2248 | d54e4765225bd3c0d9fe970deec3acaafac5cb7e | refs/heads/master | 2023-07-01T03:32:45.533775 | 2021-08-02T09:04:44 | 2021-08-02T09:04:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 351 | java | package com.x.teamwork.assemble.control.jaxrs.global;
import com.x.base.core.project.exception.PromptException;
class PriorityNotExistsException extends PromptException {
private static final long serialVersionUID = 1859164370743532895L;
PriorityNotExistsException( String id ) {
super("指定ID的优先级信息不存在。ID:" + id );
}
}
| [
"luojing@o2oa.net"
] | luojing@o2oa.net |
4affe73b6736bcda448057d3d58444d48b235ed9 | 2bf30c31677494a379831352befde4a5e3d8ed19 | /exportLibraries/hds/src/main/java/com/emc/storageos/hds/model/FreeLun.java | 8cb50ea40568a7efb25a1117fb6d244f55770103 | [] | no_license | dennywangdengyu/coprhd-controller | fed783054a4970c5f891e83d696a4e1e8364c424 | 116c905ae2728131e19631844eecf49566e46db9 | refs/heads/master | 2020-12-30T22:43:41.462865 | 2015-07-23T18:09:30 | 2015-07-23T18:09:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 816 | java | /*
* Copyright 2015 EMC Corporation
* All Rights Reserved
*/
/**
* Copyright (c) 2013 EMC Corporation
* All Rights Reserved
*
* This software contains the intellectual property of EMC Corporation
* or is licensed to EMC Corporation from third parties. Use of this
* software and the intellectual property contained therein is expressly
* limited to the terms and conditions of the License Agreement under which
* it is provided by or on behalf of EMC.
*/
package com.emc.storageos.hds.model;
public class FreeLun {
private String lun;
public FreeLun() {
}
/**
* @return the lun
*/
public String getLun() {
return lun;
}
/**
* @param lun the lun to set
*/
public void setLun(String lun) {
this.lun = lun;
}
}
| [
"review-coprhd@coprhd.org"
] | review-coprhd@coprhd.org |
21e71ab4393008398207bf67b50703840ea89bf3 | e14a938656e17d419bbdca8b9f46287c5e05cd39 | /method_extract/extract/StatementListener.java | caae554143ea697a8572a9c4e314572802e104dc | [] | no_license | glaghari/sbfl_unit_component_tests | 4076ba29a27a9c8879a874487dd947473dbcde84 | 3c83b40117098f0f2776baa9074753c5ec942c5b | refs/heads/master | 2020-03-15T20:56:47.842775 | 2018-05-06T14:08:30 | 2018-05-06T14:08:30 | 132,344,592 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,214 | java | package extract;
import java.util.List;
import antlr.JavaBaseListener;
import antlr.JavaParser;
public class StatementListener extends JavaBaseListener {
private Clazz clazz = null;
public StatementListener(Clazz clazz) {
this.clazz = clazz;
}
@Override
public void enterBlock(JavaParser.BlockContext ctx) {
if(ctx.blockStatement(0) == null)
return;
// ctx.blockStatement().forEach(blockStatement -> blockStatement.enterRule(this));
for(JavaParser.BlockStatementContext blockStatement : ctx.blockStatement()) {
blockStatement.enterRule(this);
}
}
@Override
public void enterBlockStatement(JavaParser.BlockStatementContext ctx) {
if(ctx.statement() != null) {
ctx.statement().enterRule(this);
}
if(ctx.localVariableDeclarationStatement() != null) {
// ctx.localVariableDeclarationStatement().localVariableDeclaration().variableDeclarators().variableDeclarator().forEach(variableDeclarator -> variableDeclarator.enterRule(this));
for(JavaParser.VariableDeclaratorContext variableDeclarator : ctx.localVariableDeclarationStatement().localVariableDeclaration().variableDeclarators().variableDeclarator()) {
variableDeclarator.enterRule(this);
}
}
if(ctx.typeDeclaration() != null) {
if(ctx.typeDeclaration().classDeclaration() != null) {
String className = (this.clazz.readOnlyAnonymousCounter()) + ctx.typeDeclaration().classDeclaration().Identifier().getText();
Clazz innerClazz = new Clazz();
innerClazz.setClassName(className);
this.clazz.addAInnerClazz(innerClazz);
ClassListener classListener = new ClassListener(innerClazz);
// ctx.typeDeclaration().classDeclaration().classBody().classBodyDeclaration().forEach(classBodyDeclaration -> classBodyDeclaration.enterRule(classListener));
for(JavaParser.ClassBodyDeclarationContext classBodyDeclaration : ctx.typeDeclaration().classDeclaration().classBody().classBodyDeclaration()) {
classBodyDeclaration.enterRule(classListener);
}
}
else if(ctx.typeDeclaration().enumDeclaration() != null) {
String className = (this.clazz.readOnlyAnonymousCounter()) + ctx.typeDeclaration().enumDeclaration().Identifier().getText();
Clazz innerClazz = new Clazz();
innerClazz.setClassName(className);
this.clazz.addAInnerClazz(innerClazz);
ClassListener classListener = new ClassListener(innerClazz);
// ctx.typeDeclaration().enumDeclaration().enumBodyDeclarations().forEach(classBodyDeclaration -> classBodyDeclaration.enterRule(classListener));
for(JavaParser.ClassBodyDeclarationContext classBodyDeclaration : ctx.typeDeclaration().enumDeclaration().enumBodyDeclarations().classBodyDeclaration()) {
classBodyDeclaration.enterRule(classListener);
}
}
else if(ctx.typeDeclaration().interfaceDeclaration() != null) {
String className = (this.clazz.readOnlyAnonymousCounter()) + ctx.typeDeclaration().interfaceDeclaration().Identifier().getText();
Clazz innerClazz = new Clazz();
innerClazz.setClassName(className);
this.clazz.addAInnerClazz(innerClazz);
ClassListener classListener = new ClassListener(innerClazz);
for(JavaParser.InterfaceBodyDeclarationContext interfaceBodyDeclaration : ctx.typeDeclaration().interfaceDeclaration().interfaceBody().interfaceBodyDeclaration()) {
interfaceBodyDeclaration.enterRule(classListener);
}
}
else if(ctx.typeDeclaration().annotationTypeDeclaration() != null) {
String className = (this.clazz.readOnlyAnonymousCounter()) + ctx.typeDeclaration().annotationTypeDeclaration().Identifier().getText();
Clazz innerClazz = new Clazz();
innerClazz.setClassName(className);
this.clazz.addAInnerClazz(innerClazz);
ClassListener classListener = new ClassListener(innerClazz);
for(JavaParser.AnnotationTypeElementDeclarationContext annoCtx : ctx.typeDeclaration().annotationTypeDeclaration().annotationTypeBody().annotationTypeElementDeclaration()) {
annoCtx.annotationTypeElementRest().enterRule(classListener);
}
}
}
}
@Override
public void enterStatement(JavaParser.StatementContext ctx) {
// System.out.println("Enter statement " + ctx.start.getLine());
// System.out.println(ctx.getText());
if(ctx.block() != null) {
ctx.block().enterRule(this);
}
if(ctx.statementExpression() != null) {
ctx.statementExpression().enterRule(this);
}
if(ctx.statement() != null) {
// ctx.statement().forEach(statement -> statement.enterRule(this));
for(JavaParser.StatementContext statement : ctx.statement()) {
statement.enterRule(this);
}
}
if(ctx.expression() != null) {
// ctx.expression().forEach(expression -> expression.enterRule(this));
for(JavaParser.ExpressionContext expression : ctx.expression()) {
expression.enterRule(this);
}
}
if(ctx.parExpression() != null) {
ctx.parExpression().expression().enterRule(this);
}
if(ctx.forControl() != null) {
int startLine = ctx.start.getLine();
int endLine = ctx.stop.getLine();
if(IntInterval.match(startLine, endLine)) {
Statement statement = new Statement(startLine);
this.clazz.add(statement);
}
}
if(ctx.catchClause() != null) {
// ctx.catchClause().forEach(catchClause -> catchClause.enterRule(this));
for(JavaParser.CatchClauseContext catchClause : ctx.catchClause()) {
catchClause.enterRule(this);
}
}
if(ctx.finallyBlock() != null) {
int startLine = ctx.finallyBlock().start.getLine();
int endLine = ctx.finallyBlock().stop.getLine();
if(IntInterval.match(startLine, endLine)) {
Statement statement = new Statement(startLine);
this.clazz.add(statement);
}
ctx.finallyBlock().block().enterRule(this);
}
if(ctx.switchBlockStatementGroup() != null) {
// ctx.switchBlockStatementGroup().forEach(switchBlockStatementGroup -> switchBlockStatementGroup.enterRule(this));
for(JavaParser.SwitchBlockStatementGroupContext switchBlockStatementGroup : ctx.switchBlockStatementGroup()) {
switchBlockStatementGroup.enterRule(this);
}
}
if(ctx.switchLabel() != null) {
// ctx.switchLabel().forEach(switchLabel -> switchLabel.enterRule(this));
for(JavaParser.SwitchLabelContext switchLabel : ctx.switchLabel()) {
switchLabel.enterRule(this);
}
}
if(ctx.resourceSpecification() != null) {
for(JavaParser.ResourceContext resource : ctx.resourceSpecification().resources().resource()) {
int startLine = resource.start.getLine();
int endLine = resource.stop.getLine();
if(IntInterval.match(startLine, endLine)) {
Statement statement = new Statement(startLine);
this.clazz.add(statement);
}
}
}
int startLine = ctx.start.getLine();
int endLine = ctx.stop.getLine();
if(IntInterval.match(startLine, endLine)) {
Statement statement = new Statement(startLine);
this.clazz.add(statement);
}
}
@Override
public void enterStatementExpression(JavaParser.StatementExpressionContext ctx) {
ctx.expression().enterRule(this);
}
@Override
public void enterExpression(JavaParser.ExpressionContext ctx) {
// System.out.println("Enter expression " + ctx.start.getLine() + "-" + ctx.stop.getLine() + " --- " + ctx.getText() );
if(ctx.expression() == null) {
int startLine = ctx.start.getLine();
int endLine = ctx.stop.getLine();
if(IntInterval.match(startLine, endLine)) {
Statement statement = new Statement(ctx.start.getLine());
this.clazz.add(statement);
}
}
else {
// ctx.expression().forEach(expression -> expression.enterRule(this));
for(JavaParser.ExpressionContext expression : ctx.expression()) {
expression.enterRule(this);
}
if(ctx.expressionList() != null)
for(JavaParser.ExpressionContext eCtx : ctx.expressionList().expression()) {
eCtx.enterRule(this);
}
if(ctx.explicitGenericInvocation() != null) {
JavaParser.ExplicitGenericInvocationSuffixContext sufCtx = ctx.explicitGenericInvocation().explicitGenericInvocationSuffix();
List<JavaParser.ExpressionContext> lstECtx = null;
if(sufCtx.superSuffix() != null && sufCtx.superSuffix().arguments() != null && sufCtx.superSuffix().arguments().expressionList() != null)
lstECtx = sufCtx.superSuffix().arguments().expressionList().expression();
else if(sufCtx.arguments().expressionList() != null)
lstECtx = sufCtx.arguments().expressionList().expression();
if(lstECtx != null)
for(JavaParser.ExpressionContext eCtx : lstECtx) {
eCtx.enterRule(this);
}
}
}
}
@Override
public void enterVariableDeclarator(JavaParser.VariableDeclaratorContext ctx) {
int startLine = ctx.start.getLine();
int endLine = ctx.stop.getLine();
if(IntInterval.match(startLine, endLine)) {
Statement statement = new Statement(ctx.start.getLine());
this.clazz.add(statement);
}
if(ctx.variableInitializer() != null && ctx.variableInitializer().expression() != null) {
MethodListener methodListener = new MethodListener(this.clazz);
ctx.variableInitializer().expression().enterRule(methodListener);
}
}
@Override
public void enterCatchClause(JavaParser.CatchClauseContext ctx) {
int startLine = ctx.start.getLine();
int endLine = ctx.stop.getLine();
if(IntInterval.match(startLine, endLine)) {
Statement statement = new Statement(ctx.start.getLine());
this.clazz.add(statement);
}
ctx.block().enterRule(this);
}
@Override
public void enterSwitchBlockStatementGroup(JavaParser.SwitchBlockStatementGroupContext ctx) {
// ctx.switchLabel().forEach(switchLabel -> switchLabel.enterRule(this));
// ctx.blockStatement().forEach(blockStatement -> blockStatement.enterRule(this));
for(JavaParser.SwitchLabelContext switchLabel : ctx.switchLabel()) {
switchLabel.enterRule(this);
}
for(JavaParser.BlockStatementContext blockStatement : ctx.blockStatement()) {
blockStatement.enterRule(this);
}
}
@Override
public void enterSwitchLabel(JavaParser.SwitchLabelContext ctx) {
int startLine = ctx.start.getLine();
int endLine = ctx.stop.getLine();
if(IntInterval.match(startLine, endLine)) {
Statement statement = new Statement(ctx.start.getLine());
this.clazz.add(statement);
}
}
}
| [
"gulsher.laghari@usindh.edu.pk"
] | gulsher.laghari@usindh.edu.pk |
d6c892e6f627082e15b45aac4e3a2b1808da04c2 | acd39caee1081e2a3f030ad30aaebf0a6a68190d | /Snakes_and_Ladders_Java/SnakeLaddersServer.java | cc46f94c7fcda46a94685e82f705d82e6090aa50 | [] | no_license | Ttopiac/Snakes_and_Ladders | a3b979eecf615a211fb6d612a7022a3a909d2a60 | c02f9f5f4c4e34cdf26fe256e884a8771e45e2d6 | refs/heads/master | 2020-04-12T05:27:56.441568 | 2018-12-18T18:13:08 | 2018-12-18T18:13:08 | 162,328,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,018 | java | //*******************************************************************
//* Network Programming - Unit 5 Remote Method Invocation *
//* Program Name: SnakeLaddersServer *
//* The program is the RMI server. It binds the RMIImpl *
//* with name server. *
//* 2016.05.23 *
//*******************************************************************
import java.rmi.*;
import java.rmi.server.*;
public class SnakeLaddersServer
{
// Bind Server and Registry
public static void main(String args[])
{
//System.setSecurityManager(new RMISecurityManager());
try
{
SnakeLaddersRMIImpl name = new SnakeLaddersRMIImpl();
System.out.println("Registering ...");
Naming.rebind("SnakeLadders", name); // arithmetic is the name of the service
System.out.println("Register success");
}
catch(Exception e)
{
System.out.println("Exception: " + e.getMessage());
e.printStackTrace();
}
}
} | [
"ttopiac@gmail.com"
] | ttopiac@gmail.com |
281a5e119f274384ec460fdb9bf668ec9a129954 | f00e3ccc52b7f79e1411f273d83af08a1b8f585b | /src/main/java/com/cqupt/prizetool/model/TemplateMsg.java | 23ea20898e3b3a0e793630178a784114ed737114 | [] | no_license | bladedragon/PrizeTool | 8987cf78e9239ee69610cbe648116e6ab7c01052 | b1708add131c9f08a44c14d146b7fcaa9b68b408 | refs/heads/master | 2022-07-01T06:12:35.809112 | 2020-06-25T03:08:54 | 2020-06-25T03:08:54 | 187,638,457 | 0 | 0 | null | 2022-06-17T02:09:49 | 2019-05-20T12:42:56 | Java | UTF-8 | Java | false | false | 247 | java | package com.cqupt.prizetool.model;
import lombok.Data;
import java.util.Map;
@Data
public class TemplateMsg {
private String touser;
private String template_id;
private String topcolor;
private Map<String, TemplateData> data;
}
| [
"1156673039@qq.com"
] | 1156673039@qq.com |
7f171111f236f34525bcc57f227b571ac4294539 | 39730242d9869aa77980c3fd170416930df0ce96 | /ch06/src/MemberCall.java | fb24d9a6c01e6372b97ddd01cbaaeb71dbf3e094 | [] | no_license | pomeloEater/javajeongseok3 | 12f9297b5b9d836fbebb4a23ba757de9cc3ba458 | 114e66cad2bd83444697d279866357c6fc3a7a84 | refs/heads/master | 2021-01-14T15:00:10.242759 | 2020-05-10T13:04:38 | 2020-05-10T13:04:38 | 242,653,931 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,141 | java | class MemberCall{
int iv = 10;
static int cv = 20;
int iv2 = cv;
// static int cv2 = iv; //에러. 클래스변수는 인스턴스변수를 사용할 수 없음
static int cv2 = new MemberCall().iv;//이처럼 객체를 생성하여야 사용 가능
static void staticMethod1() {
System.out.println(cv);
// System.out.println(iv); //에러. 클래스메서드에서 인스턴스변수를 사용할 수 없음
MemberCall c = new MemberCall();
System.out.println(c.iv);
}
void instanceMethod1() {
System.out.println(cv);
System.out.println(iv); //인스턴스메서드에서는 인스턴스변수를 바로 사용할 수 있음
}
static void staticMethod2() {
staticMethod1();
// instanceMethod1(); //에러. 클래스메서드에서는 인스턴스메서드를 호출할 수 없음
MemberCall c = new MemberCall();
c.instanceMethod1();//인스턴스를 생성한 후에야 호출 가능
}
void instanceMethod2() { //인스턴스메서드에서는 인스턴스메서드와 클래스메서드
staticMethod1(); //모두 인스턴스 생성 없이 바로 호출이 가능하다.
instanceMethod1();
}
} | [
"jinhui.dev@gmail.com"
] | jinhui.dev@gmail.com |
1458062ce5d78aafd74b5439aaa1fc8b045a5841 | 14522e8074ff53ec3a4d3f3fb47bb5f3b13892b4 | /src/InsertionSort.java | aec14a9f27ee9939ef6395bcbebd898d0e853036 | [] | no_license | 97dawn/coding-interview-algorithm | c95bd740383946842aad7ab75a1fe165c1edfe39 | 3417d72d21b000d7e0ce38b341a8501ac92ddf53 | refs/heads/master | 2021-04-18T22:08:34.297295 | 2018-03-25T09:55:24 | 2018-03-25T09:55:24 | 126,670,944 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 466 | java |
public class InsertionSort {
public static int[] insertionSort(int[] array){
for(int i=1 ; i<array.length ; i++){
for(int j=i ; j>0 && array[j-1]>array[j] ; j--){
int temp = array[j];
array[j] = array[j-1];
array[j-1] = temp;
}
}
return array;
}
public static void main(String[] args) {
int[] test = {3,5,6,1,0,2};
int[] array = insertionSort(test);
for(int i=0 ; i<array.length ; i++){
System.out.print(array[i]+" ");
}
}
}
| [
"graceee318@gmail.com"
] | graceee318@gmail.com |
3c063986a434721209178b829284b764d0ea09c1 | c648b4d3bbe680590de59cdb26c6376e7dc698b2 | /JavaProgramForInterview/src/test/java/FindBrokenLinksinSeleniumwithJavaStreams.java | 641280143636295b9a3579306bb0ac0b5c580dae | [] | no_license | mdirfan201/JavaInterViewProgram | 1f990792c58dcfd89b3ca67a93640b6a3989269b | d28651efcd54c1562ccf9bcee95f6e719078b728 | refs/heads/master | 2023-08-02T06:43:33.002761 | 2021-10-05T11:27:23 | 2021-10-05T11:27:23 | 410,788,199 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,985 | java |
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
import io.github.bonigarcia.wdm.WebDriverManager;
public class FindBrokenLinksinSeleniumwithJavaStreams {
static WebDriver driver;
//public static void main(String[] args) {
@Test
public static void FindBrokenLinks() {
WebDriverManager.chromedriver().setup();
driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://amazon.com");
List<WebElement> links= driver.findElements(By.tagName("a"));
System.out.println("No of Links are :: "+ links.size());
List<String> urlList=new ArrayList<String>();
for(WebElement e:links) {
String url= e.getAttribute("href");
urlList.add(url);
//checkBrokenlink(url);
}
long stTime=System.currentTimeMillis();
urlList.parallelStream().forEach(e-> checkBrokenlink(e));
//Total Time taken: : 45468 = 45 sec
//Total Time taken: : 37397 = 37 sec
// urlList.stream().forEach(e-> checkBrokenlink(e)); //Total Time taken: : 149634 =150 sec
long endTime= System.currentTimeMillis();
System.out.println("Total Time taken: : "+ (endTime-stTime));
driver.quit();
}
public static void checkBrokenlink(String linkUrl) {
try {
URL url= new URL(linkUrl);
HttpURLConnection httpUrlConnection =(HttpURLConnection) url.openConnection();
httpUrlConnection.setConnectTimeout(5000);
httpUrlConnection.connect();
if(httpUrlConnection.getResponseCode()>=400) {
System.out.println(linkUrl + "--> " + httpUrlConnection.getResponseMessage() + " is a broken Link" );
}else {
System.out.println(linkUrl + "--> " + httpUrlConnection.getResponseMessage());
}
}
catch (Exception e) {
// TODO: handle exception
}
}
}
| [
"mdirfan201@gmail.com"
] | mdirfan201@gmail.com |
5ca335c163b225da961a1d475e8bc701967f90a3 | c72fbab45290d857a628a05a5e2e00540f8d2062 | /src/main/java/com/bric/util/EnumProperty.java | 8764feeba05e45a51858c16b21b63becefa25587 | [
"BSD-3-Clause"
] | permissive | makusuko/util | a0682c717e93660c907578ef6f94eab37e112714 | c78e1c3a614685bba32821634608ce066312321b | refs/heads/master | 2021-05-30T09:46:44.117642 | 2016-01-03T11:54:18 | 2016-01-03T11:54:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,837 | java | /*
* @(#)EnumProperty.java
*
* $Date: 2014-04-28 06:08:51 +0200 (Mo, 28 Apr 2014) $
*
* Copyright (c) 2011 by Jeremy Wood.
* All rights reserved.
*
* The copyright of this software is owned by Jeremy Wood.
* You may not use, copy or modify this software, except in
* accordance with the license agreement you entered into with
* Jeremy Wood. For details see accompanying license terms.
*
* This software is probably, but not necessarily, discussed here:
* https://javagraphics.java.net/
*
* That site should also contain the most recent official version
* of this software. (See the SVN repository for more details.)
*/
package com.bric.util;
public class EnumProperty<T> extends Property<T> {
T[] values;
public EnumProperty(String name,T[] values,T defaultValue) {
super(name);
this.values = values;
for(int a = 0; a<values.length; a++) {
if(values[a]==null)
throw new NullPointerException("none of the enum values may be null");
}
if(values.length==0)
throw new IllegalArgumentException("there were no values");
setValue(defaultValue);
}
public T[] getValues() {
return values;
}
@Override
protected void validateValue(Object obj) {
if(obj==null)
throw new NullPointerException("the value must not be null");
for(int a = 0; a<values.length; a++) {
if(values[a].equals(obj))
return;
}
throw new IllegalArgumentException("the value (\""+obj+"\") did not match any of the allowed values ("+listValues()+")");
}
protected String listValues() {
if(values.length==1)
return values[0].toString();
StringBuffer sb = new StringBuffer();
for(int a = 0; a<values.length; a++) {
if(a>0) {
if(a==values.length-1) {
sb.append(" and ");
} else {
sb.append(", ");
}
}
sb.append(values[a]);
}
return sb.toString();
}
}
| [
"sebastian@topobyte.de"
] | sebastian@topobyte.de |
6562e4c22a9bec9ed90100e85385bb3e512b08f0 | ce0bc4fc6fceb3c7f6676021414ef67a20f516cd | /LSP/src/com/directi/training/lsp/exercise_refactored/Pool.java | 7e8fa199152a58f0e2583e2100b8e6e6619611d8 | [] | no_license | mshd3techs/SOLID-1 | 3c91de87b740611499ba339d103e235a8354472c | db423ec3729b29a7a6ead3319b69a79ce1951db1 | refs/heads/master | 2021-06-20T22:31:20.296073 | 2016-07-25T12:19:40 | 2017-07-19T08:03:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | package com.directi.training.lsp.exercise_refactored;
public class Pool
{
public void run()
{
Duck donaldDuck = new Duck();
ElectronicDuck electronicDuck = new ElectronicDuck();
quack(donaldDuck, electronicDuck);
swim(donaldDuck, electronicDuck);
}
private void quack(IDuck... ducks)
{
for (IDuck duck : ducks) {
try {
duck.quack();
} catch (IDuck.IDuckException e) {
e.printStackTrace();
}
}
}
private void swim(IDuck... ducks)
{
for (IDuck duck : ducks) {
try {
duck.swim();
} catch (IDuck.IDuckException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args)
{
Pool pool = new Pool();
pool.run();
}
}
| [
"ayush.j@flock.co"
] | ayush.j@flock.co |
2c1b0f5327e5b75e53c5fc2b0107057ab9e1b501 | a8ba0ed74000ef9d09e6804354766421baa0afc0 | /src/main/java/org/neo4j/shell/tools/imp/BinaryApp.java | b39c6251a6ca687a7d4005fa01dbeca302932b09 | [] | no_license | jexp/neo4j-shell-tools | 7c09ec1d7304cdf9c187649668fc8289ec441e86 | ff5c8c4fe19643c09728a73540758e10b368ccdd | refs/heads/3.0 | 2020-04-12T06:35:22.914113 | 2017-06-15T15:07:34 | 2017-06-15T15:07:34 | 11,194,460 | 238 | 55 | null | 2019-03-20T10:43:19 | 2013-07-05T07:54:49 | Java | UTF-8 | Java | false | false | 568 | java | package org.neo4j.shell.tools.imp;
import org.neo4j.shell.impl.AbstractApp;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
/**
* Created by efulton on 6/6/16.
*/
public abstract class BinaryApp extends AbstractApp {
protected static final String KRYO = "kryo";
protected static final String CBOR = "cbor";
protected static final String PACKSTREAM = "packstream";
protected static final Set<String> BINARY_FORMATS = new HashSet<>(Arrays.asList(KRYO, CBOR, PACKSTREAM));
protected static final int MAX_FORMAT_STRING_SIZE = 10;
}
| [
"github@jexp.de"
] | github@jexp.de |
a17077bf5d3aed72f2b26619891f217a35be4e96 | 54af4247012074c61f2a23dd71d930fed79d4ee0 | /ich-project/ich-pay/src/main/java/com/xwd/pay/weixin/util/TenpayUtil.java | 75bca6e935e065956ed75fdb27fb9d6019fa04f3 | [] | no_license | 18334728221/shifeng-web | e394ce74b6a5ed702047ff14586065dfb66dcd65 | b77813b2e84565aa901317f47181dafc0baf3bd3 | refs/heads/master | 2020-04-24T07:08:29.330619 | 2019-02-21T03:17:54 | 2019-02-21T03:17:54 | 171,788,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,745 | java | package com.xwd.pay.weixin.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class TenpayUtil {
/**
* 把对象转换成字符串
* @param obj
* @return String 转换成字符串,若对象为null,则返回空字符串.
*/
public static String toString(Object obj) {
if(obj == null)
return "";
return obj.toString();
}
/**
* 把对象转换为int数值.
*
* @param obj
* 包含数字的对象.
* @return int 转换后的数值,对不能转换的对象返回0。
*/
public static int toInt(Object obj) {
int a = 0;
try {
if (obj != null)
a = Integer.parseInt(obj.toString());
} catch (Exception e) {
}
return a;
}
/**
* 获取当前时间 yyyyMMddHHmmss
* @return String
*/
public static String getCurrTime() {
Date now = new Date();
SimpleDateFormat outFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String s = outFormat.format(now);
return s;
}
/**
* 获取当前日期 yyyyMMdd
* @param date
* @return String
*/
public static String formatDate(Date date) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
String strDate = formatter.format(date);
return strDate;
}
/**
* 取出一个指定长度大小的随机正整数.
*
* @param length
* int 设定所取出随机数的长度。length小于11
* @return int 返回生成的随机数。
*/
public static int buildRandom(int length) {
int num = 1;
double random = Math.random();
if (random < 0.1) {
random = random + 0.1;
}
for (int i = 0; i < length; i++) {
num = num * 10;
}
return (int) ((random * num));
}
/**
* 获取编码字符集
* @param request
* @param response
* @return String
*/
public static String getCharacterEncoding(HttpServletRequest request,
HttpServletResponse response) {
if(null == request || null == response) {
return "gbk";
}
String enc = request.getCharacterEncoding();
if(null == enc || "".equals(enc)) {
enc = response.getCharacterEncoding();
}
if(null == enc || "".equals(enc)) {
enc = "gbk";
}
return enc;
}
/**
* 获取unix时间,从1970-01-01 00:00:00开始的秒数
* @param date
* @return long
*/
public static long getUnixTime(Date date) {
if( null == date ) {
return 0;
}
return date.getTime()/1000;
}
/**
* 时间转换成字符串
* @param date 时间
* @param formatType 格式化类型
* @return String
*/
public static String date2String(Date date, String formatType) {
SimpleDateFormat sdf = new SimpleDateFormat(formatType);
return sdf.format(date);
}
}
| [
"18334728221@163.com"
] | 18334728221@163.com |
b4e09f443b57991a97943b94a8dbd9e4d4e7464a | 9958a305b713d0a41bcc9c58f72f5acf7f335c70 | /src/main/java/com/utils/vaadin/PlotDataWindow.java | f47c8f544bca2d08020c370800fa4de658467e11 | [] | no_license | helse-data/mobavis | 54360dd449f0c105577462503826378625195cae | ea97c2d875b1c83fdfdf26b748c064872471350e | refs/heads/master | 2020-03-27T20:46:57.738386 | 2018-11-20T10:59:04 | 2018-11-20T10:59:04 | 147,093,059 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,162 | java | package com.utils.vaadin;
import com.vaadin.server.Sizeable;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.Window;
/**
* PlotDataWindow provides a means to display the data underlying a plot.
*
* @author Christoffer Hjeltnes Støle
*/
public class PlotDataWindow {
Window window = new Window();
TabSheet tabSheet = new TabSheet();
public PlotDataWindow() {
window.center();
window.setCaption("Plot data");
window.setContent(tabSheet);
window.setWidth(80, Sizeable.Unit.PERCENTAGE);
window.setHeight(80, Sizeable.Unit.PERCENTAGE);
tabSheet.setSizeFull();
}
/**
* Adds or adjusts a tab in the tabshet of the window.
*
* @param indexString
* @param data
* @param tabCaption
*/
public void setTab(String indexString, String data, String tabCaption ){
int index = Integer.parseInt(indexString) - 1;
if (tabSheet.getTab(index) == null) {
HorizontalLayout layout = new HorizontalLayout(); // use a layout as the root to produce scrolling
layout.setSizeFull();
TextArea textArea = new TextArea();
textArea.setReadOnly(true);
textArea.setSizeFull();
//tabSheet.addTab(textArea, index);
layout.addComponent(textArea);
tabSheet.addTab(layout, index);
tabSheet.getTab(index).setCaption(tabCaption);
}
HorizontalLayout layout = (HorizontalLayout) tabSheet.getTab(index).getComponent();
//TextArea tab = (TextArea) tabSheet.getTab(index).getComponent();
TextArea tab = (TextArea) layout.getComponent(0);
if (data == null) {
data = "No data to display.";
}
tab.setValue(data);
}
/**
* Returns the window.
*
* @return
*/
public Component getComponent() {
return window;
}
}
| [
"chrstole@gmail.com"
] | chrstole@gmail.com |
4ea9a1883275b90a3f715187c43d3921b7ebd1df | 1208836d9bfff14d4b9cbd0ca6196893b70a7467 | /common/Hardmode/Blocks/BlockSpellBinder.java | b683fcb47d21e09b3d2fee313c665bcfb55f1511 | [] | no_license | Andy5823/Hardmode | 1d53c250852f872e465f3164eff720b004eec111 | 029e8ca9673f935ed12c8c46e23ab50dc5a1281c | refs/heads/master | 2020-06-05T07:15:54.673925 | 2013-12-18T00:29:09 | 2013-12-18T00:29:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 887 | java | package Hardmode.Blocks;
import Hardmode.Refrences.Names;
import Hardmode.Refrences.RenderIds;
import Hardmode.TileEntities.TileEntitySpellBinder;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockSpellBinder extends BaseBlockTile
{
public BlockSpellBinder(int id)
{
super(id, Material.rock);
this.setUnlocalizedName(Names.SPELL_BINDER);
}
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
this.setBlockBounds(0.06F, 0.0F, 0.06F, 0.94F, 0.44F, 0.94F);
}
public int getRenderType()
{
return RenderIds.SPELL_BINDER_RENDER_ID;
}
public TileEntity createNewTileEntity(World world)
{
return new TileEntitySpellBinder();
}
}
| [
"smita237@sgfl.org.uk"
] | smita237@sgfl.org.uk |
e24bbf2c76752fb58904c7699a043c7e951f1aec | 33b772a13fe83818645aedd64ac1e30242012f77 | /Messenger/app/src/main/java/com/quoccuong/utility/ConverstationItemAdapter.java | 7798b5f80486f4f5ee65c5e65bde9cd7d1ebf8ce | [
"Apache-2.0"
] | permissive | qcuong/Messenger | 8755c7abb5b06aeaa1a0ad24f99ba23d2a33d154 | 378c157c5ba6a533fc12ca3cbed35e8d4bce63e1 | refs/heads/master | 2021-01-20T05:40:57.065802 | 2017-08-26T05:05:02 | 2017-08-26T05:05:02 | 101,463,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,267 | java | package com.quoccuong.utility;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.quoccuong.data.Data;
import com.quoccuong.messenger.ConverstationActivity;
import com.quoccuong.messenger.R;
import com.quoccuong.model.Converstation;
import com.quoccuong.model.MyMessage;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
/**
* Created by sev_user on 7/14/2015.
*/
public class ConverstationItemAdapter extends BaseAdapter {
private ArrayList<Converstation> mListConversations;
private Context mContext;
private LayoutInflater mLayoutInflater;
public ConverstationItemAdapter(Context context,
ArrayList<Converstation> listConversations) {
this.mListConversations = listConversations;
this.mContext = context;
this.mLayoutInflater = (LayoutInflater) mContext
.getSystemService(mContext.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return mListConversations.size();
}
@Override
public Object getItem(int position) {
return mListConversations.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
static class ViewHolder {
ImageView personIcon;
TextView phoneNumber;
TextView time;
TextView msg;
TextView tvNotification;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = null;
Converstation converstation = null;
try {
converstation = mListConversations.get(position);
} catch (Exception e) {
// TODO: handle exception
return null;
}
if (converstation == null || parent == null) {
return null;
}
if (convertView == null) {
convertView = mLayoutInflater.inflate(R.layout.converstation_item,
null);
viewHolder = new ViewHolder();
viewHolder.tvNotification = (TextView) convertView
.findViewById(R.id.converstaton_item_tv_notification);
viewHolder.personIcon = (ImageView) convertView
.findViewById(R.id.converstaton_item_personicon);
viewHolder.phoneNumber = (TextView) convertView
.findViewById(R.id.converstaton_item_phonenumber);
viewHolder.msg = (TextView) convertView
.findViewById(R.id.converstaton_item_msg);
viewHolder.time = (TextView) convertView
.findViewById(R.id.converstaton_item_time);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
int notifi = 0;
for (int l = 0; l < converstation.getListMessages().size(); l++) {
if (converstation.getListMessages().get(l).getReadState() == 0) {
notifi++;
}
}
if (notifi > 0) {
viewHolder.tvNotification.setText("" + notifi);
viewHolder.tvNotification
.setBackgroundResource(R.drawable.boderbutton);
viewHolder.personIcon.setImageResource(R.drawable.new_message);
convertView.setBackgroundColor(Color.WHITE);
} else {
viewHolder.tvNotification.setText("");
viewHolder.tvNotification.setBackgroundResource(R.drawable.empty);
viewHolder.personIcon.setImageResource(R.drawable.read_message);
convertView.setBackgroundColor(Color.TRANSPARENT);
}
viewHolder.phoneNumber.setText(converstation.getnName());
MyMessage myMessage = null;
try {
myMessage = converstation.getListMessages().get(
converstation.getListMessages().size() - 1);
viewHolder.msg.setText(myMessage.getmMsg());
DateFormat df = new SimpleDateFormat("HH:mm:ss dd-MM-yyyy");
viewHolder.time.setText(df.format(myMessage.getmTime()));
} catch (Exception e) {
viewHolder.msg.setText("");
viewHolder.time.setText("");
}
final String pho = converstation.getmPhoneNumber();
final String name = converstation.getnName();
convertView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(mContext,
ConverstationActivity.class);
Bundle bundle = new Bundle();
bundle.putString("phoneNumber", pho);
bundle.putString("name", name);
intent.putExtra("bundle", bundle);
mContext.startActivity(intent);
}
});
return convertView;
}
}
| [
"tqcuong.ptit@gmail.com"
] | tqcuong.ptit@gmail.com |
d14c9a6b3508dbf3a202dc9eabdf394625060862 | 96d71f73821cfbf3653f148d8a261eceedeac882 | /external/decompiled/blackberry/bb (4)/decompiled/WhatsApp/com/whatsapp/client/HyperlinkButtonField.java | acaeb3ad5530f16d08d7dd223c11bd5dbea910ca | [] | no_license | JaapSuter/Niets | 9a9ec53f448df9b866a8c15162a5690b6bcca818 | 3cc42f8c2cefd9c3193711cbf15b5304566e08cb | refs/heads/master | 2020-04-09T19:09:40.667155 | 2012-09-28T18:11:33 | 2012-09-28T18:11:33 | 5,751,595 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 15,354 | java | // #######################################################
// Decompiled by : coddec
// Module : WhatsApp-19.cod
// Module version : 2.7.3204
// Class ID : 10
// ########################################################
package com.whatsapp.client;
abstract public final class HyperlinkButtonField extends net.rim.device.api.ui.component.LabelField
{
// @@@@@@@@@@@@@ Fields
private int /*int*/ field_53484 ; // ofs = 53484 addr = 0)
private int /*int*/ field_53488 ; // ofs = 53488 addr = 0)
private int /*int*/ field_53492 ; // ofs = 53492 addr = 0)
private int /*int*/ field_53496 ; // ofs = 53496 addr = 0)
private int /*int*/ field_53500 ; // ofs = 53500 addr = 0)
private net.rim.device.api.ui.XYRect /*net.rim.device.api.ui.XYRect*/ field_53504 ; // ofs = 53504 addr = 0)
// @@@@@@@@@@@@@ Static routines
public <init>( com.whatsapp.client.HyperlinkButtonField, java.lang.String, int, int, int, int ); // address: 0
{
enter
aload_0
aload_1
iload_2
iload_2
iload_3
iload_4
iload_5
invokespecial com.whatsapp.client.HyperlinkButtonField.<init> // pc=7
return
}
public <init>( com.whatsapp.client.HyperlinkButtonField, java.lang.String, int, int, int, int, int ); // address: 0
{
enter
aload_0
aload_1
iload_2
iload_3
iload_4
iload_5
iload_6
iconst_0
i2l
invokespecial com.whatsapp.client.HyperlinkButtonField.<init> // pc=9
return
}
public <init>( com.whatsapp.client.HyperlinkButtonField, java.lang.String, int, int, int, int, int, long ); // address: 0
{
enter
aload_0
aload_1
lipush 22517998136852480
lload 7
lor
invokespecial_lib net.rim.device.api.ui.component.LabelField.<init> // pc=4
aload_0
new_lib net.rim.device.api.ui.component.RichTextField//net.rim.device.api.ui.component.RichTextField net.rim.device.api.ui.component.RichTextField net.rim.device.api.ui.component.RichTextField
dup
invokespecial_lib net.rim.device.api.ui.XYRect.<init> // pc=1
putfield com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53504 // getName->1: // getName->2: // getName->N: // ofs = 53504 ord = 5 addr = 0
aload_0
iload_2
putfield com.whatsapp.client.HyperlinkButtonField.field_53484 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53484 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53484 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53484 // getName->1: // getName->2: // getName->N: // ofs = 53484 ord = 0 addr = 0
aload_0
iload_3
putfield com.whatsapp.client.HyperlinkButtonField.field_53488 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53488 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53488 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53488 // getName->1: // getName->2: // getName->N: // ofs = 53488 ord = 1 addr = 0
aload_0
iload_4
putfield com.whatsapp.client.HyperlinkButtonField.field_53492 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53492 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53492 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53492 // getName->1: // getName->2: // getName->N: // ofs = 53492 ord = 2 addr = 0
aload_0
iload_5
putfield com.whatsapp.client.HyperlinkButtonField.field_53496 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53496 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53496 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53496 // getName->1: // getName->2: // getName->N: // ofs = 53496 ord = 3 addr = 0
aload_0
iload_6
putfield com.whatsapp.client.HyperlinkButtonField.field_53500 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53500 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53500 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53500 // getName->1: // getName->2: // getName->N: // ofs = 53500 ord = 4 addr = 0
return
}
static final access$000( com.whatsapp.client.HyperlinkButtonField, int ); // address: 0
{
enter_narrow
aload_0
iload_1
invokevirtual fieldChangeNotify( net.rim.device.api.ui.Field, int ) // pc=2
return
}
// @@@@@@@@@@@@@ Virtual routines
public final applyFont( com.whatsapp.client.HyperlinkButtonField ); // address: 0
{
enter_narrow
aload_0
invokevirtual net.rim.device.api.ui.Font getFont( net.rim.device.api.ui.Field ) // pc=1
bipush 4
invokevirtual net.rim.device.api.ui.Font derive( net.rim.device.api.ui.Font, int ) // pc=2
astore_1
aload_0
aload_1
invokevirtual setFont( net.rim.device.api.ui.Field, net.rim.device.api.ui.Font ) // pc=2
return
}
protected final paint( com.whatsapp.client.HyperlinkButtonField, net.rim.device.api.ui.Graphics ); // address: 0
{
enter
aload_1
invokevirtual int getColor( net.rim.device.api.ui.Graphics ) // pc=1
istore_2
aload_1
bipush 8
invokevirtual boolean isDrawingStyleSet( net.rim.device.api.ui.Graphics, int ) // pc=2
ifeq Label17
aload_1
aload_0
invokevirtual boolean isEditable( net.rim.device.api.ui.Field ) // pc=1
ifeq Label14
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53488 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53488 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53488 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53488 // getName->1: // getName->2: // getName->N: // ofs = 53488 ord = 1 addr = 0
goto Label15
Label14:
iipush 7060469
Label15:
invokevirtual setColor( net.rim.device.api.ui.Graphics, int ) // pc=2
goto Label25
Label17:
aload_1
aload_0
invokevirtual boolean isEditable( net.rim.device.api.ui.Field ) // pc=1
ifeq Label23
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53484 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53484 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53484 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53484 // getName->1: // getName->2: // getName->N: // ofs = 53484 ord = 0 addr = 0
goto Label24
Label23:
iipush 6184542
Label24:
invokevirtual setColor( net.rim.device.api.ui.Graphics, int ) // pc=2
Label25:
aload_0
aload_1
invokespecial_lib net.rim.device.api.ui.component.LabelField.paint // pc=2
aload_1
iload_2
invokevirtual setColor( net.rim.device.api.ui.Graphics, int ) // pc=2
return
astore_3
aload_1
iload_2
invokevirtual setColor( net.rim.device.api.ui.Graphics, int ) // pc=2
aload_3
athrow
}
protected final drawFocus( com.whatsapp.client.HyperlinkButtonField, net.rim.device.api.ui.Graphics, boolean ); // address: 0
{
enter
aload_0
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53504 // getName->1: // getName->2: // getName->N: // ofs = 53504 ord = 5 addr = 0
invokevirtual getFocusRect( net.rim.device.api.ui.Field, net.rim.device.api.ui.XYRect ) // pc=2
aload_1
bipush 8
invokevirtual boolean isDrawingStyleSet( net.rim.device.api.ui.Graphics, int ) // pc=2
istore_3
aload_1
invokevirtual int getBackgroundColor( net.rim.device.api.ui.Graphics ) // pc=1
istore_4
aload_1
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53504 // getName->1: // getName->2: // getName->N: // ofs = 53504 ord = 5 addr = 0
getfield x // get_name_1: x // get_name_2: x // get_Name: x // getName->1: x // getName->2: x // getName->N: x // ofs = -1 ord = 0 addr = -1
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53504 // getName->1: // getName->2: // getName->N: // ofs = 53504 ord = 5 addr = 0
getfield y // get_name_1: y // get_name_2: y // get_Name: y // getName->1: y // getName->2: y // getName->N: y // ofs = -1 ord = 1 addr = -1
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53504 // getName->1: // getName->2: // getName->N: // ofs = 53504 ord = 5 addr = 0
getfield width // get_name_1: width // get_name_2: width // get_Name: width // getName->1: width // getName->2: width // getName->N: width // ofs = -1 ord = 2 addr = -1
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53504 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53504 // getName->1: // getName->2: // getName->N: // ofs = 53504 ord = 5 addr = 0
getfield height // get_name_1: height // get_name_2: height // get_Name: height // getName->1: height // getName->2: height // getName->N: height // ofs = -1 ord = 3 addr = -1
iconst_0
iconst_0
invokevirtual boolean pushContext( net.rim.device.api.ui.Graphics, int, int, int, int, int, int ) // pc=7
istore_5
iload_5
ifeq Label40
iload_2
ifeq Label35
aload_1
bipush 8
iconst_1
invokevirtual setDrawingStyle( net.rim.device.api.ui.Graphics, int, boolean ) // pc=3
aload_1
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53492 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53492 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53492 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53492 // getName->1: // getName->2: // getName->N: // ofs = 53492 ord = 2 addr = 0
invokevirtual setBackgroundColor( net.rim.device.api.ui.Graphics, int ) // pc=2
Label35:
aload_1
invokevirtual clear( net.rim.device.api.ui.Graphics ) // pc=1
aload_0
aload_1
invokenonvirtual com.whatsapp.client.HyperlinkButtonField.paint // pc=2
Label40:
aload_1
invokevirtual popContext( net.rim.device.api.ui.Graphics ) // pc=1
aload_1
iload_4
invokevirtual setBackgroundColor( net.rim.device.api.ui.Graphics, int ) // pc=2
aload_1
bipush 8
iload_3
invokevirtual setDrawingStyle( net.rim.device.api.ui.Graphics, int, boolean ) // pc=3
return
astore_6
aload_1
invokevirtual popContext( net.rim.device.api.ui.Graphics ) // pc=1
aload_1
iload_4
invokevirtual setBackgroundColor( net.rim.device.api.ui.Graphics, int ) // pc=2
aload_1
bipush 8
iload_3
invokevirtual setDrawingStyle( net.rim.device.api.ui.Graphics, int, boolean ) // pc=3
aload_6
athrow
}
protected final boolean keyChar( com.whatsapp.client.HyperlinkButtonField, char, int, int ); // address: 0
{
enter
iload_1
bipush 10
if_icmpne Label12
aload_0
invokevirtual boolean isEditable( net.rim.device.api.ui.Field ) // pc=1
ifeq Label12
aload_0
iconst_0
invokevirtual fieldChangeNotify( net.rim.device.api.ui.Field, int ) // pc=2
iconst_1
ireturn
Label12:
aload_0
iload_1
iload_2
iload_3
invokespecial_lib net.rim.device.api.ui.Field.keyChar // pc=4
ireturn
}
protected final boolean trackwheelClick( com.whatsapp.client.HyperlinkButtonField, int, int ); // address: 0
{
enter
aload_0
bipush 10
iload_1
iload_2
invokenonvirtual com.whatsapp.client.HyperlinkButtonField.keyChar // pc=4
pop
iconst_1
ireturn
}
protected final boolean invokeAction( com.whatsapp.client.HyperlinkButtonField, int ); // address: 0
{
enter_narrow
iload_1
Label3:
aload_0
invokevirtual boolean isEditable( net.rim.device.api.ui.Field ) // pc=1
ifeq Label11
aload_0
iconst_0
invokevirtual fieldChangeNotify( net.rim.device.api.ui.Field, int ) // pc=2
iconst_1
ireturn
Label11:
aload_0
iload_1
invokespecial_lib net.rim.device.api.ui.Field.invokeAction // pc=2
ireturn
}
public final setDirty( com.whatsapp.client.HyperlinkButtonField, boolean ); // address: 0
{
noenter_return
}
public final setMuddy( com.whatsapp.client.HyperlinkButtonField, boolean ); // address: 0
{
noenter_return
}
public final java.lang.String getMenuText( com.whatsapp.client.HyperlinkButtonField ); // address: 0
{
enter_narrow
aload_0
invokevirtual java.lang.String getText( net.rim.device.api.ui.component.LabelField ) // pc=1
areturn
}
public final net.rim.device.api.ui.MenuItem getMenuItem( com.whatsapp.client.HyperlinkButtonField ); // address: 0
{
enter
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53496 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53496 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53496 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53496 // getName->1: // getName->2: // getName->N: // ofs = 53496 ord = 3 addr = 0
iflt Label5
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53500 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53500 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53500 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53500 // getName->1: // getName->2: // getName->N: // ofs = 53500 ord = 4 addr = 0
ifge Label7
Label5:
aconst_null
areturn
Label7:
aload_0
invokevirtual boolean isEditable( net.rim.device.api.ui.Field ) // pc=1
ifne Label12
aconst_null
areturn
Label12:
aload_0
invokenonvirtual com.whatsapp.client.HyperlinkButtonField.getMenuText // pc=1
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53496 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53496 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53496 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53496 // getName->1: // getName->2: // getName->N: // ofs = 53496 ord = 3 addr = 0
aload_0_getfield com.whatsapp.client.HyperlinkButtonField.field_53500 // get_name_1: com.whatsapp.client.HyperlinkButtonField.field_53500 // get_name_2: com.whatsapp.client.HyperlinkButtonField.field_53500 // get_Name: com.whatsapp.client.HyperlinkButtonField.field_53500 // getName->1: // getName->2: // getName->N: // ofs = 53500 ord = 4 addr = 0
new HyperlinkButtonField$1
dup
aload_0
invokespecial com.whatsapp.client.HyperlinkButtonField$1.<init> // pc=2
invokestatic_lib module:WhatsApp-36.class#17.routine_7979( ) // class#17
areturn
}
}
| [
"git@jaapsuter.com"
] | git@jaapsuter.com |
b64881d73efda6020bbc681aa986dbdf259d8fdc | 1f010a54e822bc55ea35588267624e89fbca3c31 | /src/354.java | 6785b8ce4542ceedb96531e4bdbdfc44e2815772 | [] | no_license | cindymiaomiao/leetcode-solutions | c126e3c605d137175853600512ff6fcc7935e13c | ba65a8266a7989b83e4fe8ede33cb9c99ac7d41e | refs/heads/master | 2020-04-09T03:52:32.011389 | 2019-08-22T10:58:58 | 2019-08-22T10:58:58 | 160,000,500 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,618 | java | // You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelope is greater than the width and height of the other envelope.
// What is the maximum number of envelopes can you Russian doll? (put one inside other)
// Note:
// Rotation is not allowed.
// Example:
// Input: [[5,4],[6,4],[6,7],[2,3]]
// Output: 3
// Explanation: The maximum number of envelopes you can Russian doll is 3 ([2,3] => [5,4] => [6,7]).
class Solution {
public int maxEnvelopes(int[][] envelopes) {
int n = envelopes.length;
Comparator<int[]> localeComparator = new Comparator<int[]>() {
public int compare(int[] a, int[] b) {
return a[0] == b[0] ? a[1] - b[1] : a[0] - b[0];
}
};
Arrays.sort(envelopes, localeComparator);
Map<Integer, List<Integer>> map = new HashMap<>();
for(int i = 0; i < n-1; i++){
int[] a = envelopes[i];
map.put(i, new ArrayList<>());
for(int j = i + 1; j < n; j++){
int[] b = envelopes[j];
if(b[0] > a[0] && b[1] > a[1]) map.get(i).add(j);
}
}
int[] dp = new int[n];
for(int i = 0; i < n; i++){
if(map.containsKey(i)){
dp[i] = Math.max(dp[i], 1);
for(int j : map.get(i)){
dp[j] = Math.max(dp[i] + 1, dp[j]);
}
}
}
int max = 0;
for(int i: dp) max = Math.max(i, max);
return max;
}
} | [
"cindy.wang@coupang.com"
] | cindy.wang@coupang.com |
e28f866a1d8111f5dc237ef0f53b789bc9d4cf4f | 910ac3902990a6fc38328fb941ddc7dd5a93dae7 | /bonggeuda/src/com/bonggeuda/sugbag/book/controller/AccomoQuestionServlet.java | 1c27002372c7d25c0ad51798ede893ac083951f4 | [] | no_license | NaraWee/Projects | 15ef742151c4adad5d4cdf443f69dc2fe8586869 | da5016a85e2e6e76990b28402663006a0cf2fb62 | refs/heads/master | 2023-06-21T15:02:42.006026 | 2021-07-28T15:39:26 | 2021-07-28T15:39:26 | 385,433,955 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,496 | java | package com.bonggeuda.sugbag.book.controller;
import java.io.IOException;
import java.sql.Date;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.bonggeuda.sugbag.model.dto.OwnerQnADTO;
import com.bonggeuda.sugbag.service.BookService;
/**
* Servlet implementation class AccomoQuestionServlet
*/
@WebServlet("/book/question")
public class AccomoQuestionServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
OwnerQnADTO qna = new OwnerQnADTO();
qna.setAccomoNo(Integer.parseInt(request.getParameter("accomoNo")));
qna.setUserNo(Integer.parseInt(request.getParameter("userNo")));
qna.setTitle(request.getParameter("title"));
qna.setContent(request.getParameter("content"));
qna.setWriteDate(new Date(System.currentTimeMillis()));
BookService svc = new BookService();
int result = svc.insertOwnerQnA(qna);
String path = "";
if(result>0) {
path= "/userqnalist/select";
} else {
}
response.sendRedirect(request.getContextPath() + path);
}
}
| [
"wnl1508@naver.com"
] | wnl1508@naver.com |
9f2d6616a2ac4f4ab6e93944f181c3923c0c14c1 | 202b601f0a7dd750da5d9bbea10268e67e744f8f | /src/test/java/com/mercadolibre/mutantes/utils/RequestHeaders.java | 9bb9fe5994794cca4152466e1e9bbb54e5de8ea2 | [] | no_license | yjmb/mutantes | d8ddab2ccc095af49880d88bd8b77b4b04ca7ca4 | 73ebcab53b14ca2a348433c92751453cd4156079 | refs/heads/master | 2020-03-21T17:00:35.700986 | 2018-07-05T14:15:59 | 2018-07-05T14:15:59 | 138,807,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 620 | java | package com.mercadolibre.mutantes.utils;
import io.restassured.http.Header;
import io.restassured.http.Headers;
import java.util.ArrayList;
import java.util.List;
public class RequestHeaders {
//Headers Keys
public static final String CONTENT_TYPE_KEY = "Content-Type";
//Headers Values
public static final String CONTENT_TYPE_VALUE = "application/json";
public static Headers getRequestHeaders(){
List<Header> list = new ArrayList<Header>();
list.add(new Header(CONTENT_TYPE_KEY, CONTENT_TYPE_VALUE));
Headers headers = new Headers(list);
return headers;
}
}
| [
"yandrymarquez@gmail.com"
] | yandrymarquez@gmail.com |
7ad993145e0e80df8f5e5466ca05a8a1b70e0606 | 74658bf93c93893ec687054e79dd4e82dbed932a | /Duke/src/main/java/no/priv/garshol/duke/RecordImpl.java | d7d400e558d1918e12f6d1acd6eba86a707ad6e8 | [] | no_license | vazexqi/JFlowBenchmarks | ba734d089dd2dc97c25494ebd09fabf7afc35ce1 | 27e9531ede6bd6f7900bbf65c6c9df388739da35 | refs/heads/master | 2022-02-04T00:58:07.495616 | 2013-05-23T16:43:32 | 2013-05-23T16:43:32 | 7,509,790 | 0 | 0 | null | 2022-01-21T23:21:09 | 2013-01-08T21:44:36 | Java | UTF-8 | Java | false | false | 1,560 | java |
package no.priv.garshol.duke;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
/**
* The default implementation of the Record interface. Simply holds
* all data in memory.
*/
public class RecordImpl implements Record {
private Map<String, Collection<String>> data;
public RecordImpl(Map<String, Collection<String>> data) {
this.data = data; // FIXME: should we copy?
}
public RecordImpl() {
this.data = new HashMap();
}
public boolean isEmpty() {
return data.isEmpty();
}
public Collection<String> getProperties() {
return data.keySet();
}
public String getValue(String prop) {
Collection<String> values = getValues(prop);
if (values == null || values.isEmpty())
return null;
else
return values.iterator().next();
}
public Collection<String> getValues(String prop) {
Collection<String> values = data.get(prop);
if (values == null)
return Collections.EMPTY_LIST;
return values;
}
public void addValue(String property, String value) {
Collection<String> values = data.get(property);
if (values == null) {
values = new ArrayList();
data.put(property, values);
}
values.add(value);
}
public void remove(String property) {
data.remove(property);
}
public void merge(Record other) {
throw new UnsupportedOperationException();
}
public String toString() {
return "[RecordImpl " + data + "]";
}
} | [
"nchen@illinois.edu"
] | nchen@illinois.edu |
209dbba2845f0db8034b9b6c05d6904138de3081 | a1a9c39d6af10abdd3bd994c1a56b58fda60ad68 | /bootstrap/bootstrap5.2.0/src/main/java/org/nova/html/bootstrap/messaging/Durability.java | ac7d1b34de779b5234d2545d13b8d36160e5a143 | [
"MIT"
] | permissive | andrewtjew/nova | 00d6b856e96eb12a975dc13f21361361fe2f6033 | 4c1ca8ca1066e1b9c7efc8e8f5247d649b1da9db | refs/heads/master | 2023-08-20T10:41:20.614483 | 2023-08-18T18:43:53 | 2023-08-18T18:43:53 | 187,707,763 | 0 | 0 | NOASSERTION | 2023-04-12T14:56:30 | 2019-05-20T20:19:48 | Java | UTF-8 | Java | false | false | 109 | java | package org.nova.html.bootstrap.messaging;
public enum Durability
{
SESSION,
TRANSACTIONALs,
}
| [
"atjew@evolvesoftworks.com"
] | atjew@evolvesoftworks.com |
627cc3299e1e5d760ae1677749d4a94555971723 | b41e2cbd51331f739088ac9d6d51cf1fc63f37f0 | /src/main/java/com/abead/cglibTest/SimpleClass.java | 1dd91b860ed91c42379110dad5480fe74728152f | [] | no_license | chenzhixiu/dailyStu | 51240a610a22acee3e0e5c488c0401cba3e1e719 | 23271f497f48945b1f259ddd9f1670d6a8e70ee3 | refs/heads/master | 2020-03-23T09:11:45.047181 | 2018-09-10T01:50:26 | 2018-09-10T01:50:26 | 141,373,061 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | java | package com.abead.cglibTest;
import java.util.Collections;
import java.util.List;
/**
* @Author chenzhixiu
* @Date 创建时间 : 2018/4/25 14:32
*/
public final class SimpleClass {
//static final long serialVersionUID = 3905348978240129619L;
public void sort(List<String> list){
Collections.sort(list);
}
public void g(){
System.out.println("g");
}
}
| [
"chenzhixiu@cttq.com"
] | chenzhixiu@cttq.com |
53d21ad3f7ccc03c44255ce8fe068e29c7f829ef | 227e83292e94f10f45bb9bf043027983c8495656 | /CodeBroker/src/main/java/com/codebroker/exception/IErrorCode.java | 1ebd1bded42956d0e4635ee212c4c55a7627c59c | [
"Apache-2.0"
] | permissive | mengtest/CodeBroker | ff8c92942e5125dc4257867a201699f13ab30165 | 287930b2ff67c5685311ca5883d5cde28489e1da | refs/heads/master | 2021-05-16T17:38:23.878052 | 2017-09-08T05:19:10 | 2017-09-08T05:19:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 90 | java | package com.codebroker.exception;
public interface IErrorCode {
public short getId();
}
| [
"zerosoft@vip.qq.com"
] | zerosoft@vip.qq.com |
b7659a6292516cb4721359d19961153d0f4f06af | b2efedbad1e238cd59f4467a184830bf3075e672 | /diycode-app/src/main/java/com/gcssloop/diycode/activity/WebActivity.java | ac9425fe0e508c5c24572fc1240b6c36c18996db | [
"Apache-2.0"
] | permissive | msdgwzhy6/diycode | 06e1792cabf12d833b5ff6d1a433aa551b2e6626 | 16c073939117651bfe5afe599fc24fe5ee8f39b2 | refs/heads/master | 2021-01-18T18:39:28.909607 | 2017-03-31T12:44:22 | 2017-03-31T12:44:22 | 86,869,745 | 1 | 0 | null | 2017-04-01T00:12:30 | 2017-04-01T00:12:30 | null | UTF-8 | Java | false | false | 8,446 | java | /*
* Copyright 2017 GcsSloop
*
* 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.
*
* Last modified 2017-03-16 22:13:31
*
* GitHub: https://github.com/GcsSloop
* Website: http://www.gcssloop.com
* Weibo: http://weibo.com/GcsSloop
*/
package com.gcssloop.diycode.activity;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Message;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.GeolocationPermissions;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.ProgressBar;
import com.gcssloop.diycode.R;
import com.gcssloop.diycode.base.app.BaseActivity;
import com.gcssloop.diycode.base.app.ViewHolder;
public class WebActivity extends BaseActivity {
private final String Sign_Url = "https://www.diycode.cc/account/sign_in";
public static final String URL = "url";
private WebView mWebView;
String mUrl;
ProgressBar progressBar;
public static void newInstance(Context context, String url) {
Intent intent = new Intent(context, WebActivity.class);
intent.putExtra(URL, url);
context.startActivity(intent);
}
@Override
protected int getLayoutId() {
return R.layout.activity_web;
}
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void initViews(ViewHolder holder, View root) {
try {
progressBar = holder.get(R.id.progress_bar);
Intent intent = getIntent();
mUrl = intent.getStringExtra(URL);
if (mUrl == null || mUrl.isEmpty()) {
return;
}
FrameLayout layout = holder.get(R.id.webview_container);
mWebView = new WebView(this.getApplicationContext());
mWebView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
layout.addView(mWebView);
WebSettings settings = mWebView.getSettings();
// 基本设置
settings.setSupportZoom(true);
settings.setLoadWithOverviewMode(true);
settings.setUseWideViewPort(true);
settings.setDefaultTextEncodingName("utf-8");
settings.setLoadsImagesAutomatically(true);
settings.setJavaScriptEnabled(true);
// 缓存数据
settings.setDomStorageEnabled(true);
settings.setDatabaseEnabled(true);
settings.setAppCacheEnabled(true);
String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
settings.setAppCachePath(appCachePath);
//html中的_bank标签就是新建窗口打开,有时会打不开,需要加以下
//然后 复写 WebChromeClient的onCreateWindow方法
settings.setSupportMultipleWindows(false);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
mWebView.setWebChromeClient(mWebChromeClient);
mWebView.setWebViewClient(mWebViewClient);
mWebView.loadUrl(mUrl);
} catch (Exception e) {
e.printStackTrace();
}
}
WebViewClient mWebViewClient = new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return super.shouldOverrideUrlLoading(view, url);
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
}
};
WebChromeClient mWebChromeClient = new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int progress) {
if (progress < 100) {
progressBar.setVisibility(View.VISIBLE);
progressBar.setProgress(progress);
} else if (progress == 100) {
progressBar.setVisibility(View.GONE);
}
}
// 定位 ----------------------------------------------------------
@Override
public void onReceivedTitle(WebView view, String title) {
super.onReceivedTitle(view, title);
setTitle(title);
}
@Override
public void onReceivedIcon(WebView view, Bitmap icon) {
super.onReceivedIcon(view, icon);
}
@Override
public void onGeolocationPermissionsHidePrompt() {
super.onGeolocationPermissionsHidePrompt();
}
@Override
public void onGeolocationPermissionsShowPrompt(final String origin,
final GeolocationPermissions.Callback callback) {
callback.invoke(origin, false, false);//注意个函数,第二个参数就是是否同意定位权限,第三个是是否希望内核记住
super.onGeolocationPermissionsShowPrompt(origin, callback);
}
// 新窗口 ------------------------------------------------------------
@Override
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture,
Message resultMsg) {
WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
transport.setWebView(view);
resultMsg.sendToTarget();
return true;
}
};
// 防止内存泄漏
// in android 5.1(sdk:21) we should invoke this to avoid memory leak
// see (https://coolpers.github.io/webview/memory/leak/2015/07/16/
// android-5.1-webview-memory-leak.html)
public void clearWebViewResource() {
if (mWebView != null) {
mWebView.clearHistory();
((ViewGroup) mWebView.getParent()).removeView(mWebView);
mWebView.setTag(null);
mWebView.loadUrl("about:blank");
mWebView.stopLoading();
mWebView.setWebViewClient(null);
mWebView.setWebChromeClient(null);
mWebView.removeAllViews();
mWebView.destroy();
mWebView = null;
}
}
@Override
public void onPause() {
super.onPause();
mWebView.onPause();
}
@Override
public void onResume() {
super.onResume();
mWebView.onResume();
}
@Override
protected void onDestroy() {
super.onDestroy();
clearWebViewResource();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_web, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_browser:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(mUrl));
startActivity(intent);
break;
case R.id.action_share:
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, getTitle());
shareIntent.putExtra(Intent.EXTRA_TEXT, mUrl);
shareIntent.setType("text/plain");
startActivity(shareIntent);
break;
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && mWebView.canGoBack()) {
mWebView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}
| [
"GcsSloop@gmail.com"
] | GcsSloop@gmail.com |
563df5fbd5d185e9088c70f80149fb9a54fdd33b | 072975770c0099971bd1e864c2e085513f6835ac | /openhds-server(IntegrationTest)/specialstudy/src/main/java/org/openhds/specialstudy/domain/EndUser.java | 9a7e85d87cdb0d5b11c9aab2887aefd19116f3e3 | [
"BSD-2-Clause"
] | permissive | sm0017/COS-576 | 6b01de780b45991968773b089c90eb6e421c5fa0 | cec9301116f1b47950734834ffd4ac977a5e468b | refs/heads/master | 2021-01-23T13:37:12.162766 | 2017-03-15T19:12:11 | 2017-03-15T19:12:11 | 38,788,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,938 | java | package org.openhds.specialstudy.domain;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import org.springframework.roo.addon.entity.RooEntity;
import javax.validation.constraints.NotNull;
@Entity
@RooJavaBean
@RooToString
@RooEntity(finders = { "findEndUsersByUsernameAndPasswordEquals" })
public class EndUser {
@PersistenceContext
transient EntityManager entityManager;
@NotNull
private String username;
@NotNull
private String password;
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;
}
public static Query findEndUsersByUsernameAndPasswordEquals(String username, String password) {
if (username == null || username.length() == 0) throw new IllegalArgumentException("The username argument is required");
if (password == null || password.length() == 0) throw new IllegalArgumentException("The password argument is required");
EntityManager em = EndUser.entityManager();
Query q = em.createQuery("SELECT EndUser FROM EndUser AS enduser WHERE enduser.username = :username AND enduser.password = :password");
q.setParameter("username", username);
q.setParameter("password", password);
return q;
}
public static final EntityManager entityManager() {
EntityManager em = new EndUser().entityManager;
if (em == null) throw new IllegalStateException("Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)");
return em;
}
}
| [
"smita.sukhadeve@maine.edu"
] | smita.sukhadeve@maine.edu |
5162dab09e25983a5b81742fc822459a70a65fdf | 173af1a852429eb2faf0d938ed64e6a8088ef8ca | /代码总结(重要)/taotao/solr/solrj/TestSolrCloud.java | 0652d2fba5d3fb7c11b499092909674438442884 | [] | no_license | JayChou55/knowledgeSummary | 079af9319bfc1ced0a4d82e58d755ae095d45e91 | 25253abd8bd3adcf8a03b73fa7001441bd3bcc38 | refs/heads/master | 2021-01-19T21:48:06.524948 | 2018-06-07T10:07:21 | 2018-06-07T10:07:21 | 101,253,628 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,050 | java | package com.thinkgem.jeesite.solrj;
import org.apache.solr.client.solrj.impl.CloudSolrServer;
import org.apache.solr.common.SolrInputDocument;
import org.junit.Test;
public class TestSolrCloud {
@Test
public void testSolrCloudAdDocument() throws Exception {
//创建一个CloudSolrServer对象,构造方法中需要制定zookeeper的地址列表
// CloudSolrServer cloudSolrServer = new CloudSolrServer("192.168.134.130:2181,192.168.134.130:2182,192.168.134.130:2183");
CloudSolrServer cloudSolrServer = new CloudSolrServer("192.168.239.128:2181,192.168.239.128:2182,192.168.239.128:2183");
//需要设置默认的Collection
cloudSolrServer.setDefaultCollection("collection1");
//创建一个文档对象
SolrInputDocument document = new SolrInputDocument();
//向文档中添加域
document.addField("id", "test001");
document.addField("item_title", "测试商品名称");
document.addField("item_price", 100);
//把文档写入索引库
cloudSolrServer.add(document);
//提交
cloudSolrServer.commit();
}
}
| [
"hanjianrap.com@qq.com"
] | hanjianrap.com@qq.com |
7fd903a46a90361fccba403a616194701182a099 | e7a85949bcbf67efa5366d87ca92d0224447fe9d | /src/main/java/com/bitplan/javafx/TabSelection.java | 9bc1eddb6e19411320bd4f40ca71d4c0ffd71511 | [
"Apache-2.0"
] | permissive | BITPlan/com.bitplan.javafx | a0b71c02a3e67efabb43598c8537b4a4625213d0 | d1d2193d12d16da8af8e26a1cee2890b8c8b8a9f | refs/heads/master | 2021-06-03T02:36:32.180275 | 2020-01-23T09:40:15 | 2020-01-23T09:40:15 | 100,851,821 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,285 | java | /**
*
* This file is part of the https://github.com/BITPlan/com.bitplan.javafx open source project
*
* The copyright and license below holds true
* for all files except
* - the ones in the stackoverflow package
* - SwingFXUtils.java from Oracle which is provided e.g. for the raspberry env
*
* Copyright 2017-2018 BITPlan GmbH https://github.com/BITPlan
*
* 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.bitplan.javafx;
import java.io.File;
import com.bitplan.error.ErrorHandler;
import com.bitplan.json.JsonAble;
import com.bitplan.json.JsonManager;
import com.bitplan.json.JsonManagerImpl;
/**
* allow remembering the current TabSelection
* @author wf
*
*/
public class TabSelection implements JsonAble {
protected String tabPaneId;
protected String tabId;
public String getTabPaneId() {
return tabPaneId;
}
public void setTabPaneId(String tabPaneId) {
this.tabPaneId = tabPaneId;
}
public String getTabId() {
return tabId;
}
public void setTabId(String tabId) {
this.tabId = tabId;
}
static TabSelection instance;
/**
* get an instance of the TabSelection
*
* @return - the instance
* @throws Exception
*/
public static TabSelection getInstance() {
if (instance == null) {
File jsonFile = JsonAble.getJsonFile(TabSelection.class.getSimpleName());
if (jsonFile.canRead()) {
JsonManager<TabSelection> jmTabSelection = new JsonManagerImpl<TabSelection>(
TabSelection.class);
try {
instance = jmTabSelection.fromJsonFile(jsonFile);
} catch (Exception e) {
ErrorHandler.handle(e);
}
}
if (instance == null)
instance = new TabSelection();
}
return instance;
}
}
| [
"wf@bitplan.com"
] | wf@bitplan.com |
da3e4277571af3cb1aa8cb739e6a981677c7c9a5 | 5736194cee5cc4189705ae174d98063bc99f76dd | /src/MPI_Java.java | 165c542dbf6d8b89e00e6d7b764823cedc9efe47 | [] | no_license | marcossilva/steam | 6c62d4aa0e52da788db59fd4bc085d31e97fe991 | 4bd675a6db7ba6d75d326357cddc07dcf7d67596 | refs/heads/master | 2021-01-19T13:47:14.054765 | 2015-04-12T15:53:32 | 2015-04-12T15:53:32 | 33,689,292 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,857 | java |
import java.io.FileInputStream;
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.text.NumberFormat;
import java.util.Locale;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import mpi.*;
import org.json.JSONException;
import org.json.JSONObject;
import org.jsoup.HttpStatusException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
public class MPI_Java {
public static void main(String args[]) throws InterruptedException {
MPI.Init(args);
int me = MPI.COMM_WORLD.Rank();
int tasks = MPI.COMM_WORLD.Size();
final int[] pages = {12, 15, 10, 14, 11};
// final int[] pages = {10, 14, 11};
Document agent = null;
try {
agent = Jsoup.parse(new FileInputStream("/home/marcos/Desktop/MPI_Java/allagents.xml"), "UTF-8", "", org.jsoup.parser.Parser.xmlParser());
} catch (IOException ex) {
Logger.getLogger(MPI_Java.class.getName()).log(Level.SEVERE, null, ex);
}
Elements agents = agent.select("user-agent > String");
TreeMap<Double, String> col = new TreeMap<>();
int lastValue, actualValue;
Document doc2;
String gameLink;
JSONObject response;
Double pontos_real;
double preco;
final String tremorLink = "http://www.tremorgames.com/?action=tradeinprices&itemtype=";
Document doc;
int l_a, l_b;
for (int i = 0; i < pages.length; i++) {
try {
//Para cada uma das páginas
doc = Jsoup.connect(tremorLink + pages[i]).get();
} catch (IOException ex) {
i--;
continue;
}
System.out.printf("\n<%d> Processando %s\n", me, doc.select("div.box_round").first().text());
Elements itemList = doc.select("tr");
l_a = 0 == me ? 1 : (itemList.size() / tasks) * me;
l_b = me == (tasks - 1) ? itemList.size() : l_a + (itemList.size() / tasks);
if (me == 0) {
l_b--;
}
// System.out.printf("l_a = %d l_b = %d itens = %d\n", l_a, l_b, itemList.size());
for (int j = l_a; j < l_b; j++) {//O primeiro é o cabeçalho da tabela e n tem href
if (j % 50 == 0) {
System.out.printf("\n<%d> Processed: %d\t ItemName: %s\n", me, (j - l_a), itemList.get(j).select("td").first().text());
}
try {
//Página do Item do Tremor Games
doc2 = Jsoup.connect(itemList.get(j).select("a").attr("href"))
.header("Accept-Language", "pt-BR,en-US;q=0.8,en;q=0.8")
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")
.header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36")
.header("Accept-Encoding", "gzip, deflate, sdch")
.header("Cookie", "PHPSESSID=403c2ddfcd984f0af2a8514efaa25262; tguserid=1259204; evercookie_png=1259204; evercookie_etag=1259204; evercookie_cache=1259204; uid=1259204; eccheck=0; __utmt=1; __utma=269348916.138314648.1428357214.1428763344.1428764750.10; __utmb=269348916.19.10.1428764750; __utmc=269348916; __utmz=269348916.1428764750.10.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)")
.get();
//Página do Item do Market da Steam
gameLink = doc2.select("#productlink").first().attr("href");
if (gameLink.contains("http://steamcommunity.com/market/listings")) { //Poupa uma conexão errada
doc2 = Jsoup.connect(doc2.select("#productlink").first().attr("href"))
.header("Accept-Language", "pt-BR,en-US;q=0.8,en;q=0.8")
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")
.header("Accept-Encoding", "gzip, deflate, sdch")
.header("Cookie", "recentlyVisitedAppHubs=440; strInventoryLastContext=753_0; steamLogin=76561198049006380%7C%7C99A07FAD33D0523C1A0047C795423450B1E5DC98; sessionid=e5d2bbbdd9b13d9287454fb1; webTradeEligibility=%7B%22allowed%22%3A1%2C%22allowed_at_time%22%3A0%2C%22steamguard_required_days%22%3A15%2C%22sales_this_year%22%3A43%2C%22max_sales_per_year%22%3A200%2C%22forms_requested%22%3A0%2C%22new_device_cooldown_days%22%3A7%7D; timezoneOffset=-10800,0; __utma=268881843.1547344608.1428332143.1428378196.1428410634.6; __utmb=268881843.0.10.1428410634; __utmc=268881843; __utmz=268881843.1428410634.6.5.utmcsr=store.steampowered.com|utmccn=(referral)|utmcmd=referral|utmcct=/")
.userAgent(agents.get((int) (Math.random() * agents.size())).text())
.get();
if (doc2.select("div.market_listing_table_message").first().text().contains("Não há anúncios para este item.")) {
//Caso onde não há itens a venda
continue;
}
String gameCode = doc2.select("script").last().toString();
int pos = gameCode.indexOf("pread(") + 7;
if (pos > 6) { // itens agrupados
gameCode = gameCode.substring(pos, gameCode.indexOf(";", pos) - 2);
response = new JSONObject(new Scanner(new URL("http://steamcommunity.com/market/itemordershistogram?country=BR&language=brazilian¤cy=7&item_nameid=" + gameCode)
.openStream())
.nextLine());
try {
doc2 = Jsoup.parseBodyFragment(response.getString("sell_order_table"));
} catch (JSONException e) {
continue;
}
Elements es = doc2.select("td");
for (int k = 0; k < es.size(); k += 2) {
preco = NumberFormat.getInstance(Locale.FRANCE).parse(es.get(k).text().substring(3, es.get(k).text().length())).doubleValue();
pontos_real = Double.parseDouble(itemList.get(j).select("td").get(1).text()) / preco;
// System.out.printf("\nPontos\\Real = %.0f\\%.2f = %.4f \tItemName = { %s }\n", Double.parseDouble(itemList.get(j).select("td").get(1).text()), preco, pontos_real, itemList.get(j).select("td").first().text());
if (pontos_real >= 400) {
System.out.printf("\nPontos\\Real = %.0f\\%.2f = %.4f \tItemName = { %s }\n", Double.parseDouble(itemList.get(j).select("td").get(1).text()), preco, pontos_real, itemList.get(j).select("td").first().text());
if (col.containsKey(pontos_real)) {
col.put(pontos_real, col.get(pontos_real) + " , " + itemList.get(j).select("td").first().text());
} else {
col.put(pontos_real, itemList.get(j).select("td").first().text());
}
}
}
} else { //É item vendido separadamente
response = (new JSONObject(new Scanner(new URL(gameLink + "/render?start=0&count=10¤cy=7&language=english&format=json")
.openStream())
.nextLine()))
.getJSONObject("listinginfo");
lastValue = 0;
for (String key : response.keySet()) {
actualValue = response.getJSONObject(key).getInt("price");
if (lastValue != actualValue) {
lastValue = actualValue;
preco = actualValue;
pontos_real = 100 * Double.parseDouble(itemList.get(j).select("td").get(1).text()) / actualValue;
// System.out.printf("\nPontos\\Real = %.0f\\%.2f = %.4f \tItemName = { %s }\n", Double.parseDouble(itemList.get(j).select("td").get(1).text()), preco, pontos_real, itemList.get(j).select("td").first().text());
if (pontos_real >= 400) {
System.out.printf("\nPontos\\Real = %.0f\\%.2f = %.4f \tItemName = { %s }\n", Double.parseDouble(itemList.get(j).select("td").get(1).text()), preco, pontos_real, itemList.get(j).select("td").first().text());
if (col.containsKey(pontos_real)) {
col.put(pontos_real, col.get(pontos_real) + " , " + itemList.get(j).select("td").first().text());
} else {
col.put(pontos_real, itemList.get(j).select("td").first().text());
}
}
}
}
}
}
} catch (HttpStatusException hu) {
if (hu.getStatusCode() == 429) {
// System.out.printf("S...");
Thread.sleep(100);
j--;
}
} catch (SocketTimeoutException so) {
// System.out.printf("so...");
j--;
System.gc();
} catch (JSONException h) {
System.out.println("Item " + itemList.get(j).select("td").first().text() + " deu JSONException");
j--;
System.gc();
} catch (NumberFormatException n) {
// System.out.printf("n...");
System.gc();
} catch (IOException io) {
// System.out.printf("io...");
Thread.sleep(100);
System.gc();
j--;
} catch (MPIException iolp) {
// System.out.println("Item " + itemList.get(j).select("td").first().text() + " deu MPIException");
System.gc();
} catch (NullPointerException nul) {
// System.out.println("Não achou o item no site");
System.gc();
} catch (Exception el) {
// System.out.println("Item " + itemList.get(j).select("td").first().text() + " deu Exception");
System.gc();
}
}
System.out.println("Mapa Temporário");
for (Map.Entry<Double, String> entrySet : col.entrySet()) {
Double key = entrySet.getKey();
String value = entrySet.getValue();
System.out.println("Preco\\Real = " + key + "\tItem =" + value);
}
}
if (me == 0) {
//Recebe os mapas de cada um
Object[] finalResp = new Object[1];
for (int j = 1; j < tasks; j++) {
System.out.println("Recebendo mapas...");
MPI.COMM_WORLD.Recv(finalResp, 0, 1, MPI.OBJECT, MPI.ANY_SOURCE, 999);
col.putAll(((TreeMap<Double, String>) finalResp[0]));
}
System.out.println("Todos os mapas recebidos!");
//Imprime o mapa após receber
System.out.println("\n\n");
for (Map.Entry<Double, String> entrySet : col.entrySet()) {
Double key = entrySet.getKey();
String value = entrySet.getValue();
System.out.println("Preco\\Real = " + key + "\tItem =" + value);
}
} else {
//envia o mapa para 0
Object[] myResp = new Object[1];
myResp[0] = col;
MPI.COMM_WORLD.Send(myResp, 0, 1, MPI.OBJECT, 0, 999);
}
System.out.println("Final do programa");
MPI.Finalize();
}
}
| [
"marcos@marcos-K84L"
] | marcos@marcos-K84L |
0d0f0123a8c1fb51e8e403acefc1ff77062cc59d | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a148/A148377Test.java | d5d03b29ec0870161b04b600e1ec2c0fbe79909f | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 256 | java | package irvine.oeis.a148;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A148377Test extends AbstractSequenceTest {
@Override
protected int maxTerms() {
return 10;
}
}
| [
"sairvin@gmail.com"
] | sairvin@gmail.com |
916a6a003923c6441d9f8e151dfd4863dee74761 | 6f46957685c372a7ce375ab10f4c48ca83fe6dc6 | /src/main/java/net/hunnor/dict/admin/export/ExportController.java | abf20751c44c6e733c2330d9e3c76edd11508abd | [] | no_license | hunnor-dict/admin-spring | 7d61f6970ac62de5835975c67869ea828fd2bf87 | a93c092731263e6089e45658be1687390fe2de6b | refs/heads/master | 2022-05-01T09:31:47.196051 | 2022-04-21T17:48:45 | 2022-04-21T17:48:45 | 148,643,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,252 | java | package net.hunnor.dict.admin.export;
import java.io.IOException;
import java.io.OutputStream;
import javax.servlet.http.HttpServletResponse;
import net.hunnor.dict.admin.config.Language;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ExportController {
private static final Logger logger = LoggerFactory.getLogger(ExportController.class);
@Autowired
private ExportService exportService;
/**
* Exports the dictionary database as XML.
* @param response the HTTP response object
*/
@GetMapping("/export")
public void export(HttpServletResponse response, @RequestParam(name = "lang") Language language) {
try {
OutputStream outputStream = response.getOutputStream();
exportService.export(language, outputStream);
} catch (IOException | ExportException ex) {
logger.error(ex.getMessage(), ex);
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
}
}
}
| [
"adamzkover@gmail.com"
] | adamzkover@gmail.com |
4617217632767c7ad19130e0d74d8ef6050f6ae3 | 2f19c261a4b8b4e8636cbda126d57d94aabdceaa | /src/com/wjj/weiguan/BaiduMapActivity.java | b2817408ecf6705dcded38dd20b47efe2bcd8250 | [] | no_license | jieke213/WeiGuan | 56323aa936d39d07a67ddbc6b47a95d48ec30f88 | 81359450df26b2bc0245c4ba9d6aa4c5565fdc18 | refs/heads/master | 2020-12-30T11:52:44.198350 | 2017-05-16T08:57:48 | 2017-05-16T08:57:48 | 91,435,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,117 | java | package com.wjj.weiguan;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import com.baidu.location.BDLocation;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.baidu.location.LocationClientOption.LocationMode;
import com.baidu.location.Poi;
import com.baidu.mapapi.SDKInitializer;
import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.MapView;
public class BaiduMapActivity extends Activity implements OnClickListener{
MapView mMapView = null;
BaiduMap mBaiduMap = null;
Button btn_normal,btn_satellite;
Button btn_open_traffic,btn_close_traffic;
//定位功能
LocationClient mLocationClient=null;
public BDLocationListener myListener = new MyLocationListener();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 在使用SDK各组件之前初始化context信息,传入ApplicationContext
// 注意该方法要再setContentView方法之前实现
SDKInitializer.initialize(getApplicationContext());
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.baidumap);
initView();
mBaiduMap = mMapView.getMap();
//定位
mLocationClient = new LocationClient(getApplicationContext()); //声明LocationClient类
mLocationClient.registerLocationListener( myListener ); //注册监听函数
initLocation();
}
private void initView() {
// 获取地图控件引用
mMapView = (MapView) findViewById(R.id.bmapView);
btn_normal=(Button) findViewById(R.id.btn_normal);
btn_normal.setOnClickListener(this);
btn_satellite=(Button) findViewById(R.id.btn_satellite);
btn_satellite.setOnClickListener(this);
btn_open_traffic=(Button) findViewById(R.id.btn_open_traffic);
btn_open_traffic.setOnClickListener(this);
btn_close_traffic=(Button) findViewById(R.id.btn_close_traffic);
btn_close_traffic.setOnClickListener(this);
}
@Override
public void onClick(View arg0) {
switch (arg0.getId()) {
case R.id.btn_normal:
// 普通地图
btn_normal.setVisibility(View.INVISIBLE);
btn_satellite.setVisibility(View.VISIBLE);
mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NORMAL);
break;
case R.id.btn_satellite:
// 卫星地图
btn_satellite.setVisibility(View.INVISIBLE);
btn_normal.setVisibility(View.VISIBLE);
mBaiduMap.setMapType(BaiduMap.MAP_TYPE_SATELLITE);
break;
case R.id.btn_open_traffic:
// 开启交通图
btn_open_traffic.setVisibility(View.INVISIBLE);
btn_close_traffic.setVisibility(View.VISIBLE);
mBaiduMap.setTrafficEnabled(true);
break;
case R.id.btn_close_traffic:
// 关闭交通图
btn_close_traffic.setVisibility(View.INVISIBLE);
btn_open_traffic.setVisibility(View.VISIBLE);
mBaiduMap.setTrafficEnabled(false);
break;
default:
break;
}
}
//BDLocationListener为结果监听接口,异步获取定位结果
public class MyLocationListener implements BDLocationListener {
@Override
public void onReceiveLocation(BDLocation location) {
//Receive Location
StringBuffer sb = new StringBuffer(256);
sb.append("time : ");
sb.append(location.getTime());
sb.append("\nerror code : ");
sb.append(location.getLocType());
sb.append("\nlatitude : ");
sb.append(location.getLatitude());
sb.append("\nlontitude : ");
sb.append(location.getLongitude());
sb.append("\nradius : ");
sb.append(location.getRadius());
if (location.getLocType() == BDLocation.TypeGpsLocation){// GPS定位结果
sb.append("\nspeed : ");
sb.append(location.getSpeed());// 单位:公里每小时
sb.append("\nsatellite : ");
sb.append(location.getSatelliteNumber());
sb.append("\nheight : ");
sb.append(location.getAltitude());// 单位:米
sb.append("\ndirection : ");
sb.append(location.getDirection());// 单位度
sb.append("\naddr : ");
sb.append(location.getAddrStr());
sb.append("\ndescribe : ");
sb.append("gps定位成功");
} else if (location.getLocType() == BDLocation.TypeNetWorkLocation){// 网络定位结果
sb.append("\naddr : ");
sb.append(location.getAddrStr());
//运营商信息
sb.append("\noperationers : ");
sb.append(location.getOperators());
sb.append("\ndescribe : ");
sb.append("网络定位成功");
} else if (location.getLocType() == BDLocation.TypeOffLineLocation) {// 离线定位结果
sb.append("\ndescribe : ");
sb.append("离线定位成功,离线定位结果也是有效的");
} else if (location.getLocType() == BDLocation.TypeServerError) {
sb.append("\ndescribe : ");
sb.append("服务端网络定位失败,可以反馈IMEI号和大体定位时间到loc-bugs@baidu.com,会有人追查原因");
} else if (location.getLocType() == BDLocation.TypeNetWorkException) {
sb.append("\ndescribe : ");
sb.append("网络不同导致定位失败,请检查网络是否通畅");
} else if (location.getLocType() == BDLocation.TypeCriteriaException) {
sb.append("\ndescribe : ");
sb.append("无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机");
}
sb.append("\nlocationdescribe : ");
sb.append(location.getLocationDescribe());// 位置语义化信息
List<Poi> list = location.getPoiList();// POI数据
if (list != null) {
sb.append("\npoilist size = : ");
sb.append(list.size());
for (Poi p : list) {
sb.append("\npoi= : ");
sb.append(p.getId() + " " + p.getName() + " " + p.getRank());
}
}
Log.i("BaiduLocationApiDem", sb.toString());
}
}
//配置定位SDK参数
//设置定位参数包括:定位模式(高精度定位模式、低功耗定位模式和仅用设备定位模式),返回坐标类型,
//是否打开GPS,是否返回地址信息、位置语义化信息、POI信息等等。
//LocationClientOption类,该类用来设置定位SDK的定位方式
private void initLocation(){
LocationClientOption option = new LocationClientOption();
option.setLocationMode(LocationMode.Hight_Accuracy);//可选,默认高精度,设置定位模式,高精度,低功耗,仅设备
option.setCoorType("bd09ll");//可选,默认gcj02,设置返回的定位结果坐标系
int span=1000;
option.setScanSpan(span);//可选,默认0,即仅定位一次,设置发起定位请求的间隔需要大于等于1000ms才是有效的
option.setIsNeedAddress(true);//可选,设置是否需要地址信息,默认不需要
option.setOpenGps(true);//可选,默认false,设置是否使用gps
option.setLocationNotify(true);//可选,默认false,设置是否当GPS有效时按照1S/1次频率输出GPS结果
option.setIsNeedLocationDescribe(true);//可选,默认false,设置是否需要位置语义化结果,可以在BDLocation.getLocationDescribe里得到,结果类似于“在北京天安门附近”
option.setIsNeedLocationPoiList(true);//可选,默认false,设置是否需要POI结果,可以在BDLocation.getPoiList里得到
option.setIgnoreKillProcess(false);//可选,默认true,定位SDK内部是一个SERVICE,并放到了独立进程,设置是否在stop的时候杀死这个进程,默认不杀死
option.SetIgnoreCacheException(false);//可选,默认false,设置是否收集CRASH信息,默认收集
option.setEnableSimulateGps(false);//可选,默认false,设置是否需要过滤GPS仿真结果,默认需要
mLocationClient.setLocOption(option);
}
@Override
protected void onDestroy() {
super.onDestroy();
// 在activity执行onDestroy时执行mMapView.onDestroy(),实现地图生命周期管理
mMapView.onDestroy();
}
@Override
protected void onResume() {
super.onResume();
// 在activity执行onResume时执行mMapView. onResume (),实现地图生命周期管理
mMapView.onResume();
}
@Override
protected void onPause() {
super.onPause();
// 在activity执行onPause时执行mMapView. onPause (),实现地图生命周期管理
mMapView.onPause();
}
}
| [
"15369322925@163.com"
] | 15369322925@163.com |
52a5d7b4bce3f7df42f4e4d7407c6c6c26b0d3db | 2c1c2ae06a84e4f0a0dd81aa849c1f313aa1af9a | /app/src/main/java/com/example/protocoloderecebimento/User.java | e9064973e7920892dd3ee00afe4fc177b5a9ed76 | [] | no_license | huriro/protocolo | 4ecbc54ac0677ff630b9702892c9b513003a7c2a | f5488700f0fcfc3398c5afcf5e1ce8396dd1e1ba | refs/heads/master | 2023-04-17T08:38:31.624686 | 2021-04-24T18:30:40 | 2021-04-24T18:30:40 | 361,237,121 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package com.example.protocoloderecebimento;
import com.google.firebase.database.IgnoreExtraProperties;
@IgnoreExtraProperties
public class User {
public String username;
public String email;
public String Condominio;
public String Funcao;
public User() {
// Default constructor required for calls to DataSnapshot.getValue(User.class)
}
public User(String username, String email,String Condominio,String Funcao) {
this.username = username;
this.email = email;
this.Condominio=Condominio;
this.Funcao=Funcao;
}
}
| [
"portariatruth@gmail.com"
] | portariatruth@gmail.com |
61f8d282ece47efb3ef3c7e3f39e9cb5ca0cb0b7 | 40055be656bc73a1c5dcde0e5975083145a49878 | /app/src/main/java/com/asia/paint/base/network/bean/MessageRsp.java | 8f64dc1c95b9c9b15b5c18d2d22b1fc534e84189 | [] | no_license | lilei1990/AsiaPaint | 6fbb403a4482f86df70998f437db8823843bd714 | 3e1543baada8eacdc7bae5e6375b1b4d7823f2c9 | refs/heads/master | 2023-01-10T00:05:39.989803 | 2020-10-30T06:52:09 | 2020-10-30T06:52:09 | 311,516,714 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package com.asia.paint.base.network.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* @author by chenhong14 on 2019-12-08.
*/
public class MessageRsp {
/**
* result : [{"id":62,"is_read":0,"type":1,"group":1,"title":"测试","content":"测试测试测试测试测试","add_time":"4天前"}]
* totalpage : 1
*/
public int totalpage;
@SerializedName("result")
public List<Message> message;
}
| [
"hl763785813@163.com"
] | hl763785813@163.com |
0af1616826c252cbc426fa68aaaf5733937f4a05 | 835aad7295faa9cdbc25e987c9399ab01da22a97 | /src/utils/Util.java | a727d69397b5cb322598f08d3da9f9b932685f62 | [] | no_license | claudiocarvalhojr/giroferta | 2fb25dea9bfb6043e86cbd851babc77f106592d3 | f97279c6e4758c8a677c3e1a762131940ed5242f | refs/heads/master | 2022-06-20T06:16:53.002511 | 2020-05-04T01:01:32 | 2020-05-04T01:01:32 | 261,047,867 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 5,013 | java | package utils;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.tomcat.util.http.fileupload.IOUtils;
public final class Util {
// PRINT LISTA NOME E VALOR
public void printNameValue(Map<String, String[]> parametros, boolean isPrint) {
printLinha(isPrint);
for (Map.Entry<String, String[]> e : parametros.entrySet())
System.out.printf("PARAMETRO: %-25s VALOR: %s %n", e.getKey(), e.getValue()[0]);
printLinha(isPrint);
}
// PRINT VALOR
public void print(String valor, boolean isPrint) {
if (isPrint)
System.out.print(valor);
}
// PRINT VALOR C/ NOVA LINHA
public void println(String valor, boolean isPrint) {
if (isPrint)
System.out.println(valor);
}
// PRINT VALOR C/ NOVA LINHA
public void printDataHora(String valor, boolean isPrint) {
if (isPrint)
System.out.println((new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(new Date()) + valor);
}
// PRINT LINHA
public void printLinha(boolean isPrint) {
if (isPrint)
System.out.println("********************************************************************************");
}
public Date converteDate(String data) {
Date date = null;
String MaskData = "dd/MM/yyyy";
String MaskHora = "HH:mm:ss";
try {
if (data.length() == 10)
date = new SimpleDateFormat(MaskData).parse(data);
else
date = new SimpleDateFormat(MaskData + " " + MaskHora).parse(data);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
public String converDate(Calendar calendar, String mask) {
return (new SimpleDateFormat(mask)).format(calendar.getTime());
}
public String converDate(Date date, String mask) {
return (new SimpleDateFormat(mask)).format(date);
}
public String converCalendar(Calendar calendar) {
return (new SimpleDateFormat("yyyy-MM-dd")).format(calendar.getTime());
}
public String converDate(Date date) {
return (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(date);
}
public byte[] toBytes(InputStream stream) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
IOUtils.copy(stream, baos);
return baos.toByteArray();
}
catch (Exception e) {
return null;
}
}
// CONFIGURA ESCALA IMAGEM ENVIADA (IMAGENS) ******************************
public BufferedImage redimensionar(BufferedImage original, int width, int height) {
BufferedImage alterada = new BufferedImage(width, height, original.getType()); // original.getType() ou BufferedImage.TYPE_INT_RGB
Graphics2D g2d = alterada.createGraphics();
g2d.drawImage(original.getScaledInstance(width, height, 10000), 0, 0, null);
g2d.dispose();
return alterada;
}
public boolean isDigit(String value) {
boolean isDigit = false;
for (int i = 0; i < value.length(); i++) {
isDigit = Character.isDigit(value.charAt(i));
if (!isDigit)
break;
}
return isDigit;
}
public boolean isPassword(String password) {
if (password.length() < 8 || password.length() > 20)
return false;
Pattern p = Pattern.compile("([a-zA-Z]*([0-9]+[a-zA-Z]+)|([a-zA-Z]+[0-9]+)[0-9]*)+");
Matcher m = p.matcher(password);
return m.matches();
}
public boolean isEmail(String email) {
Pattern p = Pattern.compile("^([0-9a-z]+([_.-]?[0-9a-z]+)*@[0-9a-z]+([_.-]?[0-9a-z]+)*(.){1}[a-z]{2,4})+$");
Matcher m = p.matcher(email);
return m.matches();
}
public String onlyNumbers(String valor) {
valor = valor.replace("(", "");
valor = valor.replace(")", "");
valor = valor.replace("[", "");
valor = valor.replace("]", "");
valor = valor.replace("{", "");
valor = valor.replace("}", "");
valor = valor.replace(".", "");
valor = valor.replace(",", "");
valor = valor.replace("+", "");
valor = valor.replace("-", "");
valor = valor.replace("*", "");
valor = valor.replace("=", "");
valor = valor.replace("/", "");
valor = valor.replace("\\", "");
valor = valor.replace("_", "");
valor = valor.replace(":", "");
valor = valor.replace(";", "");
valor = valor.replace("&", "");
valor = valor.replace("%", "");
valor = valor.replace("#", "");
valor = valor.replace("@", "");
valor = valor.replace("$", "");
valor = valor.replace("|", "");
valor = valor.replace("?", "");
valor = valor.replace("!", "");
valor = valor.replace("\"", "");
valor = valor.replace("'", "");
valor = valor.replace("ª", "");
valor = valor.replace("º", "");
valor = valor.replace("¹", "");
valor = valor.replace("²", "");
valor = valor.replace("³", "");
valor = valor.replace("¬", "");
valor = valor.replace("¢", "");
valor = valor.replace("£", "");
valor = valor.replace("§", "");
valor = valor.replace(" ", "");
return valor;
}
}
| [
"claudio.omar.jr@gmail.com"
] | claudio.omar.jr@gmail.com |
5de4176af7cea57a41592c2d4c8ca3cda9cd04f0 | f41aaf353979938a6a3687d7f64b09270533491d | /spring-cloud-framework/common-service/src/main/java/com/markyang/framework/service/core/validator/PathValidator.java | e14263fd0a768daab48543baebf283c61124c45b | [
"Apache-2.0"
] | permissive | 1107186916/framework | 662efdb7cbcb5c5fe13500c7b55d301eeb2ba2da | 273232608f2589ec7e1650063366647e715bfa35 | refs/heads/main | 2023-03-21T13:04:48.138224 | 2021-02-04T12:16:37 | 2021-02-04T12:16:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,447 | java | package com.markyang.framework.service.core.validator;
import com.markyang.framework.service.core.validator.annotation.Path;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
/**
* path验证器
* @author yangchangliang
*/
public class PathValidator implements ConstraintValidator<Path, String> {
/**
* Initializes the validator in preparation for
* {@link #(Object, ConstraintValidatorContext)} calls.
* The constraint annotation for a given constraint declaration
* is passed.
* <p>
* This method is guaranteed to be called before any use of this instance for
* validation.
* <p>
* The default implementation is a no-op.
*
* @param constraintAnnotation annotation instance for a given constraint declaration
*/
@Override
public void initialize(Path constraintAnnotation) {
}
/**
* Implements the validation logic.
* The state of {@code value} must not be altered.
* <p>
* This method can be accessed concurrently, thread-safety must be ensured
* by the implementation.
*
* @param value object to validate
* @param context context in which the constraint is evaluated
* @return {@code false} if {@code value} does not pass the constraint
*/
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
if (value == null) {
return true;
}
return value.matches("(^\\s*$)|(^(/?[\\w#?&=\\-*.,]+)+$)");
}
}
| [
"markyang088@163.com"
] | markyang088@163.com |
965f7d74d0031d37f119a534963b7d32be032c94 | d41f27bcc65b81fab7f32c162ef37bd660efd8f6 | /src/main/java/livelance/app/LiveLanceApplication.java | 57d5ca94f08ae5afa469d0f16f57e2a9ec2b9b03 | [
"MIT"
] | permissive | missaouib/livelance | 8524e8a075da9a8bd34ff850966cc054ab30d00f | 6112a4976cdc7cbd76b2268e6f527dcde730226b | refs/heads/master | 2021-07-22T00:00:12.143413 | 2017-10-31T15:18:46 | 2017-10-31T15:18:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,731 | java | package livelance.app;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.apache.catalina.Context;
import org.apache.catalina.connector.Connector;
import org.apache.tomcat.util.descriptor.web.SecurityCollection;
import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.util.FileSystemUtils;
import livelance.app.web.controller.FileUploadController;
@SpringBootApplication
public class LiveLanceApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(LiveLanceApplication.class, args);
}
@Bean
CommandLineRunner init() {
return (args) -> {
FileSystemUtils.deleteRecursively(new File(FileUploadController.ROOT));
Files.createDirectory(Paths.get(FileUploadController.ROOT));
};
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
// @Bean
// public EmbeddedServletContainerFactory servletContainer() {
// TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
// @Override
// protected void postProcessContext(Context context) {
// SecurityConstraint securityConstraint = new SecurityConstraint();
// securityConstraint.setUserConstraint("CONFIDENTIAL");
// SecurityCollection collection = new SecurityCollection();
// collection.addPattern("/*");
// securityConstraint.addCollection(collection);
// context.addConstraint(securityConstraint);
// }
// };
//
// tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
// return tomcat;
// }
//
// private Connector initiateHttpConnector() {
// Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
// connector.setScheme("http");
// connector.setPort(8080);
// connector.setSecure(false);
// connector.setRedirectPort(443);
//
// return connector;
// }
}
| [
"aleksandar.sukovic@gmail.com"
] | aleksandar.sukovic@gmail.com |
91d15cfc5b5b376fb464c0b935474fe7fe4d32b8 | e876da65def970835f117040092c4e4d2dd4041b | /src/main/java/com/crm/qa/util/WebEventListener.java | 3f9ba458299038fe9459816a01757ca9fa3e8ae0 | [] | no_license | andriipavelchak/FreeCRMApp | d9387fedca6214d03ac0f0a8b9d5110c3a66bd42 | fbdb8b2d5f3df83bf924ce58736d6e16681448f1 | refs/heads/master | 2020-03-14T07:05:57.828436 | 2018-04-29T13:39:11 | 2018-04-29T13:39:11 | 131,404,394 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,897 | java | package com.crm.qa.util;
/*************************************** PURPOSE **********************************
- This class implements the WebDriverEventListener, which is included under events.
The purpose of implementing this interface is to override all the methods and define certain useful Log statements
which would be displayed/logged as the application under test is being run.
Do not call any of these methods, instead these methods will be invoked automatically
as an when the action done (click, findBy etc).
*/
import java.io.IOException;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.events.WebDriverEventListener;
import com.crm.qa.base.TestBase;
public class WebEventListener extends TestBase implements WebDriverEventListener {
public void beforeNavigateTo(String url, WebDriver driver) {
System.out.println("Before navigating to: '" + url + "'");
}
public void afterNavigateTo(String url, WebDriver driver) {
System.out.println("Navigated to:'" + url + "'");
}
public void beforeChangeValueOf(WebElement element, WebDriver driver) {
System.out.println("Value of the:" + element.toString() + " before any changes made");
}
public void afterChangeValueOf(WebElement element, WebDriver driver) {
System.out.println("Element value changed to: " + element.toString());
}
public void beforeClickOn(WebElement element, WebDriver driver) {
System.out.println("Trying to click on: " + element.toString());
}
public void afterClickOn(WebElement element, WebDriver driver) {
System.out.println("Clicked on: " + element.toString());
}
public void beforeNavigateBack(WebDriver driver) {
System.out.println("Navigating back to previous page");
}
public void afterNavigateBack(WebDriver driver) {
System.out.println("Navigated back to previous page");
}
public void beforeNavigateForward(WebDriver driver) {
System.out.println("Navigating forward to next page");
}
public void afterNavigateForward(WebDriver driver) {
System.out.println("Navigated forward to next page");
}
public void onException(Throwable error, WebDriver driver) {
System.out.println("Exception occured: " + error);
try {
TestUtil.takeScreenshotAtEndOfTest();
} catch (IOException e) {
e.printStackTrace();
}
}
public void beforeFindBy(By by, WebElement element, WebDriver driver) {
System.out.println("Trying to find Element By : " + by.toString());
}
public void afterFindBy(By by, WebElement element, WebDriver driver) {
System.out.println("Found Element By : " + by.toString());
}
/*
* non overridden methods of WebListener class
*/
public void beforeScript(String script, WebDriver driver) {
}
public void afterScript(String script, WebDriver driver) {
}
public void beforeAlertAccept(WebDriver driver) {
// TODO Auto-generated method stub
}
public void afterAlertAccept(WebDriver driver) {
// TODO Auto-generated method stub
}
public void afterAlertDismiss(WebDriver driver) {
// TODO Auto-generated method stub
}
public void beforeAlertDismiss(WebDriver driver) {
// TODO Auto-generated method stub
}
public void beforeNavigateRefresh(WebDriver driver) {
// TODO Auto-generated method stub
}
public void afterNavigateRefresh(WebDriver driver) {
// TODO Auto-generated method stub
}
public void beforeChangeValueOf(WebElement element, WebDriver driver, CharSequence[] keysToSend) {
// TODO Auto-generated method stub
}
public void afterChangeValueOf(WebElement element, WebDriver driver, CharSequence[] keysToSend) {
// TODO Auto-generated method stub
}
public void afterSwitchToWindow(String arg0, WebDriver arg1) {
// TODO Auto-generated method stub
}
public void beforeSwitchToWindow(String arg0, WebDriver arg1) {
// TODO Auto-generated method stub
}
}
| [
"apavel@softserveinc.com"
] | apavel@softserveinc.com |
c2b48cde214288b1c4a972dd2e74bde816b4839f | 049ae038a01d58f9cd761c00741604b9f852f601 | /app/src/main/java/com/hu/yang/prime/Fragment/ItemDelFragment.java | 556910c4a72a4c5a4a21e31505dbe95b9b8c4313 | [] | no_license | huyang2100/Prime | 323a567c6c321caf41cbd641ada6d7b1654b4846 | 7b87be1ea11b836bbadf833c3538856f03b9d267 | refs/heads/master | 2021-09-04T20:08:31.442941 | 2018-01-22T02:12:24 | 2018-01-22T02:12:24 | 110,322,442 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,172 | java | package com.hu.yang.prime.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.hu.yang.prime.R;
import java.util.ArrayList;
/**
* Created by yanghu on 2017/10/30.
*/
public class ItemDelFragment extends Fragment {
private ArrayList<String> datas = new ArrayList<>();
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_item_del,container,false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
for (int i = 0; i < 20; i++) {
datas.add("item: " + i);
}
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycleview);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(new MyAdapter(datas));
}
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyViewHolder> {
private final ArrayList<String> datas;
public MyAdapter(ArrayList<String> datas) {
this.datas = datas;
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
MyViewHolder viewHolder = new MyViewHolder(LayoutInflater.from(getContext()).inflate(R.layout.bookmark_list_item, parent,false));
return viewHolder;
}
@Override
public void onBindViewHolder(final MyViewHolder holder, final int position) {
final String info = datas.get(position);
holder.textView.setText(info);
// holder.itemView.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// Toast.makeText(getContext(), datas.get(holder.getLayoutPosition()), Toast.LENGTH_SHORT).show();
// }
// });
// holder.delView.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// Toast.makeText(getContext(), "del: "+holder.getLayoutPosition(), Toast.LENGTH_SHORT).show();
// }
// });
}
@Override
public int getItemCount() {
return datas.size();
}
public class MyViewHolder extends RecyclerView.ViewHolder {
private final TextView textView;
private final TextView delView;
public MyViewHolder(View itemView) {
super(itemView);
textView = (TextView) itemView.findViewById(R.id.tv);
delView = (TextView) itemView.findViewById(R.id.im_post_delete);
}
}
}
}
| [
"huyang2100@163.com"
] | huyang2100@163.com |
e88d0fde57a04dc9f2a42276ca85f2979d33650b | b3dee30c0b9d09584a9f72fe37df05d7c4f5ae95 | /src/main/java/ro/bets/config/JsonDateSerializer.java | 313846428ccf5b1639c6366b52d6f2a9e5b974ce | [] | no_license | alin-ciobanu/Spring | 883c16281e744148397fb0ca38ecff299fda0bfa | 67ad808b87addf885da647f8776ee2e76b836dad | refs/heads/master | 2021-01-18T18:12:27.630346 | 2014-07-06T16:34:56 | 2014-07-06T16:34:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 839 | java | package ro.bets.config;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by yozmo on 3/1/14.
*/
@Component
public class JsonDateSerializer extends JsonSerializer<Date> {
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy");
@Override
public synchronized void serialize(Date date, JsonGenerator gen, SerializerProvider provider)
throws IOException, JsonProcessingException {
String formattedDate = dateFormat.format(date);
gen.writeString(formattedDate);
}
}
| [
"alin.ciobanu@cti.pub.ro"
] | alin.ciobanu@cti.pub.ro |
dd2b1a2d9b191de9c50113ef7c4ba02a7c56f976 | 3ca96b2cbc245be01eb5001df31c0ca71ee7d9fc | /src/test/java/pure_Java_core/pure_core/Component/BasicScan.java | caaabee06071a5031579cc73efa2b71575f14870 | [] | no_license | ChoiYoungHa/Pure_Java_Core | bc4905687d67161501d74741820296faaea8d727 | 9d78c367513cf97f8fbf383731d8671eaccb1f20 | refs/heads/master | 2023-03-12T22:16:05.434064 | 2021-02-27T22:51:52 | 2021-02-27T22:51:52 | 338,196,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,614 | java | package pure_Java_core.pure_core.Component;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import pure_Java_core.pure_core.AutoAppConfig;
import pure_Java_core.pure_core.Order.Order;
import pure_Java_core.pure_core.Order.OrderService;
import pure_Java_core.pure_core.Order.OrderServiceImpl;
import pure_Java_core.pure_core.member.Grade;
import pure_Java_core.pure_core.member.Member;
import pure_Java_core.pure_core.member.MemberService;
public class BasicScan {
AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(AutoAppConfig.class);
@Test
@DisplayName("컴포넌트 스캔")
void scantest() {
//orderService의 의존관계인 discountPolicy가 bean이 중복되어있어서 오류를 발생시킴
MemberService memberService = ac.getBean(MemberService.class);
OrderService bean = ac.getBean(OrderService.class);
Assertions.assertThat(memberService).isInstanceOf(MemberService.class);
}
// @Test
// @DisplayName("order 서비스 사용")
// void orderServiceTest(){
// MemberService memberService = ac.getBean(MemberService.class);
// OrderService orderService = ac.getBean(OrderService.class);
// Member member = new Member(1L, "Young", Grade.VIP);
// memberService.join(member);
// Order item2 = orderService.createOrder(1L, "Item2", 12000);
// System.out.println("item2.toString() = " + item2.toString());
//
// }
}
| [
"askillofgod159@naver.com"
] | askillofgod159@naver.com |
67028db3c40f196a8aa66b8c3f044770568452e3 | c5ff7cfe8f0c145db93d8043649e78bc0e116013 | /src/main/java/com/example/orbix_web/controllers/BillServiceController.java | efbd9f54889c48d0f898e9af2c9e68c926759040 | [] | no_license | godfreydesidery/orbixBE | 9f5c12d9d196ec41759ab51a73f9b7dcc35d8113 | 573b3d183bcfd9bde8e78f59eb1cc24e1b56d9af | refs/heads/master | 2023-05-22T17:21:23.013032 | 2021-06-10T10:55:49 | 2021-06-10T10:55:49 | 312,823,546 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,565 | java | /**
*
*/
package com.example.orbix_web.controllers;
import java.util.List;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.example.orbix_web.exceptions.ResourceNotFoundException;
import com.example.orbix_web.models.Bill;
import com.example.orbix_web.repositories.BillRepository;
/**
* @author GODFREY
*
*/
@RestController
@RequestMapping(value = "/api")
@Service
public class BillServiceController {
@Autowired
BillRepository billRepository;
// Get All Bills
@GetMapping("/bills")
public List<Bill> getAllBills() {
return billRepository.findAll();
}
// Create a new Bill
@PostMapping(value="/bills")
@ResponseBody
public Bill createBill(@Valid @RequestBody Bill bill) {
return billRepository.save(bill);
}
// Get a Single Bill
@GetMapping("/bills/{id}")
public Bill getBillById(@PathVariable(value = "id") Long billId) {
return billRepository.findById(billId)
.orElseThrow(() -> new ResourceNotFoundException("Bill", "id", billId));
}
// Update a Bill
@PutMapping("/bills/{id}")
public Bill updateNote(@PathVariable(value = "id") Long billId,
@Valid @RequestBody Bill billDetails) {
Bill bill = billRepository.findById(billId)
.orElseThrow(() -> new ResourceNotFoundException("Bill", "id", billId));
Bill updatedBill = billRepository.save(bill);
return updatedBill;
}
// Delete a Bill
@DeleteMapping("/bills/{id}")
public ResponseEntity<?> deleteBill(@PathVariable(value = "id") Long billId) {
Bill bill = billRepository.findById(billId)
.orElseThrow(() -> new ResourceNotFoundException("Bill", "id", billId));
billRepository.delete(bill);
return ResponseEntity.ok().build();
}
}
| [
"desideryg@gmail.com"
] | desideryg@gmail.com |
2f5ec7eb525daa417f9be2d444b99180277e21eb | 04b4ca98bbffcbc4d96d2196977ed01ec82b8587 | /src/study/java/designpattern/observer/CurrentConditionsDisplay.java | ff5f26c765cda59cdf4e0268ddc6c7cdb70d2c20 | [] | no_license | chengjianyun/DesignPatternStudy | 3aaedc9f4dd4218bb3416a500a70fb4a78ccfcf6 | dee7df1cae20f27a568c90d906c5085efbe6a323 | refs/heads/master | 2021-01-01T18:28:32.319023 | 2014-11-04T13:31:32 | 2014-11-12T03:33:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,007 | java | package study.java.designpattern.observer;
import java.util.Observable;
import java.util.Observer;
public class CurrentConditionsDisplay implements DisplayElement, Observer {
private float temperature;
private float humidity;
private Observable weatherData;
public CurrentConditionsDisplay(Observable weatherData) {
// TODO Auto-generated constructor stub
this.weatherData=weatherData;
this.weatherData.addObserver(this);
}
public void update(float temp, float humidity, float pressure) {
// TODO Auto-generated method stub
temperature=temp;
this.humidity=humidity;
display();
}
public void display() {
// TODO Auto-generated method stub
System.out.println("Current conditions: "+temperature+"F Degrees and "+humidity+"% humidity");
}
public void update(Observable arg0, Object arg1) {
// TODO Auto-generated method stub
if(arg0 instanceof WeatherData){
temperature=((WeatherData) arg0).getTemperature();
humidity=((WeatherData) arg0).getHumidity();
}
}
}
| [
"cjy2007126@163.com"
] | cjy2007126@163.com |
5311581270a51033b5f043e3a9737fde83620115 | 34f5a364b0fa021342713abc726989365408ee77 | /src/sky/netatmo/DefaultUser.java | 9f9bc98045cb428537248e7c7b1eda68ecb3331b | [] | no_license | pjskyman/skynetatmo | a7f5a9267725213e64482a97fda969dc6ebedf3d | 531ce7af8387e43fa9f1358cb2862a04d498307d | refs/heads/master | 2021-04-29T23:29:26.712383 | 2021-04-06T10:21:09 | 2021-04-06T10:21:09 | 121,557,251 | 0 | 0 | null | 2018-02-17T10:12:30 | 2018-02-14T20:22:30 | Java | UTF-8 | Java | false | false | 3,324 | java | package sky.netatmo;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import java.io.IOException;
import java.util.Date;
import java.util.Locale;
public class DefaultUser implements User
{
private final Token token;
private final String id;
private final JsonObject attributes;
DefaultUser(Token token,String id,JsonObject attributes)
{
this.token=token;
this.id=id;
this.attributes=attributes;
}
public Token getToken()
{
return token;
}
public String getId()
{
return id;
}
public String getMail()
{
try
{
return attributes.getAsJsonPrimitive("mail").getAsString();
}
catch(JsonParseException e)
{
return "?";
}
}
public Date getCreationDate()
{
try
{
return new Date(attributes.getAsJsonObject("date_creation").getAsJsonPrimitive("sec").getAsLong()*1000L);
}
catch(JsonParseException e)
{
return new Date(0L);
}
}
public Locale getLocale()
{
try
{
String locale=attributes.getAsJsonObject("administrative").getAsJsonPrimitive("lang").getAsString();
return new Locale(locale.substring(0,2),locale.substring(3,5));
}
catch(JsonParseException e)
{
return Locale.getDefault();
}
}
public JsonObject getAttributes()
{
return attributes;
}
public Device[] getDevices() throws NetatmoException
{
JsonObject response;
try
{
response=Token.doURLRequest("GET","https://api.netatmo.net/api/devicelist","access_token="+token.getAccessTokenString());
}
catch(JsonParseException e)
{
throw new NetatmoException("Unreadable response",e);
}
catch(IOException e)
{
if(e.getMessage().contains("Server returned HTTP response code: 403"))
throw new TokenExpiredException();
else
throw new NetatmoException("Unknown error during request",e);
}
try
{
response=response.getAsJsonObject("body");
JsonArray array=response.getAsJsonArray("devices");
Device[] devices=new Device[array.size()];
for(int i=0;i<devices.length;i++)
{
JsonObject object=array.get(i).getAsJsonObject();
JsonArray moduleArray=object.getAsJsonArray("modules");
String[] moduleIds=new String[moduleArray.size()];
for(int j=0;j<moduleIds.length;j++)
moduleIds[j]=moduleArray.get(j).getAsJsonPrimitive().getAsString();
devices[i]=new DefaultDevice(this,object.get("_id").getAsJsonPrimitive().getAsString(),object);
}
return devices;
}
catch(JsonParseException e)
{
System.out.println("devicesHttpResponse="+response.toString());
throw new NetatmoException("Unreadable response",e);
}
}
}
| [
"PJ Skyman@FIXE-SALON"
] | PJ Skyman@FIXE-SALON |
e18a6735bc4687e3d0207e690b91409da012de0a | 1e9dc7388c8136208df1d2f09888d611e62b2004 | /rabbitmq-management-rest/src/main/java/com/zenika/rabbitmq/management/services/rest/remote/RabbitMqServiceRemote.java | 41ec47a6173513ff5a6c0b8ffb81eb2aeac00f54 | [] | no_license | cenbow/RabbitMQ-Management | 158ff4a82d8ef18a3f44a9dc8c160eed44f7d7db | 1eebfbccacaa2a4641ca88a94df00e92fbeca37f | refs/heads/master | 2021-01-12T16:15:28.746147 | 2010-12-02T13:46:49 | 2010-12-02T13:46:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,881 | java | package com.zenika.rabbitmq.management.services.rest.remote;
import java.util.List;
import java.util.Map;
import javax.ws.rs.*;
import com.zenika.rabbitmq.management.beans.Application;
import com.zenika.rabbitmq.management.beans.Configuration;
import com.zenika.rabbitmq.management.beans.NodeInfo;
import com.zenika.rabbitmq.management.beans.User;
public interface RabbitMqServiceRemote {
/**
* Get various random bits of information that describe the whole system.
*
* @return Informations on the node
*/
@GET
@Path("overview")
NodeInfo getNodeOverview();
/**
* Get all the running applications in the Erlang VM.
*
* @return A list of applications running on the node
*/
@GET
@Path("applications")
List<Application> getApplications();
/**
* Get the complete server configuration. Everything is retrieved apart from
* messages.
*
* @return The rabbit-mq server configuration
*/
@GET
@Path("all-configuration")
Configuration getCompleteConfiguration();
/**
* Upload a configuration to the rabbit-mq server.
* <p/>
* The uploaded configuration is merged with the existing one which is leaved
* untouched. Any conflict will cause an error. In the event of an error, you
* will be left with a part-applied configuration.
*
* @param configuration the new configuration
*/
@POST
@Consumes("application/json")
@Path("all-configuration")
void postCompleteConfiguration(Configuration configuration);
/**
* Get the current user logged in.
*
* @return current user
*/
@GET
@Path("whoami")
User getCurrentUser();
/**
* Get the status of the given vHost
*
* @param vHost the vHost to check
* @return "on" when the given vHost is alive
*/
//TODO : Find a better way to get this single result
@GET
@Path("aliveness-test/{vhost}")
Map<String, String> testAliveness(@PathParam("vhost") String vHost);
}
| [
"hebert.colin@gmail.com"
] | hebert.colin@gmail.com |
ab1ad1f0327e9626bc6abb9ba0afacdcc44fa6d0 | 2453cbf2a938818fd604e20296c20aff86efef09 | /app/src/main/java/cn/bingoogolapple/media/util/StringUtil.java | a767587aa4a8dbcc3df451fec12217ebfb400a6b | [] | no_license | lineCode/MediaNote-Android | ea2883cd3f162127b16741e2bf84dabd1e5a38c8 | ff5325a2dee8a6a2257b4cd6f7ee8422386c04ac | refs/heads/master | 2020-06-01T06:32:24.167141 | 2016-04-19T03:10:46 | 2016-04-19T03:10:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,098 | java | package cn.bingoogolapple.media.util;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 作者:王浩 邮件:bingoogolapple@gmail.com
* 创建时间:15/9/10 上午10:22
* 描述:
*/
public class StringUtil {
private StringUtil() {
}
public static String formatTime(long remainTime) {
int SECOND = 1000;
int MINUTE = SECOND * 60;
int HOUR = MINUTE * 60 * 60;
int hour = (int) (remainTime / HOUR);
remainTime = remainTime % HOUR;
int minute = (int) (remainTime / MINUTE);
remainTime = remainTime % MINUTE;
int second = (int) (remainTime / SECOND);
if (hour == 0) {
return String.format("%02d:%02d", minute, second);
} else {
return String.format("%02d:%02d:%02d", hour, minute, second);
}
}
public static String formatSystemTime() {
return new SimpleDateFormat("HH:mm:ss").format(new Date());
}
public static String formatAudioName(String audioName){
return audioName.substring(0,audioName.lastIndexOf("."));
}
} | [
"bingoogolapple@gmail.com"
] | bingoogolapple@gmail.com |
2d43794310886527fe70ff45efcb09b1d34dd3ae | 948331b63c70dcae87af256ffe51804f0802b388 | /app/src/main/java/com/utabitwallet/tools/util/CustomLogger.java | f1d0f669ef7ff3fcaf344e35f90b611cee899e1d | [
"MIT"
] | permissive | utabit/utabitwallet-android | 86fe09c3606bce4906bf59306cef2368598f727a | 3200cb498126ac9f713d8071679e10c80bf14433 | refs/heads/master | 2021-01-18T09:57:26.725366 | 2017-08-20T06:06:44 | 2017-08-20T06:06:44 | 100,359,439 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,822 | java | package com.utabitwallet.tools.util;
import android.util.Log;
/**
* BreadWallet
* <p/>
* Created by Mihail Gutan <mihail@breadwallet.com> on 11/17/15.
* Copyright (c) 2016 breadwallet LLC
* <p/>
* 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:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* 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.
*/
public class CustomLogger {
private static final String TAG = CustomLogger.class.getName();
public static void logThis(String... args) {
StringBuilder strToLog = new StringBuilder();
int i = 0;
for (String arg : args) {
if (i++ % 2 == 0) {
strToLog.append(" | ").append(arg).append(": ");
} else {
strToLog.append(arg);
}
if(i % 4 == 0) strToLog.append("\n");
}
Log.e(TAG, strToLog.toString());
}
}
| [
"dev@utabit.com"
] | dev@utabit.com |
a9094c93cc16a2ce5c202f8cc2c2cc84d2f1db2f | 4c9b3b4d11eed88a123a8d0c93966670efcba25a | /ApexCollectMonitor/src/main/java/com/chinapex/android/monitor/MonitorTools.java | aed18eb0e21aabe399c480c264aa4bd3b6e349f6 | [
"Apache-2.0"
] | permissive | SteelCabbage/ApexCollect | 9516b25794f3be6937c05c833ddc51bc3b0616f5 | d9c631c664ae547517b7dceb2fa94150d6be64fc | refs/heads/master | 2020-04-01T16:54:39.071592 | 2019-01-30T03:29:52 | 2019-01-30T03:29:52 | 153,403,655 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,797 | java | package com.chinapex.android.monitor;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;
import android.widget.Toast;
import com.chinapex.android.monitor.callback.IMonitorCallback;
import com.chinapex.android.monitor.executor.TaskController;
import com.chinapex.android.monitor.global.MonitorCache;
import com.chinapex.android.monitor.utils.MLog;
import com.chinapex.android.monitor.view.FloatingViewManager;
import com.chinapex.android.monitor.view.IFloatingView;
import com.chinapex.android.monitor.view.event.DefineEventView;
import java.util.Map;
import java.util.Stack;
/**
* @author SteelCabbage
* @date 2018/12/14
*/
public class MonitorTools {
private static final String TAG = MonitorTools.class.getSimpleName();
private MonitorTools() {
}
private static class MonitorToolsHolder {
private static final MonitorTools MONITOR_TOOLS = new MonitorTools();
}
public static MonitorTools getInstance() {
return MonitorToolsHolder.MONITOR_TOOLS;
}
public static boolean isInit = false;
public static void init() {
if (isInit) {
MLog.i(TAG, "init() -> TaskController has already been initialized !");
return;
}
TaskController.getInstance().doInit();
MonitorCache.getInstance().getExistData();
isInit = true;
}
/**
* 开启悬浮窗
*
* @param context Application的上下文
* @param iMonitorCallback 圈选模式的回调
* @param tasks Activity和Fragment的任务栈
* @param top 指向栈顶Activity顶指针
* @param foregroundTask 指向前台任务栈
*/
public static void showFloatingWindow(Context context, IMonitorCallback iMonitorCallback,
Map<Integer, Stack<Map<String, Boolean>>> tasks,
Map<Integer, Integer> top, int[] foregroundTask) {
MLog.d(TAG, "showFloatingWindow: DEBUG!");
if (null == context || null == iMonitorCallback) {
MLog.e(TAG, "context or iMonitorCallback is null!");
return;
}
MonitorCache.getInstance().setContext(context);
MonitorCache.getInstance().setIMonitorCallback(iMonitorCallback);
MonitorCache.getInstance().setTasks(tasks);
MonitorCache.getInstance().setTop(top);
MonitorCache.getInstance().setForegroundTask(foregroundTask);
getInstance().showWindow();
init();
}
/**
* 关闭悬浮窗,比如回到桌面
*/
public static void dismissFloatingWindow() {
MLog.d(TAG, "dismissFloatingWindow: DEBUG!");
getInstance().dismissWindow();
}
/**
* 显示点击事件定义页面
*
* @param viewPath 控件路径
* @param pageClass 页面路径
*/
public static void showClickDefinePage(String viewPath, String pageClass) {
FloatingViewManager.getInstance().showFloatingView(IFloatingView.WINDOW_DEFINE_CLICK_PAGE);
DefineEventView defineEventView = (DefineEventView) FloatingViewManager.getInstance()
.getFloatingView(IFloatingView.WINDOW_DEFINE_CLICK_PAGE);
if (null == defineEventView) {
MLog.d(TAG, "showDefinePage()-> can not get DefineEventView");
return;
}
defineEventView.loadClickData(viewPath, pageClass);
}
/**
* 显示列表点击事件的定义页面
*
* @param viewPath 控件路径
* @param pageClass 页面路径
* @param itemPath 列表条目路径
*/
public static void showListItemClickDefinePage(String viewPath, String pageClass, String itemPath) {
FloatingViewManager.getInstance().showFloatingView(IFloatingView.WINDOW_DEFINE_LIST_PAGE);
DefineEventView defineEventView = (DefineEventView) FloatingViewManager.getInstance()
.getFloatingView(IFloatingView.WINDOW_DEFINE_LIST_PAGE);
if (null == defineEventView) {
MLog.e(TAG, "showListItemClickDefinePage()-> can not get DefineEventView");
return;
}
defineEventView.loadListItemClickData(viewPath, pageClass, itemPath);
}
/**
* 选择点击项进行对比
*
* @param viewPath 点击项的view path
*/
public static boolean addContrastItem(String viewPath) {
return MonitorCache.getInstance().addContrastItem(viewPath);
}
private boolean showWindow() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (!Settings.canDrawOverlays(MonitorCache.getInstance().getContext())) {
requestPermission(MonitorCache.getInstance().getContext());
Toast.makeText(MonitorCache.getInstance().getContext(), "showWindow() -> unauthorized", Toast.LENGTH_LONG).show();
MLog.w(TAG, "showWindow() -> unauthorized");
return false;
}
}
FloatingViewManager.getInstance().showFloatingView(IFloatingView.WINDOW_FLOATING);
FloatingViewManager.getInstance().showAll();
return true;
}
@TargetApi(Build.VERSION_CODES.M)
private void requestPermission(Context context) {
if (null == context) {
MLog.e(TAG, "requestPermission() -> context is null!");
return;
}
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + context.getPackageName()));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
private void dismissWindow() {
FloatingViewManager.getInstance().hideAll();
}
}
| [
"liuyi_61@163.com"
] | liuyi_61@163.com |
c358b3b81e47f6805b24a2c537b5e30ac00eb0f2 | d5010105c4af9e6808e48518f46118e08a89ccff | /didong-main/didong-main/MyRestaurant/app/src/main/java/com/example/myrestaurant/model/MonAnDaChon.java | 5b8476b1a4a7334eea6a7f5a00c9ead2cfca8f7a | [] | no_license | 0306181100/Adroid-App-My-Restaurant | 9295d8c75cc6b713a00dad242d46e8ec758be084 | 93b2ec25eb8012c4fd75793b4c18da422a1e196a | refs/heads/master | 2023-02-20T02:32:45.619465 | 2021-01-26T11:40:19 | 2021-01-26T11:40:19 | 333,065,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,223 | java | package com.example.myrestaurant.model;
import java.util.LinkedList;
public class MonAnDaChon {
private MonAn monAn;
private int SoLuong;
private int id;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
private int TrangThai;
public int TrangThai() {
return TrangThai;
}
public void setTrangThai(int trangThai) {
TrangThai = trangThai;
}
public static final String COL_ID = "ID";
public static final String COL_IDMONAN = "IDMONAN";
public static final String COL_SOLUONG = "SOLUONG";
public static final String COL_TENMONAN = "TENMONAN";
public static final String COL_HINHANH = "HINHANH";
public static final String COL_GIA = "GIA";
public static final String COL_MOTA = "MOTA";
public static final String COL_TRANGTHAI = "TRANGTHAI";
public static final String TABLE_NAME = "giohang";
public static final String CREATE_TABLE = "CREATE table "+ TABLE_NAME + " ( "
+ COL_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ COL_IDMONAN + " INTEGER , "
+ COL_TENMONAN + " TEXT, "
+ COL_HINHANH + " TEXT, "
+ COL_GIA + " INTEGER, "
+ COL_MOTA + " TEXT, "
+ COL_TRANGTHAI + " BIT default(1), "
+ COL_SOLUONG + " INTEGER)";
public static final String DROP_TABLE = "DROP TABLE IF EXISTS " + TABLE_NAME;
public MonAnDaChon(){}
public MonAnDaChon(MonAn monAn) {
this.monAn=monAn;
this.id=0;
SoLuong=1;
this.TrangThai = 1;
}
public MonAnDaChon(MonAn monAn,int soluong) {
this.monAn=monAn;
this.SoLuong=soluong;
this.TrangThai = 1;
this.id=0;
}
public MonAnDaChon(MonAn monAn,int soluong,int trangThai) {
this.monAn=monAn;
this.id=0;
this.SoLuong=soluong;
this.TrangThai = trangThai;
}
public int getSoLuong() {
return SoLuong;
}
public void setSoLuong(int soLuong) {
SoLuong = soLuong;
}
public MonAn getMonAn() {
return monAn;
}
public void setMonAn(MonAn monAn) {
this.monAn = monAn;
}
}
| [
"0306181100@caothang.edu.vn"
] | 0306181100@caothang.edu.vn |
cda6bcbbbf9c8767cc123cedaf7e39033a586af3 | 42e1ad3125d82b7a74cf3b7d5db2b768fed2519a | /Grocito/app/src/main/java/com/grocito/grocito/adapter/GrocitoWalletAdapter.java | d5358ba334b9ff79175e2193e30c4b147c9c0d6f | [] | no_license | mukesh249/Grocito-Project | 92b613bffb42aa9f620aa3fe14589f2e63036877 | f54dd528d9ad25863ebd56bc07f0e167526c73d5 | refs/heads/master | 2020-12-28T01:41:17.096340 | 2020-02-04T06:35:41 | 2020-02-04T06:35:41 | 238,139,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,450 | java | package com.grocito.grocito.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.grocito.grocito.R;
import com.grocito.grocito.databinding.GrocitoWalletItemBinding;
import com.grocito.grocito.model.GrocitoWalletModel;
import java.util.List;
public class GrocitoWalletAdapter extends RecyclerView.Adapter<GrocitoWalletAdapter.ViewHolder> {
List<GrocitoWalletModel.GrocitoWallet> arrayList;
Context context;
public GrocitoWalletAdapter(Context context, List<GrocitoWalletModel.GrocitoWallet> arrayList) {
this.arrayList = arrayList;
this.context = context;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
GrocitoWalletItemBinding binding = DataBindingUtil
.inflate(LayoutInflater.from(viewGroup.getContext()),
R.layout.grocito_wallet_item,viewGroup,false);
return new ViewHolder(binding);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) {
GrocitoWalletModel.GrocitoWallet homeCatProductModel = arrayList.get(i);
viewHolder.binding.dateTimeTv.setText(homeCatProductModel.createdAt);
viewHolder.binding.productNameTv.setText(homeCatProductModel.paymentType);
viewHolder.binding.amountTv.setText(String.format("Amount : Rs.%s",homeCatProductModel.amount));
viewHolder.binding.statusTv.setText(String.format("Status : %s",homeCatProductModel.status));
}
@Override
public int getItemCount() {
return arrayList.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
GrocitoWalletItemBinding binding;
public ViewHolder(@NonNull GrocitoWalletItemBinding itemView) {
super(itemView.getRoot());
this.binding = itemView;
binding.getRoot().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// context.startActivity(new Intent(context, ProductDetail.class)
// .putExtra("product_slug",arrayList.get(getAdapterPosition()).slug));
}
});
}
}
}
| [
"mukeshv249@gmail.com"
] | mukeshv249@gmail.com |
a28fe7901468c63ed94071eba915e0bed3c10e94 | 324f7d2347e8865bf7d177d16504328e4b329880 | /src/main/java/pl/movie/rental/commands/GetMovieCommand.java | a2fc4da5e1f39ab6b75339a58ca2f343c0e14a65 | [] | no_license | Syberiat/movie-rental | 4789ddd7c9d8a75ae1ae1cf6c53e6c37faa2ca38 | 85f53b7b3deba73ee6838baf46be2dca5d5d3b16 | refs/heads/master | 2020-03-27T16:27:38.122644 | 2018-09-10T13:09:15 | 2018-09-10T13:09:15 | 146,784,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 473 | java | package pl.movie.rental.commands;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@Builder
@Data
@AllArgsConstructor
public class GetMovieCommand {
private String sortBy;
private String lastSortBy;
private String sortDirection;
private int pageSize;
private int pageNumber;
public GetMovieCommand() {
this.sortBy = "title";
this.lastSortBy = "title";
this.sortDirection = "ASC";
this.pageSize = 10;
this.pageNumber = 0;
}
} | [
"karolinaturko@wp.pl"
] | karolinaturko@wp.pl |
b00cf9f20c0fd1bbf5d784788e9b98f54183675e | 225e9c2aebb7b47971c738f45775713d7cfb15f5 | /netty-4.x/common/src/main/java/io/netty/concurrent/AbstractFuture.java | c6de297d2021216add88f77ddb8b79b5a5d1e025 | [] | no_license | smalldoctor/source-code | 6bb53559840f138a456c160aa22d0d7bba5322a0 | c7571807e8d29d46a353148de6dfce3e52f5cfe9 | refs/heads/master | 2022-11-05T19:01:27.152507 | 2019-07-02T09:57:44 | 2019-07-02T09:57:44 | 106,514,195 | 0 | 0 | null | 2022-10-05T19:09:17 | 2017-10-11T06:27:26 | Java | UTF-8 | Java | false | false | 188 | java | package io.netty.concurrent;
/**
* 自定义Future的基础抽象实现;
* 不允许Cancellation
*
* @param <V>
*/
public abstract class AbstractFuture<V> implements Future<V> {
}
| [
"15312408287@163.com"
] | 15312408287@163.com |
0588865028bd0445d8c44a84f4a166b7574969ca | 08c32f3b4bc17656629e8d3a5820bb69de3f544b | /app/build/generated/not_namespaced_r_class_sources/debug/r/androidx/legacy/coreutils/R.java | d12a2978940ddf90c32350e0e5242980bf2ce342 | [] | no_license | goddamnnoob/BiNDAS | cf5da8e781f51e7aea260288091f175ed0b46342 | be35f457e8cea66b470da79254155528c23ec21b | refs/heads/master | 2020-12-15T14:36:05.884856 | 2020-01-20T15:58:48 | 2020-01-20T15:58:48 | 235,114,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,456 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package androidx.legacy.coreutils;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f020027;
public static final int font = 0x7f020086;
public static final int fontProviderAuthority = 0x7f020088;
public static final int fontProviderCerts = 0x7f020089;
public static final int fontProviderFetchStrategy = 0x7f02008a;
public static final int fontProviderFetchTimeout = 0x7f02008b;
public static final int fontProviderPackage = 0x7f02008c;
public static final int fontProviderQuery = 0x7f02008d;
public static final int fontStyle = 0x7f02008e;
public static final int fontVariationSettings = 0x7f02008f;
public static final int fontWeight = 0x7f020090;
public static final int ttcIndex = 0x7f020148;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f040044;
public static final int notification_icon_bg_color = 0x7f040045;
public static final int ripple_material_light = 0x7f04004f;
public static final int secondary_text_default_material_light = 0x7f040051;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f05004e;
public static final int compat_button_inset_vertical_material = 0x7f05004f;
public static final int compat_button_padding_horizontal_material = 0x7f050050;
public static final int compat_button_padding_vertical_material = 0x7f050051;
public static final int compat_control_corner_material = 0x7f050052;
public static final int compat_notification_large_icon_max_height = 0x7f050053;
public static final int compat_notification_large_icon_max_width = 0x7f050054;
public static final int notification_action_icon_size = 0x7f05005e;
public static final int notification_action_text_size = 0x7f05005f;
public static final int notification_big_circle_margin = 0x7f050060;
public static final int notification_content_margin_start = 0x7f050061;
public static final int notification_large_icon_height = 0x7f050062;
public static final int notification_large_icon_width = 0x7f050063;
public static final int notification_main_column_padding_top = 0x7f050064;
public static final int notification_media_narrow_margin = 0x7f050065;
public static final int notification_right_icon_size = 0x7f050066;
public static final int notification_right_side_padding_top = 0x7f050067;
public static final int notification_small_icon_background_padding = 0x7f050068;
public static final int notification_small_icon_size_as_large = 0x7f050069;
public static final int notification_subtext_size = 0x7f05006a;
public static final int notification_top_pad = 0x7f05006b;
public static final int notification_top_pad_large_text = 0x7f05006c;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f060058;
public static final int notification_bg = 0x7f060059;
public static final int notification_bg_low = 0x7f06005a;
public static final int notification_bg_low_normal = 0x7f06005b;
public static final int notification_bg_low_pressed = 0x7f06005c;
public static final int notification_bg_normal = 0x7f06005d;
public static final int notification_bg_normal_pressed = 0x7f06005e;
public static final int notification_icon_background = 0x7f06005f;
public static final int notification_template_icon_bg = 0x7f060060;
public static final int notification_template_icon_low_bg = 0x7f060061;
public static final int notification_tile_bg = 0x7f060062;
public static final int notify_panel_notification_icon_bg = 0x7f060063;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f07000d;
public static final int action_divider = 0x7f07000f;
public static final int action_image = 0x7f070010;
public static final int action_text = 0x7f070016;
public static final int actions = 0x7f070017;
public static final int async = 0x7f07002c;
public static final int blocking = 0x7f07002f;
public static final int chronometer = 0x7f070038;
public static final int forever = 0x7f070051;
public static final int icon = 0x7f070057;
public static final int icon_group = 0x7f070058;
public static final int info = 0x7f07005b;
public static final int italic = 0x7f07005d;
public static final int line1 = 0x7f07005f;
public static final int line3 = 0x7f070060;
public static final int normal = 0x7f070068;
public static final int notification_background = 0x7f070069;
public static final int notification_main_column = 0x7f07006a;
public static final int notification_main_column_container = 0x7f07006b;
public static final int right_icon = 0x7f070074;
public static final int right_side = 0x7f070075;
public static final int tag_transition_group = 0x7f070098;
public static final int tag_unhandled_key_event_manager = 0x7f070099;
public static final int tag_unhandled_key_listeners = 0x7f07009a;
public static final int text = 0x7f07009b;
public static final int text2 = 0x7f07009c;
public static final int time = 0x7f07009f;
public static final int title = 0x7f0700a0;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f080004;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f090021;
public static final int notification_action_tombstone = 0x7f090022;
public static final int notification_template_custom_big = 0x7f090023;
public static final int notification_template_icon_group = 0x7f090024;
public static final int notification_template_part_chronometer = 0x7f090025;
public static final int notification_template_part_time = 0x7f090026;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0c002d;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0d00f0;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0d00f1;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0d00f2;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0d00f3;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0d00f4;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0d015c;
public static final int Widget_Compat_NotificationActionText = 0x7f0d015d;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f020088, 0x7f020089, 0x7f02008a, 0x7f02008b, 0x7f02008c, 0x7f02008d };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f020086, 0x7f02008e, 0x7f02008f, 0x7f020090, 0x7f020148 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"gowthamreddy547@gmail.com"
] | gowthamreddy547@gmail.com |
b04bc1e884018871f79c92f9616514e1ea2ed5d7 | 256493de97a1d21b3bb8800cb18ae743c617d386 | /QuizzUp2/app/src/main/java/com/example/swarangigaurkar/quizzup/TutorialList.java | 7e1b156bf0f53a47bbe8e026e8a7c985417bdb0d | [] | no_license | Swarangigaurkar/QuizApp | 42c3427e432aab4b3950669bee5fb9bbd48562d6 | 0b88e0550d0d8e107598487f7bb359844f01db07 | refs/heads/main | 2023-01-29T16:05:37.976503 | 2020-12-10T17:03:33 | 2020-12-10T17:03:33 | 315,609,629 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 371 | java | package com.example.swarangigaurkar.quizzup;
public class TutorialList {
private String title;
private String link;
public TutorialList( String title, String link) {
this.title = title;
this.link = link;
}
public String getTitle() {
return title;
}
public String getLink() {
return link;
}
}
| [
"49075539+Swarangigaurkar@users.noreply.github.com"
] | 49075539+Swarangigaurkar@users.noreply.github.com |
149168ff47092999e1ffeb514084c088e9c003f0 | 49689a1441e16baaca327a0582699c96b6749ade | /app/src/main/java/mc/apps/demo0/TechnicianActivity.java | d5f24483a985976aa1a8ea09682fd0f30ce7dbd7 | [] | no_license | mc-source/TechInterv | e120ee96594521fcd3ee0bd466a0eb7b538021d4 | 73e6a6a8f8bdc63eb300bcab4c2429e456956925 | refs/heads/master | 2023-03-31T18:11:26.553663 | 2021-02-20T22:52:12 | 2021-02-20T22:52:12 | 355,581,961 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,905 | java | package mc.apps.demo0;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.ViewModelProvider;
import android.app.DatePickerDialog;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import java.util.Calendar;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import mc.apps.demo0.dao.GpsDao;
import mc.apps.demo0.dao.MessageDao;
import mc.apps.demo0.libs.GPSTracker;
import mc.apps.demo0.libs.MyTools;
import mc.apps.demo0.libs.UploadFileAsync;
import mc.apps.demo0.model.GpsPosition;
import mc.apps.demo0.model.Intervention;
import mc.apps.demo0.model.Message;
import mc.apps.demo0.model.User;
import mc.apps.demo0.ui.technician.TechnicianFragment;
import mc.apps.demo0.ui.technician.TechnicianFragments;
import mc.apps.demo0.viewmodels.MainViewModel;
public class TechnicianActivity extends AppCompatActivity implements DatePickerDialog.OnDateSetListener, TimePickerDialog.OnTimeSetListener{
private static final int RESULT_LOAD_IMAGE = 2608 ;
private static final int TECH_INTERV_CODE = 1000;
private static final int CLIENT_INTERV_CODE = 2000;
private static final int RESULT_LOAD_SIGNATURE = 3000;
private static final String TAG = "tests";
private static final long GPS_REFRESH_MILLIS = 600000 ; // 10 min.
private static final long MSG_REFRESH_MILLIS = 300000 ; // 5 min.
private MainViewModel mainViewModel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.technician_activity);
if (savedInstanceState == null) {
defineFragment(TechnicianFragment.newInstance());
}
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setCustomView(R.layout.tech_toolbar_layout);
mainViewModel = new ViewModelProvider(this).get(MainViewModel.class);
mainViewModel.getNum().observe(
this,
num -> {
defineFragment(TechnicianFragments.newInstance(num));
}
);
checkPermissions();
createNotificationChannel();
registerReceiver(mReceiver, new IntentFilter(ACTION_UPDATE_NOTIFICATION));
doPeriodicWork();
}
private void checkPermissions() {
// gradle : + implementation "androidx.activity:activity:1.2.0-alpha04" //androidX
ActivityResultLauncher<String> requestPermissionLauncher =
registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> {
if (isGranted) {
Toast.makeText(this, "Permission is granted!", Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(this, "Permission not granted : feature is unavailable!", Toast.LENGTH_SHORT).show();
}
});
MyTools.CheckThenAskPermissions(TechnicianActivity.this, requestPermissionLauncher);
}
@Override
protected void onResume() {
super.onResume();
User user = MyTools.GetUserInSession();
((TextView)findViewById(R.id.title)).setText(""+user);
}
private void defineFragment(Fragment fragment) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.setCustomAnimations(R.anim.slide_in_up, R.anim.slide_out_up);
transaction.replace(R.id.container, fragment).commitNow();
}
@Override
public void onBackPressed() {
defineFragment(TechnicianFragment.newInstance());
}
public void setContent(View view){
int id= view.getId();
switch(id){
case R.id.tech_btn_interv:
defineFragment(TechnicianFragments.newInstance(0));
break;
case R.id.tech_btn_rapport:
defineFragment(TechnicianFragments.newInstance(1));
break;
case R.id.tech_btn_histo:
defineFragment(TechnicianFragments.newInstance(2));
break;
}
}
public void list_photos_click(View view){
//Sélectionner images dans Galery!
Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, RESULT_LOAD_IMAGE);
}
public void signature_view(View view){
Intent intent = new Intent(this, SignatureActivity.class);
startActivityForResult(intent, RESULT_LOAD_SIGNATURE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) {
Uri selectedImage = data.getData();
mainViewModel.addImage(selectedImage);
//new UploadFileAsync().execute(selectedImage.toString());
}
if (requestCode == TECH_INTERV_CODE && resultCode == RESULT_OK) {
mainViewModel.setRefresh(true);
if(null != data)
defineFragment(TechnicianFragments.newInstance(1, (Intervention) data.getSerializableExtra("interv")));
}
if (requestCode == CLIENT_INTERV_CODE && resultCode == RESULT_OK && null != data) {
Intervention item = (Intervention) data.getSerializableExtra("item_filter");
mainViewModel.setIntervention(item);
}
if (requestCode == RESULT_LOAD_SIGNATURE && resultCode == RESULT_OK && null != data) {
//Toast.makeText(this, "Result.. : "+data.getStringExtra("file"), Toast.LENGTH_SHORT).show();
Log.i(TAG, "onActivityResult mainViewModel.addSignatureImage(signatureImage) =>"+data.getStringExtra("file"));
try {
Uri signatureImage = Uri.parse(data.getStringExtra("file"));
mainViewModel.addSignatureImage(signatureImage);
}catch(Exception e){}
//new UploadFileAsync().execute(signatureImage.toString());
}
}
/**
* Menu
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_simple, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if(item.getItemId()==R.id.appSignOut){
MyTools.confirmLogout(this);
}
else if(item.getItemId()==R.id.appMsg){
startActivity(new Intent(this, MessagesActivity.class));
}
/* else if(item.getItemId()==R.id.appSettings){
startActivity(new Intent(this, SettingsActivity.class));
}*/
return true;
}
public void ClientIntervFilter(View view){
Intent intent = new Intent(this, InterventionsFilterActivity.class);
startActivityForResult(intent, CLIENT_INTERV_CODE);
}
/**
* Gestion calendrier
*/
EditText edtDateTime;
private int mYear, mMonth, mDay, mHour, mMinute;
public void selectCalendarDate(View view) {
this.fulldate=false;
SelectDate(view);
}
public void selectCalendarDateTime(View view) {
this.fulldate=true;
SelectDate(view);
}
private boolean fulldate=false;
private void SelectDate(View view) {
edtDateTime = (EditText) view;;
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
DatePickerDialog datePickerDialog = new DatePickerDialog(this, this, mYear, mMonth, mDay);
datePickerDialog.show();
}
int lastSelectedHour=0, lastSelectedMinute=0;
boolean is24HView = true;
public void selectCalendarTime(View view) {
edtDateTime = (EditText) view;;
TimePickerDialog.OnTimeSetListener timeSetListener = (view1, hourOfDay, minute) -> {
edtDateTime.setText(hourOfDay + ":" + minute );
lastSelectedHour = hourOfDay;
lastSelectedMinute = minute;
};
TimePickerDialog timePickerDialog = new TimePickerDialog(this, timeSetListener, lastSelectedHour, lastSelectedMinute, is24HView);
timePickerDialog.show();
}
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
mYear = year;
mDay = dayOfMonth;
mMonth = month;
Calendar c = Calendar.getInstance();
mHour = c.get(Calendar.HOUR);
mMinute = c.get(Calendar.MINUTE);
if(fulldate) {
TimePickerDialog timePickerDialog = new TimePickerDialog(this, this, mHour, mMinute, true);
timePickerDialog.show();
}else{
edtDateTime.setText(mDay + "-" + (mMonth + 1) + "-" + mYear);
}
}
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
mHour = hourOfDay;
mMinute = minute;
edtDateTime.setText(mDay + "-" + (mMonth + 1) + "-" + mYear+" "+mHour+":"+mMinute);
}
/**
* GPS Location Save
* Read Messages
*/
private void doPeriodicWork() {
handler1 = new Handler();
handler1.post(gpsRunnableCode);
getMessagesTask();
}
Handler handler1;
private Runnable gpsRunnableCode = new Runnable() {
@Override
public void run() {
Log.d(TAG, "Get Current Location..");
getCurrentLocation();
handler1.postDelayed(gpsRunnableCode, GPS_REFRESH_MILLIS);
}
};
Timer msgTimer;
private void getMessagesTask(){
msgTimer = new Timer();
msgTimer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
Log.i(TAG, "run: time task.."+MyTools.getCurrentTime());
getUnseenMessages();
}
}, 0, MSG_REFRESH_MILLIS);
}
private void getUnseenMessages() {
MessageDao dao = new MessageDao();
dao.find(MyTools.GetUserInSession().getCode(), (items, message)->{
Log.i(TAG, "getUnseenMessages: "+items.size());
if(items.size()>0) {
List<Message> messages = dao.Deserialize(items, Message.class);
sendNotification(messages);
}
});
}
/* private void addNotification(List<Message> msgs) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_send_msg)
.setContentTitle("Message!")
.setContentText("Vous avez "+msgs.size()+" message"+(msgs.size()>1?"s":"")+"!");
Intent notificationIntent = new Intent(this, MainActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(contentIntent);
// Add as notification
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(0, builder.build());
}
*/
@Override
protected void onDestroy() {
handler1.removeCallbacks(gpsRunnableCode);
Log.i(TAG, "Gps Tracker: Stop");
msgTimer.cancel();
Log.i(TAG, "MessageTimer: Cancel");
deleteLocation();
super.onDestroy();
}
private void deleteLocation() {
GpsDao dao = new GpsDao();
dao.delete(MyTools.GetUserInSession().getCode(), (i,m)->{});
}
GPSTracker gps;
private void getCurrentLocation() {
gps = new GPSTracker(this);
if(gps.canGetLocation()) {
double latitude = gps.getLatitude();
double longitude = gps.getLongitude();
//((TextView)root.findViewById(R.id.textLocation)).setText(latitude+"x"+longitude);
saveGps(latitude, longitude);
} else {
gps.showSettingsAlert();
}
}
GpsPosition gp;
private void saveGps(double latitude, double longitude) {
GpsDao dao = new GpsDao();
User user = MyTools.GetUserInSession();
dao.find(user.getCode(), (items, message) -> {
List<GpsPosition> positions_ = dao.Deserialize(items, GpsPosition.class);
if(positions_.size()>0){
gp = positions_.get(0);
gp.setLatitude(latitude);
gp.setLongitude(longitude);
dao.update(gp, (items_, message_) -> {
Log.i(TAG, "gps updated : "+user.getCode()+" => "+latitude+"x"+longitude);
});
}else{
gp = new GpsPosition(0,latitude, longitude, user.getCode());
dao.add(gp, (items_, message_) -> {
Log.i(TAG, "gps added : "+user.getCode()+" => "+latitude+"x"+longitude);
});
}
});
}
/**
* Notifications!
*/
private static final String ACTION_UPDATE_NOTIFICATION = "mc.apps.demo0.ACTION_UPDATE_NOTIFICATION";
private static final String PRIMARY_CHANNEL_ID = "primary_notification_channel";
private static final int NOTIFICATION_ID = 0;
private NotificationManager mNotifyManager;
private NotificationReceiver mReceiver = new NotificationReceiver();
public void sendNotification(List<Message> messages) {
/*
Intent updateIntent = new Intent(ACTION_UPDATE_NOTIFICATION);
PendingIntent updatePendingIntent = PendingIntent.getBroadcast(this, NOTIFICATION_ID, updateIntent, PendingIntent.FLAG_ONE_SHOT);
*/
StringBuilder sb= new StringBuilder();
for (Message message : messages){
sb.append(message.getFromUser()+" : "+message.getMessage()+"\n");
}
Log.i(TAG, "sendNotification: "+sb.toString());
NotificationCompat.Builder notifyBuilder = getNotificationBuilder("Nouveau(x) Message(s)", sb.toString());
//notifyBuilder.addAction(R.drawable.ic_send_msg, "Read", updatePendingIntent);
mNotifyManager.notify(NOTIFICATION_ID, notifyBuilder.build());
}
public void updateNotification() {
/* Bitmap androidImage = BitmapFactory.decodeResource(getResources(), R.drawable.ic_app_logo_red);
NotificationCompat.Builder notifyBuilder = getNotificationBuilder("Message(s)!","lorem ipsum bla bla!!");
notifyBuilder.setStyle(new NotificationCompat.BigPictureStyle()
.bigPicture(androidImage)
.setBigContentTitle("updated.."));
mNotifyManager.notify(NOTIFICATION_ID, notifyBuilder.build());*/
// Disable the update button, leaving only the cancel button enabled.
// setNotificationButtonState(false, false, true);
}
private NotificationCompat.Builder getNotificationBuilder(String title, String notification_text) {
Intent notificationIntent = new Intent(this, MessagesActivity.class);
PendingIntent notificationPendingIntent = PendingIntent.getActivity(this, NOTIFICATION_ID, notificationIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder notifyBuilder = new NotificationCompat
.Builder(this, PRIMARY_CHANNEL_ID)
.setContentTitle(title)
.setContentText(notification_text)
.setSmallIcon(R.drawable.ic_send_msg)
.setAutoCancel(true)
.setContentIntent(notificationPendingIntent)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setDefaults(NotificationCompat.DEFAULT_ALL);
return notifyBuilder;
}
public void createNotificationChannel() {
mNotifyManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
NotificationChannel notificationChannel = new NotificationChannel(
PRIMARY_CHANNEL_ID,
"notification_channel_name",
NotificationManager.IMPORTANCE_HIGH
);
notificationChannel.enableLights(true);
notificationChannel.setLightColor(Color.RED);
notificationChannel.enableVibration(false);
notificationChannel.setDescription("notification_channel_description");
mNotifyManager.createNotificationChannel(notificationChannel);
}
}
public class NotificationReceiver extends BroadcastReceiver {
public NotificationReceiver() {
}
@Override
public void onReceive(Context context, Intent intent) {
updateNotification();
}
}
} | [
"mc69.dashboard@gmail.com"
] | mc69.dashboard@gmail.com |
e3cdf27b8b5799088124e9955bb4b315f4947e73 | 1074c97cdd65d38c8c6ec73bfa40fb9303337468 | /rda0105-agl-aus-java-a43926f304e3/xms-dto/src/main/java/com/gms/xms/dto/email/EmailAddressInfoVo.java | 980a81d2eac1252aaaf405040139d83ecf1d2f3f | [] | no_license | gahlawat4u/repoName | 0361859254766c371068e31ff7be94025c3e5ca8 | 523cf7d30018b7783e90db98e386245edad34cae | refs/heads/master | 2020-05-17T01:26:00.968575 | 2019-04-29T06:11:52 | 2019-04-29T06:11:52 | 183,420,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,323 | java | package com.gms.xms.dto.email;
import com.gms.xms.txndb.vo.BaseVo;
/**
* Posted from Jul 26, 2016 2:36:42 PM
* <p>
* Author dattrinh
*/
public class EmailAddressInfoVo extends BaseVo {
private static final long serialVersionUID = 1L;
private String customerCode;
private String customerName;
private String email;
private String phone;
private String franchiseCode;
private String franchiseName;
private String franchiseEmail;
private String franchisePhone;
public String getCustomerCode() {
return customerCode;
}
public void setCustomerCode(String customerCode) {
this.customerCode = customerCode;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getFranchiseCode() {
return franchiseCode;
}
public void setFranchiseCode(String franchiseCode) {
this.franchiseCode = franchiseCode;
}
public String getFranchiseName() {
return franchiseName;
}
public void setFranchiseName(String franchiseName) {
this.franchiseName = franchiseName;
}
public String getFranchiseEmail() {
return franchiseEmail;
}
public void setFranchiseEmail(String franchiseEmail) {
this.franchiseEmail = franchiseEmail;
}
public String getFranchisePhone() {
return franchisePhone;
}
public void setFranchisePhone(String franchisePhone) {
this.franchisePhone = franchisePhone;
}
@Override
public String toString() {
return "EmailAddressInfoVo [customerCode=" + customerCode + ", customerName=" + customerName + ", email=" + email + ", phone=" + phone + ", franchiseCode=" + franchiseCode + ", franchiseName=" + franchiseName + ", franchiseEmail=" + franchiseEmail + ", franchisePhone=" + franchisePhone + "]";
}
}
| [
"sachin.gahlawat19@gmail.com"
] | sachin.gahlawat19@gmail.com |
37dd1e530e70d4fe64816e314e736e32c131c1a8 | 725f8b1909d16d5fcd4de8a28aebe21b89c90f01 | /illaclient/src/main/java/illarion/client/net/server/DialogMerchantMsg.java | 28edfc9ee890a9e103b9e47322563603fc9e7dd8 | [] | no_license | stephan92/Illarion-Java | a0461838a48bb9d94d1a0aeb163fed58e7fd41c2 | b9d73ccebe182f89e18af0e50673b1e870d1550f | refs/heads/master | 2021-01-17T15:49:53.402750 | 2014-10-01T18:32:32 | 2014-10-01T18:32:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,943 | java | /*
* This file is part of the Illarion project.
*
* Copyright © 2014 - Illarion e.V.
*
* Illarion is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Illarion 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.
*/
package illarion.client.net.server;
import illarion.client.net.CommandList;
import illarion.client.net.annotations.ReplyMessage;
import illarion.client.net.server.events.DialogMerchantReceivedEvent;
import illarion.client.world.items.MerchantItem;
import illarion.common.net.NetCommReader;
import illarion.common.types.ItemCount;
import illarion.common.types.ItemId;
import javolution.text.TextBuilder;
import org.bushe.swing.event.EventBus;
import javax.annotation.Nonnull;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* This server message is used to make the client showing a merchant dialog.
*
* @author Martin Karing <nitram@illarion.org>
*/
@ReplyMessage(replyId = CommandList.MSG_DIALOG_MERCHANT)
public final class DialogMerchantMsg extends AbstractGuiMsg {
/**
* The title of the dialog window.
*/
private String title;
/**
* The ID of the dialog that needs to be returned in order to inform the server that the window was closed.
*/
private int dialogId;
/**
* The items that were received from the server.
*/
private List<MerchantItem> items;
@Override
public void decode(@Nonnull NetCommReader reader) throws IOException {
title = reader.readString();
items = new ArrayList<>();
int entriesSell = reader.readUByte();
for (int i = 0; i < entriesSell; i++) {
ItemId itemId = new ItemId(reader);
String name = reader.readString();
long itemValue = reader.readUInt();
ItemCount bundleSize = ItemCount.getInstance(reader);
items.add(new MerchantItem(i, MerchantItem.MerchantItemType.SellingItem, itemId, name, itemValue,
bundleSize));
}
int entriesBuyPrimary = reader.readUByte();
for (int i = 0; i < entriesBuyPrimary; i++) {
ItemId itemId = new ItemId(reader);
String name = reader.readString();
long itemValue = reader.readUInt();
items.add(new MerchantItem(i, MerchantItem.MerchantItemType.BuyingPrimaryItem, itemId, name, itemValue));
}
int entriesBuySecondary = reader.readUByte();
for (int i = 0; i < entriesBuySecondary; i++) {
ItemId itemId = new ItemId(reader);
String name = reader.readString();
long itemValue = reader.readUInt();
items.add(new MerchantItem(i, MerchantItem.MerchantItemType.BuyingSecondaryItem, itemId, name, itemValue));
}
dialogId = reader.readInt();
}
@Override
public boolean executeUpdate() {
if (items == null) {
throw new IllegalStateException("Can't execute update before it was decoded.");
}
MerchantItem[] itemArray = new MerchantItem[items.size()];
EventBus.publish(new DialogMerchantReceivedEvent(dialogId, title, items.toArray(itemArray)));
return true;
}
@Nonnull
@Override
public String toString() {
TextBuilder builder = new TextBuilder();
builder.append("title: \"").append(title).append("\", ");
builder.append("items: \"").append(items.size()).append("\", ");
builder.append("dialog ID: ").append(dialogId);
return toString(builder.toString());
}
}
| [
"nitram@illarion.org"
] | nitram@illarion.org |
8df4b5852f428903f16e3a8469b23bba46eaaf85 | 17927341fc513377ef1bd3c01008014d0ee2b35d | /approvalsDocPlugin/src/test/java/ApprovalFileTest.java | 10a26d4251c1a285a21a862e62b1bca5fe785eb4 | [
"MIT"
] | permissive | sfauvel/documentationtesting | 4e41bd4c3ccea2c0e408f87850b37d05d82da865 | 38e9dcdad44194fc42a1bd726ef00db1c1da1a9d | refs/heads/master | 2022-11-26T10:13:33.862905 | 2022-11-10T23:06:59 | 2022-11-10T23:06:59 | 221,307,781 | 19 | 2 | MIT | 2021-02-19T08:09:43 | 2019-11-12T20:40:34 | Java | UTF-8 | Java | false | false | 9,122 | java | import docAsTest.approvalFile.ApprovalFile;
import docAsTest.approvalFile.ApprovedFile;
import org.junit.Test;
import java.nio.file.Paths;
import static org.junit.Assert.*;
public class ApprovalFileTest {
@Test
public void create_approval_java_file_from_java_class() throws NoSuchMethodException {
ApprovalFile filename = ApprovalFile.fromClass("org.demo", "DemoTest");
assertEquals("org/demo/DemoTest.java", filename.getName());
assertEquals("DemoTest.java", filename.getFileName());
}
@Test
public void create_approval_java_file_from_java_method_with_string() throws NoSuchMethodException {
ApprovalFile filename = ApprovalFile.fromMethod("org.demo", "DemoTest", "a_simple_test");
assertEquals("org/demo/DemoTest.java", filename.getName());
assertEquals("DemoTest.java", filename.getFileName());
}
@Test
public void create_approval_java_file_from_java_class_without_package() throws NoSuchMethodException {
ApprovalFile filename = ApprovalFile.fromClass("", "DemoTest");
assertEquals("DemoTest.java", filename.getName());
}
@Test
public void create_approval_java_file_from_java_inner_class_without_package() throws NoSuchMethodException {
ApprovalFile filename = ApprovalFile.fromClass("", "DemoTest.InnerClass");
assertEquals("DemoTest.java", filename.getFileName());
assertEquals("DemoTest.java", filename.getName());
}
@Test
public void convert_from_java_to_approved() throws NoSuchMethodException {
ApprovalFile filename = ApprovalFile.fromMethod("org.demo", "DemoTest", "a_simple_test");
final ApprovalFile approvedFile = filename.to(ApprovalFile.Status.APPROVED);
assertEquals("org/demo/_DemoTest.a_simple_test.approved.adoc", approvedFile.getName());
assertEquals("_DemoTest.a_simple_test.approved.adoc", approvedFile.getFileName());
}
@Test
public void open_test_file_from_java_class_without_package() throws NoSuchMethodException {
ApprovalFile filename = ApprovalFile.fromClass("", "DemoTest");
assertEquals("_DemoTest.received.adoc", filename.to(ApprovalFile.Status.RECEIVED).getName());
}
@Test
public void get_received_file_from_java_method_with_string() throws NoSuchMethodException {
ApprovalFile filename = ApprovalFile.fromMethod("org.demo", "DemoTest", "a_simple_test");
assertEquals("org/demo/_DemoTest.a_simple_test.received.adoc", filename.to(ApprovalFile.Status.RECEIVED).getName());
assertEquals("_DemoTest.a_simple_test.received.adoc", filename.to(ApprovalFile.Status.RECEIVED).getFileName());
}
@Test
public void get_approved_file_from_java_method_with_string() throws NoSuchMethodException {
ApprovalFile filename = ApprovalFile.fromMethod("org.demo", "DemoTest", "a_simple_test");
assertEquals("org/demo/_DemoTest.a_simple_test.approved.adoc", filename.to(ApprovalFile.Status.APPROVED).getName());
}
@Test
public void get_approved_file_from_java_method_without_package() throws NoSuchMethodException {
ApprovalFile filename = ApprovalFile.fromMethod("", "DemoTest", "a_simple_test");
assertEquals("_DemoTest.a_simple_test.approved.adoc", filename.to(ApprovalFile.Status.APPROVED).getName());
}
@Test
public void open_test_file() {
ApprovalFile filename = ApprovalFile.valueOf("_Test.received.adoc").get();
assertEquals("Test.java", filename.getTestFile());
}
@Test
public void open_test_file_with_path() {
ApprovalFile filename = ApprovalFile.valueOf("org/demo/_Test.received.adoc").get();
assertEquals("org/demo/Test.java", filename.getTestFile());
}
@Test
public void open_test_file_with_path_and_underscore() {
ApprovalFile filename = ApprovalFile.valueOf("org/demo/_Test_Underscore.received.adoc").get();
assertEquals("org/demo/Test_Underscore.java", filename.getTestFile());
}
@Test
public void open_test_file_with_path_and_method() {
ApprovalFile filename = ApprovalFile.valueOf("org/demo/_Test.mytestcase.received.adoc").get();
assertEquals("org/demo/Test.java", filename.getTestFile());
}
@Test
public void value_of_a_received_file() {
ApprovalFile filename = ApprovalFile.valueOf("_test.received.adoc").get();
assertTrue(filename.isReceived());
assertFalse(filename.isApproved());
assertEquals("_test.received.adoc", filename.getName());
}
@Test
public void build_a_received_file() {
ApprovalFile filename = new ApprovedFile("test", ApprovalFile.Status.RECEIVED);
assertTrue(filename.isReceived());
assertFalse(filename.isApproved());
assertEquals("_test.received.adoc", filename.getName());
}
@Test
public void value_of_an_approved_file() {
ApprovalFile filename = ApprovalFile.valueOf("_test.approved.adoc").get();
assertFalse(filename.isReceived());
assertTrue(filename.isApproved());
assertEquals("_test.approved.adoc", filename.getName());
}
@Test
public void build_an_approved_file() {
ApprovalFile filename = new ApprovedFile("test", ApprovalFile.Status.APPROVED);
assertFalse(filename.isReceived());
assertTrue(filename.isApproved());
assertEquals("_test.approved.adoc", filename.getName());
}
@Test
public void value_of_an_approved_file_with_dot_in_name() {
ApprovalFile filename = ApprovalFile.valueOf("_test.multi.part.approved.adoc").get();
assertFalse(filename.isReceived());
assertTrue(filename.isApproved());
assertEquals("_test.multi.part.approved.adoc", filename.getName());
}
@Test
public void valueOf_an_invalid_filename_should_return_empty() {
final String NO_APPROVED_KEYWORD = "_test.adoc";
assertFalse(ApprovalFile.valueOf(NO_APPROVED_KEYWORD).isPresent());
final String NO_UNDERSCORE = "test.approved.adoc";
assertFalse(ApprovalFile.valueOf(NO_UNDERSCORE).isPresent());
final String INVALID_APPROVED_KEYWORD = "test.invalid.adoc";
assertFalse(ApprovalFile.valueOf(INVALID_APPROVED_KEYWORD).isPresent());
}
@Test
public void approve_a_received_file() {
ApprovalFile filename = ApprovalFile.valueOf("_test.received.adoc").get().to(ApprovalFile.Status.APPROVED);
assertFalse(filename.isReceived());
assertTrue(filename.isApproved());
assertEquals("_test.approved.adoc", filename.getName());
}
@Test
public void approve_a_received_file_with_multi_parts_name() {
ApprovalFile filename = ApprovalFile.valueOf("_test.file.multi_part.received.adoc").get().to(ApprovalFile.Status.APPROVED);
assertFalse(filename.isReceived());
assertTrue(filename.isApproved());
assertEquals("_test.file.multi_part.approved.adoc", filename.getName());
}
@Test
public void extract_class_from_received_file() {
ApprovalFile approvalFile = ApprovalFile.valueOf("_MyClass.received.adoc").get();
assertEquals("MyClass", approvalFile.getClassName());
}
@Test
public void extract_package_from_received_file() {
ApprovalFile approvalFile = ApprovalFile.valueOf("org/demo/_MyClass.received.adoc").get();
assertEquals("MyClass", approvalFile.getClassName());
assertEquals(Paths.get("org", "demo"), approvalFile.getPath());
}
@Test
public void extract_method_from_received_file() {
ApprovalFile approvalFile = ApprovalFile.valueOf("_MyClass.test_method.received.adoc").get();
assertEquals("MyClass", approvalFile.getClassName());
assertEquals("test_method", approvalFile.getMethodName());
}
@Test
public void extract_method_from_received_file_and_transform_to_java() {
ApprovalFile approvalFile = ApprovalFile.valueOf("_MyClass.test_method.received.adoc").get().toJava();
assertEquals("MyClass", approvalFile.getClassName());
assertEquals("test_method", approvalFile.getMethodName());
}
@Test
public void extract_class_from_received_file_with_multi_parts_name() {
ApprovalFile filename = ApprovalFile.valueOf("_test.file.multi_part.myMethod.received.adoc").get();
assertEquals("test.file.multi_part", filename.getClassName());
}
@Test
public void extract_class_from_java_file_with_multi_parts_name_from_received() {
ApprovalFile filename = ApprovalFile.valueOf("_test.file.multi_part.myMethod.received.adoc").get().toJava();
assertEquals("test.file.multi_part", filename.getClassName());
}
private void assertThrow(Class<? extends Exception> expectedException, Runnable function) {
try {
function.run();
} catch (Exception e) {
if (expectedException.isAssignableFrom(e.getClass())) {
return;
}
throw e;
}
fail("No exception was thrown, " + expectedException.getName() + " expected");
}
} | [
"sfauvel@gmail.com"
] | sfauvel@gmail.com |
ad4a92e0839c52c141a78a2e6e05e8373dc7beee | 918c139372b524f48c357590f0cc3a687f1c988a | /app/src/main/java/com/example/bagrutTel/notifications/Sender.java | 610e7a2e2c641806d07e54e8e695fdd9c99bfd3b | [] | no_license | suzieSayegh123/BagruTel | b68edbd410a9a0eb56e2ddaab9b7e8b2a03eaca9 | df94bba6a1160cf3273591096127fdea9b0c0e2c | refs/heads/master | 2022-07-12T10:22:38.086627 | 2020-05-10T11:50:33 | 2020-05-10T11:50:33 | 262,764,413 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 486 | java | package com.example.bagrutTel.notifications;
public class Sender {
private Data data;
private String to;
public Sender() {
}
public Sender(Data data, String to) {
this.data = data;
this.to = to;
}
public Data getData() {
return data;
}
public void setData(Data data) {
this.data = data;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
}
| [
"suziesayegh123@gmail.com"
] | suziesayegh123@gmail.com |
30e84a1d012f00e1d9b02e39517c601d4976feed | 7852965856eb8dccc839cae9ba444dd1403f4196 | /src/main/java/net/pterodactylus/util/thread/NamedThreadFactory.java | a3e04874c6546a275080d3eb16de5860bef49031 | [] | no_license | Bombe/utils | 736ea9705cddbdd87813405e3b457d4232340241 | 34bdf5715414d1e69176e9e8044059849335dcc7 | refs/heads/master | 2021-01-19T01:10:38.194616 | 2019-11-29T09:04:11 | 2019-11-29T09:04:11 | 384,957 | 4 | 9 | null | 2020-10-13T09:51:36 | 2009-11-25T08:19:10 | Java | UTF-8 | Java | false | false | 2,584 | java | /*
* utils - NamedThreadFactory.java - Copyright © 2006–2019 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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 net.pterodactylus.util.thread;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
/**
* {@link ThreadFactory} implementation that creates threads with a configurable name.
* <br>
* The {@code nameFormat} parameter handed in to the
* {@link #NamedThreadFactory(String) constructor} will be used as a pattern
* for {@link String#format(String, Object...)}. The number of the thread
* factory and the number of the created thread are handed in as parameters to
* {@link String#format(String, Object...)}; the number of the thread factory
* is an {@code int}, the number of the thread is a {@link long}.
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class NamedThreadFactory implements ThreadFactory {
/** The counter for all named thread factories. */
private static final AtomicInteger threadFactoryCounter = new AtomicInteger();
/** The number of the current thread factory. */
private final int threadFactoryNumber;
/** The counter for created threads. */
private final AtomicLong threadCounter = new AtomicLong();
/** The name format. */
private final String nameFormat;
/**
* Creates a new named thread factory with the given name format.
*
* @param nameFormat
* The name format
*/
public NamedThreadFactory(String nameFormat) {
threadFactoryNumber = threadFactoryCounter.getAndIncrement();
this.nameFormat = nameFormat;
}
//
// THREADFACTORY METHODS
//
/**
* {@inheritDoc}
*/
@Override
public Thread newThread(Runnable runnable) {
return new Thread(runnable, String.format(nameFormat, threadFactoryNumber, threadCounter.getAndIncrement()));
}
}
| [
"bombe@pterodactylus.net"
] | bombe@pterodactylus.net |
0c3c466b5a4a50bff30209f178d91de25844bfc5 | f4cfc15089ab5f97ea0cdcac81ee2ae7f14231d9 | /home-screen/src/main/java/com/indiatoday/test/project/homescreen/entity/Astro.java | 95aaacab48a75d395c67753b392b904247e7add0 | [] | no_license | anushrut/india-today-assignment | 86bcb780c8873e62742f3196ef40b2b0244886ff | 0668356034c064dba654e33e57ba3b25107bfb0f | refs/heads/main | 2023-07-31T05:55:03.012703 | 2021-10-09T17:43:19 | 2021-10-09T17:43:19 | 415,377,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,350 | java | package com.indiatoday.test.project.homescreen.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "astro")
public class Astro {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name = "url_slug")
private String urlSlug;
@Column(name = "name_prefix")
private String namePrefix;
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Column(name = "about_me")
private String aboutMe;
@Column(name = "proflie_pic_url")
private String profliePicUrl;
@Column(name = "experience")
private Double experience;
@Column(name = "is_on_call")
private Boolean isOnCall;
@Column(name = "minimum_call_duration")
private Integer minimumCallDuration;
@Column(name = "minimum_call_duration_charges")
private Double minimumCallDurationCharges;
@Column(name = "additional_per_minute_charges")
private double additionalPerMinuteCharges;
@Column(name = "is_available")
private boolean isAvailable;
@Column(name = "rating")
private Integer rating;
}
| [
"anushrutrai28@gmail.com"
] | anushrutrai28@gmail.com |
e4ccaf237ab5b1b45e93f5eb695e343682042228 | 905012900a5500967f7ff5cad46a7980a4689256 | /src/ModSharpnet/Recipes/RecipesTiles.java | 26cb7014626e47f56989cb7dc40cd3ae69ac3ba0 | [] | no_license | Sharpik/SharpnetMod_1.6.4 | d42effaecc7973b7dcd36f987d47e2f346c87cf2 | 56716d9f1f2aa1955bdf118b7aa3dfb6bb548005 | refs/heads/master | 2020-06-02T04:17:34.088525 | 2019-04-21T20:10:01 | 2019-04-21T20:10:01 | 28,051,365 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,698 | java | package ModSharpnet.Recipes;
import ModSharpnet.Blocks;
import ModSharpnet.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.block.Block;
import cpw.mods.fml.common.registry.GameRegistry;
import static ModSharpnet.ModSharpnet.SharpnetTilesBlocks1;
import static ModSharpnet.ModSharpnet.SharpnetTilesBlocks2;
import static ModSharpnet.ModSharpnet.SharpnetTilesSlabBlocks1;
import static ModSharpnet.ModSharpnet.SharpnetTilesSlabBlocks2;
import static ModSharpnet.ModSharpnet.SharpnetTilesSlabBlocks3;
public class RecipesTiles
{
public static void register()
{
//Recipe Tile
GameRegistry.addShapelessRecipe(new ItemStack(Items.tile_brown,2,0), new ItemStack(Item.brick,1,0));
//Recipe Tile Black
GameRegistry.addRecipe(new ItemStack(Items.tile_black,8,0), new Object[]
{
"TTT",
"TCT",
"TTT",
'T', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Item.dyePowder,1,0)
});
GameRegistry.addRecipe(new ItemStack(Items.tile_black,8,0), new Object[]
{
"TTT",
"TCT",
"TTT",
'T', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Item.dyePowder,1,0)
});
GameRegistry.addRecipe(new ItemStack(Items.tile_red,8,0), new Object[]
{
"TTT",
"TCT",
"TTT",
'T', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Item.dyePowder,1,1)
});
GameRegistry.addRecipe(new ItemStack(Items.tile_green,8,0), new Object[]
{
"TTT",
"TCT",
"TTT",
'T', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Item.dyePowder,1,2)
});
GameRegistry.addRecipe(new ItemStack(Items.tile_blue,8,0), new Object[]
{
"TTT",
"TCT",
"TTT",
'T', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Item.dyePowder,1,4)
});
GameRegistry.addRecipe(new ItemStack(Items.tile_grey,8,0), new Object[]
{
"TTT",
"TCT",
"TTT",
'T', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Item.dyePowder,1,8)
});
GameRegistry.addRecipe(new ItemStack(Items.tile_orange,8,0), new Object[]
{
"TTT",
"TCT",
"TTT",
'T', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Item.dyePowder,1,14)
});
GameRegistry.addRecipe(new ItemStack(Items.tile_white,8,0), new Object[]
{
"TTT",
"TCT",
"TTT",
'T', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Item.dyePowder,1,15)
});
GameRegistry.addRecipe(new ItemStack(Items.tile_yellow,8,0), new Object[]
{
"TTT",
"TCT",
"TTT",
'T', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Item.dyePowder,1,11)
});
//Recipe Tiles Blocks
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,1,0), new Object[]
{
"TT",
"TT",
'T', new ItemStack(Items.tile_brown,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,1,1), new Object[]
{
"AB",
"BA",
'A', new ItemStack(Items.tile_grey,1,0), 'B', new ItemStack(Items.tile_blue,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,1,2), new Object[]
{
"AB",
"BA",
'A', new ItemStack(Items.tile_red,1,0), 'B', new ItemStack(Items.tile_grey,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,1,3), new Object[]
{
"AB",
"BA",
'A', new ItemStack(Items.tile_black,1,0), 'B', new ItemStack(Items.tile_white,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,2,4), new Object[]
{
"ABA",
"BAB",
"ABA",
'A', new ItemStack(Items.tile_yellow,1,0), 'B', new ItemStack(Items.tile_white,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,2,5), new Object[]
{
"AAA",
"BBB",
"AAA",
'A', new ItemStack(Items.tile_brown,1,0), 'B', new ItemStack(Items.tile_yellow,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,1,6), new Object[]
{
"AB",
"BB",
'A', new ItemStack(Items.tile_brown,1,0), 'B', new ItemStack(Items.tile_white,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,2,7), new Object[]
{
"AAA",
"ABA",
"AAA",
'A', new ItemStack(Items.tile_white,1,0), 'B', new ItemStack(Items.tile_yellow,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,2,8), new Object[]
{
"ABB",
"BBB",
"BBA",
'A', new ItemStack(Items.tile_brown,1,0), 'B', new ItemStack(Items.tile_orange,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,2,9), new Object[]
{
"AAB",
"BCB",
"DAC",
'A', new ItemStack(Items.tile_blue,1,0), 'B', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Items.tile_grey,1,0), 'D', new ItemStack(Items.tile_black,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,1,10), new Object[]
{
"AA",
"AA",
'A', new ItemStack(Items.tile_white,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,1,11), new Object[]
{
"AB",
"AA",
'A', new ItemStack(Items.tile_green,1,0), 'B', new ItemStack(Items.tile_blue,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,1,12), new Object[]
{
"AB",
"AA",
'A', new ItemStack(Items.tile_grey,1,0), 'B', new ItemStack(Items.tile_red,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,1,13), new Object[]
{
"AB",
"CC",
'A', new ItemStack(Items.tile_red,1,0), 'B', new ItemStack(Items.tile_orange,1,0), 'C', new ItemStack(Items.tile_white,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,2,14), new Object[]
{
"ABA",
"BCB",
"ABA",
'A', new ItemStack(Items.tile_orange,1,0), 'B', new ItemStack(Items.tile_brown,1,0), 'C', new ItemStack(Items.tile_black,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesBlocks1,2,15), new Object[]
{
"BAB",
"CBC",
"BAB",
'A', new ItemStack(Items.tile_green,1,0), 'B', new ItemStack(Items.tile_red,1,0), 'C', new ItemStack(Items.tile_yellow,1,0)
});
//Recipes Tiles Blocks Slabs
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks1,4,0), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks1,4,1), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,1)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks1,4,2), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,2)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks1,4,3), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,3)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks1,4,4), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,4)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks1,4,5), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,5)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks1,4,6), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,6)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks1,4,7), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,7)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks2,4,0), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,8)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks2,4,1), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,9)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks2,4,2), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,10)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks2,4,3), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,11)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks2,4,4), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,12)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks2,4,5), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,13)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks2,4,6), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,14)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks2,4,7), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks1,1,15)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks3,4,0), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks2,1,0)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks3,4,1), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks2,1,1)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks3,4,2), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks2,1,2)
});
GameRegistry.addRecipe(new ItemStack(SharpnetTilesSlabBlocks3,4,3), new Object[]
{
"AA",
'A', new ItemStack(SharpnetTilesBlocks2,1,3)
});
//Stairs
GameRegistry.addRecipe(new ItemStack(Blocks.SharpnetStairsTile1,6,0), new Object[]
{
"A ",
"AA ",
"AAA",
'A', new ItemStack(SharpnetTilesBlocks1,1,0)
});
GameRegistry.addRecipe(new ItemStack(Blocks.SharpnetStairsTile5,6,0), new Object[]
{
"A ",
"AA ",
"AAA",
'A', new ItemStack(SharpnetTilesBlocks1,1,4)
});
GameRegistry.addRecipe(new ItemStack(Blocks.SharpnetStairsTile11,6,0), new Object[]
{
"A ",
"AA ",
"AAA",
'A', new ItemStack(SharpnetTilesBlocks1,1,10)
});
}
}
| [
"hack3@seznam.cz"
] | hack3@seznam.cz |
f1599ab5b0a74c3b102ad2c18d9e5dad335fd828 | 9839e5d8aee9d014ab7aada4a203379b947dd43f | /java/day0429/src/quiz/quiz09.java | f19a3374505b1c28762ba5ede9bd562b6ec5a30c | [] | no_license | Yooogh/Gongboo | a2acc589e90730d21dff9b60a8ef19dc7f9e3962 | 6838ec20fea81b0502c1642dee64607ff325011f | refs/heads/main | 2023-08-04T04:25:32.140295 | 2021-09-10T01:00:06 | 2021-09-10T01:00:06 | 378,591,441 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 738 | java | package quiz;
import java.util.Scanner;
public class quiz09 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
/*
* int jeon
*
* int gyo
*
* int il
*
* mim 140
*
* jeon>=70
* ((gyo>=30) && (il>=30)) || (gyo + il>=80))
*
*
* isu = jeon + gyo + 1l >= 140
*/
System.out.println("전공 이수 학점 : ");
int jeon = sc.nextInt();
System.out.println("교양 이수 학점 : ");
int gyo = sc.nextInt();
System.out.println("일반 이수 학점 : ");
int il = sc.nextInt();
if ((jeon + gyo + il > 140) && (jeon > 70) && (((gyo>=30) && (il>=30)) || (gyo + il>=80))) {
System.out.println("졸업 가능");
}
sc.close();
}
}
| [
"yoogh95@gmail.com"
] | yoogh95@gmail.com |
9f012b10fd726cd0276b51c1f81a58280566b9bb | 2c926ea3ceca0bd06f483599377cd193caf63e32 | /src/main/java/com/neurone/axon/models/Panier.java | 795a9e11762067a851a5072ca170d9bf17be4d66 | [] | no_license | anagonousourou/spring-rest-template | 6804c4e7bd2897b92861bbc796befafa86f3afbd | 3994cd355c94696b1c7937602f09dd851e532e3c | refs/heads/master | 2023-02-14T03:11:18.762082 | 2020-09-14T13:17:29 | 2020-09-14T13:17:29 | 295,400,169 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 956 | java | package com.neurone.axon.models;
import java.util.List;
import org.springframework.data.annotation.Id;
public class Panier {
@Id
private String id;
private String clientId;
private long createdAt;
private long lastModified;
private List<Commande> commandes;
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public long getCreatedAt() {
return createdAt;
}
public void setCreatedAt(long createdAt) {
this.createdAt = createdAt;
}
public long getLastModified() {
return lastModified;
}
public void setLastModified(long lastModified) {
this.lastModified = lastModified;
}
public List<Commande> getCommandes() {
return commandes;
}
public void setCommandes(List<Commande> commandes) {
this.commandes = commandes;
}
}
| [
"anagonousourou@gmail.com"
] | anagonousourou@gmail.com |
d372e924da38b5cbacb891b25279a3871d84225f | 5eac5f4c155e9aafe77b4880679ae5efdaa02a1d | /pikaq-client/src/test/java/com/baidu/pikaq/client/test/service/Columns.java | 4c969c6a596a4254f1bb4533938a6d8ab5e05e90 | [] | no_license | knightliao/pikaQ | 18e0b2c7aaa9837616265bab0ccfc0cf44bfc5ce | c2036696399d30856b7c7de67fc62af994881815 | refs/heads/master | 2021-08-27T16:22:42.678754 | 2021-08-03T17:17:45 | 2021-08-03T17:17:45 | 35,210,088 | 109 | 79 | null | 2015-05-11T09:05:31 | 2015-05-07T09:07:33 | Java | UTF-8 | Java | false | false | 189 | java | package com.baidu.pikaq.client.test.service;
/**
*
*/
public class Columns {
public final static String NAME = "name";
public final static String CAMPAIGN_ID = "campaignId";
}
| [
"knightliao@gmail.com"
] | knightliao@gmail.com |
c15c43b2cd895dd8576376eb021370d3798f4cb3 | 6aa97472f1c3007f10bfb45f6fc60266d362f076 | /TAM/src/main/java/com/mnt/tam/dao/ClassDaoImpl.java | 570061fa6d228489c7832879d6522933e9e47734 | [] | no_license | venkateshpavuluri/tam | da129e73d2932d4416785f8acd1dfc7a57c4eeb5 | 42634d955f90726b90cce35649a3387094a29b77 | refs/heads/master | 2016-09-06T15:36:14.007172 | 2014-06-14T10:47:07 | 2014-06-14T10:47:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,605 | java | package com.mnt.tam.dao;
import java.io.Serializable;
import java.util.Iterator;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import com.mnt.tam.bean.Classes;
import com.mnt.tam.daoSupport.TamDaoSupport;
@Repository("classDao")
public class ClassDaoImpl extends TamDaoSupport implements ClassDao {
private static Logger logger = Logger.getLogger(ClassDaoImpl.class);
private String msg = null;
private List<Object[]> listOfObjects = null;
private String hql = null;
Iterator<Object[]> iterator = null;
Long l = 0l;
public String saveClassDetails(Classes Class) {
try {
Serializable id = getHibernateTemplate().save(Class);
logger.info("id is==" + id);
if (id != null) {
msg = "S";
} else {
msg = "F";
}
} catch (Exception e) {
msg = "F";
logger.error(e.getMessage());
e.printStackTrace();
}
return msg;
}
public List<Object[]> searchClassDetails() {
try {
hql = "select s.classId,s.className,s.school from com.mnt.tam.bean.Classes s";
listOfObjects = getHibernateTemplate().find(hql);
} catch (Exception e) {
logger.error(e.getMessage());
}
return listOfObjects;
}
public List<Object[]> basicSearchForClass(String dbField,
String operations, String basicSearchId) {
try {
hql = "select s.classId,s.className,s.school from com.mnt.tam.bean.Classes s where s."
+ dbField + "" + operations + "?";
Object[] parameters = { basicSearchId };
listOfObjects = getHibernateTemplate().find(hql, parameters);
} catch (Exception e) {
logger.error(e.getMessage());
}
return listOfObjects;
}
public List<Classes> editClassDetails(int ClassId) {
List<Classes> listOfClasss = null;
try {
hql = "from com.mnt.tam.bean.Classes s where s.classId=" + ClassId;
listOfClasss = getHibernateTemplate().find(hql);
logger.info("list of Classare ==" + listOfClasss.size());
} catch (Exception e) {
logger.error(e.getMessage());
e.printStackTrace();
}
return listOfClasss;
}
public String updateClassDetails(Classes Class) {
try {
getHibernateTemplate().update(Class);
msg = "S";
} catch (Exception e) {
msg = "F";
e.printStackTrace();
}
return msg;
}
public String deleteClassDetails(int id) {
try {
Classes Class = new Classes();
Class.setClassId(id);
getHibernateTemplate().delete(Class);
msg = "S";
} catch (Exception e) {
msg = "F";
logger.error(e.getMessage());
}
return msg;
}
public Long duplicateCheck(String className, String classId) {
try {
if (classId != null) {
String sql = "select count(*) from Classes st where st.className='"
+ className + "' and st.classId!='" + classId + "'";
listOfObjects = getHibernateTemplate().find(sql);
iterator = listOfObjects.iterator();
while (iterator.hasNext()) {
Object object = (Object) iterator.next();
l = (Long) object;
}
} else {
String sql = "select count(*) from Classes st where st.className='"
+ className + "'";
listOfObjects = getHibernateTemplate().find(sql);
iterator = listOfObjects.iterator();
while (iterator.hasNext()) {
Object object = (Object) iterator.next();
l = (Long) object;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return l;
}
}
| [
"pavuluri.venki@gmail.com"
] | pavuluri.venki@gmail.com |
ad1c9abfd46ae34ebd481082a2622db9c59d96ee | d340c510a692d20babecd7dbc8c5d8a494de3193 | /mavenproject/src/main/java/logging/Some.java | 87c1593b3aa74dc0191321723c38d44723a9b2a1 | [
"Apache-2.0"
] | permissive | Aishubante/JavaTrainings | 0a2f5ec9c9f031082502785810843c81c8fa8f5c | 4886117ea6432b1db5bf7253e80145940834de4a | refs/heads/master | 2021-06-04T02:04:27.548604 | 2016-07-04T19:11:52 | 2016-07-04T19:11:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 384 | java | package logging;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* Created by igor on 29.10.2015.
*/
public class Some {
private static final Logger logger = LogManager.getLogger(Some.class);
public static void main(String[] args) {
logger.debug("deb");
logger.error("!error");
logger.info("inf");
}
}
| [
"nesterione@gmail.com"
] | nesterione@gmail.com |
064940d97c2ef38f8034c31838f5c6460b969918 | 9cf927c911e22d8942aeda8c3d18996ec0c65d67 | /src/main/gen/at/ac/tuwien/kr/alpha/antlr/ASPCore2Visitor.java | 082e2c7de1e26b93625ae31aa95cb99635675100 | [
"BSD-2-Clause"
] | permissive | konstantin-schekotihin/Alpha | 6370900e7a086c15bd55a967bd6ea70cf4a3cd52 | ac85195040883e0df9cf450aa704387937af169a | refs/heads/master | 2021-05-07T05:30:48.703299 | 2017-11-21T15:53:31 | 2017-11-21T15:53:31 | 111,561,372 | 1 | 0 | null | 2017-11-21T14:44:20 | 2017-11-21T14:44:20 | null | UTF-8 | Java | false | false | 10,641 | java | // Generated from C:/projects/Alpha/src/main/antlr/at/ac/tuwien/kr/alpha/antlr\ASPCore2.g4 by ANTLR 4.7
package at.ac.tuwien.kr.alpha.antlr;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
/**
* This interface defines a complete generic visitor for a parse tree produced
* by {@link ASPCore2Parser}.
*
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/
public interface ASPCore2Visitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link ASPCore2Parser#program}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitProgram(ASPCore2Parser.ProgramContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#statements}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitStatements(ASPCore2Parser.StatementsContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#query}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitQuery(ASPCore2Parser.QueryContext ctx);
/**
* Visit a parse tree produced by the {@code statement_fact}
* labeled alternative in {@link ASPCore2Parser#statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitStatement_fact(ASPCore2Parser.Statement_factContext ctx);
/**
* Visit a parse tree produced by the {@code statement_constraint}
* labeled alternative in {@link ASPCore2Parser#statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitStatement_constraint(ASPCore2Parser.Statement_constraintContext ctx);
/**
* Visit a parse tree produced by the {@code statement_rule}
* labeled alternative in {@link ASPCore2Parser#statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitStatement_rule(ASPCore2Parser.Statement_ruleContext ctx);
/**
* Visit a parse tree produced by the {@code statement_weightConstraint}
* labeled alternative in {@link ASPCore2Parser#statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitStatement_weightConstraint(ASPCore2Parser.Statement_weightConstraintContext ctx);
/**
* Visit a parse tree produced by the {@code statement_gringoSharp}
* labeled alternative in {@link ASPCore2Parser#statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitStatement_gringoSharp(ASPCore2Parser.Statement_gringoSharpContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#head}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitHead(ASPCore2Parser.HeadContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#body}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBody(ASPCore2Parser.BodyContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#disjunction}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitDisjunction(ASPCore2Parser.DisjunctionContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#choice}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitChoice(ASPCore2Parser.ChoiceContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#choice_elements}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitChoice_elements(ASPCore2Parser.Choice_elementsContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#choice_element}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitChoice_element(ASPCore2Parser.Choice_elementContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#heuristic}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitHeuristic(ASPCore2Parser.HeuristicContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#aggregate}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAggregate(ASPCore2Parser.AggregateContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#aggregate_elements}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAggregate_elements(ASPCore2Parser.Aggregate_elementsContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#aggregate_element}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAggregate_element(ASPCore2Parser.Aggregate_elementContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#aggregate_function}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAggregate_function(ASPCore2Parser.Aggregate_functionContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#weight_at_level}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitWeight_at_level(ASPCore2Parser.Weight_at_levelContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#naf_literals}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitNaf_literals(ASPCore2Parser.Naf_literalsContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#naf_literal}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitNaf_literal(ASPCore2Parser.Naf_literalContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#classical_literal}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitClassical_literal(ASPCore2Parser.Classical_literalContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#builtin_atom}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBuiltin_atom(ASPCore2Parser.Builtin_atomContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#binop}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBinop(ASPCore2Parser.BinopContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#terms}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerms(ASPCore2Parser.TermsContext ctx);
/**
* Visit a parse tree produced by the {@code term_number}
* labeled alternative in {@link ASPCore2Parser#term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerm_number(ASPCore2Parser.Term_numberContext ctx);
/**
* Visit a parse tree produced by the {@code term_anonymousVariable}
* labeled alternative in {@link ASPCore2Parser#term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerm_anonymousVariable(ASPCore2Parser.Term_anonymousVariableContext ctx);
/**
* Visit a parse tree produced by the {@code term_variable}
* labeled alternative in {@link ASPCore2Parser#term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerm_variable(ASPCore2Parser.Term_variableContext ctx);
/**
* Visit a parse tree produced by the {@code term_minusTerm}
* labeled alternative in {@link ASPCore2Parser#term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerm_minusTerm(ASPCore2Parser.Term_minusTermContext ctx);
/**
* Visit a parse tree produced by the {@code term_binopTerm}
* labeled alternative in {@link ASPCore2Parser#term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerm_binopTerm(ASPCore2Parser.Term_binopTermContext ctx);
/**
* Visit a parse tree produced by the {@code term_const}
* labeled alternative in {@link ASPCore2Parser#term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerm_const(ASPCore2Parser.Term_constContext ctx);
/**
* Visit a parse tree produced by the {@code term_func}
* labeled alternative in {@link ASPCore2Parser#term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerm_func(ASPCore2Parser.Term_funcContext ctx);
/**
* Visit a parse tree produced by the {@code term_string}
* labeled alternative in {@link ASPCore2Parser#term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerm_string(ASPCore2Parser.Term_stringContext ctx);
/**
* Visit a parse tree produced by the {@code term_parenthesisedTerm}
* labeled alternative in {@link ASPCore2Parser#term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerm_parenthesisedTerm(ASPCore2Parser.Term_parenthesisedTermContext ctx);
/**
* Visit a parse tree produced by the {@code term_interval}
* labeled alternative in {@link ASPCore2Parser#term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTerm_interval(ASPCore2Parser.Term_intervalContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#arithop}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitArithop(ASPCore2Parser.ArithopContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#interval}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitInterval(ASPCore2Parser.IntervalContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#external_atom}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExternal_atom(ASPCore2Parser.External_atomContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#gringo_sharp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitGringo_sharp(ASPCore2Parser.Gringo_sharpContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#basic_terms}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBasic_terms(ASPCore2Parser.Basic_termsContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#basic_term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBasic_term(ASPCore2Parser.Basic_termContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#ground_term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitGround_term(ASPCore2Parser.Ground_termContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#variable_term}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitVariable_term(ASPCore2Parser.Variable_termContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#answer_set}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAnswer_set(ASPCore2Parser.Answer_setContext ctx);
/**
* Visit a parse tree produced by {@link ASPCore2Parser#answer_sets}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAnswer_sets(ASPCore2Parser.Answer_setsContext ctx);
} | [
"kostyantyn.shchekotykhin@gmail.com"
] | kostyantyn.shchekotykhin@gmail.com |
7a9dbc67ecee3f5e5162d1d52bfb3b18360a9b46 | 8d7def46f6f04d5cf3277594875a5245a070a7a5 | /Sugar Not Included/src/main/java/com/sugarnotincluded/SwaggerConfig.java | 61c47dfaa90e3a2694a1630ad11465c030619873 | [] | no_license | ClaudiuRaveanu/SugarNotIncluded | dec1db7f85328ab0298d7ec3db22ed6e094ffe3c | e27ff955af1a101fc83eac4b499c70b2b0930b82 | refs/heads/master | 2023-08-05T02:57:44.590324 | 2021-09-01T10:39:46 | 2021-09-01T10:39:46 | 402,776,742 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 757 | java | package com.sugarnotincluded;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket docket() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}
| [
"claudiu.raveanu00@e-uvt.ro"
] | claudiu.raveanu00@e-uvt.ro |
2c2dcf0a3daf4c1fff994717e48d04f866da6f1d | bc794d54ef1311d95d0c479962eb506180873375 | /baseaccount/baseaccount-service/src/main/java/com/basaccount/jaxrs/ifaces/achats/NoteFraisRS.java | 47689790a145a812bdb1b9627e77ceb222dd0f6e | [] | no_license | Teratech2018/Teratech | d1abb0f71a797181630d581cf5600c50e40c9663 | 612f1baf9636034cfa5d33a91e44bbf3a3f0a0cb | refs/heads/master | 2021-04-28T05:31:38.081955 | 2019-04-01T08:35:34 | 2019-04-01T08:35:34 | 122,177,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java |
package com.basaccount.jaxrs.ifaces.achats;
import com.basaccount.model.achats.NoteFrais;
import com.megatimgroup.generic.jax.rs.layer.ifaces.GenericService;
/**
* Interface du service JAX-RS
* @since Fri Mar 16 09:30:48 GMT+01:00 2018
*
*/
public interface NoteFraisRS
extends GenericService<NoteFrais, Long>
{
}
| [
"bekondo_dieu@yahoo.fr"
] | bekondo_dieu@yahoo.fr |
6bd37ff3ba9f1bac0434ecd2a5d4b447ba4f2e3b | 1100a55b42fb7cbfc36ce7e5940804622371f7f6 | /app/src/main/java/com/wxy/jetpackdemo/livedata/fragment/LiveDataFragmentOne.java | db1e08ebc29404517e73e345f0fe140161e923b0 | [] | no_license | aiceking/JetpackDemo | fe83cd25de1b6f84ba3d9e30bf313da0fc2e5ce6 | f93294fa1290229680cd463def7ca00033040df2 | refs/heads/master | 2022-03-30T07:07:43.742323 | 2019-11-29T02:12:18 | 2019-11-29T02:12:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,213 | java | package com.wxy.jetpackdemo.livedata.fragment;
import android.widget.TextView;
import com.wxy.jetpackdemo.R;
import com.wxy.jetpackdemo.base.BaseFragment;
import com.wxy.jetpackdemo.livedata.model.LiveDataViewModel;
import com.wxy.jetpackdemo.viewmodel.model.MyViewModel;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import butterknife.BindView;
import butterknife.OnClick;
public class LiveDataFragmentOne extends BaseFragment {
@BindView(R.id.tv_one)
TextView tvOne;
private LiveDataViewModel liveDataViewModel;
@Override
public int getLayoutId() {
liveDataViewModel = ViewModelProviders.of(getActivity()).get(LiveDataViewModel.class);
liveDataViewModel.getMutableLiveData().observe(this, new Observer<LiveDataViewModel.NameModel>() {
@Override
public void onChanged(LiveDataViewModel.NameModel nameModel) {
tvOne.setText(nameModel.getName());
}
});
return R.layout.fragment_livedata_one;
}
@OnClick(R.id.tv_one)
public void onViewClicked() {
liveDataViewModel.setNameModel(new LiveDataViewModel.NameModel("我是LiveDataFragmentOne"));
}
}
| [
"wangxiaoyun@zhufaner.com"
] | wangxiaoyun@zhufaner.com |
6c3d0ddf73c15becba8a7e93c26be5de3758eedd | 36ba57475cde158934da8f1adf186f771bfffd3a | /GetImageFromGallery/app/src/main/java/com/example/pc/getimagefromgallery/MainActivity.java | 982bc6ae9ac2a602721e92f65f3ec86b08d83ddd | [] | no_license | diepmanhcuong/AndroidTutorial | e32775725d7c4ac5678b9d9321462b24823df99b | c1fa6feab60aebea0f141dd07e1d94e9a447d42b | refs/heads/master | 2020-03-09T22:53:42.732154 | 2018-05-08T07:46:11 | 2018-05-08T07:46:11 | 129,045,913 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,497 | java | package com.example.pc.getimagefromgallery;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
RecyclerView recyclerView;
ArrayList<Book> bookArrayList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
recyclerView = (RecyclerView)findViewById(R.id.recyclerView);
bookArrayList = new ArrayList<>();
bookArrayList.add(new Book(R.drawable.qqq,"abc"));
bookArrayList.add(new Book(R.drawable.eee,"abc"));
bookArrayList.add(new Book(R.drawable.www,"abc"));
bookArrayList.add(new Book(R.drawable.rrr,"abc"));
bookArrayList.add(new Book(R.drawable.yyy,"abc"));
bookArrayList.add(new Book(R.drawable.uuu,"abc"));
bookArrayList.add(new Book(R.drawable.iii,"abc"));
bookArrayList.add(new Book(R.drawable.ooo,"abc"));
bookArrayList.add(new Book(R.drawable.ppp,"abc"));
bookArrayList.add(new Book(R.drawable.sss,"abc"));
BookAdapter bookAdapter = new BookAdapter(bookArrayList,MainActivity.this);
recyclerView.setLayoutManager(new GridLayoutManager(this,3));
recyclerView.setAdapter(bookAdapter);
}
}
| [
"diepmanhc0511@gmail.com"
] | diepmanhc0511@gmail.com |
3ff2e8f763a4c03f76ebe02ae928906c7ba5e4c1 | 48915cbccf329e820e13a058e539668126807718 | /app/src/main/java/com/example/kapils/myexpensemanager/PopUpdate.java | a54538740c3143989bb5e348af143f2f56bd9bf3 | [] | no_license | Priyanjul/MyExpenseManager | 13cc0e829e5ccc1370fee645d0ae13106918484f | b80cdae106c8d58e5015981312364129a32d66bd | refs/heads/priyanjul1 | 2021-01-17T17:58:12.778283 | 2017-06-27T06:47:26 | 2017-06-27T06:47:26 | 94,206,376 | 0 | 0 | null | 2017-06-13T11:37:50 | 2017-06-13T11:37:50 | null | UTF-8 | Java | false | false | 1,918 | java | package com.example.kapils.myexpensemanager;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import java.util.ArrayList;
/**
* Created by Priyanjul on 16-06-2017.
*/
public class PopUpdate extends AppCompatActivity {
EditText input;
FloatingActionButton btn;
String filler;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pop_update);
input = (EditText)findViewById(R.id.et_input);
btn = (FloatingActionButton)findViewById(R.id.btn_update);
filler = getIntent().getExtras().getString("FILLER");
Log.d("value of filler",""+filler);
input.setText(filler);
input.setSelectAllOnFocus(true);
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels;
int height = dm.heightPixels;
getWindow().setLayout((int) (width*0.8),(int)(height*0.4));
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String msg = input.getText().toString().trim();
Intent i = new Intent();
i.putExtra("INPUT", msg);
setResult(2,i);
finish();
}
});
}
@Override
public void onBackPressed() {
String msg = input.getText().toString().trim();
Intent i = new Intent();
i.putExtra("INPUT", msg);
setResult(2,i);
finish();
}
}
| [
"priyanjul5302@gmail.com"
] | priyanjul5302@gmail.com |
b798de3c46eec9d519ae07756b6708a6b9887732 | 8af77a542ba9c69a93ff7a767e987996fc42d799 | /Day004/src/Apple.java | 2667e4a44ab0db41a0aeb334cf189004dc25f1a9 | [] | no_license | zzd1109/DemoDay04 | a3a8dc77f13de87d4ed732f248f179f249dcf6cd | f30828d84693c8164beca710fe39e52561505ddb | refs/heads/master | 2020-09-30T14:08:08.942764 | 2019-12-27T09:47:41 | 2019-12-27T09:47:41 | 227,303,669 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | public class Apple extends Fruit {
public static void main(String[] args) {
Apple a = new Apple();
a.weight = 56;
a.info();
}
}
| [
"1750413215@qq.com"
] | 1750413215@qq.com |
07aac2652217403db9b4c49743f1642bef4ea1ca | c0df02e192f26ce3d798302b45fea038a4766b4e | /src/main/java/app/enums/Link.java | e3e6e697e150bff82b89725a5e6c12ca97ef1756 | [] | no_license | nedhle/superchat-backend-challenge | 5b47c4edd2e35699aaf6edd610997ca27bbd36eb | 65946091038a5ca12f2ba07388c2ec46003f40e5 | refs/heads/master | 2023-06-02T03:44:42.690514 | 2021-06-15T09:27:29 | 2021-06-15T09:27:29 | 375,990,862 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 129 | java | package app.enums;
public class Link {
public static String BTC_URL ="https://api.coindesk.com/v1/bpi/currentprice.json";
}
| [
"a.sahin28@gmail.com"
] | a.sahin28@gmail.com |
c5c0e4d1f0b6ec9f1f98f3a6612196e0264b583e | 66290b8d64ffb34bca1b924a1571b7c3946f8145 | /src/main/java/com/threenary/trazabilidad/service/email/EmailWorkflowTemplatesLocator.java | 6004068f69f50a4bb424ff44ee646088a8c0f6be | [] | no_license | threenary/trazaweb | fe2f4258976e4718bbe0ba80ac18c3fcb30b9799 | d148a46b8591859963f1023f44c46e7874c17954 | refs/heads/master | 2020-12-31T07:43:51.920846 | 2016-05-01T10:07:55 | 2016-05-01T10:07:55 | 57,593,731 | 0 | 0 | null | null | null | null | ISO-8859-2 | Java | false | false | 5,506 | java | package com.threenary.trazabilidad.service.email;
/**
* <h2>EmailTemplatesLocator</h2><br>
* Clase utilitaria para recuperar la ubicación de los templates
* utilizados para envio de emails.
*
* @version 1.0
* @author Gonzalo Gómez Sullain <a
* href="mailto:g.gomez.sullain@gmail.com"
* >g.gomez.sullain@gmail.com</a>
*/
public class EmailWorkflowTemplatesLocator {
/** urlSite un objeto de tipo <code>String</code> */
private String urlSite;
/** emailCreacionPeticion un objeto de tipo <code>String</code> */
private String emailCreacionPeticion;
/**
* emailActualizacionPeticion un objeto de tipo
* <code>String</code>
*/
private String emailActualizacionPeticion;
/** emailCambioEstadoPeticion un objeto de tipo <code>String</code> */
private String emailCambioEstadoPeticion;
/** emailComentarioPeticion un objeto de tipo <code>String</code> */
private String emailComentarioPeticion;
/** emailActividadEnPeticion un objeto de tipo <code>String</code> */
private String emailActividadEnPeticion;
/** emailRecursoEnPeticion un objeto de tipo <code>String</code> */
private String emailRecursoEnPeticion;
/** emailReasignacionPeticion un objeto de tipo <code>String</code> */
private String emailReasignacionPeticion;
/**
* Constructor<br>
*/
public EmailWorkflowTemplatesLocator() {
super();
}
/**
* Getter
*
* @return Retorna el/la emailActualizacionPeticion.
*/
public String getEmailActualizacionPeticion() {
return this.emailActualizacionPeticion;
}
/**
* Setter
*
* @param emailActualizacionPeticion
* El/La emailActualizacionPeticion para setear.
*/
public void setEmailActualizacionPeticion(
final String emailActualizacionPeticion) {
this.emailActualizacionPeticion = emailActualizacionPeticion;
}
/**
* Getter
*
* @return Retorna el/la emailCambioEstadoPeticion.
*/
public String getEmailCambioEstadoPeticion() {
return this.emailCambioEstadoPeticion;
}
/**
* Setter
*
* @param emailCambioEstadoPeticion
* El/La emailCambioEstadoPeticion para setear.
*/
public void setEmailCambioEstadoPeticion(
final String emailCambioEstadoPeticion) {
this.emailCambioEstadoPeticion = emailCambioEstadoPeticion;
}
/**
* Getter
*
* @return Retorna el/la emailComentarioPeticion.
*/
public String getEmailComentarioPeticion() {
return this.emailComentarioPeticion;
}
/**
* Setter
*
* @param emailComentarioPeticion
* El/La emailComentarioPeticion para setear.
*/
public void setEmailComentarioPeticion(final String emailComentarioPeticion) {
this.emailComentarioPeticion = emailComentarioPeticion;
}
/**
* Getter
*
* @return Retorna el/la emailActividadEnPeticion.
*/
public String getEmailActividadEnPeticion() {
return this.emailActividadEnPeticion;
}
/**
* Setter
*
* @param emailActividadEnPeticion
* El/La emailActividadEnPeticion para setear.
*/
public void setEmailActividadEnPeticion(
final String emailActividadEnPeticion) {
this.emailActividadEnPeticion = emailActividadEnPeticion;
}
/**
* Getter
*
* @return Retorna el/la emailRecursoEnPeticion.
*/
public String getEmailRecursoEnPeticion() {
return this.emailRecursoEnPeticion;
}
/**
* Setter
*
* @param emailRecursoEnPeticion
* El/La emailRecursoEnPeticion para setear.
*/
public void setEmailRecursoEnPeticion(final String emailRecursoEnPeticion) {
this.emailRecursoEnPeticion = emailRecursoEnPeticion;
}
/**
* Getter
*
* @return Retorna el/la emailReasignacionPeticion.
*/
public String getEmailReasignacionPeticion() {
return this.emailReasignacionPeticion;
}
/**
* Setter
*
* @param emailReasignacionPeticion
* El/La emailReasignacionPeticion para setear.
*/
public void setEmailReasignacionPeticion(
final String emailReasignacionPeticion) {
this.emailReasignacionPeticion = emailReasignacionPeticion;
}
/**
* Getter
*
* @return Retorna el/la emailCreacionPeticion.
*/
public String getEmailCreacionPeticion() {
return this.emailCreacionPeticion;
}
/**
* Setter
*
* @param emailCreacionPeticion
* El/La emailCreacionPeticion para setear.
*/
public void setEmailCreacionPeticion(final String emailCreacionPeticion) {
this.emailCreacionPeticion = emailCreacionPeticion;
}
/**
* Getter
*
* @return Retorna el/la urlSite.
*/
public String getUrlSite() {
return this.urlSite;
}
/**
* Setter
*
* @param urlSite
* El/La urlSite para setear.
*/
public void setUrlSite(final String urlSite) {
this.urlSite = urlSite;
}
} | [
"ggomezsullain@gmail.com"
] | ggomezsullain@gmail.com |
5a541af9b5fdf61d7b104811f443c4bf94d836d7 | 12b17568e3b89820018ac1d2366c55d662355ccf | /instrumented/dummy/src/edu/cmu/cs/mvelezce/Sleep24.java | da05cc58a51d8fea1dac5f3128b47d1cebb56bdd | [] | no_license | miguelvelezmj25/performance-mapper-evaluation | 0b086d60767250b9df7d89dfa70336b2e884af49 | e8f42e1f9006826a79e65edae30d9aa906eb8a30 | refs/heads/master | 2023-08-18T04:36:38.878803 | 2021-10-20T13:47:54 | 2021-10-20T13:47:54 | 91,713,239 | 0 | 0 | null | 2021-01-15T15:33:51 | 2017-05-18T16:05:51 | Java | UTF-8 | Java | false | false | 641 | java | package edu.cmu.cs.mvelezce;
/**
* Created by mvelezce on 7/13/17.
*/
public class Sleep24 {
public static boolean A = false;
public static boolean B = false;
public static void main(String[] args) throws InterruptedException {
A = Boolean.valueOf(args[0]);
B = Boolean.valueOf(args[1]);
if(A) {
m1(3);
}
else {
m1(5);
}
if(B) {
m1(2);
}
else {
m1(4);
}
}
public static void m1(int i) throws InterruptedException {
Thread.sleep(200 * i);
Thread.sleep(300 * i);
}
}
| [
"miguelvelez@mijecu25.com"
] | miguelvelez@mijecu25.com |
ee743de1b29d511764e128e7339a695592a5b171 | 4c7fa2e1c764a958f0b1433815df8d01f7002fd3 | /services/aprendoz_desarrollo/src/com/aprendoz_desarrollo/data/TmpEnrLog.java | 54a9fe09ae56417bae0b06ff2296ea57e303b5ef | [] | no_license | rochesterschool/Matriculas | ae39b3b25fd9880ca1c41e779d622b3e24ef087a | 608208c95d3ccce765703b36a0cccf04397e04fe | refs/heads/master | 2021-05-30T04:27:08.202990 | 2015-04-10T12:24:13 | 2015-04-10T12:24:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 397 | java |
package com.aprendoz_desarrollo.data;
/**
* aprendoz_desarrollo.TmpEnrLog
* 06/13/2014 10:26:51
*
*/
public class TmpEnrLog {
private TmpEnrLogId id;
public TmpEnrLog() {
}
public TmpEnrLog(TmpEnrLogId id) {
this.id = id;
}
public TmpEnrLogId getId() {
return id;
}
public void setId(TmpEnrLogId id) {
this.id = id;
}
}
| [
"maguilera@rochester.edu.co"
] | maguilera@rochester.edu.co |
3d5933b0e4631f8ba946c0c32bd1b6c6dfe4bb4d | b731feeb40887f5d55fdd722403536266d3605f0 | /src/main/java/study/Application.java | 00f2929315fc5fe905d3c15665dc9b0ebae864c9 | [] | no_license | yunsion/spring_boot_practice | 7875733c1148100623f0a17a58756dcf07bc3b63 | 25ec0ef0d91fd533856551038b60fc277d7c73b4 | refs/heads/master | 2021-01-07T01:48:55.581276 | 2020-02-19T06:01:05 | 2020-02-19T06:01:05 | 241,543,358 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 295 | java | package study;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| [
"sion@terafunding.com"
] | sion@terafunding.com |
8b21098a0b659be27d5f7911ba753a2b8711bebf | 9f004c3df4413eb826c229332d95130a1d5c8457 | /src/shyam/StringToArrayExamples.java | 6693acb0ed6e3c3aaca676f5e5ba7c228999eb1d | [] | no_license | MayurSTechnoCredit/JAVATechnoJuly2021 | dd8575c800e8f0cac5bab8d5ea32b25f7131dd0d | 3a422553a0d09b6a99e528c73cc2b8efe260a07a | refs/heads/master | 2023-08-22T14:43:37.980748 | 2021-10-16T06:33:34 | 2021-10-16T06:33:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,002 | java | package shyam;
public class StringToArrayExamples {
public static void main (String[] args){
String inputString = "Hello Customer Can You Find Words In Given String";
StringToArrayExamples stringToArrayExamples = new StringToArrayExamples();
stringToArrayExamples.countOfWordsInGivenString(inputString);
stringToArrayExamples.biggestWordInGivenString(inputString);
stringToArrayExamples.smallestWordInGivenString(inputString);
String numberString ="10 10 20 30 40 50";
stringToArrayExamples.sumOfAllNumbersInString(numberString);
}
void countOfWordsInGivenString(String inputString) {
System.out.println("Input String is->" + inputString);
String stringArray [] = inputString.split(" ");
System.out.println(" Number of words in the given String is :- " + stringArray.length);
}
void biggestWordInGivenString(String inputString) {
String stringArray [] = inputString.split(" ");
String biggestWord = "";
for (int index=0; index<stringArray.length; index++) {
if (stringArray[index].length() > biggestWord.length())
biggestWord= stringArray[index];
}
System.out.println("BiggestWord in given string is->"+ biggestWord);
}
void smallestWordInGivenString(String inputString) {
String[] stringArray = inputString.split(" ");
String smallestWord = stringArray[0];
for(int index = 0; index < stringArray.length; index ++) {
if(stringArray[index].length() < smallestWord.length())
smallestWord = stringArray[index];
}
System.out.println(" The smallest word in the given String is :- " + smallestWord);
}
void sumOfAllNumbersInString(String inputString) {
System.out.println("Input String of nubers is :- "+ inputString);
String[] stringArray = inputString.split(" ");
int sum = 0;
for(int index = 0; index < stringArray.length; index ++) {
int number = Integer.parseInt(stringArray[index]);
sum += number;
}
System.out.println(" The sum of all Numbers in the given String is :- " + sum);
}
}
| [
"shyamanasane@gmail.com"
] | shyamanasane@gmail.com |
888bd50955570879fd10cfb691acdf45c59565b0 | 8039c05509f3f9f86baae983e091e03ffa5ef2c6 | /firebase/src/main/java/app/we/go/firebase/rx/FirebaseUtils.java | a14e648f5651dc8d62e1feaf8d8412cf1de04939 | [
"Apache-2.0"
] | permissive | talosdev/app-we-go_firebase | 36c7315dc8d2f23452a46af9a9f0fd991ce99f8a | cce967a2970eee8aa34c8b8d02f7cbe0ea4687a6 | refs/heads/master | 2021-01-12T17:33:04.652894 | 2017-02-07T17:53:42 | 2017-02-07T17:53:42 | 71,598,081 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,902 | java | package app.we.go.firebase.rx;
import android.support.annotation.NonNull;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import app.we.go.firebase.HasId;
import java.util.Map;
import app.we.go.firebase.FirebaseException;
import rx.Subscriber;
import rx.Subscription;
import rx.functions.Action0;
import rx.functions.Func1;
import rx.subscriptions.Subscriptions;
/**
* Created by Aristides Papadopoulos (github:talosdev).
*/
public class FirebaseUtils {
public static <T> Func1<DataSnapshot, T> dataSnapshotToObject(final Class<T> clazz) {
return new Func1<DataSnapshot, T>() {
@Override
public T call(DataSnapshot dataSnapshot) {
T t = dataSnapshot.getValue(clazz);
if (t instanceof HasId) {
((HasId) t).setId(dataSnapshot.getKey());
}
return t;
}
};
}
@NonNull
public static DatabaseReference.CompletionListener getDefaultCompletionListener(final Subscriber<? super Void> subscriber) {
return new DatabaseReference.CompletionListener() {
@Override
public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {
if (databaseError == null) {
subscriber.onCompleted();
} else {
subscriber.onError(new FirebaseException(databaseError));
}
}
};
}
public static void addMapToChildUpdates(Map<String, Object> map, String basePath, Map<String, Object> childUpdates) {
for(Map.Entry entry: map.entrySet()) {
if (basePath.equals("")) {
childUpdates.put((String) entry.getKey(), entry.getValue());
} else {
childUpdates.put(basePath + "/" + entry.getKey(), entry.getValue());
}
}
}
public static Subscription unsubscribeValueListener(final Query ref, final ValueEventListener listener) {
return Subscriptions.create(
new Action0() {
@Override
public void call() {
ref.removeEventListener( listener);
}
}
);
}
public static Subscription unsubscribeChildListener(final Query ref, final ChildEventListener listener) {
return Subscriptions.create(
new Action0() {
@Override
public void call() {
ref.removeEventListener(listener);
}
}
);
}
}
| [
"Aristides.PAPADOPOULOS@gmail.com"
] | Aristides.PAPADOPOULOS@gmail.com |
0b6043dcc3d445220b8f2b668f72708fe68cb0e6 | 2f5a7f0f0896f43600e5569d5dfade7ba2192261 | /xstampp.stpapriv/src/xstampp/stpapriv/wizards/stepImages/XLTLIMGWizard.java | 446d78848cfd830c8840d6f58c848d7665de2378 | [] | no_license | wuyuehit/XSTAMPP | f16b94e67432132a191e088cbe65c5cb0fc4d26a | 87e71fe2d839c8cc281ab9431bd04822a42731d5 | refs/heads/dev | 2021-08-30T09:18:48.429026 | 2017-08-09T09:46:34 | 2017-08-09T09:46:34 | 106,696,432 | 0 | 0 | null | 2017-10-12T13:28:10 | 2017-10-12T13:28:10 | null | UTF-8 | Java | false | false | 1,306 | java | /*******************************************************************************
* Copyright (c) 2013, 2017 Lukas Balzer, Asim Abdulkhaleq, Stefan Wagner
* Institute of Software Technology, Software Engineering Group
* University of Stuttgart, Germany
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package xstampp.stpapriv.wizards.stepImages;
import messages.Messages;
import xstampp.astpa.wizards.AbstractExportWizard;
import xstampp.stpapriv.Activator;
import xstampp.ui.wizards.TableExportPage;
public class XLTLIMGWizard extends AbstractExportWizard {
public XLTLIMGWizard() {
super("");
String[] filters = new String[] {"*.png" ,"*.bmp"}; //$NON-NLS-1$
this.setExportPage(new TableExportPage(filters,
Messages.LTLFormulasTable + " " + Messages.AsImage, Activator.PLUGIN_ID)); //$NON-NLS-2$
}
@Override
public boolean performFinish() {
return this.performXSLExport("/fopLTLPropertys.xsl", false,//$NON-NLS-1$
Messages.LTLFormulasTable, false);
}
}
| [
"swt87885@stud.uni-stuttgart.de"
] | swt87885@stud.uni-stuttgart.de |
cc39d9d54223223795447aa8d7a2756303a850f8 | 8ce699ec9ba02c16695a9a53e8c0d8c2c90dbaf3 | /app/src/test/java/com/example/prepopulatedb/ExampleUnitTest.java | 14acf2d2aa8074f45045962121a811d212b5642d | [] | no_license | chukrav/prepopulateDB | fd4f51721088f959b0bba91c587c8a6dd1121ba3 | 0e5fcb93c1362233b73e01282bf0d6e0c347b652 | refs/heads/master | 2022-04-21T01:10:50.051773 | 2020-04-16T11:58:26 | 2020-04-16T11:58:26 | 256,201,058 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package com.example.prepopulatedb;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"alexei.jobs@gmail.com"
] | alexei.jobs@gmail.com |
e311f73c5d456b9763a0d3ce1956f80dd46a4f4a | 031978b912181fd1401255263beab52103f58090 | /forest/src/main/java/com/my/four/model/batch/Scheduler.java | ce5ddd075e0fdee04201a583f0539f04085fd592 | [] | no_license | rodumani1012/FourRest | 9cb09f03a1f8f20a7661a43a906c45b486eb4431 | 3d8de074b6a2aa6ea1414099a46ee26442375505 | refs/heads/master | 2022-11-30T13:06:13.570360 | 2019-09-23T07:08:08 | 2019-09-23T07:08:08 | 198,767,373 | 0 | 1 | null | 2022-11-15T23:49:36 | 2019-07-25T06:01:49 | JavaScript | UTF-8 | Java | false | false | 62 | java | package com.my.four.model.batch;
public class Scheduler {
}
| [
"wjy1408@gmail.com"
] | wjy1408@gmail.com |
6784119b4fbde3fe870a1316459f61e1e6cd7c01 | 8f69f0376bef2d9b364c902d9ed56e77a828d1ee | /src/main/java/org/gnuhpc/interview/leetcode/solutions/TreeToDoublyList426.java | 17184017200467a36d2ed9c37274677baef5e24e | [] | no_license | datainsect/All-About-SDE-Interview | 58a3e803374355026b2c8fc8670f49509ef5e4e5 | 1114e0445be28ebda4228ea4dd190121317092b3 | refs/heads/master | 2022-05-28T23:11:13.180353 | 2020-04-22T06:27:26 | 2020-04-22T06:27:26 | 259,385,255 | 0 | 3 | null | 2020-04-27T16:13:42 | 2020-04-27T16:13:41 | null | UTF-8 | Java | false | false | 3,582 | java | package org.gnuhpc.interview.leetcode.solutions;
import java.util.ArrayList;
import java.util.Deque;
import java.util.LinkedList;
import java.util.List;
public class TreeToDoublyList426 {
/*
画图就可以得到
*/
public Node treeToDoublyList(Node root) {
if (root == null) return null;
if (root.left == null && root.right == null) {
root.left = root;
root.right = root;
return root;
}
List<Node> l = inorder(root);
Node dummy = new Node();
Node cur = dummy;
for (Node n : l) {
cur.right = n;
n.left = cur;
cur = cur.right;
}
cur.right = dummy.right;
dummy.right.left = cur;
return dummy.right;
}
private List<Node> inorder(Node root) {
List<Node> list = new ArrayList<>();
visit(list, root);
return list;
}
private void visit(List<Node> list, Node node) {
if (node == null) return;
visit(list, node.left);
list.add(node);
visit(list, node.right);
}
/*
Method2 : in-place 非递归
*/
public Node treeToDoublyList2(Node root) {
if (root == null)
return root;
Deque<Node> stack = new LinkedList<>();
Node pre = new Node(0, null, null);
Node dummy = pre;
while (root != null || !stack.isEmpty()) {
while (root != null) {
stack.push(root);
root = root.left;
}
root = stack.pop();
//注意下边这三行和后边递归方法的是一样的
pre.right = root;
root.left = pre;
pre = root;
root = root.right;//别忘了转向右子树
}
//最后处理头尾
pre.right = dummy.right;
dummy.right.left = pre;
return dummy.right;
}
public Node treeToDoublyList3(Node root) {
if (root == null) {
return null;
}
Node head = root;
while (head.left != null) head = head.left;
helper(root);
//connect tail with head;
prev.right = head;
head.left = prev;
return head;
}
Node prev = null; //怎么在DFS中记录上一个元素
private void helper(Node root) {
if (root == null) {
return;
}
helper(root.left);
if (prev != null) {
prev.right = root;
root.left = prev;
}
prev = root;
helper(root.right);
}
/*
Method3 : 递归 inplace
*/
public Node treeToDoublyList4(Node root) {
if (root == null) return null;
Node left = treeToDoublyList3(root.left);
Node right = treeToDoublyList3(root.right);
root.left = root;
root.right = root;
return join(join(left, root), right);
}
private Node join(Node left, Node right) {
if (left == null) return right;
if (right == null) return left;
Node lastLeft = left.left;
Node lastRight = right.left;
lastLeft.right = right;
right.left = lastLeft;
lastRight.right = left;
left.left = lastRight;
return left;
}
class Node {
public int val;
public Node left;
public Node right;
public Node() {
}
public Node(int _val, Node _left, Node _right) {
val = _val;
left = _left;
right = _right;
}
}
}
| [
"gnuhpc@gmail.com"
] | gnuhpc@gmail.com |
90bc0bd81ebc2476f8e164b12a1bc4e854f4be6a | e760923d951a32e8af274c6832817b91da9738af | /src/main/java/RPMap/MapRouteLoader.java | cf1d520694eaffc5e891be5db322180a928f8583 | [
"MIT"
] | permissive | samcrew777/MapNav | 3e4b3e99a45259d2db4970669872d350071f1c95 | cbaa88e4c8dd89bffe3ebb7a905f855bee7ef91a | refs/heads/master | 2020-03-28T04:04:39.377331 | 2018-09-05T00:51:32 | 2018-09-05T00:51:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 28,203 | java | /*
* GPSRouteLoader.java
*
* Created on 13 ������ 2007 �., 4:28
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package RPMap;
import app.MapForms;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.Vector;
import misc.MVector;
import misc.ProgressResponse;
import misc.ProgressStoppable;
import misc.Util;
import org.kxml2.io.KXmlParser;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/**
*
* @author RFK
*/
public abstract class MapRouteLoader implements Runnable, ProgressStoppable {
public static final byte CODEPAGEUTF=0;
public static final byte CODEPAGEWIN1251=1;
public static final byte FORMATOZI=0;
public static final byte FORMATKML=1;
public static final byte FORMATGPX=2;
public static final byte FORMATLOC=3;
String furl;
private String[] result=new String[25];
private MVector routes=new MVector();
byte loadKind;
byte CP;
byte format;
protected boolean stopped;
private Calendar calendar;
public MapRouteLoader(String url, byte kind, byte CP, byte format, boolean autoStart) {
furl=url;
loadKind=kind;
this.CP=CP;
this.format=format;
calendar=Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
if (autoStart){
Thread t=new Thread(this);
t.start();
}
}
public MapRouteLoader(String url, byte kind, byte CP, byte format) {
this(url, kind, CP, format, true);
}
public MapRoute getRoute() {
if (routes.size()>0) {
return (MapRoute) routes.elementAt(0);
}
return null;
}
void loadFromStream(InputStream is) throws IOException {
if (format==FORMATLOC){
//if (loadKind==MapRoute.ROUTEKIND) loadGPXWayPointsFromStream(is,true);
//else
if (loadKind==MapRoute.WAYPOINTSKIND){
loadLOCWayPointsFromStream(is, false);
}
//else if (loadKind==MapRoute.TRACKKIND) loadTrackFromStream(is);
} else if (format==FORMATGPX){
//if (loadKind==MapRoute.ROUTEKIND) loadGPXWayPointsFromStream(is,true);
//else if (loadKind==MapRoute.WAYPOINTSKIND) loadGPXWayPointsFromStream(is,false);
//else if (loadKind==MapRoute.TRACKKIND)
loadGPXWayPointsFromStream(is, loadKind);
} else if (CP==CODEPAGEUTF){
if (loadKind==MapRoute.ROUTEKIND){
loadRouteFromStream(is);
} else if (loadKind==MapRoute.WAYPOINTSKIND){
loadWayPointsFromStream(is);
} else if (loadKind==MapRoute.TRACKKIND){
loadTrackFromOZIStream(is);
}
} else {
ByteArrayOutputStream baos=new ByteArrayOutputStream(10000);
byte[] tb=new byte[200];
boolean allRead=false;
int n1;
int rb;
do {
n1=0;
while (n1!=tb.length) {
rb=is.read(tb, n1, tb.length-n1);
if (rb<0){
allRead=true;
break;
}
n1=n1+rb;
}
baos.write(tb, 0, n1);
} while (!allRead);
String s=Util.byteArrayToString(baos.toByteArray(), false);
baos=null;
ByteArrayInputStream bais=new ByteArrayInputStream(Util.stringToByteArray(s, true));
s=null;
if (stopped){
return;
}
if (loadKind==MapRoute.ROUTEKIND){
loadRouteFromStream(bais);
} else if (loadKind==MapRoute.WAYPOINTSKIND){
loadWayPointsFromStream(bais);
} else if (loadKind==MapRoute.TRACKKIND){
loadTrackFromOZIStream(bais);
}
}
}
void loadRouteFromStream(InputStream is) throws IOException {
int i=0;
//char c;
//String s = MapUtil.emptyString;
String[] data;
String DATA_STRING;
char TYPE;
MapRoute route=null;
MapPoint pt=null;
int rId;
boolean inRoute=false;
ByteArrayOutputStream baos=new ByteArrayOutputStream(150);
// Start reading the data from the file
do {
i=is.read(); // read one byte at the time.
baos.write(i);
if (stopped){
return;
}
if (i==10){ // Every route starts with CRLF'
if (baos.size()>5){
DATA_STRING=Util.byteArrayToString(baos.toByteArray(), true);
//DATA_STRING = String.valueOf(s);//s.substring(5, s.length());
TYPE=DATA_STRING.charAt(0);
// Check the gps data type and convert the information to a more readable format.
if (TYPE=='R'){
try {
data=MapUtil.parseString(DATA_STRING, ',');
rId=Integer.parseInt(data[0]);
String nam=data[1];
int acolor=Integer.parseInt(data[3]);
acolor=swapOziColor(acolor);
route=new MapRoute(MapRoute.ROUTEKIND);
routes.addElement(route);
route.name=nam;
route.color=acolor;
inRoute=true;
} catch (Exception e) {
}
} else if (TYPE=='W'){
if (inRoute){
try {
data=MapUtil.parseString(DATA_STRING, ',');
double la=Double.parseDouble(data[4]);
double lo=Double.parseDouble(data[5]);
String nam=data[3];
if (data[12]!=null){
if (nam!=null){
if (data[12].length()>nam.length()){
nam=data[12];
}
}
}
int pS=Integer.parseInt(data[7]);
int fC=swapOziColor(Integer.parseInt(data[10]));
int bC=swapOziColor(Integer.parseInt(data[11]));
pt=new MapPoint(la, lo, 0, nam);
pt.pointSymbol=(byte) pS;
pt.foreColor=fC;
pt.backColor=bC;
route.addMapPoint(pt);
} catch (Exception e) {
}
}
} else {
inRoute=false;
route=null;
}
}
//TYPE += ":" + exc;
//s = MapUtil.emptyString;
baos.reset();
}
} while ((i!=-1));
}
void loadWayPointsFromStream(InputStream is) throws IOException {
int i=0;
//char c;
//String s = MapUtil.emptyString;
String[] data;
String DATA_STRING;
//char TYPE;
MapRoute route=null;
MapPoint pt=null;
int rId;
boolean inRoute=false;
int nR=0;
route=new MapRoute(MapRoute.WAYPOINTSKIND);
routes.addElement(route);
route.name=MapUtil.extractFilename(furl);
inRoute=true;
ByteArrayOutputStream baos=new ByteArrayOutputStream(150);
// Start reading the data from the file
do {
i=is.read(); // read one byte at the time.
baos.write(i);
//c = (char)i;
//s += c;
if (stopped){
return;
}
if (i==10){ // Every route starts with CRLF'
if (baos.size()>3){
if (nR>3){
//DATA_STRING = String.valueOf(s);//s.substring(5, s.length());
//TYPE = s.charAt(0);
DATA_STRING=Util.byteArrayToString(baos.toByteArray(), true);
// Check the gps data type and convert the information to a more readable format.
//if(TYPE == 'W'){
if (inRoute){
try {
data=MapUtil.parseString(DATA_STRING, ',');
double la=Double.parseDouble(data[1]);
double lo=Double.parseDouble(data[2]);
String nam=data[0];
if (data[9]!=null){
if (nam!=null){
if (data[9].length()>nam.length()){
nam=data[9];
}
}
}
int pS=Integer.parseInt(data[4]);
int fC=swapOziColor(Integer.parseInt(data[7]));
int bC=swapOziColor(Integer.parseInt(data[8]));
pt=new MapPoint(la, lo, 0, nam);
pt.pointSymbol=(byte) pS;
pt.foreColor=fC;
pt.backColor=bC;
//pt.kind=MapPoint.WAYPOINT;
route.addMapPoint(pt);
} catch (Exception e) {
// }
}
}
// else {
// inRoute=false;
// route=null;
// }
}
}
nR++;
//TYPE += ":" + exc;
baos.reset();
// s = MapUtil.emptyString;
}
} while ((i!=-1));
}
void loadTrackFromOZIStream(InputStream is) throws IOException {
int i=0;
//char c;
//String s = MapUtil.emptyString;
String[] data;
String DATA_STRING;
//char TYPE;
MapRoute route=null;
MapPoint pt=null;
int rId;
boolean inRoute=false;
int nR=0;
route=new MapRoute(MapRoute.TRACKKIND);
routes.addElement(route);
//route.name=furl.substring(furl.length()-7);
inRoute=true;
ByteArrayOutputStream baos=new ByteArrayOutputStream(150);
// Start reading the data from the file
do {
i=is.read(); // read one byte at the time.
baos.write(i);
//c = (char)i;
//s += c;
if (stopped){
return;
}
if (i==10){ // Every route starts with CRLF'
if (baos.size()>3){
if (nR==4){
try {
DATA_STRING=Util.byteArrayToString(baos.toByteArray(), true);
data=MapUtil.parseString(DATA_STRING, ',');
route.name=data[2];
int fC=swapOziColor(Integer.parseInt(data[1]));
route.color=fC;
} catch (Exception e) {
route.name="Noname track";
}
}
}
if (nR>5){
//DATA_STRING = String.valueOf(s);//s.substring(5, s.length());
//TYPE = s.charAt(0);
DATA_STRING=Util.byteArrayToString(baos.toByteArray(), true);
// Check the gps data type and convert the information to a more readable format.
//if(TYPE == 'W'){
if (inRoute){
try {
data=MapUtil.parseString(','+DATA_STRING, ',');
double la=Double.parseDouble(data[0]);
double lo=Double.parseDouble(data[1]);
int al=(int) (Double.parseDouble(data[3])/3.280839895);
long ts=MapPoint.winTime2JavaTime(Double.parseDouble(data[4]));
pt=new MapPoint(la, lo, al, ts, null);
route.addMapPointFromTrackLoad(pt);
} catch (Exception e) {
}
}
}
nR++;
//TYPE += ":" + exc;
baos.reset();
// s = MapUtil.emptyString;
}
} while ((i!=-1));
}
public void setProgressResponse(ProgressResponse progressResponse) {
}
public boolean stopIt() {
stopped=true;
return true;
}
abstract void load();
public void run() {
try {
try {
load();
if (stopped){
return;
}
for (int i=routes.size()-1; i>=0; i--) {
MapRoute gpe=(MapRoute) routes.elementAt(i);
if (!gpe.isEmpty()){
MapCanvas.map.rmss.saveRoute(gpe);
}
}
} finally {
MapForms.mm.back2RoutesForm(true);
}
} catch (Exception e) {
}
}
static int swapOziColor(int oc) {
int r=oc&0xFF;
int g=oc&0xFF00;
int b=oc&0xFF0000;
return (r<<16)+(g)+(b>>16);
}
/**
* 10 14 182022
* 0123456789 11131517192123
* 12 16
* Converts data 2007-08-26T19:28:54Z in long
* Converts data 2007-08-26T19:28:54.123Z in long
*
*/
//TODO Исправить чтение миллисекунд
private long isoTime(String time) {
if ((time.length()==20 && time.charAt(19)!='Z')||(time.charAt(10)!='T')){
throw new IllegalArgumentException("Date has wrong format 20: "+time);
}
if ((time.length()==24 && time.charAt(23)!='Z')){
throw new IllegalArgumentException("Date has wrong format 24: "+time);
}
calendar.set(Calendar.YEAR, Integer.parseInt(time.substring(0, 4)));
calendar.set(Calendar.MONTH, Integer.parseInt(time.substring(5, 7))-1);
calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(time.substring(8, 10)));
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(time.substring(11, 13)));
calendar.set(Calendar.MINUTE, Integer.parseInt(time.substring(14, 16)));
calendar.set(Calendar.SECOND, Integer.parseInt(time.substring(17, 19)));
if (time.length()==20)
calendar.set(Calendar.MILLISECOND, 0);
else
calendar.set(Calendar.MILLISECOND, Integer.parseInt(time.substring(20, 23)));
return calendar.getTime().getTime();
}
private void readLabel(KXmlParser parser, MapPoint mp) throws IOException, XmlPullParserException {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, label);
while (parser.nextTag()!=XmlPullParser.END_TAG) {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
String tag=parser.getName();
//#debug
//# System.out.println("label<"+tag+">");
if (tag.equals(label_text)||tag.toLowerCase().equals(label_text)){
mp.name=parser.nextText();
} else {
parser.skipTree();
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, label);
//#debug
//# System.out.println("leaved extensions");
}
private void readExtension(KXmlParser parser, MapPoint mp) throws IOException, XmlPullParserException {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, extensions);
while (parser.nextTag()!=XmlPullParser.END_TAG) {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
String tag=parser.getName();
//#debug
//# System.out.println("extensions<"+tag+">");
if (tag.equals(label)||tag.toLowerCase().equals(label)){
readLabel(parser, mp);
} else {
parser.skipTree();
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, extensions);
//#debug
//# System.out.println("leaved extensions");
}
private void readWpt(KXmlParser parser, MapRoute mr) throws IOException, XmlPullParserException {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
MapPoint mp=new MapPoint(
Double.parseDouble(parser.getAttributeValue(null, lat)),
Double.parseDouble(parser.getAttributeValue(null, lon)), 0, 0);
while (parser.nextTag()!=XmlPullParser.END_TAG) {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
String tag=parser.getName();
//#debug
//# System.out.println("wpt<"+tag+">");
if (tag.equals(name)){
mp.name=parser.nextText();
} else if (tag.equals(desc)){
mp.name=parser.nextText();
} else if (tag.equals(time)){
mp.ts=isoTime(parser.nextText());
} else if (tag.equals(ele)){
mp.alt=(int) Double.parseDouble(parser.nextText());
} else if (tag.equals(extensions)){
readExtension(parser, mp);
} else {
parser.skipTree();
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
if (mr.kind==MapRoute.TRACKKIND){
mr.addMapPointFromTrackLoad(mp);
} else {
mr.addMapPoint(mp);
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
private void readTrkSeg(KXmlParser parser, MapRoute mr) throws IOException, XmlPullParserException {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
while (parser.nextTag()!=XmlPullParser.END_TAG) {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
String tag=parser.getName();
//#debug
//# System.out.println("trkseg<"+tag+">");
if (tag.equals(trkpt)){
readWpt(parser, mr);
} else {
parser.skipTree();
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
/*
private void readRtept(KXmlParser parser, MapRoute mr)throws IOException, XmlPullParserException{
//#debug
//# parser.require(XmlPullParser.START_TAG, null, rtept);
MapPoint mp = new MapPoint(
Double.parseDouble(parser.getAttributeValue(null,lat)),
Double.parseDouble(parser.getAttributeValue(null,lon)),0,0);
mr.addMapPoint(mp);
while (parser.nextTag() != XmlPullParser.END_TAG) {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
String tag = parser.getName();
//#debug
//# System.out.println("rtept<"+tag+">");
if (tag.equals(name)||tag.toLowerCase().equals(name))
mp.name=parser.nextText();
else if (parser.isEmptyElementTag())
parser.next();
else parser.skipSubTree();
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, rtept);
}*/
//final public static byte INHTTP=1;
//final public static byte INLOCFILE=2;
private String wpt="wpt";
private String rte="rte";
private String trk="trk";
private String time="time";
private String trkpt="trkpt";
private String rtept="rtept";
private String trkseg="trkseg";
private String ele="ele";
private String name="name";
private String desc="desc";
private String extensions="extensions";
private String label_text="label_text";
private String label="label";
private String lat="lat";
private String lon="lon";
void loadGPXWayPointsFromStream(InputStream is, byte loadKind) throws IOException {
//boolean readRoute
KXmlParser parser=new KXmlParser();
MapRoute mr=null;
if (loadKind==MapRoute.WAYPOINTSKIND){
mr=new MapRoute(MapRoute.WAYPOINTSKIND);
routes.addElement(mr);
mr.name=MapUtil.extractFilename(furl);
}
try {
parser.setInput(is, null);
parser.nextTag();
//#debug
//# parser.require(XmlPullParser.START_TAG, null, "gpx");
while (parser.nextTag()!=XmlPullParser.END_TAG) {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
String tag=parser.getName();
//#debug
//# System.out.println("tag<"+tag+">");
if (loadKind==MapRoute.ROUTEKIND){
if (tag.equals(rte)){
mr=new MapRoute(MapRoute.ROUTEKIND);
routes.addElement(mr);
while (parser.nextTag()!=XmlPullParser.END_TAG) {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
String gname=parser.getName();
//#debug
//# System.out.println("rte<"+gname+">");
if (gname.equals(name)){
mr.name=parser.nextText();
} else if (gname.equals(rtept)){
readWpt(parser, mr);
} else {
parser.skipTree();
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
} else {
parser.skipTree();
}
} else if (loadKind==MapRoute.WAYPOINTSKIND){
if (tag.equals(wpt)){
readWpt(parser, mr);
} else {
parser.skipTree();
}
} else if (loadKind==MapRoute.TRACKKIND){
if (tag.equals(trk)){
mr=new MapRoute(MapRoute.TRACKKIND);
routes.addElement(mr);
while (parser.nextTag()!=XmlPullParser.END_TAG) {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
String gname=parser.getName();
//#debug
//# System.out.println("trk<"+gname+">");
if (gname.equals(name)){
mr.name=parser.nextText();
} else if (gname.equals(trkseg)){
readTrkSeg(parser, mr);
} else {
parser.skipTree();
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
} else {
parser.skipTree();
}
} else {
parser.skipTree();
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, "gpx");
//#debug
//# //parser.require(XmlPullParser.END_DOCUMENT, null, null);
} catch (Exception e) {
//#debug
//# e.printStackTrace();
}
}
private String waypoint="waypoint";
void loadLOCWayPointsFromStream(InputStream is, boolean readRoute) throws IOException {
KXmlParser parser=new KXmlParser();
MapRoute mr=null;
if (!readRoute){
mr=new MapRoute(MapRoute.WAYPOINTSKIND);
routes.addElement(mr);
mr.name=MapUtil.extractFilename(furl);
mr.geoInfo=MapRoute.GEOINFO_GEOCACHECOM;
}
try {
parser.setInput(is, null);
parser.nextTag();
//#debug
//# parser.require(XmlPullParser.START_TAG, null, "loc");
while (parser.nextTag()!=XmlPullParser.END_TAG) {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
String tag=parser.getName().toLowerCase();
if (tag.equals(waypoint)){
readWaypoint(parser, mr);
} else {
parser.skipTree();
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, "loc");
//#debug
//# //parser.require(XmlPullParser.END_DOCUMENT, null, null);
} catch (Exception e) {
//#debug
//# e.printStackTrace();
}
}
private String coord="coord";
private void readWaypoint(KXmlParser parser, MapRoute mr) throws IOException, XmlPullParserException {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, waypoint);
MapPoint mp=new MapPoint(0, 0, 0, 0);
mr.addMapPoint(mp);
String s;
String[] data;
while (parser.nextTag()!=XmlPullParser.END_TAG) {
//#debug
//# parser.require(XmlPullParser.START_TAG, null, null);
String gname=parser.getName();
//#debug
//# System.out.println("Waypoint<"+gname+">");
if (gname.equals(name)){
mp.name=parser.nextText();
} else if (gname.equals(coord)){
String slon=parser.getAttributeValue(null, lon);
String slat=parser.getAttributeValue(null, lat);
mp.lon=Double.parseDouble(slon);
mp.lat=Double.parseDouble(slat);
mp.alt=0;
parser.skipTree();
} else if (gname.equals("link")){
mp.tag=parser.nextText();
} else {
parser.skipTree();
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, null);
}
//#debug
//# parser.require(XmlPullParser.END_TAG, null, waypoint);
//#debug
//# System.out.println("leaved Location");
}
}
| [
"pavelrv@yandex.ru"
] | pavelrv@yandex.ru |
3c8de84eeade8ef0450630dc8a3cda68e253ba97 | 469fcdefbc66cd835c38802107af538547d8af59 | /src/com/test/Hello.java | fb7a9a9e4b026d8e0a912cf7de266a1e2bfc61de | [] | no_license | Usmanrafique/Rest-Home | 69011eb90ba98aa6ab25258305a7bfed75a9e3a4 | fc24ece82ecb2c77c58a21f246bf099962f8b494 | refs/heads/master | 2020-03-16T06:20:53.935117 | 2018-05-08T04:01:27 | 2018-05-08T04:01:27 | 132,551,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,455 | java | package com.test;
import java.util.Properties;
import javax.ejb.EJB;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import com.ejb.GetProductBean;
@Path("/hello")
public class Hello {
/* public Hello() {
Properties p=new Properties();
p.put(Context.PROVIDER_URL, "t3://localhost:7001");
p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
try {
System.out.println("sdsad");
Context ctx=new InitialContext(p);
GetProductBean bean=(GetProductBean)ctx.lookup("MrBean");
System.out.println("Main.main(): " + bean.hello());
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// TODO Auto-generated constructor stub
} */
@GET
@Produces(MediaType.TEXT_PLAIN)
public String helloworld(){
Properties p=new Properties();
p.put(Context.PROVIDER_URL, "t3://localhost:7001");
p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
try {
System.out.println("Hassan");
Context ctx=new InitialContext(p);
GetProductBean bean=(GetProductBean)ctx.lookup("Mr#com.ejb.GetProductBean");
System.out.println("Main.main(): " + bean.hello());
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "Usman sahab";
}
} | [
"usmanrafeeq12@gmail.com"
] | usmanrafeeq12@gmail.com |
9465797a806ab91ccd5bd104c5eaaead8f59277a | 6d1e7a32d510e7c7d6335b0e541318fd3dcd2829 | /trunk/Dorian/src/fr/dorian/service/store/StoreException.java | 36df40ce92b7a92940c0269fdbf068f8a82a8e97 | [] | no_license | BGCX262/zut-svn-to-git | 40175d73cfd6dda94ba0e26941b4ce022b1278a5 | 720db40f50167314c6e727f1d7dfdd6b38d5aef3 | refs/heads/master | 2016-09-08T00:37:50.399139 | 2015-08-23T06:49:04 | 2015-08-23T06:49:04 | 41,251,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | package fr.dorian.service.store;
public class StoreException extends Exception {
private static final long serialVersionUID = 7135365961346383879L;
public static final StoreException ILLEGAL_ARGUMENT_ERROR = new StoreException("IllegalArgument.error");
public static final StoreException IOEXCEPTION = new StoreException("IOEXCEPTION");
public StoreException(final String message) {
super(message);
}
public StoreException(final StoreException businessException, final Throwable cause) {
super(businessException.getMessage(), cause);
}
public StoreException(Exception e) {
super("StoreException", e);
}
public StoreException(String string, Throwable e) {
super(string, e);
}
}
| [
"you@example.com"
] | you@example.com |
d8f5552683577a1502cd20fb420efaa0902cedfa | 0980e057fc5710632f4c3ac46f425bf336219ee3 | /app/src/main/java/com/perrygarg/khanapeena/common/constants/ResponseCodes.java | 14b76307bfc52442fac16120e346365266331df1 | [] | no_license | perrygarg/KhanaPeena | 5a2f1597288cf5caf0555d9683f525af4f5ae4e1 | 87dd954d4e32ca2aa70a74f9372fcfd643d7c0f9 | refs/heads/master | 2021-01-01T20:09:26.780258 | 2017-12-03T17:16:45 | 2017-12-03T17:16:45 | 98,780,461 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 277 | java | package com.perrygarg.khanapeena.common.constants;
/**
* @author perry.garg
* This interface contains all the known HTTP response codes, which are used inside application for handling HTTP response on basis of response code.
*/
public interface ResponseCodes {
}
| [
"perry.garg@magicsw.com"
] | perry.garg@magicsw.com |
c9b0fb84d4af7e6965f468e846cb636255f1b08e | 2aa3f548c703f1ca8cd7307fdad675a01cd0f224 | /net.sz.game.engine/src/main/java/net/sz/game/engine/utils/HttpUtils.java | 75ae3260b758da488f79fcffad03b1e0746c7164 | [] | no_license | TangDynasty06/net.sz.java | 12f3542eeee9ced95ecb8d81b120db7e1745de0c | 114eb169f66cb844e939c24f2eb16c742edf4c8e | refs/heads/master | 2021-01-19T10:09:58.591172 | 2017-02-06T07:56:38 | 2017-02-06T07:56:38 | 82,166,821 | 1 | 0 | null | 2017-02-16T10:05:42 | 2017-02-16T10:05:42 | null | UTF-8 | Java | false | false | 8,354 | java | package net.sz.game.engine.utils;
//package com.game.engine.utils;
//
//import java.io.ByteArrayOutputStream;
//import java.io.IOException;
//import java.io.InputStream;
//import java.io.OutputStream;
//import java.net.URL;
//import java.net.HttpURLConnection;
//import java.security.KeyManagementException;
//import java.security.NoSuchAlgorithmException;
//import java.security.cert.X509Certificate;
//import java.util.Base64;
//import javax.net.ssl.HostnameVerifier;
//import javax.net.ssl.HttpsURLConnection;
//import javax.net.ssl.SSLContext;
//import javax.net.ssl.SSLSession;
//import javax.net.ssl.X509TrustManager;
//
///**
// *
// */
//public class HttpUtils {
//
// public static ByteArrayOutputStream URLPost(String strUrl, String content) throws IOException {
// return URLPost(strUrl, null, content.getBytes("UTF-8"));
// }
//
// public static ByteArrayOutputStream URLPost(String strUrl, byte[] content) throws IOException {
// return URLPost(strUrl, null, content);
// }
//
// /**
// * POST METHOD
// *
// * @param strUrl String
// * @param contentType
// * @param content Map
// * @throws IOException
// * @return String
// */
// public static ByteArrayOutputStream URLPost(String strUrl, String contentType, byte[] content) throws IOException {
//
// URL url = new URL(strUrl);
// HttpURLConnection con = (HttpURLConnection) url.openConnection();
// try {
// // verifierHostname();
//
// con.setDoInput(true);
// con.setDoOutput(true);
// con.setAllowUserInteraction(false);
// con.setUseCaches(false);
// con.setRequestMethod("POST");
// // contentType = "application/x-www-form-urlencoded;charset=UTF-8"
// // contentType = "text/html; charset=UTF-8"
// if (contentType != null) {
// con.setRequestProperty("Content-Type", contentType);
// } else {
// con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
// }
//// else {
//// con.setRequestProperty("Content-Type", "text/html; charset=UTF-8");
//// }
// con.setRequestProperty("Content-Length", String.valueOf(content.length));
// con.setConnectTimeout(30000);// jdk 1.5换成这个,连接超时
// con.setReadTimeout(30000);// jdk 1.5换成这个,读操作超时
//
// try (OutputStream outputStream = con.getOutputStream()) {
// outputStream.write(content);
// outputStream.flush();
// }
//
// int responseCode = con.getResponseCode();
//
// if (HttpURLConnection.HTTP_OK == responseCode) {
// byte[] buffer = new byte[512];
// int len = -1;
// try (InputStream is = con.getInputStream()) {
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
// while ((len = is.read(buffer)) != -1) {
// bos.write(buffer, 0, len);
// }
// return bos;
// }
// }
// } catch (IOException ex) {
// ex.printStackTrace();
// } finally {
// if (null != con) {
// con.disconnect();
// }
// }
// return null;
// }
//
// public static ByteArrayOutputStream URLGet(String strUrl) throws IOException {
// return URLGet(strUrl, 30000);
// }
//
// /**
// * GET METHOD
// *
// * @param strUrl String
// * @param timeout
// * @throws IOException
// * @return List
// */
// public static ByteArrayOutputStream URLGet(String strUrl, int timeout) throws IOException {
// URL url = new URL(strUrl);
// HttpURLConnection con = (HttpURLConnection) url.openConnection();
// InputStream is = null;
// ByteArrayOutputStream bos = null;
// try {
// con.setUseCaches(false);
// con.setConnectTimeout(timeout);// jdk 1.5换成这个,连接超时
// con.setReadTimeout(timeout);// jdk 1.5换成这个,读操作超时
// HttpURLConnection.setFollowRedirects(true);
// int responseCode = con.getResponseCode();
// if (HttpURLConnection.HTTP_OK == responseCode) {
// // String headerField = con.getHeaderField("Content-Length");
// // System.out.println("Content-Length = " + headerField);
// byte[] buffer = new byte[512];
// int len = -1;
// is = con.getInputStream();
// bos = new ByteArrayOutputStream();
// while ((len = is.read(buffer)) != -1) {
// bos.write(buffer, 0, len);
// }
// return bos;
//
// }
// } catch (IOException ex) {
// ex.printStackTrace();
// } finally {
// con.disconnect();
// is.close();
// }
// return bos;
// }
//
// /**
// * 充值相关的HTTP请求使用
// * GET METHOD
// *
// * @param strUrl String
// * @throws IOException
// * @return List
// */
// public static ByteArrayOutputStream URLGetByRecharge(String strUrl) throws IOException {
// URL url = new URL(strUrl);
// HttpURLConnection con = (HttpURLConnection) url.openConnection();
// InputStream is = null;
// ByteArrayOutputStream bos = null;
// try {
// con.setUseCaches(false);
// con.setConnectTimeout(7000);// jdk 1.5换成这个,连接超时
// con.setReadTimeout(7000);// jdk 1.5换成这个,读操作超时
// HttpURLConnection.setFollowRedirects(true);
// int responseCode = con.getResponseCode();
// if (HttpURLConnection.HTTP_OK == responseCode) {
// // String headerField = con.getHeaderField("Content-Length");
// // System.out.println("Content-Length = " + headerField);
// byte[] buffer = new byte[512];
// int len = -1;
// is = con.getInputStream();
// bos = new ByteArrayOutputStream();
// while ((len = is.read(buffer)) != -1) {
// bos.write(buffer, 0, len);
// }
// return bos;
//
// }
// } catch (IOException ex) {
// ex.printStackTrace();
// } finally {
// con.disconnect();
// is.close();
// }
// return bos;
// }
//
// private static void verifierHostname() throws NoSuchAlgorithmException, KeyManagementException {
// SSLContext sslContext = null;
// sslContext = SSLContext.getInstance("TLS");
// X509TrustManager xtm = new X509TrustManager() {
// public void checkClientTrusted(X509Certificate[] chain,
// String authType) {
// }
//
// public void checkServerTrusted(X509Certificate[] chain,
// String authType) {
// }
//
// public X509Certificate[] getAcceptedIssuers() {
// return null;
// }
// };
// X509TrustManager[] xtmArray = new X509TrustManager[]{xtm};
// sslContext.init(null, xtmArray, new java.security.SecureRandom());
// if (sslContext != null) {
// HttpsURLConnection.setDefaultSSLSocketFactory(sslContext
// .getSocketFactory());
// }
// HostnameVerifier hnv = new HostnameVerifier() {
// public boolean verify(String hostname, SSLSession session) {
// return true;
// }
// };
// HttpsURLConnection.setDefaultHostnameVerifier(hnv);
// }
//
//
// public static void main(String[] args) throws IOException {
// String req = "http://120.132.90.138:8083/gamehttp?msgid=1&cmd=" + Base64.getEncoder().encodeToString("checkglobthreads".getBytes("UTF-8")) + "&playerid=10001001&token=01b90579-e9dc-4bca-900a-8234fd9d62fd";
// ByteArrayOutputStream URLGet = HttpUtils.URLGet(req);
// String res = new String(URLGet.toByteArray(), "UTF-8");
// System.out.println(res);
// }
//}
| [
"flynetwork@c0c9bd79-6bef-40f2-a21f-1516e17f5175"
] | flynetwork@c0c9bd79-6bef-40f2-a21f-1516e17f5175 |
1c0d9bfdb1b70eebec9dacd72c09438c84655fbf | b81431cc67aec6d8519a120295060ab4f306a592 | /NMAddress.java | 9ad19a9cd9b99808b23c328ca95068f6da0db756 | [] | no_license | BhanumitraJ/OracleATGDummyCode | edffbbcd1ce18133b9c71043c46ee403b4a71004 | 7746d938900919dcbc0c600eaca2575f00118f90 | refs/heads/main | 2023-06-06T18:53:33.482440 | 2021-06-30T07:22:03 | 2021-06-30T07:22:03 | 381,444,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,557 | java | /*
* <ATGCOPYRIGHT> Copyright (C) 1997-2000 Art Technology Group, Inc. All Rights Reserved. No use, copying or distribution of this work may be made except in accordance with a valid license agreement
* from Art Technology Group. This notice must be included on all copies, modifications and derivatives of this work.
*
* Art Technology Group (ATG) MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. ATG SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR
* ITS DERIVATIVES.
*
* "Dynamo" is a trademark of Art Technology Group, Inc. </ATGCOPYRIGHT>
*/
package com.nm.commerce;
import java.util.Date;
import atg.repository.MutableRepositoryItem;
import atg.repository.RepositoryException;
import atg.repository.RepositoryItem;
import com.nm.profile.ProfileProperties;
import com.nm.repository.MutableRepositoryItemDecorator;
import com.nm.utils.AddressNickname;
public class NMAddress extends MutableRepositoryItemDecorator {
// It is used to display registry(giftlist) name on ManageAddress as well as Ship To Multiple Addresses.
private String label;
public NMAddress(MutableRepositoryItem contactInfo) {
super(contactInfo);
updateNickname();
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String updateNickname() {
String nickname = createNickName(getRepositoryItem());
setNickname(nickname);
return nickname;
}
public String getAddressNickname() {
String nickname = createNickName(getRepositoryItem());
return nickname;
}
public static String createNickName(RepositoryItem contactInfo) {
if (contactInfo == null) {
return null;
}
try {
if (!contactInfo.getItemDescriptor().getItemDescriptorName().equals(ProfileProperties.Profile_Desc_contactInfo)) {
return null;
}
} catch (RepositoryException e) {
return null;
}
String firstName = (String) contactInfo.getPropertyValue(ProfileProperties.Contact_firstName);
String lastName = (String) contactInfo.getPropertyValue(ProfileProperties.Contact_lastName);
String address1 = (String) contactInfo.getPropertyValue(ProfileProperties.Contact_address1);
String city = (String) contactInfo.getPropertyValue(ProfileProperties.Contact_city);
String state = (String) contactInfo.getPropertyValue(ProfileProperties.Contact_state);
String zip = (String) contactInfo.getPropertyValue(ProfileProperties.Contact_postalCode);
String country = (String) contactInfo.getPropertyValue(ProfileProperties.Contact_country);
return AddressNickname.createNickname(firstName, lastName, address1, city, state, zip, country);
}
@Override
public void setRepositoryItem(RepositoryItem repositoryItem) {
try {
String type = repositoryItem.getItemDescriptor().getItemDescriptorName();
if (!type.equals(ProfileProperties.Profile_Desc_contactInfo)) {
throw new IllegalArgumentException(String.format("repository item must be of type '%s' was '%s'", ProfileProperties.Profile_Desc_contactInfo, type));
}
} catch (RepositoryException e) {
throw new RuntimeException(e);
}
super.setRepositoryItem(repositoryItem);
}
// printPropertyMethods()
public String getAddressType() {
return (String) getPropertyValue("addressType");
}
public void setAddressType(String addressType) {
setPropertyValue("addressType", addressType);
}
public String getPostalCode() {
return (String) getPropertyValue("postalCode");
}
public void setPostalCode(String postalCode) {
setPropertyValue("postalCode", postalCode);
}
public String getPrefix() {
return (String) getPropertyValue("prefix");
}
public void setPrefix(String prefix) {
setPropertyValue("prefix", prefix);
}
public String getCity() {
return (String) getPropertyValue("city");
}
public void setCity(String city) {
setPropertyValue("city", city);
}
public String getCountry() {
return (String) getPropertyValue("country");
}
public void setCountry(String country) {
setPropertyValue("country", country);
}
public String getPhoneNumber() {
return (String) getPropertyValue("phoneNumber");
}
public void setPhoneNumber(String phoneNumber) {
setPropertyValue("phoneNumber", phoneNumber);
}
public String getLastName() {
return (String) getPropertyValue("lastName");
}
public void setLastName(String lastName) {
setPropertyValue("lastName", lastName);
}
public String getCountyCode() {
return (String) getPropertyValue("countyCode");
}
public void setCountyCode(String countyCode) {
setPropertyValue("countyCode", countyCode);
}
public String getTitleCode() {
return (String) getPropertyValue("titleCode");
}
public void setTitleCode(String titleCode) {
setPropertyValue("titleCode", titleCode);
}
public String getState() {
return (String) getPropertyValue("state");
}
public void setState(String state) {
setPropertyValue("state", state);
}
public String getAddress3() {
return (String) getPropertyValue("address3");
}
public void setAddress3(String address3) {
setPropertyValue("address3", address3);
}
public String getAddress2() {
return (String) getPropertyValue("address2");
}
public void setAddress2(String address2) {
setPropertyValue("address2", address2);
}
public String getAddress1() {
return (String) getPropertyValue("address1");
}
public void setAddress1(String address1) {
setPropertyValue("address1", address1);
}
public String getJobTitle() {
return (String) getPropertyValue("jobTitle");
}
public void setJobTitle(String jobTitle) {
setPropertyValue("jobTitle", jobTitle);
}
public Integer getVerificationFlag() {
return (Integer) getPropertyValue("verificationFlag");
}
public void setVerificationFlag(Integer verificationFlag) {
setPropertyValue("verificationFlag", verificationFlag);
}
public String getAlias() {
return (String) getPropertyValue("alias");
}
public void setAlias(String alias) {
setPropertyValue("alias", alias);
}
public Boolean getFlgPOBox() {
return (Boolean) getPropertyValue("flgPOBox");
}
public void setFlgPOBox(Boolean flgPOBox) {
setPropertyValue("flgPOBox", flgPOBox);
}
public String getOwnerId() {
return (String) getPropertyValue("ownerId");
}
public void setOwnerId(String ownerId) {
setPropertyValue("ownerId", ownerId);
}
public Boolean getFlgCountyCodeVer() {
return (Boolean) getPropertyValue("flgCountyCodeVer");
}
public void setFlgCountyCodeVer(Boolean flgCountyCodeVer) {
setPropertyValue("flgCountyCodeVer", flgCountyCodeVer);
}
public String getFirstName() {
return (String) getPropertyValue("firstName");
}
public void setFirstName(String firstName) {
setPropertyValue("firstName", firstName);
}
public String getEvePhoneNumber() {
return (String) getPropertyValue("evePhoneNumber");
}
public void setEvePhoneNumber(String evePhoneNumber) {
setPropertyValue("evePhoneNumber", evePhoneNumber);
}
public String getFaxNumber() {
return (String) getPropertyValue("faxNumber");
}
public void setFaxNumber(String faxNumber) {
setPropertyValue("faxNumber", faxNumber);
}
public String getCompanyName() {
return (String) getPropertyValue("companyName");
}
public void setCompanyName(String companyName) {
setPropertyValue("companyName", companyName);
}
public String getCounty() {
return (String) getPropertyValue("county");
}
public void setCounty(String county) {
setPropertyValue("county", county);
}
public String getProvince() {
return (String) getPropertyValue("province");
}
public void setProvince(String province) {
setPropertyValue("province", province);
}
public String getId() {
return (String) getPropertyValue("id");
}
public void setId(String id) {
setPropertyValue("id", id);
}
public String getFirmName() {
return (String) getPropertyValue("firmName");
}
public void setFirmName(String firmName) {
setPropertyValue("firmName", firmName);
}
public String getNickname() {
return (String) getPropertyValue("nickname");
}
public void setNickname(String nickname) {
setPropertyValue("nickname", nickname);
}
public String getPhoneType() {
return (String) getPropertyValue("phoneType");
}
public void setPhoneType(String phoneType) {
setPropertyValue("phoneType", phoneType);
}
public String getDayPhoneExt() {
return (String) getPropertyValue("dayPhoneExt");
}
public void setDayPhoneExt(String dayPhoneExt) {
setPropertyValue("dayPhoneExt", dayPhoneExt);
}
public String getSuffix() {
return (String) getPropertyValue("suffix");
}
public void setSuffix(String suffix) {
setPropertyValue("suffix", suffix);
}
public String getMiddleName() {
return (String) getPropertyValue("middleName");
}
public void setMiddleName(String middleName) {
setPropertyValue("middleName", middleName);
}
public String getSuffixCode() {
return (String) getPropertyValue("suffixCode");
}
public void setSuffixCode(String suffixCode) {
setPropertyValue("suffixCode", suffixCode);
}
public String getEvePhoneExt() {
return (String) getPropertyValue("evePhoneExt");
}
public void setEvePhoneExt(String evePhoneExt) {
setPropertyValue("evePhoneExt", evePhoneExt);
}
public Double getGeoCodeLatitude() {
return (Double) getPropertyValue("geoCodeLatitude");
}
public void setGeoCodeLatitude(Double geoCodeLatitude) {
setPropertyValue("geoCodeLatitude", geoCodeLatitude);
}
public Double getGeoCodeLongitude() {
return (Double) getPropertyValue("geoCodeLongitude");
}
public void setGeoCodeLongitude(Double geoCodeLongitude) {
setPropertyValue("geoCodeLongitude", geoCodeLongitude);
}
public String getGeoCodeTaxKey() {
return (String) getPropertyValue("geoCodeTaxKey");
}
public void setGeoCodeTaxKey(String geoCodeTaxKey) {
setPropertyValue("geoCodeTaxKey", geoCodeTaxKey);
}
public Boolean getGeoCodeRefreshFlag() {
return (Boolean) getPropertyValue("geoCodeRefreshFlag");
}
public void setGeoCodeRefreshFlag(Boolean geoCodeRefreshFlag) {
setPropertyValue("geoCodeRefreshFlag", geoCodeRefreshFlag);
}
public Date getLastGeoCodeReqDate() {
return (Date) getPropertyValue("lastGeoCodeReqDate");
}
public void setLastGeoCodeReqDate(Date lastGeoCodeReqDate) {
setPropertyValue("lastGeoCodeReqDate", lastGeoCodeReqDate);
}
}
| [
"sushreesaritaswain@Sushrees-MacBook-Air.local"
] | sushreesaritaswain@Sushrees-MacBook-Air.local |
1acede8579ee8892cf8c61f5f5734b2206683d00 | abe94b34f17668a63d2f6892daf927b4b0be5926 | /Java/OCA Java SE 8 - Part-1/CodingPractice/src/main/java/chapter_6/InterFace1.java | 80e750bf836eb509c455decb052bf6703fa08fdd | [] | no_license | shshetudev/Certifications | c65dd62e0822219158f22167305c19909bae90b0 | b0c5eb5bff3c51615bbaebdbb21e6edacb1212c7 | refs/heads/main | 2023-02-12T13:02:39.607345 | 2021-01-08T05:39:04 | 2021-01-08T05:39:04 | 316,673,641 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package chapter_6;
public interface InterFace1 {
String name = "shetu";
void print();
default void printNow() {
System.out.println("InterFace1: Default method: printNow()");
}
static void printStatic(){
System.out.println("InterFace1: static method execution");
}
}
| [
"shahariar.hossen@datsoft-bd.com"
] | shahariar.hossen@datsoft-bd.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.