blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
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
689M
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
131 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
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
077d0d48e5897f5d3d54fe3970888958f0d75517
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14302-15-19-PESA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/XWikiHibernateRecycleBinStore$DeletedDocumentsBatchHibernateCallback_ESTest_scaffolding.java
b8161d57d85492864eca354170ddc34fac9db384
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
492
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Apr 04 10:57:34 UTC 2020 */ package com.xpn.xwiki.store; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class XWikiHibernateRecycleBinStore$DeletedDocumentsBatchHibernateCallback_ESTest_scaffolding { // Empty scaffolding for empty test suite }
947ca3ded286801d93b588cf181861ce3ce242fa
30c893ab5eb21e94f2f7063fe97d0f1090c557fd
/java/com/funcy/g01/dispatcher/bo/selectChannel/SelectChannelInfo.java
a10421da9f3e67c7197871a488008badc040f425
[]
no_license
ChengLongAndroid/Bread
c4afd865fa77861ed924b5b2df646c49535528d9
247ec498bcc525d60620f455009feb6709391838
refs/heads/master
2020-03-21T09:11:03.438826
2018-06-23T09:46:31
2018-06-23T09:46:31
138,386,471
0
0
null
null
null
null
UTF-8
Java
false
false
903
java
package com.funcy.g01.dispatcher.bo.selectChannel; import com.funcy.g01.base.global.ServerConfig; public class SelectChannelInfo { private final long roomId; private int serverId; private String channelName; private int friendsNum; public SelectChannelInfo(long roomId, int serverId, int friendsNum) { this.roomId = roomId; this.serverId = serverId; this.channelName = String.format(ServerConfig.channelNamePattern, roomId); this.friendsNum = friendsNum; } public int getFriendsNum() { return friendsNum; } public void setFriendsNum(int friendsNum) { this.friendsNum = friendsNum; } public long getRoomId() { return roomId; } public String getChannelName(){ return channelName; } public int getServerId() { return serverId; } public void setServerId(int serverId) { this.serverId = serverId; } }
1c0facbba0ae8ef5948e042d3465bf459b5551d7
86bdb73c1a97747c4aba6589e74ef5f86b1a4fa7
/modules/hk-lucene-builder/src/main/java/org/hawkore/ignite/lucene/builder/search/Search.java
96271bc8fabbdfadbb4c4d9cf8dab7a70d94aa83
[ "Apache-2.0", "BSD-3-Clause", "LicenseRef-scancode-gutenberg-2020", "CC0-1.0" ]
permissive
hawkore/ignite-hk
72f7b4f345e814ea1e20be148ec8af16ed1d7cef
8084a90c0fc80a667fa4387f60b4bf8f925b5590
refs/heads/master
2022-11-11T03:20:28.228882
2022-10-21T04:31:03
2022-10-21T04:31:03
164,684,281
6
3
Apache-2.0
2022-04-12T22:00:58
2019-01-08T15:59:41
Java
UTF-8
Java
false
false
3,977
java
/* * Copyright (C) 2014 Stratio (http://stratio.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.hawkore.ignite.lucene.builder.search; import java.util.List; import org.hawkore.ignite.lucene.builder.JSONBuilder; import org.hawkore.ignite.lucene.builder.search.condition.Condition; import org.hawkore.ignite.lucene.builder.search.sort.Sort; import org.hawkore.ignite.lucene.builder.search.sort.SortField; import org.hawkore.ignite.lucene.search.SearchBuilder; import com.fasterxml.jackson.annotation.JsonProperty; /** * Class representing an Lucene index search. It is formed by an optional querying {@link Condition} and an optional * filtering {@link Condition}. * * @author Andres de la Pena {@literal <[email protected]>} */ @SuppressWarnings("unused") public class Search extends JSONBuilder { /** The filtering conditions not participating in scoring. */ @JsonProperty("filter") private List<Condition> filter; /** The querying conditions participating in scoring. */ @JsonProperty("query") private List<Condition> query; /** The {@link Sort} for the query, maybe {@code null} meaning no filtering. */ @JsonProperty("sort") private List<SortField> sort; /** The paging size. */ @JsonProperty("limit") private Integer limit; /** the offset, rows to skip */ @JsonProperty("offset") private Integer offset; /** If this search must force the refresh the index before reading it. */ @JsonProperty("refresh") private Boolean refresh; /** Default constructor. */ public Search() { } /** * Returns this with the specified filtering conditions not participating in scoring. * * @param conditions the filtering conditions to be added * @return this with the specified filtering conditions */ public Search filter(Condition... conditions) { filter = add(filter, conditions); return this; } /** * Returns this with the specified querying conditions participating in scoring. * * @param conditions the mandatory conditions to be added * @return this with the specified mandatory conditions */ public Search query(Condition... conditions) { query = add(query, conditions); return this; } /** * Sets the sorting fields. * * @param fields the sorting fields to be added * @return this with the specified sorting fields */ public Search sort(SortField... fields) { sort = add(sort, fields); return this; } /** * Sets if the {@link Search} must refresh the Lucene's index searcher before using it. Refresh is a costly * operation so you should use it only when it is strictly required. * * @param refresh if the {@link Search} must refresh the index before reading it * @return this with the specified refresh */ public Search refresh(Boolean refresh) { this.refresh = refresh; return this; } /** * The paging size. * * @param limit * * @return this for chaining */ public Search limit(int limit) { this.limit = limit; return this; } /** * the offset, rows to skip * * @param offset * * @return this for chaining */ public Search offset(int offset) { this.offset = offset; return this; } }
628a80c2672bb24c7bc08e521bed886432186c09
774d36285e48bd429017b6901a59b8e3a51d6add
/sources/com/onesignal/GcmIntentService.java
a05a76a62f131e57c1820934b6ba07ecc1b8d1f5
[]
no_license
jorge-luque/hb
83c086851a409e7e476298ffdf6ba0c8d06911db
b467a9af24164f7561057e5bcd19cdbc8647d2e5
refs/heads/master
2023-08-25T09:32:18.793176
2020-10-02T11:02:01
2020-10-02T11:02:01
300,586,541
0
0
null
null
null
null
UTF-8
Java
false
false
709
java
package com.onesignal; import android.app.IntentService; import android.content.Context; import android.content.Intent; import android.os.Bundle; import com.onesignal.C4739z; import p075d.p088f.p089a.C3217a; public class GcmIntentService extends IntentService { public GcmIntentService() { super("GcmIntentService"); setIntentRedelivery(true); } /* access modifiers changed from: protected */ public void onHandleIntent(Intent intent) { Bundle extras = intent.getExtras(); if (extras != null) { C4714x.m16405a((Context) this, (C4528j) new C4534k(extras), (C4739z.C4740a) null); C3217a.completeWakefulIntent(intent); } } }
fba9a1d9ab44e69eea50d6aa1be5d143fbf2cd32
93e5b776173db5ff5fa38df97a8db819822239a1
/src/com/prasanta/inheri.java
063c4857678b64941f60aff7c40013040e8ef11a
[]
no_license
helloprasantakumar/JavaProgram
f875ed34d44d8119f9a2636a852e54f2d9a5d5dc
18d6a6e91e33f76e65ebdb61c29a0e2df6c42c6e
refs/heads/master
2023-05-25T00:01:30.825653
2019-07-04T13:13:05
2019-07-04T13:13:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
360
java
package com.prasanta; class top { int a; top(int x) { a=x; } } class middle extends top { int square() { return(a*a); } } class bottom extends middle { void cube() { int c; c=a*a*a; System.out.println("Cube is "+c); } } class inheri { public static void main(String[] args) { bottom ob= new bottom(5); ob.square(); ob.cube(); } }
bca5c33f67bdf05ab05fccf9ffe36f48cc6b628d
bca05ca835b82ef385627c72abe376084f0ea2d1
/app/src/main/java/com/rain/customcheckbox/MainActivity.java
08868268fecaf8d5c7f22bf80c3749d05a0c42c5
[]
no_license
caihuanjian/CustomCheckBox
180aa716821dca4111b34989260e141493485f9b
d18ab638a66a37c63fa526320dfb89532f1d6259
refs/heads/master
2021-06-29T23:56:42.211127
2017-09-20T07:30:40
2017-09-20T07:30:40
104,074,274
0
0
null
null
null
null
UTF-8
Java
false
false
1,351
java
package com.rain.customcheckbox; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.Toast; import com.rain.customcheckbox.views.CustomCheckBox; public class MainActivity extends AppCompatActivity { private CustomCheckBox customCheckBox1, customCheckBox2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); customCheckBox1 = (CustomCheckBox) findViewById(R.id.checkbox1); customCheckBox2 = (CustomCheckBox) findViewById(R.id.checkbox2); customCheckBox1.setOnCheckChangedListener(new CustomCheckBox.onCheckChangedListener() { @Override public void onCheckChange(CustomCheckBox checkBox, boolean isChecked) { Toast.makeText(MainActivity.this, "checkbox1 " + (isChecked ? " checked " : "unchecked"), Toast.LENGTH_SHORT).show(); } }); customCheckBox2.setOnCheckChangedListener(new CustomCheckBox.onCheckChangedListener() { @Override public void onCheckChange(CustomCheckBox checkBox, boolean isChecked) { Toast.makeText(MainActivity.this, "checkbox2 " + (isChecked ? " checked " : "unchecked"), Toast.LENGTH_SHORT).show(); } }); } }
dbfe0fbd63f86240477c26dc1dacfa2e2631018a
a3c652f48f384ca7f77420a03b2cdb53617524ec
/src/main/java/com/oocl/parkingLot/serviceImpl/ParkingLotServiceImpl.java
aa462257a4dff1cc744ec800496e915fe0706e42
[]
no_license
LIANGCA2/week4-spring-parkinglot-demo-1
02b1543b1cc72d67ff6b83b43f503020159fe447
b9e56e47a8363f074e011c22e933b75b98e4db08
refs/heads/master
2020-03-23T23:52:05.438431
2018-07-25T13:41:56
2018-07-25T13:41:56
142,260,141
0
0
null
null
null
null
UTF-8
Java
false
false
1,938
java
package com.oocl.parkingLot.serviceImpl; import com.oocl.parkingLot.ParkingLotApplication; import com.oocl.parkingLot.model.ParkingBoy; import com.oocl.parkingLot.model.ParkingLot; import com.oocl.parkingLot.service.ParkingLotService; import org.springframework.stereotype.Service; import java.util.List; import java.util.stream.Collectors; @Service("parkingLotService") public class ParkingLotServiceImpl implements ParkingLotService { private List<ParkingLot> parkingLotList = ParkingLotApplication.allParkingLot(); @Override public List<ParkingLot> findAllParkingLot() { return parkingLotList; } @Override public List<ParkingLot> addParkingLot(ParkingLot parkingLot) { parkingLotList.add(parkingLot); return parkingLotList; } @Override public ParkingLot findNotFullParkingLot(ParkingBoy parkingBoy) throws Exception { List<ParkingLot> parkingLots = findAllParkingLot().stream().filter(item -> item.getParkingBoyId() == parkingBoy.getId() && item.getRemainSize() > 0).limit(1).collect(Collectors.toList()); if(parkingLots.size()>0){ return parkingLots.get(0); }else{ throw new Exception("没有空余的车位"); } } @Override public void ReduceParkingLotRemainSize(ParkingLot parkingLot) { List<ParkingLot> allParkingLot = findAllParkingLot(); for(int i =0;i<allParkingLot.size();i++){ if(allParkingLot.get(i).getId()==parkingLot.getId()){ allParkingLot.get(i).setRemainSize(allParkingLot.get(i).getRemainSize()-1); } } } @Override public void unpark(Integer parkingLotId) { for(int i = 0;i<parkingLotList.size();i++){ if(parkingLotList.get(i).getParkingBoyId()==parkingLotId){ parkingLotList.get(i).setRemainSize(parkingLotList.get(i).getRemainSize()+1); } } } }
[ "CAROL T T LIANG (ITA-ISDC-ISD-OOCLL/ZHA) [email protected]" ]
CAROL T T LIANG (ITA-ISDC-ISD-OOCLL/ZHA) [email protected]
7b39a846e9e6e2ade237f9feab9d23dec3ef05bb
d8355496fd0622a07525f825f7d7fa084d3d591c
/teams/hq_search/GeneralNavigation.java
b560c208e6dabd935f5cdc84034a7d0c0636dac5
[]
no_license
brittcyr/battlecode-caddar
18100a64f6af3826451576394cbe9af16e8745f5
fcbb2397325d52d4bb1a1642de9b3132c596fcb1
refs/heads/master
2016-09-11T08:46:54.155352
2014-02-07T16:26:05
2014-02-07T16:26:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,361
java
package hq_search; import battlecode.common.Direction; import battlecode.common.MapLocation; import battlecode.common.RobotController; public class GeneralNavigation { static Direction[] directions = { Direction.NORTH, Direction.NORTH_EAST, Direction.EAST, Direction.SOUTH_EAST, Direction.SOUTH, Direction.SOUTH_WEST, Direction.WEST, Direction.NORTH_WEST }; static MapLocation target; static MapLocation lastWaypoint; static int coarseness; public static void setupNav(RobotController rc, int _coarseness, MapLocation _target) { target = _target; coarseness = _coarseness; lastWaypoint = null; } public static int detectMyCoarseX(RobotController rc) { MapLocation myLoc = rc.getLocation(); int myX = myLoc.x; return myX / coarseness; } public static int detectMyCoarseY(RobotController rc) { MapLocation myLoc = rc.getLocation(); int myY = myLoc.y; return myY / coarseness; } public static MapLocation getMyCenter(RobotController rc) { int coarseX = detectMyCoarseX(rc); int coarseY = detectMyCoarseY(rc); int fineX = coarseX * coarseness + coarseness / 2; int fineY = coarseY * coarseness + coarseness / 2; return new MapLocation(fineX, fineY); } public static MapLocation getNextCenter(RobotController rc, int coarseness, Direction d) { MapLocation myCenter = getMyCenter(rc); return myCenter.add(d, coarseness); } public static void smartNav(RobotController rc) { // Do smart navigation to enemy int coarseX = GeneralNavigation.detectMyCoarseX(rc); int coarseY = GeneralNavigation.detectMyCoarseY(rc); int directionNum = Dijkstra.previous[coarseY][coarseX]; // This means that we are close to the target and should just use bug if (directionNum == Dijkstra.UNSET) { BugNavigator.navigateTo(rc, target); return; } Direction toWaypoint = directions[directionNum]; MapLocation waypoint = GeneralNavigation.getNextCenter(rc, coarseness, toWaypoint); if (!waypoint.equals(lastWaypoint)) { BugNavigator.bugReset(); lastWaypoint = waypoint; } BugNavigator.navigateTo(rc, waypoint); } }
d930cac5531c606b5e7c2c582d655b3af050886a
1a01383d9816b2b77491a002c5641f43ab3a43aa
/cmz-shardingjdbc-yml/src/main/java/com/cmz/service/OrderItemService.java
efcd8b4b4aad54b2bf9b1e2daa6894349bee4938
[]
no_license
cmzdandan/cmz-shardingjdbc
02f47d4948c5db0ecb39ebf1c9cdb7fa846a2dcb
9bdda72dc3b6e135f1cbff0e75e53dccbc012336
refs/heads/master
2023-06-20T21:01:05.629871
2019-11-01T08:55:43
2019-11-01T08:55:43
218,948,948
0
0
null
2023-06-14T16:39:10
2019-11-01T08:51:33
Java
UTF-8
Java
false
false
428
java
package com.cmz.service; import com.cmz.dao.OrderItemDao; import com.cmz.entity.OrderItem; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class OrderItemService { @Autowired private OrderItemDao orderItemDao; public long addOne(OrderItem item){ this.orderItemDao.addOne(item); return item.getOrderItemId(); } }
8af121421a4798a2005f8dd39ba317b74f932aeb
e9cb29ed252e100e3b2f79c742954f738122edb3
/src/main/java/src/exception/SimpleJavaCrawlerException.java
ed3f18457fefdfa0e278161d64d9b7b3d47b1bf9
[]
no_license
zcx1218029121/simple_crawler
56396664af5c10b68886f7f1de1e67160bdcca33
ef8859daadf7ffdc070948f5d221d9643dfe81a6
refs/heads/master
2023-05-09T07:26:28.901679
2020-07-20T10:03:48
2020-07-20T10:03:48
275,561,040
0
0
null
2021-06-04T02:43:34
2020-06-28T10:28:36
Java
UTF-8
Java
false
false
462
java
package src.exception; /** * @ProjectName: simple_java_crawler * @Package: src.exception * @ClassName: SimpleJavaCrawler * @Author: loafer * @Description: * @Date: 2020/7/13 10:35 * @Version: 1.0 */ public class SimpleJavaCrawlerException extends RuntimeException { public SimpleJavaCrawlerException(String msg){ super(msg); } public SimpleJavaCrawlerException(String msg,Throwable throwable){ super(msg,throwable); } }
6da4e434c857b829b77fd721eaf58231b2ca3806
6780b4fe21a20641b25b746e78b31b982969d2ed
/src/main/java/com/otto/design/pattern/structural/adapter/AC220.java
c9db54406a28f972d04967a1672601f88a1f4809
[]
no_license
daydaydo/design_pattern
8446edcd0e102f588cdc251b32457e5f154b5c7e
f880b54db1861d2620672e54b77ec4c6b2f60781
refs/heads/master
2023-06-19T08:49:29.230034
2021-07-25T14:35:37
2021-07-25T14:35:37
381,073,030
0
0
null
2021-07-25T14:35:38
2021-06-28T15:08:02
Java
UTF-8
Java
false
false
332
java
package com.otto.design.pattern.structural.adapter; /** * program: design_pattern * description: AC220 * *@author: gqchu * create: 2021-07-19 22:36 **/ public class AC220 { public int outputAC220V() { int output = 220; System.out.println("输出220V的交流电"+output+"V"); return output; } }
44e62a9f4a4ac17e70cbfc8df8dc6c6a5143b263
746c57dfbee8236d79c6e5e7c057ad3d64c3d83a
/src/frontend/parse/ast/AndExpr.java
73cfd884621381428e8ef396a1b34f7788e1cada
[]
no_license
robert-w-gries/javar
2a428feac16bfac0ea0b08f35dca68496e1a52d6
52a6f158f262cbc4e52562cdec58df7ae0379022
refs/heads/master
2021-03-19T10:58:47.429648
2018-02-22T01:43:55
2018-02-22T01:43:55
33,518,774
0
0
null
null
null
null
UTF-8
Java
false
false
552
java
package frontend.parse.ast; import frontend.typecheck.Type; import frontend.translate.Exp; import frontend.translate.Translate; /** * Boolean (Logical) And Expressions. */ public class AndExpr extends BinOpExpr{ public AndExpr(Expr e1, Expr e2){ super(e1, e2); } /** * Visitor pattern dispatch. */ public void accept(Visitor v){ v.visit(this); } @Override public Type accept(TypeVisitor v) { return v.visit(this); } public Exp accept(Translate t) { return t.visit(this);} }
3bb06560ceffd6ce5956a218e378a28589e91361
0f98a039bc9fd8acdac1d5ac7a25ac33dbc0a83f
/mavenweb/src/main/java/com/cts/training/mavenweb/entity/Follow.java
bc0f9ac87822a07ce31e267e63e39bb64c2497ae
[]
no_license
priyachokhande-123/CognizantTraining
da1b6254899e44b53cde47a19e08deddc3ecca4c
c6591eedf317e84d80728bf2ec0250918c8f6c45
refs/heads/master
2022-12-23T02:19:35.773738
2020-03-12T12:07:30
2020-03-12T12:07:30
234,699,612
0
0
null
2022-12-16T15:24:41
2020-01-18T07:43:18
Java
UTF-8
Java
false
false
1,449
java
package com.cts.training.mavenweb.entity; import java.time.LocalDateTime; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.CreationTimestamp; import org.hibernate.annotations.UpdateTimestamp; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; @Getter @Setter @AllArgsConstructor @NoArgsConstructor @ToString @Entity // Registers the class as entity //Define the mappings @Table(name = "follow") public class Follow { @Column private Integer followerId; @ManyToOne() @JoinColumn(name="user_Id") private UserDetails user; @CreationTimestamp @Column private LocalDateTime createdOn; @UpdateTimestamp @Column private LocalDateTime updatedOn; /* public Follow() { } public Integer getFollowerId() { return followerId; } public void setFollowerId(Integer followerId) { this.followerId = followerId; } public LocalDateTime getCreatedOn() { return createdOn; } public void setCreatedOn(LocalDateTime createdOn) { this.createdOn = createdOn; } public LocalDateTime getUpdatedOn() { return updatedOn; } public void setUpdatedOn(LocalDateTime updatedOn) { this.updatedOn = updatedOn; } */ }
c53c2cade9167bf5b3e4c7ffec48d370b0f62bf8
693c0d8b51e23752ae2e94d907f5e4f90de02572
/src/main/java/com/test/springBoot/kafka/CustomerTest.java
09503a99ec20667e616bb467b25fa04bd6ae7cb1
[ "Apache-2.0" ]
permissive
wyj2080/springBoot
aaa0eaff838f75eb32efd83673eda20d4c772aaa
032fe4bc8992c2ed93d6083d9ffbcc39aaf141a8
refs/heads/master
2023-05-01T03:08:33.902900
2023-04-24T13:11:13
2023-04-24T13:11:13
221,373,202
0
0
Apache-2.0
2022-11-28T12:14:16
2019-11-13T04:34:49
JavaScript
UTF-8
Java
false
false
3,312
java
package com.test.springBoot.kafka; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecords; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.util.Arrays; import java.util.Properties; /** * @Description: 消费者 * @Author: wangyinjia * @Date: 2019/10/28 * @Version: 1.0 */ //@Service public class CustomerTest { //连接参数 private Properties properties; //消费者 private KafkaConsumer<String, String> kafkaConsumer; /** * 消费组构造 * @param servers 服务器 */ CustomerTest(@Value("${kafka.servers}") String servers){ properties = new Properties(); properties.put("bootstrap.servers", servers); properties.put("group.id", "group-1"); properties.put("enable.auto.commit", "true"); properties.put("auto.commit.interval.ms", "1000"); properties.put("auto.offset.reset", "earliest"); properties.put("session.timeout.ms", "30000"); properties.put("max.poll.records","100000"); properties.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer"); properties.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer"); kafkaConsumer = new KafkaConsumer<>(properties); } /** * 接收消息 * @param size 条数 * @throws InterruptedException */ public void receive(Integer size) throws InterruptedException { kafkaConsumer.subscribe(Arrays.asList("jcftest","joker","test")); Integer num = 0; if(size != null){ String last = ""; for(int i = 0;i<size;i++){ ConsumerRecords<String, String> records = kafkaConsumer.poll(100); for (ConsumerRecord<String, String> record : records) { last = "topic = "+record.topic()+", offset = "+record.offset()+", value = "+record.value()+", partion = "+record.partition(); // System.out.printf("topic = %s, offset = %d, value = %s, partion = %s", record.topic(), record.offset(), record.value(), record.partition()); // System.out.println("====================================>"); num++; if(num%100000 == 0){ System.out.println(num); } } } System.out.println(num+"条"); System.out.println(last); }else{ while (true) { ConsumerRecords<String, String> records = kafkaConsumer.poll(100); for (ConsumerRecord<String, String> record : records) { // System.out.printf("topic = %s, offset = %d, value = %s, partion = %s", record.topic(), record.offset(), record.value(), record.partition()); // System.out.println("====================================>"); num++; if(num%100000 == 0){ System.out.println(num); } } } } } public void close(){ kafkaConsumer.close(); } }
a17ad452b82288c3e06df2d44f2b5b443ab370a1
2500307b8261c7dfb0f9e2533428f6e6c2d69b75
/src/com/Java/_831_Masking_Personal_Information_隐藏个人信息.java
ed5f0c38087c6b978c72ed671668955ca40d8402
[]
no_license
caokeya/IDEA
2f763985333032f67d2e65ad2ae91e2170f02ab2
c70972bb41e3f4dd41268b1e65b8132f56506252
refs/heads/master
2021-07-07T20:49:36.239172
2019-03-06T06:53:53
2019-03-06T06:53:53
149,573,270
1
0
null
null
null
null
UTF-8
Java
false
false
3,470
java
package src.com.Java; /* 给你一条个人信息 string S,它可能是一个邮箱地址,也可能是一个电话号码。 我们将隐藏它的隐私信息,通过如下规则: 1. 电子邮箱 定义名称 <name> 的长度大于2,并且只包含小写字母 a-z 和大写字母 A-Z。 电子邮箱地址由名称 <name> 开头,紧接着是符号 '@',后面接着一个名称 <name>,再接着一个点号 '.',然后是一个名称 <name>。 电子邮箱地址确定为有效的,并且格式是"[email protected]"。 为了隐藏电子邮箱,所有的名称 <name> 必须被转换成小写的,并且第一个名称 <name> 的第一个字母和最后一个字母的中间的所有字母由 5 个 '*' 代替。 2. 电话号码 电话号码是一串包括数组 0-9,以及 {'+', '-', '(', ')', ' '} 这几个字符的字符串。你可以假设电话号码包含 10 到 13 个数字。 电话号码的最后 10 个数字组成本地号码,在这之前的数字组成国际号码。注意,国际号码是可选的。我们只暴露最后 4 个数字并隐藏所有其他数字。 本地号码是有格式的,并且如 "***-***-1111" 这样显示,这里的 1 表示暴露的数字。 为了隐藏有国际号码的电话号码,像 "+111 111 111 1111",我们以 "+***-***-***-1111" 的格式来显示。 在本地号码前面的 '+' 号和第一个 '-' 号仅当电话号码中包含国际号码时存在。例如,一个 12 位的电话号码应当以 "+**-" 开头进行显示。 注意:像 "(",")"," " 这样的不相干的字符以及不符合上述格式的额外的减号或者加号都应当被删除。 最后,将提供的信息正确隐藏后返回。 示例 1: 输入: "[email protected]" 输出: "l*****[email protected]" 解释: 所有的名称转换成小写, 第一个名称的第一个字符和最后一个字符中间由 5 个星号代替。 因此,"leetcode" -> "l*****e"。 示例 2: 输入: "[email protected]" 输出: "a*****[email protected]" 解释: 第一个名称"ab"的第一个字符和最后一个字符的中间必须有 5 个星号 因此,"ab" -> "a*****b"。 示例 3: 输入: "1(234)567-890" 输出: "***-***-7890" 解释: 10 个数字的电话号码,那意味着所有的数字都是本地号码。 示例 4: 输入: "86-(10)12345678" 输出: "+**-***-***-5678" 解释: 12 位数字,2 个数字是国际号码另外 10 个数字是本地号码 。 */ public class _831_Masking_Personal_Information_隐藏个人信息 { class Solution { public String maskPII(String S) { if (S.contains("@")) { String l = S.toLowerCase(); return l.substring(0, 1) + "*****" + l.charAt(l.indexOf("@") - 1) + l.substring(l.indexOf("@")); } else { String ph = ""; for (int i = 0; i < S.length(); i++) { char c = S.charAt(i); if (Character.isDigit(c)) { ph += c; } } int len = ph.length(); if (len == 10) { return "***-***-" + ph.substring(6); } else { String star = ""; for (int i = 0; i < len - 10; i++) { star += "*"; } return "+" + star + "-***-***-" + ph.substring(ph.length() - 4); } } } } }
1afdeffdb57271738c2dea2320c0f413adc4aaf4
dcba3dfaf38d3aed0401408370611d45a14726e9
/src/main/java/ru/kpfu/itis/ibragimovaidar/movie_searcher_app/web/servlet/ReviewServlet.java
b80185c5e8f6c8d60dd2bff1a9996b9e35700a38
[]
no_license
ibragimovaidar/movie_searcher_app
b39e42871051ab349147c2bb8185adc27ce45ebf
e63ea3efe704a066acba845a82c4185e836978ab
refs/heads/main
2023-09-03T23:09:59.358812
2021-11-02T20:40:22
2021-11-02T20:40:22
414,691,160
0
0
null
2021-11-02T20:40:23
2021-10-07T17:09:07
null
UTF-8
Java
false
false
1,849
java
package ru.kpfu.itis.ibragimovaidar.movie_searcher_app.web.servlet; import com.fasterxml.jackson.databind.ObjectMapper; import ru.kpfu.itis.ibragimovaidar.movie_searcher_app.dto.ReviewDTO; import ru.kpfu.itis.ibragimovaidar.movie_searcher_app.dto.ReviewForm; import ru.kpfu.itis.ibragimovaidar.movie_searcher_app.dto.ReviewModalDTO; import ru.kpfu.itis.ibragimovaidar.movie_searcher_app.service.ReviewService; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; 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 java.io.IOException; import java.io.PrintWriter; import java.nio.charset.StandardCharsets; @WebServlet(name = "reviewServlet", urlPatterns = "/review") public class ReviewServlet extends HttpServlet { private ReviewService reviewService; private ObjectMapper objectMapper; @Override public void init(ServletConfig config) throws ServletException { ServletContext servletContext = config.getServletContext(); reviewService = (ReviewService) servletContext.getAttribute(ReviewService.class.getName()); objectMapper = (ObjectMapper) servletContext.getAttribute(ObjectMapper.class.getName()); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Integer id = Integer.parseInt(request.getParameter("id")); ReviewModalDTO reviewModalDTO = reviewService.getReviewModalDTO(id).orElseThrow(ServletException::new); response.setCharacterEncoding(StandardCharsets.UTF_8.name()); response.setContentType("application/json"); try (PrintWriter writer = response.getWriter()){ writer.write(objectMapper.writeValueAsString(reviewModalDTO)); } } }
0a764513c9cc4547b01780f4932e886d6f41a942
a4c59640fc35a5efeadb4bc54d66b188479b1eaa
/app/src/androidTest/java/com/adithya/healthcare/ecgmonitor/ApplicationTest.java
063b46ce1cea766cef18e81551ad2e850e7fd8a7
[ "MIT" ]
permissive
gadithyaraju21/Android_ECG_Monitor
7ba56e830c2d5433fafff9f05c2c01fbfea4e1f8
1de89d5b3a8a679d6656834c3f3a501e538121f6
refs/heads/master
2020-12-02T17:56:15.927152
2017-07-06T16:53:01
2017-07-06T16:53:01
96,449,487
2
3
null
null
null
null
UTF-8
Java
false
false
364
java
package com.adithya.healthcare.ecgmonitor; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "g.adithya raju" ]
g.adithya raju
5821b644f609846a8a65d7a959f7982c8a0b4488
99167cb93fdf3f7de58e2e9df646ff85411c6e57
/src/util/Util.java
27a00725e4031b4df19b8857ce134108e2f5fac3
[]
no_license
PedroMonteiro7/estacionamentoFinalSemestre1Java
aab4f63dff81279e0c4471417ea38f07c33fbe0c
6c493ece9bc9ff7541a241bef5884470e63b4baa
refs/heads/main
2023-06-17T16:00:16.407633
2021-07-13T00:18:21
2021-07-13T00:18:21
385,420,724
1
0
null
null
null
null
UTF-8
Java
false
false
176
java
package util; import java.util.UUID; public class Util { public static String gerarCodigo() { return UUID.randomUUID().toString().substring(0, 8).toUpperCase(); } }
b0450609718bb92f688131971c3106c95b9ea44f
537b3a622f307ff8f5d32c92e02c0ffca721b1be
/mystudy/HeadFirst/src/main/java/design/patterns/decorator/starbuzz/CondimentDecorator.java
d4cb47c52b8124fff4b58e28f02b632ab5a6a720
[]
no_license
hotinh/mygit
b01cb92efcd6e037acf897db6ed73bba01ad5a0a
54d6a8c5ed8f66afbb97baf482dcbc6982d91b9b
refs/heads/master
2021-07-12T03:05:57.519248
2019-01-26T13:41:43
2019-01-26T13:41:43
104,535,060
0
0
null
null
null
null
UTF-8
Java
false
false
149
java
package design.patterns.decorator.starbuzz; public abstract class CondimentDecorator extends Beverage { public abstract String getDescription(); }
9979dd6a5a840d78b8ceb4ccb0b786ee69e41390
3668940d22248c25014f355f108b74f2446a5601
/src/com/egame/beans/ProductListBean.java
8ac429f9d8feb438f706e4af55ae3ab35f70b1a6
[]
no_license
nicochofly/NormalVersion
c1a5a93b901825605b1d657c5c8e34c09aa74a93
142acc86b7a231bc84b5d0d712a4ac105c2a05ee
refs/heads/master
2021-05-26T14:33:10.248040
2013-07-23T05:24:29
2013-07-23T05:24:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,611
java
package com.egame.beans; import org.json.JSONObject; import com.egame.utils.ui.IconBeanImpl; /** * * 类说明:产品列表 * * @创建时间 2012-2-3 * @创建人: 王先云 * @邮箱:[email protected] */ public class ProductListBean extends IconBeanImpl { /** 产品名称 */ private String productName; /** 产品ID */ private String productId; /** 产品类型 */ private int productType; /** 访问地址 */ private String linkUrl; public ProductListBean(JSONObject obj) { super(obj.optString("picture")); this.productName = obj.optString("productName"); this.productId = obj.optString("productId"); this.productType = obj.optInt("productType"); this.linkUrl = obj.optString("linkUrl"); } public String getProductName() { return productName; } public void setProductName(String productName) { this.productName = productName; } public String getProductId() { return productId; } public void setProductId(String productId) { this.productId = productId; } public int getProductType() { return productType; } public void setProductType(int productType) { this.productType = productType; } public String getLinkUrl() { return linkUrl; } public void setLinkUrl(String linkUrl) { this.linkUrl = linkUrl; } }
50d1ea3dd2240269a02b00ac2da1b19a2c1923cf
57dcc3b1694eb2e3bf3e3622c169a7284eb5328c
/src/main/java/com/betterprojectsfaster/talks/openj9memory/security/SecurityUtils.java
1a96ef9038323a815c671a8d427ff516f8103097
[]
no_license
ksilz/issue-intellij-typescript-implement-method
11a5929a8753da302322aeaa3344701a5b816035
1c5528ce9e8c5756220a9faa8083856143a65a7c
refs/heads/master
2022-11-13T16:20:30.729502
2020-07-13T06:14:05
2020-07-13T06:14:05
278,880,514
0
0
null
null
null
null
UTF-8
Java
false
false
3,139
java
package com.betterprojectsfaster.talks.openj9memory.security; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import java.util.Optional; import java.util.stream.Stream; /** * Utility class for Spring Security. */ public final class SecurityUtils { private SecurityUtils() { } /** * Get the login of the current user. * * @return the login of the current user. */ public static Optional<String> getCurrentUserLogin() { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(extractPrincipal(securityContext.getAuthentication())); } private static String extractPrincipal(Authentication authentication) { if (authentication == null) { return null; } else if (authentication.getPrincipal() instanceof UserDetails) { UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal(); return springSecurityUser.getUsername(); } else if (authentication.getPrincipal() instanceof String) { return (String) authentication.getPrincipal(); } return null; } /** * Get the JWT of the current user. * * @return the JWT of the current user. */ public static Optional<String> getCurrentUserJWT() { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) .filter(authentication -> authentication.getCredentials() instanceof String) .map(authentication -> (String) authentication.getCredentials()); } /** * Check if a user is authenticated. * * @return true if the user is authenticated, false otherwise. */ public static boolean isAuthenticated() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && getAuthorities(authentication).noneMatch(AuthoritiesConstants.ANONYMOUS::equals); } /** * If the current user has a specific authority (security role). * <p> * The name of this method comes from the {@code isUserInRole()} method in the Servlet API. * * @param authority the authority to check. * @return true if the current user has the authority, false otherwise. */ public static boolean isCurrentUserInRole(String authority) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && getAuthorities(authentication).anyMatch(authority::equals); } private static Stream<String> getAuthorities(Authentication authentication) { return authentication.getAuthorities().stream() .map(GrantedAuthority::getAuthority); } }
ef7f84a0c69ec2ed9ca8c99adfabdb10bde16643
7e3961feb86331772f56c3c9632ec6de8225eafd
/bfs/CloneGraph.java
3ce87b8e9aa67886801c99eec541b22e1e8b51fa
[]
no_license
jialuyyy/Leetcode
0b11dbd328aef7fb18e397311e9bc27fdc58a5f2
16fc35ed0756db56db40782a45224ee2151c1160
refs/heads/master
2021-01-23T12:58:25.139130
2020-02-26T13:44:55
2020-02-26T13:44:55
93,215,029
3
1
null
null
null
null
UTF-8
Java
false
false
3,775
java
// bfs to find all the node and copy the value, and put the copied node and original node into a hashmap, use a hashset to avoid pushing duplciates // after building the relationship between the original node and the copied node, copy the neighbors. use the hashset to iterate over the // nodes in the graph, for every node, iterate over their neighbors and building the neighboring relationship between the copied nodes. //Time Complexity: O(n) //Space Complexity: O(n) //two pass /** * Definition for undirected graph. * class UndirectedGraphNode { * int label; * List<UndirectedGraphNode> neighbors; * UndirectedGraphNode(int x) { label = x; neighbors = new ArrayList<UndirectedGraphNode>(); } * }; */ public class CloneGraph { public UndirectedGraphNode cloneGraph(UndirectedGraphNode node) { if (node == null) { return null; } Queue<UndirectedGraphNode> q = new ArrayDeque<UndirectedGraphNode>(); Set<UndirectedGraphNode> set = new HashSet<UndirectedGraphNode>(); Map<UndirectedGraphNode, UndirectedGraphNode> map = new HashMap<UndirectedGraphNode, UndirectedGraphNode>(); q.offer(node); set.add(node); while(!q.isEmpty()) { UndirectedGraphNode cur = q.poll(); UndirectedGraphNode newNode = new UndirectedGraphNode(cur.label); map.put(cur, newNode); for (UndirectedGraphNode neighbor: cur.neighbors) { if (!set.contains(neighbor)) { q.offer(neighbor); set.add(neighbor); } } } for (UndirectedGraphNode n: set) { UndirectedGraphNode copied = map.get(n); for (UndirectedGraphNode neighbor: n.neighbors) { copied.neighbors.add(map.get(neighbor)); } } return map.get(node); } //one pass solution //Time complexity: O(n) //Space Complexity: O(n) /** * Definition for undirected graph. * class UndirectedGraphNode { * int label; * List<UndirectedGraphNode> neighbors; * UndirectedGraphNode(int x) { label = x; neighbors = new ArrayList<UndirectedGraphNode>(); } * }; */ public class Solution { public UndirectedGraphNode cloneGraph(UndirectedGraphNode node) { if (node == null) { return null; } Map<UndirectedGraphNode,UndirectedGraphNode> map = new HashMap<UndirectedGraphNode,UndirectedGraphNode>(); Queue<UndirectedGraphNode> q = new ArrayDeque<UndirectedGraphNode>(); q.offer(node); map.put(node, new UndirectedGraphNode(node.label)); while (!q.isEmpty()) { UndirectedGraphNode cur = q.poll(); for (UndirectedGraphNode neighbor : cur.neighbors) { if (map.get(neighbor) == null) { map.put(neighbor, new UndirectedGraphNode(neighbor.label)); q.offer(neighbor); } map.get(cur).neighbors.add(map.get(neighbor)); } } return map.get(node); } } } //depth first traversal class Solution { private Map<Node, Node> map = new HashMap<>(); public Node cloneGraph(Node node) { if (node == null) return null; if (map.containsKey(node)) { return map.get(node); } Node cloned = new Node(node.val); map.put(node, cloned); for (Node neighbor : node.neighbors) { cloned.neighbors.add(cloneGraph(neighbor)); } return cloned; } }
8daf2f2b3dda065e0b8d9d709bac80939691f0ae
c2fd4a4e0f88def0f88145810904126e8e334efe
/DEVOPES/src/test/java/com/test/AppTest.java
c77bae35e00f0b637fe541d8fc430fb669cc0f45
[]
no_license
RaviParamasivan/DEVOPES
8b96bea9bc0555589a3431f1c6834c906fcee603
980673e7cd7c8c29ec30ea6610f45c10f61eedd7
refs/heads/master
2021-01-17T05:24:30.694181
2015-08-30T22:37:59
2015-08-30T22:37:59
41,445,496
0
0
null
null
null
null
UTF-8
Java
false
false
282
java
package com.test; import static org.junit.Assert.*; import org.junit.Test; /** * Unit test for simple App. */ public class AppTest { @Test public void testDev() { App app = new App(); String test = app.testDev(); assertNotNull(test); } }
[ "Arun@Arun-PC" ]
Arun@Arun-PC
74217517c3e041ab2f36e1a92e1cd28bfac3769c
c87b68b3f7a819cec8baddc8cb855120fc7cf68b
/app/src/main/java/com/wzq/duorou/chat/parse/UserProfileManager.java
cb692c835ab4fdedfc6434342b0838398b5de47f
[]
no_license
ggyuer/DuoRou
072fff9496bd9c6ec57fcb010ca7676c571f8dc7
c3f7d085485d0a392ba004f7851c8c78ac5865f3
refs/heads/master
2021-01-20T08:10:10.530273
2017-05-06T10:53:35
2017-05-06T10:53:35
90,105,202
0
0
null
null
null
null
UTF-8
Java
false
false
4,745
java
package com.wzq.duorou.chat.parse; import android.content.Context; import com.hyphenate.EMValueCallBack; import com.hyphenate.chat.EMClient; import com.hyphenate.easeui.domain.EaseUser; import com.wzq.duorou.MyHelper; import com.wzq.duorou.MyHelper.DataSyncListener; import com.wzq.duorou.utils.PreferenceManager; import java.util.ArrayList; import java.util.List; public class UserProfileManager { /** * application context */ protected Context appContext = null; /** * init flag: test if the sdk has been inited before, we don't need to init * again */ private boolean sdkInited = false; /** * HuanXin sync contact nick and avatar listener */ private List<MyHelper.DataSyncListener> syncContactInfosListeners; private boolean isSyncingContactInfosWithServer = false; private EaseUser currentUser; public UserProfileManager() { } public synchronized boolean init(Context context) { if (sdkInited) { return true; } ParseManager.getInstance().onInit(context); syncContactInfosListeners = new ArrayList<DataSyncListener>(); sdkInited = true; return true; } public void addSyncContactInfoListener(DataSyncListener listener) { if (listener == null) { return; } if (!syncContactInfosListeners.contains(listener)) { syncContactInfosListeners.add(listener); } } public void removeSyncContactInfoListener(DataSyncListener listener) { if (listener == null) { return; } if (syncContactInfosListeners.contains(listener)) { syncContactInfosListeners.remove(listener); } } public void asyncFetchContactInfosFromServer(List<String> usernames, final EMValueCallBack<List<EaseUser>> callback) { if (isSyncingContactInfosWithServer) { return; } isSyncingContactInfosWithServer = true; ParseManager.getInstance().getContactInfos(usernames, new EMValueCallBack<List<EaseUser>>() { @Override public void onSuccess(List<EaseUser> value) { isSyncingContactInfosWithServer = false; // in case that logout already before server returns,we should // return immediately if (!MyHelper.getInstance().isLoggedIn()) { return; } if (callback != null) { callback.onSuccess(value); } } @Override public void onError(int error, String errorMsg) { isSyncingContactInfosWithServer = false; if (callback != null) { callback.onError(error, errorMsg); } } }); } public void notifyContactInfosSyncListener(boolean success) { for (DataSyncListener listener : syncContactInfosListeners) { listener.onSyncComplete(success); } } public boolean isSyncingContactInfoWithServer() { return isSyncingContactInfosWithServer; } public synchronized void reset() { isSyncingContactInfosWithServer = false; currentUser = null; PreferenceManager.getInstance().removeCurrentUserInfo(); } public synchronized EaseUser getCurrentUserInfo() { if (currentUser == null) { String username = EMClient.getInstance().getCurrentUser(); currentUser = new EaseUser(username); String nick = getCurrentUserNick(); currentUser.setNick((nick != null) ? nick : username); currentUser.setAvatar(getCurrentUserAvatar()); } return currentUser; } public boolean updateCurrentUserNickName(final String nickname) { boolean isSuccess = ParseManager.getInstance().updateParseNickName(nickname); if (isSuccess) { setCurrentUserNick(nickname); } return isSuccess; } public String uploadUserAvatar(byte[] data) { String avatarUrl = ParseManager.getInstance().uploadParseAvatar(data); if (avatarUrl != null) { setCurrentUserAvatar(avatarUrl); } return avatarUrl; } public void asyncGetCurrentUserInfo() { ParseManager.getInstance().asyncGetCurrentUserInfo(new EMValueCallBack<EaseUser>() { @Override public void onSuccess(EaseUser value) { if(value != null){ setCurrentUserNick(value.getNick()); setCurrentUserAvatar(value.getAvatar()); } } @Override public void onError(int error, String errorMsg) { } }); } public void asyncGetUserInfo(final String username,final EMValueCallBack<EaseUser> callback){ ParseManager.getInstance().asyncGetUserInfo(username, callback); } private void setCurrentUserNick(String nickname) { getCurrentUserInfo().setNick(nickname); PreferenceManager.getInstance().setCurrentUserNick(nickname); } private void setCurrentUserAvatar(String avatar) { getCurrentUserInfo().setAvatar(avatar); PreferenceManager.getInstance().setCurrentUserAvatar(avatar); } private String getCurrentUserNick() { return PreferenceManager.getInstance().getCurrentUserNick(); } private String getCurrentUserAvatar() { return PreferenceManager.getInstance().getCurrentUserAvatar(); } }
64a17a916bcdcc281ade444127ab65f3a3c16eae
c2e2e14fbde09c46b4481b5d896cd30e2a041fab
/hadoop_setup/nextPartitioner.java
4d00b7dbf5852f72cb01f3d2194b8143b4860f57
[]
no_license
VikNim/Relative_Frequency
4c29d570da80a30dcf4ebeb7a0bfdf4baed5f66e
04e650e07445f8c1c66d45c72d69ee46d2ba8dd7
refs/heads/master
2022-04-03T03:03:15.941368
2020-02-25T10:06:36
2020-02-25T10:06:36
242,957,468
1
0
null
null
null
null
UTF-8
Java
false
false
364
java
import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.mapreduce.Partitioner; public class nextPartitioner extends Partitioner<wordNext,IntWritable> { @Override public int getPartition(wordNext wordPair, IntWritable intWritable, int numPartitions) { return (wordPair.getWord().hashCode() & Integer.MAX_VALUE ) % numPartitions; } }
1f50184f5ebbdfa13085cdcdacf2b339faf74834
78b028649f2147d52fee98a4328c043eaac30cdc
/app/src/main/java/com/cheezycode/techiedesi/MessagingService.java
f35cada215ea3769091bb32488e93d810d73e895
[]
no_license
vishaldroidx/Blog
68b52bcc394aaa71801030d4295fdf335023ce77
26dab93d1e1f89b758fbd5d2a83deec9bc33afa1
refs/heads/master
2022-04-26T16:20:54.764293
2020-04-27T08:47:05
2020-04-27T08:47:05
259,059,749
0
0
null
null
null
null
UTF-8
Java
false
false
1,204
java
package com.cheezycode.techiedesi; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Intent; import androidx.core.app.NotificationCompat; import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; public class MessagingService extends FirebaseMessagingService { @Override public void onMessageReceived(RemoteMessage remoteMessage) { showNotification(remoteMessage.getNotification().getBody()); } public void showNotification(String message) { PendingIntent pi = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0); Notification notification = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_stat_name) .setContentTitle("Techie Desi") .setContentText(message) .setContentIntent(pi) .setAutoCancel(true) .build(); NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); notificationManager.notify(0, notification); } }
aa1dc9f10d39b29aee2b177c2283e6a2324bd035
fc160694094b89ab09e5c9a0f03db80437eabc93
/java-datacatalog/proto-google-cloud-datacatalog-v1/src/main/java/com/google/cloud/datacatalog/v1/TagTemplateFieldEnumValueName.java
2345369aa0c9150ed0b286febc7342a57dd8b5cb
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
googleapis/google-cloud-java
4f4d97a145e0310db142ecbc3340ce3a2a444e5e
6e23c3a406e19af410a1a1dd0d0487329875040e
refs/heads/main
2023-09-04T09:09:02.481897
2023-08-31T20:45:11
2023-08-31T20:45:11
26,181,278
1,122
685
Apache-2.0
2023-09-13T21:21:23
2014-11-04T17:57:16
Java
UTF-8
Java
false
false
9,498
java
/* * Copyright 2023 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.cloud.datacatalog.v1; import com.google.api.pathtemplate.PathTemplate; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. @Generated("by gapic-generator-java") public class TagTemplateFieldEnumValueName implements ResourceName { private static final PathTemplate PROJECT_LOCATION_TAG_TEMPLATE_TAG_TEMPLATE_FIELD_ID_ENUM_VALUE_DISPLAY_NAME = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{tag_template_field_id}/enumValues/{enum_value_display_name}"); private volatile Map<String, String> fieldValuesMap; private final String project; private final String location; private final String tagTemplate; private final String tagTemplateFieldId; private final String enumValueDisplayName; @Deprecated protected TagTemplateFieldEnumValueName() { project = null; location = null; tagTemplate = null; tagTemplateFieldId = null; enumValueDisplayName = null; } private TagTemplateFieldEnumValueName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); location = Preconditions.checkNotNull(builder.getLocation()); tagTemplate = Preconditions.checkNotNull(builder.getTagTemplate()); tagTemplateFieldId = Preconditions.checkNotNull(builder.getTagTemplateFieldId()); enumValueDisplayName = Preconditions.checkNotNull(builder.getEnumValueDisplayName()); } public String getProject() { return project; } public String getLocation() { return location; } public String getTagTemplate() { return tagTemplate; } public String getTagTemplateFieldId() { return tagTemplateFieldId; } public String getEnumValueDisplayName() { return enumValueDisplayName; } public static Builder newBuilder() { return new Builder(); } public Builder toBuilder() { return new Builder(this); } public static TagTemplateFieldEnumValueName of( String project, String location, String tagTemplate, String tagTemplateFieldId, String enumValueDisplayName) { return newBuilder() .setProject(project) .setLocation(location) .setTagTemplate(tagTemplate) .setTagTemplateFieldId(tagTemplateFieldId) .setEnumValueDisplayName(enumValueDisplayName) .build(); } public static String format( String project, String location, String tagTemplate, String tagTemplateFieldId, String enumValueDisplayName) { return newBuilder() .setProject(project) .setLocation(location) .setTagTemplate(tagTemplate) .setTagTemplateFieldId(tagTemplateFieldId) .setEnumValueDisplayName(enumValueDisplayName) .build() .toString(); } public static TagTemplateFieldEnumValueName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } Map<String, String> matchMap = PROJECT_LOCATION_TAG_TEMPLATE_TAG_TEMPLATE_FIELD_ID_ENUM_VALUE_DISPLAY_NAME.validatedMatch( formattedString, "TagTemplateFieldEnumValueName.parse: formattedString not in valid format"); return of( matchMap.get("project"), matchMap.get("location"), matchMap.get("tag_template"), matchMap.get("tag_template_field_id"), matchMap.get("enum_value_display_name")); } public static List<TagTemplateFieldEnumValueName> parseList(List<String> formattedStrings) { List<TagTemplateFieldEnumValueName> list = new ArrayList<>(formattedStrings.size()); for (String formattedString : formattedStrings) { list.add(parse(formattedString)); } return list; } public static List<String> toStringList(List<TagTemplateFieldEnumValueName> values) { List<String> list = new ArrayList<>(values.size()); for (TagTemplateFieldEnumValueName value : values) { if (value == null) { list.add(""); } else { list.add(value.toString()); } } return list; } public static boolean isParsableFrom(String formattedString) { return PROJECT_LOCATION_TAG_TEMPLATE_TAG_TEMPLATE_FIELD_ID_ENUM_VALUE_DISPLAY_NAME.matches( formattedString); } @Override public Map<String, String> getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder<String, String> fieldMapBuilder = ImmutableMap.builder(); if (project != null) { fieldMapBuilder.put("project", project); } if (location != null) { fieldMapBuilder.put("location", location); } if (tagTemplate != null) { fieldMapBuilder.put("tag_template", tagTemplate); } if (tagTemplateFieldId != null) { fieldMapBuilder.put("tag_template_field_id", tagTemplateFieldId); } if (enumValueDisplayName != null) { fieldMapBuilder.put("enum_value_display_name", enumValueDisplayName); } fieldValuesMap = fieldMapBuilder.build(); } } } return fieldValuesMap; } public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } @Override public String toString() { return PROJECT_LOCATION_TAG_TEMPLATE_TAG_TEMPLATE_FIELD_ID_ENUM_VALUE_DISPLAY_NAME.instantiate( "project", project, "location", location, "tag_template", tagTemplate, "tag_template_field_id", tagTemplateFieldId, "enum_value_display_name", enumValueDisplayName); } @Override public boolean equals(Object o) { if (o == this) { return true; } if (o != null || getClass() == o.getClass()) { TagTemplateFieldEnumValueName that = ((TagTemplateFieldEnumValueName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.location, that.location) && Objects.equals(this.tagTemplate, that.tagTemplate) && Objects.equals(this.tagTemplateFieldId, that.tagTemplateFieldId) && Objects.equals(this.enumValueDisplayName, that.enumValueDisplayName); } return false; } @Override public int hashCode() { int h = 1; h *= 1000003; h ^= Objects.hashCode(project); h *= 1000003; h ^= Objects.hashCode(location); h *= 1000003; h ^= Objects.hashCode(tagTemplate); h *= 1000003; h ^= Objects.hashCode(tagTemplateFieldId); h *= 1000003; h ^= Objects.hashCode(enumValueDisplayName); return h; } /** * Builder for * projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{tag_template_field_id}/enumValues/{enum_value_display_name}. */ public static class Builder { private String project; private String location; private String tagTemplate; private String tagTemplateFieldId; private String enumValueDisplayName; protected Builder() {} public String getProject() { return project; } public String getLocation() { return location; } public String getTagTemplate() { return tagTemplate; } public String getTagTemplateFieldId() { return tagTemplateFieldId; } public String getEnumValueDisplayName() { return enumValueDisplayName; } public Builder setProject(String project) { this.project = project; return this; } public Builder setLocation(String location) { this.location = location; return this; } public Builder setTagTemplate(String tagTemplate) { this.tagTemplate = tagTemplate; return this; } public Builder setTagTemplateFieldId(String tagTemplateFieldId) { this.tagTemplateFieldId = tagTemplateFieldId; return this; } public Builder setEnumValueDisplayName(String enumValueDisplayName) { this.enumValueDisplayName = enumValueDisplayName; return this; } private Builder(TagTemplateFieldEnumValueName tagTemplateFieldEnumValueName) { this.project = tagTemplateFieldEnumValueName.project; this.location = tagTemplateFieldEnumValueName.location; this.tagTemplate = tagTemplateFieldEnumValueName.tagTemplate; this.tagTemplateFieldId = tagTemplateFieldEnumValueName.tagTemplateFieldId; this.enumValueDisplayName = tagTemplateFieldEnumValueName.enumValueDisplayName; } public TagTemplateFieldEnumValueName build() { return new TagTemplateFieldEnumValueName(this); } } }
542f5a209b8ae8b7da293cdb4fb2d684cae31568
02ca8deb98e29620ac54ffec09a3399d6cb91252
/modules/axelor-message/src/main/java/com/axelor/apps/message/service/MailAccountServiceImpl.java
0798ac6fc103e62dfca11af175a8db86741540ba
[]
no_license
jhalak040/Event-Module
c6003bafbb426b14cee50522e9bb894517ed403a
73b93e2ec077e094037a1d0966471e9243c13c0e
refs/heads/master
2020-04-02T08:55:31.592791
2018-10-23T06:02:25
2018-10-23T06:02:25
154,267,734
0
0
null
null
null
null
UTF-8
Java
false
false
11,737
java
/* * Axelor Business Solutions * * Copyright (C) 2018 Axelor (<http://axelor.com>). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.axelor.apps.message.service; import java.io.IOException; import java.io.InputStream; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.activation.DataSource; import javax.mail.AuthenticationFailedException; import javax.mail.FetchProfile; import javax.mail.Flags; import javax.mail.Folder; import javax.mail.MessagingException; import javax.mail.NoSuchProviderException; import javax.mail.Session; import javax.mail.Store; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.mail.search.FlagTerm; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.axelor.apps.message.db.EmailAccount; import com.axelor.apps.message.db.EmailAddress; import com.axelor.apps.message.db.Message; import com.axelor.apps.message.db.repo.EmailAccountRepository; import com.axelor.apps.message.db.repo.EmailAddressRepository; import com.axelor.apps.message.db.repo.MessageRepository; import com.axelor.apps.message.exception.IExceptionMessage; import com.axelor.apps.tool.date.DateTool; import com.axelor.apps.tool.service.CipherService; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.i18n.I18n; import com.axelor.mail.ImapAccount; import com.axelor.mail.MailConstants; import com.axelor.mail.MailParser; import com.axelor.mail.MailReader; import com.axelor.mail.Pop3Account; import com.axelor.mail.SmtpAccount; import com.axelor.meta.MetaFiles; import com.google.common.collect.Lists; import com.google.inject.Inject; import com.google.inject.persist.Transactional; public class MailAccountServiceImpl implements MailAccountService { private final Logger log = LoggerFactory.getLogger(MailAccountServiceImpl.class); static final int CHECK_CONF_TIMEOUT = 5000; @Inject protected EmailAccountRepository mailAccountRepo; @Inject private CipherService cipherService; @Inject protected EmailAddressRepository emailAddressRepo; @Inject private MessageRepository messageRepo; @Inject private MetaFiles metaFiles; @Override public void checkDefaultMailAccount(EmailAccount mailAccount) throws AxelorException { if (mailAccount.getIsDefault()) { String query = "self.isDefault = true"; List<Object> params = Lists.newArrayList(); if (mailAccount.getId() != null) { query += " AND self.id != ?1"; params.add(mailAccount.getId()); } Integer serverTypeSelect = mailAccount.getServerTypeSelect(); if (serverTypeSelect == EmailAccountRepository.SERVER_TYPE_SMTP) { query += " AND self.serverTypeSelect = " + EmailAccountRepository.SERVER_TYPE_SMTP + " "; } else if (serverTypeSelect == EmailAccountRepository.SERVER_TYPE_IMAP || serverTypeSelect == EmailAccountRepository.SERVER_TYPE_POP) { query += " AND (self.serverTypeSelect = " + EmailAccountRepository.SERVER_TYPE_IMAP + " OR " + "self.serverTypeSelect = " + EmailAccountRepository.SERVER_TYPE_POP + ") "; } Long count = mailAccountRepo.all().filter(query, params.toArray()).count(); if (count > 0) { throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.MAIL_ACCOUNT_5)); } } } @Override public EmailAccount getDefaultSender() { return mailAccountRepo.all() .filter("self.isDefault = true AND self.serverTypeSelect = ?1", EmailAccountRepository.SERVER_TYPE_SMTP) .fetchOne(); } @Override public EmailAccount getDefaultReader() { return mailAccountRepo.all() .filter("self.isDefault = true " + "AND (self.serverTypeSelect = ?1 OR self.serverTypeSelect = ?2)", EmailAccountRepository.SERVER_TYPE_IMAP, EmailAccountRepository.SERVER_TYPE_POP) .fetchOne(); } @Override public void checkMailAccountConfiguration(EmailAccount mailAccount) throws AxelorException, Exception { com.axelor.mail.MailAccount account = getMailAccount(mailAccount); Session session = account.getSession(); try { if (mailAccount.getServerTypeSelect().equals(EmailAccountRepository.SERVER_TYPE_SMTP)) { Transport transport = session.getTransport(getProtocol(mailAccount)); transport.connect(mailAccount.getHost(), mailAccount.getPort(), mailAccount.getLogin(), mailAccount.getPassword()); transport.close(); } else { session.getStore().connect(); } } catch (AuthenticationFailedException e) { throw new AxelorException(e, mailAccount, TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.MAIL_ACCOUNT_1)); } catch (NoSuchProviderException e) { throw new AxelorException(e, mailAccount, TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.MAIL_ACCOUNT_2)); } } @Override public com.axelor.mail.MailAccount getMailAccount(EmailAccount mailAccount) { Integer serverType = mailAccount.getServerTypeSelect(); String port = mailAccount.getPort() <= 0 ? null : mailAccount.getPort().toString(); com.axelor.mail.MailAccount account; if (serverType == EmailAccountRepository.SERVER_TYPE_SMTP) { account = new SmtpAccount(mailAccount.getHost(), port, mailAccount.getLogin(), getDecryptPassword(mailAccount.getPassword()), getSecurity(mailAccount)); } else if (serverType == EmailAccountRepository.SERVER_TYPE_IMAP) { account = new ImapAccount(mailAccount.getHost(), mailAccount.getPort().toString(), mailAccount.getLogin(), getDecryptPassword(mailAccount.getPassword()), getSecurity(mailAccount)); } else { account = new Pop3Account(mailAccount.getHost(), mailAccount.getPort().toString(), mailAccount.getLogin(), getDecryptPassword(mailAccount.getPassword()), getSecurity(mailAccount)); } account.setConnectionTimeout(CHECK_CONF_TIMEOUT); return account; } public String getSecurity(EmailAccount mailAccount) { if (mailAccount.getSecuritySelect() == EmailAccountRepository.SECURITY_SSL) { return MailConstants.CHANNEL_SSL; } else if (mailAccount.getSecuritySelect() == EmailAccountRepository.SECURITY_STARTTLS) { return MailConstants.CHANNEL_STARTTLS; } else { return null; } } public String getProtocol(EmailAccount mailAccount) { switch (mailAccount.getServerTypeSelect()) { case EmailAccountRepository.SERVER_TYPE_SMTP: return "smtp"; case EmailAccountRepository.SERVER_TYPE_IMAP: if (mailAccount.getSecuritySelect() == EmailAccountRepository.SECURITY_SSL) { return MailConstants.PROTOCOL_IMAPS; } return MailConstants.PROTOCOL_IMAP; case EmailAccountRepository.SERVER_TYPE_POP: return MailConstants.PROTOCOL_POP3; default: return ""; } } public String getSignature(EmailAccount mailAccount) { if (mailAccount != null && mailAccount.getSignature() != null) { return "\n " + mailAccount.getSignature(); } return ""; } @Override public int fetchEmails(EmailAccount mailAccount, boolean unseenOnly) throws MessagingException, IOException { if (mailAccount == null) { return 0; } log.debug("Fetching emails from host: {}, port: {}, login: {} ", mailAccount.getHost(), mailAccount.getPort(), mailAccount.getLogin()); com.axelor.mail.MailAccount account = null; if (mailAccount.getServerTypeSelect().equals(EmailAccountRepository.SERVER_TYPE_IMAP)) { account = new ImapAccount(mailAccount.getHost(), mailAccount.getPort().toString(), mailAccount.getLogin(), mailAccount.getPassword(), getSecurity(mailAccount)); } else { account = new Pop3Account(mailAccount.getHost(), mailAccount.getPort().toString(), mailAccount.getLogin(), mailAccount.getPassword(), getSecurity(mailAccount)); } MailReader reader = new MailReader(account); final Store store = reader.getStore(); final Folder inbox = store.getFolder("INBOX"); // open as READ_WRITE to mark messages as seen inbox.open(Folder.READ_WRITE); // find all unseen messages final FetchProfile profile = new FetchProfile(); javax.mail.Message[] messages; if (unseenOnly) { final FlagTerm unseen = new FlagTerm(new Flags(Flags.Flag.SEEN), false); messages = inbox.search(unseen); } else { messages = inbox.getMessages(); } profile.add(FetchProfile.Item.ENVELOPE); // actually fetch the messages inbox.fetch(messages, profile); log.debug("Total emails unseen: {}", messages.length); int count = 0; for (javax.mail.Message message : messages) { if (message instanceof MimeMessage) { MailParser parser = new MailParser((MimeMessage) message); parser.parse(); createMessage(mailAccount, parser, message.getSentDate()); count++; } } log.debug("Total emails fetched: {}", count); return count; } @Transactional public Message createMessage(EmailAccount mailAccount, MailParser parser, Date date ) throws MessagingException, IOException { // List<EventRegistration> eventRegistrationlist = event.getEventRegistration(); Message message = new Message(); message.setMailAccount(mailAccount); message.setTypeSelect(MessageRepository.TYPE_SENT); message.setMediaTypeSelect(MessageRepository.MEDIA_TYPE_EMAIL); message.setFromEmailAddress(getEmailAddress(parser.getFrom())); message.setCcEmailAddressSet(getEmailAddressSet(parser.getCc())); message.setBccEmailAddressSet(getEmailAddressSet(parser.getBcc())); message.setToEmailAddressSet(getEmailAddressSet(parser.getTo())); message.addReplyToEmailAddressSetItem(getEmailAddress(parser.getReplyTo())); message.setContent(parser.getHtml()); message.setSubject(parser.getSubject()); message.setSentDateT(DateTool.toLocalDateT(date)); message = messageRepo.save(message); List<DataSource> attachments = parser.getAttachments(); addAttachments(message, attachments); return message; } private EmailAddress getEmailAddress(InternetAddress address) { EmailAddress emailAddress = null; emailAddress = emailAddressRepo.findByAddress(address.getAddress()); if (emailAddress == null) { emailAddress = new EmailAddress(); emailAddress.setAddress(address.getAddress()); } return emailAddress; } private Set<EmailAddress> getEmailAddressSet(List<InternetAddress> addresses) { Set<EmailAddress> addressSet = new HashSet<EmailAddress>(); if (addresses == null) { return addressSet; } for (InternetAddress address : addresses) { EmailAddress emailAddress = getEmailAddress(address); addressSet.add(emailAddress); } return addressSet; } private void addAttachments(Message message, List<DataSource> attachments) { if (attachments == null) { return; } for (DataSource source : attachments) { try { InputStream stream = source.getInputStream(); metaFiles.attach(stream, source.getName(), message); } catch (IOException e) { e.printStackTrace(); } } } @Override public String getEncryptPassword(String password) { return cipherService.encrypt(password); } @Override public String getDecryptPassword(String password) { return cipherService.decrypt(password); } }
2d3f91155ff591113bcd6d57064f9e15cd6c743b
44c586f6a34c59c5e81425e8e43764c3c1699dc1
/myProject/src/main/java/com/example/demo/MyProjectApplication.java
6ddee2ff3fd6991fe657313fce8d88ae2e680848
[]
no_license
Paradise2k18/MovieBlog
811f45fdf07daeabd5b63dff8fbbfc49fdabe1c2
d0c46ce5ad2a9289cddef49a7d6b6b6e1eb34170
refs/heads/master
2021-05-12T16:04:26.810035
2018-01-17T11:01:06
2018-01-17T11:01:06
116,998,054
0
1
null
null
null
null
UTF-8
Java
false
false
586
java
package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Configuration; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @Configuration @EnableAutoConfiguration @SpringBootApplication @EnableJpaRepositories public class MyProjectApplication { public static void main(String[] args) { SpringApplication.run(MyProjectApplication.class, args); } }
3221c6a72d2c4bc6c790b516fdddc1e3f1a43d28
ca4970a5ef9f7a7c5b7ebdda472fd2bc51390893
/src/com/bai/proposal/servlet/LegalDDServlet.java
c5b6afd673c39d1b46840463ad565897b00b0304
[]
no_license
sriprak/ProposalMaster
8c015202c18933a65494d68c1f6a1ecbef0126f5
4c2249be535e4a0a2e0c368846dddabacf624613
refs/heads/master
2021-01-22T20:44:55.484479
2017-03-17T20:48:09
2017-03-17T20:48:09
85,353,249
0
0
null
null
null
null
UTF-8
Java
false
false
6,931
java
package com.bai.proposal.servlet; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.List; import javax.servlet.RequestDispatcher; 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 javax.servlet.http.HttpSession; import org.apache.commons.lang.StringUtils; import org.docx4j.openpackaging.packages.WordprocessingMLPackage; import org.docx4j.wml.Text; import com.bai.proposal.file.Docx4j; /** * Servlet implementation class LegalDDServlet */ @WebServlet("/LegalDDServlet") public class LegalDDServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public LegalDDServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub final String[] memName; final String[] prodName; final String[] memDesgn; final String[] pocName; final String[] pocMobNumber; final String[] pocDesgn; final String[] pocEmail; final String[] tgtAreaName; final String[] baPocName; final String[] baPocMobNumber; final String[] baPocDesgn; final String[] baPocEmail; final String[] baPocAddress; final String fullName = request.getParameter("fullName"); final String shortName = request.getParameter("shortName"); final String descpt = request.getParameter("descpt"); final String address = request.getParameter("address"); final String telNo = request.getParameter("telNum"); final String faxNum = request.getParameter("faxNum"); final String webSite = request.getParameter("webSite"); final String bkgInfo = request.getParameter("bkgInfo"); final String scopeWork = request.getParameter("scopeWork"); final String suppInfo = request.getParameter("suppInfo"); final int duration = Integer.parseInt(request.getParameter("duration")); final double proffee = Double.parseDouble(request .getParameter("proffee")); final double servTax = Double.parseDouble(request .getParameter("servTax")); final double ope = Double.parseDouble(request.getParameter("ope")); final double totalAmt = Double.parseDouble(request .getParameter("totalAmt")); final String date = new SimpleDateFormat("dd/MM/yyyy") .format(new Date()); final String fodate = new SimpleDateFormat("yyyyMMdd") .format(new Date()); final String cntry = request.getParameter("cntry"); HttpSession session = request.getSession(); session.setAttribute("shortName", shortName); prodName = request.getParameterValues("prodName"); memName = request.getParameterValues("memName"); memDesgn = request.getParameterValues("memDesgn"); pocName = request.getParameterValues("pocName"); pocMobNumber = request.getParameterValues("pocMobNumber"); pocDesgn = request.getParameterValues("pocDesgn"); pocEmail = request.getParameterValues("pocEmail"); tgtAreaName = request.getParameterValues("tgtAreaName"); baPocName = request.getParameterValues("baPocName"); baPocAddress = request.getParameterValues("baPocAddress"); baPocMobNumber = request.getParameterValues("baPocMobNumber"); baPocDesgn = request.getParameterValues("baPocDesgn"); baPocEmail = request.getParameterValues("baPocEmail"); try { String filePath = "E:\\PROPOSAL FORMAT\\PROPOSAL FORMAT\\Proposal Docx\\"; String file = "Legal Due Dilligence.docx"; Docx4j docx4j = new Docx4j(); WordprocessingMLPackage template = docx4j.getTemplate(filePath + file); // MainDocumentPart documentPart = template.getMainDocumentPart(); List<Object> texts = Docx4j.getAllElementFromObject( template.getMainDocumentPart(), Text.class); docx4j.searchAndReplace(texts, new HashMap<String, Object>() { /** * */ private static final long serialVersionUID = 1L; { this.put("${ fullName }", fullName); this.put("${ shortName }", shortName + " "); this.put("${ descpt }", " " + descpt); this.put("${ address }", " " + address); this.put("${ telNum }", " " + telNo); this.put("${ faxNum }", " " + faxNum); this.put("${ webSite }", " " + webSite + " "); this.put("${ bkgInfo }", bkgInfo); this.put("${ scopeWork }", scopeWork); this.put("${ suppInfo }", suppInfo); this.put("${ duration }", duration); this.put("${ proffee }", proffee); this.put("${ servTax }", servTax); this.put("${ ope }", ope); this.put("${ totalAmt }", totalAmt); this.put("${ date }", date); this.put("${ fodate }", fodate); this.put("${ baCountry }", " " + cntry); this.put("${ prodName }", " " + (StringUtils.join(prodName, ", ")) + " "); this.put("${ tgtAreaName }", " " + (StringUtils.join(tgtAreaName, ", ")) + " "); this.put("${ memName }", " " + (StringUtils.join(memName, ", ")) + " "); this.put("${ memDesgn }", " " + (StringUtils.join(memDesgn, ", ")) + " "); this.put("${ pocName }", " " + (StringUtils.join(pocName, ", ")) + " "); this.put("${ pocMobNumber }", " " + (StringUtils.join(pocMobNumber, ", ")) + " "); this.put("${ pocDesgn }", " " + (StringUtils.join(pocDesgn, ", ")) + " "); this.put("${ pocEmail }", " " + (StringUtils.join(pocEmail, ", ")) + " "); this.put("${ baPocName }", " " + (StringUtils.join(baPocName, ", ")) + " "); this.put("${ baPocAddress }", " " + (StringUtils.join(baPocAddress, ", ")) + " "); this.put("${ baPocMobNumber }", " " + (StringUtils.join(baPocMobNumber, ", ")) + " "); this.put("${ baPocDesgn }", " " + (StringUtils.join(baPocDesgn, ", ")) + " "); this.put("${ baPocEmail }", " " + (StringUtils.join(baPocEmail, ", ")) + " "); } @Override public Object get(Object key) { // TODO Auto-generated method stub return super.get(key); } }); docx4j.writeDocxToStream( template, "C:\\Users\\BAI-MUM\\Desktop\\Reports\\Legal Due Dilligence Reports\\Legal_Due_Dilligence_" + shortName + ".docx"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } RequestDispatcher rd = request.getRequestDispatcher("FileUploadLegddServlet"); rd.forward(request, response); } }
18efed0fbc886aa671225033199cbe6cadf681d3
f5c1a979871b950848a92f64f8cea2655d19ab10
/SistCoopREST/src/main/java/org/sistemafinanciero/entity/Titular.java
266fb3fe691b9e9007aec5ef75553cdee93fd087
[ "Apache-2.0" ]
permissive
Softgreen/SistCoop
f8172818bfc1f96552045a3147fac3d27e30f394
78a6c93fd82e4438eea157ca51410416672bc6b8
refs/heads/master
2021-01-02T08:14:02.872539
2015-08-24T22:10:12
2015-08-24T22:10:12
22,446,090
0
0
null
null
null
null
UTF-8
Java
false
false
4,234
java
package org.sistemafinanciero.entity; // Generated 02-may-2014 11:48:28 by Hibernate Tools 4.0.0 import java.math.BigDecimal; import java.math.BigInteger; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; import com.sun.org.apache.xpath.internal.operations.Bool; /** * Titular generated by hbm2java */ @Entity @Table(name = "TITULAR", schema = "BDSISTEMAFINANCIERO") @XmlRootElement(name = "titular") @XmlAccessorType(XmlAccessType.NONE) public class Titular implements java.io.Serializable { /** * */ private static final long serialVersionUID = 1L; private BigInteger idTitular; private PersonaNatural personaNatural; private CuentaBancaria cuentaBancaria; private Date fechaInicio; private Date fechaFin; private int estado; public Titular() { } public Titular(BigInteger idTitular, PersonaNatural personaNatural, CuentaBancaria cuentaBancaria, Date fechaInicio, boolean estado) { this.idTitular = idTitular; this.personaNatural = personaNatural; this.cuentaBancaria = cuentaBancaria; this.fechaInicio = fechaInicio; this.estado = (estado ? 1 : 0); } public Titular(BigInteger idTitular, PersonaNatural personaNatural, CuentaBancaria cuentaBancaria, Date fechaInicio, Date fechaFin, boolean estado) { this.idTitular = idTitular; this.personaNatural = personaNatural; this.cuentaBancaria = cuentaBancaria; this.fechaInicio = fechaInicio; this.fechaFin = fechaFin; this.estado = (estado ? 1 : 0); } @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="TITULAR_SEQ") @SequenceGenerator(name="TITULAR_SEQ", initialValue=1, allocationSize=1, sequenceName="TITULAR_SEQ") @XmlElement(name = "id") @Id @Column(name = "ID_TITULAR", unique = true, nullable = false, precision = 22, scale = 0) public BigInteger getIdTitular() { return this.idTitular; } public void setIdTitular(BigInteger idTitular) { this.idTitular = idTitular; } @XmlElement @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ID_PERSONA_NATURAL", nullable = false) public PersonaNatural getPersonaNatural() { return this.personaNatural; } public void setPersonaNatural(PersonaNatural personaNatural) { this.personaNatural = personaNatural; } @XmlTransient @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ID_CUENTA_BANCARIA", nullable = false) public CuentaBancaria getCuentaBancaria() { return this.cuentaBancaria; } public void setCuentaBancaria(CuentaBancaria cuentaBancaria) { this.cuentaBancaria = cuentaBancaria; } @XmlElement @Temporal(TemporalType.DATE) @Column(name = "FECHA_INICIO", nullable = false, length = 7) public Date getFechaInicio() { return this.fechaInicio; } public void setFechaInicio(Date fechaInicio) { this.fechaInicio = fechaInicio; } @XmlElement @Temporal(TemporalType.DATE) @Column(name = "FECHA_FIN", length = 7) public Date getFechaFin() { return this.fechaFin; } public void setFechaFin(Date fechaFin) { this.fechaFin = fechaFin; } @XmlElement @Column(name = "ESTADO", nullable = false, precision = 22, scale = 0) public boolean getEstado() { return (this.estado == 1 ? true : false); } public void setEstado(boolean estado) { this.estado = (estado ? 1 : 0); } @Override public boolean equals(Object obj) { if ((obj == null) || !(obj instanceof Titular)) { return false; } final Titular other = (Titular) obj; return other.getPersonaNatural().equals(this.personaNatural); } @Override public int hashCode() { if(this.personaNatural != null) return this.personaNatural.hashCode(); else return 0; } }
dcb6b4a6a43d6a48567a1fa11e515d68b7c63fce
3c2d2c06d85abb9c7a1a84fefe9b72399c201f85
/phloc-css/src/main/java/com/phloc/css/CSSFilenameHelper.java
7cea63315fa0e4244401660d2c9e90b8c5bb0a0e
[]
no_license
phlocbg/phloc-css
2240754f778d06fa95be411abf21544ecb0ac768
215a945f4ec585b0d24d65a5f39666fb8a67e124
refs/heads/master
2022-07-16T02:04:41.954879
2019-08-22T23:10:14
2019-08-22T23:10:14
41,243,652
1
0
null
2022-07-01T22:17:57
2015-08-23T09:27:32
Java
UTF-8
Java
false
false
3,116
java
/** * Copyright (C) 2006-2015 phloc systems * http://www.phloc.com * office[at]phloc[dot]com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.phloc.css; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; import com.phloc.commons.annotations.PresentForCodeCoverage; import com.phloc.commons.string.StringHelper; /** * Utility methods to deal with CSS filenames. * * @author Philip Helger */ @Immutable public final class CSSFilenameHelper { @SuppressWarnings ("unused") @PresentForCodeCoverage private static final CSSFilenameHelper s_aInstance = new CSSFilenameHelper (); private CSSFilenameHelper () {} /** * Check if the passed filename is a CSS filename (independent if regular or * minified) * * @param sFilename * The filename to check. * @return <code>true</code> if the passed filename is a CSS filename. */ public static boolean isCSSFilename (@Nullable final String sFilename) { return StringHelper.endsWith (sFilename, CCSS.FILE_EXTENSION_CSS); } /** * Check if the passed filename is a minified CSS filename * * @param sFilename * The filename to check. * @return <code>true</code> if the passed filename is a minified CSS * filename. */ public static boolean isMinifiedCSSFilename (@Nullable final String sFilename) { return StringHelper.endsWith (sFilename, CCSS.FILE_EXTENSION_MIN_CSS); } /** * Check if the passed filename is a regular (not minified) CSS filename * * @param sFilename * The filename to check. * @return <code>true</code> if the passed filename is a regular CSS filename. */ public static boolean isRegularCSSFilename (@Nullable final String sFilename) { return isCSSFilename (sFilename) && !isMinifiedCSSFilename (sFilename); } /** * Get the minified CSS filename from the passed filename. If the passed * filename is already minified, it is returned as is. * * @param sCSSFilename * The filename to get minified. May not be <code>null</code>. * @return The minified filename */ @Nonnull public static String getMinifiedCSSFilename (@Nonnull final String sCSSFilename) { if (!isCSSFilename (sCSSFilename)) throw new IllegalArgumentException ("Passed file name '" + sCSSFilename + "' is not a CSS file name!"); if (isMinifiedCSSFilename (sCSSFilename)) return sCSSFilename; return StringHelper.trimEnd (sCSSFilename, CCSS.FILE_EXTENSION_CSS) + CCSS.FILE_EXTENSION_MIN_CSS; } }
7cdbf517513c909de3ecaa34a1808c49c9204e63
200c0aa8e394a3595effc3c1b7389c9b9446609b
/src/kaikei/db/KamokuKbnSManage.java
64e121089668803fecd4394b421f0fcb83984729
[]
no_license
reqroot/Sotsuron
e1c5d77264c572e550ad21470056cba50c5bae45
9aea77b104e9b00eefc11964cbca6d5985c5ee94
refs/heads/master
2021-01-01T06:38:28.018059
2015-09-18T00:25:41
2015-09-18T00:25:41
34,892,916
0
0
null
null
null
null
UTF-8
Java
false
false
941
java
package kaikei.db; import java.util.ArrayList; import java.util.List; import db.DBAccess; public class KamokuKbnSManage extends DBAccess { private String selectSql; public KamokuKbnSManage() { super("java:comp/env/jdbc/MySqlCon"); this.selectSql = "select kamoku_kbn_s_id, kamoku_kbn_d_id, kamoku_kbn_s_name from kamoku_kbn_s order by kamoku_kbn_s_id"; } public List<KamokuKbnSInfo> select() throws Exception { List<KamokuKbnSInfo> list = new ArrayList<KamokuKbnSInfo>(); KamokuKbnSInfo info = null; // DB接続 connect(); // ステートメント createStatement(); // 実行 selectExe(selectSql); while (getRsResult().next()) { info = new KamokuKbnSInfo( getRsResult().getString("kamoku_kbn_s_id"), getRsResult().getString("kamoku_kbn_d_id"), getRsResult().getString("kamoku_kbn_s_name")); list.add(info); } disConnect(); return list; } }
f09f9532344410b493058c3cd49ca63d7d60cd9b
a387c9fa08abba6089a09e511765c3e8d5ad61df
/Lab/大三(下)/软件项目管理_2013/PIPProject5/src/com/buptsse/spm/service/IScheduleService.java
9ac06f2969339d9627dfa56063488462c969ff41
[]
no_license
linjinze999/BUPTSSE2013
ab5153a8a544a8e1f3337bbc8c89b3bf23788d05
00abfac8c51cbca4cfcc936d6441424e15d656fd
refs/heads/master
2021-01-19T01:12:17.275203
2019-11-28T01:57:03
2019-11-28T02:00:11
63,605,859
4
3
null
2019-11-28T02:00:12
2016-07-18T13:36:01
JavaScript
UTF-8
Java
false
false
790
java
/** * */ package com.buptsse.spm.service; import java.util.List; import com.buptsse.spm.domain.Course; import com.buptsse.spm.domain.Schedule; import com.buptsse.spm.domain.User; /** * @author libing * @date 2015年11月23日 下午4:05:37 * @description 视频调度相关功能接口定义,包括增删改查 * @modify * */ public interface IScheduleService { public Schedule findScheduleById(String id); public boolean insertSchedule(Schedule schedule); public List<Schedule> findAllSchedule(); public boolean deleteSchedule(String id); public boolean saveOrUpdate(Schedule schedule); public List<Schedule> findScheduleByUserIdAndStepOrder(Integer stepOrder,String userId); public List<Schedule> findScheduleByUserIdAndChapterId(Integer chapterId,String userId); }
44a84d71eee556ce096a7d2521a1527455d9f8de
e7488e2521feacc341ff992303cb2170a068a183
/vskeddemos/projects/commonfileuploaddemo/src/com/vsked/util/BaseService.java
e9a99e12aad7e623a388433d9866dcb03e3bdc50
[ "MIT" ]
permissive
brucevsked/vskeddemolist
6b061d5657d503865726fb98314c5ff0b1dbb1cf
f863783b5b2b4e21e878ee3b295a3b5e03f39d94
refs/heads/master
2023-07-21T21:20:48.900142
2023-07-13T08:11:19
2023-07-13T08:11:19
38,467,274
29
12
MIT
2022-10-26T01:32:56
2015-07-03T02:21:29
Java
UTF-8
Java
false
false
1,618
java
package com.vsked.util; import java.io.File; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; public class BaseService { public Map<String, Object> uploadFile(HttpServletRequest req,String savePath){ Map<String, Object> m=new HashMap<String, Object>(); try{ if(ServletFileUpload.isMultipartContent(req)){ List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(req); String mapValue=""; Iterator<FileItem> itr = items.iterator(); while(itr.hasNext()){ FileItem item = itr.next(); if(!item.isFormField()){ mapValue=savePath+item.getName(); item.write(new File(getMyAppPath(req)+mapValue)); }else{ mapValue=item.getString("utf-8"); } m.put(item.getFieldName(), mapValue); } } }catch(Exception e){ e.printStackTrace(); } System.out.println(m); return m; } public String getMyAppPath(HttpServletRequest req){ return req.getServletContext().getRealPath("/").replace("\\", "/"); } public Map<String,Object> getMaps(HttpServletRequest req){ Map<String,Object> m=new HashMap<String, Object>(); Enumeration<?> e=req.getParameterNames(); while(e.hasMoreElements()){ String s=(String) e.nextElement(); m.put(s, req.getParameter(s)); } return m; } }
f464f736687eacc728bb00348936fb6a42f1174d
f4df64db8fe1bb29eab076da939dfadbeb407bde
/app/src/main/java/mobile/utfpr/com/br/mobileproject/PrincipalActivity.java
23693d867dc7a77d5dd20049c6b5174e95020e1e
[]
no_license
johnnybegoods/mobileproject
c3ed7007074d4522faee6d2812d4c396982b195f
13b9e7bd5198bd8275a794e02f635fa7eced5c98
refs/heads/master
2021-08-26T08:34:43.057056
2017-11-22T14:38:24
2017-11-22T14:38:24
111,593,294
0
0
null
null
null
null
UTF-8
Java
false
false
8,523
java
package mobile.utfpr.com.br.mobileproject; import android.app.Activity; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Color; import android.support.annotation.NonNull; import android.support.constraint.ConstraintLayout; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.view.ActionMode; import android.view.ContextMenu; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.CalendarView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import java.util.Date; import mobile.utfpr.com.br.mobileproject.model.Config; import mobile.utfpr.com.br.mobileproject.model.HoraExtra; import mobile.utfpr.com.br.mobileproject.persistencia.ConexaoBD; import mobile.utfpr.com.br.mobileproject.utilitario.Processamento; import mobile.utfpr.com.br.mobileproject.utilitario.Utils; public class PrincipalActivity extends AppCompatActivity { private TextView textViewTotalHoras, textViewTotalBanco; private CalendarView calendario; public static int opcaoTema = Color.WHITE; private ListView listViewHorasExtras; private ArrayAdapter<HoraExtra> listaAdapter; public static final String MODO = "MODO"; public static final String ID = "ID"; public static final int NOVO = 1; public static final int ALTERAR = 2; private ActionMode actionMode; private int posicaoSelecionada = -1; private View viewSelecionada; private ConstraintLayout layout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_principal); layout = (ConstraintLayout)findViewById(R.id.layoutPrincipal); textViewTotalHoras= (TextView)findViewById(R.id.textViewTotalHoras); textViewTotalBanco= (TextView)findViewById(R.id.textViewTotalBanco); calendario = (CalendarView)findViewById(R.id.calendarViewCalendario); listViewHorasExtras = (ListView)findViewById(R.id.ListViewHorasExtras); /* listViewHorasExtras.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { HoraExtra horaExtra = (HoraExtra) parent.getItemAtPosition(position); } });*/ popularListaHoras(); processarDados(); registerForContextMenu(listViewHorasExtras); calendario.setOnDateChangeListener(new CalendarView.OnDateChangeListener() { @Override public void onSelectedDayChange(@NonNull CalendarView calendarView, int i, int i1, int i2) { calendario = calendarView; } }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if ((requestCode == NOVO || requestCode == ALTERAR) && resultCode == Activity.RESULT_OK){ listaAdapter.notifyDataSetChanged(); processarDados(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_principal, menu); return true; } @Override public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo){ super.onCreateContextMenu(menu, view, menuInfo); getMenuInflater().inflate(R.menu.menu_item_select, menu); } @Override public boolean onContextItemSelected(MenuItem item) { AdapterView.AdapterContextMenuInfo info; info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo(); HoraExtra horaExtra = (HoraExtra) listViewHorasExtras.getItemAtPosition(info.position); switch (item.getItemId()) { case R.id.itemSelectEditar: Intent intent = new Intent(PrincipalActivity.this, Adicionar_Horas_Activity.class); intent.putExtra("dataLongMiliseconds", (Long) calendario.getDate()); intent.putExtra(MODO, ALTERAR); intent.putExtra(ID, horaExtra.getId()); startActivityForResult(intent, ALTERAR); return true; case R.id.itemSelectExcluir: String mensagem = getString(R.string.deseja_realmente_apagar) + "\n" + horaExtra.getData(); final HoraExtra horaExtraExclusao = horaExtra; DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch (which) { case DialogInterface.BUTTON_POSITIVE: listaAdapter.remove(horaExtraExclusao); break; case DialogInterface.BUTTON_NEGATIVE: break; } } }; Utils.confirmaAcao(this, mensagem, listener); return true; case R.id.itemSelectMarcar: Intent intentTag = new Intent(this, Activity_VerHoras.class); startActivity(intentTag); return true; default: return super.onContextItemSelected(item); } } @Override public boolean onOptionsItemSelected(MenuItem item){ switch (item.getItemId()){ case R.id.menuItemAdd: final Date data = null; Intent intent = new Intent(PrincipalActivity.this, Adicionar_Horas_Activity.class); intent.putExtra("dataLongMiliseconds", (Long) calendario.getDate()); intent.putExtra(MODO, NOVO); startActivityForResult(intent, NOVO); return true; case R.id.menuItemConfig: ConexaoBD conexaoBD = ConexaoBD.getInstance(this); Config config = conexaoBD.configDAO.carregaConfig(); Intent intentConfig = new Intent(PrincipalActivity.this, ConfigActivity.class); intentConfig.putExtra(MODO, ALTERAR); intentConfig.putExtra(ID, config.getId()); startActivityForResult(intentConfig, ALTERAR); return true; case R.id.menuItemSobre: Intent intentAbout = new Intent(this, ActivityAbout.class); startActivity(intentAbout); return true; default: return super.onOptionsItemSelected(item); } } public void popularListaHoras(){ ConexaoBD conexao = ConexaoBD.getInstance(this); listaAdapter = new ArrayAdapter<HoraExtra>(this, android.R.layout.simple_list_item_1, conexao.horaExtraDAO.lista); listViewHorasExtras.setAdapter(listaAdapter); } private void getTema(){ SharedPreferences sharedPref = getSharedPreferences(getString(R.string.prefencias_cores), Context.MODE_PRIVATE); opcaoTema = sharedPref.getInt(getString(R.string.cor_fundo), opcaoTema); mudarCorFundo(); } private void mudarCorFundo(){ layout.setBackgroundColor(opcaoTema); } private void processarDados(){ Config config = null; ConexaoBD conexaoBD = ConexaoBD.getInstance(this); Processamento processamento = new Processamento(conexaoBD.configDAO.carregaConfig(), conexaoBD.horaExtraDAO.listaHorasExtras()); config = processamento.processaDados(); Toast.makeText(this, ""+config.getVarlorDeHoras(), Toast.LENGTH_SHORT).show(); textViewTotalBanco.setText(config.getBanco()); textViewTotalHoras.setText(""+config.getVarlorDeHoras()); } }
216cb3ab924962eee5bae370ba8d2dc3d6d83cf2
a2d2d0aa328d5d9242dc1b779bf2893af001ddfd
/ERP/src/java/com/t2tierp/conciliacaocontabil/cliente/ConciliacaoFornecedorGrid.java
0b0c774122d2de957d9e0dd6d0fd0e812493ce3f
[]
no_license
joaovitorpina/maica-erp
f0fc4e85a588478c4d43f11b94d95d4c75f01e5f
e55fad8238f6ef8b87910476c221d9c2f1c47b59
refs/heads/master
2021-05-28T10:22:12.274751
2014-04-14T14:46:59
2014-04-14T14:46:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,805
java
package com.t2tierp.conciliacaocontabil.cliente; import org.openswing.swing.client.GridControl; import org.openswing.swing.mdi.client.InternalFrame; /** * <p>Title: T2Ti ERP</p> * <p>Description: Tela ConciliacaoFornecedor.</p> * * <p>The MIT License</p> * * <p>Copyright: Copyright (C) 2010 T2Ti.COM * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * The author may be contacted at: * [email protected]</p> * * @author Claudio de Barros ([email protected]) * @version 1.0 */ public class ConciliacaoFornecedorGrid extends InternalFrame { public ConciliacaoFornecedorGrid(ConciliacaoFornecedorGridController controller) { initComponents(); gridControl1.setController(controller); gridControl1.setGridDataLocator(controller); } public GridControl getGrid1() { return gridControl1; } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jPanel1 = new javax.swing.JPanel(); reloadButton1 = new org.openswing.swing.client.ReloadButton(); navigatorBar1 = new org.openswing.swing.client.NavigatorBar(); filterButton1 = new org.openswing.swing.client.FilterButton(); exportButton1 = new org.openswing.swing.client.ExportButton(); gridControl1 = new org.openswing.swing.client.GridControl(); textColumn3 = new org.openswing.swing.table.columns.client.TextColumn(); textColumn4 = new org.openswing.swing.table.columns.client.TextColumn(); textColumn5 = new org.openswing.swing.table.columns.client.TextColumn(); dateColumn6 = new org.openswing.swing.table.columns.client.DateColumn(); dateColumn9 = new org.openswing.swing.table.columns.client.DateColumn(); setTitle("Conciliacao Contabil"); setPreferredSize(new java.awt.Dimension(700, 400)); getContentPane().setLayout(new java.awt.GridBagLayout()); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Conciliacao Fornecedor")); jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); jPanel1.add(reloadButton1); jPanel1.add(navigatorBar1); jPanel1.add(filterButton1); jPanel1.add(exportButton1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; getContentPane().add(jPanel1, gridBagConstraints); gridControl1.setFunctionId("fornecedor"); gridControl1.setValueObjectClassName("com.erp.cadastros.java.vo.FornecedorVO"); gridControl1.getColumnContainer().setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); textColumn3.setColumnName("pessoa.nome"); textColumn3.setHeaderColumnName("Nome"); textColumn3.setHeaderFont(new java.awt.Font("Arial", 1, 11)); // NOI18N textColumn3.setPreferredWidth(300); gridControl1.getColumnContainer().add(textColumn3); textColumn4.setColumnName("atividadeForCli.nome"); textColumn4.setHeaderColumnName("Atividade"); textColumn4.setHeaderFont(new java.awt.Font("Arial", 1, 11)); // NOI18N gridControl1.getColumnContainer().add(textColumn4); textColumn5.setColumnName("situacaoForCli.nome"); textColumn5.setHeaderColumnName("Situacao"); textColumn5.setHeaderFont(new java.awt.Font("Arial", 1, 11)); // NOI18N gridControl1.getColumnContainer().add(textColumn5); dateColumn6.setColumnName("desde"); dateColumn6.setHeaderColumnName("Desde"); dateColumn6.setHeaderFont(new java.awt.Font("Arial", 1, 11)); // NOI18N gridControl1.getColumnContainer().add(dateColumn6); dateColumn9.setColumnName("dataCadastro"); dateColumn9.setHeaderColumnName("Data Cadastro"); dateColumn9.setHeaderFont(new java.awt.Font("Arial", 1, 11)); // NOI18N gridControl1.getColumnContainer().add(dateColumn9); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(gridControl1, gridBagConstraints); pack(); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private org.openswing.swing.table.columns.client.DateColumn dateColumn6; private org.openswing.swing.table.columns.client.DateColumn dateColumn9; private org.openswing.swing.client.ExportButton exportButton1; private org.openswing.swing.client.FilterButton filterButton1; private org.openswing.swing.client.GridControl gridControl1; private javax.swing.JPanel jPanel1; private org.openswing.swing.client.NavigatorBar navigatorBar1; private org.openswing.swing.client.ReloadButton reloadButton1; private org.openswing.swing.table.columns.client.TextColumn textColumn3; private org.openswing.swing.table.columns.client.TextColumn textColumn4; private org.openswing.swing.table.columns.client.TextColumn textColumn5; // End of variables declaration//GEN-END:variables }
[ "[email protected]@ad18e148-4fa2-a8d7-3c0d-fede52b83961" ]
[email protected]@ad18e148-4fa2-a8d7-3c0d-fede52b83961
d5e5f6f12c78b4c8757dbbd85a98b4e19e4b5e84
91e72ef337a34eb7e547fa96d99fca5a4a6dc89e
/subjects/commons-codec/results/reneri/generated/org/apache/commons/codec/net/RFC1522CodecTest.java
ff573974553f7636a1f9d12281be272a119163a1
[]
no_license
STAMP-project/descartes-amplification-experiments
deda5e2f1a122b9d365f7c76b74fb2d99634aad4
a5709fd78bbe8b4a4ae590ec50704dbf7881e882
refs/heads/master
2021-06-27T04:13:17.035471
2020-10-14T08:17:05
2020-10-14T08:17:05
169,711,716
0
0
null
2020-10-14T08:17:07
2019-02-08T09:32:43
Java
UTF-8
Java
false
false
5,052
java
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.codec.net; /** * RFC 1522 compliant codec test cases * * @version $Id$ */ public class RFC1522CodecTest { static class RFC1522TestCodec extends org.apache.commons.codec.net.RFC1522Codec { @java.lang.Override protected byte[] doDecoding(final byte[] bytes) { return bytes; } @java.lang.Override protected byte[] doEncoding(final byte[] bytes) { return bytes; } @java.lang.Override protected java.lang.String getEncoding() { return "T"; } } @org.junit.Test public void testNullInput() throws java.lang.Exception { final org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec testcodec = eu.stamp_project.reneri.instrumentation.StateObserver.<org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec>observeState("org.apache.commons.codec.net.RFC1522CodecTest|testNullInput()|0", org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec.class, new org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec()); org.junit.Assert.assertNull(eu.stamp_project.reneri.instrumentation.StateObserver.observe("org.apache.commons.codec.net.RFC1522CodecTest|testNullInput()|2", eu.stamp_project.reneri.instrumentation.StateObserver.<org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec>observeState("org.apache.commons.codec.net.RFC1522CodecTest|testNullInput()|1", org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec.class, testcodec).decodeText(null))); org.junit.Assert.assertNull(eu.stamp_project.reneri.instrumentation.StateObserver.observe("org.apache.commons.codec.net.RFC1522CodecTest|testNullInput()|4", eu.stamp_project.reneri.instrumentation.StateObserver.<org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec>observeState("org.apache.commons.codec.net.RFC1522CodecTest|testNullInput()|3", org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec.class, testcodec).encodeText(null, org.apache.commons.codec.CharEncoding.UTF_8))); } private void assertExpectedDecoderException(final java.lang.String s) throws java.lang.Exception { final org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec testcodec = eu.stamp_project.reneri.instrumentation.StateObserver.<org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec>observeState("org.apache.commons.codec.net.RFC1522CodecTest|assertExpectedDecoderException(java.lang.String)|0", org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec.class, new org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec()); try { eu.stamp_project.reneri.instrumentation.StateObserver.observe("org.apache.commons.codec.net.RFC1522CodecTest|assertExpectedDecoderException(java.lang.String)|3", eu.stamp_project.reneri.instrumentation.StateObserver.<org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec>observeState("org.apache.commons.codec.net.RFC1522CodecTest|assertExpectedDecoderException(java.lang.String)|1", org.apache.commons.codec.net.RFC1522CodecTest.RFC1522TestCodec.class, testcodec).decodeText(eu.stamp_project.reneri.instrumentation.StateObserver.observe("org.apache.commons.codec.net.RFC1522CodecTest|assertExpectedDecoderException(java.lang.String)|2", s))); org.junit.Assert.fail("DecoderException should have been thrown"); } catch (final org.apache.commons.codec.DecoderException e) { // Expected. } } @org.junit.Test public void testDecodeInvalid() throws java.lang.Exception { assertExpectedDecoderException("whatever"); assertExpectedDecoderException("=?"); assertExpectedDecoderException("?="); assertExpectedDecoderException("=="); assertExpectedDecoderException("=??="); assertExpectedDecoderException("=?stuff?="); assertExpectedDecoderException("=?UTF-8??="); assertExpectedDecoderException("=?UTF-8?stuff?="); assertExpectedDecoderException("=?UTF-8?T?stuff"); assertExpectedDecoderException("=??T?stuff?="); assertExpectedDecoderException("=?UTF-8??stuff?="); assertExpectedDecoderException("=?UTF-8?W?stuff?="); } }
004d65d79c429b3bbee12bdb768a9741c199aa6a
183732491ccf0693b044163c3eb9a0e657fcce94
/phloc-commons/src/main/java/com/phloc/commons/tree/utils/sort/ComparatorDefaultTreeItem.java
da37ff08fe4947ce49d5ecd7e734034dd0e92916
[]
no_license
phlocbg/phloc-commons
9b0d6699af33d67ee832c14e0594c97cef44c05d
6f86abe9c4bb9f9f94fe53fc5ba149356f88a154
refs/heads/master
2023-04-23T22:25:52.355734
2023-03-31T18:09:10
2023-03-31T18:09:10
41,243,446
0
0
null
2022-07-01T22:17:52
2015-08-23T09:19:38
Java
UTF-8
Java
false
false
3,415
java
/** * Copyright (C) 2006-2015 phloc systems * http://www.phloc.com * office[at]phloc[dot]com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.phloc.commons.tree.utils.sort; import java.util.Comparator; import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.phloc.commons.compare.ESortOrder; import com.phloc.commons.tree.simple.DefaultTreeItem; /** * Comparator for sorting {@link DefaultTreeItem} items by their value using an * explicit {@link Comparator}. * * @author Philip Helger * @param <DATATYPE> * tree item value type */ public final class ComparatorDefaultTreeItem <DATATYPE> extends ComparatorTreeItemData <DATATYPE, DefaultTreeItem <DATATYPE>> { /** * Constructor with default sort order. * * @param aDataComparator * Comparator for the data elements. May not be <code>null</code>. */ public ComparatorDefaultTreeItem (@Nonnull final Comparator <? super DATATYPE> aDataComparator) { super (aDataComparator); } /** * Constructor with sort order. * * @param aDataComparator * Comparator for the data elements. May not be <code>null</code>. * @param eSortOrder * The sort order to use. May not be <code>null</code>. */ public ComparatorDefaultTreeItem (@Nonnull final ESortOrder eSortOrder, @Nonnull final Comparator <? super DATATYPE> aDataComparator) { super (eSortOrder, aDataComparator); } /** * Comparator with default sort order and a nested comparator. * * @param aNestedComparator * The nested comparator to be invoked, when the main comparison * resulted in 0. * @param aDataComparator * The comparator for comparing the IDs. May not be <code>null</code>. */ public ComparatorDefaultTreeItem (@Nullable final Comparator <? super DefaultTreeItem <DATATYPE>> aNestedComparator, @Nonnull final Comparator <? super DATATYPE> aDataComparator) { super (aNestedComparator, aDataComparator); } /** * Constructor with sort order and a nested comparator. * * @param eSortOrder * The sort order to use. May not be <code>null</code>. * @param aNestedComparator * The nested comparator to be invoked, when the main comparison * resulted in 0. * @param aDataComparator * The comparator for comparing the IDs. May not be <code>null</code>. */ public ComparatorDefaultTreeItem (@Nonnull final ESortOrder eSortOrder, @Nullable final Comparator <? super DefaultTreeItem <DATATYPE>> aNestedComparator, @Nonnull final Comparator <? super DATATYPE> aDataComparator) { super (eSortOrder, aNestedComparator, aDataComparator); } }
d4f8ff1f4fe7e9c5c3bdaf03f1329770223f277c
45df0eb1770e632adf231df41bf7ade047a34f22
/app/src/main/java/com/huyentran/tweets/models/User.java
6aa47125b671b55402c7e5749b595739fdad35c7
[ "MIT", "Apache-2.0" ]
permissive
heyhuyen/codepath-twitter-client
64526385208679a48ad7b3a67fc98117a9fff729
09dd4193639dba7db7bfef900ebe798de3746c58
refs/heads/master
2021-01-18T21:01:23.101653
2016-10-30T22:16:29
2016-10-30T22:16:29
72,241,218
0
0
null
null
null
null
UTF-8
Java
false
false
1,909
java
package com.huyentran.tweets.models; import com.huyentran.tweets.db.MyDatabase; import com.raizlabs.android.dbflow.annotation.Column; import com.raizlabs.android.dbflow.annotation.PrimaryKey; import com.raizlabs.android.dbflow.annotation.Table; import com.raizlabs.android.dbflow.annotation.Unique; import com.raizlabs.android.dbflow.structure.BaseModel; import org.json.JSONException; import org.json.JSONObject; import org.parceler.Parcel; import static android.R.attr.id; /** * User model. */ @Table(database = MyDatabase.class) @Parcel(analyze={User.class}) public class User extends BaseModel { @Column @PrimaryKey long uid; @Column String name; @Column String screenName; @Column String profileImageUrl; public User() { // empty constructor for Parceler } public static User fromJson(JSONObject json) { User user = new User(); try { user.uid = json.getLong("id"); user.name = json.getString("name"); user.screenName = String.format("@%s", json.getString("screen_name")); user.profileImageUrl = json.getString("profile_image_url"); } catch (JSONException e) { e.printStackTrace(); } return user; } public long getUid() { return this.uid; } public String getName() { return this.name; } public String getScreenName() { return this.screenName; } public String getProfileImageUrl() { return this.profileImageUrl; } public void setUid(long uid) { this.uid = uid; } public void setName(String name) { this.name = name; } public void setScreenName(String screenName) { this.screenName = screenName; } public void setProfileImageUrl(String profileImageUrl) { this.profileImageUrl = profileImageUrl; } }
0515007f06b0f2a08f787502dcdf6abd3c73d250
8b314b8fca24b08684ff4163aaef1b5635031665
/src/main/java/morozov/ru/controller/DriverController.java
93ba5f74940905c5447c87bd23916656b98bd219
[]
no_license
RomanMorozov88/Driver_Payment_System
09343f199674487bc414c1be13d7192e7585f8bc
67a60ee80201376188f6e6ec0fbf8a67b4e53da6
refs/heads/master
2023-01-19T23:34:45.645310
2020-11-12T10:22:29
2020-11-12T11:16:09
311,667,225
1
0
null
null
null
null
UTF-8
Java
false
false
2,939
java
package morozov.ru.controller; import morozov.ru.model.Account; import morozov.ru.model.Driver; import morozov.ru.model.util.ReMessageString; import morozov.ru.service.serviceinterface.DriverService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/dps") public class DriverController { @Value("${done.answer}") private String successMsg; @Value("${fail.answer}") private String failMsg; private final DriverService driverService; @Autowired public DriverController(DriverService driverService) { this.driverService = driverService; } /** * Список всех воителей. * Pagination * @param page - номер страницы для просмотра. * @param size - размер странцы. * @return */ @GetMapping("/drivers") public List<Driver> getAllDrivers( @RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "5") int size ) { Pageable pageable = PageRequest.of(page, size); return driverService.getAll(pageable); } /** * Создание записи нового водителя. * @param driver - данные нового водителя(тут только имя) * @return */ @PostMapping("/drivers") public Driver saveDriver(@RequestBody Driver driver) { Driver result = null; if (driver != null && driver.getName() != null) { result = driverService.save(driver); } return result; } /** * Получение всех счетов водителя. * @param id - id водителя. * @return */ @GetMapping("/drivers/{id}") public List<Account> getAllDriverAccounts(@PathVariable Integer id) { Driver targetDriver = driverService.getById(id); return targetDriver != null ? targetDriver.getAccounts() : null; } /** * Создание нового счёта. * @param id - id водителя, для которого создаётся счёт. * @return */ @PostMapping("/drivers/{id}") public ReMessageString createAccount(@PathVariable Integer id) { ReMessageString msg = new ReMessageString(); if (driverService.createAccount(id)) { msg.setData(successMsg); } else { msg.setData(failMsg); } return msg; } /** * Удаление водителя по id * @param id */ @DeleteMapping("/drivers/{id}") public void deleteDriver(@PathVariable Integer id) { driverService.delete(id); } }
6cd3516c8ae9a8417e0481e5bb7ec7f853e84eee
4d6f449339b36b8d4c25d8772212bf6cd339f087
/netreflected/src/Framework/mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089/system/runtime/compilerservices/CallConvCdecl.java
e392984d5a8a1519fe50b9bf0a68cc7491509920
[ "MIT" ]
permissive
lvyitian/JCOReflector
299a64550394db3e663567efc6e1996754f6946e
7e420dca504090b817c2fe208e4649804df1c3e1
refs/heads/master
2022-12-07T21:13:06.208025
2020-08-28T09:49:29
2020-08-28T09:49:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,304
java
/* * MIT License * * Copyright (c) 2020 MASES s.r.l. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /************************************************************************************** * <auto-generated> * This code was generated from a template using JCOReflector * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. * </auto-generated> *************************************************************************************/ package system.runtime.compilerservices; import org.mases.jcobridge.*; import org.mases.jcobridge.netreflection.*; import java.util.ArrayList; // Import section /** * The base .NET class managing System.Runtime.CompilerServices.CallConvCdecl, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. Extends {@link NetObject}. * <p> * * See: <a href="https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.CompilerServices.CallConvCdecl" target="_top">https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.CompilerServices.CallConvCdecl</a> */ public class CallConvCdecl extends NetObject { /** * Fully assembly qualified name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 */ public static final String assemblyFullName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; /** * Assembly name: mscorlib */ public static final String assemblyShortName = "mscorlib"; /** * Qualified class name: System.Runtime.CompilerServices.CallConvCdecl */ public static final String className = "System.Runtime.CompilerServices.CallConvCdecl"; static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName); /** * The type managed from JCOBridge. See {@link JCType} */ public static JCType classType = createType(); static JCEnum enumInstance = null; JCObject classInstance = null; static JCType createType() { try { return bridge.GetType(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName)); } catch (JCException e) { return null; } } void addReference(String ref) throws Throwable { try { bridge.AddReference(ref); } catch (JCNativeException jcne) { throw translateException(jcne); } } public CallConvCdecl(Object instance) throws Throwable { super(instance); if (instance instanceof JCObject) { classInstance = (JCObject) instance; } else throw new Exception("Cannot manage object, it is not a JCObject"); } public String getJCOAssemblyName() { return assemblyFullName; } public String getJCOClassName() { return className; } public String getJCOObjectName() { return className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); } public Object getJCOInstance() { return classInstance; } public void setJCOInstance(JCObject instance) { classInstance = instance; super.setJCOInstance(classInstance); } public JCType getJCOType() { return classType; } /** * Try to cast the {@link IJCOBridgeReflected} instance into {@link CallConvCdecl}, a cast assert is made to check if types are compatible. */ public static CallConvCdecl cast(IJCOBridgeReflected from) throws Throwable { NetType.AssertCast(classType, from); return new CallConvCdecl(from.getJCOInstance()); } // Constructors section public CallConvCdecl() throws Throwable { try { // add reference to assemblyName.dll file addReference(JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); setJCOInstance((JCObject)classType.NewObject()); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Methods section // Properties section // Instance Events section }
b0e79a93bd5f3a9207e8dd5a08c2a2763cb1b933
f8024a6353848e15fc5623f2a32b50b279b67e0d
/src/Entities/Mine.java
7d6c1dd3ef0d3f892310ca5a9022c62f6a1078ba
[]
no_license
Starpicka/Slick2DGame
9709078449c6e10baf1b7cefb789e82620ae5376
84ff1266d42b73679d34c58da98812678cf2b5de
refs/heads/main
2023-03-17T14:31:39.441514
2021-03-12T10:19:45
2021-03-12T10:19:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,220
java
package Entities; import org.newdawn.slick.Graphics; import org.newdawn.slick.Image; import org.newdawn.slick.SlickException; import org.newdawn.slick.geom.Rectangle; import Utilities.Animation; import Utilities.Vector2f; public class Mine extends Entity { private Image tex; private float orePerSec; private float oreAmount; public Mine(float movementSpeed, Vector2f pos, float damage, float health, float attackCooldown, Animation animation) { super(movementSpeed, pos, damage, health, attackCooldown, animation); } public Mine(Vector2f pos) throws SlickException { super(0, pos, 0, 100, 0, null); this.tex = new Image("res/Sprites/Entities/mine.png"); hitbox = new Rectangle(pos.x, pos.y, this.tex.getWidth(), this.tex.getWidth()); this.orePerSec = 0; } @Override public void update(float dt) { oreAmount += orePerSec * dt; } @Override public void render(Graphics g) { g.drawImage(tex, pos.x, pos.y); } public float getOreAmount() { return oreAmount; } public void removeOre(int amount) { oreAmount -= amount; } public void setOrePerSec(float orePerSec) { this.orePerSec = orePerSec; } }
a72f2d73cb32d066f6f5c7e3fb88378c830ce70a
711e0d680b6a659ecc703bd05db17fbf41a7284f
/java/Time Conversion.java
663056983be38566b891d55aa94c81b2846a8475
[]
no_license
pluralism/hackerrank
d3448f1777e5c493820f94d9b31d0f5f1cbf4a07
e46a17fc421537ade74ddeae77a13bd6a4c37641
refs/heads/master
2021-01-19T03:09:08.654707
2019-10-06T11:29:36
2019-10-06T11:29:36
46,612,415
0
0
null
null
null
null
UTF-8
Java
false
false
635
java
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.nextLine(); String[] hoursSplitted = s.split(":"); String hours = hoursSplitted[0]; if(hoursSplitted[2].substring(2, 4).equals("AM")) { if(hours.equals("12")) hours = "00"; } else if (!hours.equals("12")) hours = String.format("%2d", Integer.parseInt(hours) + 12); System.out.println(hours + ":" + hoursSplitted[1] + ":" + hoursSplitted[2].substring(0, 2)); } }
2c44496922bdeaadc1c1c6b5baaf9d80eb629865
35be182e02efd8308a5814f06d718ebddd311d1d
/anyviewj/src/anyviewj/debug/breakpoint/InvalidArgumentTypeException.java
51ce809d2eb3f286fc296ecb8f0ee3705eb468bf
[]
no_license
houjincheng/graduation_project
c694bff99ad073d7bc8b080e7505a8255ad70b3e
6229388c2f40eb6c0774809fe56c0c9e20d0d065
refs/heads/master
2020-04-06T04:32:36.275225
2015-03-22T11:58:12
2015-03-22T11:58:12
32,659,519
0
0
null
null
null
null
UTF-8
Java
false
false
774
java
package anyviewj.debug.breakpoint; /** * InvalidArgumentTypeException is thrown when the specified argument * type was invalid or unrecognized. * * @author ltt */ public class InvalidArgumentTypeException extends Exception { /** silence the compiler warnings */ private static final long serialVersionUID = 1L; /** * Constructs a InvalidArgumentTypeException with no message. */ public InvalidArgumentTypeException() { super(); } // InvalidArgumentTypeException /** * Constructs a InvalidArgumentTypeException with the given message. * * @param s Message. */ public InvalidArgumentTypeException(String s) { super(s); } // InvalidArgumentTypeException } // InvalidArgumentTypeException
e3a9c9f2844fbd6b5d448f54cdf7b7f1ff2ccbd5
c91f4ea7f270ecc1a5266c28ba03a2b647229165
/mindstorm-modules/mindstorm-education/src/main/java/cn/lwjppz/mindstorm/education/model/vo/courseclass/CourseClassVO.java
69ee25f5d41226cf67295c31a6a178afddb68056
[]
no_license
hanlibaby/MindStorm
b0662670b99844d89999b1725e633a9cccf261f5
55e01cb3a41b95463f57769e3df87f5872bf3b2b
refs/heads/main
2023-07-07T20:53:09.484222
2021-08-12T13:15:21
2021-08-12T13:15:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
664
java
package cn.lwjppz.mindstorm.education.model.vo.courseclass; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; /** * <p></p> * * @author : lwj * @since : 2021-07-15 */ @Data @AllArgsConstructor @NoArgsConstructor @ToString public class CourseClassVO { @ApiModelProperty(value = "课程班级Id") private String id; @ApiModelProperty(value = "课程Id") private String courseId; @ApiModelProperty(value = "班级名称") private String className; @ApiModelProperty(value = "班级排序") private Integer sort; }
482517eb53d3adadcdac14b2a46bfde8b9d2198a
649ce769206e8d34282f955284eed4ced47a3c94
/src/main/java/XIS/toolset/scanfilters/Arguments.java
c4f16ce6e2e9bb8b101818e4eecd940fa4786810
[]
no_license
kamil-sita/XIS
a66e33dad4252c66f4b6bf3b2d648252d18d8499
b105c4f90e603ffcc6c2ef1983506b8699cb7070
refs/heads/master
2021-12-15T03:03:52.665615
2021-12-06T22:10:11
2021-12-06T22:10:11
122,327,856
3
0
null
2021-06-15T15:59:11
2018-02-21T11:28:55
Java
UTF-8
Java
false
false
65
java
package XIS.toolset.scanfilters; public interface Arguments { }
8d379b4762f86b02c072f92647b69f27f648b308
152d3198e5c42bd6c61301c4437b759074932224
/src/main/java/com/tts/ms/bis/wx/sdk/pay/payment/wrapper/OrderCloseResponseWrapper.java
e5afc41e1c0430cd1f7a1088701d699edd2b0975
[]
no_license
jilun2016/tts
00fa44c2a230f8f417e01f8cb509b6a05b459ebd
8eb2bb41ee4d0fa044b17229b8a165adbc76d8b9
refs/heads/master
2021-09-08T01:51:16.395548
2018-03-05T16:07:11
2018-03-05T16:07:11
115,126,932
0
0
null
null
null
null
UTF-8
Java
false
false
479
java
package com.tts.ms.bis.wx.sdk.pay.payment.wrapper; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.tts.ms.bis.wx.sdk.pay.base.BaseResponse; /** * @borball on 1/13/2017. */ public class OrderCloseResponseWrapper extends BaseSettings { @JsonUnwrapped private BaseResponse response; public BaseResponse getResponse() { return response; } public void setResponse(BaseResponse response) { this.response = response; } }
1a4a20d325f00e855229894da26d9d04144bbaeb
5cfb3314fb9d1d172f7ca16d3aa753fd21eb551d
/src/java/BusinessLayer/ServiceImplementation/EpaTasasOcupActivFacadeREST.java
a80c3543675c89a3a87446a421c2b077042322cb
[]
no_license
AntGarSil/ecotrab-nlayer
53840dbf23f783e91771ecc26ab5847e96043251
7f79f376aba483027b9d03ddb5085b7d3ea1b1dd
refs/heads/master
2020-09-12T14:50:52.741328
2012-08-01T23:06:23
2012-08-01T23:06:23
5,265,175
1
0
null
null
null
null
UTF-8
Java
false
false
2,084
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package BusinessLayer.ServiceImplementation; import DataLayer.Entities.EpaTasasOcupActiv; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.ws.rs.*; /** * * @author PC */ @Stateless @Path("datalayer.entities.epatasasocupactiv") public class EpaTasasOcupActivFacadeREST extends AbstractFacade<EpaTasasOcupActiv> { @PersistenceContext(unitName = "ecotrab-finalPU") private EntityManager em; public EpaTasasOcupActivFacadeREST() { super(EpaTasasOcupActiv.class); } @POST @Override @Consumes({"application/xml", "application/json"}) public void create(EpaTasasOcupActiv entity) { super.create(entity); } @PUT @Override @Consumes({"application/xml", "application/json"}) public void edit(EpaTasasOcupActiv entity) { super.edit(entity); } @DELETE @Path("{id}") public void remove(@PathParam("id") Integer id) { super.remove(super.find(id)); } @GET @Path("{id}") @Produces({"application/xml", "application/json"}) public EpaTasasOcupActiv find(@PathParam("id") Integer id) { return super.find(id); } @GET @Override @Produces({"application/xml", "application/json"}) public List<EpaTasasOcupActiv> findAll() { return super.findAll(); } @GET @Path("{from}/{to}") @Produces({"application/xml", "application/json"}) public List<EpaTasasOcupActiv> findRange(@PathParam("from") Integer from, @PathParam("to") Integer to) { return super.findRange(new int[]{from, to}); } @GET @Path("count") @Produces("text/plain") public String countREST() { return String.valueOf(super.count()); } @java.lang.Override protected EntityManager getEntityManager() { return em; } }
d4b711364e483604fc7ba5929ba7bfffa63048fc
db6c1e0e9047985b8650099b20208409bbe39b6c
/NewsManuscript/src/com/exceptions/refereeManage/RefereeAddManuscriptNotExistentException.java
ed6080142b2a328e75c13f4c501d1053d73a7141
[]
no_license
zs512/NewsManuscript
70841d525769bb75c97d69073b55f688c7a1f6d2
b0cc88d01c695e985acc031f88e1a6901f8d275f
refs/heads/master
2021-01-10T21:58:10.668124
2015-06-10T16:21:46
2015-06-10T16:21:49
34,776,913
0
0
null
null
null
null
UTF-8
Java
false
false
311
java
package com.exceptions.refereeManage; /** * Created by ruanqx on 2015/6/5. */ public class RefereeAddManuscriptNotExistentException extends Exception{ public RefereeAddManuscriptNotExistentException(){} public RefereeAddManuscriptNotExistentException(String message){ super(message); } }
ba0faaa723d1cd6b9f50d373e9e418758ab32a21
178f90d93257ca3e82ee8affa44efdacf86a5df1
/src/com/example/cellphonesaferactivity/activity/MainActivity.java
a2b641d4c023ea4538f3e24786b7867cf440ad3c
[]
no_license
lsmtty/CellphoneSafer
33725d68ee5367bca84849890a95f93201655a65
81bef57f532437438c4a7ef0f2f71981b11336a5
refs/heads/master
2021-01-17T14:54:06.471893
2015-11-18T13:26:09
2015-11-18T13:26:09
45,382,354
0
1
null
2019-12-30T15:06:11
2015-11-02T08:44:55
Java
UTF-8
Java
false
false
8,133
java
package com.example.cellphonesaferactivity.activity; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.security.auth.login.LoginException; import com.example.cellphonesafer.R; import com.example.cellphonesaferactivity.Utils.MD5Utils; import com.example.cellphonesaferactivity.Utils.SharedPreferencesUtils; import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.Dialog; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.text.TextUtils; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.Button; import android.widget.EditText; import android.widget.GridView; import android.widget.RelativeLayout; import android.widget.SimpleAdapter; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends Activity { private int[] PhotoId = new int[] { R.drawable.home_safe, R.drawable.home_callmsgsafe, R.drawable.home_apps, R.drawable.home_taskmanager, R.drawable.home_netmanager, R.drawable.home_trojan, R.drawable.home_sysoptimize, R.drawable.home_tools, R.drawable.home_settings }; private String[] photoName = new String[] { "手机防盗", "通讯卫士", "软件管理", "进程管理", "流量统计", "手机杀毒", "缓存清理", "高级工具", "设置中心" }; List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); private GridView gridView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initList(); gridView = (GridView) findViewById(R.id.main_gv); gridView.setAdapter(new SimpleAdapter(this, list, R.layout.main_grid_item, new String[] { "id", "name" }, new int[] { R.id.griditem_iv, R.id.griditem_tv })); gridView.setOnItemClickListener(new OnItemClickListener() { private RelativeLayout setPasswordLayout; private AlertDialog setPasswordDialog; private EditText password; private EditText confirm_password; private RelativeLayout inputPasswordLayout; private EditText input_password; private AlertDialog inputDialog; @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // TODO Auto-generated method stub //Log.i("message", "" + position); switch (position) { case 0: if ("0".equals(SharedPreferencesUtils.getString("config", MainActivity.this, "safer_key", "0"))) { AlertDialog.Builder setPassword = new Builder( MainActivity.this); setPassword.setIcon(getResources().getDrawable( R.drawable.abc_ab_bottom_solid_light_holo)); setPassword.setTitle("设置安全密码"); setPasswordLayout = (RelativeLayout) getLayoutInflater() .inflate(R.layout.setpassword_layout, null); // 动态填充,防止反复调用会显示已经有父布局 password = (EditText) setPasswordLayout .findViewById(R.id.input_password); confirm_password = (EditText) setPasswordLayout .findViewById(R.id.confim_password); Button positive = (Button) setPasswordLayout .findViewById(R.id.positive); Button negative = (Button) setPasswordLayout .findViewById(R.id.negative); positive.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub if(TextUtils.isEmpty(password.getText().toString())||TextUtils.isEmpty(confirm_password.getText().toString())) { Toast.makeText(MainActivity.this, "密码不能为空", 1).show(); } else { if(!password.getText().toString().equals(confirm_password.getText().toString())) { Toast.makeText(MainActivity.this, "两次输入密码不相同", 1).show(); } else { String MD5Password = MD5Utils.getMD5String(password.getText().toString()); Log.i("password", MD5Password); SharedPreferencesUtils.setString("config",MainActivity.this, "safer_key", MD5Password); Toast.makeText(MainActivity.this, "密码保存成功", 1).show(); startActivity(new Intent(MainActivity.this,MobileProtectSetting1.class));//保存成功直接进入设置页面 setPasswordDialog.dismiss(); } } } }); negative.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub setPasswordDialog.dismiss(); } }); setPassword.setView(setPasswordLayout); setPasswordDialog = setPassword.show(); } else {//第二次登录不用进入向导页面直接转入手机安全主页 AlertDialog.Builder inputPassword = new Builder(MainActivity.this); inputPassword.setIcon(getResources().getDrawable( R.drawable.abc_ab_bottom_solid_light_holo)); inputPassword.setTitle("请输入安全密码"); inputPasswordLayout = (RelativeLayout) getLayoutInflater().inflate(R.layout.inputpassword_layout, null); input_password = (EditText) inputPasswordLayout .findViewById(R.id.input_password_enter); Button positive_enter = (Button) inputPasswordLayout .findViewById(R.id.positive_enter); Button negative_enter = (Button) inputPasswordLayout .findViewById(R.id.negative_enter); inputPassword.setView(inputPasswordLayout); positive_enter.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub String MD5input = MD5Utils.getMD5String(input_password.getText().toString()); if(MD5input.equals(SharedPreferencesUtils.getString("config", MainActivity.this, "safer_key", "0"))) { inputDialog.dismiss(); startActivity(new Intent(MainActivity.this,MobileProtectSettingFinish.class)); //Toast.makeText(MainActivity.this, "密码正确", 1).show(); //进入手机防盗页面或者防盗设置页面 } else { Toast.makeText(MainActivity.this, "密码错误", 1).show(); //判断是否有设置安全信息,未设置则首先进入设置页面。已设置则跳过先导页面直接进入主页面 } } }); negative_enter.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub inputDialog.dismiss(); } }); inputDialog = inputPassword.show(); } break; case 1: //通讯卫士页面 startActivity(new Intent(MainActivity.this,BlackNameActivity.class)); break; case 2: //软件管理页面 startActivity(new Intent(MainActivity.this,SoftManagementActivity.class)); break; case 3: //进程管理页面 startActivity(new Intent(MainActivity.this,ProgressControlActivity.class)); break; case 5://进入手机杀毒页面 startActivity(new Intent(MainActivity.this,KillVirus.class)); break; case 6://进入缓存清理页面 startActivity(new Intent(MainActivity.this,ClearCacheActivity.class)); break; case 7: //高级工具页面 startActivity(new Intent(MainActivity.this,AdvancedToolsActivity.class)); break; case 8: //设置中心页面 startActivity(new Intent(MainActivity.this, Setting_activity.class)); break; default: break; } } }); } private void initList() { // TODO Auto-generated method stub for (int i = 0; i < photoName.length; i++) { Map<String, Object> newMap = new HashMap<String, Object>(); newMap.put("id", PhotoId[i]); newMap.put("name", photoName[i]); list.add(newMap); } } }
d81068c9c0030f0350d6a8944530d92cb9494484
cfe89a5d77803b3cd370038d5e50ebfd28224900
/service/service-core/src/test/java/mall/service/util/ClassUtilsTest.java
cb90c89c3a0fe583e68ede0b373bcfdcdcbde206
[]
no_license
moriartyy/mall
4bbdf4314051b72b55b5d086212fd4ceba0c3861
c2b53736621a333eb2385b14027517ec91f2a6d2
refs/heads/master
2023-08-02T17:45:53.536011
2021-09-08T14:08:07
2021-09-08T14:08:07
402,373,486
0
0
null
null
null
null
UTF-8
Java
false
false
1,842
java
package mall.service.util; import mall.service.util.tree.*; import org.junit.jupiter.api.Test; import org.springframework.core.ResolvableType; import java.util.Arrays; import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author walter */ class ClassUtilsTest { @Test void resolveGenericType() { DummyEventHandler h = new DummyEventHandler(); assertEquals(DummyEvent.class, ClassUtils.resolveGenericType(h.getClass())); assertEquals(DummyEvent.class, h.getEventType()); assertEquals(Red.class, ClassUtils.resolveGenericTypes(RedAppleTree.class, AppleTree.class)[0]); assertEquals(Apple.class, ClassUtils.resolveGenericTypes(RedAppleTree.class, AbstractTree.class)[0]); assertEquals(Red.class, ClassUtils.resolveGenericTypes(RedAppleTree.class, AbstractTree.class)[1]); assertEquals(Apple.class, ClassUtils.resolveGenericTypes(RedAppleTree.class, Tree.class)[0]); } @Test void test() { ResolvableType resolvableType = ResolvableType.forClass(RedAppleTree.class); do { printType(resolvableType); } while ((resolvableType = resolvableType.getSuperType()) != ResolvableType.NONE); Arrays.stream(ResolvableType.forClass(RedAppleTree.class).getInterfaces()).forEach(t -> { printType(t); }); System.out.println(ResolvableType.forClass(AbstractTree.class).getInterfaces().length); System.out.println(AppleTree.class.getGenericInterfaces().length); } private void printType(ResolvableType resolvableType) { System.out.println(resolvableType.getRawClass() == AbstractTree.class); System.out.println(resolvableType.getRawClass()); System.out.println(resolvableType.resolve()); System.out.println("---------------\r\n"); } }
c786e02b6a94a5da65460b0928df6b59e4e474ea
ab97da270946027adaca22332d9ec16f265a39e5
/website/src/com/admin/productdao.java
4e07f75898433ffba27437928a7c778c33ddb17d
[]
no_license
amankush1999/website
0504fa84393da0bbf61ce92041ede6f8d180d770
3848bc663b2e67b06a7a666f6feef03b9f5580ed
refs/heads/master
2020-07-22T17:04:04.306323
2019-09-09T09:09:15
2019-09-09T09:09:15
207,268,516
0
0
null
null
null
null
UTF-8
Java
false
false
137
java
package com.admin; public interface productdao { public boolean add(product pro); public boolean delete(product pro1); }
ecf5df64c2366cd87894cc8608d92f92e0114a77
552435beee2fd5f4f873fdc8ca9cd37eaa025449
/ch12/beans/ArticleBean.java
a79675008b03c06f3ff2ab6e743a3e776874bf0e
[]
no_license
cyberdive/jspbook
d01f3a4e1f4102713140ba3dc13198380bbcdb69
74795c0113de3440c7b9f6b68e59ed10942c8e76
refs/heads/master
2021-05-21T19:37:13.654281
2020-04-03T15:39:20
2020-04-03T15:39:20
252,772,813
0
0
null
null
null
null
UTF-8
Java
false
false
8,193
java
package com.awl.jspbook.ch12; import java.sql.*; import java.text.SimpleDateFormat; public class ArticleBean { private String orderBy = ""; private Statement st = null; private ResultSet rs; private String keywords[]; public ArticleBean () { setPubtime((new java.util.Date()).getTime()); } public void setKeywords(String keywords[]) { this.keywords = keywords; } public void updateKeywords() { if(keywords == null) return; try { if (rs != null) {rs.close(); rs = null;} if (st != null) {st.close(); st = null;} Connection tmp = PersistentConnection.getConnection(); st = tmp.createStatement(); for (int i=0;i<keywords.length;i++) { String query = "INSERT INTO articlekeywords VALUES(" + articleId + "," + keywords[i].trim() + ");"; st.executeUpdate(query); } st.close(); } catch (Exception e) { e.printStackTrace(System.err); } } public void setOrderBy(String orderBy) { this.orderBy = "ORDER BY " + orderBy; } private int articleId; private boolean articleIdSet = false; public int getArticleId() { if(rs == null) return 0; try { articleId = rs.getInt("articleId"); return articleId; } catch(Exception e) { e.printStackTrace(System.err); } return 0; } public String getArticleIdString() { if(rs == null) return "0"; try { return "" + rs.getInt("articleId"); } catch(Exception e) { e.printStackTrace(System.err); } return "0"; } public void setArticleId(int articleId) { this.articleId = articleId; this.articleIdSet = true; } private int sectionId; private boolean sectionIdSet = false; public int getSectionId() { if(rs == null) return 0; try { return rs.getInt("sectionId"); } catch(Exception e) { e.printStackTrace(System.err); } return 0; } public void setSectionId(int sectionId) { if(sectionId == 0) { this.sectionId = 0; this.sectionIdSet = false; } else { this.sectionId = sectionId; this.sectionIdSet = true; } } private int authorId; private boolean authorIdSet = false; public int getAuthorId() { if(rs == null) return 0; try { return rs.getInt("authorId"); } catch(Exception e) { e.printStackTrace(System.err); } return 0; } public void setAuthorId(int authorId) { this.authorId = authorId; this.authorIdSet = true; } private long pubtime; private boolean pubtimeSet = false; public long getPubtime() { if(rs == null) return 0; try { return rs.getLong("pubtime"); } catch(Exception e) { e.printStackTrace(System.err); } return 0; } public void setPubtime(long pubtime) { this.pubtime = pubtime; this.pubtimeSet = true; } private String headline; private boolean headlineSet = false; public String getHeadline() { if(rs == null) return null; try { return rs.getString("headline"); } catch(Exception e) { e.printStackTrace(System.err); } return null; } public String getHeadlineURLEncoded() { if(rs == null) return null; try { return rs.getString("headline").replace(' ','+'); } catch(Exception e) { e.printStackTrace(System.err); } return null; } public void setHeadline(String headline) { this.headline = headline.replace('\n',' '); this.headlineSet = true; } private String summary; private boolean summarySet = false; public String getSummary() { if(rs == null) return null; try { return rs.getString("summary"); } catch(Exception e) { e.printStackTrace(System.err); } return null; } public String getSummaryURLEncoded() { if(rs == null) return null; try { return rs.getString("summary").replace(' ','+'); } catch(Exception e) { e.printStackTrace(System.err); } return null; } public void setSummary(String summary) { this.summary = summary.replace('\n',' '); this.summarySet = true; } private String body; private boolean bodySet = false; public String getBody() { if(rs == null) return null; try { return rs.getString("body"); } catch(Exception e) { e.printStackTrace(System.err); } return null; } public String getBodyURLEncoded() { if(rs == null) return null; try { return rs.getString("body").replace(' ','+'); } catch(Exception e) { e.printStackTrace(System.err); } return null; } public void setBody(String body) { this.body = body.replace('\n',' '); this.bodySet = true; } public void select() { try { if (rs != null) {rs.close(); rs = null;} if (st != null) {st.close(); st = null;} Connection tmp = PersistentConnection.getConnection(); st = tmp.createStatement(); String query = "SELECT * FROM Articles"; String where = buildWhere(); rs = st.executeQuery(query + where + " " + orderBy); articleIdSet = false; sectionIdSet = false; authorIdSet = false; pubtimeSet = false; headlineSet = false; summarySet = false; bodySet = false; } catch (Exception e) { e.printStackTrace(System.err); } } private String buildWhere() { StringBuffer where = new StringBuffer(20); boolean nonEmpty = false; if(articleIdSet) { if(nonEmpty) where.append(" AND "); where.append("articleId="); where.append(articleId); nonEmpty = true; } if(sectionIdSet) { if(nonEmpty) where.append(" AND "); where.append("sectionId="); where.append(sectionId); nonEmpty = true; } if(authorIdSet) { if(nonEmpty) where.append(" AND "); where.append("authorId="); where.append(authorId); nonEmpty = true; } if(headlineSet) { if(nonEmpty) where.append(" AND "); where.append("headline='"); where.append(headline); where.append("'"); nonEmpty = true; } if(summarySet) { if(nonEmpty) where.append(" AND "); where.append("summary='"); where.append(summary); where.append("'"); nonEmpty = true; } if(bodySet) { if(nonEmpty) where.append(" AND "); where.append("body='"); where.append(body); where.append("'"); nonEmpty = true; } String res = where.toString(); if(nonEmpty) res = " WHERE " + res; return res; } public void insert() { try { if (rs != null) {rs.close(); rs = null;} if (st != null) {st.close(); rs = null;} Connection tmp = PersistentConnection.getConnection(); st = tmp.createStatement(); StringBuffer query = new StringBuffer(100); query.append("INSERT INTO articles(sectionId,authorId,pubtime,headline,summary,body) VALUES("); query.append(sectionId); query.append(","); query.append(authorId); query.append(",'"); SimpleDateFormat sdf = new SimpleDateFormat(); query.append(sdf.format(new java.util.Date())); query.append("',"); query.append("'"); query.append(headline); query.append("'"); query.append(","); query.append("'"); query.append(summary); query.append("'"); query.append(","); query.append("'"); query.append(body); query.append("'"); query.append(")"); int tmp2 = st.executeUpdate(query.toString()); System.err.println("Insert returned " + tmp2); sectionIdSet = authorIdSet = articleIdSet = headlineSet = summarySet = bodySet = false; st.close(); st = null; PersistentConnection.reset(); } catch (Exception e) { e.printStackTrace(System.err); } } public boolean next() { if(rs == null) return false; try { return rs.next(); } catch (Exception e) { e.printStackTrace(System.err); return false; } } public void cleanup() { try { if (rs != null) rs.close(); if (st != null) st.close(); } catch (Exception e) { } } }
6cd40507ba817607aa3f735d308be3f2bc3a0996
55b4b2de462019a3d82c453940caf0c1da935679
/TreeMapTest02/src/TreeMapTest02.java
b4c4d2e7c12aad97b4e3cf9da52a940c12ad6a83
[]
no_license
y0-0nhj/WhatisJava
060b39246fccd6a75446a0cc2fcc429fa4e2a474
3e05fbb36d875504bb82028dde6c6755f96f02a4
refs/heads/master
2023-05-01T03:35:25.054765
2021-05-21T03:34:46
2021-05-21T03:34:46
null
0
0
null
null
null
null
UHC
Java
false
false
497
java
// 문제) // 1. 키:학생이름(String), 값:점수(Integer)를 저장하는 TreeMap인 map인 map을 생성아시오. // 2. 5명의 학생 데이터를 추가하시오. // 3. 키와 값의 중복을 확인하시오. // 4. 양석형 학생의 정보를 삭제하시오. // 5. 안정원 학생의 점수를 88에서 82으로 수정하시오. // 6. 데이터를 3가지 방법으로 출력하시오. public class TreeMapTest02 { public static void main(String[] args) { } }
[ "yun00@DESKTOP-F5N6OD1" ]
yun00@DESKTOP-F5N6OD1
135471f3403fd73811143ce500c91a2a5bb52fa9
6a1f7f6e8447f15ba69043b0c7a4e431fccd043c
/android/app/src/main/java/com/sonhador/MainApplication.java
214718ff41d2c54a2a9b3ea346ff1f232c3f9fc4
[]
no_license
MatheusRmelo/sonhador_app
ea8af6b7f527b2ec556fcaea6c8157270943b9a7
cbe036b2b6c4e645ec0b465b12ce4858e1515c78
refs/heads/master
2023-08-17T04:07:26.641246
2021-01-05T19:01:12
2021-01-05T19:01:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,653
java
package com.sonhador; import android.app.Application; import android.content.Context; import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import java.lang.reflect.InvocationTargetException; import java.util.List; import androidx.multidex.MultiDexApplication; public class MainApplication extends MultiDexApplication implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List<ReactPackage> packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); return packages; } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); } /** * Loads Flipper in React Native templates. Call this in the onCreate method with something like * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); * * @param context * @param reactInstanceManager */ private static void initializeFlipper( Context context, ReactInstanceManager reactInstanceManager) { if (BuildConfig.DEBUG) { try { /* We use reflection here to pick up the class that initializes Flipper, since Flipper library is not available in release mode */ Class<?> aClass = Class.forName("com.sonhador.ReactNativeFlipper"); aClass .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) .invoke(null, context, reactInstanceManager); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } } }
2765486e98d11ef3f499fda8f30c37758f400ce0
b86a00d6244329a56d9229e39fd13bae5d1be974
/source/ddc-core/src/main/java/com/imperva/ddc/core/query/TestQueryType.java
4ca94cd08d9cf835a09d932c6c22c169374291d0
[ "Apache-2.0" ]
permissive
imperva/domain-directory-controller
7a5f72f94f1ba0f927077df0b2cc67cecf89a694
6916a6d8aeb43efd0f00b5392253eaabe48c9a96
refs/heads/master
2023-06-07T22:59:45.221761
2022-02-06T13:42:00
2022-02-06T13:42:00
149,281,309
68
24
NOASSERTION
2023-06-05T19:25:05
2018-09-18T12:01:12
Java
UTF-8
Java
false
false
158
java
package com.imperva.ddc.core.query; /** * Created by gabi.beyo on 10/13/2016. */ public enum TestQueryType { NONE, DATA_FOUND, NO_DATA_FOUND }
7321c26c003bc830ef24fbeff128ce8e7e346b54
51c09f59d0f64ea304e96ce9ec49ec5e3c1feed6
/src/main/java/com/github/raphael/cities/entities/City.java
0fc5ebbfcdb48da8a9e8d24dc31eed807691f8ba
[]
no_license
raphael690/cities-api
96703af7946d6fe9f06a1fec28c0cb834ea00a00
4603ff1b26ecaa6a27d109bea2dd869c2e042c95
refs/heads/main
2023-05-09T12:34:59.183404
2021-05-25T05:55:23
2021-05-25T05:55:23
370,568,648
0
0
null
null
null
null
UTF-8
Java
false
false
1,431
java
package com.github.raphael.cities.entities; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; import org.springframework.data.geo.Point; @Entity @Table(name = "cidade") @TypeDefs(value = { @TypeDef(name = "point", typeClass = PointType.class) }) public class City { @Id private Long id; @Column(name = "nome") private String name; private Integer uf; private Integer ibge; // 1st @Column(name = "lat_lon") private String geolocation; // 2nd @Type(type = "point") @Column(name = "lat_lon", updatable = false, insertable = false) private Point location; public City() { } public City(final Long id, final String name, final Integer uf, final Integer ibge, final String geolocation, final Point location) { this.id = id; this.name = name; this.uf = uf; this.ibge = ibge; this.geolocation = geolocation; this.location = location; } public Long getId() { return id; } public String getName() { return name; } public Integer getUf() { return uf; } public Integer getIbge() { return ibge; } public String getGeolocation() { return geolocation; } public Point getLocation() { return location; } }
05e31187e408d75f69a41a1235b208c4e437f43f
482be7366b2e5bffe4651faabb86f77d5579bef4
/demo/demo-web/src/main/java/com/example/demo/mybatis/controller/BookController.java
d75ff17c998c8bea47e48a920e276b81779b2dea
[ "Apache-2.0" ]
permissive
xiaolv857/LibraryLib
24a16e2232bf403b86e5db66bef121a79d716999
268c73c1bc401ded34906ff4636747f077561d5e
refs/heads/main
2023-06-17T06:16:49.297943
2021-07-19T05:46:27
2021-07-19T05:46:27
386,488,258
0
0
Apache-2.0
2021-07-19T05:46:28
2021-07-16T02:47:09
null
UTF-8
Java
false
false
1,661
java
package com.example.demo.mybatis.controller; import com.example.demo.mybatis.entity.BookDTO; import com.example.demo.mybatis.mapper.BookMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @RequestMapping("/book") public class BookController { @Autowired(required=false) private BookMapper bookMapper; @Autowired private RedisTemplate redisTemplate; @RequestMapping("/findAll") public List<BookDTO> findAll() { return bookMapper.findAll(); } @RequestMapping("/findByCache") public List<BookDTO> findByCache() { //优先取缓存数据 Object obj = redisTemplate.opsForValue().get("demo-book-findByCache"); if (null != obj){ System.out.println("走缓存"); return (List<BookDTO>) obj; } //缓存为空,重新查找且缓存 System.out.println("走DB"); List<BookDTO> localList = bookMapper.findAll(); redisTemplate.opsForValue().set("demo-book-findByCache",localList); return localList; } @RequestMapping("/clearCache") public String clearCache() { //优先取缓存数据 Object obj = redisTemplate.opsForValue().get("demo-book-findByCache"); if (null != obj){ redisTemplate.delete("demo-book-findByCache"); return "缓存非空,已成功删除"; } return "缓存为空,无需操作"; } }
c0b23f4f8ce7ae53f503f389334929e9982492a4
7007371aa342a7475ccc7f4cd83d415e655a5ae0
/src/oculus/xdataht/model/ClassifierResult.java
50a13f0f1c7c9ed59383e5045c7b9ee733913a82
[]
no_license
curtiszimmerman/TellFinder
31a677ac80990108cf92fa0cd7f8a9d29219f0b6
5fa920ca5b24f8ca87e35400eeccf55fda75aa7e
refs/heads/master
2021-01-18T07:02:33.736423
2015-04-08T16:27:58
2015-04-08T16:27:59
34,244,631
3
3
null
2015-04-20T07:20:01
2015-04-20T07:19:59
null
UTF-8
Java
false
false
2,025
java
/** * Copyright (c) 2013-2015 Uncharted Software Inc. * http://uncharted.software/ * * Released under the MIT License. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package oculus.xdataht.model; import java.util.ArrayList; import java.util.Collection; import javax.xml.bind.annotation.XmlRootElement; /** A single classifier / concept and its associated keywords. */ @XmlRootElement public class ClassifierResult { private String classifier; private ArrayList<String> keywords; public ClassifierResult() { } public ClassifierResult(String classifier, Collection<String> keywords) { this.classifier = classifier; this.keywords = new ArrayList<String>(keywords); } public String getClassifier() { return this.classifier; } public void setClassifier(String classifier) { this.classifier = classifier; } public ArrayList<String> getKeywords() { return this.keywords; } public void setKeywords(ArrayList<String> keywords) { this.keywords = keywords; } }
29e39bf77d0183d6ecb48f89c71a943601524c1d
72919ef25f2cf5e35834e2058cc8ba8b49dc030f
/back/src/main/java/com/saveaspot/parking/saveaspot/ControllerSpot.java
492c24241390626e2aab88a8fca4981f17d96f9f
[]
no_license
opreateodora/ParkNow
cba6b9c836d158ca540e97f5e755aec031f8d46a
756e9a18951bd3c6e2a6ced818479682d4364f02
refs/heads/main
2023-01-09T21:07:56.901661
2020-11-10T21:06:13
2020-11-10T21:06:13
311,782,084
0
0
null
null
null
null
UTF-8
Java
false
false
1,066
java
package com.saveaspot.parking.saveaspot; import java.util.List; import javax.ws.rs.core.MediaType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.jpa.repository.query.Procedure; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @RestController public class ControllerSpot { private final SpotService SpotService; public ControllerSpot(SpotService SpotService) { this.SpotService = SpotService; } @PostMapping("/AddSpot") @Procedure(MediaType.APPLICATION_JSON) public ResponseEntity<Void> register(@RequestBody Spot spot) { SpotService.saveSpot(spot); return new ResponseEntity<Void>(null, null,HttpStatus.OK); } @GetMapping("/getSpot") @Procedure(MediaType.APPLICATION_JSON) public ResponseEntity<?> getSpot() { return new ResponseEntity <List<Spot>> (this.SpotService.getAll(),HttpStatus.OK); } }
cb2abaeff5f9d0730faa99525fb0a463cb6e745b
dd80a584130ef1a0333429ba76c1cee0eb40df73
/development/samples/training/testingfun/app/src/com/example/android/testingfun/lesson4/LaunchActivity.java
8f1fb9b8c561d7663afe83b15e8d95cede93bb50
[ "Apache-2.0", "MIT" ]
permissive
karunmatharu/Android-4.4-Pay-by-Data
466f4e169ede13c5835424c78e8c30ce58f885c1
fcb778e92d4aad525ef7a995660580f948d40bc9
refs/heads/master
2021-03-24T13:33:01.721868
2017-02-18T17:48:49
2017-02-18T17:48:49
81,847,777
0
2
MIT
2020-03-09T00:02:12
2017-02-13T16:47:00
null
UTF-8
Java
false
false
1,653
java
/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.android.testingfun.lesson4; import com.example.android.testingfun.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; /** * Launches NextActivity and passes a payload in the Bundle. */ public class LaunchActivity extends Activity { /** * The payload that is passed as Intent data to NextActivity. */ public final static String STRING_PAYLOAD = "Started from LaunchActivity"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_launch_next); Button launchNextButton = (Button) findViewById(R.id.launch_next_activity_button); launchNextButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(NextActivity.makeIntent(LaunchActivity.this, STRING_PAYLOAD)); finish(); } }); } }
b3063a0c0a539e2fa031b763971f2fde07e7428e
fbf27d453d933352a2c8ef76e0445f59e6b5d304
/server/src/com/fy/engineserver/message/WAREHOUSE_SET_PASSWORD_RES.java
530f1dd862ad345c5e02e43190811128a4deef98
[]
no_license
JoyPanda/wangxian_server
0996a03d86fa12a5a884a4c792100b04980d3445
d4a526ecb29dc1babffaf607859b2ed6947480bb
refs/heads/main
2023-06-29T05:33:57.988077
2021-04-06T07:29:03
2021-04-06T07:29:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,608
java
package com.fy.engineserver.message; import com.xuanzhi.tools.transport.*; import java.nio.ByteBuffer; /** * 网络数据包,此数据包是由MessageComplier自动生成,请不要手动修改。<br> * 版本号:null<br> * req为客户端向服务器发送设置密码请求,res为服务器告诉客户端打开设置密码窗口<br> * 数据包的格式如下:<br><br> * <table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#000000" align="center"> * <tr bgcolor="#00FFFF" align="center"><td>字段名</td><td>数据类型</td><td>长度(字节数)</td><td>说明</td></tr> * <tr bgcolor="#FFFFFF" align="center"><td>length</td><td>int</td><td>getNumOfByteForMessageLength()个字节</td><td>包的整体长度,包头的一部分</td></tr> * <tr bgcolor="#FAFAFA" align="center"><td>type</td><td>int</td><td>4个字节</td><td>包的类型,包头的一部分</td></tr> * <tr bgcolor="#FFFFFF" align="center"><td>seqNum</td><td>int</td><td>4个字节</td><td>包的序列号,包头的一部分</td></tr> * </table> */ public class WAREHOUSE_SET_PASSWORD_RES implements ResponseMessage{ static GameMessageFactory mf = GameMessageFactory.getInstance(); long seqNum; public WAREHOUSE_SET_PASSWORD_RES(){ } public WAREHOUSE_SET_PASSWORD_RES(long seqNum){ this.seqNum = seqNum; } public WAREHOUSE_SET_PASSWORD_RES(long seqNum,byte[] content,int offset,int size) throws Exception{ this.seqNum = seqNum; } public int getType() { return 0x7000B006; } public String getTypeDescription() { return "WAREHOUSE_SET_PASSWORD_RES"; } public String getSequenceNumAsString() { return String.valueOf(seqNum); } public long getSequnceNum(){ return seqNum; } private int packet_length = 0; public int getLength() { if(packet_length > 0) return packet_length; int len = mf.getNumOfByteForMessageLength() + 4 + 4; packet_length = len; return len; } public int writeTo(ByteBuffer buffer) { int messageLength = getLength(); if(buffer.remaining() < messageLength) return 0; int oldPos = buffer.position(); buffer.mark(); try{ buffer.put(mf.numberToByteArray(messageLength,mf.getNumOfByteForMessageLength())); buffer.putInt(getType()); buffer.putInt((int)seqNum); }catch(Exception e){ e.printStackTrace(); buffer.reset(); throw new RuntimeException("in writeTo method catch exception :",e); } int newPos = buffer.position(); buffer.position(oldPos); buffer.put(mf.numberToByteArray(newPos-oldPos,mf.getNumOfByteForMessageLength())); buffer.position(newPos); return newPos-oldPos; } }
0ccdaa59ce0d1ce765404779c57027bb415034d7
6ad3ce36bbf7e43a1bfb2dad4e60f1b294df5574
/src/a2/PopDir.java
864af9cd13c7eee66ac3ad28ab212851ef81da5b
[]
no_license
bryan-ojay/MockUnixShell
528281e10ed38a9582739b95c56b82708f5fd2a7
b4e782c6f70fe6412b6b46df2fe002f86157b62f
refs/heads/master
2020-06-18T08:59:00.306720
2019-07-10T20:32:25
2019-07-10T20:32:25
196,242,424
0
0
null
null
null
null
UTF-8
Java
false
false
1,778
java
// ********************************************************** // Assignment2: // Student1: // UTORID user_name: oladejib // UT Student #: 1004112738 // Author: Bryan Ifeoluwapo Oladeji // // Student2: // UTORID user_name: singhd51 // UT Student #: 1004322280 // Author: Divneet Singh // // Student3: // UTORID user_name: khulla18 // UT Student #: 1004325893 // Author: Jayesh Khullar // // Student4: // UTORID user_name: mendezve // UT Student #: 1004353479 // Author: Daniel Mendez Velarde // // // Honor Code: I pledge that this program represents my own // program code and that I have coded on my own. I received // help from no one in designing and debugging my program. // I have also read the plagiarism section in the course info // sheet of CSC B07 and understand the consequences. // ********************************************************* package a2; import driver.JShell; /** * Represents the popd command. Users may remove the top entry from * the directory stack, and cd into it */ public class PopDir extends Command { /** * Validates parameters for and executes the popd command. * @param input String for syntax correctness */ public String execute(String input) { // check if the input is not empty if (!(input.equals(""))) { // let the user know the commands syntax is wrong System.out.println("The syntax of the command is incorrect."); } else { try { // set the <curr> to the path after you pop from the dir stack JShell.curr = findPath(JShell.directoryStack.pop()); } catch(Exception emptyException) { /* * if there are no saved directories, catch the error and * give an appropriate error message */ System.out.println("There are no saved directories."); } } return null; } }
b387a999a6980ea14030e721747a4b5cb62490df
4e01ef400f6d99931f063b239213a9c262b56fbe
/app/src/main/java/com/android/dubaicovid19/view/fragments/SelfAssessmentResultFragment.java
b7aca41324a9c30325387b17f12bc1846e187005
[]
no_license
codrodev/Covid19Tracker
b27776c25613dad8e866ff9e388fbfd6cabb6e6e
c653f0c3b2b69e427142bab80e79039dcce66463
refs/heads/master
2022-04-27T01:59:14.915642
2020-04-27T05:57:32
2020-04-27T05:57:32
259,220,806
0
0
null
null
null
null
UTF-8
Java
false
false
2,773
java
package com.android.dubaicovid19.view.fragments; import android.graphics.Color; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import com.android.dubaicovid19.R; import com.android.dubaicovid19.utility.constant.FragmentTAGS; import com.android.dubaicovid19.view.navigators.FragmentNavigator; public class SelfAssessmentResultFragment extends Fragment { private static String ARG_RECORD = "rec"; private static String ARG_CODE = "code"; private static String message, colorCode; FragmentNavigator navigator; public static SelfAssessmentResultFragment newInstance(String record, String code) { Bundle args = new Bundle(); SelfAssessmentResultFragment fragment = new SelfAssessmentResultFragment(); args.putString(ARG_RECORD, record); args.putString(ARG_CODE, code); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { message = getArguments().getString(ARG_RECORD); colorCode = getArguments().getString(ARG_CODE); } } @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_selfassessment_result, container, false); Button btnAction = (Button) view.findViewById(R.id.btnActi); ImageView btnHome = (ImageView) view.findViewById(R.id.btnHome); TextView textReco = (TextView) view.findViewById(R.id.textReco); RelativeLayout layoutReco = (RelativeLayout) view.findViewById(R.id.layoutReco); if(message != null && message.length() > 0){ textReco.setText(message); } if (colorCode != null && colorCode.length() > 0){ layoutReco.setBackgroundColor(Color.parseColor(colorCode)); } btnAction.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { navigator = (FragmentNavigator) getActivity(); navigator.fragmentNavigator(FragmentTAGS.FR_COVID_CENTER, true, null); } }); btnHome.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { getActivity().onBackPressed(); } }); return view; } }
[ "codrodev" ]
codrodev
1c7012145d072c99729e12ae4242569ee041e6d1
25f548c836cdbf7142ab9275f888c8fa0643cb7c
/src/test/java/org/springboot/dao/NewsDAOTest.java
c6afb14b9a3a01ea79e728e8153e9eac5971d22e
[]
no_license
luoxunhao/news
a65c892a109e5e588a46da6dc543265a177d9100
881af07ffa97bc41639c71b760551248ce225c3a
refs/heads/master
2021-01-20T08:31:51.584988
2017-05-05T16:59:27
2017-05-05T16:59:27
90,160,126
0
0
null
null
null
null
UTF-8
Java
false
false
2,008
java
package org.springboot.dao; import org.junit.Test; import org.junit.runner.RunWith; import org.springboot.NewsApplication; import org.springboot.entity.News; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.Date; import java.util.List; import java.util.Random; @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = NewsApplication.class) public class NewsDAOTest { @Autowired private NewsDAO newsDAO; @Test public void addNews() throws Exception { Random random = new Random(); for (int i = 0; i < 11; ++i) { News news = new News(); news.setCommentCount(i); Date date = new Date(); date.setTime(date.getTime() + 1000*3600*5*i); news.setCreatedDate(date); news.setImage(String.format("http://images.nowcoder.com/head/%dm.png", random.nextInt(1000))); news.setLikeCount(i+1); news.setUserId(2); news.setTitle(String.format("TITLE{%d}", i)); news.setLink(String.format("http://www.nowcoder.com/%d.html", i)); newsDAO.addNews(news); } } @Test public void queryList() throws Exception { int userId = 0; int offset = 3; int limit = 10; List<News> newsList = newsDAO.queryList(userId, offset, limit); for (News news : newsList){ System.out.println(news); } } @Test public void queryById() throws Exception { int id = 2; News news = newsDAO.queryById(id); System.out.println(news); } @Test public void updateCommentCount() throws Exception { int id = 1; int count = 5; newsDAO.updateCommentCount(id, count); News news = newsDAO.queryById(1); System.out.println(news); } }
7057ba016a8446fa256a49d83adefeec44604a98
0d650d22980fe8a92023c735f8c20a2b551acdf6
/app/src/main/java/com/emmanuel/sqlito/DetailProductsActivity.java
97bc695888c64c921a4951ffbd5847a9357dcdae
[]
no_license
EmmanuelDgz/sqlite-db
15e70ffee76f8367853690d70bce2ad706d682e3
5a18c7a3647cd75954c5f9243d990fc276fed4e9
refs/heads/master
2020-06-05T00:59:17.984877
2019-06-17T02:09:00
2019-06-17T02:09:00
192,259,186
0
0
null
null
null
null
UTF-8
Java
false
false
3,135
java
package com.emmanuel.sqlito; import android.database.Cursor; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import java.util.ArrayList; public class DetailProductsActivity extends AppCompatActivity implements ProductAdapter.AdapterButtonsListener { private ListView listView; private ProductAdapter productAdapter; private ArrayList<Product> products; private DataBaseHelper db; private EditText name; private EditText price; private Button btnSaveChanges; private int productId; private int arrayIndex; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail_products); name = findViewById(R.id.editName); price = findViewById(R.id.editPrice); btnSaveChanges = findViewById(R.id.btnSaveChanges); name.setEnabled(false); price.setEnabled(false); btnSaveChanges.setEnabled(false); listView = findViewById(R.id.listView); products = new ArrayList<>(); productAdapter = new ProductAdapter(getApplicationContext(), products); productAdapter.setListener(this); listView.setAdapter(productAdapter); db = new DataBaseHelper(this); Cursor cursor = db.getProducts(); if (cursor.moveToFirst()) { do { int productId = cursor.getInt(0); String productName = cursor.getString(1); String productPrice = cursor.getString(2); products.add(new Product(productId, productName, productPrice)); } while (cursor.moveToNext()); } btnSaveChanges.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String name_ = name.getText().toString(); String price_ = price.getText().toString(); products.get(arrayIndex).setName(name_); products.get(arrayIndex).setPrice(price_); productAdapter.notifyDataSetChanged(); name.setText(""); price.setText(""); name.setEnabled(false); price.setEnabled(false); btnSaveChanges.setEnabled(false); db.updateProductById(productId, name_, price_); } }); } @Override public void onButtonEditClickListener(int position, Product product) { arrayIndex = position; productId = product.getId(); name.setText(product.getName()); price.setText(product.getPrice()); name.setEnabled(true); price.setEnabled(true); btnSaveChanges.setEnabled(true); } @Override public void onButtonDeleteClickListener(int position, Product product) { db.deleteProductById(product.getId()); products.remove(position); productAdapter.notifyDataSetChanged(); } }
e2a030268e5b4da09124a0662cc65ae8d28f32d1
d806904e389b32d1217f48ff9463b74584a736a9
/app/src/androidTest/java/com/elbaz/eliran/mymood_v3/ExampleInstrumentedTest.java
1e66423105ce8da1457877b8d024584b9a66e264
[]
no_license
devedelie/MyMood_V3
a232f2832ae1564432abff57304260099c6a0991
185951c234e8ffb0cefe8183f8f5fa438936fcc1
refs/heads/master
2020-05-17T01:02:31.274125
2019-04-25T10:51:11
2019-04-25T10:51:11
183,415,201
0
0
null
null
null
null
UTF-8
Java
false
false
736
java
package com.elbaz.eliran.mymood_v3; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.elbaz.eliran.mymood_v3", appContext.getPackageName()); } }
beb9defe668a8a9e7b4e1f6c298e001090b77e9d
e211693c623f825057fa1906d6d6a61441b86c63
/src/uet/oop/bomberman/entities/Grass.java
2dbbecd68eb54346b6102009374a569dcf33bf54
[]
no_license
20020419huy/Bomb
16b9d1b8f7521c6a4d06e6f94e38d8fd8dbf6299
892f9152376172dae10955d24b815d413ffc3149
refs/heads/master
2023-08-25T20:53:32.282424
2021-11-07T08:47:33
2021-11-07T08:47:33
425,139,011
0
0
null
null
null
null
UTF-8
Java
false
false
311
java
package uet.oop.bomberman.entities; import javafx.scene.Scene; import javafx.scene.image.Image; import uet.oop.bomberman.graphics.Sprite; public class Grass extends Entity { public Grass(int x, int y, Sprite sprite) { super(x, y, sprite); } @Override public void update() { } }
900ca61c5ac6b878b3bc36aebcc49cfca280456f
867d3c455f18c7cc4174c45ca6ef8ed483738df6
/src/spanningusa/Main.java
dcbaecf9d4fd7e7020a5e13ad33f4f4e4ebf31f5
[]
no_license
markus026/lab3
619339c650f1fff0e768993e432740749657ceca
c170a90df616ce7277d7d391c5c854b8e317fb9f
refs/heads/master
2021-01-01T03:54:02.723823
2016-04-12T21:22:07
2016-04-12T21:22:07
56,059,563
0
0
null
null
null
null
UTF-8
Java
false
false
2,321
java
package spanningusa; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Main { private Scanner inFile; private SpanningTree st; private String s = ""; public Main(String fileName) { st = new SpanningTree(); try { inFile = new Scanner(new File(fileName)); String line = inFile.nextLine(); while (!line.endsWith("]")) { String city; if (line.startsWith("\"")) { city = line.substring(1, line.length() - 2); } else { city = line.substring(0, line.length() - 1); } //s += city + "\n"; st.addCity(city); line = inFile.nextLine(); } //System.out.println(s); while (inFile.hasNextLine()) { int index1 = line.indexOf("--"); int index2 = line.indexOf("["); String city1 = line.substring(0, index1); if (city1.startsWith("\"")) { city1 = city1.substring(1, city1.length() - 1); } String neighbour = line.substring(index1 + 2, index2 - 1); if (neighbour.startsWith("\"")) { neighbour = neighbour.substring(1, neighbour.length() - 1); } line = line.substring(index2 + 1); int distance = Integer.parseInt(line.substring(0, line.length() - 1)); // System.out.println(city1 + "---" + neighbour + "---" + distance); st.addNeighbor(city1, neighbour, distance); line = inFile.nextLine(); // s += city1 + "-" + neighbour + "-" + distance + "\n"; } int index1 = line.indexOf("-"); int index2 = line.indexOf("["); String city1 = line.substring(0, index1); if (city1.startsWith("\"")) { city1 = city1.substring(1, city1.length() - 1); } String neighbour = line.substring(index1 + 2, index2 - 1); if (neighbour.startsWith("\"")) { neighbour = neighbour.substring(1, neighbour.length() - 1); } line = line.substring(index2 + 1); int distance = Integer.parseInt(line.substring(0, line.length() - 1)); st.addNeighbor(city1, neighbour, distance); // s += city1 + "-" + neighbour + "-" + distance + "\n"; // System.out.println(s); System.out.println(st.mst()); st.printTree(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void main(String[] args) { new Main("USA-highway-miles.txt"); // new Main("tinyEWG-alpha.txt"); } }
f3c99198fc192ce11c34552220e63455d5390588
578fbe4de176298b21ce892a17c852972d6b9d99
/src/leetcode/KdiffPairsinanArray.java
264809e93b423f9b12735800c3a0186e9944e76e
[]
no_license
FullStackD/algorithm-exercise
11b9cf52cccb658c3dbc993b420c7906ba8c2846
f894536a37f411625b95f0d36d7850c8c3d13305
refs/heads/master
2023-07-18T10:18:30.524357
2023-06-27T17:18:53
2023-06-27T17:18:53
100,006,587
2
0
null
null
null
null
UTF-8
Java
false
false
943
java
package leetcode; import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** * 532. K-diff Pairs in an Array * * @author Monster * @date 2017/11/6 */ public class KdiffPairsinanArray { public int findPairs(int[] nums, int k) { if (k < 0) { return 0; } Arrays.sort(nums); Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < nums.length; i++) { map.put(nums[i], map.getOrDefault(nums[i], 0) + 1); } int count = 0; for (int i = 0; i < nums.length; i++) { if (i > 0) { if (nums[i] == nums[i - 1]) { continue; } } if (k != 0 && map.containsKey(nums[i] + k)) { count++; } if (k == 0 && map.get(nums[i]) > 1) { count++; } } return count; } }
e0758d3bb12e4c221b876eb91f4e05fe6a6604a3
591951fe1dbc78039dd9304b75f66d2d5a09a362
/K Closest Points to Origin/MySolMaxHeap.java
2521b8dac15ead19cce3f5e386cb6260f48c49d1
[]
no_license
gururaj3/LeetCode90DayChallenge
155c43ad38cf8ff081c81955b4f664f4b8ab91f8
8493a3dfbfd2a5b52b7162a8c0a88e13522cd57f
refs/heads/master
2023-07-09T05:31:00.417124
2021-08-19T20:01:09
2021-08-19T20:01:09
265,163,348
0
0
null
null
null
null
UTF-8
Java
false
false
554
java
class Solution { public int[][] kClosest(int[][] points, int K) { int[][] res = new int[K][2]; if(points.length == 0) return res; PriorityQueue<int[]> topK = new PriorityQueue<>((a,b)-> (b[0]*b[0] + b[1]*b[1]) - (a[0]*a[0] + a[1]*a[1])); int j =0; for (int i = 0; i < points.length; i++) { topK.add(points[i]); if(topK.size() > K){ topK.poll(); } } for (int i = 0; i < res.length; i++) { res[i] = topK.poll(); } return res; } }
467a4908a68a62aac21c3d0b006ebca6e7c2ef28
578e3c6cca7094f80bd654d945cc085e9d8459b8
/app/src/main/java/com/prima/iut/splhealthandbeautytips/face.java
4d1c9841a368b1b8b8e0b43743dfe4b93664c250
[]
no_license
TasfiaPrima/SPLhealth-BeautyTips
40d66afb4b7b7f5d1f8beba115829fde020b77de
dcc58007e23c2e22e16849577f6d6df356049d5f
refs/heads/master
2021-03-08T13:18:11.968437
2020-04-04T18:21:05
2020-04-04T18:21:05
246,348,183
2
0
null
null
null
null
UTF-8
Java
false
false
1,581
java
package com.prima.iut.splhealthandbeautytips; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; public class face extends AppCompatActivity { private Button BtnMove; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_face); BtnMove = findViewById(R.id.button21); BtnMove.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { moveToActivity21(); } }); BtnMove = findViewById(R.id.button22); BtnMove.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { moveToActivity22(); } }); BtnMove = findViewById(R.id.button23); BtnMove.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { moveToActivity23(); } }); } private void moveToActivity21(){ Intent intent=new Intent(face.this,lipCare.class); startActivity(intent); } private void moveToActivity22(){ Intent intent=new Intent(face.this,blackheads.class); startActivity(intent); } private void moveToActivity23(){ Intent intent=new Intent(face.this,acne.class); startActivity(intent); } }
7705d012ba1d21721d2ec145f1c6ded3c2a12915
cb7a93b3ec1e21ab0d7488e6e6d988cfa635fbf0
/app/src/main/java/com/example/vianatureapp/MainActivity.java
b5871f6ff2cd33b052902c26558ced82cabc4c5b
[]
no_license
rrADISLAV/vianatureapp
c2d6f4bc0d93d9039fc46e74ecf3dd18567e0f14
d2d15c0e41b6db1b488006abe15cd03c875a9a19
refs/heads/master
2023-03-21T07:09:19.903085
2021-03-10T18:23:20
2021-03-10T18:23:20
346,318,145
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package com.example.vianatureapp; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
6ac5887b0495cbc4601481f2feb89f58edf7761b
f746960c1e18022ff4689d3cd9ced76799f85450
/src/main/java/jp/co/cec/vfInputDatMigrator/util/LoggerUtil.java
c1714ead5d5d37a033a56b8880b30cc3eca0e119
[]
no_license
krumichan/Sol-JavaNoSQLMigrator
401b457b209451b9ad7a42bca08219f5b287e4f1
fd5fe7c00c9ebfd91502a0ceab0bfe83645ff798
refs/heads/master
2023-04-01T11:20:33.671971
2021-04-15T11:37:34
2021-04-15T11:37:34
358,236,173
0
0
null
null
null
null
UTF-8
Java
false
false
4,068
java
package jp.co.cec.vfInputDatMigrator.util; import java.io.File; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.nio.file.StandardOpenOption; import java.util.Objects; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import org.apache.log4j.helpers.NullEnumeration; import jp.co.cec.vfInputDatMigrator.constant.Constants; /** * Logger Utility */ public class LoggerUtil { /** * ロガー */ private static Logger myLogger = null; /** * ロガー名 */ private static String name = null; /** * ロガー名セッター * @param name ロガー名 */ public static void setName(String name) { LoggerUtil.name = name; } /** * ロガーゲッター * @return ロガー */ public static Logger getLogger() { LoggerUtil.setLogger(); return LoggerUtil.myLogger; } /** * ロガーをセット */ private static void setLogger() { if (LoggerUtil.myLogger == null) { LoggerUtil.myLogger = LogManager.getLogger( (LoggerUtil.name == null || LoggerUtil.name.isEmpty()) ? Constants.DEFAULT_LOGGER_NAME : LoggerUtil.name); if (LoggerUtil.myLogger == null) { LoggerUtil.myLogger = LogManager.getLogger(Constants.DEFAULT_LOGGER_NAME); } } } /** * ログのパスをセット * @param logFileDestination ログ出力パス * @param isDialog ダイアログ出力要否 * @param name ファイル名 * @param filePath ファイルパスキー * @return */ public static boolean setLogPath(String logFileDestination, boolean isDialog, String name, String filePath) { boolean canWrite = false; System.setProperty(filePath, logFileDestination); try { File logFile = new File(logFileDestination); if (logFile.exists()) { if (!logFile.canWrite()) { String msg = "Logの出力先が書き込み不可のため、起動できませんでした。 logFileDestination:" + logFileDestination; DialogUtil.showMessageDialogWithTextArea(isDialog, msg); return canWrite; } FileChannel fc = null; try { fc = FileChannel.open(logFile.toPath(), StandardOpenOption.CREATE, StandardOpenOption.WRITE); FileLock lock = fc.tryLock(); if (Objects.isNull(lock)) { throw new Exception(); } else { lock.release(); } } catch (Exception e) { String msg = "Logの出力先が他プロセスでロック中のため、起動できませんでした。 logFileDestination:" + logFileDestination; DialogUtil.showMessageDialogWithTextArea(isDialog, msg); return canWrite; } finally { if (Objects.nonNull(fc)) fc.close(); } } else { Boolean createNewFile = logFile.createNewFile(); if (!createNewFile) { String msg = "Logの出力先が異常なため、起動できませんでした。 logFileDestination:" + logFileDestination; DialogUtil.showMessageDialogWithTextArea(isDialog, msg); return canWrite; } } } catch (Exception e) { String msg = "Logの出力先が異常なため、起動できませんでした。 logFileDestination:" + logFileDestination; DialogUtil.showMessageDialogWithTextArea(isDialog, msg); return canWrite; } return true; } /** * ログ出力ができるかを判断 * @param isDialog ダイアログに出力するか * @param name ロガー名 * @return 判断結果 */ public static boolean canWriteLog(boolean isDialog, String name) { boolean canWriteLog = false; // ロガー名セット setName(name); // Loggerのインスタンスを作成する myLogger = LogManager.getLogger(name); // アペンダが存在するか確認(設定ファイルが読み込めていない場合アペンダが存在しない) if (NullEnumeration.getInstance().equals(myLogger.getAllAppenders())) { String msg = "log4jの設定ファイルの読み込みに失敗しました。"; DialogUtil.showMessageDialogWithTextArea(isDialog, msg); return canWriteLog; } canWriteLog = true; return canWriteLog; } }
aa623eaa8928fc74c661fe899cc1d8e10fb47074
48f2c146d2450a2e7004d97a0df50c952d9c07e3
/src/test/java/coyote/commons/network/IpNetworkTest.java
f07456f8dec8788eb40104995e0cd70d31a6cdbd
[ "MIT" ]
permissive
sdcote/commons
c0389f7c6544f58508571ddc534012bdbdf5e790
ab358f66fc1f1418d0e4066481805fc809ce7fa0
refs/heads/master
2020-04-12T08:47:02.106934
2017-02-23T16:38:21
2017-02-23T16:38:21
19,671,244
0
0
null
null
null
null
UTF-8
Java
false
false
2,783
java
package coyote.commons.network; //import static org.junit.Assert.*; import static org.junit.Assert.assertTrue; import java.util.Iterator; import org.junit.Test; /** * */ public class IpNetworkTest { /** * Test method for {@link coyote.commons.network.IpNetwork#IpNetwork(coyote.commons.network.IpAddress, coyote.commons.network.IpAddress)}. */ @Test public void testIpNetworkIpAddressIpAddress() throws IpAddressException { IpAddress address = new IpAddress( "192.168.1.1" ); IpAddress netMask = new IpAddress( "255.255.0.0" ); new IpNetwork( address, netMask ); address = new IpAddress( "150.10.10.10" ); netMask = new IpAddress( "255.255.252.0" ); new IpNetwork( address, netMask ); } /** * Test method for {@link coyote.commons.network.IpNetwork#getBroadcastAddress()}. */ @Test public void testGetBroadcastAddress() throws IpAddressException { IpAddress address = new IpAddress( "192.168.1.1" ); IpAddress netMask = new IpAddress( "255.255.0.0" ); IpNetwork ipNetwork = new IpNetwork( address, netMask ); assertTrue( "192.168.255.255".equals( ipNetwork.getBroadcastAddress().toString() ) ); address = new IpAddress( "150.10.10.10" ); netMask = new IpAddress( "255.255.252.0" ); ipNetwork = new IpNetwork( address, netMask ); assertTrue( "150.10.11.255".equals( ipNetwork.getBroadcastAddress().toString() ) ); } /** * Test method for {@link coyote.commons.network.IpNetwork#IpNetwork(java.lang.String, java.lang.String)}. */ @Test public void testIpNetworkStringString() throws IpAddressException { new IpNetwork( "192.168.1.1", "255.255.0.0" ); } /** * Test method for {@link coyote.commons.network.IpNetwork#IpNetwork(java.lang.String)}. */ @Test public void testIpNetworkString() throws IpAddressException { new IpNetwork( "206.13.01.48/25" ); } /** * Test method for {@link coyote.commons.network.IpNetwork#iterator()}. */ @Test public void testIterator() throws IpAddressException { IpAddress address = new IpAddress( "150.10.10.10" ); IpAddress netMask = new IpAddress( "255.255.252.0" ); IpNetwork network = new IpNetwork( address, netMask ); Iterator<IpAddress> iter = network.iterator(); int ipaddresscount = 0; while ( iter.hasNext() ) { iter.next(); ipaddresscount++; } assertTrue( ipaddresscount == 1022 ); // A more common example address = new IpAddress( "192.168.1.1" ); netMask = new IpAddress( "255.255.0.0" ); network = new IpNetwork( address, netMask ); iter = network.iterator(); ipaddresscount = 0; while ( iter.hasNext() ) { iter.next(); ipaddresscount++; } assertTrue( ipaddresscount == 65534 ); } }
f297b3055b4b4680ad2598a2b2904992b30123da
48394a5a1a571d2e08f3ed3d20337f9088ce5b32
/src/main/java/com/samsonan/Logic.java
77dc08288442a85bf3447966fa66a90e941ceb15
[]
no_license
samsonan-it/spring-data-pgsql-arrays
fe91fb82db228f29c4df9763570d5165775a1840
8ff3d1689e7b71b7f16076608543a681ca9f5772
refs/heads/master
2020-03-24T13:38:05.660670
2018-07-29T09:38:22
2018-07-29T09:38:22
142,748,193
0
0
null
null
null
null
UTF-8
Java
false
false
881
java
package com.samsonan; import org.hibernate.annotations.Type; import javax.persistence.*; import java.util.Arrays; @Entity @Table(name="LOGICS") public class Logic { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; @Column(name="LOGIC_PARAMS") @Type(type = "com.samsonan.FloatArrayUserType") private Float[] floatParams; protected Logic() {} public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Float[] getFloatParams() { return floatParams; } public void setFloatParams(Float[] floatParams) { this.floatParams = floatParams; } @Override public String toString() { return "Logic{" + "id=" + id + ", floatParams=" + Arrays.toString(floatParams) + '}'; } }
8a404755e9d58ece9d87ec1877085e4edefd2dff
29c3f799e555b11c8fa7906f50d5a0aa5dbfd0ea
/ambiente/semillero-hbt/semillero-padre/semillero-servicios/src/main/java/com/hbt/semillero/rest/GestionarPersonajesRest.java
a61f1965243fa59312bc6d017358080a17d4b5a9
[]
no_license
leninnarvaez/semillero
a8e5522f60541eb76658e4348e64f6d63ea4801e
3f438735349ba74a53ab2d1ca65c0b72a0331f0a
refs/heads/master
2022-11-30T19:47:04.002751
2019-12-20T18:27:14
2019-12-20T18:27:14
225,735,213
0
0
null
null
null
null
UTF-8
Java
false
false
5,387
java
package com.hbt.semillero.rest; import java.util.List; import javax.ejb.EJB; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.apache.log4j.Logger; import com.hbt.semillero.dto.PersonajeDTO; import com.hbt.semillero.dto.ResultadoDTO; import com.hbt.semillero.ejb.GestionarComicBean; import com.hbt.semillero.ejb.GestionarPersonajeBean; import com.hbt.semillero.ejb.IGestionarPersonajeLocal; import com.hbt.semillero.exceptions.ComicException; import com.hbt.semillero.exceptions.PersonajeException; /** * <b>Descripción:<b> Clase que determina el servicio rest que permite gestionar * un personaje * * @author Lenin Narvaez * @version */ @Path("/GestionarPersonaje") public class GestionarPersonajesRest { /** * Atriburo que permite gestionar un personaje */ final static Logger logger = Logger.getLogger(GestionarComicBean.class); @EJB private IGestionarPersonajeLocal gestionarPersonajeBean; /** * Crea las personas en sus diferentes roles dentro del sistema. * http://localhost:8085/semillero-servicios/rest/GestionarRol/crear * @param persona * @return * @throws PersonajeException */ @POST @Path("/crear") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response crearPersonaje(PersonajeDTO personajeDTO) { try { gestionarPersonajeBean.crearPersonaje(personajeDTO); //ResultadoDTO resultadoDTO = new ResultadoDTO(Boolean.TRUE, "Personaje creado exitosamente"); return Response.status(Response.Status.CREATED) .entity(personajeDTO) .type(MediaType.APPLICATION_JSON) .build(); }catch (PersonajeException e) { return Response.status(Response.Status.BAD_REQUEST) .entity("Fallo en la invocación del servicio " + e) .type(MediaType.APPLICATION_JSON) .build(); } // try { // gestionarPersonajeBean.crearPersonaje(personajeDTO); // }catch (PersonajeException e) { // logger.error("Se capturo la excepcion y la informacion es: " + e.getCodigo() + "message: " + e.getMensaje()); // throw new PersonajeException("COD-per-001","Error al realizar el llamado a la creacion de personaje",e); // } } /** * Crea las personas en sus diferentes roles dentro del sistema. * http://localhost:8085/semillero-servicios/rest/GestionarRol/modificar * @param persona * @return * @throws PersonajeException */ @POST @Path("/modificar") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response actualizarPersonaje(PersonajeDTO personajeDTO) { try { gestionarPersonajeBean.actualizarPersonaje(personajeDTO); //ResultadoDTO resultadoDTO = new ResultadoDTO(Boolean.TRUE, "Personaje creado exitosamente"); return Response.status(Response.Status.OK) .entity(personajeDTO) .type(MediaType.APPLICATION_JSON) .build(); }catch (PersonajeException e) { return Response.status(Response.Status.BAD_REQUEST) .entity("Fallo en la invocación del servicio " + e) .type(MediaType.APPLICATION_JSON) .build(); } } /** * * Metodo encargado de traer la informacion de un comic determiando * http://localhost:8085/semillero-servicios/rest/GestionarPersonaje/consultarPersonajes * * @param idPersonaje * @return * @throws PersonajeException */ @GET @Path("/consultarPersonajes") @Produces(MediaType.APPLICATION_JSON) public List<PersonajeDTO> consultarPersonajes() throws PersonajeException{ try { return gestionarPersonajeBean.consultarPersonajes(); }catch (PersonajeException e) { logger.error("Se capturo la excepcion y la informacion es: " + e.getCodigo() + "message: " + e.getMensaje()); throw new PersonajeException("COD-lj","Error al realizar el llamado cadena",e); } } /** * * Metodo encargado de traer la informacion de un comic determiando * http://localhost:8085/semillero-servicios/rest/GestionarPersonaje/consultarPersonajes * * @param idPersonaje * @return */ @GET @Path("/consultarPersonajesPorParametro") @Produces(MediaType.APPLICATION_JSON) public List<PersonajeDTO> consultarPersonajes(@QueryParam("index") int index, @QueryParam("cadena") String cadena){ return gestionarPersonajeBean.consultarPersonajes(index, cadena); } /** * * Metodo encargado de traer la informacion de un comic determiando * http://localhost:8085/semillero-servicios/rest/GestionarPersonaje/consultarPersonajesPorId?idComic=1 * * @param idComic * @return * @throws PersonajeException */ @GET @Path("/consultarPersonajesPorId") @Produces(MediaType.APPLICATION_JSON) public List<PersonajeDTO> consultaPersonaje(@QueryParam("idComic") long idComic) throws PersonajeException{ try { return gestionarPersonajeBean.consultarPersonajes(idComic); }catch(PersonajeException e) { logger.error("Se capturo la excepcion y la informacion es: " + e.getCodigo() + "message: " + e.getMensaje()); throw new PersonajeException("COD-lj02","Error al realizar el llamado cadena",e); } } @GET @Path("/consultarDefault") @Produces(MediaType.APPLICATION_JSON) public double consultarDefault() { return gestionarPersonajeBean.defaultMethod(); } }
451ba3c12ea9130cbc52f7d3aa714c59e16689c0
cfddcce35c61ccbf32dcc1734a355574ccaf2448
/chanzorClient/chanzorClient-service/src/main/java/com/chanzor/service/ExportService.java
59026e366de30bafe356a2ae715ea459b831d676
[]
no_license
wgy1109/BootStarp
43fc674a72a086fc9f8bacd7a21fdcf5f22a92c8
2422c8a722bf21f6937c7651b1bbda37e215767b
refs/heads/master
2021-01-20T15:10:55.215742
2018-08-17T01:51:44
2018-08-17T01:51:44
90,731,508
0
0
null
null
null
null
UTF-8
Java
false
false
342
java
package com.chanzor.service; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletResponse; import com.chanzor.entity.PageInfo; public interface ExportService { public int exportExcel(PageInfo page, HttpServletResponse response); public List<Map<String, Object>> selectMap(String sql) throws Exception; }
a1948d4631a2db8bea8b46331217c93dcead9231
fb5daff48677c594832122ffca62beae593b9874
/src/main/java/com/ibrahim/bootcampweek4assignment/config/couchbase/CouchbaseProperties.java
c24d38fa7c7bcd9de64c973770ae550dd6794e62
[]
no_license
SarojaMaharana/bootcamp-week4-assignment
0623b114b911383756260176f8fca54e97c2b027
58827e0537386b41b4a3ebda9be30cbd4813daef
refs/heads/master
2022-12-26T06:10:30.834746
2020-10-01T00:10:39
2020-10-01T00:10:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
589
java
package com.ibrahim.bootcampweek4assignment.config.couchbase; import lombok.Getter; import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; @Getter @Setter @Configuration @EnableConfigurationProperties @ConfigurationProperties(prefix = "couchbase") public class CouchbaseProperties { private String host; private String userName; private String password; private String bucketName; }
50f444471be0e8a163d12724826bbd27109f2a42
05b41e929b17cff6a3ee0ff2c9472dff336b1305
/tracker-core/src/main/java/jdev/tracker/services/GpsService.java
780624936344a5b3ee0ebb3a169794213a5b64cf
[]
no_license
srgvar/RToll
73000317049540c457a3ca879c0262bf5e18858d
a45ad778d7dbc8a1b3174d780fe825460ae80e35
refs/heads/master
2021-01-01T20:37:37.508687
2017-08-01T12:43:24
2017-08-01T12:43:24
98,900,307
0
0
null
null
null
null
UTF-8
Java
false
false
4,713
java
package jdev.tracker.services; import de.micromata.opengis.kml.v_2_2_0.*; import jdev.dto.PointCalculate; import jdev.dto.PointDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import java.io.File; import java.util.List; import java.util.concurrent.LinkedBlockingDeque; /** * Created by srgva on 23.07.2017. */ @Service public class GpsService { @Value("${kmlFile}") String kmlFileName; //имя файла с координатами - в файле roadtoll.propertis @Value("${autoId}") String autoId; // номер авто - в файле roadtoll.propertis /** Логгер сервиса GPS */ private static final Logger log = LoggerFactory.getLogger(GpsService.class); /* Предыдущая точка */ PointDTO previousPoint = new PointDTO(); /* Список координат, полученных из kml - файла */ private List<Coordinate> coordinates; /* Очередь для помещения точек с координатами, скоростью и азимутом сервисом GPS * и для чтения сервисом хранения */ protected static LinkedBlockingDeque<PointDTO> gpsQueue = new LinkedBlockingDeque<>(100); /** Инициализация сервиса: * получаение списка координат из файла и */ @PostConstruct private void init(){ // получаем список координат coordinates = getCoordinates(); } /** формирование точки и помещение её в очередь сервиса GPS*/ @Scheduled(cron = "${gpsSchedule}") //Шедулер сервиса GPS void put() { PointDTO point = new PointDTO(); // новая точка point.setTime(System.currentTimeMillis()); // текущее время point.setAutoId(autoId); // Номер авто if (coordinates.iterator().hasNext()){ // получаем координаты Coordinate coordinate = coordinates.iterator().next(); point.setLat(coordinate.getLatitude()); // широта point.setLon(coordinate.getLongitude()); // долгота /** Вычисляем азимут */ point.setBearing(PointCalculate.getBearing(previousPoint, point)); /** Вычисляем скорость */ point.setSpeed(PointCalculate.getSpeed(previousPoint, point)); try { gpsQueue.put(point); // помещаем точку в очередь сервиса GPS log.info(" get " + point.toString()); } catch (InterruptedException e) { e.printStackTrace(); } // удаляем текущую точку из списка coordinates.remove(coordinate); /** Предыдущая точка становится текущей - для последующих вычислений * азимута и скорости следующей точки */ previousPoint = point; } } /** Читаем список координат из kml - файла */ private List<Coordinate> getCoordinates() { File file = new File(kmlFileName); // файл List <Coordinate> coordinates; // список координат final Kml kml = Kml.unmarshal(file); // начинаем разбор файла // Объект Folder может содержать список объектов Feature Folder folder = (Folder) kml.getFeature(); List <Feature> features = folder.getFeature(); Placemark placemark = new Placemark(); // Просматриваем все объекты Feature for(Feature feature : features){ placemark = (Placemark) feature; // Приводим их к типу Placemark // Получаем LineString LineString lineString = (LineString) placemark.getGeometry(); // Получаем из LineString список координат coordinates = lineString.getCoordinates(); if(!coordinates.isEmpty()){ // если список не пуст return coordinates; // возвращаем список координат } } return null; // возвращаем пустой список } }
566a4680c6d785c4dad61846d9a7f7e7a26f7c47
aabffae2e89cbadae013d6c2bd617730dffd7aa4
/StudHelper/src/main/java/de/kunze/studhelper/view/rest/RestLecture.java
beed9ad1bea38e40c627da1b3814d23b34b2a053
[]
no_license
s-kunze/StudHelper_JavaWicket
59c05fea0cd9eb749ebf76346f995a2ac247aa33
25bc8f11f620684c9b36b4ce7db3202a3e535fbb
refs/heads/master
2020-05-19T13:14:27.305912
2012-12-20T20:56:14
2012-12-20T20:56:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,124
java
package de.kunze.studhelper.view.rest; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.ws.rs.core.MediaType; import org.codehaus.jackson.type.TypeReference; import com.sun.jersey.api.client.ClientResponse; import de.kunze.studhelper.rest.transfer.backend.LectureTransfer; /** * * @author Stefan Kunze * */ public class RestLecture extends RestUtil { private static final long serialVersionUID = 1L; public RestLecture() { super(); } public boolean createLecture(String id, LectureTransfer l) { ClientResponse cr = this.webResource.path(MODUL).path(id).path(LECTURE).type(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON).put(ClientResponse.class, l); return is2xx(cr.getStatus()); } public LectureTransfer getLecture(String id) { return this.webResource.path(LECTURE).path(id).accept(MediaType.APPLICATION_JSON).get(LectureTransfer.class); } public List<LectureTransfer> getLectures() { try { String json = this.webResource.path(LECTURE).accept(MediaType.APPLICATION_JSON).get(String.class); return mapper.readValue(json, new TypeReference<List<LectureTransfer>>() { }); } catch (IOException e) { logger.error("", e); } return new ArrayList<LectureTransfer>(); } public boolean updateLecture(LectureTransfer d) { ClientResponse cr = this.webResource.path(LECTURE).type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON) .post(ClientResponse.class, d); return is2xx(cr.getStatus()); } public boolean deleteLecture(String id) { ClientResponse cr = webResource.path(LECTURE).path(id).type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON) .delete(ClientResponse.class); return is2xx(cr.getStatus()); } public boolean addUserToLecture(String lectureId, String userId, Float mark) { ClientResponse cr = this.webResource.path(LECTURE).path(lectureId).path(ADDUSER).path(userId).queryParam("mark", mark.toString()).type(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON).put(ClientResponse.class, null); return is2xx(cr.getStatus()); } }
[ "stefan@laptop-home.(none)" ]
stefan@laptop-home.(none)
78e3c32e51ebd0582572498edcb4db6843e0631d
8c0124d21de98e2d19c29d5d8c51aac728dab617
/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/CDCJdbcRunnable.java
2d218db3e3b5b10a5cc7197500383f74f5f19e53
[ "Apache-2.0" ]
permissive
mzjdy/hive-jdbc-stage-lib
2b0fe7d115348b6f2f7cf92ba8db263ad22d4174
1cb99b24ca93ad82801ac789a6713df351c7d6e0
refs/heads/master
2020-04-26T21:40:32.537922
2018-08-17T12:24:12
2018-08-17T12:24:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,690
java
/* * Copyright 2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.streamsets.pipeline.lib.jdbc.multithread; import com.google.common.cache.CacheLoader; import com.google.common.collect.ImmutableSet; import com.streamsets.pipeline.api.BatchContext; import com.streamsets.pipeline.api.Field; import com.streamsets.pipeline.api.PushSource; import com.streamsets.pipeline.api.Record; import com.streamsets.pipeline.api.StageException; import com.streamsets.pipeline.lib.jdbc.BoneCPPoolConfigBean; import com.streamsets.pipeline.lib.jdbc.JdbcUtil; import com.streamsets.pipeline.lib.jdbc.MSOperationCode; import com.streamsets.pipeline.lib.jdbc.multithread.util.MSQueryUtil; import com.streamsets.pipeline.lib.jdbc.multithread.util.OffsetQueryUtil; import com.streamsets.pipeline.lib.operation.OperationType; import com.streamsets.pipeline.stage.origin.hive_jdbc.CommonSourceConfigBean; import com.streamsets.pipeline.stage.origin.hive_jdbc.table.TableJdbcConfigBean; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; public class CDCJdbcRunnable extends JdbcBaseRunnable { private static final Logger LOG = LoggerFactory.getLogger(CTJdbcRunnable.class); private final Set<String> recordHeader; public CDCJdbcRunnable( PushSource.Context context, int threadNumber, int batchSize, Map<String, String> offsets, MultithreadedTableProvider tableProvider, ConnectionManager connectionManager, TableJdbcConfigBean tableJdbcConfigBean, CommonSourceConfigBean commonSourceConfigBean, CacheLoader<TableRuntimeContext, TableReadContext> tableReadContextCache ) { super(context, threadNumber, batchSize, offsets, tableProvider, connectionManager, tableJdbcConfigBean, commonSourceConfigBean, tableReadContextCache); this.recordHeader = ImmutableSet.of( MSQueryUtil.CDC_START_LSN, MSQueryUtil.CDC_END_LSN, MSQueryUtil.CDC_SEQVAL, MSQueryUtil.CDC_OPERATION, MSQueryUtil.CDC_UPDATE_MASK ); } @Override public void createAndAddRecord( ResultSet rs, TableRuntimeContext tableContext, BatchContext batchContext ) throws SQLException, StageException { ResultSetMetaData md = rs.getMetaData(); LinkedHashMap<String, Field> fields = JdbcUtil.resultSetToFields( rs, commonSourceConfigBean.maxClobSize, commonSourceConfigBean.maxBlobSize, errorRecordHandler, tableJdbcConfigBean.unknownTypeAction, recordHeader ); Map<String, String> columnOffsets = new HashMap<>(); // Generate Offset includes __$start_lsn and __$seqval for (String key : tableContext.getSourceTableContext().getOffsetColumns()) { columnOffsets.put(key, rs.getString(key)); } String offsetFormat = OffsetQueryUtil.getOffsetFormat(columnOffsets); Record record = context.createRecord(tableContext.getQualifiedName() + "::" + offsetFormat); record.set(Field.createListMap(fields)); //Set Column Headers JdbcUtil.setColumnSpecificHeaders( record, Collections.singleton(tableContext.getSourceTableContext().getTableName()), md, JDBC_NAMESPACE_HEADER ); for (String fieldName : recordHeader) { record.getHeader().setAttribute(JDBC_NAMESPACE_HEADER + fieldName, rs.getString(fieldName) != null ? rs.getString(fieldName) : "NULL" ); } //Set SDC Operation Header int op = MSOperationCode.convertToJDBCCode(rs.getInt(MSQueryUtil.CDC_OPERATION)); record.getHeader().setAttribute(OperationType.SDC_OPERATION_TYPE, String.valueOf(op)); for (String fieldName : recordHeader) { record.getHeader().setAttribute(JDBC_NAMESPACE_HEADER + fieldName, rs.getString(fieldName) != null ? rs.getString(fieldName) : "NULL" ); } batchContext.getBatchMaker().addRecord(record); offsets.put(tableContext.getOffsetKey(), offsetFormat); } }
b780c7277032d0bcb87fe072d19fcf95bd4b3eeb
0a7c4498b7f3ed804694eb2c0671bdea12ac3b12
/T14.xml/app/src/main/java/com/example/kang/t14xml/MainActivity.java
a16038bc50ecf5ec43745c702c533107929ccd63
[]
no_license
aroma104/android_1604
7967c23fe096544c0f05b04faf5eabe82c8d436a
c1099c46ecb55604efbd58b36ac62039286ad13d
refs/heads/master
2021-01-01T05:22:32.213489
2016-04-30T09:19:03
2016-04-30T09:19:03
57,435,315
0
0
null
null
null
null
UTF-8
Java
false
false
951
java
package com.example.kang.t14xml; import android.os.AsyncTask; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import java.net.MalformedURLException; import java.net.URL; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; public class MainActivity extends AppCompatActivity { TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = (TextView)findViewById(R.id.textView); MyPullParser task = new MyPullParser(textView); //alt + insert = constructor //MyDomParser task = new MyDomParser(textView); task.execute("http://www.kma.go.kr/wid/queryDFSRSS.jsp?zone=1159068000"); } }
b3638ba452a53467dce88743ccb9509d5e52b2b9
6f84d91d835154aa25142a201d41c5e7c2228a42
/org/details/ams/Adhvaith.java
4fed50873084730a31fafb3e30001d430e31d6f6
[]
no_license
sravan0912/adhvaith17
8971a45f91465102447611a7ca2133a3f70167de
924ab217985201c0e5839f4746129361a5c7345e
refs/heads/master
2020-07-07T22:29:46.506156
2019-08-23T07:54:33
2019-08-23T07:54:33
203,494,417
0
0
null
2019-08-25T04:07:15
2019-08-21T02:55:31
Java
UTF-8
Java
false
false
523
java
package org.details.ams; public class Adhvaith{ public static void main(String[] args) { String dob="09-12-17"; System.out.println("adhvaith date of birth is :"+dob); String name="Adhvaith Mano Sai"; System.out.println("full name of adhvaith is:"+name); String place="hanamkonda"; System.out.println("palce of birth is:"+place); String fathername ="Sravan Kumar"; System.out.println("Name of father:"+fathername); String mothername="Sravanthi"; System.out.println("Name of mother:"+mothername); } }
caa32d6fd2179cc3e82039ea4a8a92f326396d11
0fb8166e06972f61658a9181c80d07d2d4597ce0
/src/main/java/opencv/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java
4828b680b297d327c5282a0b376741288b1eaf31
[]
no_license
XiongBangze/cjs_jvm
4790ccde2581ba0c231b4e0b8bdb641b302f79d9
160abfd2cfabfcfa659a537ea924e2ecdab5f997
refs/heads/master
2020-03-23T06:55:17.252272
2019-01-24T02:55:11
2019-01-24T02:55:11
141,237,263
0
0
null
2018-07-17T05:45:26
2018-07-17T05:45:26
null
UTF-8
Java
false
false
5,724
java
package opencv.tutorial_code.ImgProc.BasicGeometricDrawing; import org.opencv.core.*; import org.opencv.core.Point; import org.opencv.highgui.HighGui; import org.opencv.imgproc.Imgproc; import java.util.*; import java.util.List; class GeometricDrawingRun{ private static final int W = 400; public void run(){ //! [create_images] /// Windows names String atom_window = "Drawing 1: Atom"; String rook_window = "Drawing 2: Rook"; /// Create black empty images Mat atom_image = Mat.zeros( W, W, CvType.CV_8UC3 ); Mat rook_image = Mat.zeros( W, W, CvType.CV_8UC3 ); //! [create_images] //! [draw_atom] /// 1. Draw a simple atom: /// ----------------------- MyEllipse( atom_image, 90.0 ); MyEllipse( atom_image, 0.0 ); MyEllipse( atom_image, 45.0 ); MyEllipse( atom_image, -45.0 ); /// 1.b. Creating circles MyFilledCircle( atom_image, new Point( W/2, W/2) ); //! [draw_atom] //! [draw_rook] /// 2. Draw a rook /// ------------------ /// 2.a. Create a convex polygon MyPolygon( rook_image ); //! [rectangle] /// 2.b. Creating rectangles Imgproc.rectangle( rook_image, new Point( 0, 7*W/8 ), new Point( W, W), new Scalar( 0, 255, 255 ), -1, 8, 0 ); //! [rectangle] /// 2.c. Create a few lines MyLine( rook_image, new Point( 0, 15*W/16 ), new Point( W, 15*W/16 ) ); MyLine( rook_image, new Point( W/4, 7*W/8 ), new Point( W/4, W ) ); MyLine( rook_image, new Point( W/2, 7*W/8 ), new Point( W/2, W ) ); MyLine( rook_image, new Point( 3*W/4, 7*W/8 ), new Point( 3*W/4, W ) ); //! [draw_rook] /// 3. Display your stuff! HighGui.imshow( atom_window, atom_image ); HighGui.moveWindow( atom_window, 0, 200 ); HighGui.imshow( rook_window, rook_image ); HighGui.moveWindow( rook_window, W, 200 ); HighGui.waitKey( 0 ); System.exit(0); } /// Function Declaration /** * @function MyEllipse * @brief Draw a fixed-size ellipse with different angles */ //! [my_ellipse] private void MyEllipse( Mat img, double angle ) { int thickness = 2; int lineType = 8; int shift = 0; Imgproc.ellipse( img, new Point( W/2, W/2 ), new Size( W/4, W/16 ), angle, 0.0, 360.0, new Scalar( 255, 0, 0 ), thickness, lineType, shift ); } //! [my_ellipse] /** * @function MyFilledCircle * @brief Draw a fixed-size filled circle */ //! [my_filled_circle] private void MyFilledCircle( Mat img, Point center ) { int thickness = -1; int lineType = 8; int shift = 0; Imgproc.circle( img, center, W/32, new Scalar( 0, 0, 255 ), thickness, lineType, shift ); } //! [my_filled_circle] /** * @function MyPolygon * @function Draw a simple concave polygon (rook) */ //! [my_polygon] private void MyPolygon( Mat img ) { int lineType = 8; int shift = 0; /** Create some points */ Point[] rook_points = new Point[20]; rook_points[0] = new Point( W/4, 7*W/8 ); rook_points[1] = new Point( 3*W/4, 7*W/8 ); rook_points[2] = new Point( 3*W/4, 13*W/16 ); rook_points[3] = new Point( 11*W/16, 13*W/16 ); rook_points[4] = new Point( 19*W/32, 3*W/8 ); rook_points[5] = new Point( 3*W/4, 3*W/8 ); rook_points[6] = new Point( 3*W/4, W/8 ); rook_points[7] = new Point( 26*W/40, W/8 ); rook_points[8] = new Point( 26*W/40, W/4 ); rook_points[9] = new Point( 22*W/40, W/4 ); rook_points[10] = new Point( 22*W/40, W/8 ); rook_points[11] = new Point( 18*W/40, W/8 ); rook_points[12] = new Point( 18*W/40, W/4 ); rook_points[13] = new Point( 14*W/40, W/4 ); rook_points[14] = new Point( 14*W/40, W/8 ); rook_points[15] = new Point( W/4, W/8 ); rook_points[16] = new Point( W/4, 3*W/8 ); rook_points[17] = new Point( 13*W/32, 3*W/8 ); rook_points[18] = new Point( 5*W/16, 13*W/16 ); rook_points[19] = new Point( W/4, 13*W/16 ); MatOfPoint matPt = new MatOfPoint(); matPt.fromArray(rook_points); List<MatOfPoint> ppt = new ArrayList<MatOfPoint>(); ppt.add(matPt); Imgproc.fillPoly(img, ppt, new Scalar( 255, 255, 255 ), lineType, shift, new Point(0,0) ); } //! [my_polygon] /** * @function MyLine * @brief Draw a simple line */ //! [my_line] private void MyLine( Mat img, Point start, Point end ) { int thickness = 2; int lineType = 8; int shift = 0; Imgproc.line( img, start, end, new Scalar( 0, 0, 0 ), thickness, lineType, shift ); } //! [my_line] } public class BasicGeometricDrawing { public static void main(String[] args) { // Load the native library. System.loadLibrary(Core.NATIVE_LIBRARY_NAME); new GeometricDrawingRun().run(); } }
[ "Aa123456" ]
Aa123456
c11b8687221b21b9fd229f1e96b9d24fb00a5424
1653534bcce4d0531cf0f75bcd6fcf2ad54277ef
/mongo-track-service/src/main/java/com/stackroute/TrackServiceApplication.java
3e0af0a1aedc7b2d7b6c8df747ca8d01fcb46fab
[]
no_license
Praveenraj1024/music-app
40e34ec88c1f7995cbdcba1aad315a6bbbdb8e4b
e19a11633e0b46eb2f2a5ab19513c2e58dfd5d7a
refs/heads/master
2020-07-02T05:29:13.862654
2019-08-09T08:50:43
2019-08-09T08:50:43
201,428,785
0
0
null
2020-06-06T05:33:28
2019-08-09T08:46:16
Java
UTF-8
Java
false
false
648
java
package com.stackroute; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.context.annotation.PropertySource; @SpringBootApplication //Used to specify the starting point of the project. //It triggers the auto-configuration, component scanning, bean creations. @PropertySource("classpath:application.properties") @EnableEurekaClient public class TrackServiceApplication { public static void main(String[] args) { SpringApplication.run(TrackServiceApplication.class, args); } }
18edd7e4f37363b2fad4b6cb5812bfaf8329eb61
2cceb259858393e7200059f5f94df3f5d0863373
/src/main/java/com/thingoncloud/bean/pub/endpoint/BeanEndpoints.java
2071e01edf5cd5f9258234f5aadb4f3930e66fa8
[]
no_license
MarkoVcode/ThingOnCloudSDK
9fa3d63d9ad56e9e30d506df9e01093c8ef91526
6bc689e6971433d90b164030dbab7c2358c8673d
refs/heads/master
2020-04-06T06:52:25.425702
2015-07-27T23:13:17
2015-07-27T23:13:17
39,457,726
0
0
null
null
null
null
UTF-8
Java
false
false
2,386
java
/** * Copyright 2015 MarkoV * * 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. * * ThingOnCloud.com SDK * * Project home: https://github.com/MarkoVcode/ThingOnCloudSDK * * @build <BUILDTAG> * @date <BUILDDATE> * @version <RELEASEVERSION> */ package com.thingoncloud.bean.pub.endpoint; import java.io.Serializable; import java.util.List; import com.thingoncloud.bean.Ref; public class BeanEndpoints implements Serializable { private static final long serialVersionUID = 821206923363446235L; private Ref self; private Ref owner; private Ref parent; private List<BeanEndpoint> endpoints; public Ref getSelf() { return self; } public void setSelf(Ref self) { this.self = self; } public Ref getOwner() { return owner; } public void setOwner(Ref owner) { this.owner = owner; } public Ref getParent() { return parent; } public void setParent(Ref parent) { this.parent = parent; } public List<BeanEndpoint> getEndpoints() { return endpoints; } public void setEndpoints(List<BeanEndpoint> endpoints) { this.endpoints = endpoints; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("BeanEndpoints [self=").append(self).append(", owner=") .append(owner).append(", parent=").append(parent) .append(", endpoints=").append(endpoints).append("]"); return builder.toString(); } /* * @Override public String toString() { StringBuilder sb = new * StringBuilder(); sb.append("BeanEndpoints:\n"); * sb.append(" self: ").append(self.toString()).append("\n"); * sb.append(" owner: ").append(owner.toString()).append("\n"); * sb.append(" parent: ").append(parent.toString()).append("\n"); * sb.append(" endpoints: \n"); for(BeanEndpoint ep : endpoints) { * sb.append("-> ").append(ep.toString()); } sb.append("\n"); return * sb.toString(); } */ }
efc21ebc233a62f626e1df8a8f69b951bad1fc68
5dbaeaf18cb0b6afccc1bc24380f99d8fdcdc590
/src/main/java/com/quaint/blog/constant/CommentConstant.java
21fda58feaf454f0987c55ac5caeded6493dd272
[]
no_license
quaintclever/quaint-blog-plus
d5410456b9680aa5fc361e1ded3926a0dd7f1eba
b6df280bcfefe76d065494cd603cab82278862eb
refs/heads/master
2022-07-11T06:37:04.522790
2020-01-08T05:26:36
2020-01-08T05:26:36
223,303,452
0
0
null
2022-06-21T02:17:23
2019-11-22T02:06:52
TSQL
UTF-8
Java
false
false
468
java
package com.quaint.blog.constant; /** * @Description: * @author: qi cong * @Date: Created in 2019-12-07 19:32 */ public class CommentConstant { /** * quaint-blog-plus-web 接口 */ public static final String WEB_ARTICLE_COMMENT_LIST = "/article/comment/list"; // 评论列表展示 public static final String WEB_ARTICLE_ADD_COMMENT = "/article/comment/add"; // 文章增加评论 /** * quaint-blog-plus-admin 接口 */ }
a107adb9d22ef21928bff5dcd5d6ea908e7816fc
284ec40af3d54cde0ad8ff615e943f89f561ee80
/src/main/java/bexysuttx/httpserver/io/HtmlTemplateManager.java
61cda222075ba0f427204f55f8f05e1cc2b472fa
[]
no_license
bexysuttx/httpServer
eb7e05aa5a9e690faef31be5526133e36af01498
1365519828821768c58b0be3712b615d89a4c73a
refs/heads/master
2023-02-26T18:12:57.844275
2021-01-25T07:26:36
2021-01-25T07:26:36
330,032,490
0
0
null
null
null
null
UTF-8
Java
false
false
171
java
package bexysuttx.httpserver.io; import java.util.Map; public interface HtmlTemplateManager { String processTemplate(String template, Map<String, Object> args); }
592b9eae19d1591d19213d497c88916f47b3042a
a9ae6ac5a6e6f277f4e3098b448ed74552f0150f
/src/main/java/com/websecurity/pwcev/apirest/service/IPlanService.java
942cf1dd797d7cd401219e46d208dd374b759870
[]
no_license
ManriqueCesar/Viex-Backend
785cd88b23ece2fbb4e609933d43fbd54c262cdb
64aebc09e240b6c4bdcbb573ac1ea4720abb6a1f
refs/heads/master
2023-07-31T11:32:02.498101
2021-09-04T20:16:36
2021-09-04T20:16:36
352,783,693
1
0
null
null
null
null
UTF-8
Java
false
false
205
java
package com.websecurity.pwcev.apirest.service; import java.util.List; import com.websecurity.pwcev.apirest.model.Plan; public interface IPlanService { public List<Plan> listarPlanesDisponibles(); }
82fe914be85d3ca374005acd992c5f97f6acc402
0ef4e41dd334e1aeaabb154ad82d99b3c616e863
/GetVideoSubPlayList/src/main/java/com/youflix/getvideoplaylist/service/LOGService.java
d8bba75be441a919ed29f78516b4f84782a82eae
[]
no_license
MollyKim/youflix_sts
370a204c70018e24e1762d75ae49cf4ec7dc74b7
42e80ef8de7a20d0aabfd9d9baa7d1920ed181cc
refs/heads/main
2023-04-20T20:54:30.214403
2021-05-14T02:39:56
2021-05-14T02:39:56
366,220,997
0
0
null
null
null
null
UTF-8
Java
false
false
1,769
java
package com.youflix.getvideoplaylist.service; import java.util.HashMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.youflix.getvideoplaylist.dao.log.LOGDao; @Service public class LOGService { // @Autowired // private Producer producer; @Autowired private LOGDao logDao; /** * @FileName : DB Service Log Write * @Project : CUST * @Date : 2021.01.29 * @Author : 조 준 희 * @Description : ServiceLogManager.WriteServiceLog(request, '2020-12-11 00:00:00','2020-12-11 00:00:00', "sign_up", result, log_MSG); * @History : */ //@Async("executorSMLS") public void WriteServiceLog(String functionDesc, Long startTime, Long endTime, String apiName, int Result, String log_MSG) { final Long elapsed_time = endTime - startTime; HashMap<String, String> paramServLog = new HashMap<String, String>(); paramServLog.put("API_NAME", apiName); paramServLog.put("API_DESCRIPTION", functionDesc); paramServLog.put("LOG_DESCRIPTION", log_MSG); paramServLog.put("RESULT", (Result == 1)? "Y":"N" ); paramServLog.put("ELAPSED_TIME", elapsed_time.toString()); try { logDao.SendServiceLog(paramServLog); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } // Gson gson = new GsonBuilder().disableHtmlEscaping().create(); // String result = gson.toJson(paramServLog); // producer.send(result); } } // public static void WriteFileLog(String apiName, String log_MSG) { // // if (log_MSG.toString().isEmpty()) // return; // // switch (apiName) { // case "sign_up": // logger_sign_up.info(log_MSG); // break; // // } // // }
5100b03f1cde871e30e519f5623447c71e44d80a
78319dd4b0238e8b03f3e954b59bfbc8d4583cd5
/asciipicSearch/src/main/java/com/asciipic/search/services/ImageServiceImpl.java
0dc06eeb37764e5be46c39b4bc0069df41a6ba60
[ "MIT" ]
permissive
AlexandruTudose/asciipic
b919b4cd6e39acf051cf274d09dc728e01f38b01
d8488c22645d8d63ed0a1c465ba6e53c54301d35
refs/heads/master
2021-01-20T00:33:43.242630
2017-06-17T06:03:33
2017-06-17T06:03:33
89,149,715
0
0
null
2017-06-17T06:03:34
2017-04-23T14:54:49
Java
UTF-8
Java
false
false
3,111
java
package com.asciipic.search.services; import com.asciipic.search.dtos.ImagePostDTO; import com.asciipic.search.models.Image; import com.asciipic.search.models.SavedImage; import com.asciipic.search.models.Tag; import com.asciipic.search.repositories.ImageRepository; import com.asciipic.search.repositories.SavedImageRepository; import com.asciipic.search.repositories.TagRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.sql.rowset.serial.SerialBlob; import java.sql.Blob; import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @Service public class ImageServiceImpl implements ImageService { @Autowired TagRepository tagRepository; @Autowired SavedImageRepository savedImageRepository; @Autowired ImageRepository imageRepository; @Autowired AsciiService asciiService; @Override public SavedImage findSavedImageById(Long imageId) { return savedImageRepository.findOne(imageId); } @Override public Image findImageById(Long imageId) { return imageRepository.findOne(imageId); } @Override public String getAsciiData(long id) { return savedImageRepository.findOne(id).getAsciiData(); } @Override public Image addNewImage(ImagePostDTO imagePostDTO) throws SQLException { // TODO: verify the input imagePostDTO.getTags(); List<String> listOfTags = imagePostDTO.getTags(); List<Tag> newListOfTags = new ArrayList<>(); Tag newTag; for (String listOfTag : listOfTags) { if (tagRepository.findNumberByName(listOfTag) == 0) { Tag tag = new Tag(listOfTag); newTag = tagRepository.save(tag); } else { newTag = new Tag(); newTag.setId(tagRepository.findIdByName(listOfTag)); newTag.setName(listOfTag); } newListOfTags.add(newTag); } Image image = new Image(); image.setUrl(imagePostDTO.getUrl()); image.setSource(imagePostDTO.getSource()); image.setSize(imagePostDTO.getSize()); image.setWidth(imagePostDTO.getWidth()); image.setHeight(imagePostDTO.getHeight()); image.setPostDate(imagePostDTO.getPostDate()); image.setCrawlDate(imagePostDTO.getCrawlDate()); image.setIsSaved(imagePostDTO.getSaved()); image.setTags(newListOfTags); Image newImage = imageRepository.save(image); SavedImage savedImage = new SavedImage(); byte[] bytes = new byte[2]; Arrays.fill(bytes, (byte) 1); Blob imageBlob = new SerialBlob(imagePostDTO.getByteImage()); savedImage.setId(newImage.getId()); savedImage.setData(bytes); savedImage.setAsciiData(asciiService.transformImageToAscii(imageBlob)); savedImageRepository.save(savedImage); savedImageRepository.updateBlob(imagePostDTO.getByteImage(), newImage.getId()); return newImage; } }
bb97c297df6318004fe69f5dca3fb35eab669485
d3e5ee1b3ffa3fe3befc9ec6221df36a97f4613b
/task/src/pojo/Student.java
bcea3aeaeb259b8d3f668da3c3f4466509b9bfd3
[]
no_license
firmofliran/task
8482ce2e5c9870b729706a6680f91297ab5b460d
7d71a0b4fedf220e1836bd01a58c7f9608aa774c
refs/heads/master
2020-05-26T10:26:15.922261
2019-05-23T09:11:29
2019-05-23T09:11:29
188,198,412
3
0
null
null
null
null
UTF-8
Java
false
false
1,540
java
package pojo; import java.io.Serializable; public class Student implements Serializable{ private static final long serialVersionUID = 1L; String sno; String passward; String name; String sclass; String department; int score; String identify; int sturank; public Student(String sno, String passward, String name, String sclass, String department, int score, String identify) { this.sno = sno; this.passward = passward; this.name = name; this.sclass = sclass; this.department = department; this.score = score; this.identify = identify; } public Student() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSclass() { return sclass; } public void setSclass(String sclass) { this.sclass = sclass; } public String getDepartment() { return department; } public void setDepartment(String department) { this.department = department; } public int getScore() { return score; } public void setScore(int score) { this.score = score; } public String getIdentify() { return identify; } public void setIdentify(String identify) { this.identify = identify; } public String getSno() { return sno; } public void setSno(String sno) { this.sno = sno; } public String getPassward() { return passward; } public void setPassward(String passward) { this.passward = passward; } public int getSturank() { return sturank; } public void setSturank(int sturank) { this.sturank = sturank; } }
3da4c2369b95c5fd75a8c3da9b97d7d644fdfb04
22931b8653f282bfdf88c0a4bc43257dcaea805b
/src/main/java/com.managementSystemProject/Login/LoginAdmin.java
f0791f7252049d4f4d95e0bf7b50ffa49830d8a1
[]
no_license
Lukaszwutkowski/EmployeeManagementSystem
e1c6799f9602a2239475241b1dcd4b5fa40d26ef
a78d5e9091f3c6b03f4d471f6d470fc09a9753e6
refs/heads/master
2022-12-17T20:10:47.723579
2020-09-24T16:25:33
2020-09-24T16:25:33
296,960,645
0
0
null
null
null
null
UTF-8
Java
false
false
1,669
java
package com.managementSystemProject.Login; import com.managementSystemProject.ConsoleMenu.ConsoleMenu; import com.managementSystemProject.DAO.AdminDAOImpl; import com.managementSystemProject.DAO.TestDAO; import java.sql.*; import java.util.Scanner; public class LoginAdmin implements Login { private static final ConsoleMenu c = new ConsoleMenu(); private String userName; private String password; private static final Scanner scanner = new Scanner(System.in); private static final String URL = "jdbc:mysql://localhost:3306/management_sys?useLegacyDatetimeCode=false&serverTimezone=UTC"; @Override public void loginActionPerformed() { try { Connection connection = DriverManager.getConnection(URL, "root", "RootPassword95"); String query = "select * from user_admin where user_admin =? and password =?"; PreparedStatement pst = connection.prepareStatement(query); System.out.println("Type in your email address"); userName = scanner.next(); System.out.println("Type in password"); password = scanner.next(); pst.setString(1, userName); pst.setString(2, password); ResultSet rs = pst.executeQuery(); if (rs.next()) { System.out.println("username and password is correct"); c.correctPasswordAdmin(); } else { System.out.println("username and password is NOT correct"); loginActionPerformed(); } } catch (SQLException throwables) { throwables.printStackTrace(); } } }
d402027870e426a36da1ba05c614203345354bf1
297b0dcd8e9f6fd00425bcc12849bdc0b46a4ed2
/ui/com.mercatis.lighthouse3.ui.environment.ui/src/com/mercatis/lighthouse3/ui/environment/editors/pages/AttachedDeploymentsEditorFormPage.java
6a860105c44671b235345cbefbd7964ca1108367
[ "Apache-2.0" ]
permissive
mercatis/Lighthouse
cedf5093ea16285460975f4882de0de0b05b0db2
85885f29585137347150cfc7e24fcc5315db980a
refs/heads/master
2020-05-19T23:49:00.669151
2011-12-13T09:48:22
2011-12-13T09:48:22
2,143,373
1
0
null
null
null
null
UTF-8
Java
false
false
7,140
java
/* * Copyright 2011 mercatis Technologies AG * * 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.mercatis.lighthouse3.ui.environment.editors.pages; import java.util.Comparator; import java.util.Iterator; import java.util.Set; import java.util.TreeSet; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.forms.IManagedForm; import org.eclipse.ui.forms.editor.FormEditor; import org.eclipse.ui.forms.editor.FormPage; import org.eclipse.ui.forms.widgets.FormToolkit; import org.eclipse.ui.forms.widgets.ScrolledForm; import org.eclipse.ui.forms.widgets.Section; import com.mercatis.lighthouse3.base.ui.editors.GenericEditorInput; import com.mercatis.lighthouse3.base.ui.provider.LabelConverter; import com.mercatis.lighthouse3.base.ui.widgets.chooser.SecuritySelectionListLabelProvider; import com.mercatis.lighthouse3.base.ui.widgets.chooser.SecuritySelectionListModificationListener; import com.mercatis.lighthouse3.base.ui.widgets.chooser.SecuritySelectionListWidget; import com.mercatis.lighthouse3.domainmodel.environment.Deployment; import com.mercatis.lighthouse3.domainmodel.environment.DeploymentCarryingDomainModelEntity; import com.mercatis.lighthouse3.ui.common.base.CommonBaseActivator; import com.mercatis.lighthouse3.ui.environment.base.model.LighthouseDomain; import com.mercatis.lighthouse3.ui.environment.base.services.DomainChangeEvent; import com.mercatis.lighthouse3.ui.environment.base.services.DomainChangeListener; import com.mercatis.lighthouse3.ui.security.CodeGuard; import com.mercatis.lighthouse3.ui.security.Role; /** * This editor page provides fuctions for detaching and attaching deployments to a DeploymentCarrier * */ public class AttachedDeploymentsEditorFormPage extends FormPage implements SecuritySelectionListModificationListener<Deployment>, DomainChangeListener { public static final String ID = AttachedDeploymentsEditorFormPage.class.getName(); private DeploymentCarryingDomainModelEntity<?> carrier; private SecuritySelectionListWidget<Deployment> chooser; private LighthouseDomain lighthouseDomain; private SecuritySelectionListLabelProvider<Deployment> dLabelProv = new SecuritySelectionListLabelProvider<Deployment>() { public String getLabel(Deployment d) { return d.getDeployedComponent().getCode() + " @ " + d.getLocation(); } }; public AttachedDeploymentsEditorFormPage(FormEditor editor) { super(editor, ID, null); this.carrier = (DeploymentCarryingDomainModelEntity<?>) ((GenericEditorInput<?>) getEditor().getEditorInput()).getEntity(); this.lighthouseDomain = ((GenericEditorInput<?>) getEditor().getEditorInput()).getDomain(); CommonBaseActivator.getPlugin().getDomainService().addDomainChangeListener(this); } @Override public void dispose() { CommonBaseActivator.getPlugin().getDomainService().removeDomainChangeListener(this); super.dispose(); } private Comparator<Deployment> deploymentComparator = new Comparator<Deployment>(){ public int compare(Deployment o1, Deployment o2) { String s1 = LabelConverter.getLabel(o1); String s2 = LabelConverter.getLabel(o2); return s1.compareTo(s2); } }; private void refresh() { // there is no need to refresh if we ain't got no view if (chooser == null) return; // fetch all "available" deployments TreeSet<Deployment> available = new TreeSet<Deployment>(deploymentComparator); available.addAll(lighthouseDomain.getDeploymentContainer().getAllDeployments()); // remove all deployments that the current user is not allowed to view & install for (Iterator<Deployment> it = available.iterator(); it.hasNext();) { Deployment deployment = it.next(); if (!CodeGuard.hasRole(Role.DEPLOYMENT_VIEW, deployment)) { it.remove(); } } chooser.setItems(available, Role.DEPLOYMENT_INSTALL); // fetch all deployments that are already attached to this.carrier Set<Deployment> selected = new TreeSet<Deployment>(deploymentComparator); selected.addAll(this.carrier.getDeployments()); // remove all deployments that the current user is not allowed to view & drag for (Iterator<Deployment> it = selected.iterator(); it.hasNext();) { Deployment deployment = it.next(); if (!CodeGuard.hasRole(Role.DEPLOYMENT_VIEW, deployment)) { it.remove(); } } chooser.setSelected(selected); getEditor().editorDirtyStateChanged(); } @Override protected void createFormContent(IManagedForm managedForm) { final ScrolledForm form = managedForm.getForm(); FormToolkit toolkit = managedForm.getToolkit(); form.setText("Deployments on: " + LabelConverter.getLabel(carrier)); toolkit.decorateFormHeading(form.getForm()); form.getBody().setLayout(new FillLayout()); createHeaderSection(form, toolkit); refresh(); } private void createHeaderSection(ScrolledForm form, FormToolkit toolkit) { Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR); section.clientVerticalSpacing = 5; section.marginHeight = 8; section.marginWidth = 8; Composite client = toolkit.createComposite(section); client.setLayout(new FillLayout()); toolkit.paintBordersFor(client); chooser = new SecuritySelectionListWidget<Deployment>(client, dLabelProv); chooser.addModifiycationListener(this); section.setClient(client); } @Override public boolean isDirty() { if (chooser==null) return false; return chooser.getModified(true).size() != 0 || chooser.getModified(false).size() != 0; } public void updateModel() { Set<Deployment> removedItems = chooser.getModified(false); boolean allDetached = true; for (Deployment deployment : removedItems) { if (!CommonBaseActivator.getPlugin().getDomainService().isDeploymentPartOfStatusTemplate(carrier, deployment)) { carrier.detachDeployment(deployment); } else { allDetached = false; } } if (!allDetached) { Shell shell = Display.getCurrent().getActiveShell(); MessageDialog.openWarning(shell, "Deployments not detached", "One or more deployments were not detached because they are part of a status."); } Set<Deployment> addedItems = chooser.getModified(true); for (Deployment deployment : addedItems) { carrier.attachDeployment(deployment); } getEditor().editorDirtyStateChanged(); } public void domainChange(DomainChangeEvent event) { refresh(); } public void onListItemModified(Deployment item, boolean enabled, boolean modified) { getEditor().editorDirtyStateChanged(); } }
df66d79a801d118b5a3ce5cfbea0c4522f528278
23825c62485bb2d2f4e89f090ee2d96be7cd9161
/src/main/java/com/nsc/web/contorller/ErpBookInfoController.java
cec463b028d5b9690f3eff696095f7f30e2b48f5
[]
no_license
linshili/bookstore
c69425540a1ff7ccf780cf41eb844f6193f9af95
d7ac215f155195fc052bb34bd005d48cb7b8ffaf
refs/heads/master
2020-04-17T00:48:50.842726
2019-04-17T07:56:43
2019-04-17T07:56:43
166,063,339
2
0
null
2019-04-17T07:55:59
2019-01-16T15:29:10
Java
UTF-8
Java
false
false
2,896
java
package com.nsc.web.contorller; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.nsc.backend.entity.Book; import com.nsc.backend.entity.ErpBookInfo; import com.nsc.backend.service.IErpBookInfoService; @Controller @RequestMapping("/ErpBookInfoController") public class ErpBookInfoController { @Autowired private IErpBookInfoService iebis; @RequestMapping(value="/selData") @ResponseBody public void selData(){ //List<Map<String, Object>> baseList=null; /*List<Object> baseList=null;*/ /*HashMap<String, Object> baseList=new HashMap<String, Object>();*/ /* String num; Date date=new Date();*/ List<ErpBookInfo> bookList = new ArrayList<ErpBookInfo>(); bookList= iebis.selData(); // for(int i=0;i<baseList.size();i++){ // Map<String,Object> map = baseList.get(i); // num=501+i+""; // // map.put("book_id", num); // map.put("title", "【人民出版社】特价 赢在专注:从简单到极致的36技 10071148:200905;10071147:9787506034678;10071150:东方出版社"); // map.put("props_name", "hh"); // map.put("version", "1"); // map.put("pic_url", "http://img10.360buyimg.com/n1/jfs/t2305/263/763174789/133819/40ca5b9d/5627043aNcc2a643b.jpg"); // map.put("author", num); // map.put("print_date", date.toString()); // map.put("print_house", num); /*System.out.println(map.get("book_id")+" "+map.get("title")+" "+map.get("props_name")+" " +map.get("version")+" "+map.get("pic_url")+" " +map.get("author")+" "+map.get("print_date")+" " +map.get("print_house")+" "+map.get("frame"));*/ //System.out.println(map); /*Set<String> keys=map.keySet(); Iterator<String> iter=keys.iterator(); while(iter.hasNext()){ String str=iter.next(); System.out.print(str); }*/ System.out.println(bookList); iebis.insert(bookList); } /* @RequestMapping(value="/selDatar") @ResponseBody public void selData2(){ Map<String, Object> map=null; map= iebis.selData2(); System.out.println(map.get("title")+" "+map.get("props_name")+" " +map.get("version")+" "+map.get("pic_url")+" " +map.get("author")+" "+map.get("print_date")+" " +map.get("print_house")+" "+map.get("frame")); iebis.insert2(map); }*/ }
ce14dbd1961c59c6ed13dde8063c2869973b1ad6
69548cac31f8bad08a0a665a232f29ee458b3c1b
/Lessons/Lesson15/Utils.java
d13c3a2250bdd898882c54232f79f68412605d44
[]
no_license
Vitamin-68/SkillsUp
ac7bff63efb44c3ca58b686373654a22c828b0c9
22cb91cb172bdc326b0fe311b892fef8f92312a2
refs/heads/master
2022-06-29T04:44:14.410195
2019-09-30T17:27:12
2019-09-30T17:27:12
195,966,244
0
0
null
null
null
null
UTF-8
Java
false
false
4,570
java
package Lesson15; import java.io.*; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; import java.util.Set; public class Utils { private static final String FIRST_NAME = "First Name: "; private static final String LAST_NAME = "Last Name: "; private static final String AGE = "Age: "; private static final String HEIGHT = "Height: "; private static final String MARRIED = "Married: "; private static final String BIRTH_DAY = "Birth day: "; private static final String WORD_SEPARATOR = ", "; private static final String LINE_SEPARATOR = "\n"; private static final String LIST_PATH = "person.txt"; static void writeIntoFile(List<Person> people) throws IOException { FileWriter writer = new FileWriter(new File(LIST_PATH)); for (Person person : people) { writer.write(FIRST_NAME + person.getFirstName() + WORD_SEPARATOR + LAST_NAME + person.getLastName() + WORD_SEPARATOR + AGE + person.getAge() + WORD_SEPARATOR + HEIGHT + person.getHeight() + WORD_SEPARATOR + MARRIED + person.isMarried() + WORD_SEPARATOR + BIRTH_DAY + person.getBirthDay() + WORD_SEPARATOR + LINE_SEPARATOR); } writer.close(); } static void readPeopleFromFile() throws IOException, ClassNotFoundException { FileInputStream fileInputStream = new FileInputStream("peopleObject.txt"); ObjectInputStream inputStream = new ObjectInputStream(fileInputStream); List<Person> people = (List<Person>) inputStream.readObject(); inputStream.close(); people.forEach(System.out::println); } static void writeListOfPeople(List<Person> people) throws IOException { FileOutputStream fileOutputStream = new FileOutputStream("peopleObject.txt"); ObjectOutputStream outputStream = new ObjectOutputStream(fileOutputStream); outputStream.writeObject(people); outputStream.close(); } static void writeListOfPeople2(Set<Person> people) throws IOException { FileOutputStream fileOutputStream = new FileOutputStream("peopleObject.txt"); ObjectOutputStream outputStream = new ObjectOutputStream(fileOutputStream); outputStream.writeObject(people); outputStream.close(); } static List<Person> getPersonListFromFile() throws IOException { List<Person> people = new ArrayList<>(); BufferedReader reader = new BufferedReader(new FileReader(new File(LIST_PATH))); reader.lines().forEach((String item) -> { Person person = new Person(); String[] parameters = item.split(WORD_SEPARATOR); for (String parameter : parameters) { if (parameter.contains(FIRST_NAME)) { person.setFirstName(parameter.split(":")[1]); } else if (parameter.contains(LAST_NAME)) { person.setLastName(parameter.split(":")[1]); } else if (parameter.contains(AGE)) { person.setAge(Integer.parseInt(parameter.split(":")[1].trim())); } else if (parameter.contains(HEIGHT)) { person.setHeight(Double.parseDouble(parameter.split(":")[1].trim())); } else if (parameter.contains(MARRIED)) { person.setMarried(Boolean.parseBoolean(parameter.split(":")[1].trim())); } else if (parameter.contains(BIRTH_DAY)) { person.setBirthDay(LocalDate.parse(parameter.split(":")[1].trim())); } } people.add(person); }); return people; } static void test() { File file = new File("Новый текстовый документ.txt"); System.out.println("af" + file.getAbsoluteFile()); System.out.println("ap" + file.getAbsolutePath()); try { System.out.println("cp" + file.getCanonicalPath()); } catch (IOException e) { e.printStackTrace(); } try { FileInputStream fileInputStream = new FileInputStream(file); int number = -1; StringBuilder sBuilder = new StringBuilder(); while ((number = fileInputStream.read()) != -1) { // -1 end of file sBuilder.append((char) number); } System.out.println(sBuilder.toString()); } catch (IOException e) { e.printStackTrace(); } } }
4b6f109e294d1a2f758d70aae1942b9e995ab951
1ce518b09521578e26e79a1beef350e7485ced8c
/source/app/src/main/java/com/google/android/gms/drive/internal/r.java
54f33627ee3fca63189baf50ba51ced569fa45bd
[]
no_license
yash2710/AndroidStudioProjects
7180eb25e0f83d3f14db2713cd46cd89e927db20
e8ba4f5c00664f9084f6154f69f314c374551e51
refs/heads/master
2021-01-10T01:15:07.615329
2016-04-03T09:19:01
2016-04-03T09:19:01
55,338,306
1
1
null
null
null
null
UTF-8
Java
false
false
6,941
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.google.android.gms.drive.internal; import android.content.Context; import android.os.Bundle; import android.os.IBinder; import android.os.IInterface; import android.os.Looper; import android.os.RemoteException; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; import com.google.android.gms.common.api.Status; import com.google.android.gms.drive.DriveId; import com.google.android.gms.drive.events.b; import com.google.android.gms.internal.gy; import com.google.android.gms.internal.hb; import com.google.android.gms.internal.hi; import com.google.android.gms.internal.hm; import java.util.HashMap; import java.util.Map; // Referenced classes of package com.google.android.gms.drive.internal: // x, aa, DisconnectRequest public class r extends hb { private final String IQ; private final Bundle IR; private DriveId IS; private DriveId IT; final com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks IU; Map IV; private final String yQ; public r(Context context, Looper looper, gy gy1, com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks connectioncallbacks, com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener onconnectionfailedlistener, String as[], Bundle bundle) { super(context, looper, connectioncallbacks, onconnectionfailedlistener, as); IV = new HashMap(); yQ = (String)hm.b(gy1.fj(), "Must call Api.ClientBuilder.setAccountName()"); IQ = gy1.fn(); IU = connectioncallbacks; IR = bundle; } protected aa O(IBinder ibinder) { return aa.a.P(ibinder); } PendingResult a(GoogleApiClient googleapiclient, DriveId driveid, int i, com.google.android.gms.drive.events.DriveEvent.Listener listener) { hm.b(com.google.android.gms.drive.events.b.a(i, driveid), "id"); hm.b(listener, "listener"); hm.a(isConnected(), "Client must be connected"); Map map = IV; map; JVM INSTR monitorenter ; Object obj = (Map)IV.get(driveid); if (obj != null) { break MISSING_BLOCK_LABEL_78; } obj = new HashMap(); IV.put(driveid, obj); p.k k; if (!((Map) (obj)).containsKey(listener)) { break MISSING_BLOCK_LABEL_109; } k = new p.k(googleapiclient, Status.En); map; JVM INSTR monitorexit ; return k; com.google.android.gms.common.api.a.b b1; x x1 = new x(getLooper(), i, listener); ((Map) (obj)).put(listener, x1); b1 = googleapiclient.b(new _cls1(driveid, i, x1)); map; JVM INSTR monitorexit ; return b1; Exception exception; exception; throw exception; } protected void a(int i, IBinder ibinder, Bundle bundle) { if (bundle != null) { bundle.setClassLoader(getClass().getClassLoader()); IS = (DriveId)bundle.getParcelable("com.google.android.gms.drive.root_id"); IT = (DriveId)bundle.getParcelable("com.google.android.gms.drive.appdata_id"); } super.a(i, ibinder, bundle); } protected void a(hi hi1, com.google.android.gms.internal.hb.e e) { String s = getContext().getPackageName(); hm.f(e); hm.f(s); hm.f(fs()); Bundle bundle = new Bundle(); bundle.putString("proxy_package_name", IQ); bundle.putAll(IR); hi1.a(e, 0x4da6e8, s, fs(), yQ, bundle); } PendingResult b(GoogleApiClient googleapiclient, DriveId driveid, int i, com.google.android.gms.drive.events.DriveEvent.Listener listener) { hm.b(com.google.android.gms.drive.events.b.a(i, driveid), "id"); hm.a(isConnected(), "Client must be connected"); hm.b(listener, "listener"); Map map = IV; map; JVM INSTR monitorenter ; Map map1 = (Map)IV.get(driveid); if (map1 != null) { break MISSING_BLOCK_LABEL_75; } p.k k = new p.k(googleapiclient, Status.En); map; JVM INSTR monitorexit ; return k; x x1 = (x)map1.remove(listener); if (x1 != null) { break MISSING_BLOCK_LABEL_121; } p.k k1 = new p.k(googleapiclient, Status.En); map; JVM INSTR monitorexit ; return k1; Exception exception; exception; throw exception; com.google.android.gms.common.api.a.b b1; if (map1.isEmpty()) { IV.remove(driveid); } b1 = googleapiclient.b(new _cls2(driveid, i, x1)); map; JVM INSTR monitorexit ; return b1; } protected String bu() { return "com.google.android.gms.drive.ApiService.START"; } protected String bv() { return "com.google.android.gms.drive.internal.IDriveService"; } public void disconnect() { aa aa1 = (aa)ft(); if (aa1 != null) { try { aa1.a(new DisconnectRequest()); } catch (RemoteException remoteexception) { } } super.disconnect(); IV.clear(); } public aa gp() { return (aa)ft(); } public DriveId gq() { return IS; } public DriveId gr() { return IT; } protected IInterface x(IBinder ibinder) { return O(ibinder); } private class _cls1 extends p.j { final DriveId IW; final int IX; final x IY; final r IZ; protected volatile void a(com.google.android.gms.common.api.Api.a a1) { a((r)a1); } protected void a(r r1) { r1.gp().a(new AddEventListenerRequest(IW, IX, null), IY, null, new aw(this)); } _cls1(DriveId driveid, int i, x x1) { IZ = r.this; IW = driveid; IX = i; IY = x1; super(); } } private class _cls2 extends p.j { final DriveId IW; final int IX; final x IY; final r IZ; protected volatile void a(com.google.android.gms.common.api.Api.a a1) { a((r)a1); } protected void a(r r1) { r1.gp().a(new RemoveEventListenerRequest(IW, IX), IY, null, new aw(this)); } _cls2(DriveId driveid, int i, x x1) { IZ = r.this; IW = driveid; IX = i; IY = x1; super(); } } }
d3cdd91c96e80adf11175fd75b40c2c3f056089d
a99fab454db47547e5cf244dd2d41e6864b4432f
/src/main/java/com/arc90/xmlsanity/transformation/TransformationException.java
5327c1da4bacdf827684b4652037caac1c2147e3
[]
no_license
arc90/xmlsanity
b40a297029463bb0ef4a9128e8b3cf7aef6d6468
0422f13d305798314b350ca3fb0eea67299b0771
refs/heads/master
2020-05-20T15:25:18.260132
2010-12-20T02:48:01
2010-12-20T02:48:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
465
java
package com.arc90.xmlsanity.transformation; public class TransformationException extends Exception { private static final long serialVersionUID = -2347256368493384122L; public TransformationException(String message) { super(message); } public TransformationException(Throwable cause) { super(cause); } public TransformationException(String message, Throwable cause) { super(message, cause); } }
[ "devnull@localhost" ]
devnull@localhost