blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
5e3108726223153d53d3f23b90973befc921ab02
7fb29004c64bae6e4abadf38c18fb3fe8f7f1a8a
/compute/src/main/java/org/jclouds/compute/domain/NodeMetadataBuilder.java
1f0671b7ab02f2a6138244b0bacd401f7dac60bf
[ "Apache-2.0" ]
permissive
bastiao/jclouds
10b69a384f0d69a667cc8431ede0969d10f1d834
03db30591d52e8c1a98666bdd356953dccebc92c
refs/heads/master
2021-01-16T01:25:54.541918
2011-05-29T17:42:41
2011-05-29T17:42:41
1,172,036
0
1
null
null
null
null
UTF-8
Java
false
false
5,377
java
/** * * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com> * * ==================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ==================================================================== */ package org.jclouds.compute.domain; import static com.google.common.base.Preconditions.checkNotNull; import java.net.URI; import java.util.Map; import java.util.Set; import javax.annotation.Nullable; import org.jclouds.compute.domain.internal.NodeMetadataImpl; import org.jclouds.domain.Credentials; import org.jclouds.domain.Location; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; /** * @author Adrian Cole */ public class NodeMetadataBuilder extends ComputeMetadataBuilder { private NodeState state; private Set<String> publicAddresses = Sets.newLinkedHashSet(); private Set<String> privateAddresses = Sets.newLinkedHashSet(); @Nullable private String adminPassword; @Nullable private Credentials credentials; @Nullable private String group; private int loginPort = 22; @Nullable private String imageId; @Nullable private Hardware hardware; @Nullable private OperatingSystem os; public NodeMetadataBuilder() { super(ComputeType.NODE); } public NodeMetadataBuilder loginPort(int loginPort) { this.loginPort = loginPort; return this; } public NodeMetadataBuilder state(NodeState state) { this.state = checkNotNull(state, "state"); return this; } public NodeMetadataBuilder publicAddresses(Iterable<String> publicAddresses) { this.publicAddresses = ImmutableSet.copyOf(checkNotNull(publicAddresses, "publicAddresses")); return this; } public NodeMetadataBuilder privateAddresses(Iterable<String> privateAddresses) { this.privateAddresses = ImmutableSet.copyOf(checkNotNull(privateAddresses, "privateAddresses")); return this; } public NodeMetadataBuilder credentials(@Nullable Credentials credentials) { this.credentials = credentials; return this; } public NodeMetadataBuilder adminPassword(@Nullable String adminPassword) { this.adminPassword = adminPassword; return this; } public NodeMetadataBuilder group(@Nullable String group) { this.group = group; return this; } public NodeMetadataBuilder imageId(@Nullable String imageId) { this.imageId = imageId; return this; } public NodeMetadataBuilder hardware(@Nullable Hardware hardware) { this.hardware = hardware; return this; } public NodeMetadataBuilder operatingSystem(@Nullable OperatingSystem os) { this.os = os; return this; } @Override public NodeMetadataBuilder id(String id) { return NodeMetadataBuilder.class.cast(super.id(id)); } @Override public NodeMetadataBuilder tags(Set<String> tags) { return NodeMetadataBuilder.class.cast(super.tags(tags)); } @Override public NodeMetadataBuilder ids(String id) { return NodeMetadataBuilder.class.cast(super.ids(id)); } @Override public NodeMetadataBuilder providerId(String providerId) { return NodeMetadataBuilder.class.cast(super.providerId(providerId)); } @Override public NodeMetadataBuilder name(String name) { return NodeMetadataBuilder.class.cast(super.name(name)); } @Override public NodeMetadataBuilder location(Location location) { return NodeMetadataBuilder.class.cast(super.location(location)); } @Override public NodeMetadataBuilder uri(URI uri) { return NodeMetadataBuilder.class.cast(super.uri(uri)); } @Override public NodeMetadataBuilder userMetadata(Map<String, String> userMetadata) { return NodeMetadataBuilder.class.cast(super.userMetadata(userMetadata)); } @Override public NodeMetadata build() { return new NodeMetadataImpl(providerId, name, id, location, uri, userMetadata, tags, group, hardware, imageId, os, state, loginPort, publicAddresses, privateAddresses, adminPassword, credentials); } public static NodeMetadataBuilder fromNodeMetadata(NodeMetadata node) { return new NodeMetadataBuilder().providerId(node.getProviderId()).name(node.getName()).id(node.getId()).location( node.getLocation()).uri(node.getUri()).userMetadata(node.getUserMetadata()).tags(node.getTags()).group( node.getGroup()).hardware(node.getHardware()).imageId(node.getImageId()).operatingSystem( node.getOperatingSystem()).state(node.getState()).loginPort(node.getLoginPort()).publicAddresses( node.getPublicAddresses()).privateAddresses(node.getPrivateAddresses()).adminPassword( node.getAdminPassword()).credentials(node.getCredentials()); } }
[ "adrian@jclouds.org" ]
adrian@jclouds.org
b88eb11d3514dce2104cf3770cf691425baec275
c3f60f5b4f7bec78a4c34286d487d8a87c255ca5
/19-jms-activemq/activemq/src/main/java/com/helius/producer/TestTopicConsumer.java
e9d3ee8215ed3a78ca6a0d79badec821ffa43e0e
[]
no_license
heliusjing/Demo-Helius
27fa51070c1ea75b9856d605e2ec3da08261cbae
50ee41fd4d363a53f9df7903599b37912b10a7aa
refs/heads/master
2022-06-27T14:18:42.761435
2020-01-31T05:35:17
2020-01-31T05:35:17
237,366,719
0
0
null
2022-06-21T02:43:23
2020-01-31T05:29:56
Java
UTF-8
Java
false
false
2,109
java
package com.helius.producer; import org.apache.activemq.ActiveMQConnectionFactory; import javax.jms.*; /** * @Author jcf * @Create 2020-01-30-15:43 */ public class TestTopicConsumer { public static void main(String[] args) throws Exception { TestTopicConsumer testTopicConsumer = new TestTopicConsumer(); testTopicConsumer.TestTopicConsumer(); } public void TestTopicConsumer() throws Exception { //1、创建工厂连接对象,需要制定ip和端口号 ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://47.100.246.223:61616"); //2、使用连接工厂创建一个连接对象 Connection connection = connectionFactory.createConnection(); //3、开启连接 connection.start(); //4、使用连接对象创建会话(session)对象 Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); //5、使用会话对象创建目标对象,包含queue和topic(一对一和一对多) Topic topic = session.createTopic("test-topic"); //6、使用会话对象创建生产者对象 MessageConsumer consumer = session.createConsumer(topic); //7、向consumer对象中设置一个messageListener对象,用来接收消息 consumer.setMessageListener(new MessageListener() { @Override public void onMessage(Message message) { // TODO Auto-generated method stub if (message instanceof TextMessage) { TextMessage textMessage = (TextMessage) message; try { System.out.println(textMessage.getText()); } catch (JMSException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }); //8、程序等待接收用户消息 System.in.read(); //9、关闭资源 consumer.close(); session.close(); connection.close(); } }
[ "heliusjing@gmail.com" ]
heliusjing@gmail.com
2f3a5b00d596150862451cb7cf5e1a3e70b5c2c8
3fc1908017685b4a642d2ae1ff2cb3af4cb446f9
/java/workspace/JavaCore/src/Lesson8/ReadObj.java
b7e5944754c84fa9636e99395e6be83e162e3665
[]
no_license
avganti1102/TEST
64f7d6246d1d1f48d06594345bedd57fce284637
68cdcc3d7636a818457c659f3ba9a998a4d24cca
refs/heads/master
2023-01-12T00:01:19.335802
2020-11-23T06:13:47
2020-11-23T06:13:47
289,693,486
0
0
null
null
null
null
UTF-8
Java
false
false
589
java
package Lesson8; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; public class ReadObj { public static void main(String[] args) { InputStream is = null; ObjectInputStream ois = null; try { is = new FileInputStream("F:\\test1.txt"); ois = new ObjectInputStream(is); ButLong bl = (ButLong) ois.readObject(); System.out.println(bl.isMuc()); } catch (IOException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } }
[ "avganti1001@gmail.com" ]
avganti1001@gmail.com
2e40813875bc3a3ca62805dc87e4d070300d8d4f
4ae41a632c69f8cae652386b7e8f56dcc60605b9
/src/com/company/tasks/task031/ThreadQueue.java
678f17836a8192191fc62d1423264f2faed22b94
[ "MIT" ]
permissive
zelinskiyrk/ftl-jb-001
b02d9515dc065cb777f659d36cb97d90644e6b88
400be808633ccdb6361f062cdf30e1c5db939d37
refs/heads/master
2022-12-23T11:59:43.776200
2020-09-29T11:14:50
2020-09-29T11:14:50
286,769,239
0
0
MIT
2020-09-29T11:14:51
2020-08-11T14:41:50
Java
UTF-8
Java
false
false
556
java
package com.company.tasks.task031; public class ThreadQueue extends Thread{ private Object lock; public ThreadQueue(Object object) { this.lock = object; } @Override public void run() { while (true) { synchronized (lock) { try { System.out.println(getName()); lock.notify(); lock.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } } }
[ "zelinskiyrk@gmail.com" ]
zelinskiyrk@gmail.com
b84d4ce632cbf97f77faa11b9fb3621ed8357bf2
831effbf51dffed6a6710a2a583aa1bd8d70362e
/src/unidade6/LojaVirtualV2.java
3a400145e2ed43461fd088dc8fec8c467cea9469
[]
no_license
lassulfi/ABCTreinamentos
bf0c04bde7ac003280e614870a876ebbe014356e
cfcacd8d29880c69f4e0f52f9bce06fef072e054
refs/heads/master
2021-04-09T11:00:22.821389
2018-05-27T12:39:10
2018-05-27T12:39:10
125,542,257
0
0
null
null
null
null
UTF-8
Java
false
false
11,458
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 unidade6; import java.awt.Container; import java.awt.GridLayout; import java.nio.file.Path; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JTextField; /** * * @author LuisDaniel */ public class LojaVirtualV2 { //Atributos static Map<Cliente, List<Curso>> pagamentos = new HashMap<>(); static List<Cliente> listaClientes = new ArrayList<>(); static float receitaLoja = 0.0f; static void listarCursos(List<Curso> lista) { //lista.forEach(p -> System.out.println(p.getCdCurso()+"<=>"+p.getNome())); //lista.forEach(System.out::print); } /** * Método que ordena a lista de clientes em ordem alfabética e imprime na * tela para visualização * * @param lista List<Cliente> lista de clientes cadastrados */ static void ordenarClientes(List<Cliente> lista) { lista.stream().sorted((p1, p2) -> p1.getNome().compareTo(p2.getNome())) .forEach(System.out::println); } static void ordernarClientesPorValor(List<Cliente> clientes, Map<Cliente, List<Curso>> matriculas){ //Cálculo do total gasto por cliente matriculas.forEach((cliente, curso) -> { //Zera o total pago cliente.setTotalPago(0.0f); //Calcula a soma do curso gasto por cliente curso.forEach(c -> cliente.setTotalPago(c.getValor())); }); clientes.sort( (Cliente c1, Cliente c2) -> Float.compare(c2.getTotalPago(), c1.getTotalPago())); System.out.println(clientes); } public static void main(String[] args) { JFrame frame = new JFrame("Loja Virtual"); frame.setSize(350, 250); Container container = frame.getContentPane(); JMenuBar barra = new JMenuBar(); JMenu m1 = new JMenu("Clientes"); JMenuItem m11 = new JMenuItem("Novo"); m11.addActionListener(ev ->{ ClienteFrame cFrame = new ClienteFrame("Novo Cliente",listaClientes,1); cFrame.showClienteFrame(); }); JMenuItem m12 = new JMenuItem("Consultar"); m12.addActionListener(ev -> { ClienteFrame cFrame = new ClienteFrame("Consultar cliente", listaClientes, 2); cFrame.showClienteFrame(); }); JMenuItem m13 = new JMenuItem("Alterar"); m13.addActionListener(ev -> { ClienteFrame cframe = new ClienteFrame("Alterar cliente", listaClientes, 3); cframe.showClienteFrame(); }); JMenuItem m14 = new JMenuItem("Excluir"); m1.add(m11); m1.add(m12); m1.add(m13); m1.add(m14); JMenu m2 = new JMenu("Cursos"); JMenuItem m21 = new JMenuItem("Novo"); JMenuItem m22 = new JMenuItem("Consultar"); JMenuItem m23 = new JMenuItem("Alterar"); JMenuItem m24 = new JMenuItem("Excluir"); m2.add(m21); m2.add(m22); m2.add(m23); m2.add(m24); barra.add(m1); barra.add(m2); frame.setJMenuBar(barra); frame.setVisible(true); } private void excluirCliente(){ String idCli = JOptionPane.showInputDialog(null, "Informe a id do cliente"); int id = Integer.valueOf(idCli); listaClientes.remove(id); System.out.println(listaClientes); } } class ClienteFrame{ private String titulo; private JFrame frame; private JTextField id; private JTextField cpf; private JTextField nome; private JTextField email; private JButton confirmar; private JButton sair; private List<Cliente> clientes; private int opcao; ClienteFrame(String titulo, List<Cliente> cliente, int opcao){ this.titulo = titulo; this.clientes = cliente; this.opcao = opcao; //Interface frame = new JFrame(); id = new JTextField(); cpf = new JTextField(); nome = new JTextField(); email = new JTextField(); confirmar = new JButton("Confirmar"); sair = new JButton("Sair"); //Eventos confirmar.addActionListener(ev -> { //Recupera os valores inputados pelo usuário switch (opcao){ case 1: //Adiciona cliente cadastrar(); break; case 3: //Altera o cliente alterar(); break; } }); sair.addActionListener(ev -> { frame.dispose(); }); } public void showClienteFrame(){ switch (opcao){ case 2: String idCliString = JOptionPane.showInputDialog("Informe a id do cliente"); int idCLi = Integer.parseInt(idCliString); Cliente c = clientes.get(idCLi); id.setText(String.valueOf(idCLi)); id.setEnabled(false); nome.setText(c.getNome()); nome.setEnabled(false); cpf.setText(c.getCpf()); cpf.setEnabled(false); email.setText(c.getEmail()); email.setEnabled(false); confirmar.setEnabled(false); break; case 3: idCliString = JOptionPane.showInputDialog("Informe a id do cliente"); idCLi = Integer.parseInt(idCliString); c = clientes.get(idCLi); id.setText(String.valueOf(idCLi)); id.setEnabled(false); nome.setText(c.getNome()); cpf.setText(c.getCpf()); email.setText(c.getEmail()); break; } frame.setTitle(titulo); frame.setSize(350, 250); GridLayout grid = new GridLayout(0, 2, 5, 5); Container cont = frame.getContentPane(); cont.setLayout(grid); cont.add(new JLabel("ID")); cont.add(id); cont.add(new JLabel("CPF:")); cont.add(cpf); cont.add(new JLabel("Nome")); cont.add(nome); cont.add(new JLabel("e-mail")); cont.add(email); cont.add(confirmar); cont.add(sair); frame.show(); } private void cadastrar(){ //Recupera os dados dos elementos String nomeCliente = nome.getText(); String cpfCliente = cpf.getText(); String emailCliente = email.getText(); //Cria um objeto cliente Cliente cliente = new Cliente(cpfCliente, nomeCliente, emailCliente); cliente.setId(); //Adiciona o cliente a lista clientes.add(cliente); JOptionPane.showMessageDialog(null, "Cliente cadastrado com sucesso!"); limparCampos(); //Exibe o cliente exibido System.out.println(clientes.toString()); } private void alterar(){ //Recupera os dados dos elementos int idCliente = Integer.parseInt(id.getText()); String nomeCliente = nome.getText(); String cpfCliente = cpf.getText(); String emailCliente = email.getText(); Cliente cliente = new Cliente(cpfCliente, nomeCliente, emailCliente); clientes.set(idCliente, cliente); JOptionPane.showMessageDialog(null, "Cliente atualizado com sucesso!"); limparCampos(); //Exibe a lista de clientes System.out.println(clientes.toString()); } private void limparCampos(){ id.setText(""); nome.setText(""); cpf.setText(""); email.setText(""); } } class Cliente{ //Atributos private static int id = 0; private String cpf; private String nome; private String email; private float totalPago = 0.0f; //Métodos especiais public Cliente(String cpf, String nome, String email) { this.cpf = cpf; this.nome = nome; this.email = email; } public void setId(){ this.id += 1; } public int getId(){ return id; } public String getNome() { return nome; } public String getEmail(){ return email; } public String getCpf(){ return cpf; } public void setTotalPago(float valorCurso) { this.totalPago += valorCurso; } public float getTotalPago() { return totalPago; } @Override public String toString() { return "Cliente{ id =" + id + "cpf=" + cpf + ", nome=" + nome + ", email=" + email + '}'; } } class Curso { //Atributos private int cdCurso; private String nome; private float valor; private Path url; //Métodos especiais public Curso(int cdCurso, String nome, float valor, Path url) { this.cdCurso = cdCurso; this.nome = nome; this.valor = valor; this.url = url; } public int getCdCurso() { return cdCurso; } public void setCdCurso(int cdCurso) { this.cdCurso = cdCurso; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public float getValor() { return valor; } public void setValor(float valor) { this.valor = valor; } public Path getUrl() { return url; } public void setUrl(Path url) { this.url = url; } @Override public String toString() { return "Curso{" + "cdCurso=" + cdCurso + ", nome=" + nome + ", valor=" + valor + ", url=" + url + '}'; } }
[ "noreply@github.com" ]
noreply@github.com
cf8d6d4adcb9452ff2e64d613849fbb08eac02bd
ebc657175576f14ccee216abc101ed437aedcbf9
/Coud_gateway/src/main/java/com/dailycodebuffer/cloud/gateway/CoudGatewayApplication.java
c45fc6722a26098df08c79290543a30664c30b58
[]
no_license
sadhwanilucky/SpringMicroservices-UserDept_SSL
befb33c08b72f4d6076f5c6dcffe16cf64662cd7
a5a11ad573acfd80674c8550b4317cc30803507b
refs/heads/master
2023-03-05T08:24:36.220945
2021-02-18T07:27:34
2021-02-18T07:27:34
339,953,579
0
0
null
null
null
null
UTF-8
Java
false
false
503
java
package com.dailycodebuffer.cloud.gateway; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.netflix.hystrix.EnableHystrix; @SpringBootApplication @EnableEurekaClient @EnableHystrix public class CoudGatewayApplication { public static void main(String[] args) { SpringApplication.run(CoudGatewayApplication.class, args); } }
[ "sadhwanilucky@gmail.com" ]
sadhwanilucky@gmail.com
58ab18c46e77fc3904f1dbfa4c48d4a8131cacae
82262cdae859ded0f82346ed04ff0f407b18ea6f
/366pai/zeus-core/core-service/src/main/java/com/_360pai/core/provider/asset/AssetFieldItemProvider.java
83d8a8d5db654f9a3e61a886c896782b72ef7901
[]
no_license
dwifdji/real-project
75ec32805f97c6d0d8f0935f7f92902f9509a993
9ddf66dfe0493915b22132781ef121a8d4661ff8
refs/heads/master
2020-12-27T14:01:37.365982
2019-07-26T10:07:27
2019-07-26T10:07:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,464
java
package com._360pai.core.provider.asset; import com._360pai.core.facade.asset.AssetFieldItemFacade; import com._360pai.core.facade.asset.req.AssetFieldItemReq; import com._360pai.core.model.asset.AssetFieldItem; import com._360pai.core.service.asset.AssetFieldItemService; import com.alibaba.dubbo.config.annotation.Service; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * @author zxiao * @Title: AssetFieldItemProvider * @ProjectName zeus-parent * @Description: * @date 2018/8/16 17:20 */ @Component @Service(version = "1.0.0") public class AssetFieldItemProvider implements AssetFieldItemFacade { @Autowired private AssetFieldItemService assetFieldItemService; @Override public int addAssetFieldItem(AssetFieldItemReq req) { AssetFieldItem item = new AssetFieldItem(); BeanUtils.copyProperties(req, item); return assetFieldItemService.insert(item); } @Override public int deleteItem(AssetFieldItemReq req) { AssetFieldItem item = new AssetFieldItem(); BeanUtils.copyProperties(req,item); return assetFieldItemService.delete(item); } @Override public Object updateItem(AssetFieldItemReq req) { AssetFieldItem item = new AssetFieldItem(); BeanUtils.copyProperties(req,item); return assetFieldItemService.update(item); } }
[ "15538068782@163.com" ]
15538068782@163.com
b03a8c26032084014da352e440fc76d8d8c0942b
132a7d3c8816635e414ddfb752246d2a46bff772
/core/src/main/java/com/alibaba/alink/common/sql/builtin/agg/LastDistinctValueUdaf.java
d084b5e594cdfc700819b05f55e95ce821b45869
[ "Apache-2.0" ]
permissive
jackiehff/Alink
8a04f0bb97d79745aa227da28d12a8c900d603cb
c3a3886a55cbcdaa5a1057ce501ccfd2ade2c6b4
refs/heads/master
2023-03-20T20:27:28.455375
2022-11-08T08:14:04
2022-11-08T08:14:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,706
java
package com.alibaba.alink.common.sql.builtin.agg; import org.apache.flink.api.java.tuple.Tuple3; import com.alibaba.alink.common.exceptions.AkIllegalDataException; import com.alibaba.alink.common.sql.builtin.agg.LastDistinctValueUdaf.LastDistinctSaveFirst; import java.sql.Timestamp; public class LastDistinctValueUdaf extends BaseUdaf<Object, LastDistinctSaveFirst> { private double timeInterval = -1; private final boolean considerNull; public LastDistinctValueUdaf() { this.considerNull = false; } public LastDistinctValueUdaf(boolean considerNull) { this.considerNull = considerNull; } public LastDistinctValueUdaf(double timeInterval) { this.timeInterval = timeInterval; this.considerNull = false; } @Override public Object getValue(LastDistinctSaveFirst accumulator) { return accumulator.query(); } @Override public LastDistinctSaveFirst createAccumulator() { if (timeInterval == -1) { return new LastDistinctSaveFirst(-0.001, considerNull);//make sure inside data is -1. } return new LastDistinctSaveFirst(timeInterval, considerNull); } @Override public void accumulate(LastDistinctSaveFirst acc, Object... values) { if (values.length != 4) { throw new AkIllegalDataException(""); } Object key = values[0]; Object value = values[1]; Object eventTime = values[2]; acc.setTimeInterval(Double.parseDouble(values[3].toString())); acc.addOne(key, value, eventTime); acc.setLastKey(key); acc.setLastTime(eventTime); } @Override public void retract(LastDistinctSaveFirst acc, Object... values) { } @Override public void resetAccumulator(LastDistinctSaveFirst acc) { acc.save = null; acc.setLastTime(null); acc.setLastKey(null); } @Override public void merge(LastDistinctSaveFirst acc, Iterable <LastDistinctSaveFirst> it) { } public static class LastDistinctSaveFirst extends LastDistinct { Tuple3 <Object, Object, Object> save = null; private Object lastKey; private Object lastTime; private final boolean considerNull; public void setLastKey(Object lastKey) { this.lastKey = lastKey; } public void setLastTime(Object lastTime) { this.lastTime = lastTime; } public LastDistinctSaveFirst(double timeInterval, boolean considerNull) { super(timeInterval * 1000); this.considerNull = considerNull; } public void setTimeInterval(double timeInterval) { if (timeInterval == -1) { this.timeInterval = -1; } else { this.timeInterval = timeInterval * 1000; } } @Override public void addOne(Object key, Object value, Object eventTime) { //when query, if current key is null, it can query; besides, it can ignore null value. if (key == null && !this.considerNull) { return; } if (save != null) { super.addOne(save.f0, save.f1, save.f2); } save = Tuple3.of(key, value, eventTime); } public Object query() { if (lastTime instanceof Timestamp) { return query(lastKey, ((Timestamp) lastTime).getTime()); } else { return query(lastKey, (long) lastTime); } } } public static class LastDistinct { //key, value, time Tuple3 <Object, Object, Double> firstObj; Tuple3 <Object, Object, Double> secondObj; public double timeInterval;//the metric is ms. public LastDistinct(double timeInterval) { this.timeInterval = timeInterval; } void addOne(Object key, Object value, double currentTime) { Tuple3<Object, Object, Double> currentNode = Tuple3.of(key, value, currentTime); if (firstObj == null) { firstObj = currentNode; } else if (secondObj == null) { secondObj = currentNode; } else { if (secondObj.f0 != key || firstObj.f0 == key) { firstObj = secondObj; } secondObj = currentNode; } } Object query(Object key, double currentTime) { if (secondObj != null) { if (secondObj.f0 == key) { if (!(firstObj.f0 == key) && (timeInterval == -1 || currentTime - firstObj.f2 <= timeInterval)) { return firstObj.f1; } else { return null; } } else { if (timeInterval == -1 || currentTime - secondObj.f2 <= timeInterval) { return secondObj.f1; } else { return null; } } } else { if (firstObj != null && !(firstObj.f0 == key) && (timeInterval == -1 || currentTime - firstObj.f2 <= timeInterval)) { return firstObj.f1; } else { return null; } } } public void addOne(Object key, Object value, Object currentTime) { if (currentTime instanceof Timestamp) { addOne(key, value, ((Timestamp) currentTime).getTime()); } else { addOne(key, value, (long) currentTime); } } public Object query(Object key, Object currentTime) { if (currentTime instanceof Timestamp) { return query(key, ((Timestamp) currentTime).getTime()); } else { return query(key, (long) currentTime); } } @Override public boolean equals(Object o) { if (!(o instanceof LastDistinct)) { return false; } Tuple3 <Object, Object, Double> otherFirst = ((LastDistinct) o).firstObj; Tuple3 <Object, Object, Double> otherSecond = ((LastDistinct) o).secondObj; return AggUtil.judgeNull(firstObj, otherFirst, LastDistinct::judgeTuple) && AggUtil.judgeNull(secondObj, otherSecond, LastDistinct::judgeTuple); } private static boolean judgeTuple(Object a, Object b) { Tuple3 <Object, Object, Double> ta = (Tuple3 <Object, Object, Double>) a; Tuple3 <Object, Object, Double> tb = (Tuple3 <Object, Object, Double>) b; return AggUtil.judgeNull(ta.f0, tb.f0, AggUtil::simpleJudgeEqual) && AggUtil.judgeNull(ta.f1, tb.f1, AggUtil::simpleJudgeEqual) && AggUtil.judgeNull(ta.f2, tb.f2, AggUtil::simpleJudgeEqual); } } }
[ "shaomeng.wang.w@gmail.com" ]
shaomeng.wang.w@gmail.com
3569920f6b349c952f478c2e9bb80744a584bc5a
426649a31ff5609d06d1979b043117fdb40f3400
/Chapter16/LoggingDemo.java
d0fcb1ae37599160fd4888b691fa5e13285b77f8
[]
no_license
TimSongCoder/LearnJavaForAndroid
bb1accae555aea02f211712f42e2166bd39ccdb6
54c580d08ed59e9d1e2242de6ff59feb0ffb1266
refs/heads/master
2021-06-10T09:19:56.998578
2017-02-12T08:23:48
2017-02-12T08:23:48
70,450,482
0
2
null
null
null
null
UTF-8
Java
false
false
460
java
import java.util.logging.Logger; import java.util.logging.Level; public class LoggingDemo{ public static void main(String[] args) { Logger logger = Logger.getLogger("LoggingDemo"); for (int i=0; i<5; i++) { logger.log(Level.INFO, String.valueOf(i)); } System.out.println(); logWarning("Something weird has happened..."); } static void logWarning(String msg){ Logger.getLogger("LoggingDemo").log(Level.WARNING, msg); } }
[ "timmy_song@163.com" ]
timmy_song@163.com
8a54a041eb8723ef2965448ffc1ff5721e95bbd6
5cbec2c253913285476d1e323c3e766dac23aaae
/LocationShare/gen/com/google/android/gms/R.java
5e728671e3a487c9432d3954834913104bc2b886
[]
no_license
aareano/LocationShare
674c306061d8d7190baedf8ba7a0ba34706bf328
9acc824ec4351f9edd4ff8f1d3b21b06030bbb7f
refs/heads/master
2021-01-16T02:42:56.561041
2015-01-10T18:53:13
2015-01-10T18:53:13
29,067,310
0
1
null
null
null
null
UTF-8
Java
false
false
13,620
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.google.android.gms; public final class R { public static final class attr { public static final int adSize = 0x7f010000; public static final int adSizes = 0x7f010001; public static final int adUnitId = 0x7f010002; public static final int appTheme = 0x7f010011; public static final int buyButtonAppearance = 0x7f010018; public static final int buyButtonHeight = 0x7f010015; public static final int buyButtonText = 0x7f010017; public static final int buyButtonWidth = 0x7f010016; public static final int cameraBearing = 0x7f010004; public static final int cameraTargetLat = 0x7f010005; public static final int cameraTargetLng = 0x7f010006; public static final int cameraTilt = 0x7f010007; public static final int cameraZoom = 0x7f010008; public static final int environment = 0x7f010012; public static final int fragmentMode = 0x7f010014; public static final int fragmentStyle = 0x7f010013; public static final int mapType = 0x7f010003; public static final int maskedWalletDetailsBackground = 0x7f01001b; public static final int maskedWalletDetailsButtonBackground = 0x7f01001d; public static final int maskedWalletDetailsButtonTextAppearance = 0x7f01001c; public static final int maskedWalletDetailsHeaderTextAppearance = 0x7f01001a; public static final int maskedWalletDetailsLogoImageType = 0x7f01001f; public static final int maskedWalletDetailsLogoTextColor = 0x7f01001e; public static final int maskedWalletDetailsTextAppearance = 0x7f010019; public static final int uiCompass = 0x7f010009; public static final int uiRotateGestures = 0x7f01000a; public static final int uiScrollGestures = 0x7f01000b; public static final int uiTiltGestures = 0x7f01000c; public static final int uiZoomControls = 0x7f01000d; public static final int uiZoomGestures = 0x7f01000e; public static final int useViewLifecycle = 0x7f01000f; public static final int zOrderOnTop = 0x7f010010; } public static final class color { public static final int common_action_bar_splitter = 0x7f070009; public static final int common_signin_btn_dark_text_default = 0x7f070000; public static final int common_signin_btn_dark_text_disabled = 0x7f070002; public static final int common_signin_btn_dark_text_focused = 0x7f070003; public static final int common_signin_btn_dark_text_pressed = 0x7f070001; public static final int common_signin_btn_default_background = 0x7f070008; public static final int common_signin_btn_light_text_default = 0x7f070004; public static final int common_signin_btn_light_text_disabled = 0x7f070006; public static final int common_signin_btn_light_text_focused = 0x7f070007; public static final int common_signin_btn_light_text_pressed = 0x7f070005; public static final int common_signin_btn_text_dark = 0x7f070051; public static final int common_signin_btn_text_light = 0x7f070052; public static final int wallet_bright_foreground_disabled_holo_light = 0x7f07000f; public static final int wallet_bright_foreground_holo_dark = 0x7f07000a; public static final int wallet_bright_foreground_holo_light = 0x7f070010; public static final int wallet_dim_foreground_disabled_holo_dark = 0x7f07000c; public static final int wallet_dim_foreground_holo_dark = 0x7f07000b; public static final int wallet_dim_foreground_inverse_disabled_holo_dark = 0x7f07000e; public static final int wallet_dim_foreground_inverse_holo_dark = 0x7f07000d; public static final int wallet_highlighted_text_holo_dark = 0x7f070014; public static final int wallet_highlighted_text_holo_light = 0x7f070013; public static final int wallet_hint_foreground_holo_dark = 0x7f070012; public static final int wallet_hint_foreground_holo_light = 0x7f070011; public static final int wallet_holo_blue_light = 0x7f070015; public static final int wallet_link_text_light = 0x7f070016; public static final int wallet_primary_text_holo_light = 0x7f070053; public static final int wallet_secondary_text_holo_dark = 0x7f070054; } public static final class drawable { public static final int common_full_open_on_phone = 0x7f020033; public static final int common_ic_googleplayservices = 0x7f020034; public static final int common_signin_btn_icon_dark = 0x7f020035; public static final int common_signin_btn_icon_disabled_dark = 0x7f020036; public static final int common_signin_btn_icon_disabled_focus_dark = 0x7f020037; public static final int common_signin_btn_icon_disabled_focus_light = 0x7f020038; public static final int common_signin_btn_icon_disabled_light = 0x7f020039; public static final int common_signin_btn_icon_focus_dark = 0x7f02003a; public static final int common_signin_btn_icon_focus_light = 0x7f02003b; public static final int common_signin_btn_icon_light = 0x7f02003c; public static final int common_signin_btn_icon_normal_dark = 0x7f02003d; public static final int common_signin_btn_icon_normal_light = 0x7f02003e; public static final int common_signin_btn_icon_pressed_dark = 0x7f02003f; public static final int common_signin_btn_icon_pressed_light = 0x7f020040; public static final int common_signin_btn_text_dark = 0x7f020041; public static final int common_signin_btn_text_disabled_dark = 0x7f020042; public static final int common_signin_btn_text_disabled_focus_dark = 0x7f020043; public static final int common_signin_btn_text_disabled_focus_light = 0x7f020044; public static final int common_signin_btn_text_disabled_light = 0x7f020045; public static final int common_signin_btn_text_focus_dark = 0x7f020046; public static final int common_signin_btn_text_focus_light = 0x7f020047; public static final int common_signin_btn_text_light = 0x7f020048; public static final int common_signin_btn_text_normal_dark = 0x7f020049; public static final int common_signin_btn_text_normal_light = 0x7f02004a; public static final int common_signin_btn_text_pressed_dark = 0x7f02004b; public static final int common_signin_btn_text_pressed_light = 0x7f02004c; public static final int ic_plusone_medium_off_client = 0x7f020050; public static final int ic_plusone_small_off_client = 0x7f020051; public static final int ic_plusone_standard_off_client = 0x7f020052; public static final int ic_plusone_tall_off_client = 0x7f020053; public static final int powered_by_google_dark = 0x7f020054; public static final int powered_by_google_light = 0x7f020055; } public static final class id { public static final int book_now = 0x7f0b0017; public static final int buyButton = 0x7f0b0013; public static final int buy_now = 0x7f0b0018; public static final int buy_with_google = 0x7f0b0019; public static final int classic = 0x7f0b001a; public static final int grayscale = 0x7f0b001b; public static final int holo_dark = 0x7f0b000e; public static final int holo_light = 0x7f0b000f; public static final int hybrid = 0x7f0b0009; public static final int match_parent = 0x7f0b0015; public static final int monochrome = 0x7f0b001c; public static final int none = 0x7f0b000a; public static final int normal = 0x7f0b000b; public static final int production = 0x7f0b0010; public static final int sandbox = 0x7f0b0011; public static final int satellite = 0x7f0b000c; public static final int selectionDetails = 0x7f0b0014; public static final int strict_sandbox = 0x7f0b0012; public static final int terrain = 0x7f0b000d; public static final int wrap_content = 0x7f0b0016; } public static final class integer { public static final int google_play_services_version = 0x7f080000; } public static final class string { public static final int accept = 0x7f060002; public static final int common_android_wear_notification_needs_update_text = 0x7f060009; public static final int common_android_wear_update_text = 0x7f060016; public static final int common_android_wear_update_title = 0x7f060014; public static final int common_google_play_services_enable_button = 0x7f060012; public static final int common_google_play_services_enable_text = 0x7f060011; public static final int common_google_play_services_enable_title = 0x7f060010; public static final int common_google_play_services_error_notification_requested_by_msg = 0x7f06000b; public static final int common_google_play_services_install_button = 0x7f06000f; public static final int common_google_play_services_install_text_phone = 0x7f06000d; public static final int common_google_play_services_install_text_tablet = 0x7f06000e; public static final int common_google_play_services_install_title = 0x7f06000c; public static final int common_google_play_services_invalid_account_text = 0x7f06001a; public static final int common_google_play_services_invalid_account_title = 0x7f060019; public static final int common_google_play_services_needs_enabling_title = 0x7f06000a; public static final int common_google_play_services_network_error_text = 0x7f060018; public static final int common_google_play_services_network_error_title = 0x7f060017; public static final int common_google_play_services_notification_needs_installation_title = 0x7f060007; public static final int common_google_play_services_notification_needs_update_title = 0x7f060008; public static final int common_google_play_services_notification_ticker = 0x7f060006; public static final int common_google_play_services_unknown_issue = 0x7f06001b; public static final int common_google_play_services_unsupported_text = 0x7f06001d; public static final int common_google_play_services_unsupported_title = 0x7f06001c; public static final int common_google_play_services_update_button = 0x7f06001e; public static final int common_google_play_services_update_text = 0x7f060015; public static final int common_google_play_services_update_title = 0x7f060013; public static final int common_open_on_phone = 0x7f060021; public static final int common_signin_button_text = 0x7f06001f; public static final int common_signin_button_text_long = 0x7f060020; public static final int create_calendar_message = 0x7f060005; public static final int create_calendar_title = 0x7f060004; public static final int decline = 0x7f060003; public static final int store_picture_message = 0x7f060001; public static final int store_picture_title = 0x7f060000; public static final int wallet_buy_button_place_holder = 0x7f060022; } public static final class style { public static final int Theme_IAPTheme = 0x7f050000; public static final int WalletFragmentDefaultButtonTextAppearance = 0x7f050003; public static final int WalletFragmentDefaultDetailsHeaderTextAppearance = 0x7f050002; public static final int WalletFragmentDefaultDetailsTextAppearance = 0x7f050001; public static final int WalletFragmentDefaultStyle = 0x7f050004; } public static final class styleable { public static final int[] AdsAttrs = { 0x7f010000, 0x7f010001, 0x7f010002 }; public static final int AdsAttrs_adSize = 0; public static final int AdsAttrs_adSizes = 1; public static final int AdsAttrs_adUnitId = 2; public static final int[] MapAttrs = { 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010 }; public static final int MapAttrs_cameraBearing = 1; public static final int MapAttrs_cameraTargetLat = 2; public static final int MapAttrs_cameraTargetLng = 3; public static final int MapAttrs_cameraTilt = 4; public static final int MapAttrs_cameraZoom = 5; public static final int MapAttrs_mapType = 0; public static final int MapAttrs_uiCompass = 6; public static final int MapAttrs_uiRotateGestures = 7; public static final int MapAttrs_uiScrollGestures = 8; public static final int MapAttrs_uiTiltGestures = 9; public static final int MapAttrs_uiZoomControls = 10; public static final int MapAttrs_uiZoomGestures = 11; public static final int MapAttrs_useViewLifecycle = 12; public static final int MapAttrs_zOrderOnTop = 13; public static final int[] WalletFragmentOptions = { 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014 }; public static final int WalletFragmentOptions_appTheme = 0; public static final int WalletFragmentOptions_environment = 1; public static final int WalletFragmentOptions_fragmentMode = 3; public static final int WalletFragmentOptions_fragmentStyle = 2; public static final int[] WalletFragmentStyle = { 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001c, 0x7f01001d, 0x7f01001e, 0x7f01001f }; public static final int WalletFragmentStyle_buyButtonAppearance = 3; public static final int WalletFragmentStyle_buyButtonHeight = 0; public static final int WalletFragmentStyle_buyButtonText = 2; public static final int WalletFragmentStyle_buyButtonWidth = 1; public static final int WalletFragmentStyle_maskedWalletDetailsBackground = 6; public static final int WalletFragmentStyle_maskedWalletDetailsButtonBackground = 8; public static final int WalletFragmentStyle_maskedWalletDetailsButtonTextAppearance = 7; public static final int WalletFragmentStyle_maskedWalletDetailsHeaderTextAppearance = 5; public static final int WalletFragmentStyle_maskedWalletDetailsLogoImageType = 10; public static final int WalletFragmentStyle_maskedWalletDetailsLogoTextColor = 9; public static final int WalletFragmentStyle_maskedWalletDetailsTextAppearance = 4; } }
[ "aaron.bwn@gmail.com" ]
aaron.bwn@gmail.com
5c4664e7563393212bfc266496ed4aa81dd1d495
5fa9cca0d0a35ac1fd6510c1384347fce36bba6f
/src/main/java/com/demo/ui/test/android/AndroidNavigationUI.java
7aa1642a103ac2c77714b9584efbd0b6a2da71de
[]
no_license
rodionovmax/demo-wiki_ios_android_mobile_web
ffbbd81ce7f3a9bb80ae035c4b3b722a47a3f4a5
5fd460cbf2ca3246a2c3bb43ca16658275d5560d
refs/heads/master
2023-05-11T00:01:32.819165
2019-11-12T04:32:34
2019-11-12T04:32:34
219,408,871
0
0
null
2023-05-09T18:17:01
2019-11-04T03:22:28
JavaScript
UTF-8
Java
false
false
426
java
package com.demo.ui.test.android; import com.demo.ui.test.pageobjects.NavigationUI; import org.openqa.selenium.By; import org.openqa.selenium.remote.RemoteWebDriver; public class AndroidNavigationUI extends NavigationUI { static { MY_LISTS_LINK = By.xpath("//android.widget.FrameLayout[@content-desc='My lists']"); } public AndroidNavigationUI(RemoteWebDriver driver) { super(driver); } }
[ "rodionovmax90test@gmail.com" ]
rodionovmax90test@gmail.com
0b6d4bb9d9955793997d87cea36e30bd4fa89acf
72b417006992010cbbfeaa250ee6bc2ae0991c03
/FarmaciaDAEMavenBackup/src/main/java/webservice/service/SecurityInterceptor.java
3360cd00db7884325fb4aa1af3dc646bd154b787
[]
no_license
godmack/yolo-swag-meisters
4a6c7596b3204450d2c4c6a1aa8d68e611b99aaf
6dd327563a16de90cc6d47fc02c1196ed32303d3
refs/heads/master
2021-01-22T11:46:57.447575
2015-01-05T14:02:44
2015-01-05T14:02:44
25,475,043
0
0
null
null
null
null
UTF-8
Java
false
false
970
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 pt.ipleiria.estg.mcm.iaupss.webservice.service; import java.io.IOException; import javax.ws.rs.HttpMethod; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.container.ContainerRequestFilter; import javax.ws.rs.ext.Provider; import org.jboss.resteasy.annotations.interception.ServerInterceptor; /** * This interceptor verify the access permissions for a user based on username * and passowrd provided in request * */ @Provider @ServerInterceptor public class SecurityInterceptor implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { if(requestContext.getMethod().equals(HttpMethod.OPTIONS)){ return; } } }
[ "2110112@my.ipleiria.pt" ]
2110112@my.ipleiria.pt
7c852bbde7f57a6f4fc6df225ecd9dc5786e4d98
282eebd1d6db7b81155c942160ecc0a579215375
/datacenter-simulation/src/main/java/vn/edu/hust/simulation/algos/myalgo/myheuristic/FactorOperators.java
80a67049f67040a2e79a5a3eb880db3488aa8ac3
[]
no_license
quangkhanh250699/task-scheduling-in-cloud-computing
65898a68b29836c8699770f3cb98c71b68e5bd30
e64b70e34d51d57a22d560e8237e62a6f449d69c
refs/heads/main
2023-06-17T21:06:36.527423
2021-07-23T02:41:05
2021-07-23T02:41:05
381,648,686
0
0
null
null
null
null
UTF-8
Java
false
false
178
java
package vn.edu.hust.simulation.algos.myalgo.myheuristic; public class FactorOperators { public static Double product(Double[] x, Double[] y) { return null; } }
[ "quangkhanh250699@gmail.com" ]
quangkhanh250699@gmail.com
9b3982566b801b1dd334d4bda6f5a5c9c45c41c9
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
/JFreeChart/rev91-775/right-trunk-775/source/org/jfree/data/xy/DefaultTableXYDataset.java
b5cd31fde85fbeb2032af394e380f150268802ab
[]
no_license
joliebig/featurehouse_fstmerge_examples
af1b963537839d13e834f829cf51f8ad5e6ffe76
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
refs/heads/master
2016-09-05T10:24:50.974902
2013-03-28T16:28:47
2013-03-28T16:28:47
9,080,611
3
2
null
null
null
null
UTF-8
Java
false
false
10,056
java
package org.jfree.data.xy; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; import org.jfree.chart.util.ObjectUtilities; import org.jfree.data.DomainInfo; import org.jfree.data.Range; import org.jfree.data.general.DatasetChangeEvent; import org.jfree.data.general.DatasetUtilities; import org.jfree.data.general.SeriesChangeEvent; public class DefaultTableXYDataset extends AbstractIntervalXYDataset implements TableXYDataset, IntervalXYDataset, DomainInfo { private List data = null; private HashSet xPoints = null; private boolean propagateEvents = true; private boolean autoPrune = false; private IntervalXYDelegate intervalDelegate; public DefaultTableXYDataset() { this(false); } public DefaultTableXYDataset(boolean autoPrune) { this.autoPrune = autoPrune; this.data = new ArrayList(); this.xPoints = new HashSet(); this.intervalDelegate = new IntervalXYDelegate(this, false); addChangeListener(this.intervalDelegate); } public boolean isAutoPrune() { return this.autoPrune; } public void addSeries(XYSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } if (series.getAllowDuplicateXValues()) { throw new IllegalArgumentException( "Cannot accept XYSeries that allow duplicate values. " + "Use XYSeries(seriesName, <sort>, false) constructor." ); } updateXPoints(series); this.data.add(series); series.addChangeListener(this); fireDatasetChanged(); } private void updateXPoints(XYSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' not permitted."); } HashSet seriesXPoints = new HashSet(); boolean savedState = this.propagateEvents; this.propagateEvents = false; for (int itemNo = 0; itemNo < series.getItemCount(); itemNo++) { Number xValue = series.getX(itemNo); seriesXPoints.add(xValue); if (!this.xPoints.contains(xValue)) { this.xPoints.add(xValue); int seriesCount = this.data.size(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { XYSeries dataSeries = (XYSeries) this.data.get(seriesNo); if (!dataSeries.equals(series)) { dataSeries.add(xValue, null); } } } } Iterator iterator = this.xPoints.iterator(); while (iterator.hasNext()) { Number xPoint = (Number) iterator.next(); if (!seriesXPoints.contains(xPoint)) { series.add(xPoint, null); } } this.propagateEvents = savedState; } public void updateXPoints() { this.propagateEvents = false; for (int s = 0; s < this.data.size(); s++) { updateXPoints((XYSeries) this.data.get(s)); } if (this.autoPrune) { prune(); } this.propagateEvents = true; } public int getSeriesCount() { return this.data.size(); } public int getItemCount() { if (this.xPoints == null) { return 0; } else { return this.xPoints.size(); } } public XYSeries getSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Index outside valid range."); } return (XYSeries) this.data.get(series); } public Comparable getSeriesKey(int series) { return getSeries(series).getKey(); } public int getItemCount(int series) { return getSeries(series).getItemCount(); } public Number getX(int series, int item) { XYSeries s = (XYSeries) this.data.get(series); XYDataItem dataItem = s.getDataItem(item); return dataItem.getX(); } public Number getStartX(int series, int item) { return this.intervalDelegate.getStartX(series, item); } public Number getEndX(int series, int item) { return this.intervalDelegate.getEndX(series, item); } public Number getY(int series, int index) { XYSeries ts = (XYSeries) this.data.get(series); XYDataItem dataItem = ts.getDataItem(index); return dataItem.getY(); } public Number getStartY(int series, int item) { return getY(series, item); } public Number getEndY(int series, int item) { return getY(series, item); } public void removeAllSeries() { for (int i = 0; i < this.data.size(); i++) { XYSeries series = (XYSeries) this.data.get(i); series.removeChangeListener(this); } this.data.clear(); this.xPoints.clear(); fireDatasetChanged(); } public void removeSeries(XYSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } if (this.data.contains(series)) { series.removeChangeListener(this); this.data.remove(series); if (this.data.size() == 0) { this.xPoints.clear(); } fireDatasetChanged(); } } public void removeSeries(int series) { if ((series < 0) || (series > getSeriesCount())) { throw new IllegalArgumentException("Index outside valid range."); } XYSeries s = (XYSeries) this.data.get(series); s.removeChangeListener(this); this.data.remove(series); if (this.data.size() == 0) { this.xPoints.clear(); } else if (this.autoPrune) { prune(); } fireDatasetChanged(); } public void removeAllValuesForX(Number x) { if (x == null) { throw new IllegalArgumentException("Null 'x' argument."); } boolean savedState = this.propagateEvents; this.propagateEvents = false; for (int s = 0; s < this.data.size(); s++) { XYSeries series = (XYSeries) this.data.get(s); series.remove(x); } this.propagateEvents = savedState; this.xPoints.remove(x); fireDatasetChanged(); } protected boolean canPrune(Number x) { for (int s = 0; s < this.data.size(); s++) { XYSeries series = (XYSeries) this.data.get(s); if (series.getY(series.indexOf(x)) != null) { return false; } } return true; } public void prune() { HashSet hs = (HashSet) this.xPoints.clone(); Iterator iterator = hs.iterator(); while (iterator.hasNext()) { Number x = (Number) iterator.next(); if (canPrune(x)) { removeAllValuesForX(x); } } } public void seriesChanged(SeriesChangeEvent event) { if (this.propagateEvents) { updateXPoints(); fireDatasetChanged(); } } public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DefaultTableXYDataset)) { return false; } DefaultTableXYDataset that = (DefaultTableXYDataset) obj; if (this.autoPrune != that.autoPrune) { return false; } if (this.propagateEvents != that.propagateEvents) { return false; } if (!this.intervalDelegate.equals(that.intervalDelegate)) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true; } public int hashCode() { int result; result = (this.data != null ? this.data.hashCode() : 0); result = 29 * result + (this.xPoints != null ? this.xPoints.hashCode() : 0); result = 29 * result + (this.propagateEvents ? 1 : 0); result = 29 * result + (this.autoPrune ? 1 : 0); return result; } public double getDomainLowerBound(boolean includeInterval) { return this.intervalDelegate.getDomainLowerBound(includeInterval); } public double getDomainUpperBound(boolean includeInterval) { return this.intervalDelegate.getDomainUpperBound(includeInterval); } public Range getDomainBounds(boolean includeInterval) { if (includeInterval) { return this.intervalDelegate.getDomainBounds(includeInterval); } else { return DatasetUtilities.iterateDomainBounds(this, includeInterval); } } public double getIntervalPositionFactor() { return this.intervalDelegate.getIntervalPositionFactor(); } public void setIntervalPositionFactor(double d) { this.intervalDelegate.setIntervalPositionFactor(d); fireDatasetChanged(); } public double getIntervalWidth() { return this.intervalDelegate.getIntervalWidth(); } public void setIntervalWidth(double d) { this.intervalDelegate.setFixedIntervalWidth(d); fireDatasetChanged(); } public boolean isAutoWidth() { return this.intervalDelegate.isAutoWidth(); } public void setAutoWidth(boolean b) { this.intervalDelegate.setAutoWidth(b); fireDatasetChanged(); } }
[ "joliebig@fim.uni-passau.de" ]
joliebig@fim.uni-passau.de
304bd21682ec4facd1ce5860ff48b4b36a0b624d
d69a59901fa22b2d0183d6d1686276f701e136d4
/src/main/java/com/emc/vipr/sync/model/object/AtmosSyncObject.java
8a2028f86d3f287cadcbf03ae02dc5330e09e5ed
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Seven10Storage/ecs-sync
e07170f646384966ae7be3826466a52860522a31
24414ff4dacb3617a54cab7c8f85533e81c47c3d
refs/heads/master
2020-02-26T14:32:44.211165
2015-07-28T16:06:12
2015-07-28T16:06:12
46,522,582
0
0
null
2015-11-19T21:51:12
2015-11-19T21:51:12
null
UTF-8
Java
false
false
3,829
java
/* * Copyright 2015 EMC Corporation. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * or in the "license" file accompanying this file. This file 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.emc.vipr.sync.model.object; import com.emc.atmos.api.AtmosApi; import com.emc.atmos.api.ObjectIdentifier; import com.emc.atmos.api.ObjectPath; import com.emc.atmos.api.bean.ObjectInfo; import com.emc.atmos.api.bean.ObjectMetadata; import com.emc.atmos.api.bean.ReadObjectResponse; import com.emc.vipr.sync.SyncPlugin; import com.emc.vipr.sync.model.AtmosMetadata; import com.emc.vipr.sync.source.AtmosSource; import com.emc.vipr.sync.util.Function; import com.emc.vipr.sync.util.TimingUtil; import java.io.InputStream; /** * Encapsulates the information needed for reading from Atmos and does * some lazy loading of data. */ public class AtmosSyncObject extends AbstractSyncObject<ObjectIdentifier> { private SyncPlugin parentPlugin; private AtmosApi atmos; public AtmosSyncObject(SyncPlugin parentPlugin, AtmosApi atmos, ObjectIdentifier sourceId, String relativePath) { super(sourceId, sourceId.toString(), relativePath, sourceId instanceof ObjectPath && ((ObjectPath) sourceId).isDirectory()); this.parentPlugin = parentPlugin; this.atmos = atmos; } @Override public InputStream createSourceInputStream() { if (isDirectory()) return null; return TimingUtil.time(parentPlugin, AtmosSource.OPERATION_GET_OBJECT_STREAM, new Function<ReadObjectResponse<InputStream>>() { @Override public ReadObjectResponse<InputStream> call() { return atmos.readObjectStream(getRawSourceIdentifier(), null); } }).getObject(); } // HEAD object in Atmos @Override protected void loadObject() { // deal with root of namespace if ("/".equals(getSourceIdentifier())) { this.metadata = new AtmosMetadata(); return; } AtmosMetadata metadata = AtmosMetadata.fromObjectMetadata(TimingUtil.time(parentPlugin, AtmosSource.OPERATION_GET_ALL_META, new Function<ObjectMetadata>() { @Override public ObjectMetadata call() { return atmos.getObjectMetadata(getRawSourceIdentifier()); } })); this.metadata = metadata; if (isDirectory()) { metadata.setSize(0); } else { // GET ?info will give use retention/expiration if (parentPlugin.isIncludeRetentionExpiration()) { ObjectInfo info = TimingUtil.time(parentPlugin, AtmosSource.OPERATION_GET_OBJECT_INFO, new Function<ObjectInfo>() { @Override public ObjectInfo call() { return atmos.getObjectInfo(getRawSourceIdentifier()); } }); if (info.getRetention() != null) { metadata.setRetentionEnabled(info.getRetention().isEnabled()); metadata.setRetentionEndDate(info.getRetention().getEndAt()); } if (info.getExpiration() != null) { metadata.setExpirationDate(info.getExpiration().getEndAt()); } } } } }
[ "twincitiesguy@gmail.com" ]
twincitiesguy@gmail.com
e8cdd144370cbd46f7f26c83f9d84447c7b8fba2
b0a3c27f71a56cfb56622286b7c2760d31efec62
/src/main/java/com/example/ktz/algorithm/graph/Ex05.java
273b7cfbcc4dad335d2f5b2213ef07de98284ef7
[]
no_license
ktz-study-repo/java_study
2604fd0e6f122c35754ba01acf2150f5a50a64e1
30b3ee8e302358aac9a0015b37c9466db4379ca0
refs/heads/master
2020-06-25T16:55:19.127927
2018-02-17T08:17:46
2018-02-17T08:17:46
96,978,276
0
0
null
null
null
null
UTF-8
Java
false
false
822
java
package com.example.ktz.algorithm.graph; public class Ex05 { public static void main(String[] args) { BTree<Integer> root = new BTree<Integer>(10); BTree<Integer> item1_1 = new BTree<Integer>(1); BTree<Integer> item1_2 = new BTree<Integer>(12); BTree<Integer> item2_1 = new BTree<Integer>(11); root.left = item1_1; root.right = item1_2; item1_2.left = item2_1; System.out.println(checkBST(root)); } public static boolean checkBST(BTree<Integer> root) { if(root == null) return true; else if ((root.left == null || root.left.value < root.value) && (root.right == null || root.right.value > root.value)){ return checkBST(root.left) && checkBST(root.right); } else return false; } }
[ "knightpop@gmail.com" ]
knightpop@gmail.com
912f96feb02f56bb08daa427acbce674bfc3c2ec
29b0b9d5489bc6b8fe9013bfa02b461fd46172db
/backend-utils/src/main/java/com/mooc/meetingfilm/utils/common/vo/BasePageVO.java
d9870d42083d3af91f2be3abf5612fa886933167
[]
no_license
ZZJNotes/meetingfilm
e6177c71b8d6109ef10352e679a61d3b16fb7e03
37442f5dfe60235a10d729d6ab485af1f3c4fa97
refs/heads/master
2023-01-02T17:08:37.405491
2020-10-16T05:07:41
2020-10-16T05:07:41
301,160,775
0
0
null
null
null
null
UTF-8
Java
false
false
734
java
package com.mooc.meetingfilm.utils.common.vo; import com.mooc.meetingfilm.utils.exception.CommonServiceException; import com.mooc.meetingfilm.utils.util.ToolUtils; import lombok.Data; /** * @author : jiangzh * @program : com.mooc.meetingfilm.utils.common.vo * @description : 分页请求类 **/ @Data public class BasePageVO extends BaseRequestVO { private Integer nowPage = 1; private Integer pageSize = 10; @Override public void checkParam() throws CommonServiceException { // TODO nowpage和pageSize不能为空 balaba if (ToolUtils.strIsNull(nowPage.toString()) || ToolUtils.strIsNull(pageSize.toString())) throw new CommonServiceException(500, "页数不能为空"); } }
[ "786130168@qq.com" ]
786130168@qq.com
df2ef95f60dffa04ce0b824857eaad12b81ba2ad
600fd27f0a2d702a2299ecd82ace8a61290ccba7
/app/src/androidTest/java/com/example/nextu/materialdesign/ExampleInstrumentedTest.java
ddbdb1caa4905118ee25c8146b4548d141334a91
[]
no_license
AlexisRoj/MaterialDesignv2
eec5fb1c9e5bb380a674e7d48ddbf41982653e32
0cc5ad23f810faafbb5d90618467da64850712dd
refs/heads/master
2021-01-25T09:15:05.310351
2017-06-09T01:39:11
2017-06-09T01:39:11
93,806,992
0
0
null
null
null
null
UTF-8
Java
false
false
768
java
package com.example.nextu.materialdesign; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.nextu.materialdesign", appContext.getPackageName()); } }
[ "alexisroj2@gmail.com" ]
alexisroj2@gmail.com
258a441d5741d3c3b06829fae2e22d4394dddd0c
5d2e6d0a5ae041b96a9e626a2ad3d6784f1e16b2
/CustomerSystem/src/po/MerchantProfile.java
203601bef74efefb99c77b26ecd2f4f5e1bd8234
[]
no_license
lewishoch/newnew
904011f09cdc1143ea5d1f34ccf9d9361d75e96c
a80a6379d91c351f731829de0a866a4fd45a8c04
refs/heads/master
2021-01-11T02:53:47.585573
2016-10-18T01:13:59
2016-10-18T01:13:59
70,887,760
0
0
null
null
null
null
UTF-8
Java
false
false
1,599
java
package po; import java.util.Date; public class MerchantProfile { private long uuid; private String mName; private int mAge; private String mGender; private String sName; private String sAddr; private String sTel; private String sLogoPath; private Date creDt; private Date lastModDt; private long mAccountUuid; public long getUuid() { return uuid; } public void setUuid(long uuid) { this.uuid = uuid; } public String getmName() { return mName; } public void setmName(String mName) { this.mName = mName; } public int getmAge() { return mAge; } public void setmAge(int mAge) { this.mAge = mAge; } public String getmGender() { return mGender; } public void setmGender(String mGender) { this.mGender = mGender; } public String getsName() { return sName; } public void setsName(String sName) { this.sName = sName; } public String getsAddr() { return sAddr; } public void setsAddr(String sAddr) { this.sAddr = sAddr; } public String getsTel() { return sTel; } public void setsTel(String sTel) { this.sTel = sTel; } public String getsLogoPath() { return sLogoPath; } public void setsLogoPath(String sLogoPath) { this.sLogoPath = sLogoPath; } public Date getCreDt() { return creDt; } public void setCreDt(Date creDt) { this.creDt = creDt; } public Date getLastModDt() { return lastModDt; } public void setLastModDt(Date lastModDt) { this.lastModDt = lastModDt; } public long getmAccountUuid() { return mAccountUuid; } public void setmAccountUuid(long mAccountUuid) { this.mAccountUuid = mAccountUuid; } }
[ "w.h.cheung@oocl.com" ]
w.h.cheung@oocl.com
71216afb1abeaddc999daeec4f71c902c674aa5a
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.bugreportservice-BugReportService/sources/java/security/BasicPermission.java
d157afd4f36f5b79a1e950ff80904dba4f3cb165
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
386
java
package java.security; import java.io.Serializable; public abstract class BasicPermission extends Permission implements Serializable { @Override // java.security.Permission public String getActions() { return ""; } public BasicPermission(String str) { super(""); } public BasicPermission(String str, String str2) { super(""); } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
c53392d9fdf7ef7f4e4436a55c3c5cab0fb5305b
eea92f9c23ad2b78ac2f8aaf62e30cd4db5d8366
/app/src/main/java/com/samkeet/iins/CameraPreview.java
79bf26521de1598094fe46ff57e02dabab6e6a6e
[]
no_license
SamkeetJain/IINS
c630866e62de4e6bdd4c499bcf403ccc68b06d69
ad40792e1134eec0761833dee0a99a5638d22c84
refs/heads/master
2021-01-20T13:35:03.359093
2017-05-07T02:29:03
2017-05-07T02:29:03
80,285,933
0
0
null
null
null
null
UTF-8
Java
false
false
5,908
java
package com.samkeet.iins; import android.content.Context; import android.hardware.Camera; import android.util.Log; import android.view.SurfaceHolder; import android.view.SurfaceView; import java.io.IOException; import java.util.List; public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback { private SurfaceHolder mHolder; public Camera mCamera; private List<Camera.Size> mSupportedPreviewSizes; private Camera.Size mPreviewSize; public CameraPreview(Context context, Camera camera) { super(context); mCamera = camera; mSupportedPreviewSizes = mCamera.getParameters().getSupportedPreviewSizes(); // Install a SurfaceHolder.Callback so we get notified when the // underlying surface is created and destroyed. mHolder = getHolder(); mHolder.addCallback(this); // deprecated setting, but required on Android versions prior to 3.0 mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) { // The Surface has been created, now tell the camera where to draw the preview. try { Camera.Parameters params = mCamera.getParameters(); List<String> focusModes = params.getSupportedFocusModes(); if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE)) { params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE); } else if (focusModes.contains(Camera.Parameters.FLASH_MODE_AUTO)){ params.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO); } mCamera.setParameters(params); mCamera.setPreviewDisplay(holder); mCamera.setDisplayOrientation(90); mCamera.startPreview(); } catch (IOException e) { Log.d("Camera preview", "Error setting camera preview1: " + e.getMessage()); } } public void surfaceDestroyed(SurfaceHolder holder) { stopPreviewAndFreeCamera(); } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // If your preview can change or rotate, take care of those events here. // Make sure to stop the preview before resizing or reformatting it. if (mHolder.getSurface() == null) { // preview surface does not exist return; } // stop preview before making changes try { mCamera.stopPreview(); } catch (Exception e) { // ignore: tried to stop a non-existent preview } // set preview size and make any resize, rotate or // reformatting changes here // start preview with new settings try { Camera.Parameters parameters = mCamera.getParameters(); // parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height); // mCamera.setParameters(parameters); List<Camera.Size> pitchersize=parameters.getSupportedPictureSizes(); List<Camera.Size> previewsize=parameters.getSupportedPreviewSizes(); parameters.setPictureSize(previewsize.get(0).width,previewsize.get(0).height); parameters.setPreviewSize(previewsize.get(0).width,previewsize.get(0).height); // Set parameters for camera mCamera.setParameters(parameters); mCamera.setPreviewDisplay(mHolder); mCamera.startPreview(); } catch (Exception e) { Log.d("Camera preview2", "Error starting camera preview2: " + e.getMessage()); } } private void stopPreviewAndFreeCamera() { if (mCamera != null) { // Call stopPreview() to stop updating the preview surface. mCamera.release(); mCamera = null; } } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final int width = resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec); final int height = resolveSize(getSuggestedMinimumHeight(), heightMeasureSpec); if (mSupportedPreviewSizes != null) { mPreviewSize = getOptimalPreviewSize(mSupportedPreviewSizes, width, height); } float ratio; if (mPreviewSize.height >= mPreviewSize.width) ratio = (float) mPreviewSize.height / (float) mPreviewSize.width; else ratio = (float) mPreviewSize.width / (float) mPreviewSize.height; // One of these methods should be used, second method squishes preview slightly // setMeasuredDimension(width, (int) (width * ratio)); setMeasuredDimension(width, height); // setMeasuredDimension((int) (width * ratio), height); } private Camera.Size getOptimalPreviewSize(List<Camera.Size> sizes, int w, int h) { final double ASPECT_TOLERANCE = 0.1; double targetRatio = (double) h / w; if (sizes == null) return null; Camera.Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = h; for (Camera.Size size : sizes) { double ratio = (double) size.height / size.width; if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue; if (Math.abs(size.height - targetHeight) < minDiff) { optimalSize = size; minDiff = Math.abs(size.height - targetHeight); } } if (optimalSize == null) { minDiff = Double.MAX_VALUE; for (Camera.Size size : sizes) { if (Math.abs(size.height - targetHeight) < minDiff) { optimalSize = size; minDiff = Math.abs(size.height - targetHeight); } } } return optimalSize; } }
[ "jain.sankeet2210@gmail.com" ]
jain.sankeet2210@gmail.com
200fdd71191a26e322808f46c4b0eed42f11e76f
3d838c958c315139e2038bb6f146306e9552c2ce
/src/main/java/org/postgresql/sql2/submissions/ArrayCountSubmission.java
0f5d2158080d5dbbac5937912dedb2ebf8a2acc9
[ "BSD-2-Clause" ]
permissive
sssinghsyr/pgsql2
d8c748108a7a8eca92dfa63abfa0a32b2df6a9b2
c55cfe5e4576073f48f8d81325d6da9ae308fa18
refs/heads/master
2020-03-20T07:00:14.357003
2018-07-16T20:29:52
2018-07-16T20:29:52
137,268,221
0
0
null
2018-06-13T20:40:51
2018-06-13T20:40:51
null
UTF-8
Java
false
false
3,718
java
package org.postgresql.sql2.submissions; import jdk.incubator.sql2.Result; import org.postgresql.sql2.PGSubmission; import org.postgresql.sql2.communication.packets.DataRow; import org.postgresql.sql2.operations.helpers.ParameterHolder; import org.postgresql.sql2.util.PGCount; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; import java.util.function.Supplier; import java.util.stream.Collector; public class ArrayCountSubmission<T> implements PGSubmission<T> { final static private Collector<Result.RowCount, List<Result.RowCount>, List<Result.RowCount>> defaultCollector = Collector.of( () -> new ArrayList<>(), (a, r) -> a.add(r), (l, r) -> null, a -> a); final private Supplier<Boolean> cancel; private CompletableFuture<T> publicStage; private String sql; private final AtomicBoolean sendConsumed = new AtomicBoolean(false); private ParameterHolder holder; private Collector collector = defaultCollector; private Object collectorHolder = defaultCollector.supplier().get(); private Consumer<Throwable> errorHandler; private GroupSubmission groupSubmission; private int numResults = 0; public ArrayCountSubmission(Supplier<Boolean> cancel, Consumer<Throwable> errorHandler, ParameterHolder holder, String sql, GroupSubmission groupSubmission) { this.cancel = cancel; this.errorHandler = errorHandler; this.holder = holder; this.sql = sql; this.groupSubmission = groupSubmission; } @Override public String getSql() { return sql; } @Override public AtomicBoolean getSendConsumed() { return sendConsumed; } @Override public ParameterHolder getHolder() { return holder; } @Override public Types getCompletionType() { return Types.ARRAY_COUNT; } @Override public void setCollector(Collector collector) { this.collector = collector; collectorHolder = collector.supplier().get(); } @Override public Object finish(Object finishObject) { collector.accumulator().accept(collectorHolder, new PGCount(Long.valueOf((Integer) finishObject))); numResults++; try { if(numResults == numberOfQueryRepetitions()) { Object endObject = collector.finisher().apply(collectorHolder); ((CompletableFuture) getCompletionStage()) .complete(endObject); if(groupSubmission != null) { groupSubmission.addGroupResult(endObject); } return true; } } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } return false; } @Override public void addRow(DataRow row) { try { collector.accumulator().accept(collectorHolder, row); } catch (Throwable e) { publicStage.completeExceptionally(e); } } @Override public List<Integer> getParamTypes() throws ExecutionException, InterruptedException { return holder.getParamTypes(); } @Override public int numberOfQueryRepetitions() throws ExecutionException, InterruptedException { return holder.numberOfQueryRepetitions(); } @Override public Consumer<Throwable> getErrorHandler() { return errorHandler; } @Override public CompletionStage<Boolean> cancel() { return new CompletableFuture<Boolean>().completeAsync(cancel); } @Override public CompletionStage<T> getCompletionStage() { if (publicStage == null) publicStage = new CompletableFuture<>(); return publicStage; } }
[ "alexander.kjall@gmail.com" ]
alexander.kjall@gmail.com
e599934404fc07a923d919277dd9969a6ba2e8a1
a9f53231328b3b9b03660a07c8ec3571009caecf
/app/src/main/java/com/example/harikrishnan/task1/QBank.java
518d6aaa92350d145db8ebd9150ed430543856ed
[]
no_license
harilee1325/TvTrivia
444d908eef7d92704f13452812391fca5c96439c
fc4bdb3f25c98a868815c70cbad4f8a256117aff
refs/heads/master
2020-04-11T04:03:51.676654
2018-12-16T12:24:19
2018-12-16T12:24:19
161,500,018
0
0
null
null
null
null
UTF-8
Java
false
false
1,126
java
package com.example.harikrishnan.task1; public class QBank { String name,c1,c2,c3,c4,correct; public QBank() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getC1() { return c1; } public void setC1(String c1) { this.c1 = c1; } public String getC2() { return c2; } public void setC2(String c2) { this.c2 = c2; } public String getC3() { return c3; } public void setC3(String c3) { this.c3 = c3; } public String getC4() { return c4; } public void setC4(String c4) { this.c4 = c4; } public String getCorrect() { return correct; } public void setCorrect(String correct) { this.correct = correct; } public QBank(String name, String c1, String c2, String c3, String c4, String correct) { this.name = name; this.c1 = c1; this.c2 = c2; this.c3 = c3; this.c4 = c4; this.correct = correct; } }
[ "45534309+harilee1325@users.noreply.github.com" ]
45534309+harilee1325@users.noreply.github.com
e3806fd5b79c91006aa73b9e6cf241c09288df1a
bc57cd338daf173eeae8653798d08d564ba20907
/fleetapp/src/main/java/com/sushils/controller/InvoiceStatusController.java
a5b0ce8db2276e51825ce4d5913401fefaccf3f0
[]
no_license
sushilsangle/fleetapp
432f9a882eca0351b6a4798773f6bb6c8be480fa
6b79a1c44ff846d62a20838210305c18bf4e76b9
refs/heads/master
2022-12-13T15:10:43.487133
2020-09-06T18:24:01
2020-09-06T18:24:01
289,723,787
0
0
null
null
null
null
UTF-8
Java
false
false
154
java
package com.sushils.controller; import org.springframework.web.bind.annotation.RestController; @RestController public class InvoiceStatusController { }
[ "sushilsangle.ss@gmail.com" ]
sushilsangle.ss@gmail.com
caa8fa81dca716be53a7c99651bd6539ee289b1a
7977a8cb5fc02922ef57c24962b182b45ac9f477
/src/com/unicorn/mianshijindian/树/MS0405.java
99bee5d2793187289304dcc6c0f54c30ffbc3614
[]
no_license
unicorn1009/AlgorithmWithJava
0f7ed0a5efd25a447c91594692dd82e66be7068a
d3ec62ed2ed885127b0c3850756574934d6f6642
refs/heads/master
2023-07-15T13:30:48.606629
2021-08-18T03:05:22
2021-08-18T03:05:22
320,192,812
0
0
null
null
null
null
UTF-8
Java
false
false
1,351
java
package com.unicorn.mianshijindian.树; import com.sun.org.apache.bcel.internal.generic.FADD; import com.unicorn.Leetcode.TreeNode; import java.util.ArrayList; import java.util.List; /** * <p> * 面试题 04.05. 合法二叉搜索树 * 实现一个函数,检查一棵二叉树是否为二叉搜索树。 * </p> * Created on 2021-7-7. * * @author Unicorn */ public class MS0405 { public boolean isValidBST1(TreeNode root) { return isValidBST1(root, Long.MIN_VALUE, Long.MAX_VALUE); } public boolean isValidBST1(TreeNode node, long min, long max) { if (node == null) return true; // 先序遍历 if (node.val <= min || node.val >= max) return false; return isValidBST1(node.left, min, node.val) && isValidBST1(node.right, node.val, max); } private List<Integer> values; public boolean isValidBST(TreeNode root) { values = new ArrayList<>(); dfs(root); for (int i = 1; i < values.size(); i++) { if (values.get(i) <= values.get(i-1)) return false; } return true; } // 二叉搜索用中序 public void dfs(TreeNode root) { if (root == null) return; dfs(root.left); values.add(root.val); dfs(root.right); } }
[ "1334083811@qq.com" ]
1334083811@qq.com
a4874dc66c929c6c85a2f9305b12bc5723796370
f5b90d10db8841381dc23ab65502dca43135295e
/One/day08/src/com/test2/exec3/Dog.java
7555a2191c441c0de4651f1b4826bab2233adebc
[ "LicenseRef-scancode-mulanpsl-2.0-en", "MulanPSL-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
fsjhut/shangMaStudy
f8edf1f6d55478615d6bd8b1a4add211de98ba36
c0abad4a87e2000dd13225ffdc7e95293625fb55
refs/heads/master
2023-07-17T09:15:31.931156
2021-09-01T02:18:18
2021-09-01T02:18:18
364,105,148
2
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.test2.exec3; /** * @className: Dog * @description: * @author SunHang * @createTime 2021/3/24 16:30 */ public class Dog extends Animal { public Dog(String name, String color) { super(name, color); } public Dog() { } public void eatPeople(){ System.out.println(this.getName()+"正在咬人---"); } }
[ "1067224906@qq.com" ]
1067224906@qq.com
6d51fc010441fe43c836cf03811c8e3196a6c0e8
496b81c0b0296aac8157b8b12fc0bb37a8207911
/src/main/Singleton/InitializingOnDemandHolderIdiom.java
3bd93f6143a82daecfc13d0869bd71f36ad2b2d5
[]
no_license
slheluo/DesignPatterns
8e84e4d1c20a18c47a1a884609ff73d0d07dace0
c3e3fc980bcd409fa3e6f3bccca0deacc910e845
refs/heads/master
2021-01-19T05:34:15.658302
2017-04-09T08:21:26
2017-04-09T08:21:26
87,437,204
1
0
null
null
null
null
UTF-8
Java
false
false
2,349
java
/** * The MIT License * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package main.Singleton; /** * The Initialize-on-demand-holder idiom is a secure way of creating a lazy initialized singleton * object in Java. * <p> * The technique is as lazy as possible and works in all known versions of Java. It takes advantage * of language guarantees about class initialization, and will therefore work correctly in all * Java-compliant compilers and virtual machines. * <p> * The inner class is referenced no earlier (and therefore loaded no earlier by the class loader) than * the moment that getInstance() is called. Thus, this solution is thread-safe without requiring special * language constructs (i.e. volatile or synchronized). * */ public final class InitializingOnDemandHolderIdiom { /** * 单例 TODO sl * Private constructor. */ private InitializingOnDemandHolderIdiom() {} /** * @return Singleton instance */ public static InitializingOnDemandHolderIdiom getInstance() { return HelperHolder.INSTANCE; } /** * Provides the lazy-loaded Singleton instance. */ private static class HelperHolder { private static final InitializingOnDemandHolderIdiom INSTANCE = new InitializingOnDemandHolderIdiom(); } }
[ "875834446@qq.com" ]
875834446@qq.com
b7a72fba6576a122d9a4ee09ad44c58fabf3a981
5a64f1954cb681c4d9be53b8aa1d0004233491da
/src/test/java/org/faithgreen/AppTest.java
083e2eb0608b734ef94b6c4a27b786d6a867b7e7
[]
no_license
faithgreen332/zookeeper
ceb202b36b4ac4e1f110d9bf11661f21115b2f57
757bb33bed85e34f61413d19550a95921a341253
refs/heads/master
2023-04-04T08:45:55.393973
2021-04-23T16:16:19
2021-04-23T16:16:19
360,711,556
0
0
null
null
null
null
UTF-8
Java
false
false
286
java
package org.faithgreen; import static org.junit.Assert.assertTrue; import org.junit.Test; /** * Unit test for simple App. */ public class AppTest { /** * Rigorous Test :-) */ @Test public void shouldAnswerWithTrue() { assertTrue( true ); } }
[ "lijinfeigreen@vip.163.com" ]
lijinfeigreen@vip.163.com
daacefd825545d597c0612512e7abcced614106d
98612a780106e19269e6f2da630c887c40cf34e9
/app/src/main/java/onroad/travel/com/onroad/java/OnRoad.java
5f71fcf8f6d1382f4b5e2bace75a1682f7fdd63f
[]
no_license
ashok-vc/OnRoad
1751849e4891d0ac550ba917c75c22a8ffb1c6cf
8549e0ab450196060662d0ce6304d9c3af3f4f34
refs/heads/master
2020-09-22T12:28:33.024878
2016-08-31T11:05:48
2016-08-31T11:05:48
66,851,587
0
0
null
null
null
null
UTF-8
Java
false
false
476
java
package onroad.travel.com.onroad.java; import android.app.Application; import com.facebook.FacebookSdk; import com.facebook.appevents.AppEventsLogger; public class OnRoad extends Application { // Updated your class body: @Override public void onCreate() { super.onCreate(); // Initialize the SDK before executing any other operations, FacebookSdk.sdkInitialize(getApplicationContext()); AppEventsLogger.activateApp(this); } }
[ "mohamed.ansardeen@virtual.clinic" ]
mohamed.ansardeen@virtual.clinic
1edaf2fc6abff621b9c3cd7d0c51fb0351ab7f15
73e3765a29367afd829d1dc44eb0d00299af991d
/jpa-hibernate-advanced/demo/src/main/java/com/learn/jpa/hibernate/database/demo/entity/FullTimeEmployee.java
be50ce7bc19204a44cafcce92021cec02d7161cb
[]
no_license
sushmitasharp/sush-beats-hibernate-jpa-practice
8162164f1900f12c75c7b782f1c5c000692604e8
ce1983084ba9b542abca4b57cd2bd2f007bdaab0
refs/heads/master
2020-03-18T12:05:02.118961
2018-05-24T11:46:47
2018-05-24T11:46:47
134,707,757
0
0
null
null
null
null
UTF-8
Java
false
false
371
java
package com.learn.jpa.hibernate.database.demo.entity; import javax.persistence.Entity; import java.math.BigDecimal; @Entity public class FullTimeEmployee extends Employee { protected FullTimeEmployee() { } public FullTimeEmployee(String name, BigDecimal salary) { super(name); this.salary = salary; } private BigDecimal salary; }
[ "sushmitasharp@gmail.com" ]
sushmitasharp@gmail.com
71651adda28e735d964c3289c515bd13d758620d
98565ea543002b7119115fb2597c0d31036d0acc
/src/main/java/codechicken/nei/jei/proxy/DummyProxy.java
6d5ca3318e62c764b0b6e10d4763ef767cc46710
[ "MIT" ]
permissive
MrDiamond123/NotEnoughItems
4ac45be9d40905b24cfd55898b671b4b58925e66
37d54d8950d1b903ba9828f5b483b18bdc7673bb
refs/heads/master
2021-01-20T00:14:05.222906
2017-04-14T02:42:51
2017-04-14T02:42:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
390
java
package codechicken.nei.jei.proxy; import net.minecraft.item.ItemStack; /** * Created by covers1624 on 7/04/2017. */ public class DummyProxy implements IJEIProxy { @Override public boolean isJEIEnabled() { return false; } @Override public void openRecipeGui(ItemStack stack) { } @Override public void openUsageGui(ItemStack stack) { } }
[ "laughlan.cov@internode.on.net" ]
laughlan.cov@internode.on.net
04ef1fbaff2dc3a317ba54bb78c1ace932fb85c2
a2035413bcecfb12dcead9dc955603e29517ecd8
/TEKSYS_TEST/src/com/api/test/CountryDetailsFinder.java
c2595070ce471099c6c65b25da7d622d5d0ee0cc
[]
no_license
rosuantony/SDET-QA-TESTJAVA
2e63f388e4ea388ef5a9c208199d1f5a79c082a1
2d02128fdc3394e428442441a847a26a83091e87
refs/heads/master
2020-09-06T10:07:27.959994
2019-11-08T17:56:01
2019-11-08T17:56:01
220,395,112
0
0
null
null
null
null
UTF-8
Java
false
false
1,205
java
package com.api.test; import java.util.Scanner; import org.json.JSONObject; import com.api.test.RestCountriesApi.Country; public class CountryDetailsFinder { public static void main(String[] args) { try { Scanner sc = new Scanner(System.in); while(true) { System.out.println("****************************************"); System.out.println("Input the ISO2 or ISO3 country code(Type 'STOP' to exit)"); String countryCode = sc.nextLine(); if(countryCode.equalsIgnoreCase("stop")) break; if(countryCode == null || countryCode.isEmpty() || countryCode.equals("")) { System.out.println("Please input a COUNTRY CODE or input 'STOP'"); } else { Country country = new RestCountriesApi().getCountryDetailsByCode(countryCode); if(country != null) { System.out.println("Country is "+country .name); System.out.println("Capital is "+country.capital); } else { System.out.println("Please input a valid country code!!!!"); } } } } catch (Exception e) { e.printStackTrace(); } } }
[ "acer@192.168.0.17" ]
acer@192.168.0.17
c283de943202e181a988eb80a7793f55531ed6dc
d4d206413a4647476d3c6a1157058745db061aa7
/org.schema/src/main/java/org/schema/PlaceOfWorship.java
76433dd2b0a6c12747d3da3631092085037613bf
[ "Apache-2.0" ]
permissive
devlinjunker/ec
4b881c69e10d9be46a19216c7bd712a045508d6e
4abf6a2a563a2a30e5f1b620a451dc83b675dbc9
refs/heads/master
2021-07-16T21:04:31.990932
2017-10-23T19:15:36
2017-10-23T19:15:36
106,870,884
0
0
null
2017-10-13T20:34:43
2017-10-13T20:34:42
null
UTF-8
Java
false
false
451
java
package org.schema; /** * Schema.org/PlaceOfWorship * Place of worship, such as a church, synagogue, or mosque. * * @author schema.org * @class PlaceOfWorship * @module org.schema * @extends CivicStructure */ public class PlaceOfWorship extends CivicStructure { /** * Constructor, automatically sets @context and @type. * * @constructor */ public PlaceOfWorship() { context = "http://schema.org/"; type = "PlaceOfWorship"; } }
[ "fritz.ray@eduworks.com" ]
fritz.ray@eduworks.com
b58da473b42268163c621bfb25177a11f601e61c
accf3b568ba528c78c749110c859587e1c0f1f89
/app/src/test/java/com/example/quoteit/ExampleUnitTest.java
7de5bedc522a693698e672f96a4f341c21ae1e7f
[]
no_license
rajsaurabh247/QuoteIt
6a32ae128657bbbfa607a1371d26ce7e2ebdfe5d
98dfbc262df3d4bcbea7b22f07e686191e792125
refs/heads/master
2023-02-22T19:24:12.745304
2021-01-29T08:41:20
2021-01-29T08:41:20
333,187,351
0
0
null
null
null
null
UTF-8
Java
false
false
380
java
package com.example.quoteit; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "rajsaurabh247@gmail.com" ]
rajsaurabh247@gmail.com
1dee5efc087d5b95fb3659ef5a95f51dd09d873c
f74c33f541e5a9c5f3b3cc01dbeaa6d46c61e67b
/sources/com/google/gson/internal/ConstructorConstructor.java
3c2246566e4e7fffe3207a0402b1f88cc9945dec
[]
no_license
chaboox/Algeriaplus
7e57345581195aa988d834614ac9775b48214dc9
c74acb4d1f1f503a9d81b01b9e9b01993ebd4d5a
refs/heads/master
2020-05-24T20:47:59.749061
2019-05-19T10:21:49
2019-05-19T10:21:49
187,461,511
0
0
null
null
null
null
UTF-8
Java
false
false
5,483
java
package com.google.gson.internal; import com.google.gson.InstanceCreator; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.Map; import java.util.Queue; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; public final class ConstructorConstructor { private final Map<Type, InstanceCreator<?>> instanceCreators; /* renamed from: com.google.gson.internal.ConstructorConstructor$3 */ class C05703 implements ObjectConstructor<T> { C05703() { } public T construct() { return new TreeSet(); } } /* renamed from: com.google.gson.internal.ConstructorConstructor$4 */ class C05714 implements ObjectConstructor<T> { C05714() { } public T construct() { return new LinkedHashSet(); } } /* renamed from: com.google.gson.internal.ConstructorConstructor$5 */ class C05725 implements ObjectConstructor<T> { C05725() { } public T construct() { return new LinkedList(); } } /* renamed from: com.google.gson.internal.ConstructorConstructor$6 */ class C05736 implements ObjectConstructor<T> { C05736() { } public T construct() { return new ArrayList(); } } /* renamed from: com.google.gson.internal.ConstructorConstructor$7 */ class C05747 implements ObjectConstructor<T> { C05747() { } public T construct() { return new LinkedHashMap(); } } public ConstructorConstructor(Map<Type, InstanceCreator<?>> instanceCreators) { this.instanceCreators = instanceCreators; } public ConstructorConstructor() { this(Collections.emptyMap()); } public <T> ObjectConstructor<T> get(TypeToken<T> typeToken) { final Type type = typeToken.getType(); Class<? super T> rawType = typeToken.getRawType(); final InstanceCreator<T> creator = (InstanceCreator) this.instanceCreators.get(type); if (creator != null) { return new ObjectConstructor<T>() { public T construct() { return creator.createInstance(type); } }; } ObjectConstructor<T> defaultConstructor = newDefaultConstructor(rawType); if (defaultConstructor != null) { return defaultConstructor; } ObjectConstructor<T> defaultImplementation = newDefaultImplementationConstructor(rawType); if (defaultImplementation != null) { return defaultImplementation; } return newUnsafeAllocator(type, rawType); } private <T> ObjectConstructor<T> newDefaultConstructor(Class<? super T> rawType) { try { final Constructor<? super T> constructor = rawType.getDeclaredConstructor(new Class[0]); if (!constructor.isAccessible()) { constructor.setAccessible(true); } return new ObjectConstructor<T>() { public T construct() { try { return constructor.newInstance(null); } catch (InstantiationException e) { throw new RuntimeException("Failed to invoke " + constructor + " with no args", e); } catch (InvocationTargetException e2) { throw new RuntimeException("Failed to invoke " + constructor + " with no args", e2.getTargetException()); } catch (IllegalAccessException e3) { throw new AssertionError(e3); } } }; } catch (NoSuchMethodException e) { return null; } } private <T> ObjectConstructor<T> newDefaultImplementationConstructor(Class<? super T> rawType) { if (Collection.class.isAssignableFrom(rawType)) { if (SortedSet.class.isAssignableFrom(rawType)) { return new C05703(); } if (Set.class.isAssignableFrom(rawType)) { return new C05714(); } if (Queue.class.isAssignableFrom(rawType)) { return new C05725(); } return new C05736(); } else if (Map.class.isAssignableFrom(rawType)) { return new C05747(); } else { return null; } } private <T> ObjectConstructor<T> newUnsafeAllocator(final Type type, final Class<? super T> rawType) { return new ObjectConstructor<T>() { private final UnsafeAllocator unsafeAllocator = UnsafeAllocator.create(); public T construct() { try { return this.unsafeAllocator.newInstance(rawType); } catch (Exception e) { throw new RuntimeException("Unable to invoke no-args constructor for " + type + ". " + "Register an InstanceCreator with Gson for this type may fix this problem.", e); } } }; } public String toString() { return this.instanceCreators.toString(); } }
[ "chaboox@gmail.com" ]
chaboox@gmail.com
ccc2794d550316615f76f88500b244a63d178e7c
b5ed6edbf4b0e785ff4c92a229cd6b3f5de7a341
/src/excel/DealExcelRecoverData.java
c71ae6411a8e57787c328339d2cee3a72986bee6
[]
no_license
ailierke/dealdata
ba9630c3e75f143ba643db6c47fc19440fb73eb0
b734b08e7577c31b8ce38278888cf616efb6462b
refs/heads/master
2020-04-01T14:14:29.708785
2018-10-16T13:16:43
2018-10-16T13:16:43
153,286,864
0
0
null
null
null
null
UTF-8
Java
false
false
3,767
java
package excel; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PushbackInputStream; import java.sql.Connection; import java.sql.SQLException; import java.util.List; import org.apache.commons.dbutils.QueryRunner; import org.apache.poi.POIXMLDocument; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import diwinet.wp.vo.SensorInfo; import diwinet.wp.vo.TWaterReportHistory; import diwinet.wp.vo.TWaterReportHistoryRT; import diwinet.wp.vo.WpCustomerBanding; import util.DBUtil; import util.DBUtilsTemplate; /** * 读取excel中数据,将未被绑定的设备条码提取出来 * <p>标题:</p> * <p>描述:</p> * <p>Copyright:Copyright(c) 2016 diwinet</p> * <p>日期:2016年9月9日</p> * @author jiangxing */ public class DealExcelRecoverData { public static void dealExcel() throws InvalidFormatException, IOException, SQLException{ Connection conn = DBUtil.getConnection(); QueryRunner queryRunner = new QueryRunner(); DBUtilsTemplate dbUtil = new DBUtilsTemplate(conn,queryRunner); File file = new File("D:\\回复数据.xls"); Workbook wb = null; InputStream in= new FileInputStream(file); if (!in.markSupported()) { in = new PushbackInputStream(in, 8); } if (POIFSFileSystem.hasPOIFSHeader(in)) { wb= new HSSFWorkbook(in); }else{ if (POIXMLDocument.hasOOXMLHeader(in)) { wb= new XSSFWorkbook(OPCPackage.open(in)); } } Cell cell = null; StringBuilder hasBanding = new StringBuilder(); StringBuilder noBanding = new StringBuilder(); for (int sheetIndex = 0; sheetIndex < wb.getNumberOfSheets(); sheetIndex++) { Sheet st = wb.getSheetAt(sheetIndex); Long sbbh = null; for (int rowIndex = 1; rowIndex <=st.getLastRowNum(); rowIndex++) { sbbh = null; Row row = st.getRow(rowIndex); cell = row.getCell(0); if(cell==null){ continue; } String sbtm = cell.getStringCellValue(); cell.setCellType(HSSFCell.CELL_TYPE_STRING); //如果粗航设备条码为null或者为空 if(sbtm==null||sbtm.equals("")){ continue; } WpCustomerBanding wp = null; SensorInfo sensor =null; try{ String sql = "select * from T_SENSOR_INFO where sbtm = '"+sbtm+"'"; sensor = dbUtil.findFirst(SensorInfo.class,sql); if(sensor!=null){ sbbh = sensor.getSbbh(); sql = "select * from T_WP_CUSTOMER_BANDING where sbbh = "+sbbh; wp = dbUtil.findFirst(WpCustomerBanding.class,sql); if(wp!=null){ st.removeRow(row); hasBanding.append(sbtm+";"); }else{ noBanding.append(sbtm+";"); cell = row.getCell(1); cell.setCellValue(sbbh); } } }catch(Exception e){ e.printStackTrace(); } } } System.out.println("已被绑定:"+hasBanding.toString()); System.out.println("未被绑定:"+noBanding.toString()); /** * 在更改过后一定还要再次将excel保存下来。因为excel的操作都是在内存中。不然修改不了 */ FileOutputStream stream; stream = new FileOutputStream(file); wb.write(stream); stream.close(); } public static void main(String[] args) throws InvalidFormatException, IOException, SQLException { dealExcel(); } }
[ "724941972@qq.com" ]
724941972@qq.com
aec5e10b80f884487ca8c5764c956f58861a9338
caff96296fee48b5ac6c13831ddb2259f4e1071f
/src/test/java/com/treadstone/web/rest/TestUtil.java
757f2aa5adee1ce5ec288937bc51fce37fe017aa
[]
no_license
tchupp/treadstone-old
689c1d70755462efd2e344fa45675e9be6104cb4
546f6a883637b26358c48baa2d4d6b84ec952d8c
refs/heads/master
2022-12-19T20:07:06.755032
2020-09-18T13:39:28
2020-09-29T14:17:50
40,850,597
0
1
null
2020-09-29T14:17:51
2015-08-17T00:32:58
Java
UTF-8
Java
false
false
1,891
java
package com.treadstone.web.rest; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.joda.JodaModule; import com.treadstone.domain.util.CustomDateTimeSerializer; import com.treadstone.domain.util.CustomLocalDateSerializer; import org.joda.time.DateTime; import org.joda.time.LocalDate; import org.springframework.http.MediaType; import java.io.IOException; import java.nio.charset.Charset; /** * Utility class for testing REST controllers. */ public class TestUtil { /** * MediaType for JSON UTF8 */ public static final MediaType APPLICATION_JSON_UTF8 = new MediaType( MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")); /** * Convert an object to JSON byte array. * * @param object the object to convert * @return the JSON byte array * @throws IOException */ public static byte[] convertObjectToJsonBytes(Object object) throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); JodaModule module = new JodaModule(); module.addSerializer(DateTime.class, new CustomDateTimeSerializer()); module.addSerializer(LocalDate.class, new CustomLocalDateSerializer()); mapper.registerModule(module); return mapper.writeValueAsBytes(object); } /** * Create a byte array with a specific size filled with specified data * * @param size * @param data * @return */ public static byte[] createByteArray(int size, String data) { byte[] byteArray = new byte[size]; for (int i = 0; i < size; i++) { byteArray[i] = Byte.parseByte(data, 2); } return byteArray; } }
[ "tclchiam@gmail.com" ]
tclchiam@gmail.com
09497e8b9677f55ecc414dc2a8af7bd8508d9acb
3994c2b8bf5153487e8bf03c043d47822df750c9
/core/src/main/java/edu/arizona/biosemantics/etcsite/core/shared/model/Configuration.java
2baf5f08ead1995674f4fc87c902c1ed5a7fde97
[]
no_license
biosemantics/etc-site-archived-do-not-use
a9faacd5d3396621267f21b176b6ea1d206cf38a
4d1a7fd159e156da0be327164ad07df2198f3aae
refs/heads/master
2021-07-24T03:52:30.902933
2017-10-03T00:08:04
2017-10-03T00:08:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,141
java
package edu.arizona.biosemantics.etcsite.core.shared.model; import java.io.Serializable; import java.util.Date; public class Configuration implements Serializable { private static final long serialVersionUID = -3601068865826034113L; public static String otoSecret; public static String otoUrl; public static String googleClientId; public static String googleSecret; public static String googleRedirectURI; private int id; private Date created; public Configuration() { } public Configuration(int id, Date created) { super(); this.id = id; this.created = created; } public int getId() { return id; } public void setId(int id) { this.id = id; } public Date getCreated() { return created; } public void setCreated(Date created) { this.created = created; } @Override public int hashCode() { return id; } @Override public boolean equals(Object object) { if(object == null) return false; if (getClass() != object.getClass()) { return false; } Configuration configuration = (Configuration)object; if(configuration.getId()==this.id) return true; return false; } }
[ "thomas.rodenhausen@gmail.com" ]
thomas.rodenhausen@gmail.com
99dae26df267b3e58a454a22cff2101b03a424e9
9b40dbc856082102a1e8fcf321e41745abb32a3e
/app/src/main/java/com/gospelware/testwidget/Widget/Utils.java
51fa6736efc3f93944dd0249fb5efce8c020bcb1
[]
no_license
yoruriko/TestWidget
7d1bf87dad0567c6811e6611e04e3ab044c12151
b958e4cb1693e3bdc63158878788d5ee9e674cc2
refs/heads/master
2021-01-09T20:04:54.127894
2016-07-05T09:14:27
2016-07-05T09:14:27
62,060,988
0
0
null
null
null
null
UTF-8
Java
false
false
959
java
package com.gospelware.testwidget.Widget; import android.content.Context; import android.util.DisplayMetrics; import android.util.TypedValue; import android.view.WindowManager; public class Utils { public static int dp2px(Context context, float dp) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics()); } public static int getScreenWidth(Context context) { WindowManager wm = (WindowManager) context .getSystemService(Context.WINDOW_SERVICE); DisplayMetrics outMetrics = new DisplayMetrics(); wm.getDefaultDisplay().getMetrics(outMetrics); return outMetrics.widthPixels; } public static int convertDpToPixel(Context context, int dp) { float density = context.getResources().getDisplayMetrics().density; return Math.round((float) dp * density); } }
[ "rico@gospelware.co.uk" ]
rico@gospelware.co.uk
9e44a7e7658cc2fee93893049490958375ef1f5a
d07d6ced8dee6a9e178c3a5d933a269c4d17523f
/algorithms/src/leetcode/Main.java
4350ef830f8548f74cc1c9cb730a79fb571840d8
[]
no_license
Codingdbx/java-learning
bdfc6d9eb48dfbdd6f2cf248a527e935b8d7e869
f6c2cd8aad697d77b3d10841a1c2223c8997c212
refs/heads/master
2021-06-19T04:46:47.202701
2021-04-23T09:52:41
2021-04-23T09:52:41
203,362,886
0
0
null
null
null
null
UTF-8
Java
false
false
2,343
java
package leetcode; /** * created by dbx on 2019/1/15 */ public class Main { public static void main(String[] args) { int result = countPrimes3(1500000); System.out.println(result); } public static int countPrimes(int n) { int number = 0; //注意两个循环的起始值均为2,都为2时,不进入第二个循环,即默认2为质数 int i = 2; while (i < n) { int j = 2; boolean flg = false; while (j < i) { if (i % j == 0) { flg = true;//说明是素数 break; } j++; } if (!flg) { number++; } i++; } return number; } public static int countPrimes2(int n) { int number = 0; //注意两个循环的起始值均为2,都为2时,不进入第二个循环,即默认2为质数 int i = 2; while (i < n) { int j = 2; boolean flg = false; while (j <= Math.sqrt(i)) {//优化点:可以不必从2~m-1,只需遍历2 ~ √m.因为如果m能被2 ~ m-1之间任一整数整除, // 其二个因子必定有一个小于或等于√m,另一个大于或等于√m。 if (i % j == 0) { flg = true;//说明是素数 break; } j++; } if (!flg) { number++; } i++; } return number; } /** * 埃拉托斯特尼筛法 * * @param n * @return */ public static int countPrimes3(int n) { int aa[] = new int[101]; aa[2] = 0; int k = 2, tt = 0; while (tt < 101) { for (int i = 1; i < aa.length; i++) //将不是素数的数筛出 if (i % k == 0 && i != k) aa[i] = 1; for (int i = 1; i < aa.length; i++) //将筛选后的第一个数当做新的筛子 if (i > k && aa[i] == 0) { k = i; break; } tt++; } for (int i = 1; i < aa.length; i++) if (aa[i] == 0) System.out.printf("%d ", i); return 0; } }
[ "you@example.com" ]
you@example.com
11fb303204fa5a667bddaef72c1a00611c8e572e
7bc6ba7dd3b87e08b37e13c25ae1c8ed2349fdcb
/src/rentaldvd/koneksi.java
4957b52f0a15b4721e7a5daa99a1529f2c27df40
[]
no_license
Papzaan/RentalDVD
7f3e3deaa0d436f3fcc2f8d3d35a7520885ee07a
3e56caf0dd89bdbe7139a397efe5824364bdfab8
refs/heads/master
2020-05-04T07:00:23.104660
2019-04-02T08:00:20
2019-04-02T08:00:20
179,019,137
0
0
null
null
null
null
UTF-8
Java
false
false
986
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 rentaldvd; import com.mysql.jdbc.Connection; import com.mysql.jdbc.Statement; import java.sql.DriverManager; import java.sql.SQLException; import javax.swing.JOptionPane; /** * * @author asus */ public class koneksi { private static Connection con; private static Statement stm; public static Connection getKoneksi() { String host = "jdbc:mysql://localhost/rentaldvd", user = "root", pass = ""; try { con = (Connection) DriverManager.getConnection(host, user, pass); stm = (Statement) con.createStatement(); } catch (SQLException err) { JOptionPane.showMessageDialog(null, err.getMessage()); } return con; } public static void main(String[] args) { } }
[ "aansanova.14116175@student.itera.ac.id" ]
aansanova.14116175@student.itera.ac.id
84da794ef9db5dd94cbb8ef32b9987b28201677b
89008e5437053f79cfe98dcd54a5ebe6fa9fa0d2
/src/model/Doctor.java
86d2b0cf7233481ad0f3b83d2fec33b7d5efdd93
[]
no_license
Leelleon/MyMedicalAppointments
093b9c722653b2b9372b0ff64a39439f2dac59fc
3a013bf3ffaef5140744333f27c81fd6f1255ea7
refs/heads/master
2023-08-31T04:02:01.330050
2021-09-17T20:58:03
2021-09-17T20:58:03
406,804,577
0
0
null
null
null
null
UTF-8
Java
false
false
1,492
java
package model; import java.util.ArrayList; import java.util.Date; public class Doctor extends User{ private String speciality; public Doctor(String name, String email){ super(name, email); this.speciality = speciality; } public String getSpeciality() { return speciality; } public void setSpeciality(String speciality) { this.speciality = speciality; } ArrayList<AvailableAppointment> Appointments = new ArrayList<>(); public void addAppointment(Date date, String time){ Appointments.add(new Doctor.AvailableAppointment(date, time)); } public void getAppointment(){ for (AvailableAppointment A: Appointments) { System.out.println(A.date + " " + A.time); } } public static class AvailableAppointment{ private int id; private Date date; private String time; public AvailableAppointment(Date date, String time){ this.date = date; this.time = time; } } @Override public String toString() { return super.toString() + "speciality='" + speciality + '\'' + ", Appointments=" + Appointments; } @Override public void showDataUser() { System.out.println("Empleado"); System.out.println("Hospital: Cruz Roja"); System.out.println("Departamento: Oncologia"); } }
[ "leonardosantosbran@gmail.com" ]
leonardosantosbran@gmail.com
10f2af936d5d2e2a1c8b2f4a1ac36fa7b6565e0b
43332deb2b564be162ccbe28cb99dbe5bff29ba4
/src/main/java/xyz/liuyou/seckill/utils/UserUtil.java
5bebdf8751edea72cb2f3cd62942bf767a072190
[]
no_license
kaiminliu/seckill-demo
da716ca3de4d7cf662e5157d604b5d461b555ae0
1e09fb215de435cb30dad90572434f5a9216fd5b
refs/heads/master
2023-07-26T21:37:17.831773
2021-09-09T07:22:28
2021-09-09T07:22:28
404,609,898
0
0
null
null
null
null
UTF-8
Java
false
false
4,350
java
package xyz.liuyou.seckill.utils; import com.fasterxml.jackson.databind.ObjectMapper; import xyz.liuyou.seckill.pojo.User; import xyz.liuyou.seckill.vo.RespBean; import java.io.*; import java.net.HttpURLConnection; import java.net.URL; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * @author liuminkai * @version 1.0 * @datetime 2021/9/1 9:37 * @decription 生成用户工具类 **/ public class UserUtil { private static void createUser(int count) throws Exception { List<User> users = new ArrayList<>(count); // 生成用户 for (int i=0; i < count; i++){ User user = new User(); user.setPhone(17000000000L+i); user.setNickname("user"+i); user.setSalt("1a2b3c"); user.setPassword(MD5Util.inputPassToDBPass("123456", user.getSalt())); user.setRegisterDate(new Date()); user.setLoginCount(1); users.add(user); } System.out.println("create user"); // 插入数据库 Connection conn = getConn(); String sql = "insert into user(phone, nickname, salt, password, register_date, login_count) values(?,?,?,?,?,?)"; PreparedStatement pstat = conn.prepareStatement(sql); for (int i = 0; i < count; i++) { User user = users.get(i); pstat.setLong(1, user.getPhone()); pstat.setString(2, user.getNickname()); pstat.setString(3, user.getSalt()); pstat.setString(4, user.getPassword()); pstat.setTimestamp(5, new Timestamp(user.getRegisterDate().getTime())); pstat.setInt(6, user.getLoginCount()); pstat.addBatch(); } pstat.executeBatch(); pstat.close(); conn.close(); System.out.println("insert to db"); // 登录,生成token String uslString = "http://localhost:8080/login/doLogin"; File file = new File(System.getProperty("user.dir") + "/users.txt"); if (file.exists()){ file.delete(); } RandomAccessFile raf = new RandomAccessFile(file, "rw"); file.createNewFile(); raf.seek(0); for (int i = 0; i < users.size(); i++) { User user = users.get(i); URL url = new URL(uslString); HttpURLConnection huc = (HttpURLConnection) url.openConnection(); huc.setRequestMethod("POST"); huc.setDoOutput(true); OutputStream os = huc.getOutputStream(); String params = "mobile=" + user.getPhone() + "&password=" + MD5Util.inputPassToFormPass("123456"); os.write(params.getBytes()); os.flush(); os.close(); InputStream is = huc.getInputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buff = new byte[1024]; int len = 0; while((len = is.read(buff)) >= 0){ baos.write(buff, 0, len); } is.close(); baos.close(); String response = new String(baos.toByteArray()); ObjectMapper objectMapper = new ObjectMapper(); RespBean respBean = objectMapper.readValue(response, RespBean.class); String userTicket = (String) respBean.getObj(); System.out.println("create userTicket : " + userTicket); String row = user.getPhone() + "," + userTicket + "\r\n"; raf.seek(raf.length()); raf.write(row.getBytes()); System.out.println("write to file : " + user.getPhone()); } raf.close(); System.out.println("over"); } private static Connection getConn() throws Exception { String url = "jdbc:mysql://localhost:3306/seckill?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai"; String driver = "com.mysql.jdbc.Driver"; String username = "root"; String password = "mysql"; Class.forName(driver); return DriverManager.getConnection(url, username, password); } public static void main(String[] args) throws Exception { createUser(5000); } }
[ "1423928650@qq.com" ]
1423928650@qq.com
1f7a907e1f3cfaaef9368600504cbbf22e73e326
59d0acab882c30074208371f9d8270901dcc4f33
/app/src/main/java/com/example/afaf/enterprisecrm/Helper_Database/JCGSQLiteHelper_cases.java
f916ab2e93bec9e8eaca62962e74ba883273c9f1
[]
no_license
Mariem-Ahmed/CRM
9314fae26bb9faf33329ddd75860281875b60f82
dbf4cafbcfd8bd99980cdf7a87c4d566fbe74255
refs/heads/master
2021-05-07T03:13:57.144553
2017-11-15T11:20:31
2017-11-15T11:20:31
110,819,589
0
0
null
null
null
null
UTF-8
Java
false
false
14,605
java
package com.example.afaf.enterprisecrm.Helper_Database; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import com.example.afaf.enterprisecrm.Helper_Database.casesModel; import java.util.LinkedList; import java.util.List; /** * Created by enterprise on 11/10/16. */ public class JCGSQLiteHelper_cases extends SQLiteOpenHelper { public static boolean listFlagInsert=false; // database version private static final int database_VERSION = 1; // database name private static final String database_NAME = "Cases.db"; private static final String table_Cases = "cases"; private static final String ID = "id"; private static final String leadName = "leadName"; private static final String subjectName = "subjectName"; private static final String spentTime = "spentTime"; private static final String assignedTo = "assignedTo"; private static final String status = "status"; private static final String priority = "priority"; private static final String deadLine = "deadLine"; private static final String caseID = "caseID"; private static final String caseRelatedLead = "caseRelatedLead"; private static final String spenthours = "spenthours"; private static final String spentmintues = "spentmintues"; private static final String caseActivity= "caseActivity"; private static final String caseActivityId= "caseActivityId"; private static final String[] COLUMNS = {ID,assignedTo, leadName,spentTime,priority, subjectName,caseID , deadLine ,status, caseRelatedLead, spenthours, spentmintues, caseActivity,caseActivityId}; public JCGSQLiteHelper_cases(Context context) { super(context, database_NAME, null, database_VERSION); } @Override public void onCreate(SQLiteDatabase db) { // SQL statement to create Event table String CREATE_Event_TABLE = "CREATE TABLE cases ( " + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "assignedTo TEXT, "+"leadName TEXT , " + "spentTime TEXT, " + "priority TEXT,"+" subjectName TEXT, " + "caseID TEXT, "+"deadLine TEXT, "+"status TEXT, "+"caseRelatedLead TEXT," + " "+"spenthours TEXT, "+"spentmintues TEXT, "+"caseActivity TEXT, "+"caseActivityId TEXT )"; db.execSQL(CREATE_Event_TABLE); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS " + table_Cases); this.onCreate(db); } public void createCases( String assignedTo_,String leadName_ ,String spentTime_ ,String priority_ , String subjectName_, String caseID_, String deadLine_, String status_, String caseRelatedLead_, String spenthours_, String spentmintues_, String caseActivity_,String caseActivityId_) { // get reference of the EventDB database SQLiteDatabase db = this.getWritableDatabase(); // make values to be inserted ContentValues values = new ContentValues(); values.put(assignedTo, assignedTo_); values.put(leadName, leadName_); values.put(spentTime, spentTime_); values.put(priority, priority_); values.put(subjectName, subjectName_); values.put(caseID, caseID_); values.put(deadLine, deadLine_); values.put(status, status_); values.put(caseRelatedLead, caseRelatedLead_); values.put(spenthours, spenthours_); values.put(spentmintues, spentmintues_); values.put(caseActivity, caseActivity_); values.put(caseActivityId, caseActivityId_); // String xcf = leadName_; // insert Event db.insert(table_Cases, null, values); // close database transaction // db.close(); } public casesModel readCase(int id) { // get reference of the EventDB database listFlagInsert=false; SQLiteDatabase db = this.getReadableDatabase(); // get Event query Cursor cursor = db.query(table_Cases, // a. table COLUMNS, " id = ?", new String[]{String.valueOf(id)}, null, null, null, null); // if results !=null, parse the first one if (cursor != null) cursor.moveToFirst(); casesModel EM = new casesModel(); EM.setId(Integer.parseInt(cursor.getString(0))); EM.setAssignedTo(cursor.getString(1)); EM.setLeadName(cursor.getString(2)); EM.setTimeSpent(cursor.getString(3)); EM.setPriority(cursor.getString(4)); EM.setSubjectName(cursor.getString(5)); EM.setCaseID(cursor.getString(6)); EM.setDeadLine(cursor.getString(7)); EM.setStatus(cursor.getString(8)); EM.setCaseRelatedLead(cursor.getString(9)); EM.setSpenthours(cursor.getString(10)); EM.setSpentmintues(cursor.getString(11)); EM.setCaseActivity(cursor.getString(12)); EM.setCaseActivityId(cursor.getString(13)); return EM; } //-----------------------------get all cases for activity---------------------------------------------------------------- public List<casesModel> getAllCasesActivities( String actid) { List<casesModel> eventsM = new LinkedList<casesModel>(); // select Event query String query = "SELECT * FROM "+table_Cases +" where caseActivityId = '"+actid+"' "; // get reference of the EventDB database SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery(query, null); // parse all results casesModel EM = null; if (cursor.moveToFirst()) { do { EM = new casesModel(); EM.setId(Integer.parseInt(cursor.getString(0))); EM.setAssignedTo(cursor.getString(1)); EM.setLeadName(cursor.getString(2)); EM.setTimeSpent(cursor.getString(3)); EM.setPriority(cursor.getString(4)); EM.setSubjectName(cursor.getString(5)); EM.setCaseID(cursor.getString(6)); EM.setDeadLine(cursor.getString(7)); EM.setStatus(cursor.getString(8)); EM.setCaseRelatedLead(cursor.getString(9)); EM.setSpenthours(cursor.getString(10)); EM.setSpentmintues(cursor.getString(11)); EM.setCaseActivity(cursor.getString(12)); EM.setCaseActivityId(cursor.getString(13)); // Add event to events eventsM.add(EM); } while (cursor.moveToNext()); } return eventsM; } //-----------------------------get all cases for lead---------------------------------------------------------------- public List<casesModel> getAllCasesLeads( String leadid) { List<casesModel> eventsM = new LinkedList<casesModel>(); // select Event query String query = "SELECT * FROM "+table_Cases +" where caseRelatedLead = '"+leadid+"' "; // get reference of the EventDB database SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery(query, null); // parse all results casesModel EM = null; if (cursor.moveToFirst()) { do { EM = new casesModel(); EM.setId(Integer.parseInt(cursor.getString(0))); EM.setAssignedTo(cursor.getString(1)); EM.setLeadName(cursor.getString(2)); EM.setTimeSpent(cursor.getString(3)); EM.setPriority(cursor.getString(4)); EM.setSubjectName(cursor.getString(5)); EM.setCaseID(cursor.getString(6)); EM.setDeadLine(cursor.getString(7)); EM.setStatus(cursor.getString(8)); EM.setCaseRelatedLead(cursor.getString(9)); EM.setSpenthours(cursor.getString(10)); EM.setSpentmintues(cursor.getString(11)); EM.setCaseActivity(cursor.getString(12)); EM.setCaseActivityId(cursor.getString(13)); // Add event to events eventsM.add(EM); } while (cursor.moveToNext()); } return eventsM; } // --------------------------------------------------------------------------- public List<casesModel> getAllCases() { List<casesModel> eventsM = new LinkedList<casesModel>(); // select Event query try { String query = "SELECT * FROM " + table_Cases + " ORDER BY id "; // get reference of the EventDB database SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery(query, null); // parse all results casesModel EM = null; if (cursor.moveToFirst()) { do { EM = new casesModel(); EM.setId(Integer.parseInt(cursor.getString(0))); EM.setAssignedTo(cursor.getString(1)); EM.setLeadName(cursor.getString(2)); EM.setTimeSpent(cursor.getString(3)); EM.setPriority(cursor.getString(4)); EM.setSubjectName(cursor.getString(5)); EM.setCaseID(cursor.getString(6)); EM.setDeadLine(cursor.getString(7)); EM.setStatus(cursor.getString(8)); EM.setCaseRelatedLead(cursor.getString(9)); EM.setSpenthours(cursor.getString(10)); EM.setSpentmintues(cursor.getString(11)); EM.setCaseActivity(cursor.getString(12)); EM.setCaseActivityId(cursor.getString(13)); // Add event to events eventsM.add(EM); } while (cursor.moveToNext()); return eventsM; } }catch (Exception ex){ } return null; } public List<casesModel> getAllCases(String searchKey) { List<casesModel> eventsM = new LinkedList<casesModel>(); // select Event query try { String query = "SELECT * FROM " + table_Cases + " where subjectName LIKE '"+searchKey+"%' "; // get reference of the EventDB databaseg SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery(query, null); // parse all results casesModel EM = null; if (cursor.moveToFirst()) { do { EM = new casesModel(); EM.setId(Integer.parseInt(cursor.getString(0))); EM.setAssignedTo(cursor.getString(1)); EM.setLeadName(cursor.getString(2)); EM.setTimeSpent(cursor.getString(3)); EM.setPriority(cursor.getString(4)); EM.setSubjectName(cursor.getString(5)); EM.setCaseID(cursor.getString(6)); EM.setDeadLine(cursor.getString(7)); EM.setStatus(cursor.getString(8)); EM.setCaseRelatedLead(cursor.getString(9)); EM.setSpenthours(cursor.getString(10)); EM.setSpentmintues(cursor.getString(11)); EM.setCaseActivity(cursor.getString(12)); EM.setCaseActivityId(cursor.getString(13)); // Add event to events eventsM.add(EM); } while (cursor.moveToNext()); return eventsM; } }catch (Exception ex){ } return null; } // Deleting single Event public void deleteEvent(casesModel EM) { // get reference of the EventDB database SQLiteDatabase db = this.getWritableDatabase(); // delete Event db.delete(table_Cases, ID + " = ?", new String[]{String.valueOf(EM.getId())}); db.close(); } public void updateEvent(casesModel EM) { // , String activity_Subject, String activity_Startdate, String start_Hour, String start_Minute, String duration_Hours // ,String activity_Type, String activity_Status, String related_Lead SQLiteDatabase db1 = this.getWritableDatabase(); ContentValues contentValues= new ContentValues(); contentValues.put(assignedTo,EM.getAssignedTo()); contentValues.put(leadName,EM.getLeadName()); contentValues.put(caseRelatedLead,EM.getLeadName()); // contentValues.put(spentTime, EM.getTimeSpent()); contentValues.put(priority,EM.getPriority()); contentValues.put(subjectName, EM.getSubjectName()); contentValues.put(caseID,EM.getCaseID()); contentValues.put(deadLine,EM.getDeadLine()); contentValues.put(status,EM.getStatus()); // contentValues.put(spenthours,EM.getSpenthours()); // contentValues.put(spentmintues,EM.getSpentmintues()); contentValues.put(caseActivity,EM.getCaseActivity()); contentValues.put(caseActivityId,EM.getCaseActivityId()); db1.update(table_Cases, contentValues,"ID=?",new String[] {String.valueOf(EM.getId())}); db1.close(); } // insert event public void insertEvent(casesModel EM) { listFlagInsert=true; SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues= new ContentValues(); contentValues.put(ID, EM.getId()); contentValues.put(assignedTo,EM.getAssignedTo()); contentValues.put(leadName,EM.getLeadName()); contentValues.put(caseRelatedLead,EM.getLeadName()); // contentValues.put(spentTime, EM.getTimeSpent()); contentValues.put(priority,EM.getPriority()); contentValues.put(subjectName, EM.getSubjectName()); // contentValues.put(caseID,EM.getCaseID()); contentValues.put(deadLine,EM.getDeadLine()); contentValues.put(status,EM.getStatus()); // contentValues.put(spenthours,EM.getSpenthours()); // contentValues.put(spentmintues,EM.getSpentmintues()); contentValues.put(caseActivity,EM.getCaseActivity()); contentValues.put(caseActivityId,EM.getCaseActivity()); db.insert(table_Cases, null,contentValues); db.close(); } @Override protected void finalize() throws Throwable { this.close(); super.finalize(); } }
[ "Mariem.Ahmed.Abdelrahman@outlook.com" ]
Mariem.Ahmed.Abdelrahman@outlook.com
2ff674343ed7139308d8f4bc5060821107717fd7
e336f082118dfeaeb84c76e86df33902b1e482d5
/app/src/androidTest/java/com/wong/testdecorator/ExampleInstrumentedTest.java
13b0dfd2010b05a843b4261eb444736a2be9bd4d
[]
no_license
wongkyunban/TestDecorator
2a1a9b66ede8c51b61049a8f5500300f43e18c2b
7be5c0b09b1401ef11dee30ef5e7b648edfc48ae
refs/heads/master
2020-03-06T18:35:02.793632
2018-03-27T15:41:32
2018-03-27T15:41:32
127,009,996
0
0
null
null
null
null
UTF-8
Java
false
false
745
java
package com.wong.testdecorator; 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("com.wong.testdecorator", appContext.getPackageName()); } }
[ "wongkyunban@sina.com" ]
wongkyunban@sina.com
03a47c2dd99629ba1ce120169b25d5f88113716a
36861d7da11ccd6610271e300c2ab0c01b864f6b
/Ecadc/edac/k notes/final project/chat bot/chat-bot/src/main/java/chat/bot/ChatBotApplication.java
e52fac8870f4261c6e2643626e16a7aefeeba73c
[]
no_license
khadepratiksha/finalproject
99a182456e35ecd1a5e9570ac22224fea948d265
79f55b44358bd6012d234cad8520b42d03a69d86
refs/heads/master
2023-03-26T20:08:15.438208
2021-02-26T18:11:16
2021-02-26T18:11:16
342,639,970
0
0
null
null
null
null
UTF-8
Java
false
false
325
java
package chat.bot; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ChatBotApplication { public static void main(String[] args) { SpringApplication.run(ChatBotApplication.class, args); } }
[ "pratikshakhade987@gmail.com" ]
pratikshakhade987@gmail.com
0f1689be15640b123e19d735109c3e76dd86f1d5
ded40e36d7be318549cb0329cb18004e71f47cac
/product/src/main/java/com/imooc/product/dataobject/ProductInfo.java
91f32f3217a13571026484d13ce6acb5739d7ba6
[]
no_license
wushaopei/SpringCloud_Sell
112be9fc896c59c46dd72da16a57406944a6bd1e
cea9bd9a1ce1c2fa3e70b65e22e2545005b85471
refs/heads/master
2020-09-09T09:30:22.495435
2019-11-16T04:36:48
2019-11-16T04:36:48
221,411,683
0
0
null
null
null
null
UTF-8
Java
false
false
948
java
package com.imooc.product.dataobject; import lombok.Data; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import java.math.BigDecimal; import java.util.Date; /** * @ClassName ProductInfo * @Description TODO * @Author wushaopei * @Date 2019/11/14 16:14 * @Version 1.0 */ @Data @Table(name = "Product_Info")// 表名与类名不一致时使用该注解 @Entity public class ProductInfo { @Id private String productId; /** 名字. */ private String productName; /** 单价. */ private BigDecimal productPrice; /** 库存. */ private Integer productStock; /** 描述. */ private String productDescription; /** 小图. */ private String productIcon; /** 状态, 0正常1下架. */ private Integer productStatus; /** 类目编号. */ private Integer categoryType; private Date createTime; private Date updateTime; }
[ "goolMorning_glb@webcode.com" ]
goolMorning_glb@webcode.com
2148d190e1bd99022122eb313db1a8c86cfa1e6f
752b10be5c11bbee07e387c6f6fa318d29d9c79f
/oops/src/example/Main2.java
add9c7076763f0cf97ca851228db0d0329349532
[]
no_license
GangaBhavaniKanda/ctsjavatraining
a5349e73c4521f6b2dd2b7e013b07ac0307bb073
f96f6d16655c2a9705e16a395c909d8f34713835
refs/heads/programs
2022-12-22T05:59:51.422098
2020-03-17T10:43:40
2020-03-17T10:43:40
247,245,320
0
0
null
2022-12-16T14:59:47
2020-03-14T09:12:37
Java
UTF-8
Java
false
false
377
java
//calling vowelscount static method in UserMain package example; import java.util.Scanner; public class Main2 { public static void main(String[] args) { String str; System.out.println("enter input string:"); Scanner s=new Scanner(System.in); str=s.next(); System.out.println("total number of vowels in given string:"+UserMain.countVowels(str)); s.close(); } }
[ "bhavanikanda.007@gmail.com" ]
bhavanikanda.007@gmail.com
197101521018229dcb2e173bca2a9a8260a54583
61eb189a6a7b3281e5659094fb521aef79c878dc
/Ejercicio 1 -Temporizador/src/main/java/com/example/hv12/ejercicio_1_temporizador/ContadorAsincrono.java
62a8e162f8f296330e1bf1a85c1d1beda8b9a734
[]
no_license
mario1023/Guia-3
d560a812f5e768431e2f52d08c12e7e4d804fc8a
ac35918bd573d7bb7e352f081b9bdd968f5d815c
refs/heads/master
2020-03-28T09:54:02.981915
2018-10-04T20:25:43
2018-10-04T20:25:43
148,068,058
0
0
null
null
null
null
UTF-8
Java
false
false
3,392
java
package com.example.hv12.ejercicio_1_temporizador; import android.content.Context; import android.os.AsyncTask; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.TextView; import java.util.concurrent.TimeUnit; /** * Created by admin on 7/9/18. */ public class ContadorAsincrono extends AsyncTask<Integer,Integer,String> { boolean pausa = false; Context context; TextView lblContador,porcentaje; Button btnIniciar; EditText cantidad; ProgressBar progressBar; private String VIGILANTE = "VIGILANTE"; public ContadorAsincrono(Context context, TextView lblContador,Button btnIniciar,EditText cantidad,TextView porcentaje,ProgressBar progressBar) { this.context = context; this.lblContador = lblContador; this.btnIniciar = btnIniciar; this.cantidad = cantidad; this.porcentaje = porcentaje; this.progressBar = progressBar; } @Override protected String doInBackground(Integer... integers) { int i = integers[0]; while (i>=0){ publishProgress(i); i--; esperarUnSegundo(); /** si esta pausado**/ if(pausa==true){ publishProgress(i*-1); synchronized (VIGILANTE){ try { /**realiza pausa en el hilo**/ VIGILANTE.wait(); } catch (InterruptedException e) { e.printStackTrace(); }/**sale del sincronized por lo que ya no hay pausa*/ pausa = false; } } } return "Finalizado"; } @Override protected void onProgressUpdate(Integer... values) { if(values[0]<0) { btnIniciar.setText("REANUDAR"); }else{ progressBar.setProgress(values[0]); porcentaje.setText(values[0]+"%"); lblContador.setText(values[0]+" Seg"); btnIniciar.setText("PAUSAR"); } super.onProgressUpdate(values); } @Override protected void onPreExecute() { super.onPreExecute(); btnIniciar.setText("PAUSAR"); cantidad.setEnabled(false); porcentaje.setVisibility(View.VISIBLE); porcentaje.setText("0%"); progressBar.setProgress(0); if(cantidad.getText().toString().equals("")){ progressBar.setMax(60); }else{ progressBar.setMax(Integer.parseInt(cantidad.getText().toString())); } } @Override protected void onPostExecute(String s) { super.onPostExecute(s); cantidad.setEnabled(true); btnIniciar.setText("INICIAR"); porcentaje.setText("Finalizado"); lblContador.setText("1min"); } private void esperarUnSegundo() { try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException ignore) {} } public boolean esPausa(){ return pausa; } public void pausarContador(){ pausa = true; } /** notifica a VIGILANTE en todas sus llamadas con syncronized**/ public void reanudarContador(){ synchronized (VIGILANTE){ VIGILANTE.notify(); } } }
[ "noreply@github.com" ]
noreply@github.com
5e5110eabd9750bcadd672ed892f00c8059e872a
cfe75c768fdbc186ffc10a7cda75a6cc4205e3e6
/app/src/main/java/com/damage0413/shiyan_2/BiaoGeActivity.java
daa1b1ee9bba4a2f1b86373d4ca7e55f5a591bd0
[]
no_license
Damage0413/ShiYan_2
67b080529b7b88eae7211e6e881cde1340b2ad50
e8426f519845f68ee761633672612bfc6a6790f2
refs/heads/master
2021-02-15T01:55:11.212257
2020-03-04T09:03:01
2020-03-04T09:03:01
244,853,489
0
0
null
null
null
null
UTF-8
Java
false
false
793
java
package com.damage0413.shiyan_2; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; public class BiaoGeActivity extends AppCompatActivity { private Button mBtnttm; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_biao_ge); mBtnttm = (Button) findViewById(R.id.ttm); mBtnttm.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { Intent intent_ttm = new Intent(BiaoGeActivity.this,MainActivity.class); startActivity(intent_ttm); } }); } }
[ "hsy00413@163.com" ]
hsy00413@163.com
610dd4a8afb635dec9004bce13577dd9fce40adb
b1fa9c9f159ffad81a51d86fdc254077f7484466
/myProject-Service2-client/app/src/main/java/com/osk2090/pms/ClientApp.java
79ae080095709c7380366f165c2096fc0210f1be
[]
no_license
osk2090/myProject-Service2
f3a697cd2fc6df6e2bc8faf8a8b59ba81eb94357
3c318b9c40e594b1d048c5ae7f2baa4800b0ac3f
refs/heads/main
2023-06-04T08:51:45.952712
2021-06-17T10:59:59
2021-06-17T10:59:59
347,665,224
0
0
null
null
null
null
UTF-8
Java
false
false
2,308
java
package com.osk2090.pms; import com.osk2090.util.Prompt; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; public class ClientApp { public static void main(String[] args) { ClientApp app = new ClientApp(); try { app.execute(); } catch (Exception e) { System.out.println("클라이언트 실행 중 오류 발생!"); e.printStackTrace(); } } public void execute() throws Exception { // Stateless 통신 방식 while (true) { String choice = String.valueOf(Prompt.promptInt("-Nike-\n-Draw-\n1. 응모자 2. 관리자 3. 당첨자 수령하기 0. 종료")); if (choice.length() == 0) { continue; } if (choice.equalsIgnoreCase("0")) { System.out.println("종료합니다!"); break; } if (!choice.equalsIgnoreCase("1") || !choice.equalsIgnoreCase("2") || !choice.equalsIgnoreCase("3")) { System.out.println("다시 선택해주세요!"); break; } } } private void requestService(String input) { int i = input.indexOf("/"); String command = input.substring(i); String[] values = input.substring(0, i).split(":"); String serverAddress = values[0]; int port = 8080; if (values.length > 1) { port = Integer.parseInt(values[1]); } try (Socket socket = new Socket(serverAddress, port); PrintWriter out = new PrintWriter(socket.getOutputStream()); BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) { out.println(command); out.println(); out.flush(); String line = null; while (true) { line = in.readLine(); if (line.length() == 0) { break; } else if (line.equals("!{}!")) { String choice = String.valueOf(Prompt.promptInt("-Nike-\n-Draw-\n1. 응모자 2. 관리자 3. 당첨자 수령하기 0. 종료")); out.println(choice); out.flush(); } else { System.out.println(line); } } } catch (Exception e) { System.out.println("통신 오류 발생!"); } } }
[ "osk2090@naver.com" ]
osk2090@naver.com
1e38e5f250cd850d23fd3639749d5ac89af5c180
1bb18b4236056fc4e101dc63e98cc7e268d207f3
/produtos/src/main/java/com/br/servico/api/produtos/controllers/TagsController.java
524bac073d26433068c694e0086ef5e03d6ea051
[]
no_license
leonardodantas/ecommerce-java
195a6fdecee4b6b30f375d05a81c43df161e2e25
7083a7f1519f4173ac5557ce6e5d51df1cbc5698
refs/heads/main
2023-08-04T15:30:55.937504
2021-09-08T23:55:49
2021-09-08T23:55:49
404,529,152
0
0
null
null
null
null
UTF-8
Java
false
false
3,432
java
package com.br.servico.api.produtos.controllers; import com.br.servico.api.produtos.models.request.TagRequestDTO; import com.br.servico.api.produtos.models.response.*; import com.br.servico.api.produtos.services.ITagsService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.net.HttpURLConnection; @Api(tags = "Tags") @RestController @RequestMapping("/v1/tags") public class TagsController { @Autowired private ITagsService tagsService; @PostMapping @ApiOperation(value = "Cria uma nova tag", code = 201) @ApiResponses( value = { @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = "Tag criada com sucesso", response = TagsResponseDTO.class), @ApiResponse(code = HttpURLConnection.HTTP_BAD_REQUEST, message = "Requisição negada", response = ErrorResponseDTO.class), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Não autorizado", response = ErrorResponseDTO.class) }) public ResponseEntity<DataResponse> createTag(@Valid @RequestBody TagRequestDTO body){ TagsResponseDTO response = tagsService.createTag(body); return new ResponseEntity<>(DataResponse.builder().data(response).build(), HttpStatus.CREATED); } @GetMapping("/{id}") @ApiOperation(value = "Recuperar tag pelo id") @ApiResponses( value = { @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Tag recuperada", response = TagsResponseDTO.class), @ApiResponse(code = HttpURLConnection.HTTP_BAD_REQUEST, message = "Requisição negada", response = ErrorResponseDTO.class), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Não autorizado", response = ErrorResponseDTO.class) }) public ResponseEntity<DataResponse> getTagId(@PathVariable String id){ TagsResponseDTO response = tagsService.getTagId(id); return new ResponseEntity(DataResponse.builder().data(response).build(), HttpStatus.OK); } @GetMapping @ApiOperation(value = "Recuperar todas as tags") @ApiResponses( value = { @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Lista de tags recuperadas", response = PageTagsResponseDTO.class), @ApiResponse(code = HttpURLConnection.HTTP_BAD_REQUEST, message = "Requisição negada", response = ErrorResponseDTO.class), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Não autorizado", response = ErrorResponseDTO.class) }) public ResponseEntity<PageTagsResponseDTO> getAllTags(@RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "20") int size){ Pageable pageable = PageRequest.of(page, size); PageTagsResponseDTO response = tagsService.getAllTags(pageable); return new ResponseEntity(response, HttpStatus.OK); } }
[ "leonardo1317@yahoo.com.br" ]
leonardo1317@yahoo.com.br
758e7200052488648a06febaa45266f6635f65ab
32d8b3c3a328607806b5173cd72c12b22681a9b3
/Assignment-6/Triangle/TriImpInterf.java
983dc6220789dbb8a303cccfa88d23b4b4d1f0f4
[]
no_license
dilsadmohammed4/Java-Remote-Method-Invocation-RMI
b62162fa990d51e0b90baa3dcd571a59bb76072d
0ce846266a156f64d2d8f11790cc0a4a68f4c8b1
refs/heads/master
2023-02-18T02:35:33.299164
2021-01-19T06:32:36
2021-01-19T06:32:36
330,885,665
1
0
null
null
null
null
UTF-8
Java
false
false
524
java
import java.rmi.*; import java.rmi.server.*; public class TriImpInterf extends UnicastRemoteObject implements TriInterface { public TriImpInterf() throws RemoteException { } public String TriArea(int b, int h, int s) throws RemoteException { double triangleArea, trianglePerimeter; double pi = 3.141; triangleArea = (b * h) / 2; trianglePerimeter = b + h + s; return "Area Of Triangle:" + triangleArea + "\n" + "Perimeter Of Triangle:" + trianglePerimeter; } }
[ "dilsadmohammed4@gmail.com" ]
dilsadmohammed4@gmail.com
44048f4a11fc46923baf7222c272692fe64552bf
f3310622f8675fb3a73be4ff8f8680be6b32ddcd
/export_parent/export_manager_web/src/main/java/com/itheima/web/controller/system/UserController.java
c271d2e26daef5e76af67d046f668892d94d8769
[]
no_license
hejie1234/gitrepository
e21a1b461417d2b51cb78277694775942e8104e9
ec1949319921871f9573083a0682376126ca363e
refs/heads/master
2022-12-23T13:34:27.719135
2019-07-05T02:29:53
2019-07-05T02:29:53
194,876,247
3
0
null
2022-12-16T04:25:09
2019-07-02T14:11:12
JavaScript
UTF-8
Java
false
false
4,552
java
package com.itheima.web.controller.system; import com.github.pagehelper.PageInfo; import com.itheima.common.utils.UtilFuns; import com.itheima.domain.system.Dept; import com.itheima.domain.system.Role; import com.itheima.domain.system.User; import com.itheima.service.system.DeptService; import com.itheima.service.system.RoleService; import com.itheima.service.system.UserService; import com.itheima.web.controller.BaseController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; /** * 用户的控制器 * @author 黑马程序员 * @Company http://www.itheima.com */ @Controller @RequestMapping("/system/user") public class UserController extends BaseController { @Autowired private UserService userService; @Autowired private DeptService deptService; @Autowired private RoleService roleService; /** * 查询所有 * @return */ @RequestMapping("/list") public String list(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "5") int size){ //1.动态获取当前用户的企业id String companyId = "1"; //2.调用service查询 PageInfo pageInfo = userService.findAll(companyId,page,size); //3.存入请求域中 request.setAttribute("page",pageInfo); //4.返回 return "system/user/user-list"; } /** * 前往添加页面 * @return */ @RequestMapping("/toAdd") public String toAdd(){ //1.根据企业id查询所有部门 List<Dept> deptList = deptService.findAll(super.getCurrentUserCompanyId()); //2.存入请求域中 request.setAttribute("deptList",deptList); return "system/user/user-add"; } /** * 保存或者更新用户 * @param user * @return */ @RequestMapping("/edit") public String edit(User user){ user.setCompanyId(super.getCurrentUserCompanyId()); user.setCompanyName(super.getCurrentUserCompanyName()); //1.判断是保存还是更新 if(UtilFuns.isEmpty(user.getId())){ //保存 userService.save(user); }else { //更新 userService.update(user); } //2.重定向到列表页面 return "redirect:/system/user/list.do"; } /** * 前往更新页面 * @param id * @return */ @RequestMapping("/toUpdate") public String toUpdate(String id){ //1.根据id查询用户 User user = userService.findById(id); //2.把查出来的用户存入请求域 request.setAttribute("user",user); //3.根据企业id查询所有部门 List<Dept> deptList = deptService.findAll(super.getCurrentUserCompanyId()); //4.存入请求域中 request.setAttribute("deptList",deptList); //5.前往编辑页面 return "system/user/user-update"; } /** * @param id * @return */ @RequestMapping("/delete") public String delete(String id){ userService.delete(id); return "redirect:/system/user/list.do"; } /** * 前往给用户分配角色的页面 * @param id 用户的id * @return */ @RequestMapping("/roleList") public String roleList(String id){ //1.根据id查询用户 User user = userService.findById(id); //2.获取所有角色 List<Role> roleList = roleService.findAll(super.getCurrentUserCompanyId());//是查询角色表 //3.获取当前用户所具备的角色 用户的角色信息,只包含角色的id即可 List<String> userRoleList = userService.findUserRole(id);//只需要查询角色用户中间表即可 //4.存入请求域中 request.setAttribute("user",user); request.setAttribute("roleList",roleList); request.setAttribute("userRoleStr",userRoleList.toString()); return "system/user/user-role"; } /** * 给用户分配角色 * @return */ @RequestMapping("/changeRole") public String changeRole(@RequestParam("userid") String id,String[] roleIds){ //1.调用service执行给用户分配角色 userService.changeUserRole(id,roleIds); //2.重定向到用户的列表页面 return "redirect:/system/user/list.do"; } }
[ "605217946@qq.com" ]
605217946@qq.com
d5cdcac3e763f1a13f403148838821ff3e48f3d2
fd3e4cc20a58c2a46892b3a38b96d5e2303266d8
/src/main/java/p054u/aly/bv.java
bb77d74d8141324c7ab578c489c94688e8910b7a
[]
no_license
makewheels/AnalyzeBusDex
42ef50f575779b66bd659c096c57f94dca809050
3cb818d981c7bc32c3cbd8c046aa78cd38b20e8a
refs/heads/master
2021-10-22T07:16:40.087139
2019-03-09T03:11:05
2019-03-09T03:11:05
173,123,231
0
0
null
null
null
null
UTF-8
Java
false
false
8,388
java
package p054u.aly; import android.content.Context; import android.content.Intent; import android.net.Uri; import com.tencent.smtt.sdk.WebView; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.StringWriter; import java.math.BigInteger; import java.security.MessageDigest; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; /* compiled from: Helper */ /* renamed from: u.aly.bv */ public class bv { /* renamed from: a */ public static final String f6383a = System.getProperty("line.separator"); /* renamed from: b */ private static final String f6384b = "helper"; /* renamed from: a */ public static String m10055a(String str) { if (str == null) { return null; } try { byte[] bytes = str.getBytes(); MessageDigest instance = MessageDigest.getInstance("MD5"); instance.reset(); instance.update(bytes); bytes = instance.digest(); StringBuffer stringBuffer = new StringBuffer(); for (int i = 0; i < bytes.length; i++) { stringBuffer.append(String.format("%02X", new Object[]{Byte.valueOf(bytes[i])})); } return stringBuffer.toString(); } catch (Exception e) { return str.replaceAll("[^[a-z][A-Z][0-9][.][_]]", bi_常量类.f6358b_空串); } } /* renamed from: b */ public static String m10061b(String str) { try { MessageDigest instance = MessageDigest.getInstance("MD5"); instance.update(str.getBytes()); byte[] digest = instance.digest(); StringBuffer stringBuffer = new StringBuffer(); for (byte b : digest) { stringBuffer.append(Integer.toHexString(b & WebView.NORMAL_MODE_ALPHA)); } return stringBuffer.toString(); } catch (Exception e) { bj.m10001a(f6384b, "getMD5 error", e); return bi_常量类.f6358b_空串; } } /* renamed from: a */ public static String m10053a(File file) { byte[] bArr = new byte[1024]; try { if (!file.isFile()) { return bi_常量类.f6358b_空串; } MessageDigest instance = MessageDigest.getInstance("MD5"); FileInputStream fileInputStream = new FileInputStream(file); while (true) { int read = fileInputStream.read(bArr, 0, 1024); if (read == -1) { fileInputStream.close(); BigInteger bigInteger = new BigInteger(1, instance.digest()); return String.format("%1$032x", new Object[]{bigInteger}); } instance.update(bArr, 0, read); } } catch (Exception e) { e.printStackTrace(); return null; } } /* renamed from: a */ public static String m10052a(Context context, long j) { String str = bi_常量类.f6358b_空串; if (j < 1000) { return ((int) j) + "B"; } if (j < 1000000) { return new StringBuilder(String.valueOf(Math.round(((double) ((float) j)) / 1000.0d))).append("K").toString(); } if (j < 1000000000) { return new StringBuilder(String.valueOf(new DecimalFormat("#0.0").format(((double) ((float) j)) / 1000000.0d))).append("M").toString(); } return new StringBuilder(String.valueOf(new DecimalFormat("#0.00").format(((double) ((float) j)) / 1.0E9d))).append("G").toString(); } /* renamed from: c */ public static String m10064c(String str) { String str2 = bi_常量类.f6358b_空串; try { long longValue = Long.valueOf(str).longValue(); if (longValue < 1024) { return ((int) longValue) + "B"; } if (longValue < 1048576) { return new StringBuilder(String.valueOf(new DecimalFormat("#0.00").format(((double) ((float) longValue)) / 1024.0d))).append("K").toString(); } if (longValue < 1073741824) { return new StringBuilder(String.valueOf(new DecimalFormat("#0.00").format(((double) ((float) longValue)) / 1048576.0d))).append("M").toString(); } return new StringBuilder(String.valueOf(new DecimalFormat("#0.00").format(((double) ((float) longValue)) / 1.073741824E9d))).append("G").toString(); } catch (NumberFormatException e) { return str; } } /* renamed from: a */ public static void m10057a(Context context, String str) { context.startActivity(context.getPackageManager().getLaunchIntentForPackage(str)); } /* renamed from: b */ public static boolean m10062b(Context context, String str) { try { context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str))); return true; } catch (Exception e) { e.printStackTrace(); return false; } } /* renamed from: d */ public static boolean m10066d(String str) { return str == null || str.length() == 0; } /* renamed from: e */ public static boolean m10067e(String str) { if (bv.m10066d(str)) { return false; } String toLowerCase = str.trim().toLowerCase(Locale.US); if (toLowerCase.startsWith("http://") || toLowerCase.startsWith("https://")) { return true; } return false; } /* renamed from: a */ public static String m10051a() { return bv.m10056a(new Date()); } /* renamed from: a */ public static String m10056a(Date date) { if (date == null) { return bi_常量类.f6358b_空串; } return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).format(date); } /* renamed from: a */ public static String m10054a(InputStream inputStream) throws IOException { InputStreamReader inputStreamReader = new InputStreamReader(inputStream); char[] cArr = new char[1024]; StringWriter stringWriter = new StringWriter(); while (true) { int read = inputStreamReader.read(cArr); if (-1 == read) { return stringWriter.toString(); } stringWriter.write(cArr, 0, read); } } /* renamed from: b */ public static byte[] m10063b(InputStream inputStream) throws IOException { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); byte[] bArr = new byte[1024]; while (true) { int read = inputStream.read(bArr); if (-1 == read) { return byteArrayOutputStream.toByteArray(); } byteArrayOutputStream.write(bArr, 0, read); } } /* renamed from: a */ public static void m10059a(File file, byte[] bArr) throws IOException { OutputStream fileOutputStream = new FileOutputStream(file); try { fileOutputStream.write(bArr); fileOutputStream.flush(); } finally { bv.m10060a(fileOutputStream); } } /* renamed from: a */ public static void m10058a(File file, String str) throws IOException { bv.m10059a(file, str.getBytes()); } /* renamed from: c */ public static void m10065c(InputStream inputStream) { if (inputStream != null) { try { inputStream.close(); } catch (Exception e) { } } } /* renamed from: a */ public static void m10060a(OutputStream outputStream) { if (outputStream != null) { try { outputStream.close(); } catch (Exception e) { } } } }
[ "spring@qbserver.cn" ]
spring@qbserver.cn
0d6ccb1ac26f3175f38059ea74a5a152243278bd
11fff9b87c70da2add160aea0809cfdb2ae73cab
/src/main/java/operacionDeCondiciones/Mediana.java
834f7c24272ef035364e0c82b400f4716abe1ede
[]
no_license
alabarque/TP-Dise-o-2017
06ff62f76a8f003feddd6d06288ff5b610e21336
2036f614d87aab2438dbc91e973892485acd239d
refs/heads/master
2020-03-11T09:38:35.088945
2018-04-17T14:43:05
2018-04-17T14:43:05
129,918,014
0
0
null
null
null
null
UTF-8
Java
false
false
1,087
java
package operacionDeCondiciones; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; import javax.persistence.Column; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import condicionesImpuestasPorElUser.CondicionEvaluarPeriodoNAnios; import entidades.Periodo; @Entity @DiscriminatorValue(value="mediana") public class Mediana extends Operacion { public Mediana() { this.nombre = "mediana"; } @Override public Boolean operar(List<Double> list, CondicionEvaluarPeriodoNAnios condicion) { int mediana = list.size()/2; Double valorMediana; if (list.size()%2 == 1) { valorMediana = list.get(mediana); return condicion.cumpleCondicion(valorMediana); } else { valorMediana = list.get(mediana-1) + list.get(mediana) / 2.0; return condicion.cumpleCondicion(valorMediana); } } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String toString() { return this.nombre; } }
[ "agustinlabarc@hotmail.com" ]
agustinlabarc@hotmail.com
01b2ffb30411f8e8e0c69c99176195684cfd44f2
2a458cc45d69b8f034217b5acc51615f3583f6b9
/src/main/java/com/wishlist/conf/filter/AuthenticationSuccessFilter.java
5d7a7f8fb4dc0df80cbd53037d86898aaccaa24d
[]
no_license
odakhovsky/web-wishlist
220bc555530d384db8b8bfe779a884b0e08601a0
6114f32cb4c7804f9c98ca82719a97db62cb4762
refs/heads/dev
2021-01-10T05:47:50.637450
2016-02-26T18:42:15
2016-02-26T18:42:15
51,636,968
3
1
null
2016-02-22T16:12:09
2016-02-13T07:37:59
Java
UTF-8
Java
false
false
1,432
java
package com.wishlist.conf.filter; import com.wishlist.service.IUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.User; import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; import org.springframework.stereotype.Component; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.concurrent.TimeUnit; @Component public class AuthenticationSuccessFilter extends SavedRequestAwareAuthenticationSuccessHandler { @Autowired private IUserService userService; @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws ServletException, IOException { User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); request.getSession().setAttribute("userBean", userService.getByEmail(user.getUsername())); request.getSession().setMaxInactiveInterval((int) TimeUnit.HOURS.toSeconds(48)); super.onAuthenticationSuccess(request, response, authentication); } }
[ "odahovskiy@gmail.com" ]
odahovskiy@gmail.com
d2f31d8af6b39a072cb307cd8804605044d38671
75d7d12e501ebfbcbe868023887176b17a7b1931
/IDEAL/IDEAL/IDEAL-PARENT/IDEAL-COMMON/src/main/java/cn/ideal/common/mapper/AccountMerchantMapper.java
9bd7a42d8945a5c376d10dc0dbded764ca29ae20
[]
no_license
RZZBlackMagic/first_repository
ba48fc0934181da525ce3eb4bd5e7d405a6d6978
35774058fbec5df07c62719bbddf514e730f5125
refs/heads/master
2022-12-27T04:26:45.351129
2020-11-04T09:40:01
2020-11-04T09:40:01
156,545,713
2
0
null
2022-12-16T07:12:41
2018-11-07T12:50:01
JavaScript
UTF-8
Java
false
false
968
java
package cn.ideal.common.mapper; import cn.ideal.common.pojo.AccountMerchant; import cn.ideal.common.pojo.AccountMerchantExample; import org.apache.ibatis.annotations.Param; import java.util.List; public interface AccountMerchantMapper { int countByExample(AccountMerchantExample example); int deleteByExample(AccountMerchantExample example); int deleteByPrimaryKey(Long id); int insert(AccountMerchant record); int insertSelective(AccountMerchant record); List<AccountMerchant> selectByExample(AccountMerchantExample example); AccountMerchant selectByPrimaryKey(Long id); int updateByExampleSelective(@Param("record") AccountMerchant record, @Param("example") AccountMerchantExample example); int updateByExample(@Param("record") AccountMerchant record, @Param("example") AccountMerchantExample example); int updateByPrimaryKeySelective(AccountMerchant record); int updateByPrimaryKey(AccountMerchant record); }
[ "1403741992@qq.com" ]
1403741992@qq.com
3bba8ca7edff380716a777d0cee26ffc5c9bb264
dbca8765c7f412e42acb234e84ed1cd9ba92b7f8
/todoapp/src/test/java/com/redhat/demos/quarkus/todo/NativeApiResourceIT.java
e9513ef05340fe037f08abd3dbf75172caba232a
[]
no_license
jeremyrdavis/quarkus-todo
91f49ee3d4c330c149c92a97f4db9257feb7141b
ef637e43465871e54f7bc060f089709e0cc6219e
refs/heads/master
2020-09-06T03:49:17.548669
2019-12-12T15:18:15
2019-12-12T15:18:15
220,311,616
0
4
null
2020-01-17T23:16:41
2019-11-07T19:17:59
HTML
UTF-8
Java
false
false
215
java
package com.redhat.demos.quarkus.todo; import io.quarkus.test.junit.NativeImageTest; @NativeImageTest public class NativeApiResourceIT extends ApiResourceTest { // Execute the same tests but in native mode. }
[ "jeremyrdavis@mac.com" ]
jeremyrdavis@mac.com
ac22885020fce318377f7a5c5394c56782418dbb
7de95dfb11c10eef5c579289f98c163f5cbe4665
/bibliotheques-annecy-ws/bibliotheques-annecy-ws-webapp/src/main/java/com/bibliotheques/ws/webapp/editionservice/generated/GetListRappelEmpruntEnCoursFault.java
3230f22336acaddbeac58938a8530a30bcdd53f3
[]
no_license
AndreM-1/Projet_10_Amelioration_Systeme_information_bibliotheque
3c134a84fdb2f1140fb0c4356f15f770ee8927fa
f2ba8464678e2025d3dd36e94de45c4f7d9d644c
refs/heads/master
2020-04-08T16:53:18.763607
2019-01-14T14:59:40
2019-01-16T09:31:44
159,540,252
0
0
null
2018-12-26T08:40:34
2018-11-28T17:32:56
Java
UTF-8
Java
false
false
1,665
java
package com.bibliotheques.ws.webapp.editionservice.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>Classe Java pour anonymous complex type. * * <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="faultMessageErreur" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "faultMessageErreur" }) @XmlRootElement(name = "getListRappelEmpruntEnCoursFault") public class GetListRappelEmpruntEnCoursFault { @XmlElement(required = true) protected String faultMessageErreur; /** * Obtient la valeur de la propriété faultMessageErreur. * * @return * possible object is * {@link String } * */ public String getFaultMessageErreur() { return faultMessageErreur; } /** * Définit la valeur de la propriété faultMessageErreur. * * @param value * allowed object is * {@link String } * */ public void setFaultMessageErreur(String value) { this.faultMessageErreur = value; } }
[ "andre_monnier@yahoo.fr" ]
andre_monnier@yahoo.fr
bd4c61a1100d2bef6427703466a68d91fdc5059c
96e6907170072bef530aac34c71c80416cd3754b
/src/test/java/com/anomie/webservice/item/TestSample.java
1671ea593189a63f1ebf00f23e31cef519f3ba96
[]
no_license
anomie7/springBootAndJpaPractice
1fcbbb60a44b868fc312ba56a38b81f68136148f
754b0192f24d060f9f8d9ceb9cf485dddf4c0a50
refs/heads/master
2020-03-28T03:32:38.966428
2018-10-07T11:08:25
2018-10-07T11:08:25
147,653,510
0
0
null
null
null
null
UTF-8
Java
false
false
2,513
java
package com.anomie.webservice.item; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; 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 com.anomie.webservice.category.Category; @RunWith(SpringRunner.class) @DataJpaTest @ActiveProfiles("test") public class TestSample { @Autowired private TestEntityManager entityManager; Category parent; Category actionMovie; Category romanceMovie; Category comedyMovie; @Before public void testCategory() { parent = Category.builder().name("영화").build(); actionMovie = Category.builder().name("액션").build(); romanceMovie = Category.builder().name("로맨스").build(); comedyMovie = Category.builder().name("코메디").build(); parent.addChild(actionMovie); parent.addChild(actionMovie); parent.addChild(actionMovie); parent.addChild(romanceMovie); parent.addChild(comedyMovie); entityManager.persist(parent); Category test = entityManager.find(Category.class, 1L); assertEquals("카테고리 아이디가 일치하지 않습니다.", parent.getId(), test.getId()); assertEquals("자식 객체가 일치하지 않습니다.", actionMovie, test.getChild().get(0)); assertEquals("자식 객체가 일치하지 않습니다.", romanceMovie, test.getChild().get(1)); assertEquals("자식 객체가 일치하지 않습니다.", comedyMovie, test.getChild().get(2)); } @Test public void testItem() { Album album = Album.builder().name("화양연화").price(20000).stockQuantity(450).artist("bts").build(); entityManager.persist(album); Book book = Book.builder().name("노인과 바다").price(10000).stockQuantity(200).author("헤밍웨이").isbn("12200-10") .build(); entityManager.persist(book); Movie movie = Movie.builder().name("안시성").price(12000).stockQuantity(1000).actor("조인성").director("조민기").build(); movie.addCategory(actionMovie); movie.addCategory(comedyMovie); entityManager.persist(movie); Album falbum = entityManager.find(Album.class, 1L); Movie fmovie = entityManager.find(Movie.class, 3L); Book fbook = entityManager.find(Book.class, 2L); Category test = entityManager.find(Category.class, 2L); } }
[ "anomie7777@gmail.com" ]
anomie7777@gmail.com
d23d51eac610834605cf10ca711296275fed223f
e1b883ddd3937ff705bcede151fc453bb9b98e42
/MyJava/DukeCourse/src/com/recommender/Rating.java
e5d61c7a7a1be99a8c84968b14d9598f835440b3
[]
no_license
ecpro/MyJava
ea4610c17cf273e0349be448e28a490656c5ceca
3550c182aa36f6dd9c9dbac32730794cc8ed63c0
refs/heads/master
2021-01-09T20:37:04.699464
2016-07-16T09:45:17
2016-07-16T09:45:17
63,476,061
0
0
null
null
null
null
UTF-8
Java
false
false
860
java
package com.recommender; // An immutable passive data object (PDO) to represent the rating data public class Rating implements Comparable<Rating> { private String item; private double value; public Rating (String anItem, double aValue) { item = anItem; value = aValue; } // Returns item being rated public String getItem () { return item; } // Returns the value of this rating (as a number so it can be used in calculations) public double getValue () { return value; } // Returns a string of all the rating information public String toString () { return "[" + getItem() + ", " + getValue() + "]"; } public int compareTo(Rating other) { if (value < other.value) return -1; if (value > other.value) return 1; return 0; } }
[ "mails4ipiyush@gmail.com" ]
mails4ipiyush@gmail.com
073198681b06614e22f555cb9367cdf089d1a70f
ea23f54907daabf72f72daf6de9bf4c8c82c4395
/src/org/yiouli/leetcode/easy/SymmetricTree.java
43ddbd9775c0061a78a115b2240ca99172c0b337
[]
no_license
yiouli/LeetCode
512afd5d60d739fa1ae5868d92b7a7064156ee48
d3d3c1b958c87fb73b4d781f452d27d13fe678ed
refs/heads/master
2021-01-10T19:24:08.363413
2020-11-24T08:59:45
2020-11-24T08:59:45
25,674,085
0
0
null
null
null
null
UTF-8
Java
false
false
2,005
java
/** * @author Yiou Li */ package org.yiouli.leetcode.easy; import java.util.ArrayList; /** * Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). * For example, this binary tree is symmetric: * * 1 * / \ * 2 2 * / \ / \ * 3 4 4 3 * * But the following is not: * * 1 * / \ * 2 2 * \ \ * 3 3 * * @see <a href="https://oj.leetcode.com/problems/symmetric-tree/">Symmetric Tree on LeetCode</a> */ public class SymmetricTree { /** * Definition for Binary Tree. */ public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } private boolean isSymmetric(TreeNode p, TreeNode q) { if (p == null && q == null) return true; if (p == null || q == null) return false; return p.val == q.val && isSymmetric(p.left, q.right) && isSymmetric(p.right, q.left); } public boolean isSymmetric(TreeNode root) { if (root == null) return true; return isSymmetric(root.left, root.right); } /** * Based on BFS by level. * @param root is the root node of the tree. * @return whether the given tree is symmetric. */ public boolean isSymmetricIterative(TreeNode root) { ArrayList<TreeNode> currentLvl = new ArrayList<TreeNode>(); ArrayList<TreeNode> nextLvl = new ArrayList<TreeNode>(); currentLvl.add(root); while (!currentLvl.isEmpty()) { for (TreeNode node : currentLvl) { if (node != null) { nextLvl.add(node.left); nextLvl.add(node.right); } } int n = nextLvl.size(); for (int i = 0; i < n/2; i++) { TreeNode p = nextLvl.get(i); TreeNode q = nextLvl.get(n-i-1); if (p == null ^ q == null) return false; if (p != null && q != null & p.val != q.val) return false; } ArrayList<TreeNode> temp = currentLvl; currentLvl = nextLvl; nextLvl = temp; nextLvl.clear(); } return true; } }
[ "liyiousu@gmail.com" ]
liyiousu@gmail.com
4db64f38573b55dbfe05bdb41aac6eca1621ccce
f3b3d65d1e007f4d39c12afca28540ca8c9f181d
/dsl/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/src-gen/org/xtext/constraint/mydsl/myDsl/MaxDuration.java
e781299caffa79fa6162a5a0c40fa897987fdabb
[]
no_license
husseinmarah/temporal-based-runtime-monitoring
78c8d8a7867900ef5e324afb743826e0e416eb1c
3edb426583a333321dcbd517bd2082e5370298b8
refs/heads/master
2023-06-17T22:54:29.812616
2021-07-13T14:12:30
2021-07-13T14:12:30
385,620,488
1
0
null
null
null
null
UTF-8
Java
false
false
385
java
/** * generated by Xtext 2.26.0-SNAPSHOT */ package org.xtext.constraint.mydsl.myDsl; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Max Duration</b></em>'. * <!-- end-user-doc --> * * * @see org.xtext.constraint.mydsl.myDsl.MyDslPackage#getMaxDuration() * @model * @generated */ public interface MaxDuration extends Timer { } // MaxDuration
[ "hussein.marah@ymail.com" ]
hussein.marah@ymail.com
8236822d748b638194dadf82ff4c80ac9a3053bd
cd6de96c5c395f0fd2407551d9f02e29f79c7ec3
/Softwareergonomie/Softwareergonomie/src/de/thm/creationPatterns/Models/Produzent.java
ae31b1777e760a434a453e1390ff4a24cd72b80f
[ "MIT" ]
permissive
DavidStahl97/Studium
74b5dba47b6c5a93f973016b8de86a9090b820b4
bb8abf9f243583887e36a97dfd81d8b7e3ea67a4
refs/heads/master
2022-11-23T03:06:04.400646
2020-07-19T09:27:17
2020-07-19T09:27:17
160,153,456
0
0
null
null
null
null
UTF-8
Java
false
false
348
java
package de.thm.creationPatterns.Models; public class Produzent { private String name; public Produzent(String name) { this.name = name; } public Product kaufen(String name) { return new Product(name, this); } @Override public String toString() { return "Produzent: " + name; } }
[ "d.stahl@tus-brandoberndorf.de" ]
d.stahl@tus-brandoberndorf.de
1a7a8b7267fa90877da4dfa1594b213b521cd982
f8853de467fc1a21eb050856fb9e2e3b60a3d13b
/ristes-sem-security-4f03688545e8/src/main/java/mk/ukim/finki/lovefinder/dbUtilities/FindCloseUsersAlgorithm.java
aee9bb9bc49734bc5393924a54fb945e276699b8
[]
no_license
aceslaf/love-finder-prototype
eb327be04395276a73e8896bb4ca22ee96c5350f
cf5a550d1ee3ebb57f02fdf598f9c2494948035c
refs/heads/master
2020-08-09T00:33:31.723467
2014-07-25T09:02:54
2014-07-25T09:02:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package mk.ukim.finki.lovefinder.dbUtilities; import java.util.HashMap; import java.util.Map; import java.util.TreeSet; import mk.ukim.finki.lovefinder.dataholders.Hotspot; import mk.ukim.finki.lovefinder.dataholders.UserIDs; /** * * @author Aleksandar */
[ "aleksandartrposki@gmail.com" ]
aleksandartrposki@gmail.com
ffa7fd564d0865b96f20e05404f1fa507d615d68
59d654d2ed152dee9c8a2a1a25d6f723d38f0e76
/spring-cloud-config-client/src/main/java/com/ideal/remote/HelloRemoteHystrix.java
3e0a41dbc48fd3a289af50522351b2c700b7c25e
[]
no_license
yaloo/spring-cloud-tester
469dc147415c242e38ccc7e092250f287ec2c9df
797166b4c9e76d55efcd9783d2d3207977fb3d14
refs/heads/master
2021-04-25T02:00:01.764958
2018-02-08T08:49:05
2018-02-08T08:49:05
115,606,556
0
1
null
null
null
null
UTF-8
Java
false
false
256
java
package com.ideal.remote; import org.springframework.stereotype.Component; @Component public class HelloRemoteHystrix implements HelloRemote{ @Override public String hello(String name) { return "hello " +name+", this messge send failed "; } }
[ "yaloo@live.cn" ]
yaloo@live.cn
ecf3ac13b3fad4b76b9f45650e51f6bd89d6da2d
c2ab23eb9c301cf1282a197938405ccc564c1adc
/src/mandel/paint/LayerPanel.java
1bc9b293e56269a41747ec93acb1e51d8fc6138e
[]
no_license
mbmandel7/mandel-mco364-fall-2014
ed86a4dd7fa85e86c86ef6b937daddde0815cddc
24a8ee1ae9e6abda22471fbe08be295811570421
refs/heads/master
2016-09-05T14:00:26.405603
2014-12-28T19:51:22
2014-12-28T19:51:22
24,123,734
0
0
null
null
null
null
UTF-8
Java
false
false
1,200
java
package mandel.paint; import java.awt.Color; import java.awt.Graphics2D; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import javax.swing.JButton; import javax.swing.JPanel; public class LayerPanel extends JPanel { private JButton[] layerBtns; private BufferedImage[] images; public LayerPanel(Canvas2 canvas) { this.setLayout(new GridLayout(4, 1)); images = new BufferedImage[4]; layerBtns = new JButton[4]; for (int i = 0; i < layerBtns.length; i++) { BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_ARGB); Graphics2D g = (Graphics2D)image.getGraphics(); g.setBackground(new Color(255, 255, 0, 0)); images[i] = image; layerBtns[i] = new JButton("Layer" + i); this.add(layerBtns[i]); layerBtns[i].addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub canvas.setImage(image); } }); } canvas.setImages(images); canvas.setImage(images[0]); } // public BufferedImage[] getImages(){ // return this.images; // } }
[ "mbmandel7@gmail.com" ]
mbmandel7@gmail.com
d60a4caa9a42bcedbb129877646ab8d42fc6fe8c
0b98218ef2c54245ed6a6361b4b6bbbbebec7c3e
/edpf-parent/edpf-core/src/main/java/com/weds/edpf/core/constant/ScmParams.java
509fa4c0e37798831a8dd6db8a9cee0b865e98fa
[]
no_license
zlibo2019/edpf-parent-new
ba7113310569fab6f039f790eec22f6028e55b4e
f6680e21a542b4a5b96a1eae353ed16b7ec09f21
refs/heads/master
2022-12-03T17:18:25.961834
2020-08-15T01:04:41
2020-08-15T01:04:41
287,652,996
0
0
null
null
null
null
UTF-8
Java
false
false
4,356
java
package com.weds.edpf.core.constant; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Component @ConfigurationProperties(prefix = "weds.scm") public class ScmParams { // SCM根路径 private String rootPath = ""; // SCM Url private String scmUrl = ""; // 档案照片路径 private String photoPath = "wwwroot/photo"; // 人脸照片路径 private String facePath = "wwwroot/face"; // 拍照照片路径 private String framePath ="wwwroot/frame"; // 照片工具路径 private String toolPath; // 车牌照片路径 private String carsPath = ""; // 人脸类型 0 jpg 1 fct private String faceType = "1"; // 访客身份证照片路径 private String visPhotoPath = "wwwroot/photo/vis"; // 考勤照片路径 private String attencePath = "wwwroot/frame"; // 移动端考勤设备序号 private Integer devSerial = 9999999; // 0 卡、1 人脸、2 卡+人脸、3 二维码, 4 二维码+人脸 private String discernType = "2"; // 照片尺寸 private Integer photoSize = 720; // 增量允许的最大条数 private Integer maxNum; // 外勤是否自动审批 private boolean outside; // 人脸照片是否作为档案照片 private boolean userPhoto; // 考勤照片是否增加水印 private boolean watermark; // 订餐扣费方式 private int chargeback = 2; public String getRootPath() { return rootPath; } public void setRootPath(String rootPath) { this.rootPath = rootPath; } public String getScmUrl() { return scmUrl; } public void setScmUrl(String scmUrl) { this.scmUrl = scmUrl; } public String getPhotoPath() { return photoPath; } public void setPhotoPath(String photoPath) { this.photoPath = photoPath; } public String getFacePath() { return facePath; } public void setFacePath(String facePath) { this.facePath = facePath; } public String getFramePath() { return framePath; } public void setFramePath(String framePath) { this.framePath = framePath; } public String getFaceType() { return faceType; } public void setFaceType(String faceType) { this.faceType = faceType; } public String getVisPhotoPath() { return visPhotoPath; } public void setVisPhotoPath(String visPhotoPath) { this.visPhotoPath = visPhotoPath; } public String getDiscernType() { return discernType; } public void setDiscernType(String discernType) { this.discernType = discernType; } public String getCarsPath() { return carsPath; } public void setCarsPath(String carsPath) { this.carsPath = carsPath; } public Integer getMaxNum() { return maxNum; } public void setMaxNum(Integer maxNum) { this.maxNum = maxNum; } public String getAttencePath() { return attencePath; } public void setAttencePath(String attencePath) { this.attencePath = attencePath; } public Integer getDevSerial() { return devSerial; } public void setDevSerial(Integer devSerial) { this.devSerial = devSerial; } public Integer getPhotoSize() { return photoSize; } public void setPhotoSize(Integer photoSize) { this.photoSize = photoSize; } public boolean isOutside() { return outside; } public void setOutside(boolean outside) { this.outside = outside; } public boolean isUserPhoto() { return userPhoto; } public void setUserPhoto(boolean userPhoto) { this.userPhoto = userPhoto; } public boolean isWatermark() { return watermark; } public void setWatermark(boolean watermark) { this.watermark = watermark; } public int getChargeback() { return chargeback; } public void setChargeback(int chargeback) { this.chargeback = chargeback; } public String getToolPath() { return toolPath; } public void setToolPath(String toolPath) { this.toolPath = toolPath; } }
[ "83433430@qq.com" ]
83433430@qq.com
4c9019c36cde9dec263c2efcad468c32eaa2982d
7865cba33f0f0bf1ad89e5db3b7bbff38c50ef67
/app/src/main/java/clases/microbanco/AcercaAcitivity.java
144296cb0b693cf9908d98ff132c0ea8c0c556b7
[ "Apache-2.0" ]
permissive
feliperomero3/MicroBanco
7f718b50a7e7b38dad06c54b524306fe09f86381
ab94c278a59083ff38fe52539249cbc204b0c87e
refs/heads/master
2021-04-28T03:26:40.791960
2020-10-20T04:04:36
2020-10-20T04:04:36
122,138,868
1
0
null
null
null
null
UTF-8
Java
false
false
1,267
java
/* * Copyright (c) 2018 Felipe Romero * * 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 clases.microbanco; import android.app.Activity; import android.os.Bundle; import android.text.method.LinkMovementMethod; import android.widget.TextView; public class AcercaAcitivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_acerca); TextView lblLink = (TextView)findViewById(R.id.lblLink); TextView lblLinkWeb = (TextView)findViewById(R.id.lblLinkWeb); lblLink.setMovementMethod(LinkMovementMethod.getInstance()); lblLinkWeb.setMovementMethod(LinkMovementMethod.getInstance()); } }
[ "feliperomero3@outlook.com" ]
feliperomero3@outlook.com
36664edfce2df5fa201a216efb6731a8a331b7a0
46e1b1f2c7661abb8440a93fd4b464ead182a71f
/mo-core/src/test/java/wang/momo/mocore/MoCoreApplicationTests.java
6c6e231092dea10af4da51cc4ca946c7f01e9119
[ "Apache-2.0" ]
permissive
rhettmm/mo-fast
fc1783a528c9b5ce659fe45b9afa430ca5baa239
b7e84b795e3cfcd51b100fa1cbead974fbcebf80
refs/heads/master
2022-12-25T07:30:29.528697
2020-10-13T17:32:49
2020-10-13T17:32:49
296,372,968
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package wang.momo.mocore; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.TestPropertySource; import org.springframework.transaction.event.TransactionalEventListener; import sun.reflect.generics.tree.VoidDescriptor; @SpringBootTest class MoCoreApplicationTests { }
[ "rhetthj@live.com" ]
rhetthj@live.com
74ec20a7bbade26d921ade3b2621715783f736e9
ef83399ef13771e47b31f8d427905e3788b9029a
/20-spring-examples/spring-examples-aop/src/main/java/com/zenika/bean/BeanFeu.java
04909083918b3bb657161ced97040bb432cf6b27
[]
no_license
regisroy/spring-exercises
120c27cde64ef912c5814dd5cf92bcbedf7eeb71
3c75231cdd729274dd9da3a979aaddea3a11a3dd
refs/heads/master
2020-04-11T14:53:44.618588
2016-09-01T07:43:53
2016-09-01T07:43:53
30,668,650
0
0
null
null
null
null
UTF-8
Java
false
false
411
java
package com.zenika.bean; public class BeanFeu { private String description; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @Override public String toString() { return "BeanFeu{" + "description='" + description + '\'' + '}'; } }
[ "regis.roy@zenika.com" ]
regis.roy@zenika.com
8b18dd9673ab7f48629d66f87bdb3df3c4aea293
1c609693bdaf01134c7a283cb75b5f560ac1009a
/maple-spider/src/main/java/com/iflytek/spider/protocol/httpclient/HttpAuthenticationException.java
66abeec953bafc780ecd2e0f56de235597717872
[]
no_license
sunmeng007/spider
133aad556763878bcb91c83cd81e18b2d90487b6
7b8a62914cc98f2a4b3ab15a8bb0648e89469f44
refs/heads/master
2022-12-21T11:40:30.785575
2015-03-26T13:22:58
2015-03-26T13:22:58
32,913,097
0
0
null
2022-12-09T23:18:36
2015-03-26T07:17:00
Java
UTF-8
Java
false
false
2,427
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 com.iflytek.spider.protocol.httpclient; /** * Can be used to identify problems during creation of Authentication objects. * In the future it may be used as a method of collecting authentication * failures during Http protocol transfer in order to present the user with * credentials required during a future fetch. * * @author Matt Tencati */ public class HttpAuthenticationException extends Exception { /** * Constructs a new exception with null as its detail message. */ public HttpAuthenticationException() { super(); } /** * Constructs a new exception with the specified detail message. * * @param message the detail message. The detail message is saved for later retrieval by the {@link Throwable#getMessage()} method. */ public HttpAuthenticationException(String message) { super(message); } /** * Constructs a new exception with the specified message and cause. * * @param message the detail message. The detail message is saved for later retrieval by the {@link Throwable#getMessage()} method. * @param cause the cause (use {@link #getCause()} to retrieve the cause) */ public HttpAuthenticationException(String message, Throwable cause) { super(message, cause); } /** * Constructs a new exception with the specified cause and detail message from * given clause if it is not null. * * @param cause the cause (use {@link #getCause()} to retrieve the cause) */ public HttpAuthenticationException(Throwable cause) { super(cause); } }
[ "mengsun@iflytek.com" ]
mengsun@iflytek.com
acb2ef413c0d4889d97c6b914ef72174cc8e81c4
cd1c5b3acc72df3ebd5bcaf102783c31537fc3a7
/src/main/java/org/springframework/data/querydsl/binding/QuerydslDefaultBinding.java
736130745ca50e559a86e8f7cd8c2f3c0c56e166
[ "LicenseRef-scancode-generic-cla" ]
no_license
denis554/spring-data-commons
1d92cdafd445c30f2d3f61c82a39afa040c37888
326fa1a6390a98713e06234107400c9a4299a504
refs/heads/master
2020-04-30T16:26:52.369688
2019-03-20T22:08:25
2019-03-21T07:26:30
176,948,302
1
0
null
null
null
null
UTF-8
Java
false
false
2,738
java
/* * Copyright 2015-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.data.querydsl.binding; import java.util.Collection; import java.util.Optional; import org.springframework.util.Assert; import com.querydsl.core.BooleanBuilder; import com.querydsl.core.types.Path; import com.querydsl.core.types.Predicate; import com.querydsl.core.types.dsl.CollectionPathBase; import com.querydsl.core.types.dsl.SimpleExpression; /** * Default implementation of {@link MultiValueBinding} creating {@link Predicate} based on the {@link Path}s type. * Binds: * <ul> * <li><i>{@link java.lang.Object}</i> as {@link SimpleExpression#eq()} on simple properties.</li> * <li><i>{@link java.lang.Object}</i> as {@link SimpleExpression#contains()} on collection properties.</li> * <li><i>{@link java.util.Collection}</i> as {@link SimpleExpression#in()} on simple properties.</li> * </ul> * * @author Christoph Strobl * @author Oliver Gierke * @since 1.11 */ class QuerydslDefaultBinding implements MultiValueBinding<Path<? extends Object>, Object> { /* * (non-Javadoc) * @see org.springframework.data.web.querydsl.QueryDslPredicateBuilder#buildPredicate(org.springframework.data.mapping.PropertyPath, java.lang.Object) */ @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Optional<Predicate> bind(Path<?> path, Collection<? extends Object> value) { Assert.notNull(path, "Path must not be null!"); Assert.notNull(value, "Value must not be null!"); if (value.isEmpty()) { return Optional.empty(); } if (path instanceof CollectionPathBase) { BooleanBuilder builder = new BooleanBuilder(); for (Object element : value) { builder.and(((CollectionPathBase) path).contains(element)); } return Optional.of(builder.getValue()); } if (path instanceof SimpleExpression) { if (value.size() > 1) { return Optional.of(((SimpleExpression) path).in(value)); } return Optional.of(((SimpleExpression) path).eq(value.iterator().next())); } throw new IllegalArgumentException( String.format("Cannot create predicate for path '%s' with type '%s'.", path, path.getMetadata().getPathType())); } }
[ "denisignatenko554@gmail.com" ]
denisignatenko554@gmail.com
ea94969148766bd1a9449ac64c936e8212eb3932
3eb8f2e2a258359e47be65263134d6b6cc3a7770
/src/main/java/com/onlineplay/watcher/entity/Roles.java
263e407f35e9f4b1013acc67b4a93f8792fb2241
[]
no_license
igor-strbac/Movie-and-TV-Shows-online-watching-service--Java-JSP-project
3e6b8d6f62a319124205264e04a49255482a99b5
552413a05e4ad48ea7da3aec9ad140d61f666645
refs/heads/master
2022-03-28T20:47:29.733866
2020-01-14T01:43:50
2020-01-14T01:43:50
232,578,335
0
0
null
null
null
null
UTF-8
Java
false
false
1,952
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.onlineplay.watcher.entity; import java.util.Objects; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; /** * * @author Anđelka */ @Entity @Table(name = "roles") public class Roles { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id_role") private int id_role; @Column(name = "role") private String role; public Roles() { } public Roles(int id_role, String role) { this.id_role = id_role; this.role = role; } public int getId_role() { return id_role; } public void setId_role(int id_role) { this.id_role = id_role; } public String getRole() { return role; } public void setRole(String role) { this.role = role; } @Override public int hashCode() { int hash = 5; hash = 61 * hash + this.id_role; hash = 61 * hash + Objects.hashCode(this.role); return hash; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Roles other = (Roles) obj; if (this.id_role != other.id_role) { return false; } if (!Objects.equals(this.role, other.role)) { return false; } return true; } @Override public String toString() { return "Roles{" + "id_role=" + id_role + ", role=" + role + '}'; } }
[ "57333682+igor-strbac@users.noreply.github.com" ]
57333682+igor-strbac@users.noreply.github.com
adcbc2c5257e477efcbe1e697778b5c2e646b0f2
db9c686dfedb5b0e501bbd02eb728915ee3a24ca
/app/src/main/java/rm/com/jooornal/ui/fragment/StudentPageFragment.java
577d11b1cacc2c6552c23a52947ce18dbb76301b
[]
no_license
alxrm/Jooornal
75c2cc954e7ce5bd99973ed75caae910bed9a6d1
408dd6b6715e3190c254a0a236c793c18ed9cf0f
refs/heads/master
2021-01-20T11:14:33.295287
2017-03-16T12:02:10
2017-03-16T12:02:10
79,158,001
1
0
null
null
null
null
UTF-8
Java
false
false
5,604
java
package rm.com.jooornal.ui.fragment; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.design.widget.TabLayout; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import butterknife.BindView; import java.util.Arrays; import java.util.List; import rm.com.jooornal.R; import rm.com.jooornal.data.entity.Student; import rm.com.jooornal.ui.MainActivity; import rm.com.jooornal.ui.adapter.StudentPagerAdapter; import rm.com.jooornal.util.Conditions; import rm.com.jooornal.util.Converters; import static rm.com.jooornal.constant.Navigation.STUDENT_PAGE_TITLES; /** * экран с полной информацией о студенте */ public final class StudentPageFragment extends BaseFragment { private static final String KEY_STUDENT = "KEY_STUDENT"; @BindView(R.id.student_page_slider) ViewPager pager; private TabLayout tabs; private Student student; /** * создание экрана с информацией о студенте * * @param student объект студента(данные) * @return объект экрана */ public static StudentPageFragment newInstance(@NonNull Student student) { final Bundle args = new Bundle(); final StudentPageFragment fragment = new StudentPageFragment(); args.putParcelable(KEY_STUDENT, student); fragment.setArguments(args); return fragment; } /** * создание интерфейса экрана * * @param inflater объект создания объекта интерфейса из XML вёрстки * @param container родительский объект интерфейса * @param savedInstanceState сохранённое состояние экрана(не используется) * @return объект созданного интерфейса */ @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_student_page, container, false); } /** * интерфейс создан, привязка данных * * @param view корневой элемент, в котором отрисовываются элементы экрана * @param savedInstanceState сохранённое состояние, не используется здесь */ @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); setupTabs(); pager.setAdapter(getSectionsPagerAdapter()); pager.setOffscreenPageLimit(3); tabs.setupWithViewPager(pager); setupTabTitles(tabs); } /** * интерфейс отсоединён от контейнера, нужно очистить вкладки и спрятать их */ @Override public void onDestroyView() { super.onDestroyView(); toggleTabs(false); } /** * распаковка аргументов, переданных при создании экрана * * @param args сами параметры с пометкой, что они не пустые */ @Override protected void unwrapArguments(@NonNull Bundle args) { super.unwrapArguments(args); student = args.getParcelable(KEY_STUDENT); } /** * получение заголовка экрана * * @return строка с заголовком */ @NonNull @Override String getTitle() { return Converters.shortNameOf(student); } /** * есть ли в экране кнопка перехода назад в верхнем баре * * @return флаг наличия кнопки */ @Override boolean hasBackButton() { return true; } /** * является ли экран вложенным * * @return флаг вложенности */ @Override boolean isNested() { return false; } /** * показать/спрятать вкладки * * @param show флаг, отвечающий за показ */ private void toggleTabs(boolean show) { if (tabs != null) { tabs.setVisibility(show ? View.VISIBLE : View.GONE); } } /** * заполнение вкладок */ private void setupTabs() { final MainActivity activity = (MainActivity) getActivity(); Conditions.checkNotNull(activity, "Activity cannot be null"); tabs = activity.getTabs(); tabs.removeAllTabs(); tabs.setVisibility(View.VISIBLE); } /** * инициализация экранов, которые будут отображаться под вкладками * * @return обёртка над списком экранов */ @NonNull private StudentPagerAdapter getSectionsPagerAdapter() { final List<BaseContentFragment> pages = Arrays.asList(StudentInfoFragment.newInstance(student), StudentMessagesFragment.newInstance(student.getSmsList()), StudentCallsFragment.newInstance(student.getCalls())); return new StudentPagerAdapter(getChildFragmentManager(), pages); } /** * инициализация названий вкладок * * @param tabs объект вкладок */ private void setupTabTitles(@NonNull TabLayout tabs) { for (int i = 0; i < tabs.getTabCount(); i++) { final TabLayout.Tab tab = tabs.getTabAt(i); if (tab != null) { tab.setText(STUDENT_PAGE_TITLES.get(i)); } } } }
[ "rupta3@gmail.com" ]
rupta3@gmail.com
708975b96232c573d5605dc4db7959d5c019b2c0
1da050dab57a3bfb1951b459cc964030d3dabcb8
/prj_code/xl/MyTeachBaseDao/src/org/xuliang/vo/BaseVO.java
9fa3c232c922290a75a542c341ff3c4036369fb2
[]
no_license
fy-fenty/google-code
e6465f29202fc70404f98742c8ebb26b3bd6b418
afb88780ff340beabc57dacd97c3152d9faaa473
refs/heads/master
2021-08-02T12:09:32.430582
2012-08-29T08:58:27
2012-08-29T08:58:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
936
java
package org.xuliang.vo; /** * @author xuliang * @date 2012-08-12 * @class BaseVO * @extends Object * @description 基础VO,用于跟页面数据交互.提供分页参数 */ public class BaseVO implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * 当前页的第一条记录编号 */ protected int start = 0; /** * 每页记录数,默认为20 */ protected int limit = 20; public int getStart() { return start <= 0 ? 0 : start; } public void setStart(int start) { this.start = start; } public int getLimit() { return limit; } public void setLimit(int limit) { this.limit = limit; } /* * public int getPageNo() { return (int)(this.start / this.limit) + 1; } * * public int getPageSize() { return this.limit; } * * public int getFirst() { return ((getPageNo() - 1) * getPageSize()) + 1; } */ }
[ "Luveelin@gmail.com" ]
Luveelin@gmail.com
e0ce9899aeaae27f38890fcf866460be674581e2
62176f0140a748f432aa00ccae2ea40dd4be65bd
/src/net/ccgames/rl/MainApplication.java
c0d5c7d7318f1bc46639f5e034201a96b467ab14
[]
no_license
enterth3r4in/BasicRoguelike
40ab14faa51b2651bee660c8182ce550047d81cc
2e07f3002db5c340b39eb549bc6e5c3d7205ddfa
refs/heads/master
2021-01-10T12:38:25.668694
2016-04-07T20:44:20
2016-04-07T20:44:20
55,436,271
0
0
null
null
null
null
UTF-8
Java
false
false
1,349
java
package net.ccgames.rl; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JFrame; import asciiPanel.AsciiPanel; import net.ccgames.rl.screen.Screen; import net.ccgames.rl.screen.ScreenMainMenu; import net.ccgames.rl.utility.MenuColoring; public class MainApplication extends JFrame implements KeyListener { private static final long serialVersionUID = -7012735746570763680L; private static final int WIDTH = 120; private static final int HEIGHT = 40; AsciiPanel terminal; Screen screen; public MainApplication() { super(); terminal = new AsciiPanel(WIDTH, HEIGHT); add(terminal); pack(); screen = new ScreenMainMenu(); addKeyListener(this); repaint(); } public static void main(String[] args) { MainApplication application = new MainApplication(); application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); application.setVisible(true); application.setLocationRelativeTo(null); } public void repaint() { terminal.clear(); terminal.setDefaultForegroundColor(MenuColoring.menuColor); screen.displayOutput(terminal); super.repaint(); } @Override public void keyPressed(KeyEvent ke) { screen = screen.respondToUserInput(ke); repaint(); } @Override public void keyReleased(KeyEvent arg0) {} @Override public void keyTyped(KeyEvent arg0) {} }
[ "believe.the.rain@gmail.com" ]
believe.the.rain@gmail.com
36f993d3b19d2567472696f81adda7c2eb1944bf
1a8749ca4fd442a4e06b9b1f9f34f211d9d938f3
/chapter08/src/com/itheima/test/MybatisTest.java
a591c0206de2184decea80f3b83d0df2a38ecfaf
[]
no_license
dengliangxing/javaweb
2836a5f4072f3a1dae91f1d16f0e987c683f291c
a44e902bdb2e23532d588ea164b9e3cd7efd0181
refs/heads/master
2020-03-17T05:33:44.423050
2018-05-21T11:49:25
2018-05-21T11:49:25
133,285,031
0
0
null
null
null
null
UTF-8
Java
false
false
4,245
java
package com.itheima.test; import java.util.ArrayList; import java.util.List; import org.apache.ibatis.session.SqlSession; import org.junit.Test; import com.itheima.po.Customer; import com.itheima.utils.MybatisUtils; public class MybatisTest { /** * 根据客户姓名和职业组合条件查询客户信息列表 */ @Test public void findCustomerByNameAndJobsTest(){ // 通过工具类生成SqlSession对象 SqlSession session = MybatisUtils.getSession(); // 创建Customer对象,封装需要组合查询的条件 Customer customer = new Customer(); customer.setUsername("jack"); customer.setJobs("teacher"); //执行SqlSession的查询方法,返回结果集 List<Customer> customers = session.selectList("com.itheima.mapper" + ".CustomerMapper.findCustomerByNameAndJobs",customer); // 输出查询结果信息 for (Customer customer2 : customers) { // 打印输出结果 System.out.println(customer2); } // 关闭SqlSession session.close(); } /** * 根据客户姓名或职业查询客户信息列表 */ /*@Test public void findCustomerByNameOrJobsTest(){ // 通过工具类生成SqlSession对象 SqlSession session = MybatisUtils.getSession(); // 创建Customer对象,封装需要组合查询的条件 Customer customer = new Customer(); // customer.setUsername("jack"); // customer.setJobs("teacher"); // 执行SqlSession的查询方法,返回结果集 List<Customer> customers = session.selectList("com.itheima.mapper" + ".CustomerMapper.findCustomerByNameOrJobs",customer); // 输出查询结果信息 for (Customer customer2 : customers) { // 打印输出结果 System.out.println(customer2); } // 关闭SqlSession session.close(); } *//** * 更新客户 *//* @Test public void updateCustomerTest() { // 获取SqlSession SqlSession sqlSession = MybatisUtils.getSession(); // 创建Customer对象,并向对象中添加数据 Customer customer = new Customer(); customer.setId(3); customer.setPhone("13311111234"); // 执行SqlSession的更新方法,返回的是SQL语句影响的行数 int rows = sqlSession.update("com.itheima.mapper" + ".CustomerMapper.updateCustomer", customer); // 通过返回结果判断更新操作是否执行成功 if(rows > 0){ System.out.println("您成功修改了"+rows+"条数据!"); }else{ System.out.println("执行修改操作失败!!!"); } // 提交事务 sqlSession.commit(); // 关闭SqlSession sqlSession.close(); } *//** * 根据客户编号批量查询客户信息 *//* @Test public void findCustomerByIdsTest(){ // 获取SqlSession SqlSession session = MybatisUtils.getSession(); // 创建List集合,封装查询id List<Integer> ids=new ArrayList<Integer>(); ids.add(1); ids.add(2); // 执行SqlSession的查询方法,返回结果集 List<Customer> customers = session.selectList("com.itheima.mapper" + ".CustomerMapper.findCustomerByIds", ids); // 输出查询结果信息 for (Customer customer : customers) { // 打印输出结果 System.out.println(customer); } // 关闭SqlSession session.close(); } *//** * bind元素的使用:根据客户名模糊查询客户信息 *//* @Test public void findCustomerByNameTest(){ // 通过工具类生成SqlSession对象 SqlSession session = MybatisUtils.getSession(); // 创建Customer对象,封装查询的条件 Customer customer =new Customer(); customer.setUsername("j"); // 执行sqlSession的查询方法,返回结果集 List<Customer> customers = session.selectList("com.itheima.mapper" + ".CustomerMapper.findCustomerByName", customer); // 输出查询结果信息 for (Customer customer2 : customers) { // 打印输出结果 System.out.println(customer2); } // 关闭SqlSession session.close(); }*/ }
[ "dengliangxing@gmail.com" ]
dengliangxing@gmail.com
c49818d7173e151262753245e7250311095c4f46
06b3ff22d9109ddcc981d551405045dacb6c3829
/mvprxremd/src/main/java/com/xq/mvprxremd/generalframework/adapter/MovieAdapter.java
22662c7b1e3a35f2bfff3ca937044fb23833a2d9
[]
no_license
ZhangZeQiao/GeneralFramework
fdeb117e82fc0d503f7d1b993a13d3b09653975b
3886a70881b8841183f3cb3fce935cef08553e10
refs/heads/master
2021-01-01T16:09:26.990795
2018-06-29T07:33:37
2018-06-29T07:33:37
97,781,682
1
0
null
null
null
null
UTF-8
Java
false
false
3,133
java
package com.xq.mvprxremd.generalframework.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.xq.mvprxremd.R; import com.xq.mvprxremd.generalframework.bean.Movies; import java.util.List; /** * @author 小侨 * @time 2017/7/24 10:49 * @desc movie列表adapter * <p> * 基本流程的adapter,为了不重复操作,用 QuickRlvAdapter */ public class MovieAdapter extends RecyclerView.Adapter<MovieAdapter.MovieViewHolder> { private Context mContext; private List<Movies.SubjectsBean> mSubjects; public MovieAdapter(Context context, List<Movies.SubjectsBean> subjects) { mContext = context; mSubjects = subjects; } /** * 自定义ViewHolder **/ public class MovieViewHolder extends RecyclerView.ViewHolder { private ImageView ivPoster; private TextView tvTitle; private TextView tvAverage; public MovieViewHolder(View itemView) { super(itemView); ivPoster = (ImageView) itemView.findViewById(R.id.iv_poster); tvTitle = (TextView) itemView.findViewById(R.id.tv_title); tvAverage = (TextView) itemView.findViewById(R.id.tv_average); } } /** * 创建ViewHolder **/ @Override public MovieViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { // TODO: 最佳inflate写法 View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_movie, parent, false); return new MovieViewHolder(itemView); } /** * 将数据与ViewHolder绑定 **/ @Override public void onBindViewHolder(MovieViewHolder holder, int position) { // 数据绑定 final Movies.SubjectsBean bean = mSubjects.get(position); holder.tvTitle.setText(bean.title); holder.tvAverage.setText(bean.rating.average + ""); Glide.with(mContext) .load(bean.images.medium) .diskCacheStrategy(DiskCacheStrategy.ALL) // 加快显示速度:缓存在本地磁盘 .into(holder.ivPoster); // 设置各控件点击监听 holder.ivPoster.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(mContext, "这是《" + bean.title + "》的图片", Toast.LENGTH_LONG).show(); } }); // 设置item点击监听(最笨/快捷的方法) holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(mContext, "《" + bean.title + "》", Toast.LENGTH_LONG).show(); } }); } @Override public int getItemCount() { return mSubjects.size(); } }
[ "571129524@qq.com" ]
571129524@qq.com
055c09ba79ecdfc5a637b4b91e9680958213ff7a
cc1c2c2c3d6295feccb045a66189031cb1f17b89
/app/src/main/java/com/example/musicapplication/bean/Sheet.java
9932d35118c123d82f24b6b34ea66eee3893ae87
[]
no_license
ladyluck12/DMusic
31ddd3b417958456a8767de1efab41c44ce3723b
577240f8a7d8e0d5abdce1fec71e4e346cede960
refs/heads/master
2023-06-12T07:41:12.223469
2021-07-04T06:12:31
2021-07-04T06:12:31
382,776,714
0
0
null
null
null
null
UTF-8
Java
false
false
1,552
java
package com.example.musicapplication.bean; import java.io.Serializable; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; public class Sheet implements Serializable { private String name; private List<Song> list; public Sheet() { name="New List"; list=new ArrayList<>(); } public Sheet(String name){ this.name=name; list=new ArrayList<>(); } public Sheet(String name, int type){ this.name=name; switch(type){ case 0: list=new ArrayList<>(); break; case 1: list=new LinkedList<>(); break; default:break; } } public String getName() { return name; } public List<Song> getList() { return list; } public void setList(java.util.List<Song> musicList){ list=musicList; } public void add(Song music){ list.add(music); } public void remove(Song music){ list.remove(music); } public String getNumString(){ if(list!=null) { return " " + list.size() + " 首音乐"; } return " " + 0 + " 首音乐"; } public boolean contains(Song song){ return list.contains(song); } public void addFirst(Song music){ if(list instanceof LinkedList) { ((LinkedList<Song>) list).addFirst(music); } } }
[ "66951898+ladyluck12@users.noreply.github.com" ]
66951898+ladyluck12@users.noreply.github.com
0a04bebe9f3799a39ea6d831a61df6ee3bd5f037
c426f7b90138151ffeb50a0d2c0d631abeb466b6
/inception/inception-ui-dashboard/src/main/java/de/tudarmstadt/ukp/inception/ui/core/dashboard/settings/layers/ProjectLayersPage.java
335c4313536e01087558d1fb626b2066b5099ed0
[ "Apache-2.0" ]
permissive
inception-project/inception
7a06b8cd1f8e6a7eb44ee69e842590cf2989df5f
ec95327e195ca461dd90c2761237f92a879a1e61
refs/heads/main
2023-09-02T07:52:53.578849
2023-09-02T07:44:11
2023-09-02T07:44:11
127,004,420
511
141
Apache-2.0
2023-09-13T19:09:49
2018-03-27T15:04:00
Java
UTF-8
Java
false
false
1,831
java
/* * Licensed to the Technische Universität Darmstadt under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The Technische Universität Darmstadt * 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. * * 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 de.tudarmstadt.ukp.inception.ui.core.dashboard.settings.layers; import static de.tudarmstadt.ukp.clarin.webanno.ui.core.page.ProjectPageBase.NS_PROJECT; import static de.tudarmstadt.ukp.clarin.webanno.ui.core.page.ProjectPageBase.PAGE_PARAM_PROJECT; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.wicketstuff.annotation.mount.MountPath; import de.tudarmstadt.ukp.clarin.webanno.ui.project.layers.ProjectLayersPanel; import de.tudarmstadt.ukp.inception.ui.core.dashboard.settings.ProjectSettingsDashboardPageBase; @MountPath(NS_PROJECT + "/${" + PAGE_PARAM_PROJECT + "}/settings/layers") public class ProjectLayersPage extends ProjectSettingsDashboardPageBase { private static final long serialVersionUID = 5889016668816051716L; public ProjectLayersPage(PageParameters aParameters) { super(aParameters); } @Override protected void onInitialize() { super.onInitialize(); add(new ProjectLayersPanel("panel", getProjectModel())); } }
[ "richard.eckart@gmail.com" ]
richard.eckart@gmail.com
8731687e2a26d07e0c842482957924fab06ea4f5
c42c392b2b31fbc5fa6a90cc2eca82a8a9da0e09
/app/src/main/java/com/example/nithin/personalexpensemanager/ViewPagerAdapter.java
0b7baa7ad8db4da12e3eead430fcbb0181939c51
[]
no_license
nithinjacob111/PersonalExpenseManager
438d6477390184a3596d93bf92e1d29f5c9f873e
084fb6e0bf3d861f5b78e21cde919902fb9349f6
refs/heads/master
2021-01-20T08:38:20.944655
2017-09-17T18:31:42
2017-09-17T18:31:42
101,501,951
0
0
null
null
null
null
UTF-8
Java
false
false
1,154
java
package com.example.nithin.personalexpensemanager; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import java.util.ArrayList; import java.util.List; /** * Created by nithin on 4/9/17. */ public class ViewPagerAdapter extends FragmentPagerAdapter { private final List<Fragment> mFragmentList = new ArrayList<>(); private final List<String> mFragmentTitleList = new ArrayList<>(); public ViewPagerAdapter(FragmentManager manager) { super(manager); } @Override public Fragment getItem(int position) { return mFragmentList.get(position); } @Override public int getCount() { return mFragmentList.size(); } public void addFragment(Fragment fragment, String title) { mFragmentList.add(fragment); mFragmentTitleList.add(title); } @Override public CharSequence getPageTitle(int position) { return mFragmentTitleList.get(position); } @Override public int getItemPosition(Object object){ return super.getItemPosition(object); } }
[ "nithinjacob27@gmail.com" ]
nithinjacob27@gmail.com
61d75894e671ee0d26c87bf0d2c8d5c7f8ace093
3bf649e468660b2ab05a11d4d7514aa0cc320baa
/MS5/funktionalePrototypen/client/app/src/main/java/de/rfunk/hochschulify/adapters/CourseBookmarkAdapter.java
b24ad1dc6f323822278e99f52cb6e77ffbe18093
[]
no_license
Plsr/EISWS1516MaemeckePoplawski
73e4f8bc90220af1c1a29df70a26e753e4e9339c
e70019783a84bfa43fd4e332037bcbc903090493
refs/heads/master
2020-05-20T19:26:54.977986
2016-01-17T18:46:21
2016-01-17T18:46:31
43,737,709
0
0
null
null
null
null
UTF-8
Java
false
false
2,543
java
package de.rfunk.hochschulify.adapters; import android.content.Context; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import org.w3c.dom.Text; import java.util.List; import de.rfunk.hochschulify.R; import de.rfunk.hochschulify.pojo.Course; import de.rfunk.hochschulify.pojo.Entry; /** * Created by Cheese on 12/01/16. */ public class CourseBookmarkAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { public interface CourseAdapterInterface { public void onItemClick(int position); } private Context mContext; private List<Course> mCourses; private CourseAdapterInterface mListener; public CourseBookmarkAdapter(Context context, List<Course> courses, CourseAdapterInterface listener) { mContext = context; mCourses = courses; mListener = listener; } public static class ViewHolderEntry extends RecyclerView.ViewHolder { TextView courseTitle; TextView universityName; CardView cardView; public ViewHolderEntry(View itemView) { super(itemView); courseTitle = (TextView) itemView.findViewById(R.id.course_title); universityName = (TextView) itemView.findViewById(R.id.university_name); cardView = (CardView) itemView.findViewById(R.id.card_view); itemView.setTag(this); } } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.course_card, parent, false); return new ViewHolderEntry(v); } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { final Course course = mCourses.get(position); TextView title = ((ViewHolderEntry) holder).courseTitle; TextView uniname = ((ViewHolderEntry) holder).universityName; CardView cardView = ((ViewHolderEntry) holder).cardView; title.setText(course.getName()); uniname.setText(course.getUniversity().getName()); cardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mListener.onItemClick(position); } }); } @Override public int getItemCount() { return mCourses.size(); } }
[ "timo@maemecke.com" ]
timo@maemecke.com
afbb93677f0ac1507d5e6c445135f086dd1f2ed2
b6bb2f56ffc26bec7e541735f7616906004fbff5
/src/com/leslie/realm/entity/mob/Player.java
f9802670a1867567001ce25fd5e466edc17f473e
[]
no_license
LesGayard/RealmOfGod
44492a54c2f89e628c61299108b63afe618ff397
a2a973ece30fb9b7951d7e2915ed15d86987418f
refs/heads/master
2023-06-21T21:35:49.027561
2021-07-11T15:41:26
2021-07-11T15:41:26
381,772,070
0
0
null
null
null
null
UTF-8
Java
false
false
2,516
java
package com.leslie.realm.entity.mob; import com.leslie.realm.graphics.Screen; import com.leslie.realm.graphics.Sprite; import com.leslie.realm.input.Keyboard; public class Player extends Mob{ private Keyboard input; /* Create a sprite for the player animation */ private Sprite sprite; private int animate; private boolean walking; /* CONSTRUCTORS */ public Player(Keyboard input){ this.input = input; } /* created at a specific location */ public Player(int x, int y, Keyboard input){ this.x = x; this.y = y; this.input = input; } /* Change the inputs of the player*/ @Override public void update(){ if (animate < 8500) animate ++; else animate = 0; int xMove = 0; int yMove = 0; if(input.up) yMove--; if(input.down) yMove++; if(input.left) xMove--; if(input.right) xMove++; if(xMove != 0 || yMove != 0) { move(xMove,yMove); this.walking = true; }else{ this.walking = false; } } @Override public void render(Screen screen){ int flip = 0; if(direction == 1) { this.sprite = Sprite.playerRight; // East if(walking){ if(animate %20 > 10){ this.sprite = Sprite.playerRight01; }else{ this.sprite = Sprite.playerRight02; } } } if(direction == 3) { this.sprite = Sprite.playerLeft; // West if(walking){ if(animate %20 > 10){ this.sprite = Sprite.playerLeft01; }else{ this.sprite = Sprite.playerLeft02; } } } if(direction == 2) { this.sprite = Sprite.playerBack; //South if(walking){ if(animate %20 > 10){ this.sprite = Sprite.playerBack01; }else{ this.sprite = Sprite.playerBack02; } } } if(direction == 0) { this.sprite = Sprite.playerFront; if(walking){ if(animate %20 > 10){ this.sprite = Sprite.playerFront01; }else{ this.sprite = Sprite.playerFront02; } } } screen.renderPlayer(x,y, sprite,flip); } }
[ "leslie.123@hotmail.fr" ]
leslie.123@hotmail.fr
39cfd293b013ba6477539699f3260077d5dc78cc
83d48417e11998732ae357b68ff2032c6016df12
/FirstAkkaApplication/src/main/java/org/cmontemu/books/akka/essentials/first/mapreduce/messages/MapData.java
5d5b5b48659664ddb1daca0a79ad3dea0714b76a
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
chakra-coder/akka-essentials-java
8c91b2850cc00bbb570200a41d4446f06d1a109c
08d2a891c50c3cf555d3f2b46fd7d12d845e55a4
refs/heads/master
2021-05-27T08:36:27.222235
2013-11-15T17:57:32
2013-11-15T17:57:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
112
java
package org.cmontemu.books.akka.essentials.first.mapreduce.messages; /** * */ public final class MapData { }
[ "carlos.montemuino@gmail.com" ]
carlos.montemuino@gmail.com
abb4c5b3d0542382c773317eaf4eda3551593121
9dc939133c9865b0a64ac4a4b0adb3adacecddf0
/Debugging/src/debugging/Debugging_9.java
838ca47ffa40c0e60780328cffa3a67d9c7a3e2e
[]
no_license
jrivasdam19/Entornos_de_desarrollo
8a83e09c5486601bac2f6e4286e52333c7ba918a
4b581d2c26f6176bf9592d96e09299940262a114
refs/heads/master
2022-07-04T05:33:21.934349
2020-05-09T12:12:51
2020-05-09T12:12:51
262,255,134
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package debugging; public class Debugging_9 { static int suma_n_impares(int n) { int suma = 0; for (int i = 1; i <= n; i++) { suma += 2 * i - 1; } return (suma); } public static void main(String[] args) { int n; System.out.println("Introduzca un número: "); n = Entrada.entero(); System.out.println("La suma de los " + n + " primeros impares es: " + suma_n_impares(n)); } }
[ "jrivas@cifpfbmoll.eu" ]
jrivas@cifpfbmoll.eu
f46e1690294d7c028dead349ce14c867c999133b
f06026a2065ab92978d5550401ae6347bbcda5d4
/exercise42-challenge02/src/main/java/challenges/Challenge02.java
610fa46e495b5c20359286a75d81d4b0c07c0264
[]
no_license
Dbug100/Murphy-a04
b42e07e982a7e179c613b1e43507600bfe02d9ff
ed78d4b0a4c3a915d43f2e1e364a78be3e8e616e
refs/heads/main
2023-08-31T18:21:35.130680
2021-10-20T02:57:05
2021-10-20T02:57:05
417,349,117
0
0
null
null
null
null
UTF-8
Java
false
false
707
java
package challenges; /* * UCF COP3330 Fall 2021 Assignment 4 Solution * Copyright 2021 Deaja Murphy */ import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; public class Challenge02 { public static void main(String[] args) throws IOException { //open file BufferedReader file = new BufferedReader(new FileReader("data/exercise42_input.txt")); ArrayList<String> employee = new ArrayList<>(); //call readNames ReadNames rn = new ReadNames(); rn.readNames(file, employee); //call printNames rn.printNames(employee); //close input file file.close(); } }
[ "deaja214@gmail.com" ]
deaja214@gmail.com
0ef8c8d58ee70b6a38e7e8c8d1079887354e97dd
d50ad5192f58c73cd8e8bc37b579d36d556622b1
/ReportCenter/ReportCenter/src/edu/missouri/operations/reportcenter/data/ReportParameters.java
c683784fdf25ebc20d70cb0598c291da37166182
[]
no_license
dxccm666/reportcenter
6eb3d82d738d895f6496e4c9857ba0e10ec0ae59
465857812e1aecb2cea6de5311f014386694839e
refs/heads/master
2021-01-17T23:28:33.899258
2017-04-20T16:27:13
2017-04-20T16:27:13
84,219,630
0
0
null
null
null
null
UTF-8
Java
false
false
1,620
java
/** * */ package edu.missouri.operations.reportcenter.data; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.SQLException; import java.sql.Types; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.vaadin.data.Item; import com.vaadin.data.util.sqlcontainer.query.OracleQuery; import edu.missouri.operations.reportcenter.Pools; /** * @author graumannc * */ @SuppressWarnings("serial") public class ReportParameters extends OracleQuery { static final transient Logger logger = LoggerFactory.getLogger(ReportParameters.class); public ReportParameters() { super(Pools.getConnectionPool(Pools.Names.REPORTCENTER)); setQueryString("select * from reportparameters"); setRowQueryString("select * from reportparameters where id = ?"); setPrimaryKeyColumns("ID"); } @Override public int storeRow(Connection conn, Item row) throws UnsupportedOperationException, SQLException { int retval = 0; try (CallableStatement call = conn.prepareCall("{ ? = call reports.reportparameter(?,?,?,?,?,?,?,?) }")) { int i=1; call.registerOutParameter(i++, Types.VARCHAR); setString(call, i++, getId(row)); setString(call, i++, getRowStamp(row)); setString(call, i++, getOracleString(row,"REPORTID")); setBigDecimal(call, i++, getDecimal(row,"PARAMETERNUMBER")); setString(call, i++, getOracleString(row,"PARAMETER")); setString(call, i++, getOracleString(row, "PARAMETERTYPE")); setString(call, i++, getOracleString(row, "LISTNAME")); retval = call.executeUpdate(); setLastId(call.getString(1)); } return retval; } }
[ "\"graumannc@missouri.edu\"" ]
"graumannc@missouri.edu"
17b2ab5917f91cd497f5b1d0b78ae3af5d864c01
cebab5906e9ce39791f0c136bb61a21846e922d3
/TeachDroid/datalink/com/keba/kemro/teach/network/rpc/protocol/RpcTcDestroyIn.java
c12b6228f8405badef51ff21fae851b548648c00
[]
no_license
hauserkristof/TeachDroid
7927965fb66fbfe917430106d40fa2c005d32188
9edfcfd9aa8b75847db97a5798df7baa124c6e31
refs/heads/master
2021-05-27T16:17:41.448040
2014-03-05T07:54:56
2014-03-05T07:54:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package com.keba.kemro.teach.network.rpc.protocol; import com.keba.jrpc.rpc.*; import java.io.*; public class RpcTcDestroyIn implements XDR { public int scopeHnd; public RpcTcDestroyIn () { } public void write (RPCOutputStream out) throws RPCException, IOException { out.writeInt(scopeHnd); } public void read (RPCInputStream in) throws RPCException, IOException { scopeHnd = in.readInt(); } }
[ "ltz@keba.com" ]
ltz@keba.com
4383195ead6929dbc2c284b1a96bf96f2c1207fb
fd3092691a8ad6581d72119f6ebcf5ed4956b60e
/study-src/src/main/java/com/jzue/study/netty/netty2_2/TestServerHandler.java
84c56c629176d1623c807b847622b41201019483
[]
no_license
JZue/note-doucment
71790d34b02b5eaf93c5433b7b998adf48c0f5af
c94e5b029acf33ff8a503f408ed5d130666284d5
refs/heads/master
2023-06-24T04:05:14.299226
2022-01-14T01:53:49
2022-01-14T01:53:49
155,163,867
6
2
null
2023-06-20T18:32:16
2018-10-29T06:39:44
Java
UTF-8
Java
false
false
1,100
java
package com.jzue.study.netty.netty2_2; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.util.ReferenceCountUtil; import sun.tools.tree.ByteExpression; import javax.naming.Reference; import java.io.IOException; /** * @Author: junzexue * @Date: 2018/12/3 下午3:53 * @Description: **/ public class TestServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { ByteBuf in=(ByteBuf)msg; try { while (in.isReadable()){ System.out.println("TODO: "); char chars=(char) in.readByte(); System.out.println((char) in.readByte()); System.out.flush(); } }finally { ReferenceCountUtil.release(msg); } } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { cause.printStackTrace(); ctx.close(); } }
[ "xuejunze@xuejunzedeMacBook-Pro-2.local" ]
xuejunze@xuejunzedeMacBook-Pro-2.local
8ed0a70459ca018abaf72f240d10b7bfdb9b3723
0bc9a15487fdf717de2d32c47fb8d28a6b34abea
/src/main/java/etf/openpgp/pd170312duu170714d/SecretKeyChain.java
f2f12b6c1b6136dd2aeadd8816eda4ade27cca52
[]
no_license
DamjanTM/ZP-PGP
b43412b9e5e6d5426460b8cec17b82f8dd50b7cc
389a9618c10259ec9933ffee2ff4bba288ecd8a5
refs/heads/master
2023-06-01T04:55:07.431427
2021-06-15T16:10:02
2021-06-15T16:10:02
371,697,200
0
0
null
null
null
null
UTF-8
Java
false
false
6,459
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 etf.openpgp.pd170312duu170714d; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.Iterator; import java.util.logging.Level; import java.util.logging.Logger; import org.bouncycastle.bcpg.ArmoredInputStream; import org.bouncycastle.bcpg.ArmoredOutputStream; import org.bouncycastle.openpgp.PGPException; import org.bouncycastle.openpgp.PGPKeyRingGenerator; import org.bouncycastle.openpgp.PGPSecretKey; import org.bouncycastle.openpgp.PGPSecretKeyRing; import org.bouncycastle.openpgp.PGPSecretKeyRingCollection; import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator; import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; /** * * @author Uros */ public class SecretKeyChain { private PGPSecretKeyRingCollection secretKeyRingCollection; public SecretKeyChain(){ try { Utils.touch_file(new File("./secret_keychain.asc")); secretKeyRingCollection = new PGPSecretKeyRingCollection( new ArmoredInputStream( new FileInputStream( new File( "./secret_keychain.asc" ) ) ), new BcKeyFingerprintCalculator() ); } catch (IOException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } catch (PGPException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } } public void importSecretKey( String path ) { ArmoredInputStream ais = null; try { File file = new File(path); ais = new ArmoredInputStream( new FileInputStream( file ) ); PGPSecretKeyRingCollection pgpSecKeyCol = new PGPSecretKeyRingCollection( ais, new BcKeyFingerprintCalculator() ); Iterator<PGPSecretKeyRing> keyRingIter = pgpSecKeyCol.getKeyRings(); while( keyRingIter.hasNext() ) { PGPSecretKeyRing keyRing = keyRingIter.next(); secretKeyRingCollection = PGPSecretKeyRingCollection.addSecretKeyRing( secretKeyRingCollection, keyRing ); } } catch (FileNotFoundException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } catch (PGPException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } finally { try { ais.close(); } catch (IOException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } } } public PGPSecretKeyRingCollection getSecretKeysCollection() { return secretKeyRingCollection; } public void addSecretKey( PGPKeyRingGenerator keyRingGenerator ) { PGPSecretKeyRing secretKeyRing = keyRingGenerator.generateSecretKeyRing(); secretKeyRingCollection = PGPSecretKeyRingCollection.addSecretKeyRing( secretKeyRingCollection, secretKeyRing ); } public void removeSecretKey( PGPSecretKeyRing secretKeyRing ) { secretKeyRingCollection = PGPSecretKeyRingCollection.removeSecretKeyRing( secretKeyRingCollection, secretKeyRing ); } public PGPSecretKeyRing getSecretKeyRing( long keyID ) { Iterator<PGPSecretKeyRing> i = this.secretKeyRingCollection.getKeyRings(); while( i.hasNext() ) { PGPSecretKeyRing keyRing = i.next(); Iterator<PGPSecretKey> keyIter = keyRing.getSecretKeys(); while( keyIter.hasNext() ) { PGPSecretKey key = keyIter.next(); if( key.getKeyID() == keyID ) { return keyRing; } } } return null; } public static void exportSecretKey( PGPSecretKeyRing publicKeyRing, String path ){ File file = new File(path); try { Utils.touch_file(file); } catch (FileNotFoundException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } try( ArmoredOutputStream aos = new ArmoredOutputStream( new FileOutputStream( file ) ) ) { publicKeyRing.encode( aos ); } catch (FileNotFoundException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } } public void saveKeysToFile(File file) { if(file == null)file = new File("../secret_ring_file.asc"); try { Utils.touch_file(file); } catch (FileNotFoundException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } try( ArmoredOutputStream aos = new ArmoredOutputStream( new FileOutputStream( file) ) ) { secretKeyRingCollection.encode( aos ); } catch (FileNotFoundException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(SecretKeyChain.class.getName()).log(Level.SEVERE, null, ex); } } public static boolean isValidPassphrase( PGPSecretKeyRing secretKeyring, int index, char[] password ) throws PGPException { if( secretKeyring == null || password == null ) return false; Iterator secretKeyIter = secretKeyring.getSecretKeys(); PGPSecretKey secretKey = null; for( int i = 0; i <= index && secretKeyIter.hasNext(); i++ ) secretKey = ( PGPSecretKey )secretKeyIter.next(); if( secretKey == null )return false; secretKey.extractPrivateKey( new JcePBESecretKeyDecryptorBuilder() .setProvider( "BC" ) .build( password ) ); return true; } }
[ "62910441+ugrinicu@users.noreply.github.com" ]
62910441+ugrinicu@users.noreply.github.com
1f10d3ebeb0aba0b38c54095fce3de32b7cf6ed7
09410f5bf8459dcbea66349c870817a6ae86bf0d
/app/src/main/java/com/example/eyeu/EyeRecoveryImage.java
263bb0e819c76271249c94e6e2ba732cd81aec33
[]
no_license
suyeong2785/eyeU_project
7bac12d790733fb25595a957cc16445f606037d7
30a16b9300b23c5da49de7dcbbdc4823039d9213
refs/heads/master
2023-05-28T02:51:03.174133
2021-06-01T07:34:45
2021-06-01T07:34:45
371,608,690
0
1
null
null
null
null
UTF-8
Java
false
false
347
java
package com.example.eyeu; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class EyeRecoveryImage extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_eye_recovery_image); } }
[ "qkdtpwls_@naver.com" ]
qkdtpwls_@naver.com
cd320a59b88f99fb9d667fecf9db027f0f76947d
2a9bb9de05be09cbffa2f9961b47300679854190
/src/dp/Leet118_PascalTriangle.java
d8cc6166e140ad5167e6a905ce46ac2bd2342edb
[]
no_license
yancheng1022/leetcode
bbe3f34eaee4ae2ab8a344666232e589343a472a
114c9397e944d875c9d856e0c6727baed88d9f2c
refs/heads/master
2023-04-03T14:11:25.621650
2021-04-27T10:24:53
2021-04-27T10:24:53
302,603,666
0
0
null
null
null
null
UTF-8
Java
false
false
944
java
package dp; import java.util.ArrayList; import java.util.List; /** * 给定一个非负整数 numRows,生成杨辉三角的前 numRows 行。 * <p> * 在杨辉三角中,每个数是它左上方和右上方的数的和。 * <p> * 示例: * <p> * 输入: 5 * 输出: * [ * [1], * [1,1], * [1,2,1], * [1,3,3,1], * [1,4,6,4,1] * ] */ public class Leet118_PascalTriangle { public List<List<Integer>> generate(int numRows) { ArrayList<List<Integer>> result = new ArrayList<>(); for (int i = 0; i < numRows; i++) { ArrayList<Integer> temp = new ArrayList<>(); for (int j = 0; j < i + 1; j++) { if (j == 0 || j == i) { temp.add(1); } else { temp.add(result.get(i - 1).get(j) + result.get(i - 1).get(j - 1)); } } result.add(temp); } return result; } }
[ "guoyancheng@fang.com" ]
guoyancheng@fang.com
4b23c1d82479d2d6c0bd7cd51c82bbb5af1800e7
a52a5550f499c2c02b523885e46b2e7b19850f26
/src/main/java/com/xebia/tennisleagueserver/repositories/RoundRepository.java
dd2760f2478103d3b41a7ceb600d6f930d3701a7
[]
no_license
XI2438-SantoshWalsetwar/tennis-league-server
48a916da10713cf14a7b2cd06da9cf715a70ccde
64aa8d4efb0fe2595967cad5ea7c4794b6c6518d
refs/heads/master
2023-05-02T07:29:49.834170
2021-05-06T13:22:14
2021-05-06T13:22:14
364,679,146
0
0
null
null
null
null
UTF-8
Java
false
false
318
java
package com.xebia.tennisleagueserver.repositories; import com.xebia.tennisleagueserver.entities.Round; import org.springframework.data.jpa.repository.JpaRepository; import java.util.Optional; public interface RoundRepository extends JpaRepository<Round,Long> { public Optional<Round> findTopByOrderByIdDesc(); }
[ "santosh.walsetwar@xebia.com" ]
santosh.walsetwar@xebia.com
b10abf8ec979b8506d3f25711710e18b9290c9c6
b8ae374fd6ccf74073938afc2c2b7344cd40da42
/bundles/com.neogenlabs.mail.shooter/src/main/java/com/neogenlabs/mail/shooter/MailShootServlet.java
2fe4a94e8aee47ac65784584cf2444372236da9b
[]
no_license
subho020m/neogenlabs_mobileApp
36255d62fda226e1cd6e482faa40c471fe0434ea
8d4331ee3601fa655bb10d5e3baeada8f895cffd
refs/heads/master
2016-08-04T09:42:19.314580
2014-09-17T17:58:32
2014-09-17T17:58:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,732
java
package com.neogenlabs.mail.shooter; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import org.apache.sling.api.servlets.SlingSafeMethodsServlet; import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.neogenlabs.mail.MailService; /** * This bundle is responsible for sending mail when new orders and requests are * created * * @author SUBHAJIT * */ public class MailShootServlet extends SlingSafeMethodsServlet { private final Logger logger = LoggerFactory .getLogger(MailShootServlet.class); /* * Mail Service Reference */ private volatile MailService mailService; /** * Mail Service {@link MailService} Injection Bound */ protected void bindMailService(ServiceReference reference, MailService mailService) { logger.info("Mail Service Injected"); this.mailService = mailService; } /** * Mail Service {@link MailService} Injection Changed */ protected void changeMailService(ServiceReference reference, MailService mailService) { logger.info("Mail Service Injection Reference Change"); this.mailService = mailService; } /** * Mail Service {@link MailService} Injection Unbound */ protected void unbindMailService(ServiceReference reference, MailService mailService) { logger.info("Mail Service Removed"); if (this.mailService == mailService) { this.mailService = null; } } /* * (non-Javadoc) * * @see * org.apache.sling.api.servlets.SlingSafeMethodsServlet#doGet(org.apache * .sling.api.SlingHttpServletRequest, * org.apache.sling.api.SlingHttpServletResponse) */ @Override protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { HttpServletRequest req = null; HttpServletResponse res = null; if (request instanceof HttpServletRequest) req = (HttpServletRequest) request; if (response instanceof HttpServletResponse) res = (HttpServletResponse) response; if (req != null) { String from = (String) req.getParameter("from"); String to = (String) req.getParameter("to"); String message = (String) req.getParameter("message"); String subject = (String) req.getParameter("subject"); if (from != null && to != null && message != null && subject != null) { if (mailService != null) { logger.debug("Mail Sending Started"); mailService.sendMail(from, subject, message, to); logger.debug("Mail Sending Stopped"); } } } } }
[ "subhajitm6@gmail.com" ]
subhajitm6@gmail.com
90e08ae5160137c1ffabe97c6c26092095fb3f58
1134526f5b67f82dbdd3953d083cc182ed46b3b2
/src/main/java/com/pltfhs/car/security/JWTFilter.java
69f179af6c7e47ad2987717e42d307704484eaef
[]
no_license
david-sn/rc
0a1a8757273bdc414f471aed24448f2a403fba48
1be39912142f68316156ce8cc6ac59c66125d72d
refs/heads/master
2020-03-22T10:23:07.188040
2018-07-06T08:26:40
2018-07-06T08:26:40
139,898,911
0
0
null
null
null
null
UTF-8
Java
false
false
3,700
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.pltfhs.car.security; import com.pltfhs.car.entity.Users; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import java.io.IOException; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.filter.GenericFilterBean; /** * * @author Client 1 */ public class JWTFilter extends GenericFilterBean { private static final String AUTHORIZATION_HEADER = "Authorization"; private static final String AUTHORITIES_KEY = "roles"; @Override public void doFilter(ServletRequest req, ServletResponse res, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; System.out.println("***************> " + request.getRequestURI()); String authHeader = request.getHeader(AUTHORIZATION_HEADER); if (authHeader == null || !authHeader.startsWith("Bearer ")) { ((HttpServletResponse) res).sendError(HttpServletResponse.SC_UNAUTHORIZED, "Invalid Authorization header."); } else { try { String token = authHeader.substring(7); Claims claims = Jwts.parser().setSigningKey("secretkey").parseClaimsJws(token).getBody(); request.setAttribute("claims", claims); SecurityContextHolder.getContext().setAuthentication(getAuthentication(claims)); filterChain.doFilter(req, res); } catch (io.jsonwebtoken.SignatureException ex) { res.getOutputStream().write("invalid Token".getBytes()); } } } public String getUserFromToken(String headerToken) { if (headerToken != null) { String token = headerToken.substring(7); Claims claims = Jwts.parser().setSigningKey("secretkey").parseClaimsJws(token).getBody(); SecurityContextHolder.getContext().setAuthentication(getAuthentication(claims)); return claims.getSubject(); } return null; } /** * Method for creating Authentication for Spring Security Context Holder * from JWT claims * * @param claims * @return */ public Authentication getAuthentication(Claims claims) { List<SimpleGrantedAuthority> authorities = new ArrayList<>(); List<?> roles = (List<?>) claims.get(AUTHORITIES_KEY); for (Object role : roles) { LinkedHashMap value = (LinkedHashMap) role; authorities.add(new SimpleGrantedAuthority(value.get("roleName").toString())); } Users principal = new Users(claims.getSubject()); UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken( claims.getSubject(), "", authorities); return usernamePasswordAuthenticationToken; } }
[ "d.shiref@v-apps.co" ]
d.shiref@v-apps.co
73fc30a41af84ebf9d7ddea91ef9859c87ce8506
13320c5eda61dc9791a7bfff65e7dfbf0d1b3cba
/29.数据结构/StackDemo.java
1a3ca4a119f73a56363b5dc638dee817a3f753de
[]
no_license
jk123vip/JavaTutorial
6e5e4dfe682bebb2ecd8239331c4aead9dfe2167
7e0a61ac4ade33ce96c951889d0c28ee084197cf
refs/heads/master
2016-08-10T17:09:37.179548
2016-03-12T19:51:40
2016-03-12T19:51:40
51,159,658
0
0
null
null
null
null
UTF-8
Java
false
false
842
java
/** Stack类 */ import java.util.*; public class StackDemo { static void showpush(Stack st, int a) { st.push(new Integer(a)); System.out.println("push(" + a + ")"); System.out.println("stack: " + st); } static void showpop(Stack st) { System.out.print("pop ->"); Integer a = (Integer) st.pop(); System.out.println(a); System.out.println("stack: " + st); } public static void main(String[] args) { Stack st = new Stack(); System.out.println("Stack: " + st); showpush(st, 42); showpush(st, 66); showpush(st, 99); showpop(st); showpop(st); showpop(st); try { showpop(st); } catch (EmptyStackException e) { System.out.println("empty stack"); } } }
[ "jk123vip@gmail.com" ]
jk123vip@gmail.com
3ccd28f281a3fc5a860c616ec0ddc884fef255a0
e0661812eaf1d3fc1a5bcc7a5ddf64ba27b19700
/app/src/main/java/com/example/cakedatabasedemo/ui/dashboard/DashboardFragment.java
a74efd4194acf0f98d08211f28a933494a2d85e6
[]
no_license
digipodium/Cake_Database_Demo
18ed04c406a57acd90cfb6fe83f114f80d14a2c3
cdf5c35ec681c00bd3891764a6cc6974bcf1bf1c
refs/heads/master
2022-11-19T01:34:03.753694
2020-07-25T11:33:44
2020-07-25T11:33:44
281,934,567
0
0
null
null
null
null
UTF-8
Java
false
false
1,634
java
package com.example.cakedatabasedemo.ui.dashboard; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; import com.example.cakedatabasedemo.Cake; import com.example.cakedatabasedemo.CakeViewModel; import com.example.cakedatabasedemo.R; public class DashboardFragment extends Fragment { private CakeViewModel cakeViewModel; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { cakeViewModel = new ViewModelProvider(this).get(CakeViewModel.class); View root = inflater.inflate(R.layout.fragment_dashboard, container, false); return root; } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); EditText editCake = view.findViewById(R.id.editCakeName); Button btnAdd = view.findViewById(R.id.btnAdd); btnAdd.setOnClickListener(v -> { String cakeName = editCake.getText().toString(); if (cakeName.length() > 2) { Cake cake = new Cake(cakeName); cakeViewModel.insert(cake); } else { editCake.setError("Please fill a valid cake name"); editCake.setFocusable(true); } }); } }
[ "xaidmetamorphos@gmail.com" ]
xaidmetamorphos@gmail.com
7f79617de6e1701e092429ebfd0d00e1ed1c1d9a
bd31c6143b74d13259d1776eb8cf8035f4a85ce9
/IR_Models_ElasticSearch/src/main/java/com/assign1/models/OkapiBM25.java
7b438ff0c4711f7f4ba0d3bbad8fbe191a0430f9
[]
no_license
BiyantaShah/IR-Projects
ea6560d7055d4b91a60b527f75bc0df36d43147c
bd4d97b63a55dcf31dacf261f8dc679de39e316c
refs/heads/master
2019-07-11T19:18:00.741951
2017-08-16T16:26:23
2017-08-16T16:26:23
100,507,261
0
0
null
null
null
null
UTF-8
Java
false
false
637
java
package com.assign1.models; /** * Created by Biyanta on 26/05/17. */ public class OkapiBM25 { public static double okapiBM25Score(int totalDocuments, long documentFrequency, long termFrequency, Long docLength) { double k1 = 1.2, b = 0.75; double avg_len_doc = 250; double term1 = Math.log10(Double.valueOf((totalDocuments+0.5))/(documentFrequency+0.5)); double term2 = Double.valueOf (termFrequency + k1 * termFrequency) /(termFrequency + k1 * ((1-b) + b * Double.valueOf(docLength)/avg_len_doc)); return term1*term2; } }
[ "shah.bi@husky.neu.edu" ]
shah.bi@husky.neu.edu