blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bf759670a9c3da30bc58f812928e075968fb3327 | 9e676ac07819d46603a4755cd8247a75d9f6b102 | /src/main/java/org/wicketTutorial/helloworld/model/UserModel.java | d7a1a4399417844c86762372f1193683e3800e9d | [] | no_license | CManig/WicketChoiceExample | 4231ed9f13b57f7031a4346c97d87947af21f3bb | 3c7063c876853e1582250f7a863c089e207006f4 | refs/heads/master | 2021-01-11T21:42:29.470607 | 2017-01-13T10:11:07 | 2017-01-13T10:11:07 | 78,837,586 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,374 | java | package org.wicketTutorial.helloworld.model;
import java.io.Serializable;
import java.util.List;
/**
* Represents the form fields of the user management page.
*
* @author cmanig
*/
public class UserModel implements Serializable{
/** serialVersionUID */
private static final long serialVersionUID = -6411316673601688928L;
/** The ID of the user. */
private int userID;
/** The first name of the user. */
private String firstname;
/** The last name of the user. */
private String lastname;
/** The phone number of the user. */
private String phoneNumber;
/** The username of the user. */
private String username;
/** The password of the user. */
private String password;
/** Salt for encrypting password. */
private String salt;
/** The e-mail address of the user. */
private String eMailaddress;
/** A flag which says the should change his password after first login. */
private boolean changePasswordForce;
/** The groups which belongs to the user. */
private List<Group> groups;
public int getUserID() {
return userID;
}
public void setUserID(int userID) {
this.userID = userID;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String nachName) {
this.lastname = nachName;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
public String geteMailaddress() {
return eMailaddress;
}
public void seteMailaddress(String eMailaddress) {
this.eMailaddress = eMailaddress;
}
public boolean isChangePasswordForce() {
return changePasswordForce;
}
public void setChangePasswordForce(boolean changePasswordForce) {
this.changePasswordForce = changePasswordForce;
}
public List<Group> getGroups() {
return groups;
}
public void setGroups(List<Group> groups) {
this.groups = groups;
}
}
| [
"[email protected]"
] | |
ca3ba12fe1c58fe3a18ee6a98f868469cb0fc2ec | 900e7d090a2e0d8c0f1da80fdf64a32e665d1d40 | /core/src/main/java/com/huitai/core/base/BaseIService.java | f330f0c302ee334dfdaa432a42c948aaa81f880d | [
"MIT"
] | permissive | 314863336/jeemes-base | cd68d62715e55153e25660f4b562e28d9f856ab7 | 22ff034f12f4aefeab4dea0f18fb2f7d7b9942a9 | refs/heads/main | 2023-06-16T20:27:02.351008 | 2021-07-16T05:27:20 | 2021-07-16T05:28:23 | 386,484,959 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,949 | java | /*
* Copyright (c) 2011-2020, baomidou ([email protected]).
* <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>
* https://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 com.huitai.core.base;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.toolkit.ChainWrappers;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.huitai.core.system.entity.HtSysUser;
import com.huitai.core.utils.AssignmentUtil;
import com.huitai.core.utils.UserUtil;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* description: 接口层基类 <br>
* version: 1.0 <br>
* date: 2020/5/27 9:05 <br>
* author: TYJ <br>
*/
public interface BaseIService<T> extends IService<T> {
/**
* 默认批次提交数量
*/
int DEFAULT_BATCH_SIZE = 1000;
/**
* 插入一条记录(选择字段,策略插入)
*
* @param entity 实体对象
*/
default boolean save(T entity) {
HtSysUser htSysUser = UserUtil.getCurUser();
AssignmentUtil.setBaseFields(htSysUser, entity);
return SqlHelper.retBool(getBaseMapper().insert(entity));
}
/**
* 插入(批量)
*
* @param entityList 实体对象集合
*/
@Transactional(rollbackFor = Exception.class)
default boolean saveBatch(Collection<T> entityList) {
HtSysUser htSysUser = UserUtil.getCurUser();
for(T entity : entityList){
if(entity != null){
AssignmentUtil.setBaseFields(htSysUser, entity);
}
}
return saveBatch(entityList, DEFAULT_BATCH_SIZE);
}
/**
* 插入(批量)
*
* @param entityList 实体对象集合
* @param batchSize 插入批次数量
*/
boolean saveBatch(Collection<T> entityList, int batchSize);
/**
* 批量修改插入
*
* @param entityList 实体对象集合
*/
@Transactional(rollbackFor = Exception.class)
default boolean saveOrUpdateBatch(Collection<T> entityList) {
return saveOrUpdateBatch(entityList, DEFAULT_BATCH_SIZE);
}
/**
* 批量修改插入
*
* @param entityList 实体对象集合
* @param batchSize 每次的数量
*/
boolean saveOrUpdateBatch(Collection<T> entityList, int batchSize);
/**
* 根据 ID 删除
*
* @param id 主键ID
*/
default boolean removeById(Serializable id) {
return SqlHelper.retBool(getBaseMapper().deleteById(id));
}
/**
* 根据 columnMap 条件,删除记录
*
* @param columnMap 表字段 map 对象
*/
default boolean removeByMap(Map<String, Object> columnMap) {
Assert.notEmpty(columnMap, "error: columnMap must not be empty");
return SqlHelper.retBool(getBaseMapper().deleteByMap(columnMap));
}
/**
* 根据 entity 条件,删除记录
*
* @param queryWrapper 实体包装类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
*/
default boolean remove(Wrapper<T> queryWrapper) {
return SqlHelper.retBool(getBaseMapper().delete(queryWrapper));
}
/**
* 删除(根据ID 批量删除)
*
* @param idList 主键ID列表
*/
default boolean removeByIds(Collection<? extends Serializable> idList) {
if (CollectionUtils.isEmpty(idList)) {
return false;
}
return SqlHelper.retBool(getBaseMapper().deleteBatchIds(idList));
}
/**
* 根据 ID 选择修改
*
* @param entity 实体对象
*/
default boolean updateById(T entity) {
AssignmentUtil.setUpdateFields(entity);
return SqlHelper.retBool(getBaseMapper().updateById(entity));
}
/**
* 根据 UpdateWrapper 条件,更新记录 需要设置sqlset
*
* @param updateWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper}
*/
default boolean update(Wrapper<T> updateWrapper) {
return update(null, updateWrapper);
}
/**
* 根据 whereEntity 条件,更新记录
*
* @param entity 实体对象
* @param updateWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper}
*/
default boolean update(T entity, Wrapper<T> updateWrapper) {
return SqlHelper.retBool(getBaseMapper().update(entity, updateWrapper));
}
/**
* 根据ID 批量更新
*
* @param entityList 实体对象集合
*/
@Transactional(rollbackFor = Exception.class)
default boolean updateBatchById(Collection<T> entityList) {
return updateBatchById(entityList, DEFAULT_BATCH_SIZE);
}
/**
* 根据ID 批量更新
*
* @param entityList 实体对象集合
* @param batchSize 更新批次数量
*/
boolean updateBatchById(Collection<T> entityList, int batchSize);
/**
* TableId 注解存在更新记录,否插入一条记录
*
* @param entity 实体对象
*/
boolean saveOrUpdate(T entity);
/**
* 根据 ID 查询
*
* @param id 主键ID
*/
default T getById(Serializable id) {
return getBaseMapper().selectById(id);
}
/**
* 查询(根据ID 批量查询)
*
* @param idList 主键ID列表
*/
default List<T> listByIds(Collection<? extends Serializable> idList) {
return getBaseMapper().selectBatchIds(idList);
}
/**
* 查询(根据 columnMap 条件)
*
* @param columnMap 表字段 map 对象
*/
default List<T> listByMap(Map<String, Object> columnMap) {
return getBaseMapper().selectByMap(columnMap);
}
/**
* 根据 Wrapper,查询一条记录 <br/>
* <p>结果集,如果是多个会抛出异常,随机取一条加上限制条件 wrapper.last("LIMIT 1")</p>
*
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
*/
default T getOne(Wrapper<T> queryWrapper) {
return getOne(queryWrapper, true);
}
/**
* 根据 Wrapper,查询一条记录
*
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
* @param throwEx 有多个 result 是否抛出异常
*/
T getOne(Wrapper<T> queryWrapper, boolean throwEx);
/**
* 根据 Wrapper,查询一条记录
*
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
*/
Map<String, Object> getMap(Wrapper<T> queryWrapper);
/**
* 根据 Wrapper,查询一条记录
*
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
* @param mapper 转换函数
*/
<V> V getObj(Wrapper<T> queryWrapper, Function<? super Object, V> mapper);
/**
* 查询总记录数
*
* @see Wrappers#emptyWrapper()
*/
default int count() {
return count(Wrappers.emptyWrapper());
}
/**
* 根据 Wrapper 条件,查询总记录数
*
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
*/
default int count(Wrapper<T> queryWrapper) {
return SqlHelper.retCount(getBaseMapper().selectCount(queryWrapper));
}
/**
* 查询列表
*
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
*/
default List<T> list(Wrapper<T> queryWrapper) {
return getBaseMapper().selectList(queryWrapper);
}
/**
* 查询所有
*
* @see Wrappers#emptyWrapper()
*/
default List<T> list() {
return list(Wrappers.emptyWrapper());
}
/**
* 翻页查询
*
* @param page 翻页对象
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
*/
default <E extends IPage<T>> E page(E page, Wrapper<T> queryWrapper) {
return getBaseMapper().selectPage(page, queryWrapper);
}
/**
* 无条件翻页查询
*
* @param page 翻页对象
* @see Wrappers#emptyWrapper()
*/
default <E extends IPage<T>> E page(E page) {
return page(page, Wrappers.emptyWrapper());
}
/**
* 查询列表
*
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
*/
default List<Map<String, Object>> listMaps(Wrapper<T> queryWrapper) {
return getBaseMapper().selectMaps(queryWrapper);
}
/**
* 查询所有列表
*
* @see Wrappers#emptyWrapper()
*/
default List<Map<String, Object>> listMaps() {
return listMaps(Wrappers.emptyWrapper());
}
/**
* 查询全部记录
*/
default List<Object> listObjs() {
return listObjs(Function.identity());
}
/**
* 查询全部记录
*
* @param mapper 转换函数
*/
default <V> List<V> listObjs(Function<? super Object, V> mapper) {
return listObjs(Wrappers.emptyWrapper(), mapper);
}
/**
* 根据 Wrapper 条件,查询全部记录
*
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
*/
default List<Object> listObjs(Wrapper<T> queryWrapper) {
return listObjs(queryWrapper, Function.identity());
}
/**
* 根据 Wrapper 条件,查询全部记录
*
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
* @param mapper 转换函数
*/
default <V> List<V> listObjs(Wrapper<T> queryWrapper, Function<? super Object, V> mapper) {
return getBaseMapper().selectObjs(queryWrapper).stream().filter(Objects::nonNull).map(mapper).collect(Collectors.toList());
}
/**
* 翻页查询
*
* @param page 翻页对象
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
*/
default <E extends IPage<Map<String, Object>>> E pageMaps(E page, Wrapper<T> queryWrapper) {
return getBaseMapper().selectMapsPage(page, queryWrapper);
}
/**
* 无条件翻页查询
*
* @param page 翻页对象
* @see Wrappers#emptyWrapper()
*/
default <E extends IPage<Map<String, Object>>> E pageMaps(E page) {
return pageMaps(page, Wrappers.emptyWrapper());
}
/**
* 获取对应 entity 的 BaseMapper
*
* @return BaseMapper
*/
BaseMapper<T> getBaseMapper();
/**
* 以下的方法使用介绍:
*
* 一. 名称介绍
* 1. 方法名带有 query 的为对数据的查询操作, 方法名带有 update 的为对数据的修改操作
* 2. 方法名带有 lambda 的为内部方法入参 column 支持函数式的
*
* 二. 支持介绍
* 1. 方法名带有 query 的支持以 {@link ChainQuery} 内部的方法名结尾进行数据查询操作
* 2. 方法名带有 update 的支持以 {@link ChainUpdate} 内部的方法名为结尾进行数据修改操作
*
* 三. 使用示例,只用不带 lambda 的方法各展示一个例子,其他类推
* 1. 根据条件获取一条数据: `query().eq("column", value).one()`
* 2. 根据条件删除一条数据: `update().eq("column", value).remove()`
*
*/
/**
* 链式查询 普通
*
* @return QueryWrapper 的包装类
*/
default QueryChainWrapper<T> query() {
return ChainWrappers.queryChain(getBaseMapper());
}
/**
* 链式查询 lambda 式
* <p>注意:不支持 Kotlin </p>
*
* @return LambdaQueryWrapper 的包装类
*/
default LambdaQueryChainWrapper<T> lambdaQuery() {
return ChainWrappers.lambdaQueryChain(getBaseMapper());
}
/**
* 链式更改 普通
*
* @return UpdateWrapper 的包装类
*/
default UpdateChainWrapper<T> update() {
return ChainWrappers.updateChain(getBaseMapper());
}
/**
* 链式更改 lambda 式
* <p>注意:不支持 Kotlin </p>
*
* @return LambdaUpdateWrapper 的包装类
*/
default LambdaUpdateChainWrapper<T> lambdaUpdate() {
return ChainWrappers.lambdaUpdateChain(getBaseMapper());
}
/**
* <p>
* 根据updateWrapper尝试更新,否继续执行saveOrUpdate(T)方法
* 此次修改主要是减少了此项业务代码的代码量(存在性验证之后的saveOrUpdate操作)
* </p>
*
* @param entity 实体对象
*/
default boolean saveOrUpdate(T entity, Wrapper<T> updateWrapper) {
return update(entity, updateWrapper) || saveOrUpdate(entity);
}
}
| [
"[email protected]"
] | |
bc99a0af121ef86ee88b34f66e830530fb99c2dc | 0c330497a79fee531cfb83a7da89edc27dddec3a | /tahiti/src/main/java/com/sun/tahiti/grammar/Accessor.java | 187abb0aae4c0dc13095d0630e588df81c63fb25 | [] | permissive | xmlark/msv | 63dfd17d9b635eb00c97a28d3529fdaaef698a65 | b9316e2f2270bc1606952ea4939ec87fbba157f3 | refs/heads/main | 2023-08-31T23:39:38.529130 | 2023-03-03T16:22:12 | 2023-03-03T17:49:32 | 216,036,776 | 18 | 9 | MIT | 2023-08-17T07:52:18 | 2019-10-18T14:01:35 | Java | UTF-8 | Java | false | false | 1,166 | java | /*
* @(#)$Id$
*
* Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the proprietary information of Sun Microsystems, Inc.
* Use is subject to license terms.
*
*/
package com.sun.tahiti.grammar;
/**
*
*
* @author
* <a href="mailto:[email protected]">Kohsuke KAWAGUCHI</a>
*/
public class Accessor {
/**
* no need to create an instance.
* Use pre-defined values.
*/
private Accessor() {}
public static Accessor field = new Accessor();
public static Accessor readOnly = new Accessor();
public static Accessor readWrite = new Accessor();
/** gets the default accessor. */
public static Accessor getDefault() {
return readWrite;
}
/**
* parses the string representation of the accessor
* and returns one of the predefined value.
*
* @return
* If the value is not recognized, return null.
*/
public static Accessor parse( String value ) {
value = value.trim();
if(value.equalsIgnoreCase("field")) return field;
if(value.equalsIgnoreCase("readOnly")) return readOnly;
if(value.equalsIgnoreCase("readWrite")) return readWrite;
return null; // unrecognized
}
}
| [
"Bear@8cecbe3e-ef64-0410-a610-ece5afc49ac1"
] | Bear@8cecbe3e-ef64-0410-a610-ece5afc49ac1 |
eb1e42bf394da6684ff3782a62e254dc76d71575 | 23e56b22bd445e0906fc921a52ad1834bcbca0b3 | /src/de/willuhn/jameica/fibu/gui/views/GeschaeftsjahrNeu.java | d3ce3d91e9bfd05e9e789bc3286b68ffb343971e | [] | no_license | adrzei/syntax | f92cc1cb53da4c95c292d599be3ed859705e9805 | e8388c02ce610366f32a0d570c45ad901c10c14d | refs/heads/master | 2021-01-18T00:39:34.475275 | 2015-03-18T21:47:09 | 2015-03-18T21:47:09 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 4,328 | java | /**********************************************************************
* $Source: /cvsroot/syntax/syntax/src/de/willuhn/jameica/fibu/gui/views/GeschaeftsjahrNeu.java,v $
* $Revision: 1.13 $
* $Date: 2011/05/12 09:10:31 $
* $Author: willuhn $
* $Locker: $
* $State: Exp $
*
* Copyright (c) by willuhn.webdesign
* All rights reserved
*
**********************************************************************/
package de.willuhn.jameica.fibu.gui.views;
import de.willuhn.jameica.fibu.Fibu;
import de.willuhn.jameica.fibu.Settings;
import de.willuhn.jameica.fibu.gui.action.GeschaeftsjahrClose;
import de.willuhn.jameica.fibu.gui.action.GeschaeftsjahrDelete;
import de.willuhn.jameica.fibu.gui.controller.GeschaeftsjahrControl;
import de.willuhn.jameica.fibu.rmi.Geschaeftsjahr;
import de.willuhn.jameica.gui.AbstractView;
import de.willuhn.jameica.gui.Action;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.jameica.gui.parts.Button;
import de.willuhn.jameica.gui.parts.ButtonArea;
import de.willuhn.jameica.gui.util.Container;
import de.willuhn.jameica.gui.util.SimpleContainer;
import de.willuhn.jameica.system.Application;
import de.willuhn.util.ApplicationException;
import de.willuhn.util.I18N;
/**
* View zum Bearbeiten eines Geschaeftsjahres.
*/
public class GeschaeftsjahrNeu extends AbstractView
{
private final static I18N i18n = Application.getPluginLoader().getPlugin(Fibu.class).getResources().getI18N();
/**
* @see de.willuhn.jameica.gui.AbstractView#bind()
*/
public void bind() throws Exception
{
GUI.getView().setTitle(i18n.tr("Geschäftsjahr bearbeiten"));
final GeschaeftsjahrControl control = new GeschaeftsjahrControl(this);
Container group = new SimpleContainer(getParent());
group.addHeadline(i18n.tr("Eigenschaften"));
group.addLabelPair(i18n.tr("Kontenrahmen"), control.getKontenrahmenAuswahl());
group.addLabelPair(i18n.tr("Beginn des Geschäftsjahres"),control.getBeginn());
group.addLabelPair(i18n.tr("Ende des Geschäftsjahres"),control.getEnde());
ButtonArea buttonArea = new ButtonArea();
boolean canDelete = true;
Geschaeftsjahr current = Settings.getActiveGeschaeftsjahr();
if (current != null) canDelete = !current.equals(control.getGeschaeftsjahr());
Button delete = new Button(i18n.tr("Löschen"),new GeschaeftsjahrDelete(),getCurrentObject(),false,"user-trash-full.png");
delete.setEnabled(canDelete);
buttonArea.addButton(delete);
Button close = new Button(i18n.tr("Geschäftsjahr abschließen"), new GeschaeftsjahrClose(), control.getCurrentObject(),false,"go-next.png");
close.setEnabled(!control.getGeschaeftsjahr().isNewObject() && !control.getGeschaeftsjahr().isClosed());
buttonArea.addButton(close);
Button store = new Button(i18n.tr("Speichern"), new Action()
{
public void handleAction(Object context) throws ApplicationException
{
control.handleStore();
}
},null,true,"document-save.png");
store.setEnabled(!control.getGeschaeftsjahr().isClosed());
buttonArea.addButton(store);
buttonArea.paint(getParent());
}
}
/*********************************************************************
* $Log: GeschaeftsjahrNeu.java,v $
* Revision 1.13 2011/05/12 09:10:31 willuhn
* @R Back-Buttons entfernt
* @C GUI-Cleanup
*
* Revision 1.12 2010-06-04 00:33:56 willuhn
* @B Debugging
* @N Mehr Icons
* @C GUI-Cleanup
*
* Revision 1.11 2010/06/03 14:26:16 willuhn
* @N Extension zum Zuordnen von Hibiscus-Kategorien zu SynTAX-Buchungsvorlagen
* @C Code-Cleanup
*
* Revision 1.10 2010/06/02 00:02:58 willuhn
* @N Mehr Icons
*
* Revision 1.9 2010/06/01 23:51:56 willuhn
* @N Neue Icons - erster Teil
*
* Revision 1.8 2010/06/01 16:37:22 willuhn
* @C Konstanten von Fibu zu Settings verschoben
* @N Systemkontenrahmen nach expliziter Freigabe in den Einstellungen aenderbar
* @C Unterscheidung zwischen canChange und isUserObject in UserObject
* @C Code-Cleanup
* @R alte CVS-Logs entfernt
*
* Revision 1.7 2009/07/03 10:52:18 willuhn
* @N Merged SYNTAX_1_3_BRANCH into HEAD
*
* Revision 1.6.2.1 2008/09/08 09:03:51 willuhn
* @C aktiver Mandant/aktives Geschaeftsjahr kann nicht mehr geloescht werden
**********************************************************************/ | [
"willuhn"
] | willuhn |
7e7f95dad7508a42a71ed0ccddfb2c06c70db634 | a9720788513f9e67df95582da453ca899c2f8760 | /src/sudoku/makesure.java | 51a00ca6274147a2371f5c0364e540ee52ad8ed2 | [] | no_license | HeshamSalama/Sudoku-Solution-Validator | 5f10fdc897337ed44fb0fa4c777c43d069f9c2b5 | ad78e07b1fc4e2d8ca706eebbd437e53449ddc6d | refs/heads/master | 2021-01-12T06:37:39.916418 | 2017-02-09T06:42:02 | 2017-02-09T06:42:02 | 77,398,836 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,354 | java | package sudoku;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
/*screen oif you clicked on exit symbol "save - discard -cancel"*/
public class makesure extends JFrame{
private JPanel panel;
private JLabel lab;
private JButton btn1;
private JButton btn2;
private JButton btn3;
public makesure(){
setUndecorated(true);
setVisible(true);
Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
int Width = (int) ((dimension.getWidth() - getWidth()) / 3.4);
int Height = (int) ((dimension.getHeight() - getHeight()) / 3.9);
setLocation(Width, Height);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(500, 250);
panel = new JPanel();
panel.setLayout(null);
panel.setBackground(new Color(139, 69, 19));
add(panel);
validate();
panel.setBounds(0, 0, 500, 250);
btn1=new JButton("Save");
btn2=new JButton("Discard");
btn3=new JButton("Cancel");
lab=new JLabel("Do you want to save?");
btn1.setBackground(Color.WHITE);
btn2.setBackground(Color.WHITE);
btn3.setBackground(Color.WHITE);
lab.setFont(new Font ("Arial",Font.BOLD,25));
btn1.setForeground(new Color(139, 69, 19));
btn2.setForeground(new Color(139, 69, 19));
btn3.setForeground(new Color(139, 69, 19));
lab.setForeground(Color.WHITE);
panel.add(btn1);
panel.add(btn2);
panel.add(btn3);
panel.add(lab);
btn1.setFont(new Font("Arial", Font.BOLD, 25));
btn2.setFont(new Font("Arial", Font.BOLD, 25));
btn3.setFont(new Font("Arial", Font.BOLD, 25));
btn1.setBounds(10, 150, 150, 50);
btn2.setBounds(170, 150, 150, 50);
btn3.setBounds(330, 150, 150, 50);
lab.setBounds(100, 50, 450, 50);
btn1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
btn2.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
BufferedWriter bw=new BufferedWriter(new FileWriter("save.txt"));
bw.write("empty");
bw.close();
System.exit(0);
} catch (IOException ex) {
}
}
});
btn3.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setVisible(false);
try {
BufferedWriter bw=new BufferedWriter(new FileWriter("save.txt"));
bw.write("empty");
bw.close();
} catch (IOException ex) {
}
}
});
}
}
| [
"[email protected]"
] | |
cc36b39c646aedb4043b461b5e4ec1694933fe89 | df834c072953080298bdbe1039908d169e6e1be3 | /每日温度.java | 84714fe811e18b4e4628a10049266a3fafb4d9a4 | [] | no_license | Xjint/leetcode | d38ef2de28343fc13f073b92a93b6805e228d0ed | 53416c80af5bda0b203742099662dc913b2ac75a | refs/heads/master | 2021-11-24T01:56:11.092875 | 2021-10-09T03:35:45 | 2021-10-09T03:35:45 | 220,732,714 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 936 | java | import java.util.Stack;
public class 每日温度 {
/*
* 依次将每日温度的索引存入栈中,直到某一天的温度大于栈顶元素索引所对应的温度,取出栈顶元素
*
* 栈中的索引对应的值是递减的,也就是栈顶索引对应的是截止到这一天为止最小的温度*/
public int[] dailyTemperatures(int[] T) {
int[] ans = new int[T.length];
Stack<Integer> stack = new Stack<>();
for (int i = 0; i < T.length; i++) {
while (!stack.isEmpty() && T[i] > T[stack.peek()]) {
int index = stack.pop();
ans[index] = i - index;
}
stack.push(i);
}
return ans;
}
public static void main(String[] args) {
for (int n : new 每日温度().dailyTemperatures(new int[]{73, 74, 75, 71, 69, 72, 76, 73})) {
System.out.print(n + "\t");
}
}
} | [
"jintao,[email protected]"
] | jintao,[email protected] |
2041eee6eeb8344bd43c3c0163d94a1497fde44a | f2d46c873aa331fe8a8e46e316a05d9d5d0f0e28 | /BitShiftL.java | d4708cfd106cd61caf4ae99e9aaaf204b2456b01 | [] | no_license | schibel50/VLT_FINAL | f87dca153df37b8635e4c0c5d4c8eb725c5c2ec9 | 80401a326f0ae3163ed99c19b5d140ceb8fe14fb | refs/heads/master | 2021-01-18T07:32:56.907545 | 2017-03-30T18:38:42 | 2017-03-30T18:38:42 | 84,291,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 393 | java | package vlt;
/**
* This class represents a Bit Shift Left part
* See Part class for further details
*
* @author Parker
*/
public class BitShiftL extends Part{
public int amount;
public BitShiftL(String name, int amount){
super(name);
this.amount = amount;
ports.add(new Port("in",this));
ports.add(new Port("out",this));
}
}
| [
"[email protected]"
] | |
3af28cb44f9f1fff5e930e2c239fbc8b33b0d36c | 439874522c15194dbf83b63ccdfefeee217ab3c5 | /plugins/kotlin/compiler-reference-index/tests/testData/compilerIndex/classOrObject/companion/Instance.java | 8ad913fceed22cbef81ca732e387b57b3996148d | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | jbeckers/intellij-community | c473f51026be1ffcdd5979c6e750274133b2b847 | 37e4976327f5f5b595a4d20192482f966c9683b6 | refs/heads/master | 2023-04-29T11:21:10.165921 | 2023-02-16T07:10:25 | 2023-02-16T07:35:15 | 62,625,846 | 1 | 0 | Apache-2.0 | 2021-03-18T16:36:09 | 2016-07-05T09:59:44 | null | UTF-8 | Java | false | false | 79 | java | class Instance {
void main() {
new MainClass.Companion.T();
}
} | [
"[email protected]"
] | |
f9197d2ad026da40c06599751f63de3377826cfd | 84e43c38bfb10bde9075153d11770180d78f22f1 | /src/main/java/com/cdsadmin/business/config/package-info.java | 11400b0247bb06dcbecd888cdaecbbf809961b64 | [] | no_license | mphasisfhlmvp/cds-admin-business-service | f8f64b13de87b27424358e76c3d4246605897bac | 630f10a8610c7857f2cf54d3344a830e2f62fb9f | refs/heads/master | 2021-07-06T09:59:34.704276 | 2020-01-13T00:45:09 | 2020-01-13T00:45:09 | 233,482,715 | 0 | 1 | null | 2021-05-06T19:20:46 | 2020-01-13T00:52:31 | null | UTF-8 | Java | false | false | 87 | java | /**
* Spring Framework configuration files.
*/
package com.cdsadmin.business.config;
| [
"[email protected]"
] | |
ecb065b0ce460e0de0db8c4eab9bcc770e318c3b | d14261a67c4c4efaf8121e60b54a9d2f4bd1059d | /src/main/java/Animal.java | c13c2fb91d85544497797ec99b05c60584cf30c7 | [] | no_license | Lufunomadima/Animals-part1 | e489f29c67ccbd2925007a3bda8c48307a683de6 | b4514dc717745fd60deca4ed0896ca91f733d542 | refs/heads/master | 2021-01-02T02:48:18.647239 | 2020-02-11T11:55:29 | 2020-02-11T11:55:29 | 239,459,128 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 295 | java | public class Animal {
private String name;
public String sound(){
return "Barks";
}
public String eat(){
return "Food";
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"[email protected]"
] | |
bd1b0db77c6efeb6ba04c1a4a966cd6c5c396563 | 255494357301b5f0f187103dd791cdf4199642c5 | /tms/app/src/main/java/com/coderbd/tms/pushnotification/Config.java | a16bfa80214927e36009406e8cff16660c0c81fb | [] | no_license | springapidev/android | 9f1e03d8192158804a5b58e96d2a67c624595751 | b330991e91b906e16dffa3135f3da5b24106750e | refs/heads/master | 2022-02-16T18:48:33.797401 | 2019-08-08T12:51:50 | 2019-08-08T12:51:50 | 104,208,108 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 610 | java | package com.coderbd.tms.pushnotification;
public class Config {
// global topic to receive app wide push notifications
public static final String TOPIC_GLOBAL = "global";
// broadcast receiver intent filters
public static final String REGISTRATION_COMPLETE = "registrationComplete";
public static final String PUSH_NOTIFICATION = "pushNotification";
// id to handle the notification in the notification tray
public static final int NOTIFICATION_ID = 100;
public static final int NOTIFICATION_ID_BIG_IMAGE = 101;
public static final String SHARED_PREF = "ah_firebase";
}
| [
"[email protected]"
] | |
d8753b0bccf9d8bd3da234402bda8e773dbeda10 | 31e646d8b2c8ebccd93a8da17ae482aaf9d7827f | /src/main/java/com/stoneskies/feudalism/Util/TownyTabCompleters.java | 67fc418d8c4d309ab769de18656e9aeab577cade | [
"MIT"
] | permissive | Stoneskies/Feudalism-OLD | 3322bad8ff82183a25bb9014e8233d097847efe8 | e4f27dcc710c2df65692f02efb1029f1bfdfc96a | refs/heads/master | 2022-12-31T16:57:38.270608 | 2020-10-20T23:51:25 | 2020-10-20T23:51:25 | 302,928,402 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,096 | java | package com.stoneskies.feudalism.Util;
import com.palmergames.bukkit.towny.TownyUniverse;
import com.palmergames.bukkit.towny.utils.NameUtil;
import java.util.ArrayList;
import java.util.List;
public class TownyTabCompleters {
public static List<String> getTownyStartingWith(String arg, String type) {
List<String> matches = new ArrayList<>();
TownyUniverse townyUniverse = TownyUniverse.getInstance();
if (type.contains("r")) {
matches.addAll(townyUniverse.getResidentsTrie().getStringsFromKey(arg));
}
if (type.contains("t")) {
matches.addAll(townyUniverse.getTownsTrie().getStringsFromKey(arg));
}
if (type.contains("n")) {
matches.addAll(townyUniverse.getNationsTrie().getStringsFromKey(arg));
}
if (type.contains("w")) { // There aren't many worlds so check even if arg is empty
matches.addAll(NameUtil.filterByStart(NameUtil.getNames(townyUniverse.getWorldMap().values()), arg));
}
return matches;
}
}
| [
"[email protected]"
] | |
97feb21c9bf40dc484ee6e8a291ec48651385574 | d05282cc56bbd8f803996d34a8ea0158f3a8a033 | /app/src/main/java/com/example/Metalls.java | 8ad53333464909bf301c4e9154a28a07fbec3ade | [] | no_license | grind1122/TimeMet_Progect-master | bbf3bdd5cbc4386573eb0a90c91e0b03cbb5ad47 | c502ec1b851270175a22d54e2c752e7fbdea3f83 | refs/heads/master | 2020-04-07T17:05:36.728184 | 2018-11-21T13:44:59 | 2018-11-21T13:44:59 | 158,556,288 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,606 | java | //package com.example;
//
//import java.util.ArrayList;
//import java.util.List;
//
//public class Metalls {
// private String name;
// private String cost;
// private int imageResources;
// private String description;
//
// public String getName() {
// return name;
// }
//
// public String getCost() {
// return cost;
// }
//
// public String getDescription() {
// return description;
// }
//
// public int getImageResources() {
// return imageResources;
// }
//
// public Metalls(String name, String cost, String description, int imageResources) {
// this.name = name;
// this.cost = cost;
// this.description = description;
// this.imageResources = imageResources;
// }
// public static List<Metalls> getMetallsForCardView(){
// List<Metalls> list = new ArrayList<>();
// list.add(new Metalls("Категория металла - 3A", "От 17500 руб/тонна...",
// "3А - исключительно стальной лом. Максимальные размеры 1,6х0,5х0,6 м. Масса куска должна находится в диапазоне от 1 до 600 кг. Также к этой категории относятся трубы диаметром не более 150 мм со стенкой от 4 мм. Трубы необходимо разрезать вдоль и сплющить.", R.drawable.a_3));
// list.add(new Metalls("Категория металла - 5A","От 17200 руб/тонна...",
// "5А, 5Б - соответственно стальной и легированный лом. Негабаритные куски массой до 5 кг. Включает в себя стальной скрап.",R.drawable.a_5));
// list.add(new Metalls("Категория металла - 12A", "От 16800 руб/тонна...",
// "12А - бытовой и промышленный лом. Фасуется в пакеты массой не более 40 кг. Нет ограничения по габаритам.",R.drawable.a_12));
// list.add(new Metalls("Категория металла - 16A", "От 14000 руб/тонна...",
// "16А - марка лома черных металлов, имеющая форму вьюнообразной стружки. Подразумевается последующая переплавка в печах. Нет ограничения по весу.", R.drawable.a_16));
// return list;
// }
//}
| [
"[email protected]"
] | |
bdb9bff6f6305995ee3fdc912ed880b6f10cf434 | 6157cf000d8f95aae180288059ce892ff84edfa4 | /src/main/java/com/cazen/iti/web/rest/UpQuestionMasterResource.java | 969aebef84a7a1353cb3a9b51032d76f177b7443 | [] | no_license | Cazen/itinterview | c852383d21a732fbb7eedc5d94d1596d621c9102 | e1a82964ca57f653c71a89a0228862a0e6c7cc5b | refs/heads/master | 2020-12-24T10:24:06.861668 | 2017-02-09T07:01:52 | 2017-02-09T07:01:52 | 73,084,508 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,770 | java | package com.cazen.iti.web.rest;
import com.codahale.metrics.annotation.Timed;
import com.cazen.iti.domain.UpQuestionMaster;
import com.cazen.iti.service.UpQuestionMasterService;
import com.cazen.iti.web.rest.util.HeaderUtil;
import com.cazen.iti.web.rest.util.PaginationUtil;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.inject.Inject;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;
/**
* REST controller for managing UpQuestionMaster.
*/
@RestController
@RequestMapping("/api")
public class UpQuestionMasterResource {
private final Logger log = LoggerFactory.getLogger(UpQuestionMasterResource.class);
@Inject
private UpQuestionMasterService upQuestionMasterService;
/**
* POST /up-question-masters : Create a new upQuestionMaster.
*
* @param upQuestionMaster the upQuestionMaster to create
* @return the ResponseEntity with status 201 (Created) and with body the new upQuestionMaster, or with status 400 (Bad Request) if the upQuestionMaster has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/up-question-masters")
@Timed
public ResponseEntity<UpQuestionMaster> createUpQuestionMaster(@RequestBody UpQuestionMaster upQuestionMaster) throws URISyntaxException {
log.debug("REST request to save UpQuestionMaster : {}", upQuestionMaster);
if (upQuestionMaster.getId() != null) {
return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert("upQuestionMaster", "idexists", "A new upQuestionMaster cannot already have an ID")).body(null);
}
UpQuestionMaster result = upQuestionMasterService.save(upQuestionMaster);
return ResponseEntity.created(new URI("/api/up-question-masters/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert("upQuestionMaster", result.getId().toString()))
.body(result);
}
/**
* PUT /up-question-masters : Updates an existing upQuestionMaster.
*
* @param upQuestionMaster the upQuestionMaster to update
* @return the ResponseEntity with status 200 (OK) and with body the updated upQuestionMaster,
* or with status 400 (Bad Request) if the upQuestionMaster is not valid,
* or with status 500 (Internal Server Error) if the upQuestionMaster couldnt be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/up-question-masters")
@Timed
public ResponseEntity<UpQuestionMaster> updateUpQuestionMaster(@RequestBody UpQuestionMaster upQuestionMaster) throws URISyntaxException {
log.debug("REST request to update UpQuestionMaster : {}", upQuestionMaster);
if (upQuestionMaster.getId() == null) {
return createUpQuestionMaster(upQuestionMaster);
}
UpQuestionMaster result = upQuestionMasterService.save(upQuestionMaster);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert("upQuestionMaster", upQuestionMaster.getId().toString()))
.body(result);
}
/**
* GET /up-question-masters : get all the upQuestionMasters.
*
* @param pageable the pagination information
* @return the ResponseEntity with status 200 (OK) and the list of upQuestionMasters in body
* @throws URISyntaxException if there is an error to generate the pagination HTTP headers
*/
@GetMapping("/up-question-masters")
@Timed
public ResponseEntity<List<UpQuestionMaster>> getAllUpQuestionMasters(@ApiParam Pageable pageable)
throws URISyntaxException {
log.debug("REST request to get a page of UpQuestionMasters");
Page<UpQuestionMaster> page = upQuestionMasterService.findAll(pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/up-question-masters");
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
/**
* GET /up-question-masters/:id : get the "id" upQuestionMaster.
*
* @param id the id of the upQuestionMaster to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the upQuestionMaster, or with status 404 (Not Found)
*/
@GetMapping("/up-question-masters/{id}")
@Timed
public ResponseEntity<UpQuestionMaster> getUpQuestionMaster(@PathVariable Long id) {
log.debug("REST request to get UpQuestionMaster : {}", id);
UpQuestionMaster upQuestionMaster = upQuestionMasterService.findOne(id);
return Optional.ofNullable(upQuestionMaster)
.map(result -> new ResponseEntity<>(
result,
HttpStatus.OK))
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}
/**
* DELETE /up-question-masters/:id : delete the "id" upQuestionMaster.
*
* @param id the id of the upQuestionMaster to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/up-question-masters/{id}")
@Timed
public ResponseEntity<Void> deleteUpQuestionMaster(@PathVariable Long id) {
log.debug("REST request to delete UpQuestionMaster : {}", id);
upQuestionMasterService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert("upQuestionMaster", id.toString())).build();
}
}
| [
"[email protected]"
] | |
68254d230a9f1e9627e4dcaf983ad4400226f21f | aa88ad5e46c8d65de4481d9006896a6650980322 | /src/twitter/database/Tweet.java | 35a315de85b5a2f0bcbc912ee62d60bea7c1463f | [] | no_license | Danijj89/TwitterSim | 335da3a0396ec87952540ae221f856b6da05351d | d58428f8e0b22c94fd589379185a1b926cc958c9 | refs/heads/master | 2020-05-02T16:17:13.471331 | 2019-01-28T21:03:36 | 2019-01-28T21:03:36 | 178,064,351 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,260 | java | package twitter.database;
import java.util.Calendar;
/**
* Value class that represents a Tweet in Twitter.
* The max length of the message of this tweet is set to 139.
* String is the preferred datatype as we are working with databases.
*/
public class Tweet {
private final String userId;
private final Calendar datetime;
private String message;
public Tweet(String userId, Calendar datetime, String message) throws IllegalArgumentException {
/*
if (userId == null || datetime == null || message == null) {
throw new IllegalArgumentException("Given datetime or message is null");
}
*/
if (message.length() > 139) {
throw new IllegalArgumentException("Length of the message has to be smaller than 140");
}
this.userId = userId;
this.datetime = datetime;
this.message = message;
}
/**
* Gets the userId of this Tweet .
*
* @return the userId
*/
public String getUserId() {
return userId;
}
/**
* Gets the datetime of this Tweet .
*
* @return the datetime
*/
public Calendar getDatetime() {
return datetime;
}
/**
* Gets the message of this Tweet .
*
* @return the message
*/
public String getMessage() {
return message;
}
}
| [
"[email protected]"
] | |
4e657c882a1dd18e6a5e9226e0a6eed29a4e9f36 | 055ff1e0c7c99394fe1cd885922b9242f837dbb9 | /src/lk/ijse/westminstercarparkmanager/service/custom/MotorBikeService.java | 139106133d0ea0b4ee511c6c759bc55f7aac7c9c | [] | no_license | AmilaWasantha/Westminister-CarPark-Manage-System | a5e2084041b4d5a94b0fc863b699b571091cbd5e | 288eb909b212cc595dc38876787a5159155d9e23 | refs/heads/master | 2020-04-06T19:51:04.910244 | 2018-11-15T18:03:16 | 2018-11-15T18:03:16 | 157,751,821 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 580 | 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 lk.ijse.westminstercarparkmanager.service.custom;
import java.util.List;
import lk.ijse.westminstercarparkmanager.dto.MotorBikeDTO;
import lk.ijse.westminstercarparkmanager.service.CarParkManagerService;
/**
*
* @author user
*/
public interface MotorBikeService extends CarParkManagerService<MotorBikeDTO, String>{
public List<MotorBikeDTO>showAllMotorBike()throws Exception;
}
| [
"[email protected]"
] | |
63d72822419477f94d904d52cb006caa125a8233 | 89565f96e5f3907d39dcfa9ce295ab59ae388269 | /src/main/java/com/devops/aquarium/dao/AnimalDao.java | 1f37eb4eab519047920f1197701c054b6649a736 | [] | no_license | BILA-INC/aquarium | 8ec4f4f631b1d00f7271ed0562779caad97d3ca5 | 31f03099d9c11d5beb6e0ddf076862df2f92d79f | refs/heads/master | 2023-01-19T04:44:12.431750 | 2020-03-02T22:23:28 | 2020-03-02T22:23:28 | 235,338,945 | 0 | 0 | null | 2023-01-07T14:38:07 | 2020-01-21T12:36:42 | Java | UTF-8 | Java | false | false | 434 | java | package com.devops.aquarium.dao;
import com.devops.aquarium.model.Animal;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface AnimalDao extends JpaRepository<Animal, Integer> {
Animal findById(int id); // In order to avoid using Object as wrapper for return value
//Animal findByName(String test);
//void update(Animal animal);
}
| [
"[email protected]"
] | |
297de977025373290e2ddafa0225407506934f6a | a6145148e79a92f9a55d95597f38c9b5f5852de0 | /src/Program5.0/src/soars/application/visualshell/object/role/base/object/legacy/condition/OthersCondition.java | 0729aee0aaf852ff7dfe6be2851ede2cb179f690 | [
"MIT"
] | permissive | degulab/SOARS | a5083f20ceabf294daa4f8abc71bf2d975e738c7 | 2054c62f53a0027438b99ee26cc03510f04caa63 | refs/heads/master | 2021-06-14T07:14:33.284031 | 2021-03-31T04:50:29 | 2021-03-31T04:50:29 | 176,213,677 | 0 | 1 | NOASSERTION | 2019-03-18T06:28:16 | 2019-03-18T05:56:10 | null | UTF-8 | Java | false | false | 420 | java | /**
*
*/
package soars.application.visualshell.object.role.base.object.legacy.condition;
import soars.application.visualshell.object.role.base.object.base.Rule;
/**
* @author kurata
*
*/
public class OthersCondition extends Rule {
/**
* @param kind
* @param type
* @param value
*/
public OthersCondition(String kind, String type, String value) {
super(kind, type, value);
}
}
| [
"[email protected]"
] | |
38e8599ca9a4ff719c2957d2d72a6e8bc4b9be59 | 05a61ffbbccf0e7c8fc48005c31ac7978a06c6a5 | /AndersenTestTasks/src/main/java/com/andersen/myCacheImpl/tests/CacheTest.java | 77dd85feafcedcb88029a98b858f8e6d2da7249e | [] | no_license | Yaroslav40k/academyProjects | c8cf38fb9a981049231dafd6bd9052153316787f | d32f64eb5ed3d1414a20487a06eadf02df7a971e | refs/heads/master | 2021-04-28T02:33:13.641528 | 2018-06-01T06:07:04 | 2018-06-01T06:07:04 | 122,117,514 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 897 | java | package com.andersen.myCacheImpl.tests;
import org.junit.Assert;
import com.andersen.myCacheImpl.Cache;
import static org.hamcrest.core.Is.is;
/*Test Class, contains filling methods to prepare the Cache for further testing */
public abstract class CacheTest extends Assert
{
@SuppressWarnings("rawtypes")
public abstract Cache getCache();
/*Fills whole Cash*/
@SuppressWarnings( "unchecked" )
public void fillCache()
{
for( int i = 0; i < getCache().getCapacity(); i++ ) {
getCache().put( i, i );
}
assertThat( getCache().getSize(), is( getCache().getCapacity() ) );
}
/*Adds one K/V Cash*/
@SuppressWarnings( "unchecked" )
public void putToCache( Integer key, Object val )
{
getCache().put( key, val );
assertThat( getCache().get( key ), is( val ) );
}
}
| [
"[email protected]"
] | |
99bcf392dac7c8b334261256711eba48f593e899 | 7c72211e473433b314ea39c60f0585805495ff8d | /minimarketdemoWeb/src/minimarketdemo/controller/datapdf/ProductService.java | c84ed1e84f22955de76333631b7b7bcefd8506b2 | [] | no_license | Andresm98/java-webservices-inventario | ff0e7a1bdc9154b030010d08654ab29e6f7d196f | 20a8ea08c4fb6355209e5e34443bb93bab0c5a46 | refs/heads/main | 2023-07-14T16:32:22.848737 | 2021-08-14T16:55:08 | 2021-08-14T16:55:08 | 396,071,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,671 | java | package minimarketdemo.controller.datapdf;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
import minimarketdemo.model.auditoria.managers.ManagerAuditoria;
import minimarketdemo.model.inventario.managers.ManagerCatInventario;
import minimarketdemo.model.inventario.managers.ManagerInventario;
@Named
@ApplicationScoped
public class ProductService {
List<Product> products;
@PostConstruct
public void init() {
ManagerInventario mInventario = new ManagerInventario();
ManagerAuditoria mAuditoria = new ManagerAuditoria();
ManagerCatInventario mCategoria = new ManagerCatInventario();
mAuditoria.mostrarLog(null, getClass(), null, null);
mInventario.findAllProducto();
}
public List<Product> getProducts() {
return new ArrayList<>(products);
}
public List<Product> getProducts(int size) {
if (size > products.size()) {
Random rand = new Random();
List<Product> randomList = new ArrayList<>();
for (int i = 0; i < size; i++) {
int randomIndex = rand.nextInt(products.size());
randomList.add(products.get(randomIndex));
}
return randomList;
}
else {
return new ArrayList<>(products.subList(0, size));
}
}
public List<Product> getClonedProducts(int size) {
List<Product> results = new ArrayList<>();
List<Product> originals = getProducts(size);
for (Product original : originals) {
}
return results;
}
} | [
"[email protected]"
] | |
183511720874a82d8184acc2a3c62dec3690f973 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_66b7fb92698205a978224e745b9cbcf176fa0a18/FileLocator/2_66b7fb92698205a978224e745b9cbcf176fa0a18_FileLocator_s.java | 7545c910be4e93822c990ce83d89ff745fa66039 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,156 | java | /**
* Copyright (c) 2012-2013, md_5. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* The name of the author may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package net.md_5.specialsource.util;
import com.google.common.base.CharMatcher;
import java.io.*;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import net.md_5.specialsource.SpecialSource;
public class FileLocator {
public static boolean useCache = true;
private static File download(String url) throws IOException {
// Create temporary dir in system location
File tempDir = new File(System.getProperty("java.io.tmpdir") + File.pathSeparator + "ss-cache");
if (!tempDir.exists()) {
tempDir.mkdirs();
}
// Create our own cache file here, replacing potentially invalid characters
String id = CharMatcher.JAVA_LETTER_OR_DIGIT.or(CharMatcher.anyOf("-_.")).negate().replaceFrom(url.toString(), '_');
File file = new File(tempDir, id);
// Check cache for a hit
if (file.exists() && useCache) {
if (true || SpecialSource.verbose()) {
System.out.println("Using cached file " + file.getPath() + " for " + url);
}
return file;
}
// Nope, we need to download it ourselves
if (true || SpecialSource.verbose()) {
System.out.println("Downloading " + url);
}
ReadableByteChannel rbc = null;
FileOutputStream fos = null;
try {
// TODO: Better solution for cleaning names - this extraneous '\' is introduced by path joining on the mcp dir
rbc = Channels.newChannel(new URL(url.replace('\\', '/')).openStream());
fos = new FileOutputStream(file);
fos.getChannel().transferFrom(rbc, 0, 1 << 24);
} finally {
if (rbc != null) {
rbc.close();
}
if (fos != null) {
fos.close();
}
}
// Success!
if (SpecialSource.verbose()) {
System.out.println("Downloaded to " + file.getPath());
}
return file;
}
/**
* Either download, or get a File object corresponding to the given URL /
* file name.
*
* @param path
* @return
* @throws IOException
*/
public static File getFile(String path) throws IOException {
if (isHTTPURL(path)) {
return download(path);
}
return new File(path);
}
public static boolean isHTTPURL(String string) {
return string.startsWith("http://") || string.startsWith("https://");
}
}
| [
"[email protected]"
] | |
a1b2300505100cc328aa8891d6c26bce16777211 | c157bca90f5f239c087c0a283b5cf50f9dd29317 | /service/src/main/java/uk/co/revsys/cloud/service/rest/InstanceRestService.java | f275869897bfd90ba796dadf2a68e60290ab0a34 | [] | no_license | revolutionarysystems/cloud | b17fe45dd03ea970c2b5df2ece77a02c5a0af90e | 054b1699bed9e684aad244687075b15f33fb46c3 | refs/heads/master | 2016-09-06T15:20:47.929225 | 2015-03-20T09:36:06 | 2015-03-20T09:36:06 | 20,717,904 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,042 | java | package uk.co.revsys.cloud.service.rest;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Set;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.jclouds.compute.ComputeService;
import org.jclouds.compute.domain.ComputeMetadata;
import uk.co.revsys.cloud.service.ComputeServiceFactory;
@Path("/")
public class InstanceRestService {
private final ComputeService computeService;
private final ObjectMapper objectMapper;
public InstanceRestService() {
this.computeService = ComputeServiceFactory.getComputeService();
this.objectMapper = new ObjectMapper();
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getInstances() {
try {
Set<? extends ComputeMetadata> instances = computeService.listNodes();
return Response.ok(objectMapper.writeValueAsString(instances)).header("Access-Control-Allow-Origin", "*").build();
} catch (JsonProcessingException ex) {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
}
@GET
@Path("/{id}/start")
@Produces(MediaType.APPLICATION_JSON)
public Response startInstance(@PathParam("id") String id) {
id = id.replace("|", "/");
computeService.resumeNode(id);
return getInstances();
}
@GET
@Path("/{id}/stop")
@Produces(MediaType.APPLICATION_JSON)
public Response stopInstance(@PathParam("id") String id) {
id = id.replace("|", "/");
computeService.suspendNode(id);
return getInstances();
}
@GET
@Path("/{id}/terminate")
@Produces(MediaType.APPLICATION_JSON)
public Response terminateInstance(@PathParam("id") String id) {
id = id.replace("|", "/");
computeService.destroyNode(id);
return getInstances();
}
}
| [
"[email protected]"
] | |
9d4070d242e7426db5ea23ce9fcb2368e2444a9a | cc2bc1fbca6284dc298e58251355b7690aef571b | /app/src/main/java/com/example/cs465/decisionhelper/BaseActivity.java | 1159d863654dfaa1f7ac8a9296a8ccc84c312537 | [] | no_license | cptwonton/DecisionHelper | 0430a7fc80584c0d43d51e329257ffeab97d1e83 | e0cf7e25a61df1478a2fd57cbf361e2a76e03c4d | refs/heads/master | 2021-08-14T22:52:43.773750 | 2017-11-16T23:23:39 | 2017-11-16T23:23:39 | 72,790,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,072 | java | package com.example.cs465.decisionhelper;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.FrameLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.util.ArrayList;
public class BaseActivity extends AppCompatActivity {
ListView mDrawerList;
RelativeLayout mDrawerPane;
private ActionBarDrawerToggle mDrawerToggle;
private DrawerLayout fullView;
ArrayList<NavItem> mNavItems = new ArrayList<NavItem>();
Storage db;
public static int currDecisionID = 0;
public static String currDecisionName = "Decision Helper";
public static int currChoiceID = 0;
public static String currChoiceName = "Choice";
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void setContentView(int layoutResID)
{
fullView = (DrawerLayout) getLayoutInflater().inflate(R.layout.activity_base, null);
FrameLayout activityContainer = (FrameLayout) fullView.findViewById(R.id.activity_content);
getLayoutInflater().inflate(layoutResID, activityContainer, true);
super.setContentView(fullView);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
setTitle("Use setTitle()");
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
mDrawerToggle = new ActionBarDrawerToggle(this, fullView, R.string.btn_OK, R.string.btn_cancel);
mDrawerToggle.setDrawerIndicatorEnabled(true);
fullView.addDrawerListener(mDrawerToggle);
mDrawerToggle.syncState();
}
mNavItems.add(new NavItem("Decision Helper", "Begin making better decisions!"));
mNavItems.add(new NavItem("Personality Quiz", "Discover your personality!"));
mNavItems.add(new NavItem("Settings", "Change account specific settings!"));
mNavItems.add(new NavItem("Help", "Confused? FAQ here!"));
mDrawerPane = (RelativeLayout) findViewById(R.id.drawerPane);
mDrawerList = (ListView) findViewById(R.id.navList);
DrawerListAdapter adapter = new DrawerListAdapter(this, mNavItems);
mDrawerList.setAdapter(adapter);
//Drawer Item click listeners
mDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id){
selectItemFromDrawer(position);
}
});
db = new Storage(this);
}
@Override
protected void onPostCreate(Bundle savedInstanceState)
{
super.onPostCreate(savedInstanceState);
mDrawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
mDrawerToggle.onConfigurationChanged(newConfig);
}
public void setTitle(String title) {
TextView textView = (TextView) findViewById(R.id.toolbar_title);
if (title.length() > 17) {
title = title.substring(0, 16);
}
textView.setText(title);
}
private void selectItemFromDrawer(int position)
{
Class selectedActivity = null;
switch (position)
{
case 0: selectedActivity = dh_homepage.class;
break;
case 1: selectedActivity = pq_homepage.class;
break;
case 2: selectedActivity = s_homepage.class;
break;
case 3: selectedActivity = h_homepage.class;
break;
}
Intent intent = new Intent(this, selectedActivity);
startActivity(intent);
}
class NavItem
{
String mTitle;
String mSubtitle;
public NavItem(String title, String subtitle)
{
mTitle = title;
mSubtitle = subtitle;
}
}
class DrawerListAdapter extends BaseAdapter
{
Context mContext;
ArrayList<NavItem> mNavItems;
public DrawerListAdapter(Context context, ArrayList<NavItem> navItems)
{
mContext = context;
mNavItems = navItems;
}
@Override
public int getCount()
{
return mNavItems.size();
}
@Override
public Object getItem(int position)
{
return mNavItems.get(position);
}
@Override
public long getItemId(int position)
{
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
View view;
if (convertView == null)
{
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.drawer_list_item, null);
}
else
{
view = convertView;
}
TextView titleView = (TextView) view.findViewById(R.id.title);
TextView subtitleView = (TextView) view.findViewById(R.id.subtitle);
titleView.setText( mNavItems.get(position).mTitle);
subtitleView.setText( mNavItems.get(position).mSubtitle);
return view;
}
}
}
| [
"[email protected]"
] | |
b13e6a64b0f777baca59cc1a6efb9e5f32783380 | 94d65912c0e823964edddc44bc4be07873734d95 | /Leetcode/src/main/java/QLY/Leetcode/backtrace/Permute.java | 14bcef8363a2f272b1be9fd812217bec4083ed21 | [] | no_license | qiulingyun/Leetcode | f7c19d1e93353eea83a630879aebc0945c7cb3c4 | 497065fe60d8cbc1c1f493fdb57858a87a944b6a | refs/heads/master | 2022-05-23T12:02:41.133397 | 2022-03-23T15:58:50 | 2022-03-23T15:58:50 | 173,534,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,282 | java | package QLY.Leetcode.backtrace;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
/**
* 全排列
*/
public class Permute {
public List<List<Integer>> permute(int[] nums){
if (nums == null || nums.length == 0){
return null;
}
List<List<Integer>> result = new ArrayList<>();
permute(nums, result, new HashSet<>(), new LinkedList<>());
return result;
}
public void permute(int[] nums, List<List<Integer>> result, HashSet<Integer> usedIndex, LinkedList<Integer> currList){
if (usedIndex.size() == nums.length){
List<Integer> tmp = new ArrayList<>();
tmp.addAll(currList);
result.add(tmp);
return;
}
for (int i = 0; i < nums.length; i++){
if (usedIndex.contains(i)){
continue;
}
currList.add(nums[i]);
usedIndex.add(i);
permute(nums, result, usedIndex, currList);
currList.removeLast();
usedIndex.remove(i);
}
}
public static void main(String[] args) {
Permute Permute = new Permute();
System.out.println(Permute.permute(new int[]{1,2,3}));
}
}
| [
"[email protected]"
] | |
c4b397ce250b7024fe799642e446cb9dd6646d98 | dbe32e5afb62a400d09a1a438777f57d3233aa8a | /app/src/main/java/com/aaron/passwordlist/ui/EditActivity.java | 71c37880468534618ab2b060562f28df3722df19 | [] | no_license | StarsAaron/PasswordList | 900c083e5db498e365546f7f22d8160b581ffa21 | 333f4e638324e1e1b3b6c57273a708dc85f3d4c7 | refs/heads/master | 2023-05-14T13:09:51.582989 | 2021-06-11T03:50:58 | 2021-06-11T03:50:58 | 124,476,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,693 | java | package com.aaron.passwordlist.ui;
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.aaron.passwordlist.Myapplication;
import com.aaron.passwordlist.R;
import com.aaron.passwordlist.bean.PasswordBean;
import com.aaron.passwordlist.db.dao.PwdDao;
public class EditActivity extends AppCompatActivity {
private EditText edit_keyword;
private EditText edit_account;
private EditText edit_tip;
private Button btn_edit_add;
private Toolbar toolbar;
private PasswordBean passwordBean;
public static void jumpToEditActivity(Context context,PasswordBean passwordBean){
Intent intent = new Intent(context,EditActivity.class);
intent.putExtra("passwordbean",passwordBean);
context.startActivity(intent);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit);
initView();
}
private void initView() {
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("修改记录");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
edit_keyword = (EditText) findViewById(R.id.edit_keyword);
edit_account = (EditText) findViewById(R.id.edit_account);
edit_tip = (EditText) findViewById(R.id.edit_tip);
btn_edit_add = (Button) findViewById(R.id.btn_edit_add);
btn_edit_add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (checkInput()) {
changePasswordMessageToDb();
}
}
});
passwordBean = (PasswordBean)getIntent().getSerializableExtra("passwordbean");
if(passwordBean != null){
edit_keyword.setText(passwordBean.pwdkeyword);
edit_account.setText(passwordBean.pwdAccount);
edit_tip.setText(passwordBean.pwdTip);
}else{
toast("获取不到数据");
finish();
}
}
private boolean checkInput() {
String key = edit_keyword.getText().toString();
String account = edit_account.getText().toString();
if (TextUtils.isEmpty(key)) {
toast("关键字是搜索时必须的");
return false;
}
if (TextUtils.isEmpty(account)) {
toast("账号为空");
return false;
}
return true;
}
private void changePasswordMessageToDb(){
passwordBean.pwdkeyword = edit_keyword.getText().toString();
passwordBean.pwdAccount = edit_account.getText().toString();
passwordBean.pwdTip = edit_tip.getText().toString();
PwdDao pwdDao = new PwdDao(getApplicationContext());
long rowsAffectedResult = pwdDao.changePasswordMessage(passwordBean);
if(rowsAffectedResult <= 0){
toast("修改失败");
}else{
toast("修改成功");
}
}
private void toast(String message) {
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
84bd9f9046f01af9a9c4bcaeb396ab710e1ca4f1 | 6fd7e088ab993ab4cceb41a7e77403f1e0d96daf | /Hotel_management/src/com/BO/Staff_info.java | d683f9a87bea8e46fc937acee2d0d287684cc7da | [] | no_license | tvishant18/hotel_mangement_core_java_swings_project | 98641e40849a99a53747f500da28bd513bc25e6e | d3e76dfb215cf9db83adeb4153ae247932fbf9bd | refs/heads/master | 2021-01-09T20:22:28.637847 | 2016-07-20T10:16:35 | 2016-07-20T10:16:35 | 63,478,211 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 519 | java | package com.BO;
public class Staff_info {
int Steward_id;
String Steward_name;
String Department;
public int getSteward_id() {
return Steward_id;
}
public void setSteward_id(int steward_id) {
Steward_id = steward_id;
}
public String getSteward_name() {
return Steward_name;
}
public void setSteward_name(String steward_name) {
Steward_name = steward_name;
}
public String getDepartment() {
return Department;
}
public void setDepartment(String department) {
Department = department;
}
}
| [
"vishant [email protected]"
] | vishant [email protected] |
02148a5f95d933db7dd67b4ef4abc065166f51b8 | 02e0028b4a0d85a3c4ab3a26d72ba262d1fe5f2e | /src/model/Fenoma.java | be643eb7aa62069309df959832e176db6a8458c0 | [] | no_license | GermanAriza/algoritmo-genetico-simple | 0c54d9266c9c650af469420e01c2ad4f1bb219d5 | 0e3e73700d4249136ecb8253a4c729082dc6fd87 | refs/heads/master | 2021-04-09T21:57:47.342725 | 2020-03-21T01:28:00 | 2020-03-21T01:28:00 | 248,884,110 | 0 | 0 | null | null | null | null | WINDOWS-1250 | Java | false | false | 1,005 | java | package model;
/**
* @author
*
* FENOMA: Representación real de una variable
*/
public class Fenoma {
private Double valorReal;
private String valorEntero;
private String valorDecimal;
public Fenoma(Double valorReal) {
super();
this.valorReal = valorReal;
String[] numero = valorReal.toString().split("\\.");
this.valorEntero = numero[0];
this.valorDecimal = numero[1];
}
public Double getValorReal() {
return valorReal;
}
public void setValorReal(Double valorReal) {
this.valorReal = valorReal;
}
public String getValorEntero() {
return valorEntero;
}
public void setValorEntero(String valorEntero) {
this.valorEntero = valorEntero;
}
public String getValorDecimal() {
return valorDecimal;
}
public void setValorDecimal(String valorDecimal) {
this.valorDecimal = valorDecimal;
}
@Override
public String toString() {
return "Fenoma [valorReal=" + valorReal + ", valorEntero=" + valorEntero + ", valorDecimal=" + valorDecimal
+ "]";
}
}
| [
"[email protected]"
] | |
9bd91162f970a92d85bd6a75a85cf82e2fe92176 | e22ca81275d34f125176742721824c82ae09bd16 | /app/src/androidTest/java/com/example/parcial2movil/ExampleInstrumentedTest.java | 61881d2502c8bb2aabfe2c5cad94064c66cd6bfb | [] | no_license | rgcamelo/DezzerApp | e4ccda32a67f33e7edf413e1032224f2f18c8464 | e743d9efb59aa43e201439f51d6b1c1e96f7c0ea | refs/heads/master | 2022-07-23T06:05:35.644797 | 2020-05-19T18:50:45 | 2020-05-19T18:50:45 | 265,335,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package com.example.parcial2movil;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.parcial2movil", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
f245e193b9d3833d6cadcc1698717b5694ee7a6a | 87ce92a68065dac48fe79e3543a168a3f4e9e56f | /src/main/java/com/wojtek/parkingmeter/ParkingMeterRestApiApplication.java | 42eeeb61cca52fe304b48c458d43f777330777de | [] | no_license | WojciechWeg/parking_meter_rest_api | 049fc9ad59f15e6495f1e706afb0feba3286a72e | d5654014359b43469ea10572fcc317828df78806 | refs/heads/master | 2020-04-16T10:41:24.320279 | 2019-08-29T13:48:43 | 2019-08-29T13:48:43 | 165,513,432 | 0 | 0 | null | 2019-01-20T23:17:06 | 2019-01-13T14:15:17 | Java | UTF-8 | Java | false | false | 355 | java | package com.wojtek.parkingmeter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ParkingMeterRestApiApplication {
public static void main(String[] args) {
SpringApplication.run(ParkingMeterRestApiApplication.class, args);
}
}
| [
"[email protected]"
] | |
30bd4dbaec751bd8f1fc136d8bf530eddfbb439b | a828119846088bba601a2aae274aa71ace65d9a4 | /Tool/dex2jar/out/com/google/android/gms/b/kb.java | dee6f9a9afaaaa98312301777b245f5492a2f31d | [] | no_license | PhuongThao09/ZingMP3 | 19112d400dc2c30719f03272c0de3b8101bfe3b9 | a060ee305894c2d89e8636bd2700b16ecde6c421 | refs/heads/master | 2020-06-11T20:11:33.371267 | 2019-06-27T11:37:16 | 2019-06-27T11:37:16 | 194,065,503 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | //
// Decompiled by Procyon v0.5.30
//
package com.google.android.gms.b;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
public abstract class kb
{
private static final ExecutorService a;
static {
a = Executors.newFixedThreadPool(2, new kz("GAC_Executor"));
}
public static ExecutorService a() {
return kb.a;
}
}
| [
"̣"
] | ̣ |
84ef95d4222727580c75864592bcddcf08eaa5c6 | 52bfe004cf2320349fe86c0950507dbc2c753f15 | /src/PSI/CounterFrameMain.java | a43ab377f23df943c425e32807fb499d914fa1ff | [] | no_license | raflyyunandi/PSI_Latihan | 718b5c7e1c889699816f97fe64c4d328e885a9d2 | 3e59567253741e2c8a25edf9e3fac6dd136ece35 | refs/heads/master | 2020-08-13T16:18:25.608363 | 2019-11-21T05:02:03 | 2019-11-21T05:02:03 | 214,999,636 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | 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 PSI;
/**
*
* @author User
*/
public class CounterFrameMain {
public static void main(String[] args) {
new CounterFrame().setVisible(true);
}
}
| [
"[email protected]"
] | |
1102408446b99097f7ae7b78fb72f468b0ac2f45 | 43334ae5400646e072ce2c217cb6b647d9c50734 | /src/main/java/org/drip/analytics/holset/UAHHoliday.java | 1491bc2e53157726d926ce927f23b37b4a3225e9 | [
"Apache-2.0"
] | permissive | BukhariH/DROP | 0e2f70ff441f082a88c7f26a840585fb593665fb | 8770f84c747c41ed2022155fee1e6f63bb09f6fa | refs/heads/master | 2020-03-30T06:27:29.042934 | 2018-09-29T06:13:19 | 2018-09-29T06:13:19 | 150,862,864 | 1 | 0 | Apache-2.0 | 2018-09-29T12:37:29 | 2018-09-29T12:37:28 | null | UTF-8 | Java | false | false | 25,275 | java |
package org.drip.analytics.holset;
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*/
/*
* GENERATED on Fri Jan 11 19:54:07 EST 2013 ---- DO NOT DELETE
*/
/*!
* Copyright (C) 2016 Lakshmi Krishnamurthy
* Copyright (C) 2015 Lakshmi Krishnamurthy
* Copyright (C) 2014 Lakshmi Krishnamurthy
* Copyright (C) 2013 Lakshmi Krishnamurthy
* Copyright (C) 2012 Lakshmi Krishnamurthy
* Copyright (C) 2011 Lakshmi Krishnamurthy
*
* This file is part of CreditAnalytics, a free-software/open-source library for
* fixed income analysts and developers - http://www.credit-trader.org
*
* CreditAnalytics is a free, full featured, fixed income credit analytics library, developed with a special focus
* towards the needs of the bonds and credit products community.
*
* 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 UAHHoliday implements org.drip.analytics.holset.LocationHoliday {
public UAHHoliday()
{
}
public java.lang.String getHolidayLoc()
{
return "UAH";
}
public org.drip.analytics.eventday.Locale getHolidaySet()
{
org.drip.analytics.eventday.Locale lh = new
org.drip.analytics.eventday.Locale();
lh.addStaticHoliday ("01-JAN-1998", "New Years Day");
lh.addStaticHoliday ("07-JAN-1998", "Orthodox Christmas Day");
lh.addStaticHoliday ("09-MAR-1998", "Womens Day Observed");
lh.addStaticHoliday ("20-APR-1998", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-1998", "Labor Day");
lh.addStaticHoliday ("04-MAY-1998", "Day after Labor Day Observed");
lh.addStaticHoliday ("11-MAY-1998", "Victory Day Observed");
lh.addStaticHoliday ("08-JUN-1998", "Whit Monday");
lh.addStaticHoliday ("29-JUN-1998", "Constitution Day Observed");
lh.addStaticHoliday ("24-AUG-1998", "Independence Day");
lh.addStaticHoliday ("09-NOV-1998", "Day after Great October Revolution Day Observed");
lh.addStaticHoliday ("10-NOV-1998", "Great October Revolution Day Observed");
lh.addStaticHoliday ("01-JAN-1999", "New Years Day");
lh.addStaticHoliday ("07-JAN-1999", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-1999", "Womens Day");
lh.addStaticHoliday ("12-APR-1999", "Orthodox Easter Monday");
lh.addStaticHoliday ("03-MAY-1999", "Day after Labor Day Observed");
lh.addStaticHoliday ("04-MAY-1999", "Labor Day Observed");
lh.addStaticHoliday ("10-MAY-1999", "Victory Day Observed");
lh.addStaticHoliday ("31-MAY-1999", "Whit Monday");
lh.addStaticHoliday ("28-JUN-1999", "Constitution Day");
lh.addStaticHoliday ("24-AUG-1999", "Independence Day");
lh.addStaticHoliday ("08-NOV-1999", "Day after Great October Revolution Day");
lh.addStaticHoliday ("09-NOV-1999", "Great October Revolution Day Observed");
lh.addStaticHoliday ("03-JAN-2000", "New Years Day Observed");
lh.addStaticHoliday ("07-JAN-2000", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2000", "Womens Day");
lh.addStaticHoliday ("01-MAY-2000", "Labor Day");
lh.addStaticHoliday ("02-MAY-2000", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2000", "Victory Day");
lh.addStaticHoliday ("19-JUN-2000", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2000", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2000", "Independence Day");
lh.addStaticHoliday ("07-NOV-2000", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2000", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2001", "New Years Day");
lh.addStaticHoliday ("08-JAN-2001", "Orthodox Christmas Day Observed");
lh.addStaticHoliday ("08-MAR-2001", "Womens Day");
lh.addStaticHoliday ("16-APR-2001", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2001", "Labor Day");
lh.addStaticHoliday ("02-MAY-2001", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2001", "Victory Day");
lh.addStaticHoliday ("04-JUN-2001", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2001", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2001", "Independence Day");
lh.addStaticHoliday ("07-NOV-2001", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2001", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2002", "New Years Day");
lh.addStaticHoliday ("07-JAN-2002", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2002", "Womens Day");
lh.addStaticHoliday ("01-MAY-2002", "Labor Day");
lh.addStaticHoliday ("02-MAY-2002", "Day after Labor Day");
lh.addStaticHoliday ("06-MAY-2002", "Orthodox Easter Monday");
lh.addStaticHoliday ("09-MAY-2002", "Victory Day");
lh.addStaticHoliday ("24-JUN-2002", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2002", "Constitution Day");
lh.addStaticHoliday ("26-AUG-2002", "Independence Day Observed");
lh.addStaticHoliday ("07-NOV-2002", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2002", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2003", "New Years Day");
lh.addStaticHoliday ("07-JAN-2003", "Orthodox Christmas Day");
lh.addStaticHoliday ("10-MAR-2003", "Womens Day Observed");
lh.addStaticHoliday ("28-APR-2003", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2003", "Labor Day");
lh.addStaticHoliday ("02-MAY-2003", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2003", "Victory Day");
lh.addStaticHoliday ("16-JUN-2003", "Whit Monday");
lh.addStaticHoliday ("30-JUN-2003", "Constitution Day Observed");
lh.addStaticHoliday ("25-AUG-2003", "Independence Day Observed");
lh.addStaticHoliday ("07-NOV-2003", "Great October Revolution Day");
lh.addStaticHoliday ("10-NOV-2003", "Day after Great October Revolution Day Observed");
lh.addStaticHoliday ("01-JAN-2004", "New Years Day");
lh.addStaticHoliday ("07-JAN-2004", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2004", "Womens Day");
lh.addStaticHoliday ("12-APR-2004", "Orthodox Easter Monday");
lh.addStaticHoliday ("03-MAY-2004", "Day after Labor Day Observed");
lh.addStaticHoliday ("04-MAY-2004", "Labor Day Observed");
lh.addStaticHoliday ("10-MAY-2004", "Victory Day Observed");
lh.addStaticHoliday ("31-MAY-2004", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2004", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2004", "Independence Day");
lh.addStaticHoliday ("08-NOV-2004", "Day after Great October Revolution Day");
lh.addStaticHoliday ("09-NOV-2004", "Great October Revolution Day Observed");
lh.addStaticHoliday ("03-JAN-2005", "New Years Day Observed");
lh.addStaticHoliday ("07-JAN-2005", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2005", "Womens Day");
lh.addStaticHoliday ("02-MAY-2005", "Day after Labor Day");
lh.addStaticHoliday ("03-MAY-2005", "Labor Day Observed");
lh.addStaticHoliday ("09-MAY-2005", "Victory Day");
lh.addStaticHoliday ("20-JUN-2005", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2005", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2005", "Independence Day");
lh.addStaticHoliday ("07-NOV-2005", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2005", "Day after Great October Revolution Day");
lh.addStaticHoliday ("02-JAN-2006", "New Years Day Observed");
lh.addStaticHoliday ("09-JAN-2006", "Orthodox Christmas Day Observed");
lh.addStaticHoliday ("08-MAR-2006", "Womens Day");
lh.addStaticHoliday ("24-APR-2006", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2006", "Labor Day");
lh.addStaticHoliday ("02-MAY-2006", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2006", "Victory Day");
lh.addStaticHoliday ("12-JUN-2006", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2006", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2006", "Independence Day");
lh.addStaticHoliday ("07-NOV-2006", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2006", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2007", "New Years Day");
lh.addStaticHoliday ("08-JAN-2007", "Orthodox Christmas Day Observed");
lh.addStaticHoliday ("08-MAR-2007", "Womens Day");
lh.addStaticHoliday ("09-APR-2007", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2007", "Labor Day");
lh.addStaticHoliday ("02-MAY-2007", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2007", "Victory Day");
lh.addStaticHoliday ("28-MAY-2007", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2007", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2007", "Independence Day");
lh.addStaticHoliday ("07-NOV-2007", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2007", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2008", "New Years Day");
lh.addStaticHoliday ("07-JAN-2008", "Orthodox Christmas Day");
lh.addStaticHoliday ("10-MAR-2008", "Womens Day Observed");
lh.addStaticHoliday ("28-APR-2008", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2008", "Labor Day");
lh.addStaticHoliday ("02-MAY-2008", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2008", "Victory Day");
lh.addStaticHoliday ("16-JUN-2008", "Whit Monday");
lh.addStaticHoliday ("30-JUN-2008", "Constitution Day Observed");
lh.addStaticHoliday ("25-AUG-2008", "Independence Day Observed");
lh.addStaticHoliday ("07-NOV-2008", "Great October Revolution Day");
lh.addStaticHoliday ("10-NOV-2008", "Day after Great October Revolution Day Observed");
lh.addStaticHoliday ("01-JAN-2009", "New Years Day");
lh.addStaticHoliday ("07-JAN-2009", "Orthodox Christmas Day");
lh.addStaticHoliday ("09-MAR-2009", "Womens Day Observed");
lh.addStaticHoliday ("20-APR-2009", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2009", "Labor Day");
lh.addStaticHoliday ("04-MAY-2009", "Day after Labor Day Observed");
lh.addStaticHoliday ("11-MAY-2009", "Victory Day Observed");
lh.addStaticHoliday ("08-JUN-2009", "Whit Monday");
lh.addStaticHoliday ("29-JUN-2009", "Constitution Day Observed");
lh.addStaticHoliday ("24-AUG-2009", "Independence Day");
lh.addStaticHoliday ("09-NOV-2009", "Day after Great October Revolution Day Observed");
lh.addStaticHoliday ("10-NOV-2009", "Great October Revolution Day Observed");
lh.addStaticHoliday ("01-JAN-2010", "New Years Day");
lh.addStaticHoliday ("07-JAN-2010", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2010", "Womens Day");
lh.addStaticHoliday ("05-APR-2010", "Orthodox Easter Monday");
lh.addStaticHoliday ("03-MAY-2010", "Day after Labor Day Observed");
lh.addStaticHoliday ("04-MAY-2010", "Labor Day Observed");
lh.addStaticHoliday ("10-MAY-2010", "Victory Day Observed");
lh.addStaticHoliday ("24-MAY-2010", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2010", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2010", "Independence Day");
lh.addStaticHoliday ("08-NOV-2010", "Day after Great October Revolution Day");
lh.addStaticHoliday ("09-NOV-2010", "Great October Revolution Day Observed");
lh.addStaticHoliday ("03-JAN-2011", "New Years Day Observed");
lh.addStaticHoliday ("07-JAN-2011", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2011", "Womens Day");
lh.addStaticHoliday ("25-APR-2011", "Orthodox Easter Monday");
lh.addStaticHoliday ("02-MAY-2011", "Day after Labor Day");
lh.addStaticHoliday ("03-MAY-2011", "Labor Day Observed");
lh.addStaticHoliday ("09-MAY-2011", "Victory Day");
lh.addStaticHoliday ("13-JUN-2011", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2011", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2011", "Independence Day");
lh.addStaticHoliday ("07-NOV-2011", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2011", "Day after Great October Revolution Day");
lh.addStaticHoliday ("02-JAN-2012", "New Years Day Observed");
lh.addStaticHoliday ("09-JAN-2012", "Orthodox Christmas Day Observed");
lh.addStaticHoliday ("08-MAR-2012", "Womens Day");
lh.addStaticHoliday ("16-APR-2012", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2012", "Labor Day");
lh.addStaticHoliday ("02-MAY-2012", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2012", "Victory Day");
lh.addStaticHoliday ("04-JUN-2012", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2012", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2012", "Independence Day");
lh.addStaticHoliday ("07-NOV-2012", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2012", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2013", "New Years Day");
lh.addStaticHoliday ("07-JAN-2013", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2013", "Womens Day");
lh.addStaticHoliday ("01-MAY-2013", "Labor Day");
lh.addStaticHoliday ("02-MAY-2013", "Day after Labor Day");
lh.addStaticHoliday ("06-MAY-2013", "Orthodox Easter Monday");
lh.addStaticHoliday ("09-MAY-2013", "Victory Day");
lh.addStaticHoliday ("24-JUN-2013", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2013", "Constitution Day");
lh.addStaticHoliday ("26-AUG-2013", "Independence Day Observed");
lh.addStaticHoliday ("07-NOV-2013", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2013", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2014", "New Years Day");
lh.addStaticHoliday ("07-JAN-2014", "Orthodox Christmas Day");
lh.addStaticHoliday ("10-MAR-2014", "Womens Day Observed");
lh.addStaticHoliday ("21-APR-2014", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2014", "Labor Day");
lh.addStaticHoliday ("02-MAY-2014", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2014", "Victory Day");
lh.addStaticHoliday ("09-JUN-2014", "Whit Monday");
lh.addStaticHoliday ("30-JUN-2014", "Constitution Day Observed");
lh.addStaticHoliday ("25-AUG-2014", "Independence Day Observed");
lh.addStaticHoliday ("07-NOV-2014", "Great October Revolution Day");
lh.addStaticHoliday ("10-NOV-2014", "Day after Great October Revolution Day Observed");
lh.addStaticHoliday ("01-JAN-2015", "New Years Day");
lh.addStaticHoliday ("07-JAN-2015", "Orthodox Christmas Day");
lh.addStaticHoliday ("09-MAR-2015", "Womens Day Observed");
lh.addStaticHoliday ("13-APR-2015", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2015", "Labor Day");
lh.addStaticHoliday ("04-MAY-2015", "Day after Labor Day Observed");
lh.addStaticHoliday ("11-MAY-2015", "Victory Day Observed");
lh.addStaticHoliday ("01-JUN-2015", "Whit Monday");
lh.addStaticHoliday ("29-JUN-2015", "Constitution Day Observed");
lh.addStaticHoliday ("24-AUG-2015", "Independence Day");
lh.addStaticHoliday ("09-NOV-2015", "Day after Great October Revolution Day Observed");
lh.addStaticHoliday ("10-NOV-2015", "Great October Revolution Day Observed");
lh.addStaticHoliday ("01-JAN-2016", "New Years Day");
lh.addStaticHoliday ("07-JAN-2016", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2016", "Womens Day");
lh.addStaticHoliday ("02-MAY-2016", "Day after Labor Day");
lh.addStaticHoliday ("03-MAY-2016", "Labor Day Observed");
lh.addStaticHoliday ("09-MAY-2016", "Victory Day");
lh.addStaticHoliday ("20-JUN-2016", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2016", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2016", "Independence Day");
lh.addStaticHoliday ("07-NOV-2016", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2016", "Day after Great October Revolution Day");
lh.addStaticHoliday ("02-JAN-2017", "New Years Day Observed");
lh.addStaticHoliday ("09-JAN-2017", "Orthodox Christmas Day Observed");
lh.addStaticHoliday ("08-MAR-2017", "Womens Day");
lh.addStaticHoliday ("17-APR-2017", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2017", "Labor Day");
lh.addStaticHoliday ("02-MAY-2017", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2017", "Victory Day");
lh.addStaticHoliday ("05-JUN-2017", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2017", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2017", "Independence Day");
lh.addStaticHoliday ("07-NOV-2017", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2017", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2018", "New Years Day");
lh.addStaticHoliday ("08-JAN-2018", "Orthodox Christmas Day Observed");
lh.addStaticHoliday ("08-MAR-2018", "Womens Day");
lh.addStaticHoliday ("09-APR-2018", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2018", "Labor Day");
lh.addStaticHoliday ("02-MAY-2018", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2018", "Victory Day");
lh.addStaticHoliday ("28-MAY-2018", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2018", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2018", "Independence Day");
lh.addStaticHoliday ("07-NOV-2018", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2018", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2019", "New Years Day");
lh.addStaticHoliday ("07-JAN-2019", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2019", "Womens Day");
lh.addStaticHoliday ("29-APR-2019", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2019", "Labor Day");
lh.addStaticHoliday ("02-MAY-2019", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2019", "Victory Day");
lh.addStaticHoliday ("17-JUN-2019", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2019", "Constitution Day");
lh.addStaticHoliday ("26-AUG-2019", "Independence Day Observed");
lh.addStaticHoliday ("07-NOV-2019", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2019", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2020", "New Years Day");
lh.addStaticHoliday ("07-JAN-2020", "Orthodox Christmas Day");
lh.addStaticHoliday ("09-MAR-2020", "Womens Day Observed");
lh.addStaticHoliday ("20-APR-2020", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2020", "Labor Day");
lh.addStaticHoliday ("04-MAY-2020", "Day after Labor Day Observed");
lh.addStaticHoliday ("11-MAY-2020", "Victory Day Observed");
lh.addStaticHoliday ("08-JUN-2020", "Whit Monday");
lh.addStaticHoliday ("29-JUN-2020", "Constitution Day Observed");
lh.addStaticHoliday ("24-AUG-2020", "Independence Day");
lh.addStaticHoliday ("09-NOV-2020", "Day after Great October Revolution Day Observed");
lh.addStaticHoliday ("10-NOV-2020", "Great October Revolution Day Observed");
lh.addStaticHoliday ("01-JAN-2021", "New Years Day");
lh.addStaticHoliday ("07-JAN-2021", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2021", "Womens Day");
lh.addStaticHoliday ("03-MAY-2021", "Day after Labor Day Observed");
lh.addStaticHoliday ("04-MAY-2021", "Labor Day Observed");
lh.addStaticHoliday ("10-MAY-2021", "Victory Day Observed");
lh.addStaticHoliday ("21-JUN-2021", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2021", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2021", "Independence Day");
lh.addStaticHoliday ("08-NOV-2021", "Day after Great October Revolution Day");
lh.addStaticHoliday ("09-NOV-2021", "Great October Revolution Day Observed");
lh.addStaticHoliday ("03-JAN-2022", "New Years Day Observed");
lh.addStaticHoliday ("07-JAN-2022", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2022", "Womens Day");
lh.addStaticHoliday ("25-APR-2022", "Orthodox Easter Monday");
lh.addStaticHoliday ("02-MAY-2022", "Day after Labor Day");
lh.addStaticHoliday ("03-MAY-2022", "Labor Day Observed");
lh.addStaticHoliday ("09-MAY-2022", "Victory Day");
lh.addStaticHoliday ("13-JUN-2022", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2022", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2022", "Independence Day");
lh.addStaticHoliday ("07-NOV-2022", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2022", "Day after Great October Revolution Day");
lh.addStaticHoliday ("02-JAN-2023", "New Years Day Observed");
lh.addStaticHoliday ("09-JAN-2023", "Orthodox Christmas Day Observed");
lh.addStaticHoliday ("08-MAR-2023", "Womens Day");
lh.addStaticHoliday ("17-APR-2023", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2023", "Labor Day");
lh.addStaticHoliday ("02-MAY-2023", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2023", "Victory Day");
lh.addStaticHoliday ("05-JUN-2023", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2023", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2023", "Independence Day");
lh.addStaticHoliday ("07-NOV-2023", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2023", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2024", "New Years Day");
lh.addStaticHoliday ("08-JAN-2024", "Orthodox Christmas Day Observed");
lh.addStaticHoliday ("08-MAR-2024", "Womens Day");
lh.addStaticHoliday ("01-MAY-2024", "Labor Day");
lh.addStaticHoliday ("02-MAY-2024", "Day after Labor Day");
lh.addStaticHoliday ("06-MAY-2024", "Orthodox Easter Monday");
lh.addStaticHoliday ("09-MAY-2024", "Victory Day");
lh.addStaticHoliday ("24-JUN-2024", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2024", "Constitution Day");
lh.addStaticHoliday ("26-AUG-2024", "Independence Day Observed");
lh.addStaticHoliday ("07-NOV-2024", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2024", "Day after Great October Revolution Day");
lh.addStaticHoliday ("01-JAN-2025", "New Years Day");
lh.addStaticHoliday ("07-JAN-2025", "Orthodox Christmas Day");
lh.addStaticHoliday ("10-MAR-2025", "Womens Day Observed");
lh.addStaticHoliday ("21-APR-2025", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2025", "Labor Day");
lh.addStaticHoliday ("02-MAY-2025", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2025", "Victory Day");
lh.addStaticHoliday ("09-JUN-2025", "Whit Monday");
lh.addStaticHoliday ("30-JUN-2025", "Constitution Day Observed");
lh.addStaticHoliday ("25-AUG-2025", "Independence Day Observed");
lh.addStaticHoliday ("07-NOV-2025", "Great October Revolution Day");
lh.addStaticHoliday ("10-NOV-2025", "Day after Great October Revolution Day Observed");
lh.addStaticHoliday ("01-JAN-2026", "New Years Day");
lh.addStaticHoliday ("07-JAN-2026", "Orthodox Christmas Day");
lh.addStaticHoliday ("09-MAR-2026", "Womens Day Observed");
lh.addStaticHoliday ("13-APR-2026", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2026", "Labor Day");
lh.addStaticHoliday ("04-MAY-2026", "Day after Labor Day Observed");
lh.addStaticHoliday ("11-MAY-2026", "Victory Day Observed");
lh.addStaticHoliday ("01-JUN-2026", "Whit Monday");
lh.addStaticHoliday ("29-JUN-2026", "Constitution Day Observed");
lh.addStaticHoliday ("24-AUG-2026", "Independence Day");
lh.addStaticHoliday ("09-NOV-2026", "Day after Great October Revolution Day Observed");
lh.addStaticHoliday ("10-NOV-2026", "Great October Revolution Day Observed");
lh.addStaticHoliday ("01-JAN-2027", "New Years Day");
lh.addStaticHoliday ("07-JAN-2027", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2027", "Womens Day");
lh.addStaticHoliday ("03-MAY-2027", "Day after Labor Day Observed");
lh.addStaticHoliday ("04-MAY-2027", "Labor Day Observed");
lh.addStaticHoliday ("10-MAY-2027", "Victory Day Observed");
lh.addStaticHoliday ("21-JUN-2027", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2027", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2027", "Independence Day");
lh.addStaticHoliday ("08-NOV-2027", "Day after Great October Revolution Day");
lh.addStaticHoliday ("09-NOV-2027", "Great October Revolution Day Observed");
lh.addStaticHoliday ("03-JAN-2028", "New Years Day Observed");
lh.addStaticHoliday ("07-JAN-2028", "Orthodox Christmas Day");
lh.addStaticHoliday ("08-MAR-2028", "Womens Day");
lh.addStaticHoliday ("17-APR-2028", "Orthodox Easter Monday");
lh.addStaticHoliday ("01-MAY-2028", "Labor Day");
lh.addStaticHoliday ("02-MAY-2028", "Day after Labor Day");
lh.addStaticHoliday ("09-MAY-2028", "Victory Day");
lh.addStaticHoliday ("05-JUN-2028", "Whit Monday");
lh.addStaticHoliday ("28-JUN-2028", "Constitution Day");
lh.addStaticHoliday ("24-AUG-2028", "Independence Day");
lh.addStaticHoliday ("07-NOV-2028", "Great October Revolution Day");
lh.addStaticHoliday ("08-NOV-2028", "Day after Great October Revolution Day");
lh.addStandardWeekend();
return lh;
}
}
| [
"[email protected]"
] | |
c691294ec350e59d892e09628ccaa4e084dd3162 | 9ab91b074703bcfe9c9407e1123e2b551784a680 | /plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsVersionServiceImpl.java | 3d607b7c977d37052760df284ecfa7fc8eea181f | [] | no_license | pkdevbox/osee | 7ad9c083c3df8a7e9ef6185a419680cc08e21769 | 7e31f80f43d6d0b661af521fdd93b139cb694001 | refs/heads/master | 2021-01-22T00:30:05.686402 | 2015-06-08T21:19:57 | 2015-06-09T18:42:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 878 | java | /*******************************************************************************
* Copyright (c) 2015 Boeing.
* 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:
* Boeing - initial API and implementation
*******************************************************************************/
package org.eclipse.osee.ats.impl.internal.workitem;
import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.core.version.AbstractAtsVersionServiceImpl;
/**
* @author Donald G. Dunne
*/
public class AtsVersionServiceImpl extends AbstractAtsVersionServiceImpl {
public AtsVersionServiceImpl(IAtsServices services) {
super(services);
}
}
| [
"[email protected]"
] | |
663114d61e68e1b4f5b9239829762f97f1b72a7f | 90047daeb462598a924d76ddf4288e832e86417c | /chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java | 5318960d85db9ea3ce46fba5c58895868eea2bd8 | [
"BSD-3-Clause"
] | permissive | massbrowser/android | 99b8c21fa4552a13c06bbedd0f9c88dd4a4ad080 | a9c4371682c9443d6e1d66005d4db61a24a9617c | refs/heads/master | 2022-11-04T21:15:50.656802 | 2017-06-08T12:31:39 | 2017-06-08T12:31:39 | 93,747,579 | 2 | 2 | BSD-3-Clause | 2022-10-31T10:34:25 | 2017-06-08T12:36:07 | null | UTF-8 | Java | false | false | 26,683 | java | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.util.MathUtils;
import org.chromium.ui.base.DeviceFormFactor;
import org.chromium.ui.widget.TextViewWithClickableSpans;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* A general-purpose dialog for presenting a list of things to pick from.
*
* The dialog is shown by the ItemChooserDialog constructor, and always calls
* ItemSelectedCallback.onItemSelected() as it's closing.
*/
public class ItemChooserDialog {
/**
* An interface to implement to get a callback when something has been
* selected.
*/
public interface ItemSelectedCallback {
/**
* Returns the user selection.
*
* @param id The id of the item selected. Blank if the dialog was closed
* without selecting anything.
*/
void onItemSelected(String id);
}
/**
* A class representing one data row in the picker.
*/
public static class ItemChooserRow {
private final String mKey;
private String mDescription;
private Drawable mIcon;
private String mIconDescription;
public ItemChooserRow(String key, String description, @Nullable Drawable icon,
@Nullable String iconDescription) {
mKey = key;
mDescription = description;
mIcon = icon;
mIconDescription = iconDescription;
}
/**
* Returns true if all parameters match the corresponding member.
*
* @param key Expected item unique identifier.
* @param description Expected item description.
* @param icon Expected item icon.
*/
public boolean hasSameContents(String key, String description, @Nullable Drawable icon,
@Nullable String iconDescription) {
if (!TextUtils.equals(mKey, key)) return false;
if (!TextUtils.equals(mDescription, description)) return false;
if (!TextUtils.equals(mIconDescription, iconDescription)) return false;
if (icon == null ^ mIcon == null) return false;
if (mIcon != null && !mIcon.getConstantState().equals(icon.getConstantState())) {
return false;
}
return true;
}
}
/**
* The labels to show in the dialog.
*/
public static class ItemChooserLabels {
// The title at the top of the dialog.
public final CharSequence title;
// The message to show while there are no results.
public final CharSequence searching;
// The message to show when no results were produced.
public final CharSequence noneFound;
// A status message to show above the button row after an item has
// been added and discovery is still ongoing.
public final CharSequence statusActive;
// A status message to show above the button row after discovery has
// stopped and no devices have been found.
public final CharSequence statusIdleNoneFound;
// A status message to show above the button row after an item has
// been added and discovery has stopped.
public final CharSequence statusIdleSomeFound;
// The label for the positive button (e.g. Select/Pair).
public final CharSequence positiveButton;
public ItemChooserLabels(CharSequence title, CharSequence searching, CharSequence noneFound,
CharSequence statusActive, CharSequence statusIdleNoneFound,
CharSequence statusIdleSomeFound, CharSequence positiveButton) {
this.title = title;
this.searching = searching;
this.noneFound = noneFound;
this.statusActive = statusActive;
this.statusIdleNoneFound = statusIdleNoneFound;
this.statusIdleSomeFound = statusIdleSomeFound;
this.positiveButton = positiveButton;
}
}
/**
* Item holder for performance boost.
*/
private static class ViewHolder {
private TextView mTextView;
private ImageView mImageView;
public ViewHolder(View view) {
mImageView = (ImageView) view.findViewById(R.id.icon);
mTextView = (TextView) view.findViewById(R.id.description);
}
}
/**
* The various states the dialog can represent.
*/
private enum State { INITIALIZING_ADAPTER, STARTING, PROGRESS_UPDATE_AVAILABLE, DISCOVERY_IDLE }
/**
* An adapter for keeping track of which items to show in the dialog.
*/
public class ItemAdapter extends ArrayAdapter<ItemChooserRow>
implements AdapterView.OnItemClickListener {
private final LayoutInflater mInflater;
// The zero-based index of the item currently selected in the dialog,
// or -1 (INVALID_POSITION) if nothing is selected.
private int mSelectedItem = ListView.INVALID_POSITION;
// A set of keys that are marked as disabled in the dialog.
private Set<String> mDisabledEntries = new HashSet<String>();
// Item descriptions are counted in a map.
private Map<String, Integer> mItemDescriptionMap = new HashMap<>();
// Map of keys to items so that we can access the items in O(1).
private Map<String, ItemChooserRow> mKeyToItemMap = new HashMap<>();
// True when there is at least one row with an icon.
private boolean mHasIcon;
public ItemAdapter(Context context, int resource) {
super(context, resource);
mInflater = LayoutInflater.from(context);
}
@Override
public boolean isEmpty() {
boolean isEmpty = super.isEmpty();
if (isEmpty) {
assert mKeyToItemMap.isEmpty();
assert mDisabledEntries.isEmpty();
assert mItemDescriptionMap.isEmpty();
} else {
assert !mKeyToItemMap.isEmpty();
assert !mItemDescriptionMap.isEmpty();
}
return isEmpty;
}
/**
* Adds an item to the list to show in the dialog if the item
* was not in the chooser. Otherwise updates the items description, icon
* and icon description.
* @param key Unique identifier for that item.
* @param description Text in the row.
* @param icon Drawable to show next to the item.
* @param iconDescription Description of the icon.
*/
public void addOrUpdate(String key, String description, @Nullable Drawable icon,
@Nullable String iconDescription) {
ItemChooserRow oldItem = mKeyToItemMap.get(key);
if (oldItem != null) {
if (oldItem.hasSameContents(key, description, icon, iconDescription)) {
// No need to update anything.
return;
}
if (!TextUtils.equals(oldItem.mDescription, description)) {
removeFromDescriptionsMap(oldItem.mDescription);
oldItem.mDescription = description;
addToDescriptionsMap(oldItem.mDescription);
}
if (!ApiCompatibilityUtils.objectEquals(icon, oldItem.mIcon)) {
oldItem.mIcon = icon;
oldItem.mIconDescription = iconDescription;
}
notifyDataSetChanged();
return;
}
assert !mKeyToItemMap.containsKey(key);
ItemChooserRow newItem = new ItemChooserRow(key, description, icon, iconDescription);
mKeyToItemMap.put(key, newItem);
addToDescriptionsMap(newItem.mDescription);
add(newItem);
}
public void removeItemWithKey(String key) {
ItemChooserRow oldItem = mKeyToItemMap.remove(key);
if (oldItem == null) return;
int oldItemPosition = getPosition(oldItem);
// If the removed item is the item that is currently selected, deselect it
// and disable the confirm button. Otherwise if the removed item is before
// the currently selected item, the currently selected item's index needs
// to be adjusted by one.
if (oldItemPosition == mSelectedItem) {
mSelectedItem = ListView.INVALID_POSITION;
mConfirmButton.setEnabled(false);
} else if (oldItemPosition < mSelectedItem) {
--mSelectedItem;
}
removeFromDescriptionsMap(oldItem.mDescription);
super.remove(oldItem);
}
@Override
public void clear() {
mSelectedItem = ListView.INVALID_POSITION;
mKeyToItemMap.clear();
mDisabledEntries.clear();
mItemDescriptionMap.clear();
mConfirmButton.setEnabled(false);
super.clear();
}
/**
* Returns the key of the currently selected item or blank if nothing is
* selected.
*/
public String getSelectedItemKey() {
if (mSelectedItem == ListView.INVALID_POSITION) return "";
ItemChooserRow row = getItem(mSelectedItem);
if (row == null) return "";
return row.mKey;
}
/**
* Returns the text to be displayed on the chooser for an item. For items with the same
* description, their unique keys are appended to distinguish them.
* @param position The index of the item.
*/
public String getDisplayText(int position) {
ItemChooserRow item = getItem(position);
String description = item.mDescription;
int counter = mItemDescriptionMap.get(description);
return counter == 1 ? description
: mActivity.getString(R.string.item_chooser_item_name_with_id, description,
item.mKey);
}
/**
* Sets whether the item is enabled. Disabled items are grayed out.
* @param id The id of the item to affect.
* @param enabled Whether the item should be enabled or not.
*/
public void setEnabled(String id, boolean enabled) {
if (enabled) {
mDisabledEntries.remove(id);
} else {
mDisabledEntries.add(id);
}
if (mSelectedItem != ListView.INVALID_POSITION) {
ItemChooserRow selectedRow = getItem(mSelectedItem);
if (id.equals(selectedRow.mKey) && !enabled) {
mSelectedItem = ListView.INVALID_POSITION;
mConfirmButton.setEnabled(enabled);
}
}
notifyDataSetChanged();
}
@Override
public boolean isEnabled(int position) {
ItemChooserRow item = getItem(position);
return !mDisabledEntries.contains(item.mKey);
}
@Override
public int getViewTypeCount() {
return 1;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder row;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.item_chooser_dialog_row, parent, false);
row = new ViewHolder(convertView);
convertView.setTag(row);
} else {
row = (ViewHolder) convertView.getTag();
}
row.mTextView.setSelected(position == mSelectedItem);
row.mTextView.setEnabled(isEnabled(position));
row.mTextView.setText(getDisplayText(position));
// If there is at least one item with an icon then we set mImageView's
// visibility to INVISIBLE for all items with no icons. We do this
// so that all items' desriptions are aligned.
if (!mHasIcon) {
row.mImageView.setVisibility(View.GONE);
} else {
ItemChooserRow item = getItem(position);
if (item.mIcon != null) {
row.mImageView.setContentDescription(item.mIconDescription);
row.mImageView.setImageDrawable(item.mIcon);
row.mImageView.setVisibility(View.VISIBLE);
} else {
row.mImageView.setVisibility(View.INVISIBLE);
row.mImageView.setImageDrawable(null);
row.mImageView.setContentDescription(null);
}
row.mImageView.setSelected(position == mSelectedItem);
}
return convertView;
}
@Override
public void notifyDataSetChanged() {
mHasIcon = false;
for (ItemChooserRow row : mKeyToItemMap.values()) {
if (row.mIcon != null) mHasIcon = true;
}
super.notifyDataSetChanged();
}
@Override
public void onItemClick(AdapterView<?> adapter, View view, int position, long id) {
mSelectedItem = position;
mConfirmButton.setEnabled(true);
notifyDataSetChanged();
}
private void addToDescriptionsMap(String description) {
int count = mItemDescriptionMap.containsKey(description)
? mItemDescriptionMap.get(description)
: 0;
mItemDescriptionMap.put(description, count + 1);
}
private void removeFromDescriptionsMap(String description) {
if (!mItemDescriptionMap.containsKey(description)) {
return;
}
int count = mItemDescriptionMap.get(description);
if (count == 1) {
mItemDescriptionMap.remove(description);
} else {
mItemDescriptionMap.put(description, count - 1);
}
}
}
private Activity mActivity;
// The dialog this class encapsulates.
private Dialog mDialog;
// The callback to notify when the user selected an item.
private ItemSelectedCallback mItemSelectedCallback;
// Individual UI elements.
private TextViewWithClickableSpans mTitle;
private TextViewWithClickableSpans mEmptyMessage;
private ProgressBar mProgressBar;
private ListView mListView;
private TextView mStatus;
private Button mConfirmButton;
// The labels to display in the dialog.
private ItemChooserLabels mLabels;
// The adapter containing the items to show in the dialog.
private ItemAdapter mItemAdapter;
// How much of the height of the screen should be taken up by the listview.
private static final float LISTVIEW_HEIGHT_PERCENT = 0.30f;
// The height of a row of the listview in dp.
private static final int LIST_ROW_HEIGHT_DP = 48;
// The minimum height of the listview in the dialog (in dp).
private static final int MIN_HEIGHT_DP = (int) (LIST_ROW_HEIGHT_DP * 1.5);
// The maximum height of the listview in the dialog (in dp).
private static final int MAX_HEIGHT_DP = (int) (LIST_ROW_HEIGHT_DP * 8.5);
// If this variable is false, the window should be closed when it loses focus;
// Otherwise, the window should not be closed when it loses focus.
private boolean mIgnorePendingWindowFocusChangeForClose;
/**
* Creates the ItemChooserPopup and displays it (and starts waiting for data).
*
* @param activity Activity which is used for launching a dialog.
* @param callback The callback used to communicate back what was selected.
* @param labels The labels to show in the dialog.
*/
public ItemChooserDialog(
Activity activity, ItemSelectedCallback callback, ItemChooserLabels labels) {
mActivity = activity;
mItemSelectedCallback = callback;
mLabels = labels;
LinearLayout dialogContainer = (LinearLayout) LayoutInflater.from(mActivity).inflate(
R.layout.item_chooser_dialog, null);
mListView = (ListView) dialogContainer.findViewById(R.id.items);
mProgressBar = (ProgressBar) dialogContainer.findViewById(R.id.progress);
mStatus = (TextView) dialogContainer.findViewById(R.id.status);
mTitle = (TextViewWithClickableSpans) dialogContainer.findViewById(
R.id.dialog_title);
mEmptyMessage =
(TextViewWithClickableSpans) dialogContainer.findViewById(R.id.not_found_message);
mTitle.setText(labels.title);
mTitle.setMovementMethod(LinkMovementMethod.getInstance());
mEmptyMessage.setMovementMethod(LinkMovementMethod.getInstance());
mStatus.setMovementMethod(LinkMovementMethod.getInstance());
mConfirmButton = (Button) dialogContainer.findViewById(R.id.positive);
mConfirmButton.setText(labels.positiveButton);
mConfirmButton.setEnabled(false);
mConfirmButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mItemSelectedCallback.onItemSelected(mItemAdapter.getSelectedItemKey());
mDialog.setOnDismissListener(null);
mDialog.dismiss();
}
});
mItemAdapter = new ItemAdapter(mActivity, R.layout.item_chooser_dialog_row);
mItemAdapter.setNotifyOnChange(true);
mListView.setAdapter(mItemAdapter);
mListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
mListView.setEmptyView(mEmptyMessage);
mListView.setOnItemClickListener(mItemAdapter);
mListView.setDivider(null);
setState(State.STARTING);
// The list is the main element in the dialog and it should grow and
// shrink according to the size of the screen available.
View listViewContainer = dialogContainer.findViewById(R.id.container);
listViewContainer.setLayoutParams(new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT,
getListHeight(mActivity.getWindow().getDecorView().getHeight(),
mActivity.getResources().getDisplayMetrics().density)));
mIgnorePendingWindowFocusChangeForClose = false;
showDialogForView(dialogContainer);
}
/**
* Sets whether the window should be closed when it loses focus.
*
* @param ignorePendingWindowFocusChangeForClose Whether the window should be closed when it
* loses focus.
*/
public void setIgnorePendingWindowFocusChangeForClose(
boolean ignorePendingWindowFocusChangeForClose) {
mIgnorePendingWindowFocusChangeForClose = ignorePendingWindowFocusChangeForClose;
}
// Computes the height of the device list, bound to half-multiples of the
// row height so that it's obvious if there are more elements to scroll to.
@VisibleForTesting
static int getListHeight(int decorHeight, float density) {
float heightDp = decorHeight / density * LISTVIEW_HEIGHT_PERCENT;
// Round to (an integer + 0.5) times LIST_ROW_HEIGHT.
heightDp = (Math.round(heightDp / LIST_ROW_HEIGHT_DP - 0.5f) + 0.5f) * LIST_ROW_HEIGHT_DP;
heightDp = MathUtils.clamp(heightDp, MIN_HEIGHT_DP, MAX_HEIGHT_DP);
return (int) Math.round(heightDp * density);
}
private void showDialogForView(View view) {
mDialog = new Dialog(mActivity) {
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (!mIgnorePendingWindowFocusChangeForClose && !hasFocus) super.dismiss();
setIgnorePendingWindowFocusChangeForClose(false);
}
};
mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
mDialog.setCanceledOnTouchOutside(true);
mDialog.addContentView(view,
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT));
mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
mItemSelectedCallback.onItemSelected("");
}
});
Window window = mDialog.getWindow();
if (!DeviceFormFactor.isTablet(mActivity)) {
// On smaller screens, make the dialog fill the width of the screen,
// and appear at the top.
window.setBackgroundDrawable(new ColorDrawable(Color.WHITE));
window.setGravity(Gravity.TOP);
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
}
mDialog.show();
}
public void dismiss() {
mDialog.dismiss();
}
/**
* Adds an item to the end of the list to show in the dialog if the item
* was not in the chooser. Otherwise updates the items description.
*
* @param key Unique identifier for that item.
* @param description Text in the row.
*/
public void addOrUpdateItem(String key, String description) {
addOrUpdateItem(key, description, null /* icon */, null /* iconDescription */);
}
/**
* Adds an item to the end of the list to show in the dialog if the item
* was not in the chooser. Otherwise updates the items description or icon.
* Note that as long as at least one item has an icon all rows will be inset
* with the icon dimensions.
*
* @param key Unique identifier for that item.
* @param description Text in the row.
* @param icon Drawable to show left of the description. The drawable provided should
* be stateful and handle the selected state to be rendered correctly.
* @param iconDescription Description of the icon.
*/
public void addOrUpdateItem(String key, String description, @Nullable Drawable icon,
@Nullable String iconDescription) {
mProgressBar.setVisibility(View.GONE);
mItemAdapter.addOrUpdate(key, description, icon, iconDescription);
setState(State.PROGRESS_UPDATE_AVAILABLE);
}
/**
* Removes an item that is shown in the dialog.
*
* @param key Unique identifier for the item.
*/
public void removeItemFromList(String key) {
mItemAdapter.removeItemWithKey(key);
setState(State.DISCOVERY_IDLE);
}
/**
* Indicates the chooser that no more items will be added.
*/
public void setIdleState() {
mProgressBar.setVisibility(View.GONE);
setState(State.DISCOVERY_IDLE);
}
/**
* Sets whether the item is enabled.
* @param key Unique indetifier for the item.
* @param enabled Whether the item should be enabled or not.
*/
public void setEnabled(String key, boolean enabled) {
mItemAdapter.setEnabled(key, enabled);
}
/**
* Indicates the adapter is being initialized.
*/
public void signalInitializingAdapter() {
setState(State.INITIALIZING_ADAPTER);
}
/**
* Clear all items from the dialog.
*/
public void clear() {
mItemAdapter.clear();
setState(State.STARTING);
}
/**
* Shows an error message in the dialog.
*/
public void setErrorState(CharSequence errorMessage, CharSequence errorStatus) {
mListView.setVisibility(View.GONE);
mProgressBar.setVisibility(View.GONE);
mEmptyMessage.setText(errorMessage);
mEmptyMessage.setVisibility(View.VISIBLE);
mStatus.setText(errorStatus);
}
private void setState(State state) {
switch (state) {
case INITIALIZING_ADAPTER:
mListView.setVisibility(View.GONE);
mProgressBar.setVisibility(View.VISIBLE);
mEmptyMessage.setVisibility(View.GONE);
break;
case STARTING:
mStatus.setText(mLabels.searching);
mListView.setVisibility(View.GONE);
mProgressBar.setVisibility(View.VISIBLE);
mEmptyMessage.setVisibility(View.GONE);
break;
case PROGRESS_UPDATE_AVAILABLE:
mStatus.setText(mLabels.statusActive);
mProgressBar.setVisibility(View.GONE);
mListView.setVisibility(View.VISIBLE);
break;
case DISCOVERY_IDLE:
boolean showEmptyMessage = mItemAdapter.isEmpty();
mStatus.setText(showEmptyMessage
? mLabels.statusIdleNoneFound : mLabels.statusIdleSomeFound);
mEmptyMessage.setText(mLabels.noneFound);
mEmptyMessage.setVisibility(showEmptyMessage ? View.VISIBLE : View.GONE);
break;
}
}
/**
* Returns the dialog associated with this class. For use with tests only.
*/
@VisibleForTesting
public Dialog getDialogForTesting() {
return mDialog;
}
/**
* Returns the ItemAdapter associated with this class. For use with tests only.
*/
@VisibleForTesting
public ItemAdapter getItemAdapterForTesting() {
return mItemAdapter;
}
}
| [
"[email protected]"
] | |
9c88d6cfea07361150afc6a0dceac27c85599ce4 | c86fd16696bbfa190624bfcd2449b82b784937b1 | /assessment/src/main/java/com/atmecs/pages/AboutUsPage.java | e3ec8ddae73ec7ee025f55e81ce86a55363c4f64 | [] | no_license | kishor-joshi/modified-assessment | fc92480c4a47d5af43eb43a49db8aad4f8b1ace5 | bd4700d81fd99e9f94810b9cf93b597d5b7e69ab | refs/heads/master | 2023-05-10T19:32:12.606826 | 2019-10-03T16:37:21 | 2019-10-03T16:37:21 | 211,343,646 | 0 | 0 | null | 2023-05-01T20:39:34 | 2019-09-27T14:59:17 | HTML | UTF-8 | Java | false | false | 1,259 | java | package com.atmecs.pages;
import java.io.FileInputStream;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.Test;
import com.atmecs.helper.ElementHelper;
import com.atmecs.utils.BaseClass;
import com.atmecs.utils.Constants;
public class AboutUsPage extends BaseClass{
public void aboutuspageFotterValidation(WebDriver driver) throws Exception {
Properties prop=new Properties();
ElementHelper helper=new ElementHelper();
ValidateFooter footer=new ValidateFooter();
FileInputStream input = new FileInputStream(Constants.homeLocatorPropertiesFilePath);
prop.load(input);
Actions action = new Actions(driver);
WebElement element=helper.getElement(driver, prop, "aboutus");
action.moveToElement(element).build().perform();
element.click();
driver.manage().timeouts().pageLoadTimeout(Constants.waitingTime, TimeUnit.SECONDS);
String title=driver.getTitle();
System.out.println(title);
driver.manage().timeouts().implicitlyWait(Constants.waitingTime, TimeUnit.SECONDS);
System.out.println("before");
//validate footer at about page
footer.ValidateFooterContent(driver);
}
}
| [
"[email protected]"
] | |
359e73fc7203d45960688ba1bdbe51cd9ec8eab2 | 2b988ed13fb200c7e1bfeceff99226faf8955119 | /src/java_20210528/TransactionMain.java | 2b5725650e2d386dd44c136cafc0beeba8b18df1 | [] | no_license | LambFerret/java-eclipse | 36d53099c8615791c49f3f9989990be12e445f76 | 707673042602081a805c8b48e20794cb4f235884 | refs/heads/master | 2023-06-02T06:56:11.985135 | 2021-06-16T00:08:40 | 2021-06-16T00:08:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,732 | java | package java_20210528;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class TransactionMain {
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Class.forName("org.mariadb.jdbc.Driver");
System.out.println("도라이버 로드 성공!");
} catch (ClassNotFoundException e) {
System.out.println("도라이버 로드 실패 ㅠㅠ");
}
boolean success = false;
Connection con = null;
PreparedStatement pstmt1 = null;
PreparedStatement pstmt2 = null;
try {
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/ssc", "root", "root1234");
System.out.println("데베 연결 성공!");
// 트랜잭션 시작
con.setAutoCommit(false);
StringBuilder sql = new StringBuilder();
sql.append("INSERT INTO member(num, name , addr) VALUES (20,'igotit','igot1')");
pstmt1 = con.prepareStatement(sql.toString());
pstmt1.executeUpdate();
sql.setLength(0);
sql.append("INSERT INTO member(num, name , addr) VALUES (8,'igotit','igot1')");
pstmt2 = con.prepareStatement(sql.toString());
pstmt2.executeUpdate();
success = true;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
if (success) {
con.commit();
} else {
con.rollback();
}
// Connection Pool 사용할때 반드시 해저야하는거 :
con.setAutoCommit(true);
if (con != null)
con.close();
if (pstmt1 != null)
pstmt1.close();
if (pstmt2 != null)
pstmt2.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
| [
"[email protected]"
] | |
3a21719a5f3f3f122e905df4ed726bb2bf5abb16 | 15b00088c49bff7f4dd588603fd07a8bb1a9c817 | /accounting/src/main/java/accounting/webservice/login/LoginService.java | 62697acce0546ae3913160770cd7e045bbc9dfc8 | [] | no_license | myrra/restaccounting | e074014090874c5ea703416590d2e04093db0e0c | e0f703689021f5428834e15d23fb30edb4d66992 | refs/heads/master | 2021-01-12T13:10:57.792007 | 2016-10-27T19:26:01 | 2016-10-27T19:26:01 | 72,140,200 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 687 | java | package accounting.webservice.login;
import java.net.URI;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import accounting.webservice.login.entity.User;
@Path("/")
public class LoginService {
@POST
@Path("/login")
@Produces("application/json")
public Response login(User user) {
try {
Response response = Response
.created(URI.create("/"))
.entity(user)
.status(200)
.build();
return response;
} catch (Exception e) {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
.header("Access-Control-Allow-Origin", "http://192.168.1.2:3000").build();
}
}
}
| [
"[email protected]"
] | |
3bb287381d53f273595faf3e8fde12dced2a3a0f | 5443da8d768b4b3f94fd750ee189609ed56326a7 | /src/test/java/roundsteps/MixColumnsTest.java | cea5089cea2316e160c18c29cd34e3d1d46881cf | [] | no_license | lesha300398/cyberSecurity | 88b8ad09908afc6814eddd9e1efecd25cf97642b | 4965d4368144bfcf850d881e7d51543b7500832d | refs/heads/aes | 2020-07-31T03:47:04.156406 | 2019-09-23T23:22:06 | 2019-09-23T23:22:06 | 210,474,000 | 0 | 0 | null | 2019-11-19T02:31:00 | 2019-09-24T00:03:27 | Java | UTF-8 | Java | false | false | 2,034 | java | package roundsteps;
import org.junit.Assert;
import org.junit.Test;
import lesha3003.aes.Utils;
import lesha3003.aes.roundsteps.MixColumns;
public class MixColumnsTest {
// test cases from https://en.wikipedia.org/wiki/Rijndael_MixColumns
@Test
public void mixColumns_test() {
final byte[][] state = {
{(byte) 0xDB, (byte) 0xF2, (byte) 0xD4, (byte) 0xC6},
{(byte) 0x13, (byte) 0x0A, (byte) 0xD4, (byte) 0xC6},
{(byte) 0x53, (byte) 0x22, (byte) 0xD4, (byte) 0xC6},
{(byte) 0x45, (byte) 0x5C, (byte) 0xD5, (byte) 0xC6}
};
final byte[][] expectedResult = {
{(byte) 0x8E, (byte) 0x9F, (byte) 0xD5, (byte) 0xC6},
{(byte) 0x4D, (byte) 0xDC, (byte) 0xD5, (byte) 0xC6},
{(byte) 0xA1, (byte) 0x58, (byte) 0xD7, (byte) 0xC6},
{(byte) 0xBC, (byte) 0x9D, (byte) 0xD6, (byte) 0xC6}
};
byte[] stateBytes = Utils.matrixToBytes(state);
MixColumns.mixColumns(stateBytes);
Assert.assertArrayEquals(expectedResult,Utils.bytesToMatrix(stateBytes));
}
@Test
public void invMixColumns_test() {
final byte[][] state = {
{(byte) 0x8E, (byte) 0x9F, (byte) 0xD5, (byte) 0xC6},
{(byte) 0x4D, (byte) 0xDC, (byte) 0xD5, (byte) 0xC6},
{(byte) 0xA1, (byte) 0x58, (byte) 0xD7, (byte) 0xC6},
{(byte) 0xBC, (byte) 0x9D, (byte) 0xD6, (byte) 0xC6}
};
final byte[][] expectedResult = {
{(byte) 0xDB, (byte) 0xF2, (byte) 0xD4, (byte) 0xC6},
{(byte) 0x13, (byte) 0x0A, (byte) 0xD4, (byte) 0xC6},
{(byte) 0x53, (byte) 0x22, (byte) 0xD4, (byte) 0xC6},
{(byte) 0x45, (byte) 0x5C, (byte) 0xD5, (byte) 0xC6}
};
byte[] stateBytes = Utils.matrixToBytes(state);
MixColumns.invMixColumns(stateBytes);
Assert.assertArrayEquals(expectedResult, Utils.bytesToMatrix(stateBytes));
}
}
| [
"[email protected]"
] | |
cd7cc5f46d0bd9e24351471a3f21cb59bed6d541 | 53c971cfa1b26d8a91fadf753cfbb9380c90a254 | /src/main/java/com/khpp/db/genric/GenericDao.java | f3205c4dc90845f40a4454982892c27a308847d5 | [] | no_license | Karlzzb/weixin-khpp | 69abf8e248caa8a2c41fafec8d2ebad42c665712 | a5e5107a73d78c84a94a9e0885c2265e0370c3ce | refs/heads/master | 2021-01-21T17:24:24.616949 | 2017-04-18T09:19:08 | 2017-04-18T09:19:08 | 85,376,947 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 899 | java | package com.khpp.db.genric;
/**
* 所有自定义Dao的顶级接口, 封装常用的增删查改操作, 可以通过Mybatis Generator Maven 插件自动生成Dao,
* 也可以手动编码,然后继承GenericDao 即可.
* <p/>
* Model : 代表数据库中的表 映射的Java对象类型 PK :代表对象的主键类型
*
* @author StarZou
* @since 2014年6月9日 下午6:14:06
*/
public interface GenericDao<Model, PK> {
/**
* 插入对象
*
* @param model
* 对象
*/
int insertSelective(Model model);
/**
* 更新对象
*
* @param model
* 对象
*/
int updateByPrimaryKeySelective(Model model);
/**
* 通过主键, 删除对象
*
* @param id
* 主键
*/
int deleteByPrimaryKey(PK id);
/**
* 通过主键, 查询对象
*
* @param id
* 主键
* @return
*/
Model selectByPrimaryKey(PK id);
}
| [
"[email protected]"
] | |
35e4a2a5436ebac6a93cb15b3e6d17c459d5b62d | 86546a56b6d3177e7650ce69a620ff6a41b9089c | /2016-02-12/src/Reptiles.java | 2a9053a4811742df1b890c28066a0d6140d4a758 | [] | no_license | Alenka11-401/Lonina_11401_Java_2016 | 7363748900702cc655cf4c3c1c1149a0e0f70520 | 2520f218ea0f2e750a0b75ed0026073e0c61b2f6 | refs/heads/master | 2021-01-13T00:48:25.489349 | 2016-03-10T17:37:50 | 2016-03-10T17:37:50 | 51,568,846 | 0 | 0 | null | 2016-02-26T08:17:24 | 2016-02-12T05:26:49 | Java | UTF-8 | Java | false | false | 190 | java | /**
* Created by alena on 12.02.16.
*/
public interface Reptiles {
String crawl = "You don`t observe me!";
void crawlFromDanger();
void stickOutTongue();
void layEggs();
}
| [
"[email protected]"
] | |
959270fa13d9050f2f1ce24001a27da6ad32983c | f07d3be20f1c56f2a37c93d49336f8528369796f | /SpringIntercepters/src/main/java/spring/inter/controller/IntercepterController.java | 3a43e879b5a95fee063e5573b822abae4e61d09c | [] | no_license | somkuwardinesh/SpringMVC | 505fd8894d276eb50fcb0a97e4803bebf3c66e67 | 5dcdcfdbf6e3bda98d41408cf617f84ec06d0641 | refs/heads/master | 2021-01-20T04:58:33.691473 | 2017-10-05T16:30:11 | 2017-10-05T16:30:11 | 101,403,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 750 | java | package spring.inter.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import spring.inter.model.MyUser;
@Controller
public class IntercepterController {
@RequestMapping(value = "/index", method = RequestMethod.GET)
public String showPage(ModelMap modelMap) {
MyUser myUser = new MyUser();
modelMap.addAttribute("myUser", myUser);
return "register";
}
@RequestMapping(value = "/sunday", method = RequestMethod.GET)
public String sundayPage() {
return "sunday";
}
}
| [
"Dinesh@DESKTOP-V2A3146"
] | Dinesh@DESKTOP-V2A3146 |
05e44d590248454de817aa98f66ee64588055186 | 4bdedb7853b80dbda0604825305b9dc1545cbaca | /src/java/nc/model/ModelNuclearMonster.java | 72bfbf0e506ee43f7902151a64ac91e24bfa7bbf | [] | no_license | chaos234/NuclearCraft | 44bbaeabcbe04e738ea0d0c76d042f961a39a712 | a9540677b63b76ea133768fcfa27da4947397a65 | refs/heads/master | 2021-01-11T19:20:21.350723 | 2017-01-04T19:22:19 | 2017-01-04T19:22:19 | 79,321,397 | 0 | 0 | null | 2017-01-18T08:54:33 | 2017-01-18T08:54:33 | null | UTF-8 | Java | false | false | 3,731 | java | package nc.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
public class ModelNuclearMonster extends ModelBase
{
//fields
ModelRenderer Head;
ModelRenderer Headwear;
ModelRenderer Body;
ModelRenderer RightArm;
ModelRenderer LeftArm;
ModelRenderer RightLeg;
ModelRenderer LeftLeg;
public ModelNuclearMonster()
{
textureWidth = 64;
textureHeight = 64;
Head = new ModelRenderer(this, 0, 0);
Head.addBox(-4F, -8F, -4F, 8, 8, 8);
Head.setRotationPoint(0F, -30F, 0F);
Head.setTextureSize(64, 64);
Head.mirror = true;
setRotation(Head, 0F, 0F, 0F);
Headwear = new ModelRenderer(this, 0, 16);
Headwear.addBox(-4F, -8F, -4F, 8, 8, 8);
Headwear.setRotationPoint(0F, -30F, 0F);
Headwear.setTextureSize(64, 64);
Headwear.mirror = true;
setRotation(Headwear, 0F, 0F, 0F);
Body = new ModelRenderer(this, 32, 16);
Body.addBox(-4F, 0F, -2F, 8, 4, 4);
Body.setRotationPoint(0F, -30F, 0F);
Body.setTextureSize(64, 64);
Body.mirror = true;
setRotation(Body, 0F, 0F, 0F);
RightArm = new ModelRenderer(this, 56, 0);
RightArm.addBox(-1F, -2F, -1F, 2, 52, 2);
RightArm.setRotationPoint(-5F, -28F, 0F);
RightArm.setTextureSize(64, 64);
RightArm.mirror = true;
setRotation(RightArm, 0F, 0F, 0F);
LeftArm = new ModelRenderer(this, 56, 0);
LeftArm.addBox(-1F, -2F, -1F, 2, 52, 2);
LeftArm.setRotationPoint(5F, -28F, 0F);
LeftArm.setTextureSize(64, 64);
LeftArm.mirror = true;
setRotation(LeftArm, 0F, 0F, 0F);
RightLeg = new ModelRenderer(this, 56, 0);
RightLeg.addBox(-1F, 0F, -1F, 2, 50, 2);
RightLeg.setRotationPoint(-2F, -26F, 0F);
RightLeg.setTextureSize(64, 64);
RightLeg.mirror = true;
setRotation(RightLeg, 0F, 0F, 0F);
LeftLeg = new ModelRenderer(this, 56, 0);
LeftLeg.addBox(-1F, 0F, -1F, 2, 50, 2);
LeftLeg.setRotationPoint(2F, -26F, 0F);
LeftLeg.setTextureSize(64, 64);
LeftLeg.mirror = true;
setRotation(LeftLeg, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
Head.render(f5);
Headwear.render(f5);
Body.render(f5);
RightArm.render(f5);
LeftArm.render(f5);
RightLeg.render(f5);
LeftLeg.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.Head.rotateAngleY = f3 / (180F / (float)Math.PI);
this.Head.rotateAngleX = f4 / (180F / (float)Math.PI);
this.Headwear.rotateAngleY = this.Head.rotateAngleY;
this.Headwear.rotateAngleX = this.Head.rotateAngleX;
this.RightArm.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 2.0F * f1 * 0.5F * 0.1F;
this.LeftArm.rotateAngleX = MathHelper.cos(f * 0.6662F) * 2.0F * f1 * 0.5F * 0.1F;
this.RightArm.rotateAngleZ = 0.0F;
this.LeftArm.rotateAngleZ = 0.0F;
this.RightLeg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1 * 0.1F;
this.LeftLeg.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1 * 0.1F;
this.RightLeg.rotateAngleY = 0.0F;
this.LeftLeg.rotateAngleY = 0.0F;
}
}
| [
"[email protected]"
] | |
5c0506c849f1ca5232298cfa929fe9ba77ae5313 | 9dd38dae47f7527647fa7e7f0f71143ba5ac0b4e | /RTO-Registration/src/main/java/com/USA/RTO/Entity/VeichleOwnerRegstrtnEntity.java | ba3c89976f5ff2ab9f5143b8acdd996ffe7ff87b | [] | no_license | Shree12GitRepo/Automatic-TollPlaza-Mgt-System | 41a763e751593d689725eae8e442c4be728e882a | 3cd39666e8b2ea80dc1d0a15ed3db6c493f77b3e | refs/heads/master | 2020-08-24T17:02:53.813708 | 2019-10-29T13:12:44 | 2019-10-29T13:12:44 | 216,868,468 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,717 | java | package com.USA.RTO.Entity;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.CreationTimestamp;
@Entity
@Table(name="vchl_ownr_dtls")
public class VeichleOwnerRegstrtnEntity {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE,generator = "vchl_ownrSeq")
@SequenceGenerator(sequenceName = "ownr_seq",allocationSize = 1,name = "vchl_ownrSeq")
private int vchl_ownrID;
@Column(name = "OWNR_FNAME", length = 10)
private String owner_Fname;
@Column(name = "OWNR_LNAME", length = 8)
private String owner_Lname;
@Column(name = "OWNR_MAIL", length = 30)
private String owner_email;
@Column(name = "OWNR_MOB", length = 10)
private Long owner_Mob;
@Column(name = "OWNR_DOB")
@Temporal(TemporalType.DATE)
private Date owner_DOB;
@Column(name = "OWNR_GENDER",length = 6)
private String owner_Gender;
@CreationTimestamp
@Column(name = "OWNR_CREATE_DATE", nullable = false)
private LocalDateTime ownr_create_Date;
public String getOwner_Fname() {
return owner_Fname;
}
public void setOwner_Fname(String owner_Fname) {
this.owner_Fname = owner_Fname;
}
public String getOwner_Lname() {
return owner_Lname;
}
public void setOwner_Lname(String owner_Lname) {
this.owner_Lname = owner_Lname;
}
public String getOwner_email() {
return owner_email;
}
public void setOwner_email(String owner_email) {
this.owner_email = owner_email;
}
public Long getOwner_Mob() {
return owner_Mob;
}
public void setOwner_Mob(Long owner_Mob) {
this.owner_Mob = owner_Mob;
}
public Date getOwner_DOB() {
return owner_DOB;
}
public void setOwner_DOB(Date owner_DOB) {
this.owner_DOB = owner_DOB;
}
public String getOwner_Gender() {
return owner_Gender;
}
public void setOwner_Gender(String owner_Gender) {
this.owner_Gender = owner_Gender;
}
public int getVchl_ownrID() {
return vchl_ownrID;
}
public void setVchl_ownrID(int vchl_ownrID) {
this.vchl_ownrID = vchl_ownrID;
}
public LocalDateTime getOwnr_create_Date() {
return ownr_create_Date;
}
public void setOwnr_create_Date(LocalDateTime ownr_create_Date) {
this.ownr_create_Date = ownr_create_Date;
}
}
| [
"[email protected]"
] | |
362fb0860432a4bdc49046f0f853f557f6f791bf | 14746c4b8511abe301fd470a152de627327fe720 | /soroush-android-1.10.0_source_from_JADX/org/jivesoftware/smack/filter/MessageWithBodiesFilter.java | 5aaf045424502261e6fd196af8c77b86ecd3db87 | [] | no_license | maasalan/soroush-messenger-apis | 3005c4a43123c6543dbcca3dd9084f95e934a6f4 | 29867bf53a113a30b1aa36719b1c7899b991d0a8 | refs/heads/master | 2020-03-21T21:23:20.693794 | 2018-06-28T19:57:01 | 2018-06-28T19:57:01 | 139,060,676 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 535 | java | package org.jivesoftware.smack.filter;
import org.jivesoftware.smack.packet.Message;
public final class MessageWithBodiesFilter extends FlexibleStanzaTypeFilter<Message> {
public static final StanzaFilter INSTANCE = new MessageWithBodiesFilter();
private MessageWithBodiesFilter() {
super(Message.class);
}
protected final boolean acceptSpecific(Message message) {
return !message.getBodies().isEmpty();
}
public final String toString() {
return getClass().getSimpleName();
}
}
| [
"[email protected]"
] | |
89c694a8a756ac9cb9ce513fe73962879df0ceaa | 0a3021666ee8a4227e97a0a39ce13528b90d59d7 | /src/main/java/com/websocket/model/HelloMessage.java | 6bd84829e3c849812a31a50685317ebe7acdea8a | [] | no_license | anilreddykatta/websocketsample | ace2cba31c731ed6a27b1345f64ee18134d1db06 | de2b69606773b4d9afb8721c6874e1a10dca87c1 | refs/heads/master | 2021-01-13T14:21:17.536666 | 2014-06-05T12:26:06 | 2014-06-05T12:26:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java | package com.websocket.model;
public class HelloMessage {
private String name;
public String getName() {
return name;
}
}
| [
"[email protected]"
] | |
d2aa06194cb99789a0b78834cbfbe3086631f542 | 06edfca59b414aca788759809b72f2f038a4e123 | /src/main/java/com/manoelbrito/cursomc/repositories/PedidoRepository.java | 1b6c3551e0633fe3031badbab20c8829e8cad320 | [] | no_license | manoelbrito/spring-boot-ionic-backend | e320a0ca1e5e8a33e77b4a70c18d507212f55d46 | 06d248a9b3b269c1a4306be98e632c1abc4579da | refs/heads/master | 2020-04-03T17:11:35.630612 | 2018-11-20T20:07:18 | 2018-11-20T20:07:18 | 155,435,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package com.manoelbrito.cursomc.repositories;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.manoelbrito.cursomc.domain.Cliente;
import com.manoelbrito.cursomc.domain.Pedido;
@Repository
public interface PedidoRepository extends JpaRepository<Pedido, Integer> {
@Transactional(readOnly=true)
Page<Pedido> findByCliente(Cliente cliente, Pageable pageRequest);
}
| [
"[email protected]"
] | |
eaac3021558d2050a5a8dec79ee28fbfd4968014 | 2b85899a8d9333f7747838971dca702c98ec4032 | /jobman-core/src/main/java/gtcloud/jobman/core/processor/SubjobEntity.java | 109709e3c48c7ffed4dd9b420b73af198dac046f | [] | no_license | cicadasworld/jobman-framework | 64040481d797b8baa276c16afbacc802a3c18492 | 99c16c575d6fcc28d7f5f4bfafe72ef7f111e0b3 | refs/heads/master | 2022-09-13T10:03:42.459815 | 2020-05-27T15:22:24 | 2020-05-27T15:22:24 | 267,354,555 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,162 | java | package gtcloud.jobman.core.processor;
import gtcloud.common.basetypes.PropertiesEx;
/**
* "子作业"实体对象。
*/
public interface SubjobEntity {
/**
* 返回"子作业"的描述子。
* @return "子作业"的描述子
*/
SubjobHandle getHandle();
/**
* 返回"主作业"的标题, 如'影像产品数据入库-20170427123022', 主要用于UI显示.
* @return "主作业"的标题
*/
String getJobCaption();
/**
* 获得作业的优先级。
* @return 作业的优先级。
*/
int getPriority();
/**
* 获得作业是否为收尾作业。
* @return 是否为收尾作业。
*/
boolean isReduce();
/**
* 返回子作业的可选属性。
* @return 子作业的可选属性
*/
PropertiesEx getOptions();
/**
* 返回子作业数据体,该数据的解释依赖于具体实现。
* @return 子作业数据体
*/
byte[] getSubjobBody();
/**
* 从给定对象拷贝数据到当前对象。
* @param from
* @param copyBody
*/
void copyFrom(SubjobEntity from, boolean copyBody);
}
| [
"[email protected]"
] | |
eea4d8213a159b16781f3268ce24e8e8f5e0c769 | 0513e1c8fc2d522bfdc3ef218deaf1447c98e7ce | /Table.java | 60b2feb42c5e7562f62c41829513c032a3798031 | [] | no_license | kartikpatnaik/java-basic | 1782afc989f3062eea92adc04d7367fbc121d21f | ff3a42963391f07d1f2d0a45da9ffabbff7aa633 | refs/heads/main | 2023-09-04T15:15:56.874158 | 2021-11-16T19:28:43 | 2021-11-16T19:28:43 | 354,379,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | import java.util.Scanner;
public class Table{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int table;
System.out.println("Enter an int: ");
table=sc.nextInt();
System.out.println("Table"+ table);
for(int j=1;j<=10;j++)
{
System.out.println(table + "*" + j +"=" + (table*j) );
}
}
} | [
"[email protected]"
] | |
3331e5b7227cf0dc0a9042906bbf5c1f8d66eb0d | c5fd25b2985dfefdf9450f142b88812a5dd12433 | /src/android/ScanPlugin.java | 3bda4daf1c2362abf63b9f0515cb34818af72a09 | [] | no_license | liuya891012/cordova-plugin-scan | 62dbce1d8e32cdae201cc082b7c9f5175df9f840 | 5ff4dd1d2d2150c94ba05035100acf94fe055a26 | refs/heads/master | 2020-12-23T20:12:01.543051 | 2017-05-27T05:42:48 | 2017-05-27T05:42:48 | 92,571,138 | 0 | 1 | null | 2017-05-27T05:41:51 | 2017-05-27T04:38:50 | Java | UTF-8 | Java | false | false | 3,865 | java | package ScanPlugin;
import java.util.HashMap;
import java.util.Map;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.media.SoundPool;
import android.net.Uri;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
import com.seuic.scanner.DecodeCallback;
import com.seuic.scanner.Scanner;
import com.seuic.scanner.ScannerFactory;
import com.seuic.scanner.ScannerKey;
/**
* This class echoes a string called from JavaScript.
*/
public class ScanPlugin extends CordovaPlugin implements DecodeCallback {
public static final String TAG = "ScanPlugin";
private Scanner mScanner;
private Context mContext;
private Activity mActivity;
private CallbackContext mCallback = null;
private InputMethodManager imm;
private SoundPool soundPool;
private Map<String, Integer> map = new HashMap<String, Integer>();
private Uri uri;
private Ringtone rt;
@Override
public boolean execute(String action, JSONArray args,
CallbackContext callbackContext) throws JSONException {
if (action.equals("getCode")) {
this.mCallback = callbackContext;
return true;
} else if (action.equals("closeScan")) {
this.mCallback = null;
this.mCallback.success();
return true;
} else if (action.equals("closeKeyboard")) {
if (imm != null) {
imm.hideSoftInputFromWindow(mActivity.getWindow()
.getCurrentFocus().getWindowToken(), 0);
return true;
}
} else if (action.equals("playOk")) {
soundPool.play(map.get("ok"), 1.0f, 1.0f, 0, 0, 1);
return true;
} else if (action.equals("playError")) {
soundPool.play(map.get("error"), 1.0f, 1.0f, 0, 0, 1);
return true;
} else if (action.equals("playSys")) {
rt.play();
return true;
}
return false;
}
@Override
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
// TODO Auto-generated method stub
super.initialize(cordova, webView);
mActivity = cordova.getActivity();
mContext = cordova.getActivity().getApplicationContext();
soundPool = new SoundPool(2, AudioManager.STREAM_NOTIFICATION, 100);
map.put("ok", soundPool.load(mActivity,mActivity.getResources().getIdentifier("ok", "raw",mActivity.getPackageName()), 1));
map.put("error", soundPool.load(mActivity,mActivity.getResources().getIdentifier("error", "raw",mActivity.getPackageName()), 1));
uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);// 绯荤粺鑷甫鎻愮ず闊�
rt = RingtoneManager.getRingtone(mActivity, uri);
mScanner = ScannerFactory.getScanner(mContext);
mScanner.open();
imm = (InputMethodManager) mContext
.getSystemService(Context.INPUT_METHOD_SERVICE);
new Thread(runnable).start();
mScanner.setDecodeCallBack(new DecodeCallback() {
@Override
public void onDecodeComplete(String arg0) {
if (mCallback != null) {
PluginResult result = new PluginResult(
PluginResult.Status.OK, arg0);
result.setKeepCallback(true);
mCallback.sendPluginResult(result);
}
}
});
}
Runnable runnable = new Runnable() {
@Override
public void run() {
int ret1 = ScannerKey.open();
if (ret1 > -1) {
while (true) {
int ret = ScannerKey.getKeyEvent();
if (ret > -1) {
switch (ret) {
case ScannerKey.KEY_DOWN:
mScanner.startScan();
break;
}
}
}
}
}
};
@Override
public void onDecodeComplete(String arg0) {
Toast.makeText(mContext, "2:" + arg0, Toast.LENGTH_SHORT).show();
// barcode = arg0;
}
}
| [
"[email protected]"
] | |
6c680fb81bca8c8de5fc7aa3d0da2cb8791f4722 | 7e6ad9e56cc743368ea6b23100bbb84b9741730f | /src/main/java/org/web6/controller/Greeting.java | 028142e8ae74fc583b8951fa1abf8fa3e5a06fa5 | [] | no_license | romanm/my6gradle | 7248992d8c80b82234c120ac3ae3be79fbdcdcd5 | 8d9cfa8cb4b172cdb3e59c8fef6d65f213118b90 | refs/heads/master | 2021-01-23T13:53:31.017903 | 2014-03-30T07:43:47 | 2014-03-30T07:43:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 295 | java | package org.web6.controller;
public class Greeting {
private final long id;
private final String content;
public Greeting(long id, String content) {
this.id = id;
this.content = content;
}
public long getId() {
return id;
}
public String getContent() {
return content;
}
}
| [
"[email protected]"
] | |
cd23e20d42345b4a2aae51d854ee9fa16e570caf | 4f558ce38e04062a8ec384419865cab7583bb901 | /src/main/java/cc/ycn/mp/bean/WxTemplateInfo.java | dfd8d311c1963d97d8d819dedba083e21b95a7dd | [
"Apache-2.0"
] | permissive | ycn/weixin-java | b6c21d38140a1c05e8b98f5a4b876fdf31134e92 | 62fbc208c1e2b0250ee8e4e77f42a071c4aaea6a | refs/heads/master | 2022-10-27T09:06:29.250026 | 2021-06-06T03:52:47 | 2021-06-06T03:52:47 | 47,816,209 | 2 | 0 | Apache-2.0 | 2022-10-18T21:23:45 | 2015-12-11T09:06:37 | Java | UTF-8 | Java | false | false | 852 | java | package cc.ycn.mp.bean;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.List;
/**
* Created by ydz on 16/4/23.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class WxTemplateInfo implements Serializable {
@JSONField(name = "template_list")
private List<WxTemplate> templateList;
public WxTemplateInfo() {
}
public WxTemplateInfo(List<WxTemplate> templateList) {
this.templateList = templateList;
}
public List<WxTemplate> getTemplateList() {
return templateList;
}
public void setTemplateList(List<WxTemplate> templateList) {
this.templateList = templateList;
}
}
| [
"[email protected]"
] | |
763bd3fed9b1d213296193f25dfe581ea8469a2f | 364bd91497a498b899c1de60e1ff028795eddbbc | /02Benchmarks/Openj9Test-Test/src/javaT/util/spi/ResourceBundleControlProvider/providersrc/UserControlProvider.java | f5d409a7cb6992e2afc916ad8c79b758a4cc16d1 | [] | no_license | JavaTailor/CFSynthesis | 8485f5d94cec335bedfdf18c88ddc523e05a0567 | bf9421fea49469fbac554da91169cf07aae3e08c | refs/heads/master | 2023-04-15T02:37:04.252151 | 2021-11-12T09:57:06 | 2021-11-12T09:57:06 | 402,928,654 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,785 | java | package javaT.util.spi.ResourceBundleControlProvider.providersrc;
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.util.ResourceBundle;
import java.util.spi.ResourceBundleControlProvider;
public class UserControlProvider implements ResourceBundleControlProvider {
static final ResourceBundle.Control XMLCONTROL = new UserXMLControl();
public ResourceBundle.Control getControl(String baseName) {
System.out.println(getClass().getName()+".getControl called for " + baseName);
// Throws a NPE if baseName is null.
if (baseName.startsWith("com.foo.Xml")) {
System.out.println("\treturns " + XMLCONTROL);
return XMLCONTROL;
}
System.out.println("\treturns null");
return null;
}
}
| [
"[email protected]"
] | |
b793e480ea290c83397dd031a2afc962a58da34e | f5f5d836c9a2fb7636d02283ccc6753678c273ad | /Enox Server/src/com/rs/game/player/dialogues/TokHaarHok.java | 6a109c837eb84fa737538fae90679f0a448a89a1 | [] | no_license | gnmmarechal/EnoxScapeReloaded | 3a48c1925fef1bfb7969230f4258a65ae21c7bf2 | ae9639be756b4adb139faa00553adf3e26c488fe | refs/heads/master | 2020-04-22T12:54:40.777755 | 2019-06-28T20:46:34 | 2019-06-28T20:46:34 | 170,389,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,991 | java | package com.rs.game.player.dialogues;
import java.util.TimerTask;
import com.rs.cores.CoresManager;
import com.rs.game.WorldTile;
import com.rs.game.player.controlers.FightKiln;
import com.rs.game.player.cutscenes.Cutscene;
import com.rs.utils.Logger;
public class TokHaarHok extends Dialogue {
private int npcId;
private int type;
private FightKiln fightKiln;
/// So...you accept our challenge. Let our sport be glorious. Xill - attack!
@Override
public void start() {
type = (Integer) parameters[0];
npcId = (Integer) parameters[1];
fightKiln = (FightKiln) parameters[2];
if(type == 0)
sendNPCDialogue(npcId, 9827, "Let us talk..." );
else if (type == 1)
sendNPCDialogue(npcId, 9827, "So...you accept our challenge. Let our sport be glorious. Xill - attack!" );
else if (type == 2)
sendNPCDialogue(npcId, 9827, "Well fought, "+player.getDisplayName()+". You are ferocious, but you must fight faster... The lava is rising." );
else if (type == 3)
sendNPCDialogue(npcId, 9827, "You must be carved from a rock inpervious to magic... You are quite the worthy foe." );
else if (type == 4)
sendNPCDialogue(npcId, 9827, "Hurry, "+player.getDisplayName()+"... Kill my brothers before the lava consumes you." );
else if (type == 7)
sendNPCDialogue(npcId, 9827, "Amazing! We haven't had such fun in such a long time. But now, the real challenge begins..." );
else if (type == 5)
sendNPCDialogue(npcId, 9827, "We have thrown many waves at you... You have handled yourself like a true Tokhaar. You have earned our respect." );
else if (type == 6)
sendNPCDialogue(npcId, 9827, "You are a Tokhaar... born in a human's body. Truly, we have not seen such skill from anyone out of our kiln." );
}
@Override
public void run(int interfaceId, int componentId) {
switch(type) {
case 0: //TODO
switch(stage) {
case -1:
stage = 0;
sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE,
"Let's fight.",
"I'd like to speak more about you and your kind.");
break;
case 0:
switch(componentId) {
case OPTION_1:
stage = 1;
sendNPCDialogue(npcId, 9827, "Do you have any questions on the rules of our engagement?");
break;
case OPTION_2:
default:
break;
}
break;
case 1:
stage = 2;
sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE,
"No, let's just fight.",
"What do I get if I beat you?",
"What are the rules?");
break;
case 2:
switch(componentId) {
case OPTION_1:
stage = 3;
sendPlayerDialogue(9827, "No let's just fight.");
break;
case OPTION_2:
break;
case OPTION_3:
default:
break;
}
break;
case 3:
fightKiln.removeTokHaarTok();
fightKiln.nextWave();
end();
break;
}
break;
case 1:
end();
break;
case 2:
switch(stage) {
case -1:
stage = 0;
player.getInterfaceManager().closeChatBoxInterface();
WorldTile lookTo = fightKiln.getWorldTile(37, 50);
player.getPackets().sendCameraLook(Cutscene.getX(player, lookTo.getX()),
Cutscene.getY(player, lookTo.getY()), 1000);
WorldTile posTile = fightKiln.getWorldTile(37, 45);
player.getPackets().sendCameraPos(Cutscene.getX(player, posTile.getX()),
Cutscene.getY(player, posTile.getY()), 3000);
CoresManager.fastExecutor.schedule(new TimerTask() {
@Override
public void run() {
try {
sendNPCDialogue(npcId, 9827, "Our Mej wish to test you..." );
} catch (Throwable e) {
Logger.handle(e);
}
}
}, 3000);
break;
case 0:
end();
break;
}
break;
case 3:
switch(stage) {
case -1:
stage = 0;
sendNPCDialogue(npcId, 9827, "Ah, the platform is crumbling. Be quick little one - our Ket are comming." );
break;
case 0:
end();
break;
}
break;
case 4:
end();
break;
case 7:
switch(stage) {
case -1:
stage = 0;
sendPlayerDialogue(9810, "The real challenge?" );
break;
case 0:
stage = 1;
sendNPCDialogue(npcId, 9827, "Many creatures have entered the kiln over the ages. We remember their shapes." );
break;
case 1:
end();
break;
}
break;
case 5:
switch(stage) {
case -1:
stage = 0;
sendNPCDialogue(npcId, 9827, " Take this cape as a symbol of our -" );
break;
case 0:
stage = 1;
fightKiln.showHarAken();
player.getInterfaceManager().closeChatBoxInterface();
CoresManager.fastExecutor.schedule(new TimerTask() {
@Override
public void run() {
try {
sendNPCDialogue(npcId, 9827, "Ah - yes, there is one final challenge..." );
} catch (Throwable e) {
Logger.handle(e);
}
}
}, 3000);
break;
case 1:
end();
fightKiln.hideHarAken();
CoresManager.fastExecutor.schedule(new TimerTask() {
@Override
public void run() {
try {
fightKiln.removeScene();
} catch (Throwable e) {
Logger.handle(e);
}
}
}, 3000);
break;
}
break;
case 6:
switch(stage) {
case -1:
stage = 0;
sendNPCDialogue(npcId, 9827, "You have done very well. To mark your triumph, accept a trophy from our home." );
break;
case 0:
stage = 1;
sendOptionsDialogue("Choose your reward:",
"The TokHaar-Kal", "The TokHaar-Kal-Xil", "The TokHaar-Kal-Mej", "An uncut onyx");
break;
case 1:
if (componentId == OPTION_1) {
stage = 6;
//player.getInventory().addItem(23659, 1);
player.getBank().addItem(23659, 1, true);
sendNPCDialogue(npcId, 9827, "The TokHaar-Kal is a powerful cape that will let others see that you have mastered the Fight Kiln. In addition to this, it provides several stat boosts including 8+ strength." );
player.sendMessage("The TokHaar-Kal was added to your bank.");
}
if (componentId == OPTION_2) {
stage = 6;
//player.getInventory().addItem(31610, 1);
player.getBank().addItem(31610, 1, true);
sendNPCDialogue(npcId, 9827, "The TokHaar-Kal-Xil is a powerful cape that will let others see that you have mastered the Fight Kiln. In addition to this, it provides several stat boosts including 8+ Range." );
player.sendMessage("The TokHaar-Kal-Xil was added to your bank.");
}
if (componentId == OPTION_3) {
stage = 6;
//player.getInventory().addItem(31611, 1);
player.getBank().addItem(31611, 1, true);
sendNPCDialogue(npcId, 9827, "The The TokHaar-Kal-Mej is a powerful cape that will let others see that you have mastered the Fight Kiln. In addition to this, it provides several stat boosts including 8+ Magic." );
player.sendMessage("The TokHaar-Kal-Mej was added to your bank.");
}
if (componentId == OPTION_4) {
stage = 6;
//player.getInventory().addItem(6571, 1);
player.getBank().addItem(6571, 1, true);
sendNPCDialogue(npcId, 9827, "Onyx is a precious and rare gem that can be crafted into one of several powerful objects, including the coveted Amulet of Fury.");
player.sendMessage("The Onyx was added to your bank.");
}
break;
case 2:
case 3:
stage = 6;
sendOptionsDialogue("Accept the "+ (stage == 4 ? "TokHaar-Kal" : "uncut onyx") + "?",
"Yes.", "No.");
break;
case 4:
case 5:
if (componentId == OPTION_1) {
player.getTemporaryAttributtes().put("FightKilnReward", stage == 4 ? 0 : 1);
stage = 6;
sendNPCDialogue(npcId, 9827, "Let us test our strength again...soon...");
}else{
stage = 1;
sendOptionsDialogue("Choose your reward:",
"The TokHaar-Kal", "The TokHaar-Kal-Xil", "The TokHaar-Kal-Mej", "An uncut onyx");
}
break;
case 6:
stage = 7;
sendNPCDialogue(npcId, 9827, "Now,leave...before the lava consumes you.");
break;
case 7:
end();
break;
}
break;
}
}
@Override
public void finish() {
if(type == 5)
fightKiln.unlockPlayer();
else if(type != 0)
fightKiln.removeScene();
}
}
| [
"[email protected]"
] | |
2167a779676ba0e97416f1fefb6c03b6d7be9b74 | c3879d8ea642be9f89ab6c8bc77e38376f8bb055 | /app/src/main/java/com/pujit/wallpaperdemo/utilities/AnimationUtils.java | 53693bde7b5bf259611d7c84176fff9ba646982c | [] | no_license | PujitSomaiya/WallpaperHubDemo | b314045a1de055ae8de23ebd15985fc7d7921236 | 2da01c3e9ea4461a9c46fefe37c10ad11169ef6f | refs/heads/master | 2023-07-12T06:12:24.078895 | 2021-08-11T15:48:28 | 2021-08-11T15:48:28 | 393,884,257 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,886 | java | package com.pujit.wallpaperdemo.utilities;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
public class AnimationUtils {
public interface AnimationListener {
void onFinish();
}
/***
* @param view = animate view
*/
public static void slideToUp(View view) {
Animation slide = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
slide.setDuration(400);
slide.setFillAfter(true);
slide.setFillEnabled(true);
view.startAnimation(slide);
}
/**
* @param view = animate view
* @param listener = listener to listen animation
*/
public static void slideToDown(View view, final AnimationListener listener) {
Animation slide = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
0.0f, Animation.RELATIVE_TO_SELF, 1.0f);
slide.setDuration(400);
slide.setFillAfter(true);
slide.setFillEnabled(true);
view.startAnimation(slide);
slide.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
/*ViewUtilKt.showLog("AnimationStart");*/
}
@Override
public void onAnimationEnd(Animation animation) {
if (listener != null) {
listener.onFinish();
}
}
@Override
public void onAnimationRepeat(Animation animation) {
/*ViewUtilKt.showLog("AnimationRepeat");*/
}
});
}
} | [
"[email protected]"
] | |
23c52b896e0dd1b6cb483b1bb46de54e5255aa4a | a6d1cbee7cb2d821019b84b820c6afc16ad62753 | /src/main/java/com/example/optiimsample/service/PhotoService.java | 2311ee45c55857ee6729594609a8dd4b7dba50a8 | [] | no_license | beyzacevik/Simple-Microservice-PhotoGallery-App | 8770aaa517c6ddba2f2fd6e1a830adba48a20524 | 78d0a43c390551c885715c58b1844301f6426d45 | refs/heads/master | 2023-08-03T00:56:57.145567 | 2021-09-09T19:22:04 | 2021-09-09T19:22:04 | 401,715,121 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 927 | java | package com.example.optiimsample.service;
import com.example.optiimsample.model.Photo;
import com.example.optiimsample.repository.PhotoRepository;
import org.bson.BsonBinarySubType;
import org.bson.types.Binary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
@Service
public class PhotoService {
@Autowired
private PhotoRepository photoRepo;
public String addPhoto(String title, MultipartFile file) throws IOException{
Photo photo = new Photo(title);
photo.setImage(new Binary(BsonBinarySubType.BINARY, file.getBytes()));
photo = photoRepo.insert(photo);
return photo.getId();
}
public Photo getPhoto(String id ){
return photoRepo.findById(id).get();
}
}
| [
"[email protected]"
] | |
b0751002efc1c024620fa7e7a21fc5bc4a04ce27 | 1a607c6d8d87cc01d3658bb32d600685e934e9d2 | /src/main/java/com/kzw/controller/ResumeController.java | 97708bf6eb20c627e61b52ab00c3045d2ff2ce7b | [] | no_license | kzw11/ssm_hrm | 46592c8b61d6571248ce70c5ca3890f0526332f2 | 40e1e8b0b0d9fb8164afad23fdfe5c0297f3b3fa | refs/heads/master | 2020-05-03T02:57:02.119517 | 2019-03-29T10:33:02 | 2019-03-29T10:33:02 | 178,384,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,179 | java | package com.kzw.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.kzw.entity.Resume;
import com.kzw.entity.User;
import com.kzw.service.ResumeService;
import com.kzw.utils.Msg;
/**
* @author kzw
*
*/
@Controller
public class ResumeController {
@Autowired
private ResumeService rs;
@RequestMapping("/addResume")
@ResponseBody
public Msg addResume(Resume resume,HttpServletRequest request){
HttpSession session = request.getSession();
User user = (User) session.getAttribute("user");
if(user!=null){
resume.setUserid(user.getId());
resume.setDeptId(0);
resume.setPositonId(0);
System.out.println(resume);
int i = rs.insert(resume);
if(i>1){
return Msg.fail();
}
return Msg.success();
}
return Msg.fail().add("msg", "您还没有登录,请先去登录在进行!");
}
@RequestMapping("/lookresume")
public String getResumeByUserId(HttpServletRequest request,Model model){
HttpSession session = request.getSession();
User user = (User) session.getAttribute("user");
if(user!=null){
Integer id = user.getId();
Resume resume = rs.getResumeBuUId(id);
if(resume!=null){
model.addAttribute("resume", resume);
}
}
return "resumeinfo";
}
@RequestMapping(value ="/updateResume", method = RequestMethod.PUT)
@ResponseBody
public Msg updateResume(Resume resume,HttpServletRequest request){
HttpSession session = request.getSession();
User user = (User) session.getAttribute("user");
if(user!=null){
Integer id = user.getId();
//int i = rs.updateResume(resume, id);
System.out.println("resumeid="+resume.getResumeId());
int i = rs.updateResumeByPrimaryKey(resume);
System.out.println(i);
if(i>1){
return Msg.fail();
}
}
return Msg.success();
}
}
| [
"[email protected]"
] | |
ec0d61287d77443581d6370712071da05f51277f | b28cd15d937184ac1749110a04095cbb8a2906a9 | /_ Tutoriais/src/net/eduard/tutoriais/sistemas/MercadoProduto.java | 74ec3c2ba8d47aa78aa959138e9dba542dfa2cc4 | [] | no_license | ScoltBr/plugins | 9a061ebe283390756d5ce58ebe134223e4120d15 | f3e7a589b1bfe059d87de64c757fd6c43382fe36 | refs/heads/master | 2020-04-21T18:33:10.505101 | 2019-01-25T23:47:09 | 2019-01-25T23:47:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 871 | java | package net.eduard.tutoriais.sistemas;
import org.bukkit.inventory.ItemStack;
public class MercadoProduto {
private String id;
private ItemStack item;
private String dono;
private String categoria;
private double preco;
public ItemStack getIcone() {
ItemStack newItem = item.clone();
return newItem;
}
public ItemStack getIconeDevolucao() {
ItemStack newItem = item.clone();
return newItem;
}
public String getDono() {
return dono;
}
public void setDono(String dono) {
this.dono = dono;
}
public String getCategoria() {
return categoria;
}
public void setCategoria(String categoria) {
this.categoria = categoria;
}
public double getPreco() {
return preco;
}
public void setPreco(double preco) {
this.preco = preco;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
| [
"[email protected]"
] | |
e459b68cdf6e0bc439377e22690d73ce47617412 | 6d2a2f15b2422248705115f6dd5ccb762b675881 | /src/main/java/fr/treeptik/evaluation/controller/navigation/FacePainter.java | 31667748aac4cc6b39cc6abfe00a41c6ab59be06 | [] | no_license | ojidono/treeptik_tp_evaluation | 54bcac33d42502808bcb8bc8e66b876747962d5b | 2af0f8646177154ee8cc047454421f08621f959a | refs/heads/master | 2021-01-10T05:50:02.036665 | 2016-03-23T09:19:09 | 2016-03-23T09:19:09 | 54,543,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,005 | java | package fr.treeptik.evaluation.controller.navigation;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@ManagedBean(name="facePainter")
@SessionScoped
public class FacePainter implements Serializable{
private static final long serialVersionUID = -7964208082355315896L;
private String sideContent;
private String mainContent;
public FacePainter() {
this.sideContent = "forms/stagiaire.xhtml";
this.mainContent = "lists/stagiaire.xhtml";
}
public void setContents(String mainContent, String sideContent){
setSideContent(sideContent);
setMainContent(mainContent);
}
public String getSideContent() {
return sideContent;
}
public String setSideContent(String sideContent) {
this.sideContent = sideContent;
return (null);
}
public String getMainContent() {
return mainContent;
}
public String setMainContent(String mainContent) {
this.mainContent = mainContent;
return (null);
}
} | [
"[email protected]"
] | |
74eaec601fc2dccc3e6981207ab3962398cc1149 | ad7f42657fea1c5426270e1fc7348d8cc484dbad | /src/main/java/Application.java | 45ec7ff4ce226fbde8751fe2dfe1217978967e49 | [] | no_license | soulex666/Youtube_downloader_test | 4e69e0250ce37db8ab985b16b1ca1b36a91e47dc | 2822fdcfb9f304a27fb686cdea4b52ed151cfe50 | refs/heads/master | 2022-09-24T01:10:34.416519 | 2020-06-07T13:04:09 | 2020-06-07T13:04:09 | 270,306,322 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,268 | java | import com.github.kiulian.downloader.OnYoutubeDownloadListener;
import com.github.kiulian.downloader.YoutubeDownloader;
import com.github.kiulian.downloader.YoutubeException;
import com.github.kiulian.downloader.model.VideoDetails;
import com.github.kiulian.downloader.model.YoutubeVideo;
import com.github.kiulian.downloader.model.formats.AudioFormat;
import com.github.kiulian.downloader.model.formats.AudioVideoFormat;
import javafx.scene.control.Button;
import javafx.stage.Stage;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.Future;
public class Application {
public static void main(String[] args) throws IOException, YoutubeException, InterruptedException {
FileReader readFromFile = new FileReader("youtubeLinks.txt");
Scanner reader = new Scanner(readFromFile);
String tempLine = (reader.nextLine().split(".+v=")[1]).split("&.+")[0];
reader.close();
System.out.println(tempLine);
String videoID = tempLine;
YoutubeDownloader downloader = new YoutubeDownloader();
YoutubeVideo video = downloader.getVideo(videoID);
VideoDetails details = video.details();
System.out.println("Title: " + details.title());
System.out.println("Description: " + details.description());
List<AudioVideoFormat> videoWithAudioFormat = video.videoWithAudioFormats();
videoWithAudioFormat.forEach(it -> {
System.out.println("Video&Audio: " + it.videoQuality() + ": " + it.url());
});
List<AudioFormat> audioFormats = video.audioFormats();
audioFormats.forEach(it -> {
System.out.println("Audio: " + it.audioQuality() + ": " + it.url());
});
File outputDirVideoWithAudio = new File("video_audio");
//videoWithAudioFormat.get(1) <- number of link list
video.downloadAsync(videoWithAudioFormat.get(0), outputDirVideoWithAudio, new OnYoutubeDownloadListener() {
@Override
public void onDownloading(int progress) {
System.out.printf("\b\b\b\b\b%d%%", progress);
}
@Override
public void onFinished(File file) {
System.out.printf("\nFinish video: %s", file);
System.exit(0); //exit from JVM progress
}
@Override
public void onError(Throwable throwable) {
System.err.println("Error: " + throwable.getMessage());
}
});
/* File outputDirAudio = new File("audio");
video.downloadAsync(audioFormats.get(0), outputDirAudio, new OnYoutubeDownloadListener() {
@Override
public void onDownloading(int progress) {
System.out.printf("\b\b\b\b\b%d%%", progress);
}
@Override
public void onFinished(File file) {
System.out.printf("\nFinish audio: %s", file);
}
@Override
public void onError(Throwable throwable) {
System.err.println("Error: " + throwable.getMessage());
}
});*/
Thread.currentThread().join();
}
}
| [
"[email protected]"
] | |
960953a2e3be13c78dd0be28b422f3f94710c5d8 | 1af06a33bc4d9521911b19bbdc077713e9c6a553 | /Test1/src/RythmMaster_vol1/Track.java | c2fd5e944e90ded8bda32f7c32741393fe0f3b85 | [] | no_license | plu5ix/RythmMaster | 45575f5b8286892c184557bd31595348a0e8bd6f | a86a876427747c8948b6b22c062c002697baf1b0 | refs/heads/master | 2020-03-19T08:04:39.774363 | 2018-06-03T14:03:43 | 2018-06-03T14:03:43 | null | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,629 | java | package RythmMaster_vol1;
public class Track {
private String titleImage; // 제목 부분 이미지
private String startImage; // 게임 선택 창 표지 이미지
private String gameImage; // 해당 곡을 실행했을 때 표지 이미지
private String startMusic; // 게임 선택 창 음악
private String gameMusic; // 해당 곡을 실행했을 때 음악
private String titleName; // 곡 제목
public String getTitleImage() {
return titleImage;
}
public void setTitleImage(String titleImage) {
this.titleImage = titleImage;
}
public String getStartImage() {
return startImage;
}
public void setStartImage(String startImage) {
this.startImage = startImage;
}
public String getGameImage() {
return gameImage;
}
public void setGameImage(String gameImage) {
this.gameImage = gameImage;
}
public String getStartMusic() {
return startMusic;
}
public void setStartMusic(String startMusic) {
this.startMusic = startMusic;
}
public String getGameMusic() {
return gameMusic;
}
public void setGameMusic(String gameMusic) {
this.gameMusic = gameMusic;
}
public String getTitleName() {
return titleName;
}
public void setTitleName(String titleName) {
this.titleName = titleName;
}
public Track(String titleImage, String startImage, String gameImage, String startMusic, String gameMusic, String titleName) {
super();
this.titleImage = titleImage;
this.startImage = startImage;
this.gameImage = gameImage;
this.startMusic = startMusic;
this.gameMusic = gameMusic;
this.titleName = titleName;
}
}
| [
"user@DESKTOP-0A0NRMG"
] | user@DESKTOP-0A0NRMG |
101916876fcf9c869f56e79aa53448850b02ec9c | 226f03647af8c2106d0c68ec9da35be1b542fda3 | /kodilla-stream/src/main/java/com/kodilla/stream/StreamMain.java | 132e87e4f54ae88feb411b5aa821ba8cd77270ed | [] | no_license | DanielKryszkiewicz/daniel-kryszkiewiczold | 102e41b83f22bc1b91583d1a19d4b02042eec44e | e6de664628ca66a72e025a6cb4c1e867159549b4 | refs/heads/master | 2023-05-06T07:50:31.253696 | 2020-06-07T20:26:47 | 2020-06-07T20:26:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 904 | java | package com.kodilla.stream;
import com.kodilla.stream.forumuser.Forum;
import com.kodilla.stream.forumuser.ForumUser;
import java.time.LocalDate;
import java.time.Period;
import java.util.Map;
import java.util.stream.Collectors;
public class StreamMain {
public static void main(String[] args) {
Forum forum = new Forum();
Map<Integer,ForumUser> theResultMapOfUsers = forum.getList().stream()
.filter(user -> user.getSex() =='M')
.filter(user -> user.getPosts()>0)
.filter(user -> user.getAge() >20)
.collect(Collectors.toMap(ForumUser::getUserID, user -> user));
System.out.println("# Users: " + theResultMapOfUsers.size());
theResultMapOfUsers.entrySet().stream()
.map(entry -> entry.getKey() + ": " + entry.getValue())
.forEach(System.out::println);
}
}
| [
"[email protected]"
] | |
beacd550e4cfb8005b743878fb3e2f8c3c3ff725 | b1bee28f5168559425c52876f207f282fd2f3381 | /neo4j.graphml.indexing/src/main/java/neo4j/storage/main/Main.java | 4e894cfc698a88693e401c5978679a03d45533af | [] | no_license | szarnyasg/neo4j-graphml-indexing | 9628969bb6615e10709d825384574a83f88ffdf8 | 74591a0542200029ab00675c4e9e318a37471d87 | refs/heads/master | 2021-01-16T21:23:59.006018 | 2013-04-12T18:29:57 | 2013-04-12T18:29:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | package neo4j.storage.main;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
Neo4jLoader neo4jLoader = new Neo4jLoader();
neo4jLoader.work();
}
}
| [
"[email protected]"
] | |
0d16017bbe116d33e9d49d29c76783b71d19b3ab | ae7633500b31844bf52078aeaa5523d5ab440586 | /SERVER API/src/main/java/com/fpt/main/security/WebSecurityConfig.java | b39b8e31598145c50f0a63dd686f4c86ee554f93 | [] | no_license | khoaimiday/projecthk4 | 325f4f69af67a442f33f4db2da00d78467d76a3d | 76d6558f66c68d427cd0eb559ef4152dd1d9d211 | refs/heads/main | 2023-07-16T00:37:06.370953 | 2021-08-19T04:42:37 | 2021-08-19T04:42:37 | 385,548,002 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 927 | java | package com.fpt.main.security;
import com.okta.spring.boot.oauth.Okta;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter{
String[] pathArray = new String[] {
"/api/orders/**",
"/api/favourites/**",
"/api/rating/**"
};
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers(pathArray)
.authenticated()
.and()
.oauth2ResourceServer()
.jwt();
// add cors filter
http.cors();
// force a non-empty response body for 401's to make the response more friendly
Okta.configureResourceServer401ResponseBody(http);
}
}
| [
"[email protected]"
] | |
342501f6fd973aec2d410338ec038c503a5bc660 | 15839cab0b7760677264405e291dc5d502f94d42 | /app/src/androidTest/java/org/iii/tw/mystopwatch/ApplicationTest.java | 05012b2ae31ddf58443b592cb999eb63d3f60995 | [] | no_license | chuan1983/android_MyStopWatch | 47b77c8f2b519b517ba0bc0a2b42298324a52ab0 | 7491b61f6fb810cce22664b1ef7c5c06219506ac | refs/heads/master | 2020-04-11T03:02:40.353732 | 2016-09-13T06:25:57 | 2016-09-13T06:25:57 | 68,067,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 353 | java | package org.iii.tw.mystopwatch;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"[email protected]"
] | |
581b2cc5653b10fde104f81c062f2b37fde80930 | 73d1dec6e93be81b1320cef2b1009c2bc3929b6b | /Randomized optimization/Agagail/src/opt/test/RHC_Restarts.java | bc5488f6a5a70de2ac11b4641ddca0240fc398d0 | [] | no_license | tuzi123/machine-learning-CS-7641 | b688115a5e133e9f7037c09b2caa14899d0544dc | 11419493ba3fecd8a2043c66f89f97d6d26bb75a | refs/heads/master | 2020-04-26T15:03:19.840593 | 2019-03-03T21:59:34 | 2019-03-03T21:59:34 | 173,635,135 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,338 | java | package opt.test;
import dist.*;
import opt.*;
import opt.example.*;
import opt.ga.*;
import shared.*;
import func.nn.backprop.*;
import java.util.*;
import java.io.*;
import java.text.*;
/**
* Implementation of randomized hill climbing, simulated annealing, and genetic algorithm to
* find optimal weights to a neural network that is classifying abalone as having either fewer
* or more than 15 rings.
*
* @author Hannah Lau
* @version 1.0
*/
public class RHC_Restarts {
private static final String BASE_OUTPUT_DIR_PATH = "outputs/tt_neural_net/spam/RHC/";
public static String getFullFileName(String fileName) {
return BASE_OUTPUT_DIR_PATH + fileName;
}
private static final int VERSION_NO = 6;
private static Instance[] instances = initializeInstancesTrain();
private static int INPUT_LAYERS = 57, HIDDEN_LAYERS = 2, OUTPUT_LAYER = 1, TRAINING_ITERATIONS = 800;
private static BackPropagationNetworkFactory factory = new BackPropagationNetworkFactory();
private static ErrorMeasure measure = new SumOfSquaresError();
private static int restarts= 3;
private static DataSet set_train = new DataSet(instances);
private static BackPropagationNetwork networks[] = new BackPropagationNetwork[3];
private static NeuralNetworkOptimizationProblem[] nnop = new NeuralNetworkOptimizationProblem[3];
private static OptimizationAlgorithm[] oa = new OptimizationAlgorithm[1];
private static String[] oaNames = {"RHC"};
private static String results = "", displayResults = "";
private static DecimalFormat df = new DecimalFormat("0.000");
public static void main(String[] args) {
if (args.length > 0)
restarts = Integer.parseInt(args[0]);
for(int i = 0; i < oa.length; i++) {
networks[i] = factory.createClassificationNetwork(
new int[] {INPUT_LAYERS, HIDDEN_LAYERS, OUTPUT_LAYER});
nnop[i] = new NeuralNetworkOptimizationProblem(set_train, networks[i], measure);
}
oa[0] = new RHC(nnop[0],restarts);
for(int i = 0; i < oa.length; i++) {
double start = System.nanoTime(), end, trainingTime, testingTime, correct = 0, incorrect = 0;
train(oa[i], networks[i], oaNames[i]); // trainer.train();
end = System.nanoTime();
trainingTime = end - start;
trainingTime /= Math.pow(10, 9);
Instance optimalInstance = oa[i].getOptimal();
networks[i].setWeights(optimalInstance.getData());
double predicted, actual;
start = System.nanoTime();
for(int j = 0; j < instances.length; j++) {
networks[i].setInputValues(instances[j].getData());
networks[i].run();
actual = Double.parseDouble(instances[j].getLabel().toString());
predicted = Double.parseDouble(networks[i].getOutputValues().toString());
actual = (actual >= 0.5 ? 1: 0);
predicted = (predicted >= 0.5 ? 1: 0);
//System.out.println("predicted test " + predicted + " actual test "+ actual+"\n---------------------------");
double trash = Math.abs(predicted - actual) < 0.2 ? correct++ : incorrect++;
}
end = System.nanoTime();
testingTime = end - start;
testingTime /= Math.pow(10, 9);
displayResults += oaNames[i] + "," + restarts + "," + VERSION_NO +
"," + correct + "," + incorrect + "," +
df.format(correct/(correct+incorrect)*100) + "," +
df.format(trainingTime) + "," + df.format(testingTime) + "\n";
results += "\nResults for " + oaNames[i] + ": \nCorrectly classified " + correct + " instances." +
"\nIncorrectly classified " + incorrect + " instances.\nPercent correctly classified: "
+ df.format(correct/(correct+incorrect)*100) + "%\nTraining time: " + df.format(trainingTime)
+ " seconds\nTesting time: " + df.format(testingTime) + " seconds\n";
}
try {
String fileName = getFullFileName("outputs_RHC_" + VERSION_NO + ".csv");
PrintWriter writer = new PrintWriter(new FileOutputStream(new File(fileName), true));
writer.print(displayResults);
writer.close();
} catch(Exception e) {
e.printStackTrace();
}
System.out.println(results);
}
private static void train(OptimizationAlgorithm oa, BackPropagationNetwork network, String oaName) {
System.out.println("\nError results for " + oaName + "\n---------------------------");
String errorResults = "";
for(int i = 0; i < TRAINING_ITERATIONS; i++) {
oa.train();
double error = 0;
for(int j = 0; j < instances.length; j++) {
network.setInputValues(instances[j].getData());
network.run();
Instance output = instances[j].getLabel(), example = new Instance(network.getOutputValues());
example.setLabel(new Instance(Double.parseDouble(network.getOutputValues().toString())));
error += measure.value(output, example);
}
//error =correct/(correct+incorrect)*100;
errorResults += oaName + "," + TRAINING_ITERATIONS + "," + i + "," + df.format(error) + "\n";
// System.out.println(df.format(error));
}
try {
String fileName = getFullFileName("errors_" + VERSION_NO + "_" + restarts + ".csv");
PrintWriter writer = new PrintWriter(new FileOutputStream(new File(fileName), true));
writer.println("---");
writer.print(errorResults);
writer.close();
} catch(Exception e) {
e.printStackTrace();
}
}
private static Instance[] initializeInstancesTrain() {
final int NO_INSTANCES = 2830;
double[][][] attributes = new double[NO_INSTANCES][][];
final int ATT_LENGTH = INPUT_LAYERS;
try {
BufferedReader br = new BufferedReader(new FileReader(new File("spambase_train.data")));
for(int i = 0; i < attributes.length; i++) {
Scanner scan = new Scanner(br.readLine());
scan.useDelimiter(",");
attributes[i] = new double[2][];
attributes[i][0] = new double[ATT_LENGTH]; // 11 attributes
attributes[i][1] = new double[1]; // 1 output - class
// writing input values
for(int j = 0; j < ATT_LENGTH; j++)
attributes[i][0][j] = Double.parseDouble(scan.next());
// writing output value
attributes[i][1][0] = Double.parseDouble(scan.next());
}
}
catch(Exception e) {
e.printStackTrace();
}
Instance[] instances = new Instance[attributes.length];
for(int i = 0; i < instances.length; i++) {
instances[i] = new Instance(attributes[i][0]);
instances[i].setLabel(new Instance(attributes[i][1][0] >= 1 ? 1: 0));
}
return instances;
}
}
| [
"[email protected]"
] | |
bbbba318305cdc4caee0357b2345f5810a411149 | 5a0175b741698e8dc12c1b5bb30e6d5fc641a503 | /src/ca/mcgill/ecse/btms/model/DriverSchedule.java | d62018b5b5dfdbcbcd9673594300bcde0f016dc4 | [] | no_license | Lawi-Inoti99/Bus-Transportation-Management-System-BTMS- | 6e0fc5ea0f8e26c174533086e635514bb49aa7fb | 43db1ee0e65c9007c191be593a541ee3d5bf2b45 | refs/heads/master | 2022-12-17T02:58:43.056631 | 2020-08-25T16:09:23 | 2020-08-25T16:09:23 | 268,185,086 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,752 | java | /*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE 1.29.0.4181.a593105a9 modeling language!*/
package ca.mcgill.ecse.btms.model;
// line 74 "../../../../../BTMS.ump"
public class DriverSchedule
{
//------------------------
// ENUMERATIONS
//------------------------
public enum Shift { Morning, Afternoon, Night }
//------------------------
// MEMBER VARIABLES
//------------------------
//DriverSchedule Attributes
private Shift shift;
//DriverSchedule Associations
private Driver driver;
private RouteAssignment assignment;
private BTMS bTMS;
//------------------------
// CONSTRUCTOR
//------------------------
public DriverSchedule(Shift aShift, Driver aDriver, RouteAssignment aAssignment, BTMS aBTMS)
{
shift = aShift;
boolean didAddDriver = setDriver(aDriver);
if (!didAddDriver)
{
throw new RuntimeException("Unable to create driverSchedule due to driver");
}
boolean didAddAssignment = setAssignment(aAssignment);
if (!didAddAssignment)
{
throw new RuntimeException("Unable to create driverSchedule due to assignment");
}
boolean didAddBTMS = setBTMS(aBTMS);
if (!didAddBTMS)
{
throw new RuntimeException("Unable to create schedule due to bTMS");
}
}
//------------------------
// INTERFACE
//------------------------
public boolean setShift(Shift aShift)
{
boolean wasSet = false;
shift = aShift;
wasSet = true;
return wasSet;
}
public Shift getShift()
{
return shift;
}
/* Code from template association_GetOne */
public Driver getDriver()
{
return driver;
}
/* Code from template association_GetOne */
public RouteAssignment getAssignment()
{
return assignment;
}
/* Code from template association_GetOne */
public BTMS getBTMS()
{
return bTMS;
}
/* Code from template association_SetOneToMany */
public boolean setDriver(Driver aDriver)
{
boolean wasSet = false;
if (aDriver == null)
{
return wasSet;
}
Driver existingDriver = driver;
driver = aDriver;
if (existingDriver != null && !existingDriver.equals(aDriver))
{
existingDriver.removeDriverSchedule(this);
}
driver.addDriverSchedule(this);
wasSet = true;
return wasSet;
}
/* Code from template association_SetOneToMany */
public boolean setAssignment(RouteAssignment aAssignment)
{
boolean wasSet = false;
if (aAssignment == null)
{
return wasSet;
}
RouteAssignment existingAssignment = assignment;
assignment = aAssignment;
if (existingAssignment != null && !existingAssignment.equals(aAssignment))
{
existingAssignment.removeDriverSchedule(this);
}
assignment.addDriverSchedule(this);
wasSet = true;
return wasSet;
}
/* Code from template association_SetOneToMany */
public boolean setBTMS(BTMS aBTMS)
{
boolean wasSet = false;
if (aBTMS == null)
{
return wasSet;
}
BTMS existingBTMS = bTMS;
bTMS = aBTMS;
if (existingBTMS != null && !existingBTMS.equals(aBTMS))
{
existingBTMS.removeSchedule(this);
}
bTMS.addSchedule(this);
wasSet = true;
return wasSet;
}
public void delete()
{
Driver placeholderDriver = driver;
this.driver = null;
if(placeholderDriver != null)
{
placeholderDriver.removeDriverSchedule(this);
}
RouteAssignment placeholderAssignment = assignment;
this.assignment = null;
if(placeholderAssignment != null)
{
placeholderAssignment.removeDriverSchedule(this);
}
BTMS placeholderBTMS = bTMS;
this.bTMS = null;
if(placeholderBTMS != null)
{
placeholderBTMS.removeSchedule(this);
}
}
public String toString()
{
return super.toString() + "["+ "]" + System.getProperties().getProperty("line.separator") +
" " + "shift" + "=" + (getShift() != null ? !getShift().equals(this) ? getShift().toString().replaceAll(" "," ") : "this" : "null") + System.getProperties().getProperty("line.separator") +
" " + "driver = "+(getDriver()!=null?Integer.toHexString(System.identityHashCode(getDriver())):"null") + System.getProperties().getProperty("line.separator") +
" " + "assignment = "+(getAssignment()!=null?Integer.toHexString(System.identityHashCode(getAssignment())):"null") + System.getProperties().getProperty("line.separator") +
" " + "bTMS = "+(getBTMS()!=null?Integer.toHexString(System.identityHashCode(getBTMS())):"null");
}
} | [
"[email protected]"
] | |
cb399f5ffd562352abd49a0d467726ab8fed996c | 2def16e2382488b74336f65a861c9ceaa38196b5 | /OpenScienceJournal/whistlepunk_library/src/main/java/com/google/android/apps/forscience/whistlepunk/PanesToolFragment.java | 13e3dc6b4acbdbccb36c0488fd237c8dc555fed7 | [
"Apache-2.0"
] | permissive | Matthew-Long-Cork/sensor_application | 4d59435033422b530aa25f88d79742c43cd497cb | 815532bfce7874d38a5a38406ec8d72b356e2547 | refs/heads/master | 2020-07-15T11:36:16.360578 | 2019-09-06T18:55:04 | 2019-09-06T18:55:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,600 | java | /*
* Copyright 2017 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.apps.forscience.whistlepunk;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.common.base.Optional;
import io.reactivex.Maybe;
import io.reactivex.Observable;
import io.reactivex.subjects.BehaviorSubject;
public abstract class PanesToolFragment extends Fragment {
private RxEvent mVisibilityGained = new RxEvent();
private RxEvent mVisibilityLost = new RxEvent();
private BehaviorSubject<Boolean> mFocused = BehaviorSubject.create();
private BehaviorSubject<Boolean> mUiStarted = BehaviorSubject.create();
protected BehaviorSubject<Integer> mDrawerState = BehaviorSubject.create();
private BehaviorSubject<Optional<View>> mView = BehaviorSubject.create();
private RxEvent mViewDestroyed = new RxEvent();
public interface Env {
Observable<Integer> watchDrawerState();
}
public static interface EnvProvider {
Env getPanesToolEnv();
}
protected PanesToolFragment() {
// Only treat as visible (and therefore connect the camera) when we are both focused and
// resumed.
Observable.combineLatest(mFocused, mUiStarted, mDrawerState,
(focused, resumed, drawerState) -> focused
&& resumed
&& drawerState
!= PanesBottomSheetBehavior.STATE_COLLAPSED)
.distinctUntilChanged()
.subscribe(hasBecomeVisible -> {
if (hasBecomeVisible) {
mVisibilityGained.onHappened();
} else {
mVisibilityLost.onHappened();
}
});
}
@Nullable
@Override
public final View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
Bundle savedInstanceState) {
EnvProvider provider = (EnvProvider) container.getContext();
provider.getPanesToolEnv()
.watchDrawerState()
.takeUntil(mViewDestroyed.happens())
.subscribe(mDrawerState::onNext);
View view = onCreatePanesView(inflater, container, savedInstanceState);
mView.onNext(Optional.of(view));
return view;
}
protected abstract View onCreatePanesView(LayoutInflater inflater,
@Nullable ViewGroup container, Bundle savedInstanceState);
@Override
public final void onDestroyView() {
mView.onNext(Optional.absent());
mViewDestroyed.onHappened();
onDestroyPanesView();
super.onDestroyView();
}
/**
* Fragment-specific view destruction logic, if any. Should _not_ call super.onDestroyView();
*/
protected void onDestroyPanesView() {
// do nothing, but subclasses can override.
}
public Maybe<View> whenNextView() {
return mView.filter(Optional::isPresent).map(Optional::get).firstElement();
}
// TODO: extract this pattern of fragment listeners
@Override
public void onAttach(Context context) {
super.onAttach(context);
panesOnAttach(context);
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
panesOnAttach(activity);
}
protected void panesOnAttach(Context context) {
}
protected Observable<Object> whenVisibilityGained() {
return mVisibilityGained.happens();
}
protected Observable<Object> whenVisibilityLost() {
return mVisibilityLost.happens();
}
protected Observable<Integer> watchDrawerState() {
return mDrawerState;
}
public void onGainedFocus(Activity activity) {
mFocused.onNext(true);
}
public void onLosingFocus() {
mFocused.onNext(false);
}
@Override
public void onStart() {
super.onStart();
if (isMultiWindowEnabled()) {
mUiStarted.onNext(true);
}
}
@Override
public void onResume() {
super.onResume();
if (!isMultiWindowEnabled()) {
mUiStarted.onNext(true);
}
}
@Override
public void onPause() {
// TODO: can we safely use onStop to shut down observing on pre-Nougat?
// See discussion at b/34368790
if (!isMultiWindowEnabled()) {
mUiStarted.onNext(false);
}
super.onPause();
}
@Override
public void onStop() {
if (isMultiWindowEnabled()) {
mUiStarted.onNext(false);
}
super.onStop();
}
private boolean isMultiWindowEnabled() {
return MultiWindowUtils.isMultiWindowEnabled(getActivity());
}
}
| [
"[email protected]"
] | |
1cb2cd9285bdb1511c35977d4cb3627332419c8b | 1b1450f50e4c999ceedd784b72da4d138cb6562f | /app/src/main/java/ipramodsinghrawat/it/socialloginintegration/MyTwitterApiClient.java | b7e3bdde1173fd382a838219db44d036f98a8fe3 | [] | no_license | iPramodSinghRawat/SocialLoginIntegration | d9cdbd2cd30f28c43f72338c3465344e62fd2941 | 3aa86add193af3c621fc44af80c98abf82d4bd6b | refs/heads/master | 2021-09-09T15:03:59.510251 | 2018-03-17T07:57:16 | 2018-03-17T07:57:16 | 125,607,981 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 938 | java | package ipramodsinghrawat.it.socialloginintegration;
/**
* Created by iPramodSinghRawat on 16/03/18.
*/
import com.twitter.sdk.android.core.TwitterApiClient;
import com.twitter.sdk.android.core.TwitterSession;
import com.twitter.sdk.android.core.models.User;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
public class MyTwitterApiClient extends TwitterApiClient {
public MyTwitterApiClient(TwitterSession session) {
super(session);
}
public GetUsersShowAPICustomService getCustomService() {
return getService(GetUsersShowAPICustomService.class);
}
}
interface GetUsersShowAPICustomService {
@GET("/1.1/users/show.json")
Call<User> show(@Query("user_id") long userId);
/*
* In retrofit v1 you need to write like this
*
* @GET("/1.1/users/show.json")
* void show(@Query("user_id") long userId, Callback<User> callBack);
*
* */
}
| [
"[email protected]"
] | |
06b5a63b31d8642e9a030dd816faf4afa76dfec9 | 05965fc81f35de533671a1f03e1e86b7e2b8898d | /app/src/main/java/com/moor/im/options/intro2/AhoyOnboarderCard.java | 2930029bc9b331ee58903065d4a2d0fe28748381 | [] | no_license | longwei243/im2.0 | f056ec82df399e64ae27fb212bce57e468f88cd7 | fb77a3004a38fbb99ab875153f3c4102965d9971 | refs/heads/master | 2020-04-15T13:38:28.346810 | 2016-10-08T09:05:07 | 2016-10-08T09:05:07 | 57,932,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,256 | java | package com.moor.im.options.intro2;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.StringRes;
public class AhoyOnboarderCard {
public String title;
public String description;
public Drawable imageResource;
@StringRes
public int titleResourceId;
@StringRes
public int descriptionResourceId;
@DrawableRes
public int imageResourceId;
@ColorRes
public int titleColor;
@ColorRes
public int descriptionColor;
@ColorRes
public int backgroundColor;
public float titleTextSize;
public float descriptionTextSize;
public AhoyOnboarderCard(String title, String description) {
this.title = title;
this.description = description;
}
public AhoyOnboarderCard(String title, String description, int imageResourceId) {
this.title = title;
this.description = description;
this.imageResourceId = imageResourceId;
}
public AhoyOnboarderCard(String title, String description, Drawable imageResource) {
this.title = title;
this.description = description;
this.imageResource = imageResource;
}
public AhoyOnboarderCard(int title, int description) {
this.titleResourceId = title;
this.descriptionResourceId = description;
}
public AhoyOnboarderCard(int title, int description, int imageResourceId) {
this.titleResourceId = title;
this.descriptionResourceId = description;
this.imageResourceId = imageResourceId;
}
public AhoyOnboarderCard(int title, int description, Drawable imageResource) {
this.titleResourceId = title;
this.descriptionResourceId = description;
this.imageResource = imageResource;
}
public String getTitle() {
return title;
}
public int getTitleResourceId() {
return titleResourceId;
}
public String getDescription() {
return description;
}
public int getDescriptionResourceId() {
return descriptionResourceId;
}
public int getTitleColor() {
return titleColor;
}
public int getDescriptionColor() {
return descriptionColor;
}
public void setTitleColor(int color) {
this.titleColor = color;
}
public void setDescriptionColor(int color) {
this.descriptionColor = color;
}
public void setImageResourceId(int imageResourceId) {
this.imageResourceId = imageResourceId;
}
public int getImageResourceId() {
return imageResourceId;
}
public float getTitleTextSize() {
return titleTextSize;
}
public void setTitleTextSize(float titleTextSize) {
this.titleTextSize = titleTextSize;
}
public float getDescriptionTextSize() {
return descriptionTextSize;
}
public void setDescriptionTextSize(float descriptionTextSize) {
this.descriptionTextSize = descriptionTextSize;
}
public int getBackgroundColor() {
return backgroundColor;
}
public void setBackgroundColor(int backgroundColor) {
this.backgroundColor = backgroundColor;
}
}
| [
"[email protected]"
] | |
327a1fbf0d1acf2996c66be094660562ea4fe222 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_84da9a6fa97d5c28a35b99d648185b861be3fac5/FixEvent/3_84da9a6fa97d5c28a35b99d648185b861be3fac5_FixEvent_s.java | 9a7e61309ab77093fabd1ff8ddbbe940676290a7 | [] | 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 | 847 | java | /**
* Copyright (c) 2011 Sebastian Tomac (tomac.org)
* Licensed under LGPL licenses.
* You may obtain a copy of the License at http://www.gnu.org/copyleft/lgpl.html
**/
package org.tomac.protocol.fix;
import org.tomac.protocol.fix.messaging.FixMessageInfo;
/**
* @author seto
*
*/
public class FixEvent extends FixMessageInfo.SessionRejectReason {
// avoid collition with SessionRejectReasons
public static final int DISCONNECT = 100;
public static final int CONNECT = 101;
public static final int MSGSEQNUM_LOGOUT = 102;
public static final int GARBLED = 103;
public static final int MSGSEQNUM_RESENDREQUEST = 104;
public static final int MSGSEQNUM_LOGON_RESENDREQUEST = 105;
public static final int BEGINSTRING_LOGOUT = 106;
public static final int IGNORE_MESSAGE = 107;
}
| [
"[email protected]"
] | |
10061e20042adf4d8106d81a9dae61f9e731526a | 9f831fcddb45eeb78f7bd311dec4b18382ed3857 | /src/ex17collection/Ex05HashMapMain.java | f74bdb2ec9d7baa7c820bf872d1b92c8206f2ab8 | [] | no_license | toyouma94/K01Java | 2c60c4cefa71aba061107b775f6bc87438255c08 | dfdb7b1b192905e29e8a4cf016c78d558b13ff58 | refs/heads/master | 2023-01-07T05:36:11.172378 | 2020-11-04T08:59:11 | 2020-11-04T08:59:11 | 309,946,764 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,976 | java | package ex17collection;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import org.omg.CORBA.portable.ValueBase;
/*
HashMap<K,V>
:Map<T>인터페이스를 구현한 컬렉션 클래스로
-Key,Value의 쌍으로 객체를 저장한다.
-키값은 중복될 수 없다. 중복될 경우 덮어쓰기 처리된다.
-키값으로 검색하므로 다른 컬렉션보다 속도가 빠르다
*/
public class Ex05HashMapMain {
public static void main(String[] args) {
//Map 컬렉션 생성. Key와 Value는 String형으로 선언함.
HashMap<String,String>map=new HashMap<String,String>();
/*
객체저장
:객체저장시 기존에 저장된 동일한 key값이 존재하면
이전 객체가 반환된다. 만약 처음이라면 null값이 반환된다.
*/
System.out.println("name이라는 키값으로 저장된 이전의 값:"
+map.put("name","홍길동"));//null 반환
int number=20;
//map.put("age",number);->에러발생 value타입이 맞지않음.
map.put("age",String.valueOf(number));
map.put("gender","남자");
map.put("address","가산디지털단지");
/*
3.객체수
*/
System.out.println("저장된 객체수:"+map.size());
/*
4.중복저장
:기존에 입력된 name 키값이 있으므로"홍길동"이
출력된다.그리고 기존의 값이"최길동"으로 갱신된다.
*/
System.out.println("name이라는 키값으로 저장된 이전의 값:"
+map.put("name","최길동"));//덮어쓰기처리
System.out.println("키값으로 중복 저장후 객체수:"+map.size());//4개
/*
5.출력
5-1.키값을 알고 있을떄 출력하기
:get(키값)으로 출력한다.
*/
System.out.println("키값을 알떄:"+map.get("name"));
/*
5-2.키값을 모를때 출력하기
1.Set<T> KeySet()메소드 호출을 통해 키값들을
Set계열의 컬렉션을 얻어온다.
2.키값을 얻어온 후 확장 for문을 통해 저장된 값을 출력한다.
※Map계열의 컬렉션은 처음부터 확장 for문을 사용하는 것이
불가능하다. 위처럼 key값을 먼저 얻어온 후 사용해야한다.
*/
Set<String> keys=map.keySet();
System.out.println("[확장for문 적용]");
for(String key:keys) {
String value=map.get(key);
System.out.println(String.format("%s:%s",key,value));
}
/*
5-3반복자를 통한 출력
:iterator를 통해 반복할때도 keySet()으로 먼저
key를 얻어온 후 사용할 수 있다.
*/
System.out.println("[반복자 사용하기]");
Set<String>keys2=map.keySet();
Iterator<String>it=keys2.iterator();
while(it.hasNext()) {
String key=it.next();
String value=map.get(key);
System.out.println(String.format("%s:%s",key,value));
}
/*
5-4.Value값만 얻어 올때:values()메소드 사용
*/
System.out.println("[value 값들만 출력하기]");
Collection<String>values=map.values();
for(String value:values) {
System.out.println(values);
}
/*
6.존재유무판단
:key혹은 value가 존재할 경우 true가 반환된다.
*/
System.out.println(map.containsKey("name")?"name키값있다":"name키값없다");
System.out.println(map.containsKey("account")?"account키값있다":"account키값없다");
System.out.println(map.containsValue("남자")?"남자 있다":"남자 없다");
System.out.println(map.containsValue("여자")?"여자 있다":"여자 없다");
/*
7.삭제
:key를 통해 삭제하고,삭제가 완료되면 해당 value가 반환된다.
*/
System.out.println("삭제된객체:"+map.remove("age"));
System.out.println("[age키값을 삭제후 출력]");
for(String key:keys) {
System.out.println(String.format("%s:%s",key,map.get(key)));
}
/*
8.전체삭제:removeAll()은 없음.
*/
map.clear();
System.out.println("전체삭제후 객체수:"+map.size());
}
}
| [
"[email protected]"
] | |
ab7310f08fb611e1c84fb2ea287f5872f21457e7 | 03bb56d0d6e02032e6240a130da1bf275ec61703 | /Core java/Ch-7/Ch-7/ListDemo/src/listdemo/ListDemo.java | 91f4786286047610699a624a669635d30eb36b8d | [] | no_license | min2kumar/github-Core-java-project | dfad5828d1393acf15196e0a17bcac9f0895f699 | 0bdad1716fca37ae50164c33298ca3b735af3b62 | refs/heads/master | 2020-03-20T19:54:51.083349 | 2018-07-29T05:48:43 | 2018-07-29T05:48:43 | 137,660,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,344 | java | package listdemo;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ListDemo
{
public static void main(String[] args)
{
//create a list
List<String> names = new ArrayList<>();
//now add some names to this list
names.add("Chandan");
names.add("Mintu");
names.add("Abhishek");
names.add("Abdul");
names.add("Maaz");
names.add("Shlok");
names.add("nihal");
names.add("ethan");
//display using Iterator
Iterator it= names.iterator();
//while loop
while(it.hasNext())
{
System.out.println(it.next());
}
List<Customer> clist= new ArrayList<>();
Customer c= new Customer(1, "aman", 12);
Customer d= new Customer(1, "aman", 12);
clist.add(c);
clist.add(d);
// now we will display
//iterator
Iterator i=clist.iterator();
while(i.hasNext())
{
Customer obj = (Customer)i.next();
// System.out.println(obj.getId());
// System.out.println(obj.getAge());
// System.out.println(obj.getName());
System.out.println(obj.toString());
}
}
}
| [
"[email protected]"
] | |
ddcfa2848d4a5bc36de756f690db449aea099f3f | 893369280f5683545b7de7716ae4e7e588a93ebf | /src/main/java/scut/legend/cg/service/impl/WarehouseDeliveryRecordServiceImpl.java | ecb6a850079cd8460adf96577540182643182a99 | [] | no_license | lhs520/cg | 9cee4f51fcad0b7e6ea279bd61b419f4aa1ae44e | 1cb9487a259f27b4f0b6255236cd4706fcc9398d | refs/heads/master | 2021-08-23T23:40:53.071392 | 2017-12-07T03:43:29 | 2017-12-07T03:43:29 | 104,144,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,648 | java | package scut.legend.cg.service.impl;
import java.text.ParseException;
import java.util.List;
import java.util.Random;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import javax.annotation.Resource;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import scut.legend.cg.dao.StaffDao;
import scut.legend.cg.dao.WarehouseDeliveryRecordDao;
import scut.legend.cg.dao.WarehouseOrderDao;
import scut.legend.cg.dao.WarehouseProductInventoryDao;
import scut.legend.cg.exception.DeliveryQuantityException;
import scut.legend.cg.exception.InventoryShortageException;
import scut.legend.cg.exception.TimeFormatException;
import scut.legend.cg.po.Staff;
import scut.legend.cg.po.WarehouseDeliveryRecord;
import scut.legend.cg.po.WarehouseOrder;
import scut.legend.cg.po.WarehouseProductInventory;
import scut.legend.cg.service.WarehouseDeliveryRecordService;
import scut.legend.cg.util.PageUtils;
import scut.legend.cg.util.SMSUtils;
import scut.legend.cg.util.TimeUtils;
import scut.legend.cg.vo.CommonDTO;
import scut.legend.cg.vo.Result;
@Service
public class WarehouseDeliveryRecordServiceImpl implements WarehouseDeliveryRecordService {
private static Lock lock = new ReentrantLock();
@Resource
WarehouseDeliveryRecordDao warehouseDeliveryDao;
@Resource
WarehouseOrderDao warehouseOrderDao;
@Resource
WarehouseProductInventoryDao warehouseProductInventoryDao;
@Resource
StaffDao staffDao;
@Override
@Transactional
public CommonDTO createWarehouseDeliveryRecord(WarehouseDeliveryRecord warehouseDeliveryRecord, String orderNum) throws Exception {
if (warehouseDeliveryRecord.getDeliveryDate() == null
|| warehouseDeliveryRecord.getDeliveryQuantity() == null) {
return new CommonDTO(Result.PARAM_ERROR);
}
Staff staff=(Staff)SecurityUtils.getSubject().getSession().getAttribute("staff");
if(staff==null){
return new CommonDTO(Result.USER_NOT_LOGIN);
}
warehouseDeliveryRecord.setStaff(staff);
warehouseDeliveryRecord.setStaffName(staff.getStaffName());
lock.lock();
try {
// 构造配送编号
if (!constructNum(warehouseDeliveryRecord)) {
return new CommonDTO(Result.SYSTEM_EXCEPTION);
}
// 设置订单
warehouseDeliveryRecord.setWarehouseOrder(warehouseOrderDao.getWarehouseOrderByOrderNum(orderNum));
// 更新订单需配送量,然后根据配送量设置订单状态
Integer orderId = warehouseDeliveryRecord.getWarehouseOrder().getId();
Float newDeliveryQuantityNeed = warehouseDeliveryRecord.getWarehouseOrder().getDeliveryQuantityNeed()
- warehouseDeliveryRecord.getDeliveryQuantity();
// 配送量大于订单需配送量,返回失败的代码
if (newDeliveryQuantityNeed < 0) {
throw new DeliveryQuantityException();
}
warehouseOrderDao.updateOrderDeliveryNeed(orderId, newDeliveryQuantityNeed);
if (newDeliveryQuantityNeed == 0) {
warehouseOrderDao.updateOrderStatus(orderId, "已配送");
} else {
warehouseOrderDao.updateOrderStatus(orderId, "部分配送");
}
// 更新产品库存
updateInventory(warehouseDeliveryRecord);
warehouseDeliveryDao.createWarehouseDeliveryRecord(warehouseDeliveryRecord);
CommonDTO commonDTO = new CommonDTO(Result.CREATE_DELIVERY_SUCCESS);
commonDTO.setResult(warehouseDeliveryRecord.getId());
return commonDTO;
} finally {
lock.unlock();
}
}
@Override
public CommonDTO getWarehouseDeliveryRecordByTime(Long startTime, Long endTime, Integer pageNum) {
if (startTime < 0 || endTime < 0 || endTime - startTime < 0 || pageNum <= 0) {
return new CommonDTO(Result.PARAM_ERROR);
}
// 变为当天23:59
endTime = endTime + 86399999L;
List<WarehouseDeliveryRecord> result = warehouseDeliveryDao.getWarehouseDeliveryRecordByTime(startTime, endTime,
(pageNum - 1) * PageUtils.NUMBER_PER_PAGE, PageUtils.NUMBER_PER_PAGE);
// 如果是请求的第一页,则在返回结果的commDTO的msg信息中设置全部的页数
if (pageNum == 1) {
double count = warehouseDeliveryDao.getCountByTime(startTime, endTime);
CommonDTO commonDTO = new CommonDTO();
int page = (int) Math.ceil(count / PageUtils.NUMBER_PER_PAGE);
commonDTO.setMsg("" + page);
commonDTO.setResult(result);
return commonDTO;
}
CommonDTO commonDTO = new CommonDTO(Result.SUCCESS);
commonDTO.setResult(result);
return commonDTO;
}
@Override
@Transactional
public CommonDTO updateWarehouseDeliveryRecord(WarehouseDeliveryRecord warehouseDeliveryRecord) throws Exception {
if (warehouseDeliveryRecord.getDeliveryQuantity() == null) {
return new CommonDTO(Result.PARAM_ERROR);
}
if (warehouseDeliveryRecord.getDeliveryQuantity() != null) {
// 纠正订单需配送量
// WarehouseDeliveryRecord oldWdr = warehouseDeliveryDao
// .getWarehouseDeliveryRecordByNum(warehouseDeliveryRecord.getDeliveryNum());
WarehouseDeliveryRecord oldWdr = warehouseDeliveryDao
.getWarehouseDeliveryRecordById(warehouseDeliveryRecord.getId());
if (oldWdr == null) {
return new CommonDTO(Result.DELIVERYRECORD_NOT_EXISTED);
}
Float var = warehouseDeliveryRecord.getDeliveryQuantity() - oldWdr.getDeliveryQuantity();
Float newDeliveryQuantityNeed = oldWdr.getWarehouseOrder().getDeliveryQuantityNeed() - var;
// 更新订单状态
if (newDeliveryQuantityNeed < 0) {
// 出错回滚
throw new DeliveryQuantityException();
} else if (newDeliveryQuantityNeed == 0) {
warehouseOrderDao.updateOrderStatus(oldWdr.getWarehouseOrder().getId(), "已配送");
} else if (newDeliveryQuantityNeed > oldWdr.getWarehouseOrder().getDeliveryQuantityTotal()) {
return new CommonDTO(Result.NEED_BIG_TOTAL);
} else if (Math.abs(newDeliveryQuantityNeed - oldWdr.getWarehouseOrder().getDeliveryQuantityTotal()) == 0) {
warehouseOrderDao.updateOrderStatus(oldWdr.getWarehouseOrder().getId(), "未配送");
} else {
warehouseOrderDao.updateOrderStatus(oldWdr.getWarehouseOrder().getId(), "部分配送");
}
warehouseOrderDao.updateOrderDeliveryNeed(oldWdr.getWarehouseOrder().getId(), newDeliveryQuantityNeed);
// 纠正产品库存
WarehouseProductInventory warehouseProductInventory = warehouseProductInventoryDao
.getproductInventoryByProduct(oldWdr.getWarehouseOrder().getProduct());
warehouseProductInventory.setProduct(oldWdr.getWarehouseOrder().getProduct());
Float newProductInventory = warehouseProductInventory.getProductInventory() - var;
warehouseProductInventory.setProductInventory(newProductInventory);
warehouseProductInventoryDao.updateproductInventory(warehouseProductInventory);
// 出错回滚
if (newProductInventory < 0) {
throw new InventoryShortageException();
}
// updateInventory(oldWdr);
}
warehouseDeliveryDao.updateWarehouseDeliveryRecord(warehouseDeliveryRecord);
return new CommonDTO(Result.UPDATE_DELIVERY_SUCCESS);
}
// 更新产品库存
@Transactional
public void updateInventory(WarehouseDeliveryRecord warehouseDeliveryRecord) throws Exception {
WarehouseProductInventory warehouseProductInventory = warehouseProductInventoryDao
.getproductInventoryByProduct(warehouseDeliveryRecord.getWarehouseOrder().getProduct());
if (warehouseProductInventory == null) {
sendSMSToFactory(warehouseDeliveryRecord.getWarehouseOrder());
throw new InventoryShortageException();
}
warehouseProductInventory.setProduct(warehouseDeliveryRecord.getWarehouseOrder().getProduct());
Float newInventory = warehouseProductInventory.getProductInventory()
- warehouseDeliveryRecord.getDeliveryQuantity();
if (newInventory < 0) {
sendSMSToFactory(warehouseDeliveryRecord.getWarehouseOrder());
throw new InventoryShortageException();
}
warehouseProductInventory.setProductInventory(newInventory);
warehouseProductInventoryDao.updateproductInventory(warehouseProductInventory);
}
//构造入库编号
@Transactional
private boolean constructNum(WarehouseDeliveryRecord warehouseDeliveryRecord) {
StringBuilder sBuilder = new StringBuilder();
String date = TimeUtils.formatD(warehouseDeliveryRecord.getDeliveryDate());
sBuilder.append("KP");
sBuilder.append(date);
Long time = warehouseDeliveryRecord.getDeliveryDate();
try {
time = TimeUtils.parseD(date);
// warehouseDeliveryRecord.setDeliveryDate(time);
} catch (ParseException e) {
e.printStackTrace();
throw new TimeFormatException(e.getMessage());
}
int num = warehouseDeliveryDao.getDeliveryNumSuffix(time,time+86399999L) + 1;
if (num > 9999) {
return false;
}
for (int i = 0; i < 4 - new String(num + "").length(); i++) {
sBuilder.append("0");
}
sBuilder.append(num);
warehouseDeliveryRecord.setDeliveryNum(sBuilder.toString());
return true;
}
private void sendSMSToFactory(WarehouseOrder warehouseOrder) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("产品:");
stringBuilder.append(warehouseOrder.getProduct().getProductModelInfo().getProductModel()+"、");
stringBuilder.append(warehouseOrder.getProduct().getProductSize()+"、"+warehouseOrder.getProduct().getProductShape());
stringBuilder.append(",库存不足,请尽快生产!需要量:");
stringBuilder.append(warehouseOrder.getDeliveryQuantityNeed());
List<Staff> list = staffDao.getStaffsByRoleName("工厂管理员");
if (list==null) {
return;
}
try {
int index = new Random().nextInt(list.size()-1);
SMSUtils.sendSMS(list.get(index).getStaffTel(), stringBuilder.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
392592d8f2124716fccbe7524f41cf3e6cd13356 | 4ce679970d757af18557b112d80a87506862c2ea | /issuer/authorization-service/src/test/java/com/mattos/fintech/authorization/AuthorizationServiceApplicationTests.java | 3b604d324916250440befdd024924e28bdee5cf8 | [] | no_license | leonardo-s-mattos/mattos-financial-group | 52ffe30d520e206dc27fb58e8eb4d384f17d1fb6 | 400fecb37cc907c768ce5f76ae407a7104820fea | refs/heads/master | 2022-12-03T14:47:39.959090 | 2020-08-27T22:26:21 | 2020-08-27T22:26:21 | 266,184,091 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 227 | java | package com.mattos.fintech.management;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class TxManagementApplicationTests {
@Test
void contextLoads() {
}
}
| [
"[email protected]"
] | |
9ca2d985f520b66e901ca368a427cf03362ecf33 | 6d57a8aebbca8baf58f19780643c2fc50beb13e5 | /DataStructures/queue/ArrayQueueDemo.java | 2a81ee7d9cbf74e51f3e6a6482971821ad92f9e6 | [] | no_license | Zhangzhanhu/Structures-and-Algorithms | f3e5baa13a6fd6ada78a0712e4868e299fefd374 | 8b1efbfbf2e1c59b68c4faceffc01cf73a525396 | refs/heads/main | 2023-06-30T03:53:24.171659 | 2021-08-06T09:50:47 | 2021-08-06T09:50:47 | 393,328,066 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,121 | java | package com.tunan.queue;
import java.util.Scanner;
public class ArrayQueueDemo {
public static void main(String[] args) {
//创建一个队列
ArrayQueue arrayQueue = new ArrayQueue(3);
char key = ' ';//接收用户输入
Scanner scanner = new Scanner(System.in);
boolean loop = true;
while(loop) {
System.out.println("s(show):显示队列");
System.out.println("e(exit):退出程序");
System.out.println("a(add):添加数据");
System.out.println("g(get):取出数据");
System.out.println("h(head):查看头部");
key = scanner.next().charAt(0);
switch (key) {
case 's':
arrayQueue.showQueue();
break;
case 'a':
System.out.println("请输入一个数");
int value = scanner.nextInt();
arrayQueue.addQueue(value);
break;
case 'g':
try {
int res = arrayQueue.getQueue();
System.out.println("取出的数为" + res);
} catch (Exception e) {
System.out.println(e.getMessage());
}
break;
case 'h':
try {
int res = arrayQueue.headQueue();
System.out.println("队列头的数为" + res);
} catch (Exception e) {
System.out.println(e.getMessage());
}
break;
case 'e':
scanner.close();
loop = false;
System.out.println("程序退出");
break;
default:
break;
}
}
}
}
//使用数组模拟队列,编写一个ArrayQueue类
class ArrayQueue {
private int maxSize;//队列最大
private int front;//队列头
private int rear;//队列尾
private int[] arr;//用于存放数据的数组,模拟队列
//创建队列的构造器
public ArrayQueue(int arrMaxSize) {
maxSize = arrMaxSize;
arr = new int[maxSize];
front = -1;//指向队列头部前一个位置
rear = -1;//指向队列尾的具体位置
}
//判断队列是否满
public boolean isFull() {
return rear == maxSize - 1;
}
//判断队列是否为空
public boolean isEmpty() {
return rear == front;
}
//添加数据到队列
public void addQueue(int n) {
//判断是否满
if(isFull()) {
System.out.println("队列已满,不能加入数据");
return;
}
rear++;//让rear后移
arr[rear] = n;
}
//获取队列数据,数据出队列
public int getQueue() {
//判断是否空
if (isEmpty()) {
throw new RuntimeException("队列空,不能取出数据");
//这里不再需要return,因为throw已经将程序终止,后面的代码将不会执行
}
front++;//让front后移
return arr[front];
}
//显示队列所有数据
public void showQueue() {
//遍历
// for (int i = front; i < rear; i++) {
// System.out.println(arr[i]);
// }
if (isEmpty()) {
System.out.println("数组空");
return;
}
for (int i = 0; i < arr.length; i++) {
System.out.printf("arr[%d]=%d\n", i, arr[i]);
}
}
//查看头数据,而不把它取出
public int headQueue() {
if (isEmpty()) {
throw new RuntimeException("队列空,没有数据");
}
return arr[front+1];
}
} | [
"[email protected]"
] | |
bc0d1644c4184594eff3d78724a7da06d014d46b | 0124e565b2ca5d223fddd10dd9d851437ab59dc2 | /myjdk/src/com/sun/corba/se/spi/activation/ServerAlreadyInstalledHolder.java | 207b70a80698c0ada07cdf3ca14a64769c26e376 | [] | no_license | lvcs123456/syncMore | 331db4092017ba17b38ead80ab47fc4c6615683e | 43074b41851cf6514e4b28037e2465fb806b46b1 | refs/heads/master | 2023-01-23T11:29:02.755417 | 2020-11-04T12:14:37 | 2020-11-04T12:14:37 | 309,552,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,183 | java | package com.sun.corba.se.spi.activation;
/**
* com/sun/corba/se/spi/activation/ServerAlreadyInstalledHolder.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from c:/ade/jenkins/workspace/8-2-build-windows-i586-cygwin/jdk8u241/331/corba/src/share/classes/com/sun/corba/se/spi/activation/activation.idl
* Wednesday, December 11, 2019 10:25:11 AM UTC
*/
public final class ServerAlreadyInstalledHolder implements org.omg.CORBA.portable.Streamable
{
public com.sun.corba.se.spi.activation.ServerAlreadyInstalled value = null;
public ServerAlreadyInstalledHolder ()
{
}
public ServerAlreadyInstalledHolder (com.sun.corba.se.spi.activation.ServerAlreadyInstalled initialValue)
{
value = initialValue;
}
public void _read (org.omg.CORBA.portable.InputStream i)
{
value = com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.read (i);
}
public void _write (org.omg.CORBA.portable.OutputStream o)
{
com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.write (o, value);
}
public org.omg.CORBA.TypeCode _type ()
{
return com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.type ();
}
}
| [
"[email protected]"
] | |
808071c1c20229a039b942ec3e3f9f5e95e80244 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/MOCKITO-3b-2-9-NSGA_II-WeightedSum:TestLen:CallDiversity/org/mockito/internal/invocation/InvocationMarker_ESTest.java | 80f31a7202e1e7d4f0f7d76f54087e5d6172a3f1 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 570 | java | /*
* This file was automatically generated by EvoSuite
* Wed Apr 01 08:46:00 UTC 2020
*/
package org.mockito.internal.invocation;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class InvocationMarker_ESTest extends InvocationMarker_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"[email protected]"
] | |
9e86e1e3e2b335538e0496b1ce178a69b8cb73a6 | 19a3e52ab5cbab21bf09e7c7659bb8aa5d3815a1 | /HelloMVC/src/main/java/lab/mvc/hello/WebController.java | ed8f814975ccee0ada6c5121a747f871985327eb | [] | no_license | Natthanicha047/lab_WS_Spring | 7566c3fd555f97d7b55d0b4e78a037633890d917 | 8b7a7b108300ad3ddccef5d277fd3f8b92efc086 | refs/heads/master | 2020-07-29T13:00:20.715063 | 2016-11-21T04:44:51 | 2016-11-21T04:44:51 | 73,666,097 | 0 | 1 | null | 2017-10-29T09:07:36 | 2016-11-14T04:12:21 | Java | UTF-8 | Java | false | false | 685 | java | package lab.mvc.hello;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class WebController {
@RequestMapping(value = "/index", method = RequestMethod.GET)
public String index() {
return "index";
}
@RequestMapping(value = "/redirect", method = RequestMethod.GET)
public String redirect() {
return "redirect:finalPage";
}
@RequestMapping(value = "/finalPage", method = RequestMethod.GET)
public String finalPage() {
return "final";
}
}
| [
"[email protected]"
] | |
5a91bab748d41a0d14337c052677bafa08201233 | f0c391341c4d7a878cac972a38741eabc51a7e37 | /app/src/main/java/com/example/mattimoestechshop/ObserverPattern/Observer.java | e06da836554b247a7fbd403b67eafe61036e3cf0 | [] | no_license | cormacmattimoe/MattimoesTechShop | 61193ae3eaf3663ce8fcda90351571970ce117e3 | df9ef8749bd15e98ee7534dbbe03a90ff97a8b85 | refs/heads/main | 2023-04-07T04:10:19.985174 | 2021-04-18T22:41:11 | 2021-04-18T22:41:11 | 355,207,351 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 115 | java | package com.example.mattimoestechshop.ObserverPattern;
public interface Observer {
public void update();
}
| [
"[email protected]"
] | |
1c48a4f3b97bcb2635fc225e49ce41070b9b1055 | 341b3e927a5e4fb7f1dcbead7caf22c04309d84a | /Chapter-4/code/app/src/main/java/com/kelly/multi_thread/produce_consume/ProduceThread.java | 31da93c80354a785275288cd7db1be6e01deb50e | [
"Apache-2.0"
] | permissive | imxilife/AndroidReview | f1463dbafca1e64867e7ac82b51f8bf6dd4088ab | e180ba57465523a961b2daa15346357d2ace0100 | refs/heads/master | 2020-04-08T12:44:42.137640 | 2019-01-16T15:56:35 | 2019-01-16T15:56:35 | 159,359,799 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,438 | java | package com.kelly.multi_thread.produce_consume;
import android.util.Log;
import com.kelly.multi_thread.Constant;
import java.util.Queue;
import java.util.Random;
public class ProduceThread extends Thread {
private Queue<Integer>queue;
public ProduceThread(Queue<Integer> queue) {
this.queue = queue;
}
@Override
public void run() {
while(true){
synchronized (queue){
while (queue.size() == 10){
try {
Log.i(Constant.TAG,"队里已到达最大容量,无法继续装载,生产者线程进入等待状态");
queue.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Random random = new Random();
int value = random.nextInt();
Log.i(Constant.TAG, "生产者线程产生了value:"+value);
try {
Thread.sleep(60000);
} catch (InterruptedException e) {
e.printStackTrace();
}
queue.add(value);
queue.notifyAll();
}
/* try {
Thread.sleep(3000); //模拟生产一个数据的耗时
} catch (InterruptedException e) {
e.printStackTrace();
}*/
}
}
}
| [
"[email protected]"
] | |
866398e8a899d7e72f113c546b8a74e6bbae72a4 | 477e271e30591e0e60959354e46cafcd038f5a85 | /NumberToLCD/src/test/java/edu/pdx/cs410J/LeeAndKatherine/KataTest.java | b4f31b4ade41aba36addf2f705ebaecb3dc66061 | [
"Apache-2.0"
] | permissive | leevhoang/PortlandStateJavaKatas | 95b42130a10b0db018dd3cb691ec35ceaa1fb542 | 12b82714322d525be904942e74d3939328a1aef2 | refs/heads/main | 2023-06-25T17:33:14.680298 | 2021-07-29T03:13:58 | 2021-07-29T03:13:58 | 383,966,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 375 | java | package edu.pdx.cs410J.LeeAndKatherine;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class KataTest
{
@Test
void canInstantiateKataClass() {
new Kata();
}
@Test
void passingOneReturnsLCDOne() {
Kata test = new Kata();
String lcd = test.num2LCD("1");
assertEquals(lcd, "\n|\n|");
}
}
| [
"[email protected]"
] | |
0775b778d7d2563eab35cb9e490c4e5609f5a6a3 | 6661b4dd8379b41cd446e94b43b531a7021e8815 | /src/test/java/com/agility/ddp/data/domain/DdpCommOptionsLkpDataOnDemand.java | 41838c07b45803344b9b148f794e99e5f7ffd94a | [] | no_license | chaitanyaKunda/DDP-data | b5110107ab4877941c3fc1089ad2bff79408cf3c | 40de93cf86b0ab8136adeafc2c728f4497b3472d | refs/heads/master | 2021-04-27T11:45:39.382126 | 2018-02-23T03:06:31 | 2018-02-23T03:06:31 | 122,565,920 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 194 | java | package com.agility.ddp.data.domain;
import org.springframework.roo.addon.dod.RooDataOnDemand;
@RooDataOnDemand(entity = DdpCommOptionsLkp.class)
public class DdpCommOptionsLkpDataOnDemand {
}
| [
"Chaitanya@6215"
] | Chaitanya@6215 |
89edb07b587cdef3db0fdb77f6b817299ffe0f84 | dec2a43d9e6e0f043d3b309c343e8e52e11dd83c | /src/main/java/com/springcouse/resource/exception/ApiErrorList.java | 7f9211bb181af69bf696c536a9c35dbf7ef519bf | [] | no_license | rickfer8/spring-couse | a3e34174456f2e811020d4e72962bb3b7cb477a7 | 3e18c368ddb88e3d46f926e415b9ef92b591c29b | refs/heads/master | 2020-06-12T02:33:46.526809 | 2019-07-04T14:35:58 | 2019-07-04T14:35:58 | 194,169,578 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package com.springcouse.resource.exception;
import java.util.Date;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter @Setter
public class ApiErrorList extends ApiError{
/**
*
*/
private static final long serialVersionUID = 1L;
private List<String> errors;
public ApiErrorList(int code, String msg, Date date, List<String> errors) {
super(code, msg, date);
this.errors = errors;
}
}
| [
"[email protected]"
] | |
a08ae52de5abb2d59ba44406154fde57c10be658 | 16b13112a4ec8677bd269e207fac4adf6bb68440 | /src/main/java/Controller/HelloServlet.java | 1f921ef7260b5c243ee5dbb6577d1b2e73d56918 | [] | no_license | gpgzy/web_homework | 1cdedda969127343e1ffd97f84f5d43f08dbc0e9 | 8c3a6993af4d9c40ab0c4c9866a06b72be577768 | refs/heads/master | 2022-06-28T10:29:22.876597 | 2019-12-15T13:02:26 | 2019-12-15T13:02:26 | 228,141,105 | 0 | 0 | null | 2022-06-21T02:26:47 | 2019-12-15T06:48:27 | HTML | UTF-8 | Java | false | false | 2,293 | java | package Controller;
import Model.News;
import Utils.GetNewssService;
import Utils.LoginService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.LinkedList;
import java.util.logging.Logger;
@WebServlet("/helloServlet")
public class HelloServlet extends HttpServlet {
private static final Logger LOGGER
= Logger.getLogger(HelloServlet.class.getName());
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
//req.getRequestDispatcher("/jsp/index.html").forward(req,resp);
GetNewssService getNewssService = new GetNewssService();
LinkedList<News> news = getNewssService.getNews();
req.setAttribute("news",news);
//resp.sendRedirect("/jsp/index.jsp");
req.getRequestDispatcher("/jsp/index.jsp").forward(req,resp);
resp.getWriter().append("hellp");
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
String name = req.getParameter("username");
String password = req.getParameter("password");
System.out.println(name+" "+password);
LoginService loginService = new LoginService();
if(loginService.Login(name,password)==true)
{
GetNewssService getNewssService = new GetNewssService();
LinkedList<News> news = getNewssService.getNews();
// for (News n:news)
// {
// req.setAttribute("title",n.getTitle());
// req.setAttribute("date",n.getDate());
// req.setAttribute("content",n.getContent());
// }
//req.setAttribute("title","hehehe");
//resp.sendRedirect("/jsp/Welcome.jsp");
req.setAttribute("news",news);
req.getRequestDispatcher("/jsp/getallnews.jsp").forward(req,resp);
}
else {
resp.sendRedirect("/jsp/wrong.html");
}
}
}
| [
"[email protected]"
] | |
67896b65d32ea9a9c51e17f7648c4d6ba7d34354 | 03326b236be7bbe35a6f887c1848df12014372c7 | /app/src/main/java/com/example/polafigur/Romb.java | 0677ad506b1d392da74cd726c36ecc337d6e5100 | [] | no_license | cappy908982/PolaFigurAndroid | d113020df93d4f08a537784bc1309eb1de4b06b7 | 04e73fa01e113d438f28474486f6a1100feffebf | refs/heads/main | 2023-03-24T09:17:04.318788 | 2021-03-16T15:21:22 | 2021-03-16T15:21:22 | 344,555,143 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,028 | java | package com.example.polafigur;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class Romb extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_romb);
Button calculate=(Button)findViewById(R.id.button4);
EditText side=(EditText)findViewById(R.id.editText6);
EditText height=(EditText)findViewById(R.id.editText7);
TextView result = (TextView) findViewById (R.id.textView14);
calculate.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v)
{
result.setText((Double.parseDouble
(side.getText().toString()))*Double.parseDouble(height.getText().toString())+"");
}
});
}
} | [
"[email protected]"
] | |
f00143dc84b1c306ad2aadbe16abd87f74ae68bb | 6707e71c8f0ad71a4f6112f6cf977877e6e9f8c6 | /src/main/java/com/balderiano/LoggerProvider.java | 712a897b49f4e69c2959e5b5a6094bea7b979a8f | [
"MIT"
] | permissive | jaguerra/comic-sniffer | f875670244201c5012bda871c86c2cb9480f2b68 | 61e4fe768fb314d140150e1170b4db15dd8f1fb1 | refs/heads/master | 2021-01-20T19:13:36.449478 | 2016-12-19T18:07:25 | 2016-12-19T18:07:25 | 65,223,960 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 173 | java | package com.balderiano;
import java.util.logging.Logger;
public class LoggerProvider {
public Logger get(String loggerName) {
return Logger.getLogger(loggerName);
}
}
| [
"[email protected]"
] | |
2f4996244afe1566b7b16ae16885813f993559b2 | 8ae94337616a51ffb76ddfb38a1aea0ec777da94 | /src/com/missouri/monitor/utils/Utils.java | 40962031401cc4309e89a3add7fa88be8c94cf4b | [] | no_license | RickyShi/Monitor | 7f3ed2abce7c2ec87304b78896b8ee90ad9e7033 | e7f11449fc0999856bee907f91e0f1b0d786a70c | refs/heads/master | 2020-12-24T14:52:59.337359 | 2014-11-20T05:09:37 | 2014-11-20T05:09:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,422 | java | package com.missouri.monitor.utils;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public class Utils {
public static final String MONITOR_PACKAGE_NAME = "com.missouri.monitor";
public static final String ACTION_INTENT_BATTERY_CHANGED = "android.intent.action.BATTERY_CHANGED";
public static final String COMMA = ",";
public static final String NA = "N/A";
public static final String BLANK_STRING = "";
public static final String PROC_PATH = "/proc/";
public static final String STAT_PATH = "/stat";
public static final String FILE_PATH = "sdcard/monitor/";
public static final int TIMEOUT = 20000;
// default MONITOR_INTERVAL is set to 5s
public static final int MONITOR_INTERVAL = 5000;
public static final String UPLOAD_ADDRESS = "http://dslsrv8.cs.missouri.edu/~rs79c/monitor/writeArrayToFile.php";
public class Memory {
public static final String MEMORY_INFO_PATH = "/proc/meminfo";
}
public class Current {
public static final String CURRENT_NOW_PATH = "/sys/class/power_supply/battery/current_now";
public static final String BATT_CURRENT_PATH = "/sys/class/power_supply/battery/batt_current";
public static final String SMEM_TEXT_PATH = "/sys/class/power_supply/battery/smem_text";
public static final String BATT_CURRENT_ADC_PATH = "/sys/class/power_supply/battery/batt_current_adc";
public static final String CURRENT_AVG_PATH = "/sys/class/power_supply/battery/current_avg";
public static final String CURRENT_ACER = "/sys/class/power_supply/battery/BatteryAverageCurrent";
public static final String CURRENT_MOTO = "/sys/devices/platform/cpcap_battery/power_supply/usb/current_now";
public static final String I_MBAT = "I_MBAT: ";
}
public class Network {
public static final String PROC_UID_PATH = "/proc/uid_stat/";
public static final String TCP_RCV_PATH = "/tcp_rcv";
public static final String TCP_SND_PATH = "/tcp_snd";
}
public class CPU {
public static final String INTEL_CPU_NAME = "model name";
public static final String CPU_DIR_PATH = "/sys/devices/system/cpu/";
public static final String CPU_X86 = "x86";
public static final String CPU_INFO_PATH = "/proc/cpuinfo";
public static final String CPU_STAT_PATH = "/proc/stat";
}
/**
* get the sdk version of phone.
*
* @return sdk version
*/
public static String getSDKVersion() {
return android.os.Build.VERSION.RELEASE;
}
/**
* get phone type.
*
* @return phone type
*/
public static String getPhoneType() {
return android.os.Build.MODEL;
}
public static boolean checkDataConnectivity(Context context) {
ConnectivityManager connectivity = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivity != null) {
NetworkInfo[] info = connectivity.getAllNetworkInfo();
if (info != null) {
for (int i = 0; i < info.length; i++) {
if (info[i].getState() == NetworkInfo.State.CONNECTED) {
return true;
}
}
}
}
return false;
}
public static void writeToFile(String fileName, String toWrite) throws IOException {
File dir = new File(FILE_PATH);
if (!dir.exists()) {
dir.mkdirs();
}
File f = new File(FILE_PATH, fileName);
FileWriter fw = new FileWriter(f, true);
fw.write(toWrite + '\n');
fw.flush();
fw.close();
f = null;
}
}
| [
"[email protected]"
] | |
68fda15d02cae4ba62bb4832bacca3679caaecb9 | 901aec9c9408a737cf382d6c3549e44eb3d0f167 | /plugin-caches/src/main/java/com/transilink/framework/plugins/cache/memoryCache/memcached/MemCachedClientHelper.java | 485f3c531f42d41ae4c1b47cceb3922c21a49504 | [] | no_license | zhangjunfang/architecture | a32f1d3e5dfd528517ed8dc4fd2e6b32a0a12e2d | 709cbc68a8381d93e7af779470025a1d8a27de4e | refs/heads/master | 2016-09-15T08:41:37.899666 | 2016-03-05T11:23:52 | 2016-03-05T11:23:52 | 33,911,525 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,636 | java | /**
*
*/
package com.transilink.framework.plugins.cache.memoryCache.memcached;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.transilink.framework.plugins.cache.memoryCache.IMemcachedCache;
import com.transilink.framework.plugins.cache.memoryCache.memcached.client.MemCachedClient;
/**
* 为封装的MemCache提供实际处理的帮助类
*
*/
public class MemCachedClientHelper
{
private static final Log Logger = LogFactory.getLog(MemCachedClientHelper.class);
private MemCachedClient cacheClient;
private MemcachedCacheManager cacheManager;
private IMemcachedCache memcachedCache;
private String cacheName;
public List<MemCachedClient> getClusterCache()
{
List<MemCachedClient> result = new ArrayList<MemCachedClient>();
if (hasCluster())
{
MemcachedClientCluster cluster = cacheManager.getCache2cluster().get(memcachedCache);
for(IMemcachedCache node : cluster.getCaches())
{
if (node instanceof MemcachedCache)
{
result.add(((MemcachedCache)node).getHelper().getInnerCacheClient());
}
}
}
return result;
}
protected boolean hasCluster()
{
boolean result = false;
if (memcachedCache != null && cacheManager != null)
{
MemcachedClientCluster cluster = cacheManager.getCache2cluster().get(memcachedCache);
if (cluster != null && cluster.getCaches() != null
&& cluster.getCaches().size() > 0)
result = true;
}
return result;
}
protected String getClusterMode()
{
String mode = MemcachedClientClusterConfig.CLUSTER_MODE_NONE;
if (memcachedCache != null && cacheManager != null)
{
MemcachedClientCluster cluster = cacheManager.getCache2cluster().get(memcachedCache);
if (cluster != null && cluster.getCaches() != null
&& cluster.getCaches().size() > 0)
if (cluster.getMode().equals(MemcachedClientClusterConfig.CLUSTER_MODE_ACTIVE)
||cluster.getMode().equals(MemcachedClientClusterConfig.CLUSTER_MODE_STANDBY))
mode = cluster.getMode();
}
return mode;
}
public MemCachedClient getInnerCacheClient()
{
if (cacheClient == null)
{
Logger.error("cacheClient can't be injected into MemcachedCacheHelper");
throw new java.lang.RuntimeException("cacheClient can't be injected into MemcachedCacheHelper");
}
return cacheClient;
}
public MemCachedClient getCacheClient(String key)
{
if (cacheClient == null)
{
Logger.error("cacheClient can't be injected into MemcachedCacheHelper");
throw new java.lang.RuntimeException("cacheClient can't be injected into MemcachedCacheHelper");
}
//根据算法获取集群中的某一台节点服务器
if (hasCluster())
{
List<MemCachedClient> clusters = getClusterCache();
long keyhash = key.hashCode();
int index = (int)keyhash % clusters.size();
if (index < 0 )
index *= -1;
return clusters.get(index);
}
else
return cacheClient;
}
public void setCacheClient(MemCachedClient cacheClient)
{
this.cacheClient = cacheClient;
}
public MemcachedCacheManager getCacheManager()
{
return cacheManager;
}
public void setCacheManager(MemcachedCacheManager cacheManager)
{
this.cacheManager = cacheManager;
}
public IMemcachedCache getMemcachedCache()
{
return memcachedCache;
}
public void setMemcachedCache(IMemcachedCache memcachedCache)
{
this.memcachedCache = memcachedCache;
}
public String getCacheName()
{
return cacheName;
}
public void setCacheName(String cacheName)
{
this.cacheName = cacheName;
}
}
| [
"[email protected]"
] | |
380e80099e369033ee29ea2bd27eed55cddb7cfc | aa2058150b6462b50e75ab57a72c3681ee8305ea | /DW-pattern-factory/src/Main.java | 4bdcccbc2cc9ae2db56778189d5f2cca3dc470db | [] | no_license | ding-wei/pattern | 13eece83c4730e0bec86fb77fab0ee27ee3b9605 | 1c413a6647bd196f3267ce3782aaa25b22d6386f | refs/heads/master | 2021-06-08T20:14:11.944723 | 2020-11-11T08:19:27 | 2020-11-11T08:19:27 | 157,401,808 | 0 | 0 | null | 2021-04-22T18:02:27 | 2018-11-13T15:25:41 | Java | UTF-8 | Java | false | false | 187 | java | public class Main {
/**
*
* @param args
*/
public static void main(String[] args) {
System.out.println("Hello World!");
System.out.println();
}
}
| [
"[email protected]"
] | |
eb7197a769d5493ce11ae1a2c1f0c4073f412cf7 | 9d1870a895c63f540937f04a6285dd25ada5e52a | /chromecast-app-reverse-engineering/src/from-androguard-dad-broken-but-might-help/tf.java | 75a8e223b792e92ec1d93f06e3884f5d93f5b181 | [] | no_license | Churritosjesus/Chromecast-Reverse-Engineering | 572aa97eb1fd65380ca0549b4166393505328ed4 | 29fae511060a820f2500a4e6e038dfdb591f4402 | refs/heads/master | 2023-06-04T10:27:15.869608 | 2015-10-27T10:43:11 | 2015-10-27T10:43:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,180 | java | public static final a
private static final android.graphics.PorterDuff$Mode b
private static final java.util.WeakHashMap c
private static final tg d
private static final I e
private static final I f
private static final I g
private static final I h
private static final I i
private static final I j
private final java.lang.ref.WeakReference k
private android.util.SparseArray l
private android.content.res.ColorStateList m
static tf()
{
int[] v0_1;
if (android.os.Build$VERSION.SDK_INT >= 21) {
v0_1 = 0;
} else {
v0_1 = 1;
}
tf.a = v0_1;
tf.b = android.graphics.PorterDuff$Mode.SRC_IN;
tf.c = new java.util.WeakHashMap();
tf.d = new tg(6);
int[] v0_7 = new int[3];
v0_7[0] = a.aN;
v0_7[1] = a.aL;
v0_7[2] = a.af;
tf.e = v0_7;
int[] v0_9 = new int[12];
v0_9[0] = a.ao;
v0_9[1] = a.ar;
v0_9[2] = a.ay;
v0_9[3] = a.aq;
v0_9[4] = a.ap;
v0_9[5] = a.ax;
v0_9[6] = a.as;
v0_9[7] = a.at;
v0_9[8] = a.aw;
v0_9[9] = a.av;
v0_9[10] = a.au;
v0_9[11] = a.az;
tf.f = v0_9;
int[] v0_10 = new int[4];
v0_10[0] = a.aK;
v0_10[1] = a.aM;
v0_10[2] = a.am;
v0_10[3] = a.aJ;
tf.g = v0_10;
int[] v0_11 = new int[3];
v0_11[0] = a.aC;
v0_11[1] = a.ak;
v0_11[2] = a.aB;
tf.h = v0_11;
int[] v0_13 = new int[10];
v0_13[0] = a.an;
v0_13[1] = a.aI;
v0_13[2] = a.aO;
v0_13[3] = a.aE;
v0_13[4] = a.aF;
v0_13[5] = a.aD;
v0_13[6] = a.aH;
v0_13[7] = a.aG;
v0_13[8] = a.ai;
v0_13[9] = a.ag;
tf.i = v0_13;
int[] v0_14 = new int[2];
v0_14[0] = a.ah;
v0_14[1] = a.aj;
tf.j = v0_14;
return;
}
private tf(android.content.Context p2)
{
this.k = new ref.WeakReference(p2);
return;
}
public static android.graphics.drawable.Drawable a(android.content.Context p2, int p3)
{
if ((!tf.a(tf.f, p3)) && ((!tf.a(tf.e, p3)) && ((!tf.a(tf.g, p3)) && ((!tf.a(tf.i, p3)) && ((!tf.a(tf.h, p3)) && ((!tf.a(tf.j, p3)) && (p3 != a.al))))))) {
int v0_13 = 0;
} else {
v0_13 = 1;
}
int v0_14;
if (v0_13 == 0) {
v0_14 = au.a(p2, p3);
} else {
v0_14 = tf.a(p2).a(p3, 0);
}
return v0_14;
}
public static tf a(android.content.Context p2)
{
tf v0_2 = ((tf) tf.c.get(p2));
if (v0_2 == null) {
v0_2 = new tf(p2);
tf.c.put(p2, v0_2);
}
return v0_2;
}
private static void a(android.graphics.drawable.Drawable p3, int p4, android.graphics.PorterDuff$Mode p5)
{
if (p5 == null) {
p5 = tf.b;
}
android.graphics.PorterDuffColorFilter v0_2 = ((android.graphics.PorterDuffColorFilter) tf.d.a(Integer.valueOf(tg.a(p4, p5))));
if (v0_2 == null) {
android.graphics.PorterDuffColorFilter v1_3 = new android.graphics.PorterDuffColorFilter(p4, p5);
tf.d.a(Integer.valueOf(tg.a(p4, p5)), v1_3);
v0_2 = v1_3;
}
p3.setColorFilter(v0_2);
return;
}
public static void a(android.view.View p4, te p5)
{
int v0_0 = p4.getBackground();
if (!p5.b) {
v0_0.clearColorFilter();
} else {
tf.a(v0_0, p5.a.getColorForState(p4.getDrawableState(), p5.a.getDefaultColor()), 0);
}
if (android.os.Build$VERSION.SDK_INT <= 10) {
p4.invalidate();
}
return;
}
private static boolean a(int[] p4, int p5)
{
int v0 = 0;
int v1 = 0;
while (v1 < p4.length) {
if (p4[v1] != p5) {
v1++;
} else {
v0 = 1;
break;
}
}
return v0;
}
public final android.content.res.ColorStateList a(int p12)
{
int[][] v0_3;
int[][] v0_2 = ((android.content.Context) this.k.get());
if (v0_2 != null) {
int[][] v1_1;
if (this.l == null) {
v1_1 = 0;
} else {
v1_1 = ((android.content.res.ColorStateList) this.l.get(p12));
}
if (v1_1 != null) {
v0_3 = v1_1;
} else {
if (p12 != a.an) {
if (p12 != a.aH) {
if (p12 != a.aG) {
if ((p12 != a.ai) && (p12 != a.ag)) {
if ((p12 != a.aE) && (p12 != a.aF)) {
if (!tf.a(tf.f, p12)) {
if (!tf.a(tf.i, p12)) {
if (!tf.a(tf.j, p12)) {
v0_3 = v1_1;
} else {
int[][] v1_4 = new int[][3];
int[] v2_13 = new int[3];
v1_4[0] = tb.a;
v2_13[0] = tb.c(v0_2, a.C);
v1_4[1] = tb.e;
v2_13[1] = tb.a(v0_2, a.A);
v1_4[2] = tb.h;
v2_13[2] = tb.a(v0_2, a.C);
v0_3 = new android.content.res.ColorStateList(v1_4, v2_13);
}
} else {
if (this.m == null) {
int[][] v1_7 = tb.a(v0_2, a.C);
int[] v2_15 = tb.a(v0_2, a.A);
int v3_9 = new int[][7];
int[] v4_1 = new int[7];
v3_9[0] = tb.a;
v4_1[0] = tb.c(v0_2, a.C);
v3_9[1] = tb.b;
v4_1[1] = v2_15;
v3_9[2] = tb.c;
v4_1[2] = v2_15;
v3_9[3] = tb.d;
v4_1[3] = v2_15;
v3_9[4] = tb.e;
v4_1[4] = v2_15;
v3_9[5] = tb.f;
v4_1[5] = v2_15;
v3_9[6] = tb.h;
v4_1[6] = v1_7;
this.m = new android.content.res.ColorStateList(v3_9, v4_1);
}
v0_3 = this.m;
}
} else {
v0_3 = tb.b(v0_2, a.C);
}
} else {
int[][] v1_9 = new int[][3];
int[] v2_17 = new int[3];
v1_9[0] = tb.a;
v2_17[0] = tb.c(v0_2, a.C);
v1_9[1] = tb.g;
v2_17[1] = tb.a(v0_2, a.C);
v1_9[2] = tb.h;
v2_17[2] = tb.a(v0_2, a.A);
v0_3 = new android.content.res.ColorStateList(v1_9, v2_17);
}
} else {
int[][] v1_10 = new int[][4];
int[] v2_18 = new int[4];
int v3_19 = tb.a(v0_2, a.z);
int[] v4_3 = tb.a(v0_2, a.B);
v1_10[0] = tb.a;
v2_18[0] = tb.c(v0_2, a.z);
v1_10[1] = tb.d;
v2_18[1] = a.a(v4_3, v3_19);
v1_10[2] = tb.b;
v2_18[2] = a.a(v4_3, v3_19);
v1_10[3] = tb.h;
v2_18[3] = v3_19;
v0_3 = new android.content.res.ColorStateList(v1_10, v2_18);
}
} else {
int[][] v1_11 = new int[][3];
int[] v2_19 = new int[3];
int v3_21 = tb.b(v0_2, a.D);
if ((v3_21 == 0) || (!v3_21.isStateful())) {
v1_11[0] = tb.a;
v2_19[0] = tb.c(v0_2, a.D);
v1_11[1] = tb.e;
v2_19[1] = tb.a(v0_2, a.A);
v1_11[2] = tb.h;
v2_19[2] = tb.a(v0_2, a.D);
} else {
v1_11[0] = tb.a;
v2_19[0] = v3_21.getColorForState(v1_11[0], 0);
v1_11[1] = tb.e;
v2_19[1] = tb.a(v0_2, a.A);
v1_11[2] = tb.h;
v2_19[2] = v3_21.getDefaultColor();
}
v0_3 = new android.content.res.ColorStateList(v1_11, v2_19);
}
} else {
int[][] v1_12 = new int[][3];
int[] v2_20 = new int[3];
v1_12[0] = tb.a;
v2_20[0] = tb.a(v0_2, 16842800, 1036831949);
v1_12[1] = tb.e;
v2_20[1] = tb.a(v0_2, a.A, 1050253722);
v1_12[2] = tb.h;
v2_20[2] = tb.a(v0_2, 16842800, 1050253722);
v0_3 = new android.content.res.ColorStateList(v1_12, v2_20);
}
} else {
int[][] v1_13 = new int[][3];
int[] v2_21 = new int[3];
v1_13[0] = tb.a;
v2_21[0] = tb.c(v0_2, a.C);
v1_13[1] = tb.g;
v2_21[1] = tb.a(v0_2, a.C);
v1_13[2] = tb.h;
v2_21[2] = tb.a(v0_2, a.A);
v0_3 = new android.content.res.ColorStateList(v1_13, v2_21);
}
if (v0_3 != null) {
if (this.l == null) {
this.l = new android.util.SparseArray();
}
this.l.append(p12, v0_3);
}
}
} else {
v0_3 = 0;
}
return v0_3;
}
public final android.graphics.drawable.Drawable a(int p6, boolean p7)
{
android.graphics.drawable.LayerDrawable v1_0 = 0;
android.graphics.drawable.LayerDrawable v0_2 = ((android.content.Context) this.k.get());
if (v0_2 != null) {
android.graphics.drawable.LayerDrawable v0_3 = au.a(v0_2, p6);
if (v0_3 != null) {
if (android.os.Build$VERSION.SDK_INT >= 8) {
v0_3 = v0_3.mutate();
}
boolean v2_1 = this.a(p6);
if (!v2_1) {
if (p6 != a.al) {
if ((!this.a(p6, v0_3)) && (p7)) {
v0_3 = 0;
}
} else {
android.graphics.drawable.LayerDrawable v0_5 = new android.graphics.drawable.Drawable[2];
v0_5[0] = this.a(a.ak, 0);
v0_5[1] = this.a(a.am, 0);
v1_0 = new android.graphics.drawable.LayerDrawable(v0_5);
return v1_0;
}
} else {
v0_3 = bo.c(v0_3);
bo.a(v0_3, v2_1);
if (p6 == a.aG) {
v1_0 = android.graphics.PorterDuff$Mode.MULTIPLY;
}
if (v1_0 != null) {
bo.a(v0_3, v1_0);
}
}
}
v1_0 = v0_3;
}
return v1_0;
}
public final boolean a(int p9, android.graphics.drawable.Drawable p10)
{
int v0_3;
int v0_2 = ((android.content.Context) this.k.get());
if (v0_2 != 0) {
int v5_0;
int v7;
int v3_7;
int v6_1;
if (!tf.a(tf.e, p9)) {
if (!tf.a(tf.g, p9)) {
if (!tf.a(tf.h, p9)) {
if (p9 != a.aA) {
v3_7 = -1;
v5_0 = 0;
v7 = 0;
v6_1 = 0;
} else {
v5_0 = 16842800;
v3_7 = Math.round(1109603123);
v7 = 0;
v6_1 = 1;
}
} else {
v6_1 = 1;
v7 = android.graphics.PorterDuff$Mode.MULTIPLY;
v5_0 = 16842801;
v3_7 = -1;
}
} else {
v5_0 = a.A;
v7 = 0;
v6_1 = 1;
v3_7 = -1;
}
} else {
v5_0 = a.C;
v7 = 0;
v6_1 = 1;
v3_7 = -1;
}
if (v6_1 == 0) {
v0_3 = 0;
} else {
tf.a(p10, tb.a(v0_2, v5_0), v7);
if (v3_7 != -1) {
p10.setAlpha(v3_7);
}
v0_3 = 1;
}
} else {
v0_3 = 0;
}
return v0_3;
}
| [
"[email protected]"
] | |
2501817097f01f9c870aa0d6979881f0d4b5275c | a530472585b9026045a05324668c5468ae298361 | /WebAPIAutomation/src/test/java/statusTest/Get200.java | 279aa5ee9abd38c7720e86a1092c1aa1d6a7d717 | [] | no_license | shahjugal23/apiWorkspace | 3abe066d13ca613c183b94ddfdb3d63c4b537ce0 | ec79b2dfc05a87fcbf2189278eefec22308b1a6c | refs/heads/master | 2023-03-22T03:19:52.659946 | 2023-03-14T09:41:20 | 2023-03-14T09:41:20 | 204,002,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,741 | java | package statusTest;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class Get200 {
public static final String BASE_URL = "https://api.github.com";
CloseableHttpClient client ;
CloseableHttpResponse response;
@BeforeMethod
public void setup(){
client = HttpClientBuilder.create().build();
}
@Test
public void testGet200() throws ClientProtocolException, IOException {
HttpGet get = new HttpGet(BASE_URL);
response = client.execute(get);
int actualStatusCode = response.getStatusLine().getStatusCode();
assertEquals(actualStatusCode,200);
}
@Test
public void testrateLimits() throws ClientProtocolException, IOException {
HttpGet get = new HttpGet(BASE_URL + "/rate_limit");
HttpResponse response = client.execute(get);
int actualStatusCode = response.getStatusLine().getStatusCode();
assertEquals(actualStatusCode,200);
}
@Test
public void testSearch() throws ClientProtocolException, IOException {
HttpGet get = new HttpGet(BASE_URL +"/search/repositories?q=java");
HttpResponse response = client.execute(get);
int actualStatusCode = response.getStatusLine().getStatusCode();
assertEquals(actualStatusCode,200);
}
@AfterMethod
public void tearDown() throws IOException{
client.close();
response.close();
}
}
| [
"[email protected]"
] | |
a3e6c3859efef9e9f9a06d0e58c66813edf778c6 | 47f068783ceda233fedf5829ce847544c3895ba4 | /15_stmt_throw-throw_14_catch_field_shadow/throw_14_catch_field_shadow.java | ac72879c4d1142ebbbeb0d76d0751d49693a08f1 | [] | no_license | pengyunie/gvm-kbenchmark | ffef100cf9be46fa07ea04ffee16d0d2901a2394 | 2915cbd930aa82f8c26a4e63dab90faf59f9b08d | refs/heads/master | 2022-01-19T04:06:49.659426 | 2019-04-04T05:06:39 | 2019-04-04T05:06:39 | 195,458,348 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 571 | java | // Testing interplay of fields and catch clause vars with the same name
class ExField extends RuntimeException {}
class ExThrown extends RuntimeException {}
class test {
RuntimeException e = new ExField();
test() {
try {
throw new ExThrown();
} catch (RuntimeException e) {
System.out.print("caught exception: "); System.out.println( e.toString());
}
System.out.println(e.toString());
}
}
public class throw_14_catch_field_shadow {
public static void main(String[] args) {
new test();
System.out.println("Done!");
}
}
| [
"[email protected]"
] | |
e58d9e20412565c304a45999f9df3eb1a1fbb61b | 7d60f26085c2d2fb5ebb02acf2317066c84d77f2 | /spring-boot-servlet/src/main/java/com/example/springbootservlet/servlet/CustomServlet.java | f5ae4468dbe46ed8f849f48d20dc3e4aac846a94 | [] | no_license | gaoyuliang123/spring-boot-demo | f564744021a936042201d4a77bcee86175b4d703 | 43d353c39b8a74bcd020413e1570c3888239c893 | refs/heads/master | 2021-05-14T01:38:39.626728 | 2018-06-30T09:25:47 | 2018-06-30T09:25:51 | 116,570,053 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 775 | java | package com.example.springbootservlet.servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @description:
* @author: TGL
* @date: 2018/6/24 22:33
*/
public class CustomServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
this.doPost(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
System.out.println("CustomServlet······");
resp.getWriter().write("CustomServlet");
}
}
| [
"[email protected]"
] | |
57efab11e1527ba0816357ea98e7028f1a274e8e | 4c4a1b6dca0f8824b8e20afd33256f68b4d30189 | /S2阶段项目/JSP/23袁建华/SBM/SBM/src/com/qhit/sbm/common/Dao/CommonDao.java | a053042a1579d073d13be5ef49d9aeac7bf40c86 | [] | no_license | yhjm/163G4G | 230636983fee11736338842aa639ae3b33ebca23 | 94ed669d24c32318d7769ad8b8c7fff73c17b6dc | refs/heads/master | 2021-09-11T19:22:06.711176 | 2018-04-11T11:57:52 | 2018-04-11T11:57:52 | 111,631,514 | 0 | 0 | null | 2017-11-22T03:25:34 | 2017-11-22T03:25:34 | null | UTF-8 | Java | false | false | 133 | java | package com.qhit.sbm.common.Dao;
public interface CommonDao {
public int getCount(String table,String [] arg0, String [] arg1);
}
| [
"華"
] | 華 |
f3dff18ccde23bf401a55689e0070e6f273239fc | d82acd125fb7d6570e58a522ed1b8f28af11123a | /ui/data/City floor findbugs/model/src/edu/umd/cs/findbugs/classfile/IAnalysisEngine.java | 495c26d3104625c4f6edd9929392eaa24c76f979 | [
"Apache-2.0"
] | permissive | fetteradler/Getaviz | dba3323060d3bca81d2d93a2c1a19444ca406e16 | 9e80d842312f55b798044c069a1ef297e64da86f | refs/heads/master | 2020-03-22T11:34:46.963754 | 2018-08-29T14:19:09 | 2018-08-29T14:19:09 | 139,980,787 | 0 | 0 | Apache-2.0 | 2018-07-06T12:16:17 | 2018-07-06T12:16:17 | null | UTF-8 | Java | false | false | 1,686 | java | /*
* FindBugs - Find Bugs in Java programs
* Copyright (C) 2006-2007 University of Maryland
*
* This library 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 2.1 of the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package edu.umd.cs.findbugs.classfile;
/**
* An engine for analyzing classes or methods.
*
* @author David Hovemeyer
*/
public interface IAnalysisEngine<DescriptorType, ResultType> {
/**
* Perform an analysis on class or method named by given descriptor.
*
* @param analysisCache
* the analysis cache
* @param descriptor
* the descriptor of the class or method to be analyzed
* @return the result of the analysis of the class or method
*/
public ResultType analyze(IAnalysisCache analysisCache, DescriptorType descriptor) throws CheckedAnalysisException;
/**
* Register the analysis engine with given analysis cache.
*
* @param analysisCache
* the analysis cache
*/
public void registerWith(IAnalysisCache analysisCache);
}
| [
"[email protected]"
] | |
33d3cf8d28cb380a26b300f5fd05b4be674139f4 | 674c5b2e27701d47ec424f61288ea20c6dc9e13a | /app/src/main/java/edu/csce4623/ahnelson/todomvp3/todolistactivity/ToDoListPresenter.java | 2b38771963b8a99ab83f20fe2c16d9f624adf4e3 | [] | no_license | andredonati/ToDo | 0c8126e9c19a398cc1dc1e3b0fb7b734d4227e88 | 61bdb46ed7681597aabdfbcb473ce65ab5bb02fd | refs/heads/master | 2022-12-30T23:48:52.085560 | 2020-10-19T17:49:41 | 2020-10-19T17:49:41 | 305,467,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,350 | java | package edu.csce4623.ahnelson.todomvp3.todolistactivity;
import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import androidx.annotation.NonNull;
import java.util.List;
import edu.csce4623.ahnelson.todomvp3.R;
import edu.csce4623.ahnelson.todomvp3.addedittodoitem.AddEditToDoItemActivity;
import edu.csce4623.ahnelson.todomvp3.data.ToDoItem;
import edu.csce4623.ahnelson.todomvp3.data.ToDoItemRepository;
import edu.csce4623.ahnelson.todomvp3.data.ToDoListDataSource;
/**
* ToDoListPresenter -- Implements the Presenter interface from ToDoListContract Presenter
*/
public class ToDoListPresenter extends ToDoListFragment implements ToDoListContract.Presenter {
//Data repository instance
//Currently has a memory leak -- need to refactor context passing
public static ToDoItemRepository mToDoItemRepository;
//View instance
private final ToDoListContract.View mToDoItemView;
private ToDoListFragment mtoDoListFragment;
// Integer request codes for creating or updating through the result method
public static final int CREATE_TODO_REQUEST = 0;
public static final int UPDATE_TODO_REQUEST = 1;
/**
* ToDoListPresenter constructor
* @param toDoItemRepository - Data repository instance
* @param toDoItemView - ToDoListContract.View instance
*/
public ToDoListPresenter(@NonNull ToDoItemRepository toDoItemRepository, @NonNull ToDoListContract.View toDoItemView, @NonNull ToDoListFragment toDoListFragment){
mToDoItemRepository = toDoItemRepository;
mToDoItemView = toDoItemView;
//Make sure to pass the presenter into the view!
mToDoItemView.setPresenter(this);
mtoDoListFragment = toDoListFragment;
}
@Override
public void start(){
//Load all toDoItems
loadToDoItems();
}
@Override
public void addNewToDoItem() {
//Create stub ToDoItem with temporary data
ToDoItem item = new ToDoItem();
item.setCompleted(false);
item.setDueDate(System.currentTimeMillis());
item.setId(-1);
//Show AddEditToDoItemActivity with a create request and temporary item
mToDoItemView.showAddEditToDoItem(item,CREATE_TODO_REQUEST);
}
@Override
public void showExistingToDoItem(ToDoItem item) {
//Show AddEditToDoItemActivity with a edit request, passing through an item
Log.d("ToDoListPresenter", "TODO: Show Existing ToDoItem");
mToDoItemView.showAddEditToDoItem(item,UPDATE_TODO_REQUEST);
}
@Override
public void result(int requestCode, int resultCode, ToDoItem item) {
if(resultCode == Activity.RESULT_OK){
if(requestCode == CREATE_TODO_REQUEST){
createToDoItem(item);
requestCode = UPDATE_TODO_REQUEST;
Log.d("RESULT", "inside result");
}else if(requestCode == UPDATE_TODO_REQUEST){
updateToDoItem(item);
}else{
Log.e("ToDoPresenter", "No such request!");
}
}
}
@Override
public void deleteToDoItem(ToDoItem toDoItem) {
try{
mToDoItemRepository.deleteToDoItem(toDoItem.getId());
}catch (Exception e){
e.printStackTrace();
}
}
/**
* Create ToDoItem in repository from ToDoItem and reload data
* @param item - item to be placed in the data repository
*/
private void createToDoItem(ToDoItem item){
try{
mToDoItemRepository.createToDoItem(item);
}catch(Exception e){
e.printStackTrace();
}
}
/**
* Update ToDoItem in repository from ToDoItem and reload data
* @param item -- ToDoItem to be updated in the ToDoItemRepository
*/
@Override
public void updateToDoItem(ToDoItem item){
try{
Log.d("ToDoListPresenter", "TODO: Update Item");
mToDoItemRepository.saveToDoItem(item);
}catch(Exception e){
e.printStackTrace();
}
}
/**
* loadToDoItems -- loads all items from ToDoItemRepository
* Two callbacks -- success/failure
*/
@Override
public void loadToDoItems(){
Log.d("ToDoListPresenter","Loading ToDoItems");
mToDoItemRepository.getToDoItems(new ToDoListDataSource.LoadToDoItemsCallback() {
@Override
public void onToDoItemsLoaded(List<ToDoItem> toDoItems) {
Log.d("PRESENTER","Loaded");
if (toDoItems.size() == 0){
ToDoItem temp = new ToDoItem();
temp.setId(-1);
temp.setDueDate(-1);
temp.setCompleted(false);
temp.setTitle("Temporary To-Do Item");
temp.setContent("Temporary Content");
toDoItems.add(temp);
}
mToDoItemView.showToDoItems(toDoItems);
}
@Override
public void onDataNotAvailable() {
Log.d("PRESENTER","Not Loaded");
}
});
}
}
| [
"[email protected]"
] | |
e49897005b7e02dfcc7e8a3d4debaf29ef17a3e1 | 3aad3750b53bbc4b3e83b8fe8317ccabdb8af7d9 | /src/codechicken/wirelessredstone/core/ParamOpen.java | a7d6faaef2d4fe97a6eb9fe0341e67d515a030c4 | [
"MIT"
] | permissive | Chicken-Bones/WirelessRedstone | 7f35d33891d0186f8b56dbcc38f0a14ebb0f0732 | 0c7fff755a3dc5a585f886b78cd3da72f9ff9f97 | refs/heads/master | 2021-01-17T08:10:44.925419 | 2016-07-13T14:14:00 | 2016-07-13T14:14:00 | 22,309,500 | 13 | 20 | MIT | 2020-09-25T21:54:50 | 2014-07-27T11:36:26 | Java | UTF-8 | Java | false | false | 737 | java | package codechicken.wirelessredstone.core;
import codechicken.core.commands.CoreCommand.WCommandSender;
import java.util.Arrays;
public class ParamOpen extends FreqParam
{
@Override
public void printHelp(WCommandSender listener) {
listener.chatT("wrcbe_core.param.open.usage");
listener.chatT("wrcbe_core.param.open.usage1");
listener.chatT("wrcbe_core.param.jam.usage" + (rand.nextInt(5) + 2), "open");
}
@Override
public String getName() {
return "open";
}
@Override
public void handleCommand(String playername, String[] args, WCommandSender listener) {
ParamJam.jamOpenCommand(playername, Arrays.copyOfRange(args, 1, args.length), listener, false);
}
}
| [
"[email protected]"
] | |
e1ff96d6e159ded5b099a0ab2de2aa57243306e9 | 20dd663cb43f4f1ec6e62f5c533bf7a00b9b0a22 | /src/Util/KyThiBeanUtil.java | bd68ebb18e9f06c913899c38a568f425c2e09050 | [] | no_license | 00mjk/thitracnghiemjava | db7b051bc259fc3220717d28fda145a6c2ca2c9f | 336f8a66ee8bc40f73dcf25564b4b90bab0664a7 | refs/heads/master | 2023-03-17T08:39:25.111615 | 2020-06-25T09:06:23 | 2020-06-25T09:06:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,069 | 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 Util;
import DTO.KyThiDTO;
import Entity.KyThiEntity;
/**
*
* @author hocgioinhatlop
*/
public class KyThiBeanUtil {
public static KyThiDTO entity2Dto(KyThiEntity entity) {
KyThiDTO dto = new KyThiDTO();
dto.setMaKyThi(entity.getMaKyThi());
dto.setTenKyThi(entity.getTenKyThi());
dto.setDiaDiem(entity.getDiaDiem());
dto.setNgayThi(entity.getNgayThi());
dto.setNgayKetThuc(entity.getNgayKetThuc());
return dto;
}
public static KyThiEntity dto2Entity(KyThiDTO dto) {
KyThiEntity entity = new KyThiEntity();
entity.setMaKyThi(dto.getMaKyThi());
entity.setTenKyThi(dto.getTenKyThi());
entity.setDiaDiem(dto.getDiaDiem());
entity.setNgayThi(dto.getNgayThi());
entity.setNgayKetThuc(dto.getNgayKetThuc());
return entity;
}
}
| [
"[email protected]"
] | |
64a0069188494260f11b0c20a3390c2dc3db491c | 63f03f7f0f16f6df8117f9057d86e5881be4617e | /src/main/java/org/eop/sb/security/access/decision/RoleAccessDecisionVoter.java | 7048b543230eb7e57da675e2f6f212a0d032dad7 | [
"Apache-2.0"
] | permissive | endofprogram/eop-sb | 61699b89096128a5cae5da04f5dccb54d61013a2 | 53e3bcd9ad10f2549048ed18b335d925e40d694e | refs/heads/master | 2020-03-27T19:39:30.348758 | 2019-05-24T10:23:29 | 2019-05-24T10:23:29 | 147,003,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,369 | java | package org.eop.sb.security.access.decision;
import java.util.Collection;
import org.eop.sb.security.access.authority.RoleGrantedAuthority;
import org.springframework.security.access.AccessDecisionVoter;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.FilterInvocation;
/**
* <p>基于角色的投票者
* @author lixinjie
* @since 2018-10-22
*/
public class RoleAccessDecisionVoter implements AccessDecisionVoter<FilterInvocation> {
@Override
public int vote(Authentication authentication, FilterInvocation fi,
Collection<ConfigAttribute> attributes) {
//如果当前用户具有管理员角色,直接通过
if (authentication.getAuthorities().contains(new RoleGrantedAuthority("ROLE_Admin"))) {
return ACCESS_GRANTED;
}
//检查当前用户是否具有要求角色的一个,有则通过
for (ConfigAttribute attribute : attributes) {
if (authentication.getAuthorities().contains((Object)attribute)) {
return ACCESS_GRANTED;
}
}
//弃权
return ACCESS_ABSTAIN;
}
@Override
public boolean supports(ConfigAttribute attribute) {
return true;
}
@Override
public boolean supports(Class<?> clazz) {
return FilterInvocation.class.isAssignableFrom(clazz);
}
}
| [
"Administrator@L8Y9K64OI1IX0G4"
] | Administrator@L8Y9K64OI1IX0G4 |
f2c63cff3f2671713be2e7dcb9149e1bc58ecab0 | ad3e68c51e30dce8dbc04e14ed3dc4a042f2d4e6 | /bean-config-xml/src/main/java/hu/soter/bean_config_xml/HashmarkNameFormatter.java | 0bcd537447f908b349865674dca633283f611f3c | [] | no_license | soterTraining/spring | f9875acc6cb709e19b36fbcc004d9ddb5dc9f1b9 | a9aaf424b76538297b7b6fa97c31782f576ac57c | refs/heads/master | 2021-01-23T11:32:07.544461 | 2017-06-28T16:53:43 | 2017-06-28T16:53:43 | 93,141,598 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 259 | java | package hu.soter.bean_config_xml;
import org.springframework.stereotype.Component;
@Component("hashmark")
public class HashmarkNameFormatter implements Formatter {
@Override
public String format(String name) {
return name.replaceAll("\\s+", "#");
}
}
| [
"coming_soon"
] | coming_soon |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.