blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d4fff5568a7bb5884324c5141ab579222a7b702a | 620261fbc9469a5f87941c289c523ab65fc9ba46 | /src/estruturadedadosavancada/AVLBinarySearchTree.java | 34fdc96fb6f04d868c8ceec65b9f737fe82a7bf9 | [] | no_license | matheusnalmeida/AdvancedDataStructs | 04891fac8e39db1e3f4d3e25a4ab793d0f5c7e4e | 3176a9f0445e5cd28adcf4d73adeeb9c2614f13a | refs/heads/master | 2021-03-02T08:52:23.622259 | 2020-06-11T03:07:17 | 2020-06-11T03:07:17 | 245,853,788 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,718 | 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 estruturadedadosavancada;
import estruturadedadosavancada.AVLTree.AVLNode;
import java.util.Iterator;
import java.util.List;
/**
*
* @author Matheus Nunes
*/
public interface AVLBinarySearchTree<Index extends Comparable<Index>,E> {
// Retorna a quantidade de n�s da �rvore
public int size();
//retorna se a �rvore est� vazia
public boolean isEmpty();
// Retorna um interador sobre os elementos armazenados da �rvore
public Iterator<AVLNode<Index,E>> iterator();
// Substitui o elemento armazenado em determinado n�
public E replace(AVLNode<Index,E> node, E v) throws InvalidNodeException,EmptyTreeException;
// Retorna a raiz da �rvore
public AVLNode<Index,E> root() throws EmptyTreeException;
// retorna o pai de um n�
public AVLNode<Index,E> parent(AVLNode<Index,E> node) throws InvalidNodeException, EmptyTreeException;
// retorna lista de filhos
public Iterable<AVLNode<Index,E>> children(AVLNode<Index,E> node) throws InvalidNodeException,EmptyTreeException;
// retorna verdadeiro se o n� � interno
public boolean isInternal(AVLNode<Index,E> node) throws InvalidNodeException,EmptyTreeException;
// retorna verdadeiro se o n� � externo
public boolean isExternal(AVLNode<Index,E> node) throws InvalidNodeException,EmptyTreeException;
// retorna verdadeiro se o n� � raiz
public boolean isRoot(AVLNode<Index,E> node) throws EmptyTreeException;
//insere no na arvore
public void insert(AVLNode<Index,E> new_node) throws InvalidNodeException;
//Remove no da arvore
public boolean remove(Index chave);
//Limpar arvore
public void limparArvore();
//procura no na arvore de forma iterativa
public AVLNode<Index,E> find_iterativo(Index index) throws EmptyTreeException;
//procura no na arvore de forma recursiva
public AVLNode<Index,E> find_recursivo(Index index) throws EmptyTreeException;
//Algoritimos de navegacao
public List<AVLNode<Index,E>> pre_ordem();
public List<AVLNode<Index,E>> pos_ordem();
public List<AVLNode<Index,E>> em_ordem();
//Retorna maior e menor valor
public AVLNode<Index,E> retornaMaior();
public AVLNode<Index,E> retornaMenor();
//Retorna media dos valores da arvore baseado no hash code de cada chave
public int retornaMedia();
//Retorna numero de folhas
public int retornaNumeroDeFolhas();
//Retorna altura da arvore
public int retornaAltura();
}
| [
"matheus.nunes00@souunit.com.br"
] | matheus.nunes00@souunit.com.br |
aabe1c38a497596f7a7f01a9cf4a7a934acc7b3f | cfa11b7288a10dd9bf005637798228943f98059f | /notification/src/main/java/ro/trc/office/notification/config/DefaultProfileUtil.java | 5a83a4517b89c8c5f567218adc28dc76969b45a0 | [] | no_license | dgks0n/jhipster-kubernetes-istio | aec179640c18c3a4c21e8539999e343c7c94420a | 67bd589b42466ee46a0ca787f643045e8d5cfa63 | refs/heads/master | 2020-12-18T19:49:45.506862 | 2019-05-14T09:02:14 | 2019-05-14T09:02:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,302 | java | package ro.trc.office.notification.config;
import io.github.jhipster.config.JHipsterConstants;
import org.springframework.boot.SpringApplication;
import org.springframework.core.env.Environment;
import java.util.*;
/**
* Utility class to load a Spring profile to be used as default
* when there is no {@code spring.profiles.active} set in the environment or as command line argument.
* If the value is not available in {@code application.yml} then {@code dev} profile will be used as default.
*/
public final class DefaultProfileUtil {
private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default";
private DefaultProfileUtil() {
}
/**
* Set a default to use when no profile is configured.
*
* @param app the Spring application.
*/
public static void addDefaultProfile(SpringApplication app) {
Map<String, Object> defProperties = new HashMap<>();
/*
* The default profile to use when no other profiles are defined
* This cannot be set in the application.yml file.
* See https://github.com/spring-projects/spring-boot/issues/1219
*/
defProperties.put(SPRING_PROFILE_DEFAULT, JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
app.setDefaultProperties(defProperties);
}
}
| [
"razvan.simion@trencadis.ro"
] | razvan.simion@trencadis.ro |
79446daa6ede1d8ca1cd22832605fc48acae22ed | 1a60e464ca5676bff195623bccecbf25b918e4c7 | /fibonacciIteration.java | 920e741032fe9fc6ee7ed48ef35027d7f6a22359 | [] | no_license | sanchit48/codes.java | 6e610d2893df49411944d8bd5f88486b9e7abca9 | 1b14ce5103819b1b7b5499974035d0676a97b628 | refs/heads/master | 2020-05-17T14:27:38.969343 | 2019-06-30T10:48:01 | 2019-06-30T10:48:01 | 183,764,963 | 0 | 0 | null | 2019-06-30T10:48:02 | 2019-04-27T11:36:32 | Java | UTF-8 | Java | false | false | 507 | java | import java.lang.*;
import java.io.*;
import java.util.*;
class Fibonacci
{
public static void main (String args[]) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("How many fibonacci: ");
int num = Integer.parseInt(br.readLine());
int f1 = 0;
int f2 = 1;
int f;
int i = 0;
System.out.println(f1+"\n"+f2);
// Deploying algorithm
while (i < num)
{
f = f1+f2;
System.out.println(f);
f1 = f2;
f2 = f;
i++;
}
}
}
| [
"noreply@github.com"
] | sanchit48.noreply@github.com |
ac21ee3a05be54d4b1bebcc617ba105c84af8207 | d39ccf65250d04d5f7826584a06ee316babb3426 | /wb-mmb/wb-api/src/main/java/org/dwfa/ace/task/refset/AddRefsetMembersToListView.java | cc25feb492febf91c574567dd214f4ab7d9740e1 | [] | no_license | va-collabnet-archive/workbench | ab4c45504cf751296070cfe423e39d3ef2410287 | d57d55cb30172720b9aeeb02032c7d675bda75ae | refs/heads/master | 2021-01-10T02:02:09.685099 | 2012-01-25T19:15:44 | 2012-01-25T19:15:44 | 47,691,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,407 | java | /**
* Copyright (c) 2009 International Health Terminology Standards Development
* Organisation
*
* 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.dwfa.ace.task.refset;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Collection;
import java.util.List;
import javax.swing.JList;
import org.dwfa.ace.api.I_ConfigAceFrame;
import org.dwfa.ace.api.I_GetConceptData;
import org.dwfa.ace.api.I_ModelTerminologyList;
import org.dwfa.ace.api.I_TermFactory;
import org.dwfa.ace.api.Terms;
import org.dwfa.ace.api.ebr.I_ExtendByRef;
import org.dwfa.ace.api.ebr.I_ExtendByRefVersion;
import org.dwfa.ace.task.ProcessAttachmentKeys;
import org.dwfa.ace.task.WorkerAttachmentKeys;
import org.dwfa.bpa.process.Condition;
import org.dwfa.bpa.process.I_EncodeBusinessProcess;
import org.dwfa.bpa.process.I_Work;
import org.dwfa.bpa.process.TaskFailedException;
import org.dwfa.bpa.tasks.AbstractTask;
import org.dwfa.util.bean.BeanList;
import org.dwfa.util.bean.BeanType;
import org.dwfa.util.bean.Spec;
@BeanList(specs = { @Spec(directory = "tasks/ide/refset", type = BeanType.TASK_BEAN) })
public class AddRefsetMembersToListView extends AbstractTask {
/**
*
*/
private static final long serialVersionUID = 1L;
private static final int dataVersion = 1;
/**
* Property name for the term component to test.
*/
private String componentPropName = ProcessAttachmentKeys.SEARCH_TEST_ITEM.getAttachmentKey();
private void writeObject(ObjectOutputStream out) throws IOException {
out.writeInt(dataVersion);
out.writeObject(this.componentPropName);
}
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
int objDataVersion = in.readInt();
if (objDataVersion == dataVersion) {
this.componentPropName = (String) in.readObject();
} else {
throw new IOException("Can't handle dataversion: " + objDataVersion);
}
}
public void complete(I_EncodeBusinessProcess process, I_Work worker) throws TaskFailedException {
// Nothing to do
}
public Condition evaluate(I_EncodeBusinessProcess process, I_Work worker) throws TaskFailedException {
try {
I_GetConceptData refset = (I_GetConceptData) process.getProperty(componentPropName);
I_TermFactory tf = Terms.get();
I_ConfigAceFrame config = (I_ConfigAceFrame) worker.readAttachement(WorkerAttachmentKeys.ACE_FRAME_CONFIG.name());
JList conceptList = config.getBatchConceptList();
I_ModelTerminologyList model = (I_ModelTerminologyList) conceptList.getModel();
Collection<? extends I_ExtendByRef> extVersions = tf.getRefsetExtensionMembers(refset.getConceptId());
for (I_ExtendByRef thinExtByRefVersioned : extVersions) {
List<? extends I_ExtendByRefVersion> extensions = thinExtByRefVersioned.getTuples(config.getAllowedStatus(),
config.getViewPositionSetReadOnly(), config.getPrecedence(),
config.getConflictResolutionStrategy());
for (I_ExtendByRefVersion thinExtByRefTuple : extensions) {
model.addElement(tf.getConcept(thinExtByRefTuple.getComponentId()));
}
}
return Condition.CONTINUE;
} catch (Exception e) {
throw new TaskFailedException(e);
}
}
public int[] getDataContainerIds() {
return new int[] {};
}
public Collection<Condition> getConditions() {
return AbstractTask.CONTINUE_CONDITION;
}
public String getComponentPropName() {
return componentPropName;
}
public void setComponentPropName(String componentPropName) {
this.componentPropName = componentPropName;
}
}
| [
"wsmoak"
] | wsmoak |
31f1cde0ea09443846334f39ffe8b0e24f3a3d19 | a551b029e3a54839ce53c4027aa49887a116a8db | /dochadzky-klient/src/main/java/service/DochadzkyWebService.java | 12e26a12cf9e47c02bf9a45feb9230b7e74e8e32 | [] | no_license | szepesiovap/Kopr-soap | 339732a24fdd0ea773208f86a3a8339b4f0eb4d7 | a49dda8d90b8a2318e0b35678c16094006e3db5f | refs/heads/master | 2021-04-29T14:42:01.708642 | 2018-02-20T22:41:37 | 2018-02-20T22:41:37 | 121,779,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,066 | java |
package service;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.9-b130926.1035
* Generated source version: 2.2
*
*/
@WebServiceClient(name = "DochadzkyWebService", targetNamespace = "http://service/", wsdlLocation = "http://localhost:8888/dochadzky?wsdl")
public class DochadzkyWebService
extends Service
{
private final static URL DOCHADZKYWEBSERVICE_WSDL_LOCATION;
private final static WebServiceException DOCHADZKYWEBSERVICE_EXCEPTION;
private final static QName DOCHADZKYWEBSERVICE_QNAME = new QName("http://service/", "DochadzkyWebService");
static {
URL url = null;
WebServiceException e = null;
try {
url = new URL("http://localhost:8888/dochadzky?wsdl");
} catch (MalformedURLException ex) {
e = new WebServiceException(ex);
}
DOCHADZKYWEBSERVICE_WSDL_LOCATION = url;
DOCHADZKYWEBSERVICE_EXCEPTION = e;
}
public DochadzkyWebService() {
super(__getWsdlLocation(), DOCHADZKYWEBSERVICE_QNAME);
}
public DochadzkyWebService(WebServiceFeature... features) {
super(__getWsdlLocation(), DOCHADZKYWEBSERVICE_QNAME, features);
}
public DochadzkyWebService(URL wsdlLocation) {
super(wsdlLocation, DOCHADZKYWEBSERVICE_QNAME);
}
public DochadzkyWebService(URL wsdlLocation, WebServiceFeature... features) {
super(wsdlLocation, DOCHADZKYWEBSERVICE_QNAME, features);
}
public DochadzkyWebService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public DochadzkyWebService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns DochadzkyService
*/
@WebEndpoint(name = "DochadzkyServicePort")
public DochadzkyService getDochadzkyServicePort() {
return super.getPort(new QName("http://service/", "DochadzkyServicePort"), DochadzkyService.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns DochadzkyService
*/
@WebEndpoint(name = "DochadzkyServicePort")
public DochadzkyService getDochadzkyServicePort(WebServiceFeature... features) {
return super.getPort(new QName("http://service/", "DochadzkyServicePort"), DochadzkyService.class, features);
}
private static URL __getWsdlLocation() {
if (DOCHADZKYWEBSERVICE_EXCEPTION!= null) {
throw DOCHADZKYWEBSERVICE_EXCEPTION;
}
return DOCHADZKYWEBSERVICE_WSDL_LOCATION;
}
}
| [
"patka.szepesi@gmail.com"
] | patka.szepesi@gmail.com |
6c44d3f2a496a8a845991d446d063b02e4de7e78 | 526457f0077becd0bb32f52f99266addd45d1e2f | /base/01bak/JFPC-Base/src/main/java/org/jfpc/base/support/ISDatabaseSupport.java | 269de668141ac6ad40166bd626bae15493fe12ed | [
"Apache-2.0"
] | permissive | qxs820624/ishome | 58cfc8dbfeb147e2c3934485776617468a578d3b | d095bd92380d7e058f5c5c9c07c9ca8abf86b3e8 | refs/heads/master | 2020-03-09T03:51:54.761986 | 2017-09-19T03:33:21 | 2017-09-19T03:33:21 | 128,574,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,567 | java | package org.jfpc.base.support;
import java.util.List;
import org.jfpc.base.ISFrameworkConstants;
import org.jfpc.base.bean.FrameworkDataBean;
import org.jfpc.base.page.PageVOSupport;
/**
* 数据库操作基本接口CURD
*
* @author Spook
* @since 0.1.0
* @version 0.1.0 2014/2/8
* @see <ISFrameworkConstants>
*/
public interface ISDatabaseSupport extends ISFrameworkConstants {
/**
* 根据条件全表更新
* @param paramBean
* @return
*/
public int doUpdateAll(MyDataBaseObjectSupport paramBean);
///////////////////////////////////// 多数据操作///////////////////////////////////
/**
* 分页查询
* @param formParam
* @return
*/
public List<FrameworkDataBean> doSelectPage(PageVOSupport formParam);
///////////////////////////////////// 增删改查(CRUD)///////////////////////////////////
/**
* 查询一条记录(主键)
*
* @param paramBean
*/
public MyDataBaseObjectSupport doRead(MyDataBaseObjectSupport paramBean);
/**
* 插入一条记录
*
* @param paramBean
*/
public int doInsert(MyDataBaseObjectSupport paramBean);
/**
* 更新一条记录(主键)
*
* @param paramBean
*/
public int doUpdate(MyDataBaseObjectSupport paramBean);
/**
* 删除一条记录(主键,物理)
*
* @param paramBean
*/
public int doDelete(MyDataBaseObjectSupport paramBean);
/**
* 删除一条记录(主键,逻辑)
*
* @param paramBean
*/
public int toDelete(MyDataBaseObjectSupport paramBean);
}
| [
"ishome@0f64846e-ad2d-472a-bb4f-a9ad5a697426"
] | ishome@0f64846e-ad2d-472a-bb4f-a9ad5a697426 |
35c47376ef86c2d4138530cd4bc67e523013ed67 | 8be089682b1e4fecd46daaadf68b2876d38d4aae | /app/src/main/java/com/tsegazeabg/com/expensemanager/domain/interactors/impl/DeleteAccountInteractorImpl.java | 4f321321805502699566644a2130f7c1028fb495 | [] | no_license | Tsegazeab-gk/ExpenseManager | cb792046bd4315d0bc5c1d1c23e58e178c0f0c15 | 20d527cd1f2590bb7ff3287e7565cad2bd4651e2 | refs/heads/master | 2022-01-20T00:45:55.674733 | 2019-06-06T08:37:13 | 2019-06-06T08:37:13 | 190,545,586 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,479 | java | package com.tsegazeabg.com.expensemanager.domain.interactors.impl;
import com.tsegazeabg.com.expensemanager.domain.executor.Executor;
import com.tsegazeabg.com.expensemanager.domain.executor.MainThread;
import com.tsegazeabg.com.expensemanager.domain.interactors.AddAccountInteractor;
import com.tsegazeabg.com.expensemanager.domain.interactors.DeleteAccountInteractor;
import com.tsegazeabg.com.expensemanager.domain.interactors.base.AbstractInteractor;
import com.tsegazeabg.com.expensemanager.domain.repository.AccountRep;
public class DeleteAccountInteractorImpl extends AbstractInteractor implements DeleteAccountInteractor {
private AccountRep mAccountRep;
private DeleteAccountInteractor.Callback mCallback;
private long mId;
public DeleteAccountInteractorImpl(Executor threadExecutor, MainThread mainThread, AccountRep accountRep, Callback callback,
long id) {
super(threadExecutor, mainThread);
this.mAccountRep=accountRep;
this.mCallback=callback;
this.mId=id;
}
@Override
public void run() {
// Create new account
//com.tsegazeabg.com.expensemanager.domain.model.Account account=new com.tsegazeabg.com.expensemanager.domain.model.Account(mId);
mAccountRep.delete(mId);
mMainThread.post(new Runnable() {
@Override
public void run() {
mCallback.OnAccountDeleted();
}
});
}
}
| [
"tsegazeabgk@gmail.com"
] | tsegazeabgk@gmail.com |
5c1791632f99819483ed7da0f948b4eeeec46235 | fae257fbbfe936b805eb4a7c4788ff819dbdcc1c | /src/main/java/lesson05/part05/task21/Tree.java | 53a56d330a3b190973c25870e45ea9696803cdf6 | [] | no_license | akrotov-education/practice-autumn-2019 | c342885ef9480ae40712fb7cb57efb01f406f842 | cf1e973b6e5e023208f8b3033a338052ef120d5e | refs/heads/master | 2021-07-11T12:19:41.937187 | 2019-11-18T17:11:36 | 2019-11-18T17:11:36 | 210,434,430 | 3 | 44 | null | 2023-07-14T19:07:33 | 2019-09-23T19:21:22 | Java | UTF-8 | Java | false | false | 364 | java | package lesson05.part05.task21;
public class Tree {
public static int globalNumber;
public int number;
public Tree() {
this.number = ++globalNumber;
}
public void info(Object s) {
System.out.println(String.format("Дерево № %d , метод Object, параметр %s", number, s.getClass().getSimpleName()));
}
}
| [
"akrotov.direct@gmail.com"
] | akrotov.direct@gmail.com |
db1ec28278695acbc575fb2af0dfe7ea2fdaba7c | 2ebe2839f499dc941d1beeb56f1cfe39f413af6e | /src/main/java/com/tcc/pcv_ejb/mutadores/Mutador.java | d595cc99ad75e00660f55f589e5cebf8bd9bdf67 | [] | no_license | Optim-Scopus/PCV_ejb | 7f06b538fb606983ce6b8e2ebd51664ccd143ef2 | a8eff885e239b191751c865745c23dff637d0e7d | refs/heads/master | 2021-09-02T12:54:29.491262 | 2018-01-02T20:32:07 | 2018-01-02T20:32:07 | 111,472,358 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | 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.tcc.pcv_ejb.mutadores;
import com.tcc.pcv_ejb.Tour;
/**
*
* @author Ken
*/
public interface Mutador {
}
| [
"luizfercabp@gmail.com"
] | luizfercabp@gmail.com |
80567aa8bd4a13c5ecc064b05fe9d0adca1b902b | 62cb82ae81328caa46ec883ff9daebf9e868300d | /src/collidables/Block.java | 3929467f3d0ff0076e7e757df26f8695710ec444 | [] | no_license | shahafMordechay/Breakout-Game | c48ffde7191dcc9c67d712bb2efea8282e5472b3 | 052a0895bb308dafe30d7132e68466a5d7a83977 | refs/heads/master | 2020-07-30T21:29:39.036875 | 2019-09-23T13:49:19 | 2019-09-23T13:49:19 | 210,364,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,931 | java | package collidables;
import game.HitNotifier;
import geometry.Line;
import geometry.Point;
import geometry.Rectangle;
import other.Fill;
import sprites.Ball;
import sprites.Sprite;
import other.Velocity;
import game.GameLevel;
import hitlisteners.HitListener;
import biuoop.DrawSurface;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/**
* A collidable rectangle that returns a new velocity when collided.
*
* @author Shahaf Mordechay
*/
public class Block implements Collidable, Sprite, HitNotifier {
private static final Integer INDESTRUCTIBLE = -1;
private static final Integer PADDLE_LIFE = -2;
private Rectangle rectangle;
private Fill fill;
private Integer hitPoints;
private Color stroke;
private Line upperEdge;
private Line lowerEdge;
private Line leftEdge;
private Line rightEdge;
private List<HitListener> hitListeners;
private Map<Integer, Fill> fillsMap;
/**
* Constructs and initializes a block in a specified size,
* location(rectangle location and size) and color.
*
* @param rectangle this block location and size.
* @param fill this block filling.
* @param hitPoints number of times this block can be hit.
*/
public Block(Rectangle rectangle, Fill fill, Integer hitPoints) {
this.rectangle = rectangle;
this.fill = fill;
this.hitPoints = hitPoints;
this.stroke = null;
this.upperEdge = new Line(this.rectangle.getUpperLeft(),
this.rectangle.getUpperRight());
this.lowerEdge = new Line(this.rectangle.getLowerLeft(),
this.rectangle.getLowerRight());
this.leftEdge = new Line(this.rectangle.getUpperLeft(),
this.rectangle.getLowerLeft());
this.rightEdge = new Line(this.rectangle.getUpperRight(),
this.rectangle.getLowerRight());
this.hitListeners = new ArrayList<>();
this.fillsMap = new TreeMap<>();
}
/**
* Constructs and initializes an indestructible block in a specified size,
* location(rectangle location and size) and color.
*
* @param rectangle this block location and size.
* @param color this block color.
*/
public Block(Rectangle rectangle, Color color) {
this.rectangle = rectangle;
this.fill = new Fill(color);
this.hitPoints = INDESTRUCTIBLE;
this.stroke = null;
this.upperEdge = new Line(this.rectangle.getUpperLeft(),
this.rectangle.getUpperRight());
this.lowerEdge = new Line(this.rectangle.getLowerLeft(),
this.rectangle.getLowerRight());
this.leftEdge = new Line(this.rectangle.getUpperLeft(),
this.rectangle.getLowerLeft());
this.rightEdge = new Line(this.rectangle.getUpperRight(),
this.rectangle.getLowerRight());
this.hitListeners = new ArrayList<>();
this.fillsMap = new TreeMap<>();
}
/**
* Return the shape of this block.
*
* @return the shape of this block.
*/
public Rectangle getCollisionRectangle() {
return this.rectangle;
}
/**
* Return the color of this block.
*
* @return the color of this block.
*/
public Fill getFill() {
return this.fill;
}
/**
* Return the upper edge of this block.
*
* @return the upper edge of this block.
*/
public Line getUpperEdge() {
return this.upperEdge;
}
/**
* Return the lower edge of this block.
*
* @return the lower edge of this block.
*/
public Line getLowerEdge() {
return this.lowerEdge;
}
/**
* Return the left edge of this block.
*
* @return the left edge of this block.
*/
public Line getLeftEdge() {
return this.leftEdge;
}
/**
* Return the right edge of this block.
*
* @return the right edge of this block.
*/
public Line getRightEdge() {
return this.rightEdge;
}
/**
* Return the upper left point of this block rectangle.
*
* @return upper left point of this block rectangle.
*/
public Point getUpperLeft() {
return this.getCollisionRectangle().getUpperLeft();
}
/**
* Return the lower right point of this block rectangle.
*
* @return lower right point of this block rectangle.
*/
public Point getLowerRight() {
return this.getCollisionRectangle().getLowerRight();
}
/**
* Return the remaining hit points of this block.
*
* @return the remaining hit points of this block.
*/
public Integer getHitPoints() {
return this.hitPoints;
}
/**
* Set this block stroke color.
*
* @param color this block stroke color.
*/
public void setStroke(Color color) {
this.stroke = color;
}
/**
* Notify all of this block hit listeners on a hit event.
*
* @param hitter the object that hit this block.
*/
private void notifyHit(Ball hitter) {
// Make a copy of the hitlisteners list before iterating over them
List<HitListener> listeners = new ArrayList<>(this.hitListeners);
// Notify all listeners about a hit event
for (HitListener hl : listeners) {
hl.hitEvent(this, hitter);
}
}
/**
* Notify the object that we collided with it, at collisionPoint,
* with a given velocity.
* The return is the new velocity expected after the hit (based on
* the force the object inflicted on this block).
*
* @param collisionPoint collision point with object.
* @param currentVelocity object current velocity.
* @param hitter the object that hit this block.
* @return the new velocity expected after the hit.
*/
public Velocity hit(Ball hitter, Point collisionPoint, Velocity currentVelocity) {
double x = collisionPoint.getX();
double y = collisionPoint.getY();
double dx = currentVelocity.getDx();
double dy = currentVelocity.getDy();
// collision with upper or lower edge
if ((upperEdge.isPointInRange(x, y) && dy > 0)
|| ((lowerEdge.isPointInRange(x, y) && dy < 0) && (hitPoints != PADDLE_LIFE))) {
// negate velocity dy
currentVelocity = new Velocity(dx, -dy);
}
// collision with left or right edge
if ((leftEdge.isPointInRange(x, y) && dx > 0)
|| (rightEdge.isPointInRange(x, y) && dx < 0)) {
// negate velocity dx
currentVelocity = new Velocity(-dx, dy);
}
// reduce 1 hitPoints for every hit
if (this.hitPoints > 0) {
this.hitPoints -= 1;
}
this.notifyHit(hitter);
return currentVelocity;
}
/**
* Draw the block on a given surface.
*
* @param d the surface to draw the block on.
*/
public void drawOn(DrawSurface d) {
// draw rectangle
int xCoordinate = (int) this.rectangle.getUpperLeft().getX();
int yCoordinate = (int) this.rectangle.getUpperLeft().getY();
int width = (int) this.rectangle.getWidth();
int height = (int) this.rectangle.getHeight();
// draw fill-k
if (this.fillsMap.containsKey(this.hitPoints)) {
// draw fill-k image
if (this.fillsMap.get(this.hitPoints).getColor() == null) {
d.drawImage(xCoordinate, yCoordinate,
this.fillsMap.get(this.hitPoints).getImage());
// draw fill-k color
} else {
d.setColor(this.fillsMap.get(this.hitPoints).getColor());
d.fillRectangle(xCoordinate, yCoordinate, width, height);
}
// draw fill image
} else if (this.fill.getColor() == null) {
d.drawImage(xCoordinate, yCoordinate, this.fill.getImage());
// draw fill color
} else {
d.setColor(this.fill.getColor());
d.fillRectangle(xCoordinate, yCoordinate, width, height);
}
if (this.stroke != null && this.hitPoints != INDESTRUCTIBLE) {
d.setColor(this.stroke);
d.drawRectangle(xCoordinate, yCoordinate, width, height);
}
}
/**
* currently do nothing(as instructed).
*
* @param dt the amount of seconds passed since the last call.
*/
public void timePassed(double dt) {
}
/**
* Add this block to game sprites and environment.
*
* @param g the game to add the block to.
*/
public void addToGame(GameLevel g) {
g.addSprite(this);
g.addCollidable(this);
}
/**
* Remove this block from game sprites and environment.
*
* @param gameLevel the game to remove the block from.
*/
public void removeFromGame(GameLevel gameLevel) {
gameLevel.removeSprite(this);
gameLevel.removeCollidable(this);
}
/**
* Add given hit listener to this hitlisteners list.
*
* @param hl the listener to add to hitlisteners list.
*/
public void addHitListener(HitListener hl) {
this.hitListeners.add(hl);
}
/**
* Remove given hit listener from this hitlisteners list.
*
* @param hl the listener to remove from hitlisteners list.
*/
public void removeHitListener(HitListener hl) {
this.hitListeners.remove(hl);
}
/**
* Add a given map of fill-k to this block fills map.
*
* @param fillingMap a map of fills.
*/
public void addFills(Map<Integer, Fill> fillingMap) {
this.fillsMap.putAll(fillingMap);
}
}
| [
"noreply@github.com"
] | shahafMordechay.noreply@github.com |
e9a3470a20000ec45e864232070d274986daf29b | 02bdba9111327991eacb32b53035f2ee91aadc5c | /back/src/main/java/br/com/neki/userskill/api/resources/User_SkillResource.java | 87a64053ffa9571299328177707e3661af07973e | [] | no_license | zsazsaspeck/neki-back | e02d8f1ebf2f612d0d80db408a702ef0374fecf6 | f287117e3a0ef08ba21b1c5bd5333a8bcb42bf86 | refs/heads/main | 2023-08-10T17:50:11.952311 | 2021-10-06T01:20:50 | 2021-10-06T01:20:50 | 412,118,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,087 | java | package br.com.neki.userskill.api.resources;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import br.com.neki.userskill.api.dto.SkillDTO;
import br.com.neki.userskill.api.dto.UserDTO;
import br.com.neki.userskill.api.dto.User_SkillDTO;
import br.com.neki.userskill.entity.model.Skill;
import br.com.neki.userskill.entity.model.User;
import br.com.neki.userskill.entity.model.UserSkill;
import br.com.neki.userskill.exception.RegraNegocioException;
import br.com.neki.userskill.model.repository.User_SkillRepository;
import br.com.neki.userskill.service.User_SkillService;
import lombok.Builder;
@RestController
@RequestMapping("/api/userskill")
public class User_SkillResource {
private User_SkillService service;
public User_SkillResource(User_SkillService service) {
this.service = service;
}
@Autowired
private User_SkillRepository _userSkillRepository;
@GetMapping
public List<UserSkill> obter() {
return this._userSkillRepository.findAll();
}
@PostMapping
public ResponseEntity save( @RequestBody User_SkillDTO dto) {
try {
UserSkill entity = convert(dto);
entity = service.save(entity);
return new ResponseEntity(entity, HttpStatus.CREATED);
}catch (RegraNegocioException e) {
return ResponseEntity.badRequest().body(e.getMessage());
}
}
private UserSkill convert(User_SkillDTO dto) {
UserSkill userskill = new UserSkill();
userskill.setUser(dto.getUser());
userskill.setSkill(dto.getSkill());
userskill.setKnowledgeLevel(dto.getKnowledgeLevel());
userskill.setCreatedAt(dto.getCreatedAt());
userskill.setUpdatedAt(dto.getUpdatedAt());
return userskill;
}
} | [
"giovannemenezeslopes@hotmail.com"
] | giovannemenezeslopes@hotmail.com |
dbf2e76a95959df1f3af319ff7d7f0664d461771 | db5e2811d3988a5e689b5fa63e748c232943b4a0 | /jadx/sources/o/C2966.java | 30fa2b7e2f8248a9ada708256b72c8e8f4226b65 | [] | no_license | ghuntley/TraceTogether_1.6.1.apk | 914885d8be7b23758d161bcd066a4caf5ec03233 | b5c515577902482d741cabdbd30f883a016242f8 | refs/heads/master | 2022-04-23T16:59:33.038690 | 2020-04-27T05:44:49 | 2020-04-27T05:44:49 | 259,217,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,836 | java | package o;
import android.view.View;
import android.view.ViewTreeObserver;
/* renamed from: o.ԏ reason: contains not printable characters */
public final class C2966 implements ViewTreeObserver.OnPreDrawListener, View.OnAttachStateChangeListener {
/* renamed from: ɩ reason: contains not printable characters */
private final Runnable f13704;
/* renamed from: Ι reason: contains not printable characters */
private ViewTreeObserver f13705;
/* renamed from: ι reason: contains not printable characters */
private final View f13706;
private C2966(View view, Runnable runnable) {
this.f13706 = view;
this.f13705 = view.getViewTreeObserver();
this.f13704 = runnable;
}
/* renamed from: ǃ reason: contains not printable characters */
public static C2966 m15241(View view, Runnable runnable) {
if (view != null) {
C2966 r0 = new C2966(view, runnable);
view.getViewTreeObserver().addOnPreDrawListener(r0);
view.addOnAttachStateChangeListener(r0);
return r0;
}
throw new NullPointerException("view == null");
}
public final boolean onPreDraw() {
m15240();
this.f13704.run();
return true;
}
/* renamed from: ı reason: contains not printable characters */
private void m15240() {
if (this.f13705.isAlive()) {
this.f13705.removeOnPreDrawListener(this);
} else {
this.f13706.getViewTreeObserver().removeOnPreDrawListener(this);
}
this.f13706.removeOnAttachStateChangeListener(this);
}
public final void onViewAttachedToWindow(View view) {
this.f13705 = view.getViewTreeObserver();
}
public final void onViewDetachedFromWindow(View view) {
m15240();
}
}
| [
"ghuntley@ghuntley.com"
] | ghuntley@ghuntley.com |
aff797bca7de9227e876df82d1c7bf4bacb783e1 | 325ec02cc5c0dca4f89042c05a03a4cda031b637 | /super-diamond-client/src/main/java/com/github/diamond/client/event/listener/AutoUpdateConfigBean.java | 9fa7c4f03a12b93081b2fa68381d5ad7e6d69999 | [] | no_license | gaoshanwenfeng/super-diamond | 256ceeed85702267f331f01ba183a997f65b43c7 | 192627956dfb20013851b699d82623a5bcc33735 | refs/heads/master | 2020-03-11T17:58:50.032429 | 2018-05-24T03:36:39 | 2018-05-24T03:36:39 | 130,163,211 | 0 | 0 | null | 2018-04-19T05:26:48 | 2018-04-19T05:26:48 | null | UTF-8 | Java | false | false | 435 | java | package com.github.diamond.client.event.listener;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @descrition : 在需要设置属性类上设置此注解(必须)
* @author gaofeng
* @time 2018/05/18
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface AutoUpdateConfigBean {
}
| [
"376221986@qq.com"
] | 376221986@qq.com |
9716caf87cb5f7dfbd89fc71b818eb807fa0185d | b418222022c8af6ab67bf502d987eafdb906794a | /src/State/EscolherFlores.java | ed33b38d403d314a06937a588d06fa266c921b23 | [] | no_license | ViniciusTomeVieira/HaruIchiban | 333697462aa50cd17ae4344d6e873f75c71bb504 | 0786ec9ec747db4f882861f0b2955d6de79e3d60 | refs/heads/master | 2022-01-04T21:06:54.496233 | 2019-06-27T17:22:39 | 2019-06-27T17:22:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,933 | 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 State;
import Observer.Observador;
import control.GerenciadorJogoImpl;
import decorator.flores.Flor;
/**
*
* @author Vinicius Tome Vieira e Adroan Heinen
* @since 01/05/2019
* @version 2.0
*/
public class EscolherFlores extends EstadoJogo {
public EscolherFlores(GerenciadorJogoImpl gerenciadorJogo) {
super(gerenciadorJogo);
}
@Override
public void proxEstado() {
gerenciadorJogo.setIndiceMensagens(1);
gerenciadorJogo.setEstadojogo(new JogarFlor(gerenciadorJogo));
}
@Override
public void escolherFloresDeck(int row, int col) {
Flor cartaEscolhida = gerenciadorJogo.florDaVez[col][row];
if (gerenciadorJogo.getMaoDaVez().size() < 3 && gerenciadorJogo.verificarTamanhoDeck() > 0) {
if (gerenciadorJogo.florDaVez[col][row] != null) {
gerenciadorJogo.enviarCartaParaMao(cartaEscolhida);
gerenciadorJogo.florDaVez[col][row] = null;
gerenciadorJogo.getJogadorDaVez().setMao(gerenciadorJogo.getMaoDaVez());
gerenciadorJogo.getJogadorDaVez().setFlores(gerenciadorJogo.getFlorDaVez());
if (gerenciadorJogo.getMaoDaVez().size() == 3) {
gerenciadorJogo.trocarJogadorDaVez();
}
for (Observador obs : gerenciadorJogo.getObservadores()) {
obs.notificarFlorEscolhida();
}
}
} else {
gerenciadorJogo.trocarJogadorDaVez();
for (Observador obs : gerenciadorJogo.getObservadores()) {
obs.notificarFlorEscolhida();
}
}
}
}
| [
"vinny.vieira99@hotmail.com"
] | vinny.vieira99@hotmail.com |
9d30cb0005ff2faf3841c4c8fbca3f4fc31d0c23 | 378ba8b7ef341f4e467edb37049ed0c4bebfb422 | /app/src/main/java/com/ashwinchandlapur/animalsounds/BodyRoot.java | 78258e6c2b67ab6ab40ff9e175f2b3d3f8c603b4 | [] | no_license | AshwinChandlapur/Complete.Kids.Learning | 688d398887be33654f2e91227f1f7fb1d8a77317 | 089cd404981f22db9a9d6abf17663e19a8ef7348 | refs/heads/master | 2021-01-19T03:54:28.952180 | 2018-06-15T16:31:28 | 2018-06-15T16:31:28 | 68,958,209 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 998 | java | package com.ashwinchandlapur.animalsounds;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class BodyRoot extends Fragment {
private static final String TAG = "RootFragment";
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
/* Inflate the layout for this fragment */
View view = inflater.inflate(R.layout.bodyroot_fragment, container, false);
FragmentTransaction transaction = getFragmentManager()
.beginTransaction();
/*
* When this container fragment is created, we fill it with our first
* "real" fragment
* http://soundbible.com/tags-animal.html
*/
transaction.replace(R.id.root_frameo, new body());
transaction.commit();
return view;
}
} | [
"ashwinyga@rocketmail.com"
] | ashwinyga@rocketmail.com |
cfa04efc44da9cfcdb9f73001179f78178d98222 | a9f5f2e36511adbe09624f59ecdf8ad98301cf02 | /survey-api/src/main/java/org/adaptiveplatform/surveys/exception/NoSuchSurveyTemplateException.java | 40708566d100048c96edd1106fe8afe9d9f5f549 | [] | no_license | marcinderylo/surveys | 4f05940d0a5e9c5a19e33411296580742ad901c9 | 58fdb0efb55127ee003e1499da7f75bcaeef42c0 | refs/heads/master | 2021-01-25T10:28:59.352312 | 2012-04-30T22:55:24 | 2012-04-30T22:55:24 | 3,443,306 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 554 | java | package org.adaptiveplatform.surveys.exception;
import java.io.Serializable;
import org.adaptiveplatform.codegenerator.api.Param;
import org.adaptiveplatform.codegenerator.api.RemoteException;
/**
* @author Marcin Deryło
*/
@RemoteException
public class NoSuchSurveyTemplateException extends BusinessException implements Serializable {
public static final String ERROR_CODE = "SURVEY_TEMPLATES_DOES_NOT_EXIST";
public NoSuchSurveyTemplateException(@Param("id") Long id) {
super(ERROR_CODE, "No survey template exists with ID={0}.", id);
}
}
| [
"rafaljamroz@gmail.com"
] | rafaljamroz@gmail.com |
b337c350330a7626b7cce4f51a186012038d3b53 | fbc28538f9e568f9c35d631abf702ab78dc26221 | /app/common/src/main/java/com/air/common/base/BaseResult.java | c7325742cc73cf39bde11a4cd089550026a6925a | [] | no_license | personal-funny/demo | ca5c520d9135347959c3f3990e86f7f1e3c427b9 | 34f232aa4e6c22549ba2c8746d7105b76000917f | refs/heads/master | 2020-12-30T10:24:19.422646 | 2017-08-02T02:48:43 | 2017-08-02T02:48:43 | 98,875,174 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,866 | java | package com.air.common.base;
import java.io.Serializable;
/**
* @author chen chi
* @version BaseResult, v 0.1 2017/6/29 15:25 chen chi Exp
*/
public class BaseResult implements Serializable {
private static final long serialVersionUID = 8703437522881436978L;
private boolean success = false;
private String errorCode;
private String errorMessage;
/**
* 默认构造函数
*/
public BaseResult() {
super();
this.success = true;
}
/**
* 带参数构造函数
*
* @param errorCode 错误码
* @param errorMessage 错误信息
*/
public BaseResult(String errorCode, String errorMessage) {
this(false, errorCode, errorMessage);
}
/**
* 带参数构造函数
*
* @param success 服务是否执行成功
* @param errorCode 错误码
* @param errorMessage 错误信息
*/
public BaseResult(boolean success, String errorCode, String errorMessage) {
super();
this.success = success;
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
@Override
public String toString() {
return "BaseResult{" +
"success=" + success +
", errorCode='" + errorCode + '\'' +
", errorMessage='" + errorMessage + '\'' +
'}';
}
}
| [
"lx48475@ly.com"
] | lx48475@ly.com |
2beb45b29250768b8eb8ad6dafdd00774ac5b4ad | 338ea8889ad62f8a558b40aeafc609abf6d1a9d9 | /src/main/java/com/melon/o2o/util/wechat/message/req/LinkMessage.java | 70f14a2ad391c51edf838e37742448b54fac8086 | [] | no_license | ACtangle/o2o | c301bcf95444ad9ae95e29b90983fcc5ecb8f151 | 2a984807e7e9f3beb294e53d45a82c25454cf009 | refs/heads/master | 2022-12-26T04:18:18.203399 | 2019-09-29T08:59:45 | 2019-09-29T08:59:45 | 201,972,847 | 0 | 0 | null | 2022-12-16T11:35:09 | 2019-08-12T16:56:38 | Java | UTF-8 | Java | false | false | 792 | java | package com.melon.o2o.util.wechat.message.req;
/**
* 链接消息
*
* @author xiangli
* @date 2015-02-10
*/
public class LinkMessage extends BaseMessage {
// 消息标题
private String Title;
// 消息描述
private String Description;
// 消息链接
private String Url;
public String getTitle() {
return Title;
}
public void setTitle(String title) {
Title = title;
}
public String getDescription() {
return Description;
}
public void setDescription(String description) {
Description = description;
}
public String getUrl() {
return Url;
}
public void setUrl(String url) {
Url = url;
}
} | [
"674253854@qq.com"
] | 674253854@qq.com |
05668d040319a8b2709e33dab104cd04c74941a9 | 653095ca86defb0f7ad96f2a79e08455a056a7e3 | /app/src/main/java/com/itfollowme/njcit01/ZhihuApi.java | 5a69bc7fcd5d3541f19af155b612bad498891da5 | [] | no_license | slq123456/41651x | 0c19a5de7d33703b1011dda0aa300dde2487d3c0 | d085631a2ffb557d2eddfb4384e172e1d0591d30 | refs/heads/master | 2020-03-19T07:24:08.727104 | 2018-05-23T01:04:01 | 2018-05-23T01:04:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 602 | java | package com.itfollowme.njcit01;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
/**
* Created by notre on 2018/3/28.
*/
public interface ZhihuApi {
// String URL = "https://news-at.zhihu.com/
String URL = "http://172.18.26.56/";
@GET("/api/4/news/{id}")
Call<DetailBean> getZhihuDetail(@Path("id") Integer id);
@FormUrlEncoded
@POST("/zhihu/login")
Call<String> login(@Field("username") String username,@Field("password") String password);
}
| [
"notrealxu@gmail.com"
] | notrealxu@gmail.com |
143d3283206574a4b4cd4aa1efb4e29dca6ba2ac | 65eee507e487a7e382fe850c9c5c52c6830d994e | /src/main/java/alex/falendish/utils/DiscountType.java | 2e470e118d2999bd8bf1f95bd436f439bb641537 | [] | no_license | BIONIX77-JAVA/EpamTaxiProject | fe5d6fafef4a4ce684a4cfb00d078cde75a2b670 | 80777751fb8b5b5c4a628d3ad952d8e39fc939d9 | refs/heads/master | 2023-08-12T21:07:32.332510 | 2021-09-24T20:03:42 | 2021-09-24T20:03:42 | 405,748,018 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | package alex.falendish.utils;
import java.math.BigDecimal;
public enum DiscountType {
BONUS_RIDE(BigDecimal.valueOf(50)),
PROMO_CODE(BigDecimal.ZERO);
private final BigDecimal percent;
DiscountType(BigDecimal percent) {
this.percent = percent;
}
public BigDecimal getPercent() {
return percent;
}
}
| [
"amrrkkcr@email.com"
] | amrrkkcr@email.com |
84650c2b5c459fcda62bd6298d0c9b0bea2fdc67 | de24bf5a235366e9d945d938c1abe38803883a40 | /classroom/src/main/java/com/czy/classroom/mapper/ClassRoomMapper.java | 8f36a1179f58619e38f14b7baf130700979f96e7 | [] | no_license | handsomeboyck/classroom | 00650c4e7d818f822fa6944cf611aa730c520aec | 9eb2b7922c8f2069936954b734bd7fca74fd648d | refs/heads/master | 2022-09-26T01:23:09.738647 | 2020-06-09T01:31:48 | 2020-06-09T01:31:48 | 270,874,058 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,156 | java | package com.czy.classroom.mapper;
import com.czy.classroom.domain.ClassRoom;
import com.czy.classroom.domain.User;
import com.czy.classroom.provider.ClassRoomProvider;
import com.czy.classroom.provider.UserProvider;
import org.apache.ibatis.annotations.*;
import java.util.List;
//Dao层
public interface ClassRoomMapper {
/*
查询所有教室
*/
@Select("select * from classroom")
List<ClassRoom> findAllClassRoom();
/*
通过id查询单个教室信息
*/
@Select("select * from classroom where id = #{id}")
ClassRoom findClassRoomById(Integer id);
/*
通过id删除教室
*/
@Delete("delete from classroom where id = #{id}")
Integer DeleteClassRoomById(Integer id);
/*
更新教室信息
*/
@UpdateProvider(type = ClassRoomProvider.class,method = "UpdateClassRoom")
void Update(ClassRoom classRoom);
/*
新增新教室
*/
@Insert("insert into classroom(name,number,flag,date) values(#{name},#{number},#{flag},#{date})")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
Integer InsertClassRoom(ClassRoom classRoom);
}
| [
"839567748@qq.com"
] | 839567748@qq.com |
bc06b78ad45740a0a982e28b63c0da6057dfb426 | 96638cdc47a77f5698c739fe9b39698cef2fc965 | /app/src/main/java/com/theminimaldeveloper/superheroes/ModelVideoDetails.java | 03be891293fc8b2fa351bf6f0a9e0afcb246c90b | [] | no_license | nirajwagh/superheroes_superheroines_android | 8442ca775ce8fca09fb4812808aee5924a54d22a | 0813564cac2ba243087bb3272eb5a9049e23859f | refs/heads/master | 2022-10-30T19:40:18.910776 | 2020-06-15T15:10:52 | 2020-06-15T15:10:52 | 269,530,390 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 657 | java | package com.theminimaldeveloper.superheroes;
public class ModelVideoDetails {
String videoID, title, channelName, thumbnailUrl;
public ModelVideoDetails(String videoID, String title, String channelName, String thumbnailUrl) {
this.videoID = videoID;
this.title = title;
this.channelName = channelName;
this.thumbnailUrl = thumbnailUrl;
}
public String getVideoID() {
return videoID;
}
public String getTitle() {
return title;
}
public String getChannelName() {
return channelName;
}
public String getThumbnailUrl() {
return thumbnailUrl;
}
}
| [
"iamnirajwagh@gmail.com"
] | iamnirajwagh@gmail.com |
45c2f804500bfa86db28865b2e6b8d0a0e51b4f4 | 72b88931f279f564370ea7f2a8477206944b9b16 | /src/test/java/course1/chapter12/AVLTreeTest.java | 624bb5bd214440a517346c9a400496d87616b592 | [] | no_license | wchb2015/algorithm_and_leetcode | 0a4a977504069f4cdf17c18f035db5e829f2240c | 7cb048786fa8210324ad34444bf428d8365861b0 | refs/heads/master | 2021-06-24T14:42:57.285012 | 2019-05-01T17:19:19 | 2019-05-01T17:19:19 | 134,014,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,530 | java | package course1.chapter12;
import com.wchb.course1.chapter12.AVLTree;
import com.wchb.course1.chapter7.FileOperation;
import org.junit.Test;
import java.util.ArrayList;
/**
* @date 6/7/18 10:58 PM
*/
public class AVLTreeTest {
@Test
public void test() {
System.out.println("Pride and Prejudice");
ArrayList<String> words = new ArrayList<>();
if (FileOperation.readFile("pride-and-prejudice.txt", words)) {
System.out.println("Total words: " + words.size());
AVLTree<String, Integer> map = new AVLTree<>();
for (String word : words) {
if (map.contains(word)) {
map.set(word, map.get(word) + 1);
} else {
map.add(word, 1);
}
}
System.out.println("Total different words: " + map.getSize());
System.out.println("Frequency of PRIDE: " + map.get("pride"));
System.out.println("Frequency of PREJUDICE: " + map.get("prejudice"));
System.out.println(" isBST :" + map.isBST());
System.out.println(" isBalanced :" + map.isBalanced());
System.out.println("----------");
for (String word : words) {
map.remove(word);
if (!map.isBalanced() || !map.isBST()) {
throw new RuntimeException(" is not balanced or is not bst");
}
}
System.out.println("DONE " + map.getSize());
}
}
}
| [
"wchb20155@gmail.com"
] | wchb20155@gmail.com |
c1dcc395d679013088ec57e0765f20e5c86046d8 | 0ce9a326e8a5ac92757e55c10c1d3f8202b2483d | /app/src/main/java/bo/com/innovasoft/maskotas/Crear_Mascotas.java | 0cc42190c30502b32cecc26623fe553436ca00ab | [] | no_license | Maskotas/aplicacionMaskota | ebfe360992ccc04ca8e0b9e79a76fe17155b7ccf | d8a69bcafc6ee80fded4706f859f5001d56ed24f | refs/heads/master | 2020-03-17T12:33:44.580405 | 2018-06-06T17:00:33 | 2018-06-06T17:00:33 | 133,593,736 | 0 | 0 | null | 2018-06-06T17:00:22 | 2018-05-16T01:34:25 | Java | UTF-8 | Java | false | false | 10,064 | java | package bo.com.innovasoft.maskotas;
import android.app.DatePickerDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.StrictMode;
import android.provider.MediaStore;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.app.Dialog;
import android.widget.DatePicker;
import android.widget.ImageView;
import android.widget.Toast;
import java.io.File;
import java.util.Calendar;
import static android.Manifest.permission.CAMERA;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
public class Crear_Mascotas extends AppCompatActivity {
//para la imagen
private final String CARPETA_RAIZ="misImagenesMaskota/";
private final String RUTA_IMAGEN=CARPETA_RAIZ+"misFotos";
final int COD_SELECCIONA=100;
final int COD_FOTO=200;
Button botonCargar;
ImageView imagen;
String path;
//para la fecha
EditText t1;
private int mYearIni, mMonthIni, mDayIni, sYearIni,sMonthIni,sDayIni;
static final int DATE_ID=0;
Calendar C = Calendar.getInstance();
//para cargar la imagen
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_crear__mascotas);
/*para cargar imagen comienza aqui*/
imagen=(ImageView) findViewById(R.id.fotomascota);
botonCargar=(Button)findViewById(R.id.btnsubirimagenperro);
if (validaPermisos()){
botonCargar.setEnabled(true);
}else {
botonCargar.setEnabled(false);
}
/*cargar imagen termina aqui*/
/*para captar la fecha comienza aqui*/
sMonthIni = C.get(Calendar.MONTH);
sDayIni = C.get(Calendar.DAY_OF_MONTH);
sYearIni=C.get(Calendar.YEAR);
t1=(EditText)findViewById(R.id.txtfechanacimiento);
t1.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick (View view){
showDialog(DATE_ID);
}
});
}
private void colocar_fecha(){
t1.setText((mDayIni+1)+"-"+ mMonthIni + "-" + mYearIni + "");
}
private DatePickerDialog.OnDateSetListener mDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
mYearIni = year;
mMonthIni = monthOfYear;
mDayIni = dayOfMonth;
colocar_fecha();
}
};
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DATE_ID:
return new DatePickerDialog(this, mDateSetListener, sYearIni, sMonthIni, sDayIni);
}
return null;
}
/*aqui termina para captar lafecha*/
/* APARTIR DE ANDROID N SE TIENE QUE PEDIR PERMISO PARA UTLIZAR LOS SERVICIOS
CODIGO PARA PEDIR PERMISOS PARA LEER LA CAMARA Y LA MEMORIA EXTERNA */
private boolean validaPermisos() {
if (Build.VERSION.SDK_INT<Build.VERSION_CODES.M){
return true;
}
//permiso para camara y leer memoria externa
if ((checkSelfPermission(CAMERA)== PackageManager.PERMISSION_GRANTED)&&
(checkSelfPermission(WRITE_EXTERNAL_STORAGE)== PackageManager.PERMISSION_GRANTED)){
return true;
}
if ((shouldShowRequestPermissionRationale(CAMERA))||(shouldShowRequestPermissionRationale(WRITE_EXTERNAL_STORAGE))){
cargarDialogoRecomendacion();
}else{
requestPermissions(new String[]{WRITE_EXTERNAL_STORAGE,CAMERA},100);
}
return false;
}
/*INICIO PARA PEDIR PERMISOS MANUAL DESPUES DE QUE EL USUARIO RECHAZA LOS MISMOS*/
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode==100){
if (grantResults.length==2 && grantResults[0] ==PackageManager.PERMISSION_GRANTED &&
grantResults[1] == PackageManager.PERMISSION_GRANTED){
botonCargar.setEnabled(true);
}else {
solicitarPermisoManual();
}
}
}
private void solicitarPermisoManual() {
final CharSequence[] opciones={"Si","No"};
final AlertDialog.Builder alertOpciones=new AlertDialog.Builder(Crear_Mascotas.this);
alertOpciones.setTitle("¿Desea Configurar los permisos de Forma Manual?");
alertOpciones.setItems(opciones, new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (opciones[i].equals("Si")){
Intent intent=new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri =Uri.fromParts("package",getPackageName(),null);
intent.setData(uri);
startActivity(intent);
}else {
Toast.makeText(getApplicationContext(),"Los permisos no fueron aceptados",Toast.LENGTH_SHORT).show();
dialogInterface.dismiss();
}
}
});
alertOpciones.show();
}
//FIN PERMISO MANUAL
/*INICIO PARA CARGAR DIALOGO PARA PEDIR PERMISOS PARA QUE FUNCIONE LA APP*/
private void cargarDialogoRecomendacion() {
AlertDialog.Builder dialogo=new AlertDialog.Builder(Crear_Mascotas.this);
dialogo.setTitle("Permisos Desactivados");
dialogo.setMessage("Debe aceptar los permisos para el correcto funcionamiento de la App");
dialogo.setPositiveButton("Aceptar",new DialogInterface.OnClickListener(){
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
public void onClick(DialogInterface dialogInterface, int i) {
requestPermissions(new String[]{WRITE_EXTERNAL_STORAGE,CAMERA},100);
}
});
dialogo.show();
}
/*FIN DE DIALOGO*/
public void onclick(View view) {
cargarimagen();
}
private void cargarimagen() {
final CharSequence[] opciones={"Tomar Foto","Cargar Imagen", "Cancelar"};
final AlertDialog.Builder alertOpciones=new AlertDialog.Builder(Crear_Mascotas.this);
alertOpciones.setTitle("Seleccione una Opcion");
alertOpciones.setItems(opciones, new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int i) {
if (opciones[i].equals("Tomar Foto")){
tomarFotografia();
}else {
if (opciones[i].equals("Cargar Imagen")){
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("image/*");
startActivityForResult(intent.createChooser(intent,"Seleccione la aplicacion "),COD_SELECCIONA);
dialog.dismiss();
}else {
dialog.dismiss();
}
}
}
});
alertOpciones.show();
}
/*INICIO PARA PODER UTILIZAR LA CAMARA */
private void tomarFotografia() {
File fileImagen = new File(Environment.getExternalStorageDirectory(),RUTA_IMAGEN);
boolean iscreada = fileImagen.exists();
String nombreImagen="";
if (iscreada==false){
iscreada=fileImagen.mkdirs();
}
if (iscreada==true){
nombreImagen=(System.currentTimeMillis()/100)+".jpg";
}
path = Environment.getExternalStorageDirectory()+File.separator+RUTA_IMAGEN+File.separator+nombreImagen;
//CONSTRUCTOR PARA DETECTAR FALLAS
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
// FIN DE CONSTRUCTOR
File imagen = new File(path);
Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(imagen));
startActivityForResult(intent,COD_FOTO);
}
/*fIN DE CODIGO PARA UTILIZAR LA CAMARA*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode==RESULT_OK){
switch (requestCode){
case COD_SELECCIONA:
Uri miPath =data.getData();
imagen.setImageURI(miPath);
break;
case COD_FOTO:
MediaScannerConnection.scanFile(this,new String[]{path},null,
new MediaScannerConnection.OnScanCompletedListener() {
@Override
public void onScanCompleted(String path, Uri uri) {
Log.i("Ruta de Almacenamiento","Path: "+path);
}
});
Bitmap bitmap= BitmapFactory.decodeFile(path);
imagen.setImageBitmap(bitmap);
break;
}
}
}
/*para cargar la imagen*/
}
| [
"jhondouglas.87@gmail.com"
] | jhondouglas.87@gmail.com |
e46674dc0ca2ccd890eca56d4ef13d26b040594c | 5772745dbbf2402cf50b3891d68aa943354756fc | /androidhttps/src/test/java/com/demo/androidhttps/ExampleUnitTest.java | 0f1784dddd043818183c684017d272b3025ea643 | [] | no_license | danityang/DemoAdvanced | 87f46d4b97f31b68cfe228221ddfadcc9314382c | 32feb5ded5a33a704de5ca5055c78406b4c30643 | refs/heads/master | 2021-01-02T08:51:10.253654 | 2017-10-17T10:07:35 | 2017-10-17T10:07:36 | 99,081,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 399 | java | package com.demo.androidhttps;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"yangdi128@163.com"
] | yangdi128@163.com |
0b51a5af0a9f35824e6e81b49d43b1531467c7f4 | 658d2ea2aef64f8a820219354aa4eccee89ffbc9 | /src/test/java/getRequest/getData.java | 6cef6c2bdcff0c2d3d4246391df42488834fcaf0 | [] | no_license | sandhyavegi/RestAPI | b9b613cf1431c21120bd5e3854b5f509b8a73dbf | d369542b9e5267d061b90fbd94f2f099426773de | refs/heads/master | 2021-04-03T09:52:51.451784 | 2018-03-10T18:46:16 | 2018-03-10T18:46:16 | 124,687,727 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package getRequest;
import org.testng.Assert;
import org.testng.annotations.Test;
import io.restassured.RestAssured;
import io.restassured.response.Response;
public class getData {
@Test
public void testResponsecode(){
Response res=RestAssured.get("http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b6907d289e10d714a6e88b30761fae22");
int code=res.statusCode();
System.out.println(code);
Assert.assertEquals(code,200);
}
@Test
public void testResponsedata(){
Response res=RestAssured.get("http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b6907d289e10d714a6e88b30761fae22");
String data=res.toString();
System.out.println("Data is "+data);
System.out.println(res.getTime());
}
}
| [
"konathalasandhya@gmail.com"
] | konathalasandhya@gmail.com |
1e67d9a9eda1ca642ce4975b480fa426cbb468a3 | f16a19358f5bfe299290b4c1425b2f5721507cd7 | /src/main/java/ApplicationManager.java | eb1eb17fbf94839a6c442053d7aac0a6162bae0a | [] | no_license | ApuscasiteiSilviu/CryptoManagement | c6b0f544695c48185344a6b3983def56d9a450eb | 62bf6646e72f53dbbe039996793bb7bf0326f0e6 | refs/heads/master | 2023-05-11T01:14:55.056203 | 2020-02-14T07:40:46 | 2020-02-14T07:40:46 | 217,910,266 | 0 | 0 | null | 2023-05-09T18:19:40 | 2019-10-27T20:09:28 | Java | UTF-8 | Java | false | false | 4,782 | java | import command.MathCommand;
import command.TradingViewCommand;
import cucumber.api.java.it.Ma;
import thirdParty.CryptoCompareGateway;
import thirdParty.CryptoPredictorGateway;
import thirdParty.Prediction;
import util.AppReadProperties;
import util.CryptoCoinMapping;
import util.MailUtil;
import util.UserReadProperties;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class ApplicationManager {
private UserReadProperties userReadProperties = new UserReadProperties();
private AppReadProperties appReadProperties = new AppReadProperties();
private TradingViewCommand tradingViewCommand;
private MathCommand mathCommand = new MathCommand();
private CryptoPredictorGateway cryptoPredictorGateway = new CryptoPredictorGateway();
private CryptoCompareGateway cryptoCompareGateway = new CryptoCompareGateway();
private Prediction prediction;
private List<Double> startValue = new ArrayList<>();
private List<Double> lastValue = new ArrayList<>();
private List<String> coinList = Arrays.asList(userReadProperties.getCryptoCoin().split(","));
public void initializeValues(){
for (String coin:coinList){
startValue.add(cryptoCompareGateway.getInitialValue(coin));
lastValue.add(cryptoCompareGateway.getInitialValue(coin));
}
}
public void manage(){
/* --------------------------------------------------------- */
// loop with all the crypto coins
//take current value from the page for one crypto coin
//take start and last value for that crypto coin
//take decision
//update values ( + send mail if its a good trade)
/* -------------------------------------------------------- */
tradingViewCommand = new TradingViewCommand();
tradingViewCommand.login();
System.out.println("Values before running");
System.out.println("Start values: " + startValue.toString() + " and " + "Last values: " + lastValue.toString());
System.out.println("");
Integer index = 0;
while (index < coinList.size()){
//take current value from page
tradingViewCommand.goToCurrency(CryptoCoinMapping.getAppValue(coinList.get(index)));
System.out.println(coinList.get(index) + " current price: " + tradingViewCommand.getCurrentPrice() );
prediction = cryptoPredictorGateway.getCoinPrediction(coinList.get(index));
System.out.println("Prediction: " + prediction.getCoinPrice());
// List<Object> list = mathCommand.takeDecision(startValue.get(index), lastValue.get(index), prices[indexPricesList][index], coinList.get(index));
List<Object> list = mathCommand.takeDecision(startValue.get(index), lastValue.get(index), Double.valueOf(tradingViewCommand.getCurrentPrice()), coinList.get(index));
//update values
startValue.set(index, Double.valueOf(String.valueOf(list.get(0))));
lastValue.set(index, Double.valueOf(String.valueOf(list.get(1))));
//send mail
if (list.get(2) != ""){
System.out.println(list.get(2));
try {
MailUtil.sendMail( userReadProperties.getGmailAccount(), appReadProperties.getApplicationGmailAccountName(), "It's time to make a trade" , list.get(2) + " Tomorrow, this value could be " + prediction.getCoinPrice() + " " + prediction.getCurrency());
} catch (IOException e) {
e.printStackTrace();
}
}
index++;
}
System.out.println("");
System.out.println("Values after running");
System.out.println("Start values: " + startValue.toString() + " and " + "Last values: " + lastValue.toString());
tradingViewCommand.closeThePage();
}
public void closeDriverConnectionWithTradingViewSite(){
tradingViewCommand = new TradingViewCommand();
tradingViewCommand.closeThePage();
}
public void sendRegistrationEmail(){
try {
MailUtil.sendMail(userReadProperties.getGmailAccount(), appReadProperties.getApplicationGmailAccountName(), "CryptoManagement registration", "Welcome to our team! :)");
} catch (IOException e) {
e.printStackTrace();
}
}
public void sendLifeServerCheckEmail(){
try {
MailUtil.sendMail(appReadProperties.getApplicationGmailAccountName(), appReadProperties.getApplicationGmailAccountName(), "Server life cycle", "Hello sir, The server is still running! Thank you! :)");
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"silviu.apuscasitei@endava.com"
] | silviu.apuscasitei@endava.com |
4dc3f8d0d1ccf1c7b4c6945c49bfb48dcda148af | a2eefb604b06d6646ca7252cc524eab91a1e4fb5 | /sla-enforcement/src/test/java/eu/atos/sla/evaluation/constraint/simple/OperatorTest.java | 229156434d770340769e8033395a7a4a65583cb4 | [
"Apache-2.0"
] | permissive | SeaCloudsEU/sla-core | 1694e413b9716c111b373f0090ccf450f0a964c7 | 06fb06a5acf918ba2c527faa62e108f5e0ff52e9 | refs/heads/develop | 2021-01-18T08:29:50.942347 | 2015-07-09T09:10:30 | 2015-07-09T09:10:30 | 26,329,586 | 0 | 1 | null | 2015-07-09T09:10:30 | 2014-11-07T17:14:52 | Java | UTF-8 | Java | false | false | 2,815 | java | /**
* Copyright 2014 Atos
* Contact: Atos <roman.sosa@atos.net>
*
* 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 eu.atos.sla.evaluation.constraint.simple;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import eu.atos.sla.evaluation.constraint.simple.Operator;
public class OperatorTest {
/**
* Calculates three comparisons to test an operator, where the operands are:
* op1 = op2
* op1 > op2
* op1 < op2
*
* @param operator Operator to test
* @param assert1 the operator should return this for the first set of operands (i.e. if
* assert1 is true, the operator should be EQ, GE or LE)
* @param assert2
* @param assert3
*/
public void testOperator(Operator operator, boolean assert1, boolean assert2, boolean assert3) {
double[] _0 = new double[] { 0 };
double[] _1 = new double[] { 1 };
assertEquals(operator.eval(0, _0), assert1);
assertEquals(operator.eval(1, _0), assert2);
assertEquals(operator.eval(0, _1), assert3);
}
@Test
public void testEval() {
/*
* Test simple operators
*/
testOperator(Operator.GT, false, true, false);
testOperator(Operator.GE, true, true, false);
testOperator(Operator.EQ, true, false, false);
testOperator(Operator.LT, false, false, true);
testOperator(Operator.LE, true, false, true);
testOperator(Operator.NE, false, true, true);
double[] _0_1 = new double[] { 0d, 1d };
/*
* Test between
*/
assertTrue(Operator.BETWEEN.eval(0, _0_1));
assertTrue(Operator.BETWEEN.eval(1, _0_1));
assertTrue(Operator.BETWEEN.eval(0.5, _0_1));
assertFalse(Operator.BETWEEN.eval(-0.1, _0_1));
assertFalse(Operator.BETWEEN.eval(1.1, _0_1));
/*
* Test in
*/
assertTrue(Operator.IN.eval(0, _0_1));
assertTrue(Operator.IN.eval(1, _0_1));
assertFalse(Operator.IN.eval(2, _0_1));
/*
* Tests exists (right operand is don't care)
*/
assertTrue(Operator.EXISTS.eval(0, new double[] {}));
/*
* Tests not exists (right operand is don't care)
*/
assertFalse(Operator.NOT_EXISTS.eval(0, new double[] {}));
}
}
| [
"roman.sosa@atos.net"
] | roman.sosa@atos.net |
c793e03036e03b7d07593a7c994e8d62f06fa124 | 28aafa1795a46eb6e75da8d70e6aa5be339a0312 | /src/main/java/ngp/search/core/api/params/QueryParamsBuilder.java | 66eeb6f620fc6318c4971879ea573850c585020e | [] | no_license | leond08/ngp-search | 941c76e2d0a4bf9d288a0f82e23ac785a6acc735 | ecf52c0505e563f742e6b373698d0a5f00b5c0ef | refs/heads/master | 2020-03-12T12:28:59.616364 | 2018-04-23T00:52:18 | 2018-04-23T00:52:18 | 130,619,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 212 | java | package ngp.search.core.api.params;
import javax.portlet.PortletRequest;
public interface QueryParamsBuilder {
public QueryParams buildQueryParams(
PortletRequest portletRequest)
throws Exception;
}
| [
"markleo.sumadero@dict.gov.ph"
] | markleo.sumadero@dict.gov.ph |
95c87c382851eeda60700cb7ed00311d8e9ae0b3 | 1f10afdd0fb494c2bb33d3e2d0e760a8b4d8c898 | /9.ActionBars-Drawers-Tabs/HW-Cinemas/app/src/main/java/com/example/andrey/hw_cinemas/Fragments/MovieInfoFragment.java | 11e58e2ef46eee7ae14b327cc11b4833d4eec417 | [] | no_license | andrei-pl/SoftAcad | 8e11c8d10e929bd1b5a6918dba1b6bd130d2210a | 6aa3b2ca7c59e934453c731b9921277a89ce8233 | refs/heads/master | 2018-12-28T10:30:55.674144 | 2015-08-22T15:32:43 | 2015-08-22T15:32:43 | 26,921,609 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,621 | java | package com.example.andrey.hw_cinemas.Fragments;
import android.app.Activity;
import android.app.FragmentManager;
import android.net.Uri;
import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.andrey.hw_cinemas.CinemaActivity;
import com.example.andrey.hw_cinemas.Models.Cinema;
import com.example.andrey.hw_cinemas.Models.Movie;
import com.example.andrey.hw_cinemas.R;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link MovieInfoFragment.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link MovieInfoFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class MovieInfoFragment extends Fragment implements View.OnClickListener {
private static final String ARG_PARAM1 = "section_number";
private String mParam1;
private ImageView picMovie;
private TextView txtMovieName;
private TextView txtAvailableSeats;
private Button btnAvailableSeats;
private OnFragmentInteractionListener mListener;
private Movie movie;
private Cinema cinema;
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @return A new instance of fragment MovieInfoFragment.
*/
public static MovieInfoFragment newInstance(String param1, Movie movie, Cinema cinema) {
MovieInfoFragment fragment = new MovieInfoFragment();
Bundle args = new Bundle();
args.putString(param1, movie.getName());
fragment.setArguments(args);
fragment.movie = movie;
fragment.cinema = cinema;
return fragment;
}
public MovieInfoFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_movie_info, container, false);
this.picMovie = (ImageView) rootView.findViewById(R.id.moviePicInfo);
this.picMovie.setImageBitmap(this.movie.getPicMovie());
this.txtMovieName = (TextView) rootView.findViewById(R.id.txtMovieNameInfo);
this.txtMovieName.setText(this.movie.getName());
this.txtAvailableSeats = (TextView) rootView.findViewById(R.id.txtSeats);
this.txtAvailableSeats.setText(String.valueOf(this.movie.getCinemas().get(cinema)));
this.btnAvailableSeats = (Button) rootView.findViewById(R.id.btnBookTickets);
this.btnAvailableSeats.setOnClickListener(this);
return rootView;
}
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
((CinemaActivity) activity).onSectionAttached(
getArguments().getInt(ARG_PARAM1));
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
@Override
public void onClick(View v) {
int viewId = v.getId();
if(viewId == R.id.btnBookTickets){
FragmentManager manager = getFragmentManager();
BookTicketsDialogFragment bookTickets = new BookTicketsDialogFragment();
bookTickets.setMovie(movie);
bookTickets.show(manager, "BookTicketsDialogFragment");
}
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p/>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
public void onFragmentInteraction(Uri uri);
}
}
| [
"andrey.pld@gmail.com"
] | andrey.pld@gmail.com |
ceebb05f95f561d1edf3793edc758dcf275422e9 | ca493c514d92ab502187912e79f526e0f1c38b5a | /src/lesson23/homeTasks/Port.java | 12a406aaafd02b02eb143414ea35a1cc3c2e0aeb | [] | no_license | AleksandrMikhin/lessons | 3dad6a5a6a27fcb7934c10ef9d05454d99a04520 | 62a79daccba5bac36d41ce4779a9d8d736f15b1c | refs/heads/master | 2022-01-25T18:34:40.043317 | 2019-01-16T12:10:35 | 2019-01-16T12:10:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,755 | java | package lesson23.homeTasks;
// Порт. Корабли заходят в порт для разгрузки/загрузки.
// Работает несколько причалов. У одного причала может стоять один корабль.
// Корабль может загружаться у причала, разгружаться или выполнять оба действия.
// (при решении использовать классы из пакета java.util.concurrent)
import java.util.Random;
import java.util.concurrent.*;
public class Port {
private BlockingQueue<Ship> listShips;
private ExecutorService dockPool;
public Port(int maxQueueShips, int dockCount) {
listShips = new ArrayBlockingQueue(maxQueueShips, true);
dockPool = Executors.newFixedThreadPool(dockCount);
addDock(dockCount);
}
public void addDock(int dockCount) {
for (int i = 0; i < dockCount; i++)
dockPool.submit(new DockThread("Dock" + (i+1) ));
}
public void addShipQueue(Ship ship) {
if (dockPool.isShutdown()) {
System.out.println(ship + "не может зайти в порт - порт закрыт!");
return;
}
try {
listShips.put(ship);
System.out.println(ship + "зашел в порт");
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public void stop() {
dockPool.shutdown();
while (!dockPool.isTerminated()) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("Порт закончил работу.");
}
class DockThread implements Runnable {
String name;
public DockThread(String name) {
this.name = name;
}
private void loadShip(Ship ship) throws InterruptedException {
int addCargoCount = new Random().nextInt(ship.size - ship.cargoCount) + 1;
Thread.sleep(100 * addCargoCount);
ship.cargoCount += addCargoCount;
System.out.println(ship + "погружен контейнерами в количестве: " + addCargoCount + " шт");
}
private void unloadShip(Ship ship) throws InterruptedException {
int putCargoCount = new Random().nextInt(ship.cargoCount) + 1;
Thread.sleep(80 * putCargoCount);
ship.cargoCount -= putCargoCount;
System.out.println(ship + "разгрузил контейнеров в клоличестве: " + putCargoCount + " шт");
}
@Override
public void run() {
Thread.currentThread().setName(name);
Ship ship;
try {
while ((ship = listShips.poll(100, TimeUnit.MILLISECONDS)) != null) {
ship = listShips.take();
System.out.println(ship + "подошел к причалу " + Thread.currentThread().getName());
if (ship.action == Action.UNLOAD || ship.action == Action.BOTH) unloadShip(ship);
if (ship.action == Action.LOAD || ship.action == Action.BOTH) loadShip(ship);
System.out.println(ship + "покинул причал " + Thread.currentThread().getName());
}
} catch (InterruptedException e) {
//
}
}
}
public static void main(String[] args) {
Port port = new Port(5, 3); // 3 причала, очередь в порту из 5и ожидающих кораблей
for (int i = 1; i < 11; i++){
int size = new Random().nextInt(10)*10 + 10;
int cargoCount = new Random().nextInt(size);
Action action = (cargoCount == 0)? Action.LOAD :
(cargoCount == size)? new Action[]{Action.UNLOAD, Action.BOTH}[new Random().nextInt(2)] :
Action.values()[new Random().nextInt(3)];
Ship ship = new Ship("Ship" + i, size, cargoCount, action);
port.addShipQueue(ship);
}
port.stop();
}
}
class Ship {
final String name;
final int size;
int cargoCount;
Action action;
public Ship(String name, int size, int cargoCount, Action action) {
this.name = name;
this.size = size;
this.cargoCount = cargoCount;
this.action = action;
}
@Override
public String toString() {
return "Корабль " + name + " : " + size + " (" + cargoCount + ") ";
}
}
enum Action {LOAD, UNLOAD, BOTH} | [
"mihanoidy@gmail.com"
] | mihanoidy@gmail.com |
26d5570249104acbd44f070334138ebe785677f3 | 4b8088ceae49e020c9d2cc267ba633a05a6a8cc7 | /알고시간코드/DFS_반복문_연습문제1_임진섭.java | 7b00bbbfd21028ed161f7cffa30ce750e13b862b | [] | no_license | leechaeyeong/SSAFY2 | b3da004f314840567a39237e7694a9b6e4b3c3bf | 69fd35bb80123c3d9e201748491b78e226c266ec | refs/heads/master | 2023-02-03T18:28:13.360493 | 2020-12-20T14:47:45 | 2020-12-20T14:47:45 | 314,085,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 908 | java | import java.util.Scanner;
import java.util.Stack;
public class DFS_반복문_연습문제1_임진섭 {
static boolean[] visited = new boolean[8];
static Stack<Integer> st = new Stack<Integer>();
static int[][] arr = new int[8][8];
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 8; i++) {
int u = sc.nextInt();
int v = sc.nextInt();
arr[u][v] = 1;
arr[v][u] = 1;
}
DFS(1);
} // end of main
public static void DFS(int v) {
visited[v] = true;
st.push(v);
System.out.print(v + " ");
while (!st.isEmpty()) {
int flag = -1;
for (int i = 1; i < arr[v].length; i++) {
if (arr[v][i] == 1 && !visited[i]) {
flag = i;
visited[flag] = true;
st.push(flag);
v = flag;
System.out.print(flag + " ");
break;
}
} // end of for
if (flag == -1)
v = st.pop();
}
}
} // end of class
| [
"lcy707@naver.com"
] | lcy707@naver.com |
2ad889d5cbead5f4f6cefe018872dd556d8b4c6b | 101c22773c07837cd178111085791bf9ddd20af8 | /workspace/19_SEARCH/src/dao/WhiteDao.java | 645ea5c1eb04eafab6ab9435719df3fccf73ffa7 | [] | no_license | Jakezo/JSP_Study | 732b22f9102083dc7d4ecf54a0f386279afea698 | 8215dd93a5072a6181fc74ec45131e4b2f6c787d | refs/heads/master | 2023-07-10T18:09:20.615593 | 2021-08-17T14:12:01 | 2021-08-17T14:12:01 | 390,920,110 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,267 | java | package dao;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import dto.WhiteDto;
import mybatis.config.DBService;
public class WhiteDao {
private SqlSessionFactory factory;
private WhiteDao() {
factory = DBService.getInstance().getFactory();
}
private static WhiteDao whiteDao = new WhiteDao();
public static WhiteDao getInsetance() {
return whiteDao;
}
public List<WhiteDto> list() {
SqlSession ss = factory.openSession();
List<WhiteDto> list = ss.selectList("mybatis.mapper.white.getList");
ss.close();
return list;
}
public List<WhiteDto> titleList(String query) {
SqlSession ss = factory.openSession();
List<WhiteDto> title = ss.selectList("mybatis.mapper.white.getTitle", query);
ss.close();
return title;
}
public List<WhiteDto> contentList(String query) {
SqlSession ss = factory.openSession();
List<WhiteDto> content = ss.selectList("mybatis.mapper.white.getContent", query);
ss.close();
return content;
}
public List<WhiteDto> bothList(String query) {
SqlSession ss = factory.openSession();
List<WhiteDto> content = ss.selectList("mybatis.mapper.white.getBoth", query);
ss.close();
return content;
}
}
| [
"cakim21@naver.com"
] | cakim21@naver.com |
337908beda7e92f6c5d5208fe6a6fcafd7e366b3 | 499eab98166d01a23b538e4752c9af0426723053 | /app/src/main/java/com/example/gibbidi/FYL/Task.java | 86e6811bd29a7952de78bde1587f7745c147b179 | [] | no_license | gibbidi/FYL | c81e7aeb6872f254c45766662d0572a49f872b49 | 3359baa8c280724c542df18cab4e8e176016321c | refs/heads/master | 2021-01-23T18:50:07.881344 | 2015-05-02T22:07:21 | 2015-05-02T22:07:21 | 34,959,772 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,953 | java | package com.example.gibbidi.FYL;
import com.parse.ParseClassName;
import com.parse.ParseObject;
import com.parse.ParseUser;
@ParseClassName("Task")
public class Task extends ParseObject{
public Task(){
}
public boolean isCompleted(){
return getBoolean("completed");
}
public void setCompleted(boolean complete){
put("completed", complete);
}
public String getHotelName(){
return getString("HotelName");
}
public String getHotelPrice(){
return getString("HotelPrice");
}
public String getHotelLocation(){
return getString("HotelLocation");
}
//public ArrayList<String> getBookedDay() { return getArray("BookedDay");}
public boolean getMon(){return getBoolean("Mon");}
public boolean getTue(){return getBoolean("Tue");}
public boolean getWed(){return getBoolean("Wed");}
public boolean getThu(){return getBoolean("Thu");}
public boolean getFri(){return getBoolean("Fri");}
public boolean getSat(){return getBoolean("Sat");}
public boolean getSun(){return getBoolean("Sun");}
public void setHotelName(String HotelName){put("HotelName", HotelName);}
public void setHotelPrice(String HotelPrice) { put("HotelPrice",HotelPrice); }
public void setHotelLocation(String HotelLocation) { put("HotelLocation", HotelLocation);}
//public void setBookedDay(ArrayList<String> BookedDay) {put("BookedDay",BookedDay);}
//public void setUserType(String UserType) {put("UserType",UserType);}
public void setMon(boolean Mon){put("Mon",Mon);}
public void setTue(boolean Tue){put("Tue",Tue);}
public void setWed(boolean Wed){put("Wed",Wed);}
public void setThu(boolean Thu){put("Thu",Thu);}
public void setFri(boolean Fri){put("Fri",Fri);}
public void setSat(boolean Sat){put("Sat",Sat);}
public void setSun(boolean Sunday){put("Sun",Sunday);}
public void setUser(ParseUser currentUser) {
put("user", currentUser);
}
}
| [
"gibbidiabhishek@gmail.com"
] | gibbidiabhishek@gmail.com |
89b4486fadcf2fb5cebcbccede78b0887e8cb41d | a41d626e24c6c91c38f17b9bb4c553145492bf7e | /app/src/main/java/com/udacity/education/newsapp/ui/recycler/DividerItemDecoration.java | 88fde72a1756eb9d882a6c7549a058d916e4d866 | [] | no_license | dhiegoabrantes/udacity-news-app | 8bc849bb6b446bd3215215f8ea2afd05c8ee56b1 | 1867afe291f88d0ca47071553ef85678bf10f47b | refs/heads/master | 2020-07-31T17:10:42.157214 | 2016-12-15T04:49:16 | 2016-12-15T04:49:16 | 73,594,585 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,288 | java | package com.udacity.education.newsapp.ui.recycler;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
* Created by dhiegoabrantes on 24/09/16.
*/
public class DividerItemDecoration extends RecyclerView.ItemDecoration {
private static final int[] ATTRS = new int[]{
android.R.attr.listDivider
};
public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL;
public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL;
private Drawable mDivider;
private int mOrientation;
public DividerItemDecoration(Context context, int orientation) {
final TypedArray a = context.obtainStyledAttributes(ATTRS);
mDivider = a.getDrawable(0);
a.recycle();
setOrientation(orientation);
}
public void setOrientation(int orientation) {
if (orientation != HORIZONTAL_LIST && orientation != VERTICAL_LIST) {
throw new IllegalArgumentException("invalid orientation");
}
mOrientation = orientation;
}
@Override
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
if (mOrientation == VERTICAL_LIST) {
drawVertical(c, parent);
} else {
drawHorizontal(c, parent);
}
}
public void drawVertical(Canvas c, RecyclerView parent) {
final int left = parent.getPaddingLeft();
final int right = parent.getWidth() - parent.getPaddingRight();
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
.getLayoutParams();
final int top = child.getBottom() + params.bottomMargin;
final int bottom = top + mDivider.getIntrinsicHeight();
mDivider.setBounds(left, top, right, bottom);
mDivider.draw(c);
}
}
public void drawHorizontal(Canvas c, RecyclerView parent) {
final int top = parent.getPaddingTop();
final int bottom = parent.getHeight() - parent.getPaddingBottom();
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
.getLayoutParams();
final int left = child.getRight() + params.rightMargin;
final int right = left + mDivider.getIntrinsicHeight();
mDivider.setBounds(left, top, right, bottom);
mDivider.draw(c);
}
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
if (mOrientation == VERTICAL_LIST) {
outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
} else {
outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0);
}
}
} | [
"dhiegoabrantes@gmail.com"
] | dhiegoabrantes@gmail.com |
5d48c8f6ffac38e79c0af80acc1aa3380843b280 | 00cb6f98d9796ca777afc9d26cb557b6f5fe3cda | /mygo/mygo-alipay/src/main/java/com/alipay/api/domain/InsSumInsured.java | a25627f29e3c6d08d24d5a2388c0edd84beb454a | [] | no_license | caizhongao/mygo | e79a493948443e6bb17a4390d0b31033cd98d377 | 08a36fe0aced49fc46f4541af415d6e86d77d9c9 | refs/heads/master | 2020-09-06T12:45:37.350935 | 2017-06-26T05:51:50 | 2017-06-26T05:51:50 | 94,418,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,945 | java | package com.alipay.api.domain;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 保额
*
* @author auto create
* @since 1.0, 2017-02-06 10:21:00
*/
public class InsSumInsured extends AlipayObject {
private static final long serialVersionUID = 4666129325584569611L;
/**
* 保额默认值;单位分
*/
@ApiField("default_value")
private Long defaultValue;
/**
* 保额最大值;单位分,当sum_insured_type=MONEY_RANGE时该值有效
*/
@ApiField("max_value")
private Long maxValue;
/**
* 保额最小值;单位分,当sum_insured_type=MONEY_RANGE时该值有效
*/
@ApiField("min_value")
private Long minValue;
/**
* 保额类型;MONEY_RANGE:金额范围,MONEY_LIST:金额可选值,ENUM_VALUE:枚举值
*/
@ApiField("sum_insured_type")
private String sumInsuredType;
/**
* 保额列表;列表里的值单位为分,当sum_insured_type=MONEY_LIST时该值有效
*/
@ApiListField("sum_insureds")
@ApiField("number")
private List<Long> sumInsureds;
public Long getDefaultValue() {
return this.defaultValue;
}
public void setDefaultValue(Long defaultValue) {
this.defaultValue = defaultValue;
}
public Long getMaxValue() {
return this.maxValue;
}
public void setMaxValue(Long maxValue) {
this.maxValue = maxValue;
}
public Long getMinValue() {
return this.minValue;
}
public void setMinValue(Long minValue) {
this.minValue = minValue;
}
public String getSumInsuredType() {
return this.sumInsuredType;
}
public void setSumInsuredType(String sumInsuredType) {
this.sumInsuredType = sumInsuredType;
}
public List<Long> getSumInsureds() {
return this.sumInsureds;
}
public void setSumInsureds(List<Long> sumInsureds) {
this.sumInsureds = sumInsureds;
}
}
| [
"mufeng@juanpi.com"
] | mufeng@juanpi.com |
78a9f7860c54c0b1b854767dce6dd90ef7e3f58b | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_c7399eb0ad81015357c7c556ebca28d2d951ba5e/SportletConfig/11_c7399eb0ad81015357c7c556ebca28d2d951ba5e_SportletConfig_t.java | 21a2c9259cfbaee16a99f8f725338c763e37c5d7 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 6,015 | java | /*
* @author <a href="mailto:novotny@aei.mpg.de">Jason Novotny</a>
* @version $Id$
*/
package org.gridlab.gridsphere.portlet.impl;
import org.gridlab.gridsphere.portlet.*;
import org.gridlab.gridsphere.portletcontainer.ApplicationPortletConfig;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.List;
import java.io.File;
/**
* The <code>SportletConfig</code> class provides the portlet with its
* configuration. The configuration holds information about the portlet that
* is valid for all users, and is maintained by the administrator. The portlet
* can therefore only read the configuration. Only when the portlet is in
* <code>CONFIGURE</code> mode, it has write access to the configuration data
* (the rest of the configuration is managed by the portlet container directly).
*/
public class SportletConfig implements PortletConfig {
private static PortletLog log = SportletLog.getInstance(SportletConfig.class);
private ServletConfig servletConfig = null;
private PortletContext context = null;
private String portletName = null;
private String groupName = null;
private List supportedModes = new ArrayList();
private List allowedStates = new ArrayList();
private Hashtable configs = new Hashtable();
/**
* Cannot instantiate uninitialized SportletConfig
*/
private SportletConfig() {}
/**
* Constructs an instance of PortletConfig from a servlet configuration
* object and an application portlet descriptor
*
* @param servletConfig a <code>ServletConfig</code>
* @param appConfig a <code>ApplicationSportletConfig</code>
*/
public SportletConfig(ServletConfig servletConfig, ApplicationPortletConfig appConfig) {
this.servletConfig = servletConfig;
this.context = new SportletContext(servletConfig);
// set portlet modes
supportedModes = appConfig.getSupportedModes();
// set allowed states info
allowedStates = appConfig.getAllowedWindowStates();
// set portlet config information
configs = appConfig.getConfigParams();
portletName = appConfig.getPortletName();
// the group name is the web application name which can be found from
// the context path
String ctxPath = context.getRealPath("");
int i = ctxPath.lastIndexOf(File.separator);
groupName = ctxPath.substring(i+1);
//this.logConfig();
}
/**
* Returns the portlet context.
*
* @return the portlet context
*/
public PortletContext getContext() {
return context;
}
/**
* Returns the name of the portlet.
*
* @return the name of the portlet
*/
public String getName() {
return portletName;
}
/**
* Returns the group name associated with the portlet
*
* @return the group name associated with the portlet
*/
public String getGroupName() {
return groupName;
}
/**
* Returns whether the portlet supports the given mode for the given client.
*
* @param mode the portlet mode
*
* @return <code>true</code> if the window supports the given state,
* <code>false</code> otherwise
*/
public boolean supports(Portlet.Mode mode) {
return (supportedModes.contains(mode) ? true : false);
}
/**
* Returns whether the portlet window supports the given state
*
* @param state the portlet window state
* @return <code>true</code> if the window supports the given state,
* <code>false</code> otherwise
*/
public boolean supports(PortletWindow.State state) {
return (allowedStates.contains(state) ? true : false);
}
public final String getInitParameter(String name) {
return (String) configs.get(name);
}
public final Enumeration getInitParameterNames() {
return configs.keys();
}
public final ServletContext getServletContext() {
return servletConfig.getServletContext();
}
public final String getServletName() {
return servletConfig.getServletName();
}
public void logConfig() {
String name, paramvalue, vals;
Object attrvalue;
Enumeration enum, eenum;
log.debug("PortletConfig Information");
log.debug("portlet name: " + this.getName());
log.debug("portlet group name: " + this.getGroupName());
log.debug("servlet name: " + this.getServletName());
log.debug("config init parameters: ");
enum = this.getInitParameterNames();
while (enum.hasMoreElements()) {
name = (String) enum.nextElement();
vals = getInitParameter(name);
log.debug("\t\tname=" + name + " value=" + vals);
}
log.debug("PortletContext Information:");
log.debug("Container Info: " + context.getContainerInfo());
log.debug("major version: " + context.getMajorVersion() + " minor version: " + context.getMinorVersion());
/*
log.info("Server Info: " + context.getServerInfo());
enum = context.getAttributeNames();
while (enum.hasMoreElements()) {
name = (String) enum.nextElement();
attrvalue = (Object) context.getAttribute(name);
log.debug("\t\tname=" + name + " object type=" + attrvalue.getClass().getName());
}
log.info("context init parameters: ");
enum = context.getInitParameterNames();
while (enum.hasMoreElements()) {
name = (String) enum.nextElement();
vals = context.getInitParameter(name);
log.info("\t\tname=" + name + " value=" + vals);
}
*/
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
1d2fd68c0dab04f18d175e5fd02cd2d6adce729c | f01d08c4a4af6927795b56a5c5a4714306877b76 | /app/src/main/java/com/dt/anh/appdoi2h/controller/LeaderAdapter.java | 10bf6e5a1f8e5a3ab30cdd9686edfac384a0124f | [] | no_license | dangtrunganh/AppDoi2H | a9b10956005832a0ec7f12969f220d9225a3f171 | 3f52a298d9c20f5dedd7c3862756351855b6297e | refs/heads/master | 2021-01-06T20:40:58.684124 | 2017-08-07T06:44:09 | 2017-08-07T06:44:09 | 99,545,587 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,982 | java | package com.dt.anh.appdoi2h.controller;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.dt.anh.appdoi2h.R;
import com.dt.anh.appdoi2h.model.ItemLeader;
import java.util.ArrayList;
/**
* Created by ALIENWARE on 4/7/2017.
*/
public class LeaderAdapter extends BaseAdapter{
private Context context;
private LayoutInflater inflater;
private ArrayList<ItemLeader> arrayLeaders;
public LeaderAdapter(Context context, ArrayList<ItemLeader> arrayLeaders) {
this.context = context;
this.arrayLeaders = arrayLeaders;
inflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return arrayLeaders.size();
}
@Override
public ItemLeader getItem(int position) {
return arrayLeaders.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if(convertView == null) {
//Nếu converView bằng null thì tạo mới = inflate
convertView = inflater.inflate(R.layout.item_leader, parent, false /*Phai la false*/);
//holer như cái giỏ, chỉ thêm vào giỏ ở lần đầu
holder = new ViewHolder();
holder.imgPhoto = (ImageView) convertView.findViewById(R.id.iv_item_leader); //Lấy id từ convertView
holder.tvName = (TextView) convertView.findViewById(R.id.tv_item_leader_name);
holder.tvPosition = (TextView) convertView.findViewById(R.id.tv_item_leader_position);
convertView.setTag(holder); //Nhét cái giỏ và convertView
} else {
holder = (ViewHolder) convertView.getTag(); //Vì đã lưu rồi nên chỉ việc get ra
}
//Buoc 2: Đổ dữ liệu tương ứng từ mảng
ItemLeader itemLeader = arrayLeaders.get(position);
holder.imgPhoto.setImageResource(itemLeader.getImage());
holder.tvName.setText(itemLeader.getName());
holder.tvPosition.setText(itemLeader.getPosition());
holder.imgPhoto.setOnClickListener(new View.OnClickListener() {
//Ưu tiên chạy sự kiện click vào photo trước
@Override
public void onClick(View v) {
Toast.makeText(context, "Photo Click:" + position, Toast.LENGTH_SHORT).show();
}
});
return convertView;//Tra ve View con
}
private class ViewHolder {
private ImageView imgPhoto; //Vì trong nội class nên vẫn truy cập được các thuộc tính bình thường.
private TextView tvName;
private TextView tvPosition;
}
}
| [
"dangtrunganh.hust@gmail.com"
] | dangtrunganh.hust@gmail.com |
ddee199e32624984887c1953f3816e08cd9fb63b | 83bb14843855298b913e3e0374424968084f4218 | /src/main/java/com/yourdomain/model/Student.java | f1b82ae711f35c5f78493f95923102846aea5785 | [] | no_license | AntiKINACom/login-service | 1656174db30561a64c0b7f7a984c2109344910d1 | ef2c48188b999e24451dd21a67cd2d5958e88a27 | refs/heads/main | 2023-02-25T02:05:55.449369 | 2021-02-03T13:47:54 | 2021-02-03T13:47:54 | 334,704,539 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 632 | java | package com.yourdomain.model;
import lombok.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Table(name = "students")
@Entity
public class Student extends AppUser {
@Getter
@Column(updatable = false, nullable = false)
private final Integer studentId;
@Getter
@Column(nullable = false)
private final String studentName;
public Student(String username, String email, String password, int studentId, String studentName) {
super(username, email, password);
this.studentId = studentId;
this.studentName = studentName;
}
}
| [
"boileryju@gmail.com"
] | boileryju@gmail.com |
9daaa8c781452bddc3397f9004ddceb8812ca199 | dbc72e20f4b940513a71de3cbe6646022727c1ed | /src/main/java/pl/webapp/arbitratus/Security/CurrentUser.java | 7fc69a68bea57c7510c15b3002d3d0c1448c07a1 | [] | no_license | ranji94/Hajsownik-Service | 6d3cfbdb04a6fb4f88495d2bc21bb2fad1526cdf | 9f6a4e4e3c7ca982dc39f52787f624a7f4eba404 | refs/heads/master | 2020-04-30T09:07:56.130108 | 2019-06-18T08:37:07 | 2019-06-18T08:37:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package pl.webapp.arbitratus.Security;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import java.lang.annotation.*;
@Target({ElementType.PARAMETER, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@AuthenticationPrincipal
public @interface CurrentUser {
}
| [
"ranji@notowany.pl"
] | ranji@notowany.pl |
91d01ddec28b05e0685b5d992247ab0bfdb3ddba | 9f38c66cd0b9a5dc252e6af9a3adc804915ff0e9 | /java/src/designpatterns/behavioral/observers/observers/converts/HexaObserver.java | e959aa45d88b684aff2ecce58080d4e15df548ce | [
"MIT"
] | permissive | vuquangtin/designpattern | 4d4a7d09780a0ebde6b12f8edf589b6f45b38f62 | fc672493ef31647bd02c4122ab01992fca14675f | refs/heads/master | 2022-09-12T07:00:42.637733 | 2020-09-29T04:20:50 | 2020-09-29T04:20:50 | 225,505,298 | 0 | 0 | null | 2022-09-01T23:16:34 | 2019-12-03T01:41:33 | Java | UTF-8 | Java | false | false | 807 | java | package observers.converts;
/**
* <h1>Observer</h1> Định nghĩa một sự phụ thuộc 1-nhiều giữa các đối tượng để
* khi một đối tượng thay đổi trạng thái, tất cả phụ thuộc của nó được thông báo
* và cập nhật một cách tự động.
*
* @author EMAIL:vuquangtin@gmail.com , tel:0377443333
* @version 1.0.0
* @see <a
* href="https://github.com/vuquangtin/designpattern">https://github.com/vuquangtin/designpattern</a>
*
*/
public class HexaObserver extends Observer {
public HexaObserver(Subject subject) {
this.subject = subject;
this.subject.attach(this);
}
@Override
public void update() {
System.out.println("Hex String: "
+ Integer.toHexString(subject.getState()).toUpperCase());
}
}
| [
"tinvuquang@admicro.vn"
] | tinvuquang@admicro.vn |
9a3bef323d9f02c42b4ff30ddedfd848b4b48115 | bce5b2859bdaee188985725200dd2b0b702a0f96 | /modules/axiom-c14n/src/main/java/org/apache/axiom/c14n/omwrapper/interfaces/Comment.java | bcaa52bac99105e848cd70dea37bbe804c4aaf77 | [
"Apache-2.0"
] | permissive | wso2/wso2-axiom | 6c2fd0ecf23ba8321230d82d90bd26b1373caee0 | c815e34d9866465bff53b785067cd0e8aa873635 | refs/heads/master | 2023-09-05T02:27:44.573813 | 2022-11-08T03:00:05 | 2022-11-08T03:00:05 | 16,400,930 | 34 | 83 | null | 2022-11-08T02:39:07 | 2014-01-31T05:58:21 | Java | UTF-8 | Java | false | false | 982 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axiom.c14n.omwrapper.interfaces;
/**
* @author Saliya Ekanayake (esaliya@gmail.com)
*/
public interface Comment extends Node{
public String getData();
}
| [
"eranda@wso2.com"
] | eranda@wso2.com |
c751b7c375de9d4feeb7a11fb7739b9325d68c79 | 8a2e832df5aa6d5981e1a0a88c1032092bd0ff6a | /core-shapes/src/main/java/by/bsuir/oop/labs/core/factories/PolygonFactory.java | 2c15bf51e5487e2c0a5da32d6e26f4fd56d32489 | [] | no_license | PaulTheStrong/OOPLab1 | a83ff0c02ed3da2d26f7e310790dc7813464b0a7 | f02a1f2fbe460aa7bab63b616d2b79d2244a0118 | refs/heads/master | 2023-03-25T08:02:10.935548 | 2021-03-21T18:42:15 | 2021-03-21T18:42:15 | 337,651,699 | 0 | 1 | null | 2021-02-14T22:34:27 | 2021-02-10T07:44:13 | Java | UTF-8 | Java | false | false | 402 | java | package by.bsuir.oop.labs.core.factories;
import by.bsuir.oop.labs.core.shapes.Polygon;
import javafx.geometry.Point2D;
import javafx.scene.canvas.GraphicsContext;
public class PolygonFactory extends AbstractShapeFactory {
@Override
public Polygon createShape(GraphicsContext graphicsContext, Point2D startPoint) {
return new Polygon(graphicsContext, startPoint, startPoint);
}
}
| [
"47480005+PaulTheStrong@users.noreply.github.com"
] | 47480005+PaulTheStrong@users.noreply.github.com |
259daa04a67ef998c74925d8e896d67bd0ad2808 | 292af740de09ffecb1dae69aab0b7a207b94a2c7 | /DeviceHive-ClientAndroid/src/com/android/devicehive/client/commands/GetDevicesCommand.java | 734ec4e0c22f8f5117021bf492c578ec23412d31 | [] | no_license | enco164/edit2014-kg | 3ffc0e2055f96910c180b9a16355378230753984 | a2f0d9a9ae3f633296f59f9966f3e53541b47b68 | refs/heads/master | 2021-01-02T08:39:30.368668 | 2014-07-18T10:22:18 | 2014-07-18T10:22:18 | 32,491,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,146 | java | package com.android.devicehive.client.commands;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import com.android.devicehive.DeviceData;
import com.android.devicehive.network.DeviceHiveResultReceiver;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
/**
* Get all existing devices. As a result returns a list of {@link DeviceData}.
* Can be executed only by users with administrative privileges.
*
*/
public class GetDevicesCommand extends DeviceClientCommand {
private final static String NAMESPACE = GetDevicesCommand.class.getName();
private static final String DEVICES_KEY = NAMESPACE.concat(".DEVICES_KEY");
/**
* Create a new command.
*/
public GetDevicesCommand() {
super();
}
@Override
protected RequestType getRequestType() {
return RequestType.GET;
}
@Override
protected String getRequestPath() {
return "device";
}
public static Parcelable.Creator<GetDevicesCommand> CREATOR = new Parcelable.Creator<GetDevicesCommand>() {
@Override
public GetDevicesCommand[] newArray(int size) {
return new GetDevicesCommand[size];
}
@Override
public GetDevicesCommand createFromParcel(Parcel source) {
return new GetDevicesCommand();
}
};
@Override
protected int fromJson(final String response, final Gson gson,
final Bundle resultData) {
Type listType = new TypeToken<ArrayList<DeviceData>>() {
}.getType();
final ArrayList<DeviceData> devices = gson.fromJson(response,
listType);
resultData.putParcelableArrayList(DEVICES_KEY, devices);
return DeviceHiveResultReceiver.MSG_HANDLED_RESPONSE;
}
/**
* Get a list of all existing devices from response {@link Bundle}
* container.
*
* @param resultData
* {@link Bundle} object containing required response data.
* @return A list of {@link DeviceData}.
*/
public final static List<DeviceData> getDevices(Bundle resultData) {
return resultData.getParcelableArrayList(DEVICES_KEY);
}
@Override
protected String toJson(Gson gson) {
return null;
}
}
| [
"enco164@gmail.com@7ce7bccc-32d5-6017-f964-bbce70f79a65"
] | enco164@gmail.com@7ce7bccc-32d5-6017-f964-bbce70f79a65 |
4c6ee5bc24c4bfdf066643d8371c2965b6e67859 | d98de110431e5124ec7cc70d15906dac05cfa61a | /public/source/core/src/test/java/org/marketcetera/core/position/impl/GroupingListTest.java | 1345583dd7163efceb039720a52f1be5ae2af04a | [] | no_license | dhliu3/marketcetera | 367f6df815b09f366eb308481f4f53f928de4c49 | 4a81e931a044ba19d8f35bdadd4ab081edd02f5f | refs/heads/master | 2020-04-06T04:39:55.389513 | 2012-01-30T06:49:25 | 2012-01-30T06:49:25 | 29,947,427 | 0 | 1 | null | 2015-01-28T02:54:39 | 2015-01-28T02:54:39 | null | UTF-8 | Java | false | false | 19,153 | java | package org.marketcetera.core.position.impl;
import java.util.LinkedList;
import java.util.List;
import org.junit.Test;
import org.marketcetera.core.position.impl.GroupingList.GroupMatcher;
import org.marketcetera.core.position.impl.GroupingList.GroupMatcherFactory;
import ca.odell.glazedlists.EventList;
import ca.odell.glazedlists.GlazedLists;
import ca.odell.glazedlists.TransactionList;
import ca.odell.glazedlists.event.ListEvent;
/* $License$ */
/**
* Test {@link GroupingList}.
*
* @author <a href="mailto:will@marketcetera.com">Will Horn</a>
* @version $Id: GroupingListTest.java 10492 2009-04-14 00:11:35Z klim $
* @since 1.5.0
*/
public class GroupingListTest {
GroupMatcherFactory<String, GroupMatcher<String>> factory = new GroupMatcherFactory<String, GroupMatcher<String>>() {
@Override
public GroupMatcher<String> createGroupMatcher(final String element) {
class MyMatcher implements GroupMatcher<String> {
String key;
MyMatcher(String key) {
this.key = key;
}
@Override
public boolean matches(String item) {
return key.equals(item);
}
@Override
public int compareTo(GroupMatcher<String> o) {
MyMatcher my = (MyMatcher) o;
return key.compareTo(my.key);
}
}
;
return new MyMatcher(element);
}
};
abstract class TestTemplate implements Runnable {
@Override
public void run() {
EventList<String> base = GlazedLists.eventListOf();
TransactionList<String> trans = new TransactionList<String>(base);
initList(trans);
GroupingList<String> groupingList = new GroupingList<String>(trans, factory);
List<ExpectedListChanges<?>> listeners = new LinkedList<ExpectedListChanges<?>>();
for (int i = 0; i < groupingList.size(); i++) {
ExpectedListChanges<String> listChangeListener = new ExpectedListChanges<String>(
"Group " + Integer.toString(i), getGroupsExpected(i));
listeners.add(listChangeListener);
groupingList.get(i).addListEventListener(listChangeListener);
}
ExpectedListChanges<EventList<String>> listChangeListener = new ExpectedListChanges<EventList<String>>(
"Root List", getExpected());
listeners.add(listChangeListener);
groupingList.addListEventListener(listChangeListener);
modifyBaseList(base);
trans.beginEvent();
modifyInTransaction(trans);
trans.commitEvent();
for (ExpectedListChanges<?> i : listeners) {
i.exhausted();
}
}
protected void modifyBaseList(EventList<String> base) {
}
protected void modifyInTransaction(EventList<String> list) {
}
protected abstract void initList(EventList<String> list);
protected int[] getExpected() {
return new int[] {};
}
protected int[] getGroupsExpected(int i) {
return new int[] {};
}
}
@Test
public void AB_iAAB() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("B");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add(0, "A");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.UPDATE, 0 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 0) {
return new int[] { ListEvent.INSERT, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void AB_AiAB() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("B");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add(1, "A");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.UPDATE, 0 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 0) {
return new int[] { ListEvent.INSERT, 1 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void BA_ABA() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("B");
list.add("A");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add(0, "A");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.UPDATE, 0 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 0) {
return new int[] { ListEvent.INSERT, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void AB_ABiB() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("B");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add(2, "B");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.UPDATE, 1 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 1) {
return new int[] { ListEvent.INSERT, 1 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void ABC_AiBBC() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("B");
list.add("C");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add(1, "B");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.UPDATE, 1 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 1) {
return new int[] { ListEvent.INSERT, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void ABC_ABiBC() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("B");
list.add("C");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add(2, "B");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.UPDATE, 1 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 1) {
return new int[] { ListEvent.INSERT, 1 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void B_AB() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("B");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add(0, "A");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.INSERT, 0 };
}
}.run();
}
@Test
public void AC_ABC() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("C");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add(1, "B");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.INSERT, 1 };
}
}.run();
}
@Test
public void AC_EBAC() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("C");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add(0, "B");
list.add(0, "E");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.INSERT, 1, ListEvent.INSERT, 3 };
}
}.run();
}
@Test
public void AC_CEBABC() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("C");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add(0, "B");
list.add(0, "C");
list.add(3, "B");
list.add(1, "E");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.INSERT, 1, ListEvent.UPDATE, 2, ListEvent.INSERT, 3 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 1) {
return new int[] { ListEvent.INSERT, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void AC_CEBABC_no_transaction() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("C");
}
@Override
protected void modifyBaseList(EventList<String> list) {
list.add(0, "B");
list.add(0, "C");
list.add(3, "B");
list.add(1, "E");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.INSERT, 1, ListEvent.UPDATE, 2, ListEvent.UPDATE, 1,
ListEvent.INSERT, 3 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 1) {
return new int[] { ListEvent.INSERT, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void AC_AuC() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("C");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.set(1, "C");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.UPDATE, 1 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 1) {
return new int[] { ListEvent.UPDATE, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void AC_AuB() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("C");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.set(1, "B");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.INSERT, 1, ListEvent.DELETE, 2 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 1) {
return new int[] { ListEvent.DELETE, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void ABC_ABuB() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("B");
list.add("C");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.set(2, "B");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.UPDATE, 1, ListEvent.DELETE, 2 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 1) {
return new int[] { ListEvent.INSERT, 1 };
}
if (i == 2) {
return new int[] { ListEvent.DELETE, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void A_dAiA() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.remove(0);
list.add(0, "A");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.UPDATE, 0 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 0) {
return new int[] { ListEvent.DELETE, 0, ListEvent.INSERT, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void ABC_AdBiBiCC() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("B");
list.add("C");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.remove(1);
list.add(1, "C");
list.add(1, "B");
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.UPDATE, 1, ListEvent.UPDATE, 2 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 1) {
return new int[] { ListEvent.INSERT, 0, ListEvent.DELETE, 1 };
}
if (i == 2) {
return new int[] { ListEvent.INSERT, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void clear() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("B");
list.add("C");
}
@Override
protected void modifyInTransaction(EventList<String> list) {
list.add("D");
list.add("E");
list.clear();
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.DELETE, 0, ListEvent.DELETE, 0, ListEvent.DELETE, 0 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 0) {
return new int[] { ListEvent.DELETE, 0 };
}
if (i == 1) {
return new int[] { ListEvent.DELETE, 0 };
}
if (i == 2) {
return new int[] { ListEvent.DELETE, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
@Test
public void clear_no_transaction() {
new TestTemplate() {
@Override
protected void initList(EventList<String> list) {
list.add("A");
list.add("B");
list.add("C");
}
@Override
protected void modifyBaseList(EventList<String> list) {
list.add("D");
list.add("E");
list.clear();
}
@Override
protected int[] getExpected() {
return new int[] { ListEvent.INSERT, 3, ListEvent.INSERT, 4, ListEvent.DELETE, 0,
ListEvent.DELETE, 0, ListEvent.DELETE, 0, ListEvent.DELETE, 0,
ListEvent.DELETE, 0 };
}
@Override
protected int[] getGroupsExpected(int i) {
if (i == 0) {
return new int[] { ListEvent.DELETE, 0 };
}
if (i == 1) {
return new int[] { ListEvent.DELETE, 0 };
}
if (i == 2) {
return new int[] { ListEvent.DELETE, 0 };
}
return super.getGroupsExpected(i);
}
}.run();
}
}
| [
"stevenshack@stevenshack.com"
] | stevenshack@stevenshack.com |
0f0000158c16f6864a88565cceae697b79312931 | 5b8337c39cea735e3817ee6f6e6e4a0115c7487c | /sources/com/google/common/util/concurrent/RateLimiter.java | 9d2a7c115d4f688ae1144ec22e505f2e7d7257d5 | [] | no_license | karthik990/G_Farm_Application | 0a096d334b33800e7d8b4b4c850c45b8b005ccb1 | 53d1cc82199f23517af599f5329aa4289067f4aa | refs/heads/master | 2022-12-05T06:48:10.513509 | 2020-08-10T14:46:48 | 2020-08-10T14:46:48 | 286,496,946 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,000 | java | package com.google.common.util.concurrent;
import com.google.common.base.Preconditions;
import com.google.common.base.Stopwatch;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import org.checkerframework.checker.nullness.compatqual.MonotonicNonNullDecl;
public abstract class RateLimiter {
@MonotonicNonNullDecl
private volatile Object mutexDoNotUseDirectly;
private final SleepingStopwatch stopwatch;
static abstract class SleepingStopwatch {
/* access modifiers changed from: protected */
public abstract long readMicros();
/* access modifiers changed from: protected */
public abstract void sleepMicrosUninterruptibly(long j);
protected SleepingStopwatch() {
}
public static SleepingStopwatch createFromSystemTimer() {
return new SleepingStopwatch() {
final Stopwatch stopwatch = Stopwatch.createStarted();
/* access modifiers changed from: protected */
public long readMicros() {
return this.stopwatch.elapsed(TimeUnit.MICROSECONDS);
}
/* access modifiers changed from: protected */
public void sleepMicrosUninterruptibly(long j) {
if (j > 0) {
Uninterruptibles.sleepUninterruptibly(j, TimeUnit.MICROSECONDS);
}
}
};
}
}
/* access modifiers changed from: 0000 */
public abstract double doGetRate();
/* access modifiers changed from: 0000 */
public abstract void doSetRate(double d, long j);
/* access modifiers changed from: 0000 */
public abstract long queryEarliestAvailable(long j);
/* access modifiers changed from: 0000 */
public abstract long reserveEarliestAvailable(int i, long j);
public static RateLimiter create(double d) {
return create(d, SleepingStopwatch.createFromSystemTimer());
}
static RateLimiter create(double d, SleepingStopwatch sleepingStopwatch) {
SmoothBursty smoothBursty = new SmoothBursty(sleepingStopwatch, 1.0d);
smoothBursty.setRate(d);
return smoothBursty;
}
public static RateLimiter create(double d, long j, TimeUnit timeUnit) {
Preconditions.checkArgument(j >= 0, "warmupPeriod must not be negative: %s", j);
return create(d, j, timeUnit, 3.0d, SleepingStopwatch.createFromSystemTimer());
}
static RateLimiter create(double d, long j, TimeUnit timeUnit, double d2, SleepingStopwatch sleepingStopwatch) {
SmoothWarmingUp smoothWarmingUp = new SmoothWarmingUp(sleepingStopwatch, j, timeUnit, d2);
smoothWarmingUp.setRate(d);
return smoothWarmingUp;
}
private Object mutex() {
Object obj = this.mutexDoNotUseDirectly;
if (obj == null) {
synchronized (this) {
obj = this.mutexDoNotUseDirectly;
if (obj == null) {
obj = new Object();
this.mutexDoNotUseDirectly = obj;
}
}
}
return obj;
}
RateLimiter(SleepingStopwatch sleepingStopwatch) {
this.stopwatch = (SleepingStopwatch) Preconditions.checkNotNull(sleepingStopwatch);
}
public final void setRate(double d) {
Preconditions.checkArgument(d > FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE && !Double.isNaN(d), "rate must be positive");
synchronized (mutex()) {
doSetRate(d, this.stopwatch.readMicros());
}
}
public final double getRate() {
double doGetRate;
synchronized (mutex()) {
doGetRate = doGetRate();
}
return doGetRate;
}
public double acquire() {
return acquire(1);
}
public double acquire(int i) {
long reserve = reserve(i);
this.stopwatch.sleepMicrosUninterruptibly(reserve);
double d = (double) reserve;
Double.isNaN(d);
double d2 = d * 1.0d;
double micros = (double) TimeUnit.SECONDS.toMicros(1);
Double.isNaN(micros);
return d2 / micros;
}
/* access modifiers changed from: 0000 */
public final long reserve(int i) {
long reserveAndGetWaitLength;
checkPermits(i);
synchronized (mutex()) {
reserveAndGetWaitLength = reserveAndGetWaitLength(i, this.stopwatch.readMicros());
}
return reserveAndGetWaitLength;
}
public boolean tryAcquire(long j, TimeUnit timeUnit) {
return tryAcquire(1, j, timeUnit);
}
public boolean tryAcquire(int i) {
return tryAcquire(i, 0, TimeUnit.MICROSECONDS);
}
public boolean tryAcquire() {
return tryAcquire(1, 0, TimeUnit.MICROSECONDS);
}
public boolean tryAcquire(int i, long j, TimeUnit timeUnit) {
long max = Math.max(timeUnit.toMicros(j), 0);
checkPermits(i);
synchronized (mutex()) {
long readMicros = this.stopwatch.readMicros();
if (!canAcquire(readMicros, max)) {
return false;
}
long reserveAndGetWaitLength = reserveAndGetWaitLength(i, readMicros);
this.stopwatch.sleepMicrosUninterruptibly(reserveAndGetWaitLength);
return true;
}
}
private boolean canAcquire(long j, long j2) {
return queryEarliestAvailable(j) - j2 <= j;
}
/* access modifiers changed from: 0000 */
public final long reserveAndGetWaitLength(int i, long j) {
return Math.max(reserveEarliestAvailable(i, j) - j, 0);
}
public String toString() {
return String.format(Locale.ROOT, "RateLimiter[stableRate=%3.1fqps]", new Object[]{Double.valueOf(getRate())});
}
private static void checkPermits(int i) {
Preconditions.checkArgument(i > 0, "Requested permits (%s) must be positive", i);
}
}
| [
"knag88@gmail.com"
] | knag88@gmail.com |
c4277c11169aac0a0a3b020424b24a6e3ec06c9b | da9d06b44b600868bce8cc305816386bd7d8d758 | /src/main/java/com/strelnik/spring/service/SoftwareService.java | 2647ed83f1da0fe9cbd0c397e711f97429e5fd4c | [] | no_license | DmitriyStrelnik/Java_3_cours | 49b88077ea245eb9a81976bbcdb48dcc426798e0 | 601e133de31f1e155a6094817130856fccd0a4f3 | refs/heads/master | 2023-01-29T18:55:19.290663 | 2020-12-16T20:10:05 | 2020-12-16T20:10:05 | 302,240,969 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 868 | java | package com.strelnik.spring.service;
import com.strelnik.spring.bean.Software;
import com.strelnik.spring.exception.RepositoryException;
import com.strelnik.spring.exception.ServiceException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public interface SoftwareService {
@Transactional
void setSoftwareById(
Long id,
String name,
String description
) throws ServiceException, RepositoryException;
@Transactional
void deleteById(long id)throws ServiceException;
Software create(Software software)throws ServiceException;
boolean existsByName(String name)throws ServiceException;
Software getByName(String name)throws ServiceException;
List<Software> getAll()throws ServiceException;
}
| [
"dimonstrel@gmail.com"
] | dimonstrel@gmail.com |
556407a522dc3ff5fad7b3491d0876891445191b | 563e8db7dba0131fb362d8fb77a852cae8ff4485 | /Blagosfera/core/src/main/java/ru/radom/kabinet/services/web/sections/setters/CommunitiesInvitesSectionDetailsSetter.java | e4821430a5b8094f78211ce7cc3dcc6aaa8e49e3 | [] | no_license | askor2005/blagosfera | 13bd28dcaab70f6c7d6623f8408384bdf337fd21 | c6cf8f1f7094ac7ccae3220ad6518343515231d0 | refs/heads/master | 2021-01-17T18:05:08.934188 | 2016-10-14T16:53:38 | 2016-10-14T16:53:48 | 70,894,701 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 987 | java | package ru.radom.kabinet.services.web.sections.setters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import ru.askor.blagosfera.domain.section.SectionDomain;
import ru.radom.kabinet.dao.communities.CommunityMemberDao;
import java.util.HashMap;
import java.util.Map;
@Component
public class CommunitiesInvitesSectionDetailsSetter extends AbstractSectionDetailsSetter {
@Autowired
private CommunityMemberDao communityMemberDao;
@Override
public void set(SectionDomain section, Long userId) {
long count = communityMemberDao.getInvitesCount(userId);
section.getDetails().put("visible", count > 0);
section.getDetails().put("titleSuffix", "(" + count + ")");
Map<String, String> liAttrs = new HashMap<>();
liAttrs.put("data-invites-count", Long.toString(count));
section.getDetails().put("liAttrs", liAttrs);
}
@Override
public String getSupportedSectionName() {
return "communitiesInvites";
}
}
| [
"askor2005@yandex.ru"
] | askor2005@yandex.ru |
733c06597c37cd680725934b2332136cb54627e1 | 8236249b775c1d9c1bd3f9bee1054d0d7acf4120 | /app/src/main/java/com/example/lawre/week1weekendhomework/MainActivity.java | 36f95a306dd49f268d95d568ae469801376dff7a | [] | no_license | trostbd/Week1WeekendHomework | abae3957c34256e44b28dcd01dda4861c23bbcb6 | 99c99170445e3f1b2d0b6402fa3f3ebe9764e8cd | refs/heads/master | 2020-04-16T12:04:14.325757 | 2019-01-13T22:59:42 | 2019-01-13T22:59:42 | 165,563,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,925 | java | package com.example.lawre.week1weekendhomework;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity
{
String currDisplay,memory;
float num1, num2;
// boolean isFirstNum = true;
TextView displayView;
enum functions {ADD,SUBTRACT,MULTIPLY,DIVIDE,XTOY,NROOT,COUNT};
functions chosenFun;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
num1 = 0;
num2 = 0;
currDisplay = "";
displayView = findViewById(R.id.tvOutput);
displayView.setText("" + currDisplay);
chosenFun = functions.COUNT;
memory = "";
}
public void onClick(View view)
{
int buttonId = view.getId();
switch(buttonId)
{
case R.id.btCE:
displayView.setText("" );
break;
case R.id.btClear:
displayView.setText("");
num1 = 0;
num2 = 0;
break;
case R.id.btBackspace:
String newDisplay = displayView.getText().toString();
if(newDisplay.length()>1)
displayView.setText(newDisplay.substring(0,newDisplay.length()-1));
else
displayView.setText("");
break;
case R.id.btDivide:
if(displayView.getText()!="")
{
num1 = Float.parseFloat(displayView.getText() + "");
chosenFun = functions.DIVIDE;
displayView.setText("");
}
// isFirstNum = false;
break;
case R.id.btSeven:
handleNumClick("7");
break;
case R.id.btEight:
handleNumClick("8");
break;
case R.id.btNine:
handleNumClick("9");
break;
case R.id.btMultiply:
if(displayView.getText()!="")
{
num1 = Float.parseFloat(displayView.getText() + "");
chosenFun = functions.MULTIPLY;
displayView.setText("");
}
// isFirstNum = false;
break;
case R.id.btFour:
handleNumClick("4");
break;
case R.id.btFive:
handleNumClick("5");
break;
case R.id.btSix:
handleNumClick("6");
break;
case R.id.btSubtract:
if(displayView.getText()!="")
{
num1 = Float.parseFloat(displayView.getText() + "");
chosenFun = functions.SUBTRACT;
displayView.setText("");
}
// isFirstNum = false;
break;
case R.id.btOne:
handleNumClick("1");
break;
case R.id.btTwo:
handleNumClick("2");
break;
case R.id.btThree:
handleNumClick("3");
break;
case R.id.btAdd:
if(displayView.getText()!="")
{
num1 = Float.parseFloat(displayView.getText() + "");
chosenFun = functions.ADD;
displayView.setText("");
}
// isFirstNum = false;
break;
case R.id.btPositiveNegative:
if(displayView.getText()!="")
displayView.setText((Float.parseFloat(displayView.getText()+"")*-1)+"");
break;
case R.id.btZero:
handleNumClick("0");
break;
case R.id.btDecimal:
if(displayView.getText()!="")
displayView.setText(Float.parseFloat(displayView.getText()+"")+".");
else
displayView.setText("0.");
break;
case R.id.btEquals:
if(displayView.getText()!="")
handleEquals();
break;
case R.id.btE:
displayView.setText(""+Math.E);
break;
case R.id.btEtoX:
displayView.setText(""+Math.exp(Double.parseDouble(displayView.getText().toString())));
break;
case R.id.btFactorial:
displayView.setText(""+factorial(Integer.parseInt(displayView.getText().toString())));
break;
case R.id.btSin:
displayView.setText(""+Math.sin(Double.parseDouble(displayView.getText().toString())));
break;
case R.id.btCos:
displayView.setText(""+Math.cos(Double.parseDouble(displayView.getText().toString())));
break;
case R.id.btTan:
displayView.setText(""+Math.tan(Double.parseDouble(displayView.getText().toString())));
break;
case R.id.btLn:
displayView.setText(""+Math.log(Double.parseDouble(displayView.getText().toString())));
break;
case R.id.btLog:
displayView.setText(""+Math.log10(Double.parseDouble(displayView.getText().toString())));
break;
case R.id.btXtoY:
if(displayView.getText()!="")
{
num1 = Float.parseFloat(displayView.getText() + "");
chosenFun = functions.XTOY;
displayView.setText("");
}
break;
case R.id.btPi:
displayView.setText(""+Math.PI);
break;
case R.id.btNRoot:
if(displayView.getText()!="")
{
num1 = Float.parseFloat(displayView.getText() + "");
chosenFun = functions.NROOT;
displayView.setText("");
}
break;
case R.id.btSqrt:
displayView.setText(""+Math.sqrt(Double.parseDouble(displayView.getText().toString())));
break;
case R.id.btMemclr:
memory = "";
break;
case R.id.btMemadd:
memory = displayView.getText().toString();
break;
case R.id.btMemrecall:
displayView.setText(memory);
break;
}
}
void handleNumClick(String clickedNum)
{
displayView.setText(""+displayView.getText()+clickedNum);
}
void handleEquals()
{
if(chosenFun != functions.COUNT)
num2 = Float.parseFloat(displayView.getText()+"");
switch (chosenFun)
{
case ADD:
displayView.setText("" + (num1 + num2));
break;
case SUBTRACT:
displayView.setText("" + (num1 - num2));
break;
case MULTIPLY:
displayView.setText("" + (num1 * num2));
break;
case DIVIDE:
displayView.setText("" + (num1 / num2));
break;
case XTOY:
displayView.setText("" + Math.pow(num1, num2));
break;
case NROOT:
displayView.setText(""+Math.pow(num1,(1/num2)));
break;
default:
break;
}
chosenFun = functions.COUNT;
}
int factorial(int n)
{
if(n<= 0)
return 1;
else
return n*factorial(n-1);
}
}
| [
"trostbd@gmail.com"
] | trostbd@gmail.com |
8500592113d33e9d27e0f769a3f958ddf877bee0 | 5d56e80a19ca413bb17432cd189f055ebd7b2e6f | /test1.java | 310519de327e94b0ca8b991ae452cc973cc58eee | [] | no_license | vishalchoudhary1099/DemoLearn | 41a290147edc26b42476a01bea81121f8042317b | 8f60b118ab6dc513c5d2c0b77405f5f8b3baff0a | refs/heads/master | 2022-07-21T10:50:39.186094 | 2020-05-17T16:12:39 | 2020-05-17T16:12:39 | 264,686,383 | 0 | 0 | null | 2020-05-17T16:12:40 | 2020-05-17T14:32:49 | null | UTF-8 | Java | false | false | 27 | java | This is my test java code | [
"vishal@gmail.com"
] | vishal@gmail.com |
a139646347e6197d47bb3b1e9f852bc17ddb794b | 6a86ec51d26a5bfefb98c6c8f3a114c9c9de1c8f | /src/com/hdl/java/HelloWord.java | 88e2e87ccb6dfb3180f75e670af6a5ae60ce3ba8 | [] | no_license | 15271856796/GIT_IEDA_test | c9b3e8ccceba013f529b1345133dfd063940fa47 | 65eab7ed15293d0c3152c04d93dd54214925bf59 | refs/heads/master | 2020-07-13T17:02:39.657242 | 2019-08-29T09:05:16 | 2019-08-29T09:05:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | package com.hdl.java;
public class HelloWord {
public static void main(String[] args){
System.out.println("helloword");
System.out.println("1111");
System.out.println("2222");
}
}
| [
"15271856796@163.com"
] | 15271856796@163.com |
5e416a650b02253944c72e19e822beb6e1adf77a | b96481a5b2550b5145b146e7bad0678b6dab54d8 | /src/main/java/com/massoftware/backend/util/GenericBO.java | 5b7e7594a7346ea069791643bcbb38538a086a9c | [] | no_license | sebaalvarez/massoftware | 49f308029bc0a5ff3e1e040b18d673abfaa8a2e7 | a57de5c9c0c2cc73933b4e5b4d49c72eb47bce62 | refs/heads/master | 2020-03-31T19:28:23.840521 | 2018-10-10T20:23:06 | 2018-10-10T20:23:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,808 | java | package com.massoftware.backend.util;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.cendra.jdbc.ConnectionWrapper;
import org.cendra.jdbc.DataSourceWrapper;
import org.cendra.jdbc.ex.crud.UniqueException;
import com.massoftware.backend.BackendContext;
import com.massoftware.frontend.custom.windows.builder.annotation.ClassTableMSAnont;
import com.massoftware.frontend.custom.windows.builder.annotation.FieldLabelAnont;
import com.massoftware.frontend.custom.windows.builder.annotation.FieldNameMSAnont;
import com.massoftware.frontend.custom.windows.builder.annotation.FieldNowTimestampForInsertUpdate;
import com.massoftware.frontend.custom.windows.builder.annotation.FieldSubNameFKAnont;
import com.massoftware.frontend.custom.windows.builder.annotation.FieldTimestamp;
import com.massoftware.frontend.custom.windows.builder.annotation.FieldUserForInsertUpdate;
import com.massoftware.frontend.util.Traslate;
import com.massoftware.model.Usuario;
import com.massoftware.model.Valuable;
public abstract class GenericBO<T> {
protected Class<T> classModel;
protected DataSourceWrapper dataSourceWrapper;
protected BackendContext cx;
// private String dtoName;
// protected String viewName;
public GenericBO(Class<T> classModel, DataSourceWrapper dataSourceWrapper,
BackendContext cx) {
super();
this.classModel = classModel;
this.dataSourceWrapper = dataSourceWrapper;
this.cx = cx;
// dtoName = getDtoName(this.getClass());
// viewName = "v" + dtoName;
}
public Integer count() throws Exception {
String where = null;
return count(where, new Object[0]);
}
public Integer count(String where, Object... args) throws Exception {
String viewName = getView();
String sql = "SELECT COUNT(*) FROM " + viewName;
if (where != null && where.trim().length() > 0) {
sql += " WHERE " + where;
}
ConnectionWrapper connectionWrapper = dataSourceWrapper
.getConnectionWrapper();
try {
Object[][] table = null;
if (args.length == 0) {
table = connectionWrapper.findToTable(sql);
} else {
table = connectionWrapper.findToTable(sql, args);
}
return (Integer) table[0][0];
} catch (Exception e) {
throw e;
} finally {
connectionWrapper.close(connectionWrapper);
}
}
public List<T> findAll() throws Exception {
return find(null, null, new Object[0]);
// return null;
}
public List<T> findAll(String orderBy) throws Exception {
return find(orderBy, null, new Object[0]);
}
protected List<T> find(String where, Object... args) throws Exception {
return find(null, where, args);
}
protected List<T> find(String orderBy, String where, Object... args)
throws Exception {
String viewName = getView();
return find(viewName, orderBy, where, args);
}
@SuppressWarnings("unchecked")
protected List<T> find(String viewName, String orderBy, String where,
Object... args) throws Exception {
return findTLess(viewName, orderBy, where, args);
}
@SuppressWarnings({ "rawtypes" })
protected List findTLess(String viewName, String orderBy, String where,
Object... args) throws Exception {
return findTLessPaged(viewName, orderBy, where, -1, -1, args);
}
// -------------------------
public List<T> findAllPaged(int limit, int offset) throws Exception {
return findPaged(null, null, limit, offset, new Object[0]);
// return null;
}
public List<T> findAllPaged(String orderBy, int limit, int offset)
throws Exception {
return findPaged(orderBy, null, limit, offset, new Object[0]);
}
public List<T> findPaged(String where, int limit, int offset,
Object... args) throws Exception {
return findPaged(null, where, limit, offset, args);
}
public List<T> findPaged(String orderBy, String where, int limit,
int offset, Object... args) throws Exception {
String viewName = getView();
return findPaged(viewName, orderBy, where, limit, offset, args);
}
@SuppressWarnings("unchecked")
protected List<T> findPaged(String viewName, String orderBy, String where,
int limit, int offset, Object... args) throws Exception {
return findTLessPaged(viewName, orderBy, where, limit, offset, args);
}
@SuppressWarnings({ "rawtypes" })
protected List findTLessPaged(String viewName, String orderBy,
String where, int limit, int offset, Object... args)
throws Exception {
if (args == null) {
args = new Object[0];
}
String sql = "SELECT * FROM " + viewName;
if (where != null && where.trim().length() > 0) {
sql += " WHERE " + where;
}
// if (orderBy == null || orderBy.trim().length() == 0) {
// throw new Exception("orderBy not found.");
// }
if (orderBy != null && orderBy.trim().length() > 0) {
sql += " ORDER BY " + orderBy;
} else {
sql += " ORDER BY " + 1;
}
if (offset > -1 && limit > -1) {
sql += " OFFSET " + offset + " ROWS FETCH NEXT " + limit
+ " ROWS ONLY ";
}
sql += ";";
ConnectionWrapper connectionWrapper = dataSourceWrapper
.getConnectionWrapper();
try {
List list = null;
if (args.length == 0) {
list = connectionWrapper.findToListByCendraConvention(sql);
} else {
list = connectionWrapper
.findToListByCendraConvention(sql, args);
}
for (Object item : list) {
if (item instanceof Valuable) {
((Valuable) item).validate();
}
}
return list;
} catch (Exception e) {
e.printStackTrace();
throw e;
} finally {
connectionWrapper.close(connectionWrapper);
}
}
protected Boolean ifExists(String where, Object... args) throws Exception {
// List<T> items = find(where, -1, -1, args); 666
List<T> items = find(where, args);
return items.size() == 1;
}
protected void checkUnique(String attName, String where, Object... args)
throws Exception {
if (ifExists(where, args)) {
throw new UniqueException(
getLabel(classModel.getDeclaredField(attName)));
}
}
public void checkUnique(String attName, Object value) throws Exception {
}
public Integer maxValue(String attName) throws Exception {
return maxValueInteger(attName, null);
}
public Integer maxValue(String attName, T dto) throws Exception {
return maxValueInteger(attName, dto);
}
protected Integer maxValueInteger(String attName, T dto) throws Exception {
String viewName = getView();
String sql = "SELECT MAX(" + attName + ") + 1 FROM " + viewName;
ConnectionWrapper connectionWrapper = dataSourceWrapper
.getConnectionWrapper();
try {
Object[][] table = connectionWrapper.findToTable(sql);
return (Integer) table[0][0];
} catch (Exception e) {
throw e;
} finally {
connectionWrapper.close(connectionWrapper);
}
}
public void checkUnique(T dto, T dtoOriginal) throws Exception {
}
public T insert(T arg, Usuario usuario) throws Exception {
return arg;
}
protected T insertByReflection(T arg, Usuario usuario) throws Exception {
if (dataSourceWrapper.isDatabasePostgreSql()) {
} else if (dataSourceWrapper.isDatabaseMicrosoftSQLServer()) {
Field[] fields = classModel.getDeclaredFields();
String[] nameAtts = new String[fields.length];
Object[] args = new Object[fields.length];
for (int i = 0; i < fields.length; i++) {
String nameAttDB = getFieldNameMS(fields[i]);
nameAtts[i] = nameAttDB;
String methodName = "get"
+ fields[i].getName().substring(0, 1).toUpperCase()
+ fields[i].getName().substring(1,
fields[i].getName().length());
Method method = classModel.getMethod(methodName);
if (fields[i].getType() == java.util.Date.class
&& GenericBO.isFieldTimestamp(fields[i])) {
args[i] = method.invoke(arg);
args[i] = new Timestamp(
((java.util.Date) args[i]).getTime());
} else if (fields[i].getType() == Timestamp.class
&& isFieldNowTimestampForInsertUpdate(fields[i])) {
args[i] = new Timestamp(System.currentTimeMillis());
} else if (fields[i].getType() == Usuario.class
&& isFieldUserForInsertUpdate(fields[i])) {
args[i] = usuario;
} else {
args[i] = method.invoke(arg);
}
if (args[i] == null) {
args[i] = getFieldTypeMS(fields[i]);
} else if (args[i] != null
&& isPrimitive(fields[i].getType()) == false) {
String newFieldName = getSubNameFK(fields[i]);
methodName = "get"
+ newFieldName.substring(0, 1).toUpperCase()
+ newFieldName.substring(1, newFieldName.length());
method = fields[i].getType().getMethod(methodName);
args[i] = method.invoke(args[i]);
if (args[i] == null) {
args[i] = getFieldTypeMS(fields[i]);
}
}
}
String nameTableDB = getClassTableMSAnont(classModel);
insert(nameTableDB, nameAtts, args);
}
return arg;
}
protected boolean insert(String nameTableDB, String[] nameAtts,
Object[] args) throws Exception {
if (args == null) {
args = new Object[0];
}
String tableName = getTableName(nameTableDB);
String sql = "INSERT INTO " + tableName + " (";
for (int i = 0; i < nameAtts.length; i++) {
sql += nameAtts[i];
if (i < nameAtts.length - 1) {
sql += ", ";
}
}
sql += ") VALUES (";
for (int i = 0; i < args.length; i++) {
sql += "?";
if (i < args.length - 1) {
sql += ", ";
}
}
sql += ")";
ConnectionWrapper connectionWrapper = dataSourceWrapper
.getConnectionWrapper();
try {
connectionWrapper.begin();
int rows = connectionWrapper.insert(sql, args);
if (rows != 1) {
throw new Exception(
"La sentencia debería afectar un registro, la sentencia afecto "
+ rows + " registros.");
}
connectionWrapper.commit();
return true;
} catch (Exception e) {
connectionWrapper.rollBack();
throw e;
} finally {
connectionWrapper.close(connectionWrapper);
}
}
@SuppressWarnings("rawtypes")
private boolean isPrimitive(Class c) {
if (c.equals(String.class)) {
return true;
} else if (c.equals(Boolean.class)) {
return true;
} else if (c.equals(Short.class)) {
return true;
} else if (c.equals(Integer.class)) {
return true;
} else if (c.equals(Long.class)) {
return true;
} else if (c.equals(Float.class)) {
return true;
} else if (c.equals(Double.class)) {
return true;
} else if (c.equals(BigDecimal.class)) {
return true;
} else if (c.equals(Date.class)) {
return true;
} else if (c.equals(java.util.Date.class)) {
return true;
} else if (c.equals(Timestamp.class)) {
return true;
} else if (c.equals(Time.class)) {
return true;
} else {
return false;
}
}
public T update(T arg, T argOriginal, Usuario usuario) throws Exception {
return arg;
}
protected T updateByReflection(T arg, Usuario usuario, String where,
Object... argsWhere) throws Exception {
if (dataSourceWrapper.isDatabasePostgreSql()) {
} else if (dataSourceWrapper.isDatabaseMicrosoftSQLServer()) {
Field[] fields = classModel.getDeclaredFields();
List<String> nameAtts = new ArrayList<String>();
List<Object> args = new ArrayList<Object>();
// Object[] args = new Object[fields.length];
for (int i = 0; i < fields.length; i++) { // -----------------
if (fields[i].getName().trim().startsWith("_") == false) {
String nameAttDB = getFieldNameMS(fields[i]);
nameAtts.add(nameAttDB);
String methodName = "get"
+ fields[i].getName().substring(0, 1).toUpperCase()
+ fields[i].getName().substring(1,
fields[i].getName().length());
Method method = classModel.getMethod(methodName);
Object val = null;
if (fields[i].getType() == java.util.Date.class
&& GenericBO.isFieldTimestamp(fields[i])) {
val = method.invoke(arg);
val = new Timestamp(((java.util.Date) val).getTime());
} else if (fields[i].getType() == Timestamp.class
&& isFieldNowTimestampForInsertUpdate(fields[i])) {
val = new Timestamp(System.currentTimeMillis());
} else if (fields[i].getType() == Usuario.class
&& isFieldUserForInsertUpdate(fields[i])) {
val = usuario;
} else {
val = method.invoke(arg);
}
if (val == null) {
val = getFieldTypeMS(fields[i]);
} else if (val != null
&& isPrimitive(fields[i].getType()) == false) {
String newFieldName = getSubNameFK(fields[i]);
methodName = "get"
+ newFieldName.substring(0, 1).toUpperCase()
+ newFieldName.substring(1,
newFieldName.length());
method = fields[i].getType().getMethod(methodName);
val = method.invoke(val);
if (val == null) {
val = getFieldTypeMS(fields[i]);
}
}
args.add(val);
}
} // -----------------------
String[] nameAtts2 = new String[nameAtts.size()];
nameAtts2 = nameAtts.toArray(nameAtts2);
Object[] args2 = new Object[args.size()];
args2 = args.toArray();
args2 = ArrayUtils.addAll(args2, argsWhere);
String nameTableDB = getClassTableMSAnont(classModel);
update(nameTableDB, nameAtts2, args2, where);
}
return arg;
}
public boolean delete(T arg) throws Exception {
return false;
}
protected boolean delete(String where, Object... args) throws Exception {
if (args == null) {
args = new Object[0];
}
String nameTableDB = null;
if (dataSourceWrapper.isDatabasePostgreSql()) {
} else if (dataSourceWrapper.isDatabaseMicrosoftSQLServer()) {
nameTableDB = getClassTableMSAnont(classModel);
}
String sql = "DELETE FROM " + nameTableDB;
if (where != null && where.trim().length() > 0) {
sql += " WHERE " + where;
}
sql += ";";
ConnectionWrapper connectionWrapper = dataSourceWrapper
.getConnectionWrapper();
try {
connectionWrapper.begin();
int rows = -1;
rows = connectionWrapper.delete(sql, args);
if (rows != 1) {
throw new Exception(
"La sentencia debería afectar un solo registro, la sentencia afecto "
+ rows + " registros.");
}
connectionWrapper.commit();
return true;
} catch (Exception e) {
connectionWrapper.rollBack();
throw e;
} finally {
connectionWrapper.close(connectionWrapper);
}
}
protected boolean update(String nameTableDB, String[] nameAtts,
Object[] args, String where) throws Exception {
if (args == null) {
args = new Object[0];
}
// String tableName = getTableName(nameTableDB);
//
// String sql = "UPDATE " + tableName + " SET ";
//
// for (int i = 0; i < nameAtts.length; i++) {
// sql += nameAtts[i] + " = ?";
// if (i < nameAtts.length - 1) {
// sql += ", ";
// }
// }
//
// sql += " WHERE " + where + ";";
String sql = buildUpdate(nameTableDB, nameAtts, where);
ConnectionWrapper connectionWrapper = dataSourceWrapper
.getConnectionWrapper();
try {
connectionWrapper.begin();
int rows = connectionWrapper.update(sql, args);
if (rows != 1) {
throw new Exception(
"La sentencia debería afectar un registro, la sentencia afecto "
+ rows + " registros.");
}
connectionWrapper.commit();
return true;
} catch (Exception e) {
connectionWrapper.rollBack();
throw e;
} finally {
connectionWrapper.close(connectionWrapper);
}
}
protected String buildUpdate(String nameTableDB, String[] nameAtts,
String where) throws Exception {
String tableName = getTableName(nameTableDB);
String sql = "UPDATE " + tableName + " SET ";
for (int i = 0; i < nameAtts.length; i++) {
sql += nameAtts[i] + " = ?";
if (i < nameAtts.length - 1) {
sql += ", ";
}
}
sql += " WHERE " + where + ";";
return sql;
}
protected boolean update(String[] sql, Object[][] args) throws Exception {
ConnectionWrapper connectionWrapper = dataSourceWrapper
.getConnectionWrapper();
try {
connectionWrapper.begin();
for (int i = 0; i < sql.length; i++) {
int rows = connectionWrapper.update(sql[i], args[i]);
if (rows == 0) {
throw new Exception(
"La sentencia debería afectar uno o más de un registro, la sentencia afecto "
+ rows + " registros.");
}
}
connectionWrapper.commit();
return true;
} catch (Exception e) {
connectionWrapper.rollBack();
throw e;
} finally {
connectionWrapper.close(connectionWrapper);
}
}
protected String getView() {
return getView(this.getClass());
}
@SuppressWarnings("rawtypes")
protected String getDtoName(Class clazz) {
int c = 0;
if (clazz.getSimpleName().endsWith("BO")) {
c = 2;
}
return clazz.getSimpleName().substring(0,
clazz.getSimpleName().length() - c);
}
@SuppressWarnings("rawtypes")
protected String getView(Class clazz) {
String viewName = "v" + getDtoName(clazz);
if (dataSourceWrapper.isDatabasePostgreSql()) {
return "massoftware." + viewName;
} else if (dataSourceWrapper.isDatabaseMicrosoftSQLServer()) {
return "dbo." + viewName;
}
return null;
}
private String getTableName(String tableName) {
if (dataSourceWrapper.isDatabasePostgreSql()) {
return "massoftware." + tableName;
} else if (dataSourceWrapper.isDatabaseMicrosoftSQLServer()) {
return "dbo." + tableName;
}
return null;
}
protected String getFieldNameMS(Field field) {
FieldNameMSAnont[] a = field
.getAnnotationsByType(FieldNameMSAnont.class);
if (a != null && a.length > 0) {
return a[0].nameAttDB();
}
return null;
}
@SuppressWarnings("rawtypes")
private Class getFieldTypeMS(Field field) {
FieldNameMSAnont[] a = field
.getAnnotationsByType(FieldNameMSAnont.class);
if (a != null && a.length > 0) {
return a[0].classAttDB();
}
return null;
}
protected String getClassTableMSAnont(Class<T> classModel) {
ClassTableMSAnont[] a = classModel
.getAnnotationsByType(ClassTableMSAnont.class);
if (a != null && a.length > 0) {
return a[0].nameTableDB();
}
return null;
}
protected static String getLabel(Field field) {
FieldLabelAnont[] a = field.getAnnotationsByType(FieldLabelAnont.class);
if (a != null && a.length > 0) {
return a[0].value();
}
return null;
}
private static String getSubNameFK(Field field) {
FieldSubNameFKAnont[] a = field
.getAnnotationsByType(FieldSubNameFKAnont.class);
if (a != null && a.length > 0) {
return a[0].value();
}
return null;
}
private static boolean isFieldNowTimestampForInsertUpdate(Field field) {
FieldNowTimestampForInsertUpdate[] a = field
.getAnnotationsByType(FieldNowTimestampForInsertUpdate.class);
return (a != null && a.length > 0);
}
private static boolean isFieldUserForInsertUpdate(Field field) {
FieldUserForInsertUpdate[] a = field
.getAnnotationsByType(FieldUserForInsertUpdate.class);
return (a != null && a.length > 0);
}
private static boolean isFieldTimestamp(Field field) {
FieldTimestamp[] a = field.getAnnotationsByType(FieldTimestamp.class);
return (a != null && a.length > 0);
}
@SuppressWarnings("rawtypes")
protected boolean fullEquals(Class type, boolean ignoreCaseTraslate,
boolean ignoreCase, Object value, Object originalValue) {
if (type == String.class) {
value = value.toString().trim();
if (ignoreCaseTraslate
&& Traslate.translate(value.toString(), true)
.equalsIgnoreCase(
Traslate.translate(originalValue.toString()
.trim(), true))) {
return true;
}
if (ignoreCase
&& value.toString().equalsIgnoreCase(
originalValue.toString().trim())) {
return true;
}
if (value.equals(originalValue.toString().trim())) {
return true;
}
}
return value.equals(originalValue);
}
}
| [
"diegopablomansilla@gmail.com"
] | diegopablomansilla@gmail.com |
73f9683f79466d493fcfd1fcedc79f64eeb7050a | e9867f5d6da8297b73f461f0fe8983f571e93fa0 | /app/src/main/java/com/example/administrator/playandroid/ui/fragment/ProjectFragment.java | 3d1dcb0e3e531ae37d960462596d76e958d1ad32 | [] | no_license | vitorliu/PlayAndroid | 2fef40a2a67ba3df4e86e75d3082347645cab121 | 2829f0cbf17b00c07d99ede834138b3c7841630f | refs/heads/master | 2020-06-07T11:33:48.165301 | 2019-07-19T09:50:08 | 2019-07-19T09:50:08 | 193,013,280 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,080 | java | package com.example.administrator.playandroid.ui.fragment;
import android.arch.lifecycle.Observer;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.example.administrator.playandroid.R;
import com.example.administrator.playandroid.adapter.ProjectContentAdapter;
import com.example.administrator.playandroid.adapter.ProjectMenuAdapter;
import com.example.administrator.playandroid.api.helper.NetStatusHelper;
import com.example.administrator.playandroid.architeture.viewmodel.ProjectViewModel;
import com.example.administrator.playandroid.base.XFragment;
import com.example.administrator.playandroid.base.bean.Resource;
import com.example.administrator.playandroid.bean.ProjectClassifyResponce;
import com.example.administrator.playandroid.bean.ProjectListResponce;
import com.example.administrator.playandroid.bean.ResponseInfo;
import com.example.administrator.playandroid.ui.activity.H5Activity;
import com.example.administrator.playandroid.ui.activity.MainActivity;
import com.example.administrator.playandroid.ui.view.DropDownMenu;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* Created by Administrator on 2019/6/28.
* <p>Copyright 2019 Success101.</p>
*/
public class ProjectFragment extends XFragment {
@BindView(R.id.project_drop_dwon_menu)
DropDownMenu projectDropDwonMenu;
@Inject
ProjectViewModel mViewModel;
List<View> popuviews;
List<String> headerList;
int curPage = 1;
@BindView(R.id.toolbar)
Toolbar toolbar;
private int cid;
@Inject
public ProjectFragment() {
}
@Override
public int getLayoutId() {
return R.layout.fragment_project;
}
@Override
public void init(Bundle savedInstanceState) {
((MainActivity) getActivity()).setTitle(toolbar,"项目");
headerList = new ArrayList<>(1);
headerList.add("选择项目类型");
View menu = getMenuView();
popuviews = new ArrayList<>(1);
popuviews.add(menu);
View contentView = getContentView();
projectDropDwonMenu.setDropDownMenu(headerList, popuviews, contentView);
getClassifyResult();
getProjectListResult();
}
private void getProjectListResult() {
mViewModel.getLiveDataProjectList().observe(this, new Observer<Resource<ResponseInfo<ProjectListResponce>>>() {
@Override
public void onChanged(@Nullable Resource<ResponseInfo<ProjectListResponce>> pResponseInfoResource) {
mRefreshLayout.finishRefresh();
mRefreshLayout.finishLoadMore();
NetStatusHelper.handStatus(pResponseInfoResource, new NetStatusHelper.StatusCallBack<ResponseInfo<ProjectListResponce>>() {
@Override
public void onSuccess(ResponseInfo<ProjectListResponce> resource) {
ProjectListResponce vData = resource.data;
if (vData != null) {
if (curPage == 1) {
mDatasBeanList.clear();
}
mDatasBeanList.addAll(vData.datas);
if (vData.over) {
mRefreshLayout.setEnableLoadMore(false);
}
}
mContentAdapter.notifyDataSetChanged();
}
@Override
public void onLoading() {
mContentAdapter.setEmptyView(loadingView);
}
@Override
public void onError(String errorMessage) {
mContentAdapter.setEmptyView(errorView);
}
});
}
});
}
private void getClassifyResult() {
mViewModel.getLiveDataProjectClassify().observe(this, new Observer<Resource<ResponseInfo<List<ProjectClassifyResponce>>>>() {
@Override
public void onChanged(@Nullable Resource<ResponseInfo<List<ProjectClassifyResponce>>> pResponseInfoResource) {
NetStatusHelper.handStatus(pResponseInfoResource, new NetStatusHelper.StatusCallBack<ResponseInfo<List<ProjectClassifyResponce>>>() {
@Override
public void onSuccess(ResponseInfo<List<ProjectClassifyResponce>> resource) {
List<ProjectClassifyResponce> vData = resource.data;
if (vData != null) {
mClassifyResponceList.addAll(vData);
mMenuAdapter.notifyDataSetChanged();
ProjectClassifyResponce vProjectClassifyResponce = mClassifyResponceList.get(0);
curPage = 1;
cid = vProjectClassifyResponce.id;
mViewModel.fetchProjectListData(curPage, cid);
}
}
@Override
public void onLoading() {
}
@Override
public void onError(String errorMessage) {
}
});
}
});
}
@Override
protected boolean isShowStateView() {
return true;
}
RecyclerView rvContent;
SmartRefreshLayout mRefreshLayout;
List<ProjectListResponce.DatasBean> mDatasBeanList;
ProjectContentAdapter mContentAdapter;
private View getContentView() {
View contentView = LayoutInflater.from(getContext()).inflate(R.layout.item_project_rv_content_list, null);
rvContent = contentView.findViewById(R.id.rv_project_content);
mRefreshLayout = contentView.findViewById(R.id.refresh);
mDatasBeanList = new ArrayList<>();
mContentAdapter = new ProjectContentAdapter(R.layout.item_rv_project_content, mDatasBeanList);
rvContent.setLayoutManager(new LinearLayoutManager(getContext()));
rvContent.setAdapter(mContentAdapter);
mContentAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
H5Activity.launch(getContext(), mDatasBeanList.get(position).link);
}
});
mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
curPage = 1;
mViewModel.fetchProjectListData(curPage, cid);
}
});
mRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
mViewModel.fetchProjectListData(++curPage, cid);
}
});
return contentView;
}
RecyclerView rvMenu;
ProjectMenuAdapter mMenuAdapter;
List<ProjectClassifyResponce> mClassifyResponceList;
private View getMenuView() {
View menuView = LayoutInflater.from(getContext()).inflate(R.layout.item_project_menu, null);
rvMenu = menuView.findViewById(R.id.rv_project_menu);
mClassifyResponceList = new ArrayList<>();
mMenuAdapter = new ProjectMenuAdapter(R.layout.item_rv_menu_list, mClassifyResponceList);
rvMenu.setLayoutManager(new LinearLayoutManager(getContext()));
rvMenu.setAdapter(mMenuAdapter);
mMenuAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
for (int i = 0; i < mClassifyResponceList.size(); i++) {
mClassifyResponceList.get(i).isCheck = false;
}
ProjectClassifyResponce vProjectClassifyResponce = mClassifyResponceList.get(position);
vProjectClassifyResponce.isCheck = true;
mMenuAdapter.notifyDataSetChanged();
curPage = 1;
cid = vProjectClassifyResponce.id;
mViewModel.fetchProjectListData(curPage, cid);
projectDropDwonMenu.closeMenu();
}
});
return menuView;
}
}
| [
"hywelxu@126.com"
] | hywelxu@126.com |
1a8801070fa34f6d066f67771ccea5ff8f5ee9df | ac1170e975d4936f6b71453bab80665d3e8be20a | /app/src/main/java/com/example/binumtontine/activity/pdf/Common.java | 19c3c683db8f6955334f0afed0f710952056447b | [] | no_license | valdesjoel/binumtontine | e300d8a6327e36873789b2147ec041aa4227a1bf | 30b01e0cb87bfd7554dd687a8ec8d01380902608 | refs/heads/master | 2021-06-20T20:19:04.574584 | 2021-06-15T15:19:25 | 2021-06-15T15:19:25 | 223,933,425 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 534 | java | package com.example.binumtontine.activity.pdf;
import android.content.Context;
import com.example.binumtontine.R;
import java.io.File;
public class Common {
public static String getAppPath(Context context){
File dir = new File(android.os.Environment.getExternalStorageDirectory()
+File.separator
+context.getResources().getString(R.string.app_name)
+File.separator
);
if (!dir.exists()){
dir.mkdir();
}
return dir.getPath() + File.separator;
}
}
| [
"valdesfotso@gmail.com"
] | valdesfotso@gmail.com |
85332025aad25f9aba47219450bfe8cc756442e4 | a8b61c2350fc660b90602e7298b839a0a4113159 | /src/main/java/tn/esprit/spring/services/IContratService.java | 9d872c0380fb854bcd276f72d70e8b55406ed330 | [] | no_license | hadir-ouerghi/timesheet | bce34ac332ea2c8ed0305bd4e09f70d836c18f97 | 4b1d1d94ed2794e70fcf410cd424224a97edc5fd | refs/heads/master | 2023-01-03T13:18:49.367527 | 2020-11-03T15:34:53 | 2020-11-03T15:34:53 | 309,393,990 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 399 | java | package tn.esprit.spring.services;
import java.util.List;
import tn.esprit.spring.entities.Contrat;
public interface IContratService {
Contrat ajouterContrat(Contrat contrat);
Contrat getContratByRef(int contratRef);
void affecterContratAEmploye(int contratId, int employeId);
Contrat updateContrat(Contrat contrat);
List<Contrat> getAllContrats();
void deleteContratByRef(int i);
}
| [
"hadirouerghi@gmail.com"
] | hadirouerghi@gmail.com |
08c88f81461ba1d726cdb12e5467ef1b47ec23ae | 4f32ea13d390004ba0d45f7d982f5761998627bf | /Project_to_Test/design_patterns/src/behavioral/strategy/Add.java | 36b6ac97bea6b4bc289bd7ffabb6ac5a6215df56 | [] | no_license | MathieuDS13/TP3_Comprehension_logicielle_HAI913I | fe598970f4d42277e97ed279561b17d3fefbc9af | 24ae488d0c016b5c58c9698b71b9d95e859388b3 | refs/heads/master | 2023-09-03T02:25:33.675543 | 2021-11-15T20:41:24 | 2021-11-15T20:41:24 | 427,388,540 | 0 | 0 | null | 2021-11-15T20:41:25 | 2021-11-12T14:29:36 | Java | UTF-8 | Java | false | false | 364 | java | package behavioral.strategy;
/**
* an Add class that plays the role of ConcreteStrategy in the Strategy design pattern.
* it implements the arithmetic operation of binary integer addition.
* @author anonbnr
*/
public class Add implements ArithmeticOperation {
/**
* Returns x + y.
*/
@Override
public int execute(int x, int y) {
return x + y;
}
}
| [
"mathieu.dasilva13@gmail.com"
] | mathieu.dasilva13@gmail.com |
39bf1f8688693ba84b5cda962acef5c7934c4271 | 5199471adccd86a4342c3ac889c0fd8ab1a7460d | /app/src/main/java/pl/com/wordsweb/entities/Example.java | d873d01959fefa4cf8127ce6f6ea489d945c880f | [] | no_license | joannawetesko/WordsWeb | d39febfd109a9f93a23c1aa2b4b94ac3e82d9176 | 45df23304cdf49a780733ed75c59a789fb2cb38e | refs/heads/master | 2021-09-23T00:04:36.775218 | 2018-09-18T21:04:27 | 2018-09-18T21:04:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 575 | java | package pl.com.wordsweb.entities;
import java.io.Serializable;
/**
* Created by jwetesko on 02.05.16.
*/
public class Example implements Serializable {
private Integer id;
private String content;
public Example(String content) {
this.id = null;
this.content = content;
}
public Example() {
}
public int getId() { return this.id; }
public void setId(int id) { this.id = id; }
public String getContent() {
return this.content;
}
public void setContent(String content) { this.content = content; }
}
| [
"asia.wetesko@gmail.com"
] | asia.wetesko@gmail.com |
38d84561ab7c12c8f791bb416ff96145be9219a2 | d7c5121237c705b5847e374974b39f47fae13e10 | /airspan.netspan/src/main/java/Netspan/NBI_15_5/Backhaul/RelayPnpConfigList.java | 3dc9d0f864cace8607f308e0639d67542adde729 | [] | no_license | AirspanNetworks/SWITModules | 8ae768e0b864fa57dcb17168d015f6585d4455aa | 7089a4b6456621a3abd601cc4592d4b52a948b57 | refs/heads/master | 2022-11-24T11:20:29.041478 | 2020-08-09T07:20:03 | 2020-08-09T07:20:03 | 184,545,627 | 1 | 0 | null | 2022-11-16T12:35:12 | 2019-05-02T08:21:55 | Java | UTF-8 | Java | false | false | 743 | java |
package Netspan.NBI_15_5.Backhaul;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "RelayPnpConfigList")
public class RelayPnpConfigList {
}
| [
"build.Airspan.com"
] | build.Airspan.com |
7551ad9a7b5f822ca5b1ab43a3ba866e456494cd | 76eeb24ef31758c08ff32a265e30ac2f2e2f3320 | /ca.uvic.chisel.javasketch.data/src/ca/uvic/chisel/javasketch/data/internal/DataTrigger.java | 853e06f63b82e70e38a06f772e815058e9919a2a | [] | no_license | tkell/Diver | 2bc0dba5fe6fb7e012cd4efd554d1280340d133f | fb5f4ecef7afe398aca1e89d6234835659cf80a0 | refs/heads/master | 2020-12-29T02:55:16.010812 | 2012-06-26T23:14:57 | 2012-06-26T23:14:57 | 4,787,243 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,056 | java | /*******************************************************************************
* Copyright (c) 2009 the CHISEL group and contributors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Del Myers - initial API and implementation
*******************************************************************************/
package ca.uvic.chisel.javasketch.data.internal;
import java.util.LinkedList;
import org.hsqldb.Trigger;
/**
* @author Del Myers
*
*/
public class DataTrigger implements Trigger {
private final LinkedList<IDataTriggerListener> listeners = new LinkedList<IDataTriggerListener>();
DataTrigger() {};
/* (non-Javadoc)
* @see org.hsqldb.Trigger#fire(int, java.lang.String, java.lang.String, java.lang.Object[], java.lang.Object[])
*/
public void fire(int type, String name, String tableName, Object[] oldRow,
Object[] newRow) {
fireNewRow(tableName, newRow);
}
public void addDataListener(IDataTriggerListener listener) {
//make sure that the trigger matches the actual trigger name in the
//database
synchronized (listeners) {
if (!listeners.contains(listener)) {
listeners.add(listener);
}
}
}
public void removeDataListener(IDataTriggerListener listener) {
synchronized (listeners) {
listeners.remove(listener);
}
}
private void fireNewRow(String table, Object[] newRow) {
Object[] row = new Object[newRow.length];
//won't allow any changes to the database itself.
System.arraycopy(newRow, 0, row, 0, row.length);
IDataTriggerListener[] array = null;
synchronized (listeners) {
if (listeners != null) {
//avoid concurrent modification
array = listeners.toArray(new IDataTriggerListener[listeners.size()]);
}
}
if (array != null) {
for (IDataTriggerListener listener : array) {
listener.rowAdded(table, row);
}
}
}
}
| [
"seanws@uvic.ca"
] | seanws@uvic.ca |
1238e390ff32a5a8fe223a4f349bc006c2a54a0d | 738e279bf0365439ae36e298636c4b64916435fa | /src/org/ansj/library/UserDefineLibrary.java | 724ace336ad61aaa4ba9ad8dc5403499d1f21522 | [
"Apache-2.0"
] | permissive | wyher2001/ansj_seg | d0ef9dd4877cd70d5efbb59cabcaa25a24986c81 | adb695a896150cc85a6f80218072f96e0df914b7 | refs/heads/master | 2021-01-16T18:13:31.315252 | 2012-10-17T03:13:06 | 2012-10-17T03:13:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,712 | java | package org.ansj.library;
import java.io.BufferedReader;
import java.io.File;
import love.cq.domain.Forest;
import love.cq.library.Library;
import love.cq.util.IOUtil;
import love.cq.util.StringUtil;
import org.ansj.util.MyStaticValue;
public class UserDefineLibrary {
public static Forest FOREST = null;
static {
try {
long start = System.currentTimeMillis();
FOREST = new Forest();
// 先加载系统内置补充词典
BufferedReader br = MyStaticValue.getUserDefineReader();
String temp = null;
while ((temp = br.readLine()) != null) {
if (StringUtil.isBlank(temp)) {
continue;
} else {
Library.insertWord(FOREST, temp);
}
}
// 如果系统设置了用户词典.那么..呵呵
temp = MyStaticValue.userDefinePath;
// 加载用户自定义词典
if ((temp != null || (temp = MyStaticValue.rb.getString("userLibrary")) != null) && new File(temp).isFile()) {
br = IOUtil.getReader(temp, "UTF-8");
while ((temp = br.readLine()) != null) {
if (StringUtil.isBlank(temp)) {
continue;
} else {
Library.insertWord(FOREST, temp);
}
}
} else {
System.err.println("用户自定义词典:" + temp + ", 没有这个文件!");
}
System.out.println("加载用户自定义词典完成用时:" + (System.currentTimeMillis() - start));
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("加载用户自定义词典加载失败:");
}
}
/**
* 增加关键词
*/
public static void insertWord(String temp) {
Library.insertWord(FOREST, temp);
}
/**
* 删除关键词
*/
public static void removeWord(String word) {
Library.removeWord(FOREST, word);
}
}
| [
"ansj-sun@163.com"
] | ansj-sun@163.com |
118032bd52996ae8629efa9437af95f1f6f93ee1 | 13f27bcd537dec2bf19c4d8c4913b338b4d47e26 | /src/com/dhc/pos/activity/AboutActivity.java | 95418c5142ec219708bbd17bbbe65da49c56d40b | [] | no_license | suntinghui/POS2Android_Standard | b3e54ef00609599238a73776e0f889e73b3e4054 | 9507550943c3279afdbe4cea23fc0251a7e65500 | refs/heads/master | 2020-06-02T11:02:13.596017 | 2013-12-19T15:06:12 | 2013-12-19T15:06:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 621 | java | package com.dhc.pos.activity;
import com.dhc.pos.R;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class AboutActivity extends BaseActivity {
private Button backButton = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.about);
backButton = (Button) this.findViewById(R.id.backButton);
backButton.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
finish();
}
});
}
}
| [
"tinghuisun@163.com"
] | tinghuisun@163.com |
5b2cdbf4b1a4a7c5e6a5c2a88fbe2d58dab7e7f6 | 75950d61f2e7517f3fe4c32f0109b203d41466bf | /modules/tags/fabric3-modules-parent-pom-0.7/kernel/api/fabric3-spi/src/main/java/org/fabric3/spi/contribution/manifest/QNameImport.java | 57379b87c13843fd3ea5ab38e8250ccb1eae3827 | [] | no_license | codehaus/fabric3 | 3677d558dca066fb58845db5b0ad73d951acf880 | 491ff9ddaff6cb47cbb4452e4ddbf715314cd340 | refs/heads/master | 2023-07-20T00:34:33.992727 | 2012-10-31T16:32:19 | 2012-10-31T16:32:19 | 36,338,853 | 0 | 0 | null | null | null | null | MacCentralEurope | Java | false | false | 1,727 | java | /*
* Fabric3
* Copyright © 2008 Metaform Systems Limited
*
* This proprietary software may be used only connection with the Fabric3 license
* (the “License”), a copy of which is included in the software or may be
* obtained at: http://www.metaformsystems.com/licenses/license.html.
* Software distributed under the License is distributed on an “as is” basis,
* without warranties or conditions of any kind. See the License for the
* specific language governing permissions and limitations of use of the software.
* This software is distributed in conjunction with other software licensed under
* different terms. See the separate licenses for those programs included in the
* distribution for the permitted and restricted uses of such software.
*
*/
package org.fabric3.spi.contribution.manifest;
import java.net.URI;
import javax.xml.namespace.QName;
import org.fabric3.spi.Namespaces;
import org.fabric3.spi.contribution.Import;
/**
* A QName-based contribution import
*
* @version $Rev$ $Date$
*/
public class QNameImport implements Import {
private static final long serialVersionUID = 7714960525252585065L;
private static final QName TYPE = new QName(Namespaces.CORE, "qNameImport");
private QName namespace;
private URI location;
public URI getLocation() {
return location;
}
public void setLocation(URI location) {
this.location = location;
}
public QNameImport(QName namespace) {
this.namespace = namespace;
}
public QName getNamespace() {
return namespace;
}
public QName getType() {
return TYPE;
}
public String toString() {
return "qname [" + namespace + "]";
}
}
| [
"meerajk@83866bfc-822f-0410-aa35-bd5043b85eaf"
] | meerajk@83866bfc-822f-0410-aa35-bd5043b85eaf |
23d5460674d33b281e98f422abe53ace608f493f | 0161b81b227996036f5d0a713e84ac4962a954db | /Prototype/exercises/PrototypeDemo.java | 22f057880eff355e0b02815fd9127223a52b0307 | [] | no_license | darpanjbora/Java-Design-Pattern | 682d67d8a84bea7ae2f773634348e639d4a0c9bd | 12871ae2b79d344e3bf94579d96482343267fa4d | refs/heads/master | 2022-11-02T00:11:40.945834 | 2020-06-17T19:36:12 | 2020-06-17T19:36:12 | 264,740,873 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 664 | java | package exercises;
public class PrototypeDemo {
public static void main(String[] args) {
Registry registry = new Registry();
Movie movie = (Movie) registry.createItem("Movie");
movie.setTitle("Parasite");
System.out.println(movie);
System.out.println(movie.getTitle());
System.out.println(movie.getPrice());
System.out.println(movie.getRuntime());
Movie anotherMovie = (Movie) registry.createItem("Movie");
anotherMovie.setTitle("Bahubali");
System.out.println(anotherMovie);
System.out.println(anotherMovie.getTitle());
System.out.println(anotherMovie.getPrice());
System.out.println(anotherMovie.getRuntime());
}
}
| [
"darpanjyoti.bora@gmail.com"
] | darpanjyoti.bora@gmail.com |
96efd8f39e2621431bbf2514195e31d91b138376 | 2e2d9d7e041f916feaad59e97bd5ba98ffbb5f3d | /src/main/java/com/mc/p1/notice/NoticeController.java | ee635eb5207b8831b03a716f651be4c1fad1bc92 | [] | no_license | lhw7511/McProject | 0a13187a3a83a12af5ed2aa7c4c37ac57f658487 | df727f80f235a3bc34c6e4a7b15e96c5a7b0ab39 | refs/heads/main | 2023-02-22T09:10:41.086671 | 2021-01-27T02:46:35 | 2021-01-27T02:46:35 | 321,550,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,355 | java | package com.mc.p1.notice;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import com.mc.p1.util.NoticePager;
@Controller
@RequestMapping("/notice/**")
public class NoticeController {
@Autowired
private NoticeService noticeService;
@PostMapping("noticeUpdate")
public ModelAndView noticeUpdate2(NoticeVO noticeVO)throws Exception{
ModelAndView mv = new ModelAndView();
String message="수정 실패";
int result=noticeService.setUpdate(noticeVO);
if(result>0) {
message="수정 성공";
}
mv.addObject("msg", message);
mv.addObject("path", "./noticeList");
mv.setViewName("common/result");
return mv;
}
@GetMapping("noticeUpdate")
public ModelAndView noticeUpdate(NoticeVO noticeVO)throws Exception{
ModelAndView mv = new ModelAndView();
noticeVO=noticeService.getOne(noticeVO);
mv.addObject("dto", noticeVO);
mv.setViewName("notice/noticeUpdate");
return mv;
}
@GetMapping("noticeDelete")
public ModelAndView noticeDelete(NoticeVO noticeVO)throws Exception{
ModelAndView mv = new ModelAndView();
String message="삭제 실패";
int result = noticeService.setDelete(noticeVO);
if(result>0) {
message="삭제 성공";
}
mv.addObject("msg", message);
mv.addObject("path", "./noticeList");
mv.setViewName("common/result");
return mv;
}
@GetMapping("noticeSelect")
public ModelAndView noticeSelect(NoticeVO noticeVO)throws Exception {
ModelAndView mv = new ModelAndView();
noticeVO=noticeService.getOne(noticeVO);
mv.addObject("dto", noticeVO);
mv.setViewName("notice/noticeSelect");
return mv;
}
@GetMapping("noticeInsert")
public void noticeInsert() {
}
@GetMapping("noticeList")
public ModelAndView getList(NoticePager noticePager)throws Exception{
ModelAndView mv = new ModelAndView();
List<NoticeVO> noticeVOs = noticeService.getList(noticePager);
mv.addObject("list", noticeVOs);
mv.addObject("pager", noticePager);
mv.setViewName("notice/noticeList");
return mv;
}
@PostMapping("noticeInsert")
public ModelAndView noticeInsert(NoticeVO noticeVO)throws Exception{
ModelAndView mv = new ModelAndView();
String message="작성 실패!";
int result=noticeService.setInsert(noticeVO);
if(result>0) {
message="작성 성공!";
}
mv.addObject("msg", message);
mv.addObject("path", "../");
mv.setViewName("common/result");
return mv;
}
@PostMapping("summernoteInsert")
public ModelAndView setSummerNoteInsert(MultipartFile file)throws Exception{
ModelAndView mv = new ModelAndView();
String name=noticeService.setSummerNoteInsert(file);
mv.addObject("msg", name);
mv.setViewName("common/ajaxResult");
return mv;
}
@PostMapping("summernoteDelete")
public ModelAndView setSummerNoteDelete(String file)throws Exception{
ModelAndView mv = new ModelAndView();
boolean result=noticeService.setSummerNoteDelete(file);
mv.addObject("msg", result);
mv.setViewName("common/ajaxResult");
return mv;
}
}
| [
"lhw751@gmail.com"
] | lhw751@gmail.com |
3fbab7b5a407b80d7d45eb7a06d4a18b71c8fa54 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/21/21_a666e263a2c797b3acf43da09aec941b80283303/gcsProducer/21_a666e263a2c797b3acf43da09aec941b80283303_gcsProducer_t.java | 702100b00c16a1b3df3507bba0f7d538c346cecd | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,032 | java | package org.talend;
import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import org.apache.camel.Exchange;
import org.apache.camel.impl.DefaultProducer;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.api.client.googleapis.GoogleHeaders;
import com.google.api.client.googleapis.GoogleTransport;
import com.google.api.client.googleapis.auth.storage.GoogleStorageAuthentication;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpResponseException;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.InputStreamContent;
/**
* The gcs producer.
*/
public class gcsProducer extends DefaultProducer {
private static final transient Logger LOG = LoggerFactory.getLogger(gcsProducer.class);
private gcsEndpoint endpoint;
private static final SimpleDateFormat httpDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
static{
httpDateFormat.setTimeZone(TimeZone.getTimeZone("pst"));
}
public gcsProducer(gcsEndpoint endpoint) {
super(endpoint);
this.endpoint = endpoint;
}
public void process(Exchange exchange) throws Exception {
String fileName = exchange.getIn().getHeader("CamelFileName", String.class);
String filePath = exchange.getIn().getHeader("CamelFileParent", String.class);
LOG.info("Sending "+ fileName + " to http://" + endpoint.getUrl() + "/" + endpoint.getBucket() );
HttpTransport transport = GoogleTransport.create();
GoogleStorageAuthentication.authorize(transport, endpoint.getApiKey(), endpoint.getApiKeySecret());
HttpRequest request = transport.buildPutRequest();
FileInputStream testFile = new FileInputStream( filePath + "/" + fileName );
InputStreamContent isc = new InputStreamContent();
isc.inputStream = new ByteArrayInputStream( IOUtils.toByteArray(testFile) );
isc.type = endpoint.getContentType();
request.content = isc;
request.url = new GenericUrl("http://"+ endpoint.getUrl() +"/"+ endpoint.getBucket() +"/" + URLEncoder.encode( fileName, "utf8"));
GoogleHeaders headers = (GoogleHeaders) request.headers;
headers.date = httpDateFormat.format(new Date());
try {
request.execute();
} catch (HttpResponseException e) {
LOG.warn(getStreamContent(e.response.getContent()), e);
}
}
private static String getStreamContent(InputStream in) throws IOException {
StringBuffer out = new StringBuffer();
byte[] b = new byte[4096];
for (int n; (n = in.read(b)) != -1;) {
out.append(new String(b, 0, n));
}
return out.toString();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
a98b82461e5d9ced477d3d08d9d2dd5b87f2f505 | ec99c3140fe8ce38c0ee592b0c58a062e1a7216b | /src/main/java/co/com/udem/rumboteca/persistence/dao/EventDAO.java | bc3073fb28931b604e48d05cd660534ef3d3e68f | [] | no_license | jonathanHZ/rumboteca_backend | cfa6fc46dce9542ca3bc44c3283e4a8e605d10b2 | 3d64212fcc5427d3ef0ef046dd6b9d70cf1840e6 | refs/heads/master | 2021-01-02T22:51:24.268437 | 2015-06-02T12:09:02 | 2015-06-02T12:09:02 | 35,752,742 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 746 | java | package co.com.udem.rumboteca.persistence.dao;
import java.util.List;
import co.com.udem.rumboteca.model.EventDTO;
import co.com.udem.rumboteca.persistence.entity.Event;
/**
* Event database services definition
*
* @author Milton
*/
public interface EventDAO {
/**
* Get all event associated to city identifier
*
* @param idCity
*/
public List<Event> getEventByCity(int idCity);
/**
*
* @param idState
*/
public List<Event> getEventByState(int idState);
/**
*
* @param idCountry
*/
public List<Event> getEventByCountry(int idCountry);
/**
*
*/
public List<Event> getEventTopTen();
/**
*
* @param log
* @param lat
*/
public List<EventDTO> getEventByLocation(String log, String lat);
}
| [
"jonathan.udem@gmail.com"
] | jonathan.udem@gmail.com |
64f7db66a41782398cc2b100ee05b1190ee27b43 | 4a8161123b6f372dc3a3efce914dbe8301f82cb6 | /casadocodigo/src/main/java/br/com/casadocodigo/loja/infra/FileSaver.java | a69ce1445ccd32243d47986deecb5906c3ea21be | [] | no_license | luannascimentobjj/spring2-study | 4b753a25c578f0cd86a9fc652f74fccbe9388d2f | 3361356fb7ad00bc14f5aea57ac31a6a65f8c6d1 | refs/heads/master | 2021-01-21T12:15:13.592446 | 2017-09-26T02:17:39 | 2017-09-26T02:17:39 | 102,053,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 842 | java | package br.com.casadocodigo.loja.infra;
import java.io.File;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
@Component
public class FileSaver {
@Autowired
private HttpServletRequest request;
public String write(String baseFolder, MultipartFile file) {
try {
String realPath = "C:/Users/Nascimento/Documents/estudos/spring-study/casadocodigo/src/main/webapp/"+ baseFolder;
String path = realPath + "/" + file.getOriginalFilename();
file.transferTo(new File(path));
return baseFolder + "/" + file.getOriginalFilename();
} catch (IllegalStateException | IOException e) {
throw new RuntimeException(e);
}
}
}
| [
"nascimento.hate@gmail.com"
] | nascimento.hate@gmail.com |
c98c0d2037c5ba3a61557da9a648a5e926931a5d | 9beed88f18785233330a0f07b055a92b64806c95 | /app/src/main/java/com/back4app/quickstartexampleapp/MainActivity.java | 280b5960187f93ac6f5c9f1e4135493f57a5fda6 | [] | no_license | jashwanth/android-quickstart-example-master | f3e8c0c0cce9166ce60c616c9f8cbe89bb762b23 | 045f75e8a62d30c39ea3aa8a3aa8bf3ebb91d3bd | refs/heads/master | 2021-08-23T01:09:39.818387 | 2017-12-02T02:21:53 | 2017-12-02T02:21:53 | 112,805,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,088 | java | package com.back4app.quickstartexampleapp;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.ActionBar;
import android.os.Bundle;
import android.widget.RadioButton;
import android.widget.EditText;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
import android.util.Log;
import com.parse.ParseInstallation;
import com.parse.FindCallback;
import com.parse.LogInCallback;
import com.parse.Parse;
import com.parse.ParseException;
import com.parse.ParseObject;
import com.parse.ParseQuery;
import com.parse.ParseUser;
import com.parse.SignUpCallback;
import java.util.List;
public class MainActivity extends AppCompatActivity {
public final static String EXTRA_EMAIL = "com.back4app.quickstartexampleapp.EMAIL";
public final static String EXTRA_FNAME = "com.back4app.quickstartexampleapp.FNAME";
public final static String EXTRA_LNAME = "com.back4app.quickstartexampleapp.LNAME";
public final static String EXTRA_PASS = "com.back4app.quickstartexampleapp.PASS";
public final static String EXTRA_UTYPE = "com.back4app.quickstartexampleapp.UTYPE";
String userType;
//EditText uname;
EditText email;
EditText pass;
RadioButton btn1;
RadioButton btn2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Save the current Installation to Back4App
//ParseInstallation.getCurrentInstallation().saveInBackground();
Parse.initialize(this);
// Back4App's Parse setup
/* Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("efK08GFEEpuz0IEViSEYXDAPcLUQn3e8QYbybeW2")
.clientKey("4yQ26Qtl8zkzoUBKs7hCsh01l5c4zqlR6QZVnRF6")
.server("https://parseapi.back4app.com/").build()
);*/
// This is the installation part
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.put("GCMSenderId", "1030057213987");
installation.saveInBackground();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
public void userSignIn(View view) {
// uname = (EditText) findViewById(R.id.editText2);
email = (EditText) findViewById(R.id.editText3);
pass = (EditText) findViewById(R.id.editText);
//Parse.initialize(this, "h8up9mUy8RC8uubGJJKzPDbXANhqMlZ8jt7diWUH", "CxYmqiAgyaHArADvGZUSn9w2peO9wfzkbgYYdtwe");
ParseUser.logInInBackground(email.getText().toString(), pass.getText().toString(), new LogInCallback() {
@Override
public void done(ParseUser parseUser, ParseException e) {
if (parseUser != null) {
Context context = getApplicationContext();
CharSequence text = "Signed In!";
int duration = Toast.LENGTH_LONG;
//ParseObject uType = new ParseObject("userType");
//uType= parseUser.get("suerType");
String utype = parseUser.getString("userType");
Toast toast = Toast.makeText(context, utype, duration);
toast.show();
if(utype.equals("Doctor"))
{
Intent intent = new Intent(MainActivity.this, DoctorHome.class);
startActivity(intent);
}
else if(utype.equals("Patient"))
{
Intent intent = new Intent(MainActivity.this, PatientNavigationDrawer.class);
startActivity(intent);
} else if (utype.equals("Nurse")) {
Intent intent = new Intent(MainActivity.this, NurseNavigationDrawer.class);
startActivity(intent);
} else
{
Toast toast2 = Toast.makeText(context, "DID not find!!", duration);
toast2.show();
}
/*
ParseQuery<ParseUser> userQuery = ParseUser.getQuery();
userQuery.whereEqualTo("userType", "Doctor");
userQuery.whereEqualTo("objectId", parseUser.getObjectId());
userQuery.findInBackground(new FindCallback<ParseUser>() {
void done(List<ParseUser> results, ParseException e) {
// results has the list of users with a hometown team with a winning record
}
});*/
} else {
Context context = getApplicationContext();
CharSequence text = "Signed In Error!!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}
}
});
}
public void moveToEmail(View view) {
Intent intent = new Intent(this, EnterEmail.class);
startActivity(intent);
}
public void userSignUp(View view)
{
// moveToEmail(view);
// uname = (EditText) findViewById(R.id.editText2);
email = (EditText) findViewById(R.id.editText3);
pass = (EditText) findViewById(R.id.editText);
//Parse.initialize(this, "h8up9mUy8RC8uubGJJKzPDbXANhqMlZ8jt7diWUH", "CxYmqiAgyaHArADvGZUSn9w2peO9wfzkbgYYdtwe");
ParseUser user = new ParseUser();
// user.setUsername(uname.getText().toString());
user.setEmail(email.getText().toString());
user.setPassword(pass.getText().toString());
user.put("userType", userType.toString());
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if (e == null){
Context context = getApplicationContext();
CharSequence text = "Signed Up!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}else{
String tag = "PARSE";
Log.e(tag,e.toString());
// Log.e(tag,uname.getText().toString());
Log.e(tag, email.getText().toString());
Log.e(tag, pass.getText().toString());
Context context = getApplicationContext();
//CharSequence text = "Error! Could not sign up !!";
CharSequence text = e.toString();
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}
}
});
}
/* public void onRadioButtonClicked(View view) {
boolean checked = ((RadioButton) view).isChecked();
switch (view.getId()) {
case R.id.radioButton:
if (checked)
userType = "Doctor";
break;
case R.id.radioButton2:
if (checked)
userType = "Patient";
break;
}
}*/
}
| [
"jashwanthreddy09@gmail.com"
] | jashwanthreddy09@gmail.com |
9dcd4283d7291b0079c686a27a9a6aca062d78e8 | bc1fbf89595dc5ddac694e2dde366ec405639567 | /diagnosis-system-manager/src/main/java/com/eedu/diagnosis/manager/converter/DateConverter.java | e371f96e4d3a41282f5fa217e685ca233c771059 | [] | no_license | dingran9/b2b-diagnosis | 5bd9396b45b815fa856d8f447567e81425e67b9e | 147f7bb2ef3f0431638f076281cd74a9489f9c26 | refs/heads/master | 2021-05-06T07:47:14.230444 | 2017-12-18T09:44:08 | 2017-12-18T09:44:08 | 113,966,212 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | package com.eedu.diagnosis.manager.converter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.convert.converter.Converter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by dqy on 2017/3/21.
*/
public class DateConverter implements Converter<String,Date>{
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static final String[] DATE_FORMATS = {"yyyy-MM-dd HH:mm:ss" };
@Override
public Date convert(String s) {
if(StringUtils.isEmpty(s)) return null;
Date date = null;
try {
date = dateFormat.parse(s);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
public static void main(String[] args) {
DateConverter dc = new DateConverter();
Date convert = dc.convert("2017-03-22");
System.out.println(convert);
}
}
| [
"dingran@e-eduspace.com"
] | dingran@e-eduspace.com |
dff75c1b9b46f095e9ea9dbd260d68032b82a2c7 | cff4bc73026c95164472f05fb60d48e54b9a2e00 | /fruit-client-sb/src/main/java/me/fruitstand/demo/service/Fruit.java | d5b0df1c55499d6c9e9574feba4f9e5cc830c8d0 | [] | no_license | rhte-eu/gtrikler | a736b4c865b87c5c53bb481c9c7e7d45ac595a8b | 31e873976a293ba587836b40e7d6a6a4471462d1 | refs/heads/master | 2020-07-24T18:38:32.006478 | 2019-09-12T10:40:47 | 2019-09-12T10:40:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,085 | java | /*
* Copyright 2016-2017 Red Hat, Inc, and individual contributors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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 me.fruitstand.demo;
public class Fruit {
private Integer id;
private String name;
public Fruit() {
}
public Fruit(String type) {
this.name = type;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"gytis@redhat.com"
] | gytis@redhat.com |
1f8f15d09735150686c9ae63a23c2b6294029da2 | 7fa1ef43d3f3526171b66d189ad76a91c2b0133e | /src/JAVAXML/XMLReader/JDOM/JdomTest.java | a6ad0441d21d98ad11272957c5a234ef41fc5452 | [] | no_license | StudyBoy007/IDEAProject | 71fbbca1c6e588b70f5842d760f8242f56dcc661 | 7904b62882b386ca2458cc744a4755fe1170a22f | refs/heads/master | 2020-06-09T09:48:29.180834 | 2019-06-24T09:11:00 | 2019-06-24T09:11:00 | 193,418,788 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,857 | java | package JAVAXML.XMLReader.JDOM;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
public class JdomTest {
public static void main(String[] args) {
SAXBuilder saxBuilder = new SAXBuilder();
FileInputStream is = null;
InputStreamReader isr=null;
try {
is = new FileInputStream("XML\\books.xml");
isr=new InputStreamReader(is, "utf-8");//inputstreamreader字符流可以设置以什么格式编码输入指定xml文件,就不会乱码(编码格式要与文件的编码格式一致)
Document document = saxBuilder.build(isr);
Element rootElement = document.getRootElement();
List<Element> childrenOne = rootElement.getChildren();
for (Element children : childrenOne) {
System.out.println("*******开始遍历第" + (childrenOne.indexOf(children)+1)+ "本书的属性值!******");
//知道属性名1
// Attribute attribute=children.getAttribute("id");
// String name = attribute.getName();
// String value = attribute.getValue();
// System.out.print("属性名:" + name + "-->");
// System.out.println("属性值:" + value);
//知道属性名2
String value=children.getAttributeValue("id");
System.out.print("属性名:id-->");
System.out.println("属性值:" + value);
// List<Attribute> attributes = children.getAttributes();
// for (Attribute attribute : attributes) {
// String name = attribute.getName();
// String value = attribute.getValue();
// System.out.print("属性名:" + name + "-->");
// System.out.println("属性值:" + value);
// }
List<Element> childrenTwo = children.getChildren();
for (Element twochildren : childrenTwo) {
System.out.print(children.getName() + "的第" + (childrenTwo.indexOf(twochildren) + 1) + "子节点名称为:" + twochildren.getName());
System.out.println(",其值为:-->" + twochildren.getValue());
}
System.out.println("*******结束遍历第" + (childrenOne.indexOf(children)+1)+ "本书的属性值!******");
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (JDOMException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"1045112166@qq.com"
] | 1045112166@qq.com |
df0287439808673e2efd9c70861951a3ae2e59b3 | 447af6311deee8f575dcf5e1ccf47bfed736da4c | /dynamicrefactoring.tests/testdata/repository/moon/concreterefactoring/TestRenameField/assignmentOnTheLeftInTheClass/before/B.java | 1d1896277a3339a52551342f1ed363d8bf0ec6e1 | [] | no_license | txominpelu/dynamicrefactoring.plugin | a606b282f636538c07d9bc4590c011ede164cde3 | a660cc9cfb3778536e5a5994b294ea348644cc6e | refs/heads/master | 2020-12-24T17:08:13.656284 | 2011-07-14T14:14:46 | 2011-07-14T14:14:46 | 1,243,502 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 67 | java | public class B {
private int a;
public void B() {
a = 3;
}
} | [
"imediava2@hotmail.com"
] | imediava2@hotmail.com |
43ff5e5adc8c46f666732292bc028ebe43c19257 | 51e86222aa34932f355367a3efc88044a17aa3e4 | /gulimall-member/src/main/java/com/yuanxiang/gulimall/member/controller/MemberReceiveAddressController.java | 2775bf3f394742674ffdd8a558bed7d14ec9f5a1 | [
"Apache-2.0"
] | permissive | yuanxiang857/gulimall | e2a601cdf4584488c02665c19d3ec62a66d01931 | 6107403f7af5a3cf71051f5370c29d91c4271e81 | refs/heads/main | 2023-04-02T16:37:04.790791 | 2021-04-20T15:19:56 | 2021-04-20T15:19:56 | 359,856,916 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,561 | java | package com.yuanxiang.gulimall.member.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.yuanxiang.gulimall.member.entity.MemberReceiveAddressEntity;
import com.yuanxiang.gulimall.member.service.MemberReceiveAddressService;
import com.yuanxiang.common.utils.PageUtils;
import com.yuanxiang.common.utils.R;
/**
* 会员收货地址
*
* @author yuanxiang
* @email 1045703639@qq.com
* @date 2021-03-16 16:31:45
*/
@RestController
@RequestMapping("member/memberreceiveaddress")
public class MemberReceiveAddressController {
@Autowired
private MemberReceiveAddressService memberReceiveAddressService;
@GetMapping("/{memberId}/address")
public List<MemberReceiveAddressEntity> getAddress(@PathVariable("memberId") Long memberId) {
List<MemberReceiveAddressEntity> entities = memberReceiveAddressService.getAddress(memberId);
return entities;
}
/**
* 列表
*/
@RequestMapping("/list")
//@RequiresPermissions("member:memberreceiveaddress:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = memberReceiveAddressService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
//@RequiresPermissions("member:memberreceiveaddress:info")
public R info(@PathVariable("id") Long id){
MemberReceiveAddressEntity memberReceiveAddress = memberReceiveAddressService.getById(id);
return R.ok().put("memberReceiveAddress", memberReceiveAddress);
}
/**
* 保存
*/
@RequestMapping("/save")
//@RequiresPermissions("member:memberreceiveaddress:save")
public R save(@RequestBody MemberReceiveAddressEntity memberReceiveAddress){
memberReceiveAddressService.save(memberReceiveAddress);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
//@RequiresPermissions("member:memberreceiveaddress:update")
public R update(@RequestBody MemberReceiveAddressEntity memberReceiveAddress){
memberReceiveAddressService.updateById(memberReceiveAddress);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
//@RequiresPermissions("member:memberreceiveaddress:delete")
public R delete(@RequestBody Long[] ids){
memberReceiveAddressService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
| [
"1045703639@qq.com"
] | 1045703639@qq.com |
0856c9bdba149f6d8c29797b782f920eb636ef3e | d9c6554de571c2276ade7991413cc2b1e865618a | /src/org/br/jdbc/metadata/App.java | 3493235b0cb5c14395ef6968f6441bdc562b7ef1 | [] | no_license | robinBrGit/jbdc | 8c5a4a48d623f21066aad158c9e64381fab7ab5a | 7cb288ea5b5382b8a7dbde82e7da5f4fc570fdb5 | refs/heads/master | 2020-06-03T13:12:55.627327 | 2019-06-13T14:39:38 | 2019-06-13T14:39:38 | 191,580,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,240 | java | package org.br.jdbc.metadata;
import java.sql.*;
import java.util.Scanner;
public class App {
private static Scanner sc = new Scanner(System.in);
public static void main(String[] args) throws SQLException {
String url = "jdbc:mysql://127.0.0.1:3306/digi-jdbc?useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC";
String login = "root";
String pwd = "";
Connection connection = DriverManager.getConnection(url,login,pwd);
DatabaseMetaData metaData = connection.getMetaData();
ResultSet rs = metaData.getTables(connection.getCatalog(),null,"",null);
System.out.println("liste des tables de la BDD : ");
while(rs.next()){
System.out.print(rs.getString("TABLE_NAME")+ " - ");
}
String response;
Statement st = connection.createStatement();
do{
System.out.print("Entrez le nom de la table : ");
response = sc.nextLine();
if(!response.equals("exit")) {
ResultSet resultSet = st.executeQuery("SELECT * FROM " + response);
ResultSetMetaData rsMetaData = resultSet.getMetaData();
int count = rsMetaData.getColumnCount();
if (count > 0) {
System.out.println("Voici les informations de la table " + response);
for (int i = 1; i <= count; ++i) {
System.out.printf("%-30s", rsMetaData.getColumnName(i) + "[" + rsMetaData.getColumnTypeName(i) + "]");
}
System.out.println();
System.out.println("=============================================================================================================================");
while (resultSet.next()) {
for (int i = 1; i <= count; ++i) {
System.out.printf("%-30s", resultSet.getString(i));
}
}
System.out.println();
}
resultSet.close();
}
}while (!response.equalsIgnoreCase("exit"));
st.close();
rs.close();
connection.close();
}
}
| [
"robin.broquerie@gmail.com"
] | robin.broquerie@gmail.com |
b1012955aaa24e44e9d25a041d5fe3b705851c96 | 7b8089d65871fd0a9a193a563ed024ea47ddf5c3 | /weka-dev/src/main/java/weka/classifiers/SingleClassifierEnhancer.java | fa9bcd0e78e30c6fb86c83e33a94ff229d3e8d2a | [] | no_license | Floishy/ba_edtEvaluation | dc997931de7e4cbb0a4f9c4bc79c27d142fcaa8f | 9f6f426ed181bace74c954a8f7ea55221c4fb05e | refs/heads/master | 2021-01-13T04:19:15.337735 | 2017-09-04T11:45:18 | 2017-09-04T11:45:18 | 77,467,630 | 1 | 0 | null | 2016-12-27T16:20:10 | 2016-12-27T16:14:08 | null | UTF-8 | Java | false | false | 6,171 | java | /*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* SingleClassifierEnhancer.java
* Copyright (C) 2004-2012 University of Waikato, Hamilton, New Zealand
*
*/
package weka.classifiers;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Vector;
import weka.classifiers.rules.ZeroR;
import weka.core.Capabilities;
import weka.core.Capabilities.Capability;
import weka.core.Option;
import weka.core.OptionHandler;
import weka.core.Utils;
/**
* Abstract utility class for handling settings common to meta
* classifiers that use a single base learner.
*
* @author Eibe Frank (eibe@cs.waikato.ac.nz)
* @version $Revision$
*/
public abstract class SingleClassifierEnhancer extends AbstractClassifier {
/** for serialization */
private static final long serialVersionUID = -3665885256363525164L;
/** The base classifier to use */
protected Classifier m_Classifier = new ZeroR();
/**
* String describing default classifier.
*/
protected String defaultClassifierString() {
return "weka.classifiers.rules.ZeroR";
}
/**
* String describing options for default classifier.
*/
protected String[] defaultClassifierOptions() {
return new String[0];
}
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
public Enumeration<Option> listOptions() {
Vector<Option> newVector = new Vector<Option>(3);
newVector.addElement(new Option(
"\tFull name of base classifier.\n"
+ "\t(default: " + defaultClassifierString() +
((defaultClassifierOptions().length > 0) ?
" with options " + Utils.joinOptions(defaultClassifierOptions()) + ")" : ")"),
"W", 1, "-W"));
newVector.addAll(Collections.list(super.listOptions()));
newVector.addElement(new Option(
"",
"", 0, "\nOptions specific to classifier "
+ m_Classifier.getClass().getName() + ":"));
newVector.addAll(Collections.list(((OptionHandler)m_Classifier).listOptions()));
return newVector.elements();
}
/**
* Parses a given list of options. Valid options are:<p>
*
* -W classname <br>
* Specify the full class name of the base learner.<p>
*
* Options after -- are passed to the designated classifier.<p>
*
* @param options the list of options as an array of strings
* @exception Exception if an option is not supported
*/
public void setOptions(String[] options) throws Exception {
super.setOptions(options);
String classifierName = Utils.getOption('W', options);
if (classifierName.length() > 0) {
setClassifier(AbstractClassifier.forName(classifierName, null));
setClassifier(AbstractClassifier.forName(classifierName,
Utils.partitionOptions(options)));
} else {
setClassifier(AbstractClassifier.forName(defaultClassifierString(), null));
String[] classifierOptions = Utils.partitionOptions(options);
if (classifierOptions.length > 0) {
setClassifier(AbstractClassifier.forName(defaultClassifierString(),
classifierOptions));
} else {
setClassifier(AbstractClassifier.forName(defaultClassifierString(),
defaultClassifierOptions()));
}
}
}
/**
* Gets the current settings of the Classifier.
*
* @return an array of strings suitable for passing to setOptions
*/
public String [] getOptions() {
Vector<String> options = new Vector<String>();
options.add("-W");
options.add(getClassifier().getClass().getName());
Collections.addAll(options, super.getOptions());
String[] classifierOptions = ((OptionHandler)m_Classifier).getOptions();
if (classifierOptions.length > 0) {
options.add("--");
Collections.addAll(options, classifierOptions);
}
return options.toArray(new String[0]);
}
/**
* Returns the tip text for this property
* @return tip text for this property suitable for
* displaying in the explorer/experimenter gui
*/
public String classifierTipText() {
return "The base classifier to be used.";
}
/**
* Returns default capabilities of the base classifier.
*
* @return the capabilities of the base classifier
*/
public Capabilities getCapabilities() {
Capabilities result;
if (getClassifier() != null) {
result = getClassifier().getCapabilities();
} else {
result = new Capabilities(this);
result.disableAll();
}
// set dependencies
for (Capability cap: Capability.values())
result.enableDependency(cap);
result.setOwner(this);
return result;
}
/**
* Set the base learner.
*
* @param newClassifier the classifier to use.
*/
public void setClassifier(Classifier newClassifier) {
m_Classifier = newClassifier;
}
/**
* Get the classifier used as the base learner.
*
* @return the classifier used as the classifier
*/
public Classifier getClassifier() {
return m_Classifier;
}
/**
* Gets the classifier specification string, which contains the class name of
* the classifier and any options to the classifier
*
* @return the classifier string
*/
protected String getClassifierSpec() {
Classifier c = getClassifier();
return c.getClass().getName() + " "
+ Utils.joinOptions(((OptionHandler)c).getOptions());
}
}
| [
"Florian@DESKTOP-8BCIU9Q"
] | Florian@DESKTOP-8BCIU9Q |
2cd6fe6588f876cc2ae0dcd763985d7b79158cdf | c54ef8012a3bcc699bc15b3b056dd34bc358598b | / my-hadoop-recommend/DemoMaven/src/useridmovieid/UserIdMovieIdMapper.java | 0cc6f2894509cb23af189ebd52bf9f39ec176e31 | [] | no_license | cbmdinesh/my-hadoop-recommend | dd7afb97855d4ea779a3c0c02f19ed1c07120009 | fd8640b9e4d838f2943b678eb2a3c49fd85252be | refs/heads/master | 2020-12-24T16:50:30.015094 | 2015-02-12T05:18:11 | 2015-02-12T05:18:11 | 32,458,660 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 956 | java | /**
*
*/
package useridmovieid;
import java.io.IOException;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
/**
* @author Dinesh
*
*/
public class UserIdMovieIdMapper extends Mapper<LongWritable, Text, Text, Text>
{
/* (non-Javadoc)
* @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
*/
@Override
protected void map(LongWritable key, Text value,Mapper<LongWritable, Text, Text, Text>.Context context) throws IOException,
InterruptedException
{
String line=value.toString();
String[] items=line.split(",");
String userId="";
String ratedMovies="";
if(items.length!=3)
{
context.setStatus("Key value missing at line "+line);
return;
}
userId=items[0];
ratedMovies=items[1]+","+items[2];
context.write(new Text(userId),new Text(ratedMovies));
}
}
| [
"cbmdinesh@6f86e939-1bed-522e-11fc-ee434a671e27"
] | cbmdinesh@6f86e939-1bed-522e-11fc-ee434a671e27 |
edefc2c26e522475fe32dd29de9e9ed5a5b266b1 | 20ef0eaaa77093335a0ea254e5e9cf9cffcf4f0c | /jingpeng/005_绥化拌合站/SuihuaMixStation/src/com/MixStation/model/PlatformCementStableDataEntity.java | 42a11f6d95e176b108d25e915730816f7b29fe1a | [] | no_license | elaine140626/jingpeng | 1749830a96352b0c853f148c4808dd67650df8a0 | 2329eb463b4d36bdb4dedf451702b4c73ef87982 | refs/heads/master | 2021-03-15T00:29:17.637034 | 2019-08-15T01:35:49 | 2019-08-15T01:35:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,188 | java | package com.MixStation.model;
/**
*
* @Title 水泥生产
* @author ygt
* @date 2018年9月20日
*/
public class PlatformCementStableDataEntity {
private int serialNumber;// 序号
private String I_Id;
private String Org_ID;//组织机构ID
private String Product_ID;//产品Id
private String Equ_ID;//拌和机Id
private String i_cons_Mix_ID;//施工配合比ID
private String ProdPlan_No;//生产计划编号
private String str_collect_Date;//采集时间
private String d_set_Cement1;//水泥仓1设定值
private String d_set_Cement2;//水泥仓2设定值
private String d_set_Cement3;//水泥仓3设定值
private String d_set_Cement4;//水泥仓4设定值
private String d_weight_Cement1;//水泥仓1采集值
private String d_weight_Cement2;//水泥仓2采集值
private String d_weight_Cement3;//水泥仓3采集值
private String d_weight_Cement4;//水泥仓4采集值
private String d_set_Aggregate1;//骨料仓1设定值
private String d_set_Aggregate2;//骨料仓2设定值
private String d_set_Aggregate3;//骨料仓3设定值
private String d_set_Aggregate4;//骨料仓4设定值
private String d_set_Aggregate5;//骨料仓5设定值
private String d_set_Aggregate6;//骨料仓6设定值
private String d_weight_Aggregate1;//骨料仓1采集值
private String d_weight_Aggregate2;//骨料仓2采集值
private String d_weight_Aggregate3;//骨料仓3采集值
private String d_weight_Aggregate4;//骨料仓4采集值
private String d_weight_Aggregate5;//骨料仓5采集值
private String d_weight_Aggregate6;//骨料仓6采集值
private String d_set_Water;//水仓设定值
private String d_weight_Water;//水仓采集值
private String d_set_Admixture1;//外掺剂1仓设定值
private String d_set_Admixture2;//外掺剂2仓设定值
private String d_weight_Admixture1;//外掺剂1仓采集值
private String d_weight_Admixture2;//外掺剂2仓采集值
private String Analysis_Result;//数据分析结果
private String d_total_Weight;//拌和总量
private String i_mix_Time; //拌和时间
private String Temperature_Meter;
private String Construction_Unit;//施工地点
private String Proj_Pos;//工程部位
private String str_equipment_Name;//设备名称
private String str_equipment_Type;
private String productInfo;//产品名称
private String Proportion_Code;//生产配合比编号
private String Grade_Code;//级配编号
private String Valid_Flag;
private String Org_Name;//拌和站名称
public int getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(int serialNumber) {
this.serialNumber = serialNumber;
}
public String getI_Id() {
return I_Id;
}
public void setI_Id(String i_Id) {
I_Id = i_Id;
}
public String getOrg_ID() {
return Org_ID;
}
public void setOrg_ID(String org_ID) {
Org_ID = org_ID;
}
public String getProduct_ID() {
return Product_ID;
}
public void setProduct_ID(String product_ID) {
Product_ID = product_ID;
}
public String getEqu_ID() {
return Equ_ID;
}
public void setEqu_ID(String equ_ID) {
Equ_ID = equ_ID;
}
public String getI_cons_Mix_ID() {
return i_cons_Mix_ID;
}
public void setI_cons_Mix_ID(String i_cons_Mix_ID) {
this.i_cons_Mix_ID = i_cons_Mix_ID;
}
public String getProdPlan_No() {
return ProdPlan_No;
}
public void setProdPlan_No(String prodPlan_No) {
ProdPlan_No = prodPlan_No;
}
public String getStr_collect_Date() {
return str_collect_Date;
}
public void setStr_collect_Date(String str_collect_Date) {
this.str_collect_Date = str_collect_Date;
}
public String getD_set_Cement1() {
return d_set_Cement1;
}
public void setD_set_Cement1(String d_set_Cement1) {
this.d_set_Cement1 = d_set_Cement1;
}
public String getD_set_Cement2() {
return d_set_Cement2;
}
public void setD_set_Cement2(String d_set_Cement2) {
this.d_set_Cement2 = d_set_Cement2;
}
public String getD_set_Cement3() {
return d_set_Cement3;
}
public void setD_set_Cement3(String d_set_Cement3) {
this.d_set_Cement3 = d_set_Cement3;
}
public String getD_set_Cement4() {
return d_set_Cement4;
}
public void setD_set_Cement4(String d_set_Cement4) {
this.d_set_Cement4 = d_set_Cement4;
}
public String getD_weight_Cement1() {
return d_weight_Cement1;
}
public void setD_weight_Cement1(String d_weight_Cement1) {
this.d_weight_Cement1 = d_weight_Cement1;
}
public String getD_weight_Cement2() {
return d_weight_Cement2;
}
public void setD_weight_Cement2(String d_weight_Cement2) {
this.d_weight_Cement2 = d_weight_Cement2;
}
public String getD_weight_Cement3() {
return d_weight_Cement3;
}
public void setD_weight_Cement3(String d_weight_Cement3) {
this.d_weight_Cement3 = d_weight_Cement3;
}
public String getD_weight_Cement4() {
return d_weight_Cement4;
}
public void setD_weight_Cement4(String d_weight_Cement4) {
this.d_weight_Cement4 = d_weight_Cement4;
}
public String getD_set_Aggregate1() {
return d_set_Aggregate1;
}
public void setD_set_Aggregate1(String d_set_Aggregate1) {
this.d_set_Aggregate1 = d_set_Aggregate1;
}
public String getD_set_Aggregate2() {
return d_set_Aggregate2;
}
public void setD_set_Aggregate2(String d_set_Aggregate2) {
this.d_set_Aggregate2 = d_set_Aggregate2;
}
public String getD_set_Aggregate3() {
return d_set_Aggregate3;
}
public void setD_set_Aggregate3(String d_set_Aggregate3) {
this.d_set_Aggregate3 = d_set_Aggregate3;
}
public String getD_set_Aggregate4() {
return d_set_Aggregate4;
}
public void setD_set_Aggregate4(String d_set_Aggregate4) {
this.d_set_Aggregate4 = d_set_Aggregate4;
}
public String getD_set_Aggregate5() {
return d_set_Aggregate5;
}
public void setD_set_Aggregate5(String d_set_Aggregate5) {
this.d_set_Aggregate5 = d_set_Aggregate5;
}
public String getD_set_Aggregate6() {
return d_set_Aggregate6;
}
public void setD_set_Aggregate6(String d_set_Aggregate6) {
this.d_set_Aggregate6 = d_set_Aggregate6;
}
public String getD_weight_Aggregate1() {
return d_weight_Aggregate1;
}
public void setD_weight_Aggregate1(String d_weight_Aggregate1) {
this.d_weight_Aggregate1 = d_weight_Aggregate1;
}
public String getD_weight_Aggregate2() {
return d_weight_Aggregate2;
}
public void setD_weight_Aggregate2(String d_weight_Aggregate2) {
this.d_weight_Aggregate2 = d_weight_Aggregate2;
}
public String getD_weight_Aggregate3() {
return d_weight_Aggregate3;
}
public void setD_weight_Aggregate3(String d_weight_Aggregate3) {
this.d_weight_Aggregate3 = d_weight_Aggregate3;
}
public String getD_weight_Aggregate4() {
return d_weight_Aggregate4;
}
public void setD_weight_Aggregate4(String d_weight_Aggregate4) {
this.d_weight_Aggregate4 = d_weight_Aggregate4;
}
public String getD_weight_Aggregate5() {
return d_weight_Aggregate5;
}
public void setD_weight_Aggregate5(String d_weight_Aggregate5) {
this.d_weight_Aggregate5 = d_weight_Aggregate5;
}
public String getD_weight_Aggregate6() {
return d_weight_Aggregate6;
}
public void setD_weight_Aggregate6(String d_weight_Aggregate6) {
this.d_weight_Aggregate6 = d_weight_Aggregate6;
}
public String getD_set_Water() {
return d_set_Water;
}
public void setD_set_Water(String d_set_Water) {
this.d_set_Water = d_set_Water;
}
public String getD_weight_Water() {
return d_weight_Water;
}
public void setD_weight_Water(String d_weight_Water) {
this.d_weight_Water = d_weight_Water;
}
public String getD_set_Admixture1() {
return d_set_Admixture1;
}
public void setD_set_Admixture1(String d_set_Admixture1) {
this.d_set_Admixture1 = d_set_Admixture1;
}
public String getD_set_Admixture2() {
return d_set_Admixture2;
}
public void setD_set_Admixture2(String d_set_Admixture2) {
this.d_set_Admixture2 = d_set_Admixture2;
}
public String getD_weight_Admixture1() {
return d_weight_Admixture1;
}
public void setD_weight_Admixture1(String d_weight_Admixture1) {
this.d_weight_Admixture1 = d_weight_Admixture1;
}
public String getD_weight_Admixture2() {
return d_weight_Admixture2;
}
public void setD_weight_Admixture2(String d_weight_Admixture2) {
this.d_weight_Admixture2 = d_weight_Admixture2;
}
public String getAnalysis_Result() {
return Analysis_Result;
}
public void setAnalysis_Result(String analysis_Result) {
Analysis_Result = analysis_Result;
}
public String getD_total_Weight() {
return d_total_Weight;
}
public void setD_total_Weight(String d_total_Weight) {
this.d_total_Weight = d_total_Weight;
}
public String getI_mix_Time() {
return i_mix_Time;
}
public void setI_mix_Time(String i_mix_Time) {
this.i_mix_Time = i_mix_Time;
}
public String getTemperature_Meter() {
return Temperature_Meter;
}
public void setTemperature_Meter(String temperature_Meter) {
Temperature_Meter = temperature_Meter;
}
public String getConstruction_Unit() {
return Construction_Unit;
}
public void setConstruction_Unit(String construction_Unit) {
Construction_Unit = construction_Unit;
}
public String getProj_Pos() {
return Proj_Pos;
}
public void setProj_Pos(String proj_Pos) {
Proj_Pos = proj_Pos;
}
public String getStr_equipment_Name() {
return str_equipment_Name;
}
public void setStr_equipment_Name(String str_equipment_Name) {
this.str_equipment_Name = str_equipment_Name;
}
public String getStr_equipment_Type() {
return str_equipment_Type;
}
public void setStr_equipment_Type(String str_equipment_Type) {
this.str_equipment_Type = str_equipment_Type;
}
public String getProductInfo() {
return productInfo;
}
public void setProductInfo(String productInfo) {
this.productInfo = productInfo;
}
public String getProportion_Code() {
return Proportion_Code;
}
public void setProportion_Code(String proportion_Code) {
Proportion_Code = proportion_Code;
}
public String getGrade_Code() {
return Grade_Code;
}
public void setGrade_Code(String grade_Code) {
Grade_Code = grade_Code;
}
public String getValid_Flag() {
return Valid_Flag;
}
public void setValid_Flag(String valid_Flag) {
Valid_Flag = valid_Flag;
}
public String getOrg_Name() {
return Org_Name;
}
public void setOrg_Name(String org_Name) {
Org_Name = org_Name;
}
}
| [
"474296307@qq.com"
] | 474296307@qq.com |
f236a8f4818c4c238203765b0c8b17df7232457e | e51754506cd9cbc8fed84b51c31832d32dc19abd | /src/main/java/com/dregost/moneytransfer/common/model/Aggregate.java | 92675a9c9fcaaa91ff8497d4659784239c382c93 | [] | no_license | dregost/money-transfer | acb171c5ff54a8ea31bec93f53c55270c3660b97 | 7a5d1e8eee49efec45d2dbc4f7be0864e21184ec | refs/heads/master | 2020-04-16T05:01:45.029333 | 2019-01-11T18:52:22 | 2019-01-11T19:00:25 | 165,290,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 761 | java | package com.dregost.moneytransfer.common.model;
import com.dregost.moneytransfer.common.event.EventStream;
import lombok.Getter;
import java.util.*;
@Getter
public abstract class Aggregate<ID extends Id, EVENT extends Event> {
private final List<EVENT> pendingEvents;
protected Aggregate() {
this.pendingEvents = new ArrayList<>();
}
public abstract ID getId();
public void markEventsAsCommitted() {
pendingEvents.clear();
}
protected void apply(final EventStream<EVENT> eventStream) {
eventStream.forEach(this::apply);
}
protected void addPendingEvent(final EVENT event) {
pendingEvents.add(event);
apply(event);
}
protected abstract void apply(final EVENT event);
}
| [
"46607397+dregost@users.noreply.github.com"
] | 46607397+dregost@users.noreply.github.com |
ae9c0f9070a2d2284ea998529703f93dba2795bf | 4f9342f089887a8079c28075ad6c33f3b42a996f | /General/src/byzantinebailuremodelclient/Main.java | 14ca956c6e1cf56e86695b60ec8b4a893c8b6cfd | [] | no_license | williampmb/GeneralByzantine | dd3ca5142c16ff0816473e88cf51ccaab093d53c | 6463d1900d397844101e5864f42a8506638a7256 | refs/heads/master | 2021-01-02T09:35:27.944913 | 2017-08-03T16:47:27 | 2017-08-03T16:47:27 | 99,254,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,767 | 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 byzantinebailuremodelclient;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import static java.lang.Thread.sleep;
import java.net.Socket;
/**
*
* @author willi
*/
public class Main {
static private General general;
static String splitTag = "->";
static private Socket socket;
static int numberOfGenerals;
static int probabilityOfTraitors;
//args[0] = ip to connect on the broadcast
//args[1] = number of generals
//args[2] = probability of traitors
public static void main(String[] args) throws IOException, Exception {
System.out.println(" ** Trying to Connect ** ");
System.out.println(" ** Version 3.0 ** ");
socket = new Socket(args[0], 9000);
numberOfGenerals = Integer.valueOf(args[1]);
probabilityOfTraitors = Integer.valueOf(args[2]);
InputStream input = socket.getInputStream();
OutputStream output = socket.getOutputStream();
BufferedReader in = new BufferedReader(new InputStreamReader(input));
PrintStream out = new PrintStream(output);
String msg = in.readLine();
System.out.println(msg);
general = new General(msg);
File log = new File("general"+general.getId()+".txt");
if(!log.exists()){
log.createNewFile();
}
PrintWriter pw = new PrintWriter(new FileOutputStream(log, true));
pw.append(" ** Trying to Connect ** \n");
pw.append(" ** Version 3.0 ** \n");
System.out.println("General " + general.getId() + " Conencted");
pw.append("General " + general.getId() + " Conencted \n");
ScoutHandler sendMessages = new ScoutHandler(in, out, general,pw);
sendMessages.start();
ScoutListenerHandler receiveMessages = new ScoutListenerHandler(in, out, general,pw);
receiveMessages.start();
while (true) {
// thinking if it has enough votes to attack or not
boolean commomSense = general.analiseVotes();
if (commomSense) {
System.out.println(general.getId() + ": " + general.getDecision());
pw.append(general.getId() + ": " + general.getDecision()+"\n");
break;
}
sleep(1000);
}
pw.close();
}
}
| [
"williampmb@gmail.com"
] | williampmb@gmail.com |
3e3b1aa24f53d3609159e91fb25d32176f8cb67b | 40c13cc53b0d88f7e9a8de823c16f9c2279604ed | /Part 13/13-12-VocabularyPractice/application/Dictionary.java | bfe84532f966079dc520a4813e8d8a0db6158822 | [] | no_license | faaabi93/mooc-java-programming-ii | 7c2c05b7998fb02dcf25b2a64b09bb470d8ad7f7 | d44b0f20211717f5696176fa7d622999e91c2843 | refs/heads/main | 2023-03-23T13:00:56.771690 | 2021-03-15T10:45:40 | 2021-03-15T10:45:40 | 329,591,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 854 | java | package application;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class Dictionary {
private List<String> words;
private Map<String, String> translations;
public Dictionary() {
this.words = new ArrayList<>();
this.translations = new HashMap<>();
add("Test", "Test");
}
public String get(String word) {
return this.translations.get(word);
}
public void add(String word, String translation) {
if(!this.translations.containsKey(word)) {
this.words.add(word);
}
this.translations.put(word, translation);
}
public String getRandomWord() {
Random random = new Random();
return this.words.get(random.nextInt(this.words.size()));
}
}
| [
"fabian.baiersdoerfer@gmx.de"
] | fabian.baiersdoerfer@gmx.de |
d47e1c3b740c5349c056b1e5530549505e7a2af8 | d5ac78ca568d81288ed20ea354e43a936c2fefed | /src/Dao/PatientDao.java | 0c2b5aafcf28d3b82f21be067426a3377d143349 | [] | no_license | ash0710/Hospital-Management | a29fe8a822b774b1c65898e46c3686ee5effa197 | c914cddf42807057edf3c42eeda259d8c44c5182 | refs/heads/master | 2023-03-01T18:05:44.859757 | 2021-01-31T13:23:51 | 2021-01-31T13:23:51 | 334,653,290 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,540 | 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 Dao;
import DBConn.Myconnection;
import POJO.PatientPojo;
import java.sql.Connection;
import java.util.logging.Level;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.logging.Logger;
/**
*
* @author Ashray
*/
public class PatientDao {
public static boolean addPatient (PatientPojo obj)
{
boolean status=true;
Connection conn;
PreparedStatement ps;
ResultSet rs;
try
{
conn = (Connection) Myconnection.getConnection();
ps=conn.prepareStatement("select * from patient where p_name = ?");
ps.setString(1, obj.getP_name());
rs=ps.executeQuery();
if(rs.next())
{
status=false;
}
else
{
ps=conn.prepareStatement("insert into patient values(?,?,?,?,?)");
ps.setString(1, obj.getP_name());
ps.setString(2, obj.getF_name());
ps.setInt(3, obj.getAge());
ps.setLong(4,obj.getAadhar());
ps.setString(5, obj.getDoc_name());
ps.executeUpdate();
}
}
catch (Exception ex) {
Logger.getLogger(PatientDao.class.getName()).log(Level.SEVERE, null, ex);
}
return status;
}
}
| [
"ashray062@gmail.com"
] | ashray062@gmail.com |
b64768f6c3bfca2d33432648c977c51744dec008 | a64edf7014cdd85bb23f3cffb7bc996f57f55e42 | /src/org/usfirst/frc/team219/robot/subsystems/BallConveyor.java | 1ccea5d5fffff21ea87d9760e22c8875def0e357 | [] | no_license | JasonNTran/Team-219-Steamworks | 5560633549e952b2a254d0daff11f053c7b3888d | 2afd17d190daca2ee9ef3718b74319026e014ce7 | refs/heads/master | 2021-07-06T03:32:35.420897 | 2017-01-26T20:24:35 | 2017-01-26T20:24:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,286 | java | package org.usfirst.frc.team219.robot.subsystems;
import org.usfirst.frc.team219.robot.RobotMap;
import com.ctre.CANTalon;
import edu.wpi.first.wpilibj.command.PIDSubsystem;
/**
* The subsystem for the conveyor belt of Team 219's 2017 robot.
* <br>
* THIS SUBSYSTEM IS CURRENTLY INCOMPLETE
*/
public class BallConveyor extends PIDSubsystem {
// Initialize your subsystem here
private CANTalon conveyorMotor;
public BallConveyor() {
// Use these to get going:
// setSetpoint() - Sets where the PID controller should move the system
// to
// enable() - Enables the PID controller.
super("Conveyer", 1, 0, 0);
conveyorMotor = new CANTalon(RobotMap.CONVEYORMOTOR_PORT);
}
public void initDefaultCommand() {
// Set the default command for a subsystem here.
//setDefaultCommand(new MySpecialCommand());
}
protected double returnPIDInput() {
// Return your input value for the PID loop
// e.g. a sensor, like a potentiometer:
// yourPot.getAverageVoltage() / kYourMaxVoltage;
return 0.0;
}
protected void usePIDOutput(double output) {
// Use output to drive your system, like a motor
// e.g. yourMotor.set(output);
}
}
| [
"jasontran33@gmail.com"
] | jasontran33@gmail.com |
12d60fc15d137e27af48a3a3c8301f6a78facbdd | 56c1e410f5c977fedce3242e92a1c6496e205af8 | /lib/sources/dolphin-mybatis-generator/main/java/com/freetmp/mbg/merge/expression/UnaryExprMerger.java | 6356b779c01ea2ac4e2f9234a04eb1a88fcd9bae | [
"Apache-2.0"
] | permissive | jacksonpradolima/NewMuJava | 8d759879ecff0a43b607d7ab949d6a3f9512944f | 625229d042ab593f96f7780b8cbab2a3dbca7daf | refs/heads/master | 2016-09-12T16:23:29.310385 | 2016-04-27T18:45:51 | 2016-04-27T18:45:51 | 57,235,697 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 730 | java | package com.freetmp.mbg.merge.expression;
import com.freetmp.mbg.merge.AbstractMerger;
import com.github.javaparser.ast.expr.UnaryExpr;
/**
* Created by LiuPin on 2015/5/13.
*/
public class UnaryExprMerger extends AbstractMerger<UnaryExpr> {
@Override public UnaryExpr doMerge(UnaryExpr first, UnaryExpr second) {
UnaryExpr ue = new UnaryExpr();
ue.setExpr(mergeSingle(first.getExpr(),second.getExpr()));
ue.setOperator(first.getOperator());
return ue;
}
@Override public boolean doIsEquals(UnaryExpr first, UnaryExpr second) {
if(!first.getOperator().equals(second.getOperator())) return false;
if(!isEqualsUseMerger(first.getExpr(),second.getExpr())) return false;
return true;
}
}
| [
"pradolima@live.com"
] | pradolima@live.com |
9a4c86ae30cbd46b71b573276f35f1bd7a6f1546 | 4b9fbbe775178ce71d14bc6ff6d885cb5ec74c54 | /src/main/java/com/pps/core/plug/insertplug/strage/ObjectCreateFactory.java | 997d75bd3cf0114440a4c0be1e23be21b399041a | [] | no_license | pupansheng/my_springboot_core | de577db18d4b12b89826230c97119f2ad240313c | afd34ef68c776e8dfb30ca19cdf2ec377ac57522 | refs/heads/master | 2023-04-23T15:06:39.638501 | 2021-05-16T02:57:13 | 2021-05-16T02:57:13 | 366,321,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 609 | java | package com.pps.core.plug.insertplug.strage;
import java.util.HashMap;
import java.util.Map;
/**
* @author
* @discription;
* @time 2020/11/10 11:18
*/
public class ObjectCreateFactory {
private static final Map<Class,ObjectCreate> m=new HashMap<>();
public static ObjectCreate getObjectCreate(Class c){
ObjectCreate objectCreate = m.get(c);
if(objectCreate==null){
throw new RuntimeException(c+":没有找到此类型的对象生成器");
}
return objectCreate;
}
public static void put(Class c,ObjectCreate o){
m.put(c,o);
}
}
| [
"pupansheng@travelsky.com.cn"
] | pupansheng@travelsky.com.cn |
810e15de680bea915949d474507c29a62ef7182c | 63a3dba50c8232a71c4128ca7ed5814fc617fe62 | /src/com/javaer/tools/common/XmlFormatter.java | 8d71606aa90ec058b849b8920ca2e6a0a7345057 | [] | no_license | henrypoter/mydevtools | e2df942b8f8738cf2aad85183c73cd96b7938b05 | 2b896116be36081f2a1554f1e08e51aaae7dc0d8 | refs/heads/master | 2016-09-09T17:56:04.838414 | 2013-01-19T09:15:04 | 2013-01-19T09:15:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,562 | java | package com.javaer.tools.common;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileReader;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class XmlFormatter {
/**
* @param args
* @throws TransformerException
* @throws TransformerFactoryConfigurationError
* @throws TransformerConfigurationException
*/
public static void main(String[] args) throws TransformerConfigurationException, TransformerFactoryConfigurationError, TransformerException {
File xsltFile = new File("xml-indent.xslt");
String urglyXml = getXMLString(args[0]);
String prettyXml = XmlFormatter.xmlFormat(urglyXml, xsltFile);
System.out.println("Urgly Xml:");
System.out.println(urglyXml);
System.out.println("Pretty Xml:");
System.out.println(prettyXml);
}
public static String xmlFormat(String urglyXml,File xsltFile) throws TransformerException{
//InputStream is = new ByteArrayInputStream(Charset.forName("UTF-8").encode(urglyXml).array());
InputStream is = new ByteArrayInputStream( urglyXml.getBytes() );
Source xmlSource = new StreamSource(is);
Source xsltSource = new StreamSource(xsltFile);
// the factory pattern supports different XSLT processors
TransformerFactory transFact = TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(xsltSource);
StringBuffer buffer = new StringBuffer();
OutputStream out = new ByteArrayOutputStream();
// trans.transform(xmlSource, new StreamResult(System.out));
trans.transform(xmlSource, new StreamResult(out));
return out.toString();
}
/**
* xml�ļ�ͨ��xslt����ת��
*
* @param xmlFile ��Ҫ����ת����xml�ļ�
* @param xmlFile ��Ҫ����ת����xml�ļ�
* @return out ת����Ľ��
*/
private static OutputStream transform(File xmlFile, File xsltFile)
throws TransformerFactoryConfigurationError,
TransformerConfigurationException, TransformerException {
// JAXP reads data using the Source interface
Source xmlSource = new StreamSource(xmlFile);
Source xsltSource = new StreamSource(xsltFile);
// the factory pattern supports different XSLT processors
TransformerFactory transFact = TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(xsltSource);
StringBuffer buffer = new StringBuffer();
OutputStream out = new ByteArrayOutputStream();
// trans.transform(xmlSource, new StreamResult(System.out));
trans.transform(xmlSource, new StreamResult(out));
return out;
}
private static String getXMLString(String filePath) {
StringBuffer sb = new StringBuffer();
BufferedReader br = null;
String line;
try {
br = new BufferedReader(new FileReader(filePath));
while (true) {
line = br.readLine();
if (line == null) {
break;
}
sb.append(line + "\n");
}
} catch (Exception e) {
e.printStackTrace();
}
return sb.toString();
}
}
| [
"henrypoter@126.com"
] | henrypoter@126.com |
23308c9aa3bbac81a816217e380371bed2840d91 | 863cda41b5209f32121c90e10a375bf14c6cba1e | /de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/AbstractFeatureModelReader.java | c5df86804b37eb29e700c7984bf66a1aa34dc507 | [] | no_license | dstrueber/bigtrafo | 0113fc19eccf15531feea4b42c202000ddac32c7 | 5eccaec248bf146338f23e3ccee7134bdc6c2eff | refs/heads/master | 2021-01-21T14:44:45.404710 | 2016-10-21T10:30:12 | 2016-10-21T10:30:12 | 56,861,233 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,108 | java | /* FeatureIDE - A Framework for Feature-Oriented Software Development
* Copyright (C) 2005-2013 FeatureIDE team, University of Magdeburg, Germany
*
* This file is part of FeatureIDE.
*
* FeatureIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FeatureIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with FeatureIDE. If not, see <http://www.gnu.org/licenses/>.
*
* See http://www.fosd.de/featureide/ for further information.
*/
package de.ovgu.featureide.fm.core.io;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.LinkedList;
import java.util.List;
import de.ovgu.featureide.fm.core.FMCorePlugin;
import de.ovgu.featureide.fm.core.FeatureModel;
/**
* Default reader to be extended for each feature model format.
*
* If IFile support is needed, the {@link FeatureModelReaderIFileWrapper} has to be used.
*
* @author Thomas Thuem
*/
public abstract class AbstractFeatureModelReader implements IFeatureModelReader {
/**
* the structure to store the parsed data
*/
protected FeatureModel featureModel;
/**
* warnings occurred while parsing
*/
protected LinkedList<ModelWarning> warnings = new LinkedList<ModelWarning>();
/**
* The source of the textual representation of the feature model.<br/><br/>
*
* <strong>Caution:</strong> This field can be null and is maybe not up to date.
*/
protected File featureModelFile;
public void setFeatureModel(FeatureModel featureModel) {
this.featureModel = featureModel;
}
public FeatureModel getFeatureModel() {
return featureModel;
}
/**
* Reads a feature model from a file.
*
* @param file
* the file which contains the textual representation of the
* feature model
* @throws UnsupportedModelException
* @throws FileNotFoundException
*/
public void readFromFile(File file) throws UnsupportedModelException,
FileNotFoundException {
warnings.clear();
this.featureModelFile = file;
String fileName = file.getPath();
InputStream inputStream = null;
try {
inputStream = new FileInputStream(fileName);
parseInputStream(inputStream);
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
FMCorePlugin.getDefault().logError(e);
}
}
}
}
/**
* Reads a feature model from a string.<br/><br/>
*
* Please use {@link #setFile(File)} if you know the source of the feature
* model.
*
* @param text
* the textual representation of the feature model
* @throws UnsupportedModelException
*/
public void readFromString(String text) throws UnsupportedModelException {
warnings.clear();
InputStream inputStream = new ByteArrayInputStream(
text.getBytes(Charset.availableCharsets().get("UTF-8")));
parseInputStream(inputStream);
}
public List<ModelWarning> getWarnings() {
return warnings;
}
/**
* Reads a feature model from an input stream.
*
* @param inputStream the textual representation of the feature model
* @throws UnsupportedModelException
*/
protected abstract void parseInputStream(InputStream inputStream)
throws UnsupportedModelException;
/**
* Set the source file of the textual representation of the feature model.
*
* @param featureModelFile
* the source file
*/
public void setFile(File featureModelFile) {
this.featureModelFile = featureModelFile;
}
public File getFile() {
return this.featureModelFile;
}
}
| [
"strueber@mathematik.uni-marburg.de"
] | strueber@mathematik.uni-marburg.de |
6942a483a3da3e808dff3c281d6eab9e02d9c554 | f6beea8ab88dad733809e354ef9a39291e9b7874 | /com/planet_ink/coffee_mud/WebMacros/ExpertiseID.java | beb52a3c549e486b0a833518ec6061ae61f278a7 | [
"Apache-2.0"
] | permissive | bonnedav/CoffeeMud | c290f4d5a96f760af91f44502495a3dce3eea415 | f629f3e2e10955e47db47e66d65ae2883e6f9072 | refs/heads/master | 2020-04-01T12:13:11.943769 | 2018-10-11T02:50:45 | 2018-10-11T02:50:45 | 153,196,768 | 0 | 0 | Apache-2.0 | 2018-10-15T23:58:53 | 2018-10-15T23:58:53 | null | UTF-8 | Java | false | false | 1,986 | java | package com.planet_ink.coffee_mud.WebMacros;
import com.planet_ink.coffee_web.interfaces.*;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2006-2018 Bo Zimmerman
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.
*/
public class ExpertiseID extends StdWebMacro
{
@Override
public String name()
{
return "ExpertiseID";
}
@Override
public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp)
{
final String last=httpReq.getUrlParameter("EXPERTISE");
if(last==null)
return " @break@";
if(last.length()>0)
{
final ExpertiseLibrary.ExpertiseDefinition E=CMLib.expertises().getDefinition(last);
if(E!=null)
return E.ID();
}
return "";
}
}
| [
"bo@zimmers.net"
] | bo@zimmers.net |
ed2f0a055b13d9780bb5d256074feedb2c47b851 | 2fb7d094d786885cc43d60b991c6cea2ccc4e5b7 | /src/com/myorg/dummy/pos/controller/ManageItemFormController.java | 64bbab0fe27153c38bb77e98bf849424e17348d2 | [
"MIT"
] | permissive | Charindu-Thennakoon/Spring-Hibernate-POS-System | 109b4896eefb0a811255002f1c5562d737d3655b | fd3dfef14a84989ded5ee20fbe2fa4b417a62279 | refs/heads/master | 2022-12-06T09:14:25.116824 | 2020-08-27T02:10:00 | 2020-08-27T02:10:00 | 290,649,359 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,245 | java |
package com.myorg.dummy.pos.controller;
import com.myorg.dummy.pos.AppInitializer;
import com.myorg.dummy.pos.business.custom.ItemBO;
import com.jfoenix.controls.JFXTextField;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import com.myorg.dummy.pos.util.ItemTM;
import java.io.IOException;
import java.net.URL;
import java.util.Optional;
import java.util.ResourceBundle;
public class ManageItemFormController implements Initializable {
public JFXTextField txtCode;
public JFXTextField txtDescription;
public JFXTextField txtQtyOnHand;
public TableView<ItemTM> tblItems;
public JFXTextField txtUnitPrice;
@FXML
private Button btnSave;
@FXML
private Button btnDelete;
@FXML
private AnchorPane root;
private ItemBO itemBO = AppInitializer.getApplicationContext().getBean(ItemBO.class);
@Override
public void initialize(URL url, ResourceBundle rb) {
tblItems.getColumns().get(0).setCellValueFactory(new PropertyValueFactory<>("code"));
tblItems.getColumns().get(1).setCellValueFactory(new PropertyValueFactory<>("description"));
tblItems.getColumns().get(2).setCellValueFactory(new PropertyValueFactory<>("qtyOnHand"));
tblItems.getColumns().get(3).setCellValueFactory(new PropertyValueFactory<>("unitPrice"));
txtCode.setDisable(true);
txtDescription.setDisable(true);
txtQtyOnHand.setDisable(true);
txtUnitPrice.setDisable(true);
btnDelete.setDisable(true);
btnSave.setDisable(true);
loadAllItems();
tblItems.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ItemTM>() {
@Override
public void changed(ObservableValue<? extends ItemTM> observable, ItemTM oldValue, ItemTM newValue) {
ItemTM selectedItem = tblItems.getSelectionModel().getSelectedItem();
if (selectedItem == null) {
btnSave.setText("Save");
btnDelete.setDisable(true);
txtCode.clear();
txtDescription.clear();
txtQtyOnHand.clear();
txtUnitPrice.clear();
return;
}
btnSave.setText("Update");
btnSave.setDisable(false);
btnDelete.setDisable(false);
txtDescription.setDisable(false);
txtQtyOnHand.setDisable(false);
txtUnitPrice.setDisable(false);
txtCode.setText(selectedItem.getCode());
txtDescription.setText(selectedItem.getDescription());
txtQtyOnHand.setText(selectedItem.getQtyOnHand() + "");
txtUnitPrice.setText(selectedItem.getUnitPrice() + "");
}
});
}
private void loadAllItems() {
ObservableList<ItemTM> items = tblItems.getItems();
items.clear();
try {
items = FXCollections.observableArrayList(itemBO.getAllItems());
} catch (Exception e) {
e.printStackTrace();
}
tblItems.setItems(items);
}
@FXML
private void navigateToHome(MouseEvent event) throws IOException {
URL resource = this.getClass().getResource("/com/myorg/dummy/pos/view/MainForm.fxml");
Parent root = FXMLLoader.load(resource);
Scene scene = new Scene(root);
Stage primaryStage = (Stage) (this.root.getScene().getWindow());
primaryStage.setScene(scene);
primaryStage.centerOnScreen();
}
@FXML
private void btnSave_OnAction(ActionEvent event) {
if (txtDescription.getText().trim().isEmpty() ||
txtQtyOnHand.getText().trim().isEmpty() ||
txtUnitPrice.getText().trim().isEmpty()) {
new Alert(Alert.AlertType.ERROR, "Description, Qty. on Hand or Unit Price can't be empty").show();
return;
}
int qtyOnHand = Integer.parseInt(txtQtyOnHand.getText().trim());
double unitPrice = Double.parseDouble(txtUnitPrice.getText().trim());
if (qtyOnHand < 0 || unitPrice <= 0) {
new Alert(Alert.AlertType.ERROR, "Invalid Qty. or UnitPrice").show();
return;
}
if (btnSave.getText().equals("Save")) {
try {
itemBO.saveItem(txtCode.getText(), txtDescription.getText(), qtyOnHand, unitPrice);
btnAddNew_OnAction(event);
} catch (Exception e) {
e.printStackTrace();
new Alert(Alert.AlertType.ERROR, "Failed to save the item", ButtonType.OK).show();
}
} else {
ItemTM selectedItem = tblItems.getSelectionModel().getSelectedItem();
try {
itemBO.updateItem(txtDescription.getText(), qtyOnHand, unitPrice, selectedItem.getCode());
tblItems.refresh();
btnAddNew_OnAction(event);
} catch (Exception e) {
e.printStackTrace();
new Alert(Alert.AlertType.ERROR, "Failed to update the Item").show();
}
}
loadAllItems();
}
@FXML
private void btnDelete_OnAction(ActionEvent event) {
Alert alert = new Alert(Alert.AlertType.CONFIRMATION,
"Are you sure whether you want to delete this item?",
ButtonType.YES, ButtonType.NO);
Optional<ButtonType> buttonType = alert.showAndWait();
if (buttonType.get() == ButtonType.YES) {
ItemTM selectedItem = tblItems.getSelectionModel().getSelectedItem();
try {
itemBO.deleteItem(selectedItem.getCode());
tblItems.getItems().remove(selectedItem);
tblItems.getSelectionModel().clearSelection();
} catch (Exception e) {
e.printStackTrace();
new Alert(Alert.AlertType.ERROR, "Failed to delete the item", ButtonType.OK).show();
}
}
}
@FXML
private void btnAddNew_OnAction(ActionEvent actionEvent) {
txtCode.clear();
txtDescription.clear();
txtQtyOnHand.clear();
txtUnitPrice.clear();
tblItems.getSelectionModel().clearSelection();
txtDescription.setDisable(false);
txtQtyOnHand.setDisable(false);
txtUnitPrice.setDisable(false);
txtDescription.requestFocus();
btnSave.setDisable(false);
// Generate a new id
try {
txtCode.setText(itemBO.getNewItemCode());
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"charsad500@gmail.com"
] | charsad500@gmail.com |
b5804ce9c61242de1aba2ecc4ef2e63448fa0fe7 | 204cf84a2070e3078375e76b9f95e988bde8e18d | /src/main/java/com/saulomendes/workshopmongo/resources/UserResource.java | 35beaadf56b7a819295fea8ac3432bd49f440288 | [] | no_license | SauloMMota/workshop-spring-boot-mongodb | 47b8b269194e9d6ddc93095a8349be434c6d86fb | 54388666ceb62ca01a40a913a3dc3a7b4158470a | refs/heads/master | 2022-12-25T16:44:40.167785 | 2020-09-16T00:41:34 | 2020-09-16T00:41:34 | 293,951,046 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,527 | java | package com.saulomendes.workshopmongo.resources;
import java.net.URI;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import com.saulomendes.workshopmongo.domain.Post;
import com.saulomendes.workshopmongo.domain.User;
import com.saulomendes.workshopmongo.dto.UserDTO;
import com.saulomendes.workshopmongo.services.UserService;
@RestController
@RequestMapping(value="/users")
public class UserResource {
@Autowired
private UserService service;
@RequestMapping(method=RequestMethod.GET)
public ResponseEntity<List<UserDTO>> findAll() {
List<User> list = service.findAll();
List<UserDTO> listDto = list.stream().map(x -> new UserDTO(x)).collect(Collectors.toList());
return ResponseEntity.ok().body(listDto);
}
@RequestMapping(value="/{id}", method=RequestMethod.GET)
public ResponseEntity<UserDTO> findById(@PathVariable String id) {
User obj = service.findById(id);
return ResponseEntity.ok().body(new UserDTO(obj));
}
@RequestMapping(method=RequestMethod.POST)
public ResponseEntity<Void> insert(@RequestBody UserDTO objDto) {
User obj = service.fromDTO(objDto);
obj = service.insert(obj);
URI uri = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}").buildAndExpand(obj.getId()).toUri();
return ResponseEntity.created(uri).build();
}
@RequestMapping(value="/{id}", method=RequestMethod.DELETE)
public ResponseEntity<Void> delete(@PathVariable String id) {
service.delete(id);
return ResponseEntity.noContent().build();
}
@RequestMapping(value="/{id}", method=RequestMethod.PUT)
public ResponseEntity<Void> update(@RequestBody UserDTO objDto, @PathVariable String id) {
User obj = service.fromDTO(objDto);
obj.setId(id);
obj = service.update(obj);
return ResponseEntity.noContent().build();
}
@RequestMapping(value="/{id}/posts", method=RequestMethod.GET)
public ResponseEntity<List<Post>> findPosts(@PathVariable String id) {
User obj = service.findById(id);
return ResponseEntity.ok().body(obj.getPosts());
}
}
| [
"saulomendes_br@hotmail.com"
] | saulomendes_br@hotmail.com |
2df85dad2a2e66b81b905abe846ac010ad1314f5 | 5223a8e64af1c571b39dbf0319407d9727526cbd | /oims-core/src/main/java/com/wms/core/business/system/service/MerchantLogService.java | 6da2b6d8c9d70ceaaad016ce0d539df564e9a839 | [] | no_license | repo-upadhyay/oims | 32bb56e2837e00e28f79d66bf13b0b74a5c70ef5 | 57ac044e724fa7de8d412086659ebf731a1ef407 | refs/heads/master | 2020-03-31T02:27:31.810973 | 2016-06-26T19:08:23 | 2016-06-26T19:08:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | package com.wms.core.business.system.service;
import com.wms.core.business.generic.service.SalesManagerEntityService;
import com.wms.core.business.system.model.MerchantLog;
public interface MerchantLogService extends
SalesManagerEntityService<Long, MerchantLog> {
}
| [
"dilip.repo1@gmail.com"
] | dilip.repo1@gmail.com |
68094d57ab5249f9e51358a373d32f7527571a56 | 044a99192742cd01d2a3a884aecc5e81daeee032 | /Arduino/src/main/java/gov/ismonnet/arduino/netty/purejavacomm/PureJavaCommChannelOption.java | a5a40035fcf76ee36f0bec105b9e5cb2b5d78887 | [] | no_license | Furrrlo/Javino | f60e0771c909ea500bf385d72a06ba38b907788b | 6c4e9bdb8ea5a6928fec34181ab685649b6c3fff | refs/heads/master | 2020-09-16T21:11:46.247847 | 2019-11-29T15:55:22 | 2019-11-29T15:55:22 | 224,882,725 | 0 | 0 | null | 2019-11-29T15:53:31 | 2019-11-29T15:53:30 | null | UTF-8 | Java | false | false | 1,328 | java | package gov.ismonnet.arduino.netty.purejavacomm;
import gov.ismonnet.arduino.netty.purejavacomm.PureJavaCommChannelConfig.Baudrate;
import gov.ismonnet.arduino.netty.purejavacomm.PureJavaCommChannelConfig.Databits;
import gov.ismonnet.arduino.netty.purejavacomm.PureJavaCommChannelConfig.Paritybit;
import gov.ismonnet.arduino.netty.purejavacomm.PureJavaCommChannelConfig.Stopbits;
import io.netty.channel.ChannelOption;
/**
* Option for configuring a serial port connection
*/
public final class PureJavaCommChannelOption<T> extends ChannelOption<T> {
public static final ChannelOption<Baudrate> BAUD_RATE = valueOf(PureJavaCommChannelOption.class, "BAUD_RATE");
public static final ChannelOption<Databits> DATA_BITS = valueOf(PureJavaCommChannelOption.class, "DATA_BITS");
public static final ChannelOption<Stopbits> STOP_BITS = valueOf(PureJavaCommChannelOption.class, "STOP_BITS");
public static final ChannelOption<Paritybit> PARITY_BIT = valueOf(PureJavaCommChannelOption.class, "PARITY_BIT");
public static final ChannelOption<Integer> WAIT_TIME = valueOf(PureJavaCommChannelOption.class, "WAIT_TIME");
public static final ChannelOption<Integer> READ_TIMEOUT = valueOf(PureJavaCommChannelOption.class, "READ_TIMEOUT");
private PureJavaCommChannelOption() {
super(null);
}
}
| [
"ferlolovesnewmail@gmail.com"
] | ferlolovesnewmail@gmail.com |
bf5bbb5a31abb042442277cda0f48646021bd0f9 | 89904f6c80aab728d197f879b5a0167f7198ea96 | /integration-tests/reactive-messaging-rabbitmq-dyn/src/main/java/io/quarkus/it/rabbitmq/TestCredentialsProvider.java | 6ee393de8b0c393092392a848014d238ecb5e715 | [
"Apache-2.0"
] | permissive | loicmathieu/quarkus | 54b27952bbdbf16772ce52086bed13165a6c0aec | f29b28887af4b50e7484dd1faf252b15f1a9f61a | refs/heads/main | 2023-08-30T23:58:38.586507 | 2022-11-10T15:01:09 | 2022-11-10T15:01:09 | 187,598,844 | 3 | 1 | Apache-2.0 | 2023-03-02T20:56:56 | 2019-05-20T08:23:48 | Java | UTF-8 | Java | false | false | 934 | java | package io.quarkus.it.rabbitmq;
import java.time.Instant;
import java.util.Map;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import io.quarkus.credentials.CredentialsProvider;
@ApplicationScoped
@Named("test-creds-provider")
public class TestCredentialsProvider implements CredentialsProvider {
@ConfigProperty(name = "test-creds-provider.username")
String username;
@ConfigProperty(name = "test-creds-provider.password")
String password;
@Override
public Map<String, String> getCredentials(String credentialsProviderName) {
return Map.of(
CredentialsProvider.USER_PROPERTY_NAME, username,
CredentialsProvider.PASSWORD_PROPERTY_NAME, password,
CredentialsProvider.EXPIRATION_TIMESTAMP_PROPERTY_NAME, Instant.now().plusSeconds(90).toString());
}
}
| [
"kevin@wooten.com"
] | kevin@wooten.com |
e3f354ce2e4f6aeeb4886fd685030158e1d34bba | 0ff2ad68fd35e77401f89fb4abe34ba7a8c0959d | /src/main/java/net/rainmore/services/users/AccountRepository.java | c4074e7bd12171a302f6547e53c9f48606a1d32d | [] | no_license | rainmore/spring-boot-jpa-demo | 6521c0baa57b990000b33ff391fcd85e5d3617c4 | 5ef9f4396219bd148496cb3a4300b4f4b9fe8ed2 | refs/heads/master | 2021-01-20T00:48:21.811570 | 2017-04-24T03:17:02 | 2017-04-24T03:53:09 | 89,192,573 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 211 | java | package net.rainmore.services.users;
import net.rainmore.domains.users.Account;
import net.rainmore.services.GenericRepository;
public interface AccountRepository extends GenericRepository<Account, Long> {
}
| [
"rainmore24@gmail.com"
] | rainmore24@gmail.com |
eb51267785724888dcfa6b25b5feba6685863001 | 8f3739b54602a01f7dfe510e5f9cc57c90b13c19 | /src/picture_back/src/main/java/com/program/picture/common/exception/picture/PictureSelectFailException.java | 59cf8b8366551021f18fd3b110ba607c71dd82f4 | [] | no_license | Boyle-Coffee/SE_homework_picture | 8052a4f8f550ee35f89fb6bd5120835a978f7e46 | 4f68666494c05a26030ba3a2f1b53ed8e3bf2750 | refs/heads/main | 2023-01-15T16:56:47.113346 | 2020-11-30T14:56:17 | 2020-11-30T14:56:17 | 304,226,987 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 719 | java | package com.program.picture.common.exception.picture;
/**
* @program: picture
* @description:
* @author: Mr.Huang
* @create: 2020-11-10 22:13
**/
public class PictureSelectFailException extends RuntimeException {
/**
* 错误码
*/
protected Integer code;
protected String msg;
public Integer getCode() {
return code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
/**
* 有参构造器,返回码在枚举类中,这里可以指定错误信息
*
* @param msg
*/
public PictureSelectFailException(String msg) {
super(msg);
this.msg = msg;
}
}
| [
"570911275@qq.com"
] | 570911275@qq.com |
f9f25c633364c09f4f908a61b2494e11932a51f1 | 3f7a5d7c700199625ed2ab3250b939342abee9f1 | /src/gcom/batch/financeiro/TarefaBatchGerarLancamentosContabeisDevedoresDuvidosos.java | bbc663a7a38e893476e56c4a494cf156b8ba9928 | [] | no_license | prodigasistemas/gsan-caema | 490cecbd2a784693de422d3a2033967d8063204d | 87a472e07e608c557e471d555563d71c76a56ec5 | refs/heads/master | 2021-01-01T06:05:09.920120 | 2014-10-08T20:10:40 | 2014-10-08T20:10:40 | 24,958,220 | 1 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 5,201 | java | /*
* Copyright (C) 2007-2007 the GSAN - Sistema Integrado de Gestão de Serviços de Saneamento
*
* This file is part of GSAN, an integrated service management system for Sanitation
*
* GSAN is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*
* GSAN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/*
* GSAN - Sistema Integrado de Gestão de Serviços de Saneamento
* Copyright (C) <2007>
* Adriano Britto Siqueira
* Alexandre Santos Cabral
* Ana Carolina Alves Breda
* Ana Maria Andrade Cavalcante
* Aryed Lins de Araújo
* Bruno Leonardo Rodrigues Barros
* Carlos Elmano Rodrigues Ferreira
* Cláudio de Andrade Lira
* Denys Guimarães Guenes Tavares
* Eduardo Breckenfeld da Rosa Borges
* Fabíola Gomes de Araújo
* Flávio Leonardo Cavalcanti Cordeiro
* Francisco do Nascimento Júnior
* Homero Sampaio Cavalcanti
* Ivan Sérgio da Silva Júnior
* José Edmar de Siqueira
* José Thiago Tenório Lopes
* Kássia Regina Silvestre de Albuquerque
* Leonardo Luiz Vieira da Silva
* Márcio Roberto Batista da Silva
* Maria de Fátima Sampaio Leite
* Micaela Maria Coelho de Araújo
* Nelson Mendonça de Carvalho
* Newton Morais e Silva
* Pedro Alexandre Santos da Silva Filho
* Rafael Corrêa Lima e Silva
* Rafael Francisco Pinto
* Rafael Koury Monteiro
* Rafael Palermo de Araújo
* Raphael Veras Rossiter
* Roberto Sobreira Barbalho
* Rodrigo Avellar Silveira
* Rosana Carvalho Barbosa
* Sávio Luiz de Andrade Cavalcante
* Tai Mu Shih
* Thiago Augusto Souza do Nascimento
* Tiago Moreno Rodrigues
* Vivianne Barbosa Sousa
*
* Este programa é software livre; você pode redistribuí-lo e/ou
* modificá-lo sob os termos de Licença Pública Geral GNU, conforme
* publicada pela Free Software Foundation; versão 2 da
* Licença.
* Este programa é distribuído na expectativa de ser útil, mas SEM
* QUALQUER GARANTIA; sem mesmo a garantia implícita de
* COMERCIALIZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM
* PARTICULAR. Consulte a Licença Pública Geral GNU para obter mais
* detalhes.
* Você deve ter recebido uma cópia da Licença Pública Geral GNU
* junto com este programa; se não, escreva para Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*/
package gcom.batch.financeiro;
import gcom.seguranca.acesso.usuario.Usuario;
import gcom.tarefa.TarefaBatch;
import gcom.tarefa.TarefaException;
import gcom.util.ConstantesJNDI;
import gcom.util.ConstantesSistema;
import gcom.util.agendadortarefas.AgendadorTarefas;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/**
* @author pedro
*
*/
public class TarefaBatchGerarLancamentosContabeisDevedoresDuvidosos extends TarefaBatch {
private static final long serialVersionUID = 1L;
public TarefaBatchGerarLancamentosContabeisDevedoresDuvidosos(Usuario usuario,
int idFuncionalidadeIniciada) {
super(usuario, idFuncionalidadeIniciada);
}
@Deprecated
public TarefaBatchGerarLancamentosContabeisDevedoresDuvidosos() {
super(null, 0);
}
public Object executar() throws TarefaException {
// Se o sequencial de execucao do processo_funcionalidade for 1 ou o
// primeiro --> Registrar Processo Iniciado
List<Integer> colecaoIdsLocalidades = (List<Integer>) getParametro(ConstantesSistema.COLECAO_UNIDADES_PROCESSAMENTO_BATCH);
Collections.shuffle(colecaoIdsLocalidades);
Integer anoMesReferenciaContabil = (Integer) getParametro("anoMesReferenciaContabil");
Integer idTipoPerdaLancamentos = (Integer) getParametro("idTipoPerdaLancamentos");
Iterator iterator = colecaoIdsLocalidades.iterator();
while (iterator.hasNext()) {
Integer idLocalidade = (Integer) iterator.next();
enviarMensagemControladorBatch(
ConstantesJNDI.BATCH_GERAR_LANCAMENTOS_CONTABEIS_DEVEDORES_DUVIDOSOS_MDB,
new Object[] { anoMesReferenciaContabil,
idLocalidade,
idTipoPerdaLancamentos,
this.getIdFuncionalidadeIniciada() });
}
return null;
}
@Override
public Collection pesquisarTodasUnidadeProcessamentoBatch() {
return null;
}
@Override
public Collection pesquisarTodasUnidadeProcessamentoReinicioBatch() {
return null;
}
@Override
public void agendarTarefaBatch() {
AgendadorTarefas.agendarTarefa("GerarLancamentosContabeisDevedoresDuvidososBatch",
this);
}
}
| [
"felipesantos2089@gmail.com"
] | felipesantos2089@gmail.com |
1063c984db7672db755d557d5985c15cff9100be | 678a3d58c110afd1e9ce195d2f20b2531d45a2e0 | /sources/com/facebook/react/uimanager/ReactInvalidPropertyException.java | 247303a1c027a8f91a0e72b4872f22bda2f642ab | [] | no_license | jasonnth/AirCode | d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5 | d37db1baa493fca56f390c4205faf5c9bbe36604 | refs/heads/master | 2020-07-03T08:35:24.902940 | 2019-08-12T03:34:56 | 2019-08-12T03:34:56 | 201,842,970 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 329 | java | package com.facebook.react.uimanager;
public class ReactInvalidPropertyException extends RuntimeException {
public ReactInvalidPropertyException(String property, String value, String expectedValues) {
super("Invalid React property `" + property + "` with value `" + value + "`, expected " + expectedValues);
}
}
| [
"thanhhuu2apc@gmail.com"
] | thanhhuu2apc@gmail.com |
6bf4f78182e4b168a3b0a6e35312cea321570023 | 29f25e42eb77459725f80d9d403a428425c8546b | /src/main/java/rashjz/info/authentication/BasicAccessControl.java | fbe130f688a49ae4f6521a61cc8516294562472f | [] | no_license | rashjz/vaadin-crud | 95ac864a152ca5bae80c95168f9c70073126ddce | 5505c466c1f4d5142ffb9b4253185163043510d0 | refs/heads/master | 2021-01-23T07:55:18.251325 | 2017-02-16T10:44:08 | 2017-02-16T10:44:08 | 80,515,075 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,357 | java | package rashjz.info.authentication;
import rashjz.info.domain.Users;
import rashjz.info.jpa.UsersRepository;
import java.util.logging.Logger;
public class BasicAccessControl implements AccessControl {
private final static Logger logger = Logger.getLogger(BasicAccessControl.class.getName());
private UsersRepository repository;
public BasicAccessControl(UsersRepository repository) {
this.repository = repository;
}
@Override
public boolean signIn(String username, String password) {
if (username == null || username.isEmpty())
return false;
Users users = repository.findByUsernameAndPassword(username, password);
if (users == null)
return false;
logger.info(password + " " + username + " " + users);
CurrentUser.set(username);
return true;
}
@Override
public boolean isUserSignedIn() {
return !CurrentUser.get().isEmpty();
}
@Override
public boolean isUserInRole(String role) {
if ("admin".equals(role)) {
// Only the "admin" user is in the "admin" role
return getPrincipalName().equals("admin");
}
// All users are in all non-admin roles
return true;
}
@Override
public String getPrincipalName() {
return CurrentUser.get();
}
}
| [
"rashadjavad@gmail.com"
] | rashadjavad@gmail.com |
3f46829d1794df39fbc179f1f1fb47df480ea939 | 652dbbba9b83bcffa22b5104a755d07909285bc3 | /Project171/src/switch_commands/SwitchTo_frame_Using_Element_Reference.java | 808c11aed14d011040a760bd2dc6fbff8c585060 | [] | no_license | aj12mu/26th_Sep_9-30AM_2019 | a5b200c208c1e4199260930731f8969b5f01c529 | 9207f7c7fc344754e48b552ed89d8edcd2d68727 | refs/heads/master | 2022-04-02T00:06:30.682693 | 2019-12-17T05:29:38 | 2019-12-17T05:29:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,499 | java | package switch_commands;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class SwitchTo_frame_Using_Element_Reference
{
public static void main(String[] args) throws Exception
{
//Set Runtime Environment variable for browser driver
System.setProperty("webdriver.chrome.driver", "Browser_Drivers\\chromedriver.exe");
WebDriver driver=new ChromeDriver(); //Launch chrome browse
driver.get("https://www.redbus.in/hotels/"); //load webpage to browser window
driver.manage().window().maximize(); //maximize browser window
//Using javascript executor scroll page down
((JavascriptExecutor)driver).executeScript("scroll(100,200)");
Thread.sleep(3000);
//identifying location at webpage
WebElement Signin_btn=driver.findElement(By.xpath("//button[@class='login-btn'][contains(.,'Sign in')]"));
Signin_btn.click();
Thread.sleep(3000);
//Identify Frame at webpage and store frame Element into referal.
WebElement ModalFrame=driver.findElement(By.className("modalIframe"));
//Apply switch to frame using frame element reference
driver.switchTo().frame(ModalFrame);
WebElement Mobile_number=driver.findElement(By.xpath("//input[contains(@id,'mobileNoInp')]"));
Mobile_number.clear();
Mobile_number.sendKeys("9030248855");
}
}
| [
"Administrator@192.168.1.9"
] | Administrator@192.168.1.9 |
c9f671040ae59251f50c1d6acf69a175369afb27 | 76ea66c3988af71153058ebb8fceb06c1d33dc6b | /app/src/main/java/com/comorinland/deepak/milksubscription/Common/ProductInfo.java | d6d09a34a2a34f4faa19f31f3e2068a7907b2e32 | [] | no_license | deepakjd/MilkSubscription | 4d4262e0c60a98b7f52d9c6f3e6b067684d8feb3 | c654e53a50539640aab4a85a873709961a3a789a | refs/heads/master | 2020-06-06T10:21:21.741593 | 2019-06-19T10:43:11 | 2019-06-19T10:43:11 | 192,712,786 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 757 | java | package com.comorinland.deepak.milksubscription.Common;
public class ProductInfo
{
private String strProductName;
private String strProductDesc;
private int iPrice;
private String strImageName;
public ProductInfo(String strProductName, String strProductDesc, int price, String strImageName)
{
this.strProductName = strProductName;
this.strProductDesc = strProductDesc;
this.iPrice = price;
this.strImageName = strImageName;
}
public String getProductName() {
return strProductName;
}
public String getProductDesc() {
return strProductDesc;
}
public int getPrice() {return iPrice;}
public String getImageName() { return strImageName;}
}
| [
"deepak.joe.daniel@gmail.com"
] | deepak.joe.daniel@gmail.com |
f99e4b331fa45926ff3d5b00c41d2a5618ccaa52 | 74eb0753f1cdc4ee82e3a3a30e16f50c43501442 | /src/utilityClasses/CenteredText.java | 8241a32fc6ce0e3686af13a84d9ff3c91422dfe2 | [] | no_license | BinEP/NetworkConnect | 3cd8fc6df425261c6c4df08a54627bc7ee5521de | 8f1d5524bc9b06cb41678443deaac744f4d95b67 | refs/heads/master | 2021-01-01T19:01:19.985829 | 2015-03-26T17:26:48 | 2015-03-26T17:26:48 | 29,510,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,030 | java | package utilityClasses;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Rectangle;
/*
* this seems like an odd way to go about this.
* I'd expect something more like GuiUtil.centerText(String text, Graphics g).
* Or just use a JLabel and set its horizontal alignment.
*/
public class CenteredText {
public static void draw(String text, int yVal, Graphics g) {
int width = Window.WIDTH;
int height = Window.HEIGHT;
FontMetrics fontInfo = g.getFontMetrics();
int textWidth = fontInfo.stringWidth(text);
int textHeight = fontInfo.getHeight();
int x = (width - textWidth) / 2;
int y = (height - textHeight) / 2;
g.drawString(text, x, yVal);
}
public static void draw(String text, Rectangle r, Graphics g) {
FontMetrics fontInfo = g.getFontMetrics();
int textWidth = fontInfo.stringWidth(text);
int textHeight = fontInfo.getHeight();
int x = r.x + (r.width - textWidth) / 2;
int y = r.y + (r.height - textHeight) / 2;
g.drawString(text, x, y);
}
}
| [
"bradystoffel@gmail.com"
] | bradystoffel@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.