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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4e2578b0669adc81c98a01fa121feda4d1947608 | ac99dc85be34d25e277724dc20e1e4ccf40584c8 | /src/main/java/com/mir/app/simplecloud/account/AccountRepository.java | 173f45e02831932d3df2df3ea273e65514d66038 | [] | no_license | maxeasy2/simple-cloud | b89d79861d6861a298756db3a02cdcc74be18a97 | 0ce207066693e42c91dc6acf3361bdb6cbd7ac5c | refs/heads/master | 2021-05-16T19:45:24.258533 | 2020-03-29T15:52:30 | 2020-03-29T15:52:30 | 250,444,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 222 | java | package com.mir.app.simplecloud.account;
import org.springframework.data.jpa.repository.JpaRepository;
public interface AccountRepository extends JpaRepository<Account, Long> {
Account findByUserId(String userId);
}
| [
"hearttnet@gmail.com"
] | hearttnet@gmail.com |
d8fd92dd9d0717106855e20146c9f78dde6f32b7 | 7a87bbe68cc6df4358072dd802fbb8f617902dfa | /src/main/java/boot/crud/securityBoot/dao/UserDao.java | ebc88f82716552ab71143b067fc11a5fadbd70cf | [] | no_license | Tolerantfire/SecurityBootStrapJS | 0f8c7b2ee781df0d574c14a4a30edd79e3d96ea0 | cd704485d55950cb6e35e0258fed7ff5a466adc2 | refs/heads/master | 2023-02-04T22:02:26.815724 | 2020-12-13T20:38:57 | 2020-12-13T20:38:57 | 321,155,307 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 397 | java | package boot.crud.securityBoot.dao;
import boot.crud.securityBoot.model.User;
import java.util.List;
public interface UserDao {
void addUser(User user);
List<?> queryForUser();
void removeUser(int id);
void editUser(User user);
User findByUsername(String username);
User findByEmail(String email);
void addUserByAdmin(User user);
User getById(int id);
}
| [
"andrewmkrtchan91@gmail.org"
] | andrewmkrtchan91@gmail.org |
9cfc2a10b7272b5c14c550a32a9fefdf013b5983 | d73a7016e56233f1f6e447bdebd9b0935ba7fe2d | /Logic/src/DataTypes/Util/SecretWithMissionSizeConverter.java | 2308eeed454457a577dbe197cf980e2e7cd3a8e4 | [] | no_license | yair16karshi/Enigma | 57ecc941a02a2ac6ba818d56f3697e9d218de491 | 7eca8160b4f837a59636a26fe1f047c0e94d5a88 | refs/heads/master | 2020-03-17T21:49:13.412380 | 2018-08-09T21:38:31 | 2018-08-09T21:38:31 | 133,971,068 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,975 | java | package DataTypes.Util;
import DataTypes.GeneratedMachineDataTypes.SerializeableMachine.Secret;
import DataTypes.GeneratedMachineDataTypes.SerializeableMachine.SecretWithMissionSize;
import pukteam.enigma.component.machine.secret.SecretBuilder;
import pukteam.enigma.component.machine.secret.SecretImpl;
public class SecretWithMissionSizeConverter{
public static SecretWithMissionSize AviadToSerializable(DataTypes.SecretWithMissionSize secretWithMissionSize){
Secret resSecret = new Secret(
secretWithMissionSize.getSecret().getSelectedRotorsInOrder(),
secretWithMissionSize.getSecret().getSelectedRotorsPositions(),
secretWithMissionSize.getSecret().getSelectedReflector());
SecretWithMissionSize resSecretWithMissionSize = new SecretWithMissionSize();
resSecretWithMissionSize.setMissionSize(secretWithMissionSize.getMissionSize());
resSecretWithMissionSize.setSecret(resSecret);
return resSecretWithMissionSize;
}
public static DataTypes.SecretWithMissionSize SerializableToAviad(SecretWithMissionSize secretWithMissionSize,SecretBuilder secretBuilder){
DataTypes.SecretWithMissionSize resSecretWithMissionSize = new DataTypes.SecretWithMissionSize();
secretBuilder.selectReflector(secretWithMissionSize.getSecret().getSelectedReflector());
for(int i=0; i<secretWithMissionSize.getSecret().getSelectedRotorsInOrder().size(); i++){
secretBuilder.selectRotor(
secretWithMissionSize.getSecret().getSelectedRotorsInOrder().get(i),
secretWithMissionSize.getSecret().getSelectedRotorsPositions().get(i));
}
pukteam.enigma.component.machine.api.Secret resSecret = secretBuilder.create();
resSecretWithMissionSize.setSecret(resSecret);
resSecretWithMissionSize.setMissionSize(secretWithMissionSize.getMissionSize());
return resSecretWithMissionSize;
}
}
| [
"hezided@gmail.com"
] | hezided@gmail.com |
bc29eebbef2292fd0126cb0cb17ab6086a1f1d4d | 61e42a58da2bafe92b52eae8140f5e3a3715b01c | /src/main/java/br/com/gerenciador/converters/GrupoToGrupoEntity.java | 5c220f2881b9e68dc38d851963d6633913c67de6 | [] | no_license | BLouzada/gerenciador-restaurante | 569c6f43c8eb439603a8d584c9a0db2fb0617d43 | 01700314e2b8b321d094cdb51f494cb782de4613 | refs/heads/master | 2021-01-19T10:28:41.783750 | 2017-06-20T00:19:36 | 2017-06-20T00:19:36 | 87,868,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,455 | java | package br.com.gerenciador.converters;
import br.com.gerenciador.beans.Grupo;
import br.com.gerenciador.beans.Ingrediente;
import br.com.gerenciador.entity.GrupoEntity;
import br.com.gerenciador.entity.IngredienteEntity;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
/**
* Created by 201320336 on 20/04/2017.
*/
@Component
public class GrupoToGrupoEntity implements Converter<Grupo,GrupoEntity> {
private IngredienteToIngredienteEntity ingredienteEntityToIngrediente;
public GrupoToGrupoEntity(IngredienteToIngredienteEntity ingredienteEntityToIngrediente) {
this.ingredienteEntityToIngrediente = ingredienteEntityToIngrediente;
}
@Override
public GrupoEntity convert(Grupo source) {
Long id = source.getId();
ArrayList<IngredienteEntity> ingredientes = new ArrayList<IngredienteEntity>();
for (Ingrediente ingrediente : source.getIngredientes()){
ingredientes.add(ingredienteEntityToIngrediente.convert(ingrediente));
}
if(id != null){
return new GrupoEntity()
.setId(id)
.setNome(source.getNome())
.setIngredientes(ingredientes);
}else{
return new GrupoEntity()
.setNome(source.getNome())
.setIngredientes(ingredientes);
}
}
}
| [
"blgoes@gmail.com"
] | blgoes@gmail.com |
3776552f48c63e1d15bee95fe9ab9e1a3b6b650c | fe087dd77d53a57263a8a9d5a4cae8c4c9afc060 | /imagej/EDF-src/EDF_Viewer3D_.java | c53c56ad99b5a232c6a8daabd7f7668fe749b33b | [] | no_license | tischi/scripts | 9ebeae80785996ac91d34a366cc9571dd70c4d88 | fbef07ecf7c2fde1626b24839a7d8933f58ccb1e | refs/heads/master | 2021-01-10T19:02:54.208340 | 2015-12-21T15:38:35 | 2015-12-21T15:38:35 | 6,355,262 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,255 | java | //==============================================================================
//
// Project: EDF - Extended Depth of Focus
//
// Author: Daniel Sage
//
// Organization: Biomedical Imaging Group (BIG)
// Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland
//
// Information: http://bigwww.epfl.ch/demo/edf/
//
// Reference: B. Forster, D. Van De Ville, J. Berent, D. Sage, M. Unser
// Complex Wavelets for Extended Depth-of-Field: A New Method for the Fusion
// of Multichannel Microscopy Images, Microscopy Research and Techniques,
// 65(1-2), pp. 33-42, September 2004.
//
// Conditions of use: You'll be free to use this software for research purposes,
// but you should not redistribute it without our consent. In addition, we
// expect you to include a citation or acknowledgment whenever you present or
// publish results that are based on it.
//
// History:
// - Updated (Daniel Sage, 21 December 2010)
//
//==============================================================================
import ij.IJ;
import ij.ImagePlus;
import ij.WindowManager;
import ij.gui.GUI;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import surfacemap.SurfaceMap3D;
public class EDF_Viewer3D_ extends JDialog implements ActionListener {
private Vector indexMap;
private Vector indexTexture;
private JPanel jContentPane = null;
private GridBagLayout layout;
private GridBagConstraints constraint;
private JButton bnHeightMap;
private JButton bnClose;
private JLabel lblMap;
private JLabel lblTexture;
private JComboBox choiceMap;
private JComboBox choiceTexture;
private String STR_CHOICE = "<Select an image>";
private boolean isMapSelected = false;
private boolean isTextureSelected = false;
/**
* Constructor extends JDialog.
*/
public EDF_Viewer3D_() {
super();
super.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setContentPane(getJContentPane());
setTitle("EDF Viewer 3D");
pack();
setVisible(true);
GUI.center(this);
}
/**
* This method initializes jContentPane.
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
// Layout
layout = new GridBagLayout();
constraint = new GridBagConstraints();
// List of images
lblMap = new JLabel("Height-Map");
lblTexture = new JLabel("Texture");
// Buttons
bnClose = new JButton("Close");
bnHeightMap = new JButton("Show Height-Map");
bnHeightMap.setEnabled(false);
// Panel buttons
JPanel pnButtons = new JPanel();
pnButtons.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0));
pnButtons.add(bnClose);
pnButtons.add(bnHeightMap);
jContentPane = new JPanel(layout);
choiceMap = new JComboBox();
choiceMap.addActionListener(this);
choiceTexture = new JComboBox();
choiceTexture.addActionListener(this);
choiceMap.addItem(STR_CHOICE);
choiceTexture.addItem(STR_CHOICE);
indexMap = setMapList(choiceMap);
indexTexture = setTextureList(choiceTexture);
JPanel pnControls = new JPanel(layout);
pnControls.setBorder(BorderFactory.createEtchedBorder());
addComponent(pnControls, 1, 0, 1, 1, 5, lblMap);
addComponent(pnControls, 1, 1, 1, 1, 5, choiceMap);
addComponent(pnControls, 2, 0, 1, 1, 5, lblTexture);
addComponent(pnControls, 2, 1, 1, 1, 5, choiceTexture);
addComponent(jContentPane, 1, 0, 3, 1, 10, pnControls);
addComponent(jContentPane, 3, 0, 3, 1, 10, pnButtons);
bnClose.addActionListener(this);
bnHeightMap.addActionListener(this);
if (indexMap.size() == 0 || indexTexture.size() == 0) {
IJ.error("You have to open a Topology image and a Texture image");
}
}
return jContentPane;
}
/**
* Add a component in a panel in the northeast of the cell.
*/
private void addComponent(JPanel pn, int row, final int col, int width, final int height, int space, JComponent comp) {
constraint.gridx = col;
constraint.gridy = row;
constraint.gridwidth = width;
constraint.gridheight = height;
constraint.anchor = GridBagConstraints.NORTHWEST;
constraint.insets = new Insets(space, space, space, space);
constraint.weightx = IJ.isMacintosh()?90:100;
constraint.fill = GridBagConstraints.HORIZONTAL;
layout.setConstraints(comp, constraint);
pn.add(comp);
}
/**
* Implements the actionPerformed method of the ActionListener.
*/
public synchronized void actionPerformed(ActionEvent e) {
Object source = e.getSource();
if (source == bnClose) {
dispose();
}
else if (source == bnHeightMap) {
int index = choiceMap.getSelectedIndex() - 1;
Integer map = (Integer)indexMap.elementAt(index);
ImagePlus imp = WindowManager.getImage(map.intValue());
index = choiceTexture.getSelectedIndex() - 1;
Integer Texture = (Integer)indexTexture.elementAt(index);
ImagePlus impTexture = WindowManager.getImage(Texture.intValue());
SurfaceMap3D viewer = new SurfaceMap3D(imp, impTexture);
Thread thread = new Thread(viewer);
thread.start();
this.dispose();
}
else if (source == choiceMap){
if (choiceMap.getSelectedIndex() !=0) {
isMapSelected = true;
}
else{
isMapSelected = false;
}
if (isMapSelected && isTextureSelected)
this.bnHeightMap.setEnabled(true);
else
this.bnHeightMap.setEnabled(false);
}
else if (source == choiceTexture){
if (choiceTexture.getSelectedIndex() !=0) {
isTextureSelected = true;
}
else{
isTextureSelected = false;
}
if ( isMapSelected && isTextureSelected)
this.bnHeightMap.setEnabled(true);
else
this.bnHeightMap.setEnabled(false);
}
}
/**
* Set the list of images.
*/
private Vector setTextureList(JComboBox choice) {
Vector index = new Vector(1,1);
int[] wList = WindowManager.getIDList();
if (wList==null) {
return index;
}
index.removeAllElements();
Vector list = new Vector(1,1);
for (int i=0; i<wList.length; i++) {
ImagePlus imp = WindowManager.getImage(wList[i]);
if (imp != null)
if (imp.getStackSize() == 1)
if ((imp.getType() == ImagePlus.COLOR_RGB) ||
(imp.getType() == ImagePlus.GRAY8) ||
(imp.getType() == ImagePlus.GRAY16) ||
(imp.getType() == ImagePlus.GRAY32) ||
(imp.getType() == ImagePlus.COLOR_256)) {
list.addElement(imp.getTitle());
index.addElement(new Integer(wList[i]));
}
}
if (list.size() <= 0 && choice == choiceMap) {
IJ.error("No suitable texture images are open.");
return index;
}
for (int i=0; i<list.size(); i++)
choice.addItem((String)list.elementAt(i));
return index;
}
/**
* Set the list of images.
*/
private Vector setMapList(JComboBox choice) {
Vector index = new Vector(1,1);
int[] wList = WindowManager.getIDList();
if (wList==null) {
if (choice == choiceMap) // To display the message only one time
IJ.error("No images are open.");
return index;
}
Vector list = new Vector(1,1);
for (int i=0; i<wList.length; i++) {
ImagePlus imp = WindowManager.getImage(wList[i]);
if (imp != null)
if (imp.getStackSize() == 1)
if ((imp.getType() == ImagePlus.GRAY32) ||
(imp.getType() == ImagePlus.GRAY8) ||
(imp.getType() == ImagePlus.GRAY16)) {
list.addElement(imp.getTitle());
index.addElement(new Integer(wList[i]));
}
}
if (list.size() <= 0 && choice == choiceMap) {
IJ.error("No suitable map images are open. Try Grayscale Images.");
return index;
}
for (int i=0; i<list.size(); i++)
choice.addItem((String)list.elementAt(i));
return index;
}
}
| [
"tischer@sub-master.embl.de"
] | tischer@sub-master.embl.de |
4d0f385ec11a6587f446ab5733dc2be02cfd6d28 | 6b05de2fa683fcd3d89898898f45841105113900 | /pipeline-core/src/main/java/com/github/jadepeng/pipeline/core/api/AgentApi.java | 8a49f593c89e91af840824dee6b5b00c0595d240 | [] | no_license | surging-dandelion/docker-pipeline | 2a8e11d585ecf14b3fe6c8ffbb037c84b724e5b7 | 858c694aab4eca4c41cd9ccebe6e7a9298a327fd | refs/heads/main | 2023-06-28T00:31:47.211295 | 2021-07-29T01:55:30 | 2021-07-29T01:55:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,421 | java | package com.github.jadepeng.pipeline.core.api;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.github.jadepeng.pipeline.core.bean.AgentInfo;
import com.github.jadepeng.pipeline.core.bean.OperationalSystemInfo;
import com.github.jadepeng.pipeline.core.bean.PipelineJob;
import com.github.jadepeng.pipeline.core.bean.PipelineJobLog;
import com.github.jadepeng.pipeline.core.bean.PipelineJobTaskLog;
import com.github.jadepeng.pipeline.core.dto.BaseResponse;
import com.github.jadepeng.pipeline.core.dto.ExecutePipelineRequest;
import com.github.jadepeng.pipeline.core.dto.JobState;
import feign.Headers;
import feign.Param;
import feign.RequestLine;
public interface AgentApi {
@RequestLine(value = "GET /api/info")
AgentInfo info();
@RequestLine(value = "GET /api/os")
OperationalSystemInfo os() ;
@RequestLine(value = "GET /api/joblog/{jobId}")
PipelineJobLog getJobLog(@Param("jobId") String jobId);
@RequestLine("POST /api/runJob")
@Headers("Content-Type: application/json")
BaseResponse runJob(@Valid @RequestBody ExecutePipelineRequest job);
@RequestLine("POST /api/stopJob")
@Headers("Content-Type: application/json")
BaseResponse stopJob(@Valid @RequestBody PipelineJob job);
}
| [
"jqpeng@iflytek.com"
] | jqpeng@iflytek.com |
4ab0c45ed86c52824daf676445f033cbda25f376 | 0a840a61a4b72908d1faa3a2d01026f9ed8a6515 | /SSLServerProject/src/sslserverproject/Server.java | 262fe748c9561b1652ea7778f817637f183f238a | [] | no_license | cimystory/Distributed_System | 0f5c067694bc5e2e50d324a9c5e5dad438858cf6 | 91df23d18b89c1dbb38c50181ffdbd5c9f22ab82 | refs/heads/master | 2021-05-30T01:59:06.736543 | 2015-11-14T00:10:18 | 2015-11-14T00:10:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,820 | 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 sslserverproject;
import java.io.*;
import java.net.*;
import javax.net.*;
import javax.net.ssl.*;
import java.security.*;
/**
*
* @author Gao
*/
public class Server {
// hold the name of the keystore containing public and private keys
static String keyStore = "Coolkeystore.jks";
// password of the keystore (same as the alias)
static char keyStorePass[] = "sesame".toCharArray();
public static void main(String args[]) {
int port = 6502;
SSLServerSocket server;
try {
// get the keystore into memory
KeyStore ks = KeyStore.getInstance("JKS");
ks.load(new FileInputStream(keyStore), keyStorePass);
// initialize the key manager factory with the keystore data
KeyManagerFactory kmf =
KeyManagerFactory.getInstance("SunX509");
kmf.init(ks,keyStorePass);
// initialize the SSLContext engine
// may throw NoSuchProvider or NoSuchAlgorithm exception
// TLS - Transport Layer Security most generic
SSLContext sslContext = SSLContext.getInstance("TLS");
// Inititialize context with given KeyManagers, TrustManagers,
// SecureRandom defaults taken if null
sslContext.init(kmf.getKeyManagers(), null, null);
// Get ServerSocketFactory from the context object
ServerSocketFactory ssf = sslContext.getServerSocketFactory();
// Now like programming with normal server sockets
ServerSocket serverSocket = ssf.createServerSocket(port);
System.out.println("Accepting secure connections");
Socket client = serverSocket.accept();
System.out.println("Got connection");
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(client.getOutputStream()));
BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));
String username = in.readLine();
String password = in.readLine();
if(username.equals("Josh") && password.equals("GoBucs")) {
out.write("Greeting Client");
} else {
out.write("Sorry, you are not authorized");
}
out.flush();
in.close();
out.close();
}
catch(Exception e) {
System.out.println("Exception thrown " + e);
}
}
}
| [
"gaoj@andrew.cmu.edu"
] | gaoj@andrew.cmu.edu |
f0f3d991e763515d6c1e7ac4bcd0ebbea8ff1220 | 7d25e78ff4b72e6df6bb5c97678f7070287bbddd | /src/acmp/problem246/Main.java | 8700ad012dc581d4b9a708cf7536ef0aafd9c3a4 | [] | no_license | numatay/CompetativeProgramming | 490e12f25fc4d4f62777b7fb1dc3f3881c3f4472 | 6c0ea0d224e8f717e925a484ac42dc8aaae98ac6 | refs/heads/master | 2021-01-22T05:54:06.772772 | 2017-05-17T12:09:41 | 2017-05-17T12:09:41 | 81,718,119 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 806 | java | package acmp.problem246;
import java.io.PrintWriter;
import java.util.Scanner;
/**
* Created by umatayn on 01/25/2017.
*/
public class Main {
public static void main(String[] args) {
new Thread(null, () -> new Main().run(), "solution", 1 << 23).start();
}
public void run() {
// initialize resources
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int n = in.nextInt();
int prev = -1, cur;
int cnt = 0;
for (int i = 0; i < n; i++) {
cur = in.nextInt();
if ((prev != -1) && (prev > cur || (cur - prev > 1))) {
cnt++;
}
prev = cur;
}
out.print(cnt);
// release resources
out.close();
}
} | [
"umatayn@gmail.com"
] | umatayn@gmail.com |
bc932b4ecd5f31c8a9418f0009a449f047f896ce | 71aeaa0dda33ef7efcf9b1ac0ace51f017a03a0f | /TEST/二手租赁APP代码/Java Web服务端源码/src/com/tomo/dao/UsersDao.java | 4890abd935e31b57598ccb463fb2e934ee77fd2e | [] | no_license | justinhaha/borrow-and-lend | 47de342a5def6bc5872d302bc7122ca4936908fc | a457fed8c8b869789770b14345293d64f59fe4a8 | refs/heads/master | 2020-03-16T03:05:20.803358 | 2018-05-07T15:38:57 | 2018-05-07T15:38:57 | 132,480,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 231 | java | /**
*
*/
package com.tomo.dao;
import com.tomo.dao.common.BaseDao;
import com.tomo.entity.Users;
/**
* @author YHX
* @date: 日期:2014-1-6 时间:下午3:03:26
*/
public interface UsersDao extends BaseDao<Users>{
}
| [
"2417689183@qq.com"
] | 2417689183@qq.com |
fa9b0e74665a7dfecaaba25b37ec1c344262b5a5 | ed604b012ff7040db218efd1b9b49c514e15e14c | /src/main/java/com/desgreen/education/siapp/app_email/EmailService.java | 9162821064a44edd3e1c549de21ffec1fdebc9dc | [
"Unlicense"
] | permissive | bagus-stimata/siapp | 2f2edf0be9c00c629faffa050bf060ccd3d3c0c7 | 67f6ddde5efcf01959100f084da402453d7a419d | refs/heads/master | 2022-12-25T09:05:36.261606 | 2020-10-11T11:28:03 | 2020-10-11T11:28:03 | 284,419,437 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,739 | java | package com.desgreen.education.siapp.app_email;
import com.desgreen.education.siapp.AppPublicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.mail.internet.MimeMessage;
import java.util.Properties;
@Service
public class EmailService {
@Autowired
public JavaMailSender mailSender;
public JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl();
public EmailService(){
try {
// javaMailSender.setUsername("helpdesk1@des-green.com");
javaMailSender.setUsername("ponpesldii@ponpesdahlanikhsan.com");
javaMailSender.setPassword("Welcome123456789");
Properties properties = new Properties();
properties.put("mail.transport.protocol", "smtp");
properties.put("mail.smtp.ssl.enable", "true");
properties.put("mail.smtp.auth", "true");
properties.put("mail.debug", "true");
properties.put("mail.smtp.connectiontimeout", 6000);
// properties.put("mail.smtp.timeout", 6000); //sellau bikin error: Jangan pakai ini
// properties.put("mail.smtp.starttls.enable", "true");
javaMailSender.setJavaMailProperties(properties);
// javaMailSender.setHost("mail.des-green.com");
javaMailSender.setHost("mail.ponpesdahlanikhsan.com");
javaMailSender.setPort(465);
// mailSender.setPort(587); //Not SSL
}catch (Exception ex) {}
}
@Async
public void sendSimpleMessage(String to, String subject, String textMesage) {
SimpleMailMessage msg = new SimpleMailMessage();
msg.setFrom(AppPublicService.PUBLIC_HOST_EMAIL); //Dummy aslinya ada di setting: Tapi harus ada
// msg.setTo("bagus.stimata@gmail.com", "des.jatim1@gmail.com", "helpdesk1@des-green.com");
msg.setTo(to);
msg.setSubject(subject);
// msg.setText("Hello World \n Spring Boot Email ari mas bagus winanro");
msg.setText(textMesage);
mailSender.send(msg);
}
@Async
public void sendSimpleHtmlMessage(String to, String subject, String htmlContent){
MimeMessage mimeMessage = this.mailSender.createMimeMessage();
MimeMessageHelper message = new MimeMessageHelper(mimeMessage, "UTF-8");
try {
message.setFrom(AppPublicService.PUBLIC_HOST_EMAIL); //Dummy aslinya ada di setting: Tapi harus ada
message.setTo(to);
message.setSubject(subject);
message.setText(htmlContent, true);
}catch (Exception ex){}
mailSender.send(mimeMessage);
}
@Async
public void sendSimpleMessageManual(String to, String subject, String textMesage) throws Exception {
SimpleMailMessage msg = new SimpleMailMessage();
msg.setFrom(AppPublicService.PUBLIC_HOST_EMAIL); //Dummy aslinya ada di setting: Tapi harus ada
// msg.setFrom("bagus.stimata@gmail.com");
// msg.setTo("bagus.stimata@gmail.com", "des.jatim1@gmail.com", "helpdesk1@des-green.com");
msg.setTo(to);
msg.setSubject(subject);
// msg.setText("Hello World \n Spring Boot Email Boss");
msg.setText(textMesage);
javaMailSender.send(msg);
}
@Bean
public void testImplement(){
System.out.println("hello oke ini");
}
} | [
"bagus.stimata@gmail.com"
] | bagus.stimata@gmail.com |
b2c1bc44852c4fded83ef5d90a2133a97f9e1770 | c43b921cc7b0b8e005a1fad25eb2642b07021db3 | /KTC_V3/src/ktc_v3/CellMatrix.java | ee8b8fdc55247167adbf79450b4bb1ac8cede6f5 | [] | no_license | Alex-Willenbrink/KTC | 2f0b369aeaf874e20b6b51bddf76f87585d28c3f | ca379dc792b13176975478c03b32e573706d12c7 | refs/heads/master | 2021-01-20T07:51:54.952166 | 2017-05-02T16:27:37 | 2017-05-02T16:27:37 | 90,054,415 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,037 | 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 ktc_v3;
import java.util.ArrayList;
import java.util.Random;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Shape;
/**
*
* @author Alex
*/
public class CellMatrix implements CellMatrixInterface{
private ArrayList<Cell> cellArray = new ArrayList<>();
private ArrayList<Cell> divideList = new ArrayList<>();
private Circle circle;
public CellMatrix(Circle circle){
this.circle = circle;
}
@Override
public void repliate() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void infect() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void turn() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public boolean checkCellCollisions(Cell newCell) {
for (Cell currCell : cellArray) {
Shape intersect = Shape.intersect(currCell.getCircle(), newCell.getCircle());
if (intersect.getBoundsInLocal().getWidth() != -1) {
return true;
}
}
return false;
}
public void addCell2Matrix(Cell newCell){
this.cellArray.add(newCell);
}
public ArrayList<Cell> getCellArray() {
return this.cellArray;
}
public Circle getCircle() {
return this.circle;
}
// You'll have to make this more dynamic later
@Override
public boolean checkWithinBigCircle(Cell cellNew) {
double xDiff = this.circle.getCenterX() - cellNew.getCircle().getCenterX();
double yDiff = this.circle.getCenterY() - cellNew.getCircle().getCenterY();
double rCondition = this.circle.getRadius() - cellNew.getCircle().getRadius();
return Math.pow(Math.pow(yDiff, 2) + Math.pow(xDiff, 2), 0.5) <= rCondition;
}
public void updateDivisionList(){
divideList = new ArrayList<>();
for(Cell cell : cellArray){
if(checkForNextDivision(cell)){
divideList.add(cell);
}
}
}
public boolean checkForNextDivision(Cell cell){
if(nextBooleanAboveX(cell.getCellDivideRatio())){
return true;
}
return false;
}
public boolean nextBooleanAboveX(double x){
Random rand = new Random();
if(rand.nextFloat() < x){
return true;
} else return false;
}
public ArrayList<Cell> getDivideList() {
return divideList;
}
}
| [
"awillenbrink@gmail.com"
] | awillenbrink@gmail.com |
135bbbc4bf089fedd35ef7a2108904780839eeb4 | 288ef587366db6c75051fad10cce01c9f433cba4 | /M4_Assessment_VM/src/main/java/com/sg/vendingmachine/advice/LoggingAdvice.java | e79be379bbf9cdc667097487bdfbb117f725d5aa | [] | no_license | ajama28/Apprenticeship_Assignments | 74087023d5a72239ef3e72d05a4498df3166f697 | 15b909c1688741a07c5d68aee0b795202f01cfca | refs/heads/master | 2021-01-01T11:15:59.691939 | 2019-12-13T16:26:25 | 2019-12-13T16:26:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,340 | 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 com.sg.vendingmachine.advice;
import com.sg.vendingmachine.dao.VendingMachineAuditDao;
import com.sg.vendingmachine.dao.VendingMachinePersistenceException;
import com.sg.vendingmachine.service.InsufficientFundsException;
import com.sg.vendingmachine.service.NoItemInventoryException;
import org.aspectj.lang.JoinPoint;
/**
*
* @author jesse
*/
public class LoggingAdvice {
VendingMachineAuditDao auditDao;
public LoggingAdvice(VendingMachineAuditDao auditDao) {
this.auditDao = auditDao;
}
public void createAuditEntry(JoinPoint jp, Throwable ex)
throws InsufficientFundsException,
NoItemInventoryException {
Object[] args = jp.getArgs();
String auditEntry = jp.getSignature().getName() +": "+ ex.toString() + ": ";
for (Object currentArg : args) {
auditEntry += currentArg + ": ";
}
try {
auditDao.writeAuditEntry(auditEntry);
} catch (VendingMachinePersistenceException e) {
System.err.println(
"ERROR: Could not create audit entry in LoggingAdvice.");
}
}
}
| [
"Jessicasarahgross@gmail.com"
] | Jessicasarahgross@gmail.com |
3b87959e57c735cde0bf56cea3eb45771b724a8f | 6fab3f1e150284edd43a7b1d9b050879235b4b01 | /src/main/java/com/nongyeos/loan/app/service/IFlowNodeService.java | 6f3cc4893fba1b17172f7d5b70cab2e7fa9ff209 | [] | no_license | theLittleBirds/hlj_nongdai | e5c96386dbc6e1ebd1e770b00e9a5f042aa42ddc | 3a53d4e541190c0dd509f7583e5937bde415e21e | refs/heads/master | 2020-05-05T13:00:47.212692 | 2019-04-08T02:46:34 | 2019-04-08T02:46:34 | 180,055,330 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 664 | java | package com.nongyeos.loan.app.service;
import java.util.List;
import com.nongyeos.loan.app.entity.FlowNode;
public interface IFlowNodeService {
void addFleNode(FlowNode fleNode) throws Exception;
void updateFleNode(FlowNode fleNode) throws Exception;
void updateFleNode1(FlowNode fleNode) throws Exception;
void deleteFleNode(String fleNodeId) throws Exception;
List<FlowNode> selectByAppId(String appId) throws Exception;
FlowNode selectByNodeId(String nodeId) throws Exception;
FlowNode getApproverIdsByNodeId(String nodeId) throws Exception;
FlowNode queryByEnameAndModel(FlowNode fleNode) throws Exception;
List<FlowNode> selectAll();
}
| [
"zd2539250013@163.com"
] | zd2539250013@163.com |
e2165ee5cd761ae37a71f08a8690cb648a82a78b | cfe621e8c36e6ac5053a2c4f7129a13ea9f9f66b | /AndroidApplications/com.zeptolab.ctr.ads-912244/src/com/google/ads/mediation/jsadapter/JavascriptServerParameters.java | 032b8e55ef1416ad93e194124c685f8e11ca3877 | [] | no_license | linux86/AndoirdSecurity | 3165de73b37f53070cd6b435e180a2cb58d6f672 | 1e72a3c1f7a72ea9cd12048d9874a8651e0aede7 | refs/heads/master | 2021-01-11T01:20:58.986651 | 2016-04-05T17:14:26 | 2016-04-05T17:14:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 526 | java | package com.google.ads.mediation.jsadapter;
import com.google.ads.mediation.MediationServerParameters;
public class JavascriptServerParameters extends MediationServerParameters {
@Parameter(name = "adxtym_height", required = false)
public Integer height;
@Parameter(name = "adxtym_html", required = true)
public String htmlScript;
@Parameter(name = "adxtym_passback_url", required = false)
public String passBackUrl;
@Parameter(name = "adxtym_width", required = false)
public Integer width;
} | [
"jack.luo@mail.utoronto.ca"
] | jack.luo@mail.utoronto.ca |
ed6ffbd3fc23e959d0f3f2434dbc4690b59d501e | b6acb787a644ab293e5a4c7a711ac7cdfca5d0df | /feesCommissionManager/src/main/java/com/electron/mfs/pg/feescommission/repository/package-info.java | 982e5de54aa93b7611d31d7e9d2b95355650f0a4 | [] | no_license | fsfish/electron-backend | 3440089550a5222cfa5fa4855302a2404fa34577 | dff5634d0f8e75c090eca3c66aad3c76883b1edd | refs/heads/master | 2021-05-22T00:27:37.984536 | 2020-03-30T18:16:03 | 2020-03-30T18:16:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 96 | java | /**
* Spring Data JPA repositories.
*/
package com.electron.mfs.pg.feescommission.repository;
| [
"philippe.monsan@gmail.com"
] | philippe.monsan@gmail.com |
08d3344f9e1d76d64156405d62d4991bf5498299 | 1567751bf6cdfbc97aa6988614b8f7ab955ef3aa | /app/src/main/java/com/example/rohan/hellotoast/MainActivity.java | b6dabc1b3dcf24cc67f95610120403d1e60611a3 | [] | no_license | rohanyadav1152/Hellotoast | d7f4a77a0086d97a49d4c324079b3050cc0d342a | 4ea43e79b012ac3ef24feaf69079334e5e5ad3a9 | refs/heads/master | 2020-03-23T09:30:50.777593 | 2018-07-18T06:41:06 | 2018-07-18T06:41:06 | 141,392,291 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 827 | java | package com.example.rohan.hellotoast;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends Activity {
private int mCount=0;
private TextView mShowCount;
String msg="Count is: ";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mShowCount=(TextView)findViewById(R.id.show_count);
}
public void countUp(View view){
mCount++;
if(mShowCount !=null)
mShowCount.setText(Integer.toString(mCount));
}
public void ShowToast(View view){
Toast toast=Toast.makeText(this,msg+mCount, Toast.LENGTH_LONG);
toast.show();
}
}
| [
"rohanyadav13396@gmail.com"
] | rohanyadav13396@gmail.com |
c4dee8a6da052b150c396407d0976433e474f527 | 1ebf4b6fcede63888fb98abb0d6253db2d99d899 | /snippets/spring-framework-master_SerializableTypeWrapper_4.java | fd978efaae3f085eddbb95b3021ca26fc012ef21 | [] | no_license | stakelab/replication-naturalness-understandability | 07adfd51427a4f5ec7c1a06a146772a90c3b3ace | f00ddec3b9628ea085337f9749e5f3f045ed17a2 | refs/heads/master | 2020-12-15T10:49:21.867564 | 2020-07-16T14:50:16 | 2020-07-16T14:50:16 | 235,079,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,296 | java | @Nullable
static Type forTypeProvider(TypeProvider provider) {
Type providedType = provider.getType();
if (providedType == null || providedType instanceof Serializable) {
// No serializable type wrapping necessary (e.g. for java.lang.Class)
return providedType;
}
if (GraalDetector.inImageCode() || !Serializable.class.isAssignableFrom(Class.class)) {
// Let's skip any wrapping attempts if types are generally not serializable in
// the current runtime environment (even java.lang.Class itself, e.g. on Graal)
return providedType;
}
// Obtain a serializable type proxy for the given provider...
Type cached = cache.get(providedType);
if (cached != null) {
return cached;
}
for (Class<?> type : SUPPORTED_SERIALIZABLE_TYPES) {
if (type.isInstance(providedType)) {
ClassLoader classLoader = provider.getClass().getClassLoader();
Class<?>[] interfaces = new Class<?>[] {type, SerializableTypeProxy.class, Serializable.class};
InvocationHandler handler = new TypeProxyInvocationHandler(provider);
cached = (Type) Proxy.newProxyInstance(classLoader, interfaces, handler);
cache.put(providedType, cached);
return cached;
}
}
throw new IllegalArgumentException("Unsupported Type class: " + providedType.getClass().getName());
} | [
"s.scalabrino9@gmail.com"
] | s.scalabrino9@gmail.com |
6bc2a5ea51e49d5c5180a87279964330f71eb7e9 | 4950a1d01c47d411e9d6f086530bd5faf865c900 | /agents-app/agents-back-end/src/main/java/com/SoapWebServiceConfig.java | 6d98aa1260898967b15a9f5483526a973f00e022 | [] | no_license | vlada29/XML-i-Web-Servisi | a41e5762a9a032e2369515f213b2bff6532396f6 | 7070ef1086fdb5129c1db615d5d6dfb7baa29467 | refs/heads/master | 2020-03-11T10:24:33.119277 | 2018-06-24T08:38:14 | 2018-06-24T08:38:14 | 129,941,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,521 | java | package com;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.ws.config.annotation.EnableWs;
import org.springframework.ws.config.annotation.WsConfigurerAdapter;
import org.springframework.ws.transport.http.MessageDispatcherServlet;
import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
import org.springframework.xml.xsd.SimpleXsdSchema;
import org.springframework.xml.xsd.XsdSchema;
@EnableWs
@Configuration
public class SoapWebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext context) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(context);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/soapWS/*");
}
// @Bean
// public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema userSchema) {
//
// DefaultWsdl11Definition definition = new DefaultWsdl11Definition();
// definition.setSchema(userSchema);
// definition.setLocationUri("/soapWS");
// definition.setPortTypeName("UserServicePort");
// definition.setTargetNamespace("ns");
// return definition;
// }
} | [
"danilo.daca.b@gmail.com"
] | danilo.daca.b@gmail.com |
48a131601be7149a19f7bedf7c8e813754864d35 | 760e696ab78d9347b62381ce395c9023b05c28a6 | /jtsapp/src/main/java/com/vividsolutions/jtstest/testbuilder/geom/EnvelopeUtil.java | 0f656c38f0088c3aea727e371359a650ff56fd00 | [] | no_license | hastebrot/jts-topo-suite | 0c532641147d3880b91312dff375d9226585b0d1 | 8f0bd55cb7c837799c6b356af16d1a23b2114c29 | refs/heads/master | 2016-09-05T22:54:04.073815 | 2015-06-02T05:15:19 | 2015-06-02T05:15:19 | 37,997,834 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 444 | java | package com.vividsolutions.jtstest.testbuilder.geom;
import com.vividsolutions.jts.geom.Envelope;
public class EnvelopeUtil
{
public static double minExtent(Envelope env)
{
double w = env.getWidth();
double h = env.getHeight();
if (w < h) return w;
return h;
}
public static double maxExtent(Envelope env)
{
double w = env.getWidth();
double h = env.getHeight();
if (w > h) return w;
return h;
}
}
| [
"dr_jts@3b1963ad-ff86-43ac-bf88-fa91f6ade54d"
] | dr_jts@3b1963ad-ff86-43ac-bf88-fa91f6ade54d |
3cbe73f1f99b2971fa5353e03cf30c942822ccc1 | de3cc32c392bda4cbc33903259f99194c78bf4d7 | /src/main/java/io/github/jhipster/application/service/mapper/ListTeeTypeMapper.java | 7afc6d95349aa3cebe70e93a36dbf35b668187fa | [] | no_license | Orvas/jhipster-sample-application | 526d4a05098dd508ee66d478b2e419f9b65af96d | 86da109ed1f76fc89370d9d3428d5cbc09ace482 | refs/heads/master | 2022-12-22T21:07:49.001252 | 2019-05-31T14:25:34 | 2019-05-31T14:25:34 | 189,054,767 | 1 | 0 | null | 2022-12-16T04:52:31 | 2019-05-28T15:24:59 | Java | UTF-8 | Java | false | false | 750 | java | package io.github.jhipster.application.service.mapper;
import io.github.jhipster.application.domain.*;
import io.github.jhipster.application.service.dto.ListTeeTypeDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link ListTeeType} and its DTO {@link ListTeeTypeDTO}.
*/
@Mapper(componentModel = "spring", uses = {})
public interface ListTeeTypeMapper extends EntityMapper<ListTeeTypeDTO, ListTeeType> {
@Mapping(target = "teeHists", ignore = true)
ListTeeType toEntity(ListTeeTypeDTO listTeeTypeDTO);
default ListTeeType fromId(Long id) {
if (id == null) {
return null;
}
ListTeeType listTeeType = new ListTeeType();
listTeeType.setId(id);
return listTeeType;
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
9ae6cefcb213d3a6d0cfe36fc8b38933b5e6f906 | 5e08e601d3de73713a292a4d67c5c6b8d213cc13 | /javapractice/src/kbinaryTree/MirrorTree.java | b884a0858c93ff541e8f5febfe14961cb84ba504 | [] | no_license | Minal11/AlgosAndDataStructures | be910673d77b390f8511e091409efb72af948d0e | 8d8522a2ba00047517c5562a0340980c1062a23e | refs/heads/master | 2021-01-20T15:38:54.424942 | 2015-09-27T00:36:42 | 2015-09-27T00:36:42 | 33,506,493 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,276 | java | /**
*
*/
package kbinaryTree;
import inheritance.B;
import java.util.Stack;
/**
* @author Minal
*
*/
public class MirrorTree {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] array=new int[]{1,2,3,4,5};
CreateBinaryTree create=new CreateBinaryTree(array);
BinaryTreeNode root=create.createTree();
System.out.println();
System.out.println("Non-Recursive");
inorder(root);
System.out.println();
mirrorTree2(root);
inorder(root);
System.out.println();
}
public static void inorder(BinaryTreeNode node){
if(node==null)
return;
//you need Stack for non recursive
Stack stack=new Stack();
while(true){
while(node!=null){
stack.push(node);
node=node.getLeft();
}
if(stack.isEmpty())
break;
node=(BinaryTreeNode) stack.pop();
System.out.print(node.getData()+" ");
node=node.getRight();
}
}
public static void mirrorTree2( BinaryTreeNode n){
if(n==null)
return;
else{
mirrorTree2(n.getLeft());
mirrorTree2(n.getRight());
BinaryTreeNode temp=n.getLeft();
n.setLeft(n.getRight());
n.setRight(temp);
}
}
}
| [
"mkondawar11@gmail.com"
] | mkondawar11@gmail.com |
485e9e723884cad6bc7a4dd4ad7cf4f5a8f634bb | f10238571df2bd8d5ccebb5760288902b46b5a2b | /src/com/mantosh/operators/arithmetic_operators/Lab71.java | a985fbb680e974ce08d61514442d092a003f1b54 | [] | no_license | mantoshpanda/JAVA | beabc6d6cefd08598b6e1d942ed5b35b513789d2 | 0d13596a7108803d324c8ecc4936deab3f9c3d72 | refs/heads/master | 2020-04-12T18:36:48.863493 | 2018-12-27T12:46:39 | 2018-12-27T12:46:39 | 162,684,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 288 | java | package com.mantosh.operators.arithematic_operators;
public class Lab71 {
public static void main(String... arg){
byte b1=12;
byte b2=23;
//byte a=b1+b2;
System.out.println(b1);
System.out.println(b2);
//System.out.println(a);
}
}
| [
"pmantosh@pkrmsezdc.com"
] | pmantosh@pkrmsezdc.com |
4b303098ee231a2d4910769b8b44f882a1d712c9 | fc7ac8a620ec8196346436690a2215fe1a09b807 | /design-patterns/src/main/java/_08simple_factory/section4/WhiteHuman.java | 057581ea48aed246d9ab2038d33699e7788678b1 | [] | no_license | nanphonfy/TTUP | a530aeecb7c7041de8688b79287c36d339b4dfdf | d11bd7fa3612f0751bd3481df483c065c58f41d6 | refs/heads/master | 2021-07-03T14:18:00.519388 | 2019-03-18T15:09:17 | 2019-03-18T15:09:17 | 108,563,952 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 476 | java | package _08simple_factory.section4;
/**
* @author cbf4Life cbf4life@126.com
* I'm glad to share my knowledge with you all.
* 白色人人种
*/
public class WhiteHuman implements Human {
//白色人种的颜色是白色的
@Override public void getColor(){
System.out.println("白色人种的皮肤颜色是白色的!");
}
//白色人种讲话
@Override public void talk() {
System.out.println("白色人种会说话,一般都是但是单字节。");
}
}
| [
"nanphonfy@gmail.com"
] | nanphonfy@gmail.com |
2bf407454ce936386d58d95f9ac714217fe8b656 | eb604a447e028af5351349ae4fc25aa475846be1 | /ABC100~150/ABC139/b.java | c5d62ed7ad23e1cfb36041e8164258632cbd519c | [] | no_license | RuRey0310/Competitive_Programming | 2fe494410aa49c4d44e85f99530664afeb0e1d96 | e230cc4034ef3b2fe984b583add7a9e3449aa7f5 | refs/heads/master | 2023-04-17T22:16:25.130530 | 2020-06-14T13:43:33 | 2020-06-14T13:43:33 | 246,257,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 653 | java | import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int A = Integer.parseInt(stdin.next());
int B = Integer.parseInt(stdin.next());
if(B == 1) {
System.out.println(0);
}
else if(A == B) {
System.out.println(1);
}
else {
int sum=A;
for(int i=1;i<100;i++) {
if(i==1) {
if(A*i >= B) {
out.println(i);
break;
}
}
else {
sum+=A-1;
if(sum >= B) {
out.println(i);
break;
}
}
}
}
out.flush();
}
}
| [
"y.sumitomo310@gmail.com"
] | y.sumitomo310@gmail.com |
7742ccc13723fb17c4491b8fc54296ca769094c9 | 53b0bd73f0b2ea6418b4798be63ed9e603531c0c | /geoLocate/src/com/example/geolocate/MainActivity.java | b76665567233342d938c5df09ae7acdf90ca748e | [] | no_license | concolato/MobileAndroid | 3328dbbf637e3610bf24da2e67216c6c76a807cd | 3ee58a2e14e4a107980474c97d80521c9023bbe2 | refs/heads/master | 2021-01-10T20:19:45.363064 | 2015-01-08T22:48:15 | 2015-01-08T22:48:15 | 27,456,481 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,952 | java | package com.example.geolocate;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import android.app.Activity;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Toast;
public class MainActivity extends Activity {
// Google Map
private GoogleMap googleMap;
private LocationManager locationmanager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try {
// Loading map
googleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
googleMap.setMyLocationEnabled(true); // false to disable
googleMap.getUiSettings().setZoomControlsEnabled(false); // true to enable
googleMap.getUiSettings().setMyLocationButtonEnabled(true);
googleMap.getUiSettings().setRotateGesturesEnabled(true);
googleMap.getUiSettings().setCompassEnabled(true);
googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
Criteria cri= new Criteria();
String bbb = locationmanager.getBestProvider(cri, true);
Location myLocation = locationmanager.getLastKnownLocation(bbb);
double latitude= myLocation.getLatitude();
double longitude = myLocation.getLongitude();
LatLng coords = new LatLng(latitude, longitude);
if(latitude == 0){
Toast.makeText(getApplicationContext(),
"Sorry! unable to get location", Toast.LENGTH_SHORT)
.show();
}
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(coords, 20));
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* function to load map. If map is not created it will create it for you
* */
public void initilizeMap() {
// latitude and longitude
Criteria cri= new Criteria();
String bbb = locationmanager.getBestProvider(cri, true);
Location myLocation = locationmanager.getLastKnownLocation(bbb);
double latitude= myLocation.getLatitude();
double longitude = myLocation.getLongitude();
LatLng ll = new LatLng(latitude, longitude);
// create marker
MarkerOptions marker = new MarkerOptions().position(new LatLng(latitude, longitude)).title("Hello Maps");
// Changing marker icon and adding marker
//marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.my_marker_icon)));
marker.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ROSE));
googleMap.setMyLocationEnabled(true); // false to disable
googleMap.getUiSettings().setZoomControlsEnabled(false); // true to enable
googleMap.getUiSettings().setMyLocationButtonEnabled(true);
googleMap.getUiSettings().setRotateGesturesEnabled(true);
googleMap.getUiSettings().setCompassEnabled(true);
googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(ll, 20));
googleMap.addMarker(marker);
if (googleMap == null) {
googleMap = ((MapFragment) getFragmentManager()
.findFragmentById(R.id.map)).getMap();
// check if map is created successfully or not
if (googleMap == null) {
Toast.makeText(getApplicationContext(),
"Sorry! unable to create maps", Toast.LENGTH_SHORT)
.show();
}
}
}
/*@Override
protected void onResume() {
super.onResume();
this.initilizeMap();
}
*/
}
| [
"claude.mercury@gmail.com"
] | claude.mercury@gmail.com |
8599ce9ec472b109af5f618df7864ab9454d8676 | 3326674d1945e095df4f039e9b28b9dda34131cd | /src/main/java/org/example/App.java | dd8465c0e19ae89d0254b8fe394006f466a9c80e | [] | no_license | psottomayorpereir/sottomayorpereiradasilva-cop3330-ex17 | 6f421d13f12a5db9e1d628fb0ee966f3c008ed9e | 91f7643f9fcabf307787ad6c2a9b1779fa26260f | refs/heads/master | 2023-08-04T10:19:50.902791 | 2021-09-14T06:35:28 | 2021-09-14T06:35:28 | 406,189,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,467 | java | /*
* UCF COP3330 Fall 2021 Assignment 1 Solution
* Copyright 2021 Pedro Henrique Sotto-Mayor Pereira da Silva
*/
package org.example;
import java.util.Scanner;
public class App
{
public static void main( String[] args )
{
Scanner sc= new Scanner(System.in);
String sex="", ounces="", weight="", hours="";
boolean check=true;
int s=0, oz=0, wei=0, h=0;
double bac=0.0, ratio=0.0;
do{
System.out.print("Enter a 1 is you are male or a 2 if you are female: ");
sex=sc.nextLine();
try{
s = Integer.parseInt(sex);
check=true;
}catch (NumberFormatException ex) {
System.out.println("You have to enter a numeric value!");
check=false;
}
}while(check==false);
do{
System.out.print("How many ounces of alcohol did you have? ");
ounces=sc.nextLine();
try{
oz = Integer.parseInt(ounces);
check=true;
}catch (NumberFormatException ex) {
System.out.println("You have to enter a numeric value!");
check=false;
}
}while(check==false);
do{
System.out.print("What is your weight, in pounds? ");
weight=sc.nextLine();
try{
wei = Integer.parseInt(weight);
check=true;
}catch (NumberFormatException ex) {
System.out.println("You have to enter a numeric value!");
check=false;
}
}while(check==false);
do{
System.out.print("How many hours has it been since your last drink? ");
hours=sc.nextLine();
try{
h = Integer.parseInt(hours);
check=true;
}catch (NumberFormatException ex) {
System.out.println("You have to enter a numeric value!");
check=false;
}
}while(check==false);
if(s==1){
ratio=0.73;
}
else{
ratio=0.66;
}
bac=(oz*5.14/wei*ratio)-(0.015*h);
System.out.printf("Your BAC is %.6f", bac);
if(bac<0.08){
System.out.printf("\nIt is legal for you to drive.");
}
else{
System.out.printf("\nIt is not legal for you to drive.");
}
}
} | [
"itapeu16@hotmail.com"
] | itapeu16@hotmail.com |
291f0a7c2c84c169eb0ab27c1068325cb83b5177 | dfe16b7a810482ed72ed939d1b1d1b833d4fd3db | /DeepComment/src/main/java/chc/bean/DiffType.java | fdfee3bda144f6b03505f2be98eaa6e3c38856f7 | [] | no_license | huanchaochen/DeepComment | 4846a4c41ea5471b6aef5d356bbe0aab4b0b3667 | 9075e2ab616aa0e9d3e5c7838cbfe3d817b72ffb | refs/heads/master | 2021-07-02T17:56:05.703085 | 2017-09-22T03:37:59 | 2017-09-22T03:37:59 | 104,426,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,463 | java | package chc.bean;
import java.util.ArrayList;
import java.util.List;
import org.springframework.data.mongodb.core.mapping.Field;
public class DiffType {
private String type;
@Field("new_start_line")
private int newStartLine;
@Field("new_end_line")
private int newEndLine;
@Field("old_start_line")
private int oldStartLine;
@Field("old_end_line")
private int oldEndLine;
@Field("new_hashs")
private List<Long> newHashList = new ArrayList<Long>();
@Field("old_hashs")
private List<Long> oldHashList = new ArrayList<Long>();
@Field("new_keywords")
private List<String> newKeywordList = new ArrayList<String>();
@Field("old_keywords")
private List<String> oldKeywordList = new ArrayList<String>();
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public int getOldStartLine() {
return oldStartLine;
}
public void setOldStartLine(int oldStartLine) {
this.oldStartLine = oldStartLine;
}
public int getOldEndLine() {
return oldEndLine;
}
public void setOldEndLine(int oldEndLine) {
this.oldEndLine = oldEndLine;
}
public int getNewStartLine() {
return newStartLine;
}
public void setNewStartLine(int newStartLine) {
this.newStartLine = newStartLine;
}
public int getNewEndLine() {
return newEndLine;
}
public void setNewEndLine(int newEndLine) {
this.newEndLine = newEndLine;
}
public List<Long> getNewHashList() {
return newHashList;
}
public void setNewHashList(List<Long> newHashList) {
this.newHashList = newHashList;
}
public List<Long> getOldHashList() {
return oldHashList;
}
public void setOldHashList(List<Long> oldHashList) {
this.oldHashList = oldHashList;
}
public void addNewHash(long newHash){
newHashList.add(newHash);
}
public void addOldHash(long oldHash){
oldHashList.add(oldHash);
}
public List<String> getNewKeywordList() {
return newKeywordList;
}
public void setNewKeywordList(List<String> newKeywordList) {
this.newKeywordList = newKeywordList;
}
public List<String> getOldKeywordList() {
return oldKeywordList;
}
public void setOldKeywordList(List<String> oldKeywordList) {
this.oldKeywordList = oldKeywordList;
}
public void addNewKeyword(String keyword){
newKeywordList.add(keyword);
}
public void addOldKeyword(String keyword){
oldKeywordList.add(keyword);
}
}
| [
"Administrator@CHC_LAB_01"
] | Administrator@CHC_LAB_01 |
3f75e3f3620cc7db39801e7bc5d6de5e42b7cf4f | 1f5712487a482ef6c8c8982f3774ac8ab261f46e | /Renown_aws/src/test/java/renown/app/LambdaTest.java | 15e8225308886b876d0780c284bab217a25bb396 | [] | no_license | semorrissey/Renown | b07d38e11381d50e94e4007277e82941294884ac | 708164ea2af96750ac551f938638b3a82bd9044c | refs/heads/master | 2021-07-26T01:06:55.308590 | 2019-12-13T22:29:33 | 2019-12-13T22:29:33 | 223,048,776 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 521 | java | package renown.app;
import com.amazonaws.services.lambda.runtime.Context;
public class LambdaTest {
/**
* Helper method that creates a context that supports logging so you can test lambda functions
* in JUnit without worrying about the logger anymore.
*
* @param apiCall An arbitrary string to identify which API is being called.
* @return
*/
Context createContext(String apiCall) {
TestContext ctx = new TestContext();
ctx.setFunctionName(apiCall);
return ctx;
}
}
| [
"ejreardon@wpi.edu"
] | ejreardon@wpi.edu |
9bbd954ec69e20ebf213d9bc23f2ffd3790e3719 | 1cf7a426846e12374ba7d37718bd917322d5065b | /ssm/src/main/java/cn/kgc/service/impl/AccountServiceImpl.java | 6644058bf1c5d3d816d3c70b3656f29bc87ecea7 | [] | no_license | qaq-12123/ssm | 6ef144a917954af4c631bf073db67e442ecbf843 | d41008f7d61a9046d13d30b131a3e3de39698ec3 | refs/heads/master | 2022-12-22T08:59:32.549392 | 2019-07-21T02:31:13 | 2019-07-21T02:31:13 | 196,665,093 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package cn.kgc.service.impl;
import cn.kgc.dao.AccountDao;
import cn.kgc.domain.Account;
import cn.kgc.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("accountService")
public class AccountServiceImpl implements AccountService {
@Autowired
private AccountDao accountDao;
/**
* @param phone 根据手机号查询账户信息
* @return
*/
@Override
public Account findByPhone(String phone) {
return accountDao.findByPhone(phone);
}
}
| [
"1769788253@qq.com"
] | 1769788253@qq.com |
9890d8aa07c718a376ce2a34b169bdaeaab17e20 | 5f86fb9adb3c49624b39cd25ae3c3f1bcb09d536 | /app/src/main/java/sdk/facecamera/demo/fragment/FaceCompareFragment.java | 639e2c4076c4c99fe33d37de07e9ac1cb33fc4f1 | [] | no_license | qingtian521/FaceCameraSdk | 6c11cb7f30be40dc781922ec20f122aafbda8766 | 9948ac0c4d27a8691f96247fba2a7328a4efc47a | refs/heads/master | 2020-05-20T09:58:37.768295 | 2019-08-23T08:43:15 | 2019-08-23T08:43:15 | 185,515,283 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 544 | java | package sdk.facecamera.demo.fragment;
import android.graphics.Color;
import android.view.View;
import android.widget.TextView;
/**
* Created by 云中双月 on 2018/3/30.
*/
public class FaceCompareFragment extends BaseFragment{
@Override
public View initView() {
TextView textView = new TextView(getActivity());
textView.setText("人脸参数对比");
textView.setTextColor(Color.BLACK);
textView.setTextSize(30);
return textView;
}
@Override
public void initData() {
}
}
| [
"572159012@qq.com"
] | 572159012@qq.com |
7e650b27c9816bb653c36b0a864448da17f09489 | 57e9721a045a1a5e127bb1ed061095170b706f23 | /Dec23L8T2.java | 865a080b8a196bf18ecfaae4edccb5dd52b85a82 | [] | no_license | ashraf-kabir/Java-Basic-Practices | 5fd19b875995761bd528e0c135fb0e08e91d09d8 | 74bdabfc9aeb23639706063c27c2c1913f958a1d | refs/heads/master | 2020-04-23T07:01:48.805424 | 2019-11-03T17:09:41 | 2019-11-03T17:09:41 | 170,994,289 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | import java.util.Scanner;
public class Dec23L8T2 {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int num[] = new int[10];
for (int a = 0; a < num.length; a++) {
System.out.println("Enter number: ");
num[a] = sc.nextInt();
}
System.out.println("Enter the index: ");
int b = sc.nextInt();
System.out.println(num[b]);
}
}
| [
"s.m.ashraf.kabir@g.bracu.ac.bd"
] | s.m.ashraf.kabir@g.bracu.ac.bd |
97655161363ec04096984c9f9f60f7cb0be5e420 | a7bff68f0adfc377c97777534f780d9ed4ed62a4 | /code/2009-9-1/src/com/umt/runnable/TestJoin.java | 1cd7cb5d9196208e467d6302e8f462431674ef07 | [] | no_license | salingers/Jee | 0a683715c62fd1e7c2d16d29f1c311506a23ed3b | c6ba53bdc87c60740a7f3a284518b9dd2c3f8d9e | refs/heads/master | 2021-01-11T05:42:08.078111 | 2016-11-22T05:09:55 | 2016-11-22T05:09:55 | 71,548,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 501 | java | package com.umt.runnable;
public class TestJoin extends Thread{
public void run() {
for(int i = 0; i < 100; i++){
System.out.println(this.getName() + "_____" + i);
}
}
/**
* @param args
*/
public static void main(String[] args) {
TestJoin tj1 = new TestJoin();
tj1.setName("tj1");
tj1.start();
try {
tj1.join();
} catch (InterruptedException e1) {
e1.printStackTrace();
}
TestJoin tj2 = new TestJoin();
tj2.setName("tj2");
tj2.start();
}
}
| [
"salingersms@msn.com"
] | salingersms@msn.com |
008b03aa99bf6c0358e7232e9be30792d8b42a4e | 8618dab2eedae58082920758f67f7e7a3f4f7464 | /jenkinsxml2jobdsl-master/src/main/java/xyz/hellmouth/jenkinsxml2jobdsl/xml/model/publishers/parameterizedbuildtrigger/ParameterizedBuildTriggerConfigs.java | 3feeaac42214ab2ac1152f5960976abf508fc3b6 | [] | no_license | circlesgit/resources | b58338525a1c92d8db5104c2d2f1147c19bea3fa | eb7c170a44cb8fd8d5bde450cf931edbcfd4a52f | refs/heads/master | 2023-03-04T20:43:51.797764 | 2020-01-02T02:45:27 | 2020-01-02T02:45:27 | 231,294,863 | 1 | 2 | null | 2023-03-03T18:03:23 | 2020-01-02T02:42:28 | Go | UTF-8 | Java | false | false | 752 | java | package xyz.hellmouth.jenkinsxml2jobdsl.xml.model.publishers.parameterizedbuildtrigger;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import xyz.hellmouth.jenkinsxml2jobdsl.jobdsl.Buildable;
import xyz.hellmouth.jenkinsxml2jobdsl.jobdsl.Builder;
import xyz.hellmouth.jenkinsxml2jobdsl.xml.model.publishers.Publisher;
public class ParameterizedBuildTriggerConfigs implements Buildable{
@XmlElements({
@XmlElement(name="hudson.plugins.parameterizedtrigger.BuildTriggerConfig", type=ParameterizedBuildTriggerConfig.class)
})
public List<Buildable> elements;
@Override
public void build(Builder builder) {
for (Buildable o : elements){
o.build(builder);
}
}
}
| [
"chatura1989@gmail.com"
] | chatura1989@gmail.com |
21cce90d885d4107e8f11bfda27ed02807fa2dfc | 999299895a4ddf9e6328d85f34552689b7cbb22a | /app/src/main/java/br/edu/unidavi/kantask/model/Tarefa.java | 7bb0d9c1ead245a02feb37a36181733dea18c0fd | [] | no_license | fnandos1987/KanTask | 6590e1ce0c9a8f0cb5c5347fa90425a851adb142 | 51c4c81a0b105b75f2d777b96799d79082a67ed2 | refs/heads/master | 2020-03-10T03:24:14.452178 | 2018-04-28T20:11:14 | 2018-04-28T20:11:14 | 129,163,829 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,998 | java | package br.edu.unidavi.kantask.model;
import android.support.annotation.NonNull;
import java.util.Date;
public class Tarefa implements Comparable<Tarefa> {
private Integer id;
private String descricao;
private String prazo;
private String dataInicio;
private String dataConlusao;
private Integer prioridade;
private Integer status;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getDescricao() {
return "Tarefa: " + descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
public String getPrazo() {
return "Prazo Conclusão: " + prazo;
}
public void setPrazo(String prazo) {
this.prazo = prazo;
}
public String getDataInicio() {
return "Data Início: " + dataInicio;
}
public void setDataInicio(String dataInicio) {
this.dataInicio = dataInicio;
}
public String getDataConlusao() {
return "Data Conclusão: " + dataConlusao;
}
public void setDataConlusao(String dataConlusao) {
this.dataConlusao = dataConlusao;
}
public Integer getPrioridade() {
return prioridade;
}
public void setPrioridade(Integer prioridade) {
this.prioridade = prioridade;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getDescricaoPrioridade(){
return "Prioridade: " + Prioridade.getById(this.prioridade).getDescricao();
}
public String getDescricaoStatus(){
return Status.getById(this.status).getDescricao();
}
@Override
public int compareTo(@NonNull Tarefa o) {
if (this.prioridade < o.prioridade) {
return -1;
}
if (this.prioridade > o.prioridade) {
return 1;
}
return 0;
}
}
| [
"fnandos1987@gmail.com"
] | fnandos1987@gmail.com |
819245d11ed7ecb392d66418742afb3ee6462152 | 7f9c0b7878c942ad0d5f52c170dbe1f29215709c | /phonebook-web/src/main/java/com/jeromesimmonds/phonebook/web/form/AccountPersonalInfoForm.java | 2f6c7daa7dd97cda0b7fcf68d34a74a5d3e457bb | [] | no_license | JeromeSimmonds/phonebook | 518a9cbb3ba21a1ee166486a23305daf2325f190 | 190f8558ec9e9410b1653278f76b60d2d116a3e7 | refs/heads/master | 2021-01-02T09:33:03.007547 | 2016-01-12T04:03:21 | 2016-01-12T04:03:21 | 24,154,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 876 | java | package com.jeromesimmonds.phonebook.web.form;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.NotBlank;
import com.jeromesimmonds.phonebook.web.validator.UsernameAvailable;
/**
* @author Jerome Simmonds
*
*/
public class AccountPersonalInfoForm {
@NotBlank(message="{com.jeromesimmonds.phonebook.constraints.username.required}")
@Size(min=2, max=40, message="{com.jeromesimmonds.phonebook.constraints.username.invalid}")
@Pattern(regexp="^[a-zA-Z0-9_-]+$", message="{com.jeromesimmonds.phonebook.constraints.username.invalid}")
@UsernameAvailable(message="{com.jeromesimmonds.phonebook.constraints.username.notavailable}")
private String username;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
| [
"jerome.simmonds@gmail.com"
] | jerome.simmonds@gmail.com |
3250864dc4b45a054631299a4656d31f8af45fc9 | 191a88918b1427cd9a6a298d01338ba015290536 | /karate-core/src/main/java/com/intuit/karate/http/HttpBody.java | 719df74ab9e014a42fdea05920ce775f26b94a28 | [
"MIT"
] | permissive | venkatramanareddy/karate | 8f47947cbca4a93e54a7a81407986aaa42f4d7aa | b02ba80ea6c3186cc938421a68ad0e17f25731cf | refs/heads/master | 2021-01-20T23:11:29.007515 | 2017-08-31T17:28:52 | 2017-08-31T17:28:52 | 101,843,148 | 0 | 0 | null | 2017-08-30T05:55:37 | 2017-08-30T05:55:37 | null | UTF-8 | Java | false | false | 4,298 | java | /*
* The MIT License
*
* Copyright 2017 Intuit Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.intuit.karate.http;
import java.io.InputStream;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.IOUtils;
/**
*
* @author pthomas3
*/
public class HttpBody {
private final byte[] bytes;
private final InputStream stream;
private final MultiValuedMap fields;
private final List<MultiPartItem> parts;
private final String contentType;
public boolean isStream() {
return stream != null;
}
public boolean isUrlEncoded() {
return fields != null;
}
public boolean isMultiPart() {
return parts != null;
}
public byte[] getBytes() {
if (isStream()) {
try {
return IOUtils.toByteArray(stream);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return bytes;
}
public InputStream getStream() {
return stream;
}
public String getContentType() {
return contentType;
}
public List<MultiPartItem> getParts() {
return parts;
}
public Map<String, String[]> getParameters() {
if (fields == null) {
return Collections.EMPTY_MAP;
}
Map<String, String[]> map = new LinkedHashMap<>(fields.size());
for (Map.Entry<String, List> entry : fields.entrySet()) {
List list = entry.getValue();
String[] values = new String[list.size()];
for (int i = 0; i < values.length; i++) {
values[i] = list.get(i) + "";
}
map.put(entry.getKey(), values);
}
return map;
}
private HttpBody(byte[] bytes, InputStream stream, String contentType) {
this.bytes = bytes;
this.stream = stream;
this.contentType = contentType;
this.fields = null;
this.parts = null;
}
private HttpBody(MultiValuedMap fields, String contentType) {
this.bytes = null;
this.stream = null;
this.contentType = contentType;
this.fields = fields;
this.parts = null;
}
private HttpBody(List<MultiPartItem> parts, String contentType) {
this.bytes = null;
this.stream = null;
this.contentType = contentType;
this.fields = null;
this.parts = parts;
}
public static HttpBody string(String value, String contentType) {
return new HttpBody(value.getBytes(), null, contentType);
}
public static HttpBody stream(InputStream stream, String contentType) {
return new HttpBody(null, stream, contentType);
}
public static HttpBody bytes(byte[] bytes, String contentType) {
return new HttpBody(bytes, null, contentType);
}
public static HttpBody formFields(MultiValuedMap fields, String contentType) {
return new HttpBody(fields, contentType);
}
public static HttpBody multiPart(List<MultiPartItem> parts, String contentType) {
return new HttpBody(parts, contentType);
}
}
| [
"peter_thomas@intuit.com"
] | peter_thomas@intuit.com |
aafc8e4e79c04f30f28561a590fc358e4eff889a | b43ee67db8c74a1f6efdac9ad833fbdb425eb1a0 | /src/main/java/net/atos/spring_webapp/model/Permission.java | 7ef3e563e0f3eaf42f6c87438539cc9db7b80fc9 | [] | no_license | MikiKru/spring_app | 3b71b282a38573473c0397c90dfe41e5009d7fd9 | 9895e118769cbe18ebb783f523e4c3f2ac0425fe | refs/heads/master | 2020-09-13T19:02:00.893377 | 2019-11-22T13:41:33 | 2019-11-22T13:41:33 | 222,876,184 | 0 | 0 | null | 2019-11-22T13:33:56 | 2019-11-20T07:24:52 | JavaScript | UTF-8 | Java | false | false | 375 | java | package net.atos.spring_webapp.model;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
@NoArgsConstructor
@Data
@Entity
public class Permission {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "permission_id")
private Byte permissionId;
@Column(name = "role_name")
private String roleName;
}
| [
"michal_kruczkowski@o2.pl"
] | michal_kruczkowski@o2.pl |
51a779c0ce3e45cf82b21a55121da7061d8747fc | dba72dcd74e2e04b256dde1c3326ffdb3881bc9b | /week-03/day-2/src/PrintEachLine.java | d06ba2b6bc4b2a447a782d1c580d7e4de68575aa | [] | no_license | green-fox-academy/rdgrv | dc0c6681359706c78acd5776799af54e316c1de5 | 22a24b7f8c0fcd91859600d7d1d75ec32d288cd2 | refs/heads/master | 2021-07-11T05:07:00.242402 | 2019-01-24T09:30:20 | 2019-01-24T09:30:20 | 143,150,938 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 463 | java | import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.Files;
import java.util.List;
public class PrintEachLine {
public static void main(String[] args) {
try {
Path path = Paths.get("my-file.txt");
List<String> lines = Files.readAllLines(path);
for (String line : lines) {
System.out.println(line);
}
} catch (Exception e) {
System.out.println("Unable to read file: my-file.txt");
}
}
} | [
"doraagnesvarga@gmail.com"
] | doraagnesvarga@gmail.com |
a0bdab4ef3899a6f6c8f02c2565ae48bc7a2a226 | 8065897e51519697bf281b72007c8addd0b168a8 | /src/wattwatt/components/devices/suspendable/fridge/Fridge.java | 12b44ff53b1fdb2241c9bc7ae0b9b34a6d984eec | [] | no_license | PascalZheng/WattWatt | bfe4d5520843b15992267632ceaabb661c3962c6 | 7e6d2737d1ea90a961401629af75c126ecdee4cd | refs/heads/master | 2020-08-01T06:08:56.524686 | 2020-02-03T16:25:04 | 2020-02-03T16:25:04 | 210,889,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,853 | java | package wattwatt.components.devices.suspendable.fridge;
import fr.sorbonne_u.components.annotations.OfferedInterfaces;
import fr.sorbonne_u.components.annotations.RequiredInterfaces;
import fr.sorbonne_u.components.cyphy.AbstractCyPhyComponent;
import fr.sorbonne_u.components.cyphy.interfaces.EmbeddingComponentAccessI;
import fr.sorbonne_u.components.exceptions.ComponentShutdownException;
import fr.sorbonne_u.components.exceptions.ComponentStartException;
import fr.sorbonne_u.devs_simulation.architectures.Architecture;
import simulation.models.fridge.FridgeCoupledModel;
import simulation.plugins.FridgeSimulatorPlugin;
import simulation.tools.fridge.FridgeConsumption;
import simulation.tools.fridge.FridgeDoor;
import wattwatt.interfaces.controller.IController;
import wattwatt.interfaces.devices.suspendable.fridge.IFridge;
import wattwatt.ports.devices.suspendable.fridge.FridgeInPort;
import wattwatt.tools.fridge.FridgeSetting;
//-----------------------------------------------------------------------------
/**
* The class <code>Fridge</code>
*
* <p>
* <strong>Description</strong>
* </p>
*
* This class implements the fridge component. The fridge
* requires the controller interface because he have to be
* connected to the controller to receive order from him.
*
*
* <p>
* Created on : 2020-01-27
* </p>
*
* @author
* <p>
* Bah Thierno, Zheng Pascal
* </p>
*/
//The next annotation requires that the referenced interface is added to
//the required interfaces of the component.
@OfferedInterfaces(offered = IFridge.class)
@RequiredInterfaces(required = IController.class)
public class Fridge extends AbstractCyPhyComponent implements EmbeddingComponentAccessI {
// -------------------------------------------------------------------------
// Constants and variables
// -------------------------------------------------------------------------
/** The inbound port of the fridge */
protected FridgeInPort refrin;
/** The mode of the fridge, if he is suspended or not */
protected FridgeConsumption consumptionState;
/** The current state of the fridge door */
protected FridgeDoor currentDoorState;
protected double intensity;
/** The temperature of the fridge used in the simulation */
protected double temperature;
/** The temperature of the upper compartment */
protected double tempH;
/** The temperature of the lower compartment */
protected double tempB;
/** The state of the fridge */
protected boolean isOn;
/** The state of the fridge */
protected boolean isWorking;
/** The energy consumption of the fridge */
protected double conso;
/** the simulation plug-in holding the simulation models. */
protected FridgeSimulatorPlugin asp;
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a washing machine.
*
*
* @param uri URI of the component.
* @param refriIn inbound port URI of the fridge.
* @throws Exception <i>todo.</i>
*/
protected Fridge(String uri, String refriIn) throws Exception {
super(uri, 2, 1);
this.initialise();
this.refrin = new FridgeInPort(refriIn, this);
this.refrin.publishPort();
this.tempH = FridgeSetting.TEMP_H_INIT;
this.tempB = FridgeSetting.TEMP_L_INIT;
this.consumptionState = FridgeConsumption.SUSPENDED;
this.currentDoorState = FridgeDoor.CLOSED;
this.intensity = 0.0;
this.temperature = 2.0;
this.on();
this.tracer.setRelativePosition(1, 0);
}
protected void initialise() throws Exception {
// The coupled model has been made able to create the simulation
// architecture description.
Architecture localArchitecture = this.createLocalArchitecture(null);
// Create the appropriate DEVS simulation plug-in.
this.asp = new FridgeSimulatorPlugin();
// Set the URI of the plug-in, using the URI of its associated
// simulation model.
this.asp.setPluginURI(localArchitecture.getRootModelURI());
// Set the simulation architecture.
this.asp.setSimulationArchitecture(localArchitecture);
// Install the plug-in on the component, starting its own life-cycle.
this.installPlugin(this.asp);
}
// -------------------------------------------------------------------------
// Methods
// -------------------------------------------------------------------------
@Override
public void start() throws ComponentStartException {
super.start();
this.logMessage("Refrigerateur starting");
try {
Thread.sleep(10);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void execute() throws Exception {
super.execute();
}
@Override
public void shutdown() throws ComponentShutdownException {
try {
this.refrin.unpublishPort();
} catch (Exception e) {
e.printStackTrace();
}
super.shutdown();
}
@Override
public void finalise() throws Exception {
super.finalise();
}
// -------------------------------------------------------------------------
// Methods
// -------------------------------------------------------------------------
/**
* @see fr.sorbonne_u.components.cyphy.AbstractCyPhyComponent#createLocalArchitecture(java.lang.String)
*/
@Override
protected Architecture createLocalArchitecture(String architectureURI) throws Exception {
return FridgeCoupledModel.build();
}
/**
* @see fr.sorbonne_u.components.cyphy.interfaces.EmbeddingComponentStateAccessI#getEmbeddingComponentStateValue(java.lang.String)
*/
@Override
public Object getEmbeddingComponentStateValue(String name) throws Exception {
if (name.equals("door")) {
return this.currentDoorState;
} else if (name.equals("consumption")) {
return new Double(this.conso);
} else if (name.equals("temperature")) {
return new Double(this.temperature);
} else {
assert name.equals("state");
return this.consumptionState;
}
}
@Override
public void setEmbeddingComponentStateValue(String name, Object value) throws Exception {
if (name.equals("close")) {
this.currentDoorState = FridgeDoor.CLOSED;
} else if (name.equals("open")) {
this.currentDoorState = FridgeDoor.OPENED;
} else if (name.equals("suspend")) {
this.suspend();
} else if (name.equals("temperature")) {
this.temperature = (double) value;
} else if (name.equals("consumption")) {
this.conso = (double) value;
} else {
assert name.equals("resume");
this.resume();
}
}
public double getTempHaut() {
return this.tempH;
}
public double getTempBas() {
return this.tempB;
}
public void suspend() {
this.consumptionState = FridgeConsumption.SUSPENDED;
this.isWorking = false;
}
public void resume() {
this.consumptionState = FridgeConsumption.RESUMED;
if (this.isOn) {
this.isWorking = true;
} else {
this.isWorking = false;
}
}
public void on() {
this.isOn = true;
this.isWorking = true;
}
public void off() {
this.isOn = false;
this.isWorking = false;
}
public boolean isWorking() {
return this.isWorking;
}
public boolean isOn() {
return this.isOn;
}
public double giveConso() {
return conso;
}
public void setDoorState(FridgeDoor door) {
this.currentDoorState = door;
}
public void setConsumptionState(FridgeConsumption consumption) {
this.consumptionState = consumption;
}
public void setIntensity(double intensity) {
this.intensity = intensity;
}
public void setTemperature(double temperature) {
this.temperature = temperature;
}
public void regule() {
if (this.isOn) {
if (this.isWorking) {
if (this.tempH > FridgeSetting.TEMP_H_MIN) {
this.tempH--;
}
if (this.tempB > FridgeSetting.TEMP_L_MIN) {
this.tempB--;
}
this.conso += FridgeSetting.ACTIVE_CONSUMPTION;
} else {
if (this.tempH < FridgeSetting.TEMP_H_MAX) {
this.tempH++;
}
if (this.tempB < FridgeSetting.TEMP_L_MAX) {
this.tempB++;
}
if (this.conso - FridgeSetting.PASSIVE_CONSUMPTION <= 0) {
this.conso = 0;
} else {
this.conso -= FridgeSetting.PASSIVE_CONSUMPTION;
}
}
} else {
if (this.conso - FridgeSetting.PASSIVE_CONSUMPTION <= 0) {
this.conso = 0;
} else {
this.conso -= FridgeSetting.PASSIVE_CONSUMPTION;
}
}
}
public void printState() {
this.logMessage(">>> isOn : [" + this.isOn + "] Working : [" + this.isWorking + "] Temp Haut : ["
+ this.getTempHaut() + " ] Temp Bas : [" + this.getTempBas() + " ] \n>>> Conso depuis le debut : ["
+ this.giveConso() + " ]\n");
}
}
| [
"zheng.pascal@gmail.com"
] | zheng.pascal@gmail.com |
1894b002d846ece9d61f82fe968c7962d1207ea0 | 6a36169755d9412435a844aae78d4ba203539308 | /Locadora/Locadora/FILMES.java | 1ac17a8e7011a9dbfbe03b504f4b93ce171543cb | [] | no_license | michelmorais/locadoralocafacil | caa99fdc9a4369afc24716e7828cff426ebce6e6 | b7bbd47f274ef764f833be3cee63be5e84412aeb | refs/heads/master | 2021-01-19T17:57:21.699479 | 2010-11-16T17:04:29 | 2010-11-16T17:04:29 | 32,329,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 595 | java | package Locadora;
public class FILMES
{
public int id_filmes;
public String nome;
public int qtde;
public int qtde_disponivel;
public int id_genero;
public int id_categoria;
public String sinopse;
public String nome_genero;
public String nome_categoria;
public String observacao;
public int id_itens_pd_locacao;
public String data_entrega;//usado somente para consulta (inner join)
public String preco;//usado somente para consulta (inner join)
public String situacao;//usado para devolucao
public int id_devolucao;//usado para devolucao
}
| [
"Michel.braz.morais@163bf44e-5e22-494a-3104-4736a7a0d7f0"
] | Michel.braz.morais@163bf44e-5e22-494a-3104-4736a7a0d7f0 |
6ab828265eb719017863e952fae4a2830db26410 | 8a6abfee7d223875badafb924dc61be72598508f | /src/main/java/Commands.java | bd18758411d4d55c41b2510a60dccefcd6cc3ba4 | [] | no_license | CoocooFroggy/King-of-the-Hill-Bot | 71cce1dbdd8bbd42528b198eb066175f68054574 | 7001299a5f25659d470a0fb6539ed3519591f501 | refs/heads/master | 2023-07-06T23:08:45.497539 | 2021-08-14T04:07:25 | 2021-08-14T04:07:25 | 336,071,959 | 0 | 1 | null | 2021-08-14T18:53:59 | 2021-02-04T20:17:40 | Java | UTF-8 | Java | false | false | 16,907 | java | import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.exceptions.ErrorResponseException;
import net.dv8tion.jda.api.interactions.commands.OptionMapping;
import net.dv8tion.jda.api.requests.ErrorResponse;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.time.Duration;
import java.time.Instant;
import java.util.List;
import java.util.Timer;
import java.util.concurrent.TimeUnit;
public class Commands {
public static String pushCommand(User user, Member member, Guild guild, TextChannel channel, OptionMapping userToPush) throws SQLException {
//Vars
Statement statement = Main.statement;
String userId = user.getId();
String guildId = guild.getId();
String channelId = channel.getId();
String nickname;
Instant currentTimestamp = Instant.now();
long currentTimestampEpoch = Instant.now().toEpochMilli();
//Fetch all bans
ResultSet bansResultSet = statement.executeQuery("SELECT expiretimestamp FROM kingbans " +
"WHERE guildid = '" + guildId + "' AND channelid = '" + channelId + "' AND userid = '" + userId + "'");
//If a ban exists for the user ID
while (bansResultSet.next()) {
long banExpireTimestamp = Long.parseLong(bansResultSet.getString("expiretimestamp"));
//if the current date is before the timestamp
if (currentTimestampEpoch < banExpireTimestamp) {
long banDuration = banExpireTimestamp - currentTimestampEpoch;
String banDurationFormatted = String.format("%d hours and %d minutes",
TimeUnit.SECONDS.toHours(banDuration),
TimeUnit.SECONDS.toMinutes(banDuration) -
TimeUnit.HOURS.toMinutes(TimeUnit.SECONDS.toHours(banDuration))
);
return ("You are banned for **" + banDurationFormatted + "** :(");
}
}
//Get personal name for user
if (member.getNickname() == null)
nickname = user.getName();
else
nickname = member.getNickname();
//Get user ID of king
ResultSet resultSet = statement.executeQuery(
"SELECT userid, timestamp FROM king " +
"WHERE key = 'king' AND guildid = '" + guildId + "' AND channelid = '" + channelId + "'");
//If there's no hill in this channel + guild
if (!resultSet.next())
return "EPHEMERAL:There's no Hill in the current channel. Use `/create` to create one!";
//King vars part 1
int kingidIndex = resultSet.findColumn("userid");
int kingTimestampIndex = resultSet.findColumn("timestamp");
String kingId = resultSet.getString(kingidIndex);
String kingTimestamp = resultSet.getString(kingTimestampIndex);
//If there already is row for this guild and channel, just no king
if (kingId == null) {
statement.execute("UPDATE king " +
"SET userid = '" + userId + "', timestamp = '" + currentTimestampEpoch + "' " +
"WHERE key = 'king' AND guildid = '" + guildId + "' AND channelid = '" + channelId + "'");
//Create roles if they don't exist
createRoles(guild);
//Distribute roles
distributeRoles(null, member, guild, channel);
return ("**" + nickname + "** is now king of the hill!");
}
// If nobody is mentioned
if (userToPush == null) {
//If you're the king
if (userId.equals(kingId)) {
return ("You're the king already!");
} else {
return ("Please mention a player to push!");
}
}
//King vars P2
String pushedUserId = userToPush.getAsUser().getId();
User kingUser = Main.jda.retrieveUserById(kingId).complete();
// Member of the person pushed off
Member kingMember = null;
// What to call the person who was pushed off
String kingName;
// Temp variable for their literal server nickname
String kingNick = null;
try {
kingMember = guild.retrieveMember(kingUser).complete();
kingNick = kingMember.getNickname();
}
// We just catch because it's ok if kingMember is null. No action necessary
catch (ErrorResponseException ignored) {
}
// If you mention yourself
if (pushedUserId.equals(userId)) {
return ("You can't push yourself off, silly!");
}
// Get personal name for king
if (kingNick == null)
kingName = kingUser.getName();
else
kingName = kingNick;
// Otherwise, check if they pushed the king off
if (pushedUserId.equals(kingId)) {
//Create roles if they don't exist
createRoles(guild);
//Distribute roles
distributeRoles(kingMember, member, guild, channel);
//Update king's stats (person who just got pushed off, not the pusher)
updateKingStats(guildId, channelId, kingId, kingTimestamp, currentTimestamp);
// Get totalkings
ResultSet totalKingsResultSet = statement.executeQuery("SELECT totalkings FROM kingstats " +
"WHERE guildid = '" + guildId + "' AND channelid = '" + channelId + "' AND userid = '" + userId + "'");
int totalkings = 0;
// If they already have a value
if (totalKingsResultSet.next()) {
totalkings = totalKingsResultSet.getInt("totalkings");
}
// Increment totalkings
totalkings++;
// Put it back
statement.executeUpdate("UPDATE kingstats " +
"SET totalkings = " + totalkings + " " +
"WHERE guildid = '" + guildId + "' AND channelid = '" + channelId + "' AND userid = '" + userId + "'");
//Push off the king
statement.executeUpdate("UPDATE king " +
"SET userid = '" + kingId + "' " +
"WHERE key = 'pushed' AND guildid = '" + guildId + "' AND channelid = '" + channelId + "'");
//Make the pusher the new king
statement.executeUpdate("UPDATE king " +
"SET userid = '" + userId + "', timestamp = '" + currentTimestampEpoch + "'" +
"WHERE key = 'king' AND guildid = '" + guildId + "' AND channelid = '" + channelId + "'");
return ("**" + nickname + "** pushed **" + kingName + "** off the hill!");
}
//Else if they didn't push the king off the hill
else {
return ("Please push **" + kingName + "** off the hill!");
}
}
public static String createCommand(Guild guild, Member member, TextChannel channel) throws SQLException {
//Vars
Statement statement = Main.statement;
String guildId = guild.getId();
String channelId = channel.getId();
//If they don't have manage server perms, ignore them
if (!member.hasPermission(Permission.MANAGE_CHANNEL))
return "EPHEMERAL:You need Manage Channel permissions to create a Hill.";
//See if hill exists here
ResultSet resultSet = statement.executeQuery(
"SELECT * FROM king " +
"WHERE key = 'king' AND guildid = '" + guildId + "' AND channelid = '" + channelId + "'");
//Check if hill already exists here
if (resultSet.next()) {
return ("EPHEMERAL:Cannot create a hill here, hill already exists!");
}
createRoles(guild);
//Otherwise create a hill here
statement.execute("INSERT INTO king (key, guildid, channelid) VALUES " +
"('king', '" + guildId + "', '" + channelId + "')");
statement.execute("INSERT INTO king (key, guildid, channelid) VALUES " +
"('pushed', '" + guildId + "', '" + channelId + "')");
return ("Hill created! Do `/push` to start!");
}
public static String removeCommand(Guild guild, Member member, TextChannel channel) throws SQLException {
//DELETE FROM king WHERE channelid = '685618172975513625';
//Vars
Statement statement = Main.statement;
String guildId = guild.getId();
String channelId = channel.getId();
//If they don't have manage server perms, ignore them
if (!member.hasPermission(Permission.MANAGE_CHANNEL))
return "EPHEMERAL:You need Manage Channel permissions to remove a Hill.";
statement.execute("DELETE FROM king WHERE guildid = '" + guildId + "' AND channelid = '" + channelId + "'");
return ("Removed hill from this channel.");
}
public static String statsCommand(Guild guild, Member member, TextChannel channel, OptionMapping user) throws SQLException {
//Vars
Statement statement = Main.statement;
String userId = member.getId();
String guildId = guild.getId();
String channelId = channel.getId();
int totalSeconds = 0;
int totalkings = 0;
int totalpushed = 0;
String nickname;
//if they mentioned a user
if (user != null) {
//Then set the user ID to that mentioned user
userId = user.getAsUser().getId();
member = guild.retrieveMemberById(userId).complete();
}
//Otherwise it'll be the user ID of the user who triggered the command
//Get personal name for user
if (member.getNickname() == null)
nickname = member.getUser().getName();
else
nickname = member.getNickname();
//Get stats
ResultSet kingstatsResultSet = statement.executeQuery("SELECT totalseconds, totalkings, totalpushed FROM kingstats " +
"WHERE guildid = '" + guildId + "' AND channelid = '" + channelId + "' AND userid = '" + userId + "'");
//Get stored seconds
if (kingstatsResultSet.next()) {
String totalsecondsString = kingstatsResultSet.getString("totalseconds");
totalkings = kingstatsResultSet.getInt("totalkings");
totalpushed = kingstatsResultSet.getInt("totalpushed");
totalSeconds = Integer.parseInt(totalsecondsString);
}
//Get king of the channel + timestamp
ResultSet kingResultSet = statement.executeQuery("SELECT userid, timestamp FROM king " +
"WHERE key = 'king' AND guildid = '" + guildId + "' AND channelid = '" + channelId + "'");
//If there's no hill in this channel
if (!kingResultSet.next())
return "EPHEMERAL:There's no hill in this channel!";
//Add current session's seconds if you're king
int kingIdIndex = kingResultSet.findColumn("userid");
String kingId = kingResultSet.getString(kingIdIndex);
if (userId.equals(kingId)) {
Instant currentInstant = Instant.now();
String kingStartEpoch = kingResultSet.getString("timestamp");
Instant kingStartInstant = Instant.ofEpochMilli(Long.parseLong(kingStartEpoch));
Duration between = Duration.between(kingStartInstant, currentInstant);
totalSeconds += between.getSeconds();
}
//If your time is 0
if (totalSeconds == 0) {
return ("**" + nickname + "** hasn't been king yet.");
}
String formattedTime = String.format("%d hours, %d minutes, %d seconds",
TimeUnit.SECONDS.toHours(totalSeconds),
TimeUnit.SECONDS.toMinutes(totalSeconds) -
TimeUnit.HOURS.toMinutes(TimeUnit.SECONDS.toHours(totalSeconds)),
totalSeconds -
TimeUnit.MINUTES.toSeconds(TimeUnit.SECONDS.toMinutes(totalSeconds))
);
return ("**" + nickname + "** has been king for **" + formattedTime + "**.\n" +
"They've also been king " + totalkings + " times and has been pushed off " + totalpushed + " times.");
}
public static String kingBanCommand(Guild guild, Member member, TextChannel channel, OptionMapping userToBan) {
//Vars
Statement statement = Main.statement;
String guildId = guild.getId();
String channelId = channel.getId();
//If they don't have manage server perms, ignore them
if (!member.hasPermission(Permission.MANAGE_CHANNEL))
return "EPHEMERAL:You need Manage Channel permissions to ban a player from this Hill.";
return "EPHEMERAL:Not implemented yet!";
}
/* UTILITIES */
//Distribute roles
static Timer distributeTimer;
public static void distributeRoles(Member kingMember, Member member, Guild guild, TextChannel channel) throws SQLException {
//If we don't have perms to distribute roles, do nothing
if (!guild.getSelfMember().hasPermission(Permission.MANAGE_ROLES))
return;
//Vars
Statement statement = Main.statement;
String pushedId = null;
String guildId = guild.getId();
String channelId = channel.getId();
//Cancel existing timers
if (distributeTimer != null) {
distributeTimer.cancel();
distributeTimer.purge();
}
//Get user ID of pushed off
ResultSet resultSet;
resultSet = statement.executeQuery(
"SELECT userid FROM king " +
"WHERE key = 'pushed' AND guildid = '" + guildId + "' AND channelid = '" + channelId + "'");
if (resultSet.next()) {
pushedId = resultSet.getString("userid");
}
distributeTimer = new Timer();
distributeTimer.schedule(new DistributeRolesTimer(member, kingMember, pushedId, guild, channel), 5000);
}
public static void createRoles(Guild guild) {
//If we don't have manage role perms, just don't do anything
if (!guild.getSelfMember().hasPermission(Permission.MANAGE_ROLES))
return;
//Check if roles already exist
List<Role> kothRoles = guild.getRolesByName("King of the Hill!", false);
List<Role> pushedRoles = guild.getRolesByName("Pushed off the Hill", false);
//Make it if it doesn't
if (kothRoles.isEmpty()) {
guild.createRole()
.setName("King of the Hill!")
.setPermissions()
.queue();
}
if (pushedRoles.isEmpty()) {
guild.createRole()
.setName("Pushed off the Hill")
.setPermissions()
.queue();
}
}
public static void updateKingStats(String guildId, String channelId, String kingId, String kingTimestamp, Instant currentTimestamp) throws SQLException {
//Vars
Statement statement = Main.statement;
Instant kingStartDate = Instant.ofEpochMilli(Long.parseLong(kingTimestamp));
//Get king's totalseconds and totalpushed
ResultSet statsResultSet = statement.executeQuery("SELECT totalseconds, totalpushed FROM kingstats " +
"WHERE guildid = '" + guildId + "' AND channelid = '" + channelId + "' AND userid = '" + kingId + "'");
//Stats vars
long totalseconds = 0;
long totalpushed = 0;
//If they already have stats, add time
if (statsResultSet.next()) {
//Time
String totalsecondsString = statsResultSet.getString("totalseconds");
totalseconds = Long.parseLong(totalsecondsString);
//Kings
totalpushed = statsResultSet.getInt("totalpushed");
}
//Calculate how long they've been king
Duration between = Duration.between(kingStartDate, currentTimestamp);
long kingSessionSeconds = between.getSeconds();
//Add to totalseconds
totalseconds += kingSessionSeconds;
//Add to totalpushed
totalpushed++;
//Update table with new stats
statement.execute("UPDATE kingstats SET totalseconds = '" + totalseconds + "', totalpushed = '" + totalpushed + "' WHERE guildid = '" + guildId + "' AND channelid = '" + channelId + "' AND userid = '" + kingId + "'; " +
"INSERT INTO kingstats (guildid, channelid, userid, totalseconds, totalpushed) " +
"SELECT '" + guildId + "', '" + channelId + "', '" + kingId + "', '" + totalseconds + "', '" + totalpushed + "' " +
"WHERE NOT EXISTS (SELECT 1 FROM kingstats WHERE guildid = '" + guildId + "' AND channelid = '" + channelId + "' AND userid = '" + kingId + "');"
);
}
}
| [
"johnandklay@gmail.com"
] | johnandklay@gmail.com |
511cc8fcb72f8656288bf136e2f40d2bd6f1bde4 | 324fea83bc8135ab591f222f4cefa19b43d30944 | /src/main/java/ru/lanbilling/webservice/wsdl/BlkVgroup.java | f94181198dc48e3a2ae6ad0fd1b055b11fda47f8 | [
"MIT"
] | permissive | kanonirov/lanb-client | 2c14fac4d583c1c9f524634fa15e0f7279b8542d | bfe333cf41998e806f9c74ad257c6f2d7e013ba1 | refs/heads/master | 2021-01-10T08:47:46.996645 | 2015-10-26T07:51:35 | 2015-10-26T07:51:35 | 44,953,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,705 | java |
package ru.lanbilling.webservice.wsdl;
import javax.annotation.Generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <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="id" type="{http://www.w3.org/2001/XMLSchema}long"/>
* <element name="state" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"id",
"state"
})
@XmlRootElement(name = "blkVgroup")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11")
public class BlkVgroup {
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11")
protected long id;
@XmlElement(defaultValue = "")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11")
protected String state;
/**
* Gets the value of the id property.
*
*/
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11")
public long getId() {
return id;
}
/**
* Sets the value of the id property.
*
*/
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11")
public void setId(long value) {
this.id = value;
}
/**
* Gets the value of the state property.
*
* @return
* possible object is
* {@link String }
*
*/
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11")
public String getState() {
return state;
}
/**
* Sets the value of the state property.
*
* @param value
* allowed object is
* {@link String }
*
*/
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11")
public void setState(String value) {
this.state = value;
}
}
| [
"kio@iteratia.com"
] | kio@iteratia.com |
0f6cadbd6b4c1bf70644d62f44e47feefa69209b | bd81360948c417a1f80677a3911625e4e26e0241 | /Scuola/Tpsit/Risponditore/src/risponditore/Edge.java | 1131dca1f5076beaa69cd8786eb42a0cd59aeebb | [] | no_license | MicheleLadisa/cose | dde509279d94d1003347ea06feb6532ac817c958 | 2a3a97a4a51a077fc98d54caed1b4a973d62e537 | refs/heads/master | 2018-07-23T02:27:43.392976 | 2018-06-02T10:50:26 | 2018-06-02T10:50:26 | 119,897,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | 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 risponditore;
/**
*
* @author ladis
*/
public class Edge
{
private String command;
private Node endNode;
public Edge(String command, Node endNode)
{
this.command=command;
this.endNode=endNode;
}
public String getCommand()
{
return command;
}
public Node getEndNode()
{
return endNode;
}
}
| [
"ladisamichele@gmail.com"
] | ladisamichele@gmail.com |
c41c5c5903cfff070960cbf19c793618f5152bed | 72f91b73855bf5b6e508ed978591e7dac389ffa9 | /app/src/main/java/com/plan2/example_rest_api/view/activity/MainLibWorld.java | b68db0054e1f2eca7de0313e13edb42742daf53f | [] | no_license | qk54r71/DREAM_UI | f0bcfa773c6834f4b28abc06bc350a759da54027 | 40c11df99f57d08f44428a3960c6831193768d3a | refs/heads/master | 2021-08-23T14:01:33.874325 | 2017-12-05T05:15:34 | 2017-12-05T05:15:34 | 112,826,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 401 | java | package com.plan2.example_rest_api.view.activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.plan2.example_rest_api.R;
public class MainLibWorld extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_lib_world);
}
}
| [
"qk54r71@nate.com"
] | qk54r71@nate.com |
42dcf87a18ffa6ecbe6dc800325ddb6630a67006 | 07ba22802386b8fe92d7319f46dba1db4bfa7235 | /oblib/src/main/java/com/oldbaby/oblib/image/viewer/ImageDataAdapter.java | 164c1c9f45dae7671ed0f25bebcf15a4c9a73f0a | [
"Apache-2.0"
] | permissive | kHRYSTAL/Old-Baby | 0b8610cac38c0e4d515b551553c5e5510d3736ab | c8d90bee468c0f0cde4eb2f32ab9e381f99e2445 | refs/heads/master | 2020-04-07T15:37:23.900913 | 2018-11-21T05:46:54 | 2018-11-21T05:46:54 | 158,493,517 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 685 | java | package com.oldbaby.oblib.image.viewer;
import java.io.Serializable;
public interface ImageDataAdapter extends Serializable {
/**
* 有多少条浏览
*
* @return
*/
public int count();
/**
* 获取制定位置的URL
*
* @param postion
* @return
*/
public String getUrl(int postion);
/**
* 获取制定位置的图片id
*/
public int getDrawableId(int position);
/**
* 删除某张照片
*
* @param position
*/
void remove(int position);
/**
* 获取某张照片的描述
*
* @param position
* @return
*/
String getDesc(int position);
} | [
"723526676@qq.com"
] | 723526676@qq.com |
216ba5fc6928480ae0e748b9256947b6949849d7 | d6fab02581491bccf4f91bb308b408dc8cae1f42 | /jlmq-with-stomp/src/main/java/ru/itis/jlmqwithstomp/models/JlmqMessage.java | 0809258b76b13e1485a6830d22f959fb26c8003d | [] | no_license | almazik77/jlmq-with-stomp | 970c379c7f05508bb2613eb24d8f84e8e04457ea | 0304370495299dc8dcfcb995c5a1920779304206 | refs/heads/master | 2022-06-06T04:24:09.965001 | 2020-05-04T18:10:58 | 2020-05-04T18:10:58 | 261,260,178 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 689 | java | package ru.itis.jlmqwithstomp.models;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
import javax.persistence.*;
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@Builder
@ToString
@Table(name = "message")
public class JlmqMessage {
@JsonIgnore
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@JsonIgnore
private String messageId;
@JsonIgnore
@ManyToOne
@JoinColumn(name = "queue_id")
private Queue queue;
@JsonIgnore
@Enumerated(EnumType.STRING)
private Status status;
private String body;
public enum Status {
RECEIVED, ACCEPTED, COMPLETED;
}
}
| [
"musin.almaz33@gmail.com"
] | musin.almaz33@gmail.com |
b62545bd95352899b81dcb329db7f4800a7782d1 | 45c9aec65591ae8f0b492e17308c7740f49d16c0 | /src/com/_10_Arreglos/_01_Explicacion.java | c3e04378e8d2fbf38a9c832c1e6bce3429c46314 | [] | no_license | DanielFernandoYepezVelez/Fundamentos-Java | 6f4524f2db1b7854e6173650de9352feba9496ac | dca0fe505e30e7f2cbb59c447de71ba95d7461a1 | refs/heads/main | 2023-05-16T08:12:20.047399 | 2023-05-11T02:43:37 | 2023-05-11T02:43:37 | 328,040,970 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 658 | java | package com._10_Arreglos;
public class _01_Explicacion {
public static void CreateArrays() {
int[] numbers = new int[4];
numbers[0] = 134;
numbers[1] = Integer.valueOf("2");
numbers[2] = 34;
numbers[3] = 10;
int i = numbers[0];
int j = numbers[1];
int k = numbers[2];
//int l = numbers[3];
int l = numbers[numbers.length - 1];
System.out.println("========== EXPLICACIÒN ARREGLOS ==========");
System.out.println("i = " + i);
System.out.println("j = " + j);
System.out.println("k = " + k);
System.out.println("l = " + l);
}
}
| [
"danipez.02@gmail.com"
] | danipez.02@gmail.com |
e6435b5d9a4c05466f6d54cfb5fa7424e5537192 | aaef72117a2208f9d06ee7b17964c6d189e4b597 | /src/com/fym/app/utils/LogUtil.java | adba286ca0a1cfad5621dcd312c696507a226a0d | [] | no_license | 2245957331/fym | 0f104418e42344c622515e1ecaa035f6d4b33e92 | c614fc44db855fc7dd031bcb979fd720e00a7c52 | refs/heads/master | 2021-01-20T02:07:57.792276 | 2013-05-31T02:15:02 | 2013-05-31T02:15:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,173 | java | package com.fym.app.utils;
public class LogUtil {
public static boolean isDebug = false;
public static void v(String tag, String msg) {
if (isDebug)
android.util.Log.v(tag, msg);
}
public static void v(String tag, String msg, Throwable t) {
if (isDebug)
android.util.Log.v(tag, msg, t);
}
public static void d(String tag, String msg) {
if (isDebug)
android.util.Log.d(tag, msg);
}
public static void d(String tag, String msg, Throwable t) {
if (isDebug)
android.util.Log.d(tag, msg, t);
}
public static void i(String tag, String msg) {
if (isDebug)
android.util.Log.i(tag, msg);
}
public static void i(String tag, String msg, Throwable t) {
if (isDebug)
android.util.Log.i(tag, msg, t);
}
public static void w(String tag, String msg) {
if (isDebug)
android.util.Log.w(tag, msg);
}
public static void w(String tag, String msg, Throwable t) {
if (isDebug)
android.util.Log.w(tag, msg, t);
}
public static void e(String tag, String msg) {
if (isDebug)
android.util.Log.e(tag, msg);
}
public static void e(String tag, String msg, Throwable t) {
if (isDebug)
android.util.Log.e(tag, msg, t);
}
}
| [
"2245957331@qq.com"
] | 2245957331@qq.com |
ff48089c8ea12bd479aaa7a2dab9361473b35ab2 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Chart/23/org/jfree/chart/plot/Plot_getNoDataMessagePaint_396.java | 84a43e10a67d7e60d91ee4a2c0eadd3ac671e43e | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 1,808 | java |
org jfree chart plot
base plot free chart jfreechart
link org jfree chart free chart jfreechart deleg draw ax
data plot base facil common plot
type
plot axi chang listen axischangelisten
return paint displai 'no data' messag
paint code code
set data messag paint setnodatamessagepaint paint
data messag getnodatamessag
paint data messag paint getnodatamessagepaint
data messag paint nodatamessagepaint
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
d60d8e19bccb3f9feccbb9a574c304a41e7d55b7 | f13ded84ed52291ae06f61e38b6aa918e45d4a5d | /app/src/main/java/com/yinaf/dragon/Content/Utils/DoorLock/util/EspNetUtil.java | 0c46de080c699523192793eef9623bd2b34ca162 | [] | no_license | 18649738669/YNFandroid | 5cf03c90d295ce6b967b228ad8002a998f389ad0 | 683d88f7d80e2991d57f277e9eeeb3e644b840fe | refs/heads/master | 2020-03-20T09:19:05.480519 | 2018-06-14T09:25:44 | 2018-06-14T09:25:44 | 137,333,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,303 | java | package com.yinaf.dragon.Content.Utils.DoorLock.util;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class EspNetUtil {
/**
* get the local ip address by Android System
*
* @param context
* the context
* @return the local ip addr allocated by Ap
*/
public static InetAddress getLocalInetAddress(Context context) {
WifiManager wm = (WifiManager) context
.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wm.getConnectionInfo();
int localAddrInt = wifiInfo.getIpAddress();
String localAddrStr = __formatString(localAddrInt);
InetAddress localInetAddr = null;
try {
localInetAddr = InetAddress.getByName(localAddrStr);
} catch (UnknownHostException e) {
e.printStackTrace();
}
return localInetAddr;
}
private static String __formatString(int value) {
String strValue = "";
byte[] ary = __intToByteArray(value);
for (int i = ary.length - 1; i >= 0; i--) {
strValue += (ary[i] & 0xFF);
if (i > 0) {
strValue += ".";
}
}
return strValue;
}
private static byte[] __intToByteArray(int value) {
byte[] b = new byte[4];
for (int i = 0; i < 4; i++) {
int offset = (b.length - 1 - i) * 8;
b[i] = (byte) ((value >>> offset) & 0xFF);
}
return b;
}
/**
* parse InetAddress
*
* @param inetAddrBytes
* @return
*/
public static InetAddress parseInetAddr(byte[] inetAddrBytes, int offset,
int count) {
InetAddress inetAddress = null;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < count; i++) {
sb.append(Integer.toString(inetAddrBytes[offset + i] & 0xff));
if (i != count-1) {
sb.append('.');
}
}
try {
inetAddress = InetAddress.getByName(sb.toString());
} catch (UnknownHostException e) {
e.printStackTrace();
}
return inetAddress;
}
/**
* parse bssid
*
* @param bssid the bssid
* @return byte converted from bssid
*/
public static byte[] parseBssid2bytes(String bssid) {
String bssidSplits[] = bssid.split(":");
byte[] result = new byte[bssidSplits.length];
for(int i = 0;i < bssidSplits.length; i++) {
result[i] = (byte) Integer.parseInt(bssidSplits[i], 16);
}
return result;
}
}
| [
"18649738669@163.com"
] | 18649738669@163.com |
0da5ce881224f71cc272e7515e86f14c58d796d8 | 6062d781a1e500614eb852dff40202dc24a904d0 | /week-07/day-01/practice/src/test/java/com/greenfoxacademy/springintro/SpringintroApplicationTests.java | abeb88569b4a426292fc979aa41b9ec473221e28 | [] | no_license | green-fox-academy/Lilla | 4c50f9b3fee2835685661a904bbd9688c6ffbace | c35b4e2be51ea994a4e03ca534b2d7f2a6392261 | refs/heads/master | 2021-09-10T10:37:18.868729 | 2018-03-24T15:25:09 | 2018-03-24T15:25:09 | 112,354,547 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 353 | java | package com.greenfoxacademy.springintro;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SpringintroApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"vajdalil.hu@gmail.com"
] | vajdalil.hu@gmail.com |
b7a281109161f8557b1ca1e7639d7e6c2860917d | e1429516f202cffc789e98a3609a6c0fcc06527a | /app/src/main/java/construction/thesquare/shared/utils/DialogBuilder.java | fa4e856747fc78664c5157b7f8df5b24ada3e0d4 | [] | no_license | Swapna-Viasat/UK_project_square | 793a0affa018def9ac491a721b608b26f84b41b1 | fc0c12752f330b22d2dce02ca24acbac38b8e83f | refs/heads/master | 2021-01-20T02:01:34.696700 | 2017-04-25T13:10:28 | 2017-04-25T13:10:28 | 89,361,682 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,325 | java | package construction.thesquare.shared.utils;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.support.annotation.StringRes;
import android.support.design.widget.TextInputLayout;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import construction.thesquare.R;
import construction.thesquare.shared.view.widget.LoadingDialog;
import construction.thesquare.worker.onboarding.OnLanguagesSelectedListener;
public class DialogBuilder {
public interface OnClickStandardDialog {
void onOKClickStandardDialog(Context context);
}
public interface OnClickTwoOptionsStandardDialog {
void onClickOptionOneStandardDialog(Context context);
void onClickOptionTwoStandardDialog(Context context);
}
public interface OnTextInputDialogListener {
void onInputFinished(String input);
}
public static Dialog showCustomDialog(Context context) {
if (Build.VERSION.SDK_INT > 14) {
Dialog dialog = new LoadingDialog(context);
dialog.show();
if (dialog.getWindow() != null) {
dialog.getWindow()
.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
}
return dialog;
} else {
Dialog dialog = ProgressDialog.show(context, null, null);
dialog.setContentView(R.layout.loader);
if (dialog.getWindow() != null) {
dialog.getWindow()
.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
}
return dialog;
}
}
public static void cancelDialog(Dialog dialog) {
try {
if (dialog != null) {
dialog.cancel();
}
} catch (Exception e) {
CrashLogHelper.logException(e);
}
}
public static void showStandardDialog(Context context, String title, String message) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(title);
builder.setMessage(message).setPositiveButton(context.getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
afterShowSetProperties(builder, context);
//builder.show();
}
public static void showStandardDialog(final Context context, String title, String message,
final OnClickStandardDialog listener) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(title);
builder.setMessage(message).setPositiveButton(context.getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
listener.onOKClickStandardDialog(context);
}
});
afterShowSetProperties(builder, context);
//builder.show();
}
public static void showStandardDialog(final Context context, String title, String message,
final DialogInterface.OnClickListener listener) {
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(title);
builder.setMessage(message).setPositiveButton(context.getResources().getString(R.string.ok),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Log.d("tag", String.valueOf(dialog.hashCode()));
dialog.dismiss();
listener.onClick(dialog, id);
}
});
afterShowSetProperties(builder, context);
//builder.show();
}
public static Dialog showTwoOptionsStandardDialog(final Context context, String title, String message,
String btnOneText, String btnTwoText, final OnClickTwoOptionsStandardDialog listener) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(title);
builder.setMessage(message).setPositiveButton(btnTwoText, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
listener.onClickOptionTwoStandardDialog(context);
}
});
builder.setMessage(message).setNegativeButton(btnOneText, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
listener.onClickOptionOneStandardDialog(context);
}
});
afterShowSetProperties(builder, context);
return builder.create();
}
public static void showDeleteDraftDialog(final Context context,
final View.OnClickListener listener) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
// TODO: move strings out into resources
builder.setTitle("Delete Draft");
builder.setMessage("Are you sure you want to delete this draft job?");
builder.setPositiveButton("DELETE", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
listener.onClick(new View(context));
}
}).setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}).show();
}
public static AlertDialog.Builder getStandardDialog(Context context, String title, String message) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(title);
builder.setMessage(message);
return builder;
}
public static void showInputDialog(final Context context,
@StringRes int titleResId,
@StringRes int hintResId,
final OnTextInputDialogListener listener) {
if (context == null) return;
AlertDialog.Builder builder = new AlertDialog.Builder(context);
View viewInflated = LayoutInflater.from(context).inflate(R.layout.dialog_with_input, null, false);
final EditText input = (EditText) viewInflated.findViewById(R.id.input);
TextInputLayout textInputLayout = (TextInputLayout) viewInflated.findViewById(R.id.inputLayout);
builder.setView(viewInflated);
if (titleResId > 0) builder.setTitle(titleResId);
if (hintResId > 0) textInputLayout.setHint(context.getString(hintResId));
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (listener != null) listener.onInputFinished(input.getText().toString());
dialog.dismiss();
}
});
builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
afterShowSetProperties(builder, context);
}
public static void showCancelBookingDialog(Context context, DialogInterface.OnClickListener listener) {
if (context == null) return;
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
View viewInflated = LayoutInflater.from(context).inflate(R.layout.dialog_booking_cancel, null, false);
builder.setView(viewInflated);
viewInflated.findViewById(R.id.dialog_booking_keep).setVisibility(View.GONE);
viewInflated.findViewById(R.id.dialog_booking_cancel).setVisibility(View.GONE);
builder.setNegativeButton(R.string.employer_dialog_booking_cancel, listener);
builder.setPositiveButton(R.string.job_i_can_make_it, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
afterShowSetProperties(builder, context);
}
public static void afterShowSetProperties(AlertDialog.Builder builder, Context context) {
try {
if (context == null) return;
Typeface typeFaceSemiBold = Typeface.createFromAsset(context.getAssets(), "fonts/JosefinSans-SemiBold.ttf");
Typeface typeFaceBold = Typeface.createFromAsset(context.getAssets(), "fonts/JosefinSans-Bold.ttf");
AlertDialog alert = builder.create();
alert.show();
TextView tvMessage = (TextView) alert.findViewById(android.R.id.message);
if (tvMessage != null) tvMessage.setTypeface(typeFaceSemiBold);
TextView tvTitle = (TextView) alert.findViewById(android.R.id.title);
if (tvTitle != null)
tvTitle.setTypeface(typeFaceBold);
Button positiveButton = alert.getButton(DialogInterface.BUTTON_POSITIVE);
positiveButton.setTextColor(ContextCompat.getColor(context, R.color.redSquareColor));
positiveButton.setTypeface(typeFaceBold);
Button negativeButton = alert.getButton(DialogInterface.BUTTON_NEGATIVE);
if (negativeButton != null) {
negativeButton.setTextColor(ContextCompat.getColor(context, R.color.redSquareColor));
negativeButton.setTypeface(typeFaceBold);
}
} catch (Exception e) {
CrashLogHelper.logException(e);
}
}
public static void showMultiSelectDialog(Context context, CharSequence[] dialogList,
final OnLanguagesSelectedListener listener) {
if (context == null) return;
final AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.DialogTheme);
int count = dialogList.length;
boolean[] isChecked = new boolean[count];
builder.setMultiChoiceItems(dialogList, isChecked,
new DialogInterface.OnMultiChoiceClickListener() {
public void onClick(DialogInterface dialog,
int whichButton, boolean isChecked) {
}
});
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ListView list = ((AlertDialog) dialog).getListView();
List<String> result = new ArrayList<>();
for (int i = 0; i < list.getCount(); i++) {
if (list.isItemChecked(i)) {
result.add((String) list.getItemAtPosition(i));
}
}
if (listener != null)
listener.onLanguagesSelected(result);
}
}
);
builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
}
);
AlertDialog alert = builder.create();
alert.show();
//return selectedLanguages.toString();
}
} | [
"sian@thesqaure.tech"
] | sian@thesqaure.tech |
d84111461f34e8fc242906349b8a16bb20cf1fb9 | 1ab39ec6dfc6c5d1aa7863ec159684e39668f9aa | /app/src/main/java/com/reidiens/login/personalinfo.java | 7a137801bc2fb027d2dd3b725ac76f34fb8bfaf0 | [] | no_license | dilipjay/griediens1 | 1fde38484a03c45611df6a75c5e5586e041b0ee4 | 9406791c7fc615eaee109efe32243be8d252c72e | refs/heads/master | 2021-01-10T12:02:46.225321 | 2015-10-10T18:50:26 | 2015-10-10T18:50:26 | 44,024,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,129 | java | package com.reidiens.login;
import android.content.Intent;
import android.graphics.Typeface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
public class personalinfo extends AppCompatActivity implements View.OnClickListener {
ArrayAdapter<CharSequence> adapter;
Spinner country;
EditText enName, enEmail, pass1, ph1, ph2, ph3, date, datedd, yer, myadd, zip; //namecc,ccnum, exdt,exdt2, seccd;
Button register1;
RadioButton male, female;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_personalinfo);
replacefnt.replaceDefaultFont(this, "DEFAULT", "Neutra.ttf"); //change of default font
enName = (EditText) findViewById(R.id.enName);
enEmail = (EditText) findViewById(R.id.enEmail);
pass1 = (EditText) findViewById(R.id.pass1);
datedd = (EditText) findViewById(R.id.datedd);
yer = (EditText) findViewById(R.id.yer);
ph1 = (EditText) findViewById(R.id.ph1);
ph2 = (EditText) findViewById(R.id.ph2);
ph3 = (EditText) findViewById(R.id.ph3);
date = (EditText) findViewById(R.id.date);
myadd = (EditText) findViewById(R.id.myadd);
zip = (EditText) findViewById(R.id.zip);
register1 = (Button) findViewById(R.id.register1);
male = (RadioButton) findViewById(R.id.male);
female = (RadioButton) findViewById(R.id.female);
register1.setOnClickListener(this);
//list of country spinner
country = (Spinner)
findViewById(R.id.cntry1);
adapter = ArrayAdapter.createFromResource(this, R.array.country_names, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
country.setAdapter(adapter);
country.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(getBaseContext(), parent.getItemIdAtPosition(position) + "selected", Toast.LENGTH_LONG).show();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
}
);//complete of country spinner code
//change font to Neutra Display Light
Typeface myFont = Typeface.createFromAsset(getAssets(), "Neutra.ttf");
enName.setTypeface(myFont);
enEmail.setTypeface(myFont);
TextView myPersonal = (TextView) findViewById(R.id.personalIn);
myPersonal.setTypeface(myFont);
TextView myName1 = (TextView) findViewById(R.id.name1);
myName1.setTypeface(myFont);
TextView myEmailT = (TextView) findViewById(R.id.emailTx);
myEmailT.setTypeface(myFont);
pass1.setTypeface(myFont);
TextView myPassTx = (TextView) findViewById(R.id.passTx);
myPassTx.setTypeface(myFont);
male.setTypeface(myFont);
female.setTypeface(myFont);
TextView myS = (TextView) findViewById(R.id.sex);
myS.setTypeface(myFont);
date.setTypeface(myFont);
datedd.setTypeface(myFont);
yer.setTypeface(myFont);
TextView myDob = (TextView) findViewById(R.id.dob);
myDob.setTypeface(myFont);
TextView myPh = (TextView) findViewById(R.id.ph);
myPh.setTypeface(myFont);
ph1.setTypeface(myFont);
ph2.setTypeface(myFont);
ph3.setTypeface(myFont);
myadd.setTypeface(myFont);
register1.setTypeface(myFont);
TextView myAdd1 = (TextView) findViewById(R.id.myadd1);
myAdd1.setTypeface(myFont);
zip.setTypeface(myFont);
TextView myZip1 = (TextView) findViewById(R.id.zip1);
myZip1.setTypeface(myFont);
TextView myCntry = (TextView) findViewById(R.id.cntry);
myCntry.setTypeface(myFont);
register1.setTypeface(myFont);
//code complete for change of font
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.register1:
String email = enEmail.getText().toString();
String password = pass1.getText().toString();
User registerData = new User(email, password);
startActivity(new Intent(this,Loginpg.class));
break;
}
}
} | [
"jdilip.kumar12@gmail.com"
] | jdilip.kumar12@gmail.com |
79de291ecf2fdcf702d20a84ed36bea9b008907e | 4b1f40eaee40a76b1d32284b2ab8cd0a8d2d7e2e | /Exercise1.java | 78a2144880248f6d7ee23986a92db885310ebc0a | [] | no_license | Chloe-Cannon/CCannonAI2 | 30cf0178c2ae0bfab7ca6c2fd94834be8128bdbc | c247802eafcc676758a79dff0bfdb37e576b158e | refs/heads/master | 2020-06-17T09:04:23.383230 | 2019-07-09T14:04:17 | 2019-07-09T14:04:17 | 195,873,477 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 172 | java | public class Exercise1 {
public static void main(String[] args){
System.out.print("Chloe");
System.out.print(" Cannon");
System.out.println(" 9th grade");
}
} | [
"chloecannon05@gmail.com"
] | chloecannon05@gmail.com |
215431c06ae3acd31cf73b25b523bdf05c77bac1 | 4a46674ecad95ae51cdbebb8a59daf10d097a3b1 | /src/main/java/Netty/runtime/ServerHandler.java | 6798d09507dd6d79bb1e5c2d06d32aafc24209bf | [] | no_license | pengrenjun/SockeIONettyStudy | a2b941c60ac6dd771e911b7ea15ede05aefb0264 | 45b376d36be491e44aa92805bd9c5f8f8579798a | refs/heads/master | 2021-06-26T06:57:23.548913 | 2019-10-03T13:24:24 | 2019-10-03T13:24:24 | 154,242,406 | 1 | 0 | null | 2020-10-13T16:02:27 | 2018-10-23T01:33:19 | Java | UTF-8 | Java | false | false | 1,004 | java | package Netty.runtime;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
public class ServerHandler extends ChannelHandlerAdapter{
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
}
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
Request request = (Request)msg;
System.out.println("Server : " + request.getId() + ", " + request.getName() + ", " + request.getRequestMessage());
Response response = new Response();
response.setId(request.getId());
response.setName("response" + request.getId());
response.setResponseMessage("响应内容" + request.getId());
ctx.writeAndFlush(response);//.addListener(ChannelFutureListener.CLOSE);
}
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
ctx.close();
}
}
| [
"809507790@qq.com"
] | 809507790@qq.com |
29d1976b4625900af66085f8a94a7de8866c030f | 39654341c4a9528ea9939ecd7825ceb1dab12dc0 | /guest-services/src/main/java/com/ihnat/mikhalkovich/guestservices/GuestServicesApplication.java | e59ec65ff3c6ab0f29d100a94657e572850a790e | [] | no_license | ihnat-mikhalkovich/spring-cloud-sample | 0dfeaf72847c34fc19ae9148b87078d21fbdaa17 | fe756f647db07c84941f24166062ef554e9ac15b | refs/heads/main | 2023-03-26T16:41:45.096674 | 2021-03-19T01:00:46 | 2021-03-19T01:00:46 | 349,258,922 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 439 | java | package com.ihnat.mikhalkovich.guestservices;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
public class GuestServicesApplication {
public static void main(String[] args) {
SpringApplication.run(GuestServicesApplication.class, args);
}
}
| [
"ihnat.mikhalkovich@gmail.com"
] | ihnat.mikhalkovich@gmail.com |
322517ea65022af74cdb3eecbc97f2eed61addeb | 7ebed4b6dfc2f51e95833af55aa5b9d63c2fde17 | /Sources/pushwoosh/src/main/java/com/pushwoosh/thirdpart/com/ironz/binaryprefs/event/EventBridge.java | 4a7559f031dbda700745e5719cd4fbc7a3fc89a2 | [
"LicenseRef-scancode-other-permissive"
] | permissive | Pushwoosh/pushwoosh-android-sdk | 30cac70a5482fb00bbcb25e061085849f3a6d8f3 | ccf2c1b19a0ff0108309d617918e69350e1e0b64 | refs/heads/master | 2023-08-31T04:47:37.768195 | 2023-08-28T11:15:23 | 2023-08-28T11:15:23 | 15,434,764 | 62 | 57 | NOASSERTION | 2019-01-29T08:42:53 | 2013-12-25T12:22:47 | null | UTF-8 | Java | false | false | 2,506 | java | /*
*
* Copyright (c) 2017. Pushwoosh Inc. (http://www.pushwoosh.com)
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* (i) the original and/or modified Software should be used exclusively to work with Pushwoosh services,
*
* (ii) the above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.pushwoosh.thirdpart.com.ironz.binaryprefs.event;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
/**
* Describes contract for preferences change events
*/
public interface EventBridge {
/**
* Behaves exactly like in
* {@link android.content.SharedPreferences#registerOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener)}
* method.
*
* @param listener listener
*/
void registerOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener);
/**
* Behaves exactly like in
* {@link android.content.SharedPreferences#unregisterOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener)}}
* method.
*
* @param listener listener
*/
void unregisterOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener);
/**
* Notifies all listeners which has been subscribed on preferences changes about preference update
*
* @param key target key
* @param bytes target bytes
*/
void notifyListenersUpdate(String key, byte[] bytes);
/**
* Notifies all listeners which has been subscribed on preferences changes about preference remove
*
* @param key target key
*/
void notifyListenersRemove(String key);
} | [
"vromanychev@pushwoosh.com"
] | vromanychev@pushwoosh.com |
38ab35ad45644a653ce2acf1a38be560fcf986ef | c9c842479e6e4ddf3a079f339652961e8b6b957e | /trux/src/main/java/com/trux/dao/ZonesDAOImpl.java | 64a938909558de8b9b376ecea850a46453324ee4 | [] | no_license | hussainshahzad250/Transpotr | 1a509d897c5e4ae11416d3e3bf58d308a88a1756 | c9c5ce273c2bcac75a16a322d8a98e0ff31d0d40 | refs/heads/master | 2021-01-12T06:37:45.634127 | 2016-12-26T18:12:10 | 2016-12-26T18:12:10 | 77,399,509 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,017 | java | package com.trux.dao;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Property;
import com.trux.model.Zones;
public class ZonesDAOImpl implements ZonesDAO {
private SessionFactory sessionFactory;
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
@SuppressWarnings("unchecked")
public Zones saveZone(Zones dto) {
Session session = this.sessionFactory.openSession();
try{Transaction tx = session.beginTransaction();
session.save(dto);
tx.commit();
DetachedCriteria maxID = DetachedCriteria.forClass(Zones.class)
.setProjection(Projections.max("zoneId"));
List<Zones> zoneList = session.createCriteria(Zones.class)
.add(Property.forName("zoneId").eq(maxID)).list();
session.close();
if (zoneList != null && zoneList.size() > 0) {
return zoneList.get(0);
}
}catch(Exception er){
er.printStackTrace();
session.close();
}
return null;
}
@SuppressWarnings("unchecked")
public List<Zones> getZones(Integer zonedId) {
Session session = this.sessionFactory.openSession();
try{
List<Zones> zoneList = session.createQuery("From Zones where zoneId="+zonedId).list();
session.close();
if(zoneList!=null && zoneList.size()>0){
return zoneList;
}
}catch(Exception er){
er.printStackTrace();
session.close();
}
return null;
}
@SuppressWarnings("unchecked")
public List<Zones> getAllZones() {
Session session = this.sessionFactory.openSession();
try{
List<Zones> zoneList = session.createQuery("From Zones").list();
session.close();
if(zoneList!=null && zoneList.size()>0){
return zoneList;
}
}catch(Exception er){
er.printStackTrace();
session.close();
}
return null;
}
}
| [
"Shahzad@192.168.0.6"
] | Shahzad@192.168.0.6 |
827505c1845f431a0402359b13d4aaa0bdcc9282 | 9890f81db5b1a004a2feab10db1b6cde07bc948a | /src/main/java/com/great/springboot/aoplog/LogAspect.java | ac2692d8afbab535a236976f166dc8d079c43a31 | [] | no_license | WeJieLi/Demo6 | 1bcd8498291f434199d2326c5439528a04bb515b | 8d1691310ef13fc93e3c142f68fa7a89317de00b | refs/heads/master | 2022-06-12T20:23:15.098798 | 2019-12-14T02:08:15 | 2019-12-14T02:08:15 | 227,951,739 | 0 | 0 | null | 2022-05-20T21:19:08 | 2019-12-14T01:56:40 | JavaScript | UTF-8 | Java | false | false | 3,050 | java | package com.great.springboot.aoplog;
import com.great.springboot.entity.LogInf;
import com.great.springboot.service.UserService;
import com.great.springboot.util.GetNowTime;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
@Aspect
@Component
public class LogAspect
{ private HttpServletRequest request;
@Autowired
private LogInf logInf ;
@Autowired
private UserService userService ;
//Controller层切点
@Pointcut("within(com.great.springboot.service.UserService)")
public void controllerAspect()
{
}
@After("controllerAspect()")
public void after(JoinPoint joinPoint) throws Throwable
{
System.out.println("进入了after方法");
String targetName = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
//获取传入目标方法的参数值
Object[] arguments = joinPoint.getArgs();
Class<?> targetClass = Class.forName(targetName);
Method[] methods = targetClass.getMethods();
String operationType = "";
String operationName = "";
boolean flag = false;
for (Method method : methods)
{
if (method.getName().equals(methodName))
{
Class<?>[] clazzs = method.getParameterTypes();
if (clazzs.length == arguments.length)
{
if (clazzs.length == 0)
{
flag = true;
} else
{
for (int i = 0; i < clazzs.length; i++)
{
System.out.println(clazzs[i]);
if (clazzs[i] == arguments[i].getClass())
{
flag = true;
break;
}
}
}
}
}
if (flag)
{
operationType = method.getAnnotation(Log.class).operationType();
operationName = method.getAnnotation(Log.class).operationName();
break;
}
}
//*========控制台输出=========*//
System.out.println("=====后置通知开始=====");
System.out.println("请求方法:" + (joinPoint.getTarget().getClass().getName() + "." + joinPoint.getSignature().getName() + "()"));
System.out.println("方法类型:" + operationType);
System.out.println("方法描述:" + operationName);
ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(sra, true);
request = sra.getRequest();
Object admin=request.getSession().getAttribute("admin");
if(operationType.equals("1")&&null!=admin){
logInf.setDate(GetNowTime.getDate());
logInf.setTime(GetNowTime.getTime());
logInf.setAffair(operationName);
logInf.setOperate(admin.toString());
userService.addLog(logInf);
System.out.println("日志记录:"+logInf.toString());
}
}
}
| [
"1312137229@qq.com"
] | 1312137229@qq.com |
93a50a04fdcea8cf4ad60dc58c1988f74e284296 | 4dcede1d5b1230079fce24899ef32b398a765e08 | /src/main/java/com/my_thread/ExchangeTest.java | 78c1883e76aa677a32d8b3a2f204a5896e93e0b2 | [] | no_license | xianlongbai/basic_java | fefd995da04d3665abfe80f01504eef991d3c26f | 6ba2efb9b1ddc041c00a5a11557e029499b78f3f | refs/heads/master | 2022-12-11T00:20:05.146411 | 2020-06-02T06:03:41 | 2020-06-02T06:03:41 | 181,322,937 | 0 | 0 | null | 2022-12-06T00:45:20 | 2019-04-14T14:41:17 | Java | UTF-8 | Java | false | false | 1,812 | java | package com.my_thread;
import java.util.concurrent.Exchanger;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ExchangeTest {
public static void main(String[] args) {
final ExecutorService service = Executors.newCachedThreadPool();
final Exchanger<String> changer = new Exchanger<String>();
service.submit(new Runnable(){
public void run(){
try{
String data1 = "北京老冰棍";
System.out.println("线程 "+Thread.currentThread().getName()+" 正在把 "+data1+" 拿出来");
String data2 = changer.exchange(data1);
System.out.println("线程 "+Thread.currentThread().getName()+"用 "+data1+" 换来了"+data2);
}catch(Exception e){
e.printStackTrace();
}finally{
service.shutdown();
System.out.println(Thread.currentThread().getName()+"交易完毕,撤!");
}
}
});
service.submit(new Runnable(){
public void run(){
try{
String data1 = "100元";
System.out.println("线程 "+Thread.currentThread().getName()+" 正在把钱 "+data1+" 拿出来");
String data2 = changer.exchange(data1);
System.out.println("线程 "+Thread.currentThread().getName()+"用 "+data1+"换来了"+data2);
}catch(Exception e){
e.printStackTrace();
}finally{
service.shutdown();
System.out.println(Thread.currentThread().getName()+"交易完毕,撤!");
}
}
});
}
}
| [
"xianlong.bai@tendcloud.com"
] | xianlong.bai@tendcloud.com |
cbb05fd11964b01c2ffdec64c5dcb1f473a38b68 | 3afde6b5c4693fdb6a271ef5fd4924d17e1ed84e | /src/main/java/com/udacity/course3/reviews/controller/CommentsController.java | be171786980c3349dc5a7dc0234c6de91d39ca5f | [] | no_license | kalyanitiwari-java-lab/nd035-project04-CustomerReviewsFinal | 04b3d1087631f1abaa33ff421ffacbb95c68a970 | c814e206ac1996d3253d595701ac3851d64e16f6 | refs/heads/master | 2022-04-10T17:08:53.797565 | 2020-03-28T18:25:57 | 2020-03-28T18:25:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,503 | java | package com.udacity.course3.reviews.controller;
import com.udacity.course3.reviews.entity.Comment;
import com.udacity.course3.reviews.entity.CommentDoc;
import com.udacity.course3.reviews.entity.Review;
import com.udacity.course3.reviews.entity.ReviewDoc;
import com.udacity.course3.reviews.repository.jpa.CommentRepository;
import com.udacity.course3.reviews.repository.jpa.ReviewRepository;
import com.udacity.course3.reviews.repository.mongodb.ReviewDocRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Optional;
/**
* Spring REST controller for working with comment entity.
*/
@RestController
@RequestMapping("/comments")
public class CommentsController {
// TODO: Wire needed JPA repositories here
@Autowired
private ReviewRepository reviewRepository;
@Autowired
private CommentRepository commentRepository;
@Autowired
private ReviewDocRepository reviewDocRepository;
public CommentsController(ReviewRepository reviewRepository, CommentRepository commentRepository, ReviewDocRepository reviewDocRepository) {
this.reviewRepository = reviewRepository;
this.commentRepository = commentRepository;
this.reviewDocRepository = reviewDocRepository;
}
/**
* Creates a comment for a review.
*
* 1. Add argument for comment entity. Use {@link RequestBody} annotation.
* 2. Check for existence of review.
* 3. If review not found, return NOT_FOUND.
* 4. If found, save comment.
*
* @param reviewId The id of the review.
*/
@RequestMapping(value = "/reviews/{reviewId}", method = RequestMethod.POST)
public ResponseEntity<Comment> createCommentForReview(@PathVariable("reviewId") Integer reviewId, @RequestBody Comment comment) {
Optional<Review> optionalReview = reviewRepository.findById(reviewId);
if(optionalReview.isPresent()){
Review review = optionalReview.get();
comment.setReview(review);
//Persist in MongoDB as well
ReviewDoc matchingReviewDoc = reviewDocRepository.findById(review.getReviewDocId()).get();
List<CommentDoc> commentDocs = matchingReviewDoc.getComments();
CommentDoc commentDoc = new CommentDoc();
commentDoc.setTitle(comment.getTitle());
commentDoc.setCommentText(comment.getCommentText());
commentDocs.add(commentDoc);
reviewDocRepository.save(matchingReviewDoc);
return ResponseEntity.ok(commentRepository.save(comment));
}else{
return ResponseEntity.notFound().build();
}
}
/**
* List comments for a review.
*
* 2. Check for existence of review.
* 3. If review not found, return NOT_FOUND.
* 4. If found, return list of comments.
*
* @param reviewId The id of the review.
*/
@RequestMapping(value = "/reviews/{reviewId}", method = RequestMethod.GET)
public ResponseEntity<List<Comment>> listCommentsForReview(@PathVariable("reviewId") Integer reviewId) {
Optional<Review> optionalReview = reviewRepository.findById(reviewId);
if(optionalReview.isPresent()){
return ResponseEntity.ok(commentRepository.findAllByReview(new Review(reviewId)));
}else{
return ResponseEntity.notFound().build();
}
}
} | [
"kalyani7t@gmail.com"
] | kalyani7t@gmail.com |
2b8642d92bb6054d8e970207493c5b70834ca4d6 | 30d08b7a9cbdd336a8d9f802f5ac50eb9700dee5 | /src/main/java/minecraftbyexample/mbe40_hud_overlay/StartupCommon.java | 50a9b3498ebca208799e7b7f81fed0d52e6463a7 | [] | no_license | alvaropp/MinecraftByExample | e0da453ff2a21d049547b40c3f0ebefd5f11dac8 | c265da620571d0b53f50d9fdd7159e95d174b96d | refs/heads/master | 2021-01-22T13:30:38.075187 | 2016-08-22T14:37:17 | 2016-08-22T14:37:17 | 67,339,071 | 0 | 0 | null | 2016-09-04T10:39:50 | 2016-09-04T10:39:50 | null | UTF-8 | Java | false | false | 1,075 | java | //package minecraftbyexample.mbe40_hud_overlay;
//
//import net.minecraftforge.fml.common.registry.GameRegistry;
//
// /**
// * @author Nephroid
// *
// * User: Nephroid
// * Date: December 26, 2014
// * The Startup classes for this example are called during startup, in the following order:
// * preInitCommon
// * preInitClientOnly
// * initCommon
// * initClientOnly
// * postInitCommon
// * postInitClientOnly
// * See MinecraftByExample class for more information
// */
//public class StartupCommon
//{
// public static ItemHUDactivator itemHUDactivator; // this holds the unique instance of your item
//
// public static void preInitCommon()
// {
// // each instance of your item should have a name that is unique within your mod. use lower case.
// itemHUDactivator = (ItemHUDactivator)(new ItemHUDactivator().setUnlocalizedName("mbe40_hud_overlay_item"));
// GameRegistry.registerItem(itemHUDactivator, "mbe40_hud_overlay_item");
// }
//
// public static void initCommon()
// {
// }
//
// public static void postInitCommon()
// {
// }
//}
| [
"spamblackhole88@yahoo.com.au"
] | spamblackhole88@yahoo.com.au |
62058d774fee43f396abb23c328b211c0ad3ba8f | 72e666c2073893cbfa244d6ea154382a77824a97 | /src/main/java/com/arie/test/inventory/model/BaseVersionEntity.java | ca4a8975c3d8142743b36f5b993a892c32499e41 | [] | no_license | morearie/inventory | 9ff09ea95ec452b3a747ae5814df14270282854f | 9737b4fed3f56980218dcb7656253c06fbf1e292 | refs/heads/main | 2023-08-21T19:35:48.296981 | 2021-10-10T14:30:52 | 2021-10-10T14:30:52 | 415,224,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,387 | java | package com.arie.test.inventory.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@MappedSuperclass
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@EntityListeners(AuditingEntityListener.class)
public class BaseVersionEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1234614398953255553L;
@Version
private Integer version;
@CreatedBy
@JsonIgnore
@Column(updatable = false)
private String createdBy;
/** The created date. */
@CreatedDate
@JsonIgnore
@Column(updatable = false)
private Date createdDate = new Date();
@LastModifiedBy
@JsonIgnore
private String lastModifiedBy;
/** The modified date. */
@LastModifiedDate
@JsonIgnore
private Date lastModifiedDate = new Date();
}
| [
"arie.pamungkas@verint.com"
] | arie.pamungkas@verint.com |
cecf480da595a3ec0f7ae3d956f1228bb4becbc7 | ed6191681cb29117f3240b763d31f5e3e559c3cc | /oo/abstrato/TesteAbstrato.java | 8cb7a9056f3af31996d509717ab9319621fefca4 | [
"MIT"
] | permissive | heltonricardo/estudo-java | 756c85c0869ff4f195dbf24b4039a662e4faeca2 | edaa8f968a75c4336e2646eb36c08ceda622cc36 | refs/heads/master | 2022-12-27T21:05:03.528948 | 2020-10-14T14:58:32 | 2020-10-14T14:58:32 | 284,755,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 560 | java | package oo.abstrato;
public class TesteAbstrato {
public static void main(String[] args) {
Animal a = new Cachorro();
System.out.println(a.respirar());
System.out.println(a.mover());
System.out.println();
Mamifero b = new Cachorro();
System.out.println(b.respirar());
System.out.println(b.mover());
System.out.println(b.mamar());
System.out.println();
Cachorro c = new Cachorro();
System.out.println(c.respirar());
System.out.println(c.mover());
System.out.println(c.mamar());
System.out.println(c.pegarBolinha());
}
}
| [
"50843386+heltonr13@users.noreply.github.com"
] | 50843386+heltonr13@users.noreply.github.com |
fb0c09d0ba9de59382956a7ad0d3d46d41ba36b3 | c5b694e3873cd095208c0f796dff537ba1d82b98 | /i_gede_susila_astawa/app/src/androidTest/java/example/com/oticket/ExampleInstrumentedTest.java | 29faa9acdff2cbee9e2c7a598aa7650d2f29f7d6 | [] | no_license | omrobbie/Final-Project-IAK-Periode-3-Batch-3 | 7d077e2272d654f30c2be2656e0151c004b28cb1 | 7f345ac651ba8d554b900f9eb63eeb3e0da0cf89 | refs/heads/master | 2021-08-28T04:45:19.653919 | 2017-12-11T07:34:13 | 2017-12-11T07:35:21 | 112,972,393 | 0 | 10 | null | 2017-12-10T16:37:11 | 2017-12-03T23:21:39 | Java | UTF-8 | Java | false | false | 739 | java | package example.com.oticket;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("example.com.oticket", appContext.getPackageName());
}
}
| [
"govins.com@gmail.com"
] | govins.com@gmail.com |
b0cbc5c2eadf67dbf1164838aadd8d35fb2c5d88 | 46d7a0d4b2e1bc62f3e6032da88ce9573db386fc | /br/unipe/java/unidade1/Aulas/Aula10/src/gravarObjeto/UsaContato.java | 7e7a00919113395281af213c1692fc5e907c0a41 | [] | no_license | danielnathan1/JavaP3 | 6474994de2a7561adb573d36e1e037041f0c9c3a | b8ced849977cb453ab6d3269345bf31f7d9dd3a7 | refs/heads/master | 2021-01-19T10:48:15.927823 | 2017-06-05T04:18:12 | 2017-06-05T04:18:12 | 82,205,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,006 | java | package gravarObjeto;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.ObjectOutputStream;
import java.util.Scanner;
public class UsaContato {
public static void main(String[] args) {
GravarObjeto gravar = new GravarObjeto();
LerObjeto ler = new LerObjeto();
Scanner leitor= new Scanner(System.in);
System.out.println("Digite o ID: ");
String id= leitor.nextLine();
System.out.println("Digite o Nome: ");
String nome = leitor.nextLine();
try{
FileOutputStream fos = new FileOutputStream("arquivo.txt");
byte[] contentINBytes = id.getBytes();
fos.write(contentINBytes);
byte[] contetINBytes2 = nome.getBytes();
fos.write(contetINBytes2);
fos.close();
FileReader fr = new FileReader("arquivo.txt");
BufferedReader br = new BufferedReader(fr);
String s = br.readLine();
br.close();
System.out.println(s);
}catch (Exception e) {
System.out.println("erro");
}
}
}
| [
"danielzipzip@hotmail.com"
] | danielzipzip@hotmail.com |
adb6c2f3427b4480dc72c4e20ba991313fb504b7 | f21a15b89c1ff9eb9cfac4a6d0cb8b5792509cf1 | /src/pattern/creational/factorymethod2/SchedulingStrategyID.java | 5b84a12779dfd1cd373e7118d731f44bee1572d8 | [] | no_license | kinamJung/patternall | 0049a07619987fb904616d682dac3075d4a57b77 | e926616079e6ba404a158ab306a99c693fc2ac16 | refs/heads/master | 2021-01-16T20:31:54.279574 | 2016-01-25T00:30:17 | 2016-01-25T00:30:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 122 | java | package pattern.creational.factorymethod2;
public enum SchedulingStrategyID {
RESPONSE_TIME, THROUGHTUP, DYNAMIC
}
| [
"manderg@naver.com"
] | manderg@naver.com |
93dc9fd1bfb3fe96b216a94a8b613aa6c5494a38 | b14482c320fdcc140dd3a8d6884fbe5d71ba0838 | /src/threadTest/playDice/Dice.java | e89f8c927fd4ada0b6184bf5965e17d9a0d5088a | [] | no_license | qpzmal/Temp | 24769abb5b77e8f4ca98ac8dc55d94faa04037c9 | 19ccca56fe10166137c6f3748103bbd37626dae4 | refs/heads/master | 2020-05-19T16:25:12.761154 | 2015-01-09T05:38:05 | 2015-01-09T05:38:05 | 18,844,664 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,158 | java | package threadTest.playDice;
import java.util.Random;
/**
* 骰子类
* @author weiqz
*
*/
public class Dice {
protected int number = 0;
protected int count = 0;
public synchronized void setNumber() throws Exception {
if (count == 3) {
Thread.currentThread().interrupt();
return;
}
Random r = new Random();
this.number = r.nextInt(6) + 1;
// System.out.println("线程 "+Thread.currentThread().getName()+" 骰子数:"+this.number);
this.notify();
try {
this.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public synchronized void getNumber() {
System.out.println("线程 "+Thread.currentThread().getName()+" 骰子数:"+this.number +",六的次数:" + count);
if (this.number == 6) {
count++;
if (count == 3) {
Thread.currentThread().interrupt();
this.notify();
return;
}
} else {
count = 0;
}
this.notify();
try {
this.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
// public static void main(String[] args) {
// Dice dice = new Dice();
// dice.setNumber();
// System.out.println(dice.getNumber());
// }
}
| [
"qpzmal@gmail.com"
] | qpzmal@gmail.com |
5b6b0528355b084b92e4d5fbe6cc117a586d64e6 | 803d8093313a4a10065429527271854144896141 | /library-base/src/main/java/com/goldze/base/utils/DateUtil.java | e99c35f8b97890292faa5f7f20fd746b6cf0ca98 | [
"Apache-2.0"
] | permissive | tlchun/FutureHome | 2a574ed927859320c6addaa77c16bb3b28a7cd2b | f50818bbec09ec3fbb5748cd599cd799fd48e2a8 | refs/heads/master | 2023-04-24T04:42:57.236198 | 2021-05-10T02:11:11 | 2021-05-10T02:11:11 | 335,849,823 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,221 | java | package com.goldze.base.utils;
import android.text.format.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class DateUtil {
/**
* 时间戳转换成日期格式字符串
*
* @param seconds 精确到豪秒的字符串
* @return
*/
public static String timeStamp2Date(long seconds) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(new Date(Long.valueOf(seconds)));
}
/**
* 日期格式字符串转换成时间戳
*
* @param format 如:yyyy-MM-dd HH:mm:ss
* @return
*/
public static String date2TimeStamp(String date_str, String format) {
try {
SimpleDateFormat sdf = new SimpleDateFormat(format);
return String.valueOf(sdf.parse(date_str).getTime() / 1000);
} catch (Exception e) {
e.printStackTrace();
}
return "";
}
/**
* 取得当前时间戳(精确到秒)
*
* @return
*/
public static String timeStamp() {
long time = System.currentTimeMillis();
String t = String.valueOf(time / 1000);
return t;
}
} | [
"xi.he@clife.cn"
] | xi.he@clife.cn |
c4ee6cfda836638bbdc617f34b8371f4e3a5e7cf | 951a8a1f3a744e80be33a4421370762cbe30e381 | /ArrayListview/app/src/main/java/com/example/studentadmin/arraylistview/MainActivity.java | a962228ead13ca23753f441fc3138ecd3a51ace0 | [] | no_license | krutiikothari/Android | dcff5a05cbbc492f57b72db710650dab588c4c61 | 2d53aa44a140ed70b5d0341027267a28b00cd5a3 | refs/heads/master | 2020-03-25T17:54:19.062359 | 2018-08-08T11:45:19 | 2018-08-08T11:45:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,293 | java | package com.example.studentadmin.arraylistview;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {
ListView l;
String[] days = {"SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
l = (ListView) findViewById(R.id.lv);
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, days);
l.setAdapter(adapter);
l.setOnItemClickListener(this);
}
@Override
public void onItemClick(AdapterView<?> adapterview, View view, int i, long l) {
TextView temp = (TextView) view;
Toast.makeText(this, temp.getText() + "" + i, Toast.LENGTH_SHORT).show();
}
@Override
public void onPointerCaptureChanged(boolean hasCapture) {
}
}
| [
"studentadmin@ibmserver.local"
] | studentadmin@ibmserver.local |
43b21c78266a1dcd2b4f1a5e9761bef38d7671f8 | 6ff8893659c5c160f334a99eba75dc2bad983af3 | /src/main/java/com/darlisonalves/cursomc/services/exceptions/DataIntegrityException.java | 1e0419e68570c4c1a6448541459477f27623b94f | [] | no_license | darlison-alves/api-pedidos-pagamento | 9b71c35bc5ada41eb32e2111ac00c58a02e677c1 | 627a93fd855bb70243b99e2fbb873ca2e690e1f3 | refs/heads/master | 2022-09-07T20:14:56.225874 | 2020-06-02T09:44:43 | 2020-06-02T09:44:43 | 255,718,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 347 | java | package com.darlisonalves.cursomc.services.exceptions;
public class DataIntegrityException extends RuntimeException {
private static final long serialVersionUID = 1L;
public DataIntegrityException(String msg) {
super(msg);
}
public DataIntegrityException(String msg, Throwable cause){
super(msg, cause);
}
}
| [
"darlinsonalves@gmail.com"
] | darlinsonalves@gmail.com |
9ff0eb412097f130dd0d7f6cd61f5bf41992b6de | e983bb2f433521dff631e200f82a9787bbefc2dc | /ARCHIVED/CSCE4650/Assignment7/assign7/7/SymbolTable.java | 7e57eec92c120d72b9f26262259e0d0f6d5c73ff | [] | no_license | axelyates/unt_csce | 051a5242d11d42e249f6f2e67939b72b7cc52453 | 67b09ae7f3b39d33c5c7c6dadce14748c9a6316d | refs/heads/master | 2020-03-19T21:32:44.295888 | 2018-06-11T15:04:54 | 2018-06-11T15:04:54 | 136,942,264 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,120 | java | /*
Name: Axel Yates
Assignment: Assignment 5
*/
import java.util.*;
enum Category {CLASS, FUNCTION, VARIABLE}
class Type { }
class IntegerType extends Type {
public String toString () {
return "int";
}
}
class BooleanType extends Type {
public String toString () {
return "boolean";
}
}
class VoidType extends Type {
public String toString () {
return "void";
}
}
class ArrayType extends Type {
private int dimension;
private Type baseType;
public ArrayType (int dim, Type base) {
dimension = dim;
baseType = base;
}
public int dimension () { return dimension; }
public String toString () {
return "array (" + dimension + ", " + baseType + ")";
}
}
class ObjectType extends Type {
private String className;
private SymbolTableEntry objectType;
public ObjectType (String className, SymbolTableEntry objectType) {
this . className = className;
this . objectType = objectType;
}
public String className () { return className; }
public SymbolTableEntry objectType () { return objectType; }
public String toString () {
return className;
}
}
class Declarator {
private String id;
private Type type;
public Declarator (String id, Type type) {
this . id = id;
this . type = type;
}
public String id () { return id; }
public Type type () { return type; }
}
class ArrayDeclarator extends Declarator {
private int subscriptNumber;
public ArrayDeclarator (String id, Type type, int subscriptNumber) {
super (id, type);
this . subscriptNumber = subscriptNumber;
}
public int subscriptNumber () { return subscriptNumber; }
}
class SymbolTableEntry {
private Category category;
private LinkedList<Type> argTypes;
private SymbolTable localEnv;
private String funcCode;
private boolean staticFlag;
private Type type;
public SymbolTableEntry (Category category) {
this . category = category;
}
public SymbolTableEntry (Category category, Type type) {
this . category = category;
this . type = type;
}
public SymbolTableEntry (Category category, Type type, boolean staticFlag) {
this . category = category;
this . type = type;
this . staticFlag = staticFlag;
}
public SymbolTableEntry (Category category, SymbolTable env) {
this . category = category;
this . localEnv = env;
}
public SymbolTableEntry (Category category, Type type, boolean staticFlag, LinkedList<Type> argTypes, SymbolTable env) {
this . category = category;
this . type = type;
this . staticFlag = staticFlag;
this . argTypes = argTypes;
this . localEnv = env;
}
public Category category () { return category; }
public boolean staticFlag () { return staticFlag; }
public Type type () { return type; }
public SymbolTable localEnv () { return localEnv; }
public String funcCode () { return funcCode; }
public void setCode (String code) { funcCode = code; }
public String toString () {
String printString = category . name ();
if (category == Category . VARIABLE || category == Category . FUNCTION) {
if (staticFlag){
printString = printString + " yes ";
}
else{
printString = printString + " no ";
}
if (category == Category . VARIABLE){
printString = printString + " " + type;
}
else{
printString = printString + " " + argTypes + "->" + type;
}
}
return printString;
}
}
public class SymbolTable {
private static int maxlen = 2;
public static int maxLen () { return maxlen; }
private SymbolTable parent;
private TreeMap <String, SymbolTableEntry> table;
public SymbolTable (SymbolTable staticParent) {
parent = staticParent;
table = new TreeMap <String, SymbolTableEntry> ();
}
public SymbolTable parent () { return parent; }
public SymbolTableEntry entry (String id) {
SymbolTableEntry idEntry = table . get (id);
if (idEntry == null){
if (parent == null){
ErrorMessage . print ("Undeclared identifier: " + id);
}
}
else{
idEntry = parent . entry (id);
}
return idEntry;
}
public void enter (String id, SymbolTableEntry entry) {
SymbolTableEntry idEntry = table . get (id);
if (idEntry != null)
ErrorMessage . print ("Identifier " + id + " already declared.");
table . put (id, entry);
if (id . length () > maxlen){
maxlen = id . length ();
}
}
public void enterVar (String id, Type type) {
enter (id, new SymbolTableEntry (Category . VARIABLE, type));
}
public void enterClass (String id, SymbolTable env) {
enter (id, new SymbolTableEntry (Category . CLASS, env));
}
public void enterFunc (String id, Type type, boolean staticFlag,
LinkedList<Type> argTypes, SymbolTable env) {
enter (id, new SymbolTableEntry (Category . FUNCTION, type, staticFlag,
argTypes, env));
}
public void enterVar (String id, Type type, boolean staticFlag) {
enter (id, new SymbolTableEntry (Category . VARIABLE, type, staticFlag));
}
public void enterFuncCode (String id, String code) {
SymbolTableEntry idEntry = table . get (id);
idEntry . setCode (code);
}
public void print (String blockName) {
System . out . println ();
System . out . println ("ID Table for " + blockName);
System . out . print ("----------------");
for (int i = 0; i < blockName . length (); i++)
System . out . print ("-");
System . out . println ();
System . out . println ();
System . out . print ("ID");
for (int i = 2; i < maxLen (); i++)
System . out . print (" ");
System . out . println (" Category Static Type");
System . out . print ("--");
for (int i = 2; i < maxLen (); i++)
System . out . print (" ");
System . out . println (" -------- ------ ----");
Iterator <Map . Entry <String, SymbolTableEntry>> envIterator =
table . entrySet () . iterator ();
TreeMap <String, SymbolTableEntry> classAndFunctionList =
new TreeMap <String, SymbolTableEntry> ();
while (envIterator . hasNext ()) {
Map . Entry <String, SymbolTableEntry> entry = envIterator . next ();
String id = entry . getKey ();
SymbolTableEntry idEntry = entry . getValue ();
System . out . print (id);
for (int i = id . length (); i < maxLen (); i++)
System . out . print (" ");
System . out . print (" ");
System . out . println (idEntry);
if (idEntry . category () == Category . CLASS || idEntry . category () == Category . FUNCTION){
classAndFunctionList . put (id, idEntry);
}
}
Iterator <Map . Entry <String, SymbolTableEntry>> classAndFunctionIterator =
classAndFunctionList . entrySet () . iterator ();
while (classAndFunctionIterator . hasNext ()) {
Map . Entry <String, SymbolTableEntry> entry = classAndFunctionIterator . next ();
String classOrFunctionName = entry . getKey ();
SymbolTableEntry idEntry = entry . getValue ();
idEntry . localEnv () . print (classOrFunctionName);
}
}
}
| [
"axelyates@gmail.com"
] | axelyates@gmail.com |
05d2238b84c4483520b04466a1e789b3a1129d06 | f5e7dde3ced0e7af1c9fcec1e2a74384c862cb56 | /app/src/main/java/dev/nick/music/MainActivity.java | 54fb697e7e15a98a61736c6fd4dc2db83289aa6f | [] | no_license | yinheng/Music | 6ab8ca5e4d16dcd106681c2a4db5c77e5198d95e | dcf798600e2bee2462d3fd583d5d89737755cc1f | refs/heads/master | 2021-01-01T17:45:25.121365 | 2017-07-24T04:13:19 | 2017-07-24T04:13:48 | 98,148,254 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,611 | java | package dev.nick.music;
import android.graphics.Color;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import dev.nick.music.loader.Music;
import dev.nick.music.loader.MusicLoader;
public class MainActivity extends AppCompatActivity {
List<Music> musicList;
MediaPlayer mediaPlayer = new MediaPlayer();
ListView listView;
ImageButton prevBtn, playBtn, nextBtn;
BaseAdapter adapter;
int index = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listView = (ListView) findViewById(R.id.list);
SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
loadAndDisplay();
}
});
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Toast.makeText(getApplicationContext(), "item:" + (i + 1), Toast.LENGTH_SHORT).show();
play(i);
}
});
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mediaPlayer) {
playNext();
}
});
playBtn = (ImageButton) findViewById(R.id.imageButton2);
nextBtn = (ImageButton) findViewById(R.id.imageButton3);
prevBtn = (ImageButton) findViewById(R.id.imageButton);
playBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mediaPlayer.isPlaying()) {
mediaPlayer.pause();
playBtn.setImageResource(R.drawable.ic_play_arrow_black_24dp);
} else {
mediaPlayer.start();
playBtn.setImageResource(R.drawable.ic_pause_black_24dp);
}
}
});
prevBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (index == 0) {
index = musicList.size() - 1;
} else {
index = index - 1;
}
play(index);
}
});
nextBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
playNext();
}
});
loadAndDisplay();
}
private void playNext() {
if (index == musicList.size() - 1) {
index = 0;
} else {
index += 1;
}
play(index);
}
private void play(int i) {
index = i;
String path = musicList.get(i).getMusicPath();
try {
if (mediaPlayer.isPlaying()) {
mediaPlayer.stop();
}
mediaPlayer.reset();
mediaPlayer.setDataSource(path);
mediaPlayer.prepare();
mediaPlayer.start();
playBtn.setImageResource(R.drawable.ic_pause_black_24dp);
adapter.notifyDataSetChanged();
} catch (IOException e) {
e.printStackTrace();
}
}
private void loadAndDisplay() {
new Thread(new Runnable() {
@Override
public void run() {
MusicLoader musicLoader = new MusicLoader();
musicList = musicLoader.loadMusic(Environment.getExternalStorageDirectory().getPath());
Log.i("yinheng", "item:" + musicList.size());
Iterator<Music> iterator = musicList.iterator();
while (iterator.hasNext()) {
Music m = iterator.next();
Log.i("yinheng", m.toString());
}
runOnUiThread(new Runnable() {
@Override
public void run() {
onLoadComplete();
}
});
}
}).start();
}
private void onLoadComplete() {
SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe);
swipeRefreshLayout.setRefreshing(false);
ProgressBar progressBar = (ProgressBar) findViewById(R.id.progress);
progressBar.setVisibility(View.INVISIBLE);
adapter = new MusicAdapter();
ListView listView = (ListView) findViewById(R.id.list);
listView.setAdapter(adapter);
}
class MusicAdapter extends BaseAdapter {
@Override
public int getCount() {
return musicList.size();
}
@Override
public Object getItem(int i) {
return musicList.get(i);
}
@Override
public long getItemId(int i) {
return i;
}
@Override
public View getView(int position, View view, ViewGroup viewGroup) {
View itemView = LayoutInflater.from(getApplicationContext())
.inflate(R.layout.item, viewGroup, false);
TextView line1 = itemView.findViewById(R.id.textView);
TextView line2 = itemView.findViewById(R.id.textView2);
Music music = musicList.get(position);
line1.setText(music.getMusicName());
line2.setText(music.getMusicPath());
if (index == position) {
itemView.setBackgroundColor(Color.GREEN);
}
return itemView;
}
}
}
| [
"guohao4@lenovo.com"
] | guohao4@lenovo.com |
c68eb19764238b9ffb8d6a9849f7176d47b7fb45 | c2422978578b32ae0d79b3cae88dcf8e3fc8248a | /FactoryPattern/SimpleDoorFactory/DoorFactory.java | bb1d2f7fcb3badc9dfb5b484a42e215dcc8bf1bb | [] | no_license | pranav1698/design_patterns_practise | faa30169eb60a98fa12f57e70f41daa6a15a2308 | 9b4d56ab027713eb9510fff10945cccdc9fd733c | refs/heads/master | 2023-01-11T17:00:41.946247 | 2020-11-18T18:41:27 | 2020-11-18T18:41:27 | 299,711,392 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 138 | java | public class DoorFactory {
public Door makeDoor(double width, double height) {
return new WoodenDoor(width, height);
}
}
| [
"prkulshrestha16@gmail.com"
] | prkulshrestha16@gmail.com |
9ae9ddedd2d2d7cd8adca5a823e0d4c077660407 | 428973e10582c2ad84a6056f9966a475f4d6530b | /kodilla-collections/src/main/java/com/kodilla/collections/interfaces/homework/Opel.java | 7a1c7238297d9b08b26bf559738e20028d5a3636 | [] | no_license | MagdaRdk/magdalena_rudnik-kodilla_tester | 2c3cb076e21259bf84765b586927e7012266fe88 | 378ecacb91c6baa1cc5bfd5d410f6e0b8ba4e751 | refs/heads/master | 2022-12-17T10:47:53.519112 | 2020-09-21T19:07:42 | 2020-09-21T19:07:42 | 265,937,740 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 541 | java | package com.kodilla.collections.interfaces.homework;
public class Opel implements Car {
private double speedO;
public Opel (double speedO) {
this.speedO = speedO;
}
@Override
public String toString() {
return "Opel{" +
"speedO=" + speedO +
'}';
}
@Override
public double getSpeed() {
return speedO;
}
public double increaseSpeed() {
return speedO + 20;
}
public double decreaseSpeed() {
return speedO - 5;
}
}
| [
"mcabaj1989@gmail.com"
] | mcabaj1989@gmail.com |
f0ac0a5602cf159a6eaa744630fe93e0202ab8e2 | d6bd75156e8a1a5287d67e4ca9d726d903468f06 | /src/main/java/com/dayshare/utils/email/EmailServiceImpl.java | 2673f71a6fd4307dc38a52f632fea9b55a5f7eb4 | [] | no_license | kpl39/day-share-api | 032be7aa65a7191f197fe88bd12e38198a71a43f | cacd89c5610b3e8403f59f3d0776e9449d44b391 | refs/heads/master | 2021-04-25T16:40:34.160886 | 2018-02-25T14:55:15 | 2018-02-25T14:55:15 | 108,195,131 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,637 | java | package com.dayshare.utils.email;
import com.amazonaws.services.simpleemail.AmazonSimpleEmailService;
import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClientBuilder;
import com.amazonaws.services.simpleemail.model.*;
import com.dayshare.emails.Email;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class EmailServiceImpl implements EmailService {
@Autowired
private AmazonSimpleEmailService sesClient;
public String sendEmail(Email email) {
String recipient = "kylelinhardt@gmail.com";
String sender = "Day Share <admin@dayshare.co>";
String subject = email.getSubject();
String body = email.getMessageBody();
String status;
try {
SendEmailRequest request = new SendEmailRequest()
.withDestination(
new Destination().withToAddresses(recipient))
.withMessage(new Message()
.withBody(new Body()
.withText(new Content()
.withCharset("UTF-8").withData(body)))
.withSubject(new Content()
.withCharset("UTF-8").withData(subject)))
.withSource(sender);
sesClient.sendEmail(request);
status = "Great Success";
} catch (Exception ex) {
System.out.println("Email not sent: " + ex.getMessage());
status = "Dumbass";
}
return status;
}
}
| [
"kylelinhardt@Kyles-iMac.local"
] | kylelinhardt@Kyles-iMac.local |
3901afb43c1a470004b9fe1a637866334899f6a1 | d36cadb95057843dbccf776634e28797364e9ca6 | /src/main/java/com/iivanovs/bookshopca/controller/AddressController.java | b94742a340329f871fed624735b28611426cd562 | [] | no_license | scanslv/Book_Shop_CA | c199908c99c35b48aef62c4dd68b61b119bb2922 | 7988bee178bfdc82b00f2f8b90b10d9c7bd2d056 | refs/heads/master | 2020-03-08T09:33:06.011195 | 2018-04-13T15:06:49 | 2018-04-13T15:06:49 | 128,049,956 | 1 | 0 | null | 2018-04-13T15:06:50 | 2018-04-04T11:00:54 | JavaScript | UTF-8 | Java | false | false | 2,849 | java | package com.iivanovs.bookshopca.controller;
import com.iivanovs.bookshopca.entity.Address;
import com.iivanovs.bookshopca.entity.User;
import com.iivanovs.bookshopca.service.AddressServiceImpl;
import com.iivanovs.bookshopca.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.security.Principal;
import java.util.Optional;
@RestController
@RequestMapping("/address")
public class AddressController {
public AddressController() {
super();
}
@Autowired
private AddressServiceImpl addressService;
@Autowired
private UserServiceImpl userService;
@RequestMapping(method = RequestMethod.POST)
ResponseEntity<?> create(Principal principal,
@RequestParam("id") long user_id,
@RequestBody Address address) {
Optional<User> u = userService.findOne(user_id);
if (u.isPresent() && u.get().getEmail().equalsIgnoreCase(principal.getName())) {
User user = this.addressService.create(user_id, address);
if (user == null)
return ResponseEntity.status(404).body("Can't create address");
else {
return ResponseEntity.ok(user);
}
} else
return ResponseEntity.status(404).body("Can't create address");
}
@RequestMapping(method = RequestMethod.PUT)
ResponseEntity<?> update(Principal principal,
@RequestParam("id") long user_id,
@RequestBody Address address) {
Optional<User> u = userService.findOne(user_id);
if (u.isPresent() && u.get().getEmail().equalsIgnoreCase(principal.getName())) {
User user = this.addressService.update(user_id, address);
if (user == null)
return ResponseEntity.status(404).body("Can't update address");
else {
return ResponseEntity.ok(user);
}
} else
return ResponseEntity.status(404).body("Can't update address");
}
@RequestMapping(method = RequestMethod.DELETE)
ResponseEntity<?> delete(Principal principal,
@RequestParam("id") long user_id) {
Optional<User> u = userService.findOne(user_id);
if (u.isPresent() && u.get().getEmail().equalsIgnoreCase(principal.getName())) {
User user = this.addressService.delete(user_id);
if (user == null)
return ResponseEntity.status(404).body("Can't delete address");
else {
return ResponseEntity.ok(user);
}
} else
return ResponseEntity.status(404).body("Can't delete address");
}
}
| [
"scanslv@gmail.com"
] | scanslv@gmail.com |
978fe803fe520efebbc94a45b88452ac842e8c28 | 51ff905cd5becc60248e15d90fcba4b24b953e7a | /TrackMeInside/app/src/main/java/ch/hearc/trackmeinside/Trilateration.java | c329606056e3e8bab0b285d02d5bd46fca33e1c1 | [] | no_license | thegazou/track-me-inside | f00f805acec818fa772630a4832807adc4a29997 | ff63eb4431f493a0e13f2864f7781a4b865f311f | refs/heads/master | 2021-04-29T10:46:05.574165 | 2017-01-24T22:10:06 | 2017-01-24T22:10:06 | 77,832,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,790 | java | package ch.hearc.trackmeinside;
import java.util.List;
/**
* Created by Mateli on 18.01.2017.
*/
public class Trilateration {
/**
*
* @param listCercles (size == 3)
* @return
*/
public static Cercle trilaterer(List<Cercle> listCercles){
double top = 0;
double bot = 0;
for (int i=0; i<3; i++) {
Cercle c = listCercles.get(i);
Cercle c2, c3;
if (i==0) {
c2 = listCercles.get(1);
c3 = listCercles.get(2);
}
else if (i==1) {
c2 = listCercles.get(0);
c3 = listCercles.get(2);
}
else {
c2 = listCercles.get(0);
c3 = listCercles.get(1);
}
double d = c2.x - c3.x;
double v1 = (c.x * c.x + c.y * c.y) - (c.r * c.r);
top += d*v1;
double v2 = c.y * d;
bot += v2;
}
double y = top / (2*bot);
Cercle c1 = listCercles.get(0);
Cercle c2 = listCercles.get(1);
top = c2.r*c2.r+c1.x*c1.x+c1.y*c1.y-c1.r*c1.r-c2.x*c2.x-c2.y*c2.y-2*(c1.y-c2.y)*y;
bot = c1.x-c2.x;
double x = top / (2*bot);
return new Cercle(x,y,0);
}
/**
*
* @param listCercles (min size = 1, pas de maxsize)
* @return
*/
public static Cercle trilaterer2(List<Cercle> listCercles){
double x = 0;
double y = 0;
double normalizeCoefficient = 0.0;
int size = listCercles.size();
//if(listCercles.size() != 3)
//return null;
//take revert values, because lower distance then bigger weight
for (int i = 0; i < size; i++)
normalizeCoefficient += 1.0 / (listCercles.get(i).r * listCercles.get(i).r);
//System.out.println("Normalized coef : "+normalizeCoefficient);
double[] tabWeight = new double[size];
for (int i = 0; i < size; i++)
{
// calculate probability of being at beacons x,y coordinates
tabWeight[i] = 1.0 / (listCercles.get(i).r * listCercles.get(i).r *
normalizeCoefficient );
//System.out.println("weight "+ i+" : "+tabWeight[i]);
double beaconX = listCercles.get(i).x;//mBeaconMeas[ i ].getBeaconPtr()->getX();
double beaconY = listCercles.get(i).y;//mBeaconMeas[ i ].getBeaconPtr()->getY();
//System.out.println("beaconX "+ i+" : "+beaconX);
//System.out.println("beaconY "+ i+" : "+beaconY);
//find final coordinates according to probability
x += tabWeight[ i ] * beaconX;
y += tabWeight[ i ] * beaconY;
}
return new Cercle(x,y,0);
}
}
| [
"matbandeli@gmail.com"
] | matbandeli@gmail.com |
b0b66ac4f555c17d9b95b39765b531b2da81340b | ee082d98892a3add1ed4865303be35d49e091261 | /DivRanking/src/org/archive/a1/search/another/jsearchdemo/ThingWithProperties.java | 283bd1b4b38a8b9964e1d2433ff387aff24cc274 | [] | no_license | laurel2935/DivRanking | a7fea2d71840853bec2277096202fb59a1ce2c02 | 9e9b7067fcc5c25fa62a4fbc8fcc5f1ce05ebb48 | refs/heads/master | 2016-09-05T11:00:34.359657 | 2015-10-20T13:33:45 | 2015-10-20T13:33:45 | 42,454,235 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 142 | java | package org.archive.a1.search.another.jsearchdemo;
import java.util.*;
interface ThingWithProperties {
Vector getProperties();
}
| [
"Forest Lion@Winapple"
] | Forest Lion@Winapple |
8834253e998412a6835b3b3a7582429e940ae74e | a3e032a19b88cdfa6fca71f3dc7fbd85fd79f3c6 | /exoplayer/src/main/java/com/google/android/exoplayer/DummyTrackRenderer.java | 485dd34206cdafd279552be48ae012881ff2c59a | [] | no_license | ihrthk/VideoPlayer | 1dd86b7a16c3f6459b6580ff543b0ffbb632c9d4 | 2aaee57f0a8075d2d3592134ab602eb5e5282ce6 | refs/heads/master | 2021-01-19T08:25:50.139821 | 2015-02-03T07:32:19 | 2015-02-03T07:32:19 | 28,563,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,943 | java | /*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.exoplayer;
/**
* A {@link TrackRenderer} that does nothing.
* <p/>
* This renderer returns {@link TrackRenderer#STATE_IGNORE} from {@link #doPrepare()} in order to
* request that it should be ignored. {@link IllegalStateException} is thrown from all methods that
* are documented to indicate that they should not be invoked unless the renderer is prepared.
*/
public class DummyTrackRenderer extends TrackRenderer {
@Override
protected int doPrepare() throws ExoPlaybackException {
return STATE_IGNORE;
}
@Override
protected boolean isEnded() {
throw new IllegalStateException();
}
@Override
protected boolean isReady() {
throw new IllegalStateException();
}
@Override
protected void seekTo(long positionUs) {
throw new IllegalStateException();
}
@Override
protected void doSomeWork(long positionUs, long elapsedRealtimeUs) {
throw new IllegalStateException();
}
@Override
protected long getDurationUs() {
throw new IllegalStateException();
}
@Override
protected long getBufferedPositionUs() {
throw new IllegalStateException();
}
@Override
protected long getCurrentPositionUs() {
throw new IllegalStateException();
}
}
| [
"ihrthk@gmail.com"
] | ihrthk@gmail.com |
4e60c19d307b7ce00f0f9b92673d2a375931ff02 | 2fd9d77d529e9b90fd077d0aa5ed2889525129e3 | /DecompiledViberSrc/app/src/main/java/com/google/android/gms/internal/ads/zzdqn.java | 4423feff1194c532ede0675ff0d070ec4cf0fddf | [] | no_license | cga2351/code | 703f5d49dc3be45eafc4521e931f8d9d270e8a92 | 4e35fb567d359c252c2feca1e21b3a2a386f2bdb | refs/heads/master | 2021-07-08T15:11:06.299852 | 2021-05-06T13:22:21 | 2021-05-06T13:22:21 | 60,314,071 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 521 | java | package com.google.android.gms.internal.ads;
final class zzdqn
implements zzdph
{
public final int zzayz()
{
throw new NoSuchMethodError();
}
public final boolean zzaza()
{
throw new NoSuchMethodError();
}
public final zzdpj zzazb()
{
throw new NoSuchMethodError();
}
}
/* Location: E:\Study\Tools\apktool2_2\dex2jar-0.0.9.15\classes_viber_2_dex2jar.jar
* Qualified Name: com.google.android.gms.internal.ads.zzdqn
* JD-Core Version: 0.6.2
*/ | [
"yu.liang@navercorp.com"
] | yu.liang@navercorp.com |
a6b62d6639276297090cf75c5f6bdd3d0099bff8 | 09b5122d25fd3435bcce2513764c0ca2bd5c4d61 | /app/src/main/java/at/mrtramoga/moviebuddy/themoviedb3/MovieReviewsAnswer.java | dca57a52ff357d991b0fd678d38cdde57c73eae3 | [
"MIT"
] | permissive | ChristianMoesl/movie-buddy | 64cc8c9dbfbcd35cd2edae51809aa1f7bd0f4943 | a8bafa1fdc9f4184f553d20111d2eb9e23d3358e | refs/heads/master | 2021-12-15T04:56:55.089073 | 2017-11-08T20:06:56 | 2017-11-08T20:06:56 | 90,909,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,014 | java | package at.mrtramoga.moviebuddy.themoviedb3;
import java.util.List;
public class MovieReviewsAnswer {
public static class Review {
private String id;
private String author;
private String content;
private String url;
public String getId() {
return id;
}
public String getAuthor() {
return author;
}
public String getContent() {
return content;
}
public String getUrl() {
return url;
}
}
private long id;
private long page;
private List<Review> results;
private long totalPages;
private long totalResults;
public long getId() {
return id;
}
public long getPage() {
return page;
}
public List<Review> getReviews() {
return results;
}
public long getTotalPages() {
return totalPages;
}
public long getTotalResults() {
return totalResults;
}
}
| [
"christian.moesl@live.at"
] | christian.moesl@live.at |
73be8a2f2275d3e56eec10aab5302e4a9b52233f | bba653e4ec049feaee23e23f0ac8272112fb5f7b | /app/src/main/java/com/example/administrator/mytestdemo/verticalviewpager/ContentAdapter.java | 125dd3dbdac28eedf7553b15c59d1f36703fa9de | [] | no_license | blueflychief/MyTestDemo | 91437037c5c179a6c36c200f724fa2d51e07c8c5 | 0b3febfb4cd2dd907abbb1c5c1a01b893623fddd | refs/heads/master | 2020-05-21T22:16:31.811995 | 2017-01-09T12:59:11 | 2017-01-09T12:59:11 | 65,727,183 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,148 | java | package com.example.administrator.mytestdemo.verticalviewpager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.example.administrator.mytestdemo.R;
public class ContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new ContentView(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_content, parent, false));
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
ContentView content = (ContentView) holder;
content.textView.setText("content" + position);
}
@Override
public int getItemCount() {
return 15;
}
public class ContentView extends RecyclerView.ViewHolder {
private TextView textView;
public ContentView(View itemView) {
super(itemView);
textView = (TextView) itemView.findViewById(R.id.context_text);
}
}
}
| [
"qq690797866@163.com"
] | qq690797866@163.com |
de6de07f4478ff1434c76d55f843ffa20e6d61d7 | 4d6793623d8c407169ae96d648d14231ee0a1c53 | /lab3/soa-lab/lab3-dao/src/main/java/pl/edu/agh/soa/lab3/mapper/DeanMapper.java | cb1563fb19df9d25286a98bec15fca6f694f3c6d | [] | no_license | paulinastal/SOA-lab | cc36be98c9b21a27280b18e3d35279bc829af108 | 7eff5a22cd55b430f4be15a346887104bff4aeb1 | refs/heads/master | 2023-05-09T06:50:57.462582 | 2021-06-09T19:08:14 | 2021-06-09T19:08:14 | 375,458,525 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 654 | java | package pl.edu.agh.soa.lab3.mapper;
import pl.edu.agh.soa.lab3.entity.DeanEntity;
import pl.edu.agh.soa.model.Dean;
public class DeanMapper {
public static Dean entityToModel(DeanEntity entity){
Dean dean = new Dean();
dean.setId(entity.getId());
dean.setDegree(entity.getDegree());
dean.setName(entity.getName());
return dean;
}
public static DeanEntity modelToEntity(Dean dean){
DeanEntity deanEntity = new DeanEntity();
deanEntity.setDegree(dean.getDegree());
deanEntity.setId(dean.getId());
deanEntity.setName(dean.getName());
return deanEntity;
}
}
| [
"paulina@taunet.pl"
] | paulina@taunet.pl |
1d1241a77e0f6212a6a9afe8390669033a48d8ae | 26b6fef94956bc713110189d3573f4ab3beebe4c | /Xidu-service/src/main/java/com/xidu/framework/fileloading/dto/BaseLoadingFileProcessDto.java | 09b1a625f5b3a57c9b52c8c303cbee90e0550675 | [] | no_license | zhang5883no1/anji | dca2c54a02cec65e5c943d7109d115b32062bbce | a16ae72bdc7c630b657503adedcf427c5e994e14 | refs/heads/master | 2021-01-18T15:40:32.248445 | 2017-03-30T07:19:31 | 2017-03-30T07:19:31 | 86,671,763 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,029 | java | /******************************************************************************
* @File name : BaseUploadFileProcessDto.java
* @Author : XINLYU
* @Date : 2013-6-20
* @Copyright Notice:
* Copyright (c) 2012 Capgemini, Inc. All Rights Reserved.
* ----------------------------------------------------------------------------
* Date Who Version Comments
* 2013-6-20 上午11:51:07 XINLYU 1.0 Initial Version
*****************************************************************************/
package com.xidu.framework.fileloading.dto;
import java.io.Serializable;
import java.util.Date;
import org.springframework.web.multipart.MultipartFile;
import com.xidu.framework.usermgnt.dto.SessionUserDto;
public class BaseLoadingFileProcessDto implements Serializable{
private static final long serialVersionUID = -1247346399344228776L;
private SessionUserDto sessionUser;
private String operationUser;
private String batchNo;
private String memo;
private Date operationDate;
private String errorMsg;
private String status;
protected String statusDesc;
private String operationDesc;
private String functionCode;
private String moduleCode;
private String operationType;
private String reason;
protected String createUser;
protected Date createDate;
protected String lastUpdateUser;
protected Date lastUpdateDate;
private MultipartFile multipartFile;
private String fileLocation;
private Date operationEndDate;
protected String createDateStr;
protected String lastUpdateDateStr;
public String getOperationUser() {
return operationUser;
}
public void setOperationUser(String operationUser) {
this.operationUser = operationUser;
}
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public Date getOperationDate() {
return operationDate;
}
public void setOperationDate(Date operationDate) {
this.operationDate = operationDate;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatusDesc() {
return statusDesc;
}
public void setStatusDesc(String statusDesc) {
this.statusDesc = statusDesc;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getLastUpdateUser() {
return lastUpdateUser;
}
public void setLastUpdateUser(String lastUpdateUser) {
this.lastUpdateUser = lastUpdateUser;
}
public Date getLastUpdateDate() {
return lastUpdateDate;
}
public void setLastUpdateDate(Date lastUpdateDate) {
this.lastUpdateDate = lastUpdateDate;
}
public MultipartFile getMultipartFile() {
return multipartFile;
}
public void setMultipartFile(MultipartFile multipartFile) {
this.multipartFile = multipartFile;
}
public String getCreateDateStr() {
return createDateStr;
}
public void setCreateDateStr(String createDateStr) {
this.createDateStr = createDateStr;
}
public String getLastUpdateDateStr() {
return lastUpdateDateStr;
}
public void setLastUpdateDateStr(String lastUpdateDateStr) {
this.lastUpdateDateStr = lastUpdateDateStr;
}
public SessionUserDto getSessionUser() {
return sessionUser;
}
public void setSessionUser(SessionUserDto sessionUser) {
this.sessionUser = sessionUser;
}
public String getFileLocation() {
return fileLocation;
}
public void setFileLocation(String fileLocation) {
this.fileLocation = fileLocation;
}
public String getOperationDesc() {
return operationDesc;
}
public void setOperationDesc(String operationDesc) {
this.operationDesc = operationDesc;
}
public String getFunctionCode() {
return functionCode;
}
public void setFunctionCode(String functionCode) {
this.functionCode = functionCode;
}
public String getModuleCode() {
return moduleCode;
}
public void setModuleCode(String moduleCode) {
this.moduleCode = moduleCode;
}
public String getOperationType() {
return operationType;
}
public void setOperationType(String operationType) {
this.operationType = operationType;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public Date getOperationEndDate() {
return operationEndDate;
}
public void setOperationEndDate(Date operationEndDate) {
this.operationEndDate = operationEndDate;
}
}
| [
"815273727@qq.com"
] | 815273727@qq.com |
d4c3326dde881b2e606f25793bbbaf09a4dd24a5 | 90122c18b51d027810b54bc519caeefd8b2f587b | /app/src/main/java/ru/evendate/android/ui/cities/CityPromptDialog.java | 9e21182e8e4a577ce8e2c0fb71868211561211d9 | [] | no_license | KardanovIR/evendate-android | c9da1b458f7fc5140a27c55efb808feedb4a70a7 | 87fce26681fdc51fcb9ab57123a0d9c9d2de2b89 | refs/heads/master | 2021-03-24T12:43:11.271688 | 2017-11-22T22:14:33 | 2017-11-22T22:14:33 | 53,123,544 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,492 | java | package ru.evendate.android.ui.cities;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import ru.evendate.android.R;
/**
* Created by Aedirn on 11.03.17.
*/
public class CityPromptDialog extends Fragment {
private PromptInteractionListener mListener;
private Unbinder unbinder;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_city_prompt, container, false);
unbinder = ButterKnife.bind(this, rootView);
return rootView;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof PromptInteractionListener) {
mListener = (PromptInteractionListener)context;
} else {
throw new RuntimeException("Activity should implement PromptInteractionListener" +
"interface");
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
@OnClick(R.id.button2)
public void onClick() {
mListener.onPlaceButtonClick();
}
interface PromptInteractionListener {
void onPlaceButtonClick();
}
} | [
"nillsondg@gmail.com"
] | nillsondg@gmail.com |
45f93693cb2914fba81357d0d00cb20eb04dfdcc | 969d7bf9a10bc944303c2f16095b611c3688642d | /src/main/java/org/lwjglb/engine/GameEngine.java | 409947cc7cbaebc622f33b78282a6455b70edd0c | [] | no_license | EasternSauce/GamePrototype | 8531915f613211ebf9be216805eab4393588940a | c3ae9755107f935f027707b87bf77b7a61e0d92c | refs/heads/master | 2022-03-01T12:04:51.915469 | 2019-10-29T15:44:54 | 2019-10-29T15:44:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,781 | java | package org.lwjglb.engine;
public class GameEngine implements Runnable {
public static final int TARGET_FPS = 60;
public static final int TARGET_UPS = 60;
private final Window window;
private final Timer timer;
private final IGameLogic gameLogic;
private double lastFps;
private int fps;
private String windowTitle;
public GameEngine(String windowTitle, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {
this(windowTitle, 0, 0, vSync, opts, gameLogic);
}
public GameEngine(String windowTitle, int width, int height, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {
this.windowTitle = windowTitle;
window = new Window(windowTitle, width, height, vSync, opts);
this.gameLogic = gameLogic;
timer = new Timer();
}
@Override
public void run() {
try {
init();
gameLoop();
} catch (Exception excp) {
excp.printStackTrace();
} finally {
cleanup();
}
}
protected void init() throws Exception {
window.init();
timer.init();
gameLogic.init(window);
lastFps = timer.getTime();
fps = 0;
}
protected void gameLoop() {
float elapsedTime;
float accumulator = 0f;
float interval = 1f / TARGET_UPS;
boolean running = true;
while (running && !window.windowShouldClose()) {
elapsedTime = timer.getElapsedTime();
accumulator += elapsedTime;
input();
while (accumulator >= interval) {
update(interval);
accumulator -= interval;
}
render();
if ( !window.isvSync() ) {
sync();
}
}
}
protected void cleanup() {
gameLogic.cleanup();
}
private void sync() {
float loopSlot = 1f / TARGET_FPS;
double endTime = timer.getLastLoopTime() + loopSlot;
while (timer.getTime() < endTime) {
try {
Thread.sleep(1);
} catch (InterruptedException ie) {
}
}
}
protected void input() {
gameLogic.input(window);
}
protected void update(float interval) {
gameLogic.update(interval, window);
}
protected void render() {
if ( window.getWindowOptions().showFps && timer.getLastLoopTime() - lastFps > 1 ) {
lastFps = timer.getLastLoopTime();
window.setWindowTitle(windowTitle + " - " + fps + " FPS");
fps = 0;
}
fps++;
gameLogic.render(window);
window.update();
}
}
| [
"kam.kurp@gmail.com"
] | kam.kurp@gmail.com |
a470101c998c4c1ddf1a8cc1f861a1c823e453d1 | db23b0198a89f132e98f2869d7ad3f09fbf8490e | /app/src/main/java/com/cyl/musiclake/player/playback/PlaybackListener.java | d51bcf8b0dffd7d954c1da26e6dd0233d4faa7b0 | [
"Apache-2.0"
] | permissive | truongchec/MusicLake | 8955941833acbed7dff1a74a64af4f27dd9a6fa3 | 3665b1c376f054c8333c6090af3c61b1b6fe6cfd | refs/heads/master | 2022-03-28T12:49:13.132987 | 2020-01-01T02:24:45 | 2020-01-01T02:24:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 281 | java | package com.cyl.musiclake.player.playback;
import android.media.MediaPlayer;
public interface PlaybackListener {
void onCompletionNext();
void onCompletionEnd();
void onBufferingUpdate(MediaPlayer mp, int percent);
void onPrepared();
void onError();
}
| [
"44560500+truongnguyen3112@users.noreply.github.com"
] | 44560500+truongnguyen3112@users.noreply.github.com |
5cebb9d04ddc6a2ad4197de833835aa179f4cecd | 672e0c8962118048b1a7e947dea4448bed4419a5 | /android/SplashActivity.java | e57b19c43bbecb69509719acea4d32579578ad52 | [] | no_license | jhnyang/postureRecognition | 8ec355c53486ec1bc8cfbe80db12e24d7f7b9c29 | 54dd8b3e56a5f2767674bf1bd92858ae77cdfa50 | refs/heads/master | 2020-04-03T16:57:49.043251 | 2018-12-03T14:15:01 | 2018-12-03T14:15:01 | 155,426,035 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,110 | java | package com.example.yangJihyun.bubu_main;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.LinearLayout;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings;
public class SplashActivity extends AppCompatActivity {
private LinearLayout linearLayout;
private FirebaseRemoteConfig mFirebaseRemoteConfig;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
//state bar 제거
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
linearLayout = (LinearLayout) findViewById(R.id.splashactivity_linaerlayout);
mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
.setDeveloperModeEnabled(BuildConfig.DEBUG)
.build();
mFirebaseRemoteConfig.setConfigSettings(configSettings);
mFirebaseRemoteConfig.setDefaults(R.xml.default_config);
mFirebaseRemoteConfig.fetch(0)
.addOnCompleteListener(this, new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
// Once the config is successfully fetched it must be activated before newly fetched
// values are returned.
mFirebaseRemoteConfig.activateFetched();
} else {
}
displayMessage();
}
});
}
void displayMessage() {
String splash_background = mFirebaseRemoteConfig.getString("splash_background");
boolean caps = mFirebaseRemoteConfig.getBoolean("splash_message_caps");
String splash_message = mFirebaseRemoteConfig.getString("splash_message");
linearLayout.setBackgroundColor(Color.parseColor(splash_background));
if(caps) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(splash_message).setPositiveButton("확인", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
finish();
}
});
builder.create().show();
}
else {
startActivity(new Intent(this,LoginActivity.class));
finish();
}
}
}
| [
"jhnyang@naver.com"
] | jhnyang@naver.com |
ffc9155d748c07be402c1c0e6065b0eebc7793fa | a21a9d1f5800b96b66129ad76563d4b152914746 | /src/lesson4/MovieSession.java | 2a75e2d4ec05ed26cf6fb4049704fdcfdbdb5443 | [] | no_license | Denki77/InterviewProject | fd528192801cf70d7b4c6e2806f9053a74c7e7de | b96a06f575574e45ba495f4d8f1f66f54b5603d3 | refs/heads/master | 2023-07-19T07:03:50.680725 | 2021-09-14T06:10:29 | 2021-09-14T06:10:29 | 390,234,914 | 0 | 0 | null | 2021-09-14T06:10:30 | 2021-07-28T06:09:53 | Java | UTF-8 | Java | false | false | 891 | java | package lesson4;
import java.util.Date;
public class MovieSession {
private Date date = null;
private int max_duration_film = 0;
private CinemaHall cinemaHall = null;
public MovieSession(Date date, int max_duration_film, CinemaHall cinemaHall) {
this.date = date;
this.max_duration_film = max_duration_film;
this.cinemaHall = cinemaHall;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public int getMax_duration_film() {
return max_duration_film;
}
public void setMax_duration_film(int max_duration_film) {
this.max_duration_film = max_duration_film;
}
public CinemaHall getCinemaHall() {
return cinemaHall;
}
public void setCinemaHall(CinemaHall cinemaHall) {
this.cinemaHall = cinemaHall;
}
}
| [
"tgimrv@ya.ru"
] | tgimrv@ya.ru |
48416eb38340c89bb319689317131fab7b6da960 | abbc8366dd0ceecc14861775f126b60020060175 | /src/paquetePrincipal/TablaDescriptores.java | c0513ec542af5a488d4aacc0f821ff5ab206dd92 | [] | no_license | cnuila/Compilador_VB6.0 | 98d3f82d2893627942bfdfad2b1021e5fbd98367 | 24a02a142af5143326aea422a37a07544e3ded8f | refs/heads/master | 2023-05-30T18:14:28.717000 | 2021-06-24T21:58:34 | 2021-06-24T21:58:34 | 341,435,036 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 262 | java | package paquetePrincipal;
import java.util.ArrayList;
public class TablaDescriptores {
private ArrayList<Boolean> tablaDescriptores;
TablaDescriptores() {
}
public ArrayList<Boolean> getDescriptores(){
return tablaDescriptores;
}
} | [
"cnuila14@icloud.com"
] | cnuila14@icloud.com |
0c0bfa544ac1b511483ef90191ca6787f6d809ff | e5b9397e15a547ccc237c4c9e610ebde89674f19 | /app/src/main/java/com/rarcher/Login_Register/LoginActivity.java | 18f719f0fba531fbad5b8565c6b24b757ebf2f70 | [] | no_license | Rarchers/Spring | e49b8fb29dffbda3c6e6393067638f22bbe578ad | 4db696995cd024374d4b0a259fb0c3af47fb9184 | refs/heads/master | 2020-04-26T09:32:45.613241 | 2019-03-29T13:23:05 | 2019-03-29T13:23:05 | 173,459,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,929 | java | package com.rarcher.Login_Register;
import android.animation.ValueAnimator;
import android.app.ProgressDialog;
import android.content.ContentValues;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Build;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.DecelerateInterpolator;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.rarcher.Acticitys.MainActivity;
import com.rarcher.DataBase.LocalDB;
import com.rarcher.DataBase.Nowusers;
import com.rarcher.DataBase.Users;
import com.rarcher.R;
import java.io.ByteArrayInputStream;
public class LoginActivity extends AppCompatActivity implements View.OnClickListener, View.OnFocusChangeListener, ViewTreeObserver.OnGlobalLayoutListener, TextWatcher {
/*
* 控件
* */
CheckBox markme;
private ImageButton mIbNavigationBack;
private EditText mEtLoginUsername;
private EditText mEtLoginPwd;
private LinearLayout mLlLoginUsername;
private ImageView mIvLoginUsernameDel;
private Button mBtLoginSubmit;
private LinearLayout mLlLoginPwd;
private ImageView mIvLoginPwdDel;
private ImageView mIvLoginLogo;
private LinearLayout mLayBackBar;
private TextView mTvLoginForgetPwd;
private Button mBtLoginRegister;
//全局Toast
private Toast mToast;
private int mLogoHeight;
private int mLogoWidth;
String RU,RP;
String TAG = "Login";
private SharedPreferences preferences;
private SharedPreferences.Editor editor;
//登陆对话框
ProgressDialog progressDialog;
/*
* DataBase
* */
LocalDB dbhelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
title();
setContentView(R.layout.activity_login);
Intent intent = getIntent();
RU = intent.getStringExtra("un");
RP = intent.getStringExtra("pa");
Log.d(TAG, "onCreate: RU"+RU);
Log.d(TAG, "onCreate: RP"+RP);
//注册dialog
progressDialog = new ProgressDialog(LoginActivity.this);
markme = findViewById(R.id.markme);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
initView();
String username = mEtLoginUsername.getText().toString().trim();
String pwd = mEtLoginPwd.getText().toString().trim();
//登录按钮是否可用
if (!TextUtils.isEmpty(pwd) && !TextUtils.isEmpty(username)) {
mBtLoginSubmit.setClickable(true);
mBtLoginSubmit.setBackgroundResource(R.drawable.bg_login_submit);
mBtLoginSubmit.setTextColor(getResources().getColor(R.color.black));
} else {
mBtLoginSubmit.setBackgroundResource(R.drawable.bg_login_submit_lock);
mBtLoginSubmit.setClickable(false);
mBtLoginSubmit.setTextColor(getResources().getColor(R.color.account_lock_font_color));
}
//数据库初始化
dbhelper = new LocalDB(LoginActivity.this, "User.db", null, 2);
dbhelper.getWritableDatabase();
}
//初始化视图
private void initView() {
//导航栏+返回按钮
mLayBackBar = findViewById(R.id.ly_retrieve_bar);
mIbNavigationBack = findViewById(R.id.ib_navigation_back);
//logo
mIvLoginLogo = findViewById(R.id.iv_login_logo);
//username
mLlLoginUsername = findViewById(R.id.ll_login_username);
mEtLoginUsername = findViewById(R.id.et_login_username);
mIvLoginUsernameDel = findViewById(R.id.iv_login_username_del);
//passwd
mLlLoginPwd = findViewById(R.id.ll_login_pwd);
mEtLoginPwd = findViewById(R.id.et_login_pwd);
mIvLoginPwdDel = findViewById(R.id.iv_login_pwd_del);
//提交、注册
mBtLoginSubmit = findViewById(R.id.bt_login_submit);
mBtLoginRegister = findViewById(R.id.bt_login_register);
//忘记密码
mTvLoginForgetPwd = findViewById(R.id.tv_login_forget_pwd);
mTvLoginForgetPwd.setOnClickListener(this);
boolean isRemember = preferences.getBoolean("remember", false);
//检查是否记住密码
if (isRemember&&RU==null&&RP==null) {
String account = preferences.getString("account", "");
String pass = preferences.getString("password", "");
mEtLoginUsername.setText(account);
mEtLoginPwd.setText(pass);
markme.setChecked(true);
}
else if (RU!=null&&RP!=null)
{
mEtLoginUsername.setText(RU);
mEtLoginPwd.setText(RP);
}
mIbNavigationBack.setVisibility(View.INVISIBLE);
mIbNavigationBack.setClickable(false);
//注册点击事件
mIbNavigationBack.setOnClickListener(this);
mEtLoginUsername.setOnClickListener(this);
mIvLoginUsernameDel.setOnClickListener(this);
mBtLoginSubmit.setOnClickListener(this);
mBtLoginRegister.setOnClickListener(this);
mEtLoginPwd.setOnClickListener(this);
mIvLoginPwdDel.setOnClickListener(this);
//注册其它事件
mLayBackBar.getViewTreeObserver().addOnGlobalLayoutListener(this);
mEtLoginUsername.setOnFocusChangeListener(this);
mEtLoginUsername.addTextChangedListener(this);
mEtLoginPwd.setOnFocusChangeListener(this);
mEtLoginPwd.addTextChangedListener(this);
}
//融合状态栏
private void title() {
if (Build.VERSION.SDK_INT >= 21)
{
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
}
//显示loading对话框
private void showloading() {
progressDialog.setTitle("登陆中");
progressDialog.setMessage("Loading...");
progressDialog.setCancelable(true);
progressDialog.show();
}
//关闭loading
private void closeloading() {
progressDialog.cancel();
}
//云端数据库查到资料后放进本地数据库
private void addtolocal(String phone, String password, String name, String sex) {
SQLiteDatabase db = dbhelper.getWritableDatabase();
ContentValues values = new ContentValues();
values.put("phone", phone);
values.put("password", password);
values.put("name", name);
values.put("sex", sex);
db.insert("Book", null, values);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.ib_navigation_back:
//返回
//finish();
break;
case R.id.et_login_username:
mEtLoginPwd.clearFocus();
mEtLoginUsername.setFocusableInTouchMode(true);
mEtLoginUsername.requestFocus();
break;
case R.id.et_login_pwd:
mEtLoginUsername.clearFocus();
mEtLoginPwd.setFocusableInTouchMode(true);
mEtLoginPwd.requestFocus();
break;
case R.id.iv_login_username_del:
//清空用户名
mEtLoginUsername.setText(null);
break;
case R.id.iv_login_pwd_del:
//清空密码
mEtLoginPwd.setText(null);
break;
case R.id.bt_login_submit:
//登录
loginRequest();
break;
case R.id.bt_login_register:
//注册
startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
finish();
break;
case R.id.tv_login_forget_pwd:
//忘记密码
startActivity(new Intent(LoginActivity.this, ForgetPwdActivity.class));
break;
default:
break;
}
}
//用户名密码焦点改变
@Override
public void onFocusChange(View v, boolean hasFocus) {
int id = v.getId();
if (id == R.id.et_login_username) {
if (hasFocus) {
mLlLoginUsername.setActivated(true);
mLlLoginPwd.setActivated(false);
}
} else {
if (hasFocus) {
mLlLoginPwd.setActivated(true);
mLlLoginUsername.setActivated(false);
}
}
}
//显示或隐藏logo
@Override
public void onGlobalLayout() {
final ImageView ivLogo = this.mIvLoginLogo;
Rect KeypadRect = new Rect();
mLayBackBar.getWindowVisibleDisplayFrame(KeypadRect);
int screenHeight = mLayBackBar.getRootView().getHeight();
int keypadHeight = screenHeight - KeypadRect.bottom;
//隐藏logo
if (keypadHeight > 300 && ivLogo.getTag() == null) {
final int height = ivLogo.getHeight();
final int width = ivLogo.getWidth();
this.mLogoHeight = height;
this.mLogoWidth = width;
ivLogo.setTag(true);
ValueAnimator valueAnimator = ValueAnimator.ofFloat(1, 0);
valueAnimator.setDuration(400).setInterpolator(new DecelerateInterpolator());
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float animatedValue = (float) animation.getAnimatedValue();
ViewGroup.LayoutParams layoutParams = ivLogo.getLayoutParams();
layoutParams.height = (int) (height * animatedValue);
layoutParams.width = (int) (width * animatedValue);
ivLogo.requestLayout();
ivLogo.setAlpha(animatedValue);
}
});
if (valueAnimator.isRunning()) {
valueAnimator.cancel();
}
valueAnimator.start();
}
//显示logo
else if (keypadHeight < 300 && ivLogo.getTag() != null) {
final int height = mLogoHeight;
final int width = mLogoWidth;
ivLogo.setTag(null);
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1);
valueAnimator.setDuration(400).setInterpolator(new DecelerateInterpolator());
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float animatedValue = (float) animation.getAnimatedValue();
ViewGroup.LayoutParams layoutParams = ivLogo.getLayoutParams();
layoutParams.height = (int) (height * animatedValue);
layoutParams.width = (int) (width * animatedValue);
ivLogo.requestLayout();
ivLogo.setAlpha(animatedValue);
}
});
if (valueAnimator.isRunning()) {
valueAnimator.cancel();
}
valueAnimator.start();
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
//用户名密码输入事件
@Override
public void afterTextChanged(Editable s) {
String username = mEtLoginUsername.getText().toString().trim();
String pwd = mEtLoginPwd.getText().toString().trim();
Log.d(TAG, "afterTextChanged: change");
//是否显示清除按钮
if (username.length() > 0) {
mIvLoginUsernameDel.setVisibility(View.VISIBLE);
} else {
mIvLoginUsernameDel.setVisibility(View.INVISIBLE);
}
if (pwd.length() > 0) {
mIvLoginPwdDel.setVisibility(View.VISIBLE);
} else {
mIvLoginPwdDel.setVisibility(View.INVISIBLE);
}
//登录按钮是否可用
if (!TextUtils.isEmpty(pwd) && !TextUtils.isEmpty(username)) {
mBtLoginSubmit.setClickable(true);
mBtLoginSubmit.setBackgroundResource(R.drawable.bg_login_submit);
mBtLoginSubmit.setTextColor(getResources().getColor(R.color.black));
} else {
mBtLoginSubmit.setBackgroundResource(R.drawable.bg_login_submit_lock);
mBtLoginSubmit.setClickable(false);
mBtLoginSubmit.setTextColor(getResources().getColor(R.color.account_lock_font_color));
}
}
//登录
private void loginRequest() {
showloading();
Toast.makeText(LoginActivity.this, "showloading", Toast.LENGTH_SHORT).show();
String account = mEtLoginUsername.getText().toString();
String pass = mEtLoginPwd.getText().toString();
if (account == "" || pass == "") {
closeloading();
Toast.makeText(LoginActivity.this, "请输入用户名或者密码", Toast.LENGTH_SHORT).show();
}
Users logins = LocalDB.query_user(account,dbhelper);
//如果本地数据库有记录,就直接放行,不去云端数据库搞事情了
if (logins != null && pass.equals(logins.getPassword())) {
editor = preferences.edit();
if (markme.isChecked()) {//记住密码是否生效
editor.putBoolean("remember", true);
editor.putString("account", account);
editor.putString("password", pass);
LocalDB.updata_user(account, pass,dbhelper);
} else editor.clear();
editor.apply();
Toast.makeText(LoginActivity.this, "登陆成功", Toast.LENGTH_SHORT).show();
closeloading();
Nowusers.setPhone(account);
Nowusers.setName(logins.getName());
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
intent.putExtra("user", account);
startActivity(intent);
finish();
} else {//本地数据库为空或者密码匹配不上
//请求云端服务器拉取信息
Toast.makeText(LoginActivity.this, "从云端数据库获取信息或者登陆失败", Toast.LENGTH_SHORT).show();
}
}
//退出时的时间
private long mExitTime;
//对返回键进行监听
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
exit();
return true;
}
return super.onKeyDown(keyCode, event);
}
//退出方法
private void exit() {
if ((System.currentTimeMillis() - mExitTime) > 2000) {
Toast.makeText(LoginActivity.this, "再按1一次退出应用", Toast.LENGTH_SHORT).show();
mExitTime = System.currentTimeMillis();
} else {
//用户退出处理
finish();
System.exit(0);
}
}
}
| [
"2553263392@qq.com"
] | 2553263392@qq.com |
ba73bc0beb9fa9dfaa438f7624af22f6d995073e | 99f8699e1e95589293dc0c188b104e8307c4bada | /src/main/java/com/cinema/utility/MovieType.java | 90ea92a8b7c2206411ba8be52b2868ebbc068636 | [] | no_license | bahatas/cinemaLab | 6d45a3c80f5fa6ae493bdd264b54f27717268911 | 329f07b6279e72ff6cd2471048e16a32f1b89e03 | refs/heads/master | 2023-05-12T23:59:35.760616 | 2021-06-03T18:05:34 | 2021-06-03T18:05:34 | 372,898,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 80 | java | package com.cinema.utility;
public enum MovieType {
PREMIER,REGULAR;
}
| [
"59250233+bahatas@users.noreply.github.com"
] | 59250233+bahatas@users.noreply.github.com |
a1c54b2ddae49b1b27e1f50b0fe463a3fa1f4b46 | 1cce29cd23674b1e7f3d523c779231032720add4 | /src/main/java/com/suixingpay/profit/jikeshijian/xiengnengyouhua/DemoApplication15.java | 79f52c53295a0a2662b78ab26246dc06c624085f | [] | no_license | histjxg/hxg-all | b87a30f2c18c8c075067c406fb1aac8b56dbff4d | 01a1aabb12f3a56bb74698ac986fd16268421698 | refs/heads/master | 2023-07-11T22:10:39.808894 | 2021-08-18T16:07:35 | 2021-08-18T16:07:36 | 397,638,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,593 | java | package com.suixingpay.profit.jikeshijian.xiengnengyouhua;
public class DemoApplication15 {
public static void main(String[] args) {
// 运行多线程
MultiThreadTester test1 = new MultiThreadTester();
test1.Start();
// 运行单线程
SerialTester test2 = new SerialTester();
test2.Start();
}
static class MultiThreadTester extends ThreadContextSwitchTester {
@Override
public void Start() {
long start = System.currentTimeMillis();
MyRunnable myRunnable1 = new MyRunnable();
Thread[] threads = new Thread[4];
// 创建多个线程
for (int i = 0; i < 4; i++) {
threads[i] = new Thread(myRunnable1);
threads[i].start();
}
for (int i = 0; i < 4; i++) {
try {
// 等待一起运行完
threads[i].join();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
long end = System.currentTimeMillis();
System.out.println("multi thread exce time: " + (end - start) + "s");
System.out.println("counter: " + counter);
}
// 创建一个实现 Runnable 的类
class MyRunnable implements Runnable {
public void run() {
while (counter < 100000000) {
synchronized (this) {
if(counter < 100000000) {
increaseCounter();
}
}
}
}
}
}
// 创建一个单线程
static class SerialTester extends ThreadContextSwitchTester{
@Override
public void Start() {
long start = System.currentTimeMillis();
for (long i = 0; i < count; i++) {
increaseCounter();
}
long end = System.currentTimeMillis();
System.out.println("serial exec time: " + (end - start) + "s");
System.out.println("counter: " + counter);
}
}
// 父类
static abstract class ThreadContextSwitchTester {
public static final int count = 100000000;
public volatile int counter = 0;
public int getCount() {
return this.counter;
}
public void increaseCounter() {
this.counter += 1;
}
public abstract void Start();
}
}
| [
"huangxiaogen@baijiahulian.com"
] | huangxiaogen@baijiahulian.com |
cd9d3f9136e6038992569a94912dc7f373465eb7 | aece520374f1718f03d6e209835700fe804932ff | /src/ex_java/Ex11_03_File.java | 6a4ff460088f7b1449752894c08ef36de72aff13 | [] | no_license | moonshot123/ex-java | 7cf033e4950c62e51523576538eb1ab9a9a20cac | e68e7bc279b92212c3df1598f1445c74533ca679 | refs/heads/master | 2021-04-27T03:04:41.736409 | 2018-02-24T05:48:08 | 2018-02-24T05:48:08 | 122,707,285 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,144 | java | package ex_java;
import java.io.File;
import java.io.IOException;
public class Ex11_03_File {
public static void main(String[] args) {
File f1 =new File("A");// 확장자가 없으면 폴더
File f2 =new File("B");// 따로 위치를 지정하지 않으면 지금 작업위치에 생김
File f3 =new File("C");
File f4 =new File(f1,"aa.txt");//f1 이 없다면 현재작업공간에 바로 생성 //
if(f1.exists()){
f1.renameTo(f2);// 이름바꾸기f1> f2 이름으로
System.out.println("폴더이름 바꾸기 완료");
}else{
f1.mkdir();// 폴더만들기:mkdir();
System.out.println("폴더생성함");
try {
f4.createNewFile(); //파일만들기:createNewFile(); //예외처리를 해줘야됨
System.out.println("화일생성함");
} catch (IOException e) {
e.printStackTrace();
}
}
if(f3.exists()){
boolean bool = f3.delete();// 대소문자 상관없는듯 // 폴더안에 파일이 있으면 안지워짐
System.out.println(bool);
if(bool){ //bool == true
System.out.println("삭제완료");
}else{
System.out.println("삭제실패");
}
}
}
} | [
"whwjddn200@naver.com"
] | whwjddn200@naver.com |
3759ff24f54bbf4724cef0783b9a9760d6b9de7e | 6edf6c315706e14dc6aef57788a2abea17da10a3 | /com/planet_ink/marble_mud/WebMacros/grinder/GrinderHolidays.java | 4fb81a06883a5b7c99d1a52346d5ce855b6e45db | [] | no_license | Cocanuta/Marble | c88efd73c46bd152098f588ba1cdc123316df818 | 4306fbda39b5488dac465a221bf9d8da4cbf2235 | refs/heads/master | 2020-12-25T18:20:08.253300 | 2012-09-10T17:09:50 | 2012-09-10T17:09:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,446 | java | package com.planet_ink.marble_mud.WebMacros.grinder;
import com.planet_ink.marble_mud.WebMacros.RoomData;
import com.planet_ink.marble_mud.core.interfaces.*;
import com.planet_ink.marble_mud.core.*;
import com.planet_ink.marble_mud.core.collections.*;
import com.planet_ink.marble_mud.Abilities.interfaces.*;
import com.planet_ink.marble_mud.Areas.interfaces.*;
import com.planet_ink.marble_mud.Behaviors.interfaces.*;
import com.planet_ink.marble_mud.CharClasses.interfaces.*;
import com.planet_ink.marble_mud.Libraries.interfaces.*;
import com.planet_ink.marble_mud.Common.interfaces.*;
import com.planet_ink.marble_mud.Exits.interfaces.*;
import com.planet_ink.marble_mud.Items.interfaces.*;
import com.planet_ink.marble_mud.Locales.interfaces.*;
import com.planet_ink.marble_mud.MOBS.interfaces.*;
import com.planet_ink.marble_mud.Races.interfaces.*;
import java.util.*;
/*
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.
*/
@SuppressWarnings({"unchecked","rawtypes"})
public class GrinderHolidays {
public String name() {return this.getClass().getName().substring(this.getClass().getName().lastIndexOf('.')+1);}
protected static String setText(DVector sets, String var, String newVAL)
{
if(newVAL==null) newVAL="";
//var=var.toUpperCase().trim();
int index=sets.indexOf(var);
String oldVal=index>=0?(String)sets.elementAt(index,2):"";
if(index>=0)
{
if(!newVAL.equals(oldVal))
sets.setElementAt(index,2,newVAL);
}
else
sets.addElement(var,newVAL,Integer.valueOf(-1));
return newVAL;
}
public static String createModifyHoliday(ExternalHTTPRequests httpReq, java.util.Map<String,String> parms, String holidayName)
{
int index=CMLib.quests().getHolidayIndex(holidayName);
if(index<=0)
{
String err = CMLib.quests().createHoliday(holidayName,"ALL",true);
if((err != null) && (err.trim().length()>0))
return err;
index=CMLib.quests().getHolidayIndex(holidayName);
if(index < 0)
return "Error creating holiday file.";
}
List<String> steps=null;
QuestManager.RawHolidayData encodedData = null;
Object resp=CMLib.quests().getHolidayFile();
if(resp instanceof List)
steps=(List<String>)resp;
else
if(resp instanceof String)
return (String)resp;
if(steps!=null)
encodedData=CMLib.quests().getEncodedHolidayData(steps.get(index));
if(encodedData==null)
return "Error reading holiday data (code: "+((resp instanceof List)?"T":"F")+":"+((steps==null)?"F":"T")+":"+((encodedData==null)?"F":"T")+")";
DVector settings=encodedData.settings;
DVector behaviors=encodedData.behaviors;
DVector properties=encodedData.properties;
DVector stats=encodedData.stats;
//List stepV=(List)encodedData.elementAt(4);
//int pricingMobIndex=((Integer)encodedData.elementAt(5)).intValue();
String name=setText(settings,"NAME",httpReq.getRequestParameter("NAME"));
if((name==null)||(name.trim().length()==0)) return "A name is required.";
String duration=setText(settings,"DURATION",httpReq.getRequestParameter("DURATION"));
if((duration==null)||(!CMath.isMathExpression(duration))) return "Duration is mal-formed.";
if(!httpReq.isRequestParameter("SCHEDULETYPE")) return "Schedule not found.";
int typeIndex=CMath.s_int(httpReq.getRequestParameter("SCHEDULETYPE"));
int mudDayIndex=settings.indexOf("MUDDAY");
int dateIndex=settings.indexOf("DATE");
int waitIndex=settings.indexOf("WAIT");
String scheduleName=new String[]{"WAIT","MUDDAY","DATE"}[typeIndex];
if((typeIndex!=0)&&(waitIndex>=0))
settings.removeElement("WAIT");
if((typeIndex!=1)&&(mudDayIndex>=0))
settings.removeElement("MUDDAY");
if((typeIndex!=2)&&(dateIndex>=0))
settings.removeElement("DATE");
String newWait = setText(settings,scheduleName,httpReq.getRequestParameter(scheduleName));
switch(typeIndex)
{
case 0: {
if(!CMath.isMathExpression(newWait))
return "Wait expression is invalid.";
break;
}
case 1:
case 2: {
int dash=newWait.indexOf('-');
if(dash < 0) return "Given date is invalid. Use Month#-Day# format";
if(!CMath.isInteger(newWait.substring(0,dash).trim()))
return "Month value in the given date is not valid.";
if(!CMath.isInteger(newWait.substring(dash+1).trim()))
return "Day value in the given date is not valid.";
break;
}
}
StringBuffer areaGroup = new StringBuffer("");
HashSet areaCodes=new HashSet();
String id="";
for(int i=0;httpReq.isRequestParameter("AREAGROUP"+id);id=Integer.toString(++i))
areaCodes.add(httpReq.getRequestParameter("AREAGROUP"+id));
if(areaCodes.contains("AREAGROUP1"))
areaGroup.append("ANY");
else
{
int areaNum=2;
boolean reallyAll=true;
for(Enumeration e=CMLib.map().sortedAreas();e.hasMoreElements();areaNum++)
if(areaCodes.contains("AREAGROUP"+areaNum))
areaGroup.append(" \"" + ((Area)e.nextElement()).Name()+"\"");
else
{
reallyAll=false;
e.nextElement();
}
if(reallyAll)
areaGroup.setLength(0);
}
setText(settings,"AREAGROUP",areaGroup.toString().trim());
setText(settings,"MOBGROUP",httpReq.getRequestParameter("MOBGROUP"));
behaviors.clear();
setText(behaviors,"AGGRESSIVE",httpReq.getRequestParameter("AGGRESSIVE"));
for(int i=1;httpReq.isRequestParameter("BEHAV"+i);i++)
if(httpReq.getRequestParameter("BEHAV"+i).trim().length()>0)
setText(behaviors,httpReq.getRequestParameter("BEHAV"+i),httpReq.getRequestParameter("BDATA"+i));
StringBuffer mudChats=new StringBuffer("");
for(int i=1;httpReq.isRequestParameter("MCWDS"+i);i++)
{
String words=httpReq.getRequestParameter("MCWDS"+i).trim();
words=CMStrings.replaceAll(words,",","|");
if((words.length()>0)&&(httpReq.isRequestParameter("MCSAYS"+i+"_1")))
{
mudChats.append("("+words+");");
for(int ii=1;httpReq.isRequestParameter("MCSAYW"+i+"_"+ii);ii++)
if(CMath.isInteger(httpReq.getRequestParameter("MCSAYW"+i+"_"+ii)))
mudChats.append(httpReq.getRequestParameter("MCSAYW"+i+"_"+ii)+httpReq.getRequestParameter("MCSAYS"+i+"_"+ii)+";");
mudChats.append(";");
}
}
setText(behaviors,"MUDCHAT",mudChats.toString());
properties.clear();
setText(properties,"MOOD",httpReq.getRequestParameter("MOOD"));
for(int i=1;httpReq.isRequestParameter("AFFECT"+i);i++)
if(httpReq.getRequestParameter("AFFECT"+i).trim().length()>0)
setText(properties,httpReq.getRequestParameter("AFFECT"+i),httpReq.getRequestParameter("ADATA"+i));
Vector priceFV=new Vector();
for(int i=1;httpReq.isRequestParameter("PRCFAC"+i);i++)
if(CMath.isPct(httpReq.getRequestParameter("PRCFAC"+i).trim()))
priceFV.add(((String)(CMath.s_pct(httpReq.getRequestParameter("PRCFAC"+i).trim())+" "+httpReq.getRequestParameter("PMASK"+i).trim())).trim());
setText(stats,"PRICEMASKS",CMParms.toStringList(priceFV));
String err=CMLib.quests().alterHoliday(holidayName, encodedData);
if(err.length()==0)
httpReq.addRequestParameters("HOLIDAY",name);
return err;
}
}
| [
"Cocanuta@Gmail.com"
] | Cocanuta@Gmail.com |
951548b8771ff837e5c58cb3bfa20cd536bff40a | 093e942f53979299f3e56c9ab1f987e5e91c13ab | /storm-client/src/jvm/org/apache/storm/trident/operation/builtin/MapGet.java | f8ca0e80524d9e0e97cc9b8b69dd53219be71b82 | [
"Apache-2.0",
"GPL-1.0-or-later",
"BSD-3-Clause",
"MIT",
"BSD-2-Clause"
] | permissive | Whale-Storm/Whale | 09bab86ce0b56412bc1b984bb5d47935cf0814aa | 9b3e5e8bffbeefa54c15cd2de7f2fb67f36d64b2 | refs/heads/master | 2022-09-26T10:56:51.916884 | 2020-06-11T08:36:44 | 2020-06-11T08:36:44 | 266,803,131 | 3 | 0 | Apache-2.0 | 2022-09-17T00:00:04 | 2020-05-25T14:39:22 | Java | UTF-8 | Java | false | false | 1,539 | 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.storm.trident.operation.builtin;
import org.apache.storm.tuple.Values;
import java.util.List;
import org.apache.storm.trident.operation.TridentCollector;
import org.apache.storm.trident.state.BaseQueryFunction;
import org.apache.storm.trident.state.map.ReadOnlyMapState;
import org.apache.storm.trident.tuple.TridentTuple;
public class MapGet extends BaseQueryFunction<ReadOnlyMapState, Object> {
@Override
public List<Object> batchRetrieve(ReadOnlyMapState map, List<TridentTuple> keys) {
return map.multiGet((List) keys);
}
@Override
public void execute(TridentTuple tuple, Object result, TridentCollector collector) {
collector.emit(new Values(result));
}
}
| [
"798750509@qq.com"
] | 798750509@qq.com |
d95c767c5d38392891b7c24946ed0a76a3f9ce01 | 45d4617df96a81397289372fc129bb98783ff849 | /project/jcart-administrayion-back-3/src/main/java/io/hqk/jcartadministrayionback/po/ReturnHistory.java | 7b3f4e5d9f8b4b2eea3a4f370c67a636ffe5eba4 | [] | no_license | My-huang/huangqinkai | 99f0df2ed678f98425153561eefdc01eb0057b0d | 959258fb58da70bc7f6ce1a3194efb1d804ec512 | refs/heads/master | 2022-12-22T09:38:15.438809 | 2020-03-19T11:27:34 | 2020-03-19T11:27:34 | 200,996,260 | 0 | 0 | null | 2022-12-16T11:54:14 | 2019-08-07T07:25:42 | JavaScript | UTF-8 | Java | false | false | 1,319 | java | package io.hqk.jcartadministrayionback.po;
import java.util.Date;
public class ReturnHistory {
private Long returnHistoryId;
private Integer returnId;
private Date time;
private Byte returnStatus;
private String comment;
private Boolean customerNotified;
public Long getReturnHistoryId() {
return returnHistoryId;
}
public void setReturnHistoryId(Long returnHistoryId) {
this.returnHistoryId = returnHistoryId;
}
public Integer getReturnId() {
return returnId;
}
public void setReturnId(Integer returnId) {
this.returnId = returnId;
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public Byte getReturnStatus() {
return returnStatus;
}
public void setReturnStatus(Byte returnStatus) {
this.returnStatus = returnStatus;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment == null ? null : comment.trim();
}
public Boolean getCustomerNotified() {
return customerNotified;
}
public void setCustomerNotified(Boolean customerNotified) {
this.customerNotified = customerNotified;
}
} | [
"2725926259@qq.com"
] | 2725926259@qq.com |
7620ada843bafc5dd6437ce01d082c72e8c00754 | c90bddf3367ecbab3e4509bdce682568c4cc8938 | /src/test/java/br/com/alura/repository/CursoRepositoryTest.java | 0cd7e855b5ea4e5ced540715f44f3c31d7c5e71d | [] | no_license | leonardo-teles/forum | 1853fba433c2b5605df0267b63070e665f9b33ed | 54fd7f69233724fff5f539e1b15d4e09d0b0f93d | refs/heads/master | 2023-02-24T11:20:49.237953 | 2021-02-02T04:50:20 | 2021-02-02T04:50:20 | 267,756,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,456 | java | package br.com.alura.repository;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase.Replace;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import br.com.alura.modelo.Curso;
@RunWith(SpringRunner.class)
@DataJpaTest
@AutoConfigureTestDatabase(replace = Replace.NONE)
@ActiveProfiles("test")
public class CursoRepositoryTest {
@Autowired
private CursoRepository repository;
@Autowired
private TestEntityManager em;
@Test
public void deveriaCarregarUmCursoAoBuscarPeloSeuNome() {
String nomeCurso = "HTML 5";
Curso html5 = new Curso();
html5.setNome(nomeCurso);
html5.setCategoria("Programação");
em.persist(html5);
Curso curso = repository.findByNome(nomeCurso);
Assert.assertNotNull(curso);
Assert.assertEquals(nomeCurso, curso.getNome());
}
@Test
public void naoDeveriaCarregarUmCursoCujoNomeNaoEstejaCadastrado() {
String nomeCurso = "JPA";
Curso curso = repository.findByNome(nomeCurso);
Assert.assertNull(curso);
}
}
| [
"leonardo.teles.almeida@gmail.com"
] | leonardo.teles.almeida@gmail.com |
64205defeb27c82432b50288ae52d0b95f8e83c6 | d362e7ba8fee99415fedf762a530156c74ba89db | /Chapter8/Labs/Payroll.java | 67a3c6809c66883a509fb625fbc4e36e4e93bf1c | [] | no_license | evilpegasus/APCS | 5324d97b4598ebae0d9ad89512c443707c194154 | 6b04b0492de4418b74feaacd65df572c2ee85f82 | refs/heads/master | 2020-09-11T11:48:07.974958 | 2020-05-20T23:18:27 | 2020-05-20T23:18:27 | 222,054,169 | 5 | 0 | null | 2020-01-28T16:42:43 | 2019-11-16T05:54:59 | Java | UTF-8 | Java | false | false | 2,310 | java | // ****************************************************************
// Payroll.java
//
// Represents a list of employees.
// ****************************************************************
import java.util.Scanner;
import java.util.*;
import java.io.*;
public class Payroll
{
final int MAX = 30;
Employee[] payroll = new Employee[MAX];
int numEmployees = 0;
// ---------------------------------------------------------
// Reads the list of employee wage data from the given
// file.
// ---------------------------------------------------------
public void readPayrollInfo(String file)
{
String line; // a line in the file
String name; // name of an employee
int hours; // hours worked
double rate; // hourly pay rate
Scanner fileScan, lineScan;
try
{
fileScan = new Scanner (new File(file));
while (fileScan.hasNext())
{
line = fileScan.nextLine();
lineScan = new Scanner(line);
name = lineScan.next ();
try
{
hours = lineScan.nextInt();
rate = lineScan.nextDouble();
payroll[numEmployees] = new Employee (name, hours, rate);
numEmployees++;
}
catch (InputMismatchException exception)
{
System.out.println ("Error in input. Line ignored.");
System.out.println (line);
}
catch {ArrayIndexOutOfBoundsException exception)
{
System.out.println ("Too many employees!");
}
}
fileScan.close();
}
catch (FileNotFoundException exception)
{
System.out.println ("The file " + file + " was not found.");
}
catch (IOException exception)
{
System.out.println (exception);
}
}
// ------------------------------------------
// Returns the number of employees who
// worked over 40 hours; the helper method
// overtime is called to do all the work.
// ------------------------------------------
public int numOvertime ()
{
return overtime (0);
}
// ------------------------------------------------
// Returns the number of employees in the part
// of the list from index start to the end who
// worked more than 40 hours.
// ------------------------------------------------
private int overtime (int start)
{
}
} | [
"mingfong07@hotmail.com"
] | mingfong07@hotmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.