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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7048ce27aa80701d84f83ac29e79d47c7498e40d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/30/30_037edfc3d519a82889ef3c25e0100b702796cc13/InputFileHandler/30_037edfc3d519a82889ef3c25e0100b702796cc13_InputFileHandler_t.java | 2ccf8fe97518ac631bdd03caa9749f6c05cb3498 | [] | 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 | 10,432 | java | package org.plovr;
import java.io.IOException;
import java.net.URI;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.plovr.JsInput.CodeWithEtag;
import org.plovr.io.Responses;
import org.plovr.util.HttpExchangeUtil;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.base.Functions;
import com.google.common.base.Strings;
import com.google.common.io.Resources;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import com.google.template.soy.SoyFileSet;
import com.google.template.soy.data.SoyMapData;
import com.google.template.soy.tofu.SoyTofu;
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
/**
* {@link InputFileHandler} serves the content of input files to a compilation.
*
* @author [email protected] (Michael Bolin)
*/
public class InputFileHandler extends AbstractGetHandler {
private static final String PARENT_DIRECTORY_TOKEN = "../";
private static final String PARENT_DIRECTORY_PATTERN =
Pattern.quote(PARENT_DIRECTORY_TOKEN);
private static final String PARENT_DIRECTORY_REPLACEMENT_TOKEN = "$$/";
private static final String PARENT_DIRECTORY_REPLACEMENT_PATTERN =
PARENT_DIRECTORY_REPLACEMENT_TOKEN.replaceAll("\\$",
Matcher.quoteReplacement("\\$"));
private static final SoyTofu TOFU;
static {
SoyFileSet.Builder builder = new SoyFileSet.Builder();
builder.add(Resources.getResource(InputFileHandler.class, "raw.soy"));
SoyFileSet fileSet = builder.build();
TOFU = fileSet.compileToTofu();
}
public InputFileHandler(CompilationServer server) {
super(server, true /* usesRestfulPath */);
}
/**
* Returns the JavaScript code that bootstraps loading the application code.
*/
static String getJsToLoadManifest(CompilationServer server,
final Config config,
Manifest manifest,
HttpExchange exchange) throws CompilationException {
// Function that converts a JsInput to the URI where its raw content can be
// loaded.
Function<JsInput,JsonPrimitive> inputToUri = Functions.compose(
GsonUtil.STRING_TO_JSON_PRIMITIVE,
createInputNameToUriConverter(server, exchange, config.getId()));
String moduleInfo;
String moduleUris;
ModuleConfig moduleConfig = config.getModuleConfig();
List<JsInput> inputs;
if (moduleConfig == null) {
moduleInfo = null;
moduleUris = null;
inputs = manifest.getInputsInCompilationOrder();
} else {
moduleInfo = Compilation.createModuleInfo(moduleConfig).toString();
// Get the list of JsInputs for each module and use that to construct
// the JsonObject that will be used for the PLOVR_MODULE_URIS variable.
Map<String, List<JsInput>> moduleToInputList = moduleConfig.
partitionInputsIntoModules(manifest);
JsonObject obj = new JsonObject();
for (Map.Entry<String, List<JsInput>> entry : moduleToInputList.entrySet()) {
String moduleName = entry.getKey();
JsonArray uris = new JsonArray();
for (JsInput input : entry.getValue()) {
uris.add(inputToUri.apply(input));
}
obj.add(moduleName, uris);
}
moduleUris = obj.toString();
// Have the initial JS load the list of files that correspond to the root
// module. The root module is responsible for loading the other modules.
inputs = moduleToInputList.get(moduleConfig.getRootModule());
}
JsonArray inputUrls = new JsonArray();
for (JsInput input : inputs) {
inputUrls.add(inputToUri.apply(input));
}
// TODO(bolinfest): Figure out how to reuse Compilation#appendRootModuleInfo
// May require moving the method to ModuleConfig.
SoyMapData mapData = new SoyMapData(
"moduleInfo", moduleInfo,
"moduleUris", moduleUris,
"filesAsJsonArray", inputUrls.toString(),
"path", exchange.getRequestURI().getPath());
return TOFU.newRenderer("org.plovr.raw").setData(mapData).render();
}
/**
* Pattern that matches the path to the REST URI for this handler.
* The \\w+ will match the config id and the (/.*) will match the
* input name.
*/
private static final Pattern URI_INPUT_PATTERN = Pattern.compile(
"/input/" + AbstractGetHandler.CONFIG_ID_PATTERN + "(/.*)");
@Override
protected void doGet(HttpExchange exchange, QueryData data, Config config)
throws IOException {
Manifest manifest = config.getManifest();
URI uri = exchange.getRequestURI();
Matcher matcher = URI_INPUT_PATTERN.matcher(uri.getPath());
if (!matcher.matches()) {
throw new IllegalArgumentException("Input could not be extracted from URI");
}
String name = matcher.group(1);
// If the user requests the deps.js alongside base.js, then return the
// generated dependency info for this config rather than the default deps.js
// that comes with the Closure Library.
String depsJsName = manifest.isBuiltInClosureLibrary() ?
"/closure/goog/deps.js" : "/deps.js";
if (name.equals(depsJsName)) {
super.setCacheHeaders(exchange.getResponseHeaders());
Responses.writeJs(getCodeForDepsJs(manifest), config, exchange);
return;
}
// Reverse the rewriting done by createInputNameToUriConverter().
name = name.replaceAll(PARENT_DIRECTORY_REPLACEMENT_PATTERN,
PARENT_DIRECTORY_TOKEN);
// Find the JsInput that matches the specified name.
// TODO: eliminate this hack with the slash -- just make it an invariant of
// the system.
JsInput requestedInput = manifest.getJsInputByName(name);
if (requestedInput == null && name.startsWith("/")) {
// Remove the leading slash and try again.
name = name.substring(1);
requestedInput = manifest.getJsInputByName(name);
}
// Find the code for the requested input.
String code;
if (requestedInput == null) {
code = null;
} else if (requestedInput.supportsEtags()) {
// Set/check an ETag, if appropriate.
CodeWithEtag codeWithEtag = requestedInput.getCodeWithEtag();
String eTag = codeWithEtag.eTag;
String ifNoneMatch = exchange.getRequestHeaders().getFirst(
"If-None-Match");
if (eTag.equals(ifNoneMatch) &&
!HttpExchangeUtil.isGoogleChrome(exchange)) {
Responses.notModified(exchange);
return;
} else {
Headers headers = exchange.getResponseHeaders();
headers.set("ETag", eTag);
code = codeWithEtag.code;
}
} else {
// Do not set cache headers if the logic for ETags has not been defined
// for this JsInput. Setting an "Expires" header based on the last
// modified time for a file has been observed to cause resources to be
// cached incorrectly by IE6.
super.setCacheHeaders(exchange.getResponseHeaders());
code = requestedInput.getCode();
}
if (code == null) {
HttpUtil.writeNullResponse(exchange);
return;
}
Responses.writeJs(code, config, exchange);
}
private String getCodeForDepsJs(Manifest manifest) {
// Ordinarily, this will be "/closure/goog/base.js". It could be something
// else if the user supplies his own Closure Library.
String baseJsPath = manifest.getBaseJs().getName();
if (baseJsPath.startsWith("/")) {
baseJsPath = baseJsPath.substring(1);
}
int numDirectories = baseJsPath.split("\\/").length - 1;
final String relativePath = Strings.repeat("../", numDirectories);
Function<JsInput, String> converter = new Function<JsInput, String>() {
@Override
public String apply(JsInput input) {
String path = InputFileHandler.escapeRelativePath.apply(input.getName());
if (path.startsWith("/")) {
path = path.substring(1);
}
return relativePath + path;
}
};
return manifest.buildDepsJs(converter);
}
/**
* By default, do nothing. {@link AbstractGetHandler#setCacheHeaders(Headers)}
* will be called as appropriate from
* {@link #doGet(HttpExchange, QueryData, Config)}.
*/
@Override
protected void setCacheHeaders(Headers headers) {}
static Function<JsInput, String> createInputNameToUriConverter(
CompilationServer server, HttpExchange exchange, final String configId) {
String moduleUriBase = server.getServerForExchange(exchange);
return createInputNameToUriConverter(moduleUriBase, configId);
}
@VisibleForTesting
static Function<JsInput, String> createInputNameToUriConverter(
final String moduleUriBase, final String configId) {
return new Function<JsInput, String>() {
@Override
public String apply(JsInput input) {
// TODO(bolinfest): Should input.getName() be URI-escaped? Maybe all
// characters other than slashes?
// Hack: some input names do not have a leading slash, so add one when
// that is not the case and special case this in doGet().
String name = input.getName();
if (!name.startsWith("/")) {
name = "/" + name;
}
// If an input name has "../" as part of its name, then the URL will be
// rewritten as if it were "back a directory." To prevent this from
// happening, this pattern is replaced with "$$/". This pattern must be
// translated back to the original "../" when handling a request so that
// the input can be identified by its name (which contains the relative
// path information).
name = escapeRelativePath.apply(name);
return String.format("%sinput/%s%s",
moduleUriBase,
QueryData.encode(configId),
name);
}
};
}
static final Function<String, String> escapeRelativePath =
new Function<String, String>() {
@Override
public String apply(String path) {
return path.replaceAll(PARENT_DIRECTORY_PATTERN,
PARENT_DIRECTORY_REPLACEMENT_PATTERN);
}
};
}
| [
"[email protected]"
] | |
0305ff4fda963a496b69d20225cdc0cea3f87dca | a9b2cf65bb01492e74715dda9c18122ad1d6b02a | /Java-Study-Tasks/src/dataStructures/SearchNode.java | ff61c4c9f85565df6dd369ac2dad096b4214cafb | [] | no_license | StoyanKerkelov/Java-programming-Exercises | 310e8797b251c5ddf13862ea817a0b9cf77b942d | 9c24c0b2335a69ef3646cb8e10065bda4814549d | refs/heads/master | 2021-01-01T18:20:04.651417 | 2017-07-25T13:55:09 | 2017-07-25T13:55:09 | 98,307,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,225 | java | package dataStructures;
import java.lang.reflect.Array;
import java.util.ArrayList;
/**
* The BFS_Node class represents a station in this tutorial and will as such have a
* string representing the station's name. As well as an ArrayList of BFS_Nodes that
* will store any instantiated BFS_Nodes children.
*/
public class SearchNode {
// A Unique Identifier for our BFS_Node
public String stationName;
// An arraylist containing a list of BFS_Nodes that
// This BFS_Node is directly connected to - It's child BFS_Nodes.
SearchNode leftChild;
SearchNode rightChild;
public SearchNode(String stationName, SearchNode firstChild, SearchNode secondChild) {
this.stationName = stationName;
this.leftChild = firstChild;
this.rightChild = secondChild;
}
public ArrayList<SearchNode> getChildren() {
ArrayList<SearchNode> childBFS_Nodes = new ArrayList<>();
if (this.leftChild != null) {
childBFS_Nodes.add(leftChild);
}
if (this.rightChild != null) {
childBFS_Nodes.add(rightChild);
}
return childBFS_Nodes;
}
// An auxiliary function which allows
// us to remove any child BFS_Nodes from
// our list of child BFS_Nodes.
public boolean removeChild(SearchNode n) {
return false;
}
}
| [
"[email protected]"
] | |
0deaab866c4c6ab4b2bef96c1f3bf6daf67fa61c | 9ad5428b089742178568b8ec546cc76a8797594a | /app/src/main/java/com/example/cj/videoeditor/Constants.java | aaaa715de566092217a34c19bc5f259978b2896e | [] | no_license | akamli/VideoEditor-For-Android | a635f871902d80c4c2dc49720a7f9387e0fbc9b2 | 2dfb8f3d3f00f20f59b94e6b26c002928b37bbca | refs/heads/master | 2020-03-16T09:01:57.764609 | 2018-05-08T12:13:39 | 2018-05-08T12:13:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 940 | java | package com.example.cj.videoeditor;
import android.content.Context;
import android.os.Environment;
import android.util.DisplayMetrics;
import java.io.File;
/**
* Created by cj on 2017/6/26 .
*
*/
public class Constants {
public static String getBaseFolder() {
String baseFolder = Environment.getExternalStorageDirectory() + "/Codec/";
File f = new File(baseFolder);
if (!f.exists()) {
boolean b = f.mkdirs();
if (!b) {
baseFolder = MyApplication.getContext().getExternalFilesDir(null).getAbsolutePath() + "/";
}
}
return baseFolder;
}
//获取VideoPath
public static String getPath(String path, String fileName) {
String p = getBaseFolder() + path;
File f = new File(p);
if (!f.exists() && !f.mkdirs()) {
return getBaseFolder() + fileName;
}
return p + fileName;
}
}
| [
"[email protected]"
] | |
a8ca6d8f37c9f1fc77b30f24e86b01bbb8d0f1b8 | d05dd3d7c48cb72138606abc5a8a41785fc145e3 | /app/src/main/java/com/caohua/games/biz/vip/VipRechargeAwardEntry.java | 7788d69e67eeec22790f8d1b0ed62e6f1055d5dd | [] | no_license | ZhouSilverBullet/Android_CH_Platform_App | a0e351f4f1932aea9feaef581ba8b1789fcfc00d | 5e24e02ed52362a92578a7821edeef1faa2b0461 | refs/heads/master | 2021-08-08T08:53:56.003270 | 2017-11-10T00:41:55 | 2017-11-10T00:41:55 | 110,133,513 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,400 | java | package com.caohua.games.biz.vip;
import com.chsdk.model.BaseEntry;
import java.util.List;
/**
* Created by admin on 2017/8/29.
*/
public class VipRechargeAwardEntry extends BaseEntry {
private int code;
private String msg;
private DataBean data;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public static class DataBean extends BaseEntry {
private List<RebateBean> rebate;
private List<CouponBean> coupon;
public List<RebateBean> getRebate() {
return rebate;
}
public void setRebate(List<RebateBean> rebate) {
this.rebate = rebate;
}
public List<CouponBean> getCoupon() {
return coupon;
}
public void setCoupon(List<CouponBean> coupon) {
this.coupon = coupon;
}
public static class RebateBean extends BaseEntry {
private String rebate_id;
private String rebate_title;
private String rebate_desc;
private String game_icon;
private String low_vip;
private int is_close;
private int is_open;
public String getRebate_id() {
return rebate_id;
}
public void setRebate_id(String rebate_id) {
this.rebate_id = rebate_id;
}
public String getRebate_title() {
return rebate_title;
}
public void setRebate_title(String rebate_title) {
this.rebate_title = rebate_title;
}
public String getRebate_desc() {
return rebate_desc;
}
public void setRebate_desc(String rebate_desc) {
this.rebate_desc = rebate_desc;
}
public String getGame_icon() {
return game_icon;
}
public void setGame_icon(String game_icon) {
this.game_icon = game_icon;
}
public String getLow_vip() {
return low_vip;
}
public void setLow_vip(String low_vip) {
this.low_vip = low_vip;
}
public int getIs_close() {
return is_close;
}
public void setIs_close(int is_close) {
this.is_close = is_close;
}
public int getIs_open() {
return is_open;
}
public void setIs_open(int is_open) {
this.is_open = is_open;
}
}
public static class CouponBean extends BaseEntry {
private String name;
private String use_type;
private String use_amt;
private String min_amt;
private int use_rate;
private String vip_level;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUse_type() {
return use_type;
}
public void setUse_type(String use_type) {
this.use_type = use_type;
}
public String getUse_amt() {
return use_amt;
}
public void setUse_amt(String use_amt) {
this.use_amt = use_amt;
}
public String getMin_amt() {
return min_amt;
}
public void setMin_amt(String min_amt) {
this.min_amt = min_amt;
}
public int getUse_rate() {
return use_rate;
}
public void setUse_rate(int use_rate) {
this.use_rate = use_rate;
}
public String getVip_level() {
return vip_level;
}
public void setVip_level(String vip_level) {
this.vip_level = vip_level;
}
}
}
}
| [
"[email protected]"
] | |
4c487399eabe14e3a2d7d49efa6d4fa86cf74246 | 538ffc98d5ccd4b541ebf84f14bf73817d9285ed | /app/src/main/java/com/example/garpixloadsystem/MainActivity.java | fb2ae790d9746ac69ed445e3c7a3b5d3b6076a41 | [
"Apache-2.0"
] | permissive | Garpix/GLS-AR-HUAWEI | c7a106f4d9c8b73a053f07edea34b2ebbb3ef9e2 | bd708fd8489b0d8a3e2f5edb1efe8af85e6855cd | refs/heads/master | 2023-01-04T09:04:06.443993 | 2020-10-30T14:02:45 | 2020-10-30T14:02:45 | 308,582,328 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,274 | java | package com.example.garpixloadsystem;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class MainActivity extends BaseActivity {
private ListView listView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setScreenParams();
setContentView(R.layout.activity_main);
startAnimation();
listView = findViewById(R.id.list_view_main);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
R.layout.item_list, getResources().getStringArray(R.array.titles));
listView.setAdapter(adapter);
findViewById(R.id.continue_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, DemoActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
});
}
public void onBackPressed(){
Intent intent = new Intent(MainActivity.this, LaunchActivity.class);
startActivity(intent);
}
} | [
"[email protected]"
] | |
6e2519dacfbe1610e12e20a0aafd329be2ee54e0 | bb6455c7071a0e590f194568cd6b5c4bb15c9b08 | /weiit-saas-api/src/main/java/com/weiit/web/api/service/GrouponService.java | f785ea7839ce68637bdc62b3f3bd3c84ba0e4114 | [
"Apache-2.0"
] | permissive | beanrootbaob/weiit-saas | b00d2f3adab3c6587d856c06016ba930b2386798 | 2d8816320635e645e045a1e7e67bc6917069dec8 | refs/heads/main | 2023-05-29T20:19:28.847176 | 2021-06-17T07:45:10 | 2021-06-17T07:45:10 | 381,589,885 | 1 | 0 | Apache-2.0 | 2021-06-30T05:50:49 | 2021-06-30T05:50:49 | null | UTF-8 | Java | false | false | 3,208 | java | package com.weiit.web.api.service;
import com.weiit.core.entity.E;
import com.weiit.core.entity.FormMap;
import com.weiit.core.service.BaseService;
import java.util.List;
/**
* 拼团 接口类
* Title: DiscountService.java
* Description:
* Company: 微云时代
* @author lhq
* @date 2018年5月15日
*/
public interface GrouponService extends BaseService {
/**
* 查询活动页面的拼团商品信息
* @param formMap
* @return 返回活动页面的拼团商品信息
* */
List<E> grouponListByIds(FormMap formMap);
/**
* 查询某个拼团活动正在拼团的的信息
* @param formMap
* @return 拼团活动正在拼团的的信息
* */
List<E> inProcessGroupon(FormMap formMap);
/**
* 查询某个拼团活动某个团的用户的信息
* @param formMap
* @return 拼团活动某个团的用户的信息
* */
List<E> getJoinGrouponInfo(FormMap formMap);
/**
* 查询用户的拼团活动
* @param formMap
* @return 用户的拼团活动
* */
List<E> getMyGroupon(FormMap formMap);
/**
* 查询店铺下所有拼团商品
* @param formMap
* @return 店铺下所有拼团商品
* */
List<E> getShopAllGroupon(FormMap formMap);
/**
* 拼团的扩展信息
* @param formMap
* @return 拼团的扩展信息
* */
E inProcessGrouponExt(FormMap formMap);
/**
* 插入拼团订单信息 可用于发起支付的对象 及以后统计该活动带来的销量增益 weiit_ump_groupon_detail
* @param formMap
* @return 返回活动页面的拼团orderID
* */
int insertGrouponOrder(FormMap formMap);
/**
* 更新拼团订单信息
* @param formMap
*
* */
void updateGrouponOrderByOrderNum(FormMap formMap);
/**
* 根据Id 获取拼团订单信息
* @param formMap
* @return 拼团订单信息
* */
E getGrouponOrderById(FormMap formMap);
/**
* 更新该拼团订单下的所有进行中的用户订单状态为拼团成功 id ,parent_id为detail_id(前端约定传值) 的
* @param formMap
* */
void updateAllGrouponOrderById(FormMap formMap);
/**
* 根据product_Id spec_custom 获取拼团价
* @param formMap
* @return 获取拼团价
* */
E productSpecCheck(FormMap formMap);
/**
* orderNo 获取商户key
* @param
* @return 获取商户key
* */
E getMchKeyByGrouponOrderNo(String orderNo);
/**
* orderNo 获取商户key
* @param
* @return 获取商户key
* */
E getProductInfoByGOrderId(FormMap orderNo);
/**
* orderNo 是否已参与拼团
* @param
* @return 获取商户key
* */
int isJoinGrouponByOrderId(FormMap orderNo);
/**
* 已拼团人数
*@param formMap
* @return
* */
int hasGrouponCount(FormMap formMap);
/**
* 返回用户的参团信息
*@param formMap
* @return
* */
E getUserGrouponInfoByGOrderId(FormMap formMap);
/**
* 返回开团通知所需信息
* @param formMap
* @return
* */
E selectStartGrouponMsgInfo(FormMap formMap);
/**
* 根据参团单号查询团长信息
* @param formMap
* */
E selectMrsWuByJoinOrderNum(FormMap formMap);
/**
* 查询用户所属的
*
* */
E selectAuthorizerAppIdByUserId(FormMap formMap);
}
| [
"[email protected]"
] | |
eff2263238e1c4dbdcd190eb0d7a5f5f8f870115 | 07bf31965d074d8413812272fe12103b01c6a490 | /src/main/java/org/egov/chat/pre/authorization/CreateNewUserService.java | 194c35dc82b7c2e209d9313b43ea8756e23fc4a1 | [] | no_license | PrashantAswal/chatbot | 923085376a6141664ba8553f5c05b363f20e7989 | 0ef8c69c4e7e89d302734a149e82d39980740b23 | refs/heads/master | 2020-06-12T07:26:17.099131 | 2019-06-27T09:32:56 | 2019-06-27T09:32:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,732 | java | package org.egov.chat.pre.authorization;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.extern.slf4j.Slf4j;
import org.egov.chat.config.ApplicationProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@Slf4j
@Service
public class CreateNewUserService {
@Autowired
private ApplicationProperties applicationProperties;
@Autowired
private RestTemplate restTemplate;
@Autowired
private ObjectMapper objectMapper;
public JsonNode createNewUser(String mobileNumber, String tenantId) throws Exception {
ObjectNode userCreateRequest = objectMapper.createObjectNode();
userCreateRequest.set("RequestInfo", objectMapper.createObjectNode());
ObjectNode user = objectMapper.createObjectNode();
user.put("otpReference", applicationProperties.getHardcodedPassword());
user.put("permanentCity", tenantId);
user.put("tenantId", tenantId);
user.put("username", mobileNumber);
userCreateRequest.set("User", user);
ResponseEntity<JsonNode> createResponse =
restTemplate.postForEntity(applicationProperties.getUserServiceHost() + applicationProperties.getCitizenCreatePath(),
userCreateRequest, JsonNode.class);
if(createResponse.getStatusCode().is2xxSuccessful()) {
return createResponse.getBody();
} else {
throw new Exception("User Create Error");
}
}
}
| [
"[email protected]"
] | |
3c1d9c7d24282f989716b222a6c4132ab4b87361 | 38863a0c8154690b8e6f546a1d673e37a57f447d | /quan.java/message/src/main/java/quan/message/NettyMessageCodec.java | 44c68d7d83814e9a149eab81ed817bc15533dfc7 | [] | no_license | ly774508966/quan | 35f05ed0fbacf2cfb2f8e4b7456c12e11b8498b1 | 925f41badc85b04f5313133cf3c0a8f4c058ebb9 | refs/heads/master | 2023-03-01T14:53:45.417033 | 2021-02-05T10:12:53 | 2021-02-05T10:12:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,349 | java | package quan.message;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageCodec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Objects;
/**
* 集成Netty的消息编解码器
* Created by quanchangnai on 2019/7/11.
*/
public class NettyMessageCodec extends ByteToMessageCodec<Message> {
protected final Logger logger = LoggerFactory.getLogger(getClass());
private MessageRegistry messageRegistry;
public NettyMessageCodec(MessageRegistry messageRegistry) {
super(Message.class);
this.messageRegistry = Objects.requireNonNull(messageRegistry, "消息注册表不能为空");
}
@Override
protected void encode(ChannelHandlerContext ctx, Message msg, ByteBuf byteBuf) {
msg.encode(new NettyBuffer(byteBuf));
}
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf byteBuf, List<Object> out) {
Buffer buffer = new NettyBuffer(byteBuf);
int msgId = buffer.readInt();
buffer.reset();
Message message = messageRegistry.create(msgId);
if (message == null) {
logger.error("消息{}创建失败", msgId);
return;
}
message.decode(buffer);
out.add(message);
}
}
| [
"[email protected]"
] | |
940fe3e7c12163171e8618540f0561c464f448fd | f7eab021b81233e37579f804c0bb088f97b84444 | /Patterns examples/src/Creational/Builder/VisitCardWebSiteBuilder.java | 21ddfe393e1ad85b662413b197995244420f9a41 | [] | no_license | IvanHub2021/Start | f293241cf8feff3d0f3d0ecd23043ded7a9e23a3 | 2ea9ada5725c7fdbf8238fd62383016f222d4eac | refs/heads/main | 2023-02-13T01:06:28.627995 | 2021-01-17T17:31:19 | 2021-01-17T17:31:19 | 328,363,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package Creational.Builder;
public class VisitCardWebSiteBuilder extends WebSiteBuilder{
@Override
void buildName() {
webSite.setName("Visit card");
}
@Override
void buildCms() {
webSite.setCms(Cms.WORDPRESS);
}
@Override
void buildPrice() {
webSite.setPrice(500);
}
}
| [
"[email protected]"
] | |
b656c7dd07931b3b590c037fff8b706005f32074 | d309691c466c34e203abb06df950844dfb955efb | /SampleRest/src/main/java/com/aemforms/LoanInformation.java | 6b20cf3ecbad9b31d3fadff6b5817e80186c1add | [] | no_license | deepaktrivedi013/AllAboutAEMforms | 1d01a5cd2c33a6177a7a74d951054dd7e91ee4c0 | 52d3c98acec14b82702c3b734fb0404e68ff2032 | refs/heads/master | 2021-02-18T03:51:39.863705 | 2019-05-23T19:05:13 | 2019-05-23T19:05:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 369 | java | package com.aemforms;
public class LoanInformation {
String description;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
String value;
}
| [
"[email protected]"
] | |
cfb3516fbd7126b1819fb6094b088864f51f4902 | e700768171ee16b310c283faef37f9248cb0211f | /modelBasedTesting/modelBasedTesting-core/src/main/java/com/telnet/modelbasedtesting/service/OutportVariableServiceImpl.java | 72b28d219765962e274fe84c61a0b6bb31deee2e | [] | no_license | molkakehia/modelbasedtesting | 4c10aa4cca83ee5a6dfcf0ab252570096dc757d0 | 32142b7b4808a26bfcdea7bccfa91546fd24262a | refs/heads/master | 2021-01-20T07:52:12.845926 | 2017-05-02T17:17:31 | 2017-05-02T17:17:31 | 90,057,745 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,113 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.telnet.modelbasedtesting.service;
import com.telnet.modelbasedtesting.dao.OutportVariableDao;
import com.telnet.modelbasedtesting.dao.PersistenceProvider;
import com.telnet.modelbasedtesting.entities.Inportvariable;
import com.telnet.modelbasedtesting.entities.Outportvariable;
import java.util.List;
/**
*
* @author Hanen LAFFET
*/
public class OutportVariableServiceImpl implements OutportVariableService{
public static final String PERSISTENCE_UNIT_NAME = "oacaPU";
//final static Logger LOGGER = Logger.getLogger(UserServiceImpl.class);
private OutportVariableDao outportVaribleDao = new PersistenceProvider(PERSISTENCE_UNIT_NAME).getOutportVariableDao();
public void createVariable(Outportvariable model) {
outportVaribleDao.add(model);
}
public List<Outportvariable> findAll() {
List<Outportvariable> varList = outportVaribleDao.findAll();
//LOGGER.debug("Get Users list :" + userList.toString());
return varList;
}
public Outportvariable findByid(Integer id) {
Outportvariable var = null;
//UserDao userDao = new PersistenceProvider(PERSISTENCE_UNIT_NAME).getUserDao();
var = outportVaribleDao.findById(id);
//LOGGER.debug("Find User : Search user with id :" + id + " " + user.toString());
return var;
}
public void updateVariable(Outportvariable var) {
outportVaribleDao.update(var);
}
public void deleteVariable(Outportvariable var) {
outportVaribleDao.remove(var);
}
public List<Outportvariable> findAllByIdSimulink(int id){
List<Outportvariable> varList = outportVaribleDao.findAllByIdSimulink(id);
//LOGGER.debug("Get Users list :" + userList.toString());
// List<Inportvariable> varList=null;
return varList;
}
}
| [
"[email protected]"
] | |
31158ea12daf28e45222e437810ba0abff190f6d | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/gamelife/PluginGameLife$$ExternalSyntheticLambda1.java | c622e8b3d7064da3ce128b44e605091b2c6da869 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 564 | java | package com.tencent.mm.plugin.gamelife;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
public final class PluginGameLife$$ExternalSyntheticLambda1
implements CompoundButton.OnCheckedChangeListener
{
public final void onCheckedChanged(CompoundButton arg1, boolean arg2) {}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes5.jar
* Qualified Name: com.tencent.mm.plugin.gamelife.PluginGameLife..ExternalSyntheticLambda1
* JD-Core Version: 0.7.0.1
*/ | [
"[email protected]"
] | |
2df6f0da9abaf8385ade8bd2ffd7236d598a3011 | 8025ab0b889de3d822286a93ea9d3757dc54f60c | /app/src/main/java/com/syjjkj/kxwq/account/UserMoneyActivity.java | 64f7a35d23f3e250c1151f7f136119b3b26501d7 | [] | no_license | smg0919/demo | 553be8f8fda5fee24bac9c4d61ec099e156fbf55 | 4374df5e948cc09343f3fe493e8f21b802fa8161 | refs/heads/master | 2020-03-21T12:23:24.494168 | 2018-07-02T05:09:25 | 2018-07-02T05:09:25 | 138,550,291 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,177 | java | package com.syjjkj.kxwq.account;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.http.RequestParams;
import com.syjjkj.kxwq.R;
import com.syjjkj.kxwq.homepage.BaseActivity;
import com.syjjkj.kxwq.homepage.UserInfoBean;
import com.syjjkj.kxwq.http.AnsynHttpRequest;
import com.syjjkj.kxwq.http.HttpStaticApi;
import com.syjjkj.kxwq.http.ParserJsonBean;
import com.syjjkj.kxwq.http.UrlConfig;
import com.syjjkj.kxwq.util.StringUtil;
import com.syjjkj.kxwq.util.ToastUtil;
import org.json.JSONException;
/**
* Created by Administrator on 2017/11/15.
*/
public class UserMoneyActivity extends BaseActivity implements View.OnClickListener {
private TextView TPhone;
private RelativeLayout Rmoneyrule;
private RelativeLayout Rtransactionhistory;
private RelativeLayout Rpaymanager;
private Button Bmoney_chongzhi;
private Button Bmoney_tixian;
private TextView TAccount;
private String strPhone="";
private String strAccount="";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_money);
initView();
initData();
initListener();
}
@Override //这里是实现了自动更新
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
initView();
initData();
initListener();
}
private void initView(){
TPhone=(TextView)findViewById(R.id.item_phone);
TAccount=(TextView)findViewById(R.id.item_account);
Rmoneyrule=(RelativeLayout)findViewById(R.id.money_rule);
Rtransactionhistory=(RelativeLayout)findViewById(R.id.transaction_history);
Rpaymanager=(RelativeLayout)findViewById(R.id.pay_Manager);
Bmoney_chongzhi=(Button)findViewById(R.id.money_chongzhi);
Bmoney_tixian=(Button)findViewById(R.id.money_tixian);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
private void initListener() {
Rmoneyrule.setOnClickListener(this);
Rtransactionhistory.setOnClickListener(this);
Rpaymanager.setOnClickListener(this);
Bmoney_chongzhi.setOnClickListener(this);
Bmoney_tixian.setOnClickListener(this);
}
private void initData(){
getUserMoney();
}
private void getUserMoney() {
if (!StringUtil.isNetworkConnected(this)) {
ToastUtil.makeShortText(this, "请检查网络");
return;
}
UserInfoBean.getUserInfo(this);
RequestParams params = new RequestParams();
params.addBodyParameter("uid", UserInfoBean.uid);
params.addBodyParameter("token", UserInfoBean.token);
httpUtils = new HttpUtils();
// showWaitDialog("正在努力加载...");
AnsynHttpRequest.requestGetOrPost(AnsynHttpRequest.POST, UrlConfig.MY_INFO, params,
this, httpUtils, HttpStaticApi.getmyinfo);
}
@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.money_rule:
Intent intent1=new Intent(this,UserServiceRuleActivity.class);
startActivity(intent1);
break;
case R.id.transaction_history:
Intent intent2=new Intent(this,UserQBRecordActivity.class);
intent2.putExtra("phone",strPhone);
startActivity(intent2);
break;
case R.id.pay_Manager:
Intent intent3=new Intent(this,UserPaymanagerActivity.class);
intent3.putExtra("phone",strPhone);
startActivity(intent3);
break;
case R.id.money_tixian:
Intent intent4=new Intent(this,UserTixianActivity.class);
startActivity(intent4);
break;
case R.id.money_chongzhi:
Intent intent5=new Intent(this,UserChongzhiActivity.class);
startActivity(intent5);
break;
}
}
private static boolean checkInstallation(Context context, String packageName) {
try {
context.getPackageManager().getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
return true;
} catch (PackageManager.NameNotFoundException e) {
return false;
}
}
@Override
public void onSuccessHttp(String responseInfo, int resultCode) {
super.onSuccessHttp(responseInfo, resultCode);
dismissDialog();
switch (resultCode) {
case HttpStaticApi.getmyinfo:
try {
Bundle bundle = ParserJsonBean.parserMyInfo(responseInfo);
if (bundle != null) {
int state = bundle.getInt(ParserJsonBean.STATE);
if (state == 1) {
strPhone=bundle.getString(ParserJsonBean.PHONE,"");
strAccount=bundle.getString(ParserJsonBean.ACCOUNT,"");
TPhone.setText(strPhone);
TAccount.setText("¥"+strAccount);
} else {
ToastUtil.makeLongText(this,
bundle.getString(ParserJsonBean.MESSAGE));
}
}
} catch (JSONException e) {
e.printStackTrace();
}
dismissDialog();
break;
}
}
}
| [
"[email protected]"
] | |
314f533ae3ad38ce5e81069fb9a5105f55180855 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/hazelcast/2015/8/MapReplicationSupportingService.java | b6c4b0501b417be7b1216ec2d5dd814ed19fe840 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 3,560 | java | /*
* Copyright (c) 2008-2015, Hazelcast, 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.hazelcast.map.impl;
import com.hazelcast.core.EntryView;
import com.hazelcast.map.merge.MapMergePolicy;
import com.hazelcast.map.impl.operation.MergeOperation;
import com.hazelcast.map.impl.operation.WanOriginatedDeleteOperation;
import com.hazelcast.map.impl.wan.MapReplicationRemove;
import com.hazelcast.map.impl.wan.MapReplicationUpdate;
import com.hazelcast.spi.NodeEngine;
import com.hazelcast.spi.ReplicationSupportingService;
import com.hazelcast.util.ExceptionUtil;
import com.hazelcast.wan.WanReplicationEvent;
import java.util.concurrent.Future;
import static com.hazelcast.map.impl.MapService.SERVICE_NAME;
class MapReplicationSupportingService implements ReplicationSupportingService {
private final MapServiceContext mapServiceContext;
private final NodeEngine nodeEngine;
public MapReplicationSupportingService(MapServiceContext mapServiceContext) {
this.mapServiceContext = mapServiceContext;
this.nodeEngine = mapServiceContext.getNodeEngine();
}
@Override
public void onReplicationEvent(WanReplicationEvent replicationEvent) {
Object eventObject = replicationEvent.getEventObject();
if (eventObject instanceof MapReplicationUpdate) {
handleUpdate((MapReplicationUpdate) eventObject);
} else if (eventObject instanceof MapReplicationRemove) {
handleRemove((MapReplicationRemove) eventObject);
}
}
private void handleRemove(MapReplicationRemove replicationRemove) {
WanOriginatedDeleteOperation operation = new WanOriginatedDeleteOperation(replicationRemove.getMapName(),
replicationRemove.getKey());
try {
int partitionId = nodeEngine.getPartitionService().getPartitionId(replicationRemove.getKey());
Future f = nodeEngine.getOperationService()
.invokeOnPartition(SERVICE_NAME, operation, partitionId);
f.get();
} catch (Throwable t) {
throw ExceptionUtil.rethrow(t);
}
}
private void handleUpdate(MapReplicationUpdate replicationUpdate) {
EntryView entryView = replicationUpdate.getEntryView();
MapMergePolicy mergePolicy = replicationUpdate.getMergePolicy();
String mapName = replicationUpdate.getMapName();
MapContainer mapContainer = mapServiceContext.getMapContainer(mapName);
MergeOperation operation = new MergeOperation(mapName, mapServiceContext.toData(entryView.getKey(),
mapContainer.getPartitioningStrategy()), entryView, mergePolicy);
try {
int partitionId = nodeEngine.getPartitionService().getPartitionId(entryView.getKey());
Future f = nodeEngine.getOperationService()
.invokeOnPartition(SERVICE_NAME, operation, partitionId);
f.get();
} catch (Throwable t) {
throw ExceptionUtil.rethrow(t);
}
}
}
| [
"[email protected]"
] | |
2b35e484667e19ca818fdf3b60b69cf313a3a343 | 2b5aaaf43b5a5b3602e20c948c0f2d58583860ed | /mstar-server-dao/src/main/java/com/wincom/mstar/domain/AHistoryDataMinuteExample.java | 648d3bf1f0d79f04876a79d15b695fc564dfedbe | [
"Apache-2.0"
] | permissive | xtwxy/cassandra-tests | 2bb2350bf325eba9353d6d632ffe3e4076e213e4 | 346023aad17d37f1d140879b6808092e04d0e1eb | refs/heads/master | 2021-01-19T11:34:27.120908 | 2017-04-17T21:31:12 | 2017-04-17T21:31:12 | 82,253,594 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 31,946 | java | package com.wincom.mstar.domain;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class AHistoryDataMinuteExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public AHistoryDataMinuteExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andDatidIsNull() {
addCriterion("DatId is null");
return (Criteria) this;
}
public Criteria andDatidIsNotNull() {
addCriterion("DatId is not null");
return (Criteria) this;
}
public Criteria andDatidEqualTo(Integer value) {
addCriterion("DatId =", value, "datid");
return (Criteria) this;
}
public Criteria andDatidNotEqualTo(Integer value) {
addCriterion("DatId <>", value, "datid");
return (Criteria) this;
}
public Criteria andDatidGreaterThan(Integer value) {
addCriterion("DatId >", value, "datid");
return (Criteria) this;
}
public Criteria andDatidGreaterThanOrEqualTo(Integer value) {
addCriterion("DatId >=", value, "datid");
return (Criteria) this;
}
public Criteria andDatidLessThan(Integer value) {
addCriterion("DatId <", value, "datid");
return (Criteria) this;
}
public Criteria andDatidLessThanOrEqualTo(Integer value) {
addCriterion("DatId <=", value, "datid");
return (Criteria) this;
}
public Criteria andDatidIn(List<Integer> values) {
addCriterion("DatId in", values, "datid");
return (Criteria) this;
}
public Criteria andDatidNotIn(List<Integer> values) {
addCriterion("DatId not in", values, "datid");
return (Criteria) this;
}
public Criteria andDatidBetween(Integer value1, Integer value2) {
addCriterion("DatId between", value1, value2, "datid");
return (Criteria) this;
}
public Criteria andDatidNotBetween(Integer value1, Integer value2) {
addCriterion("DatId not between", value1, value2, "datid");
return (Criteria) this;
}
public Criteria andMachroomidIsNull() {
addCriterion("MachRoomId is null");
return (Criteria) this;
}
public Criteria andMachroomidIsNotNull() {
addCriterion("MachRoomId is not null");
return (Criteria) this;
}
public Criteria andMachroomidEqualTo(Integer value) {
addCriterion("MachRoomId =", value, "machroomid");
return (Criteria) this;
}
public Criteria andMachroomidNotEqualTo(Integer value) {
addCriterion("MachRoomId <>", value, "machroomid");
return (Criteria) this;
}
public Criteria andMachroomidGreaterThan(Integer value) {
addCriterion("MachRoomId >", value, "machroomid");
return (Criteria) this;
}
public Criteria andMachroomidGreaterThanOrEqualTo(Integer value) {
addCriterion("MachRoomId >=", value, "machroomid");
return (Criteria) this;
}
public Criteria andMachroomidLessThan(Integer value) {
addCriterion("MachRoomId <", value, "machroomid");
return (Criteria) this;
}
public Criteria andMachroomidLessThanOrEqualTo(Integer value) {
addCriterion("MachRoomId <=", value, "machroomid");
return (Criteria) this;
}
public Criteria andMachroomidIn(List<Integer> values) {
addCriterion("MachRoomId in", values, "machroomid");
return (Criteria) this;
}
public Criteria andMachroomidNotIn(List<Integer> values) {
addCriterion("MachRoomId not in", values, "machroomid");
return (Criteria) this;
}
public Criteria andMachroomidBetween(Integer value1, Integer value2) {
addCriterion("MachRoomId between", value1, value2, "machroomid");
return (Criteria) this;
}
public Criteria andMachroomidNotBetween(Integer value1, Integer value2) {
addCriterion("MachRoomId not between", value1, value2, "machroomid");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("Type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("Type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("Type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("Type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("Type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("Type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("Type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("Type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("Type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("Type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("Type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("Type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andEnergytypeIsNull() {
addCriterion("EnergyType is null");
return (Criteria) this;
}
public Criteria andEnergytypeIsNotNull() {
addCriterion("EnergyType is not null");
return (Criteria) this;
}
public Criteria andEnergytypeEqualTo(Integer value) {
addCriterion("EnergyType =", value, "energytype");
return (Criteria) this;
}
public Criteria andEnergytypeNotEqualTo(Integer value) {
addCriterion("EnergyType <>", value, "energytype");
return (Criteria) this;
}
public Criteria andEnergytypeGreaterThan(Integer value) {
addCriterion("EnergyType >", value, "energytype");
return (Criteria) this;
}
public Criteria andEnergytypeGreaterThanOrEqualTo(Integer value) {
addCriterion("EnergyType >=", value, "energytype");
return (Criteria) this;
}
public Criteria andEnergytypeLessThan(Integer value) {
addCriterion("EnergyType <", value, "energytype");
return (Criteria) this;
}
public Criteria andEnergytypeLessThanOrEqualTo(Integer value) {
addCriterion("EnergyType <=", value, "energytype");
return (Criteria) this;
}
public Criteria andEnergytypeIn(List<Integer> values) {
addCriterion("EnergyType in", values, "energytype");
return (Criteria) this;
}
public Criteria andEnergytypeNotIn(List<Integer> values) {
addCriterion("EnergyType not in", values, "energytype");
return (Criteria) this;
}
public Criteria andEnergytypeBetween(Integer value1, Integer value2) {
addCriterion("EnergyType between", value1, value2, "energytype");
return (Criteria) this;
}
public Criteria andEnergytypeNotBetween(Integer value1, Integer value2) {
addCriterion("EnergyType not between", value1, value2, "energytype");
return (Criteria) this;
}
public Criteria andCurrentvalueIsNull() {
addCriterion("CurrentValue is null");
return (Criteria) this;
}
public Criteria andCurrentvalueIsNotNull() {
addCriterion("CurrentValue is not null");
return (Criteria) this;
}
public Criteria andCurrentvalueEqualTo(Double value) {
addCriterion("CurrentValue =", value, "currentvalue");
return (Criteria) this;
}
public Criteria andCurrentvalueNotEqualTo(Double value) {
addCriterion("CurrentValue <>", value, "currentvalue");
return (Criteria) this;
}
public Criteria andCurrentvalueGreaterThan(Double value) {
addCriterion("CurrentValue >", value, "currentvalue");
return (Criteria) this;
}
public Criteria andCurrentvalueGreaterThanOrEqualTo(Double value) {
addCriterion("CurrentValue >=", value, "currentvalue");
return (Criteria) this;
}
public Criteria andCurrentvalueLessThan(Double value) {
addCriterion("CurrentValue <", value, "currentvalue");
return (Criteria) this;
}
public Criteria andCurrentvalueLessThanOrEqualTo(Double value) {
addCriterion("CurrentValue <=", value, "currentvalue");
return (Criteria) this;
}
public Criteria andCurrentvalueIn(List<Double> values) {
addCriterion("CurrentValue in", values, "currentvalue");
return (Criteria) this;
}
public Criteria andCurrentvalueNotIn(List<Double> values) {
addCriterion("CurrentValue not in", values, "currentvalue");
return (Criteria) this;
}
public Criteria andCurrentvalueBetween(Double value1, Double value2) {
addCriterion("CurrentValue between", value1, value2, "currentvalue");
return (Criteria) this;
}
public Criteria andCurrentvalueNotBetween(Double value1, Double value2) {
addCriterion("CurrentValue not between", value1, value2, "currentvalue");
return (Criteria) this;
}
public Criteria andRecordtimeIsNull() {
addCriterion("RecordTime is null");
return (Criteria) this;
}
public Criteria andRecordtimeIsNotNull() {
addCriterion("RecordTime is not null");
return (Criteria) this;
}
public Criteria andRecordtimeEqualTo(Date value) {
addCriterion("RecordTime =", value, "recordtime");
return (Criteria) this;
}
public Criteria andRecordtimeNotEqualTo(Date value) {
addCriterion("RecordTime <>", value, "recordtime");
return (Criteria) this;
}
public Criteria andRecordtimeGreaterThan(Date value) {
addCriterion("RecordTime >", value, "recordtime");
return (Criteria) this;
}
public Criteria andRecordtimeGreaterThanOrEqualTo(Date value) {
addCriterion("RecordTime >=", value, "recordtime");
return (Criteria) this;
}
public Criteria andRecordtimeLessThan(Date value) {
addCriterion("RecordTime <", value, "recordtime");
return (Criteria) this;
}
public Criteria andRecordtimeLessThanOrEqualTo(Date value) {
addCriterion("RecordTime <=", value, "recordtime");
return (Criteria) this;
}
public Criteria andRecordtimeIn(List<Date> values) {
addCriterion("RecordTime in", values, "recordtime");
return (Criteria) this;
}
public Criteria andRecordtimeNotIn(List<Date> values) {
addCriterion("RecordTime not in", values, "recordtime");
return (Criteria) this;
}
public Criteria andRecordtimeBetween(Date value1, Date value2) {
addCriterion("RecordTime between", value1, value2, "recordtime");
return (Criteria) this;
}
public Criteria andRecordtimeNotBetween(Date value1, Date value2) {
addCriterion("RecordTime not between", value1, value2, "recordtime");
return (Criteria) this;
}
public Criteria andMaxvalueIsNull() {
addCriterion("MaxValue is null");
return (Criteria) this;
}
public Criteria andMaxvalueIsNotNull() {
addCriterion("MaxValue is not null");
return (Criteria) this;
}
public Criteria andMaxvalueEqualTo(Double value) {
addCriterion("MaxValue =", value, "maxvalue");
return (Criteria) this;
}
public Criteria andMaxvalueNotEqualTo(Double value) {
addCriterion("MaxValue <>", value, "maxvalue");
return (Criteria) this;
}
public Criteria andMaxvalueGreaterThan(Double value) {
addCriterion("MaxValue >", value, "maxvalue");
return (Criteria) this;
}
public Criteria andMaxvalueGreaterThanOrEqualTo(Double value) {
addCriterion("MaxValue >=", value, "maxvalue");
return (Criteria) this;
}
public Criteria andMaxvalueLessThan(Double value) {
addCriterion("MaxValue <", value, "maxvalue");
return (Criteria) this;
}
public Criteria andMaxvalueLessThanOrEqualTo(Double value) {
addCriterion("MaxValue <=", value, "maxvalue");
return (Criteria) this;
}
public Criteria andMaxvalueIn(List<Double> values) {
addCriterion("MaxValue in", values, "maxvalue");
return (Criteria) this;
}
public Criteria andMaxvalueNotIn(List<Double> values) {
addCriterion("MaxValue not in", values, "maxvalue");
return (Criteria) this;
}
public Criteria andMaxvalueBetween(Double value1, Double value2) {
addCriterion("MaxValue between", value1, value2, "maxvalue");
return (Criteria) this;
}
public Criteria andMaxvalueNotBetween(Double value1, Double value2) {
addCriterion("MaxValue not between", value1, value2, "maxvalue");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeIsNull() {
addCriterion("MaxOccuredTime is null");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeIsNotNull() {
addCriterion("MaxOccuredTime is not null");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeEqualTo(Date value) {
addCriterion("MaxOccuredTime =", value, "maxoccuredtime");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeNotEqualTo(Date value) {
addCriterion("MaxOccuredTime <>", value, "maxoccuredtime");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeGreaterThan(Date value) {
addCriterion("MaxOccuredTime >", value, "maxoccuredtime");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeGreaterThanOrEqualTo(Date value) {
addCriterion("MaxOccuredTime >=", value, "maxoccuredtime");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeLessThan(Date value) {
addCriterion("MaxOccuredTime <", value, "maxoccuredtime");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeLessThanOrEqualTo(Date value) {
addCriterion("MaxOccuredTime <=", value, "maxoccuredtime");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeIn(List<Date> values) {
addCriterion("MaxOccuredTime in", values, "maxoccuredtime");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeNotIn(List<Date> values) {
addCriterion("MaxOccuredTime not in", values, "maxoccuredtime");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeBetween(Date value1, Date value2) {
addCriterion("MaxOccuredTime between", value1, value2, "maxoccuredtime");
return (Criteria) this;
}
public Criteria andMaxoccuredtimeNotBetween(Date value1, Date value2) {
addCriterion("MaxOccuredTime not between", value1, value2, "maxoccuredtime");
return (Criteria) this;
}
public Criteria andMinvalueIsNull() {
addCriterion("MinValue is null");
return (Criteria) this;
}
public Criteria andMinvalueIsNotNull() {
addCriterion("MinValue is not null");
return (Criteria) this;
}
public Criteria andMinvalueEqualTo(Double value) {
addCriterion("MinValue =", value, "minvalue");
return (Criteria) this;
}
public Criteria andMinvalueNotEqualTo(Double value) {
addCriterion("MinValue <>", value, "minvalue");
return (Criteria) this;
}
public Criteria andMinvalueGreaterThan(Double value) {
addCriterion("MinValue >", value, "minvalue");
return (Criteria) this;
}
public Criteria andMinvalueGreaterThanOrEqualTo(Double value) {
addCriterion("MinValue >=", value, "minvalue");
return (Criteria) this;
}
public Criteria andMinvalueLessThan(Double value) {
addCriterion("MinValue <", value, "minvalue");
return (Criteria) this;
}
public Criteria andMinvalueLessThanOrEqualTo(Double value) {
addCriterion("MinValue <=", value, "minvalue");
return (Criteria) this;
}
public Criteria andMinvalueIn(List<Double> values) {
addCriterion("MinValue in", values, "minvalue");
return (Criteria) this;
}
public Criteria andMinvalueNotIn(List<Double> values) {
addCriterion("MinValue not in", values, "minvalue");
return (Criteria) this;
}
public Criteria andMinvalueBetween(Double value1, Double value2) {
addCriterion("MinValue between", value1, value2, "minvalue");
return (Criteria) this;
}
public Criteria andMinvalueNotBetween(Double value1, Double value2) {
addCriterion("MinValue not between", value1, value2, "minvalue");
return (Criteria) this;
}
public Criteria andMinoccuredtimeIsNull() {
addCriterion("MinOccuredTime is null");
return (Criteria) this;
}
public Criteria andMinoccuredtimeIsNotNull() {
addCriterion("MinOccuredTime is not null");
return (Criteria) this;
}
public Criteria andMinoccuredtimeEqualTo(Date value) {
addCriterion("MinOccuredTime =", value, "minoccuredtime");
return (Criteria) this;
}
public Criteria andMinoccuredtimeNotEqualTo(Date value) {
addCriterion("MinOccuredTime <>", value, "minoccuredtime");
return (Criteria) this;
}
public Criteria andMinoccuredtimeGreaterThan(Date value) {
addCriterion("MinOccuredTime >", value, "minoccuredtime");
return (Criteria) this;
}
public Criteria andMinoccuredtimeGreaterThanOrEqualTo(Date value) {
addCriterion("MinOccuredTime >=", value, "minoccuredtime");
return (Criteria) this;
}
public Criteria andMinoccuredtimeLessThan(Date value) {
addCriterion("MinOccuredTime <", value, "minoccuredtime");
return (Criteria) this;
}
public Criteria andMinoccuredtimeLessThanOrEqualTo(Date value) {
addCriterion("MinOccuredTime <=", value, "minoccuredtime");
return (Criteria) this;
}
public Criteria andMinoccuredtimeIn(List<Date> values) {
addCriterion("MinOccuredTime in", values, "minoccuredtime");
return (Criteria) this;
}
public Criteria andMinoccuredtimeNotIn(List<Date> values) {
addCriterion("MinOccuredTime not in", values, "minoccuredtime");
return (Criteria) this;
}
public Criteria andMinoccuredtimeBetween(Date value1, Date value2) {
addCriterion("MinOccuredTime between", value1, value2, "minoccuredtime");
return (Criteria) this;
}
public Criteria andMinoccuredtimeNotBetween(Date value1, Date value2) {
addCriterion("MinOccuredTime not between", value1, value2, "minoccuredtime");
return (Criteria) this;
}
public Criteria andAveragevalueIsNull() {
addCriterion("AverageValue is null");
return (Criteria) this;
}
public Criteria andAveragevalueIsNotNull() {
addCriterion("AverageValue is not null");
return (Criteria) this;
}
public Criteria andAveragevalueEqualTo(Double value) {
addCriterion("AverageValue =", value, "averagevalue");
return (Criteria) this;
}
public Criteria andAveragevalueNotEqualTo(Double value) {
addCriterion("AverageValue <>", value, "averagevalue");
return (Criteria) this;
}
public Criteria andAveragevalueGreaterThan(Double value) {
addCriterion("AverageValue >", value, "averagevalue");
return (Criteria) this;
}
public Criteria andAveragevalueGreaterThanOrEqualTo(Double value) {
addCriterion("AverageValue >=", value, "averagevalue");
return (Criteria) this;
}
public Criteria andAveragevalueLessThan(Double value) {
addCriterion("AverageValue <", value, "averagevalue");
return (Criteria) this;
}
public Criteria andAveragevalueLessThanOrEqualTo(Double value) {
addCriterion("AverageValue <=", value, "averagevalue");
return (Criteria) this;
}
public Criteria andAveragevalueIn(List<Double> values) {
addCriterion("AverageValue in", values, "averagevalue");
return (Criteria) this;
}
public Criteria andAveragevalueNotIn(List<Double> values) {
addCriterion("AverageValue not in", values, "averagevalue");
return (Criteria) this;
}
public Criteria andAveragevalueBetween(Double value1, Double value2) {
addCriterion("AverageValue between", value1, value2, "averagevalue");
return (Criteria) this;
}
public Criteria andAveragevalueNotBetween(Double value1, Double value2) {
addCriterion("AverageValue not between", value1, value2, "averagevalue");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated do_not_delete_during_merge Thu Mar 02 11:23:21 CST 2017
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table Energy.dbo.AHistoryDataMinute
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"[email protected]"
] | |
3564a02c71763b7a7576f4615e23b4db0b1031fb | 3d7ebae4101a48885fd1e3b5af03407e2e774f1d | /src/service/assess/Governor/two/histroy2.java | 2ffee83ce44fad0dc1ee07c37b2139b720872cd9 | [] | no_license | yclipd/BLHPumTurEvaDia | 82a61c52084eb4525416bd419986aaae1beefa67 | 56dadf8c29bbc0dd6c38f572a53ac60d46f97536 | refs/heads/master | 2020-04-16T18:35:28.533235 | 2018-12-10T04:04:32 | 2018-12-10T04:04:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 159 | java | package service.assess.Governor.two;
public class histroy2 {
//2号机历史和巡检状态
public double histroy2(long time) {
return 87.0;
}
}
| [
"[email protected]"
] | |
9cdcb3adfa3db155217f937a282cc71976a02e26 | 65ff60dcc4092d383b6f9356f6d850083595962c | /roboticslibrary/src/main/java/com/nirzvi/roboticslibrary/MyDataWriter.java | c441e5a435c17d8d4a2edc18a6ecc303f1ffc0bf | [] | no_license | guystoppi/AndroidImageAnalysisFTC | 9046f2dc9b22de3a3856e104143606808912dac2 | 69ba85ae1def46058cc51fbc31d8eea5b9db720e | refs/heads/master | 2021-05-29T12:44:54.029223 | 2015-07-15T23:16:10 | 2015-07-15T23:16:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,032 | java | package com.nirzvi.roboticslibrary;
import android.content.Context;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.OutputStreamWriter;
/**
* Created by Nirzvi on 2015-05-23.
*/
public class MyDataWriter {
File file;
FileOutputStream stream;
String toWrite = "";
MyDataReader reader;
public MyDataWriter (String fileName, boolean overWrite, Context c) {
reader = new MyDataReader(fileName, c);
file = new File(c.getExternalFilesDir(null).getAbsolutePath() + "/" + fileName + ".txt");
try {
stream = new FileOutputStream(file);
} catch (Exception e) {
}
toWrite = "";
if (!overWrite) {
toWrite = reader.readFile();
}
System.out.println(toWrite + "--------------------");
}
public MyDataWriter (String filePath, String fileName, boolean overWrite, Context c) {
if (!filePath.contains("txt"))
file = new File(c.getExternalFilesDir(null).getAbsolutePath() + "/" + fileName + ".txt");
else
file = new File(filePath);
try {
stream = new FileOutputStream(file);
} catch (Exception e) {
}
if (!overWrite) {
MyDataReader in = new MyDataReader(fileName, c);
if (in.readFile() != null)
toWrite += in.readFile();
}
System.out.println(toWrite + "--------------------");
}
public void write (String data) {
toWrite += data;
try {
stream.write(toWrite.getBytes());
} catch (Exception e) {
}
toWrite = "";
}
public void write (int data) {
toWrite = "" + data;
try {
stream.write(toWrite.getBytes());
} catch (Exception e) {
}
toWrite = "";
}
public void write (double data) {
toWrite = "" + data;
try {
stream.write(toWrite.getBytes());
} catch (Exception e) {
}
toWrite = "";
}
public void write (float data) {
toWrite = "" + data;
try {
stream.write(toWrite.getBytes());
} catch (Exception e) {
}
toWrite = "";
}
public void write (long data) {
toWrite = "" + data;
try {
stream.write(toWrite.getBytes());
} catch (Exception e) {
}
toWrite = "";
}
public void write (short data) {
toWrite = "" + data;
try {
stream.write(toWrite.getBytes());
} catch (Exception e) {
}
toWrite = "";
}
public void write (byte data) {
toWrite = "" + data;
try {
stream.write(data);
} catch (Exception e) {
}
toWrite = "";
}
public void close () {
try {
stream.close();
} catch (Exception e) {
}
}
}
| [
"[email protected]"
] | |
a85d7c48c554379cead4ae04c5db1d8eca8f582c | d3187a1b64ac8998c78f0762aba91f219c77d2d0 | /src/main/java/aklimuk/thread/counter/part5/atomic/Main.java | 63ae3b73e21ae2b0f2dd34c193135f9f51257253 | [
"Apache-2.0"
] | permissive | aklimuk/multi-threading-demo | 732372836294ac0a9afdd8ac219f50a79f4bbbcd | a284ce13c9ff5c6ac4caea60079698c2714a4543 | refs/heads/master | 2020-12-03T00:39:55.413230 | 2017-07-03T01:55:33 | 2017-07-03T01:55:33 | 96,057,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,466 | java | /*
* Copyright 2017 Alexander Klimuk
*
* 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 aklimuk.thread.counter.part5.atomic;
import java.util.concurrent.atomic.AtomicInteger;
/**
* The logic is executed in 10 threads. An {@link AtomicInteger} is used in the
* counter.
* <p>
* Expected: The counter always reaches value 1000 (10 threads x 100 increments
* each).
* </p>
* <p>
* Actual: The counter always reaches value 1000. OK.
* </p>
*
* @author <a href="mailto:[email protected]">Alexander Klimuk</a>
*/
public class Main {
public static void main(String[] args) {
int threadNum = 10;
Thread[] threads = new Thread[threadNum];
// Create threads
for (int i = 0; i < threads.length; i++) {
Worker worker = new Worker(i + 1);
threads[i] = new Thread(worker);
}
// Start threads
for (int i = 0; i < threads.length; i++) {
threads[i].start();
}
}
}
| [
"[email protected]"
] | |
00d28b1dab2ac2c3478c7a18189191628070ecd3 | 8acd4d6dc7854ff386b998a0c50e2a4bf9d78132 | /src/main/java/com/hyperchain/springbootmabatis2/application/controller/UserController.java | 57c7bd5264e3438844fcbaa8e1ce1625788854a2 | [] | no_license | wly1003/springbootmybatis2 | c0bcf1da5750187cb29e207f0eb2ed5c07f6b017 | 43dcd0bb341981008045760cbd570f3dbdd01b1d | refs/heads/master | 2020-04-19T10:03:36.724856 | 2019-03-02T15:27:29 | 2019-03-02T15:27:29 | 168,129,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,216 | java | package com.hyperchain.springbootmabatis2.application.controller;
import com.hyperchain.springbootmabatis2.application.entity.UserEntity;
import com.hyperchain.springbootmabatis2.application.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("user")
public class UserController {
private UserService userService;
@Autowired
private UserController(UserService userService){
this.userService = userService;
}
private static final String USER_LIST = "UserList";
private static final String USER_LIST2 = "UserList2";
private static final String USER_FORM = "UserForm";
private static final String REDIRECT_TO_USER_LIST = "redirect:/user";
@RequestMapping(value = "/index",method = RequestMethod.GET)
public String showAll(ModelMap map){
map.addAttribute("UserList",userService.showAll());
return USER_LIST;
}
@RequestMapping(value="/selectByName/{userName}",method=RequestMethod.GET)
public String selectByUserName(@PathVariable String userName, ModelMap map){
if(userService.selectByName(userName)==null) {
return "传值未成功!";
} else {
map.addAttribute("UserList2",userService.selectByName(userName));
return USER_LIST2;
}
}
@RequestMapping(value="/selectByID/{userId}",method=RequestMethod.GET)
public String selectByID(@PathVariable String userId, ModelMap map){
if(userService.selectByID(userId)==null) {
return "传值未成功!";
} else {
map.addAttribute("UserList2",userService.selectByID(userId));
return USER_LIST2;
}
}
/**
* 获取创建UserForm表单
* @param map
* @return
*/
@RequestMapping(value="/addUser",method=RequestMethod.GET)
public String createUserForm(ModelMap map) {
map.addAttribute("user", new UserEntity());
map.addAttribute("action", "addUser");
return USER_FORM;
}
@RequestMapping(value="/addUser",method=RequestMethod.POST)
public String postUser(@ModelAttribute UserEntity user) {
userService.addUser(user);
return REDIRECT_TO_USER_LIST;
}
@RequestMapping(value="/updateByID/{userId}",method=RequestMethod.GET)
public String getByUserID(@PathVariable String userId, ModelMap map) {
if(userService.selectByID(userId)==null) {
return "传值未成功!";
}
else
{ map.addAttribute("user",userService.selectByID(userId));
map.addAttribute("action","updateByID");
return USER_FORM;
}
}
@RequestMapping(value="/updateByID",method=RequestMethod.POST)
public String putByUserID(@ModelAttribute UserEntity user) {
userService.updateByUserID(user);
return REDIRECT_TO_USER_LIST;
}
@RequestMapping(value="/deleteByID/{userId}",method=RequestMethod.GET)
public String deleteUserByID(@PathVariable String userId) {
userService.deleteByUserID(userId);
return REDIRECT_TO_USER_LIST;
}
}
| [
"[email protected]"
] | |
191724aa6a08c63f57895b1f753baa09c3a07fca | 2de28d9d19494ff2f4af221095f7248d9c23265d | /Aula7LP1/src/a6ex4/Dia.java | 74f2b3800fcfcab8104e199539361d8455489fca | [] | no_license | ederp/LP1 | 42f1c7141ba985409144fd21651b9d3ff9e61cc2 | 339df781fe7818661afda653096e65409668590e | refs/heads/master | 2022-12-30T12:59:53.060255 | 2020-10-20T21:16:25 | 2020-10-20T21:16:25 | 305,543,873 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 416 | java | package a6ex4;
public class Dia extends Tempo{
public Dia(String dhi, String dhf) {
setDataHoraInicial(dhi);
setDataHoraFinal(dhf);
}
@Override
protected double calcularTempo() {
// TODO Auto-generated method stub
Long diferenca = getDataHoraFinal().getTimeInMillis() - getDataHoraInicial().getTimeInMillis();
double dif2 = (double)diferenca;
dif2 /= (24 * 60 * 60 * 1000);
return dif2;
}
}
| [
"[email protected]"
] | |
9d7cfaeac914a0459fa323be3eb25f9da22a70c5 | 72f9ad527b0961b4960e64ded201e640ba2ccff3 | /onebusaway-gtfs/src/test/java/org/onebusaway/gtfs/impl/calendar/CalendarServiceImplSyntheticTest.java | 1880c6de05e273dbbd26f08db99e3a604af84186 | [] | no_license | camsys/onebusaway-gtfs-modules | 50a9f5bf6f6fd2c51ab33d16fa274b8ae258c065 | 3aac17a6eedc576fb62fde61a4377151999cbd53 | refs/heads/deprecated | 2022-11-26T00:32:09.906662 | 2019-12-10T18:21:53 | 2019-12-10T18:21:53 | 2,301,977 | 1 | 1 | null | 2022-11-24T01:42:13 | 2011-08-31T14:30:33 | Java | UTF-8 | Java | false | false | 14,890 | java | package org.onebusaway.gtfs.impl.calendar;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.onebusaway.gtfs.DateSupport.date;
import static org.onebusaway.gtfs.DateSupport.hourToSec;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import org.junit.Before;
import org.junit.Test;
import org.onebusaway.gtfs.model.AgencyAndId;
import org.onebusaway.gtfs.model.calendar.CalendarServiceData;
import org.onebusaway.gtfs.model.calendar.LocalizedServiceId;
import org.onebusaway.gtfs.model.calendar.ServiceDate;
import org.onebusaway.gtfs.model.calendar.ServiceIdIntervals;
public class CalendarServiceImplSyntheticTest {
private TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
private ServiceDate d1 = new ServiceDate(2010, 02, 01);
private ServiceDate d2 = new ServiceDate(2010, 02, 02);
private ServiceDate d3 = new ServiceDate(2010, 02, 03);
private AgencyAndId sid1 = new AgencyAndId("A", "1");
private AgencyAndId sid2 = new AgencyAndId("A", "2");
private AgencyAndId sid3 = new AgencyAndId("A", "3");
private LocalizedServiceId lsid1 = new LocalizedServiceId(sid1, tz);
private LocalizedServiceId lsid2 = new LocalizedServiceId(sid2, tz);
private LocalizedServiceId lsid3 = new LocalizedServiceId(sid3, tz);
private ServiceIdIntervals intervals;
private CalendarServiceImpl service;
@Before
public void setup() {
CalendarServiceData data = new CalendarServiceData();
data.putTimeZoneForAgencyId("A", tz);
putServiceDatesForServiceId(data, lsid1, Arrays.asList(d1, d2));
putServiceDatesForServiceId(data, lsid2, Arrays.asList(d2, d3));
putServiceDatesForServiceId(data, lsid3, Arrays.asList(d1, d3));
intervals = new ServiceIdIntervals();
intervals.addStopTime(lsid1, hourToSec(6), hourToSec(6));
intervals.addStopTime(lsid1, hourToSec(25), hourToSec(25));
intervals.addStopTime(lsid2, hourToSec(4), hourToSec(5));
intervals.addStopTime(lsid2, hourToSec(30), hourToSec(30));
intervals.addStopTime(lsid3, hourToSec(7), hourToSec(7));
intervals.addStopTime(lsid3, hourToSec(23), hourToSec(23));
service = new CalendarServiceImpl();
service.setData(data);
}
@Test
public void testGetLocalizedServiceIdForAgency() {
assertEquals(lsid1,
service.getLocalizedServiceIdForAgencyAndServiceId("A", sid1));
assertNull(service.getLocalizedServiceIdForAgencyAndServiceId("B", sid1));
}
@Test
public void testGetServiceIds() {
Set<AgencyAndId> serviceIds = service.getServiceIds();
assertEquals(3, serviceIds.size());
assertTrue(serviceIds.contains(sid1));
assertTrue(serviceIds.contains(sid2));
assertTrue(serviceIds.contains(sid3));
}
@Test
public void testGetServiceDatesForServiceId() {
Set<ServiceDate> serviceDates = service.getServiceDatesForServiceId(sid1);
assertEquals(2, serviceDates.size());
assertTrue(serviceDates.contains(d1));
assertTrue(serviceDates.contains(d2));
serviceDates = service.getServiceDatesForServiceId(new AgencyAndId("dne",
"dne"));
assertEquals(0, serviceDates.size());
}
@Test
public void test() {
Date date1 = d1.getAsDate(tz);
Date date2 = d2.getAsDate(tz);
Date date3 = d3.getAsDate(tz);
assertTrue(service.isLocalizedServiceIdActiveOnDate(lsid1, date1));
assertTrue(service.isLocalizedServiceIdActiveOnDate(lsid1, date2));
assertFalse(service.isLocalizedServiceIdActiveOnDate(lsid1, date3));
assertFalse(service.isLocalizedServiceIdActiveOnDate(lsid2, date1));
assertTrue(service.isLocalizedServiceIdActiveOnDate(lsid2, date2));
assertTrue(service.isLocalizedServiceIdActiveOnDate(lsid2, date3));
assertTrue(service.isLocalizedServiceIdActiveOnDate(lsid3, date1));
assertFalse(service.isLocalizedServiceIdActiveOnDate(lsid3, date2));
assertTrue(service.isLocalizedServiceIdActiveOnDate(lsid3, date3));
}
@Test
public void testGetServiceIdsOnDate() {
Set<AgencyAndId> serviceIds = service.getServiceIdsOnDate(d2);
assertEquals(2, serviceIds.size());
assertTrue(serviceIds.contains(sid1));
assertTrue(serviceIds.contains(sid2));
}
@Test
public void testGetServiceDatesWithinRange01() {
Date from = date("2010-02-01 07:00 Pacific Standard Time");
Date to = date("2010-02-01 08:00 Pacific Standard Time");
Map<LocalizedServiceId, List<Date>> result = service.getServiceDatesWithinRange(
intervals, from, to);
assertEquals(2, result.size());
List<Date> dates = result.get(lsid1);
assertEquals(1, dates.size());
assertEquals(d1.getAsDate(tz), dates.get(0));
dates = result.get(lsid3);
assertEquals(1, dates.size());
assertEquals(d1.getAsDate(tz), dates.get(0));
}
@Test
public void testGetServiceDatesWithinRange02() {
Date from = date("2010-02-03 05:00 Pacific Standard Time");
Date to = date("2010-02-03 05:30 Pacific Standard Time");
Map<LocalizedServiceId, List<Date>> result = service.getServiceDatesWithinRange(
intervals, from, to);
assertEquals(1, result.size());
List<Date> dates = result.get(lsid2);
assertEquals(2, dates.size());
assertTrue(dates.contains(d2.getAsDate(tz)));
assertTrue(dates.contains(d3.getAsDate(tz)));
}
@Test
public void testGetServiceDatesWithinRange03() {
Date from = date("2010-02-02 03:30 Pacific Standard Time");
Date to = date("2010-02-02 03:45 Pacific Standard Time");
Map<LocalizedServiceId, List<Date>> result = service.getServiceDateArrivalsWithinRange(
intervals, from, to);
assertEquals(0, result.size());
}
@Test
public void testGetServiceDatesWithinRange04() {
Date from = date("2010-02-02 04:30 Pacific Standard Time");
Date to = date("2010-02-02 04:45 Pacific Standard Time");
Map<LocalizedServiceId, List<Date>> result = service.getServiceDateArrivalsWithinRange(
intervals, from, to);
assertEquals(1, result.size());
List<Date> dates = result.get(lsid2);
assertEquals(1, dates.size());
assertTrue(dates.contains(d2.getAsDate(tz)));
}
@Test
public void testGetServiceDatesWithinRange05() {
Date from = date("2010-02-02 04:30 Pacific Standard Time");
Date to = date("2010-02-02 04:45 Pacific Standard Time");
Map<LocalizedServiceId, List<Date>> result = service.getServiceDateDeparturesWithinRange(
intervals, from, to);
assertEquals(0, result.size());
}
@Test
public void testGetServiceDatesWithinRange06() {
Date from = date("2010-02-02 00:30 Pacific Standard Time");
Date to = date("2010-02-02 00:45 Pacific Standard Time");
Map<LocalizedServiceId, List<Date>> result = service.getServiceDateArrivalsWithinRange(
intervals, from, to);
assertEquals(1, result.size());
List<Date> dates = result.get(lsid1);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
result = service.getServiceDateDeparturesWithinRange(intervals, from, to);
assertEquals(1, result.size());
dates = result.get(lsid1);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
}
@Test
public void testGetServiceDatesWithinRange07() {
Date from = date("2010-02-02 00:30 Pacific Standard Time");
Date to = date("2010-02-02 01:45 Pacific Standard Time");
Map<LocalizedServiceId, List<Date>> result = service.getServiceDateArrivalsWithinRange(
intervals, from, to);
assertEquals(1, result.size());
List<Date> dates = result.get(lsid1);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
result = service.getServiceDateDeparturesWithinRange(intervals, from, to);
assertEquals(1, result.size());
dates = result.get(lsid1);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
result = service.getServiceDatesWithinRange(intervals, from, to);
assertEquals(1, result.size());
dates = result.get(lsid1);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
}
@Test
public void testGetServiceDatesWithinRange08() {
Date from = date("2010-02-01 07:00 Pacific Standard Time");
Date to = date("2010-02-01 08:00 Pacific Standard Time");
List<Date> dates = service.getServiceDatesWithinRange(lsid1,
intervals.getIntervalForServiceId(lsid1), from, to);
assertEquals(1, dates.size());
assertEquals(d1.getAsDate(tz), dates.get(0));
}
@Test
public void testGetServiceDatesWithinRange09() {
Date from = date("2010-02-01 07:00 Pacific Standard Time");
Date to = date("2010-02-01 08:00 Pacific Standard Time");
List<Date> dates = service.getServiceDateArrivalsWithinRange(lsid1,
intervals.getIntervalForServiceId(lsid1), from, to);
assertEquals(1, dates.size());
assertEquals(d1.getAsDate(tz), dates.get(0));
}
@Test
public void testGetServiceDatesWithinRange10() {
Date from = date("2010-02-01 07:00 Pacific Standard Time");
Date to = date("2010-02-01 08:00 Pacific Standard Time");
List<Date> dates = service.getServiceDateDeparturesWithinRange(lsid1,
intervals.getIntervalForServiceId(lsid1), from, to);
assertEquals(1, dates.size());
assertEquals(d1.getAsDate(tz), dates.get(0));
}
@Test
public void testGetNextDepartureServiceDates01() {
Map<LocalizedServiceId, List<Date>> next = service.getNextDepartureServiceDates(
intervals, date("2010-02-01 06:30 Pacific Standard Time").getTime());
assertEquals(3, next.size());
List<Date> dates = next.get(lsid1);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
dates = next.get(lsid2);
assertEquals(1, dates.size());
assertTrue(dates.contains(d2.getAsDate(tz)));
dates = next.get(lsid3);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
}
@Test
public void testGetNextDepartureServiceDates02() {
Map<LocalizedServiceId, List<Date>> next = service.getNextDepartureServiceDates(
intervals, date("2010-02-01 10:00 Pacific Standard Time").getTime());
assertEquals(3, next.size());
List<Date> dates = next.get(lsid1);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
dates = next.get(lsid2);
assertEquals(1, dates.size());
assertTrue(dates.contains(d2.getAsDate(tz)));
dates = next.get(lsid3);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
}
@Test
public void testGetNextDepartureServiceDates03() {
Map<LocalizedServiceId, List<Date>> next = service.getNextDepartureServiceDates(
intervals, date("2010-02-03 06:30 Pacific Standard Time").getTime());
assertEquals(2, next.size());
List<Date> dates = next.get(lsid2);
assertEquals(1, dates.size());
assertTrue(dates.contains(d3.getAsDate(tz)));
dates = next.get(lsid3);
assertEquals(1, dates.size());
assertTrue(dates.contains(d3.getAsDate(tz)));
}
@Test
public void testGetNextDepartureServiceDates04() {
Map<LocalizedServiceId, List<Date>> next = service.getNextDepartureServiceDates(
intervals, date("2010-02-04 03:30 Pacific Standard Time").getTime());
assertEquals(1, next.size());
List<Date> dates = next.get(lsid2);
assertEquals(1, dates.size());
assertTrue(dates.contains(d3.getAsDate(tz)));
}
@Test
public void testGetNextDepartureServiceDates05() {
Map<LocalizedServiceId, List<Date>> next = service.getNextDepartureServiceDates(
intervals, date("2010-02-04 07:30 Pacific Standard Time").getTime());
assertEquals(0, next.size());
}
@Test
public void testGetNextDepartureServiceDates06() {
List<Date> dates = service.getNextDepartureServiceDates(lsid2,
intervals.getIntervalForServiceId(lsid2),
date("2010-02-04 03:30 Pacific Standard Time").getTime());
assertEquals(1, dates.size());
assertTrue(dates.contains(d3.getAsDate(tz)));
}
@Test
public void testGetPreviousArrivalServiceDates01() {
Map<LocalizedServiceId, List<Date>> next = service.getPreviousArrivalServiceDates(
intervals, date("2010-02-01 05:30 Pacific Standard Time").getTime());
assertEquals(0, next.size());
}
@Test
public void testGetPreviousArrivalServiceDates02() {
Map<LocalizedServiceId, List<Date>> next = service.getPreviousArrivalServiceDates(
intervals, date("2010-02-01 06:30 Pacific Standard Time").getTime());
assertEquals(1, next.size());
List<Date> dates = next.get(lsid1);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
}
@Test
public void testGetPreviousArrivalServiceDates03() {
Map<LocalizedServiceId, List<Date>> next = service.getPreviousArrivalServiceDates(
intervals, date("2010-02-01 07:30 Pacific Standard Time").getTime());
assertEquals(2, next.size());
List<Date> dates = next.get(lsid1);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
dates = next.get(lsid3);
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
}
@Test
public void testGetPreviousArrivalServiceDates04() {
Map<LocalizedServiceId, List<Date>> next = service.getPreviousArrivalServiceDates(
intervals, date("2010-02-02 07:30 Pacific Standard Time").getTime());
assertEquals(3, next.size());
List<Date> dates = next.get(lsid1);
assertEquals(1, dates.size());
assertTrue(dates.contains(d2.getAsDate(tz)));
dates = next.get(lsid2);
assertEquals(1, dates.size());
assertTrue(dates.contains(d2.getAsDate(tz)));
dates = next.get(lsid3);
assertTrue(dates.contains(d1.getAsDate(tz)));
assertEquals(1, dates.size());
}
@Test
public void testGetPreviousArrivalServiceDates05() {
List<Date> dates = service.getPreviousArrivalServiceDates(lsid1,
intervals.getIntervalForServiceId(lsid1),
date("2010-02-01 06:30 Pacific Standard Time").getTime());
assertEquals(1, dates.size());
assertTrue(dates.contains(d1.getAsDate(tz)));
}
/****
* Private Methods
****/
private void putServiceDatesForServiceId(CalendarServiceData data,
LocalizedServiceId lsid, List<ServiceDate> serviceDates) {
data.putServiceDatesForServiceId(lsid.getId(), serviceDates);
List<Date> dates = new ArrayList<Date>();
for (ServiceDate serviceDate : serviceDates)
dates.add(serviceDate.getAsDate(lsid.getTimeZone()));
data.putDatesForLocalizedServiceId(lsid, dates);
}
}
| [
"[email protected]@638cd66d-8850-0410-a654-37fb4b726c3a"
] | [email protected]@638cd66d-8850-0410-a654-37fb4b726c3a |
dda361e0b64d12f56e8feb42f620fa4104c57452 | c9c6895c8ce033bea26ef31db706c3a450a7a844 | /src/main/java/BusinessLayer/OdetailsEntity.java | ac6c1f14ac0df29ab2f3db56855de5442975365c | [] | no_license | BenedikteEva/LegoHouses | 044041ae40610c9d5604cde583665aa1aeddb9fc | b6a535ec08f2e7bc979adb7bfbe3feed00ebc868 | refs/heads/master | 2021-05-15T18:11:49.907358 | 2017-10-20T21:54:51 | 2017-10-20T21:54:51 | 107,604,049 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,494 | java | /*
* BenedikteEva
* Lego Houses
*/
package BusinessLayer;
/**
*
* @author Ejer
*/
public class OdetailsEntity {
OdetailsEntity(int order_id, int length, int width, int height, int forbandt) {
this.order_id = order_id;
this.height = height;
this.width = width;
this.length = length;
this.bondtype = forbandt;
}
public OdetailsEntity() {
}
@Override
public String toString() {
return "Ordre_id: " + order_id + ", højde: " + height + ", bredde: " + width + ", længde: " + length + ", forbandt: " + bondtype + '.';
}
public int getOrder_id() {
return order_id;
}
public void setOrder_id(int order_id) {
this.order_id = order_id;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getLength() {
return length;
}
public void setLength(int length) {
this.length = length;
}
public int getBondtype() {
return bondtype;
}
public void setBondtype(int bondtype) {
this.bondtype = bondtype;
}
int order_id;
int height;
int width;
int length;
int bondtype;
}
| [
"[email protected]"
] | |
98fcabc8c6c8d7d045aa047b175c656c4f4bd92b | ab96b14aa043f2bf5ee6185a7f15d975e70dc051 | /test/unit/java/com/galaxy/merchant/input/parser/InputParseStrategyTest.java | f37b32bd14b59d10c95112a79c2f3b31c22e1590 | [] | no_license | eralmas7/Merchant-on-Galaxy | 65153145a0a0ae266eee808e60b917f6d0933271 | 86ed476dfcf3c2c6fa13db9623a759775f512f09 | refs/heads/master | 2016-09-06T05:58:09.505686 | 2015-04-04T09:45:32 | 2015-04-04T09:45:32 | 33,400,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,164 | java | package com.galaxy.merchant.input.parser;
import org.junit.Before;
import org.junit.Test;
import junit.framework.Assert;
import junit.framework.TestCase;
public class InputParseStrategyTest extends TestCase {
private ParserStrategy inputParseStrategy;
@Before
public void setUp() {
inputParseStrategy = new InputParseStrategy();
}
@Test
public void testParserWithValidInput() {
final String[] inputs = new String[2];
inputs[0] = "glob is I";
inputs[1] = "glob glob Silver is 34 Credits";
for (int count = 0; count < inputs.length; count++) {
try {
inputParseStrategy.getTradingDetailsFromInputString(inputs[count]);
} catch (Exception e) {
Assert.fail("Did not expected any exception");
}
}
}
@Test
public void testParserWithInvalidInput() {
String input = "what Credits ";
try {
inputParseStrategy.getTradingDetailsFromInputString(input);
Assert.fail("Did not expected to be here as i was expecting an exception");
} catch (Exception e) {
}
}
}
| [
"[email protected]"
] | |
f9f60a4f67966c383ca77d73325933e70e590790 | 60276fd3148723cf7a757c5aa1a76cf127ceef41 | /src/by/bsu/hr/logic/AddInterviewResultLogic.java | 7882de23253d784a62baec8b640f674a2623bbd5 | [] | no_license | Semechkaliza/1 | 7fd070399ca31384c37df607a2e8434486c20101 | 2f67468d5c6172ef6d6f30f277c0d93ac59a31c0 | refs/heads/master | 2021-09-07T01:17:45.839440 | 2018-02-14T21:03:51 | 2018-02-14T21:03:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 684 | java | package by.bsu.hr.logic;
import by.bsu.hr.dao.DAOException;
import by.bsu.hr.dao.InterviewDAO;
/**
* Logic to add interview result command
*/
public class AddInterviewResultLogic {
/**
* @param userId
* @param vacancyId
* @param type
* @param mark
* @param feedback
* @throws LogicException
*/
public static void addResult(int userId, int vacancyId, String type, int mark, String feedback) throws LogicException {
try {
InterviewDAO.addIntrviewResult(userId, vacancyId, type, mark, feedback);
} catch (DAOException e) {
throw new LogicException("Error add interview result", e);
}
}
}
| [
"[email protected]"
] | |
e368d2159f7a4d8521ed622cec862a94ca9d5df4 | 2ea49bfaa6bc1b9301b025c5b2ca6fde7e5bb9df | /contributions/Asicoder/Java/Data Types/2016-10-27.java | 8f8173a71bbdd83e138927187b911ae16023fc42 | [] | no_license | 0x8801/commit | 18f25a9449f162ee92945b42b93700e12fd4fd77 | e7692808585bc7e9726f61f7f6baf43dc83e28ac | refs/heads/master | 2021-10-13T08:04:48.200662 | 2016-12-20T01:59:47 | 2016-12-20T01:59:47 | 76,935,980 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 185 | java | Converting a string to upper or lower case
Finding a substring in a string
Equals operation on different data types
`StringBuffer` vs `StringBuilder`
Do not attempt comparisons with NaN | [
"[email protected]"
] | |
e7b584193fc4709a580cd901972a7a3e21769154 | 29e39ec3453a00efa0a4bb79432c8e8fc1cdc4b5 | /src/main/java/com/nchu/xiaaman/student_education/dao/ClassTeacherDao.java | 3f93c392c693f4798f26feffefe0cbcba13d61ed | [
"Apache-2.0"
] | permissive | cnbillow/StudentEducationServer | 972853dfd722691e87ce5eb7076cc16d31a65be9 | a65522b5bc40019ff81904b75e55429f73337e55 | refs/heads/master | 2020-07-08T01:33:45.034125 | 2019-08-19T03:12:19 | 2019-08-19T03:12:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | package com.nchu.xiaaman.student_education.dao;
import com.nchu.xiaaman.student_education.domain.ClassTeacher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
public interface ClassTeacherDao extends JpaRepository<ClassTeacher, String> {
//根据班级id查询教师id
@Query(value = "select user_id from class_teacher where class_id = ?1", nativeQuery = true)
String getUserIdByClassId(String classId);
}
| [
"[email protected]"
] | |
6dce45b302f7b1c7b5e9077ec54acbc572dcaf37 | 6b028abe9893fe2dcf40bd1861cf9b773f341b69 | /src/day34/MonkeySmile.java | 0c9d7fb173266e58bddf68e7dc1008432e032e0a | [] | no_license | dilmir95/JavaProgrammingB15Online | d5e87513fbfdadc17837d46f054659bbd740a5ac | 519a8b1435b3427b38bc0abc1335da83b1564bbf | refs/heads/master | 2020-11-27T22:39:06.606636 | 2020-08-04T23:07:29 | 2020-08-04T23:07:29 | 229,631,305 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 631 | java | package day34;
public class MonkeySmile {
public static void main(String[] args) {
System.out.println(monkeySmile(true,true));
System.out.println(monkeySmile(true,false));
System.out.println(monkeySmileV2(true,true));
}
public static boolean monkeySmile (boolean aSmile , boolean bSmile){
if(aSmile && bSmile){
return true;
}else if(!aSmile && !bSmile){
return true;
}
return false;
}
public static boolean monkeySmileV2(boolean aSmile , boolean bSmile){
return (aSmile && bSmile || !aSmile&& !bSmile);
}
}
| [
"[email protected]"
] | |
edc689943d9b6d36d98efa9e27048d9416dbe409 | cec98e1cc9a535eb9a5a94475ae9ed47ad39557b | /graph/Graph.java | 4a6fe405f9d299861ea40ef7b54d3e8830eca9cc | [] | no_license | Frederickfan/Fun-with-Graphs | 82581947b687fd71cc93dd347dcad72eb05b8251 | f2ad6763c124203b607bbf02da057e51995d25b0 | refs/heads/master | 2020-04-08T04:07:40.160495 | 2017-10-07T21:20:47 | 2017-10-07T21:20:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,459 | java | package graph;
/* Do not add or remove public or protected members, or modify the signatures of
* any public methods. Do not add or remove public classes.
*
* You may make changes that don't affect the API (much) as seen from outside
* the graph package:
* + You may make methods in GraphObj abstract, if you want different
* implementations in DirectedGraph and UndirectedGraph.
* + You may add bodies to abstract methods, modify existing bodies,
* or override inherited methods.
* + You may change parameter names, or add 'final' modifiers to parameters.
* + You may add private and package private members.
* + You may add additional non-public classes to the graph package.
*/
/** Represents a general unlabeled graph whose vertices are denoted by
* positive integers. A graph may be directed or undirected. For
* an undirected graph, outgoing and incoming edges are the same.
* Graphs may have self edges, but no multi-edges (edges with the same
* end points).
*
* Edges in a Graph are ordered by the sequence in which they were added.
*
* @author P. N. Hilfinger
*/
public abstract class Graph {
/** Returns the number of vertices in me. */
public abstract int vertexSize();
/** Returns my maximum vertex number, or 0 if I am empty. */
public abstract int maxVertex();
/** Returns the number of edges in me. */
public abstract int edgeSize();
/** Returns true iff I am a directed graph. */
public abstract boolean isDirected();
/** Returns the number of outgoing edges incident to V, or 0 if V is not
* one of my vertices. */
public abstract int outDegree(int v);
/** Returns the number of incoming edges incident to V, or 0 if V is not
* one of my vertices. */
public abstract int inDegree(int v);
/** Returns outDegree(V). This is simply a synonym, intended for
* use in undirected graphs. */
public final int degree(int v) {
return outDegree(v);
}
/** Returns true iff U is one of my vertices. */
public abstract boolean contains(int u);
/** Returns true iff U and V are my vertices and I have an edge (U, V). */
public abstract boolean contains(int u, int v);
/** Returns a new vertex and adds it to me with no incident edges.
* The vertex number is always the smallest integer >= 1 that is not
* currently one of my vertex numbers. */
public abstract int add();
/** Add an edge incident on U and V. If I am directed, the edge is
* directed (leaves U and enters V). Assumes U and V are my
* vertices. Has no effect if there is already an edge from U to
* V. Returns a unique positive number identifying the edge,
* different from those returned for any other existing edge. */
public abstract int add(int u, int v);
/** Remove V, if present, and all adjacent edges. */
public abstract void remove(int v);
/** Remove edge (U, V) from me, if present. */
public abstract void remove(int u, int v);
/** Returns an Iteration over all vertices in numerical order. */
public abstract Iteration<Integer> vertices();
/** Return successor K of V, numbering from 0, or 0 if there
* is no such successor (or V is not a vertex). */
public abstract int successor(int v, int k);
/** Return predecessor K of V, numbering from 0, or 0 if
* there is no such predecessor. Assumes V is one of my vertices. */
public abstract int predecessor(int v, int k);
/** Return neighbor K of V, numbering from 0, or 0 if
* there is no such neighbor. Assumes V is one of my vertices.
* This is a synonym for successor(v, k). */
public int neighbor(int v, int k) {
return successor(v, k);
}
/** Returns an iteration over all successors of V in the order the edges
* to them were added. Empty if V is not my vertex. */
public abstract Iteration<Integer> successors(int v);
/** Returns an iteration over all predecessors of V in the order the edges
* to them were added. Empty if V is not my vertex. */
public abstract Iteration<Integer> predecessors(int v);
/** Returns successors(V). This is a synonym typically used on
* undirected graphs. */
public final Iteration<Integer> neighbors(int v) {
return successors(v);
}
/** Returns an iteration over all edges in me. Edges are returned
* as two-element arrays (u, v), which are directed if the graph
* is. The values in the array returned by .next() may have changed
* on the next call of .next() (that is, .next() is free to use the same
* array to return all results). */
public abstract Iteration<int[]> edges();
/* Non-public methods for internal use. */
/** Throw exception if V is not one of my vertices. */
protected void checkMyVertex(int v) {
if (!contains(v)) {
throw new IllegalArgumentException("vertex not from Graph");
}
}
/** Returns a unique positive identifier for the edge (U, V), if it
* is present, or 0 otherwise. This value should always be bounded by
* a small multiple of the meximum number of the edges in the graph.
* Its purpose is to provide a mapping of edges to integers for use by
* classes such as LabeledGraph. It is the same as that returned by
* add(u, v). */
protected abstract int edgeId(int u, int v);
}
| [
"[email protected]"
] | |
0c8a5ec1ac9ab22c4b599b4f1c2e87d010ecaf23 | b3cc9b7546af98f69ba6b81744c10beda7e3149f | /src/com/readersdigest/preference/builder/AddressBuilder.java | 6ca8ef6fca26b23caea96269b6eb24a666a6e42b | [] | no_license | shaktichauhan/preferenceservice | bb49ba1f8ae580fb6d291bd646f18cf20bfa5b4f | 35d2305215d581024a63952644d00140cb7ba465 | refs/heads/master | 2020-05-17T14:15:07.469677 | 2014-11-11T13:56:56 | 2014-11-11T13:56:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 633 | java | package com.readersdigest.preference.builder;
import com.readersdigest.preference.dto.AddressDTO;
import com.readersdigest.preference.domain.Address;
/**
* @author shsingh
*
*/
public class AddressBuilder {
public Address buildDomain(AddressDTO dto) {
if (dto == null)
return null;
Address domain = new Address();
domain.setId(dto.id);
domain.setAddress1(dto.address1);
domain.setAddress2(dto.address2);
domain.setAddress3(dto.address3);
domain.setCity(dto.city);
domain.setPostalCode(dto.postalCode);
domain.setCountryCode(dto.countryCode);
domain.setVersion(dto.version);
return domain;
}
}
| [
"[email protected]"
] | |
1b214f71b342e9dc228de5c48bf51b3ef907e597 | 2ab5eb1d40358472a36e0a4ff530ec0a9af440a7 | /src/test/java/junitTestExamle/StringsUtilTest.java | bd8d1a4ec63752725de4ddb56ed0b9f9111307ed | [] | no_license | Yaroslav3/JUnit_Test | 18b65be242e899cd4c5c21b3b510ea240c27fa82 | 5d8036c8a3b382bb07b3169768439b1c92c14343 | refs/heads/master | 2020-03-15T15:55:02.541686 | 2018-05-05T21:36:15 | 2018-05-05T21:36:15 | 132,223,812 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,519 | java | package junitTestExamle;
import org.junit.Test;
import static org.junit.Assert.*;
public class StringsUtilTest {
private static final double DELTA = 0.0001;
@Test
public void testJoinArray() {
String expected = "hello-i'm-Java";
String[] source = {"hello", "i'm", "Java"};
assertEquals("Wrong string", expected, StringsUtil.joinArray(source, '-'));
assertNull(StringsUtil.joinArray(null,'-'));
}
@Test
public void testToArray() {
String[] expected = {"hello", "i'm", "your", "crazy", "friend"};
String source = "hello i'm your crazy friend";
assertArrayEquals("Wrong array", expected, StringsUtil.toArray(source, ' '));
assertEquals(0, StringsUtil.toArray(null, ' ').length);
}
@Test
public void testIsEmpty() {
assertFalse("Non empty string claimed to be empty", StringsUtil.isEmpty("TEST"));
assertTrue("Empty string not recognized", StringsUtil.isEmpty(""));
assertTrue("Whitespaces not recognized", StringsUtil.isEmpty(" "));
}
@Test
public void testToDouble() {
assertEquals(3.1415, StringsUtil.toDouble("3.1415"), DELTA);
assertEquals("Not NaN for null", Double.NaN, StringsUtil.toDouble(null), DELTA);
}
@Test
public void testFromDouble() {
double source = 3.145;
String expected = "3.145";
String actual = StringsUtil.fromDouble(source);
assertEquals("Unexpected string value", expected, actual);
}
} | [
"[email protected]"
] | |
3b54f854ff5e16f2459d94902667956639709d8e | c65bcb0d63e9db3b2471444e7628925a613faf31 | /app/src/main/java/vlc/VLCApplication.java | b9bdd36c444bb5002b30fc325cf55e1952f990d9 | [] | no_license | MMLoveMeMM/AngryPandaIjkplayer | 6354bb117a8c91627d4f8303420b5542b7f85047 | e770dca238d7e8219ccc6349e78ff3b31e8bae32 | refs/heads/master | 2020-08-06T20:09:29.059930 | 2019-10-06T09:01:56 | 2019-10-06T09:01:56 | 213,137,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 363 | java | package vlc;
import android.app.Application;
import android.content.Context;
/**
* Created by tangjun on 14-8-24.
*/
public class VLCApplication extends Application {
private static VLCApplication sInstance;
@Override
public void onCreate() {
super.onCreate();
sInstance = this;
}
public static Context getAppContext() {
return sInstance;
}
}
| [
"[email protected]"
] | |
5f849b689e0bd02a351887c3ba59232c37c7ac7a | 2455a7077d8cfcdb41ec27bb866813ccad13c735 | /src/main/java/org/tfga/baseUrl/web/BaseUrlController.java | 25504c86ddcac795afae114783f18e6b1293dc77 | [] | no_license | tfga-ebi/baseUrl | 215846d91c198d655d4e655b6bfa2188a0c33cef | c483ea52e985d17fd5f3b7bf7fb095ae63b4413f | refs/heads/master | 2020-04-08T19:35:50.428564 | 2018-11-29T12:55:30 | 2018-11-29T12:56:16 | 159,662,694 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 557 | java | package org.tfga.baseUrl.web;
import org.springframework.web.bind.annotation.RestController;
import org.tfga.baseUrl.BaseUrl;
import java.net.MalformedURLException;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestMapping;
@RestController
@RequestMapping("/")
public class BaseUrlController {
BaseUrl b = new BaseUrl();
@RequestMapping("/tfga")
public String index(HttpServletRequest request) throws MalformedURLException {
return b.baseURL(request) + '\n';
}
}
| [
"[email protected]"
] | |
e78b343757eb05c1e5a539f2c8b0036b746f69bc | 5a5f914ba56bcb52c33263d547f9da4b0d749aea | /src/cn/org/rapid_framework/generator/provider/db/table/model/Table.java | 9f0a45b08c149c513b09bdefd8394e3bc8faab2c | [] | no_license | ztshmily/test | 88a502f602a68f6c07f1f9d5389d09f8f85af86c | e165d16bd3f17291d991a6093636d38e0175e5e8 | refs/heads/master | 2020-04-16T17:57:19.511995 | 2019-01-15T08:35:56 | 2019-01-15T08:35:56 | 165,796,909 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,930 | java | package cn.org.rapid_framework.generator.provider.db.table.model;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import cn.org.rapid_framework.generator.GeneratorProperties;
import cn.org.rapid_framework.generator.provider.db.table.TableFactory;
import cn.org.rapid_framework.generator.util.StringHelper;
/**
* 用于生成代码的Table对象.对应数据库的table
*
* @author badqiu
* @email badqiu(a)gmail.com
*/
public class Table {
String sqlName;
String remarks;
String className;
/** the name of the owner of the synonym if this table is a synonym */
private String ownerSynonymName = null;
LinkedHashSet<Column> columns = new LinkedHashSet<Column>();
List<Column> primaryKeyColumns = new ArrayList<Column>();
public Table() {
}
public Table(Table t) {
setSqlName(t.getSqlName());
this.remarks = t.getRemarks();
this.className = t.getSqlName();
this.ownerSynonymName = t.getOwnerSynonymName();
this.columns = t.getColumns();
this.primaryKeyColumns = t.getPrimaryKeyColumns();
this.tableAlias = t.getTableAlias();
this.exportedKeys = t.exportedKeys;
this.importedKeys = t.importedKeys;
}
public LinkedHashSet<Column> getColumns() {
return columns;
}
public void setColumns(LinkedHashSet<Column> columns) {
this.columns = columns;
}
public String getOwnerSynonymName() {
return ownerSynonymName;
}
public void setOwnerSynonymName(String ownerSynonymName) {
this.ownerSynonymName = ownerSynonymName;
}
/** 使用 getPkColumns() 替换 */
@Deprecated
public List<Column> getPrimaryKeyColumns() {
return primaryKeyColumns;
}
/** 使用 setPkColumns() 替换 */
@Deprecated
public void setPrimaryKeyColumns(List<Column> primaryKeyColumns) {
this.primaryKeyColumns = primaryKeyColumns;
}
/** 数据库中表的表名称,其它属性很多都是根据此属性派生 */
public String getSqlName() {
return sqlName;
}
public void setSqlName(String sqlName) {
this.sqlName = sqlName;
}
public static String removeTableSqlNamePrefix(String sqlName) {
String prefixs = GeneratorProperties.getProperty("tableRemovePrefixes", "");
for (String prefix : prefixs.split(",")) {
String removedPrefixSqlName = StringHelper.removePrefix(sqlName, prefix, true);
if (!removedPrefixSqlName.equals(sqlName)) {
return removedPrefixSqlName;
}
}
return sqlName;
}
/** 数据库中表的表备注 */
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public void addColumn(Column column) {
columns.add(column);
}
public void setClassName(String customClassName) {
this.className = customClassName;
}
/**
* 根据sqlName得到的类名称,示例值: UserInfo
*
* @return
*/
public String getClassName() {
if (StringHelper.isBlank(className)) {
String removedPrefixSqlName = removeTableSqlNamePrefix(sqlName);
className = StringHelper
.makeAllWordFirstLetterUpperCase(StringHelper.toUnderscoreName(removedPrefixSqlName));
}
return className;
}
/** 数据库中表的别名,等价于: getRemarks().isEmpty() ? getClassName() : getRemarks() */
public String getTableAlias() {
if (StringHelper.isNotBlank(tableAlias))
return tableAlias;
return StringHelper.removeCrlf(StringHelper.defaultIfEmpty(getRemarks(), getClassName()));
}
public void setTableAlias(String v) {
this.tableAlias = v;
}
/**
* 等价于getClassName().toLowerCase()
*
* @return
*/
public String getClassNameLowerCase() {
return getClassName().toLowerCase();
}
/**
* 得到用下划线分隔的类名称,如className=UserInfo,则underscoreName=user_info
*
* @return
*/
public String getUnderscoreName() {
return StringHelper.toUnderscoreName(getClassName()).toLowerCase();
}
/**
* 返回值为getClassName()的第一个字母小写,如className=UserInfo,则ClassNameFirstLower=
* userInfo
*
* @return
*/
public String getClassNameFirstLower() {
return StringHelper.uncapitalize(getClassName());
}
/**
* 根据getClassName()计算而来,用于得到常量名,如className=UserInfo,则constantName=USER_INFO
*
* @return
*/
public String getConstantName() {
return StringHelper.toUnderscoreName(getClassName()).toUpperCase();
}
/** 使用 getPkCount() 替换 */
@Deprecated
public boolean isSingleId() {
return getPkCount() == 1 ? true : false;
}
/** 使用 getPkCount() 替换 */
@Deprecated
public boolean isCompositeId() {
return getPkCount() > 1 ? true : false;
}
/** 使用 getPkCount() 替换 */
@Deprecated
public boolean isNotCompositeId() {
return !isCompositeId();
}
/**
* 得到主键总数
*
* @return
*/
public int getPkCount() {
int pkCount = 0;
for (Column c : columns) {
if (c.isPk()) {
pkCount++;
}
}
return pkCount;
}
/**
* use getPkColumns()
*
* @deprecated
*/
public List getCompositeIdColumns() {
return getPkColumns();
}
/**
* 得到是主键的全部column
*
* @return
*/
public List<Column> getPkColumns() {
List results = new ArrayList();
for (Column c : getColumns()) {
if (c.isPk())
results.add(c);
}
return results;
}
/**
* 得到不是主键的全部column
*
* @return
*/
public List<Column> getNotPkColumns() {
List results = new ArrayList();
for (Column c : getColumns()) {
if (!c.isPk())
results.add(c);
}
return results;
}
/** 得到单主键,等价于getPkColumns().get(0) */
public Column getPkColumn() {
if (getPkColumns().isEmpty()) {
throw new IllegalStateException("not found primary key on table:" + getSqlName());
}
return getPkColumns().get(0);
}
/** 使用 getPkColumn()替换 */
@Deprecated
public Column getIdColumn() {
return getPkColumn();
}
public List<Column> getEnumColumns() {
List results = new ArrayList();
for (Column c : getColumns()) {
if (!c.isEnumColumn())
results.add(c);
}
return results;
}
public Column getColumnByName(String name) {
Column c = getColumnBySqlName(name);
if (c == null) {
c = getColumnBySqlName(StringHelper.toUnderscoreName(name));
}
return c;
}
public Column getColumnBySqlName(String sqlName) {
for (Column c : getColumns()) {
if (c.getSqlName().equalsIgnoreCase(sqlName)) {
return c;
}
}
return null;
}
public Column getRequiredColumnBySqlName(String sqlName) {
if (getColumnBySqlName(sqlName) == null) {
throw new IllegalArgumentException(
"not found column with sqlName:" + sqlName + " on table:" + getSqlName());
}
return getColumnBySqlName(sqlName);
}
/**
* 忽略过滤掉某些关键字的列,关键字不区分大小写,以逗号分隔
*
* @param ignoreKeywords
* @return
*/
public List<Column> getIgnoreKeywordsColumns(String ignoreKeywords) {
List results = new ArrayList();
for (Column c : getColumns()) {
String sqlname = c.getSqlName().toLowerCase();
if (StringHelper.contains(sqlname, ignoreKeywords.split(","))) {
continue;
}
results.add(c);
}
return results;
}
/**
* This method was created in VisualAge.
*/
public void initImportedKeys(DatabaseMetaData dbmd) throws java.sql.SQLException {
// get imported keys a
ResultSet fkeys = dbmd.getImportedKeys(catalog, schema, this.sqlName);
while (fkeys.next()) {
String pktable = fkeys.getString(PKTABLE_NAME);
String pkcol = fkeys.getString(PKCOLUMN_NAME);
String fktable = fkeys.getString(FKTABLE_NAME);
String fkcol = fkeys.getString(FKCOLUMN_NAME);
String seq = fkeys.getString(KEY_SEQ);
Integer iseq = new Integer(seq);
getImportedKeys().addForeignKey(pktable, pkcol, fkcol, iseq);
}
fkeys.close();
}
/**
* This method was created in VisualAge.
*/
public void initExportedKeys(DatabaseMetaData dbmd) throws java.sql.SQLException {
// get Exported keys
ResultSet fkeys = dbmd.getExportedKeys(catalog, schema, this.sqlName);
while (fkeys.next()) {
String pktable = fkeys.getString(PKTABLE_NAME);
String pkcol = fkeys.getString(PKCOLUMN_NAME);
String fktable = fkeys.getString(FKTABLE_NAME);
String fkcol = fkeys.getString(FKCOLUMN_NAME);
String seq = fkeys.getString(KEY_SEQ);
Integer iseq = new Integer(seq);
getExportedKeys().addForeignKey(fktable, fkcol, pkcol, iseq);
}
fkeys.close();
}
/**
* @return Returns the exportedKeys.
*/
public ForeignKeys getExportedKeys() {
if (exportedKeys == null) {
exportedKeys = new ForeignKeys(this);
}
return exportedKeys;
}
/**
* @return Returns the importedKeys.
*/
public ForeignKeys getImportedKeys() {
if (importedKeys == null) {
importedKeys = new ForeignKeys(this);
}
return importedKeys;
}
public String toString() {
return "Database Table:" + getSqlName() + " to ClassName:" + getClassName();
}
String catalog = TableFactory.getInstance().getCatalog();
String schema = TableFactory.getInstance().getSchema();
private String tableAlias;
private ForeignKeys exportedKeys;
private ForeignKeys importedKeys;
public static final String PKTABLE_NAME = "PKTABLE_NAME";
public static final String PKCOLUMN_NAME = "PKCOLUMN_NAME";
public static final String FKTABLE_NAME = "FKTABLE_NAME";
public static final String FKCOLUMN_NAME = "FKCOLUMN_NAME";
public static final String KEY_SEQ = "KEY_SEQ";
}
| [
"[email protected]"
] | |
246975d116dde63a312b78bcf2d41792ed57e740 | ab9ecda2b917e20a12ba8d60a2acb84d739386c4 | /BlazarService/src/main/java/com/hubspot/blazar/util/GitHubWebhookHandler.java | 631c376e8e9401a6d99239f83f459b0a9c4bdbae | [
"Apache-2.0"
] | permissive | cgvarela/Blazar | 9953200dc8601e92e1475c30bc1ca91fa5cb8857 | 6cdc75d5733a040d9e1d8df3cf6cd472ffc432e7 | refs/heads/master | 2020-12-28T23:15:25.388027 | 2015-09-27T13:36:38 | 2015-09-27T13:36:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,531 | java | package com.hubspot.blazar.util;
import com.google.common.base.Optional;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import com.hubspot.blazar.base.BuildDefinition;
import com.hubspot.blazar.base.GitInfo;
import com.hubspot.blazar.base.Module;
import com.hubspot.blazar.data.service.BranchService;
import com.hubspot.blazar.data.service.BuildService;
import com.hubspot.blazar.data.service.ModuleService;
import com.hubspot.blazar.discovery.ModuleDiscovery;
import com.hubspot.blazar.github.GitHubProtos.Commit;
import com.hubspot.blazar.github.GitHubProtos.CreateEvent;
import com.hubspot.blazar.github.GitHubProtos.DeleteEvent;
import com.hubspot.blazar.github.GitHubProtos.PushEvent;
import com.hubspot.blazar.github.GitHubProtos.Repository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URI;
import java.nio.file.FileSystems;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@Singleton
public class GitHubWebhookHandler {
private static final Logger LOG = LoggerFactory.getLogger(GitHubWebhookHandler.class);
private final BranchService branchService;
private final ModuleService moduleService;
private final ModuleDiscovery moduleDiscovery;
private final BuildService buildService;
@Inject
public GitHubWebhookHandler(BranchService branchService,
ModuleService moduleService,
ModuleDiscovery moduleDiscovery,
BuildService buildService,
EventBus eventBus) {
this.branchService = branchService;
this.moduleService = moduleService;
this.moduleDiscovery = moduleDiscovery;
this.buildService = buildService;
eventBus.register(this);
}
@Subscribe
public void handleCreateEvent(CreateEvent createEvent) throws IOException {
if ("branch".equalsIgnoreCase(createEvent.getRefType())) {
processBranch(gitInfo(createEvent));
}
}
@Subscribe
public void handleDeleteEvent(DeleteEvent deleteEvent) {
if ("branch".equalsIgnoreCase(deleteEvent.getRefType())) {
branchService.delete(gitInfo(deleteEvent));
}
}
@Subscribe
public void handlePushEvent(PushEvent pushEvent) throws IOException {
if (!pushEvent.getRef().startsWith("refs/tags/")) {
GitInfo gitInfo = branchService.upsert(gitInfo(pushEvent));
Set<Module> modules = updateModules(gitInfo, pushEvent);
triggerBuilds(pushEvent, gitInfo, modules);
}
}
public Set<Module> processBranch(GitInfo gitInfo) throws IOException {
gitInfo = branchService.upsert(gitInfo);
try {
Set<Module> modules = moduleDiscovery.discover(gitInfo);
return moduleService.setModules(gitInfo, modules);
} catch (FileNotFoundException e) {
branchService.delete(gitInfo);
return Collections.emptySet();
}
}
private Set<Module> updateModules(GitInfo gitInfo, PushEvent pushEvent) throws IOException {
try {
if (pushEvent.getForced() || moduleDiscovery.shouldRediscover(gitInfo, pushEvent)) {
return moduleService.setModules(gitInfo, moduleDiscovery.discover(gitInfo));
}
return moduleService.getByBranch(gitInfo.getId().get());
} catch (FileNotFoundException e) {
return Collections.emptySet();
}
}
private void triggerBuilds(PushEvent pushEvent, GitInfo gitInfo, Set<Module> modules) throws IOException {
Set<Module> toBuild = new HashSet<>();
for (String path : affectedPaths(pushEvent)) {
for (Module module : modules) {
if (module.contains(FileSystems.getDefault().getPath(path))) {
toBuild.add(module);
}
}
}
for (Module module : toBuild) {
LOG.info("Going to build module {}", module.getId().get());
if ("true".equals(System.getenv("TRIGGER_BUILDS"))) {
buildService.enqueue(new BuildDefinition(gitInfo, module));
}
}
}
private GitInfo gitInfo(CreateEvent createEvent) {
return gitInfo(createEvent.getRepository(), createEvent.getRef(), true);
}
private GitInfo gitInfo(DeleteEvent deleteEvent) {
return gitInfo(deleteEvent.getRepository(), deleteEvent.getRef(), false);
}
private GitInfo gitInfo(PushEvent pushEvent) {
return gitInfo(pushEvent.getRepository(), pushEvent.getRef(), true);
}
private GitInfo gitInfo(Repository repository, String ref, boolean active) {
String host = URI.create(repository.getUrl()).getHost();
if ("api.github.com".equals(host)) {
host = "github.com";
}
String fullName = repository.getFullName();
String organization = fullName.substring(0, fullName.indexOf('/'));
String repositoryName = fullName.substring(fullName.indexOf('/') + 1);
long repositoryId = repository.getId();
String branch = ref.startsWith("refs/heads/") ? ref.substring("refs/heads/".length()) : ref;
return new GitInfo(Optional.<Integer>absent(), host, organization, repositoryName, repositoryId, branch, active);
}
private static Set<String> affectedPaths(PushEvent pushEvent) {
Set<String> affectedPaths = new HashSet<>();
for (Commit commit : pushEvent.getCommitsList()) {
affectedPaths.addAll(commit.getAddedList());
affectedPaths.addAll(commit.getModifiedList());
affectedPaths.addAll(commit.getRemovedList());
}
return affectedPaths;
}
}
| [
"[email protected]"
] | |
ea86cfd21f795470ad82aabfca57c77891b05af5 | 81d61e58e813e2ea2cfa1ae1186fa2c103090804 | /core/target/generated-sources/messages/quickfix/field/EncodedIssuerLen.java | 19fd01d0ec437138a797b67211ccded1a5596d10 | [
"BSD-2-Clause"
] | permissive | donglinworld/simplefix | 125f421ce4371e31465359e936482b77ab7e7958 | 8d9ab9200d508ba1ca441a34a5b0748e6a8ef9f8 | refs/heads/master | 2022-07-15T13:54:06.988916 | 2019-10-24T12:39:12 | 2019-10-24T12:39:12 | 34,051,037 | 0 | 0 | NOASSERTION | 2022-06-29T15:51:14 | 2015-04-16T11:07:10 | Java | UTF-8 | Java | false | false | 1,128 | java | /*******************************************************************************
* Copyright (c) quickfixengine.org All rights reserved.
*
* This file is part of the QuickFIX FIX Engine
*
* This file may be distributed under the terms of the quickfixengine.org
* license as defined by quickfixengine.org and appearing in the file
* LICENSE included in the packaging of this file.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
* THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* See http://www.quickfixengine.org/LICENSE for licensing information.
*
* Contact [email protected] if any conditions of this licensing
* are not clear to you.
******************************************************************************/
package quickfix.field;
import quickfix.IntField;
public class EncodedIssuerLen extends IntField {
static final long serialVersionUID = 20050617;
public static final int FIELD = 348;
public EncodedIssuerLen() {
super(348);
}
public EncodedIssuerLen(int data) {
super(348, data);
}
}
| [
"[email protected]@b05cb261-0605-1b5b-92d6-37ff6522ea18"
] | [email protected]@b05cb261-0605-1b5b-92d6-37ff6522ea18 |
fbba2b628d60914b7ae4dde43e60d290e50e11e7 | a798095e635f65d2dbd7d66d505b125382237da8 | /.metadata/.plugins/org.eclipse.wst.server.core/tmp1/work/Catalina/localhost/sample-web/org/apache/jsp/header_jsp.java | 580cbd15a65934847747572105b1ec301b67ac35 | [] | no_license | hiranatsu/MyECsite | 1014f5f85c2bda5acc126b2f6926b27526c17999 | ad196af46f476273da3b61380534a073acb0f660 | refs/heads/master | 2020-03-30T00:19:44.665714 | 2018-11-12T02:00:59 | 2018-11-12T02:00:59 | 150,516,861 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 39,988 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/8.0.32
* Generated at: 2018-09-27 05:12:17 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class header_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent,
org.apache.jasper.runtime.JspSourceImports {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
static {
_jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(4);
_jspx_dependants.put("jar:file:/C:/Users/internousdev/Desktop/workspace/workspace-hirano/MyECsite/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/sample-web/WEB-INF/lib/standard.jar!/META-INF/c.tld", Long.valueOf(1098678690000L));
_jspx_dependants.put("/WEB-INF/lib/standard.jar", Long.valueOf(1538015366182L));
_jspx_dependants.put("jar:file:/C:/Users/internousdev/Desktop/workspace/workspace-hirano/MyECsite/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/sample-web/WEB-INF/lib/struts2-core-2.3.32.jar!/META-INF/struts-tags.tld", Long.valueOf(1488769580000L));
_jspx_dependants.put("/WEB-INF/lib/struts2-core-2.3.32.jar", Long.valueOf(1538015366191L));
}
private static final java.util.Set<java.lang.String> _jspx_imports_packages;
private static final java.util.Set<java.lang.String> _jspx_imports_classes;
static {
_jspx_imports_packages = new java.util.HashSet<>();
_jspx_imports_packages.add("javax.servlet");
_jspx_imports_packages.add("javax.servlet.http");
_jspx_imports_packages.add("javax.servlet.jsp");
_jspx_imports_classes = null;
}
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fform_0026_005fname_005fid;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fif_0026_005ftest;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fselect_0026_005fname_005flistValue_005flistKey_005flist_005fid_005fclass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005ftextfield_0026_005fplaceholder_005fname_005fclass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005felse;
private volatile javax.el.ExpressionFactory _el_expressionfactory;
private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public java.util.Set<java.lang.String> getPackageImports() {
return _jspx_imports_packages;
}
public java.util.Set<java.lang.String> getClassImports() {
return _jspx_imports_classes;
}
public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
if (_el_expressionfactory == null) {
synchronized (this) {
if (_el_expressionfactory == null) {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
}
}
}
return _el_expressionfactory;
}
public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
if (_jsp_instancemanager == null) {
synchronized (this) {
if (_jsp_instancemanager == null) {
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
}
}
return _jsp_instancemanager;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fs_005fform_0026_005fname_005fid = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fselect_0026_005fname_005flistValue_005flistKey_005flist_005fid_005fclass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005fplaceholder_005fname_005fclass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005felse = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fs_005fform_0026_005fname_005fid.release();
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.release();
_005fjspx_005ftagPool_005fs_005fselect_0026_005fname_005flistValue_005flistKey_005flist_005fid_005fclass_005fnobody.release();
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005fplaceholder_005fname_005fclass_005fnobody.release();
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.release();
_005fjspx_005ftagPool_005fs_005felse.release();
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final java.lang.String _jspx_method = request.getMethod();
if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD");
return;
}
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE html>\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta charset=\"UTF-8\">\r\n");
out.write("<!-- <link rel=\"stylesheet\" href=\"./css/style.css\"> -->\r\n");
out.write("<title>ヘッダー</title>\r\n");
out.write("<script>\r\n");
out.write("function goLoginAction(){\r\n");
out.write("\tdocument.getElementById(\"form\").action=\"GoLoginAction\";\r\n");
out.write("}\r\n");
out.write("function goMyPageAction(){\r\n");
out.write("\tdocument.getElementById(\"form\").action=\"MyPageAction\";\r\n");
out.write("}\r\n");
out.write("function goCartAction(){\r\n");
out.write("\tdocument.getElementById(\"form\").action=\"CartAction\";\r\n");
out.write("}\r\n");
out.write("function goProductListAction(){\r\n");
out.write("\tdocument.getElementById(\"categoryId\").value=1;\r\n");
out.write("\tdocument.getElementById(\"form\").action=\"ProductListAction\";\r\n");
out.write("}\r\n");
out.write("function goLogoutAction(){\r\n");
out.write("\tdocument.getElementById(\"form\").action=\"LogoutAction\";\r\n");
out.write("}\r\n");
out.write("function goSearchItemAction(){\r\n");
out.write("\tdocument.getElementById(\"form\").action=\"SearchItemAction\";\r\n");
out.write("}\r\n");
out.write("</script>\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
out.write("<header>\r\n");
out.write("<div id=\"header\">\r\n");
out.write("<div id=\"header-title\">\r\n");
out.write("Sample Web\r\n");
out.write("</div>\r\n");
out.write("<div id=\"header-menu\">\r\n");
out.write("<ul>\r\n");
if (_jspx_meth_s_005fform_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("</ul>\r\n");
out.write("</div>\r\n");
out.write("</div>\r\n");
out.write("</header>\r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_s_005fform_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:form
org.apache.struts2.views.jsp.ui.FormTag _jspx_th_s_005fform_005f0 = (org.apache.struts2.views.jsp.ui.FormTag) _005fjspx_005ftagPool_005fs_005fform_0026_005fname_005fid.get(org.apache.struts2.views.jsp.ui.FormTag.class);
_jspx_th_s_005fform_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fform_005f0.setParent(null);
// /header.jsp(41,0) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fform_005f0.setId("form");
// /header.jsp(41,0) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fform_005f0.setName("form");
int _jspx_eval_s_005fform_005f0 = _jspx_th_s_005fform_005f0.doStartTag();
if (_jspx_eval_s_005fform_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fform_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fform_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fform_005f0.doInitBody();
}
do {
out.write('\r');
out.write('\n');
out.write(' ');
if (_jspx_meth_s_005fif_005f0(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t<li>");
if (_jspx_meth_s_005ftextfield_005f0(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("</li>\r\n");
out.write("\t<li>");
if (_jspx_meth_s_005fsubmit_005f0(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("<li>\r\n");
out.write("\t");
if (_jspx_meth_s_005fif_005f1(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write('\r');
out.write('\n');
out.write(' ');
if (_jspx_meth_s_005felse_005f0(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t<li>");
if (_jspx_meth_s_005fsubmit_005f3(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("<li>\r\n");
out.write("\t<li>");
if (_jspx_meth_s_005fsubmit_005f4(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("</li>\r\n");
out.write("\t");
if (_jspx_meth_s_005fif_005f2(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write('\r');
out.write('\n');
int evalDoAfterBody = _jspx_th_s_005fform_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fform_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fform_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fform_0026_005fname_005fid.reuse(_jspx_th_s_005fform_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fform_0026_005fname_005fid.reuse(_jspx_th_s_005fform_005f0);
return false;
}
private boolean _jspx_meth_s_005fif_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:if
org.apache.struts2.views.jsp.IfTag _jspx_th_s_005fif_005f0 = (org.apache.struts2.views.jsp.IfTag) _005fjspx_005ftagPool_005fs_005fif_0026_005ftest.get(org.apache.struts2.views.jsp.IfTag.class);
_jspx_th_s_005fif_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fif_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /header.jsp(42,1) name = test type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fif_005f0.setTest("#session.containsKey(\"mCategoryDtoList\")");
int _jspx_eval_s_005fif_005f0 = _jspx_th_s_005fif_005f0.doStartTag();
if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fif_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fif_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write("\t<li>");
if (_jspx_meth_s_005fselect_005f0(_jspx_th_s_005fif_005f0, _jspx_page_context))
return true;
out.write("</li>\r\n");
out.write("\t");
int evalDoAfterBody = _jspx_th_s_005fif_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f0);
return false;
}
private boolean _jspx_meth_s_005fselect_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fif_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:select
org.apache.struts2.views.jsp.ui.SelectTag _jspx_th_s_005fselect_005f0 = (org.apache.struts2.views.jsp.ui.SelectTag) _005fjspx_005ftagPool_005fs_005fselect_0026_005fname_005flistValue_005flistKey_005flist_005fid_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.SelectTag.class);
_jspx_th_s_005fselect_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fselect_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fif_005f0);
// /header.jsp(43,5) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setName("categoryId");
// /header.jsp(43,5) name = list type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setList("#session.mCategoryDtoList");
// /header.jsp(43,5) name = listValue type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setListValue("categoryName");
// /header.jsp(43,5) name = listKey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setListKey("categoryId");
// /header.jsp(43,5) name = class type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setCssClass("cs-div");
// /header.jsp(43,5) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setId("categoryId");
int _jspx_eval_s_005fselect_005f0 = _jspx_th_s_005fselect_005f0.doStartTag();
if (_jspx_th_s_005fselect_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fselect_0026_005fname_005flistValue_005flistKey_005flist_005fid_005fclass_005fnobody.reuse(_jspx_th_s_005fselect_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fselect_0026_005fname_005flistValue_005flistKey_005flist_005fid_005fclass_005fnobody.reuse(_jspx_th_s_005fselect_005f0);
return false;
}
private boolean _jspx_meth_s_005ftextfield_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:textfield
org.apache.struts2.views.jsp.ui.TextFieldTag _jspx_th_s_005ftextfield_005f0 = (org.apache.struts2.views.jsp.ui.TextFieldTag) _005fjspx_005ftagPool_005fs_005ftextfield_0026_005fplaceholder_005fname_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.TextFieldTag.class);
_jspx_th_s_005ftextfield_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005ftextfield_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /header.jsp(45,5) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005ftextfield_005f0.setName("keywords");
// /header.jsp(45,5) name = class type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005ftextfield_005f0.setCssClass("txt-keywords");
// /header.jsp(45,5) null
_jspx_th_s_005ftextfield_005f0.setDynamicAttribute(null, "placeholder", "検索ワード");
int _jspx_eval_s_005ftextfield_005f0 = _jspx_th_s_005ftextfield_005f0.doStartTag();
if (_jspx_th_s_005ftextfield_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005fplaceholder_005fname_005fclass_005fnobody.reuse(_jspx_th_s_005ftextfield_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005fplaceholder_005fname_005fclass_005fnobody.reuse(_jspx_th_s_005ftextfield_005f0);
return false;
}
private boolean _jspx_meth_s_005fsubmit_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:submit
org.apache.struts2.views.jsp.ui.SubmitTag _jspx_th_s_005fsubmit_005f0 = (org.apache.struts2.views.jsp.ui.SubmitTag) _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.SubmitTag.class);
_jspx_th_s_005fsubmit_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fsubmit_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /header.jsp(46,5) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f0.setValue("商品検索");
// /header.jsp(46,5) name = class type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f0.setCssClass("submit_btn");
// /header.jsp(46,5) name = onclick type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f0.setOnclick("goSearchItemAction();");
int _jspx_eval_s_005fsubmit_005f0 = _jspx_th_s_005fsubmit_005f0.doStartTag();
if (_jspx_th_s_005fsubmit_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f0);
return false;
}
private boolean _jspx_meth_s_005fif_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:if
org.apache.struts2.views.jsp.IfTag _jspx_th_s_005fif_005f1 = (org.apache.struts2.views.jsp.IfTag) _005fjspx_005ftagPool_005fs_005fif_0026_005ftest.get(org.apache.struts2.views.jsp.IfTag.class);
_jspx_th_s_005fif_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005fif_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /header.jsp(47,1) name = test type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fif_005f1.setTest("#session.logined==1");
int _jspx_eval_s_005fif_005f1 = _jspx_th_s_005fif_005f1.doStartTag();
if (_jspx_eval_s_005fif_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fif_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fif_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fif_005f1.doInitBody();
}
do {
out.write("\r\n");
out.write("\t<li>");
if (_jspx_meth_s_005fsubmit_005f1(_jspx_th_s_005fif_005f1, _jspx_page_context))
return true;
out.write("</li>\r\n");
out.write("\t");
int evalDoAfterBody = _jspx_th_s_005fif_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fif_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fif_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f1);
return false;
}
private boolean _jspx_meth_s_005fsubmit_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fif_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:submit
org.apache.struts2.views.jsp.ui.SubmitTag _jspx_th_s_005fsubmit_005f1 = (org.apache.struts2.views.jsp.ui.SubmitTag) _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.SubmitTag.class);
_jspx_th_s_005fsubmit_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005fsubmit_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fif_005f1);
// /header.jsp(48,5) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f1.setValue("ログアウト");
// /header.jsp(48,5) name = class type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f1.setCssClass("submit_btn");
// /header.jsp(48,5) name = onclick type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f1.setOnclick("goLogoutAction();");
int _jspx_eval_s_005fsubmit_005f1 = _jspx_th_s_005fsubmit_005f1.doStartTag();
if (_jspx_th_s_005fsubmit_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f1);
return false;
}
private boolean _jspx_meth_s_005felse_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:else
org.apache.struts2.views.jsp.ElseTag _jspx_th_s_005felse_005f0 = (org.apache.struts2.views.jsp.ElseTag) _005fjspx_005ftagPool_005fs_005felse.get(org.apache.struts2.views.jsp.ElseTag.class);
_jspx_th_s_005felse_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005felse_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
int _jspx_eval_s_005felse_005f0 = _jspx_th_s_005felse_005f0.doStartTag();
if (_jspx_eval_s_005felse_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005felse_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005felse_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005felse_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t<li>");
if (_jspx_meth_s_005fsubmit_005f2(_jspx_th_s_005felse_005f0, _jspx_page_context))
return true;
out.write("</li>\r\n");
out.write("\t");
int evalDoAfterBody = _jspx_th_s_005felse_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005felse_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005felse_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005felse.reuse(_jspx_th_s_005felse_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005felse.reuse(_jspx_th_s_005felse_005f0);
return false;
}
private boolean _jspx_meth_s_005fsubmit_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005felse_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:submit
org.apache.struts2.views.jsp.ui.SubmitTag _jspx_th_s_005fsubmit_005f2 = (org.apache.struts2.views.jsp.ui.SubmitTag) _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.SubmitTag.class);
_jspx_th_s_005fsubmit_005f2.setPageContext(_jspx_page_context);
_jspx_th_s_005fsubmit_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005felse_005f0);
// /header.jsp(51,6) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f2.setValue("ログイン");
// /header.jsp(51,6) name = class type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f2.setCssClass("submit_btn");
// /header.jsp(51,6) name = onclick type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f2.setOnclick("goLoginAction();");
int _jspx_eval_s_005fsubmit_005f2 = _jspx_th_s_005fsubmit_005f2.doStartTag();
if (_jspx_th_s_005fsubmit_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f2);
return true;
}
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f2);
return false;
}
private boolean _jspx_meth_s_005fsubmit_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:submit
org.apache.struts2.views.jsp.ui.SubmitTag _jspx_th_s_005fsubmit_005f3 = (org.apache.struts2.views.jsp.ui.SubmitTag) _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.SubmitTag.class);
_jspx_th_s_005fsubmit_005f3.setPageContext(_jspx_page_context);
_jspx_th_s_005fsubmit_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /header.jsp(53,5) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f3.setValue("カート");
// /header.jsp(53,5) name = class type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f3.setCssClass("submit_btn");
// /header.jsp(53,5) name = onclick type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f3.setOnclick("goCartAction();");
int _jspx_eval_s_005fsubmit_005f3 = _jspx_th_s_005fsubmit_005f3.doStartTag();
if (_jspx_th_s_005fsubmit_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f3);
return true;
}
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f3);
return false;
}
private boolean _jspx_meth_s_005fsubmit_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:submit
org.apache.struts2.views.jsp.ui.SubmitTag _jspx_th_s_005fsubmit_005f4 = (org.apache.struts2.views.jsp.ui.SubmitTag) _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.SubmitTag.class);
_jspx_th_s_005fsubmit_005f4.setPageContext(_jspx_page_context);
_jspx_th_s_005fsubmit_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /header.jsp(54,5) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f4.setValue("商品一覧");
// /header.jsp(54,5) name = class type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f4.setCssClass("submit_btn");
// /header.jsp(54,5) name = onclick type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f4.setOnclick("goProductListAction();");
int _jspx_eval_s_005fsubmit_005f4 = _jspx_th_s_005fsubmit_005f4.doStartTag();
if (_jspx_th_s_005fsubmit_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f4);
return true;
}
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f4);
return false;
}
private boolean _jspx_meth_s_005fif_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:if
org.apache.struts2.views.jsp.IfTag _jspx_th_s_005fif_005f2 = (org.apache.struts2.views.jsp.IfTag) _005fjspx_005ftagPool_005fs_005fif_0026_005ftest.get(org.apache.struts2.views.jsp.IfTag.class);
_jspx_th_s_005fif_005f2.setPageContext(_jspx_page_context);
_jspx_th_s_005fif_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /header.jsp(55,1) name = test type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fif_005f2.setTest("#session.logined==1");
int _jspx_eval_s_005fif_005f2 = _jspx_th_s_005fif_005f2.doStartTag();
if (_jspx_eval_s_005fif_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fif_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fif_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fif_005f2.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t<li>");
if (_jspx_meth_s_005fsubmit_005f5(_jspx_th_s_005fif_005f2, _jspx_page_context))
return true;
out.write("</li>\r\n");
out.write("\t");
int evalDoAfterBody = _jspx_th_s_005fif_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fif_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fif_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f2);
return true;
}
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f2);
return false;
}
private boolean _jspx_meth_s_005fsubmit_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fif_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:submit
org.apache.struts2.views.jsp.ui.SubmitTag _jspx_th_s_005fsubmit_005f5 = (org.apache.struts2.views.jsp.ui.SubmitTag) _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.SubmitTag.class);
_jspx_th_s_005fsubmit_005f5.setPageContext(_jspx_page_context);
_jspx_th_s_005fsubmit_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fif_005f2);
// /header.jsp(56,6) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f5.setValue("マイページ");
// /header.jsp(56,6) name = class type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f5.setCssClass("submit_btn");
// /header.jsp(56,6) name = onclick type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f5.setOnclick("goMyPageAction();");
int _jspx_eval_s_005fsubmit_005f5 = _jspx_th_s_005fsubmit_005f5.doStartTag();
if (_jspx_th_s_005fsubmit_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f5);
return true;
}
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fonclick_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f5);
return false;
}
}
| [
"[email protected]"
] | |
e8b92ee604dbe65eaca63a21185fd4144ebfbd24 | 71cd378e7e25ab2385a1d77d55b669e7c9f22889 | /src/zen/codegen/jvm/JavaMethodTable.java | c16bd11e40db08d3a15d2b8dbe4723e631558a01 | [
"BSD-3-Clause"
] | permissive | tsuji213/libzen | a2bdde5628223b8b1032aefb2e78c26b46406749 | 260a917f7dfdb719e1d9b3e31d1f08b138f93e8d | refs/heads/master | 2020-04-05T19:03:59.605614 | 2014-02-04T00:41:16 | 2014-02-04T00:41:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,106 | java | // ***************************************************************************
// Copyright (c) 2013, JST/CREST DEOS project authors. 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.
//
// 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 HOLDER 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 zen.codegen.jvm;
import java.lang.reflect.Method;
import java.util.HashMap;
import zen.type.ZType;
import zen.type.ZTypePool;
public class JavaMethodTable {
static HashMap<String, Method> MethodMap = new HashMap<String,Method>();
static {
Import("!", ZType.VarType, OpApi.class, "Not");
Import("+", ZType.VarType, OpApi.class, "Plus");
Import("-", ZType.VarType, OpApi.class, "Minus");
Import("~", ZType.VarType, OpApi.class, "BitwiseNot");
Import(ZType.VarType, "+", ZType.VarType, OpApi.class, "Add");
Import(ZType.VarType, "-", ZType.VarType, OpApi.class, "Sub");
Import(ZType.VarType, "*", ZType.VarType, OpApi.class, "Mul");
Import(ZType.VarType, "/", ZType.VarType, OpApi.class, "Div");
Import(ZType.VarType, "%", ZType.VarType, OpApi.class, "Mod");
Import(ZType.VarType, "==", ZType.VarType, OpApi.class, "Equals");
Import(ZType.VarType, "!=", ZType.VarType, OpApi.class, "NotEquals");
Import(ZType.VarType, "<", ZType.VarType, OpApi.class, "LessThan");
Import(ZType.VarType, "<=", ZType.VarType, OpApi.class, "LessThanEquals");
Import(ZType.VarType, ">", ZType.VarType, OpApi.class, "GreaterThan");
Import(ZType.VarType, ">=", ZType.VarType, OpApi.class, "GreaterThanEquals");
Import(ZType.VarType, "&", ZType.VarType, OpApi.class, "BitwiseAnd");
Import(ZType.VarType, "|", ZType.VarType, OpApi.class, "BitwiseOr");
Import(ZType.VarType, "^", ZType.VarType, OpApi.class, "BitwiseXor");
Import(ZType.VarType, "<<", ZType.VarType, OpApi.class, "LeftShift");
Import(ZType.VarType, ">>", ZType.VarType, OpApi.class, "RightShift");
Import("!", ZType.BooleanType, OpApi.class, "Not");
Import("+", ZType.IntType, OpApi.class, "Plus");
Import("-", ZType.IntType, OpApi.class, "Minus");
Import("~", ZType.IntType, OpApi.class, "BitwiseNot");
Import(ZType.IntType, "+", ZType.IntType, OpApi.class, "Add");
Import(ZType.IntType, "-", ZType.IntType, OpApi.class, "Sub");
Import(ZType.IntType, "*", ZType.IntType, OpApi.class, "Mul");
Import(ZType.IntType, "/", ZType.IntType, OpApi.class, "Div");
Import(ZType.IntType, "%", ZType.IntType, OpApi.class, "Mod");
Import(ZType.IntType, "==", ZType.IntType, OpApi.class, "Equals");
Import(ZType.IntType, "!=", ZType.IntType, OpApi.class, "NotEquals");
Import(ZType.IntType, "<", ZType.IntType, OpApi.class, "LessThan");
Import(ZType.IntType, "<=", ZType.IntType, OpApi.class, "LessThanEquals");
Import(ZType.IntType, ">", ZType.IntType, OpApi.class, "GreaterThan");
Import(ZType.IntType, ">=", ZType.IntType, OpApi.class, "GreaterThanEquals");
Import(ZType.IntType, "&", ZType.IntType, OpApi.class, "BitwiseAnd");
Import(ZType.IntType, "|", ZType.IntType, OpApi.class, "BitwiseOr");
Import(ZType.IntType, "^", ZType.IntType, OpApi.class, "BitwiseXor");
Import(ZType.IntType, "<<", ZType.IntType, OpApi.class, "LeftShift");
Import(ZType.IntType, ">>", ZType.IntType, OpApi.class, "RightShift");
Import("+", ZType.FloatType, OpApi.class, "Plus");
Import("-", ZType.FloatType, OpApi.class, "Minus");
Import(ZType.FloatType, "+", ZType.FloatType, OpApi.class, "Add");
Import(ZType.FloatType, "-", ZType.FloatType, OpApi.class, "Sub");
Import(ZType.FloatType, "*", ZType.FloatType, OpApi.class, "Mul");
Import(ZType.FloatType, "/", ZType.FloatType, OpApi.class, "Div");
Import(ZType.FloatType, "%", ZType.FloatType, OpApi.class, "Mod");
Import(ZType.FloatType, "==", ZType.FloatType, OpApi.class, "Equals");
Import(ZType.FloatType, "!=", ZType.FloatType, OpApi.class, "NotEquals");
Import(ZType.FloatType, "<", ZType.FloatType, OpApi.class, "LessThan");
Import(ZType.FloatType, "<=", ZType.FloatType, OpApi.class, "LessThanEquals");
Import(ZType.FloatType, ">", ZType.FloatType, OpApi.class, "GreaterThan");
Import(ZType.FloatType, ">=", ZType.FloatType, OpApi.class, "GreaterThanEquals");
Import(ZType.StringType, "+", ZType.StringType, OpApi.class, "Add");
Import(ZType.StringType, "==", ZType.StringType, OpApi.class, "Equals");
Import(ZType.StringType, "!=", ZType.StringType, OpApi.class, "NotEquals");
Import(ZType.StringType, "[]", ZType.IntType, OpApi.class, "GetIndex");
ZType IntArrayType = ZTypePool.GetGenericType1(ZType.ArrayType, ZType.IntType);
ZType FloatArrayType = ZTypePool.GetGenericType1(ZType.ArrayType, ZType.FloatType);
ZType StringArrayType = ZTypePool.GetGenericType1(ZType.ArrayType, ZType.StringType);
Import(ZType.ArrayType, "[]", ZType.IntType, zen.deps.ZenObjectArray.class, "GetIndex");
Import(ZType.ArrayType, "[]=", ZType.IntType, zen.deps.ZenObjectArray.class, "SetIndex", Object.class);
Import(IntArrayType, "[]", ZType.IntType, zen.deps.ZenIntArray.class, "GetIndex");
Import(IntArrayType, "[]=", ZType.IntType, zen.deps.ZenIntArray.class, "SetIndex", long.class);
Import(FloatArrayType, "[]", ZType.IntType, zen.deps.ZenFloatArray.class, "GetIndex");
Import(FloatArrayType, "[]=", ZType.IntType, zen.deps.ZenFloatArray.class, "SetIndex", double.class);
Import(StringArrayType, "[]", ZType.IntType, zen.deps.ZenStringArray.class, "GetIndex");
Import(StringArrayType, "[]=", ZType.IntType, zen.deps.ZenStringArray.class, "SetIndex", String.class);
Import(boolean.class, CastApi.class, "toObject");
Import(byte.class, CastApi.class, "toObject");
Import(short.class, CastApi.class, "toObject");
Import(int.class, CastApi.class, "toObject");
Import(long.class, CastApi.class, "toObject");
Import(float.class, CastApi.class, "toObject");
Import(double.class, CastApi.class, "toObject");
Import(Object.class, CastApi.class, "toboolean");
Import(Boolean.class, CastApi.class, "toboolean");
Import(Object.class, CastApi.class, "tobyte");
Import(long.class, CastApi.class, "tobyte");
Import(Object.class, CastApi.class, "toshort");
Import(long.class, CastApi.class, "toshort");
Import(Object.class, CastApi.class, "toint");
Import(long.class, CastApi.class, "toint");
Import(Object.class, CastApi.class, "tolong");
Import(byte.class, CastApi.class, "tolong");
Import(short.class, CastApi.class, "tolong");
Import(int.class, CastApi.class, "tolong");
Import(double.class, CastApi.class, "tolong");
Import(Byte.class, CastApi.class, "tolong");
Import(Short.class, CastApi.class, "tolong");
Import(Integer.class, CastApi.class, "tolong");
Import(Long.class, CastApi.class, "tolong");
Import(Object.class, CastApi.class, "tofloat");
Import(double.class, CastApi.class, "tofloat");
Import(Object.class, CastApi.class, "todouble");
Import(long.class, CastApi.class, "todouble");
Import(float.class, CastApi.class, "todouble");
Import(Float.class, CastApi.class, "todouble");
Import(Double.class, CastApi.class, "todouble");
Import(Object.class, CastApi.class, "toBoolean");
Import(boolean.class, CastApi.class, "toBoolean");
Import(Object.class, CastApi.class, "toByte");
Import(long.class, CastApi.class, "toByte");
Import(Object.class, CastApi.class, "toShort");
Import(long.class, CastApi.class, "toShort");
Import(Object.class, CastApi.class, "toInteger");
Import(long.class, CastApi.class, "toInteger");
Import(Object.class, CastApi.class, "toLong");
Import(byte.class, CastApi.class, "toLong");
Import(short.class, CastApi.class, "toLong");
Import(int.class, CastApi.class, "toLong");
Import(long.class, CastApi.class, "toLong");
Import(Object.class, CastApi.class, "toFloat");
Import(double.class, CastApi.class, "toFloat");
Import(Object.class, CastApi.class, "toDouble");
Import(double.class, CastApi.class, "toDouble");
Import(OpApi.class, "ThrowError", String.class);
Import(OpApi.class, "GetField", Object.class, String.class);
Import(OpApi.class, "SetField", Object.class, String.class, Object.class);
Import(OpApi.class, "InvokeUnresolvedMethod", Object.class, String.class, Object[].class);
}
static void Import(Class<?> BaseClass, String Name, Class<?> ... T1) {
try {
Method sMethod = BaseClass.getMethod(Name, T1);
MethodMap.put(Name, sMethod);
} catch (Exception e) {
System.err.println("FIXME:" + e);
}
}
static String BinaryKey(ZType T1, String Op, ZType T2) {
return T1.GetUniqueName()+Op+T2.GetUniqueName();
}
static String UnaryKey(String Op, ZType T2) {
return Op+T2.GetUniqueName();
}
static String CastKey(Class<?> T1, Class<?> T2) {
return T1.getCanonicalName() + ":" + T2.getCanonicalName();
}
static void Import(ZType T1, String Op, ZType T2, Class<?> BaseClass, String Name) {
try {
Method sMethod = BaseClass.getMethod(Name, JavaTypeTable.GetJavaClass(T1, null), JavaTypeTable.GetJavaClass(T2, null));
MethodMap.put(BinaryKey(T1, Op, T2), sMethod);
} catch (Exception e) {
System.err.println("FIXME:" + e);
}
}
static void Import(ZType T1, String Op, ZType T2, Class<?> BaseClass, String Name, Class<?> T3) {
try {
Method sMethod = BaseClass.getMethod(Name, JavaTypeTable.GetJavaClass(T1, null), JavaTypeTable.GetJavaClass(T2, null), T3);
MethodMap.put(BinaryKey(T1, Op, T2), sMethod);
} catch (Exception e) {
System.err.println("FIXME:" + e);
}
}
static void Import(String Op, ZType T1, Class<?> BaseClass, String Name) {
try {
Method sMethod = BaseClass.getMethod(Name, JavaTypeTable.GetJavaClass(T1, null));
MethodMap.put(UnaryKey(Op, T1), sMethod);
} catch (Exception e) {
System.err.println("FIXME:" + e);
}
}
static void Import(Class<?> T1, Class<?> BaseClass, String Name) {
try {
Method sMethod = BaseClass.getMethod(Name, T1);
MethodMap.put(CastKey(sMethod.getReturnType(), T1), sMethod);
} catch (Exception e) {
System.err.println("FIXME:" + e);
}
}
public static Method GetStaticMethod(String Name) {
return MethodMap.get(Name);
}
public static Method GetBinaryStaticMethod(ZType T1, String Op, ZType T2) {
Method sMethod = MethodMap.get(BinaryKey(T1, Op, T2));
if(sMethod == null) {
// if undefined Object "op" Object must be default
sMethod = MethodMap.get(BinaryKey(ZType.VarType, Op, ZType.VarType));
}
return sMethod;
}
public static Method GetUnaryStaticMethod(String Op, ZType T2) {
Method sMethod = MethodMap.get(UnaryKey(Op, T2));
if(sMethod == null) {
// if undefined Object "op" Object must be default
sMethod = MethodMap.get(UnaryKey(Op, ZType.VarType));
}
return sMethod;
}
public static Method GetCastMethod(Class<?> T1, Class<?> T2) {
Method sMethod = MethodMap.get(CastKey(T1, T2));
if(sMethod == null) {
// if undefined Object "op" Object must be default
sMethod = MethodMap.get(CastKey(Object.class, T2));
}
return sMethod;
}
}
| [
"[email protected]"
] | |
c5c2a0e4c5fe4bae15bbe7dea9be40db5da62e8c | d0c59d0b628e356f7e32ac651eec202fef8dcf2d | /FRAMEWORKS_E_BIBLIOTECAS/spring-boot/estudo/src/main/java/com/springboot/estudo/datastore/repository/PessoaRepository.java | a65072a37208f7ba794e9863fcfd790bd91bc420 | [] | no_license | ct-Daniel/MAP_TECH_LEARNING | d15e8be3931848d1c968aac0a10408a37618f480 | 3280de4e5a4a2a3eed5fe30e3c9209f4bd4c9a0d | refs/heads/main | 2023-08-05T13:26:05.073263 | 2021-09-16T12:20:55 | 2021-09-16T12:20:55 | 392,149,963 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,010 | java | package com.springboot.estudo.datastore.repository;
import com.springboot.estudo.datastore.entity.PessoaEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.Collection;
import java.util.List;
public interface PessoaRepository extends JpaRepository<PessoaEntity, Long>, JpaSpecificationExecutor<PessoaEntity> {
@Query(value = "SELECT (*) FROM Pessoa WHERE NOME = ?1", nativeQuery = true)
List<PessoaEntity> buscar_todas_pessoas(String nome);
@Override
Page<PessoaEntity> findAll(Pageable page);
@Override
List<PessoaEntity> findAll();
// Classificação/Sort
@Override
List<PessoaEntity> findAll(Sort sort);
}
| [
"[email protected]"
] | |
0e878fc8d601c0ab0791262697c4f1f41a865272 | 76ffd931875b8b88b6df27e6c1a5c5ce930d0183 | /src/test/java/ru/netology/stats/StatsServiceTest.java | c55cdc5d0fb8294901a3d846e34f5f06db562a36 | [] | no_license | nikola4468/java-homeworks-2.4.1 | 50b5a9f27b21ce802793575c4a46f4efa6e17c8f | e2dc0ded70bbf30df79491ea61bdbb18e45fbf41 | refs/heads/master | 2023-08-28T07:41:52.625995 | 2021-09-05T13:09:04 | 2021-09-05T13:09:04 | 403,086,759 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | package ru.netology.stats;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class StatsServiceTest {
long[] sales = {8, 15, 13, 15, 17, 20, 19, 20, 7, 14, 14, 18};
@Test
void shouldSumAllSales() {
StatsService service = new StatsService();
int expected = 180;
long actual = service.sumAllSales(sales) ;
assertEquals(expected, actual);
}
@Test
void shouldAverageSales() {
StatsService service = new StatsService();
int expected = 15;
long actual = service.averageSales(sales) ;
assertEquals(expected, actual);
}
@Test
void shouldMaxSales() {
StatsService service = new StatsService();
int expected = 8;
long actual = service.maxSales(sales) ;
assertEquals(expected, actual);
}
@Test
void shouldMinSales() {
StatsService service = new StatsService();
int expected = 9;
long actual = service.minSales(sales) ;
assertEquals(expected, actual);
}
@Test
void shouldSumMonthsAboveAverageSales() {
StatsService service = new StatsService();
int expected = 5;
long actual = service.sumMonthsAboveAverageSales(sales) ;
assertEquals(expected, actual);
}
@Test
void shouldSumMonthsBelowAverageSales() {
StatsService service = new StatsService();
int expected = 5;
long actual = service.sumMonthsBelowAverageSales(sales) ;
assertEquals(expected, actual);
}
} | [
"[email protected]"
] | |
4d619db0cc1379a4a3049d5f4cd2dfb75f6a5a4d | b6b1e5459f8a41b44f21bd83454fc94de8e1d47e | /app/src/androidTest/java/com/example/presly/myintentfilterpractice/ExampleInstrumentedTest.java | f9434a6419718cc9740ed852a55a85dc6ff0a0b1 | [] | no_license | guyportoflio/MyIntentFilterPractice | 2fcc0c8caa8f545f4f33f7b7c854d3d008874440 | 82be5d878b0987bddb41072c0e790bba81988eab | refs/heads/master | 2020-03-27T12:03:45.545498 | 2018-08-29T00:35:11 | 2018-08-29T00:35:11 | 146,523,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 792 | java | package com.example.presly.myintentfilterpractice;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.presly.myintentfilterpractice", appContext.getPackageName());
}
}
| [
"guyportfolio32.gmail.com"
] | guyportfolio32.gmail.com |
686e16b21066e5ca047fd649b5cb6dfc3ead8305 | eab084584e34ec065cd115139c346180e651c1c2 | /src/main/java/v1/t500/T547.java | 91243a449c2bd07faef26c96873117f9d23a98f6 | [] | no_license | zhouyuan93/leetcode | 5396bd3a01ed0f127553e1e175bb1f725d1c7919 | cc247bc990ad4d5aa802fc7a18a38dd46ed40a7b | refs/heads/master | 2023-05-11T19:11:09.322348 | 2023-05-05T09:12:53 | 2023-05-05T09:12:53 | 197,735,845 | 0 | 0 | null | 2020-04-05T09:17:34 | 2019-07-19T08:38:17 | Java | UTF-8 | Java | false | false | 1,156 | java | package v1.t500;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
/**
* @author yuan.zhou
*/
public class T547 {
public int findCircleNum(int[][] isConnected) {
if (isConnected == null || isConnected.length == 0) {
return 0;
}
for (int y = 0; y < isConnected.length; y++) {
if (isConnected[y][y] == 0) {
continue;
}
isConnected[y][y] = -1;
for (int x = y + 1; x < isConnected[y].length; x++) {
if (isConnected[y][x] > 0) {
clean(isConnected, x);
}
}
}
int res = 0;
for (int y = 0; y < isConnected.length; y++) {
res -= isConnected[y][y];
}
return res;
}
public void clean(int[][] isConnected, int x) {
if (isConnected[x][x] == 0 || isConnected[x][x] == -1) {
return;
}
isConnected[x][x] = 0;
for (int i = 0; i < isConnected[x].length; i++) {
if (isConnected[x][i] > 0) {
clean(isConnected,i);
}
}
}
}
| [
"[email protected]"
] | |
27808277a92763ad6e558825d4b004919535a52c | a5d567e8d041500257e4308995cdae9a76a7b416 | /app/src/main/java/com/ginuo/leweather/util/HttpUtil.java | 2409a84188035561cee51c9ef834d5354900a9ef | [
"Apache-2.0"
] | permissive | Ginuo/LeWeather | aec087fdf20c1c57e589ae32d4401ce8b2dddf5e | 2d2c26e8993555047caf5c46101a55df3d2e664f | refs/heads/master | 2021-07-11T17:11:37.678570 | 2017-10-15T04:11:04 | 2017-10-15T04:11:04 | 106,974,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 520 | java | package com.ginuo.leweather.util;
import okhttp3.OkHttpClient;
import okhttp3.Request;
public class HttpUtil {
//没有返回值,但是传入了回调对象,相应结果在回调方法中处理
public static void sendOkHttpRequest(String address,okhttp3.Callback callback){
OkHttpClient client =new OkHttpClient();
//构造请求
Request request = new Request.Builder().url(address).build();
//加入发送队列
client.newCall(request).enqueue(callback);
}
}
| [
"[email protected]"
] | |
4a1bc9d69e25e3d4ba31e80bf407b40795fcb96d | c2562505632258f8ce46cfd063e8e54062c93420 | /hibernate_mapping/test/com/pugwoo/ExtendTest.java | f949e663b8b5d5879f1230e8d6d41ad516ffce51 | [] | no_license | BlowingExodus/j2ee | 3128cbd0213888ba2915e841ac2d83eda69a2094 | f5e114d3fa4fce23dc4265b77312d2011218b432 | refs/heads/master | 2020-07-29T09:35:20.530346 | 2016-01-05T05:52:23 | 2016-01-05T05:52:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 617 | java | package com.pugwoo;
import com.pugwoo.extend.A;
import com.pugwoo.extend.B;
import com.pugwoo.extend.Generic;
import hibernate.HibernateUtils;
import junit.framework.TestCase;
/**
* 2011年4月12日 下午01:16:30
*/
public class ExtendTest extends TestCase {
public void testSave(){
Generic g = new Generic();
g.setGeneric("generic");
A a = new A();
a.setGeneric("a_gen");
a.setA("a");
B b = new B();
b.setGeneric("b_gen");
b.setB("b");
HibernateUtils.save(g);
HibernateUtils.save(a);
HibernateUtils.save(b);
HibernateUtils.commit();
}
}
| [
"[email protected]"
] | |
90a5f8002e8af93ecc6055d17e969f68969d386a | 00d8c180f76d64886ef9931a7758b33059f05542 | /app/src/main/java/com/i3020/mvpdemo01/viewpresenter/main/MainPresenter.java | 730bd2aa6ac02b26e0d6d2b435fb8daf08cc29e1 | [] | no_license | HeJinliang/MerchantMvp | 446f5c6940f83569410963b4ae2f8d7293f3f211 | 68264058b53c722226f183856e318492020780aa | refs/heads/master | 2020-04-01T23:22:08.009122 | 2018-10-19T08:57:19 | 2018-10-19T08:57:19 | 153,754,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package com.i3020.mvpdemo01.viewpresenter.main;
import android.content.Context;
/**
* decribe:
* create by HeJinliang on 2018/8/16
*/
public class MainPresenter extends MainContract.AbstractPresenter {
MainPresenter(Context mContext) {
super(mContext);
}
@Override
protected void init() {
}
@Override
public void loadData() {
}
}
| [
"[email protected]"
] | |
9bee034fd21de63d8fd575abf32436a48f553d38 | 048981c3b5f706d940d27f5effe53055eeaac5a0 | /DartEarth/src/org/gfg/dartearth/feature/goTo/GoToPanelDialog.java | 5cfbd14c416da2b3d374f61a5011a30c12caaa8a | [] | no_license | syzh1991/DigitalEarth | cc53dc4f2142f27aee92a89bdab280175743aae8 | 98f2566b176f6be82e8be55e0af6d9ad090008d7 | refs/heads/master | 2021-01-10T02:47:18.163279 | 2016-01-27T07:14:58 | 2016-01-27T07:14:58 | 50,475,400 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,963 | java | package org.gfg.dartearth.feature.goTo;
import gov.nasa.worldwind.WorldWindow;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;
import javax.swing.JDialog;
import org.gfg.dartearth.core.DartEarthAppFrame;
import com.sun.awt.AWTUtilities;
/**
* 图层对话框
*
* @author 江琳<br>
* [email protected]
*
*/
public class GoToPanelDialog extends JDialog {
private String DEFAULT_TITLE = "前往";
private int DEFAULT_WIDTH = 520;
private int DEFAULT_HEIGHT = 690;
private int DEFAULT_X_OFFSET = 32;
private int DEFAULT_Y_OFFSET = 180;
private GoToPanel goToPanel = null;
/**
* 序列号
*/
private static final long serialVersionUID = 6947991932620300072L;
/**
* 构造函数
*
* @param frame
* @param text 标题
* @param wwd
*/
public GoToPanelDialog(DartEarthAppFrame frame, String text, WorldWindow wwd) {
super(frame, text);
// 计算goToPanelDialog的location
int x = 0 + DEFAULT_X_OFFSET;
int y = 0 + DEFAULT_Y_OFFSET;
// goToPanelDialog默认不显示出来
setVisible(false);
// goToPanelDialog的具体的一些参数
setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT));
setTitle(DEFAULT_TITLE);
getContentPane().setLayout(new BorderLayout());
setResizable(true);
setModal(false);
setLocation(x, y);
// 装入goToPanel
goToPanel = new GoToPanel(wwd, frame);
add(goToPanel);
pack();
this.addWindowFocusListener(new WindowFocusListener() {
@Override
public void windowGainedFocus(WindowEvent arg0) {
AWTUtilities.setWindowOpacity(GoToPanelDialog.this, 1f);
}
@Override
public void windowLostFocus(WindowEvent arg0) {
AWTUtilities.setWindowOpacity(GoToPanelDialog.this, 0.7f);
}
});
}
public GoToPanel getGoToPanel() {
return goToPanel;
}
public void setGoToPanel(GoToPanel goToPanel) {
this.goToPanel = goToPanel;
}
}
| [
"[email protected]"
] | |
ecd93744d1dd7d8b5b1cd1066020e5355a371747 | 60563395b404723b1263bf7abc59ea1612dcab35 | /java-in-action/junit-in-action/junit-in-action-common/src/test/java/jjseo/test/ParameterizedTest.java | b600a1a6cef65b9764d9996f08f05dcb13f9793e | [] | no_license | jayailluminated/Study | afc58f7715434ece86e9fab226974cba6525401a | 6d078c8815f2f54ec5e51ca19dbe1ea128a0d989 | refs/heads/master | 2020-04-06T09:35:35.596588 | 2012-02-05T12:25:26 | 2012-02-05T12:25:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,070 | java | package jjseo.test;
import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
@RunWith(value=Parameterized.class)
public class ParameterizedTest {
private double expected;
private double valueOne;
private double valueTwo;
@Parameters
public static Collection<Integer[]> getTestParameters() {
return Arrays.asList(new Integer[][] {
{2, 1, 1}, //expected, valueOne, valueTwo
{3, 2, 1}, //expected, valueOne, valueTwo
{4, 3, 1}, //expected, valueOne, valueTwo
});
}
public ParameterizedTest(double expected,
double valueOne, double valueTwo) {
this.expected = expected;
this.valueOne = valueOne;
this.valueTwo = valueTwo;
}
@Test
public void sum() {
Calculator calc = new Calculator();
assertEquals(expected, calc.add(valueOne, valueTwo), 0);
}
}
| [
"[email protected]"
] | |
507b0c8ebbfc2893a541f32aa21134e44b1414db | 8935311f312b99384d71bb428e2354db4fcd4cbb | /CoreMsg/src/main/java/AuthenticationRequest.java | 4f36a089c10f0a9e142b86e85146a7a7d2961cd0 | [] | no_license | AdrenalinV/Chat_Server_Cliebt-GUI- | 01eb592e73429270fcbd1e13587c71b092f58c0f | f94d3a6010e92be9646a9ec022184bc232a31f25 | refs/heads/master | 2023-03-19T06:53:47.354054 | 2021-03-02T17:49:22 | 2021-03-02T17:49:22 | 337,175,440 | 0 | 0 | null | 2021-03-06T20:38:24 | 2021-02-08T18:46:36 | Java | UTF-8 | Java | false | false | 762 | java | public class AuthenticationRequest extends AbstractMSG {
private String login;
private String pass;
private String nick;
private Boolean stat;
public AuthenticationRequest() {
this.stat = false;
}
public AuthenticationRequest(String login, String pass) {
this.login = login;
this.pass = pass;
this.stat = false;
}
public String getLogin() {
return login;
}
public String getPass() {
return pass;
}
public String getNick() {
return nick;
}
public Boolean isStat() {
return stat;
}
public void setNick(String nick) {
this.nick = nick;
}
public void setStat(boolean stat) {
this.stat = stat;
}
}
| [
"[email protected]"
] | |
a968a47fdcbec9b40c4b288aaaee4c9e56ee769a | 326ba169a98bb8fe66e6c02b3691efaee9172b78 | /Subarray Sum.java | 7c80fababa5f579621a9c1777b6153f13856e820 | [] | no_license | ly16/LC-Practice | 47ed5ee13bfce803c2f78e7dc6da14b1f629f757 | e3a73f6f42047ba327d93011e6faa1428eac718c | refs/heads/master | 2020-12-30T14:00:57.623328 | 2019-03-30T19:21:17 | 2019-03-30T19:21:17 | 91,278,420 | 15 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,079 | java | /*
Given an integer array, find a subarray where the sum of numbers is zero.
Your code should return the index of the first number and the index of the last number.
Notice
There is at least one subarray that it's sum equals to zero.
Example
Given [-3, 1, 2, -3, 4], return [0, 2] or [1, 3].
*/
public class Solution {
/**
* @param nums: A list of integers
* @return: A list of integers includes the index of the first number
* and the index of the last number
*/
public ArrayList<Integer> subarraySum(int[] nums) {
// write your code here
int len= nums.length;
ArrayList<Integer> ans= new ArrayList<>();
HashMap<Integer, Integer> map= new HashMap<>();
map.put(0,-1);
int sum=0;
for(int i=0; i<len; i++){
sum+=nums[i];
if(map.containsKey(sum)){
ans.add(map.get(sum)+1); //difference is 0
ans.add(i);
return ans;
}
map.put(sum, i);
}
return ans;
}
}
| [
"[email protected]"
] | |
06e07b33b732ccad40258126e0c939f738eb6b5b | 31092f314ba393c6006ec1d00f16a9491a822566 | /src/main/java/com/platzi/platziteacherspring/service/SocialMediaService.java | 49520aec21abc53e220b5c324373f1bd6369e331 | [] | no_license | KevinMendez7/Spring-Rest-example | d7e8aa24f3ef20fdbc632358cebb2b4463c5ccca | b9dc58132b06a54263c8d7bd757a6c14972d4803 | refs/heads/master | 2020-04-01T16:39:43.505390 | 2018-10-17T03:47:12 | 2018-10-17T03:47:12 | 153,391,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 628 | java | package com.platzi.platziteacherspring.service;
import java.util.List;
import com.platzi.platziteacherspring.model.SocialMedia;
import com.platzi.platziteacherspring.model.TeacherSocialMedia;
public interface SocialMediaService {
void saveSocialMedia(SocialMedia socialMedia);
void updateSocialMedia(SocialMedia socialMedia);
void deleteSocialMedia(Integer idSocialMedia);
SocialMedia getSocialMediaById(Integer idSocialMedia);
SocialMedia getSocialMediaByName(String name);
TeacherSocialMedia findSocialMediaByIdAndName(Integer idSocialMedia, String nickname);
List<SocialMedia> getAllSocialMedia();
}
| [
"[email protected]"
] | |
37b86bd1c5583835a6d775eac38fa50e31ccdf7a | 55dfd35b78716e44d447ad9d65a44e41f78ca5f2 | /SocketClient/src/com/test/Client/MyClientHandler.java | 72ce2d71340f8fe14276d63d7aad9bb42726b393 | [] | no_license | luceas/socket-long-connect | 299140cecc0f13ada4cdceb3f6c25c2626c4b485 | 6fc3a3555ade42f30c9257e89d6cba8ec5f52864 | refs/heads/master | 2021-01-11T09:59:05.647300 | 2016-11-18T08:43:22 | 2016-11-18T08:43:22 | 77,900,142 | 1 | 1 | null | 2017-01-03T08:55:20 | 2017-01-03T08:55:20 | null | UTF-8 | Java | false | false | 1,184 | java | package com.test.Client;
import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IdleStatus;
import org.apache.mina.core.session.IoSession;
public class MyClientHandler extends IoHandlerAdapter {
@Override
public void exceptionCaught(IoSession session, Throwable cause)
throws Exception {
System.out.println("exceptionCaught");
}
@Override
public void messageReceived(IoSession session, Object message)
throws Exception {
String s = (String) message;
System.out.println("messageReceived: " + s);
}
@Override
public void messageSent(IoSession session, Object message) throws Exception {
System.out.println("messageSent");
}
@Override
public void sessionClosed(IoSession session) throws Exception {
System.out.println("sessionClosed");
}
@Override
public void sessionCreated(IoSession session) throws Exception {
System.out.println("sessionCreated");
}
@Override
public void sessionIdle(IoSession session, IdleStatus status)
throws Exception {
System.out.println("sessionIdle");
}
@Override
public void sessionOpened(IoSession session) throws Exception {
System.out.println("sessionOpened");
}
} | [
"[email protected]"
] | |
f83e9c4480e2c91064916628369ae40a469107b3 | 75a47775bd98aca048cd644b45d24b69d5f24348 | /src/main/java/clone/clone_two/Main.java | d4093f8e7b5640a03ed5b246f940023da00f5587 | [] | no_license | DyvakYA/JavaWebSamples | c5ab6f7a34175a3540599bb78cc91a4b168172a9 | b20342b38e9c64aa46c992c3f6b09253a70cdc4a | refs/heads/master | 2021-01-12T06:16:23.500863 | 2017-03-18T08:36:32 | 2017-03-18T08:36:32 | 77,333,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 799 | java | package clone.clone_two;
public class Main {
public static void main(String[] args) {
// write your code here
Point p1 = new Point(3,4);
p1.setAllParameters(4,5);
Point p2 = p1.clone();
System.out.println(p1 == p2);
System.out.println(p1.equals(p2));
System.out.println(p1.hashCode());
System.out.println(p2.hashCode());
System.out.println(p1.hashCode() == p2.hashCode() );
System.out.println("==============================");
p1.getHistory().add(new Point(5,6));
System.out.println(p1 == p2);
System.out.println(p1.equals(p2));
System.out.println(p1.hashCode());
System.out.println(p2.hashCode());
System.out.println(p1.hashCode() == p2.hashCode() );
}
}
| [
"[email protected]"
] | |
67fb8d22b91e167d291a91231a2d561098e9e0d7 | 366e0786d4af2286ad6bc1bf7e2520d9e539e5ad | /D - VeritabanıKullanımı/src/Baglanti.java | d1e39de66dfe56be8f918bb0ee90e30b59efbc62 | [] | no_license | burakbaga/java-programming-examples | b64bc8f62995f0e18828b6d144bdc67d1474372a | 432e65197ef26c1b3bc9807807aeecb60080d222 | refs/heads/master | 2022-07-17T10:56:26.922626 | 2020-05-13T20:49:05 | 2020-05-13T20:49:05 | 263,738,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,202 | java |
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Baglanti {
private String kullaniciAdi = "root";
private String parola = "";
private String dbName = "demo";
private String host = "localhost";
private int port = 3306;
private Connection conn = null;
private Statement stat = null;
private PreparedStatement preStat = null;
public void preparedCalisanlariGetir(int id) {
String sorgu = "Select * From calisanlar where id > ?";
try {
preStat = conn.prepareStatement(sorgu);
preStat.setInt(1, id);
ResultSet rs = preStat.executeQuery();
while (rs.next()) {
String ad = rs.getString("ad");
String soyad = rs.getString("soyad");
String email = rs.getString("email");
System.out.println("ID: " + id + " Ad: " + ad + " Soyad : " + soyad + " Email :" + email);
}
} catch (SQLException ex) {
Logger.getLogger(Baglanti.class.getName()).log(Level.SEVERE, null, ex);
}
/*try {
stat = conn.createStatement();
String sorgu = "Select * from calisanlar where ad like 'M%'";
ResultSet rs = stat.executeQuery(sorgu);
while(rs.next()){
System.out.println(rs.getString("ad"));
}
} catch (SQLException ex) {
Logger.getLogger(Baglanti.class.getName()).log(Level.SEVERE, null, ex);
}
*/
}
public void commitandRollback() {
try {
conn.setAutoCommit(false);
String sorgu1 = "Delete from calisanlar where id=3";
String sorgu2 = "Update calisanlar set email = '[email protected]' where id = 1 ";
System.out.println("Güncellemeden önce");
calisanlariGetir();
stat = conn.createStatement();
stat.executeUpdate(sorgu1);
stat.executeUpdate(sorgu2);
System.out.println("İşlemler kaydedilsin mi (yes or no)");
Scanner scanner = new Scanner(System.in);
String cevap = scanner.nextLine();
if (cevap.equals("yes")) {
conn.commit();
calisanlariGetir();
System.out.println("Veri tabanı güncellendi.");
} else {
conn.rollback();
System.out.println("Veritabanı güncellemesi iptal edildi.");
}
} catch (SQLException ex) {
Logger.getLogger(Baglanti.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void calisanGuncelle() {
String sorgu = "Update calisanlar Set email='[email protected]' where id=1";
try {
stat = conn.createStatement();
} catch (SQLException ex) {
Logger.getLogger(Baglanti.class.getName()).log(Level.SEVERE, null, ex);
}
try {
stat.executeUpdate(sorgu);
/*
String ad = "Kübra";
String soyad = "Mercan";
String email = "[email protected]";
*/
} catch (SQLException ex) {
Logger.getLogger(Baglanti.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void calisanSil() {
String sorgu = "Delete from calisanlar where id>6";
try {
stat = conn.createStatement();
int deger = stat.executeUpdate(sorgu);
System.out.println(deger + " kadar veri etkilendi.");
} catch (SQLException ex) {
Logger.getLogger(Baglanti.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void calisanEkle() {
try {
stat = conn.createStatement();
String ad = "Semih";
String soyad = "Aktaş";
String email = "[email protected]";
String sorgu = "Insert Into calisanlar (ad,soyad,email) VALUES (" + "'" + ad + "'," + "'" + soyad + "'," + "'" + email + "')";
stat.executeUpdate(sorgu);
} catch (SQLException ex) {
Logger.getLogger(Baglanti.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void calisanlariGetir() {
String sorgu = "Select * from calisanlar";
try {
stat = conn.createStatement();
ResultSet rs = stat.executeQuery(sorgu);
while (rs.next()) {
int id = rs.getInt("id");
String ad = rs.getString("ad");
String soyad = rs.getString("soyad");
String email = rs.getString("email");
System.out.println("ID: " + id + " Ad: " + ad + " Soyad : " + soyad + " Email :" + email);
}
} catch (SQLException ex) {
Logger.getLogger(Baglanti.class.getName()).log(Level.SEVERE, null, ex);
}
}
private Baglanti() {
String url = "jdbc:mysql://" + host + ":" + port + "/" + dbName + "?useUnicode=true&characterEncoding=utf8";
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException ex) {
System.out.println("Driver bulunamadı.");
}
try {
conn = DriverManager.getConnection(url, kullaniciAdi, parola);
System.out.println("Bağlantı Başarılı.");
} catch (SQLException ex) {
System.out.println("Bağlantı başarısız.");
}
}
public static void main(String[] args) {
Baglanti baglanti = new Baglanti();
baglanti.commitandRollback();
/*
baglanti.preparedCalisanlariGetir(3);
baglanti.calisanEkle();
baglanti.calisanSil();
baglanti.calisanGuncelle();
baglanti.calisanlariGetir();
*/
}
}
| [
"[email protected]"
] | |
6767c624063cf693ed1706508b073dc44f050db5 | a5eb2936c7e589e5feb50b1969179e62fc5c6158 | /bromium-core/src/main/java/com/hribol/bromium/core/ConventionConstants.java | ee9d574bc2afb39cb000fe2c3d1f8bb7ce85d333 | [
"MIT"
] | permissive | gitter-badger/bromium | e87e51bb84174f193c64b038e24e85bdba823709 | 252ec8238c0ac3df15f3fe3927549e3ff4020f85 | refs/heads/master | 2021-07-11T23:15:10.280451 | 2017-09-06T14:38:07 | 2017-09-06T14:38:07 | 106,837,038 | 0 | 0 | null | 2017-10-13T14:49:01 | 2017-10-13T14:49:00 | null | UTF-8 | Java | false | false | 280 | java | package com.hribol.bromium.core;
/**
* Created by hvrigazov on 06.08.17.
*/
public class ConventionConstants {
public final static String SUBMIT_EVENT_URL = "http://bromium-submit-event.com/";
public final static String LINK_INTERCEPTOR_MARKER = "bromium-js-click";
}
| [
"[email protected]"
] | |
8a8bc696a8ba149302a2f9626e6ddba33e921417 | 3e701e75a7099fec9b639ed070921de0fb563c04 | /app/src/main/java/com/dinaro/utils/MyTextInputEditText.java | 6ea6f35751f668a3c9f9a90f62f32c0a2b06fd06 | [] | no_license | goodlifechris/Dinaro_App_User | 79196c0262306dc36c8817bf6df7c993201876ae | 0e8c225fc05577953511735df0d7e2a2443be674 | refs/heads/master | 2020-12-20T06:42:48.235746 | 2020-01-24T12:00:42 | 2020-01-24T12:00:42 | 235,991,151 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,822 | java | package com.dinaro.utils;
import android.content.Context;
import android.content.res.TypedArray;
import com.google.android.material.textfield.TextInputEditText;
import android.util.AttributeSet;
import com.dinaro.R;
public class MyTextInputEditText extends TextInputEditText {
//private TypeFactory mFontFactory;
public MyTextInputEditText(Context context, AttributeSet attrs) {
super(context, attrs);
applyCustomFont(context, attrs);
}
public MyTextInputEditText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
applyCustomFont(context, attrs);
}
public MyTextInputEditText(Context context) {
super(context);
}
private void applyCustomFont(Context context, AttributeSet attrs) {
TypedArray array = context.getTheme().obtainStyledAttributes(
attrs,
R.styleable.MyTextView,
0, 0);
int typefaceType;
try {
// typefaceType = array.getInteger(R.styleable.MyTextView_font_name, 0);
} finally {
array.recycle();
}
if (!isInEditMode()) {
// setTypeface(getTypeFace(typefaceType));
}
}
/* private Typeface getTypeFace(int type) {
if (mFontFactory == null)
mFontFactory = newback TypeFactory(getContext());
switch (type) {
case ViewConstants.REGULAR:
return mFontFactory.regular;
case ViewConstants.BOLD:
return mFontFactory.bold;
case ViewConstants.LIGHT:
return mFontFactory.light;
case ViewConstants.ITALIC:
return mFontFactory.italic;
default:
return mFontFactory.regular;
}
}*/
}
| [
"[email protected]"
] | |
e707ba530035845d5135e11449ad26502640d2fb | 7fc430a6eda8ec0d9a395a819d75f2c45369cbae | /test.web/src/main/java/mybatis/MyBatisComplicateMapperTest.java | 7e41111db762ee6b9c7fc6c1263c7da9e0309292 | [] | no_license | hlyhexiansheng/everyting | fb385436accc79312410b5d3ba3be7c813fc8d87 | ce6bc6d0f9603f8e5bcfaa0d1ec433b75c64f5d4 | refs/heads/master | 2020-06-15T13:08:39.013871 | 2018-01-18T02:17:30 | 2018-01-18T02:17:30 | 75,290,953 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,994 | java | package mybatis;
import mybatis.entity.Order;
import mybatis.interceptor.PageParams;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import java.io.FileNotFoundException;
import java.util.*;
/**
* Created by Administrator on 2015/12/12.
*/
public class MyBatisComplicateMapperTest {
public static void main(String[] args) throws FileNotFoundException {
new MyBatisComplicateMapperTest().runUseConfiguration();
}
public void runUseConfiguration() throws FileNotFoundException {
SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
SqlSessionFactory sqlSessionFactory = builder.build(this.getClass().getClassLoader().getResourceAsStream("mybatis/mybatis.xml"));
SqlSession sqlSession = sqlSessionFactory.openSession();
// insertOrderUserEntity(sqlSession);
// insertOrderUserMap(sqlSession);
// inserOrderUseList(sqlSession);
// inserOrderUseArray(sqlSession);
// insertOrderUserEntityBatch(sqlSession);
// insertOrderWithGenerateKey(sqlSession);
// selectOrderWithMutiCondtion(sqlSession);
// selectCommonTable(sqlSession);
// selectOrderUseWhereNode(sqlSession);
// insertOrderTestTransation(sqlSession);
// selectOrderWithFenYeUseLimit(sqlSession);
// selectOrderWithFenYeUseRowBounds(sqlSession);
// selectOrderWithFenYeUseInterceptor(sqlSession);
selectOrderWithFenyeUseInterceptorAndVo(sqlSession);
}
private void selectOrderWithFenyeUseInterceptorAndVo(SqlSession sqlSession) {
PageQueryVO vo = new PageQueryVO();
vo.setId(1);
vo.setName("%use%");
PageParams pageParams = new PageParams();
pageParams.setCount(10);
pageParams.setNeedQueryTotal(true);
vo.setPage(pageParams);
List<Object> list = sqlSession.selectList("selectOrderWithFenyeUseInterceptorAndVo", vo);
System.out.println(list.size());
}
/**Interceptor方式的分页*/
private void selectOrderWithFenYeUseInterceptor(SqlSession sqlSession) {
PageParams pageParams = new PageParams();
pageParams.setIndex(0);
pageParams.setCount(8);
List<Object> list = sqlSession.selectList("selectOrderWithFenYeUseInterceptor", pageParams);
System.out.println(list.size());
}
/**查询分页使用mybatis提供的RowBounds**/
private void selectOrderWithFenYeUseRowBounds(SqlSession sqlSession) {
List<Object> list = sqlSession.selectList("selectOrderWithFenYeUseRowBounds", null, new RowBounds(1, 5));
System.out.println("count " + list.size());
for(Iterator iterator = list.iterator();iterator.hasNext();){
System.out.println(iterator.next());
}
}
/**分页测试---使用原始的设置参数的方式**/
private void selectOrderWithFenYeUseLimit(SqlSession sqlSession) {
Map<String,Object> fenYeParams = new HashMap<String, Object>();
fenYeParams.put("index",10);
fenYeParams.put("count",5);
List<Object> list = sqlSession.selectList("selectOrderWithFenYeUseLimit", fenYeParams);
System.out.println("count " + list.size());
for(Iterator iterator = list.iterator();iterator.hasNext();){
System.out.println(iterator.next());
}
}
private void insertOrderTestTransation(SqlSession sqlSession) {
try {
sqlSession.getConnection().setAutoCommit(false);
Order order = Order.buildOrderUseSpecifyId(54);
Order order2 = Order.buildOrderUseSpecifyId(55);
sqlSession.insert("insertOrderTestTransation",order);
sqlSession.insert("insertOrderTestTransation",order2);
// sqlSession.commit();
}catch (Exception e){
e.printStackTrace();
sqlSession.rollback();
}
}
private void selectOrderUseWhereNode(SqlSession sqlSession) {
Order order = new Order();
order.setId(0);
// order.setAddress("%hun%");
// order.setBuyerUserName("%ma%");
List<Order> list = sqlSession.selectList("selectOrderUseWhereNode",order);
for (Iterator<Order> iterator = list.iterator();iterator.hasNext();){
System.out.println(iterator.next());
}
}
// 测试#、$区别
private void selectCommonTable(SqlSession sqlSession) {
Map<String,Object> map = new HashMap<String, Object>();
map.put("tableName","T_ORDER");
map.put("id",1);
List<Order> list = sqlSession.selectList("selectCommonTable",map);
for (Iterator<Order> iterator = list.iterator();iterator.hasNext();){
System.out.println(iterator.next());
}
}
private void selectOrderWithMutiCondtion(SqlSession sqlSession) {
Order order = new Order();
order.setId(0);
order.setAddress("%hun%");
List list = sqlSession.selectList("selectOrderWithMutiCondtion",order);
System.out.println("size---" + list.size());
for(Iterator<Order> iterator = list.iterator();iterator.hasNext();){
System.out.println(iterator.next());
}
}
/**插入并返回auto-generate-key*/
private void insertOrderWithGenerateKey(SqlSession sqlSession) {
Order order = Order.buildOrderUseAutoGenerateKey(29);
int insertOrderWithGenerateKey = sqlSession.insert("insertOrderWithGenerateKey", order);
System.out.println("lastInsertKey--" + order.getId());
}
/**批量插入(无法换回auto-generate-key)**/
private void insertOrderUserEntityBatch(SqlSession sqlSession) {
List<Order> orders = new ArrayList<Order>();
orders.add(Order.buildOrderUseAutoGenerateKey(8));
orders.add(Order.buildOrderUseAutoGenerateKey(9));
orders.add(Order.buildOrderUseAutoGenerateKey(10));
int r = sqlSession.insert("insertOrderUserEntityBatch",orders);
System.out.println(r);
for(Iterator<Order> iterator = orders.iterator(); iterator.hasNext();){
System.out.println(iterator.next());
}
}
/**使用数组插入*/
private void inserOrderUseArray(SqlSession sqlSession) {
Object[] objects = new Object[]{6,new Date(),13,"fds","hunan"};
// Object[] objects = new Object[]{6,new Date(),13,null,"hunan"}; //支持null的形式
int r = sqlSession.insert("inserOrderUseArray",objects);
System.out.println(r);
}
/*插入Order,使用list*/
private void inserOrderUseList(SqlSession sqlSession) {
List<Object> list = new ArrayList<Object>();
list.add(5);
list.add(new Date());
list.add(12);
list.add("fasd");
list.add("yongzhou");
int i = sqlSession.insert("inserOrderUserList",list);
System.out.println(i);
}
/**使用map的方式插入*/
private void insertOrderUserMap(SqlSession sqlSession) {
Map<String,Object> user = new HashMap<String, Object>();
user.put("order_Id",4);
user.put("create_Date",new Date());
user.put("price",12);
user.put("buyer_User_Name","heliyuhaha");
user.put("address","yongzhou");
int i = sqlSession.insert("insertOrderUserMap",user);
System.out.println(i);
}
/*参数使用用户实体对象插入的方式*/
private void insertOrderUserEntity(SqlSession sqlSession) {
Order order = new Order();
order.setOrderId(1);
order.setCreateDate(new Date());
order.setAddress("hunan yongzhou");
order.setBuyerUserName("heliyu");
order.setPrice(100);
int i = sqlSession.insert("mybatis.mapper.ComplicateMapper.insertOrderUserEntity",order);
System.out.println(i);
}
}
| [
"[email protected]"
] | |
6bb560c1d022b3b2433596ecfcd226f0d9a3d180 | 26eaa4977bc82f76b85db7aa0674e7dc6bb4bf0a | /JavaCommonTest/test/edu/sjsu/cinequest/javase/JavaSEPlatform.java | a93b076e0c93de0cc26a6c367c63645ea20f1251 | [] | no_license | yuqianli/CS185C-CS286 | ec2b29545850d64f8804880ba80ba086155f9c8b | f79c5247e1516d48e8065c0002d48570ba345cc0 | refs/heads/master | 2021-01-23T08:57:05.562843 | 2013-05-21T04:24:35 | 2013-05-21T04:24:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,091 | java | /*
Copyright 2008 San Jose State University
This file is part of the Blackberry Cinequest client.
The Blackberry Cinequest client is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The Blackberry Cinequest client is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the Blackberry Cinequest client. If not, see <http://www.gnu.org/licenses/>.
*/
package edu.sjsu.cinequest.javase;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.URL;
import java.security.NoSuchAlgorithmException;
import java.util.Collections;
import java.util.Hashtable;
import java.util.Vector;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import edu.sjsu.cinequest.comm.Callback;
import edu.sjsu.cinequest.comm.MessageDigest;
import edu.sjsu.cinequest.comm.Platform;
import edu.sjsu.cinequest.comm.WebConnection;
public class JavaSEPlatform extends Platform
{
public WebConnection createWebConnection(String url) throws IOException
{
return new JavaSEWebConnection(url);
}
public Object convert(byte[] imageBytes)
{
return new ImageIcon(imageBytes).getImage();
}
public Object getLocalImage(Object imageName)
{
return new ImageIcon((String) imageName).getImage();
}
public void parse(String url, DefaultHandler handler, Callback callback)
throws SAXException, IOException
{
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp;
try
{
sp = spf.newSAXParser();
} catch (ParserConfigurationException e)
{
throw new SAXException(e.toString());
}
InputStream in = new URL(url).openStream();
sp.parse(in, handler);
}
public String parse(final String url, Hashtable postData, DefaultHandler handler, Callback callback)
throws SAXException, IOException
{
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp;
try
{
sp = spf.newSAXParser();
} catch (ParserConfigurationException e)
{
throw new SAXException(e.toString());
}
WebConnection connection = createWebConnection(url);
connection.setPostParameters(postData);
byte[] response = connection.getBytes();
sp.parse(new ByteArrayInputStream(response), handler);
return new String(response);
}
public void starting(Callback callback)
{
callback.starting();
}
public void invoke(Callback callback, Object arg)
{
if (callback == null)
return;
callback.invoke(arg);
}
public void failure(Callback callback, Throwable arg)
{
if (callback == null)
return;
callback.failure(arg);
}
public Object loadPersistentObject(long key)
{
File file = new File("" + key);
ObjectInputStream in;
try
{
in = new ObjectInputStream(new FileInputStream(file));
Object ret;
ret = in.readObject();
in.close();
return ret;
} catch (IOException e)
{
e.printStackTrace();
return null;
} catch (ClassNotFoundException e)
{
e.printStackTrace();
return null;
}
}
public void storePersistentObject(long key, Object object)
{
File file = new File("" + key);
try
{
ObjectOutputStream out = new ObjectOutputStream(
new FileOutputStream(file));
out.writeObject(object);
out.close();
} catch (FileNotFoundException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
}
public MessageDigest getMessageDigestInstance(String name)
{
if (name.equals("SHA-1"))
try
{
return new MessageDigest()
{
private java.security.MessageDigest delegate = java.security.MessageDigest
.getInstance("SHA-1");
public void update(byte[] input)
{
delegate.update(input);
}
public byte[] digest()
{
return delegate.digest();
}
};
} catch (NoSuchAlgorithmException ex)
{
ex.printStackTrace();
return null;
}
return null;
}
public Vector sort(Vector vec, final Comparator comp)
{
Vector svec = new Vector(vec);
Collections.sort(svec, new java.util.Comparator() {
public int compare(Object obj1, Object obj2) {
return comp.compare(obj1, obj2);
}
});
return svec;
}
public void log(String message)
{
Logger.getLogger("global").info(message);
}
public void log(Throwable t)
{
Logger.getLogger("global").info(t.getMessage());
}
public void close()
{
}
}
| [
"[email protected]"
] | |
0cbff2844ee7171f3e04a5e535d8530da82ff337 | 0c135b7cbb7765e824175007ff5c378bde7f276e | /demo-spring-boot starter/src/main/java/com/xue/demo/springstarter/myimportselector/CacheSelector.java | a6a979e14795c2fbe5ed2ae3a5584e1f958f88d2 | [] | no_license | well-behaved/study_demo | c2e13b06ba2e3c0d83a3f73174d31f8a1a5cbd71 | 70095e1fb7c56d89f47ca12b6b328235bcc229ac | refs/heads/master | 2022-12-24T09:47:21.696715 | 2022-01-13T08:41:01 | 2022-01-13T08:41:01 | 94,392,136 | 1 | 0 | null | 2022-12-16T04:43:00 | 2017-06-15T02:39:13 | Java | UTF-8 | Java | false | false | 1,106 | java | package com.xue.demo.springstarter.myimportselector;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;
import java.text.MessageFormat;
import java.util.Map;
/**
* @author [email protected]
* @return
* @exception
* @date 2022/1/13 16:20
*/
public class CacheSelector implements ImportSelector {
@Override
public String[] selectImports(AnnotationMetadata importingClassMetadata) {
Map<String, Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(EnableMyCache.class.getName());
CacheTypeEnums type = (CacheTypeEnums) annotationAttributes.get("type");
switch (type) {
case MEMORY: {
return new String[]{MemoryCacheServiceImpl.class.getName()};
}
case REDIS: {
return new String[]{RedisCacheServiceImpl.class.getName()};
}
default: {
throw new RuntimeException(MessageFormat.format("该缓存类型不支持 {0}", type.toString()));
}
}
}
}
| [
"[email protected]"
] | |
2c3161b2dea22fcbd103df2663175d4cc1b0534d | adb7fc3d0316f0d2f47b8ea4c3cbbe5fa0850de6 | /src/Solution189.java | f36b648fc24c358ae9c5f04972ef7b187a23ac11 | [] | no_license | anna2018/leetcode | 2e40c2fd3c8bd4f07995d1782143dd0352955a01 | 832e2a01412e9a9986ae60d7f67bd74984836861 | refs/heads/master | 2020-12-02T18:12:38.536669 | 2017-07-07T03:37:12 | 2017-07-07T03:37:12 | 96,496,036 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 721 | java | import java.util.Stack;
public class Solution189 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] nums={1};
int k=2;
rotate(nums, k);
for(int i=0;i<nums.length;i++){
System.out.print(nums[i]+"\t");
}
}
public static void rotate(int[] nums, int k) {
if(k<0){
return;
}
Stack<Integer> stack=new Stack<Integer> ();
int length=nums.length;
k=k%length;
for(int i=0;i<k;i++){
stack.add(nums[length-1-i]);
}
for(int j=0;j<length-k;j++){
nums[length-1-j]=nums[length-1-j-k];
}
int m=0;
while(!stack.isEmpty()){
nums[m]=stack.pop();
m++;
}
}
}
| [
"[email protected]"
] | |
fabbf3d086d6895815973dcaf5a11a7372e61246 | 22b4f2d092b481539893508f38ee8a12872a2c29 | /app/src/androidTest/java/artur/project1/ExampleInstrumentedTest.java | b699e215a5d6ca3d1bdf68657a2d7b587c32f238 | [] | no_license | ArturM94/AndroidApp_study | 3f6a5fdf4f24c740f85d164685965ec4192eafb1 | 23c6907825d777d9716e7260bfb5714ffae5a708 | refs/heads/master | 2021-01-21T21:06:23.775723 | 2018-01-28T15:58:31 | 2018-01-28T15:58:31 | 92,299,352 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 732 | java | package artur.project1;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("artur.project1", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
0183f749950186424403db9bcbdfeb81935c28a1 | ae6ef478e786638d1ec99bd5905e525c8a5d1cc8 | /app/src/main/java/com/bsuir/chekh/lab2/controller/AlarmListAdapter.java | 2a97587ab5b8a9535f3713a14a085dfc48bfc89c | [] | no_license | ChekhDmitry/RPODMP_Android_Alarm_Clock_Manager | 1d9d6460fafb3c7d2c031be0b6b494ea53d65728 | 03da988a9547b373997aa93d11c08dc77c358f52 | refs/heads/master | 2021-04-09T15:16:45.138701 | 2018-03-18T18:18:48 | 2018-03-18T18:18:48 | 125,754,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,614 | java | package com.bsuir.chekh.lab2.controller;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.bsuir.chekh.lab2.R;
import com.bsuir.chekh.lab2.model.AlarmModel;
import com.bsuir.chekh.lab2.service.alarm.AlarmManagerService;
import com.bsuir.chekh.lab2.service.alarm.AlarmService;
import java.util.List;
public class AlarmListAdapter
extends RecyclerView.Adapter<AlarmListAdapter.ViewHolder> {
private LayoutInflater inflater;
private Context context;
private List<AlarmModel> alarms;
private AlarmService alarmService;
private AlarmManagerService alarmManagerService;
private int currentlySelected;
AlarmListAdapter(Context context, List<AlarmModel> alarms) {
this.inflater = LayoutInflater.from(context);
this.context = context;
this.alarms = alarms;
this.alarmService = new AlarmService();
this.alarmManagerService = new AlarmManagerService();
}
@Override
public AlarmListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = inflater.inflate(R.layout.alarm_list_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(AlarmListAdapter.ViewHolder holder, int position) {
AlarmModel alarm = alarms.get(position);
holder.getDateView().setText(alarm.dateToFormattedString(false));
holder.getSoundNameView().setText(alarm.getName());
}
@Override
public int getItemCount() {
return alarms.size();
}
public int getCurrentlySelected() {
return currentlySelected;
}
public void setCurrentlySelected(int currentlySelected) {
this.currentlySelected = currentlySelected;
}
public void updateCurrentlySelected(AlarmModel alarmModel) {
if(alarmModel == null) return;
if (currentlySelected == -1) {
addNew(alarmModel);
} else {
changeExisting(alarmModel);
}
alarmService.writeAll(alarms);
}
private void changeExisting(AlarmModel alarmModel) {
AlarmModel old = alarms.get(getCurrentlySelected());
alarmManagerService.setAlarm(context, old, true);
AlarmModel item = alarms.set(getCurrentlySelected(), alarmModel);
this.notifyItemChanged(getCurrentlySelected());
alarmManagerService.setAlarm(context, item, false);
}
private void addNew(AlarmModel alarmModel) {
alarmManagerService.setAlarm(context, alarmModel, false);
alarms.add(alarmModel);
this.notifyDataSetChanged();
}
public void createNewAlarm() {
setCurrentlySelected(-1);
createNewActivity(null);
}
public void createNewActivity(AlarmModel item) {
Intent intent = new Intent(context, AlarmDetailActivity.class);
intent.putExtra(AlarmDetailActivity.ALARM_EXTRA_STRING, item);
((Activity)context).startActivityForResult(intent, 1);
}
public class ViewHolder
extends RecyclerView.ViewHolder
implements View.OnClickListener {
private final TextView dateView, soundNameView;
ViewHolder(View view){
super(view);
view.setOnClickListener(this);
Button deleteBtn = (Button)(view.findViewById(R.id.btn_delete));
deleteBtn.setOnClickListener(this);
dateView = (TextView) view.findViewById(R.id.date);
soundNameView = (TextView) view.findViewById(R.id.sound_name);
}
public TextView getSoundNameView() {
return soundNameView;
}
public TextView getDateView() {
return dateView;
}
@Override
public void onClick(View v) {
int position = getAdapterPosition();
if (v.getId() == R.id.btn_delete){
deleteItem(position);
} else {
setCurrentlySelected(position);
AlarmModel item = alarms.get(position);
createNewActivity(item);
}
}
}
private void deleteItem(int position) {
AlarmModel alarmModel = alarms.get(position);
alarmManagerService.setAlarm(context, alarmModel, true);
alarms.remove(position);
this.notifyDataSetChanged();
alarmService.writeAll(alarms);
}
}
| [
"[email protected]"
] | |
9e2623398253f82c1be58600a4122205ce8908e7 | ec2bd4ec310a4f9fbf0b61e427ef50b6686b18b5 | /guanglian/gl-core/src/main/java/com/kekeinfo/core/utils/AbstractDataPopulator.java | 4183564d8ae809f54e442afb156b3008eff9b798 | [] | no_license | kingc0000/privatefirst | 58d0089a91f2fb26e615bf00f5c072d9036c8ab3 | 72b37f40d0f16b69466127b60434fbccfc5a6b50 | refs/heads/master | 2020-03-15T21:22:08.487027 | 2018-05-16T15:41:56 | 2018-05-16T15:41:56 | 132,353,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 608 | java | /**
*
*/
package com.kekeinfo.core.utils;
import java.util.Locale;
import com.kekeinfo.core.business.generic.exception.ConversionException;
/**
* @author Umesh A
*
*/
public abstract class AbstractDataPopulator<Source,Target> implements DataPopulator<Source, Target>
{
private Locale locale;
public void setLocale(Locale locale) {
this.locale = locale;
}
public Locale getLocale() {
return locale;
}
@Override
public Target populate(Source source) throws ConversionException{
return populate(source,createTarget());
}
protected abstract Target createTarget();
}
| [
"[email protected]"
] | |
ca4fc3988b87f34b5dcb6634e3572d1f60c4d142 | 2ba04d2ac9a01b7163cf62124e9c79fa07f6e641 | /src/main/java/com/tilitili/admin/config/InterceptorConfig.java | acdcee982d1d978d43411e6de44c90857f716170 | [
"Apache-2.0"
] | permissive | Jadlokin-Scarlet/tilitili-kobe | bc8df7204e86209eaa616490408a8e398b069e29 | 58694262975cd9137627fdc56e8fa214315a74aa | refs/heads/master | 2023-06-25T01:40:23.961855 | 2021-07-27T09:03:44 | 2021-07-27T09:03:44 | 300,379,170 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 887 | java | package com.tilitili.admin.config;
import com.tilitili.admin.interceptor.LoginInterceptor;
import com.tilitili.admin.interceptor.RequestLoggingFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
private final LoginInterceptor loginInterceptor;
@Autowired
public InterceptorConfig(LoginInterceptor loginInterceptor) {
this.loginInterceptor = loginInterceptor;
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(loginInterceptor);
}
} | [
"[email protected]"
] | |
4169c51e11d867e0bf81307242be6e9398edcb08 | 7ccc620096747edf4fbfd5f16160982256994b75 | /src/main/java/ecsploit/main/test/ComponentECSTest.java | 8f5d63d0e06eb5dfed59573a55b461e05aad882f | [
"MIT"
] | permissive | Khaidde/ECSPloit | 33c6be4e5b425ff755188ab5165acce1484b9431 | 805120badec3fe9410eb16193e500cc538db042e | refs/heads/master | 2023-01-12T07:03:18.787857 | 2020-11-03T06:48:21 | 2020-11-03T06:48:21 | 308,484,902 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,270 | java | package ecsploit.main.test;
import ecsploit.ecs.core.*;
import ecsploit.main.test.TestGameLib.*;
import ecsploit.utils.debug.Console;
import ecsploit.utils.debug.SimpleProfiler;
public class ComponentECSTest {
private static final Console CONSOLE = Console.getConsole(ComponentECSTest.class);
private static final int N = 100_000;
private final Manager manager;
private final ComponentType<Transform> transformComponentType;
private final ComponentType<Sprite> spriteComponentType;
public ComponentECSTest() {
this.manager = new Manager();
manager.system(SystemGroup.from("OrderedSystems",
new Sys1(),
new Sys2(),
new Sys3(),
new Sys4(),
new Sys5(),
new Sys6(),
new Sys7(),
new Sys8(),
new Sys9(),
new Sys10(),
new Sys11(),
new Sys12(),
new Sys13(),
new Sys14()
));
manager.system(new RenderSystem());
manager.system((new MovementSystem()));
System.out.println(manager.viewSystems());
this.transformComponentType = manager.type(Transform.class);
this.spriteComponentType = manager.type(Sprite.class);
for(int n = 0; n < 50; n++) {
this.attachComponentType();
this.destroyEntities();
this.attachComponentClass();
this.destroyEntities();
}
SimpleProfiler profiler = new SimpleProfiler();
profiler.start();
this.attachComponentType();
CONSOLE.info("ComponentTypeTest1: " + profiler.stop() + " ms");
this.destroyEntities();
profiler.start();
this.attachComponentClass();
CONSOLE.info("ClassTest1: " + profiler.stop() + " ms");
this.destroyEntities();
profiler.start();
this.attachComponentType();
CONSOLE.info("ComponentTypeTest2: " + profiler.stop() + " ms");
this.destroyEntities();
profiler.start();
this.attachComponentClass();
CONSOLE.info("ClassTest2: " + profiler.stop() + " ms");
this.destroyEntities();
for (int i = 0; i < 3; i ++) {
Entity entity = manager.entity();
entity.attach(Transform.class);
entity.attach(Sprite.class);
}
manager.update();
}
public void destroyEntities() {
for (int i = 0; i < N; i++) {
Entity entity = manager.get(i);
manager.destroy(entity);
}
}
public void attachComponentClass() {
for (int i = 0; i < N; i++) {
Entity entity = manager.entity();
entity.attach(Transform.class).setPos(-12, 34);
entity.attach(Sprite.class).setImagePath("NewTexture.png");
}
}
public void attachComponentType() {
for (int i = 0; i < N; i++) {
Entity entity = manager.entity();
entity.attachT(transformComponentType).setPos(-12, 34);
entity.attachT(spriteComponentType).setImagePath("NewTexture.png");
}
}
public static void main(String[] args) {
new ComponentECSTest();
}
}
| [
"[email protected]"
] | |
855e7c8915ce950c393a153160da503c97c63a9f | b8016594bb8136999ba6ec364f84674ac8f9126b | /src/view/AbstractTableNepolozeni.java | e9686eb73fe6296352558a4dc440886867d03ad6 | [] | no_license | MitarBrankovic/OISISI | 91fb7aa1ab906c71c68ed3ff995e264de7814c3b | 2134dface4957af11295a9ea1d050feb9d7f34d0 | refs/heads/main | 2023-02-19T14:04:07.898896 | 2021-01-13T21:30:29 | 2021-01-13T21:30:29 | 312,851,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 808 | java | package view;
/* REFERENCIRAN KOD: pojedini delovi koda preuzeti sa vezbi 5
*/
import javax.swing.table.AbstractTableModel;
import model.BazaOcena;
public class AbstractTableNepolozeni extends AbstractTableModel{
private static final long serialVersionUID = 4394442920233291508L;
//public public AbstractTableNepolozeni() {}
@Override
public int getColumnCount() {
return BazaOcena.getInstance().getColumnCountNepolozeni();
}
@Override
public int getRowCount() {
return BazaOcena.getInstance().getOceneNepolozeni().size();
}
@Override
public Object getValueAt(int row, int column) {
return BazaOcena.getInstance().getValueAtNepolozeni(row, column);
}
@Override
public String getColumnName(int column) {
return BazaOcena.getInstance().getColumnNameNepolozeni(column);
}
}
| [
"[email protected]"
] | |
bde2edb7b7a2b3868d96af61524c773db13ff231 | 8da7c15233956c5da0b57d5e946d4fa9383d8713 | /src/main/java/com/syntel/travel/external/iata/ndc/v16_2/schema/AirShoppingRQ/EnabledSysParticipantType.java | 8520b059ab177a4f9f62f13752ecf79f44267758 | [] | no_license | chandramohan-manohar/Clink | 846c30bd29bff5e56647207e27b2587a4e4445c9 | d4b6ed10d232e3556aaa479cb9d9195be23d0fb9 | refs/heads/master | 2021-07-10T11:29:47.961453 | 2017-10-12T02:54:02 | 2017-10-12T02:54:02 | 106,635,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,177 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2017.07.24 at 01:05:54 PM IST
//
package com.syntel.travel.external.iata.ndc.v16_2.schema.AirShoppingRQ;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* A data type for Enabled System Message Participant Role. Derived from EnabledSysMsgPartyCoreType.
*
* <p>Java class for EnabledSysParticipantType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="EnabledSysParticipantType">
* <complexContent>
* <extension base="{http://www.iata.org/IATA/EDIST}EnabledSysMsgPartyCoreType">
* <attribute name="SequenceNumber" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "EnabledSysParticipantType")
public class EnabledSysParticipantType
extends EnabledSysMsgPartyCoreType
{
@XmlAttribute(name = "SequenceNumber", required = true)
@XmlSchemaType(name = "positiveInteger")
protected BigInteger sequenceNumber;
/**
* Gets the value of the sequenceNumber property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getSequenceNumber() {
return sequenceNumber;
}
/**
* Sets the value of the sequenceNumber property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setSequenceNumber(BigInteger value) {
this.sequenceNumber = value;
}
}
| [
"[email protected]"
] | |
b2e3fb2cacf28171c02c918391cd2347b2bc1116 | 8f25254ef2f6f6eaa30833c76a28f6784bceb7f0 | /rabbitmq/src/main/java/com/felix/rabbitmq/HelloApplication.java | c257bf45e87636fb4f15be7d5297300795d0f4b4 | [] | no_license | 1119405009/springBoot | 279210a2d5192c676451d394531273c362a00805 | 2338547f38ef4b5a1840eb3f6264254f76a91056 | refs/heads/master | 2022-06-28T20:59:35.126967 | 2019-06-26T02:55:25 | 2019-06-26T02:55:25 | 190,497,174 | 0 | 0 | null | 2021-03-31T21:13:04 | 2019-06-06T02:00:34 | Java | UTF-8 | Java | false | false | 1,462 | java | package com.felix.rabbitmq;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* http://localhost:8080/swagger-ui.html
*/
@SpringBootApplication
@EnableSwagger2
public class HelloApplication {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.felix.rabbitmq.controller"))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("SpringBootRabbitMQ")
.description("api接口的文档整理,支持在线测试")
.contact("Felix")
.version("1.0")
.build();
}
public static void main(String[] args) {
SpringApplication.run(HelloApplication.class, args);
}
} | [
"[email protected]"
] | |
bbf5d560441f60551a9334226519a495c4428d24 | fdf09380580ae1dfafe850f3881430842380b355 | /Server/src/database/AuthenticationData.java | 9468ab78446c53a68e72195c819757c2babfd1eb | [] | no_license | DanilSabirov/Instant-Messenger | e86e0f26f0ef52a62e2d23fb2417f2cd18b7c410 | b35860e58b10511251ac88c85a3007a238ca984d | refs/heads/master | 2021-09-10T09:33:57.656563 | 2018-03-23T16:37:06 | 2018-03-23T16:37:06 | 118,105,998 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,039 | java | package database;
import java.util.Arrays;
public class AuthenticationData {
private String login;
private char[] password;
public AuthenticationData(String login, char[] password) {
this.login = login;
this.password = password;
}
public void setPassword(char[] password) {
this.password = password;
}
public String getLogin() {
return login;
}
public char[] getPassword() {
return password;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AuthenticationData that = (AuthenticationData) o;
if (login != null ? !login.equals(that.login) : that.login != null) return false;
return Arrays.equals(password, that.password);
}
@Override
public int hashCode() {
int result = login != null ? login.hashCode() : 0;
result = 31 * result + Arrays.hashCode(password);
return result;
}
}
| [
"[email protected]"
] | |
4b622a1d5f87f598ca37039867f89b41bf13d3e5 | ffb51aa15e6e8d2f259843c783e66af7c0a85ff8 | /src/java/com/tsp/sct/dao/dto/RolesPk.java | 7dba3688bb29f6f53ba726110f3843f7bf5868ec | [] | no_license | Karmaqueda/SGFENS_BAFAR-1 | c9c9b0ffad3ac948b2a76ffbbd5916c1a8751c51 | 666f858fc49abafe7612600ac0fd468c54c37bfe | refs/heads/master | 2021-01-18T16:09:08.520888 | 2016-08-01T18:49:40 | 2016-08-01T18:49:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,296 | java | /*
* This source file was generated by FireStorm/DAO.
*
* If you purchase a full license for FireStorm/DAO you can customize this header file.
*
* For more information please visit http://www.codefutures.com/products/firestorm
*/
package com.tsp.sct.dao.dto;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* This class represents the primary key of the roles table.
*/
public class RolesPk implements Serializable
{
protected int idRoles;
/**
* This attribute represents whether the primitive attribute idRoles is null.
*/
protected boolean idRolesNull;
/**
* Sets the value of idRoles
*/
public void setIdRoles(int idRoles)
{
this.idRoles = idRoles;
}
/**
* Gets the value of idRoles
*/
public int getIdRoles()
{
return idRoles;
}
/**
* Method 'RolesPk'
*
*/
public RolesPk()
{
}
/**
* Method 'RolesPk'
*
* @param idRoles
*/
public RolesPk(final int idRoles)
{
this.idRoles = idRoles;
}
/**
* Sets the value of idRolesNull
*/
public void setIdRolesNull(boolean idRolesNull)
{
this.idRolesNull = idRolesNull;
}
/**
* Gets the value of idRolesNull
*/
public boolean isIdRolesNull()
{
return idRolesNull;
}
/**
* Method 'equals'
*
* @param _other
* @return boolean
*/
public boolean equals(Object _other)
{
if (_other == null) {
return false;
}
if (_other == this) {
return true;
}
if (!(_other instanceof RolesPk)) {
return false;
}
final RolesPk _cast = (RolesPk) _other;
if (idRoles != _cast.idRoles) {
return false;
}
if (idRolesNull != _cast.idRolesNull) {
return false;
}
return true;
}
/**
* Method 'hashCode'
*
* @return int
*/
public int hashCode()
{
int _hashCode = 0;
_hashCode = 29 * _hashCode + idRoles;
_hashCode = 29 * _hashCode + (idRolesNull ? 1 : 0);
return _hashCode;
}
/**
* Method 'toString'
*
* @return String
*/
public String toString()
{
StringBuffer ret = new StringBuffer();
ret.append( "com.tsp.sct.dao.dto.RolesPk: " );
ret.append( "idRoles=" + idRoles );
return ret.toString();
}
}
| [
"[email protected]"
] | |
8f1b67d7a9d34ca8b47e6bf72b36da85da95b47b | c9e03f81c22598ae130648c1a0ab43d45a6ab1b8 | /ColBot/src/observer/GlobalMouseListener.java | 3e4511c981903aa2f5e00712452cbe19d773c256 | [] | no_license | Fish-In-A-Suit/ColBot | ec76075cd14c453ebd22bd7016e2e29eb72c9f67 | 389106cfd451e0544b32d6d9f5625fba638c3c76 | refs/heads/master | 2020-03-22T22:46:24.120141 | 2018-08-12T17:21:05 | 2018-08-12T17:21:05 | 140,770,073 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,324 | java | package observer;
import java.io.File;
import org.jnativehook.GlobalScreen;
import org.jnativehook.NativeHookException;
import org.jnativehook.mouse.NativeMouseEvent;
import org.jnativehook.mouse.NativeMouseInputListener;
import org.jnativehook.mouse.NativeMouseListener;
import org.jnativehook.mouse.NativeMouseMotionListener;
import file.FileManager;
import file.FileWriter;
import player.Processor;
import player.WindowManager;
import system.GetSystemWindowLocation;
import system.GetSystemWindowLocation.GetWindowRectException;
import system.GetSystemWindowLocation.WindowNotFoundException;
import utilities.ArrayUtilities;
public class GlobalMouseListener implements NativeMouseInputListener {
File currentFile;
private static double currentEventTime = 0;
private static double lastEventTime = 0;
private static int numEvents = 0;
private static double delta = 0;
public void startMouseLogging() {
try {
GlobalScreen.registerNativeHook();
} catch (NativeHookException ex) {
System.err.println("There was a problem registering the native hook.");
System.err.println(ex.getMessage());
System.exit(-1);
}
GlobalMouseListener mouseListener = new GlobalMouseListener();
GlobalScreen.addNativeMouseListener((NativeMouseListener) mouseListener);
GlobalScreen.addNativeMouseMotionListener((NativeMouseMotionListener) mouseListener);
}
public void nativeMouseClicked(NativeMouseEvent e) {
String buttonRepresentation = null;
lastEventTime = System.currentTimeMillis();
delta = lastEventTime - currentEventTime;
currentEventTime = lastEventTime;
numEvents++;
System.out.println("Mouse Clicked: " + e.getClickCount());
//FileManager.setCurrentFile(FileManager.getKeyLoggingFiles().get("fishing_mouse_log"));
FileManager.setCurrentFile(FileManager.getKeyLoggingFiles().get("test_mouse_log"));
currentFile = FileManager.getCurrentFile();
if(e.getButton() == 1) {
buttonRepresentation = "LMB";
} else if (e.getButton() == 2) {
buttonRepresentation = "RMB";
} else if (e.getButton() == 3) {
buttonRepresentation = "MMB";
}
if(GlobalKeyboardListener.isActivated) {
FileWriter.writeToFileMouse(currentFile, buttonRepresentation, currentEventTime, numEvents, delta);
}
}
public void nativeMousePressed(NativeMouseEvent e) {
System.out.println("Mouse Pressed: " + e.getButton());
}
public void nativeMouseReleased(NativeMouseEvent e) {
System.out.println("Mouse Released: " + e.getButton());
}
public void nativeMouseMoved(NativeMouseEvent e) {
//System.out.println("Mouse Moved: " + e.getX() + ", " + e.getY());
}
public void nativeMouseDragged(NativeMouseEvent e) {
//checks the window location if mouse is dragged
try {
int[] newLocation = GetSystemWindowLocation.getWindowLocation(WindowManager.getWindow().getName());
WindowManager.getWindow().setLocation(newLocation);
ArrayUtilities.displayArray(newLocation);
} catch (WindowNotFoundException e1) {
e1.printStackTrace();
} catch (GetWindowRectException e1) {
e1.printStackTrace();
}
}
public void cleanUp() {
try {
GlobalScreen.unregisterNativeHook();
} catch (NativeHookException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
b32b7c344854fec20fdb628533a7fca739dd7aaf | 60c0ee668bb805c128ea4ca9dda1927e277ddd44 | /com-service/src/main/java/com/service/web/dao/LayoutDao.java | ca5b3e34f18b2b0d055ec668517be8fcb1449185 | [
"Apache-2.0"
] | permissive | JustBurrow/com | ffdfc6ff2df5de788b8e50be21cbb65a2cc4fd43 | fd3d9a0346e0eab89e12b67123b9aa4054def4dd | refs/heads/master | 2020-05-26T07:55:36.826524 | 2017-04-27T15:06:28 | 2017-04-27T15:06:28 | 82,471,525 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 514 | java | package com.service.web.dao;
import com.domain.web.Layout;
import com.domain.web.Site;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author justburrow
* @since 2017. 4. 9.
*/
@Transactional(propagation = Propagation.MANDATORY)
public interface LayoutDao {
/**
* @param site
* @return
*/
List<Layout> list(Site site);
/**
* @param id
* @return
*/
Layout read(int id);
}
| [
"[email protected]"
] | |
87fbe893013eb81f700d1bbbed96c5d351438502 | 69609f1d32b5c1008ddb3c11b3fe1927ed961ee7 | /app/src/main/java/com/rdshoep/android/study/fragment/base/FragmentComponent.java | ef300452c60e9d24a5dd95163e36564bea92213f | [
"MIT"
] | permissive | rdshoep/AndroidDaggerFramework | 55c9fa17abe613449907c41e58a96d180b692e67 | 0c2e1344aa1be42e3ceb60aa3aaa3742b96add0c | refs/heads/master | 2021-01-10T05:01:26.472201 | 2015-11-10T06:44:26 | 2015-11-10T06:44:26 | 45,606,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 735 | java | package com.rdshoep.android.study.fragment.base;
/*
* @description
* Please write the FragmentComponent module's description
* @author Zhang ([email protected])
* http://www.rdshoep.com/
* @version
* 1.0.0(11/5/2015)
*/
import com.rdshoep.android.study.activity.base.ActivityComponent;
import com.rdshoep.android.study.dagger.FragmentLife;
import com.rdshoep.android.study.fragment.FragmentComponentInterface;
import com.rdshoep.android.study.fragment.FragmentProvidesInterface;
import dagger.Component;
@FragmentLife
@Component(
modules = FragmentModule.class,
dependencies = ActivityComponent.class
)
public interface FragmentComponent extends FragmentComponentInterface, FragmentProvidesInterface {
}
| [
"[email protected]"
] | |
40b161ecaa05374b961295dc1e1101c59167be34 | 8fb39cd519587893a1f2ea0d12fc7c82bfbde710 | /src/main/java/lv/ctco/Student.java | 35614ed41dad1e2d1ed19abb81e4c144deb44b72 | [] | no_license | nsokay/JavaSchool | ee229b8c863eea5e5c2f77a88248134a836a9c76 | 217b006be66092869e15bf7d768d43b4a9696db8 | refs/heads/master | 2021-01-19T03:47:19.232814 | 2016-07-08T10:07:55 | 2016-07-08T10:07:55 | 62,879,447 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,048 | java | package lv.ctco;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
public class Student {
@Id
@GeneratedValue
private int id;
private String firstName;
private String lastName;
@OneToMany(cascade = CascadeType.ALL)
private List<Assignment> assignments = new ArrayList<>();
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public List<Assignment> getAssignments() {
return assignments;
}
public void setAssignments(List<Assignment> list) {
this.assignments = list;
}
public void addAssignment(Assignment assignment) {
assignments.add(assignment);
}
} | [
"[email protected]"
] | |
12a9564c2df9fea2bbf35eeb26b8f2943f307eed | 8836d5d79d8651b8759621315e67e4610667bdcc | /src/test/java/DatabaseAdminTest.java | 8d76feabb64b06595b0bb549de3595862c01fa0e | [] | no_license | joedillonuk/inheritance_lab | 91e1852366808b80a2a33278cb5b03f941625e03 | 1065398a843d59b981e150f1981e9aa26aa6b967 | refs/heads/master | 2022-12-27T10:51:12.448805 | 2020-07-20T14:40:11 | 2020-07-20T14:40:11 | 281,142,298 | 0 | 0 | null | 2020-10-13T23:44:48 | 2020-07-20T14:40:38 | Java | UTF-8 | Java | false | false | 924 | java | import Staff.techStaff.DatabaseAdmin;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class DatabaseAdminTest {
DatabaseAdmin databaseAdmin;
@Before
public void before(){
databaseAdmin = new DatabaseAdmin("Data", "OI 01 10 11 O", 110111.00);
}
@Test
public void canGetName(){
assertEquals("Data", databaseAdmin.getName());
}
@Test
public void canGetNiNumber(){
assertEquals("OI 01 10 11 O", databaseAdmin.getNiNumber());
}
@Test
public void canGetSalary(){
assertEquals(110111, databaseAdmin.getSalary(), 0.1);
}
@Test
public void canRaiseSalary(){
databaseAdmin.raiseSalary(1.02);
assertEquals(112313.22, databaseAdmin.getSalary(), 0.1);
}
@Test
public void canPayBonus(){
assertEquals(1101.1, databaseAdmin.payBonus(), 0.1);
}
}
| [
"[email protected]"
] | |
eed662270a7fd1bbce0476de24485f08c3e64692 | 0796e8cde415ebbe2cdf47b644f5421a861292a2 | /app/src/main/java/com/xiangxue/new_modular_customarouter/apt_create_test/ARouter$$Group$$personal.java | 7e9bba61e4908f9b883b4be61fe473bafcc6500f | [] | no_license | xiaobaima520gyj/RouterDemo | 6f8579a696dd8a29321cad3ddc4c77b8452eb761 | 9b1a6107af4ccc50d3cce940fa1e9b0e3fcbc52c | refs/heads/main | 2023-03-31T01:36:18.672255 | 2021-04-04T14:16:48 | 2021-04-04T14:16:48 | 354,555,960 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 650 | java | //package com.xiangxue.new_modular_customarouter.apt_create_test;
//
//import com.xiangxue.arouter_api.ARouterGroup;
//import com.xiangxue.arouter_api.ARouterPath;
//
//import java.util.HashMap;
//import java.util.Map;
//
//// TODO 这就是要用 APT 动态生成的代码
//public class ARouter$$Group$$personal implements ARouterGroup {
//
// @Override
// public Map<String, Class<? extends ARouterPath>> getGroupMap() {
// Map<String, Class<? extends ARouterPath>> groupMap = new HashMap<>();
// groupMap.put("personal", ARouter$$Path$$personal.class); // 先有 path
// return groupMap;
// }
//}
| [
"[email protected]"
] | |
7c5e411b0034243c726c1fdb9955d5e35e1c9650 | ea62cb0f4b0cd233f0c549fd06e9f07df2656185 | /src/Exercise296.java | 6bcc3187d91e10cd60cbd23b23943f45aeaab51a | [] | no_license | BenjaminKyhn/Chapter_2 | 90a5158091f83dfd5ab686d8475b4e25204934a1 | 4d98661ead575af7c3ca803c4be478967dc76fd1 | refs/heads/master | 2020-07-21T07:36:54.499580 | 2019-09-06T11:27:19 | 2019-09-06T11:27:19 | 206,779,388 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 303 | java | public class Exercise296 {
public static void main(String[] args){
System.out.println("25 / 4 is " + 25 / 4);
System.out.println("25 / 4.0 is " + 25 / 4.0);
System.out.println("3 * 2 / 4 is " + 3 * 2 / 4);
System.out.println("3.0 * 2 / 4 is " + 3.0 * 2 / 4);
}
}
| [
"[email protected]"
] | |
190717981241f3e547fe5de57fe116d45492980d | 96d71f73821cfbf3653f148d8a261eceedeac882 | /external/decompiled/android/WhatsApp-2.8.4278_dex2jar.src.meta/com/whatsapp/messaging/t.java | 16c6153e8d506754ef43a0ea2c7b236b552d97d6 | [] | no_license | JaapSuter/Niets | 9a9ec53f448df9b866a8c15162a5690b6bcca818 | 3cc42f8c2cefd9c3193711cbf15b5304566e08cb | refs/heads/master | 2020-04-09T19:09:40.667155 | 2012-09-28T18:11:33 | 2012-09-28T18:11:33 | 5,751,595 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,589 | java | package com.whatsapp.messaging;
import com.whatsapp.gz;
import com.whatsapp.sz;
import com.whatsapp.uz;
import java.util.Hashtable;
public abstract class t
{
protected void a()
{
}
protected void a(int paramInt)
{
}
protected void a(int paramInt, long paramLong)
{
}
protected void a(gz paramgz)
{
}
protected void a(sz paramsz)
{
}
protected void a(uz paramuz, int paramInt)
{
}
protected void a(String paramString)
{
}
protected void a(String paramString, int paramInt)
{
}
protected void a(String paramString1, int paramInt, String paramString2)
{
}
protected void a(String paramString1, String paramString2)
{
}
protected void a(String paramString1, String paramString2, String paramString3, int paramInt1, int paramInt2)
{
}
protected void a(String paramString, boolean paramBoolean)
{
}
protected void a(Hashtable paramHashtable)
{
}
protected void b()
{
}
protected void b(uz paramuz, int paramInt)
{
}
protected void b(String paramString)
{
}
protected void b(String paramString, int paramInt)
{
}
protected void b(String paramString, boolean paramBoolean)
{
}
protected void c()
{
}
protected void c(uz paramuz, int paramInt)
{
}
protected void c(String paramString)
{
}
protected void d(String paramString)
{
}
protected void e(String paramString)
{
}
}
/* Location: C:\Users\Jaap\Downloads\Code\WhatsApp-2.8.4278_dex2jar.jar
* Qualified Name: com.whatsapp.messaging.t
* JD-Core Version: 0.6.1
*/ | [
"[email protected]"
] | |
971a0199c7c0d474e1192bfca2834dee135b3358 | c38c80ab39f3122c87b237dba0a48f85c9de2b1e | /eclipse/cuarentena/src/Escritura.java | aecb0b26d08031f0ae665b8a7b190ac37c940c3c | [] | no_license | josewcabr/java | cb72c25c136d8e04e9f7999fd0a99dc0b2cfa4a7 | eef44d5059c96dcd6b6c90d118ee286b2eaa8e7f | refs/heads/master | 2022-10-09T12:12:58.742331 | 2020-05-27T15:38:49 | 2020-05-27T15:38:49 | 209,493,042 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,212 | java | import java.io.FileWriter;
import java.io.IOException;
/**
* Ejercicio (UT8_EJ2):
* Realiza la práctica del vídeo, modificando los siguientes puntos:
*
* -> utilizar un fichero con ruta relativa. Lo colocará en la raíz del proyecto.
* -> Tener en cuenta que en todas las operaciones de escritura debemos realizar tres pasos imprescindibles: abrir, procesar, y cerrar el fichero.
* -> Crea el fichero para añadir, y que vayamos viendo como cada vez que se ejecute el programa lo rellena.
* -> Añade la hora en la que se realiza la escritura.
* -> Añade un salto de línea al final de la escritura.
*
* @author Jose Cabrera Rojas
*
*/
public class Escritura {
public void escribe() {
try {
FileWriter fw = new FileWriter("src/writeTest.txt", true); //estan en src para tener cierto orden
String s = new java.util.Date() + "\n";
for(int i = 0; i < s.length(); i++) {
fw.write(s.charAt(i));
}
//fw.write(new java.util.Date() + "\n");
fw.close();
} catch (IOException e) {
System.err.println("No se pudo abrir el archivo");
}
}
public static void main(String [] args) {
Escritura esc = new Escritura();
esc.escribe();
}
}
| [
"[email protected]"
] | |
81f2ec4e6211ebf6d85c5d87fab6321ce223c3bb | e15ef516a32d2ac2a6987f60d97415b3a89635a6 | /src/cd/com/a/serviceImpl/MyPageOrderServiceImpl.java | 9173e8a4bfa21568dc1ee7b23bf74cbd4fa679e1 | [] | no_license | BaeJunHyo/CaxiDogi | 4c0f14449d1adef810f75c483dcccb582c2cb39a | 085a2f941da6e473785dc03a0649e041f0b1b20f | refs/heads/master | 2022-12-23T10:39:03.265325 | 2020-05-10T09:18:47 | 2020-05-10T09:18:47 | 252,090,500 | 2 | 0 | null | 2022-12-16T14:51:54 | 2020-04-01T06:26:20 | Java | UTF-8 | Java | false | false | 349 | java | package cd.com.a.serviceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cd.com.a.dao.MyPageOrderDao;
import cd.com.a.service.MyPageOrderService;
@Service
public class MyPageOrderServiceImpl implements MyPageOrderService {
@Autowired
MyPageOrderDao myPageOrderDao;
}
| [
"[email protected]"
] | |
6aaf64f19fbfb3135c67d4f0e4567a5e47d9a448 | 9f67b96b44c23f816a0e100563b321f350e65c71 | /src/com/sshs/pojo/AuthrOperatorPermmissionId.java | 8a94ffc9b54dfdc30f1e0b9f8cebe25c9ba6d115 | [] | no_license | gemini9640/sshshiro | 8b3c87b7df0f7c2b144ea4b86c6fbcc837aa8d48 | d1dc6042b1c9c466e0062401a8cdf154d25f3e8e | refs/heads/master | 2020-03-27T04:47:43.023325 | 2018-08-24T09:08:34 | 2018-08-24T09:08:34 | 145,968,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 974 | java | package com.sshs.pojo;
import javax.persistence.Embeddable;
@Embeddable
@org.hibernate.annotations.Entity(dynamicUpdate = true, dynamicInsert = true)
public class AuthrOperatorPermmissionId implements java.io.Serializable {
private String operator;
private String permission;
public AuthrOperatorPermmissionId() {
}
public AuthrOperatorPermmissionId(String operator, String permission) {
this.operator = operator;
this.permission = permission;
}
@javax.persistence.Column(name = "operator")
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
@javax.persistence.Column(name = "permission")
public String getPermission() {
return permission;
}
public void setPermission(String permission) {
this.permission = permission;
}
@Override
public String toString() {
return "AuthrOperatorPermmissionId [operator=" + operator
+ ", permission=" + permission + "]";
}
}
| [
"[email protected]"
] | |
23ad11d690fb5e577352d526e32f69120062b326 | 2749c41932af2432ce8b6eda8542c134a9fbc288 | /src/main/java/com/wizeek/leetcode/p169/Solution.java | e596732f880df0d9f083ba463c85c0659ba18c34 | [] | no_license | araslanov/leetcode | 857a637a0d642a4a8732afa0cd3a6321dfcdb9da | 723564c6ec27c737cd77ac58ee2b1e5cb898c191 | refs/heads/master | 2022-10-15T09:21:29.161545 | 2022-09-20T06:21:39 | 2022-09-20T06:21:39 | 135,767,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 477 | java | package com.wizeek.leetcode.p169;
public class Solution {
public int majorityElement(int[] nums) {
int n = nums.length;
int candidate = nums[0];
int count = 1;
for (int i = 1; i < n; i++) {
if (count == 0) {
candidate = nums[i];
}
if (nums[i] == candidate) {
count++;
} else {
count--;
}
}
return candidate;
}
}
| [
"[email protected]"
] | |
fd7aac973378e6b1e2997e1d417e0563a863d719 | d6f5c298260b8d20d49ea2e91dd3ded1b95fdcc4 | /app/src/main/java/com/example/dmswj/management123/LoginActivity.java | 1072df35e24052b633eea25a9887104939095222 | [] | no_license | EJSong/NewLoginRegister | c41aa91c6f1f98ae0a2d22b837f8a59286473923 | 5ee433c613854e7ed2e4a119aba7352bfb545f5b | refs/heads/master | 2021-04-15T08:50:56.147948 | 2018-03-25T18:27:36 | 2018-03-25T18:27:36 | 126,705,205 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,124 | java | package com.example.dmswj.management123;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class LoginActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
final EditText etUsername = (EditText) findViewById(R.id.etUsername);
final EditText etPassword = (EditText) findViewById(R.id.etPassword);
final Button bLogin = (Button) findViewById(R.id.bLogin);
final TextView registerLink = (TextView) findViewById(R.id.tvRegisterHere);
registerLink.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Intent registerIntent = new Intent(LoginActivity.this, RegisterActivity.class);
LoginActivity.this.startActivity(registerIntent);
}
});
}
}
| [
"[email protected]"
] | |
1295812fb2d24b57c98088c4a15d3e1d4573f880 | c96b0be86c08f639d388498851384706a3c87815 | /KCX-Mapping-Convert/src/com/kewill/kcx/component/mapping/formats/fss/edec/aus/subsets/TsCAA.java | 309334123f1191bd516fa0f7992d291156044481 | [] | no_license | joelsousa/KCX-Mapping-Convert | cf1b4b785af839f6f369bcdf539bd023d4478f72 | 9da4b25db31f5b1dfbefd279eb76c555f3977c0e | refs/heads/master | 2020-06-07T12:06:43.517765 | 2014-10-03T14:14:51 | 2014-10-03T14:14:51 | null | 0 | 0 | null | null | null | null | ISO-8859-3 | Java | false | false | 3,661 | java | /*
* Funktion : TsAAK.java
* Titel :
* Erstellt : 03.09.2008
* Author : Elisabeth Iwaniuk
* Beschreibung:
* Anmerkungen :
* Parameter :
* Rückgabe : keine
* Aufruf :
*
*/
package com.kewill.kcx.component.mapping.formats.fss.edec.aus.subsets;
import com.kewill.kcx.component.mapping.formats.fss.common.Teilsatz;
import com.kewill.kcx.component.mapping.util.Utils;
public class TsCAA extends Teilsatz {
private String beznr = ""; //Bezugsnummer
private String dklart = ""; //DeclarationKind
private String dksp = ""; // DeclarationNumberForwarder
private String dkzo = ""; // DeclarationNumberCustoms
private String antdat = ""; //AcceptanceTime
private String cdrev = ""; //RevisionCode
private String cdfrei = ""; //CodeOfRelease
public TsCAA() {
tsTyp = "CAA";
}
public void setFields(String[] fields)
{
int size = fields.length;
String ausgabe = "FSS: "+fields[0]+" size = "+ size;
//Utils.log( ausgabe);
if (size < 1 ) return;
tsTyp = fields[0];
if (size < 2 ) return;
beznr = fields[1];
if (size < 3 ) return;
dklart = fields[2];
if (size < 4 ) return;
dksp = fields[3];
if (size < 5 ) return;
dkzo = fields[4];
if (size < 6 ) return;
antdat = fields[5];
if (size < 7 ) return;
cdrev = fields[6];
if (size < 8 ) return;
cdfrei = fields[7];
}
public String teilsatzBilden() {
StringBuffer buff = new StringBuffer();
buff.append(tsTyp);
buff.append(trenner);
buff.append(beznr);
buff.append(trenner);
buff.append(dklart);
buff.append(trenner);
buff.append(dksp);
buff.append(trenner);
buff.append(dkzo);
buff.append(trenner);
buff.append(antdat);
buff.append(trenner);
buff.append(cdrev);
buff.append(trenner);
buff.append(cdfrei);
buff.append(trenner);
return new String(buff);
}
public String getBeznr() {
return beznr;
}
public void setBeznr(String beznr) {
this.beznr = Utils.checkNull(beznr);
}
public String getDklart() {
return dklart;
}
public void setDklart(String dklart) {
this.dklart = Utils.checkNull(dklart);
}
public String getDksp() {
return dksp;
}
public void setDksp(String dksp) {
this.dksp = Utils.checkNull(dksp);
}
public String getDkzo() {
return dkzo;
}
public void setDkzo(String dklzo) {
this.dkzo = Utils.checkNull(dklzo);
}
public String getAntdat() {
return antdat;
}
public void setAntdat(String antdat) {
this.antdat = Utils.checkNull(antdat);
}
public String getCdrev() {
return cdrev;
}
public void setCdrev(String cdrev) {
this.cdrev = Utils.checkNull(cdrev);
}
public String getCdfrei() {
return cdfrei;
}
public void setCdfrei(String cdfrei) {
this.cdfrei = Utils.checkNull(cdfrei);
}
/*
public void setAakSubset(MsgKids msgKids) {
this.setBeznr(msgKids.getReferenceNumber());
this.setGsroh(msgKids.getGrossMass());
}
*/
public boolean isEmpty() {
if ( Utils.isStringEmpty(dklart) && Utils.isStringEmpty(dksp)
&& Utils.isStringEmpty(dkzo) && Utils.isStringEmpty(antdat)
&& Utils.isStringEmpty(cdrev) && Utils.isStringEmpty(cdfrei))
return true;
else
return false;
}
}
| [
"[email protected]"
] | |
9c0fed79d3ef90f5f1de3d4ea5c5e7c6e792b470 | 408333f9b9971599a1db2a8cbf9f65236fceabb2 | /Searcher/src/index/IndexReader.java | d72a432a4ce481c0dc96c5068350b44deb01b335 | [] | no_license | jaychunkid/Information-Retrieval | e6c1056e0e110f6a6d4d5729010e690bb1fa5385 | 872df4a6c6f290681f2fdaf5ab6c5e2ca72acf5a | refs/heads/master | 2020-03-21T21:57:14.160178 | 2018-06-29T06:43:54 | 2018-06-29T06:43:54 | 139,095,240 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 254 | java | package index;
import java.util.List;
import java.util.Map;
//从文件中读取索引接口
public interface IndexReader {
//从文件中读取索引,保存到传入的参数中
boolean read(List<Url> urlList, Map<String, Term> termsMap);
}
| [
"[email protected]"
] | |
314102e5d8b0cda72fe15d8e8e74f3a26cd7cb68 | b9fe22925b9b96fbe5ad2ddca03a5c06605ad7b0 | /PruebaPilotoEJB/ejbModule/com/asesoftware/pruebapiloto/entidades/Vehiculo.java | 0f5a40d8da5bac0d6933594c2eb21b8f2c685482 | [] | no_license | diegoed87/proyectopiloto | 04657f018cbc60771b16cb3686b46550a0db2958 | 0063fe1e2ea22623c981b8b69a73a5ef9473b170 | refs/heads/master | 2020-03-25T00:42:21.652655 | 2018-08-02T16:51:43 | 2018-08-02T16:51:43 | 143,201,220 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,517 | java | package com.asesoftware.pruebapiloto.entidades;
import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;
/**
* The persistent class for the VEHICULO database table.
*
*/
@Entity
@NamedQuery(name="Vehiculo.findAll", query="SELECT v FROM Vehiculo v")
public class Vehiculo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private String placa;
private BigDecimal cilindraje;
private String color;
private String marca;
private String modelo;
//bi-directional many-to-one association to Cita
@OneToMany(mappedBy="vehiculo")
private List<Cita> citas;
//bi-directional many-to-one association to ClienteVehiculo
@OneToMany(mappedBy="vehiculo")
private List<ClienteVehiculo> clienteVehiculos;
public Vehiculo() {
}
public String getPlaca() {
return this.placa;
}
public void setPlaca(String placa) {
this.placa = placa;
}
public BigDecimal getCilindraje() {
return this.cilindraje;
}
public void setCilindraje(BigDecimal cilindraje) {
this.cilindraje = cilindraje;
}
public String getColor() {
return this.color;
}
public void setColor(String color) {
this.color = color;
}
public String getMarca() {
return this.marca;
}
public void setMarca(String marca) {
this.marca = marca;
}
public String getModelo() {
return this.modelo;
}
public void setModelo(String modelo) {
this.modelo = modelo;
}
public List<Cita> getCitas() {
return this.citas;
}
public void setCitas(List<Cita> citas) {
this.citas = citas;
}
public Cita addCita(Cita cita) {
getCitas().add(cita);
cita.setVehiculo(this);
return cita;
}
public Cita removeCita(Cita cita) {
getCitas().remove(cita);
cita.setVehiculo(null);
return cita;
}
public List<ClienteVehiculo> getClienteVehiculos() {
return this.clienteVehiculos;
}
public void setClienteVehiculos(List<ClienteVehiculo> clienteVehiculos) {
this.clienteVehiculos = clienteVehiculos;
}
public ClienteVehiculo addClienteVehiculo(ClienteVehiculo clienteVehiculo) {
getClienteVehiculos().add(clienteVehiculo);
clienteVehiculo.setVehiculo(this);
return clienteVehiculo;
}
public ClienteVehiculo removeClienteVehiculo(ClienteVehiculo clienteVehiculo) {
getClienteVehiculos().remove(clienteVehiculo);
clienteVehiculo.setVehiculo(null);
return clienteVehiculo;
}
} | [
"[email protected]"
] | |
16e9d3acf18b7f0fadfd9d573430c0fc2e3010cb | 8f5c45c8819a429513851177ff59169e7fb725db | /app/src/main/java/com/juanlabrador/exampleparse/LoginActivity.java | fd29ce1d53fe0f1c0782570c2c3ddd327f6b353b | [] | no_license | juanlabrador/ExampleParse | dc72305d2464fe89ad38310cf9bcdc72f842e5f3 | 824d2e888f7b0fa71294e7232e99225d1d1ebd13 | refs/heads/master | 2021-01-10T09:29:51.706314 | 2015-10-22T19:30:56 | 2015-10-22T19:30:56 | 44,768,727 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,485 | java | package com.juanlabrador.exampleparse;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.parse.LogInCallback;
import com.parse.ParseException;
import com.parse.ParseUser;
/**
* Created by juanlabrador on 21/10/15.
*/
public class LoginActivity extends Activity {
private EditText username;
private EditText password;
private Button login;
private TextView register;
private ParseUser currentUser;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
username = (EditText) findViewById(R.id.username);
password = (EditText) findViewById(R.id.password);
login = (Button) findViewById(R.id.login);
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
login();
}
});
register = (TextView) findViewById(R.id.register);
register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
}
});
}
@Override
protected void onStart() {
super.onStart();
currentUser = ParseUser.getCurrentUser();
if (currentUser != null) {
startActivity(new Intent(LoginActivity.this, MainActivity.class));
}
}
private void login() {
final ProgressDialog dialog = new ProgressDialog(this);
dialog.setIndeterminate(true);
dialog.setMessage("Login...");
dialog.show();
ParseUser.logInInBackground(username.getText().toString(), password.getText().toString(), new LogInCallback() {
@Override
public void done(ParseUser user, ParseException e) {
if (e == null) {
startActivity(new Intent(LoginActivity.this, MainActivity.class));
} else {
Toast.makeText(getApplicationContext(), "Username or password are wrong!", Toast.LENGTH_SHORT).show();
}
dialog.dismiss();
}
});
}
}
| [
"[email protected]"
] | |
da09cecb7df42f5a9bb7d79a03d64153d048470b | 279aaf95ed667caeb19e8df59394168adca09d93 | /src/main/java/com/vmware/mapbu/support/jmw/LoadSimulationController.java | 6347d18852ce17693edd035cfa5c9106782f0c20 | [] | no_license | dmikusa/java-memory-waster | 9a61d85c0f02615d9fc99a338995c1fedc4f128d | 36dc4827a12729d50778a125f1106638481621a4 | refs/heads/main | 2022-12-31T23:36:16.146598 | 2020-10-22T17:46:47 | 2020-10-22T17:46:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,302 | java | package com.vmware.mapbu.support.jmw;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
@Controller
@RequestMapping("/api/v1/load")
public class LoadSimulationController {
private static final Logger log = LoggerFactory.getLogger(LoadSimulationController.class);
@GetMapping("/wait")
@ResponseStatus(code = HttpStatus.ACCEPTED)
public void waitingLoad(@RequestParam(defaultValue = "1") int howLong) throws InterruptedException {
log.info("waiting for " + howLong + " seconds");
Thread.sleep(howLong * 1000);
}
@GetMapping("/busy")
@ResponseStatus(code = HttpStatus.ACCEPTED)
public void waitingBusy(@RequestParam(defaultValue = "1") int howLong) {
log.info("spinning for " + howLong + " seconds");
long sleepTime = howLong * 1000000000L; // convert to nanoseconds
long startTime = System.nanoTime();
while ((System.nanoTime() - startTime) < sleepTime) {
}
}
} | [
"[email protected]"
] | |
d0c0d96bc7e4b38f468e141111ea512e547f6d2c | ad97045ca38d680bf7cd45b72415306fde95dc51 | /src/main/java/Application.java | 6385e4ce8328b8a05d43ca1947ac554cd15e46fd | [] | no_license | romanmarasanov/first-telegram-bot | eba3051a82554dd7311d4334ff8bf8acf19d3a89 | ca363545ac96aa3ab387c400425e2703c19873c6 | refs/heads/master | 2023-08-23T14:17:36.828727 | 2021-09-24T09:07:14 | 2021-09-24T09:07:14 | 409,741,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 523 | java | import org.telegram.telegrambots.meta.TelegramBotsApi;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
import org.telegram.telegrambots.updatesreceivers.DefaultBotSession;
public class Application {
public static void main(String[] args) {
try {
TelegramBotsApi botsApi = new TelegramBotsApi(DefaultBotSession.class);
botsApi.registerBot(new MyFirstLongPollingBot());
} catch (TelegramApiException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
c96cdbf54a57578cb4a5bd3e14102a6b3d5ff50d | e90a27d6911ef0119ab15ffc9762e560f17faf01 | /Login.java | fe9b47d24499f4be4edba211bf776f730539a065 | [] | no_license | alsals126/MirimPC | 4801ce30937e6368f7deb4c3a8f9e8a0243420f0 | 70a8efe6a4d1166501b5adbcd398582de662b098 | refs/heads/master | 2021-04-07T13:11:07.230811 | 2020-03-20T06:33:49 | 2020-03-20T06:33:49 | 248,678,421 | 0 | 1 | null | null | null | null | UHC | Java | false | false | 5,437 | java | import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import java.util.Scanner;
import java.io.*;
//Login클래스에서 db에관해 필요한 메서드들을 모아놓은 클래스
class LoginDB{
private Connection conn;
private static final String USERNAME = "root";
private static final String PASSWORD = "9970q!q!a!a!";
private static final String URL = "jdbc:mysql://127.0.0.1:3306/java?characterEncoding=UTF-8&serverTimezone=UTC";
Properties info = null;
Statement stmt = null;
String sql = null;
ResultSet rs = null;
public LoginDB() {// connection객체를 생성해서 디비에 연결해줌
try {
Class.forName("com.mysql.cj.jdbc.Driver");
conn = DriverManager.getConnection(URL, USERNAME, PASSWORD);
// System.out.println("연결성공");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("클래스 적재 실패!!");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("연결 실패!!");
}
}
//db와 연동하여 로그인하기
public int letLogin() {
Login l1 = new Login();
System.out.println("---------------------------------------------");
System.out.println("<회원-로그인>");
System.out.println("*1.확인 2.취소");
l1.setID();
l1.setPW();
String id = l1.getID();
String pw = l1.getPW();
int result = 1;
try {
stmt = conn.createStatement();
sql = "select * from java.member where ID='" + id + "';";
rs = stmt.executeQuery(sql);
if (rs.next() == false || (id.isEmpty()) == true) { // id가 존재x
result = 1;
} else {
sql = "select * from java.member where ID='" + id + "';";
rs = stmt.executeQuery(sql);
while (rs.next() == true) { // 다음값의
if(rs.getString(3).equals(pw)) { // pw와 같은지 비교
result = 0; // 같으면 로그인 성공
try {
BufferedWriter writer = new BufferedWriter(new FileWriter("id.txt"));
writer.write(id);
writer.close();
} catch(Exception ex) {
}
}else // 아이디는같고 pw가 다른경우
result = 1;
}
}
} catch (Exception ee) {
System.out.println("문제있음");
ee.printStackTrace();
}
return result;
}
}
//Login클래스
public class Login{
private String ID;
private String PW;
Scanner scan = new Scanner(System.in);
//생성자 메서드
public Login(String iD, String pW) {
super();
ID = iD;
PW = pW;
}
public Login() {}
//getter and setter
public String getID() {
return ID;
}
public void setID(String iD) {
ID = iD;
}
public void setID() {
System.out.print("ID : ");
ID = scan.next();
}
public String getPW() {
return PW;
}
public void setPW(String pW) {
PW = pW;
}
public void setPW() {
System.out.print("PW : ");
PW = scan.next();
}
//번호선택
public void choosenum() {
int choosenum;
System.out.print("\n번호 : ");
choosenum = scan.nextInt();
switch(choosenum) {
case 1 : //좌석선택불러오기
System.out.println("\n로그인 되었습니다.");
Seat s1 = new Seat();
s1.callSeat();
break;
case 2 : //전(처음)으로 돌아가기
Pcroom p1 = new Pcroom();
p1.main(null);
break;
default : //1,2를 제외한 번호를 선택했을 때 실행
System.out.println("다시입력해주세요. \n");
choosenum();
break;
}
}
//Login의 기능을 담은 클래스
public void callLogin() {
LoginCheck lc = new LoginCheck();
lc.checkpwid();
}
}
//LoginCheck클래스
class LoginCheck {
private LoginDB ldb = new LoginDB();
private Login l1 = new Login();
private int num;
Scanner scan = new Scanner(System.in);
//번호선택
public void choosenum() {
int choosenum;
System.out.print("번호 : ");
choosenum = scan.nextInt();
switch(choosenum) {
case 1 : //checkpwid메서드 불러옴
checkpwid();
break;
case 2 : //전(처음)으로 돌아가기
Pcroom p1 = new Pcroom();
p1.main(null);
break;
default : //1,2이 아닌 다른 번호를 선택했을 때 실행
System.out.println("다시입력해주세요. \n");
choosenum();
break;
}
}
//로그인이 잘 되었는지 안되었는지 알려주는 메서드
public void checkpwid() {
this.num = ldb.letLogin();
if(num == 0) {
l1.choosenum();
}else if(num == 1){
System.out.println("ID 또는 PW를 확인해주세요.");
this.choosenum();
checkpwid();
}
}
} | [
"[email protected]"
] | |
d257407ff13d37f57c85d7f036899f30ce971070 | 856b97fb0da221d1b4515d5f858d93ace20f154c | /app/src/main/java/com/byrongjr/educationalhangouts/GetNearbyPlacesData.java | fc55a626cbbf9356ac6bb2deb23a46a98e3fa34f | [] | no_license | byrongjr49/EducationalHangouts | a82a4a5ca9c7ec4b5bf80947fb6b400252bbe532 | f5aef45b63f4edd3ed2af47c905127debd6eefcc | refs/heads/master | 2021-08-23T01:32:18.937702 | 2017-12-02T05:21:17 | 2017-12-02T05:21:17 | 105,741,692 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,708 | java | package com.byrongjr.educationalhangouts;
import android.os.AsyncTask;
import android.util.Log;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.List;
/**
* Created by navneet on 23/7/16.
*/
public class GetNearbyPlacesData extends AsyncTask<Object, String, String> {
String googlePlacesData;
GoogleMap mMap;
String url;
@Override
protected String doInBackground(Object... params) {
try {
Log.d("GetNearbyPlacesData", "doInBackground entered");
mMap = (GoogleMap) params[0];
url = (String) params[1];
DownloadUrl downloadUrl = new DownloadUrl();
googlePlacesData = downloadUrl.readUrl(url);
Log.d("GooglePlacesReadTask", "doInBackground Exit");
} catch (Exception e) {
Log.d("GooglePlacesReadTask", e.toString());
}
return googlePlacesData;
}
@Override
protected void onPostExecute(String result) {
Log.d("GooglePlacesReadTask", "onPostExecute Entered");
List<HashMap<String, String>> nearbyPlacesList = null;
DataParser dataParser = new DataParser();
nearbyPlacesList = dataParser.parse(result);
ShowNearbyPlaces(nearbyPlacesList);
Log.d("GooglePlacesReadTask", "onPostExecute Exit");
}
private void ShowNearbyPlaces(List<HashMap<String, String>> nearbyPlacesList) {
for (int i = 0; i < nearbyPlacesList.size(); i++) {
Log.d("onPostExecute","Entered into showing locations");
MarkerOptions markerOptions = new MarkerOptions();
HashMap<String, String> googlePlace = nearbyPlacesList.get(i);
double lat = Double.parseDouble(googlePlace.get("lat"));
double lng = Double.parseDouble(googlePlace.get("lng"));
String placeName = googlePlace.get("place_name");
String vicinity = googlePlace.get("vicinity");
LatLng latLng = new LatLng(lat, lng);
markerOptions.position(latLng);
markerOptions.title(placeName);
markerOptions.snippet(vicinity);
markerOptions.icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_launcher2));
mMap.addMarker(markerOptions);
//move map camera
mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
mMap.animateCamera(CameraUpdateFactory.zoomTo(11));
}
}
}
| [
"[email protected]"
] | |
2f6c85f3189a00c0f21f4909164a67bffb2da42b | 682a0788c52c7ad3098fb9f0c63ba6c0d7f1d0e6 | /src/main/java/com/uol/entities/Temperatura.java | 9eb785a0e6de759cd82f4cd03ac6c059afe1cf66 | [] | no_license | fePremazzi/uol-teste | a63a04028459a5a4175b351fab6099b65c890526 | 97dba55987abf696005c58a807609c1f98240ea0 | refs/heads/master | 2022-12-10T16:23:18.545780 | 2018-10-11T05:01:14 | 2018-10-11T05:01:14 | 151,853,911 | 0 | 0 | null | 2022-11-16T10:51:09 | 2018-10-06T15:32:51 | Java | UTF-8 | Java | false | false | 835 | java | package com.uol.entities;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@Entity
@Table(name = "temperatura")
public class Temperatura {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long idTemp;
private float tempMin;
private float tempMax;
public Long getIdTemp() {
return idTemp;
}
public void setIdTemp(Long idTemp) {
this.idTemp = idTemp;
}
public float getTempMin() {
return tempMin;
}
public void setTempMin(float tempMin) {
this.tempMin = tempMin;
}
public float getTempMax() {
return tempMax;
}
public void setTempMax(float tempMax) {
this.tempMax = tempMax;
}
}
| [
"[email protected]"
] | |
fb47d770170d9403de6f559bea1750165d8f9528 | b11f17fa3fc0ecf6ba59ae614c4715684f23a927 | /Circular.java | e0e3cb80268183d7b55afa12337917b295dc10d1 | [] | no_license | kashish2909/Java_problems | 381b4412efe1920741e6da98fd96c67fb29fbb35 | 1ed8488f77aa1c7efef658deaddc96b0edfad934 | refs/heads/master | 2023-01-24T18:52:33.342149 | 2020-11-29T05:10:18 | 2020-11-29T05:10:18 | 316,880,449 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,977 | java | public class Circular {
public static void main(String[] args) {
Circular list=new Circular();
list.insertAtEnd(0);
list.show();
list.insertAtEnd(1);
list.show();
list.insertAtEnd(2);
list.show();
list.insertAtBeginning(69);
list.show();
list.insertAfter(69, 70);
list.show();
list.delete(2);
list.show();
}
void delete(int key){
Node temp=head;
if(head.next==head && head.data==key){
head=null;
}
else if(head.data==key){
while(temp.next!=head)
temp=temp.next;
head=head.next;
temp.next=head;
}
else{
while(temp.next!=head && temp.next.data!=key){
temp=temp.next;
}
temp.next=temp.next.next;
}
}
void insertAfter(int after,int key){
Node temp=head;
Node new_node=new Node(key);
if(head.data==after && head.next==head){
head.next=new_node;
new_node.next=head;
}
else{
while(temp.next!=head && temp.data!=after){
temp=temp.next;
}
if(temp.next==head && temp.data!=after)
System.out.println("No element found");
else{
new_node.next=temp.next;
temp.next=new_node;
}
}
}
void insertAtBeginning(int key){
if(head==null){
head=new Node(key);
head.next=head;
}
else{
Node temp=head;
Node new_node=new Node(key);
while(temp.next!=head)
temp=temp.next;
temp.next=new_node;
new_node.next=head;
head=new_node;
}
}
void insertAtEnd(int key){
if(head==null){
head=new Node(key);
head.next=head;
}
else{
Node temp=head;
while( temp.next!=head){
temp=temp.next;
}
Node new_node=new Node(key);
temp.next=new_node;
new_node.next=head;
}
}
void show(){
Node temp=head;
if(temp!=null && temp.next==head){
System.out.println(temp.data+" ");
}
else{
if(temp!=null)
{
while(temp.next!=head){
System.out.print(temp.data+" ");
temp=temp.next;
}
System.out.print(temp.data+" ");
System.out.println();
}
}
}
Node head;
class Node{
Node next;
int data;
Node(int value){
data=value;
}
}
} | [
"[email protected]"
] | |
20e91b30eea87c05406e43d7c624719be9353d59 | 5dbc806877b9cd77b03369f8b8c01e4b7c5df41a | /src/notaFiscal/Pagamento.java | f8f8a710e0fba552ecb6ea3053f07150ec14081c | [] | no_license | marcelobentes/JavaGitHub | bc5b44259fafbb68bccfa1cfa7f89f6bea2a447e | 6373810d56b46cd5132b4638e5f3c0367712278f | refs/heads/master | 2023-06-25T15:40:00.573881 | 2021-08-02T13:40:45 | 2021-08-02T13:40:45 | 357,990,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 291 | java | package notaFiscal;
public abstract class Pagamento {
private double valor;
public Pagamento(double valor) {
super();
this.valor = valor;
}
public double getValor() {
return valor;
}
public void setValor(double valor) {
this.valor = valor;
}
public abstract String imprimir();
}
| [
"[email protected]"
] | |
23b5ec868791b6e70228f86c219a35ff799d1e2a | 0cd52ca4045927d63ca350f6cecfd1d9a8c39bc5 | /app/src/main/java/widget/WheelView.java | bc614342a67af09f5cdc5bd318b2fb7f49915e7c | [] | no_license | sengeiou/BluetoothTest-817 | fdd44f89b7696b078c349b610ea96313ad2847f2 | 9405c19f4554f0455e36c8588764203000f19c7a | refs/heads/master | 2021-06-24T21:40:44.454553 | 2017-08-21T02:22:44 | 2017-08-21T02:22:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,514 | java | package widget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.GradientDrawable.Orientation;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.SoundEffectConstants;
import android.view.View;
import com.senssun.bluetooth.tools.R;
public class WheelView extends TosGallery {
private int resouceId=0;
/**
* The selector.
*/
private Drawable mSelectorDrawable = null;
/**
* The bound rectangle of selector.
*/
private Rect mSelectorBound = new Rect();
/**
* The top shadow.
*/
private GradientDrawable mTopShadow = null;
/**
* The bottom shadow.
*/
private GradientDrawable mBottomShadow = null;
/**
* Shadow colors
*/
private static final int[] SHADOWS_COLORS = { 0x00000000, 0x00FFFFFF, 0x00FFFFFF };
/**
* The constructor method.
*
* @param context
*/
public WheelView(Context context) {
super(context);
initialize(context);
}
/**
* The constructor method.
*
* @param context
* @param attrs
*/
public WheelView(Context context, AttributeSet attrs) {
super(context, attrs);
int id = attrs.getAttributeResourceValue(null, "typeface", 0);
if (id != 0) {
resouceId = Integer.valueOf(context.getResources().getString(resouceId)); //��������ȡ���� typefaceName="@string/typefaceName"��ʹ��
} else {
if(attrs.getAttributeValue(null, "typeface")!=null){
resouceId = Integer.valueOf(attrs.getAttributeValue(null, "typeface")); //ȡ����ֵ typefaceName="Proxima-Nova-Semibold"��ʹ��
}
}
initialize(context);
}
/**
* The constructor method.
*
* @param context
* @param attrs
* @param defStyle
*/
public WheelView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
int id = attrs.getAttributeResourceValue(null, "typeface", 0);
if (id != 0) {
resouceId = Integer.valueOf(context.getResources().getString(resouceId)); //��������ȡ���� typefaceName="@string/typefaceName"��ʹ��
} else {
if(attrs.getAttributeValue(null, "typeface")!=null){
resouceId = Integer.valueOf(attrs.getAttributeValue(null, "typeface")); //ȡ����ֵ typefaceName="Proxima-Nova-Semibold"��ʹ��
}
}
initialize(context);
}
/**
* Initialize.
*
* @param context
*/
private void initialize(Context context) {
this.setVerticalScrollBarEnabled(false);
this.setSlotInCenter(true);
this.setOrientation(TosGallery.VERTICAL);
this.setGravity(Gravity.CENTER_HORIZONTAL);
this.setUnselectedAlpha(1.0f);
// This lead the onDraw() will be called.
this.setWillNotDraw(false);
// The selector rectangle drawable.
if(resouceId==2){
this.mSelectorDrawable = getContext().getResources().getDrawable(R.drawable.wheel_val2);
}else if(resouceId==3){
this.mSelectorDrawable = getContext().getResources().getDrawable(R.drawable.wheel_val3);
}else{
this.mSelectorDrawable = getContext().getResources().getDrawable(R.drawable.wheel_val);
}
this.mTopShadow = new GradientDrawable(Orientation.TOP_BOTTOM, SHADOWS_COLORS);
this.mBottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP, SHADOWS_COLORS);
// The default background.
if(resouceId==2){
this.setBackgroundResource(R.drawable.wheel_bg2);
}else{
this.setBackgroundResource(R.drawable.wheel_bg);
}
// Disable the sound effect default.
this.setSoundEffectsEnabled(false);
}
/**
* Called by draw to draw the child views. This may be overridden by derived classes to gain
* control just before its children are drawn (but after its own view has been drawn).
*/
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
// After draw child, we do the following things:
// +1, Draw the center rectangle.
// +2, Draw the shadows on the top and bottom.
drawCenterRect(canvas);
drawShadows(canvas);
}
/**
* setOrientation
*/
@Override
public void setOrientation(int orientation) {
if (TosGallery.HORIZONTAL == orientation) {
throw new IllegalArgumentException("The orientation must be VERTICAL");
}
super.setOrientation(orientation);
}
/**
* Call when the ViewGroup is layout.
*/
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
int galleryCenter = getCenterOfGallery();
View v = this.getChildAt(0);
int height = (null != v) ? v.getMeasuredHeight() : 50;
int top = galleryCenter - height / 2;
int bottom = top + height;
mSelectorBound.set(getPaddingLeft(), top, getWidth() - getPaddingRight(), bottom);
}
@Override
protected void selectionChanged() {
super.selectionChanged();
playSoundEffect(SoundEffectConstants.CLICK);
}
/**
* Draw the selector drawable.
*
* @param canvas
*/
private void drawCenterRect(Canvas canvas) {
if (null != mSelectorDrawable) {
mSelectorDrawable.setBounds(mSelectorBound);
mSelectorDrawable.draw(canvas);
}
}
/**
* Draw the shadow
*
* @param canvas
*/
private void drawShadows(Canvas canvas) {
int height = (int) (2.0 * mSelectorBound.height());
mTopShadow.setBounds(0, 0, getWidth(), height);
mTopShadow.draw(canvas);
mBottomShadow.setBounds(0, getHeight() - height, getWidth(), getHeight());
mBottomShadow.draw(canvas);
}
}
| [
"[email protected]"
] | |
68a88b8d890008b5c974380c1351589d7cb09b0c | 3bd7b61cd56fed1734f8755f407f6b4b7a50b707 | /src/com/jcwhatever/nucleus/managed/reflection/IReflectedField.java | 10520fdaf0da9b5c24c533d88cfb3f5210cecf1d | [
"MIT"
] | permissive | TalesOfArboria/NucleusFramework | 9855ba0363d9c846fdcf0c9857d0c1893a38c5af | 0c0b3c7bfaecdb391ab56904c5c4a03b0bc21146 | refs/heads/master | 2021-05-31T01:40:25.345388 | 2016-03-06T15:53:40 | 2016-03-06T15:53:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,111 | java | /*
* This file is part of NucleusFramework for Bukkit, licensed under the MIT License (MIT).
*
* Copyright (c) JCThePants (www.jcwhatever.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.jcwhatever.nucleus.managed.reflection;
import com.jcwhatever.nucleus.mixins.INamed;
import com.jcwhatever.nucleus.mixins.IWrapper;
import java.lang.reflect.Field;
import javax.annotation.Nullable;
/**
* Interface for a wrapper of a {@link Field}.
*/
public interface IReflectedField extends INamed, IWrapper<Field> {
/**
* Get the field type.
*/
IReflectedType getReflectedType();
/**
* Get the field modifiers as they were when reflected.
*/
int getModifiers();
/**
* Get the field modifiers as they are now.
*/
int getCurrentModifiers();
/**
* Determine if the field is static.
*/
boolean isStatic();
/**
* Determine if the field is final.
*/
boolean isFinal();
/**
* Determine if the field is private.
*/
boolean isPrivate();
/**
* Determine if the field is native.
*/
boolean isNative();
/**
* Determine if the field is protected.
*/
boolean isProtected();
/**
* Determine if the field is public.
*/
boolean isPublic();
/**
* Determine if the field is strict.
*/
boolean isStrict();
/**
* Determine if the field is transient.
*/
boolean isTransient();
/**
* Determine if the field is volatile.
*/
boolean isVolatile();
/**
* Get the field value.
*
* @param instance The instance to get the value from. Null for static.
*/
Object get(@Nullable Object instance);
/**
* Set the field value.
*
* @param instance The instance to set the value on. Null for static.
* @param value The value to set.
*/
void set(@Nullable Object instance, @Nullable Object value);
/**
* Get the {@link java.lang.reflect.Field} object.
*/
@Override
Field getHandle();
}
| [
"[email protected]"
] | |
1e71485d89c80dd6ee7358bdf00fbeeed30633e5 | 29b24066df09249cb40400ec58df81283c2d3ed1 | /src/com/jysoft/cbb/vo/MenuVo.java | 59f16a2b3f943146d8bf997da6eb681160c986d6 | [] | no_license | JYCoders/jFrame-1 | c91d8bdeb266b7fbc5e7732cb8470bca3bfbbf1b | d3088ed3dceccde7ae1c0aad455d68aa383d161f | refs/heads/master | 2020-12-28T08:32:39.569621 | 2016-09-05T11:23:25 | 2016-09-05T11:23:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,611 | java | package com.jysoft.cbb.vo;
import java.util.Date;
/**
*
* 类功能描述: 菜单实体类
* 创建者: 吴立刚
* 创建日期: 2016-1-26
*
* 修改内容:
* 修改者:
* 修改日期:
*/
public class MenuVo extends BaseVo {
private String menuId; // 菜单ID
private String menuName; // 菜单名称
private String display; // 菜单描述
private String linkUrl; // 链接地址
private String linkTarget; // 目标页面
private String icon; // 默认图标
private String iconOpen; // 展开图标
private Long openStatus; // 开启状态
private Long menuType; // 菜单类别
private Date modifyDate;
private Integer ordinal;
private String parentId; // 父菜单ID
private Integer pageWidth; // 页面宽度
private Integer pageHeight; // 页面高度
private Integer defaultWidth; // 原始宽度
private Integer defaultHeight; // 原始高度
private String nodeType; // 树节点类型
private String menuCode; // code
public String getMenuId() {
return this.menuId;
}
public void setMenuId(String menuId) {
this.menuId = menuId;
}
public String getMenuName() {
return this.menuName;
}
public void setMenuName(String menuName) {
this.menuName = menuName;
}
public String getDisplay() {
return this.display;
}
public void setDisplay(String display) {
this.display = display;
}
public String getParentId() {
return this.parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getLinkUrl() {
return this.linkUrl;
}
public void setLinkUrl(String linkUrl) {
this.linkUrl = linkUrl;
}
public String getLinkTarget() {
return this.linkTarget;
}
public void setLinkTarget(String linkTarget) {
this.linkTarget = linkTarget;
}
public String getIcon() {
return this.icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getIconOpen() {
return this.iconOpen;
}
public void setIconOpen(String iconOpen) {
this.iconOpen = iconOpen;
}
public Long getOpenStatus() {
return this.openStatus;
}
public void setOpenStatus(Long openStatus) {
this.openStatus = openStatus;
}
public Long getMenuType() {
return this.menuType;
}
public void setMenuType(Long menuType) {
this.menuType = menuType;
}
public Integer getOrdinal() {
return this.ordinal;
}
public void setOrdinal(Integer ordinal) {
this.ordinal = ordinal;
}
public Integer getPageWidth() {
return this.pageWidth;
}
public void setPageWidth(Integer pageWidth) {
this.pageWidth = pageWidth;
}
public Integer getPageHeight() {
return this.pageHeight;
}
public void setPageHeight(Integer pageHeight) {
this.pageHeight = pageHeight;
}
public Date getModifyDate() {
return modifyDate;
}
public void setModifyDate(Date modifyDate) {
this.modifyDate = modifyDate;
}
public void setDefaultWidth(Integer defaultWidth) {
this.defaultWidth = defaultWidth;
}
public Integer getDefaultWidth() {
return defaultWidth;
}
public void setDefaultHeight(Integer defaultHeight) {
this.defaultHeight = defaultHeight;
}
public Integer getDefaultHeight() {
return defaultHeight;
}
public String getNodeType() {
return nodeType;
}
public void setNodeType(String nodeType) {
this.nodeType = nodeType;
}
public String getMenuCode() {
return menuCode;
}
public void setMenuCode(String menuCode) {
this.menuCode = menuCode;
}
}
| [
"[email protected]"
] | |
15ae889f039161bd418bec7961272d3ac0fb2113 | 56d81af350841e8d781382281947a19d159f5d8f | /src/main/java/com/eclubprague/cardashboard/core/preferences/SettingsFragment.java | eed3e52420bc2cec6f2f790e1bc3f8ddbfd68952 | [] | no_license | blahami2/CarDashboardCore | 882c37f599264dcb92a3cc16a75b84a614c06313 | 90ef8821f704a4845207b27de023706b3f2812af | refs/heads/master | 2021-01-16T18:37:13.534972 | 2016-01-11T17:26:47 | 2016-01-11T17:26:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,056 | java | package com.eclubprague.cardashboard.core.preferences;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.widget.Toast;
import com.eclubprague.cardashboard.core.R;
import java.util.ArrayList;
import java.util.Set;
public class SettingsFragment extends PreferenceFragment implements Preference.OnPreferenceChangeListener {
public static final String ENABLE_BT_KEY = "enable_bluetooth_preference";
public static final String BLUETOOTH_LIST_KEY = "bluetooth_list_preference";
public static final String IMPERIAL_UNITS_KEY = "imperial_units_preference";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
ArrayList<CharSequence> pairedDeviceStrings = new ArrayList<>();
ArrayList<CharSequence> vals = new ArrayList<>();
ListPreference listBtDevices = (ListPreference) getPreferenceScreen()
.findPreference(BLUETOOTH_LIST_KEY);
final BluetoothAdapter mBtAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBtAdapter == null) {
listBtDevices
.setEntries(pairedDeviceStrings.toArray(new CharSequence[0]));
listBtDevices.setEntryValues(vals.toArray(new CharSequence[0]));
Toast.makeText(this.getActivity(), "This device does not support Bluetooth.", Toast.LENGTH_LONG).show();
return;
}
final Activity thisActivity = this.getActivity();
listBtDevices.setEntries(new CharSequence[1]);
listBtDevices.setEntryValues(new CharSequence[1]);
listBtDevices.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
if (mBtAdapter == null || !mBtAdapter.isEnabled()) {
Toast.makeText(thisActivity,
"This device does not support Bluetooth or it is disabled.",
Toast.LENGTH_LONG).show();
return false;
}
return true;
}
});
Set<BluetoothDevice> pairedDevices = mBtAdapter.getBondedDevices();
if (pairedDevices.size() > 0) {
for (BluetoothDevice device : pairedDevices) {
pairedDeviceStrings.add(device.getName() + "\n" + device.getAddress());
vals.add(device.getAddress());
}
}
listBtDevices.setEntries(pairedDeviceStrings.toArray(new CharSequence[0]));
listBtDevices.setEntryValues(vals.toArray(new CharSequence[0]));
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
return false;
}
} | [
"[email protected]"
] | |
97a84e5dd132f5d6e842aca0947a1e73fa6500ad | d67485faf24b01c342ef9f313991a29b6b505e5d | /HolaMundo/src/main/java/HolaMundo.java | daf13c94fe4602dda4cc3c52cd83c24a09ebc93d | [] | no_license | PAA97/actividadGitAB | dfab9e44a68e5c787a079d9d7866c489f15f20e7 | e56f0ada2d356090ce43b50c661f4adf1ac6330c | refs/heads/master | 2023-03-01T20:55:13.900052 | 2021-02-10T09:57:56 | 2021-02-10T09:57:56 | 337,674,761 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 394 | 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.
*/
/**
*
* @author Diurno
*/
public class HolaMundo {
public void imprimirHolaMundo() {
System.out.println("Hola Mundo");
System.out.println("Adiós Mundo");
}
}
| [
"[email protected]"
] | |
b75d54a0fd0bfa5bd47a4e9708acd7da8409753e | 5b61c71f395ad61d73c7ec673d3058a154c4421a | /src/estruturaCondicional/Exerc04.java | 44550bd24411a46b76a78d79f5baa451f71cfac0 | [] | no_license | Paulojoserc/udemy | bdabc6dbaf3ba842aa209fbdb760ede6b53ab560 | 0e391c0611b3670bdda112969f7615544f84839b | refs/heads/main | 2023-03-10T05:11:21.741733 | 2021-02-19T01:31:36 | 2021-02-19T01:31:36 | 340,215,665 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 610 | java | package estruturaCondicional;
import java.util.Scanner;
public class Exerc04 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int duracao, dia= 24, horaI, horaF;
System.out.println("Digite a hora de inicio do jogo");
horaI = sc.nextInt();
System.out.println("Digite a hora do fim do jogo");
horaF = sc.nextInt();
duracao = dia - horaI + horaF;
if (duracao> 24 ) {
duracao = duracao - 24;
System.out.println(" O jogo durou :"+duracao +" Hora(s)");
}else {
System.out.println(" O jogo durou :"+duracao +" Hora(s)");
}
sc.close();
}
}
| [
"[email protected]"
] | |
205c9b09522dc250fde7b4596f5f9476d474b87a | 967f20c672aa084ad7f51423a75ce6264216608b | /ProductFinal/src/main/java/jsimmons/productfinal/dao/ProductDAOImpl.java | 065e6f82d16427fbcb320908d09aeb842748cfa8 | [] | no_license | DataPartnering/EcommerceDashboardRestAPI | 84677fa290eb13a8c114c0c26d3122df2b4fea54 | 04488ccd4cd89267ec8270b689559132937b1cc8 | refs/heads/master | 2020-12-08T22:35:40.881704 | 2020-01-10T19:33:06 | 2020-01-10T19:33:06 | 233,114,109 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,300 | java | package jsimmons.productfinal.dao;
import java.util.List;
import javax.persistence.EntityManager;
import org.hibernate.Session;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import jsimmons.productfinal.model.Product;
@Repository
public class ProductDAOImpl implements ProductDAO {
@Autowired
private EntityManager entityManager;
@Override
public List<Product> get() {
Session currentSession = entityManager.unwrap(Session.class);
Query<Product> query = currentSession.createQuery("from Product", Product.class);
List<Product> list = query.getResultList();
return list;
}
@Override
public Product get(long id) {
Session currentSession = entityManager.unwrap(Session.class);
Product productObj = currentSession.get(Product.class, id);
return productObj;
}
@Override
public void save(Product product) {
Session currentSession = entityManager.unwrap(Session.class);
currentSession.saveOrUpdate(product);
}
@Override
public void delete(long id) {
Session currentSession = entityManager.unwrap(Session.class);
Product productObj = currentSession.get(Product.class, id);
currentSession.delete(productObj);
}
}
| [
"[email protected]"
] | |
e20c9740e37585b4a579f05e609326b9df3f6e25 | b345f9610b27bae93a7b17e53c405a7acf8f91c2 | /src/main/java/com/ikanow/titan/diskstorage/mongo/MongoKeyColumnValueFlatStore.java | e7d2ee33775ce0a15da81e58aa4c1ba7c6542008 | [
"Apache-2.0"
] | permissive | jfreydank/titan-mongo | 628fbd5807c5a3abc6c1238d2cd7368464226a8e | 663abe493bd481e2d0e02acc45b517d26512fffb | refs/heads/master | 2021-01-21T02:35:58.302902 | 2015-03-04T15:11:48 | 2015-03-04T15:11:56 | 31,662,464 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,767 | java | package com.ikanow.titan.diskstorage.mongo;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentNavigableMap;
import java.util.concurrent.ConcurrentSkipListMap;
import javax.annotation.Nonnull;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import com.mongodb.BulkWriteOperation;
import com.mongodb.BulkWriteResult;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
import com.mongodb.WriteResult;
import com.thinkaurelius.titan.diskstorage.Entry;
import com.thinkaurelius.titan.diskstorage.EntryList;
import com.thinkaurelius.titan.diskstorage.StaticBuffer;
import com.thinkaurelius.titan.diskstorage.StorageException;
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStore;
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyIterator;
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyRangeQuery;
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeySliceQuery;
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.SliceQuery;
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.StoreTransaction;
import com.thinkaurelius.titan.diskstorage.util.RecordIterator;
/**
* A MongoDB implementation of {@link KeyColumnValueStore}.
*
* @author Joern Freydank [email protected]
*/
public class MongoKeyColumnValueFlatStore implements KeyColumnValueStore {
private static final Logger logger = LoggerFactory.getLogger(MongoKeyColumnValueFlatStore.class);
private final String name;
private final ConcurrentNavigableMap<StaticBuffer, ColumnValueStore> kcv;
protected DB db = null;
protected DBCollection dbCollection = null;
public MongoKeyColumnValueFlatStore(@Nonnull DB db,final String name) {
Preconditions.checkArgument(StringUtils.isNotBlank(name));
this.name = name;
this.db = db;
this.dbCollection=db.getCollection(name);
this.kcv = new ConcurrentSkipListMap<StaticBuffer, ColumnValueStore>();
}
@Override
public EntryList getSlice(KeySliceQuery query, StoreTransaction txh) throws StorageException {
//logger.debug("getSlice S:{} K:{},start:{} end;{}",name,MongoConversionUtil.staticBuffer2Bytes(query.getKey()),MongoConversionUtil.staticBuffer2MongoFieldNameHex(query.getSliceStart()),MongoConversionUtil.staticBuffer2MongoFieldNameHex(query.getSliceEnd()));
EntryList slice = null;
//mongo
DBObject dbQuery = MongoQueryBuilder.createKeySliceQuery(query) ;
DBCursor dbCursor = dbCollection.find(dbQuery);
int limit = query.getLimit();
if(limit > 0){
dbCursor.limit(limit);
}
slice = MongoQueryBuilder.convertMongoCursorToEntryList(dbCursor);
logger.trace("getSlice S:{} K:{},start:{} end;{}={}",name,MongoConversionUtil.staticBuffer2MongoFieldNameHex(query.getKey()),MongoConversionUtil.staticBuffer2MongoFieldNameHex(query.getSliceStart()),MongoConversionUtil.staticBuffer2MongoFieldNameHex(query.getSliceEnd()),slice.size());
return slice;
}
@Override
public Map<StaticBuffer, EntryList> getSlice(List<StaticBuffer> keys, SliceQuery query, StoreTransaction txh)
throws StorageException {
logger.debug("getSlice S:{} Ks:<map>,start:{} end;{}", name,
MongoConversionUtil.staticBuffer2MongoFieldNameHex(query.getSliceStart()),
MongoConversionUtil.staticBuffer2MongoFieldNameHex(query.getSliceEnd()));
int limit = query.getLimit();
Map<StaticBuffer, EntryList> resultMap = Maps.newHashMap();
if (limit == SliceQuery.NO_LIMIT) {
DBObject dbQuery = MongoQueryBuilder.createKeysSliceQuery(keys, query);
DBCursor dbCursor = dbCollection.find(dbQuery);
dbCursor.limit(limit);
resultMap = MongoQueryBuilder.convertMongoCursorToEntryMap(dbCursor);
} else {
// if limit use getSlice(key, ...) function since we cannot limit
// per key.
for (StaticBuffer key : keys) {
resultMap.put(key, getSlice(new KeySliceQuery(key, query), txh));
}
}
return resultMap;
}
@Override
public void mutate(StaticBuffer key, List<Entry> additions, List<StaticBuffer> deletions, StoreTransaction txh) throws StorageException {
//byte[] entryKey = MongoConversionUtil.staticBuffer2Bytes(key);
String entryKeyId = MongoConversionUtil.staticBuffer2MongoFieldNameHex(key);
logger.trace("mutate:S:{} E:{}",name,entryKeyId);
// mongo
for (StaticBuffer deletion : deletions) {
String delColumn = MongoConversionUtil.staticBuffer2MongoFieldNameHex(deletion);
DBObject queryObject = MongoQueryBuilder.createKeyColumnQuery(key, deletion);
Object removedValue = dbCollection.remove(queryObject);
logger.trace("mutate:S:{} E:{} D:{} V{}:",name,entryKeyId,delColumn,removedValue);
}
if (!additions.isEmpty()) {
// 2. Unordered bulk operation - no guarantee of order of operation
BulkWriteOperation builder = dbCollection.initializeUnorderedBulkOperation();
//builder.find(new BasicDBObject("_id", 1)).removeOne();
//builder.find(new BasicDBObject("_id", 2)).removeOne();
for (Entry e : additions) {
StaticBuffer cb = e.getColumn();
String addColumn = MongoConversionUtil.staticBuffer2MongoFieldNameHex(cb);
String addColumnDebug = MongoConversionUtil.staticBuffer2String(cb);
String addValueDebug = MongoConversionUtil.staticBuffer2String(e.getValue());
logger.trace("mutate:S:{} E:{} Converted StaticBuffer1 for {}={} ,{}",name,entryKeyId,e.getValue(),addValueDebug,addColumnDebug);
DBObject addEntry = MongoQueryBuilder.createNew(key,cb,e.getValue());
addEntry.put(MongoQueryBuilder.COLUMN_NAME_DEBUG, addColumnDebug);
addEntry.put(MongoQueryBuilder.VALUE_DEBUG, addColumnDebug);
builder.insert(addEntry);
}
BulkWriteResult result = builder.execute();
logger.trace("BulkWriteResult:{}",result);
} //if !additions
}
@Override
public void acquireLock(StaticBuffer key, StaticBuffer column, StaticBuffer expectedValue, StoreTransaction txh) throws StorageException {
throw new UnsupportedOperationException();
}
@Override
public KeyIterator getKeys(final KeyRangeQuery query, final StoreTransaction txh) throws StorageException {
logger.debug("getKeys KeyRange: {}",query.getKeyStart(),query.getKeyEnd());
DBObject queryObject = MongoQueryBuilder.createKeyRangeQuery(query);
List<String> keys = dbCollection.distinct(MongoQueryBuilder.KEY,queryObject);
return new RowIterator(dbCollection,keys, query, txh);
}
@Override
public KeyIterator getKeys(SliceQuery query, StoreTransaction txh) throws StorageException {
logger.debug("getKeys sliceQuery");
DBObject queryObject = MongoQueryBuilder.createSliceQuery(query);
List<String> keys = dbCollection.distinct(MongoQueryBuilder.KEY,queryObject);
return new RowIterator(dbCollection,keys, query, txh);
}
@Override
public String getName() {
return name;
}
public void clear() {
kcv.clear();
WriteResult result = dbCollection.remove(MongoQueryBuilder.EMPTY);
logger.trace("clear result:"+result);
}
@Override
public void close() throws StorageException {
logger.trace("close()");
kcv.clear();
}
private static class RowIterator implements KeyIterator {
//private DBCursor dbCursor;
private final SliceQuery columnSlice;
private final StoreTransaction transaction;
private List<String> keys = null;
private boolean isClosed;
Iterator<String> rowKeyIterator = null;
private String currentRowKey = null;
private DBCollection dbCollection = null;
public RowIterator(DBCollection dbCollection, List<String> keys, SliceQuery query,StoreTransaction transaction) {
this.keys = keys;
this.columnSlice = query;
this.transaction = transaction;
this.rowKeyIterator = keys.iterator();
this.dbCollection = dbCollection;
}
@Override
public RecordIterator<Entry> getEntries() {
ensureOpen();
if (currentRowKey == null){
throw new IllegalStateException("getEntries() requires currentRowKey to be set, need to call next() first.");
}
// final KeySliceQuery keySlice = new KeySliceQuery(currentRow.getKey(), columnSlice);
return new RecordIterator<Entry>() {
DBObject queryObject = MongoQueryBuilder.createKeySliceQuery(currentRowKey, columnSlice);
private final Iterator<DBObject> items = dbCollection.find(queryObject).limit(columnSlice.getLimit()).iterator();
@Override
public boolean hasNext() {
ensureOpen();
return items.hasNext();
}
@Override
public Entry next() {
ensureOpen();
Entry entry = MongoQueryBuilder.convertMongoObjectToEntry(items.next());
return entry;
}
@Override
public void close() {
isClosed = true;
}
@Override
public void remove() {
throw new UnsupportedOperationException("Column removal not supported");
}
};
}
@Override
public boolean hasNext() {
ensureOpen();
return rowKeyIterator.hasNext();
}
@Override
public StaticBuffer next() {
ensureOpen();
currentRowKey = rowKeyIterator.next();
StaticBuffer next = MongoConversionUtil.mongoFieldNameHex2StaticBuffer(currentRowKey);
return next;
}
@Override
public void close() {
isClosed = true;
}
private void ensureOpen() {
if (isClosed){
throw new IllegalStateException("Iterator has been closed.");
}
}
@Override
public void remove() {
throw new UnsupportedOperationException("Key removal not supported");
}
}// RowIterator
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.