blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3b2d6cb83c8e4e463e1d14c3080ea278af10711a | 0945a8d1fbeb4fb74900c37ea32a7ed577113bc0 | /app/src/main/java/com/shownew/home/activity/ModifyPhoneNumberActivity.java | cde28293cb7d51ae2c812812c5dc7c65aa659ab8 | [] | no_license | dsn727455218/mShouNewProject | 348e4749260f841a7c32fe0fcb48c4a551462c99 | 6b00838498fa928e260ff6519fd099aa13c7e979 | refs/heads/master | 2020-04-12T14:57:42.565160 | 2017-09-28T08:41:02 | 2017-09-28T08:41:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,496 | java | package com.shownew.home.activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.shownew.home.R;
import com.shownew.home.ShouNewApplication;
import com.shownew.home.activity.common.BaseActivity;
import com.shownew.home.module.UserAPI;
import com.wp.baselib.utils.Preference;
import com.wp.baselib.utils.StringUtil;
import com.wp.baselib.utils.ToastUtil;
import com.wp.baselib.widget.TitleBarView;
import org.json.JSONException;
import org.json.JSONObject;
import okhttp3.Response;
/**
* 更换手机号码
*/
public class ModifyPhoneNumberActivity extends BaseActivity implements View.OnClickListener {
private EditText mInputVertifyCode;
private TextView mSendCode;
private EditText mLoginPasswordEd;
private EditText mNewsPhoneEd;
private ShouNewApplication mShouNewApplication;
private UserAPI mUserAPI;
private TimeTask mTimeTask;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_modify_phone_number);
mShouNewApplication = ShouNewApplication.getInstance();
mUserAPI = new UserAPI(mShouNewApplication);
mTimeTask = new TimeTask(60 * 1000, 1000);
initViews();
}
private void initViews() {
TitleBarView titleBarView = (TitleBarView) findViewById(R.id.headbar);
titleBarView.setTitle("更换电话号码");
titleBarView.setTitleTextColor(R.color.color_title);
titleBarView.setOnLeftOnClickListener(this);
titleBarView.setLeftIconAndText(R.drawable.back_arrow, "返回");
titleBarView.setTitleSize(20);
findViewById(R.id.commit_phone).setOnClickListener(this);
mSendCode = (TextView) findViewById(R.id.send_code);
mSendCode.setOnClickListener(this);
mInputVertifyCode = (EditText) findViewById(R.id.input_vertify_code);
mLoginPasswordEd = (EditText) findViewById(R.id.login_password);
mNewsPhoneEd = (EditText) findViewById(R.id.news_phone_ed);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.backBtn:
finish();
break;
case R.id.commit_phone: //提交
commitRegiser();
break;
case R.id.send_code:
vertifyPhone();
break;
}
}
/**
* 提交申请
*/
private void commitRegiser() {
final String phone = mNewsPhoneEd.getText().toString().trim();
if (!checkPhone(phone)) {
return;
}
final String code = mInputVertifyCode.getText().toString().trim();
if (TextUtils.isEmpty(code)) {
ToastUtil.showToast("请输入验证码");
return;
}
if (code.length() != 4) {
ToastUtil.showToast("验证码为4位");
return;
}
String password = mLoginPasswordEd.getText().toString().trim();
if (TextUtils.isEmpty(password)) {
ToastUtil.showToast("请输入登录密码");
return;
}
commitAccount(phone, password, code);
}
/**
* 修改手机号
*
* @param phone
* @param password
* @param phoneCode
*/
private void commitAccount(String phone, String password, String phoneCode) {
mUserAPI.changePhone(phone, phoneCode, password, mShouNewApplication.new ShouNewHttpCallBackLisener() {
@Override
protected Object parseData(String data) {
return null;
}
@Override
protected void resultData(Object data, JSONObject json, Response response, Exception exception) {
try {
closeLoadingDialog();
if (null == exception) {
if (200 == json.getInt(com.wp.baselib.Config.STATUS_CODE)) {
if (json.has("data")) {
JSONObject jsonObject = json.getJSONObject("data");
if (jsonObject.has("result")) {
int code = jsonObject.getInt("result");
//-2-该手机已被注册 -1-验证码错误 0-密码错误 1-更换成功
String msg = "";
switch (code) {
case 0:
msg = "密码错误";
break;
case 1:
msg = "更换成功";
break;
case -1:
msg = "验证码错误";
break;
case -2:
msg = "该手机已被注册";
break;
}
ToastUtil.showToast(msg);
if (1 == code) {
mainApplication.redirect(LoginActivity.class);
finish();
}
}
}
}
} else {
ToastUtil.showToast("修改失败");
}
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
protected void onLoading() {
createLoadingDialog();
}
});
}
/**
* 检查手机号码
*
* @param phone
* @return
*/
private boolean checkPhone(String phone) {
hideInputKeyword();
if (TextUtils.isEmpty(phone)) {
ToastUtil.showToast("请输入电话号码");
return false;
}
if (!StringUtil.isMobileNo(phone)) {
ToastUtil.showToast("请输入正确的电话号码");
return false;
}
return true;
}
private void vertifyPhone() {
String phone = mNewsPhoneEd.getText().toString().trim();
if (!checkPhone(phone)) {
return;
}
sendMsgCode(phone);
}
private void sendMsgCode(String phone) {
if (System.currentTimeMillis() - Preference.getLong(mShouNewApplication, "day_time", 0) > 24 * 60 * 60 * 1000) {
Preference.putInt(mShouNewApplication, "recoder_count", 0);
}
if (5 < Preference.getInt(mShouNewApplication, "recoder_count", 0)) {
ToastUtil.showToast("已经超过验证码发送次数");
return;
}
Preference.putLong(mShouNewApplication, "day_time", System.currentTimeMillis());
mUserAPI.sendMsgCode(phone, mShouNewApplication.new ShouNewHttpCallBackLisener() {
@Override
protected void resultData(Object data, JSONObject json, Response response, Exception exception) {
closeLoadingDialog();
if (exception == null) {
if (null != mTimeTask) {
mTimeTask.start();
mSendCode.setTextColor(mShouNewApplication.getResources().getColor(R.color.color_press));
//记录发送的次数
Preference.putInt(mShouNewApplication, "recoder_count", Preference.getInt(mShouNewApplication, "recoder_count", 0) + 1);
ToastUtil.showToast("验证码已发送到你的手机");
mSendCode.setEnabled(false);
return;
}
}
mSendCode.setEnabled(true);
mSendCode.setText("重新发送");
}
@Override
protected void onLoading() {
createLoadingDialog();
mSendCode.setEnabled(false);
mSendCode.setText("正在发送");
}
});
}
private class TimeTask extends CountDownTimer {
/**
* @param millisInFuture The number of millis in the future from the call
* to {@link #start()} until the countdown is done and {@link #onFinish()}
* is called.
* @param countDownInterval The interval along the way to receive
* {@link #onTick(long)} callbacks.
*/
public TimeTask(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
}
@Override
public void onTick(long millisUntilFinished) {
mSendCode.setText(String.format("%3d秒", millisUntilFinished / 1000));
}
@Override
public void onFinish() {
mSendCode.setEnabled(true);
mSendCode.setText("重新发送");
mSendCode.setTextColor(mShouNewApplication.getResources().getColor(R.color.select_color));
}
}
}
| [
"1399094187@qq.com"
] | 1399094187@qq.com |
b90a929f56ac26fe89b9db40929baf65a3126b78 | 204aed747ba6a86ed8abf49234fc99b3752a78b9 | /arcore-location/src/main/java/uk/co/appoly/arcorelocation/utils/KalmanLatLong.java | d518b37c0f7e281e6376733b6f02623a6e18efea | [
"MIT"
] | permissive | wannyk/ARCore-Location | dc3143b4d6afc7e41479239ba36c8d013d66e56b | 2ce54cb1d1e83d1fa04087683d0d90c0ef0d0787 | refs/heads/master | 2022-11-21T07:43:03.129418 | 2020-07-03T06:30:52 | 2020-07-03T06:30:52 | 276,799,257 | 0 | 0 | MIT | 2020-07-03T03:33:05 | 2020-07-03T03:33:05 | null | UTF-8 | Java | false | false | 3,774 | java | package uk.co.appoly.arcorelocation.utils;
/**
* Created by johnwedgbury on 01/06/2018.
*/
public class KalmanLatLong {
private final float MinAccuracy = 1;
private float Q_metres_per_second;
private long TimeStamp_milliseconds;
private double lat;
private double lng;
private float variance; // P matrix. Negative means object uninitialised.
// NB: units irrelevant, as long as same units used
// throughout
public int consecutiveRejectCount;
public KalmanLatLong(float Q_metres_per_second) {
this.Q_metres_per_second = Q_metres_per_second;
variance = -1;
consecutiveRejectCount = 0;
}
public long get_TimeStamp() {
return TimeStamp_milliseconds;
}
public double get_lat() {
return lat;
}
public double get_lng() {
return lng;
}
public float get_accuracy() {
return (float) Math.sqrt(variance);
}
public void SetState(double lat, double lng, float accuracy,
long TimeStamp_milliseconds) {
this.lat = lat;
this.lng = lng;
variance = accuracy * accuracy;
this.TimeStamp_milliseconds = TimeStamp_milliseconds;
}
// / <summary>
// / Kalman filter processing for lattitude and longitude
// / </summary>
// / <param name="lat_measurement_degrees">new measurement of
// lattidude</param>
// / <param name="lng_measurement">new measurement of longitude</param>
// / <param name="accuracy">measurement of 1 standard deviation error in
// metres</param>
// / <param name="TimeStamp_milliseconds">time of measurement</param>
// / <returns>new state</returns>
public void Process(double lat_measurement, double lng_measurement,
float accuracy, long TimeStamp_milliseconds, float Q_metres_per_second) {
this.Q_metres_per_second = Q_metres_per_second;
if (accuracy < MinAccuracy)
accuracy = MinAccuracy;
if (variance < 0) {
// if variance < 0, object is unitialised, so initialise with
// current values
this.TimeStamp_milliseconds = TimeStamp_milliseconds;
lat = lat_measurement;
lng = lng_measurement;
variance = accuracy * accuracy;
} else {
// else apply Kalman filter methodology
long TimeInc_milliseconds = TimeStamp_milliseconds
- this.TimeStamp_milliseconds;
if (TimeInc_milliseconds > 0) {
// time has moved on, so the uncertainty in the current position
// increases
variance += TimeInc_milliseconds * Q_metres_per_second
* Q_metres_per_second / 1000;
this.TimeStamp_milliseconds = TimeStamp_milliseconds;
// TO DO: USE VELOCITY INFORMATION HERE TO GET A BETTER ESTIMATE
// OF CURRENT POSITION
}
// Kalman gain matrix K = Covarariance * Inverse(Covariance +
// MeasurementVariance)
// NB: because K is dimensionless, it doesn't matter that variance
// has different units to lat and lng
float K = variance / (variance + accuracy * accuracy);
// apply K
lat += K * (lat_measurement - lat);
lng += K * (lng_measurement - lng);
// new Covarariance matrix is (IdentityMatrix - K) * Covarariance
variance = (1 - K) * variance;
}
}
public int getConsecutiveRejectCount() {
return consecutiveRejectCount;
}
public void setConsecutiveRejectCount(int consecutiveRejectCount) {
this.consecutiveRejectCount = consecutiveRejectCount;
}
} | [
""
] | |
f894b9245b35cdba8b861e5d182a5cb4bc8297f5 | 5c328b73629d43c47a5695158162cd0814dc1dc3 | /java/org/apache/catalina/valves/rewrite/RewriteMap.java | a97a42b2bb74a8e23991ea3059c6ef61353aea61 | [
"bzip2-1.0.6",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"CPL-1.0",
"CDDL-1.0",
"Zlib",
"EPL-1.0",
"LZMA-exception"
] | permissive | cxyroot/Tomcat8Src | 8cd56d0850c0f59d4709474f761a984b7caadaf6 | 14608ee22b05083bb8d5dc813f46447cb4baba76 | refs/heads/master | 2023-07-25T12:44:07.797728 | 2022-12-06T14:46:22 | 2022-12-06T14:46:22 | 223,338,251 | 2 | 0 | Apache-2.0 | 2023-07-07T21:16:21 | 2019-11-22T06:27:01 | Java | UTF-8 | Java | false | false | 992 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.catalina.valves.rewrite;
public interface RewriteMap {
public String setParameters(String params);
public String lookup(String key);
}
| [
"1076675153@qq.com"
] | 1076675153@qq.com |
a1ad26f61a50e02a8e4053a2e7933fc0caf17b36 | 2d94e4bb4b530f2fca30dbf4a2ab327eeb102cbe | /src/main/java/com/dustalarm/service/DustAlarmService.java | 53b8eed9a5ca9b5a4d31baccfdd24d304145ecd6 | [] | no_license | lee-sanghwa/dust-alarm-spring-boot | d6b77c6e605db3dd253cda17f6aecb862a989922 | 94c07b87c02d6f82fef885422f427478c070a842 | refs/heads/master | 2021-02-09T06:41:48.348811 | 2020-04-02T11:09:27 | 2020-04-02T11:09:27 | 244,253,200 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,002 | java | package com.dustalarm.service;
import com.dustalarm.model.*;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
public interface DustAlarmService {
Station findStationById(int id);
Station findStationByLocation(Double latitude, Double longitude);
Station findStationByName(String name);
Collection<Station> findStationByNameLike(String name);
Collection<Station> findStationByAddressLike(String address);
@Transactional
void saveStation(Station station);
Collection<Station> findAllStations();
Collection<Station> findAllStations(Integer pageNo);
Integer findCountStations();
User findUserById(int id);
User findUserByUuid(String uuid);
@Transactional
void saveUser(User user);
Collection<User> findAllUsers();
Collection<User> findAllUsers(Integer pageNo);
Integer findCountUsers();
Concentration findConcentrationById(int id);
Concentration findConcentrationByStationId(int stationId);
@Transactional
void saveConcentration(Concentration concentration);
Collection<Concentration> findAllConcentrations();
Collection<Concentration> findAllConcentrations(Integer pageNo);
Integer findCountConcentrations();
AlarmConfig findAlarmConfigById(int id);
Collection<AlarmConfig> findAllAlarmConfigs();
Collection<AlarmConfig> findAllAlarmConfigs(Integer pageNo);
@Transactional
void saveAlarmConfig(AlarmConfig alarmConfig);
Integer findCountAlarmConfigs();
Alarm findAlarmById(int id);
Collection<Alarm> findAlarmByTimeActivated(String time);
Collection<Alarm> findAlarmByUserId(int userId);
Collection<Alarm> findAllAlarms();
Collection<Alarm> findAllAlarms(Integer pageNo);
@Transactional
void saveAlarm(Alarm alarm);
Integer findCountAlarms();
ForecastConcentration findFCByRegionName(String regionName);
@Transactional
void saveFC(ForecastConcentration fC);
}
| [
"joseph@devhi.me"
] | joseph@devhi.me |
ec6518582cf8673a4684d51e1531504330d18c02 | 53962a4d9ec900a85b0b31cea832306bd7ee81a4 | /src/test/java/io/jaylim/compiler/ast/pojos/expressions/primaries/interfaces/InterfacesTest.java | 0f1751da6869198f579812b4561ef4ba74f6dd75 | [
"BSD-3-Clause"
] | permissive | jisunglim/pasta | 73a9a48b588a965ea235c5041e6174cc25b68343 | 352d86eeede759534d2b02de747829bc4586fb50 | refs/heads/master | 2020-12-25T15:18:28.069904 | 2016-09-20T01:00:17 | 2016-09-20T01:00:17 | 67,093,659 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,544 | java | package io.jaylim.compiler.ast.pojos.expressions.primaries.interfaces;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runners.Parameterized;
import java.util.Arrays;
import java.util.Collection;
import io.jaylim.compiler.ast.builder.AstBuilder;
import io.jaylim.compiler.ast.compiler.SubCompiler;
import io.jaylim.compiler.ast.pojos.AstNode;
import io.jaylim.compiler.ast.pojos.Range;
import io.jaylim.compiler.gencode.JavaParser;
/**
* @author Jisung Lim <iejisung@gmail.com>
*/
@Ignore
public class InterfacesTest {
private static final Range RANGE = new Range(0, 1, 0, 2);
private static final int
DEFAULT_ARRAY_DEFAULT_PRIMARY = 0,
DEFAULT_ARRAY_LF_PRIMARY = 1,
DEFAULT_ARRAY_LFNO_PRIMARY = 2,
LF_ARRAY_DEFAULT_PRIMARY = 3,
LF_ARRAY_LF_PRIMARY = 4,
LF_ARRAY_LFNO_PRIMARY = 5,
LFNO_ARRAY_DEFALUT_PRIMARY = 6,
LFNO_ARRAY_LF_PRIMARY = 7,
LFNO_ARRAY_LFNO_PRIMARY = 8;
@Parameterized.Parameters
public static Collection<Object[]> data() {
return Arrays.asList(new Object[][] { // TODO - Compose Test Case
/* int typeClassifer, String stringToCompile, ArrayPrimary targetPojo */
{},
{},
{},
{}
});
}
private final int type;
private final String stringToCompile;
private final ArrayPrimary targetPojo;
public InterfacesTest(final int type, final String stringToCompile,
final ArrayPrimary targetPojo) {
this.type = type;
this.stringToCompile = stringToCompile;
this.targetPojo = targetPojo;
}
@Test
public void testInterfaces() {
SubCompiler subCompiler = new SubCompiler();
JavaParser parser = subCompiler.getParser(stringToCompile);
AstNode astTree = contextDispatcher(type, parser);
// JSON serialization
ObjectMapper mapper = new ObjectMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
String testString = null;
try {
testString = mapper.writeValueAsString(astTree);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
System.out.println("AST Tree : \n" + testString + "\n");
String expectedString = null;
try {
expectedString = mapper.writeValueAsString(targetPojo);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
System.out.println("Expected : \n" + expectedString + "\n");
assertThat( astTree, is( equalTo( targetPojo ) ) );
}
private AstNode contextDispatcher(int classifier, JavaParser parser) {
switch(classifier) {
case DEFAULT_ARRAY_DEFAULT_PRIMARY :
return new AstBuilder().visitPrimaryNoNewArray(parser.primaryNoNewArray());
case DEFAULT_ARRAY_LF_PRIMARY :
return new AstBuilder().visitPrimaryNoNewArray_lf_primary(parser.primaryNoNewArray_lf_primary());
case DEFAULT_ARRAY_LFNO_PRIMARY :
return new AstBuilder().visitPrimaryNoNewArray_lfno_primary(parser.primaryNoNewArray_lfno_primary());
case LF_ARRAY_DEFAULT_PRIMARY :
return new AstBuilder().visitPrimaryNoNewArray_lf_arrayAccess(parser.primaryNoNewArray_lf_arrayAccess());
case LF_ARRAY_LF_PRIMARY :
return new AstBuilder().visitPrimaryNoNewArray_lf_primary_lf_arrayAccess_lf_primary(parser.primaryNoNewArray_lf_primary_lf_arrayAccess_lf_primary());
case LF_ARRAY_LFNO_PRIMARY :
return new AstBuilder().visitPrimaryNoNewArray_lfno_primary_lf_arrayAccess_lfno_primary(parser.primaryNoNewArray_lfno_primary_lf_arrayAccess_lfno_primary());
case LFNO_ARRAY_DEFALUT_PRIMARY :
return new AstBuilder().visitPrimaryNoNewArray_lfno_arrayAccess(parser.primaryNoNewArray_lfno_arrayAccess());
case LFNO_ARRAY_LF_PRIMARY :
return new AstBuilder().visitPrimaryNoNewArray_lf_primary_lfno_arrayAccess_lf_primary(parser.primaryNoNewArray_lf_primary_lfno_arrayAccess_lf_primary());
case LFNO_ARRAY_LFNO_PRIMARY :
return new AstBuilder().visitPrimaryNoNewArray_lfno_primary_lfno_arrayAccess_lfno_primary(parser.primaryNoNewArray_lfno_primary_lfno_arrayAccess_lfno_primary());
default :
System.err.println("ERROR : contextDispatcher");
return null;
}
}
}
| [
"iejisung@gmail.com"
] | iejisung@gmail.com |
0dbccf127447851cfffa350b25e1b11f8658b96f | 74a41e4e20ca3c5f7796d9a0ff49143e029df1a2 | /src/kr/re/ec/bibim/server/da/NoteDataController.java | 08204c7b22cd764a5f8cd5456ac270d04d0a8dbc | [] | no_license | JuhoKang/BiBimServer | e9f5248e588cfac718b0b3645cb56688c1ada6c4 | aad098af9fc179ac4cc030b5f8831e788fb5eee6 | refs/heads/master | 2020-04-11T16:46:26.212963 | 2014-07-17T02:49:06 | 2014-07-17T02:49:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,388 | java | package kr.re.ec.bibim.server.da;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import kr.re.ec.bibim.constants.Constants;
import kr.re.ec.bibim.util.LogUtil;
import kr.re.ec.bibim.vo.NoteData;
/**
* DAO(Data Access Object) for controlling DB<br>
* NoteData
*
* @author Kang Juho
* @version 1.0
*/
public class NoteDataController extends DataAccess {
// for singleton
private static NoteDataController instance = null;
// for singleton
static {
try {
instance = new NoteDataController();
} catch (Exception e) {
throw new RuntimeException("singleton instance intialize error");
}
}
// for singleton
private NoteDataController() {
super(Constants.DataBaseConstantFrame.DB_NAME);
}
// for singleton
public static NoteDataController getInstance() {
return instance;
}
public boolean isTableExists() {
open();
Connection c = getConnection();
Statement stmt = null;
ResultSet rs = null;
int tableCnt = 0;
try {
stmt = c.createStatement();
String query = "SELECT COUNT(name)" + " FROM sqlite_master"
+ " WHERE type='table' AND name='"
+ Constants.NoteConstantFrame.TABLE_NAME + "'";
LogUtil.v("query: " + query);
rs = stmt.executeQuery(query);
if (rs.next()) {
tableCnt = rs.getInt(1);
LogUtil.v("tableCnt:" + tableCnt);
}
rs.close();
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
close();
}
if (tableCnt == 0) { // no table
return false;
} else { // table already exist
return true;
}
}
/**
* Create table if not exists.
*
* @return success
*/
public boolean createTable() {
open();
Connection c = getConnection();
Statement stmt = null;
try {
stmt = c.createStatement();
String query = "CREATE TABLE IF NOT EXISTS "
+ Constants.NoteConstantFrame.TABLE_NAME + " ( "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTEID
+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTETITLE
+ " TEXT , "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTECONTENT
+ " TEXT , "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTEDATE
+ " TEXT , "
+ Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID
+ " INTEGER NOT NULL, "
+ Constants.NoteConstantFrame.COLUMN_NAME_USERID
+ " INTEGER NOT NULL, " + "FOREIGN KEY("
+ Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID + ")"
+ "REFERENCES " + Constants.FolderConstantFrame.TABLE_NAME
+ "(" + Constants.FolderConstantFrame.COLUMN_NAME_FOLDERID
+ ")" + "FOREIGN KEY("
+ Constants.NoteConstantFrame.COLUMN_NAME_USERID + ")"
+ "REFERENCES " + Constants.UserConstantFrame.TABLE_NAME
+ "(" + Constants.UserConstantFrame.COLUMN_NAME_USERID
+ ")" + " );"; // should not be UNIQUE Deleted UNIQUE
// this query depends on SQLite
LogUtil.v("query: " + query);
stmt.executeUpdate(query);
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
return false;
} finally {
close();
}
return true;
}
/**
* Drop table
*
* @return success
*/
public boolean dropTable() {
open();
Connection c = getConnection();
Statement stmt = null;
try {
stmt = c.createStatement();
String query = "DROP TABLE "
+ Constants.NoteConstantFrame.TABLE_NAME + ";";
LogUtil.v("query: " + query);
stmt.executeUpdate(query);
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
return false;
} finally {
close();
}
return true;
}
// find
/**
* find all directories.
*
* @return ArrayList<Directory>
*/
public ArrayList<NoteData> findAll() {
ArrayList<NoteData> resultnotes = new ArrayList<NoteData>();
open();
Connection c = getConnection();
Statement stmt = null;
ResultSet rs = null;
try {
stmt = c.createStatement();
String query = "SELECT "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTEID + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTETITLE + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTETITLE + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTEDATE + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_USERID + " FROM "
+ Constants.UserConstantFrame.TABLE_NAME + ";";
LogUtil.v("query: " + query);
rs = stmt.executeQuery(query);
while (rs.next()) {
NoteData notedata = new NoteData();
notedata.setNoteid(rs
.getInt(Constants.NoteConstantFrame.COLUMN_NAME_NOTEID));
notedata.setTitle(rs
.getString(Constants.NoteConstantFrame.COLUMN_NAME_NOTETITLE));
notedata.setContent(rs
.getString(Constants.NoteConstantFrame.COLUMN_NAME_NOTECONTENT));
notedata.setDate(rs
.getString(Constants.NoteConstantFrame.COLUMN_NAME_NOTEDATE));
notedata.setFolderid(rs
.getInt(Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID));
notedata.setUserid(rs
.getInt(Constants.NoteConstantFrame.COLUMN_NAME_USERID));
LogUtil.d("userdata :" + notedata.getNoteid() + "\t"
+ notedata.getTitle() + "\t" + notedata.getContent()
+ notedata.getDate() + "\t" + notedata.getUserid()
+ "\t" + notedata.getFolderid());
resultnotes.add(notedata);
}
rs.close();
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
close();
}
return resultnotes;
}
public ArrayList<NoteData> findAllByFid(int id) {
ArrayList<NoteData> resultnotes = new ArrayList<NoteData>();
open();
Connection c = getConnection();
Statement stmt = null;
ResultSet rs = null;
try {
stmt = c.createStatement();
String query = "SELECT "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTEID + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTETITLE + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTECONTENT
+ ", " + Constants.NoteConstantFrame.COLUMN_NAME_NOTEDATE
+ ", " + Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID
+ ", " + Constants.NoteConstantFrame.COLUMN_NAME_USERID
+ " FROM " + Constants.NoteConstantFrame.TABLE_NAME
+ " WHERE "
+ Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID + " = "
+ id + ";";
LogUtil.v("query: " + query);
rs = stmt.executeQuery(query);
while (rs.next()) {
NoteData notedata = new NoteData();
notedata.setNoteid(rs
.getInt(Constants.NoteConstantFrame.COLUMN_NAME_NOTEID));
notedata.setTitle(rs
.getString(Constants.NoteConstantFrame.COLUMN_NAME_NOTETITLE));
notedata.setContent(rs
.getString(Constants.NoteConstantFrame.COLUMN_NAME_NOTECONTENT));
notedata.setDate(rs
.getString(Constants.NoteConstantFrame.COLUMN_NAME_NOTEDATE));
notedata.setFolderid(rs
.getInt(Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID));
notedata.setUserid(rs
.getInt(Constants.NoteConstantFrame.COLUMN_NAME_USERID));
LogUtil.d("userdata :" + notedata.getNoteid() + "\t"
+ notedata.getTitle() + "\t" + notedata.getContent()
+ notedata.getDate() + "\t" + notedata.getUserid()
+ "\t" + notedata.getFolderid());
resultnotes.add(notedata);
}
rs.close();
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
close();
}
return resultnotes;
}
public int updateNote(NoteData notedata) {
int result = 0;
open();
Connection c = getConnection();
Statement stmt = null;
try {
stmt = c.createStatement();
String query = "UPDATE "
+ Constants.NoteConstantFrame.TABLE_NAME + " SET "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTETITLE + "=" +"'"+ notedata.getTitle() + "', "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTECONTENT + "=" +"'" + notedata.getContent() + "', "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTEDATE + "="+"'" + notedata.getDate() + "', "
+ Constants.NoteConstantFrame.COLUMN_NAME_USERID + "=" + notedata.getUserid() + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID + "=" + notedata.getFolderid()
+" WHERE "+Constants.NoteConstantFrame.COLUMN_NAME_NOTEID+"="+notedata.getNoteid()+";";
LogUtil.v("query: " + query);
result = stmt.executeUpdate(query);
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
close();
}
return result;
}
public NoteData findById(int id) {
NoteData note = new NoteData();
open();
Connection c = getConnection();
Statement stmt = null;
ResultSet rs = null;
try {
stmt = c.createStatement();
String query = "SELECT "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTEID + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTETITLE + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTECONTENT
+ ", " + Constants.NoteConstantFrame.COLUMN_NAME_NOTEDATE
+ ", " + Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID
+ ", " + Constants.NoteConstantFrame.COLUMN_NAME_USERID
+ " FROM " + Constants.NoteConstantFrame.TABLE_NAME
+ " WHERE "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTEID + " = "
+ id + ";";
LogUtil.v("query: " + query);
rs = stmt.executeQuery(query);
while (rs.next()) {
note.setNoteid(rs
.getInt(Constants.NoteConstantFrame.COLUMN_NAME_NOTEID));
note.setTitle(rs
.getString(Constants.NoteConstantFrame.COLUMN_NAME_NOTETITLE));
note.setContent(rs
.getString(Constants.NoteConstantFrame.COLUMN_NAME_NOTECONTENT));
note.setDate(rs
.getString(Constants.NoteConstantFrame.COLUMN_NAME_NOTEDATE));
note.setFolderid(rs
.getInt(Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID));
note.setUserid(rs
.getInt(Constants.NoteConstantFrame.COLUMN_NAME_USERID));
}
rs.close();
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
close();
}
return note;
}
public int insert(NoteData notedata) {
int result = 0;
open();
Connection c = getConnection();
Statement stmt = null;
try {
stmt = c.createStatement();
String query = "INSERT INTO "
+ Constants.NoteConstantFrame.TABLE_NAME + " ("
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTETITLE + ", "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTECONTENT
+ ", " + Constants.NoteConstantFrame.COLUMN_NAME_NOTEDATE
+ ", " + Constants.NoteConstantFrame.COLUMN_NAME_USERID
+ ", " + Constants.NoteConstantFrame.COLUMN_NAME_FOLDERID
+ ")" + " VALUES ('" + notedata.getTitle() + "','"
+ notedata.getContent() + "','" + notedata.getDate()
+ "','" + notedata.getUserid() + "','"
+ notedata.getFolderid() + "');";
LogUtil.v("query: " + query);
result = stmt.executeUpdate(query);
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
close();
}
return result;
}
public int deleteByID(int id) {
int result = 0;
open();
Connection c = getConnection();
Statement stmt = null;
try {
stmt = c.createStatement();
String query = "DELETE FROM "
+ Constants.NoteConstantFrame.TABLE_NAME + " WHERE "
+ Constants.NoteConstantFrame.COLUMN_NAME_NOTEID + "=" + id
+ ";";
LogUtil.v("query: " + query);
result = stmt.executeUpdate(query);
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
close();
}
return result;
}
}
| [
"rjduakcjs@gmail.com"
] | rjduakcjs@gmail.com |
562a47b662caec029ec82013efbddaa489c6620c | ccc450d1e1f3bd8573ad1ee7686a90e332828c2a | /src/main/java/id/co/beton/saleslogistic_trackingsystem/Services/MyFirebaseInstanceIDService.java | aee1ded0b01a2ba9ce83b59259fc3a4295b243da | [] | no_license | wilsonmwiti/sales | 5c6cb982eb7d9f458330a24ecca1987b0f057250 | a33a93532bd78e7153285d90c8e9ec2fbb23b14d | refs/heads/master | 2022-12-20T07:31:40.597500 | 2020-09-11T04:01:58 | 2020-09-11T04:01:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,898 | java | package id.co.beton.saleslogistic_trackingsystem.Services;
import android.util.Log;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.FirebaseInstanceIdService;
import com.google.gson.JsonObject;
import id.co.beton.saleslogistic_trackingsystem.Configuration.Constants;
import id.co.beton.saleslogistic_trackingsystem.Rest.ApiClient;
import id.co.beton.saleslogistic_trackingsystem.Rest.ApiInterface;
import id.co.beton.saleslogistic_trackingsystem.Rest.ResponseObject;
import id.co.beton.saleslogistic_trackingsystem.Utils.UserUtil;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Class MyFirebaseInstanceIDService
*
*/
public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService {
private static final String TAG =MyFirebaseInstanceIDService.class.getSimpleName() ;
@Override
public void onTokenRefresh() {
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
Log.d(TAG, "Refreshed token: " + refreshedToken);
pushTokenToserver(refreshedToken);
}
private void pushTokenToserver(String deviceToken){
final ApiInterface apiInterface = ApiClient.getInstance(getApplicationContext());
JsonObject token = new JsonObject();
token.addProperty("token",deviceToken);
Call<ResponseObject> call1 = apiInterface.deviceToken(UserUtil.getInstance(getApplicationContext()).getJWTTOken(),token);
call1.enqueue(new Callback<ResponseObject>() {
@Override
public void onResponse(Call<ResponseObject> call, Response<ResponseObject> response) {
if(Constants.DEBUG){
Log.i(TAG,"Sukses post token");
}
}
@Override
public void onFailure(Call<ResponseObject> call, Throwable t) {
}
});
}
}
| [
"iswan1s71@gmail.com"
] | iswan1s71@gmail.com |
e3dd42828421a2d6c08632a72ad70c75d440b192 | 305c1318858d27147945b778556724cb67645933 | /app/src/main/java/com/song/news/ui/activity/ChannelActivity.java | 4178f66d5b47c569c7faa6858c97b2a31dc14d87 | [
"Apache-2.0"
] | permissive | 815464927/News | ec9beedd7536364befde83bc3be0e1974364227c | 3053ce9b0838d135d6d6f5e28d25f9c472257e43 | refs/heads/master | 2021-01-22T20:08:30.559681 | 2017-04-18T03:29:56 | 2017-04-18T03:29:56 | 85,282,615 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,998 | java | package com.song.news.ui.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.support.v7.widget.helper.ItemTouchHelper;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseViewHolder;
import com.song.news.R;
import com.song.news.dragCallBack.ItemDragHelperCallBack;
import com.song.news.service.entity.Channel;
import com.song.news.ui.adapter.ChannelAdapter;
import java.util.ArrayList;
import java.util.List;
public class ChannelActivity extends AppCompatActivity implements
ChannelAdapter.OnChannelDragListener{
private Toolbar mToolBar;
private TextView title;
private RecyclerView mRecyclerView;
private List<Channel> mDatas = new ArrayList<>();
private ChannelAdapter mAdapter;
private final String[] titles = new String[]{"推荐", "视频", "热点", "社会", "娱乐", "科技", "汽车",
"体育", "财经", "军事", "国际", "时尚", "游戏", "旅游", "历史", "探索", "美食", "育儿", "养生",
"故事", "美文"};
private ItemTouchHelper mHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_channel);
initView();
initToolBar();
initData();
}
private void initData() {
generateDatas();
mAdapter = new ChannelAdapter(mDatas);
GridLayoutManager manager = new GridLayoutManager(this, 4);
mRecyclerView.setLayoutManager(manager);
mRecyclerView.setAdapter(mAdapter);
manager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
int itemViewType = mAdapter.getItemViewType(position);
return itemViewType == Channel.TYPE_MY_CHANNEL ||
itemViewType == Channel.TYPE_OTHER_CHANNEL ? 1 : 4;
}
});
ItemDragHelperCallBack callBack = new ItemDragHelperCallBack(this);
mHelper = new ItemTouchHelper(callBack);
mAdapter.setOnChannelDragListener(this);
//attachRecyclerView
mHelper.attachToRecyclerView(mRecyclerView);
}
//生成频道数据
private void generateDatas() {
mDatas.add(new Channel(Channel.TYPE_MY, "我的频道"));
for (int i = 0; i < titles.length; i++) {
String title = titles[i];
mDatas.add(new Channel(Channel.TYPE_MY_CHANNEL, title));
}
mDatas.add(new Channel(Channel.TYPE_OTHER, "频道推荐"));
for (int i = 0; i < titles.length; i++) {
String title = titles[i];
mDatas.add(new Channel(Channel.TYPE_OTHER_CHANNEL, title + "推荐"));
}
}
private void initToolBar() {
setSupportActionBar(mToolBar);
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
private void initView() {
mToolBar = (Toolbar) findViewById(R.id.toolBar);
title = (TextView)findViewById(R.id.public_title);
title.setText("频道设置");
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
}
@Override
public boolean onSupportNavigateUp() {
onBackPressed();
return true;
}
@Override
public void onStarDrag(BaseViewHolder baseViewHolder) {
//开始拖动
mHelper.startDrag(baseViewHolder);
}
@Override
public void onItemMove(int starPos, int endPos) {
Channel startChannel = mDatas.get(starPos);
//先删除之前的位置
mDatas.remove(starPos);
//添加到现在的位置
mDatas.add(endPos, startChannel);
mAdapter.notifyItemMoved(starPos, endPos);
}
}
| [
"1034966089@qq.com"
] | 1034966089@qq.com |
6c48a8ace04814edcc7ab0f489950fd56748f428 | aebc6286cfbf35b36e1e4c9bab7e7212398dfb8e | /portfolio/src/main/java/com/google/sps/servlets/PhraseServlet.java | 0e489947cb50a929b2801c59b1fc8c916fe8e86f | [
"Apache-2.0"
] | permissive | AgusQuintanar/Google-SPS | 4ee56ec7111a03bd2ddf2e0d2f43bd2e3b9a39c4 | dbe44b2d9d37bacf9a90744634348104e68cd006 | refs/heads/main | 2023-03-30T04:00:41.305335 | 2021-03-21T23:17:19 | 2021-03-21T23:17:19 | 342,440,930 | 1 | 0 | Apache-2.0 | 2021-03-21T23:17:20 | 2021-02-26T02:33:47 | Java | UTF-8 | Java | false | false | 2,066 | java | package com.google.sps.servlets;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.gson.Gson;
/** Servlet that responds with the current date. */
@WebServlet("/phrase")
public class PhraseServlet extends HttpServlet {
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
String[] phrases = { "\"The Best Way To Get Started Is To Quit Talking And Begin Doing.\" - Walt Disney",
"\"The Pessimist Sees Difficulty In Every Opportunity. The Optimist Sees Opportunity In Every Difficulty.\" - Winston Churchill",
"\"Don't Let Yesterday Take Up Too Much Of Today.\" - Will Rogers",
"\"You Learn More From Failure Than From Success. Don't Let It Stop You. Failure Builds Character.\" - Unknown",
"\"It's Not Whether You Get Knocked Down, It's Whether You Get Up.\" - Vince Lombardi",
"\"If You Are Working On Something That You Really Care About, You Don't Have To Be Pushed. The Vision Pulls You.\" - Steve Jobs",
"\"People Who Are Crazy Enough To Think They Can Change The World, Are The Ones Who Do.\" - Rob Siltanen",
"\"We May Encounter Many Defeats But We Must Not Be Defeated.\" - Maya Angelou",
"\"Knowing Is Not Enough; We Must Apply. Wishing Is Not Enough; We Must Do.\" - Johann Wolfgang Von Goethe",
"\"We Generate Fears While We Sit. We Overcome Them By Action.\" - Dr. Henry Link",
"\"Whether You Think You Can Or Think You Can't, You're Right.\" - Henry Ford",
"\"The Man Who Has Confidence In Himself Gains The Confidence Of Others.\" - Hasidic Proverb" };
response.setContentType("text/html;");
Gson gson = new Gson();
String json = gson.toJson(phrases);
response.getWriter().println(json);
}
}
| [
"agusquintanar17@gmail.com"
] | agusquintanar17@gmail.com |
a8dcd197ad1a0ab73a9fb0e862b8e20ad3680bc0 | 11d6bf007e243670bf99624bf657a000621260bc | /app/src/test/java/com/lchng/ripple/sampleyelpapp/ExampleUnitTest.java | d9fe2fe75a52cf3adbdf290ee9025d93c97ad09e | [
"MIT"
] | permissive | lngcyho/SampleYelpApp | 9044664a7165274cc6cf91090640440f6759d40e | ba4aab19d0451d74cb1c1f20687c18b9c0fac598 | refs/heads/master | 2020-03-25T12:15:30.285898 | 2018-08-06T18:27:54 | 2018-08-06T18:27:54 | 143,766,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 391 | java | package com.lchng.ripple.sampleyelpapp;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"lng.chiera@gmail.com"
] | lng.chiera@gmail.com |
03283965f0d5a5ea1ce5db8df9b86f974269238d | 8ab102e5d646e3ceed618c59547ec2f7a8da19d5 | /Eric/src/HuaweiTest2.java | 935f08bc8ff28ef4802cff8eb9809adcad584253 | [] | no_license | v415/Algorithm | 3c3b910d88f5ac11d4f1337a3dd707f04aa3f74d | ceec9d02b59d718c9e817e4b70272bf39b45dec1 | refs/heads/master | 2020-05-07T14:26:15.654211 | 2019-04-27T14:05:46 | 2019-04-27T14:05:46 | 180,594,141 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,723 | java | import java.util.Scanner;
import java.util.Stack;
public class HuaweiTest2 {
public static String decodeString(String s) {
Stack<Character> stack = new Stack<>();
StringBuilder repeat;
StringBuilder res = new StringBuilder();
for (char c : s.toCharArray()) {
if (c == ']' || c == ')' || c == '}') {
repeat = new StringBuilder();
while (stack.peek() != '[' && stack.peek() != '(' && stack.peek() != '{') {
repeat.append(stack.pop());
}
if(!stack.isEmpty() || c==']'&&stack.peek()=='[' || c==')'&&stack.peek()=='(' || c=='}'&&stack.peek()=='{')
stack.pop();
StringBuilder count = new StringBuilder();
while (!stack.isEmpty() && (stack.peek() >= '0' && stack.peek() <= '9')) {
count.append(stack.pop());
}
Integer num = Integer.valueOf(count.reverse().toString());
String str = repeat.reverse().toString();
String strs = "";
for (int i = 0; i < num; i++) {
strs += str;
}
for (char charA : strs.toCharArray()) {
stack.push(charA);
}
} else {
stack.push(c);
}
}
while (!stack.isEmpty()) {
res.append(stack.pop());
}
return res.toString();
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
System.out.println(decodeString(str));
}
}
| [
"903997278@qq.com"
] | 903997278@qq.com |
6732301aa08bc092a745a2d3f654514c403f6c40 | 5e38e446d942b58b2736e29a08931efa84de9f77 | /src/main/java/com/runhang/sell/core/jpush/JDPush.java | 9e47ae70c0723a9cd83440c324effb1c2061d83c | [] | no_license | vxutianmo/OwnGit-vendor | 7074567d3c60917ce0397799a8b8433a5f6f3a34 | cf397f866dea01e118318aba08e31c70e520d8ad | refs/heads/master | 2022-10-09T16:23:50.245060 | 2019-08-29T06:13:46 | 2019-08-29T06:13:46 | 205,072,269 | 0 | 0 | null | 2022-10-04T23:54:59 | 2019-08-29T03:25:07 | Java | UTF-8 | Java | false | false | 4,324 | java | package com.runhang.sell.core.jpush;
import cn.jpush.api.JPushClient;
import cn.jpush.api.push.PushResult;
import cn.jpush.api.push.model.Message;
import cn.jpush.api.push.model.Options;
import cn.jpush.api.push.model.Platform;
import cn.jpush.api.push.model.PushPayload;
import cn.jpush.api.push.model.audience.Audience;
import com.alibaba.fastjson.JSONObject;
import com.runhang.sell.push.JPushService;
import com.runhang.sell.service.impl.PushResultService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @ClassName JDPush
* @Author wangzhaosen@runhangtech.com
* @Date 2018/8/3 18:52
* @Version 1.0
* @Description 极光推送工具类。
**/
@Component
public class JDPush {
private static final Logger logger = LoggerFactory.getLogger(JDPush.class);
@Value("${jpush.cloud.appkey}")
private String cloudKey;
@Value("${jpush.cloud.masterSecret}")
private String cloudMasterSecret;
@Value("${jpush.update.appkey}")
private String updateKey;
@Value("${jpush.update.masterSecret}")
private String updateMasterSecret;
@Autowired
private PushResultService resultService;
/**
* @return void
* @Author wangzhaosen@runhangtech.com
* @Date 2018/8/3 18:55
* @Param
* @Description android 推送工具类。
**/
private JPushClient getClient(JPushService.TYPE type) {
JPushClient client;
switch (type) {
case DEFAULT:
client = new JPushClient(cloudMasterSecret, cloudKey);
break;
case DOWNLOAD:
client = new JPushClient(updateMasterSecret, updateKey);
break;
default:
client = new JPushClient(cloudMasterSecret, cloudKey);
break;
}
return client;
}
public void jPushAndroid(Map<String, Object> parm) {
PushPayload pushPayload = makePayload(parm);
JPushService.TYPE type = (JPushService.TYPE) parm.get("type");
PushResult result = null;
JPushClient client = getClient(type);
try {
result = client.sendPush(pushPayload);
int responseCode = result.getResponseCode();
logger.error("极光推送 ---> 结果:" + responseCode);
resultService.savePushRecord(parm, result);
} catch (Exception e) {
String message = e.getMessage();
logger.error(String.format("极光推送 ---> 异常:%s", message));
resultService.savePushRecord(parm, JSONObject.parseObject(message, JPushError.class));
} finally {
client.close();
logger.error(String.format("极光推送 ---> 时间:%s", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))));
logger.error(String.format("极光推送 ---> 内容:%s", parm.get("msg")));
logger.error("极光推送 ---> 目标:" + parm.get("registrationId"));
}
}
private PushPayload makePayload(Map<String, Object> param) {
PushPayload.Builder builder = PushPayload.newBuilder()
//指定android平台的用户
.setPlatform(Platform.android())
.setOptions(Options.newBuilder().setApnsProduction(false).setTimeToLive(3600).build())
.setMessage(Message.content((String) param.get("msg")));
//.setNotification(Notification.android("收到推送", "极光推送", null));
Object registrationId = param.get("registrationId");
if (null == registrationId) {
//安全起见,不再推送所有设备
//builder.setAudience(Audience.all());
} else if (registrationId instanceof Collection) {
builder.setAudience(Audience.registrationId((List<String>) registrationId));
} else {
//安全起见,不再推送所有设备
//builder.setAudience(Audience.all());
}
return builder.build();
}
}
| [
"wuzhihong@runhangtech.com"
] | wuzhihong@runhangtech.com |
9f03fff81ec274b0e7e996416cd19c1bbbe092bc | e3efc1fede34736a2cd21da72c83939186277ca2 | /server/src/main/java/org/fastcatsearch/db/DBService.java | 6f721990537cdff9cf0c15eedf4584d583fea852 | [
"Apache-2.0"
] | permissive | songaal/abcc | e3a646d3636105b1290c251395c90e3b785f9c88 | 6839cbf947296ff8ff4439c591aa314a14f19f7b | refs/heads/master | 2023-04-03T04:40:09.743919 | 2019-10-14T08:05:21 | 2019-10-14T08:05:21 | 222,627,949 | 0 | 0 | Apache-2.0 | 2023-03-23T20:38:31 | 2019-11-19T06:47:36 | Java | UTF-8 | Java | false | false | 3,792 | java | /*
* Copyright (c) 2013 Websquared, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v2.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* Contributors:
* swsong - initial API and implementation
*/
package org.fastcatsearch.db;
import org.apache.ibatis.session.SqlSession;
import org.fastcatsearch.db.InternalDBModule.MapperSession;
import org.fastcatsearch.db.mapper.ExceptionHistoryMapper;
import org.fastcatsearch.db.mapper.GroupAccountMapper;
import org.fastcatsearch.db.mapper.GroupAuthorityMapper;
import org.fastcatsearch.db.mapper.IndexingHistoryMapper;
import org.fastcatsearch.db.mapper.IndexingResultMapper;
import org.fastcatsearch.db.mapper.ManagedMapper;
import org.fastcatsearch.db.mapper.NotificationConfigMapper;
import org.fastcatsearch.db.mapper.NotificationHistoryMapper;
import org.fastcatsearch.db.mapper.TaskHistoryMapper;
import org.fastcatsearch.db.mapper.UserAccountMapper;
import org.fastcatsearch.db.vo.GroupAccountVO;
import org.fastcatsearch.db.vo.GroupAuthorityVO;
import org.fastcatsearch.db.vo.UserAccountVO;
import org.fastcatsearch.env.Environment;
import org.fastcatsearch.exception.FastcatSearchException;
import org.fastcatsearch.http.ActionAuthority;
import org.fastcatsearch.http.ActionAuthorityLevel;
import org.fastcatsearch.service.ServiceManager;
import org.fastcatsearch.settings.Settings;
public class DBService extends AbstractDBService {
protected static DBService instance;
private static Class<?>[] mapperList = new Class<?>[] {
ExceptionHistoryMapper.class
, NotificationHistoryMapper.class
, TaskHistoryMapper.class
, IndexingHistoryMapper.class
, IndexingResultMapper.class
, UserAccountMapper.class
, GroupAccountMapper.class
, GroupAuthorityMapper.class
, NotificationConfigMapper.class
};
public static DBService getInstance() {
return instance;
}
public void asSingleton() {
instance = this;
}
public DBService(Environment environment, Settings settings, ServiceManager serviceManager) {
super("db/system", DBService.mapperList, environment, settings, serviceManager);
}
public InternalDBModule internalDBModule() {
return internalDBModule;
}
public <T> MapperSession<T> getMapperSession(Class<T> type) {
SqlSession session = internalDBModule.openSession();
return new MapperSession<T>(session, session.getMapper(type));
}
@Override
protected boolean doStart() throws FastcatSearchException {
if (super.doStart()) {
return true;
} else {
return false;
}
}
@Override
protected void initMapper(ManagedMapper managedMapper) throws Exception {
if (managedMapper instanceof GroupAccountMapper) {
GroupAccountMapper mapper = (GroupAccountMapper) managedMapper;
mapper.putEntry(new GroupAccountVO(GroupAccountVO.ADMIN_GROUP_NAME));
} else if (managedMapper instanceof GroupAuthorityMapper) {
GroupAuthorityMapper mapper = (GroupAuthorityMapper) managedMapper;
for (ActionAuthority authority : ActionAuthority.values()) {
if (authority != ActionAuthority.NULL) {
mapper.putEntry(new GroupAuthorityVO(1, authority.name(), ActionAuthorityLevel.WRITABLE.name()));
}
}
} else if (managedMapper instanceof UserAccountMapper) {
UserAccountMapper mapper = (UserAccountMapper) managedMapper;
mapper.putEntry(new UserAccountVO(UserAccountVO.ADMIN_USER_NAME, UserAccountVO.ADMIN_USER_ID, "1111", "", "", 1));
}
}
@Override
protected boolean doStop() throws FastcatSearchException {
if (super.doStop()) {
return true;
} else {
return false;
}
}
@Override
protected boolean doClose() throws FastcatSearchException {
return super.doClose();
}
}
| [
"swsong@danawa.com"
] | swsong@danawa.com |
55c10462552e9ee62c3b7f2eb53419bc487b7937 | ae771ff97b5ce8bafa42bc27411f5d599dfbcbb1 | /PROG/src/com/Swing/Principal.java | bc15cb948e87b64180545f9d1ee24c2c0137593c | [] | no_license | guillemerill/DAM | 5a6dc5adc698ed451aff732eae2c29abe2731440 | 616556cea6e9eaea898fd9d6e6fc93fd85a03098 | refs/heads/master | 2021-01-17T18:06:04.955268 | 2017-01-31T19:43:57 | 2017-01-31T19:43:57 | 70,180,971 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 86 | java | package com.Swing;
/**
* Created by DAM on 13/12/16.
*/
public class Principal {
}
| [
"guillemerillsoto@gmail.com"
] | guillemerillsoto@gmail.com |
9c7e3c3f19566b7490e8f0dd81ef8d3fcd507c2b | 7458cc522fdfd92583d5555833b6b496c3fb4583 | /app/src/main/java/com/namezio/hdwallpaper/FavActivity.java | d27feae56aee4b2747e8c57eb7d8ccfb29429dad | [] | no_license | namezio/HDWallpaper-master | 7deaff330479ede00a2f3b2cf9f93399993b2941 | b8c257e882faef5464984e252fafff8fa502ad76 | refs/heads/master | 2020-06-25T22:59:41.102216 | 2019-07-29T12:21:24 | 2019-07-29T12:21:24 | 199,447,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package com.namezio.hdwallpaper;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class FavActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fav);
}
}
| [
"canyouloveme1999@gmail.com"
] | canyouloveme1999@gmail.com |
3bc05110453f6aa2cecd72712c399b2e13e15862 | fac8480326f1f49e7eed9c6a4b87fb30f74504e4 | /src/main/java/com/zizibujuan/util/json/IJson.java | 77f9d5d1d675a972bae3373c1f4931025c714552 | [] | no_license | zizibujuan/util.json | 8eab0db6e8a83d9d22d893aa57682066884d920e | 5dd3fdf4f3a1226184f4ccfdbb66827559ffa70c | refs/heads/master | 2021-01-10T19:11:36.094653 | 2015-04-06T14:32:07 | 2015-04-06T14:32:07 | 33,388,642 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 670 | java | package com.zizibujuan.util.json;
import java.io.InputStream;
import java.io.Reader;
import java.util.List;
import java.util.Map;
public interface IJson {
Map<String,Object> fromJsonObject(String jsonString);
Map<String,Object> fromJsonObject(Reader reader);
List<Map<String, Object>> fromJsonArray(String jsonString);
List<Map<String, Object>> fromJsonArray(Reader reader);
<T> T fromJsonObject(String jsonString, Class<T> clazz);
<T> T fromJsonObject(InputStream io, Class<T> clazz);
<T> List<T> fromJsonArray(String jsonString, Class<List<?>> collectionClass, Class<T> elementClass);
<T> String stringify(T bean);
}
| [
"idocument@qq.com"
] | idocument@qq.com |
b5b7e935a92f3187c7d271770758c5ef37fd5405 | cb2ad8d85a6e32eaf32d65de786d160f25b850e1 | /Smart/app/src/main/java/adapter/Model_HeadImage_Adapter.java | 9daba6f65ddd937f7e5cb06b89c56966e3e1f061 | [] | no_license | tyhjh/The-First | 49f986a5290c3039693aa040a585d724db3f0041 | 04337fef8ba35fe5bf9627bfeeae737ba6b22eaf | refs/heads/master | 2021-01-21T13:04:13.522963 | 2016-05-02T16:57:13 | 2016-05-02T16:57:13 | 55,385,096 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,924 | java | package adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.tyhj.smart.R;
import com.squareup.picasso.Picasso;
import java.util.List;
import Api_sours.CircularImage;
import activity_for_adapter.For_Model;
import activity_for_adapter.For_ModelHead;
import savephoto.GetModelHeadImage;
/**
* Created by Tyhj on 2016/4/4.
*/
public class Model_HeadImage_Adapter extends ArrayAdapter<For_ModelHead> {
int[] imageId= GetModelHeadImage.mosiheah;
int resourceId;
View view;
For_ModelHead fmd;
ViewHold viewH;
WindowManager wm = (WindowManager) getContext()
.getSystemService(Context.WINDOW_SERVICE);
int width = wm.getDefaultDisplay().getWidth();
public Model_HeadImage_Adapter(Context context, int resource, List<For_ModelHead> objects) {
super(context, resource, objects);
resourceId=resource;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
fmd=getItem(position);
int x=fmd.getCount();
if(convertView==null) {
view = LayoutInflater.from(getContext()).inflate(resourceId, null);
viewH = new ViewHold();
viewH.iv= (ImageView) view.findViewById(R.id.iv_for_gridview);
view.setTag(viewH);
}else{
view=convertView;
viewH= (ViewHold) view.getTag();
}
Picasso.with(getContext())
.load(imageId[x])
.resize(width/12, width/12)
.centerCrop()
.into(viewH.iv);
return view;
}
class ViewHold{
ImageView iv;
}
} | [
"1043315346@qq.com"
] | 1043315346@qq.com |
ecf8f39c53467d8e634cd8b9ba0340f4c2aa3401 | 348136f8d238f283df54e609dac7b58e91e444c5 | /app/src/main/java/com/example/linhlee/myimusik/activities/AboutActivity.java | 20a5affc8ed1d9b405efedf7026d90a0310a09b3 | [] | no_license | linhlq58/iMusik | 57a37e3ba4424e9761bd5ea2cd3303b0f36a134f | 43339e93bb73fd6e79623a0eec22c9292bf5c763 | refs/heads/master | 2021-01-10T08:08:59.883170 | 2016-04-22T03:16:12 | 2016-04-22T03:16:12 | 55,795,974 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | package com.example.linhlee.myimusik.activities;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import com.example.linhlee.myimusik.R;
/**
* Created by Linh Lee on 4/10/2016.
*/
public class AboutActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
ImageView btnBack = (ImageView) findViewById(R.id.btn_back_about);
btnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
Window window = this.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(this.getResources().getColor(R.color.colorPrimaryDark));
}
}
| [
"lequyenlinh110@gmail.com"
] | lequyenlinh110@gmail.com |
c3d0595a93fa4d1216eb03bd254100354fe780b1 | 419f390f73a67e63df2822104dd23e6283c778a8 | /app/src/main/java/com/example/scrollingshooter/GameActivity.java | d92330f54c614fdb808c448140c5b58cafbafdc8 | [] | no_license | isamimitani/AndroidGame_ScrollingShooter | e3cf1d6c3715175cd4dfc3cebf7c3c7eb03a2699 | 7f03ba6f1089cd4fb51ba59d2c8b53e09e7e086a | refs/heads/master | 2020-08-06T07:43:50.147150 | 2019-10-04T20:17:17 | 2019-10-04T20:17:17 | 212,895,722 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 895 | java | package com.example.scrollingshooter;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Activity;
import android.graphics.Point;
import android.os.Bundle;
import android.view.Display;
public class GameActivity extends Activity {
GameEngine mGameEngine;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_main);
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
mGameEngine = new GameEngine(this, size);
setContentView(mGameEngine);
}
@Override
protected void onResume(){
super.onResume();
mGameEngine.startThread();
}
@Override
protected void onPause(){
super.onPause();
mGameEngine.stopThread();
}
}
| [
"isamimitani@live.se"
] | isamimitani@live.se |
35d8c7acc58984804ea8269e1b2940740a46b320 | 24a01a1e49399ddc70672457c52f06e1dfb83323 | /src/main/java/com/rabbitmq/example/worke/round/Consumer1.java | 8cd6a3caa3d7346ec9fe73c8a44c6d98e48eea70 | [] | no_license | chenkuifang/rabbitmq-java | c09d56aa2c28e5fb645b41f5b7cd7b57cfbfed1d | 34be1e8f885c8680727a85bdbd0784ffd4158616 | refs/heads/master | 2020-03-25T08:28:12.267597 | 2018-08-05T13:14:23 | 2018-08-05T13:14:23 | 143,613,995 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,419 | java | package com.rabbitmq.example.worke.round;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
import com.rabbitmq.client.AMQP.BasicProperties;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Consumer;
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.example.util.MqConnectionUtils;
/**
* 工作队列.轮询分发.消费者
*
* @author Quifar
*/
public class Consumer1 {
// 需要监听的队列
private static String QUEUE_NAME = "simple.queue.test";
public static void main(String[] args) throws IOException, TimeoutException {
Connection connection = MqConnectionUtils.getConnection();
Channel channel = connection.createChannel();
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
Consumer consumer = new DefaultConsumer(channel) {
@Override
public void handleDelivery(String consumerTag, Envelope envelope, BasicProperties properties, byte[] body)
throws IOException {
String message = new String(body, "UTF-8");
System.out.println(" 接收到信息:" + message);
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
};
// 自动回执
boolean autoAck = false;
// 监听队列
channel.basicConsume(QUEUE_NAME, autoAck, consumer);
// 不能关闭连接
}
}
| [
"314287696@qq.com"
] | 314287696@qq.com |
c9cc900ffc142647910d7fcd0690bf059f3c9074 | 7899a4d75ba8e3df94dc9a8420c38413946b2361 | /basic/src/main/java/com/surpass/demo/config/MyInterceptor2.java | e25635515fecc5351cfb6b16628d099f2f124f20 | [] | no_license | surpass-wei/spring-boot-case | 26b6708ddf6fecec9c14d43935eac0f8dfc5eeb6 | 1bf3e9bf09ab75a6b2c3430bb3f81795dcb3817a | refs/heads/master | 2021-01-19T20:24:23.004599 | 2018-10-31T06:54:00 | 2018-10-31T06:54:00 | 83,751,528 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,099 | java | package com.surpass.demo.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 自定义拦截器2
* 实现自定义拦截器只需要3步:
* 1、创建我们自己的拦截器类并实现 HandlerInterceptor 接口。
* 2、创建一个Java类继承WebMvcConfigurerAdapter,并重写 addInterceptors 方法。
* 2、实例化我们自定义的拦截器,然后将对像手动添加到拦截器链中(在addInterceptors方法中添加)。
* PS:本文重点在如何在Spring-Boot中使用拦截器,关于拦截器的原理请大家查阅资料了解。
* <p>
* Created by surpass.wei@gmail.com on 2017/2/24.
*/
public class MyInterceptor2 implements HandlerInterceptor {
private Logger logger = LoggerFactory.getLogger(MyInterceptor2.class);
@Override
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
logger.info("拦截器:MyInterceptor2 >>>> 在请求处理之前进行调用(Controller方法调用之前)");
return true; // 只有返回true才会继续向下执行,返回false取消当前请求
}
@Override
public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
logger.info("拦截器:MyInterceptor2 >>>> 在请求处理之后进行调用,但是在视图被渲染之前(Controller方法调用之后)");
}
@Override
public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
logger.info("拦截器:MyInterceptor2 >>>> 在整个请求结束之后被调用,也就是在DispatcherServlet 渲染了对应的视图之后执行(主要是用于进行资源清理工作)");
}
}
| [
"cwei@cz2r.com"
] | cwei@cz2r.com |
7b76a95ab48be484a8d645f85a96dfff06ebf745 | 1680e6bd4e63c63dcce4da00430bb6137d25f368 | /whefss-web/src/main/java/com/murong/ecp/netpay/whefss/web/pub/dal/entity/BaseHead.java | 6e91f98de6aaac3226c40562120e010117e4ea6c | [] | no_license | Teezys/whefss | 2e37d1aed6b86be6929c16c38eae2b042a429777 | 58930e7c475f4c54372fd4518217dd5b35976912 | refs/heads/master | 2023-02-07T22:40:51.252769 | 2020-12-26T01:57:43 | 2020-12-26T01:57:43 | 324,463,419 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 616 | java | package com.murong.ecp.netpay.whefss.web.pub.dal.entity;
import lombok.Data;
public class BaseHead {
private boolean result = false;
private String msgCd;
private String msgInf;
public boolean isResult() {
return result;
}
public void setResult(boolean result) {
this.result = result;
}
public String getMsgCd() {
return msgCd;
}
public void setMsgCd(String msgCd) {
this.msgCd = msgCd;
}
public String getMsgInf() {
return msgInf;
}
public void setMsgInf(String msgInf) {
this.msgInf = msgInf;
}
}
| [
"t2530968301@163.com"
] | t2530968301@163.com |
24eacc24ffb456d5f273c91edfd0c3c882576c4a | 6936588a2428e7758c04a9b77b58fa0df549c905 | /EntityListener.java | 695e7c4a4e814bb70a1d546625f7b77239b5944d | [] | no_license | mmzhao/Platforming-Game | 80bc83bc3d3f16dde79d64d024ecff880186205f | ff6ef965a828a4b4ac11b48876ebdbed328fe13e | refs/heads/master | 2020-04-24T20:48:38.570072 | 2014-11-09T00:02:42 | 2014-11-09T00:02:42 | 24,809,897 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,465 | java | import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
public class EntityListener implements KeyListener, MouseListener, MouseMotionListener{
// entity: entity that is listened to, should be the player
private Entity entity;
// --------------------------------CONTRUCTOR-------------------------------- //
public EntityListener(Entity entity) {
this.entity = entity;
}
// --------------------------------KEY LISTENING METHODS-------------------------------- //
// do while key is released
public void keyReleased(KeyEvent e) {
entity.keyReleased(e);
}
// do while key is pressed down
public void keyPressed(KeyEvent e) {
entity.keyPressed(e);
}
public void keyTyped(KeyEvent e) {
entity.keyTyped(e);
}
// --------------------------------MOUSE LISTENER METHODS-------------------------------- //
public void mouseClicked(MouseEvent e) {
// entity.mouseClicked(e);
}
public void mousePressed(MouseEvent e) {
entity.mousePressed(e);
}
public void mouseReleased(MouseEvent e) {
entity.mouseReleased(e);
}
public void mouseEntered(MouseEvent e) {
}
public void mouseExited(MouseEvent e) {
}
public void mouseDragged(MouseEvent e) {
entity.mouseDragged(e);
}
public void mouseMoved(MouseEvent e) {
entity.mouseMoved(e);
}
} | [
"mengzhe.zhao@gmail.com"
] | mengzhe.zhao@gmail.com |
7b558f55516767bd2718004c2bd070b7077d2a3d | 1dc71d6ec9066df65f162a15f2cfd119070e102c | /PatternsLibraryTesting_3/src/com/tek/test/util/GenerateXML.java | 206c7c895812988e1797cb7a427817e8500514d7 | [] | no_license | harryinfamos/patterns-library | 76fb8517955e1e99b2acd85bbd855d96f8dd9b75 | fc73cc92a0222243660691c046e2b5c8d826ce80 | refs/heads/master | 2016-09-06T07:08:38.670091 | 2015-01-29T17:12:20 | 2015-01-29T17:12:20 | 29,193,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,506 | java | package com.tek.test.util;
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class GenerateXML {
public static String[] browserName={"Chrome","Firefox","InternetExplorer"};
public static String[] testCaseName={"CSSPatternsTest","AttPatternsTest"};
public static String[] testCaseClassName={"com.tek.test.patterns.VerifyComponents","com.tek.test.patterns.VerifypatternsOnSite"};
public static void main(String argv[]) {
try {
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
// root elements
Document doc = docBuilder.newDocument();
Element rootElement = doc.createElement("suite");
doc.appendChild(rootElement);
Attr suiteName = doc.createAttribute("name");
suiteName.setValue("Test Suite");
rootElement.setAttributeNode(suiteName);
for(int i=0;i<browserName.length;i++)
{
Element test = doc.createElement("test");
rootElement.appendChild(test);
Attr verbose = doc.createAttribute("verbose");
verbose.setValue("2");
test.setAttributeNode(verbose);
Attr browserTestName = doc.createAttribute("name");
browserTestName.setValue(browserName[i]+" Test");
test.setAttributeNode(browserTestName);
Element parameter = doc.createElement("parameter");
test.appendChild(parameter);
Attr browserType = doc.createAttribute("name");
browserType.setValue("BrowserType");
parameter.setAttributeNode(browserType);
Attr value = doc.createAttribute("value");
value.setValue(browserName[i]);
parameter.setAttributeNode(value);
Element groups = doc.createElement("groups");
test.appendChild(groups);
Element run = doc.createElement("run");
groups.appendChild(run);
for(int j=0;j<testCaseName.length;j++)
{
Element include = doc.createElement("include");
run.appendChild(include);
Attr tcname = doc.createAttribute("name");
tcname.setValue(testCaseName[j]);
include.setAttributeNode(tcname);
}
Element classes = doc.createElement("classes");
test.appendChild(classes);
for(int j=0;j<testCaseClassName.length;j++)
{
Element childClass = doc.createElement("class");
classes.appendChild(childClass);
Attr className = doc.createAttribute("name");
className.setValue(testCaseClassName[j]);
childClass.setAttributeNode(className);
}
}
// write the content into xml file
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(new File("src\\generatedTestNG-suite.xml"));
transformer.transform(source, result);
System.out.println("File saved!");
} catch (ParserConfigurationException pce) {
pce.printStackTrace();
} catch (TransformerException tfe) {
tfe.printStackTrace();
}
}
}
| [
"harry.infamos@gmail.com"
] | harry.infamos@gmail.com |
60c40c15f18feda8564a5dd3200067ed2de9ae87 | e724f59233d1c7dd853a0b9356fba308d7ce0909 | /test/net/sourceforge/kolmafia/utilities/IntWrapperTest.java | cb472a7961c1e4057addb00b2491addab6c2be9e | [] | no_license | oxc/kolmafia-mirror | ed5ff937935934cab8c826e35a53d8dcece0b4a9 | e1b045f9d5daf8ec88902cda98dc418cbe13d9c4 | refs/heads/main | 2023-07-16T22:53:40.233933 | 2021-09-01T21:13:48 | 2021-09-01T21:31:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 537 | java | package net.sourceforge.kolmafia.utilities;
import static org.junit.Assert.*;
import org.junit.Test;
/**
* This is a simple test for IntWrapper because sometimes even low hanging fruit is good.
*
*/
public class IntWrapperTest {
private IntWrapper iw;
@Test
public void itShouldReturnWhatIsThere() {
int testVal = 314;
iw = new IntWrapper();
assertFalse(iw.getChoice() == testVal);
iw.setChoice(testVal);
assertEquals(iw.getChoice(), testVal);
}
}
| [
"jaadams5@b29ace70-8910-0410-8dcc-aa2fc6433167"
] | jaadams5@b29ace70-8910-0410-8dcc-aa2fc6433167 |
502289224ff5b8ed3d2d101b9d5afbf04758115c | c1d6e9546d0c7a680c1da976d17d8f5f8da23cd7 | /src/main/java/com/jackie/common/design_pattern/observer/HexaObserver.java | 120ab925f7decfe732754f48d909635eb4aa5057 | [] | no_license | jackie575/design-pattern | 5ef468610bddf3673d3f7db1af9504e0d6cf2110 | 798d9a07d549d1179bab712b72f3ac2f3d871dc8 | refs/heads/master | 2023-07-06T17:44:03.162827 | 2023-06-30T05:17:37 | 2023-06-30T05:17:37 | 290,489,452 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 267 | java | package com.jackie.common.design_pattern.observer;
public class HexaObserver extends Observer{
@Override
public void update(Subject subject) {
System.out.println( "Hex String: "
+ Integer.toHexString( subject.getState() ).toUpperCase() );
}
} | [
"wujinwu@kuaishou.com"
] | wujinwu@kuaishou.com |
684b7bb42f1b364a5025168faf914e84567b2797 | 7d399ad173b7367d7a68120324dd257c227d1a36 | /src/MultiThread2/Storage2.java | 45246a132687af7026642e924fee8d1225616e68 | [] | no_license | xujian-lele/test | 506b8fd3a1eb511db2fe2841b05bdfd2532bf19d | 55b843a4a8da3a3be2967ad632cbc70a16142b6a | refs/heads/master | 2021-01-19T11:48:24.230934 | 2015-07-20T15:41:24 | 2015-07-20T15:41:24 | 23,186,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,278 | java | package MultiThread2;
import java.util.LinkedList;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class Storage2 {
//容量
int SIZE_NUM = 100;
//
public LinkedList<Object> list = new LinkedList<Object>();
//
public Lock lock = new ReentrantLock();
//
public Condition full = lock.newCondition();
//
public Condition empty = lock.newCondition();
public void produce(int num){
lock.lock();
while(list.size()+num>SIZE_NUM){
System.out.println("仓满");
try {
full.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
//当不阻塞的时候继续执行
for(int i=0;i<num;i++){
list.add(new Object());
}
System.out.println("生产:"+num+";库存:"+list.size());
full.signal();
lock.unlock();
}
public void consume(int num){
lock.lock();
while(list.size()<num){
System.out.println("仓不够");
try {
empty.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
//当不阻塞的时候继续执行
for(int i=0;i<num;i++){
list.remove();
}
System.out.println("消费:"+num+";库存:"+list.size());
empty.signal();
lock.unlock();
}
}
| [
"648909477@qq.com"
] | 648909477@qq.com |
0589a2bfae5576eb1d66c3f87ae679ffc0630f6c | 2f7b585bc87c88e46747c969f49b86706e05cfa6 | /iefas-web/src/main/java/hk/oro/iefas/web/ledger/voucherhandling/common/view/VoucherEditView.java | aedd1ce0bb0739b698dfc71679d8e815d95b1cb5 | [] | no_license | peterso05168/oro | 3fd5ee3e86838215b02b73e8c5a536ba2bb7c525 | 6ca20e6dc77d4716df29873c110eb68abbacbdbd | refs/heads/master | 2020-03-21T17:10:58.381531 | 2018-06-27T02:19:08 | 2018-06-27T02:19:08 | 138,818,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,936 | java | package hk.oro.iefas.web.ledger.voucherhandling.common.view;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVRecord;
import org.apache.commons.io.IOUtils;
import org.omnifaces.util.Messages;
import org.primefaces.model.StreamedContent;
import org.primefaces.model.UploadedFile;
import org.springframework.http.HttpHeaders;
import hk.oro.iefas.core.constant.ApplicationCodeTableEnum;
import hk.oro.iefas.core.constant.CoreConstant;
import hk.oro.iefas.core.constant.MsgCodeConstant;
import hk.oro.iefas.core.constant.MsgParamCodeConstant;
import hk.oro.iefas.core.constant.ShroffConstant;
import hk.oro.iefas.core.util.CommonUtils;
import hk.oro.iefas.core.util.MimeTypeUtils;
import hk.oro.iefas.domain.casemgt.vo.CaseAccountInfoVO;
import hk.oro.iefas.domain.common.vo.ActionVO;
import hk.oro.iefas.domain.common.vo.ApplicationCodeTableVO;
import hk.oro.iefas.domain.report.DownloadFileVO;
import hk.oro.iefas.domain.shroff.vo.AnalysisCodeVO;
import hk.oro.iefas.domain.shroff.vo.JournalVoucherAccountItemVO;
import hk.oro.iefas.domain.shroff.vo.PaymentVoucherAccountItemVO;
import hk.oro.iefas.domain.shroff.vo.ReceiptVoucherAccountItemVO;
import hk.oro.iefas.domain.shroff.vo.SysAttachmentVO;
import hk.oro.iefas.domain.shroff.vo.VoucherAttachmentVO;
import hk.oro.iefas.domain.system.vo.SysWfInitialStatusVO;
import hk.oro.iefas.domain.system.vo.SysWorkFlowRuleVO;
import hk.oro.iefas.web.casemgt.casedetailenquiry.service.CaseAccountClientService;
import hk.oro.iefas.web.common.util.AppResourceUtils;
import hk.oro.iefas.web.core.jsf.bean.BaseBean;
import hk.oro.iefas.web.ledger.maintenance.analysiscode.service.AnalysisCodeClientService;
import hk.oro.iefas.web.ledger.voucherhandling.common.service.SysAttachmentClientService;
import hk.oro.iefas.web.ledger.voucherhandling.common.service.SysWfInitialStatusClientService;
import hk.oro.iefas.web.ledger.voucherhandling.common.service.SysWorkFlowRuleClientService;
import hk.oro.iefas.web.ledger.voucherhandling.common.service.VoucherAttachmentClientService;
import hk.oro.iefas.web.ledger.voucherhandling.common.service.VoucherClientService;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
/**
* @version $Revision: 3199 $ $Date: 2018-06-19 17:20:31 +0800 (週二, 19 六月 2018) $
* @author $Author: dante.fang $
*/
@Slf4j
public abstract class VoucherEditView extends BaseBean {
private static final long serialVersionUID = 1L;
@Inject
protected AppResourceUtils appResourceUtils;
@Inject
protected SysWfInitialStatusClientService sysWfInitialStatusClientService;
@Inject
protected SysWorkFlowRuleClientService sysWorkFlowRuleClientService;
@Inject
protected AnalysisCodeClientService analysisCodeClientService;
@Inject
protected VoucherAttachmentClientService voucherAttachmentClientService;
@Inject
protected SysAttachmentClientService sysAttachmentClientService;
@Inject
protected VoucherClientService voucherClientService;
@Inject
protected CaseAccountClientService caseAccountClientService;
protected SysWfInitialStatusVO sysWfInitialStatusVO;
protected List<SysWorkFlowRuleVO> sysWorkFlowRuleVOs;
public static final String ACCOUNT_NUMBER_COLUMN_NAME = "Account Number";
public static final String ANALYSIS_CODE_COLUMN_NAME = "Analysis Code";
public static final String NATURE_COLUMN_NAME = "Nature";
public static final String AMOUNT_COLUMN_NAME = "Amount";
public static final String PARTICULARS_COLUMN_NAME = "Particulars";
public static final String AMOUNT_DR_COLUMN_NAME = "Amount(DR)";
public static final String AMOUNT_CR_COLUMN_NAME = "Amount(CR)";
public static final String CHEQUE_NUMBER_COLUMN_NAME = "Cheque Number";
public static final String CHEQUE_DATE_COLUMN_NAME = "Cheque Date";
public static final String NATURE_OF_RECEIPT_COLUMN_NAME = "Nature of Receipt";
public static final String PAYER_NAME_COLUMN_NAME = "Payer Name";
@Getter
@Setter
protected List<VoucherAttachmentVO> attachmentList;
@Getter
@Setter
protected VoucherAttachmentVO attachment;
@Getter
@Setter
protected Integer activeIndex = 0;
@Getter
@Setter
protected UploadedFile accountFile;
@Getter
protected StreamedContent downloadFile;
@Getter
@Setter
protected Integer voucherId;
@Getter
@Setter
private Boolean isSubmitted = false;
@Getter
@Setter
private Boolean isApproved = false;
@Getter
@Setter
private Boolean isVerified = false;
@Getter
@Setter
private Boolean saveSuccessed = false;
@Getter
@Setter
protected Boolean isUploaded = false;
@Getter
@Setter
private List<ApplicationCodeTableVO> statusVOs;
@Getter
@Setter
private List<AnalysisCodeVO> analysisCodes;
@Getter
@Setter
private AnalysisCodeVO selectedAnalysisCode = new AnalysisCodeVO();
@Getter
@Setter
protected List<PaymentVoucherAccountItemVO> importPaymentItemList;
@Getter
@Setter
protected List<JournalVoucherAccountItemVO> importJournalItemList;
@Getter
@Setter
protected List<ReceiptVoucherAccountItemVO> importReceiptItemList;
@Getter
@Setter
private ActionVO action;
@PostConstruct
private void init() {
log.info("======VoucherEditView init======");
statusVOs = appResourceUtils.getApplicationCodeByGroup(ApplicationCodeTableEnum.VS.name());
sysWorkFlowRuleVOs = sysWorkFlowRuleClientService.findByPrivilegeCode(getPrivilegeCode());
}
protected void initActionButton() {
sysWfInitialStatusVO = sysWfInitialStatusClientService.findByPrivilegeCode(getPrivilegeCode());
action = sysWorkFlowRuleClientService.findIntialAction(getPrivilegeCode());
}
protected SysWorkFlowRuleVO getAfterStatusByAction(String beforeStatus, String action) {
log.info("getAfterStatusByAction() start");
SysWorkFlowRuleVO after
= sysWorkFlowRuleVOs.parallelStream().filter(item -> item.getAction().getCodeValue().equals(action)
&& item.getBeforeStatus().getCodeValue().equals(beforeStatus)).findFirst().get();
log.info("getAfterStatusByAction() start");
return after;
}
public List<AnalysisCodeVO> completeAnalysisCode(String query) {
log.info("completeAnalysisCode() start");
analysisCodes = analysisCodeClientService.findByAnalysisCode(query);
if (CommonUtils.isNotEmpty(analysisCodes)) {
String voucherTypeCode = getVoucherTypeCode();
analysisCodes = analysisCodes.stream()
.filter(item -> item.getVoucherType().getVoucherTypeCode().equals(voucherTypeCode))
.collect(Collectors.toList());
}
log.info("completeAnalysisCode() end");
return analysisCodes;
}
public abstract String getVoucherTypeCode();
public abstract String getPrivilegeCode();
protected String genCaseAccountNumberStr(List<String> str) {
StringBuilder sb = new StringBuilder();
sb.append(appResourceUtils.getMessageParam(MsgParamCodeConstant.CASE_ACCOUNT)).append(" ");
str.stream().forEach(item -> {
sb.append(item).append(", ");
});
sb.delete(sb.length() - 2, sb.length());
return sb.toString();
}
// Import Account
protected String[] genImportHeader(String voucherType) {
log.info("genImportHeader() start ");
String[] header = null;
switch (voucherType) {
case ShroffConstant.VT_PAY:
header = new String[4];
header[0] = ACCOUNT_NUMBER_COLUMN_NAME;
header[1] = ANALYSIS_CODE_COLUMN_NAME;
header[2] = NATURE_COLUMN_NAME;
header[3] = AMOUNT_COLUMN_NAME;
break;
case ShroffConstant.VT_JOU:
header = new String[5];
header[0] = ACCOUNT_NUMBER_COLUMN_NAME;
header[1] = ANALYSIS_CODE_COLUMN_NAME;
header[2] = PARTICULARS_COLUMN_NAME;
header[3] = AMOUNT_DR_COLUMN_NAME;
header[4] = AMOUNT_CR_COLUMN_NAME;
break;
case ShroffConstant.VT_REC:
header = new String[7];
header[0] = ACCOUNT_NUMBER_COLUMN_NAME;
header[1] = ANALYSIS_CODE_COLUMN_NAME;
header[2] = CHEQUE_NUMBER_COLUMN_NAME;
header[3] = CHEQUE_DATE_COLUMN_NAME;
header[4] = NATURE_OF_RECEIPT_COLUMN_NAME;
header[5] = PAYER_NAME_COLUMN_NAME;
header[5] = AMOUNT_COLUMN_NAME;
break;
default:
break;
}
log.info("genImportHeader() end ");
return header;
}
public void uploadAccountFile(String voucherType) {
log.info("uploadAccountFile() start ");
String[] header = genImportHeader(voucherType);
importPaymentItemList = new ArrayList<>();
importJournalItemList = new ArrayList<>();
importReceiptItemList = new ArrayList<>();
BufferedReader reader = null;
try {
InputStream inputstream = this.accountFile.getInputstream();
if (inputstream.available() > 0) {
String fileName = this.accountFile.getFileName();
if (!fileName.endsWith(CoreConstant.CSV_FILE_EXTENDS)) {
this.showUploadErrorMsg();
return;
}
CSVFormat format = CSVFormat.DEFAULT.withHeader(header);
try {
reader = new BufferedReader(new InputStreamReader(inputstream));
String[] trueHeader = reader.readLine().split(",");
for (int i = 0; i < header.length; i++) {
if (!trueHeader[i].equals(header[i])) {
this.showUploadErrorMsg();
return;
}
}
Iterable<CSVRecord> records = format.parse(reader);
switch (voucherType) {
case ShroffConstant.VT_PAY:
handlePaymentItemList(records);
break;
case ShroffConstant.VT_JOU:
handleJournalItemList(records);
break;
case ShroffConstant.VT_REC:
handleReceiptItemList(records);
break;
default:
break;
}
isUploaded = true;
activeIndex = 1;
} catch (Exception e) {
log.error(e.getMessage(), e);
activeIndex = 1;
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
this.showUploadErrorMsg();
activeIndex = 1;
} finally {
IOUtils.closeQuietly(reader);
activeIndex = 1;
}
log.info("uploadAccountFile() end ");
}
private void handlePaymentItemList(Iterable<CSVRecord> records) {
log.info("handlePaymentItemList() start ");
PaymentVoucherAccountItemVO csvItem = null;
for (CSVRecord csv : records) {
csvItem = new PaymentVoucherAccountItemVO();
CaseAccountInfoVO caseAccount = new CaseAccountInfoVO();
caseAccount.setCaseAcNumber(csv.get(ACCOUNT_NUMBER_COLUMN_NAME));
csvItem.setAccount(caseAccount);
csvItem.setAnalysisCode(csv.get(ANALYSIS_CODE_COLUMN_NAME));
csvItem.setNature(csv.get(NATURE_COLUMN_NAME));
csvItem.setAmount(CommonUtils.isNotBlank(csv.get(AMOUNT_COLUMN_NAME))
? new BigDecimal(csv.get(AMOUNT_COLUMN_NAME)) : null);
importPaymentItemList.add(csvItem);
}
log.info("handlePaymentItemList() end ");
}
private void handleJournalItemList(Iterable<CSVRecord> records) {
log.info("handleJournalItemList() start ");
JournalVoucherAccountItemVO csvItem = null;
for (CSVRecord csv : records) {
csvItem = new JournalVoucherAccountItemVO();
CaseAccountInfoVO caseAccount = new CaseAccountInfoVO();
caseAccount.setCaseAcNumber(csv.get(ACCOUNT_NUMBER_COLUMN_NAME));
csvItem.setAccount(caseAccount);
csvItem.setAnalysisCode(csv.get(ANALYSIS_CODE_COLUMN_NAME));
csvItem.setParticulars(csv.get(PARTICULARS_COLUMN_NAME));
csvItem.setAmountDr(CommonUtils.isNotBlank(csv.get(AMOUNT_DR_COLUMN_NAME))
? new BigDecimal(csv.get(AMOUNT_DR_COLUMN_NAME)) : null);
csvItem.setAmountCr(CommonUtils.isNotBlank(csv.get(AMOUNT_CR_COLUMN_NAME))
? new BigDecimal(csv.get(AMOUNT_CR_COLUMN_NAME)) : null);
importJournalItemList.add(csvItem);
}
log.info("handleJournalItemList() end ");
}
private void handleReceiptItemList(Iterable<CSVRecord> records) {
log.info("handleReceiptItemList() start ");
ReceiptVoucherAccountItemVO csvItem = null;
for (CSVRecord csv : records) {
csvItem = new ReceiptVoucherAccountItemVO();
String accountNumber = csv.get(ACCOUNT_NUMBER_COLUMN_NAME);
CaseAccountInfoVO caseAccountInfoVO = this.caseAccountClientService.findByAccountNumber(accountNumber);
csvItem.setAccount(caseAccountInfoVO);
csvItem.setAnalysisCode(csv.get(ANALYSIS_CODE_COLUMN_NAME));
csvItem.setChequeNo(csv.get(CHEQUE_NUMBER_COLUMN_NAME));
try {
csvItem.setChequeDate(
new SimpleDateFormat(appResourceUtils.getDateFormat()).parse(csv.get(CHEQUE_DATE_COLUMN_NAME)));
} catch (ParseException e) {
log.error(e.getMessage(), e);
Messages.addGlobalError(
String.format(appResourceUtils.getMessageContent(MsgCodeConstant.MSG_DATE_PATTERN_ERROR),
appResourceUtils.getMessageParam(MsgParamCodeConstant.IMPORTED_RECORD)));
return;
}
csvItem.setNature(csv.get(NATURE_COLUMN_NAME));
csvItem.setPayerName(csv.get(PAYER_NAME_COLUMN_NAME));
BigDecimal amount = CommonUtils.isNotBlank(csv.get(AMOUNT_COLUMN_NAME))
? new BigDecimal(csv.get(AMOUNT_COLUMN_NAME)) : null;
csvItem.setVoucherAmount(amount);
csvItem.setStatus(CoreConstant.STATUS_ACTIVE);
this.importReceiptItemList.add(csvItem);
}
log.info("handleReceiptItemList() end ");
}
public void showUploadErrorMsg() {
Messages.addError(null, "Invalid File.");
}
public abstract Boolean validateConfirmImportAccount();
public abstract void confirmImportAccount();
public void cancelImport() {
log.info("cancelImport() start ");
accountFile = null;
importPaymentItemList = new ArrayList<>();
importJournalItemList = new ArrayList<>();
importReceiptItemList = new ArrayList<>();
isUploaded = false;
log.info("cancelImport() start ");
}
public void downloadTemplate(String voucherType) throws Exception {
log.info("downloadTemplate() start ");
String[] header = genImportHeader(voucherType);
List<String> headerRecord = new ArrayList<String>();
for (int i = 0; i < header.length; i++) {
headerRecord.add(header[i]);
}
DownloadFileVO downloadFileVO = voucherClientService.downloadImportTemplate(headerRecord);
if (downloadFileVO != null) {
String fileRealName = downloadFileVO.getFileName();
fileRealName = fileRealName.replace(CoreConstant.CSV_FILE_EXTENDS,
"(" + voucherType + ")" + CoreConstant.CSV_FILE_EXTENDS);
HttpServletResponse response
= (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.addHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename="
+ new String(fileRealName.getBytes(CoreConstant.UTF_8), CoreConstant.ISO_8859_1));
response.setContentType(MimeTypeUtils.FileExtension.CSV.name());
ServletOutputStream outputStream = response.getOutputStream();
if (CommonUtils.isNotEmpty(downloadFileVO.getFileResult())) {
outputStream.write(downloadFileVO.getFileResult());
}
outputStream.close();
}
log.info("downloadTemplate() end ");
}
// support doc
public void downloadDoc() throws Exception {
log.info("downloadDoc() start");
if (attachment != null) {
SysAttachmentVO file = sysAttachmentClientService.getSysAttachmentDetail(attachment.getAttachmentId());
HttpServletResponse response
= (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.addHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename="
+ new String(attachment.getFileName().getBytes(CoreConstant.UTF_8), CoreConstant.ISO_8859_1));
response.setContentType(MimeTypeUtils.FileExtension.PDF.name());
ServletOutputStream outputStream = response.getOutputStream();
if (file != null && CommonUtils.isNotEmpty(file.getContent())) {
outputStream.write(file.getContent());
}
outputStream.close();
}
log.info("downloadDoc() end");
}
public void deleteDoc() {
log.info("deleteDoc() start");
if (attachment != null) {
attachment.setStatus(CoreConstant.STATUS_DELETE);
voucherAttachmentClientService.deleteVoucherAttachment(attachment);
refreshDocForm();
}
log.info("deleteDoc() end");
}
public void refreshDocForm() {
log.info("refreshDocForm() start");
attachmentList = voucherAttachmentClientService.findVoucherAttachmentByVoucher(voucherId);
log.info("refreshDocForm() end");
}
}
| [
"peterso05168@gmail.com"
] | peterso05168@gmail.com |
5d4681e5fadb7b66f993794ba2464eb894631993 | d98e5158667df1c3488c538a09ca6fd9822e7bbc | /backend/src/main/java/com/haumea/gitanalyzer/exception/GitLabRuntimeException.java | d153a6ce0cce07a7111539ed729d539f153f8456 | [
"BSD-3-Clause"
] | permissive | iasmaro/GitLabAnalyzer | a31da965f4d56499601feafcf70666f9cc2eb55d | f9326aaaca9b654acd56d719b12809d69cd0fadb | refs/heads/master | 2023-06-26T09:19:04.917396 | 2021-07-27T02:37:35 | 2021-07-27T02:37:35 | 377,722,700 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package com.haumea.gitanalyzer.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class GitLabRuntimeException extends RuntimeException{
public GitLabRuntimeException(String message) {
super(message);
}
}
| [
"tmbui@sfu.ca"
] | tmbui@sfu.ca |
1f197e5d5e64334543331b58f79172ffc4ddb505 | f67d39a4023a0e326f6def25c24b89573efb3e5e | /app/src/main/java/com/pack/dsestak/weatherforecaster/Travel.java | 723681c774ed1cb72cc9bb697fa9c3419876ebf5 | [] | no_license | dsestak777/News-Weather-Travel-App | 3ceb3dd194f31206bc59112641a4847f389b6311 | 4de77d336f9d1460dd39721db4248936d547e5db | refs/heads/master | 2021-01-17T07:57:31.930901 | 2015-11-17T01:21:10 | 2015-11-17T01:21:10 | 39,788,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,966 | java | package com.pack.dsestak.weatherforecaster;
/**
* Created by dsestak on 10/22/2015.
*/
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import android.app.AlertDialog;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.location.LocationProvider;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
public class Travel extends ListActivity {
Button exitButton;
private double longitude;
private double latitude;
private String address;
//private String oldAddress;
//private String oldWeather;
private String destinationZip;
private String currentZip;
private static String url;
private static final String YOUR_API_KEY = "AIzaSyCE5FLt79Fu_-WTbZfVmEi1USc6O-E151s";
private JSONObject jArray = null;
ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();
SharedPreferenceManager sharedPrefMgr;
//create boolean to check if network is available
private boolean isNetworkAvailable() {
ConnectivityManager connectivityManager
= (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listplaceholder);
//get shared prefs
sharedPrefMgr = new SharedPreferenceManager(this);
destinationZip = sharedPrefMgr.getDestinationZipCode();
//get extras from intent
Intent ii = getIntent();
Bundle b = ii.getExtras();
if (b!= null) {
latitude = (Double) b.get("Lat");
longitude = (Double) b.get("Long");
address = (String) b.get("Addr");
currentZip = (String) b.get("zip");
}
setupViews();
addButtonListeners();
//if no zip code is stored show alert
if (destinationZip == null) {
showNoLocationAlert();
//if network is not available show alert
} else if(!isNetworkAvailable()) {
showNetworkAlert();
} else {
//set URL to get data from Google
url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins="+currentZip+"&destinations="+destinationZip+"&mode=driving&language=en-EN&units=imperial&key=AIzaSyCE5FLt79Fu_-WTbZfVmEi1USc6O-E151s";
// get travel data using JSON asynchronously
new GetJSONFromGoogleMaps().execute();
}
}
//show alert dialog to remind user to enter a destination location
public void showNoLocationAlert() {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(
Travel.this);
alertDialog.setTitle("SETTINGS");
alertDialog.setMessage("You Must Enter a Destination First!!");
alertDialog.setPositiveButton("Enter Data",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Travel.this, EnterData.class);
Travel.this.startActivity(intent);
}
});
alertDialog.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
alertDialog.show();
}
//show alert dialog to remind user to turn on Wi-fi or check connection
public void showNetworkAlert() {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(
Travel.this);
alertDialog.setTitle("SETTINGS");
alertDialog.setMessage("You Must Enable Wi-fi or have a Data Connection!");
alertDialog.setPositiveButton("Settings",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(
Settings.ACTION_WIFI_SETTINGS);
Travel.this.startActivity(intent);
}
});
alertDialog.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
alertDialog.show();
}
//setup GUI
private void setupViews()
{
exitButton = (Button)findViewById(R.id.exit_button);
}
//add listeners for GUI buttons
private void addButtonListeners()
{
exitButton.setOnClickListener
(
new View.OnClickListener()
{
@Override public void onClick(View v) {
startActivity(new Intent(Travel.this, Welcome.class));
Travel.this.finish(); }
}
);
}
private class GetJSONFromGoogleMaps extends AsyncTask<String, String, JSONObject> {
String result = "";
HttpURLConnection conn = null;
private ProgressDialog dialog;
//show dialog while retrieving data
@Override
protected void onPreExecute() {
super.onPreExecute();
dialog = new ProgressDialog(Travel.this);
dialog.setMessage("Getting Data ...");
dialog.setIndeterminate(false);
dialog.setCancelable(true);
dialog.show();
}
//get data from service using JSON in background
protected JSONObject doInBackground(String... args) {
//response status
int status=0;
//http GET request
try {
//create a connection
URL u = new URL(url);
conn = (HttpURLConnection) u.openConnection();
conn.setRequestMethod("GET");
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
conn.setUseCaches(false);
conn.setAllowUserInteraction(false);
conn.connect();
status = conn.getResponseCode();
Log.d("Status", "Status=" + status);
} catch (Exception e) {
Log.e("log_tag", "Error in http connection " + e.toString());
}
//convert response to string
try
{
if (status == HttpURLConnection.HTTP_OK) { // success
//create new buffered reader
BufferedReader in = new BufferedReader(new InputStreamReader(
conn.getInputStream()));
String inputLine;
//create stringbuilder for response
StringBuilder response = new StringBuilder();
//add data to StringBuilder
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
result = response.toString();
//add result to shared prefs
sharedPrefMgr.setWeather(result);
// print result
System.out.println("new travel =" + response.toString());
//if no result use old data
} else {
System.out.println("GET request Error!");
}
}
catch(
Exception e
)
{
Log.e("log_tag", "Error converting result " + e.toString());
}
try
{
//create JSONObject array from result
jArray = new JSONObject(result);
if (jArray == null) Log.d("jArray = ", "null");
}
catch(
JSONException e
)
{
Log.e("log_tag", "Error parsing data " + e.toString());
}
return jArray;
}
protected void onPostExecute(JSONObject jArray) {
if (dialog.isShowing()) {
dialog.dismiss();
}
if (jArray != null) {
try {
//Get Travel info from JSON response
JSONArray originObject = jArray.getJSONArray("origin_addresses");
JSONArray destinationObject = jArray.getJSONArray("destination_addresses");
JSONArray rowArray = jArray.getJSONArray("rows");
String rows = rowArray.toString();
System.out.println("rows=" + rows);
JSONObject elementObject = rowArray.getJSONObject(0);
String elemObj = elementObject.toString();
JSONArray elementArray = elementObject.getJSONArray("elements");
String elemArr = elementArray.toString();
System.out.println("element Obj = " + elemObj);
System.out.println("element Array = " + elemArr);
JSONObject elementZero = elementArray.getJSONObject(0);
String status = elementZero.getString("status");
String duration = elementZero.getString("duration");
String origin = originObject.toString();
String destination = destinationObject.toString();
String[] dur = duration.split(",");
String[] time = dur[1].split(":");
String travelTime = time[1];
travelTime = travelTime.substring(0, travelTime.length()-1);
String distance = elementZero.getString("distance");
String[] dist = distance.split(",");
String[] d = dist[1].split(":");
String travelDistance = d[1];
travelDistance = travelDistance.substring(0, travelDistance.length()-1);
System.out.println("element duration = " + elementZero);
System.out.println("status = " + status);
System.out.println("duration = " + duration);
System.out.println("travel time = " + travelTime);
System.out.println("travel distance = " + travelDistance);
//create hashmap to store JSON data
HashMap<String, String> map = new HashMap<String, String>();
//put data in map
map.put("origin", "Origin:" + origin);
map.put("destination", "Destination:" + destination);
map.put("distance", "Travel Distance:" + travelDistance);
map.put("time", "Travel Time:" + travelTime);
mylist.add(map);
//set data into listadapter
ListAdapter adapter = new SimpleAdapter(Travel.this, mylist, R.layout.weather,
new String[]{"origin","destination","distance", "time"},
new int[]{R.id.item_title, R.id.item_subtitle, R.id.item_subtitle2, R.id.item_subtitle3});
setListAdapter(adapter);
// }
} catch (JSONException e) {
Log.e("log_tag", "Error parsing data " + e.toString());
}
//if no data is available from the internet or shared prefs
} else {
HashMap<String, String> map = new HashMap<String, String>();
map.put("id", String.valueOf(0));
map.put("location", "Location: not available" );
map.put("temp", "Temperature: not available" );
map.put("weathertext", "Weather: not available" );
map.put("windspeed", "Wind Speed: not available");
mylist.add(map);
//set data into listadapter
ListAdapter adapter = new SimpleAdapter(Travel.this, mylist, R.layout.weather,
new String[]{"location", "temp", "weathertext", "windspeed"},
new int[]{R.id.item_title, R.id.item_subtitle, R.id.item_subtitle2, R.id.item_subtitle3});
setListAdapter(adapter);
}
}
}
private static String getResponseText(InputStream inStream) {
return new Scanner(inStream).useDelimiter("\n").next();
}
//return to main menu if back button is pressed
@Override
public void onBackPressed() {
Intent i = new Intent(Travel.this, Welcome.class);
startActivity(i);
}
}
| [
"mrdavey777@gmail.com"
] | mrdavey777@gmail.com |
ecfcb07b7ef974530257c033c1ffbb7c6c443c79 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/main/java/org/gradle/test/performancenull_340/Productionnull_33990.java | 30e288d89ba20363446cbc09a02904ed14a36d4f | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 588 | java | package org.gradle.test.performancenull_340;
public class Productionnull_33990 {
private final String property;
public Productionnull_33990(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
856ade9038c48dcbe11fedadea16ee8d61fc58ac | 7b095236af206128b653f27a3da2bb8870f99556 | /src/Midi.java | 74bc4c9c0a759ef8244f14154a35d212cf000544 | [] | no_license | motaur/Tank-Battle | a45ea45003eaaefeb1addfbbcf3bdcba887b451c | 8dfd9b01313133182a9e68e39b620ea8d4f6c423 | refs/heads/master | 2020-04-29T18:47:31.439203 | 2019-06-24T18:54:20 | 2019-06-24T18:54:20 | 176,333,404 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,176 | java | import java.io.*;
import javax.sound.midi.*;
public class Midi
{
public Sequencer midiPlayer;
File song1 = new File(ImageManager.getInstance().getPath() + "song1.mid");
// testing main method
public Midi(int temp, int songNumber)
{
/* // Do this on every move step, you could change to another song
if (!midiPlayer.isRunning())
{ // previous song finished
// reset midi player and start a new song
midiPlayer.stop();
midiPlayer.close();
//startMidi("song2.mid");
}*/
try
{
Sequence song = MidiSystem.getSequence(song1);
midiPlayer = MidiSystem.getSequencer();
midiPlayer.open();
midiPlayer.setSequence(song);
midiPlayer.setLoopCount(99); // repeat 0 times (play once)
midiPlayer.setTempoFactor(temp); // >1 to speed up the tempo
}
catch (MidiUnavailableException e)
{
e.printStackTrace();
}
catch (InvalidMidiDataException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
}
} | [
"Levan90@mail.ru"
] | Levan90@mail.ru |
f48c2ae57ed642406a6b214db28275aa98061e8f | e7b62ee1ab1761b52010740b70610e5c7c1a79db | /src/org/android/hcl/util/Util.java | 9e4cb429eb21ff9d86d090ddb6ea09b8c78ea07c | [] | no_license | mariobat88/HCL | 10a0dd8b33dbb753470ff9551def77c201fa3723 | 5b8aca3fdc37326f5c8202a1e6e0061b4d7cd3b4 | refs/heads/master | 2021-06-24T04:34:28.654417 | 2012-10-31T14:49:09 | 2012-10-31T14:49:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 785 | java | package org.android.hcl.util;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.widget.ImageView;
import android.widget.ProgressBar;
public class Util {
private static final String TAG = Util.class.getName();
public static boolean isDeviceConected(Context context) {
ConnectivityManager cm = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();
if (ni == null) {
return false;
}
return true;
}
public static void DownloadImage(Context context, String src, ImageView imageView, ProgressBar progress) {
DownloadImage downloadImage = new DownloadImage(context, src, imageView, progress);
downloadImage.execute();
}
}
| [
"batfudbaler@gmail.com"
] | batfudbaler@gmail.com |
02cdadc114e314816887f91dabbd9c00abba5e17 | 13934ea3feb478b42257abcb7b5e969dbf965c34 | /app/src/main/java/net/zhongbenshuo/attendance/bean/Legend.java | 3eee2bad127d1c5f55528964d82da381bd8ebbeb | [] | no_license | tkkhy/ZBSKaoQin | a730a5729942004946a1e0ee21c76ae9267f8d2d | 76c915eab9f8ffb897acd4eb5d0be162fcda85e6 | refs/heads/master | 2020-06-18T18:35:59.811842 | 2019-07-11T11:45:18 | 2019-07-11T11:45:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package net.zhongbenshuo.attendance.bean;
/**
* 图例实体类
* Created at 2019/6/20 9:43
*
* @author LiYuliang
* @version 1.0
*/
public class Legend {
private String legendName;
private int legendResourceId;
public Legend(String legendName, int legendResourceId) {
this.legendName = legendName;
this.legendResourceId = legendResourceId;
}
public String getLegendName() {
return legendName;
}
public void setLegendName(String legendName) {
this.legendName = legendName;
}
public int getLegendResourceId() {
return legendResourceId;
}
public void setLegendResourceId(int legendResourceId) {
this.legendResourceId = legendResourceId;
}
}
| [
"liyuliang008@outlook.com"
] | liyuliang008@outlook.com |
ca7bb0273d2b0135ee09c79e9b0f5b7e44f4e108 | a8f521c0feef5bb7d267f181ca175cc28fe93f0d | /com.d2d.modules.corejava/src/com/d2d/modules/corejava/threads/D2DUncaughtExceptionHandler.java | 88d9a8036747cee46ce12e10e9dcfe6aaf596cb7 | [] | no_license | pradeepnemmani/d2d-stuff | 1443313ef9c9581581bee66ca5f2468655409c01 | 59b593ad939d0a69428a3f65940c0db8a7637f6b | refs/heads/master | 2020-05-01T00:58:56.024051 | 2015-07-09T14:32:23 | 2015-07-09T14:32:23 | 38,825,178 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package com.d2d.modules.corejava.threads;
import java.lang.Thread.UncaughtExceptionHandler;
public class D2DUncaughtExceptionHandler implements UncaughtExceptionHandler
{
@Override
public void uncaughtException( Thread t, Throwable e )
{
System.out.println( "Thread (" + t.getName()
+ ") threw the exception with the message - " + e.getMessage() );
System.out.println( "State of the thread : " + t.getState() );
// Shoot out an email to the support with the exception stack trace
}
}
| [
"pradeepnemmani@gmail.com"
] | pradeepnemmani@gmail.com |
f054a8c92cae509d42154e2b756aa86c19d31e01 | a37c59affd9f71c396fb760157238c09306e6399 | /src/test/java/sai/service/springsecurityjwt/SpringSecurityJwtApplicationTests.java | c3de710265c635251e895a9260e8cb150e14316e | [] | no_license | coddinginjava/spring-security-jwt | 8a2e10c11c24992f5f9694c0374afb08d432b602 | 53b739b30ceb080aac44237f42321bbac8e26d3c | refs/heads/master | 2020-09-02T14:57:12.123668 | 2019-11-03T03:09:25 | 2019-11-03T03:09:25 | 219,244,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | /*
* package sai.service.springsecurityjwt;
*
* import org.junit.jupiter.api.Test; import
* org.springframework.boot.test.context.SpringBootTest;
*
* @SpringBootTest class SpringSecurityJwtApplicationTests {
*
* @Test void contextLoads() { }
*
* }
*/ | [
"coddinginjava@gmail.com"
] | coddinginjava@gmail.com |
e9d2422e5d8da204846eafe58b07452f27ce6806 | 17a31cffd22250de04351b63d6e518e93f60cde8 | /src/TimeMachine.java | c22ce3b7769f2792ca2851b57cdcc542e7711173 | [] | no_license | Emifioli/Javalearn | 2af2d9783256c94d505de26c2104bea833ca1c53 | 8339a11e10601333315bddc47c5ae3a7ac1332ce | refs/heads/master | 2021-04-26T15:01:00.642542 | 2015-09-25T09:49:54 | 2015-09-25T09:49:54 | 43,129,354 | 0 | 0 | null | null | null | null | WINDOWS-1251 | Java | false | false | 5,374 | java | import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class TimeMachine
{
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
JFrame jFrame = new MyFrame();
jFrame.setLocation(500,300);
jFrame.setTitle("Кидала");
jFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
jFrame.setVisible(true);
jFrame.setResizable(false);
}
});
}
}
class MyFrame extends JFrame {
private JPanel z;
private JToggleButton[] mas;
private static int Knock = -1;
private static int Lol = 1;
private JLabel lj;
public MyFrame() {
//Размер окна при запуске
int SIZE_WIDTH = 500;
int SIZE_HEIGHT = 300;
setSize(SIZE_WIDTH,SIZE_HEIGHT);
//Внешний вид
try {
UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
SwingUtilities.updateComponentTreeUI(MyFrame.this);
}catch (Exception e){}
//Центральная панель
lj=new JLabel("Кубик не выбран, Выберите кубик!!!");
lj.setFont(new Font("Arial", Font.TRUETYPE_FONT,20));
lj.setBounds(55,210,400,55);
add(lj);
//Кнопочная панель
z=new JPanel();
//Действие на главную клавишу
Kidok kidok = new Kidok("Кинуть");
JButton jb=new JButton(kidok);
InputMap imap = z.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
imap.put(KeyStroke.getKeyStroke("ENTER"), "Kidok");
ActionMap amap = z.getActionMap();
amap.put("Kidok",kidok);
//Размер, шрифт на главной клавишы
jb.setFont(new Font("Arial", Font.ITALIC,12));
jb.setPreferredSize(new Dimension(getWidth(),getHeight()/3));
//Массив кнопок по выбору дайсов
mas = CreateJTB(4,6,8,10,12,20,100);
addButton(z, mas, jb);
add(z, BorderLayout.CENTER);
addWindowListener( new AreYouSure());
for(JToggleButton x : mas){
x.setBackground(getRandomColor());
}
z.setBackground(getRandomColor());
}
private JToggleButton[] CreateJTB(int... size){
JToggleButton[] mas = new JToggleButton[size.length];
for(int i=0;i<mas.length;i++) {
JToggleButton as=new JToggleButton();
UnClick un = new UnClick("Кубик на " + size[i],as,size[i]);
as.setAction(un);
mas[i] = as;
}
return mas;
}
private Color getRandomColor(){
int r = (int) (Math.random() * 251);
int b = (int) (Math.random() * 251);
int g = (int) (Math.random() * 251);
return new Color(r,g,b);
}
private void addButton(JPanel jPanel,AbstractButton[] s,AbstractButton... r) {
for(AbstractButton x : r)
jPanel.add(x);
for(AbstractButton x : s)
jPanel.add(x);
}
private class AreYouSure extends WindowAdapter {
public void windowClosing( WindowEvent e ) {
int option = JOptionPane.showOptionDialog(
MyFrame.this,
"Хотите выйти?",
"Выход", JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE, null, null,
null );
if( option == JOptionPane.YES_OPTION ) {
System.exit( 0 );
}
}
}
private class UnClick extends AbstractAction {
private JToggleButton e;
int t;
public UnClick(String name, JToggleButton z, int k)
{
putValue(Action.NAME, name);
e=z;
t=k;
}
public void actionPerformed(ActionEvent event)
{
boolean se = e.isSelected();
if(!se){
e.setSelected(false);
Knock=-1;
lj.setBounds(55,210,400,55);
lj.setText("Кубик не выбран, Выберите кубик!!!");
}else {
for(JToggleButton y1 : mas) {
y1.setSelected(false);
}
e.setSelected(true);
Knock=t;
lj.setBounds(180,210,400,55);
lj.setText("Кубик на "+Knock);
}
}
}
private class Kidok extends AbstractAction{
public Kidok(String name) {
putValue(Action.NAME, name);
putValue(Action.SHORT_DESCRIPTION, "Enter");
}
@Override
public void actionPerformed(ActionEvent e) {
if(Knock==-1){
lj.setText("Кубик не выбран, Выберите кубик!!!");
lj.setBounds(55,210,400,55);
}
else {
int result = (int)(Math.random() * Knock + 1);
lj.setBounds(220,210,400,55);
lj.setText(""+result);
}
}
}
} | [
"Emifioli@mail.ru"
] | Emifioli@mail.ru |
c7342866553a9053fb0790d8798e64dd985f6c99 | 08610788f35a7ac0726accb49a969b7d0aab412e | /equipment/src/main/java/com/krt/equipment/dao/entity/EquipmentEntity.java | 1569e52e8eed68ac7a2f7b8e5f14b11c16fa3dcc | [] | no_license | kiterunner-t/fescar-spring-cloud | 4409737ca6654c154115f79bfddff9f5091db2ec | 0a9d1348f2b889f5d4bfc0e96217a49eaec52771 | refs/heads/master | 2020-04-18T12:36:22.081869 | 2019-01-25T11:39:58 | 2019-01-25T11:39:58 | 167,538,672 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 271 | java | /**
* Copyright (C) KRT, 2019 by kiterunner_t
* TO THE HAPPY FEW
*/
package com.krt.equipment.dao.entity;
import lombok.Data;
@Data
public class EquipmentEntity {
private Integer equipmentId;
private String equipmentCode;
private String equipmentName;
}
| [
"tangzhi@zjrealtech.com"
] | tangzhi@zjrealtech.com |
80d8e48961f987fd22e5b97f51de7366a715ef99 | 382d23a7e3333c7efd7432dfbef7bbca1f11e601 | /src/com/example/futbogol/IniciActivity.java | 6aba92bf1bc1ee7fb0ff09b51e9b6639f297d713 | [] | no_license | jordieric/FutboGol-Multimedia | 17d603d801786c4d3f5b40c33d63ddf280bb1d63 | ca1858739b7b58d05bfc3563c694d4fcfa5a94cb | refs/heads/master | 2020-05-18T01:53:45.260053 | 2014-04-07T13:06:33 | 2014-04-07T13:06:33 | null | 0 | 0 | null | null | null | null | ISO-8859-13 | Java | false | false | 5,417 | java | package com.example.futbogol;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.example.futbosoci.Soci;
public class IniciActivity extends Activity {
// un codi per l'aplicació a obrir
static final int CAMERA_APP_CODE = 100;
// el fitxer on es guardarą la imatge
private File tempImageFile;
private String nom, cognom, correu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inici);
}
public void btnFotoClick(View v) {
nom = ((EditText) findViewById(R.id.iniciNom)).getText().toString();
cognom = ((EditText) findViewById(R.id.iniciCognom)).getText()
.toString();
correu = ((EditText) findViewById(R.id.iniciCorreu)).getText()
.toString();
if (nom.equals("") || cognom.equals("") || correu.equals("")) {
Toast.makeText(this, "Omple els camps!", Toast.LENGTH_SHORT).show();
} else {
if (isIntentAvailable(this, MediaStore.ACTION_IMAGE_CAPTURE)) {
// intenció de fer una foto
Intent takePictureIntent = new Intent(
MediaStore.ACTION_IMAGE_CAPTURE);
// crear la ruta del fitxer on desar la foto
tempImageFile = crearFitxer();
// li passem parąmetres a l'Inent per indicar que es vol guarda
// la captura en un fitxer
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
Uri.fromFile(tempImageFile));
// inciar l'intent
startActivityForResult(takePictureIntent, CAMERA_APP_CODE);
} else {
Toast.makeText(this,
"No hi ha cap aplicació per capturar fotos",
Toast.LENGTH_LONG).show();
}
}
}
/**
* Mčtode que comprova si hi ha una aplicició per a captura de fotos
*
* @param context
* @param action
* @return true si existeix, false en cas contrari
*/
public static boolean isIntentAvailable(Context context, String action) {
final PackageManager packageManager = context.getPackageManager();
final Intent intent = new Intent(action);
List<ResolveInfo> list = packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
return list.size() > 0;
}
/**
* Mčtode que respon a l'event clic del botó
*
* @param view
* @throws IOException
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CAMERA_APP_CODE) {
if (resultCode == RESULT_OK) {
if (reduirQualitat()) {
Intent i = new Intent(IniciActivity.this,
CarnetSociActivity.class);
Soci soci = new Soci(nom, cognom, correu);
Bundle b = new Bundle();
b.putSerializable("Soci", soci);
b.putSerializable("Imatge", tempImageFile);
i.putExtras(b);
startActivity(i);
} else {
Toast.makeText(this, "Has de fer la foto en VERTICAL!",
Toast.LENGTH_LONG).show();
}
}
}
}
/**
* Crea la ruta absoluta per a un nou fitxer temporal
*
* @return L'objecte File que representa el fitxer
*/
private File crearFitxer() {
// Create an image file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss")
.format(new Date());
String imageFileName = "foto" + timeStamp + ".jpg";
File path = new File(Environment.getExternalStorageDirectory(),
this.getPackageName());
if (!path.exists())
path.mkdirs();
return new File(path, imageFileName);
}
public boolean reduirQualitat() {
int MAX_IMAGE_SIZE = 200 * 1024;
Bitmap bmpPic = BitmapFactory.decodeFile(tempImageFile.getPath());
if (bmpPic.getWidth() > bmpPic.getHeight()) {
return false;
} else {
if ((bmpPic.getWidth() >= 1024) && (bmpPic.getHeight() >= 1024)) {
BitmapFactory.Options bmpOptions = new BitmapFactory.Options();
bmpOptions.inSampleSize = 1;
while ((bmpPic.getWidth() >= 1024)
&& (bmpPic.getHeight() >= 1024)) {
bmpOptions.inSampleSize++;
bmpPic = BitmapFactory.decodeFile(tempImageFile.getPath(),
bmpOptions);
}
}
int compressQuality = 104;
int streamLength = MAX_IMAGE_SIZE;
while (streamLength >= MAX_IMAGE_SIZE) {
ByteArrayOutputStream bmpStream = new ByteArrayOutputStream();
compressQuality -= 5;
bmpPic.compress(Bitmap.CompressFormat.JPEG, compressQuality,
bmpStream);
byte[] bmpPicByteArray = bmpStream.toByteArray();
streamLength = bmpPicByteArray.length;
}
try {
FileOutputStream bmpFile = new FileOutputStream(tempImageFile);
bmpPic.compress(Bitmap.CompressFormat.JPEG, compressQuality,
bmpFile);
bmpFile.flush();
bmpFile.close();
} catch (Exception e) {
}
return true;
}
}
}
| [
"Jordi@Jordi-HP"
] | Jordi@Jordi-HP |
6e3c2a4c7202bc16d7f20de564870d31475b3468 | b8b07abf620e19d22c1eff7ef38bcdae8c0d1bda | /demo/FileTransfer/src/com/example/filetransfer/net/NetHelper.java | bcf18805b687e6131190811e6ae9441edaa0faea | [] | no_license | sxk183393/FileTransfer-Android | 8196a7fb12f34398769c378dd9ae4a42803d559f | f8fe028e360c9566b451613a0213e9a9d0840d5c | refs/heads/master | 2020-12-28T21:51:07.029998 | 2015-04-16T07:35:06 | 2015-04-16T07:35:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,270 | java | package com.example.filetransfer.net;
import java.util.HashMap;
import java.util.Map;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import com.example.filetransfer.application.myApplication;
import com.example.filetransfer.data.MsgConst;
import com.example.filetransfer.data.User;
import com.example.filetransfer.data.UserConst;
public class NetHelper implements Runnable{
private myApplication mApplication;
private Map<String,User> users = new HashMap<String,User>();
private Context context;
public NetHelper(Context mcontext)
{
this.context = mcontext;
mApplication = (myApplication)context.getApplicationContext();
}
public void startSearch(){
User u = new User("10.10.10.10",UserConst.NOFILETRANSFER,0,100);
users.put("10.10.10.10", u);
u=new User("196.198.123.1",UserConst.SENDINGFILE,40,20);
users.put("196.198.123.1",u);
Handler handler = mApplication.getHandler("SearchActivity");
handler.sendEmptyMessage(MsgConst.CHANGEUSERS);
}
public void StopSearch(){}
public Map<String, User> getUsers() {
// TODO Auto-generated method stub
return users;
}
public int getUserCount() {
// TODO Auto-generated method stub
return users.size();
}
@Override
public void run()
{
}
}
| [
"1561875960@qq.com"
] | 1561875960@qq.com |
f10e7326297da73e6025d0d5777855f7954ff03d | 3eca6278418d9eef7f5f850b23714a8356ef525f | /tumi/SocioEJB/ejbModule/pe/com/tumi/credito/socio/creditos/bo/CreditoTipoGarantiaCondicionHabilBO.java | 9974d906905431351d87e97b730b40987a07f0d1 | [] | no_license | cdelosrios88/tumiws-bizarq | 2728235b3f3239f12f14b586bb6349e2f9b8cf4f | 7b32fa5765a4384b8d219c5f95327b2e14dd07ac | refs/heads/master | 2021-01-23T22:53:21.052873 | 2014-07-05T05:19:58 | 2014-07-05T05:19:58 | 32,641,875 | 0 | 0 | null | null | null | null | ISO-8859-3 | Java | false | false | 5,029 | java | package pe.com.tumi.credito.socio.creditos.bo;
import java.util.HashMap;
import java.util.List;
import pe.com.tumi.credito.socio.creditos.dao.CreditoTipoGarantiaCondicionHabilDao;
import pe.com.tumi.credito.socio.creditos.dao.impl.CreditoTipoGarantiaCondicionHabilDaoIbatis;
import pe.com.tumi.credito.socio.creditos.domain.CondicionHabilTipoGarantia;
import pe.com.tumi.credito.socio.creditos.domain.CondicionHabilTipoGarantiaId;
import pe.com.tumi.credito.socio.creditos.domain.CondicionSocioTipoGarantia;
import pe.com.tumi.credito.socio.creditos.domain.CreditoTipoGarantiaId;
import pe.com.tumi.framework.negocio.exception.BusinessException;
import pe.com.tumi.framework.negocio.exception.DAOException;
import pe.com.tumi.framework.negocio.factory.TumiFactory;
public class CreditoTipoGarantiaCondicionHabilBO {
private CreditoTipoGarantiaCondicionHabilDao dao = (CreditoTipoGarantiaCondicionHabilDao)TumiFactory.get(CreditoTipoGarantiaCondicionHabilDaoIbatis.class);
public CondicionHabilTipoGarantia grabarCreditoTipoGarantia(CondicionHabilTipoGarantia o) throws BusinessException{
CondicionHabilTipoGarantia dto = null;
try{
dto = dao.grabar(o);
}catch(DAOException e){
throw new BusinessException(e);
}catch(Exception e) {
throw new BusinessException(e);
}
return dto;
}
public CondicionHabilTipoGarantia modificarCreditoTipoGarantia(CondicionHabilTipoGarantia o) throws BusinessException{
CondicionHabilTipoGarantia dto = null;
try{
dto = dao.modificar(o);
}catch(DAOException e){
throw new BusinessException(e);
}catch(Exception e) {
throw new BusinessException(e);
}
return dto;
}
public CondicionHabilTipoGarantia getCreditoTipoGarantiaPorPK(CondicionHabilTipoGarantiaId pPK) throws BusinessException{
CondicionHabilTipoGarantia domain = null;
List<CondicionHabilTipoGarantia> lista = null;
try{
HashMap mapa = new HashMap();
mapa.put("intPersEmpresaPk", pPK.getIntPersEmpresaPk());
mapa.put("intParaTipoCreditoCod", pPK.getIntParaTipoCreditoCod());
mapa.put("intItemCredito", pPK.getIntItemCredito());
mapa.put("intParaTipoGarantiaCod", pPK.getIntParaTipoGarantiaCod());
mapa.put("intItemCreditoGarantia", pPK.getIntItemCreditoGarantia());
mapa.put("intItemGarantiaTipo", pPK.getIntItemGarantiaTipo());
mapa.put("intParaTipoHabilCod", pPK.getIntParaTipoHabilCod());
lista = dao.getListaCondicionHabilTipoGarantiaPorPK(mapa);
if(lista!=null){
if(lista.size()==1){
domain = lista.get(0);
}else if(lista.size()==0){
domain = null;
}else{
throw new BusinessException("Obtención de mas de un registro coincidente");
}
}
}catch(DAOException e){
throw new BusinessException(e);
}catch(BusinessException e){
throw e;
}catch(Exception e) {
throw new BusinessException(e);
}
return domain;
}
/**
*
* @param pCreditoGarantia
* @return
* @throws BusinessException
*/
public List<CondicionHabilTipoGarantia> getListaCondicionHabilPorPKCreditoTipoGarantia(CreditoTipoGarantiaId pCreditoGarantia) throws BusinessException{
List<CondicionHabilTipoGarantia> lista = null;
try{
HashMap<String, Object> mapa = new HashMap<String, Object>();
mapa.put("intPersEmpresaPk", pCreditoGarantia.getIntPersEmpresaPk());
mapa.put("intParaTipoCreditoCod", pCreditoGarantia.getIntParaTipoCreditoCod());
mapa.put("intItemCredito", pCreditoGarantia.getIntItemCredito());
mapa.put("intParaTipoGarantiaCod", pCreditoGarantia.getIntParaTipoGarantiaCod());
mapa.put("intItemCreditoGarantia", pCreditoGarantia.getIntItemCreditoGarantia());
mapa.put("intItemGarantiaTipo", pCreditoGarantia.getIntItemGarantiaTipo());
lista = dao.getListaCondicionHabilTipoGarantiaPorCreditoTipoGarantia(mapa);
}catch(DAOException e){
throw new BusinessException(e);
}catch(Exception e) {
throw new BusinessException(e);
}
return lista;
}
public List<CondicionHabilTipoGarantia> getListaCondicionHabilPorCreditoTipoGarantia(CreditoTipoGarantiaId pCreditoGarantia) throws BusinessException{
List<CondicionHabilTipoGarantia> lista = null;
try{
HashMap<String, Object> mapa = new HashMap<String, Object>();
mapa.put("intPersEmpresaPk", pCreditoGarantia.getIntPersEmpresaPk());
mapa.put("intParaTipoCreditoCod", pCreditoGarantia.getIntParaTipoCreditoCod());
mapa.put("intItemCredito", pCreditoGarantia.getIntItemCredito());
mapa.put("intParaTipoGarantiaCod", pCreditoGarantia.getIntParaTipoGarantiaCod());
mapa.put("intItemCreditoGarantia", pCreditoGarantia.getIntItemCreditoGarantia());
mapa.put("intItemGarantiaTipo", pCreditoGarantia.getIntItemGarantiaTipo());
lista = dao.getListaCondicionHabilPorCreditoTipoGarantia(mapa);
}catch(DAOException e){
throw new BusinessException(e);
}catch(Exception e) {
throw new BusinessException(e);
}
return lista;
}
}
| [
"cdelosrios@bizarq.com@b3a863b4-f5f8-5366-a268-df30542ed8c1"
] | cdelosrios@bizarq.com@b3a863b4-f5f8-5366-a268-df30542ed8c1 |
88e7ff9c550da10704a26f3d641a606081032925 | 177a389c4a695be316f3e3f1cd1f18d826a102fe | /app/src/main/java/com/matelau/junior/centsproject/Models/VizModels/MajorQuery.java | 079e8432f9dd6fa5ff953206bfb6933836d7c183 | [] | no_license | matelau/CentsMobile | a660e2f849b4652cb6623505609164905f11a238 | 96893a7f18a998b4f09b429393b63224000a0eee | refs/heads/master | 2020-12-07T03:50:08.321150 | 2015-05-06T17:50:31 | 2015-05-06T17:50:31 | 28,199,453 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 901 | java | package com.matelau.junior.centsproject.Models.VizModels;
import com.google.gson.annotations.Expose;
import java.util.ArrayList;
import java.util.List;
/**
* Created by matelau on 3/5/15.
*/
public class MajorQuery {
@Expose
private String operation;
@Expose
private List<Major> degrees = new ArrayList<Major>();
/**
*
* @return
* The operation
*/
public String getOperation() {
return operation;
}
/**
*
* @param operation
* The operation
*/
public void setOperation(String operation) {
this.operation = operation;
}
/**
*
* @return
* The majors
*/
public List<Major> getMajors() {
return degrees;
}
/**
*
* @param majors
* The majors
*/
public void setMajors(List<Major> majors) {
this.degrees = majors;
}
}
| [
"matelau@gmail.com"
] | matelau@gmail.com |
340a4bae8dfcaf49a59e0f97253a395dc3911db8 | d2df87bcdf399e2f0a3028cb29ed4c6654e44d67 | /src/main/java/com/github/zhaopei/distributefile/DistributeFileApplication.java | 2630403bad2f722ff856b0753d55cb692462a191 | [] | no_license | zhaopei8948/distribute-file | 959ea408c2b1856ca70514501c2382d05f7face6 | 35dce284bc39b0361c887273878fd48b383c7d8d | refs/heads/master | 2022-10-24T07:57:32.885816 | 2020-06-15T03:47:29 | 2020-06-15T03:47:29 | 271,804,005 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 681 | java | package com.github.zhaopei.distributefile;
import com.github.zhaopei.distributefile.utils.CommonUtils;
import com.github.zhaopei.distributefile.utils.SpringContextUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
@SpringBootApplication
public class DistributeFileApplication {
public static void main(String[] args) {
ApplicationContext applicationContext = SpringApplication.run(DistributeFileApplication.class, args);
SpringContextUtils.setApplicationContext(applicationContext);
CommonUtils.initAdapter();
}
}
| [
"zhaopei8948@hotmail.com"
] | zhaopei8948@hotmail.com |
7ada54c0d7486f2a4cc8438975255002702cc88b | f0f0dcf59ef87846470f557113270824a0a2a893 | /src/main/java/com/yale/zc/user/dao/UserMapper.java | 7128561a66ff2e913d3efabc783ce92fbfcc93eb | [] | no_license | maifayan/zc-server | 9ce842fec77b5b1579a268adbb0f9e8537407520 | 8da4fcd5dc673e483eee89b3e1154724075e25a5 | refs/heads/master | 2020-04-22T15:32:33.095387 | 2019-02-13T09:36:11 | 2019-02-13T09:36:11 | 170,480,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | package com.yale.zc.user.dao;
import com.yale.zc.user.bean.User;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface UserMapper {
int deleteByPrimaryKey(String id);
int insert(User record);
int insertSelective(User record);
User selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(User record);
int updateByPrimaryKey(User record);
User selectByPhone(String phone);
List<User> selectByRealnameCertStatus(Integer status);
List<User> selectAll();
List<User> selectByAgentCertStatus();
} | [
"1105591782@qq.com"
] | 1105591782@qq.com |
9d2342ee280d2efcd4a28c98a587f81fe3731517 | 194e5e4f65764808c646d5d3bf2613dca7e77f59 | /StarV1MoussaKevin/app/src/main/java/fr/istic/mob/starv1moussakevin/MainActivity.java | a9a318c62cf8ae15717ee07d5403dd20d104086e | [] | no_license | Bambamoussa/ProjetStar | 2a51803f4fe056cba52bbe33390fc4770657b2ca | 50b11a78f6b7828be2d70129b731967bc6ecd566 | refs/heads/main | 2023-02-14T18:38:10.733790 | 2021-01-10T21:20:00 | 2021-01-10T21:20:00 | 328,269,549 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,135 | java | package fr.istic.mob.starv1moussakevin;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import androidx.work.Constraints;
import androidx.work.Data;
import androidx.work.NetworkType;
import androidx.work.OneTimeWorkRequest;
import androidx.work.PeriodicWorkRequest;
import androidx.work.WorkManager;
import java.util.concurrent.TimeUnit;
public class MainActivity extends AppCompatActivity {
SharedPreferences prefs;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
prefs = getApplicationContext().getSharedPreferences("fr.istic.mob.starv1moussakevin", Context.MODE_PRIVATE);
setContentView(R.layout.activity_main);
//if internet is available
if (cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnected()) {
Constraints constraints = new Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.build();
PeriodicWorkRequest saveRequest =
new PeriodicWorkRequest.Builder(Updates.class, 15, TimeUnit.MINUTES)
.setConstraints(constraints)
.build();
WorkManager.getInstance(getApplicationContext())
.enqueue(saveRequest);
}
}
@Override
protected void onRestart() {
super.onRestart();
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (intent.getExtras() != null) {
String uriToZip = intent.getExtras().getString("uriToZip");
if (uriToZip != null && !uriToZip.isEmpty()) {
Constraints constraints = new Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.build();
Data.Builder data = new Data.Builder();
data.putString("uri", uriToZip);
OneTimeWorkRequest saveRequest =
new OneTimeWorkRequest.Builder(Download.class)
.setInputData(data.build())
.setConstraints(constraints)
.build();
WorkManager.getInstance(getApplicationContext())
.enqueue(saveRequest);
}
}
}
@Override
public void onDestroy() {
super.onDestroy();
try {
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"engineeryeo.a@gmail.com"
] | engineeryeo.a@gmail.com |
09d06c67fa2a8cbd0166f26b87b037751d107086 | d85b46cb7242c1a07811bf6d4aed08dcf0e65364 | /src/main/java/it/fabiofenoglio/lelohub/config/package-info.java | 09266c7f46e68f3e2308a541b96945ed1ef5fcd9 | [] | no_license | ashley0101/lelo-f1-hub | d6d3593071f7282588ab68673ca2794ec93e7f79 | f4bf412565c3ad8d6001107fb428580b643643d2 | refs/heads/master | 2022-06-18T03:59:30.023111 | 2020-05-08T14:41:58 | 2020-05-08T14:41:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 90 | java | /**
* Spring Framework configuration files.
*/
package it.fabiofenoglio.lelohub.config;
| [
"fabio.fenoglio@gmail.com"
] | fabio.fenoglio@gmail.com |
df3db897f25719c1da41a8f17a82d7d4c7891298 | 798646067233b55d04d25aa9929018045ea93f6e | /spring-specification-datasource-autoconfiguration/src/main/java/fr/pinguet62/springspecification/core/builder/database/autoconfigure/orm/jpa/SpringSpecificationJpaProperties.java | 68e39176498588b8a136011691f4407660d68911 | [
"Apache-2.0"
] | permissive | pinguet62/spring-specification | 4b10bb37e264c427320bcea94caea9528e2d92fa | 7f2fad5d7a5604046606026b8614bfa4ae2ce296 | refs/heads/master | 2021-06-28T16:03:16.563868 | 2020-02-12T15:04:13 | 2020-02-12T15:04:15 | 97,410,867 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 9,293 | java | /*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fr.pinguet62.springspecification.core.builder.database.autoconfigure.orm.jpa;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
import javax.sql.DataSource;
import org.hibernate.boot.model.naming.ImplicitNamingStrategy;
import org.hibernate.boot.model.naming.PhysicalNamingStrategy;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.orm.jpa.vendor.Database;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
/**
* External configuration properties for a JPA EntityManagerFactory created by Spring.
*
* @author Dave Syer
* @author Andy Wilkinson
* @author Stephane Nicoll
* @author Eddú Meléndez
* @author Madhura Bhave
* @since 1.1.0
*/
@ConfigurationProperties(prefix = "spring-specification.jpa")
public class SpringSpecificationJpaProperties {
/**
* Additional native properties to set on the JPA provider.
*/
private Map<String, String> properties = new HashMap<>();
/**
* Mapping resources (equivalent to "mapping-file" entries in persistence.xml).
*/
private final List<String> mappingResources = new ArrayList<>();
/**
* Name of the target database to operate on, auto-detected by default. Can be
* alternatively set using the "Database" enum.
*/
private String databasePlatform;
/**
* Target database to operate on, auto-detected by default. Can be alternatively set
* using the "databasePlatform" property.
*/
private Database database;
/**
* Whether to initialize the schema on startup.
*/
private boolean generateDdl = false;
/**
* Whether to enable logging of SQL statements.
*/
private boolean showSql = false;
/**
* Register OpenEntityManagerInViewInterceptor. Binds a JPA EntityManager to the
* thread for the entire processing of the request.
*/
private Boolean openInView;
private Hibernate hibernate = new Hibernate();
public Map<String, String> getProperties() {
return this.properties;
}
public void setProperties(Map<String, String> properties) {
this.properties = properties;
}
public List<String> getMappingResources() {
return this.mappingResources;
}
public String getDatabasePlatform() {
return this.databasePlatform;
}
public void setDatabasePlatform(String databasePlatform) {
this.databasePlatform = databasePlatform;
}
public Database getDatabase() {
return this.database;
}
public void setDatabase(Database database) {
this.database = database;
}
public boolean isGenerateDdl() {
return this.generateDdl;
}
public void setGenerateDdl(boolean generateDdl) {
this.generateDdl = generateDdl;
}
public boolean isShowSql() {
return this.showSql;
}
public void setShowSql(boolean showSql) {
this.showSql = showSql;
}
public Boolean getOpenInView() {
return this.openInView;
}
public void setOpenInView(Boolean openInView) {
this.openInView = openInView;
}
public Hibernate getHibernate() {
return this.hibernate;
}
public void setHibernate(Hibernate hibernate) {
this.hibernate = hibernate;
}
/**
* Get configuration properties for the initialization of the main Hibernate
* EntityManagerFactory.
* @param settings the settings to apply when determining the configuration properties
* @return some Hibernate properties for configuration
*/
public Map<String, Object> getHibernateProperties(SpringSpecificationHibernateSettings settings) {
return this.hibernate.getAdditionalProperties(this.properties, settings);
}
/**
* Determine the {@link Database} to use based on this configuration and the primary
* {@link DataSource}.
* @param dataSource the auto-configured data source
* @return {@code Database}
*/
public Database determineDatabase(DataSource dataSource) {
if (this.database != null) {
return this.database;
}
return SpringSpecificationDatabaseLookup.getDatabase(dataSource);
}
public static class Hibernate {
private static final String USE_NEW_ID_GENERATOR_MAPPINGS = "hibernate.id."
+ "new_generator_mappings";
/**
* DDL mode. This is actually a shortcut for the "hibernate.hbm2ddl.auto"
* property. Defaults to "create-drop" when using an embedded database and no
* schema manager was detected. Otherwise, defaults to "none".
*/
private String ddlAuto;
/**
* Whether to use Hibernate's newer IdentifierGenerator for AUTO, TABLE and
* SEQUENCE. This is actually a shortcut for the
* "hibernate.id.new_generator_mappings" property. When not specified will default
* to "true".
*/
private Boolean useNewIdGeneratorMappings;
private final Naming naming = new Naming();
public String getDdlAuto() {
return this.ddlAuto;
}
public void setDdlAuto(String ddlAuto) {
this.ddlAuto = ddlAuto;
}
public Boolean isUseNewIdGeneratorMappings() {
return this.useNewIdGeneratorMappings;
}
public void setUseNewIdGeneratorMappings(Boolean useNewIdGeneratorMappings) {
this.useNewIdGeneratorMappings = useNewIdGeneratorMappings;
}
public Naming getNaming() {
return this.naming;
}
private Map<String, Object> getAdditionalProperties(Map<String, String> existing,
SpringSpecificationHibernateSettings settings) {
Map<String, Object> result = new HashMap<>(existing);
applyNewIdGeneratorMappings(result);
getNaming().applyNamingStrategies(result,
settings.getImplicitNamingStrategy(),
settings.getPhysicalNamingStrategy());
String ddlAuto = determineDdlAuto(existing, settings::getDdlAuto);
if (StringUtils.hasText(ddlAuto) && !"none".equals(ddlAuto)) {
result.put("hibernate.hbm2ddl.auto", ddlAuto);
}
else {
result.remove("hibernate.hbm2ddl.auto");
}
Collection<SpringSpecificationHibernatePropertiesCustomizer> customizers = settings
.getHibernatePropertiesCustomizers();
if (!ObjectUtils.isEmpty(customizers)) {
customizers.forEach((customizer) -> customizer.customize(result));
}
return result;
}
private void applyNewIdGeneratorMappings(Map<String, Object> result) {
if (this.useNewIdGeneratorMappings != null) {
result.put(USE_NEW_ID_GENERATOR_MAPPINGS,
this.useNewIdGeneratorMappings.toString());
}
else if (!result.containsKey(USE_NEW_ID_GENERATOR_MAPPINGS)) {
result.put(USE_NEW_ID_GENERATOR_MAPPINGS, "true");
}
}
private String determineDdlAuto(Map<String, String> existing,
Supplier<String> defaultDdlAuto) {
if (!existing.containsKey("hibernate.hbm2ddl.auto")) {
String ddlAuto = (this.ddlAuto != null ? this.ddlAuto
: defaultDdlAuto.get());
if (!"none".equals(ddlAuto)) {
return ddlAuto;
}
}
if (existing.containsKey("hibernate.hbm2ddl.auto")) {
return existing.get("hibernate.hbm2ddl.auto");
}
return "none";
}
}
public static class Naming {
private static final String DEFAULT_PHYSICAL_STRATEGY = "org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy";
private static final String DEFAULT_IMPLICIT_STRATEGY = "org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy";
/**
* Fully qualified name of the implicit naming strategy.
*/
private String implicitStrategy;
/**
* Fully qualified name of the physical naming strategy.
*/
private String physicalStrategy;
public String getImplicitStrategy() {
return this.implicitStrategy;
}
public void setImplicitStrategy(String implicitStrategy) {
this.implicitStrategy = implicitStrategy;
}
public String getPhysicalStrategy() {
return this.physicalStrategy;
}
public void setPhysicalStrategy(String physicalStrategy) {
this.physicalStrategy = physicalStrategy;
}
private void applyNamingStrategies(Map<String, Object> properties,
ImplicitNamingStrategy implicitStrategyBean,
PhysicalNamingStrategy physicalStrategyBean) {
applyNamingStrategy(properties, "hibernate.implicit_naming_strategy",
implicitStrategyBean != null ? implicitStrategyBean
: this.implicitStrategy,
DEFAULT_IMPLICIT_STRATEGY);
applyNamingStrategy(properties, "hibernate.physical_naming_strategy",
physicalStrategyBean != null ? physicalStrategyBean
: this.physicalStrategy,
DEFAULT_PHYSICAL_STRATEGY);
}
private void applyNamingStrategy(Map<String, Object> properties, String key,
Object strategy, Object defaultStrategy) {
if (strategy != null) {
properties.put(key, strategy);
}
else if (defaultStrategy != null && !properties.containsKey(key)) {
properties.put(key, defaultStrategy);
}
}
}
}
| [
"pinguet62@gmail.com"
] | pinguet62@gmail.com |
04d99109fb0a6ce66429bd492c08ebee43dc6313 | 89922844861c5bb07eb21cb4ab7ed2a7cff73fa3 | /app/src/main/java/z/hobin/ylive/util/FileUtil.java | 0379471510d2cb8788aa845c950962853a39a509 | [] | no_license | z-houbin/YLive | a85036ebaf5bf903d5cc5ca11649078f72a93a4b | bd28a56d2c8669f83d0266e8c10c7f6a228a9dc9 | refs/heads/master | 2021-09-22T23:06:05.580844 | 2018-09-18T15:01:26 | 2018-09-18T15:01:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,641 | java | package z.hobin.ylive.util;
import android.content.res.Resources;
import android.text.TextUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class FileUtil {
public static String readRaw(Resources resources, int id) {
StringBuilder builder = new StringBuilder();
try {
InputStream is = resources.openRawResource(id);
InputStreamReader isr = new InputStreamReader(is, "UTF-8");
BufferedReader br = new BufferedReader(isr);
String str = "";
while ((str = br.readLine()) != null) {
builder.append(str + "\n");
}
} catch (IOException e) {
e.printStackTrace();
}
return builder.toString();
}
public static String md5(String string) {
if (TextUtils.isEmpty(string)) {
return "";
}
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
byte[] bytes = md5.digest(string.getBytes());
StringBuilder result = new StringBuilder();
for (byte b : bytes) {
String temp = Integer.toHexString(b & 0xff);
if (temp.length() == 1) {
temp = "0" + temp;
}
result.append(temp);
}
return result.toString();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return "";
}
}
| [
"z.houbin@foxmail.com"
] | z.houbin@foxmail.com |
1685e436ef49ff0c8c7f22911fa952cc153fc235 | 1a33044d4f96c35eb72a48db2e994b0dfdbb27f6 | /src/test/java/br/com/codenation/centraldeerros/LogServiceTest.java | f006dda43102ced58ed8c5a005d52f313e8be330 | [] | no_license | pessoas/codenation-central-de-erros | 668476afdebdd948138e1db495036008be2af966 | d0601b68f12d7f20f70aa6f161a7f1794b40a412 | refs/heads/master | 2022-11-11T18:42:44.427619 | 2020-06-25T22:04:17 | 2020-06-25T22:04:17 | 267,447,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,066 | java | package br.com.codenation.centraldeerros;
import br.com.codenation.centraldeerros.entity.Log;
import br.com.codenation.centraldeerros.entity.enums.Level;
import br.com.codenation.centraldeerros.projection.LogNoEventLog;
import br.com.codenation.centraldeerros.repository.LogRepository;
import br.com.codenation.centraldeerros.service.implementation.LogServiceImpl;
import br.com.codenation.centraldeerros.service.interfaces.LogService;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@ExtendWith(SpringExtension.class)
@DataJpaTest
public class LogServiceTest {
@TestConfiguration
static class LogServiceImplTestContextConfiguration {
@Bean
public LogServiceImpl logService() {
return new LogServiceImpl();
}
}
@Autowired
private LogService logService;
@Autowired
private LogRepository logRepository;
@Test
public void createShouldPersistData(){
Log log = new Log(Level.ERROR, "descricao", "evento", "origin",
LocalDateTime.now(), LocalDateTime.now(), 1L);
this.logService.save(log);
assertNotNull(log.getId());
assertEquals(Level.ERROR, log.getLevel());
assertEquals("descricao", log.getDescription());
assertEquals("evento", log.getEventLog());
assertEquals("origin", log.getOrigin());
assertEquals(1L, log.getEventNumber());
}
@Test
public void deleteShouldRemoveData() {
Log log = new Log(Level.ERROR, "descricao", "evento", "origin",
LocalDateTime.now(), LocalDateTime.now(), 1L);
this.logService.save(log);
this.logService.deleteById(log.getId());
assertEquals(Optional.empty(), this.logService.findById(log.getId()));
}
@Test
public void updateShouldAddNumberOfEventsToEventNumberAndPersistData() {
Log log = new Log(Level.ERROR, "descricao", "evento", "origin",
LocalDateTime.now(), LocalDateTime.now(), 1L);
this.logService.save(log);
this.logService.update(log.getId(), 1L);
log = this.logService.findById(log.getId()).get();
assertEquals(2L, log.getEventNumber());
}
@Test
public void savingEqualLogShouldUpdateEventNumber() {
Log log = new Log(Level.ERROR, "descricao", "evento", "origin",
LocalDateTime.now(), LocalDateTime.now(), 1L);
Log log2 = new Log(Level.ERROR, "descricao", "evento", "origin",
LocalDateTime.now(), LocalDateTime.now(), 5L);
this.logService.save(log);
this.logService.save(log2);
log = this.logService.findById(log.getId()).get();
assertEquals(6L, log.getEventNumber());
}
@Test
public void searchingByIdShouldReturnLog(){
Log log = new Log(Level.ERROR, "descricao", "evento", "origin",
LocalDateTime.now(), LocalDateTime.now(), 1L);
Log log2 = new Log(Level.WARNING, "descricao2", "evento2", "origin2",
LocalDateTime.now(), LocalDateTime.now(), 2L);
this.logService.save(log);
this.logService.save(log2);
Log dbLog = this.logService.findById(log.getId()).get();
assertEquals(log, dbLog);
}
@Test
public void searchingByDescriptionShouldReturnListOfLogNoEventLog(){
Log log = new Log(Level.ERROR, "descricao", "evento", "origin",
LocalDateTime.now(), LocalDateTime.now(), 1L);
Log log2 = new Log(Level.WARNING, "description", "logging", "system",
LocalDateTime.now(), LocalDateTime.now(), 2L);
this.logService.save(log);
this.logService.save(log2);
List<LogNoEventLog> dbLog = this.logService.findByDescription(log.getDescription(), null);
assertEquals(1, dbLog.size());
}
@Test
public void searchingByOriginShouldReturnListOfLogNoEventLog(){
Log log = new Log(Level.ERROR, "descricao", "evento", "origin",
LocalDateTime.now(), LocalDateTime.now(), 1L);
Log log2 = new Log(Level.WARNING, "description", "logging", "system",
LocalDateTime.now(), LocalDateTime.now(), 2L);
this.logService.save(log);
this.logService.save(log2);
List<LogNoEventLog> dbLog = this.logService.findByOrigin(log.getOrigin(), null);
assertEquals(1, dbLog.size());
}
@Test
public void searchingByEventLogShouldReturnListOfLogNoEventLog(){
Log log = new Log(Level.ERROR, "descricao", "evento", "origin",
LocalDateTime.now(), LocalDateTime.now(), 1L);
Log log2 = new Log(Level.WARNING, "description", "evento", "system",
LocalDateTime.now(), LocalDateTime.now(), 2L);
this.logService.save(log);
this.logService.save(log2);
List<LogNoEventLog> dbLog = this.logService.findByEventLog(log.getEventLog(), null);
assertEquals(2, dbLog.size());
}
@Test
public void searchingByLevelShouldReturnListOfLogNoEventLog(){
Log log = new Log(Level.ERROR, "descricao", "evento", "origin",
LocalDateTime.now(), LocalDateTime.now(), 1L);
Log log2 = new Log(Level.WARNING, "description", "evento", "system",
LocalDateTime.now(), LocalDateTime.now(), 2L);
this.logService.save(log);
this.logService.save(log2);
List<LogNoEventLog> dbLog = this.logService.findByLevel(log.getLevel(), null);
assertEquals(1, dbLog.size());
}
}
| [
"renatopessoaneto@gmail.com"
] | renatopessoaneto@gmail.com |
bbd7028cf33dcdee7010d8083a2041ae5689a643 | f598f81c0613f5502eef147120867b7b2468278d | /jagan_karan/OnlineBiddingApplication/src/io/ztech/onlinebidding/dao/InsertNewCustomer.java | 594e84ada9f06b268821a7370b7189945d8cd053 | [] | no_license | Muthusara1/zilkies19_java | 4095f60226aa7ce4c0657454638f660bb77669b1 | 6151ed093eba7cd15a004ba8f6c1ead7cb6112d8 | refs/heads/master | 2020-05-19T19:33:03.894669 | 2018-10-05T05:01:52 | 2018-10-05T05:01:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,469 | java | package io.ztech.onlinebidding.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.logging.Logger;
import io.ztech.onlinebidding.bean.CustomerDetail;
import io.ztech.onlinebidding.constant.ConstantDisplayStatement;
import io.ztech.onlinebidding.constant.SqlQueries;
import io.ztech.onlinebidding.utils.DatabaseConfig;
public class InsertNewCustomer implements SqlQueries, ConstantDisplayStatement {
DatabaseConfig dbConfig = new DatabaseConfig();
public static Logger logger = Logger.getLogger("OnlineBiddingDao");
public void insertNewUserDetails(CustomerDetail registerDetails) throws Exception {
Connection databaseConnection = dbConfig.getConnection();
try {
PreparedStatement insertstatement = databaseConnection.prepareStatement(INSERT_NEW_CUSTOMER);
insertstatement.setString(1, registerDetails.getFirstName());
insertstatement.setString(2, registerDetails.getLastName());
insertstatement.setString(3, registerDetails.getEmail());
insertstatement.setString(4, registerDetails.getMobileNumber());
insertstatement.setString(5, registerDetails.getDateOfBirth());
insertstatement.setString(6, registerDetails.getTypeOfUser());
insertstatement.setString(7, registerDetails.getUserName());
insertstatement.setString(8, registerDetails.getPassword());
insertstatement.executeUpdate();
} catch (Exception e) {
throw e;
} finally {
dbConfig.closeConnection(databaseConnection);
}
}
}
| [
"jagan.karan13@gmail.com"
] | jagan.karan13@gmail.com |
f1e85ba931dc320d268836ed961b65d6bd4f7dff | 4d25caa54ef3cc5ea6288585e4612268a8815f75 | /src/br/com/guikar/ufc/ed/ListaEncadeadaAula1.java | f2ea2efc2e33160599d1615ebc785aa7564510fd | [] | no_license | GUIKAR741/Codigos-Java | 51c2d3f948eae5e0ba9e72b433bd29d22ad09063 | d0bb51688e2bc9ae60a4bc7072cd0104c583ed92 | refs/heads/master | 2020-04-27T08:23:42.164910 | 2019-03-06T15:34:25 | 2019-03-06T15:34:25 | 174,169,566 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 672 | 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 br.com.guikar.ufc.ed;
/**
*
* @author tatiane
*/
public class ListaEncadeadaAula1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
ListaEncadeada1 xuxa = new ListaEncadeada1();
ListaEncadeada1 toto = new ListaEncadeada1();
ListaEncadeada1 leao = new ListaEncadeada1();
xuxa.addInicio(10);
xuxa.addInicio(20);
xuxa.addInicio(30);
xuxa.imprimir();
}
}
| [
"guilhermenepomuceno46@gmail.com"
] | guilhermenepomuceno46@gmail.com |
b42d438ba3b4fd8ae03d5fb37e40e5513052ea84 | 933923e2f57686c7ecfbd1d5b71632bd93c0cd84 | /src/TableModel.java | cf9ca0d6226c0617e3ca5da05f9b0d5602ddb69c | [] | no_license | izzymoriguchi/canvas | a46413c71c29f0b306f3e0252715a1e6fcc5c74f | 3ddb389e8c39ba22f2a4fb0aed245d9bad04fdfa | refs/heads/master | 2021-03-27T15:14:38.796723 | 2019-03-27T08:21:03 | 2019-03-27T08:21:03 | 110,078,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,006 | java | import javax.swing.table.AbstractTableModel;
public class TableModel extends AbstractTableModel implements ModelListener {
Canvas canvas;
private final String[] COLUMN_NAMES = new String[] {"X", "Y", "Width", "Height"};
public TableModel(Canvas canvas) {
this.canvas = canvas;
canvas.attachModelListener(this);
}
@Override
public int getRowCount() {
return canvas.getShapes().size();
}
@Override
public int getColumnCount() {
return COLUMN_NAMES.length;
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
DShapeModel model = canvas.getShapes().get(rowIndex).getdShapeModel();
Object valueAt = null;
if (columnIndex == 0) { // means return X
if (model instanceof DLineModel) {
valueAt = "Start X " + ((DLineModel) model).getUpperLeft().x;
} else {
valueAt = model.getX();
}
} else if (columnIndex == 1) { // means return Y
if (model instanceof DLineModel) {
valueAt = "Start Y " + ((DLineModel) model).getUpperLeft().y;
} else {
valueAt = model.getY();
}
} else if (columnIndex == 2) { // means return Width
if (model instanceof DLineModel) {
valueAt = "End X " + ((DLineModel) model).getLowerRight().x;
} else {
valueAt = model.getWidth();
}
} else if (columnIndex == 3) { // means return Height
if (model instanceof DLineModel) {
valueAt = "End Y " + ((DLineModel) model).getLowerRight().y;
} else {
valueAt = model.getHeight();
}
}
return valueAt;
}
@Override
public String getColumnName(int column) {
return COLUMN_NAMES[column];
}
@Override
public void modelChanged(DShapeModel model) {
fireTableDataChanged();
}
}
| [
"izumimoriguchi@gmail.com"
] | izumimoriguchi@gmail.com |
625eb8a426c7d867ef010a7019a2dadd0b4e307e | 22420882e0f781788da9fbab266c98e09534f283 | /AccessibilityFramework/app/src/main/java/framework/accessibilityframework/view/SensorListManager.java | 192f5a4b5cdb6ff2ae203ac586ccdfeac526808b | [] | no_license | olibarioneto/FrameworkProject | d547b7c86faf9fe0b290e480699d64a067fa9f68 | 1be179c9fd1476c74cf43aa61e538900f97c0cb6 | refs/heads/master | 2021-05-10T09:51:30.614298 | 2018-04-25T18:56:15 | 2018-04-25T18:56:15 | 118,940,708 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,113 | java | package framework.accessibilityframework.view;
import android.content.Intent;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.util.ArrayList;
import java.util.List;
import framework.accessibilityframework.R;
import framework.accessibilityframework.control.SensorUtils;
/**
* This class refers to the screen in which the user selects a radiobutton of the application he wants to look at.
* The sensors retrieved in the listview are all the sensors that the manufacturer has made available for the device.
* Frequently, many of the sensors lack official documentation of how to use in Android framework. In these cases, no data will
* be displayed about them at the "selected sensor screen"
*/
public class SensorListManager extends AppCompatActivity {
Intent sensorIntent;
ListView sensorListView;
SensorManager manager;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sensor_list);
sensorListView = findViewById(R.id.list_id);
manager = (SensorManager) getSystemService(SENSOR_SERVICE);
//Gets the instance of the facade class
SensorUtils facade = SensorUtils.getInstance();
//Restrieves list of all sensors available on the device
final Integer[] available_sensors = facade.getDeviceSensorTypes(manager, SensorListManager.this);
List<Sensor> sensors = facade.getAvailableDeviceSensors(manager, SensorListManager.this);
ArrayList<String> sensor_strings = new ArrayList<String>();
for (Sensor s: sensors){
if (s != null) {
sensor_strings.add(s.getName());
}
}
String[] v = {"abc", "edf", "egs"};
//Will redirect to SensorActivity screen
sensorIntent = new Intent(SensorListManager.this, SensorActivity.class);
//1st parameter: the context (Activity where we are)
//2nd parameter: the model of one single line of the list
//3rd parameter: id of the element to which the data is written
//4th parameter: the array containing all the list's data
ArrayAdapter<String> adapters = new ArrayAdapter<String>(this, R.layout.activity_sensor_list_schema,R.id.sensor_name, sensor_strings);
sensorListView.setAdapter(adapters);
sensorListView.setTextFilterEnabled(true);
sensorListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
//extra data contaning which sensor was selected
Integer aux = available_sensors[position];
sensorIntent.putExtra("chosen_sensor",aux);
startActivity(sensorIntent);
}
});
}
}
| [
"olibarioneto@gmail.com"
] | olibarioneto@gmail.com |
522953cfcf3f48e3297bda2916abb0cc403bd45a | 44c48fba70632443a8b3f0ffa80f3c2441df7e1e | /leetcode/Leetcode/src/Leetcode/Anagrams.java | 0d705a17843ae24dc74fb4529fcc922b3c9042cd | [] | no_license | hhtan611/leetcode | d9b304d8c58a76c1d49377dc7c611247c39db04b | eab8233468e07df2b00d2599a3922993002fce35 | refs/heads/master | 2021-01-23T02:28:52.785313 | 2017-03-23T21:32:39 | 2017-03-23T21:32:39 | 85,994,861 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,995 | java | package Leetcode;
/*
Author: King, wangjingui@outlook.com
Date: Dec 25, 2014
Problem: Anagrams
Difficulty: Easy
Source: https://oj.leetcode.com/problems/anagrams/
Notes:
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
Solution: Sort the string to see if they're anagrams.
*/
import java.util.*;
import java.util.Map.Entry;
public class Anagrams {
public static void main(String[] args) {
String[] strs = { "eat", "tea", "tan", "ate", "nat", "bat" };
List<String> ls = anagrams(strs);
}
public static List<String> anagrams(String[] strs) {
ArrayList<String> res = new ArrayList<String>();
HashMap<String, ArrayList<String>> group = new HashMap<String, ArrayList<String>>();
if (strs.length == 0)
return res;
for (int i = 0; i < strs.length; ++i) {
char[] tmp = strs[i].toCharArray();
Arrays.sort(tmp);
String s = String.valueOf(tmp);
if (group.containsKey(s))
(group.get(s)).add(strs[i]);
else {
ArrayList<String> t = new ArrayList<String>();
t.add(strs[i]);
group.put(s, t);
}
}
Iterator<Entry<String, ArrayList<String>>> iter = group.entrySet()
.iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
ArrayList<String> val = (ArrayList<String>) entry.getValue();
if (val.size() > 1)
res.addAll(val);
}
return res;
}
public List<List<String>> groupAnagrams(String[] strs) {
if (strs.length == 0 || strs == null)
return new ArrayList<List<String>>();
Map<String, List<String>> map = new HashMap<String, List<String>>();
for (String str : strs) {
char[] tmp = str.toCharArray();
Arrays.sort(tmp);
String keys = String.valueOf(tmp);
if (!map.containsKey(keys)) {
map.put(keys, new ArrayList<String>());
}
map.get(keys).add(str);
}
return new ArrayList<List<String>>(map.values());
}
}
| [
"htan@lenovo"
] | htan@lenovo |
f5d4ad16c9a1786c0e5b7009e35f4e2626074dcc | 60f1564e071b6b4d24069b5e70765412c9d7a730 | /xc-service-manage-course/src/test/java/com/xuecheng/manage_course/dao/AddTemplateTest.java | 88cc9ee29ff8a23aae664c90d103d5accefc3369 | [] | no_license | xibinzhao/xuechengzaixian | 1866af1753203911918ab4e66a5c35241d25fcfe | 4e622917717661904114ccda1b33d50f4ff1e1b1 | refs/heads/dev-TS-1 | 2022-11-30T19:28:29.976908 | 2020-07-03T08:57:06 | 2020-07-03T08:57:06 | 251,279,846 | 0 | 0 | null | 2022-11-24T06:27:43 | 2020-03-30T11:06:20 | Java | UTF-8 | Java | false | false | 1,663 | java | package com.xuecheng.manage_course.dao;
import com.alibaba.fastjson.JSON;
import com.xuecheng.framework.domain.cms.CmsTemplate;
import com.xuecheng.framework.model.response.QueryResponseResult;
import com.xuecheng.framework.model.response.ResponseResult;
import com.xuecheng.manage_course.ManageCourseApplication;
import com.xuecheng.manage_course.client.CmsTemplateClient;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
@SpringBootTest(classes = ManageCourseApplication.class)
@RunWith(SpringRunner.class)
public class AddTemplateTest {
@Autowired
private CmsTemplateClient cmsTemplateClient;
@Test
public void test() throws IOException {
FileInputStream fileInputStream = new FileInputStream("D:/course.ftl");
String s = IOUtils.toString(fileInputStream, "UTF-8");
CmsTemplate cmsTemplate = new CmsTemplate();
cmsTemplate.setSiteId("5a751fab6abb5044e0d19ea1");
cmsTemplate.setTemplateParameter("courseid");
cmsTemplate.setTemplateName("测试模板 课程详情页");
System.out.println(s);
ResponseResult add = cmsTemplateClient.add(s, "course.ftl", cmsTemplate);
System.out.println(add);
}
@Test
public void test2() {
QueryResponseResult all = cmsTemplateClient.findAll();
System.out.println(all);
}
}
| [
"1140877376@qq.com"
] | 1140877376@qq.com |
ee027f0a579d22b42f3d01f0930af09a3adde809 | 37875b04e9d16216b6c2cac770b6f6eff97044b6 | /app/src/androidTest/java/me/alexfischer/maxwellsdemon/ExampleInstrumentedTest.java | ae379f7a5e1d23e0caf20e3df6e528781f1f468d | [] | no_license | AlexDFischer/Chamberwell | f8d7235193f3ceeda01b860368b760942a7e132e | 5721ee07d62e2ed0f9046b05589f4926a9d0d324 | refs/heads/master | 2021-01-11T23:36:10.695594 | 2017-01-16T15:26:04 | 2017-01-16T15:26:04 | 78,608,208 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 760 | java | package me.alexfischer.maxwellsdemon;
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("me.alexfischer.maxwellsdemon", appContext.getPackageName());
}
}
| [
"alexander.fischer3@gmail.com"
] | alexander.fischer3@gmail.com |
d815e11e6bcea8663118165c8474b95cf02f9437 | 4d3f8564df96d599c9099fd08fc44fb76f05ceca | /src/main/java/com/algorithms/simple/DrMatrix.java | 3059d80f3cfb3e74ab77afaa947cd1bcda79fbfb | [] | no_license | maximd1/simple | 521e0c739c21a3e11f267967dbfd7002fe8ac263 | 94e1f84929dcae2dbad5f66c552f59f04765a4b1 | refs/heads/master | 2020-12-01T00:02:04.000553 | 2020-10-01T17:27:02 | 2020-10-01T17:27:02 | 230,516,382 | 0 | 0 | null | 2020-02-08T17:14:30 | 2019-12-27T20:46:27 | Java | UTF-8 | Java | false | false | 596 | java | package com.algorithms.simple;
public class DrMatrix {
private int n;
private int NINE = 9;
private int TEN = 10;
public DrMatrix(int n) {
this.n = n;
}
public static void main(String[] args) {
DrMatrix drm = new DrMatrix(5);
int result = drm.calculateSequence();
System.out.println(result);
}
public int calculateSequence() {
int result = 0;
for( int i = 1; i < n+1; i++ ) {
result = NINE*calculatePyramid() + (i+1);
}
return result;
}
public int calculatePyramid() {
int s = 0;
for( int i = 1; i <= n; i++ ) {
s = s*TEN+i;
}
return s;
}
}
| [
"maximd@ya0ne.com"
] | maximd@ya0ne.com |
cae2b30af50a84266ac51bafbc151d1e4205d32c | 248064e6c3d3119fdc3386863dd89e795ec65427 | /Exercicios04_Semaforos/src/ex02/Listener.java | 69b92ced86d75331599727f1172ec589a68f240a | [] | no_license | guto-alves/Sistemas-Operacionais-I | 09330ce92d10b1b0c48414dd54193c00b909d9c9 | 6d3902f5c5f852c535acefaa731c842003eec005 | refs/heads/master | 2020-07-02T14:36:47.677549 | 2019-09-27T18:50:41 | 2019-09-27T18:50:41 | 201,557,900 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 70 | java | package ex02;
public interface Listener {
void callback();
}
| [
"gustavo.almeida13@fatec.sp.gov.br"
] | gustavo.almeida13@fatec.sp.gov.br |
d17ea639d87957431301a5f0bd31a0986893b770 | 3593eefbf367547c8535f7f8fa41747fca8f17c8 | /plugins/test/src/org/lockss/plugin/atypon/nas/TestNasHtmlHashFilterFactory.java | 76c56d8e0538b42e3f41e18ababd38d5ff2f6ef6 | [
"BSD-3-Clause"
] | permissive | lockss/lockss-daemon | 2d1270e69620558852b6702010999d686fcf6dbf | dc887854e0c1b9dd364f0a14734923cdadeb2533 | refs/heads/master | 2023-08-16T23:47:42.004353 | 2023-08-16T22:33:52 | 2023-08-16T22:33:56 | 49,553,276 | 63 | 17 | null | 2018-04-25T20:02:53 | 2016-01-13T06:06:33 | Java | UTF-8 | Java | false | false | 39,467 | java | /*
Copyright (c) 2000-2022, Board of Trustees of Leland Stanford Jr. University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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 org.lockss.plugin.atypon.nas;
import org.lockss.test.LockssTestCase;
import org.lockss.test.MockArchivalUnit;
import org.lockss.test.StringInputStream;
import org.lockss.util.Constants;
import org.lockss.util.StringUtil;
import java.io.InputStream;
public class TestNasHtmlHashFilterFactory extends LockssTestCase {
private NasHtmlHashFilterFactory fact;
private MockArchivalUnit mau;
public void setUp() throws Exception {
super.setUp();
fact = new NasHtmlHashFilterFactory();
mau = new MockArchivalUnit();
}
private static final String variousCmsAssetImgs =
"<div class=\"testSection\">" +
"<div data-cover-src=\"/cms/asset/099477d1-3f71-4e50-84b5-bbbf4ed3cdfa/pnas.2022.119.issue-9.largecover.png\" class=\"cover-image__popup-moving-cover position-fixed d-block\"></div>" +
"<div data-cover-src=\"/cms/asset/56597d67-7abd-41f4-a970-ff42ae8e0057/pnas.2022.119.issue-9.largecover.png\" class=\"cover-image__popup-moving-cover position-fixed d-block\"></div>" +
"<div role=\"presentation\" style=\"background: linear-gradient(180deg, #000000 0%, rgba(0, 0, 0, 0.74) 42.8%, rgba(0, 0, 0, 0) 84%), url(/cms/asset/3a6137bb-cbbb-465d-bd3f-32b6e37903f5/toc-banner.jpg) no-repeat; background-size: cover;\" class=\"banner-widget__background\"></div>" +
"<div role=\"presentation\" style=\"background: linear-gradient(180deg, #000000 0%, rgba(0, 0, 0, 0.74) 42.8%, rgba(0, 0, 0, 0) 84%), url(/cms/asset/0976e527-f944-425c-8436-d41b5d4e0bcd/toc-banner.jpg) no-repeat; background-size: cover;\" class=\"banner-widget__background\"></div>" +
"<img src=\"/cms/10.1073/iti0122119/asset/9dc20090-4b47-4c0a-9abe-dab0613ae80e/assets/images/large/iti0122119unfig03.jpg\" />" +
"<img src=\"/cms/10.1073/iti0122119/asset/0ea25029-06ce-4afb-8c81-3c6527f7e4b3/assets/images/large/iti0122119unfig03.jpg\" />" +
"<img src=\"/cms/asset/099477d1-3f71-4e50-84b5-bbbf4ed3cdfa/pnas.2022.119.issue-9.largecover.png\" alt=\"Go to Proceedings of the National Academy of Sciences \" loading=\"lazy\" />" +
"<img src=\"/cms/asset/56597d67-7abd-41f4-a970-ff42ae8e0057/pnas.2022.119.issue-9.largecover.png\" alt=\"Go to Proceedings of the National Academy of Sciences \" loading=\"lazy\" />" +
"<img alt=\"March 8, 2022 Vol. 119 No. 10\" src=\"/cms/asset/09b6afce-9f42-41d7-a57d-4d56c6cf75f1/pnas.2022.119.issue-10.largecover.png\" loading=\"lazy\" width=\"272\" height=\"354\" class=\"w-100 h-auto\" />" +
"<img alt=\"March 8, 2022 Vol. 119 No. 10\" src=\"/cms/asset/ec13a2d2-b070-4378-8a1a-a07d1a159c65/pnas.2022.119.issue-10.largecover.png\" loading=\"lazy\" width=\"272\" height=\"354\" class=\"w-100 h-auto\" />" +
"<a href=\"/cms/asset/535b0729-21f9-405e-8e07-941b49472ab2/pnas.2022.119.issue-9.toc.pdf\" class=\"animation-icon-shift cta text-uppercase font-weight-bold text-reset\"></a>" +
"<a href=\"/cms/asset/0077a5af-361b-4216-89d3-403980be452b/pnas.2022.119.issue-9.toc.pdf\" class=\"animation-icon-shift cta text-uppercase font-weight-bold text-reset\"></a>" +
"</div>";
private static final String filteredVariousCmsAssetImgs = " <div class=\"testSection\"> </div>";
private static final String pubMed =
"<div class=\"core-pmid\">" +
"<span class=\"heading\">PubMed</span>: <a class=\"content\" href=\"https://pubmed.ncbi.nlm.nih.gov/35263229/\" property=\"sameAs\">35263229</a>" +
"</div>";
private static final String timeBadgeStamps =
"<div class=\"testSection\">" +
"<span class=\"pl-2 ml-2 pl-2 border-left border-darker-gray card__meta__date\">\n" +
"February 22, 2022" +
"</span>\n" +
"<span class=\"pl-2 ml-2 border-left border-darker-gray card__meta__badge\">\n" +
"From the Cover" +
"</span>" +
"</div>";
private static final String filteredTimeBadgeStamps = " <div class=\"testSection\"> </div>";
private static final String iframe =
"<iframe src=\"https://iframe.videodelivery.net/https://videodelivery.net/eyJraWQiOiI3YjgzNTg3NDZlNWJmNDM0MjY5YzEwZTYwMDg0ZjViYiIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI0MGU2NTZkNjEyMDNiYTVjM2VmYmFjMTc3YTg5Njk3NyIsImtpZCI6IjdiODM1ODc0NmU1YmY0MzQyNjljMTBlNjAwODRmNWJiIiwiZXhwIjoxNjQ3MDY1OTM1fQ.0pXPHunEO5QdlLGnCIsEQr6vmM7WFnrgx7YagV-h1rCoRgSSRZkHk2aT4-fVbJ-Obk0kS7NKw8JtQtfzbJfFjaUp6dI0HGKEzRvQGeJgcc-wh6aNjsszHMCd8mNgh0YlS-WRnch1fqk62E_1W2EkFS5zgN0CysnNk_vnIhtLvWwPQdbkPqaNHheui3LwwykgmsjgQxWy-rVBIaPMs1MoJK8Do-PCk8fjq8_N0CSX35KzGudR1gx05bcm-R1rOKHJ009d2WlIfyZPGZ3XaK_zUy4vxxVPa5A_ChnRpmTnQhcL1_W1yBm9rP2WIXcbUaFDwlxxnbWBCyvxVjgvcwYUOg/thumbnails/thumbnail.jpg?time=10.0s\" style=\"border: none;\" height=640\" width=\"100%\" allow=\"accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;\" allowfullscreen=\"false\">\n";
private static final String h3withId1 = "<h3 id=\"h_d1245944e49\" class=\"to-section mb-4\"></h3>";
private static final String h3withId2 = "<h3 id=\"h_d1049943e49\" class=\"to-section mb-4\"></h3>";
private static final String blankString = "";
private static final String abstractSection =
"<section id=\"frontmatter\" data-extent=\"frontmatter\">\n" +
" <header>\n" +
" <div class=\"core-container\">\n" +
" <div data-article-access=\"free\" data-article-access-type=\"free\" class=\"meta-panel\">\n" +
" <div class=\"meta-panel__left-content\">\n" +
" <div class=\"meta-panel__type\"><span>Letter</span></div>\n" +
" <div class=\"meta-panel__sub-type\"><a href=\"/topic/eco\">Ecology</a></div>\n" +
" <div class=\"meta-panel__access meta-panel__access--free\">FREE ACCESS</div>\n" +
" </div>\n" +
" <div class=\"meta-panel__right-content\">\n" +
" <div class=\"meta-panel__share\">\n" +
" <!-- Go to www.addthis.com/dashboard to customize your tools --><script type=\"text/javascript\" async=\"async\" src=\"//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-4faab26f2cff13a7\"></script>\n" +
" <div class=\"share__block share__inline-links\">\n" +
" <div class=\"pb-dropzone\" data-pb-dropzone=\"shareBlock\" title=\"shareBlock\"></div>\n" +
" <span class=\"sr-only\">Share on</span>\n" +
" <ul class=\"d-flex list-unstyled addthis addthis_toolbox mb-0\">\n" +
" <li><a role=\"link\" class=\"addthis_button_facebook at300b\" title=\"Facebook\" href=\"#\"><i aria-hidden=\"true\" class=\"at-icon-wrapper icon-facebook\"></i></a></li>\n" +
" <li><a role=\"link\" class=\"addthis_button_twitter at300b\" title=\"Twitter\" href=\"#\"><i aria-hidden=\"true\" class=\"at-icon-wrapper icon-twitter\"></i></a></li>\n" +
" <li><a role=\"link\" class=\"addthis_button_linkedin at300b\" target=\"_blank\" title=\"LinkedIn\" href=\"#\"><i aria-hidden=\"true\" class=\"at-icon-wrapper icon-LinkedIn2\"></i></a></li>\n" +
" <li><a role=\"link\" class=\"addthis_button_mailto at300b\" href=\"https://v1.addthis.com/live/redirect/?url=mailto%3A%3Fbody%3Dhttps%253A%252F%252Fwww.pnas.org%252Fdoi%252F10.1073%252Fpnas.2113862119%26subject%3DExtreme%2520uncertainty%2520and%2520unquantifiable%2520bias%2520do%2520not%2520inform%2520population%2520sizes&uid=62321b79242bdf95&pub=xa-4faab26f2cff13a7&rev=v8.28.8-wp&per=undefined&pco=tbx-300\" title=\"Email App\"><i aria-hidden=\"true\" class=\"at-icon-wrapper icon-mail\"></i></a></li>\n" +
" <div class=\"atclear\"></div>\n" +
" </ul>\n" +
" </div>\n" +
" </div>\n" +
" <div class=\"meta-panel__crossmark\"><span class=\"crossmark\"><a data-target=\"crossmark\" href=\"#\" data-doi=\"10.1073/pnas.2113862119\" class=\"crossmark__link\"><img alt=\"Check for updates on crossmark\" src=\"/specs/products/pnas/releasedAssets/images/crossmark.png\" class=\"crossmark__logo\"></a></span></div>\n" +
" </div>\n" +
" </div>\n" +
" <h1 property=\"name\">Extreme uncertainty and unquantifiable bias do not inform population sizes</h1>\n" +
" <div class=\"contributors\"><span class=\"authors\"><span role=\"list\"><span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con1\"><span property=\"givenName\">Orin J.</span> <span property=\"familyName\">Robinson</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-8935-1242\" property=\"identifier\">https://orcid.org/0000-0001-8935-1242</a> <a href=\"/cdn-cgi/l/email-protection#7817120a4f381b170a161d1414561d1c0d471b1b4517120a4f381b170a161d1414561d1c0d\" property=\"email\"><span class=\"__cf_email__\" data-cfemail=\"89e6e3fbbec9eae6fbe7ece5e5a7ecedfc\">[email protected]</span></a></span>, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con2\"><span property=\"givenName\">Jacob B.</span> <span property=\"familyName\">Socolar</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-9126-9093\" property=\"identifier\">https://orcid.org/0000-0002-9126-9093</a></span>, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con3\"><span property=\"givenName\">Erica F.</span> <span property=\"familyName\">Stuber</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-2687-6874\" property=\"identifier\">https://orcid.org/0000-0002-2687-6874</a></span><span data-control-for=\"ui-revealable\" aria-hidden=\"true\">, <span data-action-for=\"ui-revealable\" data-action=\"show\">+30</span> </span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con4\"><span property=\"givenName\">Tom</span> <span property=\"familyName\">Auer</span></a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con5\"><span property=\"givenName\">Alex J.</span> <span property=\"familyName\">Berryman</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0003-1273-7184\" property=\"identifier\">https://orcid.org/0000-0003-1273-7184</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con6\"><span property=\"givenName\">Philipp H.</span> <span property=\"familyName\">Boersch-Supan</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-6723-6833\" property=\"identifier\">https://orcid.org/0000-0001-6723-6833</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con7\"><span property=\"givenName\">Donald J.</span> <span property=\"familyName\">Brightsmith</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-3306-6490\" property=\"identifier\">https://orcid.org/0000-0002-3306-6490</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con8\"><span property=\"givenName\">Allan H.</span> <span property=\"familyName\">Burbidge</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-2136-3973\" property=\"identifier\">https://orcid.org/0000-0002-2136-3973</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con9\"><span property=\"givenName\">Stuart H. M.</span> <span property=\"familyName\">Butchart</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-1140-4049\" property=\"identifier\">https://orcid.org/0000-0002-1140-4049</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con10\"><span property=\"givenName\">Courtney L.</span> <span property=\"familyName\">Davis</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-6467-4288\" property=\"identifier\">https://orcid.org/0000-0002-6467-4288</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con11\"><span property=\"givenName\">Adriaan M.</span> <span property=\"familyName\">Dokter</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-6573-066X\" property=\"identifier\">https://orcid.org/0000-0001-6573-066X</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con12\"><span property=\"givenName\">Adrian S.</span> <span property=\"familyName\">Di Giacomo</span></a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con13\"><span property=\"givenName\">Andrew</span> <span property=\"familyName\">Farnsworth</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-9854-4449\" property=\"identifier\">https://orcid.org/0000-0002-9854-4449</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con14\"><span property=\"givenName\">Daniel</span> <span property=\"familyName\">Fink</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-8368-1248\" property=\"identifier\">https://orcid.org/0000-0002-8368-1248</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con15\"><span property=\"givenName\">Wesley M.</span> <span property=\"familyName\">Hochachka</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-0595-7827\" property=\"identifier\">https://orcid.org/0000-0002-0595-7827</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con16\"><span property=\"givenName\">Paige E.</span> <span property=\"familyName\">Howell</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-5911-2870\" property=\"identifier\">https://orcid.org/0000-0002-5911-2870</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con17\"><span property=\"givenName\">Frank A.</span> <span property=\"familyName\">La Sorte</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-8521-2501\" property=\"identifier\">https://orcid.org/0000-0001-8521-2501</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con18\"><span property=\"givenName\">Alexander C.</span> <span property=\"familyName\">Lees</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-7603-9081\" property=\"identifier\">https://orcid.org/0000-0001-7603-9081</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con19\"><span property=\"givenName\">Stuart</span> <span property=\"familyName\">Marsden</span></a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con20\"><span property=\"givenName\">Robert</span> <span property=\"familyName\">Martin</span></a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con21\"><span property=\"givenName\">Rowan O.</span> <span property=\"familyName\">Martin</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-0326-0161\" property=\"identifier\">https://orcid.org/0000-0002-0326-0161</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con22\"><span property=\"givenName\">Juan F.</span> <span property=\"familyName\">Masello</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-6826-4016\" property=\"identifier\">https://orcid.org/0000-0002-6826-4016</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con23\"><span property=\"givenName\">Eliot T.</span> <span property=\"familyName\">Miller</span></a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con24\"><span property=\"givenName\">Yoshan</span> <span property=\"familyName\">Moodley</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0003-4216-2924\" property=\"identifier\">https://orcid.org/0000-0003-4216-2924</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con25\"><span property=\"givenName\">Andy</span> <span property=\"familyName\">Musgrove</span></a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con26\"><span property=\"givenName\">David G.</span> <span property=\"familyName\">Noble</span></a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con27\"><span property=\"givenName\">Valeria</span> <span property=\"familyName\">Ojeda</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0003-4158-704X\" property=\"identifier\">https://orcid.org/0000-0003-4158-704X</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con28\"><span property=\"givenName\">Petra</span> <span property=\"familyName\">Quillfeldt</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-4450-8688\" property=\"identifier\">https://orcid.org/0000-0002-4450-8688</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con29\"><span property=\"givenName\">J. Andrew</span> <span property=\"familyName\">Royle</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0003-3135-2167\" property=\"identifier\">https://orcid.org/0000-0003-3135-2167</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con30\"><span property=\"givenName\">Viviana</span> <span property=\"familyName\">Ruiz-Gutierrez</span></a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con31\"><span property=\"givenName\">José L.</span> <span property=\"familyName\">Tella</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-3038-7424\" property=\"identifier\">https://orcid.org/0000-0002-3038-7424</a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con32\"><span property=\"givenName\">Pablo</span> <span property=\"familyName\">Yorio</span></a></span></span><span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con33\"><span property=\"givenName\">Casey</span> <span property=\"familyName\">Youngflesh</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-6343-3311\" property=\"identifier\">https://orcid.org/0000-0001-6343-3311</a></span></span>, and <span property=\"author\" typeof=\"Person\" role=\"listitem\"><a href=\"#con34\"><span property=\"givenName\">Alison</span> <span property=\"familyName\">Johnston</span></a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-8221-013X\" property=\"identifier\">https://orcid.org/0000-0001-8221-013X</a></span><span class=\"ui-hidden\" data-control-for=\"ui-revealable\" aria-hidden=\"true\"> <span data-action-for=\"ui-revealable\" data-action=\"hide\">-30</span></span></span></span></div>\n" +
" <div class=\"self-citation\"><span property=\"datePublished\">March 1, 2022</span> | <span class=\"core-enumeration\"><span property=\"isPartOf\" typeof=\"PublicationVolume\"><span property=\"volumeNumber\">119</span></span> (<span property=\"isPartOf\" typeof=\"PublicationIssue\"><span property=\"issueNumber\">10</span></span>) <span property=\"identifier\" typeof=\"Text\">e2113862119</span></span> | <a href=\"https://doi.org/10.1073/pnas.2113862119\" property=\"sameAs\">https://doi.org/10.1073/pnas.2113862119</a></div>\n" +
" <div data-core-tabs=\"relations\" class=\"core-relations my-3\"></div>\n" +
" <div class=\"info-panel\">\n" +
" <div class=\"info-panel__metrics info-panel__item\">\n" +
" <div class=\"toolbar-metric-container data-source\" data-source=\"/pb/widgets/toolBarMetric/getResponse?widgetId=e3cebcd6-6709-4826-9957-d822f658d986&pbContext=%3Bjournal%3Ajournal%3Apnas%3Bpage%3Astring%3AArticle%2FChapter+View%3BrequestedJournal%3Ajournal%3Apnas%3Bctype%3Astring%3AJournal+Content%3BsubPage%3Astring%3AAbstract%3Bwebsite%3Awebsite%3Apnas-site%3Bwgroup%3Astring%3APublication+Websites%3Bissue%3Aissue%3Adoi%5C%3A10.1073%2Fpnas.2022.119.issue-10%3BpageGroup%3Astring%3APublication+Pages%3Barticle%3Aarticle%3Adoi%5C%3A10.1073%2Fpnas.2113862119&doi=10.1073%2Fpnas.2113862119\"></div>\n" +
" </div>\n" +
" <div class=\"info-panel__right-items-wrapper\">\n" +
" <div class=\"info-panel__favorite info-panel__item\">\n" +
" <div data-permission=\"\" class=\"article-tools\"><a href=\"/action/addCitationAlert?doi=10.1073%2Fpnas.2113862119\" target=\"_blank\" title=\"Track Citations\" aria-label=\"Track Citations\" data-toggle=\"tooltip\" class=\"article-tools__citation btn\"><i class=\"icon-bell\"></i></a><a href=\"/personalize/addFavoritePublication?doi=10.1073%2Fpnas.2113862119\" target=\"_blank\" title=\"Add to favorites\" aria-label=\"Add to favorites\" data-toggle=\"tooltip\" class=\"article-tools__favorite btn\"><i class=\"icon-bookmark\"></i></a></div>\n" +
" </div>\n" +
" <div class=\"info-panel__citations info-panel__item\"><a href=\"#tab-citations\" title=\"cite\" aria-label=\"citation\" data-toggle=\"tooltip\" class=\"btn\"><i class=\"icon-citations\"></i></a></div>\n" +
" <div class=\"info-panel__formats info-panel__item\"><a href=\"https://www.pnas.org/doi/epdf/10.1073/pnas.2113862119\" aria-label=\"PDF\" class=\"btn-circle btn-square btn-pdf ml-2\"><i class=\"icon-pdf-file-1\"></i></a></div>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" </header>\n" +
" <nav data-core-nav=\"article\">\n" +
" <header>\n" +
" <div class=\"core-self-citation\"><span class=\"core-enumeration\"><span property=\"isPartOf\" typeof=\"PublicationVolume\">Vol. <span property=\"volumeNumber\">119</span></span> | <span property=\"isPartOf\" typeof=\"PublicationIssue\">No. <span property=\"issueNumber\">10</span></span></span></div>\n" +
" </header>\n" +
" <ul>\n" +
" <li><a href=\"#bibliography\">References</a></li>\n" +
" </ul>\n" +
" </nav>\n" +
" <div id=\"abstracts\">\n" +
" <div class=\"core-container\">\n" +
" <div class=\"core-first-page-image\"><img src=\"/cms/10.1073/pnas.2113862119/asset/8767a70f-fefc-4c96-a1b9-4f3a2ad0b9e3/assets/pnas.2113862119.fp.png\"></div>\n" +
" </div>\n" +
" </div>\n" +
"</section>";
private static final String filteredAbstractKeep =
" <section data-extent=\"frontmatter\"> <header> <div class=\"core-container\"> <h1 property=\"name\">Extreme uncertainty and unquantifiable bias do not inform population sizes </h1> <div class=\"contributors\"> <span class=\"authors\"> <span role=\"list\"> <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con1\"> <span property=\"givenName\">Orin J. </span> <span property=\"familyName\">Robinson </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-8935-1242\" property=\"identifier\">https://orcid.org/0000-0001-8935-1242 </a> </span>, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con2\"> <span property=\"givenName\">Jacob B. </span> <span property=\"familyName\">Socolar </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-9126-9093\" property=\"identifier\">https://orcid.org/0000-0002-9126-9093 </a> </span>, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con3\"> <span property=\"givenName\">Erica F. </span> <span property=\"familyName\">Stuber </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-2687-6874\" property=\"identifier\">https://orcid.org/0000-0002-2687-6874 </a> </span> <span data-control-for=\"ui-revealable\" aria-hidden=\"true\">, <span data-action-for=\"ui-revealable\" data-action=\"show\">+30 </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con4\"> <span property=\"givenName\">Tom </span> <span property=\"familyName\">Auer </span> </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con5\"> <span property=\"givenName\">Alex J. </span> <span property=\"familyName\">Berryman </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0003-1273-7184\" property=\"identifier\">https://orcid.org/0000-0003-1273-7184 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con6\"> <span property=\"givenName\">Philipp H. </span> <span property=\"familyName\">Boersch-Supan </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-6723-6833\" property=\"identifier\">https://orcid.org/0000-0001-6723-6833 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con7\"> <span property=\"givenName\">Donald J. </span> <span property=\"familyName\">Brightsmith </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-3306-6490\" property=\"identifier\">https://orcid.org/0000-0002-3306-6490 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con8\"> <span property=\"givenName\">Allan H. </span> <span property=\"familyName\">Burbidge </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-2136-3973\" property=\"identifier\">https://orcid.org/0000-0002-2136-3973 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con9\"> <span property=\"givenName\">Stuart H. M. </span> <span property=\"familyName\">Butchart </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-1140-4049\" property=\"identifier\">https://orcid.org/0000-0002-1140-4049 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con10\"> <span property=\"givenName\">Courtney L. </span> <span property=\"familyName\">Davis </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-6467-4288\" property=\"identifier\">https://orcid.org/0000-0002-6467-4288 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con11\"> <span property=\"givenName\">Adriaan M. </span> <span property=\"familyName\">Dokter </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-6573-066X\" property=\"identifier\">https://orcid.org/0000-0001-6573-066X </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con12\"> <span property=\"givenName\">Adrian S. </span> <span property=\"familyName\">Di Giacomo </span> </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con13\"> <span property=\"givenName\">Andrew </span> <span property=\"familyName\">Farnsworth </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-9854-4449\" property=\"identifier\">https://orcid.org/0000-0002-9854-4449 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con14\"> <span property=\"givenName\">Daniel </span> <span property=\"familyName\">Fink </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-8368-1248\" property=\"identifier\">https://orcid.org/0000-0002-8368-1248 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con15\"> <span property=\"givenName\">Wesley M. </span> <span property=\"familyName\">Hochachka </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-0595-7827\" property=\"identifier\">https://orcid.org/0000-0002-0595-7827 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con16\"> <span property=\"givenName\">Paige E. </span> <span property=\"familyName\">Howell </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-5911-2870\" property=\"identifier\">https://orcid.org/0000-0002-5911-2870 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con17\"> <span property=\"givenName\">Frank A. </span> <span property=\"familyName\">La Sorte </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-8521-2501\" property=\"identifier\">https://orcid.org/0000-0001-8521-2501 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con18\"> <span property=\"givenName\">Alexander C. </span> <span property=\"familyName\">Lees </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-7603-9081\" property=\"identifier\">https://orcid.org/0000-0001-7603-9081 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con19\"> <span property=\"givenName\">Stuart </span> <span property=\"familyName\">Marsden </span> </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con20\"> <span property=\"givenName\">Robert </span> <span property=\"familyName\">Martin </span> </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con21\"> <span property=\"givenName\">Rowan O. </span> <span property=\"familyName\">Martin </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-0326-0161\" property=\"identifier\">https://orcid.org/0000-0002-0326-0161 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con22\"> <span property=\"givenName\">Juan F. </span> <span property=\"familyName\">Masello </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-6826-4016\" property=\"identifier\">https://orcid.org/0000-0002-6826-4016 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con23\"> <span property=\"givenName\">Eliot T. </span> <span property=\"familyName\">Miller </span> </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con24\"> <span property=\"givenName\">Yoshan </span> <span property=\"familyName\">Moodley </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0003-4216-2924\" property=\"identifier\">https://orcid.org/0000-0003-4216-2924 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con25\"> <span property=\"givenName\">Andy </span> <span property=\"familyName\">Musgrove </span> </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con26\"> <span property=\"givenName\">David G. </span> <span property=\"familyName\">Noble </span> </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con27\"> <span property=\"givenName\">Valeria </span> <span property=\"familyName\">Ojeda </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0003-4158-704X\" property=\"identifier\">https://orcid.org/0000-0003-4158-704X </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con28\"> <span property=\"givenName\">Petra </span> <span property=\"familyName\">Quillfeldt </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-4450-8688\" property=\"identifier\">https://orcid.org/0000-0002-4450-8688 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con29\"> <span property=\"givenName\">J. Andrew </span> <span property=\"familyName\">Royle </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0003-3135-2167\" property=\"identifier\">https://orcid.org/0000-0003-3135-2167 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con30\"> <span property=\"givenName\">Viviana </span> <span property=\"familyName\">Ruiz-Gutierrez </span> </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con31\"> <span property=\"givenName\">José L. </span> <span property=\"familyName\">Tella </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0002-3038-7424\" property=\"identifier\">https://orcid.org/0000-0002-3038-7424 </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con32\"> <span property=\"givenName\">Pablo </span> <span property=\"familyName\">Yorio </span> </a> </span> </span> <span class=\"ui-revealable ui-hidden\">, <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con33\"> <span property=\"givenName\">Casey </span> <span property=\"familyName\">Youngflesh </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-6343-3311\" property=\"identifier\">https://orcid.org/0000-0001-6343-3311 </a> </span> </span>, and <span property=\"author\" typeof=\"Person\" role=\"listitem\"> <a href=\"#con34\"> <span property=\"givenName\">Alison </span> <span property=\"familyName\">Johnston </span> </a> <a class=\"orcid-id\" href=\"https://orcid.org/0000-0001-8221-013X\" property=\"identifier\">https://orcid.org/0000-0001-8221-013X </a> </span> <span class=\"ui-hidden\" data-control-for=\"ui-revealable\" aria-hidden=\"true\"> <span data-action-for=\"ui-revealable\" data-action=\"hide\">-30 </span> </span> </span> </span> </div> <div class=\"self-citation\"> <span property=\"datePublished\">March 1, 2022 </span> | <span class=\"core-enumeration\"> <span property=\"isPartOf\" typeof=\"PublicationVolume\"> <span property=\"volumeNumber\">119 </span> </span> ( <span property=\"isPartOf\" typeof=\"PublicationIssue\"> <span property=\"issueNumber\">10 </span> </span>) <span property=\"identifier\" typeof=\"Text\">e2113862119 </span> </span> | <a href=\"https://doi.org/10.1073/pnas.2113862119\" property=\"sameAs\">https://doi.org/10.1073/pnas.2113862119 </a> </div> <div data-core-tabs=\"relations\" class=\"core-relations my-3\"> </div> </div> </header> <div > <div class=\"core-container\"> <div class=\"core-first-page-image\"> </div> </div> </div> </section>";
public void testCmsAssetRemoval() throws Exception {
InputStream inA;
inA = fact.createFilteredInputStream(mau, new StringInputStream(variousCmsAssetImgs), Constants.DEFAULT_ENCODING);
assertEquals(filteredVariousCmsAssetImgs, StringUtil.fromInputStream(inA));
}
public void testPubMedRemoval() throws Exception {
InputStream inA;
inA = fact.createFilteredInputStream(mau, new StringInputStream(pubMed), Constants.DEFAULT_ENCODING);
assertEquals(blankString, StringUtil.fromInputStream(inA));
}
public void testTimeBadgeRemoval() throws Exception {
InputStream inA;
inA = fact.createFilteredInputStream(mau, new StringInputStream(timeBadgeStamps), Constants.DEFAULT_ENCODING);
assertEquals(filteredTimeBadgeStamps, StringUtil.fromInputStream(inA));
}
public void testIframeRemoval() throws Exception {
InputStream inA;
inA = fact.createFilteredInputStream(mau, new StringInputStream(iframe), Constants.DEFAULT_ENCODING);
assertEquals(blankString, StringUtil.fromInputStream(inA));
}
public void testIdRemoval() throws Exception {
InputStream inA, inB;
inA = fact.createFilteredInputStream(mau, new StringInputStream(h3withId1), Constants.DEFAULT_ENCODING);
inB = fact.createFilteredInputStream(mau, new StringInputStream(h3withId2), Constants.DEFAULT_ENCODING);
assertEquals(StringUtil.fromInputStream(inB), StringUtil.fromInputStream(inA));
}
public void testAbstractKeep() throws Exception {
InputStream inA;
inA = fact.createFilteredInputStream(mau, new StringInputStream(abstractSection), Constants.DEFAULT_ENCODING);
assertEquals(filteredAbstractKeep, StringUtil.fromInputStream(inA));
}
}
| [
"mol3earth@gmail.com"
] | mol3earth@gmail.com |
e619684ce5a13afdc880416b3ecd886541de7150 | 61ec421780758dc527990b28c5684b2a915f0eeb | /Labs/src/labs/Lab2.java | 55e6c45eb6aa27a28b35bc7f9fba8a29b1c42265 | [] | no_license | rwchapin/Labs | 0e861ebeee21c2904b076cc04fd0f06c703c2136 | ea4bfbb99f96457bac224fbdf0bf71828ac13adb | refs/heads/master | 2022-12-22T05:35:10.089798 | 2020-09-30T17:05:09 | 2020-09-30T17:05:09 | 298,088,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,510 | java | package labs;
import java.util.Scanner;
public class Lab2 {
public static void main(String[] args) {
//scanner input for radius
Scanner input = new Scanner(System.in);
System.out.print("Enter the radius: ");
double radius = input.nextDouble();
//result of areaCircle method
double resultArea = areaCircle(radius);
System.out.println("The area of a circle is: " + resultArea);
//result of circumCircle method
double resultCircum = circumCircle(radius);
System.out.println("The circumference of the circle is: " + resultCircum + "\n");
//prompting user for base width input
System.out.print("Enter the base width of your triangle: ");
double baseWidth = input.nextDouble();
//prompting user for height input
System.out.print("Enter the height of your triangle: ");
double height = input.nextDouble();
//result of AreaTriangle method
double resultTriangle = areaOfTriangle(baseWidth, height);
System.out.println("The area of your triangle is: " + resultTriangle + "\n");
//prompting user for even or odd number input
System.out.print("Enter your number to check Even or Odd status: ");
int evenOddNum = input.nextInt();
//result of computing even or odd status
String resultEvenOdd = evenOdd(evenOddNum);
System.out.println("Your number is: " + resultEvenOdd + "\n");
//prompt user to enter integer to be cast into double
System.out.print("Enter your number to be converted into decimel: ");
int numCast = input.nextInt();
//result of casting number
double resultCast = cast(numCast);
System.out.println("You entered " + numCast + ", the new value is " + resultCast + "\n");
//prompt user to enter character to be converted to numeric value
System.out.print("Please enter a character to be converted to numeric form: ");
char user = input.next().charAt(0);
//result of character conversion
int resultChar = charValue(user);
System.out.println("Your characters numeric value is: " + resultChar + "\n");
//prompt user to enter number to be rounded
System.out.print("Enter decimal number to be rounded up or down: ");
double d = input.nextDouble();
//result of decimal rounding
int resultRounding = numRound(d);
System.out.println("Your rounded number is: " + resultRounding + "\n");
//prompt user to enter year
System.out.print("Please enter a year: ");
int year = input.nextInt();
//true of false result of leap year calculation
boolean resultLeapYear = leapYear(year);
System.out.println("Is your entered year a leap year: " + resultLeapYear);
}
/*Write a method to prompt the user to enter the radius of the circle
then calculate the area and circumference of the circle.*/
//method to find area of circle
public static double areaCircle(double radius) {
//formula for area
double areaOfCircle = 3.14 * radius * radius;
return areaOfCircle;
}
//method to find circumference of circle
public static double circumCircle(double radius) {
//formula for circumference
double circum = 3.14 * 2 * radius;
return circum;
}
/*Write a method to prompt the user for base-width and height of a triangle,
then calculate the area of the Triangle.*/
public static double areaOfTriangle(double baseWidth, double height) {
double areaTriangle = .5 * baseWidth * height;
return areaTriangle;
}
//Write a method to prompt the user for a number then display check if the number is Even or Odd.
public static String evenOdd(int evenOddNum) {
String even = "Even";
String odd = "Odd";
//calculate even or oddness
if(evenOddNum % 2 == 0) {
return even;
}
else {
return odd;
}
}
//Write a method to prompt the user for an Integer then display the same value with one decimal place.
//eg. user enter "15 " result is: "You entered 15, the new value is 15.0".
public static double cast(int numCast) {
double cast = numCast;
return cast;
}
//Write a method to prompt the user for a letter of the alphabet and display it's numerical value.
public static int charValue(char user) {
int charV = user;
return charV;
}
/* Write a method to prompt the user for a double then display the value as a whole number.
eg user enter "15 .8" result is: "You entered 15.8, the new value is 16".
eg user enter "15 .4" result is: "You entered 15.4, the new value is 15".
*/
public static int numRound(double d) {
//casting double to integer
int i = (int) d;
//subtracting whole number from double to get decimal
double sum = d - i;
//logic statement to round up or down
if (sum <= 0.5) {
return i;
}
else if (sum >= 0.5) {
i++;
}
return i;
}
/*Write a method to prompt the user for 4 digits representing a year. Then determine If Year Is a Leap Year.
How to determine whether a year is a leap year
To determine whether a year is a leap year, follow these steps:
1. If the year is evenly divisible by 4, go to step 2. Otherwise, go to step 5.
2. If the year is evenly divisible by 100, go to step 3. Otherwise, go to step 4.
3. If the year is evenly divisible by 400, go to step 4. Otherwise, go to step 5.
4. The year is a leap year (it has 366 days).
5. The year is not a leap year (it has 365 days).
*/
public static boolean leapYear(int year) {
if(year % 4 == 0) {
return true;
}
if (year % 100 == 0) {
return true;
}
if (year % 400 == 0) {
return true;
}
return false;
}
}
| [
"ryanwchapin@yahoo.com"
] | ryanwchapin@yahoo.com |
383cb48b7da08ece7b23c2650d70a0af9cc2ca03 | 445c3cf84dd4bbcbbccf787b2d3c9eb8ed805602 | /aliyun-java-sdk-dms-enterprise/src/main/java/com/aliyuncs/dms_enterprise/model/v20181101/GetSQLReviewCheckResultStatusRequest.java | a06b962bac456b5ea2a68d5f4b5db102cf842b1f | [
"Apache-2.0"
] | permissive | caojiele/aliyun-openapi-java-sdk | b6367cc95469ac32249c3d9c119474bf76fe6db2 | ecc1c949681276b3eed2500ec230637b039771b8 | refs/heads/master | 2023-06-02T02:30:02.232397 | 2021-06-18T04:08:36 | 2021-06-18T04:08:36 | 172,076,930 | 0 | 0 | NOASSERTION | 2019-02-22T14:08:29 | 2019-02-22T14:08:29 | null | UTF-8 | Java | false | false | 1,914 | java | /*
* 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.aliyuncs.dms_enterprise.model.v20181101;
import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.dms_enterprise.Endpoint;
/**
* @author auto create
* @version
*/
public class GetSQLReviewCheckResultStatusRequest extends RpcAcsRequest<GetSQLReviewCheckResultStatusResponse> {
private Long orderId;
private Long tid;
public GetSQLReviewCheckResultStatusRequest() {
super("dms-enterprise", "2018-11-01", "GetSQLReviewCheckResultStatus", "dms-enterprise");
setMethod(MethodType.POST);
try {
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap);
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType);
} catch (Exception e) {}
}
public Long getOrderId() {
return this.orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
if(orderId != null){
putQueryParameter("OrderId", orderId.toString());
}
}
public Long getTid() {
return this.tid;
}
public void setTid(Long tid) {
this.tid = tid;
if(tid != null){
putQueryParameter("Tid", tid.toString());
}
}
@Override
public Class<GetSQLReviewCheckResultStatusResponse> getResponseClass() {
return GetSQLReviewCheckResultStatusResponse.class;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
18b82d5b50cffa6a16e5574c8959f99fa17d80af | e0317f871b0a5452bba4f8f65627c71ae8619205 | /src/com/job5156/util/option/OptionPositionMap.java | c4091dc86b7b59bb996215603ac2ef9bc9f39923 | [] | no_license | miketom156/down_resume | 8c00c4b1a9402924b0e3b4643b0b999dcd7f12ea | d3c3fb2b4272e45dfc22bcc21b9e0d265625b981 | refs/heads/master | 2016-09-06T13:02:01.918067 | 2015-08-21T04:39:31 | 2015-08-21T04:39:31 | 41,138,063 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 80,111 | java | package com.job5156.util.option;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.lang.StringUtils;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class OptionPositionMap {
public final static Map<Integer, Map<String, String>> OPT_MAP_POSITION = new LinkedHashMap<>();
public static Map<Integer,List<Map<String,String>>> OPT_MAP_BIG_SMALL_CITY =null;//保大类以及其下小类的对应关系
public static List<Map<String,String>> OPT_LIST_BIG =null;//保存所有大类
static {
OPT_MAP_POSITION.put(1000,OptionMap.setMap("计算机开发/应用类","InformationTechnology","computer"));
OPT_MAP_POSITION.put(1001,OptionMap.setMap("网络工程师","Network Engineering","network"));
OPT_MAP_POSITION.put(1002,OptionMap.setMap("网络信息安全工程师","Information Security Engineer","security"));
OPT_MAP_POSITION.put(1003,OptionMap.setMap("数据库开发与管理(DBA)","Database Administrator","dba"));
OPT_MAP_POSITION.put(1004,OptionMap.setMap("数据库系统工程师","Database System Engineer","dsner"));
OPT_MAP_POSITION.put(1005,OptionMap.setMap("系统分析师/系统分析员","System Analyst","analyst"));
OPT_MAP_POSITION.put(1006,OptionMap.setMap("系统维护员","System maintenace","maintenace"));
OPT_MAP_POSITION.put(1007,OptionMap.setMap("系统测试师","System Testing QA","tqa"));
OPT_MAP_POSITION.put(1008,OptionMap.setMap("系统/网络管理员","System/Network Administrator","administrator"));
OPT_MAP_POSITION.put(1009,OptionMap.setMap("MRP/ERP/SAP实施工程师","Mrp/Erp/Actualize Engineering","mrp"));
OPT_MAP_POSITION.put(1010,OptionMap.setMap("互联网软件开发工程师","Internet/E-Commerce Software Engineer","esoftner"));
OPT_MAP_POSITION.put(1011,OptionMap.setMap("多媒体/游戏开发工程师","Multimedia/Game Development Engineer","gamener"));
OPT_MAP_POSITION.put(1012,OptionMap.setMap("INTERNET/WEB/电子商务师","Internet/Web/E-Commerce","internet"));
OPT_MAP_POSITION.put(1013,OptionMap.setMap("计算机辅助设计工程师","Computer Aided Designer Engineer","aidedner"));
OPT_MAP_POSITION.put(1014,OptionMap.setMap("软件设计师","Software Designer","sdesigner"));
OPT_MAP_POSITION.put(1015,OptionMap.setMap("软件工程师","Software Engineering","softwarener"));
OPT_MAP_POSITION.put(1016,OptionMap.setMap("软件测试师","Software Testing QA","softtqa"));
OPT_MAP_POSITION.put(1017,OptionMap.setMap("硬件测试师","Hardware Testing QA","hardtqa"));
OPT_MAP_POSITION.put(1018,OptionMap.setMap("硬件工程师","Hardware Engineering","hardwarener"));
OPT_MAP_POSITION.put(1019,OptionMap.setMap("网页设计师","Webpage Designer","webdner"));
OPT_MAP_POSITION.put(1020,OptionMap.setMap("网页策划师","Web Designer","webplan"));
OPT_MAP_POSITION.put(1021,OptionMap.setMap("网站编辑员","Website Editor","webeditor"));
OPT_MAP_POSITION.put(1022,OptionMap.setMap("电脑美工","Computer Art Designer","artder"));
OPT_MAP_POSITION.put(1023,OptionMap.setMap("栏目主持人","Column Emcee","emcee"));
OPT_MAP_POSITION.put(1024,OptionMap.setMap("网站客服/SEO/淘宝美工","Website Customer Service / SEO / Taobao art","customer"));
OPT_MAP_POSITION.put(1099,OptionMap.setMap("其它","Other","other"));
OPT_MAP_POSITION.put(1100,OptionMap.setMap("计算机管理/技术支持类","InformationTechnology","support"));
OPT_MAP_POSITION.put(1101,OptionMap.setMap("信息系统监理/信息系统项目管理","Management information systems Division/Information systems project management Division","information"));
OPT_MAP_POSITION.put(1102,OptionMap.setMap("信息技术经理/主管","IT Manager/Supervisor","supervisor"));
OPT_MAP_POSITION.put(1103,OptionMap.setMap("信息技术专员","IT Specialist","specialist"));
OPT_MAP_POSITION.put(1104,OptionMap.setMap("信息分析师","IT Analyst","analyst"));
OPT_MAP_POSITION.put(1105,OptionMap.setMap("系统集成/技术支持","System integration, Technical Support","integration"));
OPT_MAP_POSITION.put(1106,OptionMap.setMap("标准化工程师","Standardization Engineer","seeng"));
OPT_MAP_POSITION.put(1107,OptionMap.setMap("技术助理","Technical Assistant","technical"));
OPT_MAP_POSITION.put(1108,OptionMap.setMap("项目总监","Project Director","pjdirector"));
OPT_MAP_POSITION.put(1109,OptionMap.setMap("项目经理/项目主管","Project Manager","pjmanager"));
OPT_MAP_POSITION.put(1110,OptionMap.setMap("项目执行/协调人员","Project Specialist/Coordinator","pjcoordinator"));
OPT_MAP_POSITION.put(1111,OptionMap.setMap("技术总监CTO","Tech. Majordomo, Cto","cto"));
OPT_MAP_POSITION.put(1112,OptionMap.setMap("信息主管/CIO","Information Majordomo/Cio","cio"));
OPT_MAP_POSITION.put(1113,OptionMap.setMap("网络营运经理/主管","Web Operataions Manager/Supervisor","operataions"));
OPT_MAP_POSITION.put(1199,OptionMap.setMap("其它","Other","other"));
OPT_MAP_POSITION.put(1200,OptionMap.setMap("通讯类","Telecommunication","tele"));
OPT_MAP_POSITION.put(1201,OptionMap.setMap("数据通信工程师","Data communication Engineer","dataner"));
OPT_MAP_POSITION.put(1202,OptionMap.setMap("移动通信工程师","Mobile communication Engineer","mobiler"));
OPT_MAP_POSITION.put(1203,OptionMap.setMap("通信技术工程师","Communication Engineer","communer"));
OPT_MAP_POSITION.put(1204,OptionMap.setMap("有线传输工程师","Wired Transmission Engineer","wtener"));
OPT_MAP_POSITION.put(1205,OptionMap.setMap("无线通信工程师","Wireless Communication Engineer","wcener"));
OPT_MAP_POSITION.put(1206,OptionMap.setMap("电信交换工程师","Telecommunication Exchange Engineer","teener"));
OPT_MAP_POSITION.put(1207,OptionMap.setMap("电信网络工程师","Telecommunication Network Engineer","tnener"));
OPT_MAP_POSITION.put(1208,OptionMap.setMap("通信电源工程师","Communication Power Supply Engineer","cpsner"));
OPT_MAP_POSITION.put(1209,OptionMap.setMap("射频工程师","Radio Frequency Engineer","rfener"));
OPT_MAP_POSITION.put(1210,OptionMap.setMap("手机硬件项目经理","Mobile Hardware Manager","mobilehma"));
OPT_MAP_POSITION.put(1211,OptionMap.setMap("手机软件项目经理","Mobile Software Manager","mobilesma"));
OPT_MAP_POSITION.put(1212,OptionMap.setMap("手机应用开发工程师","Mobile Application Developer Engineer","mobileadner"));
OPT_MAP_POSITION.put(1213,OptionMap.setMap("手机驱动/测试工程师","Mobile Driver Development/Test Engineer","mobileddner"));
OPT_MAP_POSITION.put(1214,OptionMap.setMap("手机维修","Mobile Maintenance Engineer","mobilemner"));
OPT_MAP_POSITION.put(1215,OptionMap.setMap("手机结构工程师","Mobile Structural Engineer","mobilesner"));
OPT_MAP_POSITION.put(1299,OptionMap.setMap("其它","Other","other"));
OPT_MAP_POSITION.put(1300,OptionMap.setMap("电子/电器(气)类","Electronics","electronics"));
OPT_MAP_POSITION.put(1301,OptionMap.setMap("电子工程师/技术员","Electron Engineer","electronner"));
OPT_MAP_POSITION.put(1302,OptionMap.setMap("电气工程师/技术员","Electric Engineer","electricner"));
OPT_MAP_POSITION.put(1303,OptionMap.setMap("电器工程师","Electric apparatus Engineer","eleaner"));
OPT_MAP_POSITION.put(1304,OptionMap.setMap("电力工程师","Electric power Engineer","elepner"));
OPT_MAP_POSITION.put(1305,OptionMap.setMap("电子测试工程师","Electronic Test Engineer","eletner"));
OPT_MAP_POSITION.put(1306,OptionMap.setMap("电路(布线)设计工程师","Circuit Design","circuit"));
OPT_MAP_POSITION.put(1307,OptionMap.setMap("智能大厦/综合布线/弱电","Intelligent mansion/synthetic disposal/Weak electronic","eleweak"));
OPT_MAP_POSITION.put(1308,OptionMap.setMap("自动控制技术员","Autocontrol","autocontrol"));
OPT_MAP_POSITION.put(1309,OptionMap.setMap("无线电技术员","Radio-technology","radio"));
OPT_MAP_POSITION.put(1310,OptionMap.setMap("半导体技术员","Semiconductor Technology","semic"));
OPT_MAP_POSITION.put(1311,OptionMap.setMap("变压器/磁电工程师","Magnetoelectricity Engineer","magnetoner"));
OPT_MAP_POSITION.put(1312,OptionMap.setMap("电声/音响工程师/技术员","Electric sound Engineer","elesoundner"));
OPT_MAP_POSITION.put(1313,OptionMap.setMap("集成电路/芯片开发工程师","Integrated circuit/Chip development Engineer","chipner"));
OPT_MAP_POSITION.put(1314,OptionMap.setMap("电子元器件工程师","Electronic primary device Engineer","elepdner"));
OPT_MAP_POSITION.put(1315,OptionMap.setMap("电子声像设备","Electronic acoustic image equipment","eleaiener"));
OPT_MAP_POSITION.put(1316,OptionMap.setMap("电池/电源开发工程师","Battery/Power source Development Engineer","battery"));
OPT_MAP_POSITION.put(1317,OptionMap.setMap("嵌入式/底层软件开发(Linux/单片机/DSP/...)","Embedded/SCM/DSP/FPGA Development","scm"));
OPT_MAP_POSITION.put(1318,OptionMap.setMap("光源与照明工程","Lamp-house and Lighting Engineering","lamp"));
OPT_MAP_POSITION.put(1319,OptionMap.setMap("灯饰研发工程师","Lamp Development Engineer","lampdner"));
OPT_MAP_POSITION.put(1320,OptionMap.setMap("电气维修员","Electric Maintain","maintain"));
OPT_MAP_POSITION.put(1321,OptionMap.setMap("家用电器开发工程师","Household electric Appliances","appliances"));
OPT_MAP_POSITION.put(1322,OptionMap.setMap("小家电","Small Household electric appliances","small"));
OPT_MAP_POSITION.put(1323,OptionMap.setMap("数码产品开发工程师","Digital Production Development Engineer","digital"));
OPT_MAP_POSITION.put(1324,OptionMap.setMap("产品研发工程师","Production Development Engineer","pd"));
OPT_MAP_POSITION.put(1325,OptionMap.setMap("PCB工程师","PCB Engineer","pcb"));
OPT_MAP_POSITION.put(1326,OptionMap.setMap("ARM开发工程师","ARM Development Engineer","arm"));
OPT_MAP_POSITION.put(1327,OptionMap.setMap("MCU底层开发工程师","MCU Development Engineer","mcu"));
OPT_MAP_POSITION.put(1328,OptionMap.setMap("FAE工程师","FAE Engineer","fae"));
OPT_MAP_POSITION.put(1399,OptionMap.setMap("其它","Other","other"));
OPT_MAP_POSITION.put(1400,OptionMap.setMap("销售管理类","Sales","sales"));
OPT_MAP_POSITION.put(1401,OptionMap.setMap("销售总监","Sales Majordomo","xszj"));
OPT_MAP_POSITION.put(1402,OptionMap.setMap("销售工程师","Sales engineer","xsgcs"));
OPT_MAP_POSITION.put(1403,OptionMap.setMap("销售部经理","Sales Manager","xsjl"));
OPT_MAP_POSITION.put(1404,OptionMap.setMap("销售主管","Sales Director","xszg"));
OPT_MAP_POSITION.put(1405,OptionMap.setMap("销售助理","Sales Assistant","xszl"));
OPT_MAP_POSITION.put(1406,OptionMap.setMap("渠道经理","Channel Manager","qdjl"));
OPT_MAP_POSITION.put(1407,OptionMap.setMap("渠道主管","Channel Director","qdjl"));
OPT_MAP_POSITION.put(1408,OptionMap.setMap("分销经理","Distribution Manager","fxjl"));
OPT_MAP_POSITION.put(1409,OptionMap.setMap("区域销售经理","District Sales Manager","qyjl"));
OPT_MAP_POSITION.put(1410,OptionMap.setMap("商务经理","Commerce Manager","swjl"));
OPT_MAP_POSITION.put(1411,OptionMap.setMap("商务专员","Commerce Clerk","swzr"));
OPT_MAP_POSITION.put(1412,OptionMap.setMap("商务助理","Business Assistant","swzl"));
OPT_MAP_POSITION.put(1499,OptionMap.setMap("其它","Other","other"));
OPT_MAP_POSITION.put(1500,OptionMap.setMap("销售业务类","Sales","sales"));
OPT_MAP_POSITION.put(1501,OptionMap.setMap("销售代表","Sales Representative","xsdb"));
OPT_MAP_POSITION.put(1502,OptionMap.setMap("客户代表","Customer Representative","customer"));
OPT_MAP_POSITION.put(1503,OptionMap.setMap("业务员","Clerk","clerk"));
OPT_MAP_POSITION.put(1504,OptionMap.setMap("推(营)销员","Salesman","salesman"));
OPT_MAP_POSITION.put(1505,OptionMap.setMap("渠道/分销专员","Channel/Retails special Commissioner","retails"));
OPT_MAP_POSITION.put(1506,OptionMap.setMap("经销商","Dealer","dealer"));
OPT_MAP_POSITION.put(1599,OptionMap.setMap("其它","Other","other"));
OPT_MAP_POSITION.put(1600,OptionMap.setMap("客户服务类","Customer Services","customers"));
OPT_MAP_POSITION.put(1601,OptionMap.setMap("客户服务","Customer Service","cuss"));
OPT_MAP_POSITION.put(1602,OptionMap.setMap("售前/售后服务/技术支持","Technical Support","tech"));
OPT_MAP_POSITION.put(1603,OptionMap.setMap("投诉处理","Complains Solve","solve"));
OPT_MAP_POSITION.put(1604,OptionMap.setMap("客户关系管理","Customer Relationship Administrator","relationship"));
OPT_MAP_POSITION.put(1605,OptionMap.setMap("客户咨询热线","Customer Consultant","consultant"));
OPT_MAP_POSITION.put(1606,OptionMap.setMap("客户服务经理","Customer Service Manager","service"));
OPT_MAP_POSITION.put(1607,OptionMap.setMap("呼叫中心人员","Hot-line Consultant","hotline"));
OPT_MAP_POSITION.put(1699,OptionMap.setMap("其它","Other","other"));
OPT_MAP_POSITION.put(1700,OptionMap.setMap("营销/企划/媒介/公关类","Marketing/Public Relations","marketing"));
OPT_MAP_POSITION.put(1701,OptionMap.setMap("新闻媒介企划","News Media Planning","news"));
OPT_MAP_POSITION.put(1702,OptionMap.setMap("促销/礼仪专员","Promotion/Comity Clerk","promotion"));
OPT_MAP_POSITION.put(1703,OptionMap.setMap("公关经理","Public Relations Manager","relationsmana"));
OPT_MAP_POSITION.put(1704,OptionMap.setMap("公关专员","Public Relations Commissioner","relationscomm"));
OPT_MAP_POSITION.put(1705,OptionMap.setMap("市场助理/专员","Marketing Assistant/Clerk","marketassis"));
OPT_MAP_POSITION.put(1706,OptionMap.setMap("市场部主管","Marketing Director","marketdirector"));
OPT_MAP_POSITION.put(1707,OptionMap.setMap("市场调研/业务分析员","Marketing Research/ Business Analysis","research"));
OPT_MAP_POSITION.put(1708,OptionMap.setMap("市场/行销企划","Marketing/Sales Planning","saleplan"));
OPT_MAP_POSITION.put(1709,OptionMap.setMap("市场推广/拓展/合作员","Market Development","marketdev"));
OPT_MAP_POSITION.put(1710,OptionMap.setMap("产品/品牌企划","Product/Brand Planning","brand"));
OPT_MAP_POSITION.put(1711,OptionMap.setMap("品牌经理","Brand Manager","brandmana"));
OPT_MAP_POSITION.put(1712,OptionMap.setMap("价格企划","Price Planning","pricplan"));
OPT_MAP_POSITION.put(1713,OptionMap.setMap("广告企划/广告制作","Advertisement Planning","advplan"));
OPT_MAP_POSITION.put(1714,OptionMap.setMap("市场/营销总监","Market Majordomo","majordomo"));
OPT_MAP_POSITION.put(1715,OptionMap.setMap("市场/营销经理","Marketing Manager","marketMana"));
OPT_MAP_POSITION.put(1716,OptionMap.setMap("营销师","Marketing Division","division"));
OPT_MAP_POSITION.put(1717,OptionMap.setMap("客户经理","Customer Manager","cusmanager"));
OPT_MAP_POSITION.put(1799,OptionMap.setMap("其它","Other","other"));
OPT_MAP_POSITION.put(1800,OptionMap.setMap("经营管理类","Management",""));
OPT_MAP_POSITION.put(1801,OptionMap.setMap("{正/副}总裁/总经理/CEO","President, VP, General Manager, CEO",""));
OPT_MAP_POSITION.put(1802,OptionMap.setMap("专业招商人员","Professional business Staff",""));
OPT_MAP_POSITION.put(1803,OptionMap.setMap("企业发展规划经理/主管/助理","Corporate Planning Manager",""));
OPT_MAP_POSITION.put(1804,OptionMap.setMap("首席运营官COO","Chief operation official COO",""));
OPT_MAP_POSITION.put(1805,OptionMap.setMap("产品经理/主管","Product Manager/Director",""));
OPT_MAP_POSITION.put(1806,OptionMap.setMap("分公司/办事处经理/主管","Branch Manager/Director",""));
OPT_MAP_POSITION.put(1807,OptionMap.setMap("部门经理/主管","Department Manager/Department Director",""));
OPT_MAP_POSITION.put(1808,OptionMap.setMap("总经理助理","President Assistant",""));
OPT_MAP_POSITION.put(1809,OptionMap.setMap("经理助理","Manager Assistant",""));
OPT_MAP_POSITION.put(1810,OptionMap.setMap("厂长/副厂长","Factory Director/Vice Factory Director",""));
OPT_MAP_POSITION.put(1811,OptionMap.setMap("项目经理/主管","Project Manager",""));
OPT_MAP_POSITION.put(1812,OptionMap.setMap("企划总监","Business Planning Director",""));
OPT_MAP_POSITION.put(1899,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(1900,OptionMap.setMap("法律/咨询(顾问)类","Law Specialist",""));
OPT_MAP_POSITION.put(1901,OptionMap.setMap("律师","Lawyer",""));
OPT_MAP_POSITION.put(1902,OptionMap.setMap("法律顾问","Counselor",""));
OPT_MAP_POSITION.put(1903,OptionMap.setMap("法务人员","Law clerk",""));
OPT_MAP_POSITION.put(1904,OptionMap.setMap("律师助理","Lawyer Assistant",""));
OPT_MAP_POSITION.put(1905,OptionMap.setMap("书记员","Secretary",""));
OPT_MAP_POSITION.put(1906,OptionMap.setMap("知识产权顾问/专员","Intellectual Property Consultants/Commissioner",""));
OPT_MAP_POSITION.put(1907,OptionMap.setMap("专利顾问/专员","Patent Consultants/Commissione",""));
OPT_MAP_POSITION.put(1908,OptionMap.setMap("企业管理顾问","Enterprise management Consultant",""));
OPT_MAP_POSITION.put(1909,OptionMap.setMap("涉外咨询师","Internationalize Consultant",""));
OPT_MAP_POSITION.put(1910,OptionMap.setMap("高级猎头顾问","Senior Head-hunter",""));
OPT_MAP_POSITION.put(1911,OptionMap.setMap("咨询总监/经理","Consultant Manager",""));
OPT_MAP_POSITION.put(1912,OptionMap.setMap("咨询员/信息中介/专业顾问","Consultation/Information agency/Speciality Consultant",""));
OPT_MAP_POSITION.put(1913,OptionMap.setMap("企业策划/顾问","Enterprise Planning Consultant",""));
OPT_MAP_POSITION.put(1999,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(2000,OptionMap.setMap("财务/审(统)计类","Financing/Audit/Stat.",""));
OPT_MAP_POSITION.put(2001,OptionMap.setMap("税务专员/助理","Tax Clerk",""));
OPT_MAP_POSITION.put(2002,OptionMap.setMap("出纳员","Treasurer",""));
OPT_MAP_POSITION.put(2003,OptionMap.setMap("统计员","Statistician",""));
OPT_MAP_POSITION.put(2004,OptionMap.setMap("注册会计师","Certified Accountant",""));
OPT_MAP_POSITION.put(2005,OptionMap.setMap("会计/会计助理","Accountant Assistant",""));
OPT_MAP_POSITION.put(2006,OptionMap.setMap("账目(进出口)管理","Account Management",""));
OPT_MAP_POSITION.put(2007,OptionMap.setMap("成本经理/主管","Cost Manager/Supervisor",""));
OPT_MAP_POSITION.put(2008,OptionMap.setMap("成本分析/核算员","Cost Analysis/Adjust",""));
OPT_MAP_POSITION.put(2009,OptionMap.setMap("成本管理员","Cost Accounting Specialist",""));
OPT_MAP_POSITION.put(2010,OptionMap.setMap("注册税务师","Certified Tax Agents",""));
OPT_MAP_POSITION.put(2011,OptionMap.setMap("税务经理/主管","Tax Manager/Supervisor",""));
OPT_MAP_POSITION.put(2012,OptionMap.setMap("审计经理/主管","Audit Manager/Supervisor",""));
OPT_MAP_POSITION.put(2013,OptionMap.setMap("审计专员/助理","Audit Executive/Assistant",""));
OPT_MAP_POSITION.put(2014,OptionMap.setMap("注册审计师","Certified Auditor",""));
OPT_MAP_POSITION.put(2015,OptionMap.setMap("财务主管/经理","Finance Director/Manager",""));
OPT_MAP_POSITION.put(2016,OptionMap.setMap("财务顾问/助理","Finance Consultant",""));
OPT_MAP_POSITION.put(2017,OptionMap.setMap("财务分析师","Finance Analysis",""));
OPT_MAP_POSITION.put(2018,OptionMap.setMap("首席财务官CFO/财务总监","Chief Financial Officer CFO",""));
OPT_MAP_POSITION.put(2019,OptionMap.setMap("财务管理师","Financial Control Teacher",""));
OPT_MAP_POSITION.put(2099,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(2100,OptionMap.setMap("金融/保险/银行类","Finance/Securities/investment",""));
OPT_MAP_POSITION.put(2101,OptionMap.setMap("评估/分析师","Evaluating",""));
OPT_MAP_POSITION.put(2102,OptionMap.setMap("精算师","Actuaries",""));
OPT_MAP_POSITION.put(2103,OptionMap.setMap("稽核员","Investigation",""));
OPT_MAP_POSITION.put(2104,OptionMap.setMap("拍卖师","Auctions",""));
OPT_MAP_POSITION.put(2105,OptionMap.setMap("证券经纪人","Securities Broke",""));
OPT_MAP_POSITION.put(2106,OptionMap.setMap("证券期货从业人员","Securities/Futures",""));
OPT_MAP_POSITION.put(2107,OptionMap.setMap("证券分析师","Securities Analysts",""));
OPT_MAP_POSITION.put(2108,OptionMap.setMap("黄金投资分析师","Gold investment Analyst",""));
OPT_MAP_POSITION.put(2109,OptionMap.setMap("注册金融分析师","Registration finance Analyst",""));
OPT_MAP_POSITION.put(2110,OptionMap.setMap("金融投资分析员","Finance investing Analysis",""));
OPT_MAP_POSITION.put(2111,OptionMap.setMap("金融/经济研究员","Finance investing Analysis",""));
OPT_MAP_POSITION.put(2112,OptionMap.setMap("炒股操盘手","Stock Manipulator",""));
OPT_MAP_POSITION.put(2113,OptionMap.setMap("投资/基金项目经理","Investment Manager",""));
OPT_MAP_POSITION.put(2114,OptionMap.setMap("融资经理/主管","Financing Manager/Directory",""));
OPT_MAP_POSITION.put(2115,OptionMap.setMap("融资专员/助理","Financing Commissioner/Assistant",""));
OPT_MAP_POSITION.put(2116,OptionMap.setMap("注册分析师","Certified Investment/Financial Analyst",""));
OPT_MAP_POSITION.put(2117,OptionMap.setMap("保险业务经理/主管","Business Manager/Supervisor",""));
OPT_MAP_POSITION.put(2118,OptionMap.setMap("保险经纪人/代理人","Insurance Broker/Agent",""));
OPT_MAP_POSITION.put(2119,OptionMap.setMap("保险产品开发/项目策划师","Product Development/Planner",""));
OPT_MAP_POSITION.put(2120,OptionMap.setMap("保险客户服务/续期管理","Customer Service",""));
OPT_MAP_POSITION.put(2121,OptionMap.setMap("理财顾问/财务规划师","Financial Advisor/Financial Planner",""));
OPT_MAP_POSITION.put(2122,OptionMap.setMap("保险理赔专员","Claim Management",""));
OPT_MAP_POSITION.put(2123,OptionMap.setMap("保险培训师","Trainer",""));
OPT_MAP_POSITION.put(2124,OptionMap.setMap("外汇交易专员","Foreign Exchange Commissioner",""));
OPT_MAP_POSITION.put(2125,OptionMap.setMap("出纳员/银行专员","Treasurer/Bank Clerk",""));
OPT_MAP_POSITION.put(2126,OptionMap.setMap("预结算专员","Budgeting/Balance Clerk",""));
OPT_MAP_POSITION.put(2127,OptionMap.setMap("大堂经理","Hall Manager",""));
OPT_MAP_POSITION.put(2128,OptionMap.setMap("银行卡/电子银行业务推广员","Credit Card/E-banking business Develop",""));
OPT_MAP_POSITION.put(2129,OptionMap.setMap("信贷管理/信用调查/分析人员","Loan/Credit Officer",""));
OPT_MAP_POSITION.put(2130,OptionMap.setMap("银行行长/副行长","Bank/Vice-President",""));
OPT_MAP_POSITION.put(2131,OptionMap.setMap("银行信贷专员","Commissioner bank Credit",""));
OPT_MAP_POSITION.put(2199,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(2200,OptionMap.setMap("人力资源/行政类","Administration/Human Resource",""));
OPT_MAP_POSITION.put(2201,OptionMap.setMap("培训经理/主管/专员","Training Manager/Director",""));
OPT_MAP_POSITION.put(2202,OptionMap.setMap("薪资福利经理/主管/专员","Compensation Manager/Director/Clerk",""));
OPT_MAP_POSITION.put(2203,OptionMap.setMap("人力资源总监","Human Resource Majordomo",""));
OPT_MAP_POSITION.put(2204,OptionMap.setMap("人事经理/主管/专员","Human Resource Manager",""));
OPT_MAP_POSITION.put(2205,OptionMap.setMap("人事助理/文员","Human Resource Assistant",""));
OPT_MAP_POSITION.put(2206,OptionMap.setMap("绩效考核经理/主管/专员","Performance Manager/Director/Clerk",""));
OPT_MAP_POSITION.put(2207,OptionMap.setMap("招聘经理/主管/专员","Recruitment Manger/Director/Clerk",""));
OPT_MAP_POSITION.put(2208,OptionMap.setMap("行政总监","Human Resource Majordomo",""));
OPT_MAP_POSITION.put(2209,OptionMap.setMap("行政经理/主管","Administration Manager",""));
OPT_MAP_POSITION.put(2210,OptionMap.setMap("行政助理/文员","Administration Assistant/Civilian",""));
OPT_MAP_POSITION.put(2211,OptionMap.setMap("员工关系管理","Staff Relationship Supervisor",""));
OPT_MAP_POSITION.put(2212,OptionMap.setMap("企业文化主管/专员","Enterprise Culture Specialist",""));
OPT_MAP_POSITION.put(2213,OptionMap.setMap("办公室主任","Office Manager",""));
OPT_MAP_POSITION.put(2214,OptionMap.setMap("总务","General Affairs",""));
OPT_MAP_POSITION.put(2215,OptionMap.setMap("合同管理专员","Contract management special Commissioner",""));
OPT_MAP_POSITION.put(2299,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(2300,OptionMap.setMap("文职类","Civilian Posts",""));
OPT_MAP_POSITION.put(2301,OptionMap.setMap("文案策划/资料编写","Article Planning/Materials Writing",""));
OPT_MAP_POSITION.put(2302,OptionMap.setMap("秘书/高级秘书","Secretary /Senior Secretary",""));
OPT_MAP_POSITION.put(2303,OptionMap.setMap("话务员","Telephonist",""));
OPT_MAP_POSITION.put(2304,OptionMap.setMap("前台文员","Reception",""));
OPT_MAP_POSITION.put(2305,OptionMap.setMap("文员/高级文员","Civilian /Senior Civilian",""));
OPT_MAP_POSITION.put(2306,OptionMap.setMap("电脑操作员/打字员","Computer Operator/Type Writer",""));
OPT_MAP_POSITION.put(2307,OptionMap.setMap("图书情报/档案管理","Books Information/Files Administration",""));
OPT_MAP_POSITION.put(2399,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(2400,OptionMap.setMap("工业/工厂类","Industry/Factories",""));
OPT_MAP_POSITION.put(2401,OptionMap.setMap("资材主管/资材助理","Materials and Equipment Manager/ Assistant",""));
OPT_MAP_POSITION.put(2402,OptionMap.setMap("仓库管理员","Storage Controller",""));
OPT_MAP_POSITION.put(2403,OptionMap.setMap("计划员/调度员","Dispatcher",""));
OPT_MAP_POSITION.put(2404,OptionMap.setMap("跟单员","Order Clerk",""));
OPT_MAP_POSITION.put(2405,OptionMap.setMap("PMC/SMT技术员","SMT Technician",""));
OPT_MAP_POSITION.put(2406,OptionMap.setMap("工艺工程师","Technic Engineer",""));
OPT_MAP_POSITION.put(2407,OptionMap.setMap("生管主管/督导","Production Management Director",""));
OPT_MAP_POSITION.put(2408,OptionMap.setMap("生管员","Production Management Clerk",""));
OPT_MAP_POSITION.put(2409,OptionMap.setMap("PE工程师","PE Engineer",""));
OPT_MAP_POSITION.put(2410,OptionMap.setMap("IE工程师","IE Engineer",""));
OPT_MAP_POSITION.put(2411,OptionMap.setMap("ME工程师","ME Engineer",""));
OPT_MAP_POSITION.put(2412,OptionMap.setMap("工程设备工程师","Engineering Device Engineer",""));
OPT_MAP_POSITION.put(2413,OptionMap.setMap("组长/拉长","Team leader",""));
OPT_MAP_POSITION.put(2414,OptionMap.setMap("物控员","Material Commissioner",""));
OPT_MAP_POSITION.put(2415,OptionMap.setMap("统计员","Statistician",""));
OPT_MAP_POSITION.put(2416,OptionMap.setMap("制造课长","ME Engineer",""));
OPT_MAP_POSITION.put(2417,OptionMap.setMap("R&D经理","RD Manager",""));
OPT_MAP_POSITION.put(2418,OptionMap.setMap("储备干部","Stockpiles the Cadre",""));
OPT_MAP_POSITION.put(2419,OptionMap.setMap("车间经理/主管","Workshop manager/Director",""));
OPT_MAP_POSITION.put(2420,OptionMap.setMap("维修工程师","Services Engineer",""));
OPT_MAP_POSITION.put(2421,OptionMap.setMap("新产品导入工程师","The new product inducts Engineer",""));
OPT_MAP_POSITION.put(2422,OptionMap.setMap("物控经理/主管","Material Manager/Director",""));
OPT_MAP_POSITION.put(2423,OptionMap.setMap("设备经理/主管","Device Manager/Director",""));
OPT_MAP_POSITION.put(2424,OptionMap.setMap("生产经理/主管","Product Manager",""));
OPT_MAP_POSITION.put(2425,OptionMap.setMap("工程经理/主管","Engineering Manager/Director",""));
OPT_MAP_POSITION.put(2426,OptionMap.setMap("产品开发","Product Development",""));
OPT_MAP_POSITION.put(2427,OptionMap.setMap("采购管理","Procurement Management",""));
OPT_MAP_POSITION.put(2499,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(2500,OptionMap.setMap("质量/安全/环境管理类","Quality/Safety Management",""));
OPT_MAP_POSITION.put(2501,OptionMap.setMap("质量管理/测试","Quality/Safety",""));
OPT_MAP_POSITION.put(2502,OptionMap.setMap("经理/主管(QA/QC经理)","QA/QC Manager/Supervisor",""));
OPT_MAP_POSITION.put(2503,OptionMap.setMap("质量管理/测试工程师(QA/QC工程师)","QA/QC Engineer",""));
OPT_MAP_POSITION.put(2504,OptionMap.setMap("质量管理/验货员(QA/QC)","Quality Management QA/QC",""));
OPT_MAP_POSITION.put(2505,OptionMap.setMap("ISO9000质量检验员/测试员","Quality Inspector/Tester",""));
OPT_MAP_POSITION.put(2506,OptionMap.setMap("化验/检验员","Assay/Test Clerk",""));
OPT_MAP_POSITION.put(2507,OptionMap.setMap("品管员","PQA Commissioner",""));
OPT_MAP_POSITION.put(2508,OptionMap.setMap("品质工程师","PQA Engineer",""));
OPT_MAP_POSITION.put(2509,OptionMap.setMap("食品检验工","Food Inspection",""));
OPT_MAP_POSITION.put(2510,OptionMap.setMap("故障分析工程师","Failure Analysis Engineer",""));
OPT_MAP_POSITION.put(2511,OptionMap.setMap("采购材料、设备质量管理","Supplies & Equipment Quality Management",""));
OPT_MAP_POSITION.put(2512,OptionMap.setMap("认证工程师/审核员","Certification Engineer/Auditor",""));
OPT_MAP_POSITION.put(2513,OptionMap.setMap("体系工程师/审核员","Systems Engineer/Auditor",""));
OPT_MAP_POSITION.put(2514,OptionMap.setMap("安全/健康/环境经理/主管","Safety/Health/Environmental Manager/Supervisor",""));
OPT_MAP_POSITION.put(2515,OptionMap.setMap("安全/健康/环境工程师","Safety/Health/Environmental Engineer",""));
OPT_MAP_POSITION.put(2516,OptionMap.setMap("安全主任","Security Director",""));
OPT_MAP_POSITION.put(2517,OptionMap.setMap("供应商管理","Supplier/Vendor Management",""));
OPT_MAP_POSITION.put(2518,OptionMap.setMap("供应商质量工程师","Supplier quality Engineer",""));
OPT_MAP_POSITION.put(2599,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(2600,OptionMap.setMap("机械(电)/仪表类","Mechanism/Instrument",""));
OPT_MAP_POSITION.put(2601,OptionMap.setMap("机械制图员","Mechanical cartography",""));
OPT_MAP_POSITION.put(2602,OptionMap.setMap("结构设计师","Structure Engineer",""));
OPT_MAP_POSITION.put(2603,OptionMap.setMap("飞行器设计工程师","Flight vehicle project Engineer",""));
OPT_MAP_POSITION.put(2604,OptionMap.setMap("机械工艺师","Machine Engineer",""));
OPT_MAP_POSITION.put(2605,OptionMap.setMap("机械设计/制造工程师","Machine Design and Manufacture Engineer",""));
OPT_MAP_POSITION.put(2606,OptionMap.setMap("机械工程师","Machine Engineer",""));
OPT_MAP_POSITION.put(2607,OptionMap.setMap("船舶机械工程师","Watercraft machine Engineer",""));
OPT_MAP_POSITION.put(2608,OptionMap.setMap("CNC工程师","CNC Engineer",""));
OPT_MAP_POSITION.put(2609,OptionMap.setMap("食品机械工程师","Grocery machine Engineer",""));
OPT_MAP_POSITION.put(2610,OptionMap.setMap("焊接机械工程师","Jointing machine Engineer",""));
OPT_MAP_POSITION.put(2611,OptionMap.setMap("精密机械/仪器仪表工程师","Precision optical machinery/Instrument and meter Engineer",""));
OPT_MAP_POSITION.put(2612,OptionMap.setMap("纺织机械工程师","Spin machine Engineer",""));
OPT_MAP_POSITION.put(2613,OptionMap.setMap("汽车/摩托车工程师","Automobile/Autocycle Engineer",""));
OPT_MAP_POSITION.put(2614,OptionMap.setMap("表面处理工程师","Surface treatment Engineer",""));
OPT_MAP_POSITION.put(2615,OptionMap.setMap("气动/液压","Hydraulic Pressure/Gas driven",""));
OPT_MAP_POSITION.put(2616,OptionMap.setMap("机电一体化","Integration of machinery",""));
OPT_MAP_POSITION.put(2617,OptionMap.setMap("铸造/锻造工程师","Foundry/Smithing Engineer",""));
OPT_MAP_POSITION.put(2618,OptionMap.setMap("数控技术员","Numerical control Technician",""));
OPT_MAP_POSITION.put(2619,OptionMap.setMap("锅炉/压力容器","Boiler/Pressure vessel",""));
OPT_MAP_POSITION.put(2620,OptionMap.setMap("设备修理","Device Repairment",""));
OPT_MAP_POSITION.put(2621,OptionMap.setMap("电镀/热处理","Galvanization/Heat Treatment",""));
OPT_MAP_POSITION.put(2622,OptionMap.setMap("五金矿产/金属制品","Ironware, mineral resources/metalwork",""));
OPT_MAP_POSITION.put(2699,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(2700,OptionMap.setMap("模具类","Mold",""));
OPT_MAP_POSITION.put(2701,OptionMap.setMap("模具工程师","Matrix Engineer",""));
OPT_MAP_POSITION.put(2702,OptionMap.setMap("塑胶模师傅/普师/补师","Plastics Mold Worker",""));
OPT_MAP_POSITION.put(2703,OptionMap.setMap("五金模师傅/普师/补师","Hardware Mold Worker",""));
OPT_MAP_POSITION.put(2704,OptionMap.setMap("塑胶模经理/主管","Plastics Mold Manager/Supervisor",""));
OPT_MAP_POSITION.put(2705,OptionMap.setMap("五金模经理/主管","Hardware Mold Manager/Supervisor",""));
OPT_MAP_POSITION.put(2706,OptionMap.setMap("模具QC/品管/品保","Mould QC",""));
OPT_MAP_POSITION.put(2707,OptionMap.setMap("注塑成型工程师","Prototyping Engineer",""));
OPT_MAP_POSITION.put(2708,OptionMap.setMap("冲压工程师","Ramming Engineer",""));
OPT_MAP_POSITION.put(2709,OptionMap.setMap("跟模/试模/校模","Mold Worker/Mold Tester/Mold Calibrater",""));
OPT_MAP_POSITION.put(2710,OptionMap.setMap("省模/组模/修模","Mold Assembler/Mold Repairer",""));
OPT_MAP_POSITION.put(2711,OptionMap.setMap("CNC/编程","CNC/ Programme",""));
OPT_MAP_POSITION.put(2712,OptionMap.setMap("走丝/慢走丝/线切割","Drawbench Technician/Line cutting Technician",""));
OPT_MAP_POSITION.put(2713,OptionMap.setMap("铣床/磨床/钻床","Miller/Grinder/Driller",""));
OPT_MAP_POSITION.put(2714,OptionMap.setMap("冲床/车床/火花机","Puncher/Latheman/Spark Machine Operator",""));
OPT_MAP_POSITION.put(2715,OptionMap.setMap("模具/手版制作","Mold Production",""));
OPT_MAP_POSITION.put(2716,OptionMap.setMap("刀具/夹具","Reamer Engineer/Jig Engineer",""));
OPT_MAP_POSITION.put(2799,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(2800,OptionMap.setMap("房地产/物业类","Realty Development",""));
OPT_MAP_POSITION.put(2801,OptionMap.setMap("房地产中介","Realty agency",""));
OPT_MAP_POSITION.put(2802,OptionMap.setMap("房地产销售","Real Estate Sales",""));
OPT_MAP_POSITION.put(2803,OptionMap.setMap("商业地产策划师","Commercial Real Estate Strategist",""));
OPT_MAP_POSITION.put(2804,OptionMap.setMap("物业管理","Infrastructure management",""));
OPT_MAP_POSITION.put(2805,OptionMap.setMap("物业招商/租赁/租售员","Property Lease/Rent",""));
OPT_MAP_POSITION.put(2806,OptionMap.setMap("房地产开发/策划经理","Realty Development/Planning Manager",""));
OPT_MAP_POSITION.put(2807,OptionMap.setMap("房地产开发/策划专员","Realty Development/Planning Commissioner",""));
OPT_MAP_POSITION.put(2808,OptionMap.setMap("房地产评估师","Realty evaluation",""));
OPT_MAP_POSITION.put(2809,OptionMap.setMap("房产测量员","Property Surveyors",""));
OPT_MAP_POSITION.put(2899,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(2900,OptionMap.setMap("建筑/施工/园林(园艺)类","Realty/Architecture/Construction",""));
OPT_MAP_POSITION.put(2901,OptionMap.setMap("投标主管","Bids the manager",""));
OPT_MAP_POSITION.put(2902,OptionMap.setMap("报批/报建专员","Approval/reported to the Commissioner",""));
OPT_MAP_POSITION.put(2903,OptionMap.setMap("建筑(结构)设计工程师","Architecture engineer",""));
OPT_MAP_POSITION.put(2904,OptionMap.setMap("建筑制图工程师","Architecture cartography",""));
OPT_MAP_POSITION.put(2905,OptionMap.setMap("注册建筑师","Registered architect",""));
OPT_MAP_POSITION.put(2906,OptionMap.setMap("土建工程师","Construction Engineer",""));
OPT_MAP_POSITION.put(2907,OptionMap.setMap("工民建","Industry/Civilian Architecture",""));
OPT_MAP_POSITION.put(2908,OptionMap.setMap("建筑工程验收师","Construction Project Inspector",""));
OPT_MAP_POSITION.put(2909,OptionMap.setMap("绘图员","Plotter",""));
OPT_MAP_POSITION.put(2910,OptionMap.setMap("建筑工程造价/预结算师","Construction Cost/pre-clearing Division",""));
OPT_MAP_POSITION.put(2911,OptionMap.setMap("施工员","Construction",""));
OPT_MAP_POSITION.put(2912,OptionMap.setMap("路桥技术/隧道工程","Route and Bridge tech./Tunnel engineering",""));
OPT_MAP_POSITION.put(2913,OptionMap.setMap("基建/岩土工程","Capital construction",""));
OPT_MAP_POSITION.put(2914,OptionMap.setMap("工程监理","Engineering superintendent",""));
OPT_MAP_POSITION.put(2915,OptionMap.setMap("工程项目经理","Engineering Project Manager",""));
OPT_MAP_POSITION.put(2916,OptionMap.setMap("管道(水、电)","Pipeline/Refrigeration",""));
OPT_MAP_POSITION.put(2917,OptionMap.setMap("给排水/供水(电)工程师","Drainage/water(electric) supply Engineer",""));
OPT_MAP_POSITION.put(2918,OptionMap.setMap("制冷暖通","Refrigeration/Central heating",""));
OPT_MAP_POSITION.put(2919,OptionMap.setMap("港口与航道工程","Port and sea-route engineering",""));
OPT_MAP_POSITION.put(2920,OptionMap.setMap("资料员","File Clerk",""));
OPT_MAP_POSITION.put(2921,OptionMap.setMap("园艺/园林技术员","Gardening/botanical garden Technician",""));
OPT_MAP_POSITION.put(2922,OptionMap.setMap("园艺/园林设计","Gardenning Designer",""));
OPT_MAP_POSITION.put(2923,OptionMap.setMap("景观设计师","Landscape Designer",""));
OPT_MAP_POSITION.put(2924,OptionMap.setMap("插花员","Flower arrangement",""));
OPT_MAP_POSITION.put(2925,OptionMap.setMap("城市规划与设计","Urban Design/Planning",""));
OPT_MAP_POSITION.put(2926,OptionMap.setMap("园林监理","Botanical garden overseeing",""));
OPT_MAP_POSITION.put(2927,OptionMap.setMap("园艺/园林工程师","Gardening/botanical garden Engineer",""));
OPT_MAP_POSITION.put(2928,OptionMap.setMap("建筑施工管理","Construction Management",""));
OPT_MAP_POSITION.put(2999,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(3000,OptionMap.setMap("设计类","advertising(upholster) Design",""));
OPT_MAP_POSITION.put(3001,OptionMap.setMap("广告创意总监","Advertisement creativity Inspector General",""));
OPT_MAP_POSITION.put(3002,OptionMap.setMap("广告设计/创意策划师","Advertisement design/Originality Planning",""));
OPT_MAP_POSITION.put(3003,OptionMap.setMap("文案/媒体策划","Planning",""));
OPT_MAP_POSITION.put(3004,OptionMap.setMap("室内(外)装修/装潢设计","Interior/Exterior Designer/Decorator",""));
OPT_MAP_POSITION.put(3005,OptionMap.setMap("商业美术设计师","Commercial fine arts Designer",""));
OPT_MAP_POSITION.put(3006,OptionMap.setMap("陈列/展览设计","Exhibition/display Design",""));
OPT_MAP_POSITION.put(3007,OptionMap.setMap("三维动画设计","3D Movie Design",""));
OPT_MAP_POSITION.put(3008,OptionMap.setMap("多媒体设计制作员","Multimedia Design",""));
OPT_MAP_POSITION.put(3009,OptionMap.setMap("动漫设计制作员","CARTOON design Producers",""));
OPT_MAP_POSITION.put(3010,OptionMap.setMap("产品包装设计","Product casing Design",""));
OPT_MAP_POSITION.put(3011,OptionMap.setMap("工艺品设计","Craftwork Design",""));
OPT_MAP_POSITION.put(3012,OptionMap.setMap("工业产品设计","Industry product Design",""));
OPT_MAP_POSITION.put(3013,OptionMap.setMap("雕塑设计","Sculpture Design",""));
OPT_MAP_POSITION.put(3014,OptionMap.setMap("纺织/服饰(装)设计","Spin/finery Design",""));
OPT_MAP_POSITION.put(3015,OptionMap.setMap("灯光设计","Light Design",""));
OPT_MAP_POSITION.put(3016,OptionMap.setMap("家具设计","Furniture Design",""));
OPT_MAP_POSITION.put(3017,OptionMap.setMap("形象设计/平面设计","Visualize Design/Plane Design",""));
OPT_MAP_POSITION.put(3018,OptionMap.setMap("玩具设计","Toy Design",""));
OPT_MAP_POSITION.put(3019,OptionMap.setMap("珠宝设计/首饰设计","Jewellery Design/Jewelry Design",""));
OPT_MAP_POSITION.put(3020,OptionMap.setMap("绘图员","Plotter",""));
OPT_MAP_POSITION.put(3021,OptionMap.setMap("游戏设计","Game Design",""));
OPT_MAP_POSITION.put(3022,OptionMap.setMap("模具设计","Mold design",""));
OPT_MAP_POSITION.put(3099,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(3100,OptionMap.setMap("影视/广播/媒体/摄影类","Movie/Photopgraphy",""));
OPT_MAP_POSITION.put(3101,OptionMap.setMap("影视策划/制作人员","Movie planning/Producer",""));
OPT_MAP_POSITION.put(3102,OptionMap.setMap("影音器材管理/道具员","Media device administrator",""));
OPT_MAP_POSITION.put(3103,OptionMap.setMap("化妆/造型师","Makeup Artist/Image Designer",""));
OPT_MAP_POSITION.put(3104,OptionMap.setMap("布景师","Art Director",""));
OPT_MAP_POSITION.put(3105,OptionMap.setMap("模特儿","Model",""));
OPT_MAP_POSITION.put(3106,OptionMap.setMap("摄影师/摄影助理","Photographer/Assistant Cameraman",""));
OPT_MAP_POSITION.put(3107,OptionMap.setMap("灯光师/剪辑师/冲印师/音效师","Lighting Engineer/Film Cutter/Photo Division/Sound effects Director",""));
OPT_MAP_POSITION.put(3108,OptionMap.setMap("节目主持人","M.C",""));
OPT_MAP_POSITION.put(3109,OptionMap.setMap("播音员","Announcer",""));
OPT_MAP_POSITION.put(3110,OptionMap.setMap("配音员","Recording Director",""));
OPT_MAP_POSITION.put(3111,OptionMap.setMap("记者","Reporter",""));
OPT_MAP_POSITION.put(3112,OptionMap.setMap("演员","Actor/actress",""));
OPT_MAP_POSITION.put(3113,OptionMap.setMap("导演/副导演/助理导演","Director/Assistant Director",""));
OPT_MAP_POSITION.put(3114,OptionMap.setMap("经纪人/星探","Manager/Talent",""));
OPT_MAP_POSITION.put(3199,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(3200,OptionMap.setMap("文体教育/培训类","Culture/Education",""));
OPT_MAP_POSITION.put(3201,OptionMap.setMap("文化艺术","Culture/Arts",""));
OPT_MAP_POSITION.put(3202,OptionMap.setMap("教授","Professor",""));
OPT_MAP_POSITION.put(3203,OptionMap.setMap("讲师","Lecturer",""));
OPT_MAP_POSITION.put(3204,OptionMap.setMap("助教","Assistant",""));
OPT_MAP_POSITION.put(3205,OptionMap.setMap("高等教育","Higher education",""));
OPT_MAP_POSITION.put(3206,OptionMap.setMap("中级教育","Intermediate education",""));
OPT_MAP_POSITION.put(3207,OptionMap.setMap("初级教育","Primary education",""));
OPT_MAP_POSITION.put(3208,OptionMap.setMap("小学/幼儿教育","Grade school/infant education",""));
OPT_MAP_POSITION.put(3209,OptionMap.setMap("竞技/体育","Sports",""));
OPT_MAP_POSITION.put(3210,OptionMap.setMap("家教","Family education",""));
OPT_MAP_POSITION.put(3211,OptionMap.setMap("培训经理/主管","Training Managers/Directors",""));
OPT_MAP_POSITION.put(3212,OptionMap.setMap("职业教育/培训","Vocational education/Training",""));
OPT_MAP_POSITION.put(3213,OptionMap.setMap("计算机培训师","Computer Training",""));
OPT_MAP_POSITION.put(3214,OptionMap.setMap("英语培训师","English Training",""));
OPT_MAP_POSITION.put(3215,OptionMap.setMap("培训专员","Trains special Commissioner",""));
OPT_MAP_POSITION.put(3216,OptionMap.setMap("驾校教练","Driving Master",""));
OPT_MAP_POSITION.put(3217,OptionMap.setMap("教务/教学管理人员","Educational Administration/Teaching Management Staff",""));
OPT_MAP_POSITION.put(3218,OptionMap.setMap("外籍教师","Foreign teacher",""));
OPT_MAP_POSITION.put(3219,OptionMap.setMap("教材编辑","Sports/Gym Teacher",""));
OPT_MAP_POSITION.put(3299,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(3300,OptionMap.setMap("卫生医疗/保健护理(美容)类","Sanitation/Treatment/Healthing",""));
OPT_MAP_POSITION.put(3301,OptionMap.setMap("医生/医师/理疗师","Doctor/Physician/Physical Therapist",""));
OPT_MAP_POSITION.put(3302,OptionMap.setMap("牙科/心理/外科/内科/预防/妇产科医生","Dentist/Psychology doctor/Surgeon/Internist/Prevent doctor/Accoucheur",""));
OPT_MAP_POSITION.put(3303,OptionMap.setMap("护士/护理员","Nurse",""));
OPT_MAP_POSITION.put(3304,OptionMap.setMap("针灸推拿/妇幼保健/卫生防疫","Acupuncture/message/Women/children heathcare/Sanitation/epidemic prevention",""));
OPT_MAP_POSITION.put(3305,OptionMap.setMap("临床医学/研究员/协调员","Clinic iatrology",""));
OPT_MAP_POSITION.put(3306,OptionMap.setMap("药剂/中药/西药/药检师","Medicament/Chinese traditional/Western medicine",""));
OPT_MAP_POSITION.put(3307,OptionMap.setMap("药库主任/药剂师","Pharmacist",""));
OPT_MAP_POSITION.put(3308,OptionMap.setMap("兽医","Farrier",""));
OPT_MAP_POSITION.put(3309,OptionMap.setMap("美容/化妆顾问/美容助理","Beauty/cosmetics Consultant",""));
OPT_MAP_POSITION.put(3310,OptionMap.setMap("发型设计师","Hairstyle Designer",""));
OPT_MAP_POSITION.put(3311,OptionMap.setMap("营养师/美甲师","Dietitian/Nail Specialist",""));
OPT_MAP_POSITION.put(3312,OptionMap.setMap("保健/健美师","Heathcare/ Gymnasium",""));
OPT_MAP_POSITION.put(3313,OptionMap.setMap("健身教练/顾问","Fitness Trainer/Consultant",""));
OPT_MAP_POSITION.put(3314,OptionMap.setMap("瑜伽/舞蹈老师/瘦身顾问","Yoga/Dance Instructor",""));
OPT_MAP_POSITION.put(3315,OptionMap.setMap("按摩/足疗","Spa/Massage/Foot Care",""));
OPT_MAP_POSITION.put(3316,OptionMap.setMap("宠物护理/美容","Pet care",""));
OPT_MAP_POSITION.put(3317,OptionMap.setMap("麻醉师","Anesthetist",""));
OPT_MAP_POSITION.put(3399,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(3400,OptionMap.setMap("化工/制药/医疗器械类","Chemical/Pharmacy",""));
OPT_MAP_POSITION.put(3401,OptionMap.setMap("化工技术应用","Chemical Technical Application",""));
OPT_MAP_POSITION.put(3402,OptionMap.setMap("表面处理","Surface Treatment",""));
OPT_MAP_POSITION.put(3403,OptionMap.setMap("日用化工","Daily-use chemical industry",""));
OPT_MAP_POSITION.put(3404,OptionMap.setMap("化工器械销售","Instrument sale",""));
OPT_MAP_POSITION.put(3405,OptionMap.setMap("生物化工","Biochemical industry",""));
OPT_MAP_POSITION.put(3406,OptionMap.setMap("造纸/废品处理","Paper making/waster disposal",""));
OPT_MAP_POSITION.put(3407,OptionMap.setMap("环保技术","Environmental Technology",""));
OPT_MAP_POSITION.put(3408,OptionMap.setMap("玻璃/硅酸盐工业","Glass/Silicate industry",""));
OPT_MAP_POSITION.put(3409,OptionMap.setMap("农药、化肥","Pesticide/Chemical fertilizer",""));
OPT_MAP_POSITION.put(3410,OptionMap.setMap("无机化工/有机化工","Abio-chemical/Organic chemical",""));
OPT_MAP_POSITION.put(3411,OptionMap.setMap("高分子化工/化纤/新材料","Macromolecule chemical/Chemical fibre/New materials",""));
OPT_MAP_POSITION.put(3412,OptionMap.setMap("精细化工/分析化工/电镀化工","Fine chemical/Analyse chemical/Plating chemical",""));
OPT_MAP_POSITION.put(3413,OptionMap.setMap("化学药剂/药品","Chemistry medicament",""));
OPT_MAP_POSITION.put(3414,OptionMap.setMap("生物制药","Biology pharmacy",""));
OPT_MAP_POSITION.put(3415,OptionMap.setMap("药品注册师","Pharmaceuticals Register Specialist",""));
OPT_MAP_POSITION.put(3416,OptionMap.setMap("药品生产/质量管理员","Pharmaceutical Manufacturing/Quality Management",""));
OPT_MAP_POSITION.put(3417,OptionMap.setMap("医药技术研发管理人员","Pharmaceutical Technology R&D Management",""));
OPT_MAP_POSITION.put(3418,OptionMap.setMap("医药销售经理/主管","Pharmaceutical Sales Manager",""));
OPT_MAP_POSITION.put(3419,OptionMap.setMap("医疗器械市场推广/销售","Medical Equipment Sales",""));
OPT_MAP_POSITION.put(3420,OptionMap.setMap("医药代表","Curative agent",""));
OPT_MAP_POSITION.put(3421,OptionMap.setMap("医药检验","Medicine checker",""));
OPT_MAP_POSITION.put(3499,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(3500,OptionMap.setMap("能源动力类","Energy sources/Power",""));
OPT_MAP_POSITION.put(3501,OptionMap.setMap("水利/水电","Irrigation works/water and electricity",""));
OPT_MAP_POSITION.put(3502,OptionMap.setMap("核电/火电","nuclear-powered/fire-powered electricity",""));
OPT_MAP_POSITION.put(3503,OptionMap.setMap("电厂/电力","Power plant",""));
OPT_MAP_POSITION.put(3504,OptionMap.setMap("制冷/暖通","Refrigeration/Heating",""));
OPT_MAP_POSITION.put(3505,OptionMap.setMap("空调/锅炉","Air-conditioning/boiler",""));
OPT_MAP_POSITION.put(3506,OptionMap.setMap("石油/天燃气/储运","Petroleum/natural gas",""));
OPT_MAP_POSITION.put(3507,OptionMap.setMap("太阳能","Solar",""));
OPT_MAP_POSITION.put(3508,OptionMap.setMap("城市燃气","City gas",""));
OPT_MAP_POSITION.put(3509,OptionMap.setMap("光伏","PV",""));
OPT_MAP_POSITION.put(3599,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(3600,OptionMap.setMap("酒店宾馆/餐饮旅游类","Hotel/Restaurant/Junketing",""));
OPT_MAP_POSITION.put(3601,OptionMap.setMap("酒店/宾馆经理","Hotel/guesthouse Manager",""));
OPT_MAP_POSITION.put(3602,OptionMap.setMap("大堂经理/副理","Lobby manager",""));
OPT_MAP_POSITION.put(3603,OptionMap.setMap("楼面/餐厅/客房部长","Floor manager/director",""));
OPT_MAP_POSITION.put(3604,OptionMap.setMap("酒店管理","Hotel manager",""));
OPT_MAP_POSITION.put(3605,OptionMap.setMap("订票/订房服务员","Reservations/booking Service",""));
OPT_MAP_POSITION.put(3606,OptionMap.setMap("咨客/前台接待/礼仪/接线生","Reception/Telephonist",""));
OPT_MAP_POSITION.put(3607,OptionMap.setMap("服务员/侍者/门童","Waiter/waitress",""));
OPT_MAP_POSITION.put(3608,OptionMap.setMap("高级厨师","Senior chef",""));
OPT_MAP_POSITION.put(3609,OptionMap.setMap("西式面点师/烹调师","Western-style flour dim sum teacher/Western Cooker",""));
OPT_MAP_POSITION.put(3610,OptionMap.setMap("中式面点师/烹调师","Chinese type flour dim sum teacher/Chinese Cooker",""));
OPT_MAP_POSITION.put(3611,OptionMap.setMap("调酒师/茶艺师","Wine mixer/Tea Specialist",""));
OPT_MAP_POSITION.put(3612,OptionMap.setMap("娱乐/餐饮管理员","Entertainment/dining Manager",""));
OPT_MAP_POSITION.put(3613,OptionMap.setMap("导游","Cicerone",""));
OPT_MAP_POSITION.put(3614,OptionMap.setMap("旅游管理","Traveling management",""));
OPT_MAP_POSITION.put(3615,OptionMap.setMap("客房主管/文员","Guest Room Manager/Service",""));
OPT_MAP_POSITION.put(3616,OptionMap.setMap("公关主任","Public relations director",""));
OPT_MAP_POSITION.put(3617,OptionMap.setMap("培训主任","Trains director",""));
OPT_MAP_POSITION.put(3618,OptionMap.setMap("外联/计调(旅行社)","External Linker/Plan Adjustor (Travel Agency)",""));
OPT_MAP_POSITION.put(3619,OptionMap.setMap("部长/领班/服务员","Minister/Service Supervisor/Service Waiter",""));
OPT_MAP_POSITION.put(3699,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(3700,OptionMap.setMap("包装/印刷/纸品类","Printing/Packaging/Paper",""));
OPT_MAP_POSITION.put(3701,OptionMap.setMap("包装工程师","Packs Engineer",""));
OPT_MAP_POSITION.put(3702,OptionMap.setMap("调墨技师","Adjusts the Mexican technician",""));
OPT_MAP_POSITION.put(3703,OptionMap.setMap("单色机长","Singles-colorprinting Machine Operator",""));
OPT_MAP_POSITION.put(3704,OptionMap.setMap("罗兰机机长","Roland Machine Operator",""));
OPT_MAP_POSITION.put(3705,OptionMap.setMap("印刷工程师","Printing Engineer",""));
OPT_MAP_POSITION.put(3706,OptionMap.setMap("折页机长","Page-Folding Printing Machine Operator",""));
OPT_MAP_POSITION.put(3707,OptionMap.setMap("过胶机机长","Gelatinizing Machine Operator",""));
OPT_MAP_POSITION.put(3708,OptionMap.setMap("切纸机机长","Paper Cutting Machine Operator",""));
OPT_MAP_POSITION.put(3709,OptionMap.setMap("啤机机长","Injection Machine Operator",""));
OPT_MAP_POSITION.put(3710,OptionMap.setMap("UV机机长","UV Machine Operator",""));
OPT_MAP_POSITION.put(3711,OptionMap.setMap("纸闸机机长","Paper-brake Machine Operator",""));
OPT_MAP_POSITION.put(3712,OptionMap.setMap("骑马钉机长","Saddle-stitched Machine Operator",""));
OPT_MAP_POSITION.put(3713,OptionMap.setMap("排书机机长","Book-arraging Machine Operator",""));
OPT_MAP_POSITION.put(3714,OptionMap.setMap("工艺开单员/工艺工程师","Craftwork Biller/Craftwork Engineeer",""));
OPT_MAP_POSITION.put(3715,OptionMap.setMap("设计制版/排版/组版","Design Platemaker/Typesetter/Assembler",""));
OPT_MAP_POSITION.put(3716,OptionMap.setMap("凹版印刷技术员","Intaglio Printing Technician",""));
OPT_MAP_POSITION.put(3717,OptionMap.setMap("丝印机长/主管","Screen Printing Operator/Supervisor",""));
OPT_MAP_POSITION.put(3718,OptionMap.setMap("菲林输出","Film Printing",""));
OPT_MAP_POSITION.put(3719,OptionMap.setMap("水印印刷","Watermark Printing",""));
OPT_MAP_POSITION.put(3720,OptionMap.setMap("晒版技工","Plate Copying Technician",""));
OPT_MAP_POSITION.put(3721,OptionMap.setMap("单面/双面瓦楞纸机长","Single-side/Double-side Corrugated Paper Machine Operator",""));
OPT_MAP_POSITION.put(3722,OptionMap.setMap("制浆造纸工程师","Papermaking Engineer",""));
OPT_MAP_POSITION.put(3723,OptionMap.setMap("裱纸/分纸/印唛/烫金","Paper Coating/Paper Dispart/Icon Printing/ Gilding Press Technician",""));
OPT_MAP_POSITION.put(3724,OptionMap.setMap("打稿师傅","Draft Operator",""));
OPT_MAP_POSITION.put(3725,OptionMap.setMap("双色机长","Two-tone Operator",""));
OPT_MAP_POSITION.put(3726,OptionMap.setMap("打钉机长","Nailing Chargeman",""));
OPT_MAP_POSITION.put(3799,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(3800,OptionMap.setMap("服装纺织/鞋帽/皮革类","Apparel/Shoes & Hats/Leather Goods",""));
OPT_MAP_POSITION.put(3801,OptionMap.setMap("服装设计师","Apparel Designer",""));
OPT_MAP_POSITION.put(3802,OptionMap.setMap("手袋设计","Handbag Design",""));
OPT_MAP_POSITION.put(3803,OptionMap.setMap("皮具开发设计","Leather Goods Design",""));
OPT_MAP_POSITION.put(3804,OptionMap.setMap("染整工程师","Printing and dyeing",""));
OPT_MAP_POSITION.put(3805,OptionMap.setMap("制版师","Apparels Sample Production",""));
OPT_MAP_POSITION.put(3806,OptionMap.setMap("纸样师","Paper Sample",""));
OPT_MAP_POSITION.put(3807,OptionMap.setMap("制鞋","Shoemaking",""));
OPT_MAP_POSITION.put(3808,OptionMap.setMap("调色员","Mixes colors",""));
OPT_MAP_POSITION.put(3809,OptionMap.setMap("面辅料采购","Fabric excipients",""));
OPT_MAP_POSITION.put(3810,OptionMap.setMap("计量员","Measurement",""));
OPT_MAP_POSITION.put(3811,OptionMap.setMap("打版师","Apparel Sample Technician",""));
OPT_MAP_POSITION.put(3812,OptionMap.setMap("机织车缝工艺员","Sewing Craftman for Weave Machine",""));
OPT_MAP_POSITION.put(3813,OptionMap.setMap("吓数师傅","Sweater messurement master",""));
OPT_MAP_POSITION.put(3814,OptionMap.setMap("出格师傅","Shoe Tree Design",""));
OPT_MAP_POSITION.put(3815,OptionMap.setMap("板房师傅","Sample master",""));
OPT_MAP_POSITION.put(3816,OptionMap.setMap("面部/底部技工","Surface / bottom mechanic",""));
OPT_MAP_POSITION.put(3817,OptionMap.setMap("面部/底部全套","A full set of surface / bottom",""));
OPT_MAP_POSITION.put(3818,OptionMap.setMap("大底技术员","Outsole technician",""));
OPT_MAP_POSITION.put(3819,OptionMap.setMap("大底磨边","Sole edge grinding",""));
OPT_MAP_POSITION.put(3820,OptionMap.setMap("面版师","Surface sample master",""));
OPT_MAP_POSITION.put(3821,OptionMap.setMap("底版师","Bottom sample master",""));
OPT_MAP_POSITION.put(3822,OptionMap.setMap("裁断机手","Cutting machine master",""));
OPT_MAP_POSITION.put(3823,OptionMap.setMap("针车技工","Needle machine mechanic",""));
OPT_MAP_POSITION.put(3824,OptionMap.setMap("针车品检","Needle machine inspection",""));
OPT_MAP_POSITION.put(3825,OptionMap.setMap("成型干部","Molding cadres",""));
OPT_MAP_POSITION.put(3826,OptionMap.setMap("鞋楦技术员","Shoe tree technician",""));
OPT_MAP_POSITION.put(3827,OptionMap.setMap("面部针车熟手","Surface needle machine proficient",""));
OPT_MAP_POSITION.put(3828,OptionMap.setMap("针车机修","Needle machine repair",""));
OPT_MAP_POSITION.put(3829,OptionMap.setMap("鞋样电脑设计","Shoe pattern design",""));
OPT_MAP_POSITION.put(3830,OptionMap.setMap("放码技工","Set size mechanic",""));
OPT_MAP_POSITION.put(3831,OptionMap.setMap("抓色技术员","Grasping color technician",""));
OPT_MAP_POSITION.put(3832,OptionMap.setMap("服装纸样版师","Clothing pattern master",""));
OPT_MAP_POSITION.put(3833,OptionMap.setMap("成型品检","Molding inspection",""));
OPT_MAP_POSITION.put(3834,OptionMap.setMap("底材仓库全检","Bottom material warehouse inspection",""));
OPT_MAP_POSITION.put(3835,OptionMap.setMap("层皮跟品检","Skin heel inspection",""));
OPT_MAP_POSITION.put(3836,OptionMap.setMap("样品跟单员","Sample Merchandiser",""));
OPT_MAP_POSITION.put(3837,OptionMap.setMap("尾部技工","Tail mechanic",""));
OPT_MAP_POSITION.put(3838,OptionMap.setMap("中烫/大烫技工","Semi/finish clothes ironing mechanic",""));
OPT_MAP_POSITION.put(3839,OptionMap.setMap("开版师/版房技术员","Sample mechanic",""));
OPT_MAP_POSITION.put(3840,OptionMap.setMap("跟单员","Order Clerk",""));
OPT_MAP_POSITION.put(3899,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(3900,OptionMap.setMap("超市/商场/零售/连锁类","Supermarket/Shops/Retail",""));
OPT_MAP_POSITION.put(3901,OptionMap.setMap("营业员/服务员/店员","Shop assistant/counterjumper",""));
OPT_MAP_POSITION.put(3902,OptionMap.setMap("导购员","Phasing leader",""));
OPT_MAP_POSITION.put(3903,OptionMap.setMap("收银员","Gathering",""));
OPT_MAP_POSITION.put(3904,OptionMap.setMap("店长","Innkeeper/shop manager",""));
OPT_MAP_POSITION.put(3905,OptionMap.setMap("防损员","Loss Prevention Management",""));
OPT_MAP_POSITION.put(3906,OptionMap.setMap("营销主管","Marketing director",""));
OPT_MAP_POSITION.put(3907,OptionMap.setMap("理货员","Tally clerk",""));
OPT_MAP_POSITION.put(3908,OptionMap.setMap("陈列员/陈列展示","Exhibition demonstrated",""));
OPT_MAP_POSITION.put(3909,OptionMap.setMap("连锁管理","Chain management",""));
OPT_MAP_POSITION.put(3910,OptionMap.setMap("专卖店/加盟店管理","Exclusive agency/alliance shop management",""));
OPT_MAP_POSITION.put(3911,OptionMap.setMap("市场督导/调查","Market director/investigation",""));
OPT_MAP_POSITION.put(3912,OptionMap.setMap("生鲜/干(杂)货管理","Raw Food/Dry (Mixed) Goods Management",""));
OPT_MAP_POSITION.put(3913,OptionMap.setMap("货品配送","Goods Allocation",""));
OPT_MAP_POSITION.put(3999,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(4000,OptionMap.setMap("技工/普工类","Mechanic/General worker",""));
OPT_MAP_POSITION.put(4001,OptionMap.setMap("叉车司机","Forklift Worker",""));
OPT_MAP_POSITION.put(4002,OptionMap.setMap("电工","Electrician",""));
OPT_MAP_POSITION.put(4003,OptionMap.setMap("焊工","Weld",""));
OPT_MAP_POSITION.put(4004,OptionMap.setMap("车床工","Latheg",""));
OPT_MAP_POSITION.put(4005,OptionMap.setMap("铣、刨、钣、铆、冲、铸","Planing,Francium,Rivetting,Washing,Cast",""));
OPT_MAP_POSITION.put(4006,OptionMap.setMap("钳工","Pincers",""));
OPT_MAP_POSITION.put(4007,OptionMap.setMap("裁、剪、车","Sewing",""));
OPT_MAP_POSITION.put(4008,OptionMap.setMap("缝、慰、烫","Iron",""));
OPT_MAP_POSITION.put(4009,OptionMap.setMap("打磨、抛光","Grinding,Polishing",""));
OPT_MAP_POSITION.put(4010,OptionMap.setMap("空调工/锅炉工/电梯工","Air-conditioning/temp/elevator work",""));
OPT_MAP_POSITION.put(4011,OptionMap.setMap("汽车/摩托车维护员","Automotive Engineer",""));
OPT_MAP_POSITION.put(4012,OptionMap.setMap("水工/木工/油漆工","Warterworker,Woodworker,Painter",""));
OPT_MAP_POSITION.put(4013,OptionMap.setMap("锁具修理工","Lock repairman",""));
OPT_MAP_POSITION.put(4014,OptionMap.setMap("普通工人","General worker",""));
OPT_MAP_POSITION.put(4015,OptionMap.setMap("技师","Technician",""));
OPT_MAP_POSITION.put(4016,OptionMap.setMap("模具工","Mold Engineer",""));
OPT_MAP_POSITION.put(4099,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(4100,OptionMap.setMap("轻工/陶瓷类","Light industry/Ceramics",""));
OPT_MAP_POSITION.put(4101,OptionMap.setMap("包装工程师","Packs Engineer",""));
OPT_MAP_POSITION.put(4102,OptionMap.setMap("服装纺织工","Accouterments/Spin",""));
OPT_MAP_POSITION.put(4103,OptionMap.setMap("物料经理","Material Manager",""));
OPT_MAP_POSITION.put(4104,OptionMap.setMap("物料主管/专员","Material Manager/Special Commissioner",""));
OPT_MAP_POSITION.put(4105,OptionMap.setMap("印刷/染整技术员","Press/printing and dyeing",""));
OPT_MAP_POSITION.put(4106,OptionMap.setMap("调色员","Mixes colors",""));
OPT_MAP_POSITION.put(4107,OptionMap.setMap("纸浆造纸工艺","Paper making",""));
OPT_MAP_POSITION.put(4108,OptionMap.setMap("制鞋/制衣/制革/手袋","Shoemaking/Clothing/Curry/Vanity",""));
OPT_MAP_POSITION.put(4109,OptionMap.setMap("面料辅料开发/采购专员","Fabric excipients Development/Procurement Commissioner",""));
OPT_MAP_POSITION.put(4110,OptionMap.setMap("板房/楦头/底格出格师","Shoe Tree Design",""));
OPT_MAP_POSITION.put(4111,OptionMap.setMap("服装打样/制版工","Apparels Sample Production",""));
OPT_MAP_POSITION.put(4112,OptionMap.setMap("车板工","Paper Sample",""));
OPT_MAP_POSITION.put(4113,OptionMap.setMap("裁床工","Cuts the bed labor",""));
OPT_MAP_POSITION.put(4114,OptionMap.setMap("食品工程/糖酒饮料/粮油副食","Foodstuff Engineering/Candy/Wine/Drink/Grain/oil",""));
OPT_MAP_POSITION.put(4115,OptionMap.setMap("金银首饰加工","Jewellery process",""));
OPT_MAP_POSITION.put(4116,OptionMap.setMap("陶瓷设计师","Ceramic Designer",""));
OPT_MAP_POSITION.put(4117,OptionMap.setMap("陶瓷选料","Ceramic Material Selector",""));
OPT_MAP_POSITION.put(4118,OptionMap.setMap("陶瓷化验","Ceramic Tester",""));
OPT_MAP_POSITION.put(4119,OptionMap.setMap("陶瓷手工成型","Ceramic Handworker",""));
OPT_MAP_POSITION.put(4120,OptionMap.setMap("瓷片技术员","Porcelain Technician",""));
OPT_MAP_POSITION.put(4121,OptionMap.setMap("陶瓷抛光工","Ceramic Furbisher",""));
OPT_MAP_POSITION.put(4122,OptionMap.setMap("陶瓷刮平工","Ceramic Technician",""));
OPT_MAP_POSITION.put(4123,OptionMap.setMap("陶瓷印花","Ceramic Printing",""));
OPT_MAP_POSITION.put(4124,OptionMap.setMap("陶瓷彩绘员","Ceramic Colored Drawing Worker",""));
OPT_MAP_POSITION.put(4125,OptionMap.setMap("陶瓷喷釉","Ceramic Spray Glazer",""));
OPT_MAP_POSITION.put(4126,OptionMap.setMap("陶瓷装罐工","Ceramic Worker",""));
OPT_MAP_POSITION.put(4127,OptionMap.setMap("计量员","Counter",""));
OPT_MAP_POSITION.put(4128,OptionMap.setMap("窑炉技术员","Stove Technician",""));
OPT_MAP_POSITION.put(4199,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(4200,OptionMap.setMap("贸易/采购/物流类","Distribution/Purchasing",""));
OPT_MAP_POSITION.put(4201,OptionMap.setMap("物流操作员","Logistics operator",""));
OPT_MAP_POSITION.put(4202,OptionMap.setMap("物流专员/助理","Logistics Commissioner/Assistant",""));
OPT_MAP_POSITION.put(4203,OptionMap.setMap("物流调度员","Logistics Dispatcher",""));
OPT_MAP_POSITION.put(4204,OptionMap.setMap("物流总监/经理/主管","Logistics Director/Manager/Director",""));
OPT_MAP_POSITION.put(4205,OptionMap.setMap("单证员","Order Clerk",""));
OPT_MAP_POSITION.put(4206,OptionMap.setMap("快递员","Courier",""));
OPT_MAP_POSITION.put(4207,OptionMap.setMap("理货员","Tally man",""));
OPT_MAP_POSITION.put(4208,OptionMap.setMap("运输经理/主管","Transit Manager/Directer",""));
OPT_MAP_POSITION.put(4209,OptionMap.setMap("货运代理","Freight forwarders",""));
OPT_MAP_POSITION.put(4210,OptionMap.setMap("集装箱业务","Container service",""));
OPT_MAP_POSITION.put(4211,OptionMap.setMap("仓库经理/主管","Storage manager/director",""));
OPT_MAP_POSITION.put(4212,OptionMap.setMap("仓库管理员","Storage clerk",""));
OPT_MAP_POSITION.put(4213,OptionMap.setMap("供应链总监","Supply Chain Director",""));
OPT_MAP_POSITION.put(4214,OptionMap.setMap("供应链经理/主管","Supply chain Manager/Supervisor",""));
OPT_MAP_POSITION.put(4215,OptionMap.setMap("供应链专员","Supply chain special Commissioner",""));
OPT_MAP_POSITION.put(4216,OptionMap.setMap("注册职业采购经理(CPPM)","Registered occupational Procurement Manager(CPPM)",""));
OPT_MAP_POSITION.put(4217,OptionMap.setMap("采购经理/主管","Procurement Manager/Supervisor",""));
OPT_MAP_POSITION.put(4218,OptionMap.setMap("采购专员/助理","Procurement Commissioner/Assistant",""));
OPT_MAP_POSITION.put(4219,OptionMap.setMap("采购管理员","Stock Management",""));
OPT_MAP_POSITION.put(4220,OptionMap.setMap("国际业务","International business",""));
OPT_MAP_POSITION.put(4221,OptionMap.setMap("外贸经理/主管","Foreign Trade Manager/Supervisor",""));
OPT_MAP_POSITION.put(4222,OptionMap.setMap("外贸专员/助理","Foreign Trade Commissioner/Assistant",""));
OPT_MAP_POSITION.put(4223,OptionMap.setMap("国内贸易人员","Domestic trade personnel",""));
OPT_MAP_POSITION.put(4224,OptionMap.setMap("业务跟单员","Service freight bill",""));
OPT_MAP_POSITION.put(4225,OptionMap.setMap("外销员","Export commissioner",""));
OPT_MAP_POSITION.put(4226,OptionMap.setMap("报关员","Customs commissioner",""));
OPT_MAP_POSITION.put(4227,OptionMap.setMap("船务人员","Shipman",""));
OPT_MAP_POSITION.put(4299,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(4300,OptionMap.setMap("后勤保障类","Logistics/Safeguard",""));
OPT_MAP_POSITION.put(4301,OptionMap.setMap("保安队长","Security captain",""));
OPT_MAP_POSITION.put(4302,OptionMap.setMap("保安","Security",""));
OPT_MAP_POSITION.put(4303,OptionMap.setMap("司机","Chauffeur",""));
OPT_MAP_POSITION.put(4304,OptionMap.setMap("消防","Firemen",""));
OPT_MAP_POSITION.put(4305,OptionMap.setMap("社区服务","Community services",""));
OPT_MAP_POSITION.put(4306,OptionMap.setMap("清洁工/后勤","Dustman/logistics",""));
OPT_MAP_POSITION.put(4307,OptionMap.setMap("食堂主管/经理","Canteen Supervisor/Manager",""));
OPT_MAP_POSITION.put(4308,OptionMap.setMap("食堂厨师","Refectory chef",""));
OPT_MAP_POSITION.put(4309,OptionMap.setMap("搬运","Portage",""));
OPT_MAP_POSITION.put(4310,OptionMap.setMap("寻呼/声讯","Pagers/Voice information services",""));
OPT_MAP_POSITION.put(4311,OptionMap.setMap("保姆/钟点工","Nanny/Hour Labor",""));
OPT_MAP_POSITION.put(4399,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(4400,OptionMap.setMap("出版/发行类","Edit/Publish",""));
OPT_MAP_POSITION.put(4401,OptionMap.setMap("总编/副总编","Editor-in-chief/Subeditor",""));
OPT_MAP_POSITION.put(4402,OptionMap.setMap("发行主管/助理","Dispatch Manager/Assistant",""));
OPT_MAP_POSITION.put(4403,OptionMap.setMap("编辑主任","Edit Director",""));
OPT_MAP_POSITION.put(4404,OptionMap.setMap("撰稿人","Copywriter",""));
OPT_MAP_POSITION.put(4405,OptionMap.setMap("采访主任","Interviews Director",""));
OPT_MAP_POSITION.put(4406,OptionMap.setMap("美术编辑","Art Editor",""));
OPT_MAP_POSITION.put(4407,OptionMap.setMap("排版设计","Layout Designer",""));
OPT_MAP_POSITION.put(4408,OptionMap.setMap("校对/录入","Proofreader/Data Entry Staff",""));
OPT_MAP_POSITION.put(4409,OptionMap.setMap("出版/发行","Publishing/Distribution",""));
OPT_MAP_POSITION.put(4410,OptionMap.setMap("文字/摄影记者","Writing/Photo Journalist",""));
OPT_MAP_POSITION.put(4411,OptionMap.setMap("编辑","Edit",""));
OPT_MAP_POSITION.put(4499,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(4500,OptionMap.setMap("翻译语言类","Translation",""));
OPT_MAP_POSITION.put(4501,OptionMap.setMap("英语翻译","English",""));
OPT_MAP_POSITION.put(4502,OptionMap.setMap("日语翻译","Japanese",""));
OPT_MAP_POSITION.put(4503,OptionMap.setMap("法语翻译","French",""));
OPT_MAP_POSITION.put(4504,OptionMap.setMap("德语翻译","German",""));
OPT_MAP_POSITION.put(4505,OptionMap.setMap("俄语翻译","Russian",""));
OPT_MAP_POSITION.put(4506,OptionMap.setMap("朝鲜语翻译","Korea",""));
OPT_MAP_POSITION.put(4507,OptionMap.setMap("越南语","Vietnamese",""));
OPT_MAP_POSITION.put(4508,OptionMap.setMap("西班牙语翻译","Spanish",""));
OPT_MAP_POSITION.put(4509,OptionMap.setMap("意大利语翻译","Italian",""));
OPT_MAP_POSITION.put(4510,OptionMap.setMap("阿拉伯语翻译","Arabic",""));
OPT_MAP_POSITION.put(4511,OptionMap.setMap("中国方言翻译","Chinese dialect translation",""));
OPT_MAP_POSITION.put(4599,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(4600,OptionMap.setMap("汽车类","Automotive",""));
OPT_MAP_POSITION.put(4601,OptionMap.setMap("汽车机构工程师","Automotive Structural Engineer",""));
OPT_MAP_POSITION.put(4602,OptionMap.setMap("汽车设计工程师","Automotive Design Engineer",""));
OPT_MAP_POSITION.put(4603,OptionMap.setMap("汽车电子工程师","Automotive Electronics Engineer",""));
OPT_MAP_POSITION.put(4604,OptionMap.setMap("汽车质量管理","Automotive Quality Management",""));
OPT_MAP_POSITION.put(4605,OptionMap.setMap("汽车安全性能工程师","Safety Performance Engineer",""));
OPT_MAP_POSITION.put(4606,OptionMap.setMap("汽车装配工艺工程师","Assembly Process Engineer",""));
OPT_MAP_POSITION.put(4607,OptionMap.setMap("汽车修理人员","Automotive Repair",""));
OPT_MAP_POSITION.put(4608,OptionMap.setMap("4S店经理/维修站经理","4S Shop Manager/Maintenance Station Manager",""));
OPT_MAP_POSITION.put(4609,OptionMap.setMap("汽车销售/经纪人","Automotive Sales Consultant/Brokers",""));
OPT_MAP_POSITION.put(4610,OptionMap.setMap("二手车评估师","Second-Hand Car Appraisers",""));
OPT_MAP_POSITION.put(4611,OptionMap.setMap("汽车美容","Automotive Cosmetology",""));
OPT_MAP_POSITION.put(4699,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(4700,OptionMap.setMap("家具类","Furniture",""));
OPT_MAP_POSITION.put(4701,OptionMap.setMap("家具设计","Furniture Design",""));
OPT_MAP_POSITION.put(4702,OptionMap.setMap("家具油漆工/主管","Furniture Paint supervisor/Directer",""));
OPT_MAP_POSITION.put(4703,OptionMap.setMap("家具木工/主管","Furniture Carpentry/Directer",""));
OPT_MAP_POSITION.put(4704,OptionMap.setMap("弯管师傅","Bend Master",""));
OPT_MAP_POSITION.put(4705,OptionMap.setMap("家具打磨/打样","Furniture Proofing/Polished",""));
OPT_MAP_POSITION.put(4706,OptionMap.setMap("家具备料/开料/精裁","Furniture Preparation/Kai Liao/Fine cut",""));
OPT_MAP_POSITION.put(4707,OptionMap.setMap("实木封边/压木","Solid Edge/Pressure veneer",""));
OPT_MAP_POSITION.put(4799,OptionMap.setMap("其它","Other",""));
OPT_MAP_POSITION.put(9900,OptionMap.setMap("其它岗位类","Others",""));
OPT_MAP_POSITION.put(9901,OptionMap.setMap("航空航天","Aerospace",""));
OPT_MAP_POSITION.put(9902,OptionMap.setMap("交通运输","Traffic",""));
OPT_MAP_POSITION.put(9903,OptionMap.setMap("声光技术","Voice/Light tech.",""));
OPT_MAP_POSITION.put(9904,OptionMap.setMap("生物技术","Boilogy tech.",""));
OPT_MAP_POSITION.put(9905,OptionMap.setMap("测绘技术","Mapping tech.",""));
OPT_MAP_POSITION.put(9906,OptionMap.setMap("激光技术","Laser tech.",""));
OPT_MAP_POSITION.put(9907,OptionMap.setMap("地质勘探","Geology prove",""));
OPT_MAP_POSITION.put(9908,OptionMap.setMap("矿产治金","Mine/metallurgy",""));
OPT_MAP_POSITION.put(9909,OptionMap.setMap("环境工程","Environment engineering",""));
OPT_MAP_POSITION.put(9910,OptionMap.setMap("农、林、牧、渔","Farming/Lumber/Pasturage/Fishery",""));
OPT_MAP_POSITION.put(9911,OptionMap.setMap("市政建设/城市规划","Municipal Construction/Urban Design & Planning",""));
OPT_MAP_POSITION.put(9999,OptionMap.setMap("其它","Other",""));
fillBigSmallMap();
}
/**
* 填充大类列表,以及大小类对应关系的map
*/
private static void fillBigSmallMap(){
Map<Integer,List<Map<String,String>>> tempBigSmalMap = Maps.newHashMap();
List<Map<String,String>> OPT_LIST_BIG_TEMP = Lists.newArrayList();
for(Map.Entry<Integer,Map<String,String>> entry : OPT_MAP_POSITION.entrySet()){
Integer code =Integer.parseInt((entry.getKey()+"").substring(0,2));//获取代码
if(StringUtils.endsWith(OptionMap.getCityCodeBits(entry.getKey()), "00")){//是否大类代码
Map<String, String> tempMapCity = entry.getValue();
Map<String, String> result = Maps.newHashMap(tempMapCity);
result.put("code",entry.getKey()+"");
result.put("hasChild","1");
OPT_LIST_BIG_TEMP.add(result);
}else{
List<Map<String,String>> tempList = tempBigSmalMap.get(code);
if(tempBigSmalMap.get(code) == null){
tempList = Lists.newArrayList();
tempBigSmalMap.put(code, tempList);
}
Map<String, String> tempMapSmall = entry.getValue();
Map<String, String> result = Maps.newHashMap(tempMapSmall);
result.put("code",entry.getKey()+"");
result.put("hasChild","0");
tempList.add(result);
}
}
OPT_MAP_BIG_SMALL_CITY = ImmutableMap.copyOf(tempBigSmalMap);
OPT_LIST_BIG = ImmutableList.copyOf(OPT_LIST_BIG_TEMP);
}
@SuppressWarnings({"rawtypes", "unchecked"})
public static Integer getKeyByValueAndType(String value,String type) {
Map map = OPT_MAP_POSITION;
for (Object obj : map.keySet()) {
Integer key = (Integer) obj;
Map<String, String> valueMap = (Map<String, String>) map.get(key);
if (StringUtils.equals(value, valueMap.get(type))) {
return key;
}
}
return null;
}
}
| [
"790260645@qq.com"
] | 790260645@qq.com |
30355467a673536e781991cba6e68ceebf898699 | caf9474af8e4aec0c1f10c6cb8ff849bb4cb1073 | /src/test/java/org/sample/Parameter.java | 7eabe3758b0ea8ed660b9a52679ed0cd7e825454 | [] | no_license | abdulameer888/abdulameer | 6e89162b10c627dff8884a031d301bc84d24aef5 | 69c3e129820a5b3f5ba4de4071634f52d4143595 | refs/heads/master | 2023-04-12T02:10:48.524398 | 2021-04-28T05:39:46 | 2021-04-28T05:39:46 | 362,047,248 | 0 | 0 | null | 2021-04-28T05:39:47 | 2021-04-27T09:01:17 | HTML | UTF-8 | Java | false | false | 541 | java | package org.sample;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import org.testng.annotations.TestInstance;
public class Parameter {
@Test
@Parameters({"UserName","password"})
private void test1(String name,String pass) {
System.out.println(name);
System.out.println(pass);
}
@Test
@Parameters({"name","password"})
private void test11(@Optional("Technology") String name, String pass) {
System.out.println(name);
System.out.println(pass);
}
}
| [
"ameervolley786@gmail.com"
] | ameervolley786@gmail.com |
53ab67e31e9308e90340dce4771db6640313f335 | 26341360de8aac870481fa9337b9d4b99a6c5e8c | /SpringHibernateExample/src/main/java/com/accolite/pizzeria/service/AdminService.java | 41ff9907ddfb5925b738f39b61fcaabe7a38cd31 | [] | no_license | p1Gaur/Pizzeria | a2b1bafb6d67a17acc826e0252cb91afbc552068 | d4bc3a448904ab8eca43be6cb2f6e2974e4010f2 | refs/heads/master | 2021-05-16T15:52:14.930949 | 2018-01-30T04:38:51 | 2018-01-30T04:38:51 | 118,412,177 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,462 | java | package com.accolite.pizzeria.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.accolite.pizzeria.model.Coupon;
import com.accolite.pizzeria.dao.AdminDao;
import com.accolite.pizzeria.dao.CustomerDao;
import com.accolite.pizzeria.model.Admin;
import com.accolite.pizzeria.model.Customer;
@Service("adminService")
@Transactional
public class AdminService {
@Autowired
private CustomerDao custDao;
@Autowired
private AdminDao adminDao;
/*
* gets admin object having specified username and password
*
* @param AdminUsername
* @param password
*
* @return Admin Object
*/
public Admin getAdmin(String adminUserName,String password) {
Admin admin = adminDao.findAdminByUsername(adminUserName);
if(admin!=null && admin.getPassword().equals(password))
return admin;
else
return null;
}
/*
* saves the admin object in database
*
* @param Admin object
*/
public void addAdmin(Admin admin) {
adminDao.saveAdmin(admin);
}
/*
* adds coupon to customer account having specified customer id.
*
* @param CustomerId
* @param Coupon object
*/
public void addCouponToCustomer(int custId,Coupon coupon) {
Customer customer=custDao.findById(custId);
if(customer==null)
return;
customer.getCoupons().add(coupon);
custDao.saveCustomer(customer);
}
}
| [
"pawan.gaur@accoliteindia.com"
] | pawan.gaur@accoliteindia.com |
02baae44aafdd4755fec0e1a1e7218c19d6406a2 | c65541a13d795518c7d9d4339bd93331cb29f143 | /app/src/main/java/com/example/numbershapes/MainActivity.java | 0b38ac6ac7a2b16e8893c1b89265332b353d13eb | [] | no_license | KAUSTUBH-SHARMA/Number-Shapes | 517fc1e9b54e60c85efab25536504738dd277a5e | f98fb03363c64c8807000b8fda709af63cdb5a25 | refs/heads/master | 2020-07-22T03:19:18.574861 | 2019-09-08T03:57:13 | 2019-09-08T03:57:13 | 207,058,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,716 | java | package com.example.numbershapes;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private EditText numberField;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
numberField=findViewById(R.id.NumberEditText);
}
public void checkNumber(View view){
if((numberField.getText().toString()).isEmpty()){
tost("Enter a number Please");
return;
}
int num=Integer.parseInt(numberField.getText().toString());
if(isTriangular(num) && isSquare(num)){
tost(""+num+" is both Square and Triangular");
} else if (isSquare(num) && !isTriangular(num)) {
tost(""+num+" is square but not Triangular");
}
else if(isTriangular(num) && !isSquare(num)){
tost(""+num+" is Triangular but not Square");
}
else{
tost(""+num+" is neither Traingular nor square");
}
}
public boolean isSquare(double x){
double sr=Math.sqrt(x);
return((sr-Math.floor(sr)) == 0);
}
public boolean isTriangular(int num){
if(num<0){
return false;
}
int sum=0;
for(int n=1;n<=num;n++){
sum=sum+n;
if(sum==num)
return true;
}
return false;
}
public void tost(String str){
Toast.makeText(this,str,Toast.LENGTH_SHORT).show();
}
}
| [
"kaustubh@iiitkalyani.ac.in"
] | kaustubh@iiitkalyani.ac.in |
6f782b018c6f8f08e40b3d54719ebfc85a768f10 | 748de3be51376802e79351b7ad2f66650193e93c | /conference/conference-v1-generated-source/com/appspot/ad_meet/conference/model/ProfileForm.java | 6deac6c56195d6067fda78adbd214b56782c2c3e | [
"Apache-2.0"
] | permissive | EncarnaAmoros/Admeet-Android | c09141c4603305a24faa5a8c2732f8b4c329884f | c8bdac8090bb7430c74e810e48a17fa7b2c0a095 | refs/heads/master | 2016-08-12T23:48:16.374733 | 2015-05-20T16:42:45 | 2015-05-20T16:42:45 | 52,906,343 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,815 | java | /*
* 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.
*/
/*
* This code was generated by https://code.google.com/p/google-apis-client-generator/
* (build: 2015-01-14 17:53:03 UTC)
* on 2015-03-21 at 10:21:04 UTC
* Modify at your own risk.
*/
package com.appspot.ad_meet.conference.model;
/**
* Model definition for ProfileForm.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the conference. For a detailed explanation see:
* <a href="http://code.google.com/p/google-http-java-client/wiki/JSON">http://code.google.com/p/google-http-java-client/wiki/JSON</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class ProfileForm extends com.google.api.client.json.GenericJson {
/**
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String ciudad;
/**
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String displayName;
/**
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String telefono;
/**
* @return value or {@code null} for none
*/
public java.lang.String getCiudad() {
return ciudad;
}
/**
* @param ciudad ciudad or {@code null} for none
*/
public ProfileForm setCiudad(java.lang.String ciudad) {
this.ciudad = ciudad;
return this;
}
/**
* @return value or {@code null} for none
*/
public java.lang.String getDisplayName() {
return displayName;
}
/**
* @param displayName displayName or {@code null} for none
*/
public ProfileForm setDisplayName(java.lang.String displayName) {
this.displayName = displayName;
return this;
}
/**
* @return value or {@code null} for none
*/
public java.lang.String getTelefono() {
return telefono;
}
/**
* @param telefono telefono or {@code null} for none
*/
public ProfileForm setTelefono(java.lang.String telefono) {
this.telefono = telefono;
return this;
}
@Override
public ProfileForm set(String fieldName, Object value) {
return (ProfileForm) super.set(fieldName, value);
}
@Override
public ProfileForm clone() {
return (ProfileForm) super.clone();
}
}
| [
"encaramorosb@gmail.com"
] | encaramorosb@gmail.com |
b35e76dfffcea6dfa5f7f96015d67998232fd252 | 252f6bdadfc0504eeca3158b4e0b91dec03d9c9e | /src/main/java/rest/RestRoot.java | d30d16b2e1060f6709d38eaa6b00cdea2a4e1a43 | [] | no_license | MartijnPol/S-JEA6a-Kwetter | a5947127e9fe6be8c6029e20aa1b9208af3f3536 | 23c2a6bc2efa7d7a07f2ab1111e6c6b58ce3412e | refs/heads/master | 2021-03-22T01:26:13.296833 | 2018-05-22T11:50:45 | 2018-05-22T11:50:45 | 122,201,393 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 215 | java | package rest;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
/**
* Created by Martijn van der Pol on 07-03-18
**/
@ApplicationPath("api")
public class RestRoot extends Application {
}
| [
"mvanderpol@mirabeau.nl"
] | mvanderpol@mirabeau.nl |
6b73122f2ef6cb553c947834d4a40fbfc899d70c | 5a17af9f62568b82ff7baa8eb1d9b5e50232269e | /src/main/java/Calculate/Calculator.java | 5a746a036171a311bbf1addf32b4aa640b0e1f24 | [] | no_license | Dmitriy85/JavaCourseOrlov | 925156a4d3c58ea985c48e8150245a81fe72f884 | 78cea66115713f22f67a0969d630ae42dfd14c8d | refs/heads/master | 2020-04-30T09:12:21.901756 | 2019-03-17T15:20:27 | 2019-03-17T15:20:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package Calculate;
public class Calculator {
public double calculate(double val1, double val2, String operator) throws Exception {
BinaryOperation operation = new OperationFactory().getOperationFor(operator);
if (operation == null) {
System.out.println("Неизвестный оператор " + operator);
return Double.NaN;
}
return operation.returnResultFor(val1, val2);
}
}
| [
"inizelnik@gmail.com"
] | inizelnik@gmail.com |
faba368412e773c3eb9527774b7fac077e8f0970 | 6ffd10e70bce67bc577b087cb58203b79c900239 | /ParkingLot/src/Bus.java | f457bf388db55ff1b831d9f59966e70f474a5d5b | [] | no_license | sarthakagarwal18/Parking-Lot-OOPs | a95fa051c37b23d8253f4832b1d5d696cd5c5db2 | 5cd2e913b0927a29024976e967818755551eb23b | refs/heads/master | 2020-05-21T02:03:42.809439 | 2019-05-11T17:59:37 | 2019-05-11T17:59:37 | 185,869,651 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,381 | java | import java.util.ArrayList;
import java.util.HashMap;
public class Bus extends Vehicle{
Bus(String busNumber, String busColor) {
super(busNumber, busColor);
setSpotsNeeded(4);
setVehicleType("Bus");
}
// Assumption: Vehicle will get a place on the floor it enters.
// The logic for finding nearest spot can easily be modified in case the above assumption is not taken to be true
public ArrayList<Integer> findNearestSpot(int entryFloor) {
ParkingLot parkingLot = new ParkingLot();
HashMap<Integer, ParkingSpot> spotMap = parkingLot.getSpotMap();
int numberoOfSpots = parkingLot.getNumberOfSpots();
int numberOfFloors = parkingLot.getNumberOfFloors();
int spotsOnFloor = (numberoOfSpots)/(numberOfFloors);
for (int spotId = spotsOnFloor*entryFloor + 1; spotId <= spotsOnFloor*(entryFloor+1)-3; spotId++) {
if (!spotMap.containsKey(spotId) && !spotMap.containsKey(spotId+1)
&& !spotMap.containsKey(spotId+2) && !spotMap.containsKey(spotId+3)) {
ArrayList<Integer> spotList = new ArrayList<>();
spotList.add(spotId);
spotList.add(spotId+1);
spotList.add(spotId+2);
spotList.add(spotId+3);
return spotList;
}
}
return null;
}
}
| [
"sarthak18696@gmail.com"
] | sarthak18696@gmail.com |
5ebf5336c813722737388552558478b03728566d | ed929e0efef7c21f2923ec968ef3e2b78862e9b5 | /src/org/jostein/employeepay/PaymentClassification.java | 8c3c5ea18c9b91f1df24292911f3db119d78b362 | [] | no_license | josteinzheng/AgileStudy | 15c0585d5aca809ac532802bab09b6a3c427f5b6 | b8c5b06465e7a51a2c3838d4bcdd29bf405d10cf | refs/heads/master | 2020-04-10T15:08:53.562312 | 2014-12-08T09:59:55 | 2014-12-08T09:59:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 83 | java | package org.jostein.employeepay;
public abstract class PaymentClassification {
}
| [
"zhengzhijie@renrendai.com"
] | zhengzhijie@renrendai.com |
20cda5e54d19c7c93fe8f8f164778cdbfd2f9d89 | d81b8829ebc2deea1acf4b41b39e8eda2734a952 | /input_output/src/test/java/ru/job4j/iotasks/InStreamServiceTest.java | d97e6c67c63db4b77e54d72ff835519654c77b38 | [
"Apache-2.0"
] | permissive | DmitriyShaplov/job4j | 6d8c4b505f0f6bd9f19d6e829370eb45492e73c7 | 46acbe6deb17ecfd00492533555f27e0df481d37 | refs/heads/master | 2022-12-04T14:51:37.185520 | 2021-02-01T21:41:00 | 2021-02-01T21:59:02 | 159,066,243 | 0 | 0 | Apache-2.0 | 2022-11-16T12:25:02 | 2018-11-25T19:23:23 | Java | UTF-8 | Java | false | false | 1,989 | java | package ru.job4j.iotasks;
import org.junit.Test;
import java.io.*;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.*;
/**
* @author shaplov
* @since 18.03.2019
*/
public class InStreamServiceTest {
@Test
public void whenInputStreamHasEvenNumberThenTrue() throws IOException {
InStreamService service = new InStreamService();
final boolean number = service.isNumber(new ByteArrayInputStream("1234567891234567890".getBytes()));
assertTrue(number);
}
@Test
public void whenInputStreamHasOddNumberThenFalse() throws IOException {
InStreamService service = new InStreamService();
final boolean number = service.isNumber(new ByteArrayInputStream("423456789123456789".getBytes()));
assertFalse(number);
}
@Test
public void whenInputStreamHasNotNumberThenFalse() throws IOException {
InStreamService service = new InStreamService();
final boolean number = service.isNumber(new ByteArrayInputStream("123мамамылараму7890".getBytes()));
assertFalse(number);
}
@Test
public void whenDropAbuseWordsFromStreamThenStreamWithoutIt() throws IOException {
InStreamService service = new InStreamService();
String[] abuse = {"нельзя", "прекратить", "завтрашний"};
OutputStream out = new ByteArrayOutputStream();
service.dropAbuses(new ByteArrayInputStream(("зачем говорить когда нельзя прекратить влеченный в завтрашний день"
+ System.lineSeparator()
+ "прекратить нельзя зачем").getBytes()),
out, abuse);
String result = out.toString();
String expect = "зачем говорить когда влеченный в день" + System.lineSeparator()
+ "зачем";
assertThat(result, is(expect));
}
} | [
"shaplovd@gmail.com"
] | shaplovd@gmail.com |
3381eb8fd20595beca145a3ab41198c646ed8c58 | 6e768aae8b77d3f9d89287abfcea69549d1ad224 | /persistence-modules/neo4j/src/test/java/com/baeldung/neo4j/Neo4jOgmLiveTest.java | aa9dd84ed6f80c9941dc32cd5518664fb5e780ae | [
"MIT"
] | permissive | press0/baeldung-tutorials | 6d06552f7208e336bbca76337449d621948257e6 | 8ffca600fcf7f62d7978e735ea495d33e2d22a81 | refs/heads/master | 2023-08-16T23:17:46.001847 | 2023-08-14T17:03:59 | 2023-08-14T17:03:59 | 52,390,032 | 5 | 9 | MIT | 2023-03-01T01:35:59 | 2016-02-23T20:40:02 | Java | UTF-8 | Java | false | false | 1,822 | java | package com.baeldung.neo4j;
import static com.baeldung.neo4j.TestContainersTestBase.getDriver;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.neo4j.ogm.model.Result;
import org.neo4j.ogm.session.Session;
import org.neo4j.ogm.session.SessionFactory;
import com.baeldung.neo4j.domain.Car;
import com.baeldung.neo4j.domain.Company;
/**
* To run this test you will need to have an instance of the docker running on your machine (Docker desktop - for Windows and Docker instance for linux)
* After your docker instance is up run this test
*/
public class Neo4jOgmLiveTest {
private static SessionFactory sessionFactory;
private static Session session;
@BeforeAll
public static void oneTimeSetUp() {
sessionFactory = new SessionFactory(getDriver(), "com.baeldung.neo4j.domain");
session = sessionFactory.openSession();
session.purgeDatabase();
}
@Test
void testOgm() {
Car tesla = new Car("tesla", "modelS");
Company baeldung = new Company("baeldung");
baeldung.setCar(tesla);
session.save(baeldung);
assertEquals(1, session.countEntitiesOfType(Company.class));
Map<String, String> params = new HashMap<>();
params.put("make", "tesla");
Result result = session.query("MATCH (car:Car) <-[:owns]- (company:Company)" +
" WHERE car.make=$make" +
" RETURN company", params);
Map<String, Object> firstResult = result.iterator().next();
assertEquals(1, firstResult.size());
Company actual = (Company) firstResult.get("company");
assertEquals(actual.getName(), baeldung.getName());
}
}
| [
"noreplay@yahoo.com"
] | noreplay@yahoo.com |
1412a5bd9c87ca297641c177022fcec236047604 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /newEvaluatedBugs/Jsoup_31_buggy/mutated/2607/HtmlTreeBuilderState.java | 0766809d651032b83b3afc567c2c5b070fba89a6 | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 68,490 | java | package org.jsoup.parser;
import org.jsoup.helper.DescendableLinkedList;
import org.jsoup.helper.StringUtil;
import org.jsoup.nodes.*;
import java.util.Iterator;
import java.util.LinkedList;
/**
* The Tree Builder's current state. Each state embodies the processing for the state, and transitions to other states.
*/
enum HtmlTreeBuilderState {
Initial {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
return true; // ignore whitespace
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype()) {
// todo: parse error check on expected doctypes
// todo: quirk state check on doctype ids
Token.Doctype d = t.asDoctype();
DocumentType doctype = new DocumentType(d.getName(), d.getPublicIdentifier(), d.getSystemIdentifier(), tb.getBaseUri());
tb.getDocument().appendChild(doctype);
if (d.isForceQuirks())
tb.getDocument().quirksMode(Document.QuirksMode.quirks);
tb.transition(BeforeHtml);
} else {
// todo: check not iframe srcdoc
tb.transition(BeforeHtml);
return tb.process(t); // re-process token
}
return true;
}
},
BeforeHtml {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (isWhitespace(t)) {
return true; // ignore whitespace
} else if (t.isStartTag() && t.asStartTag().name().equals("html")) {
tb.insert(t.asStartTag());
tb.transition(BeforeHead);
} else if (t.isEndTag() && (StringUtil.in(t.asEndTag().name(), "head", "body", "html", "br"))) {
return anythingElse(t, tb);
} else if (t.isEndTag()) {
tb.error(this);
return false;
} else {
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
tb.insert("html");
tb.transition(BeforeHead);
return tb.process(t);
}
},
BeforeHead {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
return true;
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isStartTag() && t.asStartTag().name().equals("html")) {
return InBody.process(t, tb); // does not transition
} else if (t.isStartTag() && t.asStartTag().name().equals("head")) {
Element head = tb.insert(t.asStartTag());
tb.setHeadElement(head);
tb.transition(InHead);
} else if (t.isEndTag() && (StringUtil.in(t.asEndTag().name(), "head", "body", "html", "br"))) {
tb.process(new Token.StartTag("head"));
return tb.process(t);
} else if (t.isEndTag()) {
tb.error(this);
return false;
} else {
tb.process(new Token.StartTag("head"));
return tb.process(t);
}
return true;
}
},
InHead {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
tb.insert(t.asCharacter());
return true;
}
switch (t.type) {
case Comment:
tb.insert(t.asComment());
break;
case Doctype:
tb.error(this);
return false;
case StartTag:
Token.StartTag start = t.asStartTag();
String name = start.name();
if (name.equals("html")) {
return InBody.process(t, tb);
} else if (StringUtil.in(name, "base", "basefont", "bgsound", "command", "link")) {
Element el = tb.insertEmpty(start);
// jsoup special: update base the frist time it is seen
if (name.equals("base") && el.hasAttr("href"))
tb.maybeSetBaseUri(el);
} else if (name.equals("meta")) {
Element meta = tb.insertEmpty(start);
// todo: charset switches
} else if (name.equals("title")) {
handleRcData(start, tb);
} else if (StringUtil.in(name, "noframes", "style")) {
handleRawtext(start, tb);
} else if (name.equals("noscript")) {
// else if noscript && scripting flag = true: rawtext (jsoup doesn't run script, to handle as noscript)
tb.insert(start);
tb.transition(InHeadNoscript);
} else if (name.equals("script")) {
// skips some script rules as won't execute them
tb.tokeniser.transition(TokeniserState.ScriptData);
tb.markInsertionMode();
tb.transition(Text);
tb.insert(start);
} else if (name.equals("head")) {
tb.error(this);
return false;
} else {
return anythingElse(t, tb);
}
break;
case EndTag:
Token.EndTag end = t.asEndTag();
name = end.name();
if (name.equals("head")) {
tb.pop();
tb.transition(AfterHead);
} else if (StringUtil.in(name, "body", "html", "br")) {
return anythingElse(t, tb);
} else {
tb.error(this);
return false;
}
break;
default:
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, TreeBuilder tb) {
tb.process(new Token.EndTag("head"));
return tb.process(t);
}
},
InHeadNoscript {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isDoctype()) {
tb.error(this);
} else if (t.isStartTag() && t.asStartTag().name().equals("html")) {
return tb.process(t, InBody);
} else if (t.isEndTag() && t.asEndTag().name().equals("noscript")) {
tb.pop();
tb.transition(InHead);
} else if (isWhitespace(t) || t.isComment() || (t.isStartTag() && StringUtil.in(t.asStartTag().name(),
"basefont", "bgsound", "link", "meta", "noframes", "style"))) {
return tb.process(t, InHead);
} else if (t.isEndTag() && t.asEndTag().name().equals("br")) {
return anythingElse(t, tb);
} else if ((t.isStartTag() && StringUtil.in(t.asStartTag().name(), "head", "noscript")) || t.isEndTag()) {
tb.error(this);
return false;
} else {
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
tb.error(this);
tb.process(new Token.EndTag("noscript"));
return tb.process(t);
}
},
AfterHead {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
tb.insert(t.asCharacter());
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype()) {
tb.error(this);
} else if (t.isStartTag()) {
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (name.equals("html")) {
return tb.process(t, InBody);
} else if (name.equals("body")) {
tb.insert(startTag);
tb.framesetOk(false);
tb.transition(InBody);
} else if (name.equals("frameset")) {
tb.insert(startTag);
tb.transition(InFrameset);
} else if (StringUtil.in(name, "base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "title")) {
tb.error(this);
Element head = tb.getHeadElement();
tb.push(head);
tb.process(t, InHead);
tb.removeFromStack(head);
} else if (name.equals("head")) {
tb.error(this);
return false;
} else {
anythingElse(t, tb);
}
} else if (t.isEndTag()) {
if (StringUtil.in(t.asEndTag().name(), "body", "html")) {
anythingElse(t, tb);
} else {
tb.error(this);
return false;
}
} else {
anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
tb.process(new Token.StartTag("body"));
tb.framesetOk(true);
return tb.process(t);
}
},
InBody {
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case Character: {
Token.Character c = t.asCharacter();
if (c.getData().equals(nullString)) {
// todo confirm that check
tb.error(this);
return false;
} else if (isWhitespace(c)) {
tb.reconstructFormattingElements();
tb.insert(c);
} else {
tb.reconstructFormattingElements();
tb.insert(c);
tb.framesetOk(false);
}
break;
}
case Comment: {
tb.insert(t.asComment());
break;
}
case Doctype: {
tb.error(this);
return false;
}
case StartTag:
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (name.equals("html")) {
tb.error(this);
// merge attributes onto real html
Element html = tb.getStack().getFirst();
for (Attribute attribute : startTag.getAttributes()) {
if (!html.hasAttr(attribute.getKey()))
html.attributes().put(attribute);
}
} else if (StringUtil.in(name, "base", "basefont", "bgsound", "command", "link", "meta", "noframes", "script", "style", "title")) {
return tb.process(t, InHead);
} else if (name.equals("body")) {
tb.error(this);
LinkedList<Element> stack = tb.getStack();
if (stack.size() == 1 || (stack.size() > 2 && !stack.get(1).nodeName().equals("body"))) {
// only in fragment case
return false; // ignore
} else {
tb.framesetOk(false);
Element body = stack.get(1);
for (Attribute attribute : startTag.getAttributes()) {
if (!body.hasAttr(attribute.getKey()))
body.attributes().put(attribute);
}
}
} else if (name.equals("frameset")) {
tb.error(this);
LinkedList<Element> stack = tb.getStack();
if (stack.size() == 1 || (stack.size() > 2 && !stack.get(1).nodeName().equals("body"))) {
// only in fragment case
return false; // ignore
} else if (!tb.framesetOk()) {
return false; // ignore frameset
} else {
Element second = stack.get(1);
if (second.parent() != null)
second.remove();
// pop up to html element
while (stack.size() > 1)
stack.removeLast();
tb.insert(startTag);
tb.transition(InFrameset);
}
} else if (StringUtil.in(name,
"address", "article", "aside", "blockquote", "center", "details", "dir", "div", "dl",
"fieldset", "figcaption", "figure", "footer", "header", "hgroup", "menu", "nav", "ol",
"p", "section", "summary", "ul")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
} else if (StringUtil.in(name, "h1", "h2", "h3", "h4", "h5", "h6")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
if (StringUtil.in(tb.currentElement().nodeName(), "h1", "h2", "h3", "h4", "h5", "h6")) {
tb.error(this);
tb.pop();
}
tb.insert(startTag);
} else if (StringUtil.in(name, "pre", "listing")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
// todo: ignore LF if next token
tb.framesetOk(false);
} else if (name.equals("form")) {
if (tb.getFormElement() != null) {
tb.error(this);
return false;
}
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insertForm(startTag, true);
} else if (name.equals("li")) {
tb.framesetOk(false);
LinkedList<Element> stack = tb.getStack();
for (int i = stack.size() - 1; i > 0; i--) {
Element el = stack.get(i);
if (el.nodeName().equals("li")) {
tb.process(new Token.EndTag("li"));
break;
}
if (tb.isSpecial(el) && !StringUtil.in(el.nodeName(), "address", "div", "p"))
break;
}
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
} else if (StringUtil.in(name, "dd", "dt")) {
tb.framesetOk(false);
LinkedList<Element> stack = tb.getStack();
for (int i = stack.size() - 1; i > 0; i--) {
Element el = stack.get(i);
if (StringUtil.in(el.nodeName(), "dd", "dt")) {
tb.process(new Token.EndTag(el.nodeName()));
break;
}
if (tb.isSpecial(el) && !StringUtil.in(el.nodeName(), "address", "div", "p"))
break;
}
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
} else if (name.equals("plaintext")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
tb.tokeniser.transition(TokeniserState.PLAINTEXT); // once in, never gets out
} else if (name.equals("button")) {
if (tb.inButtonScope("button")) {
// close and reprocess
tb.error(this);
tb.process(new Token.EndTag("button"));
tb.process(startTag);
} else {
tb.reconstructFormattingElements();
tb.insert(startTag);
tb.framesetOk(false);
}
} else if ("button".equals("a")) {
if (tb.getActiveFormattingElement("a") != null) {
tb.error(this);
tb.process(new Token.EndTag("a"));
// still on stack?
Element remainingA = tb.getFromStack("a");
if (remainingA != null) {
tb.removeFromActiveFormattingElements(remainingA);
tb.removeFromStack(remainingA);
}
}
tb.reconstructFormattingElements();
Element a = tb.insert(startTag);
tb.pushActiveFormattingElements(a);
} else if (StringUtil.in(name,
"b", "big", "code", "em", "font", "i", "s", "small", "strike", "strong", "tt", "u")) {
tb.reconstructFormattingElements();
Element el = tb.insert(startTag);
tb.pushActiveFormattingElements(el);
} else if (name.equals("nobr")) {
tb.reconstructFormattingElements();
if (tb.inScope("nobr")) {
tb.error(this);
tb.process(new Token.EndTag("nobr"));
tb.reconstructFormattingElements();
}
Element el = tb.insert(startTag);
tb.pushActiveFormattingElements(el);
} else if (StringUtil.in(name, "applet", "marquee", "object")) {
tb.reconstructFormattingElements();
tb.insert(startTag);
tb.insertMarkerToFormattingElements();
tb.framesetOk(false);
} else if (name.equals("table")) {
if (tb.getDocument().quirksMode() != Document.QuirksMode.quirks && tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
tb.framesetOk(false);
tb.transition(InTable);
} else if (StringUtil.in(name, "area", "br", "embed", "img", "keygen", "wbr")) {
tb.reconstructFormattingElements();
tb.insertEmpty(startTag);
tb.framesetOk(false);
} else if (name.equals("input")) {
tb.reconstructFormattingElements();
Element el = tb.insertEmpty(startTag);
if (!el.attr("type").equalsIgnoreCase("hidden"))
tb.framesetOk(false);
} else if (StringUtil.in(name, "param", "source", "track")) {
tb.insertEmpty(startTag);
} else if (name.equals("hr")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insertEmpty(startTag);
tb.framesetOk(false);
} else if (name.equals("image")) {
// we're not supposed to ask.
startTag.name("img");
return tb.process(startTag);
} else if (name.equals("isindex")) {
// how much do we care about the early 90s?
tb.error(this);
if (tb.getFormElement() != null)
return false;
tb.tokeniser.acknowledgeSelfClosingFlag();
tb.process(new Token.StartTag("form"));
if (startTag.attributes.hasKey("action")) {
Element form = tb.getFormElement();
form.attr("action", startTag.attributes.get("action"));
}
tb.process(new Token.StartTag("hr"));
tb.process(new Token.StartTag("label"));
// hope you like english.
String prompt = startTag.attributes.hasKey("prompt") ?
startTag.attributes.get("prompt") :
"This is a searchable index. Enter search keywords: ";
tb.process(new Token.Character(prompt));
// input
Attributes inputAttribs = new Attributes();
for (Attribute attr : startTag.attributes) {
if (!StringUtil.in(attr.getKey(), "name", "action", "prompt"))
inputAttribs.put(attr);
}
inputAttribs.put("name", "isindex");
tb.process(new Token.StartTag("input", inputAttribs));
tb.process(new Token.EndTag("label"));
tb.process(new Token.StartTag("hr"));
tb.process(new Token.EndTag("form"));
} else if (name.equals("textarea")) {
tb.insert(startTag);
// todo: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move on to the next one. (Newlines at the start of textarea elements are ignored as an authoring convenience.)
tb.tokeniser.transition(TokeniserState.Rcdata);
tb.markInsertionMode();
tb.framesetOk(false);
tb.transition(Text);
} else if (name.equals("xmp")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.reconstructFormattingElements();
tb.framesetOk(false);
handleRawtext(startTag, tb);
} else if (name.equals("iframe")) {
tb.framesetOk(false);
handleRawtext(startTag, tb);
} else if (name.equals("noembed")) {
// also handle noscript if script enabled
handleRawtext(startTag, tb);
} else if (name.equals("select")) {
tb.reconstructFormattingElements();
tb.insert(startTag);
tb.framesetOk(false);
HtmlTreeBuilderState state = tb.state();
if (state.equals(InTable) || state.equals(InCaption) || state.equals(InTableBody) || state.equals(InRow) || state.equals(InCell))
tb.transition(InSelectInTable);
else
tb.transition(InSelect);
} else if (StringUtil.in("optgroup", "option")) {
if (tb.currentElement().nodeName().equals("option"))
tb.process(new Token.EndTag("option"));
tb.reconstructFormattingElements();
tb.insert(startTag);
} else if (StringUtil.in("rp", "rt")) {
if (tb.inScope("ruby")) {
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals("ruby")) {
tb.error(this);
tb.popStackToBefore("ruby"); // i.e. close up to but not include name
}
tb.insert(startTag);
}
} else if (name.equals("math")) {
tb.reconstructFormattingElements();
// todo: handle A start tag whose tag name is "math" (i.e. foreign, mathml)
tb.insert(startTag);
tb.tokeniser.acknowledgeSelfClosingFlag();
} else if (name.equals("svg")) {
tb.reconstructFormattingElements();
// todo: handle A start tag whose tag name is "svg" (xlink, svg)
tb.insert(startTag);
tb.tokeniser.acknowledgeSelfClosingFlag();
} else if (StringUtil.in(name,
"caption", "col", "colgroup", "frame", "head", "tbody", "td", "tfoot", "th", "thead", "tr")) {
tb.error(this);
return false;
} else {
tb.reconstructFormattingElements();
tb.insert(startTag);
}
break;
case EndTag:
Token.EndTag endTag = t.asEndTag();
name = endTag.name();
if (name.equals("body")) {
if (!tb.inScope("body")) {
tb.error(this);
return false;
} else {
// todo: error if stack contains something not dd, dt, li, optgroup, option, p, rp, rt, tbody, td, tfoot, th, thead, tr, body, html
tb.transition(AfterBody);
}
} else if (name.equals("html")) {
boolean notIgnored = tb.process(new Token.EndTag("body"));
if (notIgnored)
return tb.process(endTag);
} else if (StringUtil.in(name,
"address", "article", "aside", "blockquote", "button", "center", "details", "dir", "div",
"dl", "fieldset", "figcaption", "figure", "footer", "header", "hgroup", "listing", "menu",
"nav", "ol", "pre", "section", "summary", "ul")) {
// todo: refactor these lookups
if (!tb.inScope(name)) {
// nothing to close
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
}
} else if (name.equals("form")) {
Element currentForm = tb.getFormElement();
tb.setFormElement(null);
if (currentForm == null || !tb.inScope(name)) {
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
// remove currentForm from stack. will shift anything under up.
tb.removeFromStack(currentForm);
}
} else if (name.equals("p")) {
if (!tb.inButtonScope(name)) {
tb.error(this);
tb.process(new Token.StartTag(name)); // if no p to close, creates an empty <p></p>
return tb.process(endTag);
} else {
tb.generateImpliedEndTags(name);
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
}
} else if (name.equals("li")) {
if (!tb.inListItemScope(name)) {
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags(name);
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
}
} else if (StringUtil.in(name, "dd", "dt")) {
if (!tb.inScope(name)) {
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags(name);
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
}
} else if (StringUtil.in(name, "h1", "h2", "h3", "h4", "h5", "h6")) {
if (!tb.inScope(new String[]{"h1", "h2", "h3", "h4", "h5", "h6"})) {
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags(name);
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose("h1", "h2", "h3", "h4", "h5", "h6");
}
} else if (name.equals("sarcasm")) {
// *sigh*
return anyOtherEndTag(t, tb);
} else if (StringUtil.in(name,
"a", "b", "big", "code", "em", "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u")) {
// Adoption Agency Algorithm.
OUTER:
for (int i = 0; i < 8; i++) {
Element formatEl = tb.getActiveFormattingElement(name);
if (formatEl == null)
return anyOtherEndTag(t, tb);
else if (!tb.onStack(formatEl)) {
tb.error(this);
tb.removeFromActiveFormattingElements(formatEl);
return true;
} else if (!tb.inScope(formatEl.nodeName())) {
tb.error(this);
return false;
} else if (tb.currentElement() != formatEl)
tb.error(this);
Element furthestBlock = null;
Element commonAncestor = null;
boolean seenFormattingElement = false;
LinkedList<Element> stack = tb.getStack();
// the spec doesn't limit to < 64, but in degenerate cases (9000+ stack depth) this prevents
// run-aways
for (int si = 0; si < stack.size() && si < 64; si++) {
Element el = stack.get(si);
if (el == formatEl) {
commonAncestor = stack.get(si - 1);
seenFormattingElement = true;
} else if (seenFormattingElement && tb.isSpecial(el)) {
furthestBlock = el;
break;
}
}
if (furthestBlock == null) {
tb.popStackToClose(formatEl.nodeName());
tb.removeFromActiveFormattingElements(formatEl);
return true;
}
// todo: Let a bookmark note the position of the formatting element in the list of active formatting elements relative to the elements on either side of it in the list.
// does that mean: int pos of format el in list?
Element node = furthestBlock;
Element lastNode = furthestBlock;
INNER:
for (int j = 0; j < 3; j++) {
if (tb.onStack(node))
node = tb.aboveOnStack(node);
if (!tb.isInActiveFormattingElements(node)) { // note no bookmark check
tb.removeFromStack(node);
continue INNER;
} else if (node == formatEl)
break INNER;
Element replacement = new Element(Tag.valueOf(node.nodeName()), tb.getBaseUri());
tb.replaceActiveFormattingElement(node, replacement);
tb.replaceOnStack(node, replacement);
node = replacement;
if (lastNode == furthestBlock) {
// todo: move the aforementioned bookmark to be immediately after the new node in the list of active formatting elements.
// not getting how this bookmark both straddles the element above, but is inbetween here...
}
if (lastNode.parent() != null)
lastNode.remove();
node.appendChild(lastNode);
lastNode = node;
}
if (StringUtil.in(commonAncestor.nodeName(), "table", "tbody", "tfoot", "thead", "tr")) {
if (lastNode.parent() != null)
lastNode.remove();
tb.insertInFosterParent(lastNode);
} else {
if (lastNode.parent() != null)
lastNode.remove();
commonAncestor.appendChild(lastNode);
}
Element adopter = new Element(Tag.valueOf(name), tb.getBaseUri());
Node[] childNodes = furthestBlock.childNodes().toArray(new Node[furthestBlock.childNodeSize()]);
for (Node childNode : childNodes) {
adopter.appendChild(childNode); // append will reparent. thus the clone to avoid concurrent mod.
}
furthestBlock.appendChild(adopter);
tb.removeFromActiveFormattingElements(formatEl);
// todo: insert the new element into the list of active formatting elements at the position of the aforementioned bookmark.
tb.removeFromStack(formatEl);
tb.insertOnStackAfter(furthestBlock, adopter);
}
} else if (StringUtil.in(name, "applet", "marquee", "object")) {
if (!tb.inScope("name")) {
if (!tb.inScope(name)) {
tb.error(this);
return false;
}
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
tb.clearFormattingElementsToLastMarker();
}
} else if (name.equals("br")) {
tb.error(this);
tb.process(new Token.StartTag("br"));
return false;
} else {
return anyOtherEndTag(t, tb);
}
break;
case EOF:
// todo: error if stack contains something not dd, dt, li, p, tbody, td, tfoot, th, thead, tr, body, html
// stop parsing
break;
}
return true;
}
boolean anyOtherEndTag(Token t, HtmlTreeBuilder tb) {
String name = t.asEndTag().name();
DescendableLinkedList<Element> stack = tb.getStack();
Iterator<Element> it = stack.descendingIterator();
while (it.hasNext()) {
Element node = it.next();
if (node.nodeName().equals(name)) {
tb.generateImpliedEndTags(name);
if (!name.equals(tb.currentElement().nodeName()))
tb.error(this);
tb.popStackToClose(name);
break;
} else {
if (tb.isSpecial(node)) {
tb.error(this);
return false;
}
}
}
return true;
}
},
Text {
// in script, style etc. normally treated as data tags
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isCharacter()) {
tb.insert(t.asCharacter());
} else if (t.isEOF()) {
tb.error(this);
// if current node is script: already started
tb.pop();
tb.transition(tb.originalState());
return tb.process(t);
} else if (t.isEndTag()) {
// if: An end tag whose tag name is "script" -- scripting nesting level, if evaluating scripts
tb.pop();
tb.transition(tb.originalState());
}
return true;
}
},
InTable {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isCharacter()) {
tb.newPendingTableCharacters();
tb.markInsertionMode();
tb.transition(InTableText);
return tb.process(t);
} else if (t.isComment()) {
tb.insert(t.asComment());
return true;
} else if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isStartTag()) {
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (name.equals("caption")) {
tb.clearStackToTableContext();
tb.insertMarkerToFormattingElements();
tb.insert(startTag);
tb.transition(InCaption);
} else if (name.equals("colgroup")) {
tb.clearStackToTableContext();
tb.insert(startTag);
tb.transition(InColumnGroup);
} else if (name.equals("col")) {
tb.process(new Token.StartTag("colgroup"));
return tb.process(t);
} else if (StringUtil.in(name, "tbody", "tfoot", "thead")) {
tb.clearStackToTableContext();
tb.insert(startTag);
tb.transition(InTableBody);
} else if (StringUtil.in(name, "td", "th", "tr")) {
tb.process(new Token.StartTag("tbody"));
return tb.process(t);
} else if (name.equals("table")) {
tb.error(this);
boolean processed = tb.process(new Token.EndTag("table"));
if (processed) // only ignored if in fragment
return tb.process(t);
} else if (StringUtil.in(name, "style", "script")) {
return tb.process(t, InHead);
} else if (name.equals("input")) {
if (!startTag.attributes.get("type").equalsIgnoreCase("hidden")) {
return anythingElse(t, tb);
} else {
tb.insertEmpty(startTag);
}
} else if (name.equals("form")) {
tb.error(this);
if (tb.getFormElement() != null)
return false;
else {
tb.insertForm(startTag, false);
}
} else {
return anythingElse(t, tb);
}
return true; // todo: check if should return processed http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#parsing-main-intable
} else if (t.isEndTag()) {
Token.EndTag endTag = t.asEndTag();
String name = endTag.name();
if (name.equals("table")) {
if (!tb.inTableScope(name)) {
tb.error(this);
return false;
} else {
tb.popStackToClose("table");
}
tb.resetInsertionMode();
} else if (StringUtil.in(name,
"body", "caption", "col", "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr")) {
tb.error(this);
return false;
} else {
return anythingElse(t, tb);
}
return true; // todo: as above todo
} else if (t.isEOF()) {
if (tb.currentElement().nodeName().equals("html"))
tb.error(this);
return true; // stops parsing
}
return anythingElse(t, tb);
}
boolean anythingElse(Token t, HtmlTreeBuilder tb) {
tb.error(this);
boolean processed = true;
if (StringUtil.in(tb.currentElement().nodeName(), "table", "tbody", "tfoot", "thead", "tr")) {
tb.setFosterInserts(true);
processed = tb.process(t, InBody);
tb.setFosterInserts(false);
} else {
processed = tb.process(t, InBody);
}
return processed;
}
},
InTableText {
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case Character:
Token.Character c = t.asCharacter();
if (c.getData().equals(nullString)) {
tb.error(this);
return false;
} else {
tb.getPendingTableCharacters().add(c);
}
break;
default:
if (tb.getPendingTableCharacters().size() > 0) {
for (Token.Character character : tb.getPendingTableCharacters()) {
if (!isWhitespace(character)) {
// InTable anything else section:
tb.error(this);
if (StringUtil.in(tb.currentElement().nodeName(), "table", "tbody", "tfoot", "thead", "tr")) {
tb.setFosterInserts(true);
tb.process(character, InBody);
tb.setFosterInserts(false);
} else {
tb.process(character, InBody);
}
} else
tb.insert(character);
}
tb.newPendingTableCharacters();
}
tb.transition(tb.originalState());
return tb.process(t);
}
return true;
}
},
InCaption {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isEndTag() && t.asEndTag().name().equals("caption")) {
Token.EndTag endTag = t.asEndTag();
String name = endTag.name();
if (!tb.inTableScope(name)) {
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals("caption"))
tb.error(this);
tb.popStackToClose("caption");
tb.clearFormattingElementsToLastMarker();
tb.transition(InTable);
}
} else if ((
t.isStartTag() && StringUtil.in(t.asStartTag().name(),
"caption", "col", "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr") ||
t.isEndTag() && t.asEndTag().name().equals("table"))
) {
tb.error(this);
boolean processed = tb.process(new Token.EndTag("caption"));
if (processed)
return tb.process(t);
} else if (t.isEndTag() && StringUtil.in(t.asEndTag().name(),
"body", "col", "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr")) {
tb.error(this);
return false;
} else {
return tb.process(t, InBody);
}
return true;
}
},
InColumnGroup {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
tb.insert(t.asCharacter());
return true;
}
switch (t.type) {
case Comment:
tb.insert(t.asComment());
break;
case Doctype:
tb.error(this);
break;
case StartTag:
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (name.equals("html"))
return tb.process(t, InBody);
else if (name.equals("col"))
tb.insertEmpty(startTag);
else
return anythingElse(t, tb);
break;
case EndTag:
Token.EndTag endTag = t.asEndTag();
name = endTag.name();
if (name.equals("colgroup")) {
if (tb.currentElement().nodeName().equals("html")) { // frag case
tb.error(this);
return false;
} else {
tb.pop();
tb.transition(InTable);
}
} else
return anythingElse(t, tb);
break;
case EOF:
if (tb.currentElement().nodeName().equals("html"))
return true; // stop parsing; frag case
else
return anythingElse(t, tb);
default:
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, TreeBuilder tb) {
boolean processed = tb.process(new Token.EndTag("colgroup"));
if (processed) // only ignored in frag case
return tb.process(t);
return true;
}
},
InTableBody {
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case StartTag:
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (name.equals("tr")) {
tb.clearStackToTableBodyContext();
tb.insert(startTag);
tb.transition(InRow);
} else if (StringUtil.in(name, "th", "td")) {
tb.error(this);
tb.process(new Token.StartTag("tr"));
return tb.process(startTag);
} else if (StringUtil.in(name, "caption", "col", "colgroup", "tbody", "tfoot", "thead")) {
return exitTableBody(t, tb);
} else
return anythingElse(t, tb);
break;
case EndTag:
Token.EndTag endTag = t.asEndTag();
name = endTag.name();
if (StringUtil.in(name, "tbody", "tfoot", "thead")) {
if (!tb.inTableScope(name)) {
tb.error(this);
return false;
} else {
tb.clearStackToTableBodyContext();
tb.pop();
tb.transition(InTable);
}
} else if (name.equals("table")) {
return exitTableBody(t, tb);
} else if (StringUtil.in(name, "body", "caption", "col", "colgroup", "html", "td", "th", "tr")) {
tb.error(this);
return false;
} else
return anythingElse(t, tb);
break;
default:
return anythingElse(t, tb);
}
return true;
}
private boolean exitTableBody(Token t, HtmlTreeBuilder tb) {
if (!(tb.inTableScope("tbody") || tb.inTableScope("thead") || tb.inScope("tfoot"))) {
// frag case
tb.error(this);
return false;
}
tb.clearStackToTableBodyContext();
tb.process(new Token.EndTag(tb.currentElement().nodeName())); // tbody, tfoot, thead
return tb.process(t);
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
return tb.process(t, InTable);
}
},
InRow {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isStartTag()) {
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (StringUtil.in(name, "th", "td")) {
tb.clearStackToTableRowContext();
tb.insert(startTag);
tb.transition(InCell);
tb.insertMarkerToFormattingElements();
} else if (StringUtil.in(name, "caption", "col", "colgroup", "tbody", "tfoot", "thead", "tr")) {
return handleMissingTr(t, tb);
} else {
return anythingElse(t, tb);
}
} else if (t.isEndTag()) {
Token.EndTag endTag = t.asEndTag();
String name = endTag.name();
if (name.equals("tr")) {
if (!tb.inTableScope(name)) {
tb.error(this); // frag
return false;
}
tb.clearStackToTableRowContext();
tb.pop(); // tr
tb.transition(InTableBody);
} else if (name.equals("table")) {
return handleMissingTr(t, tb);
} else if (StringUtil.in(name, "tbody", "tfoot", "thead")) {
if (!tb.inTableScope(name)) {
tb.error(this);
return false;
}
tb.process(new Token.EndTag("tr"));
return tb.process(t);
} else if (StringUtil.in(name, "body", "caption", "col", "colgroup", "html", "td", "th")) {
tb.error(this);
return false;
} else {
return anythingElse(t, tb);
}
} else {
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
return tb.process(t, InTable);
}
private boolean handleMissingTr(Token t, TreeBuilder tb) {
boolean processed = tb.process(new Token.EndTag("tr"));
if (processed)
return tb.process(t);
else
return false;
}
},
InCell {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isEndTag()) {
Token.EndTag endTag = t.asEndTag();
String name = endTag.name();
if (StringUtil.in(name, "td", "th")) {
if (!tb.inTableScope(name)) {
tb.error(this);
tb.transition(InRow); // might not be in scope if empty: <td /> and processing fake end tag
return false;
}
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
tb.clearFormattingElementsToLastMarker();
tb.transition(InRow);
} else if (StringUtil.in(name, "body", "caption", "col", "colgroup", "html")) {
tb.error(this);
return false;
} else if (StringUtil.in(name, "table", "tbody", "tfoot", "thead", "tr")) {
if (!tb.inTableScope(name)) {
tb.error(this);
return false;
}
closeCell(tb);
return tb.process(t);
} else {
return anythingElse(t, tb);
}
} else if (t.isStartTag() &&
StringUtil.in(t.asStartTag().name(),
"caption", "col", "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr")) {
if (!(tb.inTableScope("td") || tb.inTableScope("th"))) {
tb.error(this);
return false;
}
closeCell(tb);
return tb.process(t);
} else {
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
return tb.process(t, InBody);
}
private void closeCell(HtmlTreeBuilder tb) {
if (tb.inTableScope("td"))
tb.process(new Token.EndTag("td"));
else
tb.process(new Token.EndTag("th")); // only here if th or td in scope
}
},
InSelect {
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case Character:
Token.Character c = t.asCharacter();
if (c.getData().equals(nullString)) {
tb.error(this);
return false;
} else {
tb.insert(c);
}
break;
case Comment:
tb.insert(t.asComment());
break;
case Doctype:
tb.error(this);
return false;
case StartTag:
Token.StartTag start = t.asStartTag();
String name = start.name();
if (name.equals("html"))
return tb.process(start, InBody);
else if (name.equals("option")) {
tb.process(new Token.EndTag("option"));
tb.insert(start);
} else if (name.equals("optgroup")) {
if (tb.currentElement().nodeName().equals("option"))
tb.process(new Token.EndTag("option"));
else if (tb.currentElement().nodeName().equals("optgroup"))
tb.process(new Token.EndTag("optgroup"));
tb.insert(start);
} else if (name.equals("select")) {
tb.error(this);
return tb.process(new Token.EndTag("select"));
} else if (StringUtil.in(name, "input", "keygen", "textarea")) {
tb.error(this);
if (!tb.inSelectScope("select"))
return false; // frag
tb.process(new Token.EndTag("select"));
return tb.process(start);
} else if (name.equals("script")) {
return tb.process(t, InHead);
} else {
return anythingElse(t, tb);
}
break;
case EndTag:
Token.EndTag end = t.asEndTag();
name = end.name();
if (name.equals("optgroup")) {
if (tb.currentElement().nodeName().equals("option") && tb.aboveOnStack(tb.currentElement()) != null && tb.aboveOnStack(tb.currentElement()).nodeName().equals("optgroup"))
tb.process(new Token.EndTag("option"));
if (tb.currentElement().nodeName().equals("optgroup"))
tb.pop();
else
tb.error(this);
} else if (name.equals("option")) {
if (tb.currentElement().nodeName().equals("option"))
tb.pop();
else
tb.error(this);
} else if (name.equals("select")) {
if (!tb.inSelectScope(name)) {
tb.error(this);
return false;
} else {
tb.popStackToClose(name);
tb.resetInsertionMode();
}
} else
return anythingElse(t, tb);
break;
case EOF:
if (!tb.currentElement().nodeName().equals("html"))
tb.error(this);
break;
default:
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
tb.error(this);
return false;
}
},
InSelectInTable {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isStartTag() && StringUtil.in(t.asStartTag().name(), "caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th")) {
tb.error(this);
tb.process(new Token.EndTag("select"));
return tb.process(t);
} else if (t.isEndTag() && StringUtil.in(t.asEndTag().name(), "caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th")) {
tb.error(this);
if (tb.inTableScope(t.asEndTag().name())) {
tb.process(new Token.EndTag("select"));
return (tb.process(t));
} else
return false;
} else {
return tb.process(t, InSelect);
}
}
},
AfterBody {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
return tb.process(t, InBody);
} else if (t.isComment()) {
tb.insert(t.asComment()); // into html node
} else if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isStartTag() && t.asStartTag().name().equals("html")) {
return tb.process(t, InBody);
} else if (t.isEndTag() && t.asEndTag().name().equals("html")) {
if (tb.isFragmentParsing()) {
tb.error(this);
return false;
} else {
tb.transition(AfterAfterBody);
}
} else if (t.isEOF()) {
// chillax! we're done
} else {
tb.error(this);
tb.transition(InBody);
return tb.process(t);
}
return true;
}
},
InFrameset {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
tb.insert(t.asCharacter());
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isStartTag()) {
Token.StartTag start = t.asStartTag();
String name = start.name();
if (name.equals("html")) {
return tb.process(start, InBody);
} else if (name.equals("frameset")) {
tb.insert(start);
} else if (name.equals("frame")) {
tb.insertEmpty(start);
} else if (name.equals("noframes")) {
return tb.process(start, InHead);
} else {
tb.error(this);
return false;
}
} else if (t.isEndTag() && t.asEndTag().name().equals("frameset")) {
if (tb.currentElement().nodeName().equals("html")) { // frag
tb.error(this);
return false;
} else {
tb.pop();
if (!tb.isFragmentParsing() && !tb.currentElement().nodeName().equals("frameset")) {
tb.transition(AfterFrameset);
}
}
} else if (t.isEOF()) {
if (!tb.currentElement().nodeName().equals("html")) {
tb.error(this);
return true;
}
} else {
tb.error(this);
return false;
}
return true;
}
},
AfterFrameset {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
tb.insert(t.asCharacter());
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isStartTag() && t.asStartTag().name().equals("html")) {
return tb.process(t, InBody);
} else if (t.isEndTag() && t.asEndTag().name().equals("html")) {
tb.transition(AfterAfterFrameset);
} else if (t.isStartTag() && t.asStartTag().name().equals("noframes")) {
return tb.process(t, InHead);
} else if (t.isEOF()) {
// cool your heels, we're complete
} else {
tb.error(this);
return false;
}
return true;
}
},
AfterAfterBody {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype() || isWhitespace(t) || (t.isStartTag() && t.asStartTag().name().equals("html"))) {
return tb.process(t, InBody);
} else if (t.isEOF()) {
// nice work chuck
} else {
tb.error(this);
tb.transition(InBody);
return tb.process(t);
}
return true;
}
},
AfterAfterFrameset {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype() || isWhitespace(t) || (t.isStartTag() && t.asStartTag().name().equals("html"))) {
return tb.process(t, InBody);
} else if (t.isEOF()) {
// nice work chuck
} else if (t.isStartTag() && t.asStartTag().name().equals("noframes")) {
return tb.process(t, InHead);
} else {
tb.error(this);
return false;
}
return true;
}
},
ForeignContent {
boolean process(Token t, HtmlTreeBuilder tb) {
return true;
// todo: implement. Also; how do we get here?
}
};
private static String nullString = String.valueOf('\u0000');
abstract boolean process(Token t, HtmlTreeBuilder tb);
private static boolean isWhitespace(Token t) {
if (t.isCharacter()) {
String data = t.asCharacter().getData();
// todo: this checks more than spec - "\t", "\n", "\f", "\r", " "
for (int i = 0; i < data.length(); i++) {
char c = data.charAt(i);
if (!StringUtil.isWhitespace(c))
return false;
}
return true;
}
return false;
}
private static void handleRcData(Token.StartTag startTag, HtmlTreeBuilder tb) {
tb.insert(startTag);
tb.tokeniser.transition(TokeniserState.Rcdata);
tb.markInsertionMode();
tb.transition(Text);
}
private static void handleRawtext(Token.StartTag startTag, HtmlTreeBuilder tb) {
tb.insert(startTag);
tb.tokeniser.transition(TokeniserState.Rawtext);
tb.markInsertionMode();
tb.transition(Text);
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
f59fc46d7a2027a40042a017bd6e63053d34ca53 | e28a6f4b993aa928f023d09cc0249200db4738fa | /app/src/main/java/org/tensorflow/demo/MainActivity.java | a9b06f158993d85ef6bff44f60f41130092ea795 | [] | no_license | zhongmengfeng/zhongmengTs | 47de741145e59e7d246293ebc6fa506a6f627a7a | 783364452860578340f04805b93bf8835c72a0fc | refs/heads/master | 2020-03-20T13:53:23.123430 | 2018-06-19T06:44:47 | 2018-06-19T06:44:47 | 137,469,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,055 | java | package org.tensorflow.demo;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.media.ImageReader;
import android.os.Build;
import android.os.Environment;
import android.os.SystemClock;
import android.support.annotation.RequiresApi;
import android.util.Log;
import android.util.Size;
import android.util.TypedValue;
import android.widget.Toast;
import org.tensorflow.demo.classifer.TensorFlowMultiBoxDetector;
import org.tensorflow.demo.classifer.TensorFlowObjectDetectionAPIModel;
import org.tensorflow.demo.classifer.TensorFlowYoloDetector;
import org.tensorflow.demo.env.BorderedText;
import org.tensorflow.demo.env.ImageUtils;
import org.tensorflow.demo.env.Logger;
import org.tensorflow.demo.http.HttpHelper;
import org.tensorflow.demo.tracking.MultiBoxTracker;
import org.tensorflow.demo.utils.Classifier;
import org.tensorflow.demo.utils.OverlayView;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public class MainActivity extends CameraActivity implements ImageReader.OnImageAvailableListener {
private static final Logger LOGGER = new Logger();
private static final int TF_OD_API_INPUT_SIZE = 400;
private static final String TF_OD_API_MODEL_FILE = "file:///android_asset/ssd_mobilenet_v1_android_export.pb";
private static final String TF_OD_API_LABELS_FILE = "file:///android_asset/coco_labels_list.txt";
// Minimum detection confidence to track a detection.
private static final float MINIMUM_CONFIDENCE_TF_OD_API = 0.6f;
private static final Size DESIRED_PREVIEW_SIZE = new Size(480, 640);
private static final boolean SAVE_PREVIEW_BITMAP = false;
private static final float TEXT_SIZE_DIP = 10;
private Integer sensorOrientation;
private Classifier detector;
private long lastProcessingTimeMs;
private Bitmap rgbFrameBitmap = null;
private Bitmap croppedBitmap = null;
private Bitmap cropCopyBitmap = null;
private boolean computingDetection = false;
private long timestamp = 0;
private Matrix frameToCropTransform;
private Matrix cropToFrameTransform;
private MultiBoxTracker tracker;
private byte[] luminanceCopy;
private BorderedText borderedText;
@Override
public void onPreviewSizeChosen(final Size size, final int rotation) {
final float textSizePx =
TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, TEXT_SIZE_DIP, getResources().getDisplayMetrics());
borderedText = new BorderedText(textSizePx);
borderedText.setTypeface(Typeface.MONOSPACE);
tracker = new MultiBoxTracker(this);
int cropSize = TF_OD_API_INPUT_SIZE;
try {
detector = TensorFlowObjectDetectionAPIModel.create(
getAssets(), TF_OD_API_MODEL_FILE, TF_OD_API_LABELS_FILE, TF_OD_API_INPUT_SIZE);
cropSize = TF_OD_API_INPUT_SIZE;
} catch (final IOException e) {
finish();
}
previewWidth = size.getWidth();
previewHeight = size.getHeight();
sensorOrientation = rotation - getScreenOrientation();
rgbFrameBitmap = Bitmap.createBitmap(previewWidth, previewHeight, Bitmap.Config.ARGB_8888);
croppedBitmap = Bitmap.createBitmap(cropSize, cropSize, Bitmap.Config.ARGB_8888);
frameToCropTransform =
ImageUtils.getTransformationMatrix(
previewWidth, previewHeight,
cropSize, cropSize,
sensorOrientation, true);
cropToFrameTransform = new Matrix();
frameToCropTransform.invert(cropToFrameTransform);
trackingOverlay = findViewById(R.id.tracking_overlay);
trackingOverlay.addCallback(
new OverlayView.DrawCallback() {
@Override
public void drawCallback(final Canvas canvas) {
tracker.draw(canvas);
if (isDebug()) {
tracker.drawDebug(canvas);
}
}
});
addCallback(new OverlayView.DrawCallback() {
@Override
public void drawCallback(final Canvas canvas) {
if (!isDebug()) {
return;
}
}
});
}
OverlayView trackingOverlay;
@Override
protected void processImage() {
++timestamp;
final long currTimestamp = timestamp;
byte[] originalLuminance = getLuminance();
tracker.onFrame(
previewWidth,
previewHeight,
getLuminanceStride(),
sensorOrientation,
originalLuminance,
timestamp);
trackingOverlay.postInvalidate();
// No mutex needed as this method is not reentrant.
if (computingDetection) {
readyForNextImage();
return;
}
computingDetection = true;
rgbFrameBitmap.setPixels(getRgbBytes(), 0, previewWidth, 0, 0, previewWidth, previewHeight);
if (luminanceCopy == null) {
luminanceCopy = new byte[originalLuminance.length];
}
System.arraycopy(originalLuminance, 0, luminanceCopy, 0, originalLuminance.length);
readyForNextImage();
final Canvas canvas = new Canvas(croppedBitmap);
canvas.drawBitmap(rgbFrameBitmap, frameToCropTransform, null);
// For examining the actual TF input.
if (SAVE_PREVIEW_BITMAP) {
ImageUtils.saveBitmap(croppedBitmap);
}
runInBackground(
new Runnable() {
@Override
public void run() {
final long startTime = SystemClock.uptimeMillis();
final List<Classifier.Recognition> results = detector.recognizeImage(croppedBitmap);
lastProcessingTimeMs = SystemClock.uptimeMillis() - startTime;
cropCopyBitmap = Bitmap.createBitmap(croppedBitmap);
final Canvas canvas = new Canvas(cropCopyBitmap);
final Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(2.0f);
float minimumConfidence = MINIMUM_CONFIDENCE_TF_OD_API;
final List<Classifier.Recognition> mappedRecognitions =
new LinkedList<Classifier.Recognition>();
for (final Classifier.Recognition result : results) {
final RectF location = result.getLocation();
if (location != null && result.getConfidence() >= minimumConfidence) {
canvas.drawRect(location, paint);
cropToFrameTransform.mapRect(location);
result.setLocation(location);
mappedRecognitions.add(result);
}
}
tracker.trackResults(mappedRecognitions, luminanceCopy, currTimestamp);
trackingOverlay.postInvalidate();
requestRender();
computingDetection = false;
}
});
}
@Override
protected int getLayoutId() {
return R.layout.camera_connection_fragment_tracking;
}
@Override
protected Size getDesiredPreviewFrameSize() {
return DESIRED_PREVIEW_SIZE;
}
@Override
public void onSetDebug(final boolean debug) {
detector.enableStatLogging(debug);
}
public static File saveBitmapFile(final Bitmap bitmap) {
final String root =
Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "tensorflow";
File appDir = new File(root);
if (!appDir.exists()) {
appDir.mkdir();
}
String fileName = System.currentTimeMillis() + ".jpg";
Log.e("file", fileName);
final File file = new File(appDir, fileName);
try {
FileOutputStream fos = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.JPEG, 80, fos);
fos.flush();
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return file;
}
}
| [
"fengzhongmeng@yidoutech.com"
] | fengzhongmeng@yidoutech.com |
8e50df3c40cae00476a20e724216be913a19d8b5 | 540b0af99eef8cdb9f2b8f31075504ebeab36c74 | /heartwork/work-usercore/src/main/java/im/heart/usercore/service/FrameUserService.java | b7a07d16624a420624bf401fdef7f082478b34a8 | [] | no_license | nullllun/heartwork | 682aca16df2a970bf1ab598458c234052bd795e7 | 1d8e56da24c805d1792f0ecdd59c70779fc5eed7 | refs/heads/master | 2020-07-11T18:51:03.529649 | 2018-10-23T07:20:28 | 2018-10-23T07:20:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,800 | java | package im.heart.usercore.service;
import java.math.BigInteger;
import java.util.Set;
import im.heart.core.service.CommonService;
import im.heart.core.service.ServiceException;
import im.heart.usercore.entity.FrameUser;
import im.heart.usercore.exception.IncorrectCredentialsException;
/**
*
* @author gg
* @desc : 角色接口
*/
public interface FrameUserService extends CommonService<FrameUser, BigInteger>{
public static final String BEAN_NAME = "frameUserService";
public void updateUserheadPortrait(BigInteger userId,String headPortrait);
/**
* @desc:创建用户
* @param frameUser
* @return
* @throws ServiceException
*/
public FrameUser save(FrameUser frameUser) throws ServiceException ;
// /**
// * @desc:激活用户
// * @param userId
// * @return
// */
// public FrameUser activateUser(BigInteger userId);
//
// /**
// * @desc:禁用用户
// * @param userId
// * @return
// */
// public FrameUser disabledUser(BigInteger userId);
/**
*
* @desc:激活用户邮箱
* @param userEmail
* @return
* @throws ServiceException
*/
public FrameUser activateUserEmail(String userEmail) throws ServiceException ;
/**
*
* @desc:根据用户名称查询用户信息
* @param userName
* @return
*/
public FrameUser findByUserName(String userName);
/**
*
* @desc:根据电话号码查找
* @param userPhone
* @return
*/
public FrameUser findByUserPhone(String userPhone);
/**
*
* @desc:根据邮箱查找
* @param userEmail
* @return
*/
public FrameUser findByUserEmail(String userEmail);
/**
*
* @desc:自动选择账号登录,可以使用邮箱,账号,或者注册手机号
* @param account
* @return
*/
public FrameUser findFrameUser(String account);
/**
*
* @desc:修改密码
* @param userId
* @param newPwd
*/
public FrameUser changePassword(BigInteger userId,String oldPwd ,String newPwd) throws IncorrectCredentialsException;
/**
*
* @desc:重置密码
* @param userId
* @param newPwd
*/
public FrameUser resetPassword(BigInteger userId, String newPwd) throws IncorrectCredentialsException;
/**
*
* @desc:根据用户Id 查询用户角色权限
* @param userId
* @return
*/
public Set<String> findRoleCodesByUserId(BigInteger userId);
/**
* @desc:只更新用户的默认机构信息
* @param userId
* @param defaultorgId
*/
public void updateUserDefaultOrg(BigInteger userId,BigInteger defaultorgId);
public boolean existsUserName(String userName);
public boolean existsUserPhone(String userPhone);
public boolean existsUserEmail(String userEmail);
}
| [
"lkg61230413@163.com"
] | lkg61230413@163.com |
94f91661693d20afefe80e0fb1f37c7288d93d19 | 7722ea860033482690509989abf8d9d7faee6757 | /src/org/extremecomponents/table/state/PersistState.java | 13af4be574355d5e49138665c8558c4c82a69023 | [] | no_license | liujidong/ecside-eln3 | 190c4592a84ac0078ffd672b60665d66d1974e8e | 504e8a5e52e116a9aba4f77d8c60e9a79cfa802e | refs/heads/master | 2021-01-16T06:44:04.764520 | 2020-02-25T14:11:38 | 2020-02-25T14:11:38 | 243,012,360 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,018 | java | /*
* Copyright 2004 original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.extremecomponents.table.state;
import java.util.Map;
import org.ecside.core.TableConstants;
import org.ecside.core.context.WebContext;
/**
* @author Jeff Johnston
*/
public class PersistState extends AbstractState {
public Map getParameters(WebContext context, String tableId, String stateAttr) {
return (Map) context.getSessionAttribute(TableConstants.STATE + tableId);
}
}
| [
"593098937@qq.com"
] | 593098937@qq.com |
0bfd6e8dcac9090bd17cf637d38d5284079cf8c6 | afedce30714158f39ebb2c3e9ab0ab010296472b | /mavenDemo/ceph-buildtest/src/main/java/cn/damai/App.java | 1d8e42a2777170988936c985ebc26b95410d906a | [] | no_license | ljianchao/javaDemos | 18687f0699bf3d7ed24c6a241ca11b41b681cf92 | 5d4aac022fd24a2aab445dd74c075f9a1a7b841c | refs/heads/master | 2021-01-17T13:33:11.167501 | 2016-06-06T14:09:48 | 2016-06-06T14:09:48 | 40,160,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 470 | java | package cn.damai;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println("cn.damai.App");
List<String> list = new ArrayList<String>();
list.add("a");
list.add("b");
String listToString = StringUtils.join(list, ",");
System.out.println(listToString);
}
}
| [
"ljianchao@163.com"
] | ljianchao@163.com |
adcecfdd84640eb016999ac8c6dc57548e646ce0 | 771d12129b5f74e9babdabbc652614b20faf5983 | /app/src/main/java/jamper91/com/easyway/Util/LruBitmapCache.java | 3223156c675f7b1e876a1e9d1236be888fc89b2a | [] | no_license | jamper91a/EasyWay | d59b22f27c2747c01c3cb63a74dfa9814c74bcef | ad0a32df79998da8a0c2d61e5e9f5253a02561ce | refs/heads/master | 2021-07-04T04:05:58.862026 | 2020-09-21T01:09:55 | 2020-09-21T01:09:55 | 165,457,931 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 962 | java | package jamper91.com.easyway.Util;
import android.graphics.Bitmap;
import android.support.v4.util.LruCache;
import com.android.volley.toolbox.ImageLoader.ImageCache;
public class LruBitmapCache extends LruCache<String, Bitmap> implements
ImageCache {
public static int getDefaultLruCacheSize() {
final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);
final int cacheSize = maxMemory / 8;
return cacheSize;
}
public LruBitmapCache() {
this(getDefaultLruCacheSize());
}
public LruBitmapCache(int sizeInKiloBytes) {
super(sizeInKiloBytes);
}
@Override
protected int sizeOf(String key, Bitmap value) {
return value.getRowBytes() * value.getHeight() / 1024;
}
@Override
public Bitmap getBitmap(String url) {
return get(url);
}
@Override
public void putBitmap(String url, Bitmap bitmap) {
put(url, bitmap);
}
}
| [
"jamper91a@gmail.com"
] | jamper91a@gmail.com |
e6635e60fdfee4cc691d619c04f3986258dd2dd7 | e0ea15a96dfb33d673a3cd0c33f416c63252dd59 | /goja/goja-jfinal/src/main/java/com/jfinal/ext/handler/ServerNameRedirect301Handler.java | ebdb8565b3f4ca350cf9e8df45f3eb150787b54d | [] | no_license | jerryou/goja | a746e30d1239b055544b26d6bf08d2a0b350b751 | ad59925f83e7fa3f7c7ac44ecf8f7192ff0e1786 | refs/heads/master | 2020-05-30T13:25:48.178437 | 2014-08-25T03:15:57 | 2014-08-25T03:15:57 | 23,374,918 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,655 | java | /**
* Copyright (c) 2011-2014, James Zhan 詹波 (jfinal@126.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jfinal.ext.handler;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jfinal.handler.Handler;
/**
* ServerNameRedirect301Handler redirect to new server name with 301 Moved Permanently.
*/
public class ServerNameRedirect301Handler extends Handler {
private String originalServerName;
private String targetServerName;
private int serverNameLength;
/**
* Example: new ServerNameRedirectHandler("http://abc.com", "http://www.abc.com")
* @param originalServerName The original server name that you want be redirect
* @param targetServerName The target server name that redirect to
*/
public ServerNameRedirect301Handler(String originalServerName, String targetServerName) {
this.originalServerName = originalServerName;
this.targetServerName = targetServerName;
format();
serverNameLength = this.originalServerName.length();
}
private final void format() {
if (originalServerName.endsWith("/"))
originalServerName = originalServerName.substring(0, originalServerName.length() - 1);
if (targetServerName.endsWith("/"))
targetServerName = targetServerName.substring(0, targetServerName.length() - 1);
// 此处没有考虑 https 的情况, 该情况由用户在 new ServerNameRedirectHandler() 时自行解决
if (originalServerName.indexOf("://") == -1)
originalServerName = "http://" + originalServerName;
if (targetServerName.indexOf("://") == -1)
targetServerName = "http://" + targetServerName;
}
@Override
public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
String url = request.getRequestURL().toString();
if (url.startsWith(originalServerName)) {
isHandled[0] = true;
String queryString = request.getQueryString();
queryString = (queryString == null ? "" : "?" + queryString);
url = targetServerName + url.substring(serverNameLength) + queryString;
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
// response.sendRedirect(url); // always 302
response.setHeader("Location", url);
response.setHeader("Connection", "close");
}
else {
nextHandler.handle(target, request, response, isHandled);
}
}
}
/*
http://souwangxiao.com redirect 301 to http://www.souwangxiao.com
<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
if(request.getRequestURL().indexOf("http://souwangxiao.com") >= 0) {
// String requestURI = request.getRequestURI();
// String queryString = request.getQueryString();
// queryString = (queryString == null ? "" : "?" + queryString);
//attempt to merge non-www urls
response.setStatus(301); // 301 rewrite
// response.setHeader("Location", "http://www.souwangxiao.com" + requestURI + queryString);
response.setHeader("Location", "http://www.souwangxiao.com");
response.setHeader("Connection", "close");
}
else {%>
<s:action namespace="/" name="index" executeResult="true" />
<%}%>
*/
| [
"poplar1123@gmail.com"
] | poplar1123@gmail.com |
8b6fd2cf41e15880a15b2be44760298c55e32e3b | 71c1bee42b45c822617ff5a6c8cff35f4bb9d77d | /src/main/java/org/apache/ibatis/type/MappedJdbcTypes.java | e6ccfc07153a905f27374febce0c10073cfc710e | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | redsnower/mybatis-3.4.6 | 309576504aa9721def3f42fb73fe6202afa6ed27 | 9eb91fdc19e1cde7413d6f856bdc9de6dc62bdc4 | refs/heads/master | 2021-10-08T00:07:56.933801 | 2018-12-06T05:45:37 | 2018-12-06T05:45:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,202 | java | /**
* Copyright 2009-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.type;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 用于TypeHandler类上的注解,指明该TypeHandler实现类能够处理的JDBC类型集合
* @author Eduardo Macarron
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface MappedJdbcTypes {
JdbcType[] value();
boolean includeNullJdbcType() default false;
}
| [
"perry@thecover.co"
] | perry@thecover.co |
ca585f93b67e3b78ec54c2086e1d9e2b6eb492fa | 52083abdf7ba9f06e4eb0087e95f6dd31d247559 | /src/main/java/com/example/demo/beans/CurrencyConversion.java | 4ab256aa391cf557d1d63a7bd44e0c2e96bc8796 | [] | no_license | benarjee21/CurrencyConversionService | f21281250f0dc13711955e4b70dd0b59cd0bfeff | 60ff2eac7b5d600697c0f4feea9d7f0fc57c86c1 | refs/heads/master | 2022-10-15T23:23:46.811621 | 2020-06-09T11:40:07 | 2020-06-09T11:40:07 | 270,982,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,591 | java | package com.example.demo.beans;
import java.math.BigDecimal;
public class CurrencyConversion {
private Long id;
private String from;
private String to;
private BigDecimal convertioNMultiple;
private BigDecimal convertedValue;
private BigDecimal quantity;
private int port;
protected CurrencyConversion() {
}
public CurrencyConversion(Long id, String from, String to, BigDecimal convertioNMultiple, BigDecimal convertedValue,
BigDecimal quantity, int port) {
super();
this.id = id;
this.from = from;
this.to = to;
this.convertioNMultiple = convertioNMultiple;
this.convertedValue = convertedValue;
this.quantity = quantity;
this.port = port;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public BigDecimal getConvertioNMultiple() {
return convertioNMultiple;
}
public void setConvertioNMultiple(BigDecimal convertioNMultiple) {
this.convertioNMultiple = convertioNMultiple;
}
public BigDecimal getConvertedValue() {
return convertedValue;
}
public void setConvertedValue(BigDecimal convertedValue) {
this.convertedValue = convertedValue;
}
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
}
| [
"INTERN03@VDIN-1000128"
] | INTERN03@VDIN-1000128 |
fb9344818b26127497c9782f448a729758861f32 | 0cea659b7d8ae904f1d45ee6e67bb1785657753d | /java_workspace/small_comerce_api_rest_test/src/main/java/com/tfm/dto/Client.java | 29f952051bdd61fc9707fd62cc5ebc3db1204d74 | [] | no_license | borjaOrtizLlamas/TFM_DEVOPS_MASTER_AWS | 7e846b8f0beaf4f9118c9990fdafa619b1a85e7f | 8db3fd3d26e128c9f6ae6be1ab99320333509690 | refs/heads/master | 2023-02-24T18:26:46.723406 | 2022-05-17T10:13:53 | 2022-05-17T10:13:53 | 493,171,239 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 715 | java | package com.tfm.dto;
import java.io.Serializable;
import java.util.List;
public class Client implements Serializable{
String name;
String phone;
String surname;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
@Override
public String toString() {
return "{\"name\":\"" + name + "\", \"phone\": \""+ phone+"\", \"surname\" : \""+surname+"\"}";
}
}
| [
"ortizllamasborja@gmail.com"
] | ortizllamasborja@gmail.com |
7ee3ff6ab182e31b76d3ee7a0edb6dac697f1360 | e24abe58702cecc74d994d3693c652f4298a63cc | /src/java/main/Main.java | 0254ef3174a31bb8732b66897ff61894aa53f3ad | [] | no_license | aapopajunen/chunkshift | da0af0de2a33bc1a49cbb7abbd41299b5424d5d0 | b1b50946f2e1f5dc6138c4befa5de0b5e3d9d576 | refs/heads/master | 2020-03-23T08:07:09.287184 | 2018-07-17T16:17:49 | 2018-07-17T16:17:49 | 141,308,182 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 437 | java | package main;
import logic.ChunkShift;
public class Main {
private final ChunkShift chunkShift = new ChunkShift();
private void run() {
chunkShift.printChunks();
chunkShift.shift(-1,-1);
chunkShift.printChunks();
chunkShift.shift(1,1);
chunkShift.printChunks();
chunkShift.shift(1,1);
chunkShift.printChunks();
}
public static void main(String[] args) {
new Main().run();
}
} | [
"aapo.pajunen@gmail.com"
] | aapo.pajunen@gmail.com |
7973fe805255f8092c3864093802939026892f72 | 991e31e7d31e3ff03d0e6eab7e2b3e8987fd853d | /spring-boot-examples/spring-boot-rest/src/main/java/com/young/spring/rest/asynctask/AsyncTaskExample.java | 02fa7e8f88422c411a5f4e13bcbc3d75eda353b5 | [] | no_license | yangwx1402/young-examples | 0850ffbeff032d0247814df3422f72fd695f1983 | ae28b922a870c524ce3eae102a7229646c42511a | refs/heads/master | 2021-04-12T03:40:40.944129 | 2018-07-07T09:09:45 | 2018-07-07T09:09:45 | 53,644,263 | 27 | 11 | null | 2017-08-11T10:15:04 | 2016-03-11T06:12:49 | JavaScript | UTF-8 | Java | false | false | 1,453 | java | package com.young.spring.rest.asynctask;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;
import java.util.Random;
import java.util.concurrent.Future;
/**
* Created by yangyong3 on 2017/2/4.
*/
@Component
public class AsyncTaskExample {
@Async
public Future<String> step1(){
long start = System.currentTimeMillis();
try {
Thread.sleep(new Random().nextInt(10)*1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return new AsyncResult<String>("step1 run over cost time -"+(System.currentTimeMillis()-start));
}
@Async
public Future<String> step2(){
long start = System.currentTimeMillis();
try {
Thread.sleep(new Random().nextInt(10)*1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return new AsyncResult<String>("step2 run over cost time -"+(System.currentTimeMillis()-start));
}
@Async
public Future<String> step3(){
long start = System.currentTimeMillis();
try {
Thread.sleep(new Random().nextInt(10)*1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return new AsyncResult<String>("step3 run over cost time -"+(System.currentTimeMillis()-start));
}
}
| [
"yangyong3@le.com"
] | yangyong3@le.com |
9bafa4befee678a898add04dd5e48a30a7580afa | 8665130132f65ea32f8f8a3c964f478b23232508 | /app/src/main/java/com/assignment/tasktabraiz/di/applicationDI/qualifier/ApplicationContextQualifier.java | 19809294ccd158b5f0f74109f44ab0099134df46 | [] | no_license | TabraizAhmad/TabraizTask | 794072dcbbdf45125a73c4269312e779c47ba840 | 0a07e0bb57670c4f429a7d53fc21cf2fccfb4676 | refs/heads/master | 2020-04-01T20:18:13.265432 | 2018-10-23T00:23:16 | 2018-10-23T00:23:16 | 153,597,779 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 157 | java | package com.assignment.tasktabraiz.di.applicationDI.qualifier;
import javax.inject.Qualifier;
@Qualifier
public @interface ApplicationContextQualifier {
}
| [
"tabraiz.ahmad95@yahoo.com"
] | tabraiz.ahmad95@yahoo.com |
12e5b71f87a2ad9010b9fa0b758202ed602736ec | b12ecb0b86afe455275b6271944c9f2465de079a | /balazs-ai/src/main/java/io/jsd/training/artificialintelligence1/geneticalgorithms/Constants.java | 1c870056c4321c1237e57f9c7cd137ebe2b0730b | [] | no_license | jsdumas/ai-training | 7a898437433b6a901e9d99805838037f86786e16 | 0fc1dee319b3f1429597f5648ae326a4ca2a3400 | refs/heads/master | 2020-03-11T08:30:39.123940 | 2018-04-19T21:23:50 | 2018-04-19T21:23:50 | 129,885,693 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 447 | java | package io.jsd.training.artificialintelligence1.geneticalgorithms;
public class Constants {
private Constants(){
}
public static final int[] SOLUTION_SEQUENCE = {0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9};
public static final double UNIFORM_RATE = 0.5;
public static final double MUTATION_RATE = 0.15;
public static final int TOURNAMENT_SIZE = 5;
public static final int GENE_LENGTH = 20;
public static final int MAX_FITNESS = 20;
}
| [
"jsdumas@free.fr"
] | jsdumas@free.fr |
d33df04cc3a7e948ad95daac0a03a349832e3b0e | 46347de649fefb62ec9a12bac6084d28f9eefe4c | /app/src/main/java/com/judian/goule/store/utils/ImgeUtils.java | af0e4af3525ad90e9c1a462788ef5de1a98abd95 | [] | no_license | P79N6A/android | 1075e6730c5ffb17d0e10afbe7f0c9cb3a49b014 | 61c382cf35e9d49dd36668f12003210af77f7bd2 | refs/heads/master | 2020-07-10T23:17:23.685882 | 2019-08-26T03:57:04 | 2019-08-26T03:57:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,682 | java | package com.judian.goule.store.utils;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Environment;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* 图片进行保存到本地
*
*
*/
public class ImgeUtils {
//保存文件到指定路径
public static boolean saveImageToGallery(Context context, Bitmap bmp) {
// 首先保存图片
String storePath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "goule";
File appDir = new File(storePath);
if (!appDir.exists()) {
appDir.mkdir();
}
String fileName = System.currentTimeMillis() + ".jpg";
File file = new File(appDir, fileName);
try {
FileOutputStream fos = new FileOutputStream(file);
//通过io流的方式来压缩保存图片
boolean isSuccess = bmp.compress(Bitmap.CompressFormat.JPEG, 60, fos);
fos.flush();
fos.close();
//把文件插入到系统图库
//MediaStore.Images.Media.insertImage(context.getContentResolver(), file.getAbsolutePath(), fileName, null);
//保存图片后发送广播通知更新数据库
Uri uri = Uri.fromFile(file);
context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri));
if (isSuccess) {
return true;
} else {
return false;
}
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
}
| [
"20851332@qq.com"
] | 20851332@qq.com |
b0162f4b1dda222fb43b572adef55faeff64771e | 78c990f287df4886edc0db7094a8c2f77eb16461 | /icetone-core/src/main/java/icetone/controls/buttons/StatefulButton.java | 17b44370ffa0911fe7e836adce996248071529b3 | [
"BSD-2-Clause",
"LicenseRef-scancode-other-permissive"
] | permissive | Scrappers-glitch/icetone | a91a104571fba25cacc421ef1c3e774de6769a53 | 1684c2a6da1b1228ddcabafbbbee56286ccc4adb | refs/heads/master | 2022-01-08T10:53:47.263080 | 2019-06-27T11:10:54 | 2019-06-27T11:10:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,387 | java | /**
* ICETONE - A GUI Library for JME3 based on a heavily modified version of
* Tonegod's 'Tonegodgui'.
*
* Copyright (c) 2013, t0neg0d
* Copyright (c) 2016, Emerald Icemoon
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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 OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those
* of the authors and should not be interpreted as representing official policies,
* either expressed or implied, of the FreeBSD Project.
*/
package icetone.controls.buttons;
import java.util.Objects;
import icetone.core.BaseScreen;
import icetone.core.Layout.LayoutType;
import icetone.core.event.ChangeSupport;
import icetone.core.event.UIChangeEvent;
import icetone.core.event.UIChangeListener;
/**
* @author rockfire
*/
public abstract class StatefulButton<S extends Object> extends Button {
protected S state;
protected ChangeSupport<StatefulButton<S>, S> changeSupport;
public StatefulButton() {
super();
}
public StatefulButton(BaseScreen screen) {
super(screen);
}
public StatefulButton(BaseScreen screen, String text) {
super(screen, text);
}
public StatefulButton(String text) {
super(text);
}
public StatefulButton(String texturePath, String text) {
super(texturePath, text);
}
public StatefulButton<S> onChange(UIChangeListener<StatefulButton<S>, S> listener) {
if (changeSupport == null)
changeSupport = new ChangeSupport<>();
changeSupport.bind(listener);
return this;
}
public S getState() {
return state;
}
public StatefulButton<S> setState(S state) {
if (!Objects.equals(state, this.state)) {
S oldState = this.state;
this.state = state;
onStateChanged(oldState, state);
dirtyLayout(true, LayoutType.reset);
layoutChildren();
if (changeSupport != null)
changeSupport.fireEvent(new UIChangeEvent<StatefulButton<S>, S>(this, oldState, state));
}
return this;
}
public StatefulButton<S> unbindChanged(UIChangeListener<StatefulButton<S>, S> listener) {
if (changeSupport != null)
changeSupport.unbind(listener);
return this;
}
protected void onStateChanged(S oldState, S state2) {
}
}
| [
"rockfire.redmoon@gmail.com"
] | rockfire.redmoon@gmail.com |
b61b63e91b730855a206ea2ec0ff53f9f6b31f45 | e9e01fa572b8ffbbab1d22109fdf21305077ebb5 | /blink-sql/src/test/java/ambition/blink/sql/SqlUtilsTest.java | 7fe13cb3dfe717ffbd022224b3e3f906f7b2db79 | [
"Apache-2.0"
] | permissive | thorntree/FlinkSQL | 92eee637c8e0b4e47f2046aa7e7866a99de57aa8 | 1db70dc269d7eea3a02978ab7b98249e7ab3eba0 | refs/heads/master | 2022-12-27T02:15:59.008544 | 2020-02-10T11:56:37 | 2020-02-13T12:00:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,648 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ambition.blink.sql;
import org.apache.calcite.sql.SqlNode;
import org.apache.calcite.sql.SqlNodeList;
import org.junit.Assert;
import org.junit.Test;
/**
* @Date: 2020/1/2
*/
public class SqlUtilsTest {
@Test
public void run(){
System.out.println(System.currentTimeMillis());
}
@Test
public void parseSqlTest() throws Exception {
String table = "CREATE TABLE tbl1 (\n" +
" a bigint,\n" +
" h varchar, \n" +
" g as 2 * (a + 1), \n" +
" ts as toTimestamp(b, 'yyyy-MM-dd HH:mm:ss'), \n" +
" b varchar,\n" +
" proc as PROCTIME(), \n" +
" PRIMARY KEY (a, b)\n" +
")\n" +
"with (\n" +
" 'connector' = 'kafka', \n" +
" 'kafka.topic' = 'log.test'\n" +
")\n";
SqlNodeList nodeList = SqlUtils.parseSql(table);
for(SqlNode sqlNode : nodeList){
Assert.assertNotNull(sqlNode);
}
String watermark = "CREATE TABLE tbl1 (\n" +
" ts timestamp(3),\n" +
" id varchar, \n" +
" watermark FOR ts AS ts - interval '3' second\n" +
")\n" +
" with (\n" +
" 'connector' = 'kafka', \n" +
" 'kafka.topic' = 'log.test'\n" +
")\n";
SqlNodeList nodeList1 = SqlUtils.parseSql(watermark);
for(SqlNode sqlNode : nodeList1){
Assert.assertNotNull(sqlNode);
}
String fun = "create function function1 as 'org.apache.fink.function.function1' language java";
SqlNodeList nodeList2 = SqlUtils.parseSql(fun);
for(SqlNode sqlNode : nodeList2){
Assert.assertNotNull(sqlNode);
}
String insert = "insert into emp(x,y) partition (x='ab', y='bc') select * from emp";
SqlNodeList nodeList3 = SqlUtils.parseSql(insert);
for(SqlNode sqlNode : nodeList3){
Assert.assertNotNull(sqlNode);
}
}
}
| [
"1269223860@qq.com"
] | 1269223860@qq.com |
0f60923ea59b4b5cd543ff7a44f8c48f2a8ca815 | f6b90fae50ea0cd37c457994efadbd5560a5d663 | /android/nut-dex2jar.src/com/tencent/wxop/stat/b.java | 8a4ff8b30971e1d0608314b483a7ff4d4c6f7925 | [] | no_license | dykdykdyk/decompileTools | 5925ae91f588fefa7c703925e4629c782174cd68 | 4de5c1a23f931008fa82b85046f733c1439f06cf | refs/heads/master | 2020-01-27T09:56:48.099821 | 2016-09-14T02:47:11 | 2016-09-14T02:47:11 | 66,894,502 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 764 | java | package com.tencent.wxop.stat;
import com.tencent.wxop.stat.b.f;
import java.util.List;
final class b
implements k
{
b(ai paramai, List paramList, boolean paramBoolean)
{
}
public final void a()
{
v.b();
ai localai = this.c;
List localList = this.a;
boolean bool = this.b;
if (localai.a != null)
localai.a.a(new ak(localai, localList, bool));
}
public final void b()
{
v.c();
ai localai = this.c;
List localList = this.a;
boolean bool = this.b;
if (localai.a != null)
localai.a.a(new aj(localai, localList, bool));
}
}
/* Location: C:\crazyd\work\ustone\odm2016031702\baidu\android\nut-dex2jar.jar
* Qualified Name: com.tencent.wxop.stat.b
* JD-Core Version: 0.6.2
*/ | [
"819468107@qq.com"
] | 819468107@qq.com |
fb79e1badfcccd4199c5e5ac30b42ea6e355a2f6 | f9bf88fc81dc5f0c0da4b4c25c56a35dd39f55fd | /workspace/3Trimestre/src/UT10/Leer_Datos.java | b73398be9864e4c11c3d3533af1fa2397c0f1349 | [] | no_license | Danybs/Java1DAM | 80ebad1600e7c026c2bdf55a0d59960496efdfa4 | d4ce7ac518a5d603f543940b93a6fd5df7e3da9e | refs/heads/master | 2021-07-04T11:17:46.838559 | 2017-09-28T00:38:01 | 2017-09-28T00:38:01 | 104,946,630 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,122 | java | package UT10;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;
public class Leer_Datos {
static void ReadEquipos(Connection con, String BDNombre) throws SQLException {
Statement stmt = null;
String cadena = "SELECT TEAM_ID,EQ_NOMBRE,ESTADIO,POBLACION,PROVINCIA,COD_POSTAL FROM EQUIPO";
try {
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(cadena);
while (rs.next()) {
int v1 = rs.getInt("TEAM_ID");
System.out.print(v1+" ");
String v2 = rs.getString("EQ_NOMBRE");
System.out.print(v2+" ");
String v6 = rs.getString("ESTADIO");
System.out.print(v6+" ");
String v3 = rs.getString("POBLACION");
System.out.print(v3+" ");
String v5 = rs.getString("PROVINCIA");
System.out.print(v5+" ");
int v4 = rs.getInt("COD_POSTAL");
System.out.print(v4+" ");
System.out.println();
}
} catch (SQLException e) {
Errores.printSQLException(e);
} finally {
stmt.close();
}
}
static void ReadJugadores(Connection con, String BDNombre) throws SQLException {
Scanner teclado=new Scanner(System.in);
System.out.println("Dime numero de equipo");
int num=teclado.nextInt();
Statement stmt = null;
String createString="select * " +
"from JUGADORES "+
"where TEAM_ID=" +num;
try {
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(createString);
while (rs.next()) {
int cod=rs.getInt(1);
System.out.println("Identificacion:"+cod);
int equipo=rs.getInt(2);
System.out.println("Equipo:"+equipo);
String nombre=rs.getString(3);
System.out.println("Nombre:"+nombre);
int dorsal=rs.getInt(4);
System.out.println("Dorsal:"+dorsal);
int edad=rs.getInt(5);
System.out.println("Edad:"+edad);
System.out.println("----------------------");
}
} catch (SQLException e) {
Errores.printSQLException(e);
} finally {
stmt.close();
}
}
} | [
"d_blanco70@hotmail.com"
] | d_blanco70@hotmail.com |
af5e881fd98dec12b2564c188171fea23b38fb04 | 2d1d8b9efdd8a5ff505b6f7c78d5ce7096842cd3 | /app/src/main/java/com/example/henryzheng/avtivitysourcetest/View/explosion/explosionfield/ExploseViewActivity.java | 87dd98e518e8681fe17cf5666fdad558a51186a2 | [] | no_license | CCHenry/AvtivitySourceTest | 4d6a0f3a3735b2bec6ff772d8955b134465e8985 | 9fc5dcfa0973740aebc5ff513d4c151d775ec4fb | refs/heads/master | 2021-01-12T01:28:45.229476 | 2017-03-31T10:01:41 | 2017-03-31T10:01:41 | 78,390,741 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,818 | java | package com.example.henryzheng.avtivitysourcetest.View.explosion.explosionfield;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.example.henryzheng.avtivitysourcetest.R;
public class ExploseViewActivity extends Activity {
private ExplosionField mExplosionField;
private View contentView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_explose_view);
mExplosionField = ExplosionField.attach2Window(this);
// addListener(findViewById(R.id.root));
ViewGroup view = (ViewGroup)getWindow().getDecorView();
final FrameLayout content = (FrameLayout)view.findViewById(android.R.id.content);
contentView=content.getChildAt(0);
contentView.setClickable(true);
contentView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mExplosionField.explode(contentView);
}
});
}
private void addListener(View root) {
if (root instanceof ViewGroup) {
ViewGroup parent = (ViewGroup) root;
for (int i = 0; i < parent.getChildCount(); i++) {
addListener(parent.getChildAt(i));
}
} else {
root.setClickable(true);
root.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mExplosionField.explode(v);
v.setOnClickListener(null);
}
});
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main,menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.action_reset) {
View root = findViewById(R.id.root);
reset(root);
addListener(root);
mExplosionField.clear();
return true;
}
return super.onOptionsItemSelected(item);
}
private void reset(View root) {
if (root instanceof ViewGroup) {
ViewGroup parent = (ViewGroup) root;
for (int i = 0; i < parent.getChildCount(); i++) {
reset(parent.getChildAt(i));
}
} else {
root.setScaleX(1);
root.setScaleY(1);
root.setAlpha(1);
}
}
@Override
protected void onDestroy() {
mExplosionField.explode(contentView);
super.onDestroy();
}
}
| [
"603702817@qq.com"
] | 603702817@qq.com |
22145381fe114ffe1e0eb66cd979d317050af92e | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project40/src/main/java/org/gradle/test/performance40_3/Production40_257.java | e7e730c51a1097f659c6547c8920c1090a77d550 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 305 | java | package org.gradle.test.performance40_3;
public class Production40_257 extends org.gradle.test.performance13_3.Production13_257 {
private final String property;
public Production40_257() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
5f863014af7ccb1427c9720ed8b98f486359b9a2 | d31a0251f2b20f8012a3b74d443093ca28939089 | /OneDrive/바탕 화면/Seosumsan/app/src/main/java/com/bgp/seosumsan/Adapter/ReviewAdapter.java | 4a42831a0d053c075f690cd2ac3e377fcad8ef46 | [] | no_license | nayoon-kim/Seosumsan | 8249ecf2ae7478dd176b79238491a70df28225b0 | 04ac08e78dc429d74cfc3218993f65df00038ed9 | refs/heads/main | 2021-01-05T01:57:59.636946 | 2020-11-17T15:02:53 | 2020-11-17T15:02:53 | 240,835,319 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,827 | java | package com.bgp.seosumsan.Adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RatingBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bgp.seosumsan.DTO.ReviewData;
import com.bgp.seosumsan.R;
import java.util.ArrayList;
public class ReviewAdapter extends RecyclerView.Adapter<ReviewAdapter.CustomViewHolder>{
private ArrayList<ReviewData> mList;
public ReviewAdapter(ArrayList<ReviewData> list) { this.mList = list;}
public class CustomViewHolder extends RecyclerView.ViewHolder {
protected TextView name;
protected RatingBar rate;
protected TextView review;
public CustomViewHolder(@NonNull View view) {
super(view);
this.name = (TextView) view.findViewById(R.id.review_userid);
this.rate=(RatingBar) view.findViewById(R.id.review_ratingBar);
this.review = (TextView) view.findViewById(R.id.review_text);
}
}
@NonNull
@Override
public CustomViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.review_list, viewGroup, false);
CustomViewHolder viewHolder= new CustomViewHolder(view);
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull CustomViewHolder viewholder, int position) {
viewholder.name.setText(mList.get(position).getName());
viewholder.rate.setRating(mList.get(position).getEvaluation());
viewholder.review.setText(mList.get(position).getReview());
}
@Override
public int getItemCount() {
return (null != mList ? mList.size() : 0);
}
}
| [
"belloyv@gmail.com"
] | belloyv@gmail.com |
7bc0e2d87386a88d8851578d97e5b4ad73f4a960 | 15e8e81e657be2f2f8001846ec9a6dfdcf94b1ac | /src/com/company/SilverMembership.java | 2a6e41bf6642a44977328efe16fd22345b6661bd | [] | no_license | DzifaHodey/tlc-trading-lab | eeacedda190a67c7f2da68650aef7a8eb8480be9 | 8d56270e19a901c1dcdace0fcda3314ed44a6db6 | refs/heads/master | 2023-08-25T22:01:38.374255 | 2021-10-08T17:21:14 | 2021-10-08T17:21:14 | 414,174,364 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 235 | java | package com.company;
public class SilverMembership extends MembershipType{
public SilverMembership() {
super(10);
}
@Override
public String getMembershipType() {
return "Silver";
}
}
| [
"dzifahodey@gmail.com"
] | dzifahodey@gmail.com |
a2e6a578910377a6245be71908984fd89bff210b | edb57d5c3efc15b7cd2599723d2c418dff10353e | /design-patterns/src/main/java/effective/java/com/factorymethod/model/Computer.java | 8edf91be5deea1061352a5fa43f6388d3990a8f7 | [] | no_license | RomanDrohobytskyi/Effective-Java-programming | 73f1a353012c57c44a4ad82eac4419d121f8f916 | d3286777f15e3ae080cd1d3413fa8bc0dc7d45e4 | refs/heads/master | 2023-05-28T08:34:08.812322 | 2023-05-04T20:33:01 | 2023-05-04T20:33:01 | 197,244,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 397 | java | package effective.java.com.factorymethod.model;
public abstract class Computer {
public abstract String getRAM();
public abstract String getHDD();
public abstract String getCPU();
@Override
public String toString() {
return "RAM: " + this.getRAM()
+ ", HDD: " + this.getHDD()
+ ", CPU: " + this.getCPU()
+ ".";
}
}
| [
"romabikebmx@gmail.com"
] | romabikebmx@gmail.com |
dfbc713bbb98257316520db71502bdbb540ec65b | 198737841fb4b1ca4d16c64520ad9d842a7b350d | /micro-weather-eureka-client-feign-hystrix/src/main/java/com/soldier/controller/CityController.java | 9542965e080fe763e548d04cf6c68e099c119946 | [] | no_license | soldiergit/spring-cloud-learn | a7e21175127d0b909fc8e507c30687d2b79edca5 | 15ad1af4ee1151e0ee0afc6e4422abe6ddf4c357 | refs/heads/master | 2021-07-16T19:10:06.847137 | 2020-04-12T02:16:02 | 2020-04-12T02:16:02 | 249,862,931 | 0 | 1 | null | 2021-06-04T02:33:45 | 2020-03-25T01:56:04 | Java | UTF-8 | Java | false | false | 909 | java | package com.soldier.controller;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.soldier.services.CityClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author soldier
* @Date 20-4-11 下午5:25
* @Email:583406411@qq.com
* @Version 1.0
* @Description:
*/
@RestController
public class CityController {
@Autowired
private CityClient cityClient;
@RequestMapping("/cities")
@HystrixCommand(fallbackMethod = "defaultCities")
public String cityList() {
// 通过Feign客户端查找
String data = cityClient.cityList();
return data;
}
/**
* 当服务宕机时调用
*/
public String defaultCities() {
return "city data server is down";
}
}
| [
"soldier_wyyx@163.com"
] | soldier_wyyx@163.com |
6c886024fa45e98a96feb71352afc8886153a06b | a407678d9973a09183ca556b54d9d35cd7a2b765 | /src/minecraft/java/org/darkstorm/darkbot/minecraftbot/events/world/SpawnEvent.java | c5dd5c92a5e01209cc4205df7dc38084eb911cb3 | [
"BSD-2-Clause"
] | permissive | dahquan1/DarkBot | d4920b6f196e9b5a8bffe1adcfe150abc7e88d50 | 09ff65b67060486eaa723a68e3faf4a6296a194c | refs/heads/master | 2020-12-25T04:17:12.624939 | 2014-03-04T21:02:02 | 2014-03-04T21:02:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 404 | java | package org.darkstorm.darkbot.minecraftbot.events.world;
import org.darkstorm.darkbot.minecraftbot.events.Event;
import org.darkstorm.darkbot.minecraftbot.world.entity.MainPlayerEntity;
public class SpawnEvent extends Event {
private final MainPlayerEntity player;
public SpawnEvent(MainPlayerEntity player) {
this.player = player;
}
public MainPlayerEntity getPlayer() {
return player;
}
}
| [
"darkstorm@evilminecraft.net"
] | darkstorm@evilminecraft.net |
83c855b624fce755a99437e1a13a04867822bc41 | 0062736c40a8e08cd22e6afb01e26b4f0fa87e86 | /miniufo/io/CtlDataReadStream.java | fb14d5a9fd5b4fee22db102bfabc029def0072c0 | [] | no_license | ChanJeunlam/MyPackage | 95ba6be77e5ad3da3038a310a05c1a63ce1923cd | 77d60dea0762c0f305dfa5d9545a329131ece3b8 | refs/heads/master | 2022-04-05T18:59:21.564699 | 2018-11-16T07:22:10 | 2018-11-16T07:22:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,571 | java | /**
* @(#)CtlDataReadStream.java 1.0 07/02/01
*
* Copyright 2007 MiniUFO, All rights reserved.
* MiniUFO Studio. Use is subject to license terms.
*/
package miniufo.io;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import miniufo.descriptor.CtlDescriptor;
import miniufo.diagnosis.Variable;
import miniufo.diagnosis.Range;
/**
* used to read the binary ctl data file
*
* @version 1.0, 02/01/2007
* @author MiniUFO
* @since MDK1.0
*/
public final class CtlDataReadStream implements DataRead,Print{
//
private int t=0;
private int z=0;
private int y=0;
private int x=0;
private long skipZ=0;
private long skipY=0;
private long skipX=0;
private long skipF=0;
private boolean sequential =false;
private boolean print =true;
private ByteBuffer buf=null; // buffer fulfill with data in one time for process
private CtlDescriptor cd=null;
private FileChannel fc =null;
private RandomAccessFile raf=null;
/**
* constructor
*
* @param cd ctl descriptor
*/
public CtlDataReadStream(CtlDescriptor cd){
this.cd=cd; sequential=cd.isSequential();
try{
raf=new RandomAccessFile(cd.getDSet(),"r");
if(sequential){
if(raf.length()!=(cd.getTRecLength()+cd.getVCount()*2*4)*cd.getTCount())
throw new IllegalArgumentException("length of data file is invalid");
}else{
if(raf.length()!=cd.getTRecLength()*cd.getTCount())
throw new IllegalArgumentException(
"length of data file is invalid:"+raf.length()+
"(data, bytes), "+cd.getTRecLength()*cd.getTCount()+"(ctl, bytes)"
);
}
}
catch(IOException ex){ ex.printStackTrace(); System.exit(0);}
fc=raf.getChannel();
}
/**
* to read data from the specified file
*
* @param v variable need to fill with data
*/
public void readData(Variable... v){
if(v.length!=1){
if(print) System.out.print("\nStart reading ");
for(int m=0;m<v.length;m++){
if(print) System.out.print(v[m].getName()+" ");
readOne(v[m]);
}
if(print) System.out.println("data...\nFinish reading data.");
}else readOne(v[0]);
}
/**
* whether to print out
*
* @param print print or disable print
*/
public void setPrinting(boolean print){ this.print=print;}
/**
* close file method
*/
public void closeFile(){
try{ if(raf!=null){ fc.close(); raf.close();}}
catch(IOException ex){ ex.printStackTrace(); System.exit(0);}
t=z=y=x=0; skipF=skipZ=skipY=skipX=0;
buf=null; raf=null; cd=null;
}
/*** helper methods ***/
private void readOne(Variable v){
long one_level_length=cd.getOneLevelLength();
boolean yrev=cd.isYRev();
boolean zrev=cd.isZRev();
Range range=v.getRange();
int[] trange=range.getTRange(); int[] zrange=range.getZRange();
int[] yrange=range.getYRange(); int[] xrange=range.getXRange();
t=trange[2]; z=zrange[2];
y=yrange[2]; x=xrange[2];
int tcount=cd.getTCount(); int zcount=cd.getZCount();
int ycount=cd.getYCount(); int xcount=cd.getXCount();
if(t>tcount||z>zcount) throw new IllegalArgumentException("invalid range");
if(y>ycount||x>xcount) throw new IllegalArgumentException("invalid range");
/*** calculate skips ***/
skipF=(xrange[0]-1)<<2;
if(yrev) skipF+=xcount*(ycount-yrange[1])<<2;
else skipF+=xcount*(yrange[0]-1)<<2;
if(zrev) skipF+=one_level_length*(zcount-zrange[1]);
else skipF+=one_level_length*(zrange[0]-1);
skipF+=cd.getVarStartPosition(v.getName());
if("99".equals(cd.getStorageType())){
skipF+=cd.getTRecLength()*(trange[0]-1);
skipZ=cd.getTRecLength()-one_level_length*zrange[2];
}else{
skipF+=one_level_length*cd.getVarZcount(v.getName())*(trange[0]-1);
skipZ=one_level_length*(zcount-zrange[2]);
}
skipX=(xcount-xrange[2])<<2;
skipY=(ycount-yrange[2])*xcount<<2;
/*** buffer ***/
buf=ByteBuffer.allocate(xrange[2]*4);
buf.order(cd.getByteOrder());
/*** start to read data ***/
try{
if(yrev&&!zrev){
if(v.isTFirst()) readTFYRev(v.getData());
else readYRev(v.getData());
}else if(zrev&&!yrev){
if(v.isTFirst()) readTFZRev(v.getData());
else readZRev(v.getData());
}else if(yrev&&zrev){
if(v.isTFirst()) readTFYRevZRev(v.getData());
else readYRevZRev(v.getData());
}else{
if(v.isTFirst()) readTF(v.getData());
else read(v.getData());
}
}catch(IOException ex){ ex.printStackTrace(); System.exit(0);}
v.setUndef(cd.getUndef(v.getName()));
v.setCommentAndUnit(cd.getVarCommentAndUnit(v.getName()));
}
private void read(float[][][][] data) throws IOException{
raf.seek(skipF);
if(sequential) raf.skipBytes(4);
fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][0][i][0]=buf.getFloat();
for(int j=1;j<y;j++){
raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][j][i][0]=buf.getFloat();
}
for(int k=1;k<z;k++){ raf.seek(skipY+raf.getFilePointer());
for(int j=0;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[k][j][i][0]=buf.getFloat();
}}
if(sequential) raf.skipBytes(4);
for(int l=1;l<t;l++){ raf.seek(skipZ+raf.getFilePointer()); if(sequential) raf.skipBytes(4);
for(int k=0;k<z;k++){ raf.seek(skipY+raf.getFilePointer());
for(int j=0;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[k][j][i][l]=buf.getFloat();
}}if(sequential) raf.skipBytes(4);}
}
private void readYRev(float[][][][] data) throws IOException{
raf.seek(skipF);
if(sequential) raf.skipBytes(4);
fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][y-1][i][0]=buf.getFloat();
for(int j=y-2;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][j][i][0]=buf.getFloat();
}
for(int k=1;k<z;k++){ raf.seek(skipY+raf.getFilePointer());
for(int j=y-1;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[k][j][i][0]=buf.getFloat();
}}
if(sequential) raf.skipBytes(4);
for(int l=1;l<t;l++){ raf.seek(skipZ+raf.getFilePointer()); if(sequential) raf.skipBytes(4);
for(int k=0;k<z;k++){ raf.seek(skipY+raf.getFilePointer());
for(int j=y-1;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[k][j][i][l]=buf.getFloat();
}}if(sequential) raf.skipBytes(4);}
}
private void readZRev(float[][][][] data) throws IOException{
raf.seek(skipF);
if(sequential) raf.skipBytes(4);
fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[z-1][0][i][0]=buf.getFloat();
for(int j=1;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[z-1][j][i][0]=buf.getFloat();
}
for(int k=z-2;k>=0;k--){ raf.seek(skipY);
for(int j=0;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[k][j][i][0]=buf.getFloat();
}}
if(sequential) raf.skipBytes(4);
for(int l=1;l<t;l++){ raf.seek(skipZ+raf.getFilePointer()); if(sequential) raf.skipBytes(4);
for(int k=z-1;k>=0;k--){ raf.seek(skipY+raf.getFilePointer());
for(int j=0;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[k][j][i][l]=buf.getFloat();
}}if(sequential) raf.skipBytes(4);}
}
private void readYRevZRev(float[][][][] data) throws IOException{
raf.seek(skipF);
if(sequential) raf.skipBytes(4);
fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[z-1][y-1][i][0]=buf.getFloat();
for(int j=y-2;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[z-1][j][i][0]=buf.getFloat();
}
for(int k=z-2;k>=0;k--){ raf.seek(skipY+raf.getFilePointer());
for(int j=y-1;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[k][j][i][0]=buf.getFloat();
}}
if(sequential) raf.skipBytes(4);
for(int l=1;l<t;l++){ raf.seek(skipZ+raf.getFilePointer()); if(sequential) raf.skipBytes(4);
for(int k=z-1;k>=0;k--){ raf.seek(skipY+raf.getFilePointer());
for(int j=y-1;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[k][j][i][l]=buf.getFloat();
}}if(sequential) raf.skipBytes(4);}
}
private void readTF(float[][][][] data) throws IOException{
raf.seek(skipF);
if(sequential) raf.skipBytes(4);
fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][0][0][i]=buf.getFloat();
for(int j=1;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][0][j][i]=buf.getFloat();
}
for(int k=1;k<z;k++){ raf.seek(skipY+raf.getFilePointer());
for(int j=0;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][k][j][i]=buf.getFloat();
}}
if(sequential) raf.skipBytes(4);
for(int l=1;l<t;l++){ raf.seek(skipZ+raf.getFilePointer()); if(sequential) raf.skipBytes(4);
for(int k=0;k<z;k++){ raf.seek(skipY+raf.getFilePointer());
for(int j=0;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[l][k][j][i]=buf.getFloat();
}}if(sequential) raf.skipBytes(4);}
}
private void readTFYRev(float[][][][] data) throws IOException{
raf.seek(skipF);
if(sequential) raf.skipBytes(4);
fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][0][y-1][i]=buf.getFloat();
for(int j=y-2;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][0][j][i]=buf.getFloat();
}
for(int k=1;k<z;k++){ raf.seek(skipY+raf.getFilePointer());
for(int j=y-1;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][k][j][i]=buf.getFloat();
}}
if(sequential) raf.skipBytes(4);
for(int l=1;l<t;l++){ raf.seek(skipZ+raf.getFilePointer()); if(sequential) raf.skipBytes(4);
for(int k=0;k<z;k++){ raf.seek(skipY+raf.getFilePointer());
for(int j=y-1;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[l][k][j][i]=buf.getFloat();
}}if(sequential) raf.skipBytes(4);}
}
private void readTFZRev(float[][][][] data) throws IOException{
raf.seek(skipF);
if(sequential) raf.skipBytes(4);
fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][z-1][0][i]=buf.getFloat();
for(int j=1;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][z-1][j][i]=buf.getFloat();
}
for(int k=z-2;k>=0;k--){ raf.seek(skipY+raf.getFilePointer());
for(int j=0;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][k][j][i]=buf.getFloat();
}}
if(sequential) raf.skipBytes(4);
for(int l=1;l<t;l++){ raf.seek(skipZ+raf.getFilePointer()); if(sequential) raf.skipBytes(4);
for(int k=z-1;k>=0;k--){ raf.seek(skipY+raf.getFilePointer());
for(int j=0;j<y;j++){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[l][k][j][i]=buf.getFloat();
}}if(sequential) raf.skipBytes(4);}
}
private void readTFYRevZRev(float[][][][] data) throws IOException{
raf.seek(skipF);
if(sequential) raf.skipBytes(4);
fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][z-1][y-1][i]=buf.getFloat();
for(int j=y-2;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][z-1][j][i]=buf.getFloat();
}
for(int k=z-2;k>=0;k--){ raf.seek(skipY+raf.getFilePointer());
for(int j=y-1;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[0][k][j][i]=buf.getFloat();
}}
if(sequential) raf.skipBytes(4);
for(int l=1;l<t;l++){ raf.seek(skipZ+raf.getFilePointer()); if(sequential) raf.skipBytes(4);
for(int k=z-1;k>=0;k--){ raf.seek(skipY+raf.getFilePointer());
for(int j=y-1;j>=0;j--){ raf.seek(skipX+raf.getFilePointer());
buf.clear(); fc.read(buf); buf.clear();
for(int i=0;i<x;i++)
data[l][k][j][i]=buf.getFloat();
}}if(sequential) raf.skipBytes(4);}
}
}
| [
"Yu-Kun Qian@QYK-PC"
] | Yu-Kun Qian@QYK-PC |
cb5d95a5e10e2dd5520024c93daaa364d87aa4ff | 54ae853846ca68f91ddbca45bf51323c39954320 | /src/main/java/functionNode/VarNode.java | 42ecb097b1bfdff77385f5a76dc5f1b11536e883 | [
"Apache-2.0"
] | permissive | pedroth/Learning | 884ce88416337759218d52929d4d0e047481ef66 | 482677c3a6f43ef0567057111a3af2b4a69cbe4f | refs/heads/master | 2022-01-12T13:04:18.039007 | 2022-01-01T11:29:24 | 2022-01-01T11:29:24 | 20,309,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package functionNode;
public class VarNode extends FunctionNode {
int varNum;
public VarNode(int varNum){
super(0, null);
this.varNum = varNum;
}
@Override
public Double compute(Double[] variables) {
return variables[varNum];
}
/**
* never will be used
*/
@Override
public FunctionNode createNode(FunctionNode[] args) {
// TODO Auto-generated method stub
return null;
}
}
| [
"pedrotiago92@gmail.com"
] | pedrotiago92@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.