blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
174dcfd8f51c44b989dec33302e1314e036448ca | f45ce754926b41c0fd6fac8cff82523e3ea0475a | /LeftBullet.java | 1c7eb590622641aabaa57d324414468a398502e1 | [] | no_license | chasnolte/cs-261-programming-assignment-1-chasnolte-master | f21fed32aaee2bbb292a06ca38395ffbf46729ec | 3f01fcaf8230a153d6390df8a89b8da8e8a1cdb2 | refs/heads/master | 2021-01-02T21:56:53.569281 | 2020-02-11T16:59:18 | 2020-02-11T16:59:18 | 239,816,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* The left bullet actor is created when a player fires a gun, and will kill zombies on impact
*
* @author Chas Nolte
* @version February 11 2020
*/
public class LeftBullet extends Actor
{
/**
* Act - do whatever the LeftBullet wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
//Sets the location of the bullet to where the player is, and constantly moves left when fired
setLocation(getX()-30, getY());
//Bullet is killed if it hits the edge of the world
if (isAtEdge())
{
getWorld().removeObject(this);
}
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
66aa3176a02c565ac24c5330dfd53d552b1e27af | fe86a5a01922c2c72df131f2f5970d3c4c6ec6e4 | /src/main/java/com/kdgc/model/GoJsNode.java | 503193e4dba379b8a2c87766ebd3c83be331f56c | [] | no_license | miki-hmt/blood-analysis | e807eae94e4c6dc932b44fc8772d25b6a83f7219 | 50144a52028b5e67ee73a9f62bd8d10cb4abb2da | refs/heads/master | 2023-08-10T07:30:59.129851 | 2021-09-10T01:55:57 | 2021-09-10T01:55:57 | 329,489,492 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 498 | java | package com.kdgc.model;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.List;
/**
* @author jczhou
* @description
* @date 2020/7/24
**/
@Setter
@Getter
@Builder
public class GoJsNode implements Serializable {
private Long nodeId;
private String dbUrl;
private String key;
private String srType;
private List<GoJsNodeField> fields;
/**
* 位置 如: 321 -98
*/
private String loc;
}
| [
"1329289117@qq.com"
] | 1329289117@qq.com |
cc919f59f2dc5123b68f1390c581932479074e23 | 2acb72aae4b7970b394f64885ef849f4569779e3 | /library/src/main/java/com/blunderer/materialdesignlibrary/interfaces/ListView.java | e6661581512eb535c828b04799014669d8027b92 | [] | no_license | Cloud-Concept/DWC-Final-Android | a66c4defd3d1cb181d9a7ee21e0aa9ac4a491f00 | e19e79c3597d6b21c3c891c8b7298b97897ed9bd | refs/heads/master | 2020-04-19T08:39:41.021658 | 2016-08-22T16:09:42 | 2016-08-22T16:09:42 | 66,248,361 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 668 | java | package com.blunderer.materialdesignlibrary.interfaces;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListAdapter;
public interface ListView {
void setRefreshing(boolean refreshing);
ListAdapter getListAdapter();
boolean useCustomContentView();
int getCustomContentView();
boolean pullToRefreshEnabled();
boolean LoadMoreEnabled();
int[] getPullToRefreshColorResources();
void onRefresh();
void loadMore();
void onItemClick(AdapterView<?> adapterView, View view, int position, long l);
boolean onItemLongClick(AdapterView<?> adapterView, View view, int position, long l);
}
| [
"AbanoubWagdy"
] | AbanoubWagdy |
14be2f3bb12a0e2455bd1affdfffa0425afd5c5a | 7096288718c53a96db43374e7f7fb2038d6540d8 | /common/java/router/src/net/i2p/router/transport/udp/OutboundRefiller.java | 078105a4a7b1c00a471c9c758167879cdd1c7f37 | [
"Unlicense",
"LicenseRef-scancode-public-domain"
] | permissive | mhatta/Nightweb | 5ea1a4cec12393e0fd7fccafe1b116402e2cafd5 | b6e58eec6722dfb9df0e3de2de600c222729c96b | refs/heads/master | 2021-08-22T05:14:06.870860 | 2019-02-05T10:27:26 | 2019-02-05T10:27:26 | 151,987,810 | 10 | 0 | Unlicense | 2020-04-01T03:15:26 | 2018-10-07T21:40:45 | Clojure | UTF-8 | Java | false | false | 2,325 | java | package net.i2p.router.transport.udp;
import net.i2p.router.OutNetMessage;
import net.i2p.router.RouterContext;
import net.i2p.util.I2PThread;
import net.i2p.util.Log;
/**
* Blocking thread to grab new messages off the outbound queue and
* plopping them into our active pool.
*
* WARNING - UNUSED since 0.6.1.11
*
*/
class OutboundRefiller implements Runnable {
private RouterContext _context;
private Log _log;
private OutboundMessageFragments _fragments;
private MessageQueue _messages;
private boolean _alive;
// private Object _refillLock;
public OutboundRefiller(RouterContext ctx, OutboundMessageFragments fragments, MessageQueue messages) {
_context = ctx;
_log = ctx.logManager().getLog(OutboundRefiller.class);
_fragments = fragments;
_messages = messages;
// _refillLock = this;
_context.statManager().createRateStat("udp.timeToActive", "Message lifetime until it reaches the outbound fragment queue", "udp", UDPTransport.RATES);
}
public void startup() {
_alive = true;
I2PThread t = new I2PThread(this, "UDP outbound refiller", true);
t.start();
}
public void shutdown() { _alive = false; }
public void run() {
while (_alive) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Check the fragments to see if we can add more...");
boolean wantMore = _fragments.waitForMoreAllowed();
if (wantMore) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Want more fragments...");
OutNetMessage msg = _messages.getNext(-1);
if (msg != null) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("New message found to fragments: " + msg);
_context.statManager().addRateData("udp.timeToActive", msg.getLifetime(), msg.getLifetime());
_fragments.add(msg);
} else {
if (_log.shouldLog(Log.DEBUG))
_log.debug("No message found to fragment");
}
} else {
if (_log.shouldLog(Log.WARN))
_log.warn("No more fragments allowed, looping");
}
}
}
}
| [
"zsoakes@gmail.com"
] | zsoakes@gmail.com |
58bf68101ae5635af4e6b8fa079de223c60ad8bf | 089c99b71bc161e5809921e12ec450d041a4a9e6 | /archive/OdometricLocalizer.java | b944b2de151c419c4c229b715b5279810542e051 | [] | no_license | HarshalShende/Robot | 1f7691c12d5a60ac2f4e030b3fd04ba84b62bf58 | 1e29a9a9584726abb21b2a63f13a40b272946baa | refs/heads/master | 2020-06-16T12:00:23.971332 | 2018-04-29T16:14:11 | 2018-04-29T16:14:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,922 | java | import com.ridgesoft.robotics.Localizer;
import com.ridgesoft.robotics.Pose;
import com.ridgesoft.robotics.ShaftEncoder;
public class OdometricLocalizer extends Thread implements Localizer {
private static final float PI = 3.14159f;
private static final float TWO_PI = PI * 2.0f;
private ShaftEncoder leftEncoder;
private ShaftEncoder rightEncoder;
private int previousLeftCounts;
private int previousRightCounts;
private float distancePerCount;
private float radiansPerCount;
private float x = 0.0f;
private float y = 0.0f;
private float heading = 0.0f;
private int period;
public OdometricLocalizer(
ShaftEncoder leftEncoder,
ShaftEncoder rightEncoder,
float wheelDiameter,
float trackWidth,
int countsPerRevolution,
int threadPriority,
int period){
this.leftEncoder = leftEncoder;
this.rightEncoder = rightEncoder;
distancePerCount = (PI * wheelDiameter) / (float)countsPerRevolution;
radiansPerCount = PI * (wheelDiameter / trackWidth) / countsPerRevolution;
this.period = period;
previousLeftCounts = leftEncoder.getCounts();
previousRightCounts = rightEncoder.getCounts();
setDaemon(true);
setPriority(threadPriority);
start();
}
public synchronized Pose getPose() {
return new Pose(x, y, heading);
}
public void run() {
try {
long nextTime = System.currentTimeMillis();
while (true) {
int leftCounts = leftEncoder.getCounts();
int rightCounts = rightEncoder.getCounts();
int deltaLeft = leftCounts - previousLeftCounts;
int deltaRight = rightCounts - previousRightCounts;
float deltaDistance = 0.5f * (float)(deltaLeft + deltaRight) * distancePerCount;
float deltaX = deltaDistance * (float)Math.cos(heading);
float deltaY = deltaDistance * (float)Math.sin(heading);
float deltaTheta = (float)(deltaRight - deltaLeft) * radiansPerCount;
synchronized (this) {
x += deltaX;
y += deltaY;
heading += deltaTheta;
// limit theta to -Pi <= theta < Pi
if (heading > PI)
heading -= TWO_PI;
else if (heading <= -PI)
heading += TWO_PI;
}
previousLeftCounts = leftCounts;
previousRightCounts = rightCounts;
nextTime += period;
Thread.sleep(nextTime - System.currentTimeMillis());
}
} catch (Throwable t) {
t.printStackTrace();
}
}
@Override
public void setHeading(float arg0) {
// TODO Auto-generated method stub
}
@Override
public void setPose(Pose arg0) {
// TODO Auto-generated method stub
}
@Override
public void setPose(float arg0, float arg1, float arg2) {
// TODO Auto-generated method stub
}
@Override
public void setPosition(float arg0, float arg1) {
// TODO Auto-generated method stub
}
} | [
"big.nate.w@gmail.com"
] | big.nate.w@gmail.com |
206c93167fdf5cd4f7935ac0df522fb04d66ebcf | 741c341760ef7e08b17f1d01f0f2a919216846d5 | /core/src/main/java/academy/devdojo/youtube/core/model/Course.java | 2732178659e69f55830083c467ab08baf4637b33 | [] | no_license | tuliopcunha/microservices-java | 962ed00aa1fa171b6f94b49b9f0521921cc57f2c | 4890f1823e3ff8bc6af7f44e5b4b7a98b0b41aab | refs/heads/master | 2023-01-10T05:52:31.896123 | 2020-11-01T13:33:20 | 2020-11-01T13:33:20 | 304,946,998 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 874 | java | package academy.devdojo.youtube.core.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
@Entity
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class Course implements AbstractEntity{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@EqualsAndHashCode.Include
private Long id;
@NotNull(message = "The field 'title' is mandatory")
@Column(nullable = false)
private String title;
}
| [
"tulio.parreira@helpper.com.br"
] | tulio.parreira@helpper.com.br |
1d3b1a043872515b7a4457ad353d07c6f8e011d1 | 9f936699f192745f9312780132b05399ba97b158 | /src/com/video/tutorial/my/dao/OffersDAO.java | 0abf1fa132c7533a6da2f82960fee30b5fe64a83 | [] | no_license | jgsadang/TutorialRecommenderSystem | 6c2c93abaae5151fd6e60a964e43064afeba268f | 4b43a7c29416708b3aa27efe32cd3a959ea927b4 | refs/heads/master | 2021-01-10T09:04:09.398374 | 2015-10-07T19:02:24 | 2015-10-07T19:02:24 | 43,837,274 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,955 | java | package com.video.tutorial.my.dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Component;
@Component("offersDAO")
public class OffersDAO {
private NamedParameterJdbcTemplate jdbc;
@Autowired
public void setDataSource(DataSource jdbc) {
this.jdbc = new NamedParameterJdbcTemplate(jdbc);
}
public List<Offer> getOffers() {
return jdbc.query("select * from offers", new RowMapper<Offer>() {
public Offer mapRow(ResultSet rs, int rowNum) throws SQLException {
Offer offer = new Offer();
offer.setId(rs.getInt("id"));
offer.setName(rs.getString("name"));
offer.setText(rs.getString("text"));
offer.setEmail(rs.getString("email"));
return offer;
}
});
}
public boolean createOffer(Offer offer) {
BeanPropertySqlParameterSource params = new BeanPropertySqlParameterSource(offer);
return jdbc.update("insert into offers (name, email, text) values (:name, :email, :text)", params) == 1;
}
public Offer getOffer(int id) {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("id", id);
return jdbc.queryForObject("select * from offers where id=:id", params, new RowMapper<Offer>() {
public Offer mapRow(ResultSet rs, int rowNum) throws SQLException {
Offer offer = new Offer();
offer.setId(rs.getInt("id"));
offer.setName(rs.getString("name"));
offer.setText(rs.getString("text"));
offer.setEmail(rs.getString("email"));
return offer;
}
});
}
}
| [
"jgsadang3@gmail.com"
] | jgsadang3@gmail.com |
1762d501bffb8a0c0d3619fe61cbfbb8e779c94a | 8adca8f049c8bc9494fedc57aa5aea09e77d3ffa | /jdbc_TemplateDemo/src/main/java/com/myCompany/jdbc_templateDemo_Dao/CustomerService.java | 5312c007e2d7192f52b5ba4d26c8a4eeb5a49659 | [] | no_license | dhiraj515151/Core_java_Training | 9406c315f59f7c2f3f4319b18c439cd819c92a11 | 76fa6738dbd6da0f80bce9f7d7d179d9b7a9bb77 | refs/heads/master | 2022-12-22T08:32:17.776099 | 2020-03-14T12:13:17 | 2020-03-14T12:13:17 | 232,235,581 | 0 | 0 | null | 2022-12-16T15:24:28 | 2020-01-07T03:34:06 | Java | UTF-8 | Java | false | false | 389 | java | package com.myCompany.jdbc_templateDemo_Dao;
import java.sql.SQLException;
import java.util.List;
import com.myCompany.jdbc_templateDemo_Example.Customer;
public interface CustomerService {
public Customer createCustomer(Customer customer) throws SQLException, Exception;
public List<Customer> getAllCustomers()throws SQLException;
public List<Customer> getCustomerById();
} | [
"Alchemy@192.168.1.189"
] | Alchemy@192.168.1.189 |
7abf0db6f55fdab31c92cc30218c873b3bc05646 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/34/34_8b737ef33fd5214c9b5f5839f53aee19668371d9/MusicIndexService/34_8b737ef33fd5214c9b5f5839f53aee19668371d9_MusicIndexService_t.java | d753d10569ca31f102a34070c264ea9afeb958ca | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,724 | java | package net.sourceforge.subsonic.service;
import net.sourceforge.subsonic.domain.MusicFile;
import net.sourceforge.subsonic.domain.MusicFolder;
import net.sourceforge.subsonic.domain.MusicIndex;
import net.sourceforge.subsonic.domain.MusicIndex.Artist;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
/**
* Provides services for grouping artists by index.
*
* @author Sindre Mehus
*/
public class MusicIndexService {
private SettingsService settingsService;
private MusicFileService musicFileService;
/**
* Returns a map from music indexes to sets of artists that are direct children of the given music folders.
*
* @param folders The music folders.
* @return A map from music indexes to sets of artists that are direct children of this music file.
* @throws IOException If an I/O error occurs.
*/
public SortedMap<MusicIndex, SortedSet<Artist>> getIndexedArtists(MusicFolder[] folders) throws IOException {
String[] ignoredArticles = settingsService.getIgnoredArticlesAsArray();
String[] shortcuts = settingsService.getShortcutsAsArray();
final List<MusicIndex> indexes = createIndexesFromExpression(settingsService.getIndexString());
Comparator<MusicIndex> indexComparator = new Comparator<MusicIndex>() {
public int compare(MusicIndex a, MusicIndex b) {
int indexA = indexes.indexOf(a);
int indexB = indexes.indexOf(b);
if (indexA == -1) {
indexA = Integer.MAX_VALUE;
}
if (indexB == -1) {
indexB = Integer.MAX_VALUE;
}
if (indexA < indexB) {
return -1;
}
if (indexA > indexB) {
return 1;
}
return 0;
}
};
SortedSet<Artist> artists = createArtists(folders, ignoredArticles, shortcuts);
SortedMap<MusicIndex, SortedSet<Artist>> result = new TreeMap<MusicIndex, SortedSet<Artist>>(indexComparator);
for (Artist artist : artists) {
MusicIndex index = getIndex(artist, indexes);
SortedSet<Artist> artistSet = result.get(index);
if (artistSet == null) {
artistSet = new TreeSet<Artist>();
result.put(index, artistSet);
}
artistSet.add(artist);
}
return result;
}
/**
* Creates a new instance by parsing the given expression. The expression consists of an index name, followed by
* an optional list of one-character prefixes. For example:<p/>
* <p/>
* The expression <em>"A"</em> will create the index <em>"A" -> ["A"]</em><br/>
* The expression <em>"The"</em> will create the index <em>"The" -> ["The"]</em><br/>
* The expression <em>"A(AÅÆ)"</em> will create the index <em>"A" -> ["A", "Å", "Æ"]</em><br/>
* The expression <em>"X-Z(XYZ)"</em> will create the index <em>"X-Z" -> ["X", "Y", "Z"]</em>
*
* @param expr The expression to parse.
* @return A new instance.
*/
protected MusicIndex createIndexFromExpression(String expr) {
int separatorIndex = expr.indexOf('(');
if (separatorIndex == -1) {
MusicIndex index = new MusicIndex(expr);
index.addPrefix(expr);
return index;
}
MusicIndex index = new MusicIndex(expr.substring(0, separatorIndex));
String prefixString = expr.substring(separatorIndex + 1, expr.length() - 1);
for (int i = 0; i < prefixString.length(); i++) {
index.addPrefix(prefixString.substring(i, i + 1));
}
return index;
}
/**
* Creates a list of music indexes by parsing the given expression. The expression is a space-separated list of
* sub-expressions, for which the rules described in {@link #createIndexFromExpression} apply.
*
* @param expr The expression to parse.
* @return A list of music indexes.
*/
protected List<MusicIndex> createIndexesFromExpression(String expr) {
List<MusicIndex> result = new ArrayList<MusicIndex>();
StringTokenizer tokenizer = new StringTokenizer(expr, " ");
while (tokenizer.hasMoreTokens()) {
MusicIndex index = createIndexFromExpression(tokenizer.nextToken());
result.add(index);
}
return result;
}
private SortedSet<Artist> createArtists(MusicFolder[] folders, String[] ignoredArticles,
String[] shortcuts) throws IOException {
SortedMap<String, Artist> artistMap = new TreeMap<String, Artist>();
Set<String> shortcutSet = new HashSet<String>(Arrays.asList(shortcuts));
for (MusicFolder folder : folders) {
MusicFile parent = musicFileService.getMusicFile(folder.getPath());
List<MusicFile> children = musicFileService.getChildDirectories(parent);
for (MusicFile child : children) {
if (shortcutSet.contains(child.getName()) || !child.isDirectory()) {
continue;
}
String sortableName = createSortableName(child.getName(), ignoredArticles);
Artist artist = artistMap.get(sortableName);
if (artist == null) {
artist = new Artist(child.getName(), sortableName);
artistMap.put(sortableName, artist);
}
artist.addMusicFile(child);
}
}
return new TreeSet<Artist>(artistMap.values());
}
private String createSortableName(String name, String[] ignoredArticles) {
String uppercaseName = name.toUpperCase();
for (String article : ignoredArticles) {
if (uppercaseName.startsWith(article.toUpperCase() + " ")) {
return name.substring(article.length() + 1) + ", " + article;
}
}
return name;
}
/**
* Returns the music index to which the given artist belongs.
*
* @param artist The artist in question.
* @param indexes List of available indexes.
* @return The music index to which this music file belongs, or {@link MusicIndex#OTHER} if no index applies.
*/
private MusicIndex getIndex(Artist artist, List<MusicIndex> indexes) {
String sortableName = artist.getSortableName().toUpperCase();
for (MusicIndex index : indexes) {
for (String prefix : index.getPrefixes()) {
if (sortableName.startsWith(prefix.toUpperCase())) {
return index;
}
}
}
return MusicIndex.OTHER;
}
public void setSettingsService(SettingsService settingsService) {
this.settingsService = settingsService;
}
public void setMusicFileService(MusicFileService musicFileService) {
this.musicFileService = musicFileService;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
06f3481dd993bd7f1333978afca9ab25d0545653 | 310df228e824cc30b3d6536706d2ae571947e746 | /custom-spring-boot-starter/src/main/java/com/mycompany/myframework/service/security/servlet/HeaderUserDetailsService.java | 3bd05b749abdd4577eb176ea465802db27f925c1 | [] | no_license | mfeyabat/spring-boot-custom-starter-demo | 91bcf47c66bf5751b768d119d9913ae76b533498 | 175eaad8b4642fee52a0185ef9407d97974a4c22 | refs/heads/master | 2022-04-13T23:03:49.228697 | 2019-10-04T19:35:14 | 2019-10-04T19:35:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,174 | java | package com.mycompany.myframework.service.security.servlet;
import java.util.Optional;
import org.apache.commons.lang3.StringUtils;
import org.springframework.lang.Nullable;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
public class HeaderUserDetailsService implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(@Nullable String username) throws UsernameNotFoundException {
return Optional.ofNullable(username)
.map(StringUtils::trimToNull)
.filter(user -> StringUtils.equals(user, "user1"))
.map(this::createUserDetails)
.orElseThrow(() -> new UsernameNotFoundException(String.format("User %s is not a valid user", username)));
}
private UserDetails createUserDetails(String username) {
return User.withUsername(username)
.accountExpired(false)
.accountLocked(false)
.credentialsExpired(false)
.disabled(false)
.password("n/a")
.authorities("ROLE_USER")
.build();
}
}
| [
"eric.deandrea@gmail.com"
] | eric.deandrea@gmail.com |
84d607d7f955513df4ffb34d3ea9cc74d9fe9ae3 | 587a6c7239df806be26f2d94096cf9e4b3d435b0 | /src/main/java/com/resolution/config/DispatcherServlet.java | 1a165aa9f547b4682eb5e236d3ec6d02b08f584a | [] | no_license | maxim-grinchenko/resolution_spring | 2ea44bfdd8df79b2853e2371d07409afd1654b8a | 4690079a988d71d6ad4db1c1277c6904aab6f906 | refs/heads/master | 2022-12-23T08:02:16.193388 | 2019-07-17T06:24:47 | 2019-07-17T06:24:47 | 135,448,673 | 0 | 0 | null | 2022-12-15T23:26:36 | 2018-05-30T13:42:41 | Java | UTF-8 | Java | false | false | 554 | java | package com.resolution.config;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class DispatcherServlet extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class<?>[]{AppConfig.class};
}
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class<?>[0];
}
@Override
protected String[] getServletMappings() {
return new String[]{"/"};
}
} | [
"mks.grinchenko@gmail.com"
] | mks.grinchenko@gmail.com |
82d199ba39cd2a03a7d9fe40103a8ee7e33b2c35 | 0ff96de71930955254ff4f0e0a1e2917597bc691 | /src/by/dimalix92/book2/task9_2/JAXB.java | 8a7409e32cdf18ffa5c99bcbb913c95f8bfbdb51 | [] | no_license | Staller92/PVT-Java-JD1-2017 | c09b2cf0ffa70172f0f6b8256174b4794f31e20f | bdfde2e1fcfcdea9d3b8b1f246456f15f004b9fe | refs/heads/master | 2021-06-27T06:01:26.498125 | 2017-09-17T16:50:45 | 2017-09-17T16:50:45 | 103,699,887 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,358 | java | package by.dimalix92.book2.task9_2;
import by.dimalix92.book2.task9_1.generated.Points;
import by.dimalix92.book2.task9_1.generated.PointsList;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
/**
* Created by LIKHTAROVICH on 05.09.2017.
* Java to XML, XML to Java (Marshalling and Unmarshalling)
*/
public class JAXB {
public static void main(String[] args) {
// Save objects to XML
marshal("D:\\My tasks\\Java\\PVT\\src\\by\\dimalix92\\book2\\task9_2\\points.xml");
unmarshal("D:\\My tasks\\Java\\PVT\\src\\by\\dimalix92\\book2\\task9_2\\points.xml");
}
public static void marshal(String fileName) {
Points point1 = new Points();
point1.setX(10);
point1.setY(2);
Points point2 = new Points();
point2.setX(10);
point2.setY(200);
PointsList pointsList = new PointsList();
pointsList.point.add(point1);
pointsList.point.add(point2);
try {
JAXBContext jaxbContext = JAXBContext.newInstance(PointsList.class);
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
FileOutputStream fos = new FileOutputStream(fileName);
marshaller.marshal(pointsList, fos);
} catch (JAXBException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
public static void unmarshal(String fileName) {
try {
JAXBContext jaxbContext = JAXBContext.newInstance(PointsList.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
PointsList pointsList = (PointsList) unmarshaller.unmarshal(new FileInputStream(fileName));
System.out.println(pointsList.getPoint().get(0).getX());
System.out.println(pointsList.getPoint().get(0).getY());
System.out.println(pointsList.getPoint().get(1).getX());
System.out.println(pointsList.getPoint().get(1).getY());
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"dimalix92@gmail.com"
] | dimalix92@gmail.com |
048d13516e34a18e11a219ae57b05ddecc0b6bd5 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/7/7_55725615a67d8cf19723f1b79d657c9b62b0dc5b/AbyssalCharacterModule/7_55725615a67d8cf19723f1b79d657c9b62b0dc5b_AbyssalCharacterModule_s.java | d28add5d3c609c0696f1636700a831b181d1ff33 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,975 | java | package net.sf.anathema.character.abyssal;
import net.sf.anathema.character.abyssal.caste.AbyssalCaste;
import net.sf.anathema.character.abyssal.resonance.AbyssalResonanceModelFactory;
import net.sf.anathema.character.abyssal.resonance.AbyssalResonanceParser;
import net.sf.anathema.character.abyssal.resonance.AbyssalResonancePersisterFactory;
import net.sf.anathema.character.abyssal.resonance.AbyssalResonanceTemplate;
import net.sf.anathema.character.abyssal.resonance.AbyssalResonanceViewFactory;
import net.sf.anathema.character.generic.backgrounds.IBackgroundTemplate;
import net.sf.anathema.character.generic.framework.ICharacterGenerics;
import net.sf.anathema.character.generic.framework.additionaltemplate.IAdditionalViewFactory;
import net.sf.anathema.character.generic.framework.additionaltemplate.model.IAdditionalModelFactory;
import net.sf.anathema.character.generic.framework.additionaltemplate.persistence.IAdditionalPersisterFactory;
import net.sf.anathema.character.generic.framework.module.CharacterModule;
import net.sf.anathema.character.generic.framework.module.NullObjectCharacterModuleAdapter;
import net.sf.anathema.character.generic.impl.backgrounds.CharacterTypeBackgroundTemplate;
import net.sf.anathema.character.generic.impl.backgrounds.TemplateTypeBackgroundTemplate;
import net.sf.anathema.character.generic.impl.caste.CasteCollection;
import net.sf.anathema.character.generic.template.TemplateType;
import net.sf.anathema.lib.registry.IIdentificateRegistry;
import net.sf.anathema.lib.registry.IRegistry;
import net.sf.anathema.lib.util.Identificate;
import static net.sf.anathema.character.generic.type.CharacterType.ABYSSAL;
@CharacterModule
public class AbyssalCharacterModule extends NullObjectCharacterModuleAdapter {
@SuppressWarnings("unused")
private static final TemplateType abyssalTemplateType = new TemplateType(ABYSSAL);
private static final TemplateType loyalAbyssalTemplateType = new TemplateType(ABYSSAL,
new Identificate("default")); //$NON-NLS-1$
@SuppressWarnings("unused")
private static final TemplateType renegadeAbyssalTemplateType = new TemplateType(ABYSSAL,
new Identificate("RenegadeAbyssal")); //$NON-NLS-1$
@SuppressWarnings("unused")
public static final String BACKGROUND_ID_ABYSSAL_COMMAND = "AbyssalCommand"; //$NON-NLS-1$
public static final String BACKGROUND_ID_LIEGE = "Liege"; //$NON-NLS-1$
public static final String BACKGROUND_ID_SPIES = "Spies"; //$NON-NLS-1$
public static final String BACKGROUND_ID_UNDERWORLD_MANSE = "UnderworldManse"; //$NON-NLS-1$
public static final String BACKGROUND_ID_WHISPERS = "Whispers"; //$NON-NLS-1$
@Override
public void registerCommonData(ICharacterGenerics characterGenerics) {
characterGenerics.getAdditionalTemplateParserRegistry().register(AbyssalResonanceTemplate.ID,
new AbyssalResonanceParser());
characterGenerics.getCasteCollectionRegistry().register(ABYSSAL, new CasteCollection(AbyssalCaste.values()));
}
@Override
public void addCharacterTemplates(ICharacterGenerics characterGenerics) {
registerParsedTemplate(characterGenerics, "template/LoyalAbyssal2nd.template", "moep_Abyssals_"); //$NON-NLS-1$
registerParsedTemplate(characterGenerics, "template/RenegadeAbyssal2nd.template", "moep_Abyssals_"); //$NON-NLS-1$
}
@Override
public void addBackgroundTemplates(ICharacterGenerics generics) {
IIdentificateRegistry<IBackgroundTemplate> backgroundRegistry = generics.getBackgroundRegistry();
backgroundRegistry.add(new CharacterTypeBackgroundTemplate(BACKGROUND_ID_ABYSSAL_COMMAND, loyalAbyssalTemplateType));
backgroundRegistry.add(new TemplateTypeBackgroundTemplate(BACKGROUND_ID_LIEGE, loyalAbyssalTemplateType));
backgroundRegistry.add(new CharacterTypeBackgroundTemplate(BACKGROUND_ID_SPIES, loyalAbyssalTemplateType));
backgroundRegistry.add(new CharacterTypeBackgroundTemplate(BACKGROUND_ID_UNDERWORLD_MANSE, loyalAbyssalTemplateType));
backgroundRegistry.add(new CharacterTypeBackgroundTemplate(BACKGROUND_ID_WHISPERS, ABYSSAL));
}
@Override
public void addAdditionalTemplateData(ICharacterGenerics characterGenerics) {
IRegistry<String, IAdditionalModelFactory> additionalModelFactoryRegistry = characterGenerics.getAdditionalModelFactoryRegistry();
String templateId = AbyssalResonanceTemplate.ID;
additionalModelFactoryRegistry.register(templateId, new AbyssalResonanceModelFactory());
IRegistry<String, IAdditionalViewFactory> additionalViewFactoryRegistry = characterGenerics.getAdditionalViewFactoryRegistry();
additionalViewFactoryRegistry.register(templateId, new AbyssalResonanceViewFactory());
IRegistry<String, IAdditionalPersisterFactory> persisterFactory = characterGenerics.getAdditonalPersisterFactoryRegistry();
persisterFactory.register(templateId, new AbyssalResonancePersisterFactory());
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
b2b5280160d78176c3506ca4cdee6d4d86e26b1c | f7da203780fa15df1ad33bc4be37ddf52ebd3070 | /FootballScores/app/src/main/java/barqsoft/footballscores/service/myFetchService.java | ae289ca1c3f1b6f05169fdc045117a6320ac5cb2 | [] | no_license | PedramVeisi/SuperDuo | b5de59a37f13ff94337261b0a300575b3b201a85 | a1d8590f634763ed749edb01c4eabf543a745b1c | refs/heads/master | 2021-01-10T16:03:16.638136 | 2016-03-09T02:23:11 | 2016-03-09T02:23:11 | 43,734,472 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,823 | java | package barqsoft.footballscores.service;
import android.app.IntentService;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import java.util.Vector;
import barqsoft.footballscores.DatabaseContract;
import barqsoft.footballscores.R;
/**
* Created by yehya khaled on 3/2/2015.
*/
public class myFetchService extends IntentService
{
public static final String LOG_TAG = "myFetchService";
public myFetchService()
{
super("myFetchService");
}
@Override
protected void onHandleIntent(Intent intent)
{
getData("n2");
getData("p2");
return;
}
private void getData (String timeFrame)
{
//Creating fetch URL
final String BASE_URL = "http://api.football-data.org/alpha/fixtures"; //Base URL
final String QUERY_TIME_FRAME = "timeFrame"; //Time Frame parameter to determine days
//final String QUERY_MATCH_DAY = "matchday";
Uri fetch_build = Uri.parse(BASE_URL).buildUpon().
appendQueryParameter(QUERY_TIME_FRAME, timeFrame).build();
//Log.v(LOG_TAG, "The url we are looking at is: "+fetch_build.toString()); //log spam
HttpURLConnection m_connection = null;
BufferedReader reader = null;
String JSON_data = null;
//Opening Connection
try {
URL fetch = new URL(fetch_build.toString());
m_connection = (HttpURLConnection) fetch.openConnection();
m_connection.setRequestMethod("GET");
m_connection.addRequestProperty("X-Auth-Token",getString(R.string.api_key));
m_connection.connect();
// Read the input stream into a String
InputStream inputStream = m_connection.getInputStream();
StringBuffer buffer = new StringBuffer();
if (inputStream == null) {
// Nothing to do.
return;
}
reader = new BufferedReader(new InputStreamReader(inputStream));
String line;
while ((line = reader.readLine()) != null) {
// Since it's JSON, adding a newline isn't necessary (it won't affect parsing)
// But it does make debugging a *lot* easier if you print out the completed
// buffer for debugging.
buffer.append(line + "\n");
}
if (buffer.length() == 0) {
// Stream was empty. No point in parsing.
return;
}
JSON_data = buffer.toString();
}
catch (Exception e)
{
Log.e(LOG_TAG,"Exception here" + e.getMessage());
}
finally {
if(m_connection != null)
{
m_connection.disconnect();
}
if (reader != null)
{
try {
reader.close();
}
catch (IOException e)
{
Log.e(LOG_TAG,"Error Closing Stream");
}
}
}
try {
if (JSON_data != null) {
//This bit is to check if the data contains any matches. If not, we call processJson on the dummy data
JSONArray matches = new JSONObject(JSON_data).getJSONArray("fixtures");
if (matches.length() == 0) {
//if there is no data, call the function on dummy data
//this is expected behavior during the off season.
processJSONdata(getString(R.string.dummy_data), getApplicationContext(), false);
return;
}
processJSONdata(JSON_data, getApplicationContext(), true);
} else {
//Could not Connect
Log.d(LOG_TAG, "Could not connect to server.");
}
}
catch(Exception e)
{
Log.e(LOG_TAG,e.getMessage());
}
}
private void processJSONdata (String JSONdata,Context mContext, boolean isReal)
{
//JSON data
// This set of league codes is for the 2015/2016 season. In fall of 2016, they will need to
// be updated. Feel free to use the codes
final String BUNDESLIGA1 = "394";
final String BUNDESLIGA2 = "395";
final String LIGUE1 = "396";
final String LIGUE2 = "397";
final String PREMIER_LEAGUE = "398";
final String PRIMERA_DIVISION = "399";
final String SEGUNDA_DIVISION = "400";
final String SERIE_A = "401";
final String PRIMERA_LIGA = "402";
final String Bundesliga3 = "403";
final String EREDIVISIE = "404";
final String SEASON_LINK = "http://api.football-data.org/alpha/soccerseasons/";
final String MATCH_LINK = "http://api.football-data.org/alpha/fixtures/";
final String FIXTURES = "fixtures";
final String LINKS = "_links";
final String SOCCER_SEASON = "soccerseason";
final String SELF = "self";
final String MATCH_DATE = "date";
final String HOME_TEAM = "homeTeamName";
final String AWAY_TEAM = "awayTeamName";
final String RESULT = "result";
final String HOME_GOALS = "goalsHomeTeam";
final String AWAY_GOALS = "goalsAwayTeam";
final String MATCH_DAY = "matchday";
//Match data
String League = null;
String mDate = null;
String mTime = null;
String Home = null;
String Away = null;
String Home_goals = null;
String Away_goals = null;
String match_id = null;
String match_day = null;
try {
JSONArray matches = new JSONObject(JSONdata).getJSONArray(FIXTURES);
//ContentValues to be inserted
Vector<ContentValues> values = new Vector <ContentValues> (matches.length());
for(int i = 0;i < matches.length();i++)
{
JSONObject match_data = matches.getJSONObject(i);
League = match_data.getJSONObject(LINKS).getJSONObject(SOCCER_SEASON).
getString("href");
League = League.replace(SEASON_LINK,"");
//This if statement controls which leagues we're interested in the data from.
//add leagues here in order to have them be added to the DB.
// If you are finding no data in the app, check that this contains all the leagues.
// If it doesn't, that can cause an empty DB, bypassing the dummy data routine.
if( League.equals(PREMIER_LEAGUE) ||
League.equals(SERIE_A) ||
League.equals(BUNDESLIGA1) ||
League.equals(BUNDESLIGA2) ||
League.equals(PRIMERA_DIVISION) ||
League.equals(LIGUE1) ||
League.equals(LIGUE2) ||
League.equals(SEGUNDA_DIVISION) ||
League.equals(PRIMERA_LIGA) ||
League.equals(Bundesliga3) ||
League.equals(EREDIVISIE)
)
{
match_id = match_data.getJSONObject(LINKS).getJSONObject(SELF).
getString("href");
match_id = match_id.replace(MATCH_LINK, "");
if(!isReal){
//This if statement changes the match ID of the dummy data so that it all goes into the database
match_id=match_id+Integer.toString(i);
}
mDate = match_data.getString(MATCH_DATE);
mTime = mDate.substring(mDate.indexOf("T") + 1, mDate.indexOf("Z"));
mDate = mDate.substring(0,mDate.indexOf("T"));
SimpleDateFormat match_date = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
match_date.setTimeZone(TimeZone.getTimeZone("UTC"));
try {
Date parseddate = match_date.parse(mDate+mTime);
SimpleDateFormat new_date = new SimpleDateFormat("yyyy-MM-dd:HH:mm");
new_date.setTimeZone(TimeZone.getDefault());
mDate = new_date.format(parseddate);
mTime = mDate.substring(mDate.indexOf(":") + 1);
mDate = mDate.substring(0,mDate.indexOf(":"));
if(!isReal){
//This if statement changes the dummy data's date to match our current date range.
Date fragmentdate = new Date(System.currentTimeMillis()+((i-2)*86400000));
SimpleDateFormat mformat = new SimpleDateFormat("yyyy-MM-dd");
mDate=mformat.format(fragmentdate);
}
}
catch (Exception e)
{
Log.d(LOG_TAG, "error here!");
Log.e(LOG_TAG,e.getMessage());
}
Home = match_data.getString(HOME_TEAM);
Away = match_data.getString(AWAY_TEAM);
Home_goals = match_data.getJSONObject(RESULT).getString(HOME_GOALS);
Away_goals = match_data.getJSONObject(RESULT).getString(AWAY_GOALS);
match_day = match_data.getString(MATCH_DAY);
ContentValues match_values = new ContentValues();
match_values.put(DatabaseContract.scores_table.MATCH_ID,match_id);
match_values.put(DatabaseContract.scores_table.DATE_COL,mDate);
match_values.put(DatabaseContract.scores_table.TIME_COL,mTime);
match_values.put(DatabaseContract.scores_table.HOME_COL,Home);
match_values.put(DatabaseContract.scores_table.AWAY_COL,Away);
match_values.put(DatabaseContract.scores_table.HOME_GOALS_COL,Home_goals);
match_values.put(DatabaseContract.scores_table.AWAY_GOALS_COL,Away_goals);
match_values.put(DatabaseContract.scores_table.LEAGUE_COL,League);
match_values.put(DatabaseContract.scores_table.MATCH_DAY,match_day);
//log spam
//Log.v(LOG_TAG,match_id);
//Log.v(LOG_TAG,mDate);
//Log.v(LOG_TAG,mTime);
//Log.v(LOG_TAG,Home);
//Log.v(LOG_TAG,Away);
//Log.v(LOG_TAG,Home_goals);
//Log.v(LOG_TAG,Away_goals);
values.add(match_values);
}
}
int inserted_data = 0;
ContentValues[] insert_data = new ContentValues[values.size()];
values.toArray(insert_data);
inserted_data = mContext.getContentResolver().bulkInsert(
DatabaseContract.BASE_CONTENT_URI,insert_data);
//Log.v(LOG_TAG,"Succesfully Inserted : " + String.valueOf(inserted_data));
}
catch (JSONException e)
{
Log.e(LOG_TAG,e.getMessage());
}
}
}
| [
"pedramveisi@gmail.com"
] | pedramveisi@gmail.com |
3ff8be7f256273fa807ae42271d173cb5b5eb26a | 66c5c1d6df3cfd393a484ab041f56fe221723c7e | /src/main/java/com/lin/domain/User.java | a92f7a55a4c9fe3e39ff639f04cc16565f50de5d | [] | no_license | taz372436/ssm_shiro | 914625ff8b7bcc0ef10db271c26a0053acc36371 | b5857e9b2d0d6021a12853e5adf6c5a1ffce20fe | refs/heads/master | 2021-01-22T22:57:33.198852 | 2017-09-05T02:13:13 | 2017-09-05T02:13:13 | 102,422,362 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,070 | java | package com.lin.domain;
import java.util.Date;
public class User {
private Integer id;
private String name;
private Integer age;
private Date birthday;
private String password;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public String toString() {
return this.name + ", " + this.age + ", " + this.birthday + ", " + this.password;
}
} | [
"821252358@qq.com"
] | 821252358@qq.com |
89c303c68c59a945360240e1dfd9f07a387819fa | 02abd68504bb65757666b7b5a6575aca47b25b0e | /Code/PrototipoDeCarnetDigital/src/prototipodecarnetdigital/controller/EstudianteController.java | 117dff4b83f75c060e41a65321397078e45d0a13 | [] | no_license | edisonjt/G5_3594_MET_DES_SW_202150 | 40d69332f018aff0ed678e9a0fd4ecc1068ca2d2 | 4ae679d7348e1ec2cde2a41bf1828f6d9e9fef01 | refs/heads/main | 2023-07-21T20:24:00.695782 | 2021-09-07T07:02:29 | 2021-09-07T07:02:29 | 403,866,242 | 0 | 0 | null | 2021-09-07T06:27:15 | 2021-09-07T06:27:14 | null | UTF-8 | Java | false | false | 785 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package prototipodecarnetdigital.controller;
import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
/**
*
* @author BryanPC
*/
public class EstudianteController {
BasicDBObject document = new BasicDBObject();
public DBObject request(String name, String id, String correo, String career, String address, String age) {
document.put("Name", name);
document.put("ID", id);
document.put("Correo", correo);
document.put("Career", career);
document.put("Address", address);
document.put("Age", age);
return document;
}
}
| [
"75285255+bryalex98@users.noreply.github.com"
] | 75285255+bryalex98@users.noreply.github.com |
8c688157e449ba5da271b8c5099e5d8c7c12eaa3 | a1f6786f150ae75cf9bbdcd177d2a2ae60718a8f | /src/main/java/com/alipay/simplehbase/client/service/HbaseRawService.java | fb6dfa9cf93919156dc9748cc047ab7d6112b09c | [] | no_license | lmy86263/simplehbase | a52b5254cba2e659f137a2d69f71ba54908f1803 | 34746d4d28bb5cbf65e2c2109483d80be4955b71 | refs/heads/master | 2020-03-26T10:10:58.707184 | 2018-08-15T02:03:44 | 2018-08-15T02:03:44 | 144,785,088 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 564 | java | package com.alipay.simplehbase.client.service;
import java.util.List;
import com.alipay.simplehbase.client.SimpleHbaseCellResult;
/**
* HbaseRawService.
*
* <pre>
* Provides hbase raw service.
* </pre>
*
* @author xinzhi.zhang
* */
public interface HbaseRawService {
/**
* put data.
* */
public void put(String hql);
/**
* select data.
* */
public List<List<SimpleHbaseCellResult>> select(String hql);
/**
* delete data.
* */
public void delete(String hql);
}
| [
"xinzhi.zhang@alipay.com"
] | xinzhi.zhang@alipay.com |
01400c68e73aedbb2d00ea0caa6a6a023ca03ad8 | f876839d72c4469b9bf3768ea45b96be1735a8e3 | /GoogleTest/main/test/com/package_Selenium_Basic_Test_Servlet/Selenium_Basic_Test.java | f34bc7023e9b1baffdd7dfe55bc82d747e603a07 | [] | no_license | jkavita77/PerScholasQE | 16723a20627a4b48a8013c74dee45acb20c21d09 | 948bada4211eedf6911b89815d62ebbc1718bf3c | refs/heads/master | 2020-09-12T19:43:21.180771 | 2019-11-18T19:53:23 | 2019-11-18T19:53:23 | 222,530,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 88 | java | package com.package_Selenium_Basic_Test_Servlet;
public class Selenium_Basic_Test {
}
| [
"jkavita77@gmail.com"
] | jkavita77@gmail.com |
bc189a6c34558688730f4465a16c1331b85d6dcc | e16189135e4a6725f32b7ccf2bd1766c122b84ec | /Java22.02/TabliczkaMnozenia.java | 36fd2c81ef6b13e22035e38f2a67fa80e6c7f975 | [] | no_license | kowal16/Java | 4c1a7541edb88c96fdeb0cc38136a4897bab2490 | 947a4417a2e00b64af2b09af9c2dad1efed2f8fa | refs/heads/master | 2021-01-20T16:56:00.485441 | 2017-05-08T08:33:49 | 2017-05-08T08:33:49 | 82,807,006 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 369 | java | class TabliczkaMnozenia{
public static void main(String[] args) {
int n = Integer.parseInt(args[0]);
for(int i=1; i<=n; i++){
for(int j=1;j<=n; j++){
System.out.print(i*j+"\t");
}
System.out.println();
}
for(int i=1; i<=n; i++){
for(int j=1;j<=n; j++){
System.out.print(i+"*"+j+"="+i*j+"\t");
}
System.out.println();
}
}
}
| [
"kowal160395@gmail.com"
] | kowal160395@gmail.com |
a7395b255878df8d36eb16db9562b96a11c79826 | 4f52c9889f8b9e50bc077131c5f4dd62c844285d | /plugin/src/main/groovy/heavy/test/plugin/model/wrapper/testable/TestableWrapper.java | dcc4fb3883dedb288bd66463bca738b4f0b56cb4 | [
"Apache-2.0"
] | permissive | heavy-james/AndroidTestPlugin | 1915a2aa0b16786b0b922df9fb63e64dbdeca5fd | 86ddaf2221a8898ee35b9f06d6670ba1783b6c66 | refs/heads/master | 2021-05-02T12:06:35.476253 | 2018-02-25T06:40:53 | 2018-02-25T06:40:53 | 120,736,709 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,487 | java | package heavy.test.plugin.model.wrapper.testable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import groovy.lang.Closure;
import heavy.test.plugin.model.data.Action;
import heavy.test.plugin.model.data.TestBlock;
import heavy.test.plugin.model.data.TestContext;
import heavy.test.plugin.model.data.TestObject;
import heavy.test.plugin.model.data.Testable;
import heavy.test.plugin.model.data.testable.global.ConditionedTestable;
import heavy.test.plugin.model.data.testable.global.Delay;
import heavy.test.plugin.model.data.testable.global.MakeToast;
import heavy.test.plugin.model.data.testable.global.SendMessage;
import heavy.test.plugin.model.data.testable.global.StopTest;
import heavy.test.plugin.model.data.testable.global.ThrowException;
import heavy.test.plugin.model.data.testable.view.TestableAdapterView;
import heavy.test.plugin.model.data.testable.view.TestableRecyclerView;
import heavy.test.plugin.model.data.testable.view.TestableView;
import heavy.test.plugin.model.wrapper.ContextWrapper;
import heavy.test.plugin.model.wrapper.TestObjectWrapper;
import heavy.test.plugin.model.wrapper.action.ActionWrapper;
import heavy.test.plugin.model.wrapper.interf.IKeyEventWrapper;
import heavy.test.plugin.model.wrapper.interf.ITestableWrapper;
import heavy.test.plugin.model.wrapper.testable.global.ConditionedTestableWrapper;
import heavy.test.plugin.model.wrapper.testable.view.TestableAdapterViewWrapper;
import heavy.test.plugin.model.wrapper.testable.view.TestableRecyclerViewWrapper;
import heavy.test.plugin.model.wrapper.testable.view.TestableViewWrapper;
import heavy.test.plugin.util.TextUtil;
/**
* Created by heavy on 2017/5/31.
*/
public class TestableWrapper extends TestObjectWrapper implements ITestableWrapper, IKeyEventWrapper {
public static final String TAG = "TestableWrapper";
private static List<TestContext> savedTestContexts = new ArrayList<>();
private static Map<String, TestObject> cachedVars = new HashMap<>();
public TestableWrapper(TestContext testContext, TestObject testObject) {
super(testContext, testObject);
}
public static void defVar(String name, TestObject testObject) {
cachedVars.put(name, testObject);
}
public void context(Closure closure) {
ContextWrapper contextWrapper = new ContextWrapper(new TestContext());
closure.setDelegate(contextWrapper);
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.call();
savedTestContexts.add(contextWrapper.getTestContext());
}
public void useContext(String name) {
for (TestContext testContext : savedTestContexts) {
if (TextUtil.equals(testContext.getContextName(), name)) {
mTestContext.setParentTestContext(testContext);
}
}
}
public TestObject useVar(String name) {
return cachedVars.get(name);
}
@Override
public Testable withView(Closure closure) {
TestableViewWrapper wrapper = new TestableViewWrapper(new TestableView());
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.setDelegate(wrapper);
closure.call();
Testable testable = wrapper.getTestableView();
if (mTestObject != null) {
mTestObject.addContentObject(testable);
}
return testable;
}
@Override
public Testable withAdapterView(Closure closure) {
TestableAdapterViewWrapper wrapper = new TestableAdapterViewWrapper(new TestableAdapterView());
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.setDelegate(wrapper);
closure.call();
Testable testable = wrapper.getTestableView();
if (mTestObject != null) {
mTestObject.addContentObject(testable);
}
return testable;
}
@Override
public Testable withRecyclerView(Closure closure) {
TestableRecyclerViewWrapper wrapper = new TestableRecyclerViewWrapper(new TestableRecyclerView());
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.setDelegate(wrapper);
closure.call();
Testable testable = wrapper.getTestableView();
if (mTestObject != null) {
mTestObject.addContentObject(testable);
}
return testable;
}
@Override
public Testable addView(String name, Closure closure) {
TestableViewWrapper wrapper = new TestableViewWrapper(new TestableView());
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.setDelegate(wrapper);
closure.call();
Testable testable = wrapper.getTestableView();
if (mTestContext != null) {
mTestContext.addTestObject(name, testable);
}
return testable;
}
@Override
public Testable addAdapterView(String name, Closure closure) {
TestableAdapterViewWrapper wrapper = new TestableAdapterViewWrapper(new TestableAdapterView());
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.setDelegate(wrapper);
closure.call();
Testable testable = wrapper.getTestableView();
if (mTestContext != null) {
mTestContext.addTestObject(name, testable);
}
return testable;
}
@Override
public Testable addRecyclerView(String name, Closure closure) {
TestableRecyclerViewWrapper wrapper = new TestableRecyclerViewWrapper(new TestableRecyclerView());
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.setDelegate(wrapper);
closure.call();
Testable testable = wrapper.getTestableView();
if (mTestContext != null) {
mTestContext.addTestObject(name, testable);
}
return testable;
}
@Override
public Testable getAdapterView(String name, Closure closure) {
TestObject testObject = mTestContext.getTestObject(name).clean();
TestableAdapterView result = (TestableAdapterView) testObject;
closure.setDelegate(new TestableAdapterViewWrapper(result));
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.call();
if (mTestObject != null) {
mTestObject.addContentObject(result);
}
return result;
}
@Override
public Testable getRecyclerView(String name, Closure closure) {
TestObject testObject = mTestContext.getTestObject(name).clean();
TestableRecyclerView result = (TestableRecyclerView) testObject;
closure.setDelegate(new TestableAdapterViewWrapper(result));
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.call();
if (mTestObject != null) {
mTestObject.addContentObject(result);
}
return result;
}
@Override
public Testable getView(String name, Closure closure) {
TestObject testObject = mTestContext.getTestObject(name).clean();
TestableView result = (TestableView) testObject;
closure.setDelegate(new TestableViewWrapper(result));
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.call();
if (mTestObject != null) {
mTestObject.addContentObject(result);
}
return result;
}
@Override
public Testable makeToast(String msg, long time) {
Testable testable = new MakeToast(msg, time);
if (mTestObject != null) {
mTestObject.addContentObject(testable);
}
return testable;
}
@Override
public Testable makeToast(String msg) {
return makeToast(msg, 2000);
}
@Override
public Testable printMessage(String msg) {
Testable testable = new SendMessage(msg);
if (mTestObject != null) {
mTestObject.addContentObject(testable);
}
return testable;
}
@Override
public Testable stopTest(String msg) {
Testable testable = new StopTest(msg);
if (mTestObject != null) {
mTestObject.addContentObject(testable);
}
return testable;
}
@Override
public Testable throwException(String msg) {
Testable testable = new ThrowException(msg);
if (mTestObject != null) {
mTestObject.addContentObject(testable);
}
return testable;
}
@Override
public Testable delay(long time) {
Testable testable = new Delay(time);
if (mTestObject != null) {
mTestObject.addContentObject(testable);
}
return testable;
}
public TestObject doIf(Closure closure) {
ConditionedTestableWrapper wrapper = new ConditionedTestableWrapper(mTestContext, new ConditionedTestable(mTestContext));
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.setDelegate(wrapper);
closure.call();
TestObject testObject = wrapper.getConditionedTestable();
if (mTestObject != null) {
mTestObject.addContentObject(testObject);
}
return testObject;
}
public TestObject doIfNot(Closure closure) {
ConditionedTestable testable = (ConditionedTestable) doIf(closure);
testable.setConversed(true);
return testable;
}
public TestObject block(Closure closure) {
TestObject testObject = new TestBlock();
TestableWrapper testableWrapper = new TestableWrapper(mTestContext, testObject);
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
closure.setDelegate(testableWrapper);
closure.call();
if (mTestObject != null) {
mTestObject.addContentObject(testObject);
}
return testObject;
}
public TestObject waitUntil(Closure closure) {
return doIf(closure);
}
public TestObject getTestObject() {
return mTestObject;
}
@Override
public Action keyEvent(int keyCode, String eventAction) {
return new ActionWrapper(mTestObject).keyEvent(keyCode, eventAction);
}
@Override
public Action pressKey(int keyCode) {
return new ActionWrapper(mTestObject).pressKey(keyCode);
}
@Override
public Action pressBack() {
return new ActionWrapper(mTestObject).pressBack();
}
@Override
public Action pressMenu() {
return new ActionWrapper(mTestObject).pressMenu();
}
@Override
public Action pressDpadCenter() {
return new ActionWrapper(mTestObject).pressDpadCenter();
}
@Override
public Action pressDpadUp() {
return new ActionWrapper(mTestObject).pressDpadUp();
}
@Override
public Action pressDpadDown() {
return new ActionWrapper(mTestObject).pressDpadDown();
}
@Override
public Action pressDpadLeft() {
return new ActionWrapper(mTestObject).pressDpadLeft();
}
@Override
public Action pressDpadRight() {
return new ActionWrapper(mTestObject).pressDpadRight();
}
@Override
public Action pressVolumeDown() {
return new ActionWrapper(mTestObject).pressVolumeDown();
}
@Override
public Action pressHome() {
return new ActionWrapper(mTestObject).pressHome();
}
@Override
public Action pressPower() {
return new ActionWrapper(mTestObject).pressPower();
}
@Override
public Action pressVolumeUp() {
return new ActionWrapper(mTestObject).pressVolumeUp();
}
}
| [
"zhanhf@topband.com.cn"
] | zhanhf@topband.com.cn |
8465b07250eb39ad701536d094b94b10607cd76b | bf2739bdee52405cad9066a36009269a31dda9eb | /app/src/main/java/com/langham/chris/starships/adapter/PilotListAdapter.java | a1130fcf76feb00edb31264b806285032bc6f998 | [] | no_license | christopherLangham/viopmjsvoidjfvoi | d993a4e173814d1fd9d57261ecd092dcab755ce2 | 07523965bc29521f364bf417bc9b218a284695ba | refs/heads/master | 2020-04-03T04:10:28.354456 | 2018-10-01T05:06:20 | 2018-10-01T05:06:20 | 155,005,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,649 | java | package com.langham.chris.starships.adapter;
import android.databinding.DataBindingUtil;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.langham.chris.starships.R;
import com.langham.chris.starships.databinding.LineItemPilotBinding;
import com.langham.chris.starships.model.Person;
import java.util.List;
public class PilotListAdapter extends RecyclerView.Adapter<PilotViewHolder> {
private List<Person> pilotList;
private final PilotInfoListener pilotInfoListener;
public PilotListAdapter(final PilotInfoListener listener, final List<Person> pilotList) {
this.pilotInfoListener = listener;
this.pilotList = pilotList;
}
@NonNull
@Override
public PilotViewHolder onCreateViewHolder(@NonNull final ViewGroup parent, final int viewType) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
LineItemPilotBinding binding = DataBindingUtil.inflate(inflater, R.layout.line_item_pilot, parent, false);
return new PilotViewHolder(binding);
}
@Override
public void onBindViewHolder(@NonNull final PilotViewHolder holder, final int position) {
holder.setViewModel(pilotList.get(position));
holder.itemView.setOnClickListener(v -> pilotInfoListener.onShowPerson(pilotList.get(position)));
}
@Override
public int getItemCount() {
return pilotList.size();
}
public void setPilotList(final List<Person> pilotList) {
this.pilotList = pilotList;
notifyDataSetChanged();
}
}
| [
"chris.langham32@gmail.com"
] | chris.langham32@gmail.com |
55c7879ad6dcf7bbd5742ceabfbd854fd7201f9b | fb16b8dde007cc08ab34412cfab3a026a1f14b8d | /src/test/java/com/kondratev/LogStatisticsCollectorTest.java | ff19e06d696bf563469b88a692ea0c9ad85b80bb | [] | no_license | AlexJud/smartbics_HW | 7e7c0c31db98505370a792083c320dfa2d8a0ba7 | be579da7c709a48b7eb087f199ded621c462801f | refs/heads/master | 2023-01-09T09:46:39.825015 | 2020-11-07T18:53:25 | 2020-11-07T18:53:25 | 310,909,216 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,605 | java | package com.kondratev;
import com.kondratev.classifier.LogClassifiers;
import com.kondratev.logparser.SplittingLogParser;
import com.kondratev.model.LogEntry;
import com.kondratev.model.LogLevel;
import com.kondratev.reader.InputStreamReader;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
public class LogStatisticsCollectorTest {
private List<LogEntry> LOGS = Arrays.asList(LogEntry.builder().date(LocalDateTime.now()).level(LogLevel.INFO).message("Info").build(),
LogEntry.builder().date(LocalDateTime.now()).level(LogLevel.ERROR).message("Error").build(),
LogEntry.builder().date(LocalDateTime.now()).level(LogLevel.WARN).message("Warning").build());
@DataProvider(parallel = true)
public Object[][] logLevels() {
return new Object[][]{
{ createInputStreamFromLogList(LOGS), Stream.of(LogLevel.INFO).collect(Collectors.toCollection(HashSet::new)), 1 },
{ createInputStreamFromLogList(LOGS), Stream.of(LogLevel.ERROR).collect(Collectors.toCollection(HashSet::new)), 1 },
{ createInputStreamFromLogList(LOGS), Stream.of(LogLevel.WARN).collect(Collectors.toCollection(HashSet::new)), 1 },
{ createInputStreamFromLogList(LOGS), Stream.of(LogLevel.INFO, LogLevel.ERROR, LogLevel.WARN).collect(Collectors.toCollection(HashSet::new)), 3 }
};
}
@Test(dataProvider = "logLevels")
public void testCollectByLogLevel(InputStream inputStream, Set<LogLevel> levels, int expectedSize) throws Exception {
LogStatisticsCollector collector = new LogStatisticsCollector(new SplittingLogParser(), new InputStreamReader());
Map<LogLevel, Long> collectedLogs = collector.collect(inputStream, LogClassifiers.BY_LEVEL, logEntry -> levels.contains(logEntry.getLevel()));
assertThat(collectedLogs.size(), equalTo(expectedSize));
}
private InputStream createInputStreamFromLogList(List<LogEntry> logs) {
return new ByteArrayInputStream(logs.stream()
.map(LogEntry::toString)
.collect(Collectors.joining("\n"))
.getBytes());
}
} | [
"m.kondratev@inevstudio.com"
] | m.kondratev@inevstudio.com |
12e0536d93e8e99393d618555d5fb754642108e6 | 4940d7c91d73d9e5ba7e415c02e928eefd92fb5f | /src/net/fycraft/plugins/vip/api/pagseguro/service/SessionService.java | 7f0cad39bbf8623533467b7de87a7f22b7fe7b4f | [] | no_license | ohgosch/FyCraft_survival | 91146ca8819dea673d64e79c3ae2c111a62d5c40 | 1503df6fd5a036f91df0c910d72593ed223c0e97 | refs/heads/master | 2021-06-11T04:41:23.524385 | 2017-01-02T02:08:00 | 2017-01-02T02:08:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,828 | java | /*
************************************************************************
Copyright [2011] [PagSeguro Internet Ltda.]
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 net.fycraft.plugins.vip.api.pagseguro.service;
import java.net.HttpURLConnection;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import net.fycraft.plugins.vip.api.pagseguro.domain.Credentials;
import net.fycraft.plugins.vip.api.pagseguro.domain.Error;
import net.fycraft.plugins.vip.api.pagseguro.enums.HttpStatus;
import net.fycraft.plugins.vip.api.pagseguro.exception.PagSeguroServiceException;
import net.fycraft.plugins.vip.api.pagseguro.logs.Log;
import net.fycraft.plugins.vip.api.pagseguro.utils.HttpConnection;
import net.fycraft.plugins.vip.api.pagseguro.xmlparser.ErrorsParser;
import net.fycraft.plugins.vip.api.pagseguro.xmlparser.XMLParserUtils;
/**
* Class Session Service
*/
public class SessionService {
/**
* @var Log
*/
private static Log log = new Log(SessionService.class);
private static String buildSessionsRequestUrl(ConnectionData connectionData) //
throws PagSeguroServiceException {
return connectionData.getSessionsUrl();
}
public static String createSession(Credentials credentials) //
throws PagSeguroServiceException {
log.info("SessionService.createSession() - begin");
ConnectionData connectionData = new ConnectionData(credentials);
String url = SessionService.buildSessionsRequestUrl(connectionData);
HttpConnection connection = new HttpConnection();
HttpStatus httpCodeStatus = null;
HttpURLConnection response = connection.post(url, //
credentials.getAttributes(), //
connectionData.getServiceTimeout(), //
connectionData.getCharset(),
null);
try {
httpCodeStatus = HttpStatus.fromCode(response.getResponseCode());
if (httpCodeStatus == null) {
throw new PagSeguroServiceException("Connection Timeout");
} else if (HttpURLConnection.HTTP_OK == httpCodeStatus.getCode().intValue()) {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
InputSource inputSource = new InputSource(response.getInputStream());
Document document = documentBuilder.parse(inputSource);
Element element = document.getDocumentElement();
// setting <session><id>
String sessionId = XMLParserUtils.getTagValue("id", element);
log.info("SessionService.createSession() - end");
return sessionId;
} else if (HttpURLConnection.HTTP_BAD_REQUEST == httpCodeStatus.getCode().intValue()) {
List<Error> errors = ErrorsParser.readErrosXml(response.getErrorStream());
PagSeguroServiceException exception = new PagSeguroServiceException(httpCodeStatus, errors);
log.error(String.format("SessionService.createSession() - error %s", //
exception.getMessage()));
throw exception;
} else if (HttpURLConnection.HTTP_UNAUTHORIZED == httpCodeStatus.getCode().intValue()) {
PagSeguroServiceException exception = new PagSeguroServiceException(httpCodeStatus);
log.error(String.format("SessionService.createSession() - error %s", //
exception.getMessage()));
throw exception;
} else {
throw new PagSeguroServiceException(httpCodeStatus);
}
} catch (PagSeguroServiceException e) {
throw e;
} catch (Exception e) {
log.error(String.format("SessionService.createSession() - error %s", //
e.getMessage()));
throw new PagSeguroServiceException(httpCodeStatus, e);
} finally {
response.disconnect();
}
}
}
| [
"ricardogosch@gmail.com"
] | ricardogosch@gmail.com |
9728250ac47ac0fc7b0fb85fa4c231d9838826cc | de12f4f9766a2394c3d6bfe20b2ea1333c7dd49e | /mutlti_client_socket/src/main/java/com/example/network/HttpImageActivity.java | d63d48779c42ed3de7b670fa535744a273ed2216 | [] | no_license | yyj8209/multi_client | f347750891b8daee3bc7631b989d780024d39975 | 810c2097f92ede48b6468f76818901e58250d10f | refs/heads/master | 2022-06-19T03:40:18.404861 | 2020-05-06T02:48:43 | 2020-05-06T02:48:43 | 261,632,786 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,319 | java | package com.example.network;
import com.example.network.task.GetImageCodeTask;
import com.example.network.task.GetImageCodeTask.OnImageCodeListener;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
/**
* Created by ouyangshen on 2016/11/11.
*/
public class HttpImageActivity extends AppCompatActivity implements
OnClickListener, OnImageCodeListener {
private ImageView iv_image_code;
private boolean bRunning = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_http_image);
iv_image_code = (ImageView) findViewById(R.id.iv_image_code);
iv_image_code.setOnClickListener(this);
getImageCode();
}
private void getImageCode() {
if (bRunning != true) {
bRunning = true;
GetImageCodeTask codeTask = new GetImageCodeTask(this);
codeTask.setOnImageCodeListener(this);
codeTask.execute();
}
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.iv_image_code) {
getImageCode();
}
}
@Override
public void onGetCode(String path) {
Uri uri = Uri.parse(path);
iv_image_code.setImageURI(uri);
bRunning = false;
}
}
| [
"yyj8209@163.com"
] | yyj8209@163.com |
0b531539715ef0f9fd52d5eff913d8e5943bd58b | c23d9be4a5d864d4f4443a1edb4eefdd2ea4a955 | /app/src/main/java/com/nuoxian/kokojia/fragment/TeacherAnswerAll.java | 15a4621a7fa28cec6315d1ed2a41084c480c1b81 | [] | no_license | Superingxz/KoKoJia | b85ec91e81bf516ff859528c1eeb62e310b06abe | 84010dd816933dd4042b81f5b46b33c35ae6a766 | refs/heads/master | 2021-01-21T09:52:51.580953 | 2017-05-18T08:41:48 | 2017-05-18T08:41:48 | 85,960,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,772 | java | package com.nuoxian.kokojia.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import com.google.gson.Gson;
import com.jingchen.pulltorefresh.PullToRefreshLayout;
import com.nuoxian.kokojia.activity.TeacherAnswerDetailsActivity;
import com.nuoxian.kokojia.adapter.TeacherAnswerAdapter;
import com.nuoxian.kokojia.enterty.BuyResult;
import com.nuoxian.kokojia.enterty.TeacherAnswer;
import com.nuoxian.kokojia.http.Urls;
import com.nuoxian.kokojia.utils.CommonMethod;
import com.nuoxian.kokojia.utils.CommonValues;
import com.ypy.eventbus.EventBus;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2016/9/19.
*/
public class TeacherAnswerAll extends BaseTeacherAnswerFragment {
private List<TeacherAnswer.DataBean> mList;
private TeacherAnswerAdapter adapter;
private int page = 1;
private static String status = "0";
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
CommonMethod.showLoadingDialog("正在加载...", getContext());
init();
getData(Urls.TEACHER_ANSWER, CommonValues.NOT_TO_DO, mList, adapter, status, page);
}
private void init() {
//设置适配器
mList = new ArrayList<>();
adapter = new TeacherAnswerAdapter(mList, getContext());
setAdapter(adapter);
//上下拉刷新
setOnRefreshListener(new PullToRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(PullToRefreshLayout pullToRefreshLayout) {
//刷新
page = 1;
mList.clear();
getData(Urls.TEACHER_ANSWER, CommonValues.TO_REFRESH, mList, adapter, status, page);
adapter.notifyDataSetChanged();
}
@Override
public void onLoadMore(PullToRefreshLayout pullToRefreshLayout) {
//加载
page++;
getData(Urls.TEACHER_ANSWER, CommonValues.TO_LOAD, mList, adapter, status, page);
adapter.notifyDataSetChanged();
}
});
setItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//跳转到答疑详情页
Intent intent = new Intent(getContext(), TeacherAnswerDetailsActivity.class);
intent.putExtra("id", mList.get(position).getId());
startActivity(intent);
}
});
}
}
| [
"1803117759@qq.com"
] | 1803117759@qq.com |
d9eac745a37ec72bcd1307e7b557878dd31366ce | 2974ca92c9ac74a34dd6dd95acfd30f6013f9d8a | /demo/src/main/java/cn/larry/demo/guice/produce/HardWare.java | 8b0bf0c2429d7440b289c9da8e6405c4306efcab | [] | no_license | larryfu/curiosity | 6e7b2305fd002625e8b5ed10e2a34b51b741e338 | d3eeebef7bcc3adaf399d6baac2c41552b8b67ad | refs/heads/master | 2023-07-24T10:52:59.878437 | 2023-07-11T06:36:31 | 2023-07-11T06:36:31 | 57,139,993 | 0 | 0 | null | 2022-12-16T08:29:30 | 2016-04-26T15:30:43 | Java | UTF-8 | Java | false | false | 220 | java | package cn.larry.demo.guice.produce;
import com.google.inject.ImplementedBy;
/**
* Created by larry on 16-8-27.
*/
@ImplementedBy(IBMPC.class)
public interface HardWare {
void startup();
void shutdown();
}
| [
"fuguanges@qq.com"
] | fuguanges@qq.com |
7ab980abd8a70703e4767bfbc2ba492082866b13 | ed94e068ff37013ebba51f3beb69b2809bd1a295 | /easyerp.service/src/main/java/org/easyerp/service/impl/UserServiceImpl.java | 6014be0c719f9bc0fa9ff2800a21107072dbb7a0 | [] | no_license | hylrf0/easyerp | 0a8f1e88f8fd61507553cce8af45d43f8ee4910b | ccf7928194841eaae6e47a2c58691ae4e0fdb0a9 | refs/heads/master | 2021-01-17T20:14:48.728365 | 2017-03-20T07:35:07 | 2017-03-20T07:35:07 | 84,141,571 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,098 | java | package org.easyerp.service.impl;
import org.easyerp.dao.entity.UserInfo;
import org.easyerp.dao.mapper.UserInfoMapper;
import org.easyerp.service.UserService;
import org.easyerp.service.bo.UserInfoBO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by Administrator on 2017/3/15 0015.
* 用户信息服务层
*/
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserInfoMapper userInfoMapper;
@Override
public UserInfoBO getUserInfoByUsernameAndPassword(String username, String password) {
UserInfo userInfo = userInfoMapper.getUserInfoByUsernameAndPassword(username, password);
if (null == userInfo) {
return null;
}
return fillUserInfoBOByUserInfo(userInfo);
}
private UserInfoBO fillUserInfoBOByUserInfo(UserInfo userInfo) {
UserInfoBO userInfoBO = new UserInfoBO();
BeanUtils.copyProperties(userInfo, userInfoBO);
return userInfoBO;
}
}
| [
"hylrf0@126.com"
] | hylrf0@126.com |
ea8baabaaa8293e85d5f2b2c54f9219694a8a7f8 | 33d5bd747b036d304192510355f9ecacf3227df0 | /src/leetCode/GetPermutation.java | b73dd12ab74fc6f55d6279c1acbec05465b4518f | [] | no_license | 18jie/algorithm | c9358840edadec7a51cf3c32a20d4c550126aac4 | d6d9e634080e0f895c2d869f6c1b9cdceef9949e | refs/heads/master | 2020-04-25T05:23:15.007898 | 2019-07-01T07:46:42 | 2019-07-01T07:46:42 | 142,892,574 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 948 | java | package leetCode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author fengjie
* @date 2019:01:08
*/
public class GetPermutation {
public String getPermutation(int n, int k) {
StringBuilder str = new StringBuilder();
String num = "123456789";
List<Integer> list = new ArrayList<>();
for (int i = 0; i < n; i++) {
list.add(1);
if(i != 0){
list.add(i,i * list.get(i - 1));
}
}
--k;
for (int i = n; i >= 1; i--) {
int j = k / list.get(i - 1);
k %= list.get(i - 1);
str.append(num.charAt(j));
num = num.replace(String.valueOf(num.charAt(j)),"");
}
return str.toString();
}
public static void main(String[] args) {
GetPermutation g = new GetPermutation();
System.out.println(g.getPermutation(4,17));
}
}
| [
"wow921480587@126.com"
] | wow921480587@126.com |
90d3c42144db6574608de360e0e1ac1d1aeaf4a2 | 1b7431bf6b8b289affcf8d596274ca34a05675eb | /app/src/main/java/lxy/liying/hdtvneu/service/task/NEU_ReviewProgramsInfoImpl.java | 50352ddd565e5555a675c01c6e9ecfdf4c24215d | [
"Apache-2.0"
] | permissive | liying2008/XDPlayer | f1e9efdde40ea0b00a09d278639be0a7146975e5 | 9be0082d964bec6d530ff3660589dae9c62850da | refs/heads/master | 2021-01-12T13:39:46.308332 | 2017-06-21T06:35:49 | 2017-06-21T06:35:49 | 69,211,893 | 6 | 4 | null | null | null | null | UTF-8 | Java | false | false | 932 | java | package lxy.liying.hdtvneu.service.task;
import lxy.liying.hdtvneu.domain.ReviewList;
import lxy.liying.hdtvneu.regex.NEU_RegexReviewHtml;
import lxy.liying.hdtvneu.utils.CommonUtils;
/**
* =======================================================
* 作者:liying
* 日期:2016/5/16 23:14
* 版本:1.0
* 描述:获取回看节目网页
* 备注:
* =======================================================
*/
public class NEU_ReviewProgramsInfoImpl implements NEU_ReviewProgramsInfo {
@Override
public ReviewList getReviewProgramsInfo(String p) {
// http://hdtv.neu6.edu.cn/time-select?p=cctv5hd
String html = CommonUtils.getHtml("http://hdtv.neu6.edu.cn/time-select?p=" + p, "UTF-8");
NEU_RegexReviewHtml regexReviewHtml = new NEU_RegexReviewHtml();
ReviewList reviewList = regexReviewHtml.getReviewPrograms(html);
return reviewList;
}
}
| [
"liruoer2008@yeah.net"
] | liruoer2008@yeah.net |
5f763c9aa60cdeb484b3537e36a4b0a0e956fa04 | f3f4f8ac27a96780e5e30c25e6ff91494d8eed85 | /src/main/java/com/bcopstein/Interfaces/DTO/FiltroDTO.java | 4d548f14cf1c2200833f5c9753ffabd96a09574c | [] | no_license | tiagoluzs/LocadoraBackend | 4caf5a497d7c372563fd9ab88567b882199d3b33 | 92eb2f3232ebe468c257f2fd552584ffef444cef | refs/heads/master | 2023-01-21T18:56:34.638636 | 2020-11-30T23:32:28 | 2020-11-30T23:32:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,480 | java | package com.bcopstein;
public class FiltroDTO {
private DataLocal inicioLocacao = new DataLocal();
private DataLocal fimLocacao = new DataLocal();
private boolean arcondicionado = false;
private boolean direcao = false;
private boolean cambio = false;
public FiltroDTO(DataLocal inicioLocacao, DataLocal fimLocacao, boolean arcondicionado, boolean direcao,
boolean cambio) {
this.inicioLocacao = inicioLocacao;
this.fimLocacao = fimLocacao;
this.arcondicionado = arcondicionado;
this.direcao = direcao;
this.cambio = cambio;
}
public DataLocal getInicioLocacao() {
return inicioLocacao;
}
public void setInicioLocacao(DataLocal inicioLocacao) {
this.inicioLocacao = inicioLocacao;
}
public DataLocal getFimLocacao() {
return fimLocacao;
}
public void setFimLocacao(DataLocal fimLocacao) {
this.fimLocacao = fimLocacao;
}
public boolean isArcondicionado() {
return arcondicionado;
}
public boolean isDirecao(){
return direcao;
}
public boolean isCambio() {
return cambio;
}
@Override
public String toString() {
return "FiltroDTO [arcondicionado=" + arcondicionado + ", cambio=" + cambio + ", direcao=" + direcao
+ ", fimLocacao=" + fimLocacao + ", inicioLocacao=" + inicioLocacao + "]";
}
}
| [
"lennon.silva95@gmail.com"
] | lennon.silva95@gmail.com |
ec5bac8a184f3aaf22bee75d5906f8c0b5e969c8 | b4b6ccef05e1f1ec48456efbcf9da5e8b65442dd | /src/main/java/com/task/service/CategoryService.java | 05f8f04386159c9e264838ed0c45e10764c16205 | [] | no_license | oblivious7777/test5 | 9c6f0d70da250e9b766105533f8ff8ebae4572fa | 714798bf2461315037b3e1582b62e07580232907 | refs/heads/master | 2021-05-09T18:47:01.517060 | 2018-01-27T14:53:07 | 2018-01-27T14:53:07 | 119,172,778 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 872 | java | package com.task.service;
import com.task.model.Category;
import com.task.model.Category_;
import java.util.List;
public interface CategoryService {
List<Category> list();
public int listState();
public int listStateLs();
public int listStateAlready();
public List<Category> listStateAll();
public List<Category_> listOcc();
public int listOccDir(Category category);
public List<Category_> listOccId(int id);
public int listOccDirAll(Category category);
public int listOccDir1(Category category);
public int listOccDir2(Category category);
public int listOccDir3(Category category);
public int listOccDir4();
public int listOccDir5(Category category);
public int listOccDir6(Category category);
public int listOccDir7();
public int listOccDir8();
public int listOccDir9();
}
| [
"709504150@qq.com"
] | 709504150@qq.com |
1e6aff807300bbe8f593dd9cdb19197b15908836 | 6ff8ef13f8eb37d425d4d8b7d0127dec609fb5af | /WebProj4/src/com/internousdev/webproj4/action/LoginAction.java | ac14926580df5f9696ccf7e328b323c967e9593b | [] | no_license | torchegit/test | 1a15f5d56bbd598fdea4fedaa87ab9a3305528c2 | b9b32cdc68d12571809e74d3694a8c9efd9b8009 | refs/heads/master | 2020-04-06T23:19:53.636563 | 2019-03-29T11:03:25 | 2019-03-29T11:03:25 | 157,865,612 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,203 | java | package com.internousdev.webproj4.action;
import java.util.ArrayList;
import java.util.List;
import com.internousdev.webproj4.dao.LoginDAO;
import com.internousdev.webproj4.dto.LoginDTO;
import com.opensymphony.xwork2.ActionSupport;
public class LoginAction extends ActionSupport {
private String username;
private String password;
private List<LoginDTO> LoginDTOList = new ArrayList<LoginDTO>();
public String execute() {
String ret=ERROR;
System.out.println(username);
System.out.println(password);
LoginDAO dao=new LoginDAO();
LoginDTOList=dao.select(username, password);
if(this.username.equals(LoginDTOList.get(0).getUsername())&&
this.password.equals(LoginDTOList.get(0).getPassword())){
ret=SUCCESS;
}else{
ret=ERROR;
}
return ret;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public List<LoginDTO> getLoginDTOList() {
return LoginDTOList;
}
public void setLoginDTOList(List<LoginDTO> loginDTOList) {
LoginDTOList = loginDTOList;
}
}
| [
"tartaruga9452@gmail.com"
] | tartaruga9452@gmail.com |
18b9ec0aab2733d2d0921c27366e60540887710c | d850af00b9c31e6a9fbd1826d02f2f88752ba680 | /src/main/java/com/helper/Util.java | 12e8d0274cb9d0ecc5bc68fa2dc6e833017f349c | [] | no_license | siddharthgelda/Diary | bfac85e58190d6f51a581e8df1009e0559781d9e | bb9747a64ca20cc56b1267f0a2bdd9cd82e129c1 | refs/heads/master | 2021-01-17T23:31:55.908204 | 2020-09-01T14:06:30 | 2020-09-01T14:06:30 | 65,192,551 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,928 | java | package com.helper;
import com.Constants;
import com.ibm.internal.assignment.entity.UserDetail;
import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
public class Util {
public static Date getSqlDate(String searchDateStr) throws ParseException {
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy");
Date parsed = convert(format.parse(searchDateStr));
return parsed;
}
private static java.sql.Date convert(java.util.Date uDate) {
java.sql.Date sDate = new java.sql.Date(uDate.getTime());
return sDate;
}
public static String createExcelSheet(List<UserDetail> list) {
StringBuffer data=new StringBuffer();
data.append(Constants.CASE_LIST_HEADERS);
list.stream().forEach(caseData->{
data.append(System.lineSeparator());
data.append(caseData.getFileNo());
data.append(Constants.COMMOA);
data.append(caseData.getCaseNo());
data.append(Constants.COMMOA);
data.append(caseData.getAgainstClient());
data.append(Constants.COMMOA);
data.append(caseData.getStage());
data.append(Constants.COMMOA);
data.append(caseData.getDescripation());
data.append(Constants.COMMOA);
data.append(caseData.getAdvocate());
data.append(Constants.COMMOA);
data.append(caseData.getPrevDate().toString());
data.append(Constants.COMMOA);
data.append(caseData.getCourt().getName());
data.append(Constants.COMMOA);
data.append(caseData.getCompany().getName());
data.append(Constants.COMMOA);
data.append(caseData.getCity().getName());
data.append(Constants.COMMOA);
data.append(" ");
});
return data.toString();
}
}
| [
"siddharth@mobimedia.in"
] | siddharth@mobimedia.in |
94951d6b6ecf726645ea7da6a4406e55f19a1ec7 | 0fba2cd000422ef42be2f274edc7a2248c40f46c | /CRM_EAI_code_deploy/code/CRM61OM/TransformMoveUserToCSFormat/WEB-INF/src/com/reuters/eai/cc/uom/CSMoveUserRequest.java | 649d4175742d356d0654b638012574cbc10f41dd | [] | no_license | RamKancharla/2012_R3 | e5ea9627da9ded2136bb2c530c24d5e01f33bb12 | 0a7cfe86cde163d1554b48a73ceb924974a14dbe | refs/heads/master | 2016-09-10T10:21:38.581302 | 2013-06-25T15:41:17 | 2013-06-25T15:41:17 | 10,941,682 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,660 | java | // !DO NOT EDIT THIS FILE!
// This source file is generated by Oracle tools
// Contents may be subject to change
// For reporting problems, use the following
// Version = Oracle WebServices (10.1.3.3.0, build 070610.1800.23513)
package com.reuters.eai.cc.uom;
public class CSMoveUserRequest implements java.io.Serializable {
protected com.reuters.eai.cc.uom._CSEaiHeader eaiHeader;
protected com.reuters.eai.cc.uom.CSMessageHeader messageHeader;
protected com.reuters.eai.cc.uom.CSUserOrderHeader userOrderHeader;
protected com.reuters.eai.cc.uom.CSUOLI[] userOrderLineItem;
public CSMoveUserRequest() {
}
public com.reuters.eai.cc.uom._CSEaiHeader getEaiHeader() {
return eaiHeader;
}
public void setEaiHeader(com.reuters.eai.cc.uom._CSEaiHeader eaiHeader) {
this.eaiHeader = eaiHeader;
}
public com.reuters.eai.cc.uom.CSMessageHeader getMessageHeader() {
return messageHeader;
}
public void setMessageHeader(com.reuters.eai.cc.uom.CSMessageHeader messageHeader) {
this.messageHeader = messageHeader;
}
public com.reuters.eai.cc.uom.CSUserOrderHeader getUserOrderHeader() {
return userOrderHeader;
}
public void setUserOrderHeader(com.reuters.eai.cc.uom.CSUserOrderHeader userOrderHeader) {
this.userOrderHeader = userOrderHeader;
}
public com.reuters.eai.cc.uom.CSUOLI[] getUserOrderLineItem() {
return userOrderLineItem;
}
public void setUserOrderLineItem(com.reuters.eai.cc.uom.CSUOLI[] userOrderLineItem) {
this.userOrderLineItem = userOrderLineItem;
}
}
| [
"rams.soadeveloper@gmail.com"
] | rams.soadeveloper@gmail.com |
983117ac75b92c42a7c5b8af8dbf0727281c6c90 | 237a53f8bbf188e93de42517953804f40aed7c2b | /新闻客户端/newsclient/src/com/feicui/news/view/QrCodePupopWindow.java | e2d29eef0ac0bf6fc769fd3ebb355ab6629ac76c | [] | no_license | taiyang0725/Android | ce01a156d1c954e7274b74a9c3d128cfc846b729 | 36b411dd6b83dbfd8a94ca4472e8e9a7c23eb2b6 | refs/heads/master | 2020-04-27T08:35:29.326885 | 2015-05-15T09:27:29 | 2015-05-15T09:27:29 | 30,404,770 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,087 | java | package com.feicui.news.view;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ListView;
import android.widget.PopupWindow;
import com.feicui.news.R;
import com.feicui.news.mode.UIEntity;
/**
* 二维码适配器
* */
public class QrCodePupopWindow extends PopupWindow {
private View conentView;
private ListView lst;
private ArrayList<UIEntity> list;
// /** 点击事件回调方法 */
// public void setOnItemClick(OnItemClickListener OnItemClick) {
// this.OnItemClick = OnItemClick;
// }
public QrCodePupopWindow(final Activity context) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
conentView = inflater.inflate(R.layout.qrcode, null);
int h = context.getWindowManager().getDefaultDisplay().getHeight();
int w = context.getWindowManager().getDefaultDisplay().getWidth();
// 设置SelectPicPopupWindow的View
this.setContentView(conentView);
// 设置SelectPicPopupWindow弹出窗体的宽
this.setWidth(w / 3);
// 设置SelectPicPopupWindow弹出窗体的高
this.setHeight(LayoutParams.WRAP_CONTENT);
// 设置SelectPicPopupWindow弹出窗体可点击
this.setFocusable(true);
this.setOutsideTouchable(true);
// 刷新状态
this.update();
// 实例化一个ColorDrawable颜色为半透明
ColorDrawable dw = new ColorDrawable(R.color.green);
// 点back键和其他地方使其消失,设置了这个才能触发OnDismisslistener ,设置其他控件变化等操作
this.setBackgroundDrawable(dw);
this.setAnimationStyle(android.R.style.Animation_Dialog);
// 设置SelectPicPopupWindow弹出窗体动画效果
// this.setAnimationStyle(R.style.);
}
public void showPopupWindow(View parent) {
if (!this.isShowing()) {
this.showAsDropDown(parent, parent.getLayoutParams().width / 4, 15);
} else {
this.dismiss();
}
}
}
| [
"1139792278@qq.com"
] | 1139792278@qq.com |
974a449219273f7ef528b6dfc0c49b0b78ea758a | 8d95de1da574f71a80e3c836b4dda4f62419870a | /app/src/test/java/com/harshadachavan/widgetexample/ExampleUnitTest.java | d8ca0e8a24b869e873d9f6d9ea421d037b852bcf | [] | no_license | harshadachavan/WidgetDemo | 619300f5cc40b2fd4c37b474761af7905feb0596 | 752fc88e8d1ead597baf8b5df70489766b70fccd | refs/heads/master | 2021-07-09T13:00:06.332178 | 2017-10-07T17:28:37 | 2017-10-07T17:28:37 | 106,116,637 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package com.harshadachavan.widgetexample;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"harshada@destaglobal.com"
] | harshada@destaglobal.com |
cc9ac6be2ad6a7ece3c2a45434b362067c29d9f8 | db2be461dca17aa54481140970d6ed05a32ebd60 | /src/main/java/com/csye6220/recruitment/controller/AdminController.java | b3ddac588f9c8d0bb486f2177e5d22b7b5e2cfaa | [] | no_license | Shamture/recruitment-website | 43a21a504ff4e019f50d072ac7c69d9d0b0bed48 | 964a6983ce5f7add8361f596fb25f7b374d0e0a4 | refs/heads/master | 2020-03-25T11:40:27.943975 | 2018-05-18T10:46:20 | 2018-05-18T10:46:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,130 | java | package com.csye6220.recruitment.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.csye6220.recruitment.dao.AdminDAO;
import com.csye6220.recruitment.dao.RoleDAO;
import com.csye6220.recruitment.pojo.Admin;
import com.csye6220.recruitment.pojo.Application;
import com.csye6220.recruitment.pojo.Hr;
import com.csye6220.recruitment.pojo.Post;
import com.csye6220.recruitment.pojo.Resume;
import com.csye6220.recruitment.pojo.Role;
import com.csye6220.recruitment.pojo.User;
@Controller
public class AdminController {
@Autowired
private AdminDAO adminDAO;
@Autowired
private RoleDAO roleDAO;
@Autowired
private BCryptPasswordEncoder bcryptEncoder;
@RequestMapping(value="/admin/addAdmin",method=RequestMethod.GET)
protected String showRegisterAdmin(){
return "register-admin";
}
@RequestMapping(value="/admin/addAdmin",method=RequestMethod.POST)
protected String addAdmin(HttpServletRequest request,ModelMap model){
String username = request.getParameter("username");
String rawPassword = request.getParameter("password");
String password = bcryptEncoder.encode(rawPassword);
String roleString = request.getParameter("role");
Role role = roleDAO.getByName(roleString);
Admin admin = new Admin(username,password,role);
adminDAO.add(admin);
model.addAttribute("message","An admin has been added successfully.");
return "message";
}
@RequestMapping(value="/admin/manageAdmins",method=RequestMethod.GET)
protected String showManageAdmins(ModelMap model){
List<Admin> admins = adminDAO.list();
model.addAttribute("admins",admins);
//to be continued
return "manage-admins";
}
}
| [
"tanmeng_job@qq.com"
] | tanmeng_job@qq.com |
e66cb527d1e01b37df49b7f376f6c7a385358e78 | 45fe0cf36a4dc3b3299ddada2b1cc968f6e68cea | /BankAccountManagement/src/main/java/com/qsoft/bam/service/BankAccountManagement.java | cf271fd99fb89e17e6805187ee1765b8b0b3945c | [] | no_license | ngo-thanh-le/TDD | 9335eca5df846cd74c25723c4846db78002a926b | 633106473abf7e96b2bb4a8cb9cf1f371148d240 | refs/heads/master | 2020-03-26T00:44:52.176994 | 2013-07-30T08:00:03 | 2013-07-30T08:00:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 838 | java | package com.qsoft.bam.service;
import com.qsoft.bam.dao.BankAccountDAO;
import com.qsoft.bam.model.BankAccount;
import com.qsoft.bam.model.Transaction;
import java.util.Date;
import java.util.List;
/**
* User: lent
* Date: 7/8/13
*/
public interface BankAccountManagement
{
public void setBankAccountDAO(BankAccountDAO bankAccountDAO);
void openAccount(String accountNo, double balance);
BankAccount getAccount(String accountNo);
void deposit(String accountNo, double amount, String description);
List<Transaction> getTransactionsOccurred(String accountNo, Date from, Date to);
void withdraw(String accountNo, double amount, String description);
List<Transaction> getTransactionsOccurred(String accountNo);
List<Transaction> getRecentTransactions(String accountNo, int numberOfTransaction);
}
| [
"lent@qsoftvietnam.com"
] | lent@qsoftvietnam.com |
633f1fe089bd1ac50c9761c1e325252fa82e8624 | c89403dbdc280089c90d380452a3ddeb071a86fd | /shopingbackend/src/main/java/MavenDemoProject/shopingbackend/App.java | a81f5b440f5edb4851114755f2dd21312ae5a930 | [] | no_license | ROSHANAHIRE/online-shoping | d3fac481b8dab2f2ac3c9d310e530ecf7f6b3f0d | c8f34b8d8272f0f28c04441b26c4baf34c911b34 | refs/heads/master | 2021-04-28T10:02:27.344281 | 2018-03-13T12:54:23 | 2018-03-13T12:54:23 | 122,055,296 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 207 | java | package MavenDemoProject.shopingbackend;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
| [
"ahireroshan24@gmail.com"
] | ahireroshan24@gmail.com |
905a5a3a8238d044a7315b0dce74032d4c614bff | db039688ea992ab01f3d01d45bbaa2f37bae3324 | /gcbpanel/src/main/java/com/macoscope/gcbwatchface/SyncPreferencesView.java | d42824af2708c82ebff02e69a9175c70b45bba16 | [
"Apache-2.0"
] | permissive | jayshah3893/GCBAndroidWearWatchFace | 05f6767fe480989d66457817caca73b79c49dea8 | 8744158d8216b99b30f3faff9bdb65655b92356b | refs/heads/master | 2021-06-01T02:10:26.142049 | 2016-06-09T14:09:36 | 2016-06-09T14:09:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | package com.macoscope.gcbwatchface;
import android.content.Intent;
public interface SyncPreferencesView {
void showGooglePlayServicesAvailabilityErrorDialog(int connectionStatusCode);
void showMessage(String message);
void showMessage(int resourceId);
void startRequestAccountActivityForResult(Intent intent, int requestCode);
void requestEasyPermissions(int requestCode, String permission, int messageResourceId);
}
| [
"tomasz@macoscope.net"
] | tomasz@macoscope.net |
5372efaa6f59a545455ce715887a8b504f6d9e52 | 06f7ba5a5c69beb0915567ca0946a931d5fcd07a | /src/IO/FileInputStreamTest05.java | 666b2afe9aa7944c962492744ffd5101dcf28c8f | [] | no_license | 04143066/execise | c31c89f171b4c6371dd6c48dce0734e48842e006 | c7979317ca56578f8a927729fc567f1ef5a37bc9 | refs/heads/master | 2020-03-29T09:08:48.902124 | 2017-06-18T06:41:18 | 2017-06-18T06:41:18 | 94,669,860 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 893 | java | package IO;
import java.io.*;
public class FileInputStreamTest05 {
public static void main(String[] args) {
//1.创建流
FileInputStream fis = null;
try {
fis = new FileInputStream("E:\\我的java程序\\动力节点\\src\\IO\\temp01.txt");
System.out.println(fis.available());//4
System.out.println(fis.read());//97
System.out.println(fis.available());//3
//available() 返回下一次输入流调用的方法可以不受阻塞地从此输入流读取(或跳过)的估计剩余值
fis.skip(1);//跳过一个字节
System.out.println(fis.available());//2
System.out.println(fis.read());//99
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}
finally{
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
| [
"1005569912@qq.com"
] | 1005569912@qq.com |
92641323c7574afdcf052b0f9e98eb2d9afde446 | 9430cbb7c15fd009e94ec1606948b32e6dc36846 | /src/clueGame/DoorDirection.java | e4cfa36795e6e025d4503134fd450835c137fc7d | [] | no_license | nicwenzel26/Clue | 97b5829b8d8b502af15f49e103694a330cc6e3c8 | 21b1db6d7c6cd4131c15bfe70a4e8d2513dc5913 | refs/heads/master | 2020-06-19T15:43:43.301203 | 2019-07-13T21:53:13 | 2019-07-13T21:53:13 | 196,769,184 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 147 | java | /*
* Brennan Guthals & Nicholas Wenzel
* 3/6/2019
* ClueGame
*/
package clueGame;
public enum DoorDirection {
UP, DOWN, LEFT, RIGHT, NONE;
}
| [
"nwenzel@mymail.mines.edu"
] | nwenzel@mymail.mines.edu |
dab2f033b45f277a016b92d14acd40fa9b220572 | 63b7527a1053a2dbaa7841084c544eca5de35489 | /src/main/java/net/dv8tion/jda/internal/utils/BufferedRequestBody.java | 1e4dba36a4397ce8f19ec14cc115e8c30794afbc | [
"Apache-2.0"
] | permissive | DHeartEz/JDA | d696db134e49fd166455da2b55fbfbb456f0b80b | 4b75ff2a3d8f0beb222f282a5d6d0c17d1cadbc9 | refs/heads/master | 2022-05-24T06:14:52.935992 | 2020-04-21T04:33:14 | 2020-04-21T04:33:14 | 257,476,581 | 0 | 0 | Apache-2.0 | 2020-04-21T04:08:38 | 2020-04-21T04:08:37 | null | UTF-8 | Java | false | false | 1,657 | java | /*
* Copyright 2015-2019 Austin Keener, Michael Ritter, Florian Spieß, and the JDA contributors
*
* 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 net.dv8tion.jda.internal.utils;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okio.BufferedSink;
import okio.BufferedSource;
import okio.Okio;
import okio.Source;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;
public class BufferedRequestBody extends RequestBody
{
private final Source source;
private final MediaType type;
private byte[] data;
public BufferedRequestBody(Source source, MediaType type)
{
this.source = source;
this.type = type;
}
@Nullable
@Override
public MediaType contentType()
{
return type;
}
@Override
public void writeTo(@Nonnull BufferedSink sink) throws IOException
{
if (data != null)
{
sink.write(data);
return;
}
try (BufferedSource s = Okio.buffer(source))
{
data = s.readByteArray();
sink.write(data);
}
}
}
| [
"business@minnced.club"
] | business@minnced.club |
b406062f1d26d7b1676eb7acdc0298c43b0da9a4 | dac724ce4264693b978e60116d53c4cb187be62b | /src/main/java/com/tzxx/common/tencentservice/bill/identifyhandler/VatRollSingleInvoiceInfoHandler.java | 8b5661b35293dc9619c5b7c7531f2976c618a171 | [] | no_license | gitzhangliang/zlearn-web | 60572f3e9a79c2ab10ee633fb49fa012958a4cdb | 81788c7a53c212996d352b526ab6eaa4c9c0caa5 | refs/heads/master | 2023-02-24T14:01:07.659840 | 2023-02-12T10:25:28 | 2023-02-12T10:25:28 | 180,762,071 | 1 | 0 | null | 2022-06-17T02:07:26 | 2019-04-11T09:44:30 | Java | UTF-8 | Java | false | false | 1,091 | java | package com.tzxx.common.tencentservice.bill.identifyhandler;
import com.tencentcloudapi.ocr.v20181119.models.SingleInvoiceInfo;
import com.tzxx.common.tencentservice.bill.category.VatRollInvoice;
import java.util.List;
import java.util.Map;
/**
* @author zhangliang
* @date 2021/1/28.
*/
public class VatRollSingleInvoiceInfoHandler extends AbstractSingleInvoiceInfoHandler<VatRollInvoice>{
public VatRollSingleInvoiceInfoHandler(List<SingleInvoiceInfo> singleInvoiceInfos){
super(singleInvoiceInfos);
}
@Override
protected VatRollInvoice doHandle(Map<String, String> nameValueMap) {
VatRollInvoice vatRollInvoice = new VatRollInvoice();
vatRollInvoice.setInvoiceNo(nameValueMap.get("发票号码"));
vatRollInvoice.setInvoiceDate(nameValueMap.get("开票日期"));
vatRollInvoice.setInvoiceCode(nameValueMap.get("发票代码"));
vatRollInvoice.setTotalPriceInFigures(nameValueMap.get("合计金额(小写)"));
vatRollInvoice.setCheckCode(nameValueMap.get("校验码"));
return vatRollInvoice;
}
}
| [
"906356464@qq.com"
] | 906356464@qq.com |
87615e70712f4314d8a0b30d11eda368658d144a | 28875ff9749759d4e1bb36bc4c969b0a60c96896 | /app/src/androidTest/java/com/team_clicker/idlefarmer/ExampleInstrumentedTest.java | 98fc3642dff70d282bc6ff19741925ffe98dd31c | [
"Apache-2.0"
] | permissive | ClickerTeam/Idle-Farmer | e0819b46c30e39912c4647b712743e0abc04c8a9 | 24fd0b890ecf09045ed8f17f196ce8be301a5236 | refs/heads/master | 2020-12-30T15:55:01.403267 | 2017-06-07T21:03:32 | 2017-06-07T21:03:32 | 91,186,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 784 | java | package com.team_clicker.idlefarmer;
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.*;
/**
* Instrumentation 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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.team_clicker.idlefarmer", appContext.getPackageName());
}
}
| [
"meltoz@outlook.fr"
] | meltoz@outlook.fr |
9559994a15dbf3b92c2a1f0a8523c2630c6ef8c1 | d3a5c22fc6f248b057a36f25c2271e1966bbb91f | /reactive-mysql/src/test/java/com/anbu/reactive/mysql/ReactiveMysqlApplicationTests.java | 2ed6f9f76aedad50cdb5bebb6bc8424535b99286 | [] | no_license | anbusampath/spring-data-r2dbc-examples | 19d7198003d1370202ffbc256c886a52364df6b1 | 66d8f08e97c01317c9eb84e6bdce595b4635c334 | refs/heads/master | 2020-06-28T22:19:03.334764 | 2019-08-28T06:10:05 | 2019-08-28T06:10:05 | 200,356,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 222 | java | package com.anbu.reactive.mysql;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ReactiveMysqlApplicationTests {
@Test
void contextLoads() {
}
}
| [
"anbu.s27@gmail.com"
] | anbu.s27@gmail.com |
94ca75a1754b37da0c8dc198c5e0e2f08cf9d3a9 | 667761a0b60550bebb59a04bb2c4f310aca71243 | /myApp/src/ie/gmit/computing/TreeAdapter.java | b81b278f7e52e218151bd2125fb51e9af97bc94c | [] | no_license | zengxuezhen/Marine | f2dd3aa31d2bdd021204e869dfb6f383d194662b | fd25ed7eff85c92e0e9d9cbf6d911ce447576f0f | refs/heads/master | 2021-03-12T20:20:21.961439 | 2015-01-18T18:05:42 | 2015-01-18T18:05:42 | 29,435,109 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 6,472 | java | package ie.gmit.computing;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;
/**
* The adapter is to back up the data for listview
* @author Alex.Zeng
*
*/
public class TreeAdapter extends BaseAdapter{
private Context con;
private LayoutInflater lif;
private List<Node> all = new ArrayList<Node>();//展示
private List<Node> cache = new ArrayList<Node>();//缓存
private TreeAdapter tree = this;
boolean hasCheckBox;
private int expandIcon = -1;//展开图标
private int collapseIcon = -1;//收缩图标
/**
* Constructor
*/
public TreeAdapter(Context context,List<Node>rootNodes){
this.con = context;
this.lif = (LayoutInflater)con.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
for(int i=0;i<rootNodes.size();i++){
addNode(rootNodes.get(i));
}
}
/**
* add the given node to listview
* @param node
*
*/
public void addNode(Node node){
all.add(node);
cache.add(node);
if(node.isLeaf())return;
for(int i = 0;i<node.getChildrens().size();i++){
addNode(node.getChildrens().get(i));
}
}
/**
* set icon
* @param expandIcon
* @param collapseIcon
*
*/
public void setCollapseAndExpandIcon(int expandIcon,int collapseIcon){
this.collapseIcon = collapseIcon;
this.expandIcon = expandIcon;
}
/**
* set the state of checkbox
*
*
*/
public void checkNode(Node n,boolean isChecked){
checkParentNode(n, isChecked);
for(int i =0 ;i<n.getChildrens().size();i++){
checkNode((Node)n.getChildrens().get(i), isChecked);
}
}
public void checkParentNode(Node n, boolean isChecked){
n.setChecked(isChecked);
Node parent = n.getParent();
if (parent != null) {
if(isChecked){
checkParentNode(parent, true);
}else{
boolean checked = false;
for (int i = 0; i < parent.getChildrens().size(); i++) {
Node child = parent.getChildrens().get(i);
if(child.isChecked()) {
checked = true;
break;
}
}
checkParentNode(parent, checked);
}
}
}
/**
*get all selected nodes
* @return
*
*/
public List<Node>getSelectedNode(){
List<Node>checks =new ArrayList<Node>() ;
for(int i = 0;i<cache.size();i++){
Node n =(Node)cache.get(i);
if(n.isChecked())
checks.add(n);
}
return checks;
}
/**
* if has checkbox
* @param hasCheckBox
*
*/
public void setCheckBox(boolean hasCheckBox){
this.hasCheckBox = hasCheckBox;
}
/**
* change the state of each node
* @param location
*
*/
public void ExpandOrCollapse(int location){
Node n = all.get(location);//获得当前视图需要处理的节点
if(n!=null)//排除传入参数错误异常
{
if(!n.isLeaf()){
n.setExplaned(!n.isExplaned());// 由于该方法是用来控制展开和收缩的,所以取反即可
filterNode();//遍历一下,将所有上级节点展开的节点重新挂上去
this.notifyDataSetChanged();//刷新视图
}
}
}
/**
* set the layer
* @param level
*
*/
public void setExpandLevel(int level){
all.clear();
for(int i = 0;i<cache.size();i++){
Node n = cache.get(i);
if(n.getLevel()<=level){
if(n.getLevel()<level)
n.setExplaned(true);
else
n.setExplaned(false);
all.add(n);
}
}
}
public void filterNode(){
all.clear();
for(int i = 0;i<cache.size();i++){
Node n = cache.get(i);
if(!n.isParentCollapsed()||n.isRoot())//凡是父节点不收缩或者不是根节点的都挂上去
all.add(n);
}
}
/* (non-Javadoc)
* @see android.widget.Adapter#getCount()
*/
@Override
public int getCount() {
// TODO Auto-generated method stub
return all.size();
}
/* (non-Javadoc)
* @see android.widget.Adapter#getItem(int)
*/
@Override
public Object getItem(int location) {
// TODO Auto-generated method stub
return all.get(location);
}
/* (non-Javadoc)
* @see android.widget.Adapter#getItemId(int)
*/
@Override
public long getItemId(int location) {
// TODO Auto-generated method stub
return location;
}
/* (non-Javadoc)
* @see android.widget.Adapter#getView(int, android.view.View, android.view.ViewGroup)
*/
@Override
public View getView(int location, View view, ViewGroup viewgroup) {
ViewItem vi = null;
if(view == null){
view = lif.inflate(R.layout.list_item, null);
vi = new ViewItem();
vi.cb = (CheckBox)view.findViewById(R.id.cb);
vi.flagIcon = (ImageView)view.findViewById(R.id.ivec);
vi.tv = (TextView)view.findViewById(R.id.itemvalue);
vi.icon =(ImageView)view.findViewById(R.id.ivicon);
vi.cb.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Node n = (Node)v.getTag();
checkNode(n, ((CheckBox)v).isChecked());
tree.notifyDataSetChanged();
}
});
view.setTag(vi);
}
else{
vi = (ViewItem)view.getTag();
if(vi ==null)
System.out.println();
}
Node n = all.get(location);
if(n!=null){
if(vi==null||vi.cb==null)
System.out.println();
vi.cb.setTag(n);
vi.cb.setChecked(n.isChecked());
//叶节点不显示展开收缩图标
if(n.isLeaf()){
vi.flagIcon.setVisibility(View.GONE);
}
else{
vi.flagIcon.setVisibility(View.VISIBLE);
if(n.isExplaned()){
if(expandIcon!=-1){
vi.flagIcon.setImageResource(expandIcon);
}
}
else{
if(collapseIcon!=-1){
vi.flagIcon.setImageResource(collapseIcon);
}
}
}
//设置是否显示复选框
if(n.hasCheckBox()&&n.hasCheckBox()){
vi.cb.setVisibility(View.VISIBLE);
}
else{
vi.cb.setVisibility(View.GONE);
}
//设置是否显示头像图标
if(n.getIcon()!=-1){
vi.icon.setImageResource(n.getIcon());
vi.icon.setVisibility(View.VISIBLE);
}
else{
vi.icon.setVisibility(View.GONE);
}
//显示文本
vi.tv.setText(n.getTitle());
// 控制缩进
view.setPadding(30*n.getLevel(), 3,3, 3);
}
return view;
}
/**
* This is an entity class
* @author Alex.Zeng
*
*/
public class ViewItem{
private CheckBox cb;
private ImageView icon;
private ImageView flagIcon;
private TextView tv;
}
}
| [
"alex.zeng.xuezhen@gmail.com"
] | alex.zeng.xuezhen@gmail.com |
d5f6686c889f53e5f2f3f2abaed25d7a130dfd06 | 04445505e96b5b1bbaff6087a7e5b555a8ce13fd | /8_OOPExtraFeatures/src/task2_Bank/Task2_Bank.java | 544191ff54e94471952c78bbb82ca787957e0490 | [] | no_license | lgeorgieva/swift | 880c77245f8667dd12dbda5252eb8831a98b5aa3 | 86b35ea3364a1a6ed80c5e82665dc092972fac12 | refs/heads/master | 2020-06-14T12:07:50.597879 | 2017-02-04T08:42:18 | 2017-02-04T08:42:18 | 75,026,941 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,140 | java | package task2_Bank;
import task2_Bank.accounts.DepositAccount;
import task2_Bank.accounts.LoanAccount;
import task2_Bank.accounts.MortgageAccount;
import task2_Bank.customers.IndividualCustomer;
import java.util.Scanner;
/**
* Created by ASUS on 11.11.2016 г..
*/
public class Task2_Bank {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
String input = scn.nextLine();
while (true) {
String[] command = input.trim().split("\\s+");
if (command[0].equals("END")) {
break;
}
switch (command[0]) {
case "OPEN":
String name = command[1];
String owner = (command[2]);
double balance = Double.parseDouble(command[3]);
double monthlyInterestRate = Double.parseDouble(command[4]);
DepositAccount depositAccount = new DepositAccount(name, owner, balance, monthlyInterestRate);
System.out.println(depositAccount.getAccountIBAN());
balance = Double.parseDouble(command[3]);
monthlyInterestRate = Double.parseDouble(command[4]);
LoanAccount loanAccount = new LoanAccount(name, owner, balance, monthlyInterestRate);
System.out.println(loanAccount.getAccountIBAN());
balance = Double.parseDouble(command[3]);
monthlyInterestRate = Double.parseDouble(command[4]);
MortgageAccount mortgageAccount = new MortgageAccount(name, owner, balance, monthlyInterestRate);
System.out.println(mortgageAccount.getAccountIBAN());
break;
case "PUT":
String accountIBAN = command[1];
double cash = Double.parseDouble(command[2]);
depositAccount.put(cash);
System.out.println(depositAccount.getBalance());
loanAccount.put(cash);
System.out.println(loanAccount.getBalance());
mortgageAccount.put(cash);
System.out.println(mortgageAccount.getBalance());
break;
case "GET":
name = command[1];
accountIBAN = command[1];
cash = Double.parseDouble(command[1]);
depositAccount.put(cash);
System.out.println(depositAccount.getBalance());
break;
case "INFO":
name = command[1];
accountIBAN = command[1];
System.out.println(depositAccount.getInterestRateCost());
}
System.out.println(depositAccount.getInterestRateCost());
}
System.out.println(depositAccount.getInterestRateCost());
}
public static int getCompanyCustomer() {
return companyCustomer;
}
public static void setCompanyCustomer(int companyCustomer) {
Task2_Bank.companyCustomer = companyCustomer;
}
public static int getIndividualCustomer() {
return individualCustomer;
}
public static void setIndividualCustomer(int individualCustomer) {
Task2_Bank.individualCustomer = individualCustomer;
}
public static DepositAccount getDepositAccount() {
return depositAccount;
}
public static void setDepositAccount(DepositAccount depositAccount) {
Task2_Bank.depositAccount = depositAccount;
}
public static LoanAccount getLoanAccount() {
return loanAccount;
}
public static void setLoanAccount(LoanAccount loanAccount) {
Task2_Bank.loanAccount = loanAccount;
}
public static MortgageAccount getMortgageAccount() {
return mortgageAccount;
}
public static void setMortgageAccount(MortgageAccount mortgageAccount) {
Task2_Bank.mortgageAccount = mortgageAccount;
}
}
| [
"luba.georgieva@gmail.com"
] | luba.georgieva@gmail.com |
8ef74664651034d8a6d25342bbad4374edf8a086 | e44b96ce9280d9f4b07b86b9b401ad1dfe50cb62 | /yhlibrary/src/main/java/org/yh/library/view/webview/ProgressLifeCyclic.java | 7cfa0e7e021409319159eea4195e9bfe91b330b4 | [
"Apache-2.0"
] | permissive | my11712/YhLibraryForAndroid | aa34f6404d667e1d7cba7a1d93896914ad54b9d6 | f8d6f1dc97757517b72c069b743a65f5d1baec22 | refs/heads/master | 2020-04-11T12:10:27.336160 | 2018-03-30T14:12:26 | 2018-03-30T14:12:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 171 | java | package org.yh.library.view.webview;
public interface ProgressLifeCyclic {
void showProgressBar();
void setProgressBar(int newProgress);
void finish();
}
| [
"youh@fitcome.net"
] | youh@fitcome.net |
631957de52ec2ce77b100f477b0bd51c0cdd782d | c765552996afd2dd3479d02d2c5f4f87e14ece83 | /src/com/company/behaviouralPattern/visitor/HeadingNode.java | d1d8d18a35e5be2316e22f8959879252ab955edc | [] | no_license | yousa-rahman/DesignPatterns | 02810ef63e0cc7be13ec479f958f609235cc43e4 | c1d54dfb90968d8eb31b67c79106466ecb7c78fc | refs/heads/main | 2023-08-20T14:34:21.813316 | 2021-10-24T15:44:02 | 2021-10-24T15:44:02 | 406,389,304 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package com.company.behaviouralPattern.visitor;
public class HeadingNode implements HtmlNode{
@Override
public void execute(Operation operation) {
operation.apply(this);
}
}
| [
"yousa.rahman@gmail.com"
] | yousa.rahman@gmail.com |
b94956a9fbd2f24f0e7acb2860fd30e604ee4f8b | 36d4c9a57b53f5e14acb512759b49fe44d9990d8 | /csc/java_2014/2014_11_10/src/test/java/ru/csc/java2014/testing/demo3/CalculatorCliTest.java | 29eac5a2784334893148eec4489b2f6867ee76aa | [] | no_license | yosef8234/test | 4a280fa2b27563c055b54f2ed3dfbc7743dd9289 | 8bb58d12b2837c9f8c7b1877206a365ab9004758 | refs/heads/master | 2021-05-07T22:46:06.598921 | 2017-10-16T18:11:26 | 2017-10-16T18:11:26 | 107,286,907 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,608 | java | package ru.csc.java2014.testing.demo3;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import java.io.StringReader;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
public class CalculatorCliTest {
private Calculator calculatorMock;
private CalculatorCli calculatorCli;
@Before
public void setUp() {
calculatorMock = Mockito.mock(Calculator.class);
calculatorCli = new CalculatorCli(calculatorMock);
}
@Test
public void empty_expressions_must_be_skipped() {
calculatorCli.runInteractiveSession(new StringReader(";\n; ;;;\t\n;"));
Mockito.verifyZeroInteractions(calculatorMock);
}
@Test
public void each_expression_separated_by_semicolon_must_be_evaluated() {
calculatorCli.runInteractiveSession(new StringReader("1;2;3;"));
verify(calculatorMock).calculate("1");
verify(calculatorMock).calculate("2");
verify(calculatorMock).calculate("3");
verifyNoMoreInteractions(calculatorMock);
}
@Test
public void each_expression_separated_by_semicolon_must_be_evaluated_2() {
when(calculatorMock.calculate("1")).thenReturn(1d);
when(calculatorMock.calculate("2")).thenReturn(2d);
when(calculatorMock.calculate("3")).thenReturn(3d);
calculatorCli.runInteractiveSession(new StringReader("1;2;3;"));
verify(calculatorMock).calculate("1");
verify(calculatorMock).calculate("2");
verify(calculatorMock).calculate("3");
verifyNoMoreInteractions(calculatorMock);
}
}
| [
"ekoz@protonmail.com"
] | ekoz@protonmail.com |
a3e0f0339315f33d0aa0ed6806f0870c5724774c | 64ea0d71b0109fe51018c46bb0e2baade78ed6d2 | /Persistance/src/persistence/DAO/PizzaPriceListDAO.java | 52ce3c9c8f8fa4273a7ac00e3197e1c0ae917a73 | [] | no_license | dodaro/PizzaManager | 8a0eb458dc5bbd15577abec6863d0a9d8a3b3f63 | 95868a70569507d11ae5ae9897380297a576e7b0 | refs/heads/master | 2021-01-10T18:33:14.435895 | 2016-01-27T12:52:28 | 2016-01-27T12:52:28 | 46,803,852 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package persistence.DAO;
import java.util.List;
import persistence.PizzaPriceList;
public interface PizzaPriceListDAO {
public void create(PizzaPriceList pizzaPriceList);
public void delete(PizzaPriceList pizzaPriceList);
public void update(PizzaPriceList pizzaPriceList);
public List<PizzaPriceList> get();
}
| [
"cosentinomarco90@gmail.com"
] | cosentinomarco90@gmail.com |
402877a813fa2c9af603b866ee6175f9921bac49 | 011b41cdc57d0eb1bdc4a4ba88d6794ec885a199 | /liborrow-webinterface/liborrow-webinterface-model/src/main/java/com/liborrow/webinterface/generated/model/SaveReservations.java | 4b98c7c9514be7aa75fe39300e1bef51fffbf4ac | [] | no_license | Luwin95/liborrow-P7 | 13c2743fe60a7e5f3f7f2805362e4badb6afaa79 | d7fdc1bd7371c31fbae63d984805fb9cacd5d4fa | refs/heads/master | 2020-03-14T18:08:44.463440 | 2018-05-31T21:30:40 | 2018-05-31T21:30:40 | 131,735,723 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,805 | java |
package com.liborrow.webinterface.generated.model;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Classe Java pour saveReservations complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* <complexType name="saveReservations">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="arg0" type="{model.generated.webinterface.liborrow.com}waitingListDTO" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "saveReservations", propOrder = {
"arg0"
})
public class SaveReservations {
protected List<WaitingListDTO> arg0;
/**
* Gets the value of the arg0 property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the arg0 property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getArg0().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link WaitingListDTO }
*
*
*/
public List<WaitingListDTO> getArg0() {
if (arg0 == null) {
arg0 = new ArrayList<WaitingListDTO>();
}
return this.arg0;
}
}
| [
"b.aubin95@live.fr"
] | b.aubin95@live.fr |
882d4e762ad6dc8b7995ada4a33da46f263cf976 | 6fb16361ca612d16269fa2774cdaa3f1ad11a5d3 | /spring-main/chap_04_java_config/src/main/java/com/j4ltechnologies/formation/spring/dao/javaconfig/impls/CompteService.java | 8df5e739d620a7a5dcc2308ab45a22f5d9802681 | [
"MIT"
] | permissive | renaud91/manageBill | aeaccd1b67b264e0610dc522a8580ee286f49b9e | 98de012ac9834ac7d97b9b03308e93bc96ec20ca | refs/heads/main | 2023-05-09T15:54:08.526314 | 2021-06-01T14:04:01 | 2021-06-01T14:04:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,213 | java | package com.j4ltechnologies.formation.spring.dao.javaconfig.impls;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.j4ltechnologies.formation.spring.dao.ICompteService;
import com.j4ltechnologies.formation.spring.domains.Compte;
@Component
public class CompteService implements ICompteService {
@Autowired
private CompteRepository compteRepository;
@Override
public void transfert(Integer numSource, Integer numDestination, Double montant) {
Compte source = compteRepository.find(numSource);
Compte destination = compteRepository.find(numDestination);
source.setSolde(source.getSolde() - montant);
destination.setSolde(destination.getSolde() + montant);
compteRepository.update(source);
compteRepository.update(destination);
}
@Override
public void crediter(Integer numero, Double montant) {
Compte compte = compteRepository.find(numero);
compte.setSolde(compte.getSolde() + montant);
compteRepository.update(compte);
}
@Override
public Compte getCompte(Integer numero) {
return compteRepository.find(numero);
}
}
| [
"mhamed.dahraoui@thinkinlynk.com"
] | mhamed.dahraoui@thinkinlynk.com |
ce6c493b923994fbf19c42b944178cc306e5df5d | 778b224eb173e3c59008aceb9c48b99a04f9d473 | /mi-mall/src/main/java/com/time/demo/entity/User.java | 33c72f84fc727ab9b36a6032b22a74d3718bfa04 | [] | no_license | JieBaBaBa/sixsixsix | dda5c4e77e6fadd961e933cb288d789bb5f2943f | 722e35f8099e6b9cc2267e8092c24dabb48dfb09 | refs/heads/master | 2022-07-14T04:21:19.459515 | 2020-02-10T09:29:36 | 2020-02-10T09:30:36 | 239,472,552 | 0 | 0 | null | 2022-06-17T02:51:56 | 2020-02-10T09:24:22 | Java | UTF-8 | Java | false | false | 665 | java | package com.time.demo.entity;
import java.io.Serializable;
import com.alibaba.excel.metadata.BaseRowModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class User extends BaseRowModel implements Serializable {
private static final long serialVersionUID = 1L;
//用户编号
private Integer userid;
//用户昵称
private String nickname;
//用户名
private String username;
//密码
private String password;
//用户性别
private String sex;
} | [
"18814001109@163.com"
] | 18814001109@163.com |
1eb03747c97ac5499f82640229e7b94558c9fe7d | 1914fc49cafdb9ec2ba00b68cbb049dbe00fc652 | /src/com/starry/dao/IDepartmentImpl.java | 9ab471df86786a85bcabe41480d97ca1c1b33f74 | [] | no_license | F-eagle/Graduate | 090057371da5c78e57dadb8c44d15670cb2b7a9a | dca068a13022d94a7621335da9e0df1a5aef08a4 | refs/heads/master | 2021-01-20T04:12:23.649473 | 2017-04-26T11:33:12 | 2017-04-26T11:33:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,279 | java | package com.starry.dao;
import java.util.List;
import javax.annotation.Resource;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;
import com.starry.entity.Department;
@Repository("departmentDao")
public class IDepartmentImpl extends SqlSessionDaoSupport implements IDepartmentDao {
@Resource
public void setSuperSessionFactory(SqlSessionFactory sessionFactory){
this.setSqlSessionFactory(sessionFactory);
}
@Override
public List<Department> getAll() {
return getSqlSession().selectList("getcla");
}
@Override
public int DeleteById(String id) {
int result = this.getSqlSession().delete("delById", id);
return result;
}
@Override
public List<Department> findName(String info) {
System.out.println(this.getSqlSession().selectList("getByName", info));
return this.getSqlSession().selectList("getByName", info);
}
@Override
public List<Department> findId(String info) {
System.out.println(this.getSqlSession().selectList("getById", info));
return this.getSqlSession().selectList("getById", info);
}
@Override
public void updateDepart(Department department) {
this.getSqlSession().update("updateById",department );
}
}
| [
"760646630fei@sina.com"
] | 760646630fei@sina.com |
efb3e84abfb8bc38c4ca22889ac8d17af0942ba7 | 3cf549cbcf330d3febb4e21d60d157a311153e15 | /src/com/esg/user/AppRegister.java | 2b604b01f49654acba5d9cf070e79c5edbdd1ef9 | [] | no_license | rgao0313/wechatpay | 67231e242f15a64af5dc46768b807d2ef3babc3c | a6a1557a6169e9b947fe7cb5de3b3dd9580e325e | refs/heads/master | 2020-03-25T18:00:43.957648 | 2018-08-09T08:55:34 | 2018-08-09T08:55:34 | 144,008,626 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 624 | java | package com.esg.user;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
//import com.tencent.mm.sdk.openapi.IWXAPI;
//import com.tencent.mm.sdk.openapi.WXAPIFactory;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class AppRegister extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
final IWXAPI msgApi = WXAPIFactory.createWXAPI(context, null);
// ½«¸Ãapp×¢²áµ½Î¢ÐÅ
msgApi.registerApp(Constants.APP_ID);
UnifiedOrder.unifiedOrder();
}
}
| [
"rgao0313@uni.sydney.edu.au"
] | rgao0313@uni.sydney.edu.au |
b3ec5de8fcf33ac3523d907727e67f06130ca4fa | 2d7a444a419245b9c1e4a8dfa065d83f52e97038 | /src/main/scala/com/neighborhood/aka/laplace/estuary/web/config/RestTemplateConfig.java | 2e977e421e887bea9c2385ac69f2bd41d3abe494 | [
"Apache-2.0"
] | permissive | perkinls/estuary | 91522fb685e54d853b5ca90f8d46b6ef3350e289 | f963882c19f96d24297bcde728ade3ffe2bcb353 | refs/heads/master | 2022-01-09T01:24:57.751657 | 2019-02-14T09:23:35 | 2019-02-14T09:23:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 909 | java | package com.neighborhood.aka.laplace.estuary.web.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
/**
* Created by john_liu on 2019/1/21.
*/
@Configuration
public class RestTemplateConfig {
@Bean("restTemplate")
public RestTemplate restTemplate(ClientHttpRequestFactory factory) {
return new RestTemplate(factory);
}
@Bean
public ClientHttpRequestFactory simpleClientHttpRequestFactory() {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setReadTimeout(5000);//单位为ms
factory.setConnectTimeout(5000);//单位为ms
return factory;
}
}
| [
"liushouwei@finupgroup.com"
] | liushouwei@finupgroup.com |
47270452347443db2b485f6d3c210456d6de2ca1 | 6071044b412f7fe6aa902f765738dfc818207d2b | /discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/environment/DeleteEnvironmentResponse.java | c93a3593696d4a67bb4a87b3686da25ba3f059ac | [
"Apache-2.0"
] | permissive | eugenso/java-sdk | e07690ee5b480e51b09e3a7e5575cb1fc242d8b0 | cbb1e9cbdddda8b9fe395ada6bdc4e4181cc497e | refs/heads/master | 2021-06-11T19:26:30.867872 | 2017-02-22T19:18:50 | 2017-02-22T19:18:50 | 82,702,052 | 0 | 0 | Apache-2.0 | 2021-06-04T02:57:49 | 2017-02-21T16:28:58 | Java | UTF-8 | Java | false | false | 1,278 | java | /*
* Copyright 2016 IBM Corp. All Rights Reserved.
*
* 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.ibm.watson.developer_cloud.discovery.v1.model.environment;
import com.google.gson.annotations.SerializedName;
import com.ibm.watson.developer_cloud.discovery.v1.model.common.Status;
import com.ibm.watson.developer_cloud.service.model.GenericModel;
/**
* Response from a {@link DeleteEnvironmentRequest}.
*/
public class DeleteEnvironmentResponse extends GenericModel {
@SerializedName(EnvironmentManager.ID)
private String environmentId;
@SerializedName(EnvironmentManager.STATUS)
private Status status;
public String getEnvironmentId() {
return environmentId;
}
public Status getStatus() {
return status;
}
}
| [
"andrew.p.turgeon@gmail.com"
] | andrew.p.turgeon@gmail.com |
18ca92589a6bd8340657e4868b97dcb3037fd329 | 6b23142c6c2ced711ac866944e1934dbacf6586c | /app/src/main/java/com/solutionsmax/silverlinktask/db/FactsRepository.java | 42acd467da6e3f638428d3830d7762c362957229 | [] | no_license | cr7rahul/SilverlinkTask | c9a9d234b8b6f8bc4e28ac6ccc7b7bfd851cd7c3 | 0dab8b800f425d518646c1ba61238533087299fc | refs/heads/master | 2020-09-08T02:01:06.950767 | 2019-11-11T12:58:34 | 2019-11-11T12:58:34 | 220,952,206 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,057 | java | package com.solutionsmax.silverlinktask.db;
import android.app.Application;
import android.os.AsyncTask;
import androidx.lifecycle.LiveData;
import java.util.List;
public class FactsRepository {
private FactsDAO factsDAO;
private LiveData<List<Facts>> factsLiveData;
public FactsRepository(Application application) {
FactsDatabase factsDatabase = FactsDatabase.getDatabase(application);
factsDAO = factsDatabase.dao();
factsLiveData = factsDAO.getAllfacts();
}
public LiveData<List<Facts>> getFacts() {
return factsLiveData;
}
public void insert(Facts facts) {
new InsertAsyncTask(factsDAO).execute(facts);
}
private static class InsertAsyncTask extends AsyncTask<Facts, Void, Void> {
FactsDAO asyncFactsDAO;
InsertAsyncTask(FactsDAO factsDAO) {
asyncFactsDAO = factsDAO;
}
@Override
protected Void doInBackground(Facts... facts) {
asyncFactsDAO.insert(facts[0]);
return null;
}
}
}
| [
"luhar091@gmail.com"
] | luhar091@gmail.com |
85ce06dfe297a34f878e9037d447c0bb17ea6643 | 2a2ce22d3bd2319d3d6171f9b16bfe75399353b9 | /springcloud-feign/src/main/java/com/ytc/controller/UserController.java | 30e395d47b37855c2f75162db3b2d4c2e4ee0a77 | [] | no_license | qty0922/springcloud_marry | 6209c41597204e1d6b4a476f18b9eeba70864fff | 4bd553f373b39e78e5489afc558a0905e51644fe | refs/heads/master | 2023-03-09T04:07:15.321229 | 2021-03-02T08:38:53 | 2021-03-02T08:38:53 | 289,672,242 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,536 | java | /**
* Copyright (C), 2015-2020, XXX有限公司
* FileName: userController
* Author: 15065
* Date: 2020/8/23 15:42
* Description:
* History:
* qty <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
package com.ytc.controller;
import com.ytc.model.User;
import com.ytc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
/**
* 〈一句话功能简述〉<br>
* 〈〉
*
* @author 15065
* @create 2020/8/23
* @since 1.0.0
*/
@Controller
public class UserController {
@Autowired
private UserService userService;
@RequestMapping("hello")
public String hello(){
return "hello";
}
@GetMapping("queryUserList")
public String queryUserList(Model model){
List<User> list = userService.queryUserList();
model.addAttribute("list",list);
System.out.println(list);
return "user/show";
}
@PostMapping("register")
public void register(User user){
user.setUserId(2);
user.setUserName("admin");
user.setUserPwd("admin");
userService.register(user);
System.out.println("注册成功");
}
}
| [
"1506585406@qq.com"
] | 1506585406@qq.com |
1ab2a3fdd40110487971a71ac261a85a95c6267c | 312f02581cc9298b0375ae8b218b976a9779b113 | /dev/modules/native/aws-ec2/src/main/java/com/anttoolkit/aws/ec2/tasks/routetable/DeleteRouteTableTask.java | 5c6652137e6c90c6b07d927245d4140202804727 | [
"Apache-2.0"
] | permissive | irudyak/ant-toolkit | 2453611069fd5306e5a5b06908bbaa4b6afb760b | dcf6993c2aa7525557ea45ad560d1fed23a3cdc4 | refs/heads/master | 2021-01-15T09:03:32.519188 | 2016-09-14T20:58:36 | 2016-09-14T20:58:36 | 40,494,892 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 621 | java | package com.anttoolkit.aws.ec2.tasks.routetable;
import com.amazonaws.services.ec2.model.*;
import org.apache.tools.ant.*;
import com.anttoolkit.general.common.annotations.*;
import com.anttoolkit.aws.ec2.tasks.*;
public class DeleteRouteTableTask extends GenericEc2Task
{
@Required("Route table id should be specified")
private String tableId;
public void setTableId(String id)
{
tableId = id;
}
@Override
public void doWork() throws BuildException
{
DeleteRouteTableRequest request = new DeleteRouteTableRequest();
request.setRouteTableId(tableId);
getEc2Client().deleteRouteTable(request);
}
}
| [
"irudyak@gmail.com"
] | irudyak@gmail.com |
2133765b8d2d23bc2bb84ad88533a866c731dc3d | 7cf38653cf743a4102d98a1693bb1a51a485c3d2 | /jdk1.7.0_79.jdk/src/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java | 56ab36e3596f3624edea23e6077b183d36c2e5b7 | [] | no_license | Ranch2014/JDK-Source | 91064af7611f29b1bd96c37ae6d23831c62073b8 | 97715ef4a5aaf9b7ec560b263dbf7a22c06a4ff4 | refs/heads/master | 2021-01-01T03:36:45.716654 | 2016-04-18T01:57:10 | 2016-04-18T01:57:10 | 56,468,771 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,346 | java | package org.omg.PortableServer.POAPackage;
/**
* org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ../../../../src/share/classes/org/omg/PortableServer/poa.idl
* Friday, April 10, 2015 11:31:10 AM PDT
*/
abstract public class ServantAlreadyActiveHelper
{
private static String _id = "IDL:omg.org/PortableServer/POA/ServantAlreadyActive:1.0";
public static void insert (org.omg.CORBA.Any a, org.omg.PortableServer.POAPackage.ServantAlreadyActive that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static org.omg.PortableServer.POAPackage.ServantAlreadyActive extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
private static boolean __active = false;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
synchronized (org.omg.CORBA.TypeCode.class)
{
if (__typeCode == null)
{
if (__active)
{
return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
}
__active = true;
org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0];
org.omg.CORBA.TypeCode _tcOf_members0 = null;
__typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.PortableServer.POAPackage.ServantAlreadyActiveHelper.id (), "ServantAlreadyActive", _members0);
__active = false;
}
}
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static org.omg.PortableServer.POAPackage.ServantAlreadyActive read (org.omg.CORBA.portable.InputStream istream)
{
org.omg.PortableServer.POAPackage.ServantAlreadyActive value = new org.omg.PortableServer.POAPackage.ServantAlreadyActive ();
// read and discard the repository ID
istream.read_string ();
return value;
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.PortableServer.POAPackage.ServantAlreadyActive value)
{
// write the repository ID
ostream.write_string (id ());
}
}
| [
"Ranch2014@outlook.com"
] | Ranch2014@outlook.com |
b89f21a782cc1064e657d4fe9245d772da6677ec | 3f2cb4668322822a717db64a01fb56dac7e193c8 | /usecase/src/main/java/de/cassisi/heartcapture/usecase/port/ReportFileGenerator.java | 5f0aaa4113f4c44283c67f796343a0c41e513c43 | [] | no_license | DomenicDev/heartcapture | 1e80c30274c9ab4246058687131b7f337814636b | f62f835f308193499b8c5d6ccb96e0b358f53f33 | refs/heads/master | 2023-03-05T15:37:27.854864 | 2021-02-15T16:30:01 | 2021-02-15T16:30:01 | 294,749,044 | 0 | 1 | null | 2021-02-01T11:10:43 | 2020-09-11T16:42:38 | Java | UTF-8 | Java | false | false | 300 | java | package de.cassisi.heartcapture.usecase.port;
import de.cassisi.heartcapture.entity.ReportData;
import de.cassisi.heartcapture.usecase.exception.ReportGenerationException;
public interface ReportFileGenerator {
byte[] generateReport(ReportData reportData) throws ReportGenerationException;
}
| [
"domenic.cassisi@web.de"
] | domenic.cassisi@web.de |
62497c5928609fd6ee2ad4296d16a36bf4722f85 | 3b55f578ef0891cbfa4931276450528d77a0610d | /C83-S2-Phjx-mvn-damai/src/main/java/com/yc/damai/dao/CartDao.java | bd6ca1c25f0c279355de5aaf0784751862cd147e | [] | no_license | hujuanxiu/maven | 4ca24f6b5302b7b1184c8fd491fe21718213ad5c | ef0bc285d527b4c47b5a29f88b1955cf4bf7decd | refs/heads/master | 2022-12-09T20:47:51.982674 | 2020-08-26T11:44:59 | 2020-08-26T11:44:59 | 285,169,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,189 | java | package com.yc.damai.dao;
import java.util.List;
import com.yc.damai.util.DBHelper;
public class CartDao {
/**
* 添加购物车商品
* @param uid
* @param pid
* @return
*/
public int add(String uid,String pid) {
String sql="insert into dm_cart values(null,?,?,1)";
return new DBHelper().update(sql, uid,pid);
}
/**
* 给某个用户的购物车商品数量+1
* @param uid
* @param pid
* @return 新增的记录数
*/
public int update(String uid,String pid) {
String sql="update dm_cart set count=count+1 where uid=? and pid=?";
return new DBHelper().update(sql, uid,pid);
}
public List<?> queryByUid(String uid){
String sql="select * from dm_cart a join dm_product b on a.pid=b.id where a.uid=?";
return new DBHelper().query(sql, uid);
}
public List<?> queryByPid(String Pid){
String sql="select * from dm_cart where pid=?";
return new DBHelper().query(sql, Pid);
}
public int deleteByUid(String uid) {
String sql="delete from dm_cart where uid=?";
return new DBHelper().update(sql, uid);
}
public int del(String pid) {
String sql="delete from dm_cart where pid=?";
return new DBHelper().update(sql, pid);
}
}
| [
"风吹来的小仙女@DESKTOP-S7B2RQ0"
] | 风吹来的小仙女@DESKTOP-S7B2RQ0 |
e4d69f8243e8a0e400baf7b84d70973d32b7cd78 | 8654d804cb0f1df2689c9e670c1a5c050420b01f | /FOOL/src/it/unibo/FOOL/test/plus/MethodTest5.java | 82e5ff0cbc9ecd5561691a00476981a3ff90f773 | [
"CC0-1.0"
] | permissive | binghe/informatica-public | 9877f0c4dcf09f77f8d2b68bb10e0391da7da8b0 | 40b5623bf117059501b7c562a83e3efd1c6f3ea7 | refs/heads/master | 2023-01-13T01:47:40.743166 | 2023-01-02T03:16:51 | 2023-01-02T03:16:51 | 45,143,642 | 91 | 11 | null | null | null | null | UTF-8 | Java | false | false | 2,000 | java | /**
* An bytecode compiler and interpreter for FOOL+ language in Java/ANTLR
*
* Course project for COMPILATORI E INTERPRETI (ANALISI STATICA DI PROGRAMMI)
* Copyright(R) 2017 Chun Tian, University of Bologna
*/
package it.unibo.FOOL.test.plus;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import it.unibo.FOOL.test.*;
/*
* Method Test #4: chain of methods
*/
public final class MethodTest5 extends UnitTest {
@Test
public void testMethod5() {
prog = " class C = object end; \n"
+ "let C f(C o) o; \n"
+ " int g(C o) 1; \n"
+ "in (new C).f().g(); \n";
result = 1;
trace = true;
assertEquals(run(), result);
}
}
/** @formatter:off
3. Symbol Analysis:
base ID of class C is 1
defined class: class C(standard_object):{}
defined init function: <global.C_init():class C(standard_object):{}>
base ID of <f():class C(standard_object):{}> is 0
defined variable o in <f(C):class C(standard_object):{}>
defined function: <f(C):class C(standard_object):{}>
base ID of <g():int> is 0
defined variable o in <g(C):int>
defined function: <g(C):int>
locals: []
created new generic function: f
added new method f(C) into generic function f
created new generic function: g
added new method g(C) into generic function g
done.
4. Type Analysis:
type of prog is: int
5. Emit Bytecode:
defining function f(C) [nargs: 1(0 + 1), nlocals: 0]
defining function g(C) [nargs: 1(0 + 1), nlocals: 0]
nlocals for top-level LET: 0
done.
6. Disassemble Bytecode:
Disassembly:
.global 0
0000: br 26
0005: iconst 3
0010: load 0
0015: fstore 0
0020: load 0
0025: ret
0026: br 37
0031: load 0
0036: ret
0037: br 48
0042: iconst 1
0047: ret
0048: struct 1
0053: call #0:C_init()@5
0058: call #1:f(C)@31
0063: call #2:g(C)@42
0068: halt
7. Run Bytecode:
1
*/
| [
"binghe.lisp@gmail.com"
] | binghe.lisp@gmail.com |
6e0fe513689f8f3d184c48c1b17f6def238dec0c | 7b91092bb7197663775772a669b4cc8e210e9735 | /modules/wss4j/test/interop/TestSTScenario3.java | bde6b4ea30f7ada66de042a96752d4557a28b433 | [
"Apache-2.0",
"LicenseRef-scancode-unknown"
] | permissive | wso2/wso2-wss4j | e9786442796d37756e62675aaacfd49972ef8053 | bbd50534d56277981bbac9d18f1154ec328cd1b7 | refs/heads/master | 2023-09-05T02:47:21.212980 | 2023-02-24T06:32:44 | 2023-02-24T06:32:44 | 16,401,283 | 35 | 59 | Apache-2.0 | 2023-04-10T12:51:16 | 2014-01-31T06:23:25 | Java | UTF-8 | Java | false | false | 1,802 | 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 interop;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.ws.axis.oasis.STScenario3;
/**
* WS-Security Test Case
* <p/>
*
* @author Davanum Srinivas (dims@yahoo.com)
*/
public class TestSTScenario3 extends TestCase {
/**
* TestScenario1 constructor
* <p/>
*
* @param name name of the test
*/
public TestSTScenario3(String name) {
super(name);
}
/**
* JUnit suite
* <p/>
*
* @return a junit test suite
*/
public static Test suite() {
return new TestSuite(TestSTScenario3.class);
}
/**
* Main method
* <p/>
*
* @param args command line args
*/
public static void main(String[] args) throws Exception {
STScenario3.main(args);
}
public void testSTScenario3() throws Exception {
STScenario3.main(new String[]{"-lhttp://localhost:8080/axis/services/STPing3"});
}
}
| [
"eranda@wso2.com"
] | eranda@wso2.com |
b972fe50d142bc313317bbfb93b5a0f8e1a75570 | 8862d4b402af9e02246705da465ed8048835ecdc | /src/org/omg/PortableInterceptor/InvalidSlotHelper.java | e49e93739735009d9f29c06b24aed9ab1e8de6cc | [] | no_license | YuanAaron/JavaSourcecodeLearning | c819cedbec5c44a5d053ee4478572ac2380fdb99 | e7b57768534ba80817c9c852461ab2e39b09fb42 | refs/heads/master | 2021-07-25T08:39:28.846718 | 2021-06-03T07:32:20 | 2021-06-03T07:32:20 | 250,476,919 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,268 | java | package org.omg.PortableInterceptor;
/**
* org/omg/PortableInterceptor/InvalidSlotHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u231/13620/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl
* Saturday, October 5, 2019 3:17:54 AM PDT
*/
abstract public class InvalidSlotHelper
{
private static String _id = "IDL:omg.org/PortableInterceptor/InvalidSlot:1.0";
public static void insert (org.omg.CORBA.Any a, org.omg.PortableInterceptor.InvalidSlot that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static org.omg.PortableInterceptor.InvalidSlot extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
private static boolean __active = false;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
synchronized (org.omg.CORBA.TypeCode.class)
{
if (__typeCode == null)
{
if (__active)
{
return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
}
__active = true;
org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0];
org.omg.CORBA.TypeCode _tcOf_members0 = null;
__typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.PortableInterceptor.InvalidSlotHelper.id (), "InvalidSlot", _members0);
__active = false;
}
}
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static org.omg.PortableInterceptor.InvalidSlot read (org.omg.CORBA.portable.InputStream istream)
{
org.omg.PortableInterceptor.InvalidSlot value = new org.omg.PortableInterceptor.InvalidSlot ();
// read and discard the repository ID
istream.read_string ();
return value;
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.PortableInterceptor.InvalidSlot value)
{
// write the repository ID
ostream.write_string (id ());
}
}
| [
"user@userdeMacBook-Pro.local"
] | user@userdeMacBook-Pro.local |
927c341893a2e135fbdee491090c61f2769a7cb2 | 7ec45694dac23073aca16a3a3ae43a3d9033ad06 | /src/main/java/com/vastserver/classes/vastErrorHandling/VastRestExceptionHandler.java | 24f5f21ffd9bc5114c09d287af24f7f9133a71ec | [] | no_license | yossisp/VASTAdServer | 50ee3604324f33639370e4ba6ac825baaf3a85b4 | 4869b6e8a0bf5a5311a66b3cee7e5b2d70662265 | refs/heads/master | 2022-11-20T01:12:52.899074 | 2019-08-30T10:36:55 | 2019-08-30T10:36:55 | 205,361,128 | 1 | 0 | null | 2022-11-16T08:51:43 | 2019-08-30T10:37:38 | Java | UTF-8 | Java | false | false | 1,352 | java | package com.vastserver.classes.vastErrorHandling;
import com.vastserver.classes.VastLogger;
import org.apache.logging.log4j.Logger;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
@ControllerAdvice
public class VastRestExceptionHandler extends ResponseEntityExceptionHandler {
private Logger log = VastLogger.getLogger(VastRestExceptionHandler.class);
@Override
protected ResponseEntity<Object> handleMissingServletRequestParameter(
MissingServletRequestParameterException exception, HttpHeaders headers,
HttpStatus status, WebRequest request) {
log.warn("from handleMissingServletRequestParameter!");
String error = exception.getParameterName() + " parameter is missing";
ApiError apiError =
new ApiError(HttpStatus.BAD_REQUEST, exception.getLocalizedMessage(), error);
return new ResponseEntity<Object>(
apiError, new HttpHeaders(), apiError.getStatus());
}
} | [
"easpex@gmail.com"
] | easpex@gmail.com |
9ee99d976accb18148acd15f90760cb1f4f8596e | f92fc2fbbfde756ecdfda07b361285d2b0f4b4d8 | /src/main/java/designpattern/command/audioplayer/MacroCommand.java | ba33dfebf20e9041a6218df044e5c5fea986b54b | [] | no_license | blueaken/JianTestPlayGround | 9dbfde62273f9d8593e111bdc201b61ccfcfbfd9 | 02a962d17a6e7172b96807a785b16e7987fe3f1f | refs/heads/master | 2023-08-04T09:13:19.512764 | 2023-07-15T11:17:25 | 2023-07-15T11:17:25 | 19,551,504 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 327 | java | package designpattern.command.audioplayer;
import java.util.List;
import java.util.ArrayList;
/**
* Author: blueaken
* Date: 3/3/16 10:18 PM
*/
public interface MacroCommand extends Command {
List<Command> cmdList = new ArrayList<>();
public void add(Command command);
public void remove(Command command);
}
| [
"blueaken@gmail.com"
] | blueaken@gmail.com |
cbf279663a650c914342d96c68842048debac483 | 13fad97d2f965bcc38fcaac33c24a69a591431fe | /Session11/src/com/auribises/threads/Synchronization.java | afd9f58f0f5d08eb3427343f391497c51014346b | [] | no_license | ishantk/JavaJ2EELPU1 | 2cbd8106c438e56d38a4129d8d3dfc41879d287f | ea63c2839076d073c0968f31825086466c296a14 | refs/heads/master | 2022-12-06T21:45:02.106296 | 2020-08-27T14:00:10 | 2020-08-27T14:00:10 | 286,752,644 | 9 | 5 | null | null | null | null | UTF-8 | Java | false | false | 3,097 | java | package com.auribises.threads;
class MovieTicket{
String title;
int seatNumber;
String email;
public MovieTicket() {
}
public MovieTicket(String title, int seatNumber) {
//email = ""; // by default lets make it empty
this.title = title;
this.seatNumber = seatNumber;
}
void blockMovieTicket(String email) {
this.email = email;
System.out.println("We have Blocked Ticket for You "+email);
}
void pay() {
System.out.println("Please Pay \u20b9"+200);
System.out.println("Thank You "+email+" Your Ticket has been Booked");
}
void showConfirmedTicket() {
System.out.println("Dear, "+email);
System.out.println("Your Confirmed Ticket Details: "+title+" "+seatNumber);
}
boolean isTicketAvailable() {
//return email.isEmpty();
return email == null;
}
}
// Whenever we have a long running operations we must put in a separate thread
class MovieTicketTransaction extends Thread{
String email;
MovieTicket ticket;
MovieTicketTransaction(String email, MovieTicket ticket){
this.email = email;
this.ticket = ticket;
}
public void run() {
// if any thread is using ticket object, it will be locked for the same thread, and all other threads must wait
// till sync block has not exited, no other thread can use the same ticket object :)
synchronized (ticket) {
// isTicketAvailable is a HACK
// Could be a case for n-number of users, isTicketAvailble may return true
if(ticket.isTicketAvailable()) {
try {
System.out.println("Validating User "+email+" for his account detials in the background");
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ticket.blockMovieTicket(email);
ticket.pay();
ticket.showConfirmedTicket();
}else {
System.out.println("Sorry, "+email+" ticket is booked :(");
}
}
}
}
class User{
String name;
String phone;
String email;
public User() {
}
public User(String name, String phone, String email) {
this.name = name;
this.phone = phone;
this.email = email;
}
void selectAndBookMovieTicket(MovieTicket ticket) {
MovieTicketTransaction transaction = new MovieTicketTransaction(email, ticket);
transaction.start();
}
}
public class Synchronization {
public static void main(String[] args) {
MovieTicket m1 = new MovieTicket("Avengers", 1);
MovieTicket m2 = new MovieTicket("Avengers", 2);
MovieTicket m3 = new MovieTicket("Avengers", 3);
MovieTicket m4 = new MovieTicket("Avengers", 4);
MovieTicket m5 = new MovieTicket("Avengers", 5);
//System.out.println("Is Seat Number #"+m1.seatNumber+" available: "+m1.isTicketAvailable());
User user1 = new User("John", "+91 99999 88888", "john@example.com");
User user2 = new User("Fionna", "+91 99999 11111", "fionna@example.com");
user1.selectAndBookMovieTicket(m1);
user2.selectAndBookMovieTicket(m1);
}
}
// Challenge: In a Multi Threaded Env, when Multiple Threads access the Same Object, we must sync them
// Assignment: Write a Program demonstrating the usage of synchorized method
| [
"er.ishant@gmail.com"
] | er.ishant@gmail.com |
deec30d29b7d46444e40e049b0c2ad6fd3e05876 | fb85aa6db8e297fc4a0ea9586957dd55bfadc8a6 | /src/main/java/services/UserService.java | a29b605184d8d17d7325b690d7824de9fa3f3085 | [] | no_license | fontys-luxemburg/EndUserApplication | 8e2ea39b210c90b98fce7247fb3be474d98875f3 | ed6f53c7a46b9f117c921a930107274f3406d957 | refs/heads/DEV | 2022-03-12T11:00:18.578790 | 2019-06-17T07:52:22 | 2019-06-17T07:52:22 | 181,638,915 | 0 | 0 | null | 2022-02-26T11:52:57 | 2019-04-16T07:36:13 | null | UTF-8 | Java | false | false | 321 | java | package services;
import Connector.UserConnector;
import models.Credentials;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
@ApplicationScoped
public class UserService {
@Inject
UserConnector userConnector;
public String login(Credentials c) {
return userConnector.login(c);
}
}
| [
"tjidde-nl@users.noreply.github.com"
] | tjidde-nl@users.noreply.github.com |
edc03bf34e195549d4352895dd2e317b9963926b | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project224/src/main/java/org/gradle/test/performance/largejavamultiproject/project224/p1123/Production22466.java | 65f14ec617173cbaa460f6ca451be482b508a17a | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,890 | java | package org.gradle.test.performance.largejavamultiproject.project224.p1123;
public class Production22466 {
private String property0;
public String getProperty0() {
return property0;
}
public void setProperty0(String value) {
property0 = value;
}
private String property1;
public String getProperty1() {
return property1;
}
public void setProperty1(String value) {
property1 = value;
}
private String property2;
public String getProperty2() {
return property2;
}
public void setProperty2(String value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
acd6e5661ff76f5fa8f10379e189790f3b029a2a | e54035db6f9ca36927eeacfeb65c0e423d35105d | /src/main/java/com/shopping/cart/handler/CartHandler.java | 971dceb5fcc2aff1d460fe30e801aeed216ab810 | [] | no_license | kiran-prince/shopping-cart | 94ea50b1bca7df990eb77ec6dd071b6ca9507188 | 97009f8f5c96d897a1192a3144462e0cd8a1abb6 | refs/heads/master | 2023-03-20T10:49:25.006481 | 2021-03-19T13:29:33 | 2021-03-19T13:29:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,977 | java | package com.shopping.cart.handler;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import com.shopping.cart.constant.ResponseConstants;
import com.shopping.cart.entity.Cart;
import com.shopping.cart.entity.CartItem;
import com.shopping.cart.exception.CartItemDoesNotExistException;
import com.shopping.cart.exception.CartNotAssociatedException;
import com.shopping.cart.exception.DataNotValidException;
import com.shopping.cart.exception.ProductDoesNotExistException;
import com.shopping.cart.service.CartService;
import com.shopping.cart.validator.CartRequestValidator;;
/**
* CartHandler class to handle the requests and response to cart operations.
*
* @author Kusal
*
*/
@Component
public class CartHandler {
/**
* Logger for this class
*/
private static final Logger logger = LoggerFactory.getLogger(CartHandler.class);
/**
* Autowiring CartService dependency for consumption
*/
@Autowired
CartService cartService;
/**
* Autowiring CartRequestValidator dependency for validation of requests
*/
@Autowired
CartRequestValidator cartRequestValidator;
/**
* Handler method to fetch the cartItem list based on cart Id
*
* @param cartId
* @return ResponseEntity
*/
public ResponseEntity<Map<String, Object>> getCartItemList(int cartId) {
Map<String, Object> responseMap = new HashMap<>();
Cart cart;
try {
logger.info("Request received to fetch CartItems list for cartId - {}", cartId);
cartRequestValidator.validateGetCartItemListRequest(cartId);
cart = cartService.getCartItemList(cartId);
if (cart.getCartItem() != null && cart.getCartItem().size() > 0) {
responseMap.put(ResponseConstants.RESPONSE, cart);
} else {
// Returning a user friendly response if cart is empty.
responseMap.put(ResponseConstants.RESPONSE, ResponseConstants.EMPTY_CART);
}
} catch (DataNotValidException de) {
logger.error("DataNotValidException occurred in CartHandler::getCartItemList. Message - {}",
de.getMessage());
responseMap.put(ResponseConstants.RESPONSE, de.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.BAD_REQUEST);
} catch (CartNotAssociatedException ce) {
logger.error("CartNotAssociatedException occurred in CartHandler::getCartItemList. Message - {}",
ce.getMessage());
responseMap.put(ResponseConstants.RESPONSE, ce.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.PRECONDITION_FAILED);
} catch (Exception e) {
logger.error("Exception in CartHandler::getCartItemList. Message - {}", e.getMessage());
responseMap.put(ResponseConstants.RESPONSE, e.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.INTERNAL_SERVER_ERROR);
}
logger.info("CartItem list is fetched successfully for cartId - {}", cartId);
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.OK);
}
/**
* Handler method to add an item to the cart
*
* @param cartItem
* @return ResponseEntity
*/
public ResponseEntity<Map<String, Object>> addItem(CartItem cartItem) {
Map<String, Object> responseMap = new HashMap<>();
CartItem createdCartItem = null;
try {
logger.info("Request received to add an item to the cart - {}", cartItem);
cartRequestValidator.validateAddItemRequest(cartItem);
createdCartItem = cartService.addItem(cartItem);
responseMap.put(ResponseConstants.RESPONSE, ResponseConstants.ADD_ITEM_SUCCESS);
} catch (DataNotValidException de) {
logger.error("DataNotValidException occurred in CartHandler::addItem. Message - {}", de.getMessage());
responseMap.put(ResponseConstants.RESPONSE, de.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.BAD_REQUEST);
} catch (CartNotAssociatedException | ProductDoesNotExistException ce) {
logger.error(
"CartNotAssociatedException/ProductDoesNotExistException occurred in CartHandler::addItem. Message - {}",
ce.getMessage());
responseMap.put(ResponseConstants.RESPONSE, ce.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.PRECONDITION_FAILED);
} catch (Exception e) {
logger.error("Exception in CartHandler::addItem. Message - {}", e.getMessage());
responseMap.put(ResponseConstants.RESPONSE, e.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.INTERNAL_SERVER_ERROR);
}
logger.info("CartItem added successfully to the cart, cartItemId - {}", createdCartItem.getId());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.CREATED);
}
/**
* Handler method to update an existing item in the cart
*
* @param cartItem
* @return ResponseEntity
*/
public ResponseEntity<Map<String, Object>> updateItem(CartItem cartItem) {
Map<String, Object> responseMap = new HashMap<>();
CartItem updatedCartItem = null;
try {
logger.info("Request received to update an existing item in the cart - {}", cartItem);
cartRequestValidator.validateUpdateItemRequest(cartItem);
updatedCartItem = cartService.updateItem(cartItem);
responseMap.put(ResponseConstants.RESPONSE, ResponseConstants.UPDATE_ITEM_SUCCESS);
} catch (DataNotValidException de) {
logger.error("DataNotValidException occurred in CartHandler::updateItem. Message - {}", de.getMessage());
responseMap.put(ResponseConstants.RESPONSE, de.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.BAD_REQUEST);
} catch (CartNotAssociatedException | ProductDoesNotExistException | CartItemDoesNotExistException ce) {
logger.error(
"CartNotAssociatedException/ProductDoesNotExistException/CartItemDoesNotExistException occurred in CartHandler::updateItem. Message - {}",
ce.getMessage());
responseMap.put(ResponseConstants.RESPONSE, ce.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.PRECONDITION_FAILED);
} catch (Exception e) {
logger.error("Exception in CartHandler::updateItem. Message - {}", e.getMessage());
responseMap.put(ResponseConstants.RESPONSE, e.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.INTERNAL_SERVER_ERROR);
}
logger.info("CartItem updated successfully in the cart, cartItemId - {}", updatedCartItem.getId());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.OK);
}
/**
* Handler method to delete an existing item from the cart
*
* @param cartId
* @return ResponseEntity
*/
public ResponseEntity<Map<String, Object>> deleteItem(int cartItemId) {
Map<String, Object> responseMap = new HashMap<>();
try {
logger.info("Request received to delete an item from the cart, cartItemId - {}", cartItemId);
cartRequestValidator.validateDeleteCartItemRequest(cartItemId);
cartService.deleteItem(cartItemId);
responseMap.put(ResponseConstants.RESPONSE, ResponseConstants.DELETE_ITEM_SUCCESS);
} catch (DataNotValidException de) {
logger.error("DataNotValidException occurred in CartHandler::deleteItem. Message - {}", de.getMessage());
responseMap.put(ResponseConstants.RESPONSE, de.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.BAD_REQUEST);
} catch (Exception e) {
logger.error("Exception in CartHandler::deleteItem. Message - {}", e.getMessage());
responseMap.put(ResponseConstants.RESPONSE, e.getMessage());
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.INTERNAL_SERVER_ERROR);
}
logger.info("CartItem deleted successfully from the cart, cartItemId - {}", cartItemId);
return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.OK);
}
}
| [
"kusal.bandaru6@gmail.com"
] | kusal.bandaru6@gmail.com |
5518226ac25d99197e8ea6a09a0f397395350403 | 721bce391fa3b2afd02a9c2b61bf4276d6714d12 | /src/main/java/org/apache/lucene/queryparser/xml/builders/LikeThisQueryBuilder.java | 391be93054da7e45dceb0a94c773de85a0ec9a61 | [] | no_license | Sudhanshu127/Lucene-QueryParser-patched | 4f4ba7c51b2ee6c1be17d14c14cd160c1e9e667e | 11efb27e5caa6d64c8bee5b46cdb398dd2b6db7f | refs/heads/master | 2022-11-04T21:32:00.743344 | 2020-06-30T12:59:18 | 2020-06-30T12:59:18 | 275,168,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,243 | 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.lucene.queryparser.xml.builders;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.queries.mlt.MoreLikeThisQuery;
import org.apache.lucene.search.BoostQuery;
import org.apache.lucene.search.Query;
import org.w3c.dom.Element;
import org.apache.lucene.queryparser.xml.DOMUtils;
import org.apache.lucene.queryparser.xml.ParserException;
import org.apache.lucene.queryparser.xml.QueryBuilder;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
/**
* Builder for {@link MoreLikeThisQuery}
*/
public class LikeThisQueryBuilder implements QueryBuilder {
private static final int DEFAULT_MAX_QUERY_TERMS = 20;
private static final int DEFAULT_MIN_TERM_FREQUENCY = 1;
private static final float DEFAULT_PERCENT_TERMS_TO_MATCH = 30; //default is a 3rd of selected terms must match
private final Analyzer analyzer;
private final String defaultFieldNames[];
public LikeThisQueryBuilder(Analyzer analyzer, String[] defaultFieldNames) {
this.analyzer = analyzer;
this.defaultFieldNames = defaultFieldNames;
}
/* (non-Javadoc)
* @see org.apache.lucene.xmlparser.QueryObjectBuilder#process(org.w3c.dom.Element)
*/
@Override
public Query getQuery(Element e) throws ParserException {
String fieldsList = e.getAttribute("fieldNames"); //a comma-delimited list of fields
String fields[] = defaultFieldNames;
if ((fieldsList != null) && (fieldsList.trim().length() > 0)) {
fields = fieldsList.trim().split(",");
//trim the fieldnames
for (int i = 0; i < fields.length; i++) {
fields[i] = fields[i].trim();
}
}
//Parse any "stopWords" attribute
//TODO MoreLikeThis needs to ideally have per-field stopWords lists - until then
//I use all analyzers/fields to generate multi-field compatible stop list
String stopWords = e.getAttribute("stopWords");
Set<String> stopWordsSet = null;
if ((stopWords != null) && (fields != null)) {
stopWordsSet = new HashSet<>();
for (String field : fields) {
try (TokenStream ts = analyzer.tokenStream(field, stopWords)) {
CharTermAttribute termAtt = ts.addAttribute(CharTermAttribute.class);
ts.reset();
while (ts.incrementToken()) {
stopWordsSet.add(termAtt.toString());
}
ts.end();
} catch (IOException ioe) {
throw new ParserException("IoException parsing stop words list in "
+ getClass().getName() + ":" + ioe.getLocalizedMessage());
}
}
}
MoreLikeThisQuery mlt = new MoreLikeThisQuery(DOMUtils.getText(e), fields, analyzer, fields[0]);
mlt.setMaxQueryTerms(DOMUtils.getAttribute(e, "maxQueryTerms", DEFAULT_MAX_QUERY_TERMS));
mlt.setMinTermFrequency(DOMUtils.getAttribute(e, "minTermFrequency", DEFAULT_MIN_TERM_FREQUENCY));
mlt.setPercentTermsToMatch(DOMUtils.getAttribute(e, "percentTermsToMatch", DEFAULT_PERCENT_TERMS_TO_MATCH) / 100);
mlt.setStopWords(stopWordsSet);
int minDocFreq = DOMUtils.getAttribute(e, "minDocFreq", -1);
if (minDocFreq >= 0) {
mlt.setMinDocFreq(minDocFreq);
}
Query q = mlt;
float boost = DOMUtils.getAttribute(e, "boost", 1.0f);
if (boost != 1f) {
q = new BoostQuery(mlt, boost);
}
return q;
}
}
| [
"subansal@iitk.ac.in"
] | subansal@iitk.ac.in |
f415374a375930a6d6aa643138238362e60a8ee1 | f512281ec0365bde867e9c97ed65738812655cc0 | /cloud-eureka-server7001/src/main/java/com/halation/springcloud/EurekaMain7001.java | bf7fe73f05325e71940c5527e582f285bb7a0f64 | [] | no_license | java-liang/wklcloud | 94cd3272e5e3aba0a2aa04f3102fd97508183e12 | 05418e9180736de9c5cc584ebb39c2a20e389453 | refs/heads/master | 2022-07-11T09:48:19.676846 | 2020-03-18T11:47:08 | 2020-03-18T11:47:08 | 248,215,872 | 0 | 0 | null | 2022-06-21T03:01:00 | 2020-03-18T11:42:15 | Java | UTF-8 | Java | false | false | 419 | java | package com.halation.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class EurekaMain7001 {
public static void main(String[] args) {
SpringApplication.run(EurekaMain7001.class, args);
}
}
| [
"929501243@qq.com"
] | 929501243@qq.com |
13050047fca85223e6a53bf290c97c32271d4544 | a052af7bc2330b68bde528c3f89aad228c979568 | /mylazyloadingfragment/src/test/java/com/gmm/www/mylazyloadingfragment/ExampleUnitTest.java | 63bf074644210a7be17bbcfa9d954ddacf28f024 | [] | no_license | LittleGentleman/practice | 8bcedca89ed551d893f4f02e740c0c81444fbab4 | 8aa1ef9ec156aeb6f9691614bf8f25ce7b2df8e1 | refs/heads/master | 2022-12-19T14:05:59.733538 | 2020-09-22T09:33:28 | 2020-09-22T09:33:28 | 255,034,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 394 | java | package com.gmm.www.mylazyloadingfragment;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"gongmaomin@qq.com"
] | gongmaomin@qq.com |
75fb3e327c843b755cda09d4db08d14ed2866feb | 0928abafc44e426900cae3f4931f6c725f509ee2 | /SprigToShoapIntegarationExample/src/main/java/com/sk/service/ProductServiceImpl.java | 1af693432fb2d8dfb36a122a20870eacd00d6d98 | [
"MIT"
] | permissive | skch1/soap-spring-intergaration | d790eb895719c54848c85947aba9f34add784a91 | 395634b6c34af8dd4ede12d9f6c39a49acd390e4 | refs/heads/master | 2021-01-15T19:52:29.388488 | 2017-08-09T17:56:20 | 2017-08-09T17:56:20 | 99,833,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package com.sk.service;
import com.sk.dao.ProductDAO;
import com.sk.domain.Product;
public class ProductServiceImpl implements ProductService {
public void setProductDAO(ProductDAO productDAO) {
this.productDAO = productDAO;
}
private ProductDAO productDAO;
@Override
public boolean registration(Product product) {
boolean flage=false;
int count=0;
count=productDAO.resiterProduct(product);
if(count>0) {
flage=true;
}
return flage;
}
}
| [
"saudagar.bhumca13@gmail.com"
] | saudagar.bhumca13@gmail.com |
6b89bfe4c744a54a55e01d88a8b35fcd3822638f | 8f0d58b0256f270e9ef4c7305d2b65ac4a3e4852 | /src/main/java/com/CursoEducaWeb/course/entities/User.java | b89e9af4c94be88498120676ac12ac9f9127e4d7 | [] | no_license | PauloMiron/course-springboot-2-java-11 | b1ad864804ac548bb290760389c20ce68a61813f | d06ea128b9efa26bb45c62ecb16fc1b38a0caec9 | refs/heads/master | 2023-03-31T14:32:06.587497 | 2021-03-26T16:57:36 | 2021-03-26T16:57:36 | 351,093,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,919 | java | package com.CursoEducaWeb.course.entities;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Entity
@Table(name = "tb_user")
public class User implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String email;
private String phone;
private String password;
@JsonIgnore
@OneToMany(mappedBy = "client")
private List<Order> orders = new ArrayList<>();
public User(){
}
public User(Long id, String name, String email,String phone, String password) {
this.id = id;
this.name = name;
this.email = email;
this.phone = phone;
this.password = password;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public List<Order> getOrders() {
return orders;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
return Objects.equals(id, user.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}
| [
"paulomiron16@gmail.com"
] | paulomiron16@gmail.com |
294599b37a5aad464ff84b46bb8a8bc6bc47b245 | 5b538720b923d7c4171242d8057a1622429ae1ea | /src/main/java/com/tweedy/sboot/thymeleaf/entity/CarryoverRecordsWrapper.java | de36f8d89bd18e299cbc0de27ce538fb35b724e6 | [] | no_license | mbazhe01/attendance-tracking-v2 | 6220e2dcf5dd9e8d8de81e69ea5346691a9a6c94 | 51b7c334a08856bb830c925612685225ad666839 | refs/heads/master | 2023-03-23T00:53:23.828435 | 2021-03-17T19:22:48 | 2021-03-17T19:22:48 | 348,436,255 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,315 | java | package com.tweedy.sboot.thymeleaf.entity;
import java.util.List;
import lombok.Data;
@Data
public class CarryoverRecordsWrapper {
List<CarryoverRecord> carryovers;
public void addCarryoverRecord(CarryoverRecord carryOverRecord) {
// add on top of the list
this.carryovers.add(0, carryOverRecord);
}
public CarryoverRecordsWrapper(List<CarryoverRecord> carryOvers) {
this.carryovers = carryOvers;
}
// utility function
public int getEmployeeId() {
int emplId = -1;
if (carryovers != null && carryovers.size() > 0) {
for (CarryoverRecord c : carryovers) {
emplId = c.getEmplId();
}
}
return emplId;
}
// non field constructor
public CarryoverRecordsWrapper() {
}
public int deleteCarryOver(int id) {
int removedYear = 0;
if (carryovers != null) {
int index = -1;
for (int i = 0; i < carryovers.size(); i++) {
if (carryovers.get(i).getId() == id) {
index = i;
removedYear = carryovers.get(i).getVacationYear();
break;
}
}
if (index != -1) {
carryovers.remove(index);
}
}
return removedYear;
}// eof
public boolean contains(CarryoverRecord c) {
if (carryovers.contains(c))
return true;
else
return false;
}
}
| [
"mbazhe03@yahoo.com"
] | mbazhe03@yahoo.com |
bc359224dc9c86717bb719e11965765b306cc4e9 | 4c8fb7dde1aed013fef99bb1d3d97f6b3e14e411 | /src/test/java/com/example/amynashamy/journeytracker/ExampleUnitTest.java | 360d94cd32e970c36480d307dade88a18fa8bc8a | [] | no_license | AmyNashh/Journey-Tracker | e32559bf3314fb8b2f7dc29e2d4822bd546352ab | 67bea7b30bb020bade7b61b31b7afee436fb32f8 | refs/heads/master | 2021-01-01T05:17:24.243309 | 2016-05-25T16:20:19 | 2016-05-25T16:20:19 | 59,599,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package com.example.amynashamy.journeytracker;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"amyyasnash@gmail.com"
] | amyyasnash@gmail.com |
fdd74be6e75c8d0214aebc018a40d3b87a941b8b | f8ff1a3bde1492d2853f2748b2de60680400cb7f | /src/main/java/kr/withanimal/board/vo/BoardVO.java | 403a712636af2f818fcd4d5f06e1f815d02df812 | [] | no_license | ymi316/WithAnimal | d7c07894a27e575dd065824436e9eb22105b33e9 | c8ae4143f4a3d449d73f98756c7ed704623f5255 | refs/heads/master | 2020-12-15T06:45:02.719512 | 2020-01-20T00:38:20 | 2020-01-20T00:38:20 | 235,024,525 | 0 | 0 | null | 2020-01-20T05:19:47 | 2020-01-20T05:19:46 | null | UTF-8 | Java | false | false | 771 | java | package kr.withanimal.board.vo;
import java.util.Date;
import javax.xml.bind.annotation.XmlRootElement;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/*
CREATE TABLE withanimal_lost(
content_idx NUMBER PRIMARY KEY NOT NULL,
u_id VARCHAR2(50) NOT NULL,
u_pw VARCHAR2(50) NOT NULL,
u_name VARCHAR2(50) NOT NULL,
content VARCHAR2(500) NULL,
content_regdate TIMESTAMP NULL
);
*/
@XmlRootElement
@AllArgsConstructor
@NoArgsConstructor
@Data
public class BoardVO {
private int content_idx;
private String u_id;
private String u_pw;
private String u_name;
private String subject;
private String content;
private Date content_regdate;
private String ip;
}
| [
"Green_Computer@DESKTOP-912HOCH"
] | Green_Computer@DESKTOP-912HOCH |
1016785a29d1fbd70f301106fd07e87e3881fe25 | 5582e7b84b2331a623f483b3b8f53ded9a2e7ed2 | /tucao/src/main/java/com/aibabel/tucao/utils/MyScrollview.java | f9b3aef68f2e9f8653fd7bb47088d148a53dd782 | [] | no_license | 571034884/zhuner | 451fc9b2ecae06d83ed32b20e4ddb780095b5582 | 6879d978f0c55fe33a46b46117a097131e3b1b65 | refs/heads/master | 2022-01-14T07:08:13.537239 | 2019-03-26T07:09:44 | 2019-03-26T07:09:44 | 189,947,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,289 | java | package com.aibabel.tucao.utils;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.widget.ScrollView;
/**
* Created by zhb on 2017/6/14.
* 嵌套recyclerview,滑动惯性问题
*/
public class MyScrollview extends ScrollView {
private int downX;
private int downY;
private int mTouchSlop;
public MyScrollview(Context context) {
super(context);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
}
public MyScrollview(Context context, AttributeSet attrs) {
super(context, attrs);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
}
public MyScrollview(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
}
@Override
public boolean onInterceptTouchEvent(MotionEvent e) {
int action = e.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
downX = (int) e.getRawX();
downY = (int) e.getRawY();
break;
case MotionEvent.ACTION_MOVE:
int moveY = (int) e.getRawY();
if (Math.abs(moveY - downY) > mTouchSlop) {
return true;
}
}
return super.onInterceptTouchEvent(e);
}
} | [
"wuqinghua@aibabel.com"
] | wuqinghua@aibabel.com |
d205430fe96f5287c6950a277ac756a191cdad58 | ec47ec572bc5eba858c055e2bd4a0e1aa8137619 | /ly-item/ly-item-interface/src/main/java/com/leyou/item/pojo/SpuBo.java | 0e7fe8f78aa06c9776fb17ccfcede29a166397fc | [] | no_license | lingkuraki/leyou | aeb9faa66a30c784a275322570200d89884f96b7 | 07df782f480053e408e77fb0eb20cfe4fbb211c8 | refs/heads/master | 2020-04-29T18:05:56.743616 | 2019-03-18T15:15:56 | 2019-03-18T15:15:56 | 176,291,381 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,226 | java | package com.leyou.item.pojo;
import javax.persistence.Transient;
import java.util.List;
public class SpuBo extends Spu {
// 商品分类名称
@Transient
private String cname;
// 品牌名称
@Transient
private String bname;
// 商品详情
@Transient
private SpuDetail spuDetail;
// sku列表
@Transient
private List<Sku> skus;
public SpuDetail getSpuDetail() {
return spuDetail;
}
public void setSpuDetail(SpuDetail spuDetail) {
this.spuDetail = spuDetail;
}
public List<Sku> getSkus() {
return skus;
}
public void setSkus(List<Sku> skus) {
this.skus = skus;
}
public String getCname() {
return cname;
}
public void setCname(String cname) {
this.cname = cname;
}
public String getBname() {
return bname;
}
public void setBname(String bname) {
this.bname = bname;
}
@Override
public String toString() {
return "SpuBo{" +
"cname='" + cname + '\'' +
", bname='" + bname + '\'' +
", spuDetail=" + spuDetail +
", skus=" + skus +
'}';
}
}
| [
"583378006@qq.com"
] | 583378006@qq.com |
eefc67970eafbf9393e703f1507f394e76612080 | 5d13845c8e26e16c462af281b25aba57f7b04c36 | /poo_1/src/vista/frm_empleado.java | 0d5a54611cb19a48e330140bdd9b9514308a92e3 | [] | no_license | Oliver450F/frm_puestos | 9cd90af6d9033c875d4120676b02485402077eec | 91ac5d4cab0c4eabd11a1ee3f3e15dd8e35f4a21 | refs/heads/main | 2023-07-17T05:47:50.729387 | 2021-09-02T02:50:47 | 2021-09-02T02:50:47 | 402,268,936 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,254 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package vista;
import modelo.Empleado;
import javax.swing.JOptionPane;
import modelo.Conexion;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
/**
*
* @author olive
*/
public class frm_empleado extends javax.swing.JFrame {
/**
* Creates new form frm_empleado
*/
Empleado obj_Empleado;
DefaultTableModel t_empleado;
public frm_empleado() {
initComponents();
obj_Empleado = new Empleado();
tbl_Empleado.setModel(obj_Empleado.leer());
cmb_puesto.addItem("Gerente");
cmb_puesto.addItem("Jefe");
cmb_puesto.addItem("Cajero");
t_empleado = new DefaultTableModel();
String encabezado []={"id","Codigo","Nombres","Apellidos","Direccion","Telefono","Nacimiento","id_Puesto"};
t_empleado.setColumnIdentifiers(encabezado);
tbl_Empleado.setModel(t_empleado);
}
/**
* 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() {
txt_codigo = new javax.swing.JTextField();
txt_nombres = new javax.swing.JTextField();
txt_apellidos = new javax.swing.JTextField();
txt_direccion = new javax.swing.JTextField();
txt_telefono = new javax.swing.JTextField();
txt_fn1 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
btn_aceptar = new javax.swing.JButton();
btn_modificar = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
tbl_Empleado = new javax.swing.JTable();
cmb_puesto = new javax.swing.JComboBox<>();
lbl_puesto = new javax.swing.JLabel();
btn_eliminar = new javax.swing.JButton();
lbl_id = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("Codigo");
jLabel2.setText("Nombres");
jLabel3.setText("Apellidos");
jLabel4.setText("Direccion");
jLabel5.setText("Telefono");
jLabel7.setText("Fecha Nacimiento");
btn_aceptar.setText("Aceptar");
btn_aceptar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_aceptarActionPerformed(evt);
}
});
btn_modificar.setText("Modificar");
btn_modificar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_modificarActionPerformed(evt);
}
});
jButton1.setText("Conexion");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jScrollPane1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jScrollPane1MouseClicked(evt);
}
});
jScrollPane1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
jScrollPane1KeyReleased(evt);
}
});
tbl_Empleado.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tbl_Empleado.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tbl_EmpleadoMouseClicked(evt);
}
});
tbl_Empleado.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
tbl_EmpleadoKeyReleased(evt);
}
});
jScrollPane1.setViewportView(tbl_Empleado);
cmb_puesto.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmb_puestoActionPerformed(evt);
}
});
lbl_puesto.setText("Puesto");
btn_eliminar.setText("Eliminar");
btn_eliminar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_eliminarActionPerformed(evt);
}
});
lbl_id.setText("0");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel7)
.addGap(77, 77, 77)
.addComponent(txt_fn1, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5))
.addGap(38, 38, 38)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txt_nombres)
.addComponent(txt_apellidos)
.addComponent(txt_direccion, javax.swing.GroupLayout.DEFAULT_SIZE, 247, Short.MAX_VALUE)
.addComponent(txt_telefono, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lbl_puesto, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(cmb_puesto, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(40, 40, 40)
.addComponent(txt_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(92, 92, 92)
.addComponent(lbl_id, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addGap(29, 29, 29)
.addComponent(jButton1)
.addGap(40, 40, 40)
.addComponent(btn_aceptar)
.addGap(37, 37, 37)
.addComponent(btn_modificar)
.addGap(18, 18, 18)
.addComponent(btn_eliminar)
.addGap(0, 0, Short.MAX_VALUE)))
.addGap(55, 55, 55))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 623, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txt_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1)))
.addComponent(lbl_id, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txt_nombres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txt_apellidos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txt_direccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txt_telefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5)))
.addGroup(layout.createSequentialGroup()
.addGap(16, 16, 16)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cmb_puesto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbl_puesto))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txt_fn1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btn_aceptar)
.addComponent(btn_modificar)
.addComponent(jButton1)
.addComponent(btn_eliminar))
.addGap(30, 30, 30))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_aceptarActionPerformed
// TODO add your handling code here:
obj_Empleado = new Empleado(0,txt_codigo.getText(),txt_nombres.getText(),txt_apellidos.getText(),txt_direccion.getText(),txt_telefono.getText(),txt_fn1.getText());
obj_Empleado.agregar();
tbl_Empleado.setModel(obj_Empleado.leer());
}//GEN-LAST:event_btn_aceptarActionPerformed
private void btn_modificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_modificarActionPerformed
// TODO add your handling code here:
obj_Empleado = new Empleado(Integer.valueOf(lbl_id.getText()),txt_codigo.getText(),txt_nombres.getText(),txt_apellidos.getText(),txt_direccion.getText(),txt_telefono.getText(),txt_fn1.getText());
obj_Empleado.modificar();
tbl_Empleado.setModel(obj_Empleado.leer());
/* obj_Empleado.setCodigo(txt_codigo.getText());
obj_Empleado.setNombres(txt_nombres.getText());
obj_Empleado.setApellidos(txt_apellidos.getText());
obj_Empleado.setDireccion(txt_direccion.getText());
obj_Empleado.setTelefono(txt_telefono.getText());
//obj_Empleado.setFecha_nacimiento(txt_fn1.getText());
obj_Empleado.agregar();*/
}//GEN-LAST:event_btn_modificarActionPerformed
public void select_datos(){
int fila =tbl_Empleado.getSelectedRow();
lbl_id.setText(tbl_Empleado.getValueAt(fila,0).toString());
txt_codigo.setText(tbl_Empleado.getValueAt(fila,1).toString());
txt_nombres.setText(tbl_Empleado.getValueAt(fila,2).toString());
txt_apellidos.setText(tbl_Empleado.getValueAt(fila,3).toString());
txt_direccion.setText(tbl_Empleado.getValueAt(fila,4).toString());
txt_telefono.setText(tbl_Empleado.getValueAt(fila,5).toString());
txt_fn1.setText(tbl_Empleado.getValueAt(fila,6).toString());
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
// Conexion cn=new Conexion();
//cn.abrir_conexion();
// cn.cerrar_conexion()
}//GEN-LAST:event_jButton1ActionPerformed
private void cmb_puestoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmb_puestoActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_cmb_puestoActionPerformed
private void jScrollPane1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jScrollPane1MouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_jScrollPane1MouseClicked
private void jScrollPane1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jScrollPane1KeyReleased
// TODO add your handling code here:
}//GEN-LAST:event_jScrollPane1KeyReleased
private void tbl_EmpleadoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbl_EmpleadoMouseClicked
// TODO add your handling code here:
select_datos();
}//GEN-LAST:event_tbl_EmpleadoMouseClicked
private void tbl_EmpleadoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tbl_EmpleadoKeyReleased
// TODO add your handling code here:
select_datos();
}//GEN-LAST:event_tbl_EmpleadoKeyReleased
private void btn_eliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_eliminarActionPerformed
// TODO add your handling code here:
int opcion =JOptionPane.showConfirmDialog(null, "¿Desea eliminar el registro?","opcion",JOptionPane.YES_OPTION);
if(opcion==0){
obj_Empleado = new Empleado();
obj_Empleado.setId(Integer.valueOf(lbl_id.getText()));
obj_Empleado.eliminar();
tbl_Empleado.setModel(obj_Empleado.leer());
}//GEN-LAST:event_btn_eliminarActionPerformed
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(frm_empleado.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(frm_empleado.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(frm_empleado.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(frm_empleado.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new frm_empleado().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btn_aceptar;
private javax.swing.JButton btn_eliminar;
private javax.swing.JButton btn_modificar;
private javax.swing.JComboBox<String> cmb_puesto;
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel7;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel lbl_id;
private javax.swing.JLabel lbl_puesto;
private javax.swing.JTable tbl_Empleado;
private javax.swing.JTextField txt_apellidos;
private javax.swing.JTextField txt_codigo;
private javax.swing.JTextField txt_direccion;
private javax.swing.JTextField txt_fn1;
private javax.swing.JTextField txt_nombres;
private javax.swing.JTextField txt_telefono;
// End of variables declaration//GEN-END:variables
}
| [
"oliver450F"
] | oliver450F |
7a945ae61baeadd8a43b116e6bc3ee915718ded9 | 3771b97a96f67ec0c8967cd601f25cdd47ff80aa | /app/src/main/java/com/yitong/requestframe/download/DownloadListener.java | c95f993f41943274ef7ab83b54f317789291c2c0 | [] | no_license | hejinyi23/RequestFrame | 89e291838aece7cdb4333667c8d3fac82c663abb | adb8c993f979883380e7be9a361ba230cf0a5489 | refs/heads/master | 2020-05-22T15:11:02.789193 | 2019-03-08T12:48:43 | 2019-03-08T12:48:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 242 | java | package com.yitong.requestframe.download;
/**
* @Author Daniel Zhang
* @Time 2019/2/26 22:44
* @E-Mail zhanggaocheng@yitong.com.cn
* @Description
*/
public interface DownloadListener {
void onProgress(long total, long current);
}
| [
"194960998@qq.com"
] | 194960998@qq.com |
589b122ba4c9f7b52d23d30c6b59a699d89460e1 | 22c93d9ba57be6a3d5caee390dfe5e2627273011 | /src/glslplugin/lang/elements/statements/GLSLBreakStatement.java | 16b7a6b3d495384ebdeeb4513e15095550cabd0c | [] | no_license | TheRealSpaceShip/glsl4idea | 363420b3e8b8daa013d2e06532a5b1fff42cffcf | ff9b13b5b35f8b34e1065ebcf4ec5f50288ae28a | refs/heads/master | 2016-08-12T11:02:58.579417 | 2013-05-03T11:06:06 | 2013-05-03T11:06:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,332 | java | /*
* Copyright 2010 Jean-Paul Balabanian and Yngve Devik Hammersland
*
* This file is part of glsl4idea.
*
* Glsl4idea is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* Glsl4idea is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with glsl4idea. If not, see <http://www.gnu.org/licenses/>.
*/
package glslplugin.lang.elements.statements;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
/**
* GLSLDeclarationStatement is ...
*
* @author Yngve Devik Hammersland
* Date: Jan 28, 2009
* Time: 6:13:58 PM
*/
public class GLSLBreakStatement extends GLSLStatement {
public GLSLBreakStatement(@NotNull ASTNode astNode) {
super(astNode);
}
// TODO: Implement
@Override
public String toString() {
return "Break Statement";
}
} | [
"lysak.igor@gmail.com"
] | lysak.igor@gmail.com |
9951e3e08840d5e8d398bb726cd86f9b7fd727a8 | 4eecf8fe956a6bd4cb429cf09382cc89a914d605 | /app/src/main/java/com/lqr/wechat/utils/StringUtils.java | ecda13d60a447e800719c9e3a04d63f86f59f589 | [] | no_license | MiloMallo/HeartFollow-master | 3be6c5c0c9b63b42a27e5e52f8f751020fa15c26 | 32b4d8d9fa1e01887154b7cca4a6e904bd055967 | refs/heads/master | 2021-06-20T19:04:22.679551 | 2017-08-12T04:28:42 | 2017-08-12T04:28:42 | 91,869,054 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,722 | java | package com.lqr.wechat.utils;
import java.util.List;
/**
* @创建者 CSDN_LQR
* @描述 字符串工具类
*/
public class StringUtils {
/**
* 得到不为空的字符串
*
* @param o
* @return
*/
public static String getNotNULLStr(Object o) {
return o == null ? "" : o.toString();
}
/**
* 判断字符串或集合是否为空
*
* @param o
* @return
*/
public static boolean isEmpty(Object o) {
if (o instanceof List)
return ((List) o).size() == 0;
return o == null || o.toString().equals("");
}
/**
* 判断字符串是否为空(空格字符串也是blank)
*
* @param s
* @return
*/
public static boolean isBlank(final CharSequence s) {
if (s == null) {
return true;
}
for (int i = 0; i < s.length(); i++) {
if (!Character.isWhitespace(s.charAt(i))) {
return false;
}
}
return true;
}
/**
* 函数传入汉字的Unicode编码字符串,返回相应的汉字字符串
*
* @return
*/
public static String decodeUnicode(final String utfString) {
StringBuilder sb = new StringBuilder();
int i = -1;
int pos = 0;
while ((i = utfString.indexOf("\\u", pos)) != -1) {
sb.append(utfString.substring(pos, i));
if (i + 5 < utfString.length()) {
pos = i + 6;
sb.append((char) Integer.parseInt(utfString.substring(i + 2, i + 6), 16));
}
}
sb.append(utfString.substring(pos, utfString.length()));
return sb.toString();
}
}
| [
"1229555035@qq.com"
] | 1229555035@qq.com |
68f3708b26cc99956055c420812f8aea98cdc021 | f0992aca114b595f57fe5e74a47ed3af0e26237b | /source/tools/jboss-v7-tool/src/main/java/com/uc4/ara/feature/jbossv7/schemas/Messaging.java | 11a8e4a951da958e4bead9d78e98c642ee00bc98 | [] | no_license | Automic-Community/red-hat-jboss-v7-action-pack | 3d7b1420245d2f4b88a7332139dc6b2c301f4d9a | 90fe8ae1483a6d124528aa76b371f4d0e069ef21 | refs/heads/master | 2023-01-12T21:59:27.809924 | 2020-11-20T13:01:26 | 2020-11-20T13:01:26 | 292,008,144 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,238 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.12.04 at 03:31:00 PM ICT
//
package com.uc4.ara.feature.jbossv7.schemas;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for Messaging complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="Messaging">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="hornetq-server" maxOccurs="unbounded" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="clustered" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="jmx-domain" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="management-address" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="jms-queues">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="jms-queue" type="{http://www.example.org/JBossV7SnapshotSchema}JmsQueue" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="jms-topics">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="jms-topic" type="{http://www.example.org/JBossV7SnapshotSchema}JmsTopic" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" default="Messaging Subsystem" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Messaging", propOrder = {
"hornetqServer"
})
public class Messaging {
@XmlElement(name = "hornetq-server", nillable = true)
protected List<Messaging.HornetqServer> hornetqServer;
@XmlAttribute
protected String name;
/**
* Gets the value of the hornetqServer property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the hornetqServer property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getHornetqServer().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Messaging.HornetqServer }
*
*
*/
public List<Messaging.HornetqServer> getHornetqServer() {
if (hornetqServer == null) {
hornetqServer = new ArrayList<Messaging.HornetqServer>();
}
return this.hornetqServer;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
if (name == null) {
return "Messaging Subsystem";
} else {
return name;
}
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="clustered" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="jmx-domain" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="management-address" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="jms-queues">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="jms-queue" type="{http://www.example.org/JBossV7SnapshotSchema}JmsQueue" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="jms-topics">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="jms-topic" type="{http://www.example.org/JBossV7SnapshotSchema}JmsTopic" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"clustered",
"jmxDomain",
"version",
"managementAddress",
"jmsQueues",
"jmsTopics"
})
public static class HornetqServer {
@XmlElement(required = true)
protected String clustered;
@XmlElement(name = "jmx-domain", required = true)
protected String jmxDomain;
@XmlElement(required = true)
protected String version;
@XmlElement(name = "management-address", required = true)
protected String managementAddress;
@XmlElement(name = "jms-queues", required = true)
protected Messaging.HornetqServer.JmsQueues jmsQueues;
@XmlElement(name = "jms-topics", required = true)
protected Messaging.HornetqServer.JmsTopics jmsTopics;
@XmlAttribute
protected String name;
/**
* Gets the value of the clustered property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getClustered() {
return clustered;
}
/**
* Sets the value of the clustered property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setClustered(String value) {
this.clustered = value;
}
/**
* Gets the value of the jmxDomain property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getJmxDomain() {
return jmxDomain;
}
/**
* Sets the value of the jmxDomain property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setJmxDomain(String value) {
this.jmxDomain = value;
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersion() {
return version;
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersion(String value) {
this.version = value;
}
/**
* Gets the value of the managementAddress property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getManagementAddress() {
return managementAddress;
}
/**
* Sets the value of the managementAddress property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setManagementAddress(String value) {
this.managementAddress = value;
}
/**
* Gets the value of the jmsQueues property.
*
* @return
* possible object is
* {@link Messaging.HornetqServer.JmsQueues }
*
*/
public Messaging.HornetqServer.JmsQueues getJmsQueues() {
return jmsQueues;
}
/**
* Sets the value of the jmsQueues property.
*
* @param value
* allowed object is
* {@link Messaging.HornetqServer.JmsQueues }
*
*/
public void setJmsQueues(Messaging.HornetqServer.JmsQueues value) {
this.jmsQueues = value;
}
/**
* Gets the value of the jmsTopics property.
*
* @return
* possible object is
* {@link Messaging.HornetqServer.JmsTopics }
*
*/
public Messaging.HornetqServer.JmsTopics getJmsTopics() {
return jmsTopics;
}
/**
* Sets the value of the jmsTopics property.
*
* @param value
* allowed object is
* {@link Messaging.HornetqServer.JmsTopics }
*
*/
public void setJmsTopics(Messaging.HornetqServer.JmsTopics value) {
this.jmsTopics = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="jms-queue" type="{http://www.example.org/JBossV7SnapshotSchema}JmsQueue" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"jmsQueue"
})
public static class JmsQueues {
@XmlElement(name = "jms-queue", nillable = true)
protected List<JmsQueue> jmsQueue;
/**
* Gets the value of the jmsQueue property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the jmsQueue property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getJmsQueue().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JmsQueue }
*
*
*/
public List<JmsQueue> getJmsQueue() {
if (jmsQueue == null) {
jmsQueue = new ArrayList<JmsQueue>();
}
return this.jmsQueue;
}
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="jms-topic" type="{http://www.example.org/JBossV7SnapshotSchema}JmsTopic" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"jmsTopic"
})
public static class JmsTopics {
@XmlElement(name = "jms-topic", nillable = true)
protected List<JmsTopic> jmsTopic;
/**
* Gets the value of the jmsTopic property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the jmsTopic property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getJmsTopic().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JmsTopic }
*
*
*/
public List<JmsTopic> getJmsTopic() {
if (jmsTopic == null) {
jmsTopic = new ArrayList<JmsTopic>();
}
return this.jmsTopic;
}
}
}
}
| [
"ankush.purwar@nagarro.com"
] | ankush.purwar@nagarro.com |
e12440963eec141369483ff03b5c45c5f8d476fa | f72cb55daa5ad2d90fb038e78075eaf6691c32af | /modules/global/src/com/company/facilitymanagement/service/AppointmentService.java | 52fc623521b3f21667c141a22ddb7c660df06cef | [] | no_license | prernarai/FacilityManagement | 20e4766be8c4683db62b898afdbf6551e79752b6 | d8cf8245cffd561c83ec11ff9781f5f3fc99e78e | refs/heads/master | 2020-09-24T02:38:48.251906 | 2019-12-06T06:53:48 | 2019-12-06T06:53:48 | 225,641,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 445 | java | package com.company.facilitymanagement.service;
import com.company.facilitymanagement.entity.ComplaintModel.Complaint;
import com.company.facilitymanagement.entity.ScheduleMgmt.Appointment;
import com.haulmont.cuba.core.global.DataManager;
import javax.inject.Inject;
import java.util.List;
public interface AppointmentService {
String NAME = "facilitymanagement_AppointmentService";
public List<Appointment> getAppointmentList();
} | [
"amit-rai@outlook.com"
] | amit-rai@outlook.com |
f87a70c7ac7460738ab8b32dfa9d02729638df4b | ce719d08d68de247896e718e4c3ab5c7640a8a8f | /springboot/social-multiplication/src/main/java/microservices/book/socialmultiplication/domain/Multiplication.java | b4958072e5616b54b6ec65e10ee6c9755218f47e | [] | no_license | Uenderley/estudo | 0c82abee2a3b5cb4eb9fb51ff32539adda987bf4 | 1d15c39bc927b77a4b362d898c018527e6f20721 | refs/heads/master | 2023-01-12T17:08:53.559913 | 2021-03-26T04:07:18 | 2021-03-26T04:07:18 | 110,310,947 | 0 | 1 | null | 2023-01-07T11:54:32 | 2017-11-11T02:16:42 | Java | UTF-8 | Java | false | false | 741 | java | package microservices.book.socialmultiplication.domain;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* This class represents a Multiplication (a * b).
*/
@RequiredArgsConstructor
@Getter
@ToString
@EqualsAndHashCode
@Entity
public final class Multiplication {
@Id
@GeneratedValue
@Column(name = "MULTIPLICATION_ID")
private Long id;
// Both factors
private final int factorA;
private final int factorB;
// Empty constructor for JSON/JPA
Multiplication() {
this(0, 0);
}
} | [
"uenderley.saraiva@cnj.jus.br"
] | uenderley.saraiva@cnj.jus.br |
8054ac2cee5161f6f026ad8610fcde2885a8cefa | a1014298e6976103434a6124d7b2ff219d7f5d18 | /RISCV_final_project/mars/venus/FileDumpMemoryAction.java | 3a4a339c6698256265c71dffac4da858b259841c | [
"MIT"
] | permissive | MAYAPERETZ/Project | bd593a136361bb1ede21a9b92b9d0399a813c601 | 3be9e361582576801646d58806ff679d45a62c1d | refs/heads/master | 2020-06-25T01:37:29.970604 | 2019-11-19T18:57:55 | 2019-11-19T18:57:55 | 199,156,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,308 | java | package mars.venus;
import mars.*;
import mars.util.GenMath;
import mars.util.*;
import mars.riscv.dump.*;
import mars.riscv.hardware.*;
import mars.riscv.hardware.memory.Memory;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import java.io.*;
import java.util.*;
import javax.swing.plaf.basic.*;
/*
Copyright (c) 2003-2008, Pete Sanderson and Kenneth Vollmar
Developed by Pete Sanderson (psanderson@otterbein.edu)
and Kenneth Vollmar (kenvollmar@missouristate.edu)
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.
(MIT license, http://www.opensource.org/licenses/mit-license.html)
*/
/**
* Action for the File -> Save For Dump Memory menu item
*/
public class FileDumpMemoryAction extends GuiAction {
private JDialog dumpDialog;
private static final String title = "Dump Memory To File";
private Number[] segmentListBaseArray;
private Number[] segmentListHighArray;
private JComboBox segmentListSelector;
private JComboBox formatListSelector;
public FileDumpMemoryAction(String name, Icon icon, String descrip,
Integer mnemonic, KeyStroke accel, GUI mainUI) {
super(name, icon, descrip, mnemonic, accel, mainUI);
}
public void actionPerformed(ActionEvent e){
dumpMemory();
}
/* Save the memory segment in a supported format.*/
private void dumpMemory() {
dumpDialog = createDumpDialog();
dumpDialog.pack();
dumpDialog.setLocationRelativeTo(Globals.getGui());
dumpDialog.setVisible(true);
}
// The dump dialog that appears when menu item is selected.
private JDialog createDumpDialog() {
JDialog dumpDialog = new JDialog(Globals.getGui(), title, true);
dumpDialog.setContentPane(buildDialogPanel());
dumpDialog.setDefaultCloseOperation(
JDialog.DO_NOTHING_ON_CLOSE);
dumpDialog.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent we) {
closeDialog();
}
});
return dumpDialog;
}
// Set contents of dump dialog.
private JPanel buildDialogPanel() {
JPanel contents = new JPanel(new BorderLayout(20,20));
contents.setBorder(new EmptyBorder(10,10,10,10));
// A series of parallel arrays representing the memory segments that can be dumped.
String[] segmentArray = MemoryDump.getSegmentNames();
Number[] baseAddressArray = MemoryDump.getBaseAddresses();
Number[] limitAddressArray = MemoryDump.getLimitAddresses(segmentArray);
Number[] highAddressArray = new Number[segmentArray.length];
// These three are allocated and filled by buildDialogPanel() and used by action listeners.
String[] segmentListArray = new String[segmentArray.length];
segmentListBaseArray = new Number[segmentArray.length];
segmentListHighArray = new Number[segmentArray.length];
// Calculate the actual highest address to be dumped. For text segment, this depends on the
// program length (number of machine code instructions). For data segment, this depends on
// how many MARS 4K word blocks have been referenced during assembly and/or execution.
// Then generate label from concatentation of segmentArray[i], baseAddressArray[i]
// and highAddressArray[i]. This lets user know exactly what range will be dumped. Initially not
// editable but maybe add this later.
// If there is nothing to dump (e.g. address of first null == base address), then
// the segment will not be listed.
int segmentCount = 0;
for (int i = 0; i< segmentArray.length; i++) {
try {
highAddressArray[i] = GenMath.sub(Globals.memory.getAddressOfFirstNull(
baseAddressArray[i], limitAddressArray[i]), Memory.WORD_LENGTH_BYTES);
} // Exception will not happen since the Memory base and limit addresses are on word boundaries!
catch (AddressErrorException aee) {
highAddressArray[i] = GenMath.sub(baseAddressArray[i], Memory.WORD_LENGTH_BYTES);
}
if (!Math2.isLt(highAddressArray[i], baseAddressArray[i])) {
segmentListBaseArray[segmentCount] = baseAddressArray[i];
segmentListHighArray[segmentCount] = highAddressArray[i];
segmentListArray[segmentCount] =
segmentArray[i] + " (" + Binary.currentNumToHexString(baseAddressArray[i]) +
" - " + Binary.currentNumToHexString(highAddressArray[i]) + ")";
segmentCount++;
}
}
// It is highly unlikely that no segments remain after the null check, since
// there will always be at least one instruction (.text segment has one non-null).
// But just in case...
if (segmentCount == 0) {
contents.add(new Label("There is nothing to dump!"), BorderLayout.NORTH);
JButton OKButton = new JButton("OK");
OKButton.addActionListener(e -> closeDialog());
contents.add(OKButton, BorderLayout.SOUTH);
return contents;
}
// This is needed to assure no null array elements in ComboBox list.
if (segmentCount < segmentListArray.length) {
String[] tempArray = new String[segmentCount];
System.arraycopy(segmentListArray, 0, tempArray, 0, segmentCount);
segmentListArray = tempArray;
}
// Create segment selector. First element selected by default.
segmentListSelector = new JComboBox(segmentListArray);
segmentListSelector.setSelectedIndex(0);
JPanel segmentPanel = new JPanel(new BorderLayout());
segmentPanel.add(new Label("Memory Segment"), BorderLayout.NORTH);
segmentPanel.add(segmentListSelector);
contents.add(segmentPanel, BorderLayout.WEST);
// Next, create list of all available dump formats.
ArrayList dumpFormats = (new DumpFormatLoader()).loadDumpFormats();
formatListSelector = new JComboBox(dumpFormats.toArray());
formatListSelector.setRenderer(new DumpFormatComboBoxRenderer(formatListSelector));
formatListSelector.setSelectedIndex(0);
JPanel formatPanel = new JPanel(new BorderLayout());
formatPanel.add(new Label("Dump Format"), BorderLayout.NORTH);
formatPanel.add(formatListSelector);
contents.add(formatPanel, BorderLayout.EAST);
// Bottom row - the control buttons for Dump and Cancel
Box controlPanel = Box.createHorizontalBox();
JButton dumpButton = new JButton("Dump To File...");
dumpButton.addActionListener(
e -> {
if (performDump(segmentListBaseArray[segmentListSelector.getSelectedIndex()],
segmentListHighArray[segmentListSelector.getSelectedIndex()],
(DumpFormat)formatListSelector.getSelectedItem())) {
closeDialog();
}
});
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(
e -> closeDialog());
controlPanel.add(Box.createHorizontalGlue());
controlPanel.add(dumpButton);
controlPanel.add(Box.createHorizontalGlue());
controlPanel.add(cancelButton);
controlPanel.add(Box.createHorizontalGlue());
contents.add(controlPanel,BorderLayout.SOUTH);
return contents;
}
// User has clicked "Dump" button, so launch a file chooser then get
// segment (memory range) and format selections and save to the file.
private boolean performDump(Number firstAddress, Number lastAddress, DumpFormat format) {
File theFile;
JFileChooser saveDialog;
boolean operationOK = false;
saveDialog = new JFileChooser(mainUI.getEditor().getCurrentSaveDirectory());
saveDialog.setDialogTitle(title);
while (!operationOK) {
int decision = saveDialog.showSaveDialog(mainUI);
if (decision != JFileChooser.APPROVE_OPTION)
return false;
theFile = saveDialog.getSelectedFile();
operationOK = true;
if (theFile.exists()) {
int overwrite = JOptionPane.showConfirmDialog(mainUI,
"File "+theFile.getName()+" already exists. Do you wish to overwrite it?",
"Overwrite existing file?",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
switch (overwrite) {
case JOptionPane.YES_OPTION :
operationOK = true;
break;
case JOptionPane.NO_OPTION :
operationOK = false;
break;
case JOptionPane.CANCEL_OPTION :
return false;
default : // should never occur
return false;
}
}
if (operationOK) {
try {
format.dumpMemoryRange(theFile, firstAddress, lastAddress);
}
catch (AddressErrorException | IOException ignored) { }
}
}
return true;
}
// We're finished with this modal dialog.
private void closeDialog() {
dumpDialog.setVisible(false);
dumpDialog.dispose();
}
// Display tool tip for dump format list items. Got the technique from
// http://forum.java.sun.com/thread.jspa?threadID=488762&messageID=2292482
private class DumpFormatComboBoxRenderer extends BasicComboBoxRenderer {
private JComboBox myMaster;
public DumpFormatComboBoxRenderer(JComboBox myMaster) {
super();
this.myMaster = myMaster;
}
public Component getListCellRendererComponent( JList list, Object value, int index,
boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
setToolTipText(value.toString());
if (index >=0 && ((DumpFormat)(myMaster.getItemAt(index))).getDescription() != null) {
setToolTipText(((DumpFormat)(myMaster.getItemAt(index))).getDescription());
}
return this;
}
}
} | [
"maya.peretz2@gmail.com"
] | maya.peretz2@gmail.com |
4fa1bbce4ec2c3bfead7815b768c01d573a398cb | c1a068aa5b52792b39a4c9000000422f9db6459f | /MainActivity.java | a7436668f68861fb40d900f0479269308d2a6629 | [] | no_license | gitrexhugh/swipe_view | ac055931db1f6e1901aa309227a997fbafdceea2 | 1a7f4e77336bc72e60076297d68fa19251116ce5 | refs/heads/master | 2020-03-29T08:42:03.438846 | 2018-09-21T07:22:53 | 2018-09-21T07:22:53 | 149,723,933 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,565 | java | package com.example.hugh.swipe_view_t01;
//reference:https://medium.com/@droidbyme/android-material-design-tabs-tab-layout-with-swipe-884085ae80ff
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
//-----
public class MainActivity extends AppCompatActivity {
private TabAdapter adapter;
private TabLayout tabLayout;
private ViewPager viewPager;
private int test;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().hide();//隱藏預設標題(繼承AppCompatActivity時可用)
viewPager = (ViewPager) findViewById(R.id.viewPager);
tabLayout = (TabLayout) findViewById(R.id.tabLayout);
adapter = new TabAdapter(getSupportFragmentManager());
adapter.addFragment(new Tab1Fragment(), "Tab 1");
adapter.addFragment(new Tab2Fragment(), "Tab 2");
adapter.addFragment(new Tab3Fragment(), "Tab 3");
viewPager.setAdapter(adapter);
tabLayout.setupWithViewPager(viewPager);
int[] tabIcons = {
R.drawable.backlight1_xxxhdpi,
R.drawable.backlight_camera1_xxxhdpi,
R.drawable.screenlight_camera1_xxxhdpi
};
tabLayout.getTabAt(0).setIcon(tabIcons[0]);
tabLayout.getTabAt(1).setIcon(tabIcons[1]);
tabLayout.getTabAt(2).setIcon(tabIcons[2]);
}
}
| [
"windhugh@gmail.com"
] | windhugh@gmail.com |
7717824c27c0854543b6fcc7398bd6c8da0a8e2b | 1227175c8cab4215e116cfcffe006e322e3fee61 | /src/main/java/com/example/Authentication/RatingConsumerConfig.java | bd7e4ac9f29965f2e3852a720b661bb5ad478d84 | [] | no_license | ritikshuklacse/Authentication-MicroService | ff304f652a035490490a86412d7ee649d86c77c7 | 3ca3b358d30ea4126fdc67593645274e49ea77be | refs/heads/main | 2023-02-19T08:22:31.684100 | 2021-01-20T13:58:58 | 2021-01-20T13:58:58 | 331,327,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,638 | java | package com.example.Authentication;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
import java.util.HashMap;
import java.util.Map;
@EnableKafka
@Configuration
public class RatingConsumerConfig {
@Bean
public ConsumerFactory<String, String> consumerFactory() {
Map<String, Object> props = new HashMap<>();
props.put(
ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,
"http://10.177.1.254:9092");
props.put(
ConsumerConfig.GROUP_ID_CONFIG,
"abc");
props.put(
ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,
StringDeserializer.class);
props.put(
ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,
StringDeserializer.class);
return new DefaultKafkaConsumerFactory<>(props);
}
@Bean
public ConcurrentKafkaListenerContainerFactory<String, String>
kafkaListenerContainerFactory() {
ConcurrentKafkaListenerContainerFactory<String, String> factory =
new ConcurrentKafkaListenerContainerFactory<>();
factory.setConsumerFactory(consumerFactory());
return factory;
}
}
| [
"41631937+ritikshuklacse@users.noreply.github.com"
] | 41631937+ritikshuklacse@users.noreply.github.com |
99be43afa911dd9c6b216e8bd76b54a194493957 | 1627f39bdce9c3fe5bfa34e68c276faa4568bc35 | /src/implementation/Boj10539.java | ca3ceb40ebe88d02036d8ca97d830c7b0245cfb5 | [
"Apache-2.0"
] | permissive | minuk8932/Algorithm_BaekJoon | 9ebb556f5055b89a5e5c8d885b77738f1e660e4d | a4a46b5e22e0ed0bb1b23bf1e63b78d542aa5557 | refs/heads/master | 2022-10-23T20:08:19.968211 | 2022-10-02T06:55:53 | 2022-10-02T06:55:53 | 84,549,122 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 854 | java | package implementation;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Boj10539 {
public static final String SPACE = " ";
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
int N = Integer.parseInt(br.readLine());
int[] A = new int[N];
int chk = 0;
int[] sum = new int[N];
StringTokenizer st = new StringTokenizer(br.readLine(), " ");
for(int i = 0; i < N; i++){
A[i] = Integer.parseInt(st.nextToken());
if(i >= 1){
sum[i] = ((i+1) * A[i]) - chk;
} else {
sum[i] = A[0];
}
chk += sum[i];
sb.append(sum[i]).append(SPACE);
}
System.out.println(sb.toString());
}
}
| [
"minuk8932@naver.com"
] | minuk8932@naver.com |
9aedc5c81d09b647c8cc762b3c9f831a17ab6887 | af7c55c0f260a0060c1acf5f60f169839f6e389d | /src/main/java/moa/streams/filters/HashingTrickFilterBinary.java | 6177dd614f27c58f06d1807dde1ea2686c628d0d | [] | no_license | marouabahri/CS-ARF | 6be73a351c104f779e50764e565b5a33e88fa0f4 | 523667cb1cd1bc8199d0ddc70976e0d98941f5ba | refs/heads/master | 2021-04-17T16:12:25.463026 | 2020-03-24T15:59:40 | 2020-03-24T15:59:40 | 249,458,280 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,747 | java |
package moa.streams.filters;
import com.github.javacliparser.IntOption;
import com.google.common.hash.Hashing;
import com.yahoo.labs.samoa.instances.Attribute;
import com.yahoo.labs.samoa.instances.DenseInstance;
import com.yahoo.labs.samoa.instances.Instance;
import com.yahoo.labs.samoa.instances.Instances;
import com.yahoo.labs.samoa.instances.InstancesHeader;
import java.util.Arrays;
import moa.core.FastVector;
import moa.core.InstanceExample;
import moa.streams.InstanceStream;
/**
* Filter to perform feature hashing, to reduce the number of attributes. It applies
* a hash function to the features and using their hash values as indices directly,
* rather than looking the indices up in an associative array.
*
* @author Maroua Bahri
*/
public class HashingTrickFilterBinary extends AbstractStreamFilter {
private static final long serialVersionUID = 1L;
public IntOption dim = new IntOption("FeatureDimension", 'd',
"the target feature dimension.", 10);
protected InstancesHeader streamHeader;
protected FastVector attributes;
@Override
protected void restartImpl() {
this.streamHeader = null;
}
@Override
public InstancesHeader getHeader() {
return this.streamHeader;
}
@Override
public InstanceExample nextInstance() {
Instance sparseInstance = (Instance) this.inputStream.nextInstance().getData();
if (streamHeader == null) {
//Create a new header
this.attributes = new FastVector();
String [] attribut = new String []{"0","1"} ;
for (int i = 0; i < this.dim.getValue(); i++) {
attributes.addElement(new Attribute("nominal" + (i + 1),
Arrays.asList(attribut)));
}
this.attributes.addElement(sparseInstance.classAttribute());
this.streamHeader = new InstancesHeader(new Instances(
getCLICreationString(InstanceStream.class), this.attributes, 0));
this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1);
}
int [] hashVal = hashVector(sparseInstance,this.dim.getValue(), Hashing.murmur3_128());
return new InstanceExample(transformedInstance(sparseInstance, Arrays.stream(hashVal).asDoubleStream().toArray()));
}
public DenseInstance transformedInstance(Instance sparseInst, double [] hashVal) {
Instances header = this.streamHeader;
double[] attributeValues = new double[header.numAttributes()];
for(int i = 0 ; i < header.numAttributes()-1 ; i++) {
attributeValues[i] = hashVal[i];
}
attributeValues[attributeValues.length-1] = sparseInst.classValue();
DenseInstance newInstance = new DenseInstance(1.0, attributeValues);
newInstance.setDataset(header);
header.add(newInstance);
return newInstance;
}
@Override
public void getDescription(StringBuilder sb, int indent) {
// TODO Auto-generated method stub
}
public int[] hashVector(Instance instance, int n,
com.google.common.hash.HashFunction hashFunction) {
int [] denseValues = new int [n];
for (int i = 0 ; i < n ; i++) {
denseValues[i] = 0;
}
for (int i = 0; i < instance.numAttributes()-1 ; i++){
double diff = Math.abs(instance.value(i));
if( diff > Double.MIN_NORMAL) {
int hash = hashFunction.hashInt(i).asInt();
int bucket = Math.abs(hash) % n;
denseValues[bucket] = (1);
}
}
return denseValues;
}
} | [
"bahrimarouaa@gmail.com"
] | bahrimarouaa@gmail.com |
b1aa41ec837fc3805344a0d56908b01d24d075c2 | 42d098e6001c2fed6e86f754b667c5a886d9f406 | /src/J03Encapsulation/Encapsulation22.java | bcc6cadbbb1a31fe0e5e2e58f9deb50733c5e988 | [] | no_license | Caoanhtu/JavaOOPCodeLearnIO | a0194c68c5176f5812534d1e6473bcf79dffe013 | 10d7d5e70af81fdcd48eb1c4d057898a4d0d2a4c | refs/heads/master | 2022-11-17T18:27:19.723668 | 2020-07-18T02:52:24 | 2020-07-18T02:52:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,331 | java | package J03Encapsulation;
/*
Rectangle
-length: double
-width: double
+Rectangle
+Rectangle(length: double, width: double)
+setLength(length: double): void
+getLength(): double
+setWidth(width: double): void
+getWidth(): double
+getArea(): double
+getPerimeter(): double
*/
public class Encapsulation22 {
public static void main(String[] args) {
Rectangle r = new Rectangle(4, 5);
System.out.println("Area: " + r.getArea());
System.out.println("Perimeter: " + r.getPerimeter());
r.setLength(2);
r.setWidth(3);
System.out.println("Area: " + r.getArea());
System.out.println("Perimeter: " + r.getPerimeter());
}
}
class Rectangle {
private double length;
private double width;
public Rectangle() {
}
public Rectangle(double length, double width) {
this.length = length;
this.width = width;
}
public void setLength(double length) {
this.length = length;
}
public double getLength() {
return length;
}
public void setWidth(double width) {
this.width = width;
}
public double getWidth() {
return width;
}
public double getArea() {
return length * width;
}
public double getPerimeter() {
return (length + width) * 2;
}
} | [
"vegetaz@outlook.com"
] | vegetaz@outlook.com |
53ceb09cd2ae7f702ce47ec79d294fac4f2335b3 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/serge-rider--dbeaver/5879593f44c6a11dd22c0c56f1e2ee4f45ece200/after/DBeaverCore.java | 9eb92a4e14d73ef450819c7c07632f7baea58862 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,328 | java | /*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2015 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.jkiss.dbeaver.core;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPApplication;
import org.jkiss.dbeaver.model.DBPPreferenceStore;
import org.jkiss.dbeaver.model.DBPProjectManager;
import org.jkiss.dbeaver.model.data.DBDValueHandlerRegistry;
import org.jkiss.dbeaver.model.qm.QMUtils;
import org.jkiss.dbeaver.registry.DataTypeProviderRegistry;
import org.jkiss.dbeaver.registry.PluginServiceRegistry;
import org.jkiss.dbeaver.runtime.IPluginService;
import org.jkiss.dbeaver.runtime.net.GlobalProxyAuthenticator;
import org.jkiss.dbeaver.runtime.net.GlobalProxySelector;
import org.jkiss.dbeaver.model.navigator.DBNModel;
import org.jkiss.dbeaver.model.qm.QMController;
import org.jkiss.dbeaver.registry.DataSourceProviderRegistry;
import org.jkiss.dbeaver.model.runtime.OSDescriptor;
import org.jkiss.dbeaver.registry.ProjectRegistry;
import org.jkiss.dbeaver.runtime.qm.QMControllerImpl;
import org.jkiss.dbeaver.runtime.qm.QMLogFileWriter;
import org.osgi.framework.Bundle;
import org.osgi.framework.Version;
import java.io.File;
import java.io.IOException;
import java.net.Authenticator;
import java.net.ProxySelector;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
/**
* DBeaverCore
*/
public class DBeaverCore implements DBPApplication {
static final Log log = Log.getLog(DBeaverCore.class);
private static final String LOB_DIR = ".lob"; //$NON-NLS-1$
public static final String TEMP_PROJECT_NAME = ".dbeaver-temp"; //$NON-NLS-1$
static DBeaverCore instance;
private static boolean standalone = false;
private static volatile boolean isClosing = false;
private IWorkspace workspace;
private IProject tempProject;
private OSDescriptor localSystem;
private DBNModel navigatorModel;
private QMControllerImpl queryManager;
private QMLogFileWriter qmLogWriter;
private ProjectRegistry projectRegistry;
private final List<IPluginService> activatedServices = new ArrayList<IPluginService>();
private static boolean disposed = false;
public static DBeaverCore getInstance()
{
if (instance == null) {
synchronized (DBeaverCore.class) {
if (disposed) {
throw new IllegalStateException("DBeaver core already disposed");
}
if (instance == null) {
// Initialize DBeaver Core
DBeaverCore.createInstance();
}
}
}
return instance;
}
private static DBeaverCore createInstance()
{
log.debug("Initializing " + getProductTitle());
if (Platform.getProduct() != null) {
Bundle definingBundle = Platform.getProduct().getDefiningBundle();
if (definingBundle != null) {
log.debug("Host plugin: " + definingBundle.getSymbolicName() + " " + definingBundle.getVersion());
}
}
try {
instance = new DBeaverCore();
instance.initialize();
return instance;
} catch (Throwable e) {
log.error("Error initializing DBeaverCore", e);
throw new IllegalStateException("Error initializing DBeaverCore", e);
}
}
public static String getCorePluginID()
{
return DBeaverActivator.getInstance().getBundle().getSymbolicName();
}
public static boolean isStandalone()
{
return standalone;
}
public static void setStandalone(boolean flag)
{
standalone = flag;
}
public static boolean isClosing()
{
return isClosing;
}
public static void setClosing(boolean closing)
{
isClosing = closing;
}
public static Version getVersion()
{
return DBeaverActivator.getInstance().getBundle().getVersion();
}
public static String getProductTitle()
{
return Platform.getProduct().getName() + " " + getVersion();
}
public static DBPPreferenceStore getGlobalPreferenceStore()
{
return DBeaverActivator.getInstance().getPreferences();
}
DBeaverCore()
{
}
private void initialize()
{
// Register properties adapter
this.workspace = ResourcesPlugin.getWorkspace();
this.localSystem = new OSDescriptor(Platform.getOS(), Platform.getOSArch());
QMUtils.initApplication(this);
this.queryManager = new QMControllerImpl();
this.qmLogWriter = new QMLogFileWriter();
this.queryManager.registerMetaListener(qmLogWriter);
// Init default network settings
Authenticator.setDefault(new GlobalProxyAuthenticator());
ProxySelector.setDefault(new GlobalProxySelector(ProxySelector.getDefault()));
// Init project registry
this.projectRegistry = new ProjectRegistry(workspace);
// Projects registry
initializeProjects();
// Navigator model
this.navigatorModel = new DBNModel(this);
this.navigatorModel.initialize();
// Activate plugin services
for (IPluginService pluginService : PluginServiceRegistry.getInstance().getServices()) {
try {
pluginService.activateService();
activatedServices.add(pluginService);
} catch (Throwable e) {
log.error("Error activating plugin service", e);
}
}
}
private void initializeProjects()
{
final IProgressMonitor monitor = new NullProgressMonitor();
try {
projectRegistry.loadProjects(monitor);
} catch (DBException e) {
log.error("Error loading projects", e);
}
try {
// Temp project
tempProject = workspace.getRoot().getProject(TEMP_PROJECT_NAME);
if (tempProject.exists()) {
try {
tempProject.delete(true, true, monitor);
} catch (CoreException e) {
log.error("Can't delete temp project", e);
}
}
IProjectDescription description = workspace.newProjectDescription(TEMP_PROJECT_NAME);
description.setName(TEMP_PROJECT_NAME);
description.setComment("Project for DBeaver temporary content");
try {
tempProject.create(description, IProject.HIDDEN, monitor);
} catch (CoreException e) {
log.error("Can't create temp project", e);
}
tempProject.open(monitor);
} catch (Throwable e) {
log.error("Cannot open temp project", e); //$NON-NLS-1$
}
}
public synchronized void dispose()
{
log.debug("Shutdown initiated");
long startTime = System.currentTimeMillis();
DBeaverCore.setClosing(true);
// Deactivate plugin services
for (IPluginService pluginService : activatedServices) {
try {
pluginService.deactivateService();
} catch (Exception e) {
log.error("Error deactivating plugin service", e);
}
}
activatedServices.clear();
// Dispose navigator model first
// It is a part of UI
if (this.navigatorModel != null) {
this.navigatorModel.dispose();
//this.navigatorModel = null;
}
// Dispose project registry
// It will close all open connections
if (this.projectRegistry != null) {
this.projectRegistry.dispose();
this.projectRegistry = null;
}
// Cleanup temp project
IProgressMonitor monitor = new NullProgressMonitor();
if (workspace != null) {
if (tempProject != null && tempProject.exists()) {
try {
tempProject.delete(true, true, monitor);
} catch (CoreException e) {
log.warn("Can't cleanup temp project", e);
}
}
}
if (this.qmLogWriter != null) {
this.queryManager.unregisterMetaListener(qmLogWriter);
this.qmLogWriter.dispose();
this.qmLogWriter = null;
}
if (this.queryManager != null) {
this.queryManager.dispose();
//queryManager = null;
}
DataSourceProviderRegistry.getInstance().dispose();
if (isStandalone() && workspace != null) {
try {
workspace.save(true, monitor);
} catch (CoreException ex) {
log.error("Can't save workspace", ex); //$NON-NLS-1$
}
}
DBeaverCore.instance = null;
DBeaverCore.disposed = true;
log.debug("Shutdown completed in " + (System.currentTimeMillis() - startTime) + "ms");
}
@Override
public IWorkspace getWorkspace()
{
return workspace;
}
@Override
public DBPProjectManager getProjectManager() {
return getProjectRegistry();
}
/**
* Returns configuration file
*/
public File getConfigurationFile(String fileName, boolean read)
{
File configFile = new File(DBeaverActivator.getInstance().getStateLocation().toFile(), fileName);
if (!configFile.exists() && read) {
// [Compatibility with DBeaver 1.x]
configFile = new File(Platform.getLocation().toFile(), fileName);
}
return configFile;
}
public OSDescriptor getLocalSystem()
{
return localSystem;
}
@NotNull
@Override
public DBNModel getNavigatorModel()
{
return navigatorModel;
}
public QMController getQueryManager()
{
return queryManager;
}
@Override
public DBDValueHandlerRegistry getValueHandlerRegistry() {
return DataTypeProviderRegistry.getInstance();
}
@Override
public DBPPreferenceStore getPreferenceStore() {
return getGlobalPreferenceStore();
}
public ProjectRegistry getProjectRegistry()
{
return projectRegistry;
}
public IProject getTempProject() {
return tempProject;
}
public IFolder getLobFolder(IProgressMonitor monitor)
throws IOException
{
return getTempFolder(monitor, LOB_DIR);
}
private IFolder getTempFolder(IProgressMonitor monitor, String name)
throws IOException
{
if (tempProject == null) {
throw new IOException("Temp project wasn't initialized properly");
}
IPath tempPath = tempProject.getProjectRelativePath().append(name);
IFolder tempFolder = tempProject.getFolder(tempPath);
if (!tempFolder.exists()) {
try {
tempFolder.create(true, true, monitor);
tempFolder.setHidden(true);
} catch (CoreException ex) {
throw new IOException(MessageFormat.format(CoreMessages.DBeaverCore_error_can_create_temp_dir, tempFolder.toString()), ex);
}
}
return tempFolder;
}
public List<IProject> getLiveProjects()
{
List<IProject> result = new ArrayList<IProject>();
for (IProject project : workspace.getRoot().getProjects()) {
if (project.exists() && !project.isHidden()) {
result.add(project);
}
}
return result;
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
35a4eb95b781f86e7a515ed8fa9948897d05165e | fe41525f02cef0ae15ec458a4eeff150b3245790 | /molecularDynamics/Brown.java | c05f9af2c20d3e19603a3b13223b285352ceb21f | [] | no_license | mkadlof/mm2 | ad11f7e95a92b7ce2a6a30d3b38abf46a225cae2 | 8e9af62fd405a84523350eef56b08c13b2c3f92c | refs/heads/master | 2020-04-16T15:22:56.670510 | 2015-05-12T07:39:29 | 2015-05-12T07:39:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 851 | java | import java.util.Random;
public class Brown extends Integrator {
private double dt;
private double gamma;
private double T;
private Random rGen;
public Brown(double dt, double gamma, double T) {
this.dt = dt;
this.gamma = gamma;
this.T = T;
rGen = new Random();
}
public void step(TheSystem system, ForceField ff) {
// calkowanie
Atom[] atoms = system.getAtoms();
VecNd tmp = new VecNd();
double e_GammaDt = Math.exp(-gamma*dt);
double sigmaR2 = dt*T/gamma * (2-(3-4*e_GammaDt+e_GammaDt*e_GammaDt)/gamma/dt);
for( Atom a : atoms ) {
VecNd currX = a.getX();
VecNd currV = a.getV();
VecNd currA = a.getA();
VecNd newX = new VecNd();
// newX := currX + currA*dt/gamma + rand
tmp.mult(dt/gamma,currA);
tmp.add( VecNd.gaussian(rGen,0,sigmaR2) );
newX.add(currX,tmp);
a.updateX(newX);
}
}
}
| [
"ponadto@gmail.com"
] | ponadto@gmail.com |
773cf2d3901b7325b4cc95c7f065089cf15fbe8c | 1a86e57ccafc65ec3bf74d497d867eb456996058 | /TAS/src/main/java/info/smartkit/tas/controller/TASController.java | a1ff78448ed716dfe14abb0889c085e8cc583ca7 | [
"Unlicense"
] | permissive | smartkit/COVITAS | cad15ba881b40d19cc0c19f7a20232ba86936e41 | 99062d807cc50a50fb346ddaaad764f80ed1f34b | refs/heads/master | 2023-03-10T15:36:03.307181 | 2023-02-23T00:36:17 | 2023-02-23T00:36:17 | 89,655,588 | 0 | 1 | Unlicense | 2023-02-23T00:36:19 | 2017-04-28T01:35:06 | JavaScript | UTF-8 | Java | false | false | 3,029 | java | package info.smartkit.tas.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
import info.smartkit.tas.pojo.*;
import info.smartkit.tas.service.ITASServices;
import info.smartkit.tas.service.impl.TASService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.Date;
/**
* Created by smartkit on 28/04/2017.
*/
@RestController
@RequestMapping("/tas")
public class TASController {
private static final Logger LOG = LoggerFactory.getLogger(TASController.class);
@Autowired
private ITASServices tasService;
@RequestMapping(method = RequestMethod.GET, value="pf/{chatBotID}/{message}")
public MessageResponse simplePFMessage(@PathVariable int chatBotID, @PathVariable String message) throws JsonProcessingException,IOException {
int timeStampInt = (int) (System.currentTimeMillis() / 1000L);
LOG.info("simplePFMessage called at:"+timeStampInt);
PFMessage pfMessage = new PFMessage();
Message messageObj = new Message();
messageObj.setChatBotID(chatBotID);
messageObj.setTimestamp(timeStampInt);
messageObj.setMessage(message);
//default User
User userObj = new User();
userObj.setExternalID("abc-639184572");
userObj.setFirstName("Tugger");
userObj.setLastName("Sufani");
userObj.setGender("m");
pfMessage.setMessage(messageObj);
pfMessage.setUser(userObj);
return tasService.personalityForge(pfMessage);
}
@RequestMapping(method = RequestMethod.POST,value = "/pf")
public MessageResponse securePfMessage(@RequestBody PFMessage pfMessage) throws JsonProcessingException,IOException {
return tasService.personalityForge(pfMessage);
}
// @RequestMapping(value = "/pf", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// @ResponseBody
// public Resource<Object> getArtist(@RequestBody PFMessage message) throws JsonProcessingException {
// Object a = tasService.personalityForge(message);
// Resource<Object> resource = new Resource(a);
// resource.add(linkTo(methodOn(ArtistController.class).getArtist(id)).withSelfRel());
// return a;
// }
// private Resource<Album> getAlbumResource(Album album) {
// Resource<Album> resource = new Resource<Album>(album);
//
// // Link to Album
// resource.add(linkTo(methodOn(AlbumController.class).getAlbum(album.getId())).withSelfRel());
// // Link to Artist
// resource.add(linkTo(methodOn(ArtistController.class).getArtist(album.getArtist().getId())).withRel("artist"));
// // Option to purchase Album
// if (album.getStockLevel() > 0) {
// resource.add(linkTo(methodOn(AlbumController.class).purchaseAlbum(album.getId())).withRel("album.purchase"));
// }
// return resource;
// }
} | [
"YoungWelle@gmail.com"
] | YoungWelle@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.