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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
82d02d7a17e8011ebd19901802b66e2354c59f75
|
b55835e3160082bc5cae44a47aa8a735b4487cfe
|
/src/test/java/cl/cc/web/rest/ClientForwardControllerTest.java
|
4d972f95a4b337249dba21d90dbd49dc87f1bfa5
|
[] |
no_license
|
CyberCastle/WasteCollectorTracer
|
862923496b292a4d3a6bc39aec98b271e2a2e8dc
|
52e3ce2da0cb4142edc9330b74baa39d7639dd8f
|
refs/heads/master
| 2023-02-04T07:50:23.383164
| 2020-12-22T22:12:38
| 2020-12-22T22:12:38
| 321,176,113
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,783
|
java
|
package cl.cc.web.rest;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.ResultActions;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Unit tests for the {@link ClientForwardController} REST controller.
*/
public class ClientForwardControllerTest {
private MockMvc restMockMvc;
@BeforeEach
public void setup() {
ClientForwardController clientForwardController = new ClientForwardController();
this.restMockMvc = MockMvcBuilders
.standaloneSetup(clientForwardController, new TestController())
.build();
}
@Test
public void getBackendEndpoint() throws Exception {
restMockMvc.perform(get("/test"))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_PLAIN_VALUE))
.andExpect(content().string("test"));
}
@Test
public void getClientEndpoint() throws Exception {
ResultActions perform = restMockMvc.perform(get("/non-existant-mapping"));
perform
.andExpect(status().isOk())
.andExpect(forwardedUrl("/"));
}
@Test
public void getNestedClientEndpoint() throws Exception {
restMockMvc.perform(get("/admin/user-management"))
.andExpect(status().isOk())
.andExpect(forwardedUrl("/"));
}
@Test
public void getWebsocketInfoEndpoint() throws Exception {
restMockMvc.perform(get("/websocket/info"))
.andExpect(status().isNotFound());
}
@Test
public void getWebsocketEndpoint() throws Exception {
restMockMvc.perform(get("/websocket/tracker/308/sessionId/websocket"))
.andExpect(status().isNotFound());
}
@Test
public void getWebsocketFallbackEndpoint() throws Exception {
restMockMvc.perform(get("/websocket/tracker/308/sessionId/xhr_streaming"))
.andExpect(status().isNotFound());
}
@RestController
public static class TestController {
@RequestMapping(value = "/test")
public String test() {
return "test";
}
}
}
|
[
"cybercastle@gmail.com"
] |
cybercastle@gmail.com
|
2c2fcd5cd93c05271f424a42828744d2ce0373bb
|
680bd67e3b058c2a1a54074d000a13843f08c8b4
|
/SVLCTheSis/src/com/svlcthesis/activity/MainActivity.java
|
d52245da62d8b83f35db772def595f9c53575bcd
|
[] |
no_license
|
hiepgaf/Documents
|
023b92a713286a96d6ca379e9018aa4332f747fc
|
d244c4d04013ca310b112bedf52d7bb8c200e6b0
|
refs/heads/master
| 2021-01-10T10:41:27.836054
| 2015-12-08T04:43:15
| 2015-12-08T04:43:33
| 47,231,965
| 0
| 0
| null | 2015-12-08T08:55:48
| 2015-12-02T02:34:51
|
Java
|
UTF-8
|
Java
| false
| false
| 1,921
|
java
|
package com.svlcthesis.activity;
import java.io.File;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.Spinner;
import com.example.svlcthesis.R;
import com.svlc.hieptran.reciever.IOLib;
import com.svlc.hieptran.transmit.Thietlaptruyen;
public class MainActivity extends ActionBarActivity {
private Button send, recieve;
private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS: {
}
break;
default: {
super.onManagerConnected(status);
}
break;
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().hide();
// requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
send = (Button) findViewById(R.id.imageButton1);
recieve = (Button) findViewById(R.id.imageButton2);
send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(MainActivity.this, Thietlaptruyen.class);
startActivity(i);
}
});
recieve.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(MainActivity.this, ReceiverActivity.class);
startActivity(i);
}
});
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_6, this,
mOpenCVCallBack);
}
}
|
[
"hieptran.bka@gmail.com"
] |
hieptran.bka@gmail.com
|
34965d282d99c8d09e72da95173036547837bb12
|
fce7e06265429646c4f9948dadcc6b21ed67d0c1
|
/EasyExchangeApp/app/src/main/java/com/example/easyexchangeapp/HomeFragment.java
|
6fcf39f8dbd9401b267f99f4018211cb7e4f1dde
|
[] |
no_license
|
Rontu22/EasyExchangeApp222
|
d73ad019e30190c60ff082f7a4ba15d554c3c1b8
|
81544c2192e85defe74422c5e7fec76d77c63479
|
refs/heads/main
| 2023-01-06T11:06:12.218441
| 2020-10-29T07:09:38
| 2020-10-29T07:09:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,031
|
java
|
package com.example.easyexchangeapp;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
* Use the {@link HomeFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class HomeFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
public HomeFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment HomeFragment.
*/
// TODO: Rename and change types and number of parameters
public static HomeFragment newInstance(String param1, String param2) {
HomeFragment fragment = new HomeFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_home, container, false);
}
}
|
[
"rontubarhoi01@gmail.com"
] |
rontubarhoi01@gmail.com
|
6a06f275646a20fc2b52e7d511320dbc73b6e1ed
|
1268fe5b0bd9c236b2200d2ee7871480156804a2
|
/Web/AndroidWeb/src/main/java/dao/UserDao.java
|
c33038a018dd866bebbe03f995238f1637b53327
|
[] |
no_license
|
Wenbosi/Android-Knowledge-App
|
096f48b5e45558924b1bdc383952581240470866
|
17763f78087b9dc65d136b71a9392f861a567cf1
|
refs/heads/main
| 2023-07-21T17:56:20.119421
| 2021-08-29T03:02:48
| 2021-08-29T03:02:48
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,317
|
java
|
package dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class UserDao {
public boolean login(String username, String password) {
String sql = "select * from users where username = ? and password = ?";
Connection conn = JDBCUtils.getConn();
if (conn != null) {
try {
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, username);
ps.setString(2, password);
if(ps.executeQuery().next()){
return true;
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return false;
}
public boolean register(User user) {
if (user == null) return false;
String sql = "insert into users(username, password) values (?, ?)";
Connection conn = JDBCUtils.getConn();
if (conn != null) {
try {
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, user.getUsername());
ps.setString(2, user.getPassword());
int value = ps.executeUpdate();
if (value > 0){
return true;
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return false;
}
public User findUser(String username) {
String sql = "select * from users where username = ?";
Connection conn = JDBCUtils.getConn();
User user = null;
if (conn != null) {
try {
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, username);
ResultSet rs = ps.executeQuery();
while (rs.next()){
int id = rs.getInt(1);
String username_db = rs.getString(2);
String password_db = rs.getString(3);
user = new User(id, username_db, password_db);
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return user;
}
}
|
[
"2027387517@qq.com"
] |
2027387517@qq.com
|
f411333bc4bdab1c67a611b2f1c3871b3f0a8554
|
8f24666d19f482aae2230546d967e8579195defb
|
/src/main/java/se/mbaeumer/fxlink/handlers/DatabaseConnectionHandler.java
|
e391fe2b326f808b1640c005f1f968c4690b05df
|
[] |
no_license
|
mbaeumer/fxlink
|
4ca1f733fde2faa1c219ce468fb964a1a01f08d2
|
084e3923ecc115897545dda9500b6f33fad2f7fa
|
refs/heads/master
| 2023-09-06T09:14:37.987739
| 2023-08-28T22:46:56
| 2023-08-28T22:46:56
| 77,602,133
| 0
| 0
| null | 2022-11-26T22:20:54
| 2016-12-29T09:51:33
|
Java
|
UTF-8
|
Java
| false
| false
| 147
|
java
|
package se.mbaeumer.fxlink.handlers;
import java.sql.Connection;
public interface DatabaseConnectionHandler {
Connection getConnection();
}
|
[
"martin.baeumer@gmail.com"
] |
martin.baeumer@gmail.com
|
f7736ba8a1bcb13d0aa1de1069e3d8e475676c96
|
ca9f50003a58ff7eea7eeada579c5c84d0735806
|
/src/main/java/message/CustomizedMessage.java
|
0e3878684cccef837ca6e6773a1469d54dcaf169
|
[] |
no_license
|
kyogoiano/GradleCDITest
|
2d7a08ee5e047ff78220d560fdd9020a93912437
|
046a536cf8618f36b5300d68034f60af61f7ddf0
|
refs/heads/master
| 2021-01-10T08:04:36.286331
| 2015-06-01T21:12:40
| 2015-06-01T21:12:40
| 36,689,194
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 361
|
java
|
package message;
import org.apache.deltaspike.core.api.message.MessageBundle;
import org.apache.deltaspike.core.api.message.MessageContextConfig;
import org.apache.deltaspike.core.api.message.MessageTemplate;
/**
* Created by andrade on 10/04/15.
*/
@MessageBundle
public interface CustomizedMessage {
@MessageTemplate("{hello}")
String hello();
}
|
[
"leandro.ueg@gmail.com"
] |
leandro.ueg@gmail.com
|
709029605f830ad0030a3926139aec2e946ff8e4
|
b7966f4fdd04a066811a0389f4111b0b9014f6ee
|
/app/src/main/java/com/greencross/greencare/util/DeviceUtil.java
|
8e9eef65ce68a1325ddd86f7966eaea88f41ffe7
|
[] |
no_license
|
tddyko/HealthCareSolution
|
f370eb3f23aaa84abdceda16567ccf63f2a4fd82
|
901f65f12f07e4144bed70a66e54f828fecf3fc8
|
refs/heads/master
| 2023-08-23T07:14:31.704097
| 2021-09-25T09:36:09
| 2021-09-25T09:36:09
| 410,231,710
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 14,479
|
java
|
package com.greencross.greencare.util;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Locale;
import java.util.UUID;
/**
* Hunikey (2016. 6. 29.)
*/
public class DeviceUtil {
public static final String TAG = DeviceUtil.class.getSimpleName();
/**
* 장치가 테블릿인지 확인
*
* @param ctx Context
* @return T : 테블릿 F : 일반
*/
public static boolean isTabletDevice(Context ctx) {
Configuration conf = ctx.getResources().getConfiguration();
int screenSize = conf.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
return screenSize > Configuration.SCREENLAYOUT_SIZE_LARGE;
}
/**
* 장치가 네트워크에 연결되었는지 확인
*
* @param context Context
* @return boolean isOnline
*/
public static boolean isOnline(Context context) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo wifi = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
NetworkInfo mobile = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
NetworkInfo bluetooth = cm.getNetworkInfo(ConnectivityManager.TYPE_BLUETOOTH);
NetworkInfo lte = cm.getNetworkInfo(ConnectivityManager.TYPE_WIMAX);
boolean isConnected = false;
if ((wifi != null && wifi.isConnected()) || (mobile != null && mobile.isConnected()) || (bluetooth != null && bluetooth.isConnected()) || (lte != null && lte.isConnected())) {
isConnected = true;
}
return isConnected;
}
/**
* WIFI접속 여부 체크
*
* @param ctx Context
* @return T wifi접속/F wifi접속 아님
*/
public static boolean isWifiMode(Context ctx) {
ConnectivityManager m_NetConnectMgr = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo info = m_NetConnectMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
return info.isConnected();
}
/**
* 3G접속인가
*
* @param ctx Context
* @return T : 3g 상태/ F : 3g 아님
*/
public static boolean is3GConnection(Context ctx) {
ConnectivityManager m_NetConnectMgr = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo info = m_NetConnectMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
return (info != null && info.isConnected());
}
/**
* 4G접속인가
*
* @param ctx Context
* @return T : 4g 상태/ F : 4g 아님
*/
public static boolean is4GConnection(Context ctx) {
ConnectivityManager m_NetConnectMgr = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo info = m_NetConnectMgr.getNetworkInfo(ConnectivityManager.TYPE_WIMAX);
return (info != null && info.isConnected());
}
/**
* 해당 APP의 versionName 가져옴
*
* @param ctx Context
* @return String versionName;
*/
public static String getAppVerion(Context ctx) {
PackageInfo pki;
String rtnVersion = "";
try {
pki = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
rtnVersion = pki.versionName;
} catch (PackageManager.NameNotFoundException e) {
Logger.e(e);
}
return rtnVersion;
}
/**
* 폰 os version
*
* @return String
*/
public static String getPhoneOsVersion() {
return Build.VERSION.RELEASE;
}
public static String getPhoneModelName() {
return Build.MODEL;
}
/**
* density 얻기
*
* @param context Context
* @return String
*/
public static String getDensityName(Context context) {
float density = context.getResources().getDisplayMetrics().density;
// density 범위로 값을 구해야 한다.
String dpi = "xhdpi";
if (density > 3.0)
dpi = "xxxhdpi";
else if (density > 2.0)
dpi = "xxhdpi";
else if (density > 1.5)
dpi = "xhdpi";
else if (density > 1.0)
dpi = "hdpi";
else if (density > 0.75)
dpi = "mdpi";
else if (density <= 0.75)
dpi = "ldpi";
return dpi;
}
/**
* 안드로이드 6.0 대응(WifiManager 로 맥주소 추출안됨)
* 안드로이드ID 가져오기
*
* @param ctx Context
* @return 16자리 대문자 안드로이드 ID
*/
private static String getUDIDForM(Context ctx) {
return Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID).toUpperCase(Locale.getDefault());
}
/**
* chipSerial 얻기
*
* @param ctx Context
* @return String
*/
public static String getUDID(Context ctx) {
String chipSerial = Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID);
return chipSerial;
}
/**
* 현재 앱의 버전이름을 반환
*
* @return String
* @since : 2013. 5. 9.
*/
public static String getVersionName(Context ctx) {
String result = "";
try {
result = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e) {
Logger.e(e);
}
return result;
}
/**
* PhoneID얻기
*
* @return String
*/
public static String getPhoneID(Context ctx) {
final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
final String tmDevice, tmSerial, androidId;
tmDevice = "" + tm.getDeviceId();
tmSerial = "" + tm.getSimSerialNumber();
androidId = "" + Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());
return deviceUuid.toString();
}
/**
* 폰 OS가 기준버전 이상이면 true
*
* @param release1 Build.VERSION.RELEASE 에 해당하는 정보
* @return 기준버전 이상이면 true
*/
public static boolean afterOsVersion(String release1) {
String[] split1 = release1.split("\\.");
String release2 = Build.VERSION.RELEASE;
String[] split2 = release2.split("\\.");
int len = 0;
if (split1.length > split2.length) len = split2.length;
else len = split1.length;
for (int i = 0; i < len; i++) {
if (Integer.valueOf(split1[i]) > Integer.valueOf(split2[i])) return false;
else if (Integer.valueOf(split1[i]) < Integer.valueOf(split2[i])) return true;
}
if (split1.length > split2.length) return false;
return true;
}
/**
* ssoKey발급을 위해 필요한 PhoneID 구함.
*
* @return String sso device id
*/
public static String getSsoPhoneID(Context ctx) {
final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
String result = tm.getDeviceId();
if (result != null && !result.equals("")) {
return result;
} else {
final String tmDevice, tmSerial, androidId;
tmDevice = "" + tm.getDeviceId();
tmSerial = "" + tm.getSimSerialNumber();
androidId = "" + Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());
return deviceUuid.toString().substring(0, 15);
}
}
/**
* 지역 설정을 변경
*
* @param activity 변경될 Activity
* @param character 바뀔 locale code
*/
public static void setLocale(final Activity activity, String character) {
Locale locale = new Locale(character);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
activity.getResources().updateConfiguration(config, activity.getResources().getDisplayMetrics());
}
/**
* 뷰 그룹을 다시 그림
*
* @param context 현제 context
* @param root 업데이트될 뷰 그룹
* @throws Exception
*/
public static void setRefreshViewGroup(Context context, ViewGroup root) throws Exception {
for (int i = 0; i < root.getChildCount(); i++) {
View child = root.getChildAt(i);
if (child instanceof TextView) {
if (child.getTag() != null) {
if (((TextView) child).getText() != null && ((TextView) child).getText().toString().length() > 0) {
int stringId = getResourceId(context, child.getTag());
((TextView) child).setText(stringId);
}
if (((TextView) child).getHint() != null && ((TextView) child).getHint().toString().length() > 0) {
int hintId = getResourceId(context, child.getTag());
((TextView) child).setHint(hintId);
}
}
} else if (child instanceof ViewGroup) setRefreshViewGroup(context, (ViewGroup) child);
}
}
public static int getResourceId(Context context, Object tag) {
return context.getResources().getIdentifier((String) tag, "string", context.getPackageName());
}
/**
* 앱설치여부체크
*/
public static boolean isAppInstalled(Context ctx, String pkgName) {
boolean appInstalled = false;
try {
ctx.getPackageManager().getPackageInfo(pkgName, PackageManager.GET_ACTIVITIES);
appInstalled = true;
} catch (PackageManager.NameNotFoundException e) {
Logger.e(e);
}
return appInstalled;
}
public static String getProductName() {
return Build.PRODUCT;
}
/**
* 디바이스 정보를 가져온다.
*
* @param ctx Context
* @param pageId 태블릿에서 메인/컨텐츠 웹뷰 가로사이즈 처리하기 위해 추가됨.
* @return String
*/
public static String getDeviceInfo(Context ctx, String pageId) {
JSONObject result = new JSONObject();
try {
result.put("uuid", getUDID(ctx));
result.put("version", getPhoneOsVersion());
result.put("platform", "Android");
result.put("devicetype", isTabletDevice(ctx) ? "tablet" : "phone");
result.put("frdNm", DeviceUtil.getProductName());
float tabletWebviewWidth = 0;
Logger.d(TAG, "tabletWebviewWidth[" + tabletWebviewWidth + "]");
result.put("tabletWebviewWidth", tabletWebviewWidth);
} catch (JSONException e) {
}
return result.toString();
}
/**
* 특정단말에서 OS Icon push count 표시 변경.
*
* @param ctx Context
* @param cnt 표시할 갯수
*/
public static void resetPushIconState(Context ctx, int cnt) {
Intent intent_badge = new Intent("android.intent.action.BADGE_COUNT_UPDATE");
intent_badge.putExtra("badge_count", cnt);
// 메인메뉴에 나타나는 어플의 패키지명
intent_badge.putExtra("badge_count_package_name", ctx.getPackageName());
// 메인메뉴에 나타나는 어플의 클래스명
//2015.12.23 스타뱅킹3.0 에서 붙은 뱃지 변경을 위해 수정 - T003046
intent_badge.putExtra("badge_count_class_name", "com.greencross.UI.CIntro");
//intent_badge.putExtra("badge_count_class_name", Intro.class.getCardName());
ctx.sendBroadcast(intent_badge);
}
public static String getServiceVender(Context ctx) {
TelephonyManager systemService = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
return systemService.getNetworkOperatorName();
}
/**
* 폰번호 얻기
*
* @param ctx Context
* @return String
*/
public static String getPhoneNumber(Context ctx) {
TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
String phoneNumber = tm.getLine1Number();
if ((phoneNumber != null) && (!phoneNumber.equals(""))) {
boolean codeCheck = phoneNumber.startsWith("+82");
if (codeCheck) {
String cut = phoneNumber.substring(0, 3);
phoneNumber = phoneNumber.replace(cut, "0");
}
}
return phoneNumber;
}
/**
* USIM 일련번호 가져오기
*
* @param cont Context
* @return String
*/
public static String getSimSerialNumber(Context cont) {
TelephonyManager operator = (TelephonyManager) cont.getSystemService(Context.TELEPHONY_SERVICE);
return operator.getSimSerialNumber();
}
/**
* UICC-ID (USIM 일련번호 앞뒤 2자리씩 삭제 가져오기)
*
* @param cont Context
* @return String
*/
public static String getUiccId(Context cont) {
TelephonyManager operator = (TelephonyManager) cont.getSystemService(Context.TELEPHONY_SERVICE);
String uiccId = operator.getSimSerialNumber();
if (uiccId != null && uiccId.length() >= 18) {
uiccId = uiccId.substring(2, 18);
}
return uiccId;
}
/**
* IMEI 값을 가져오기
*
* @param context 컨텍스트 정보
* @return IMEI 값
*/
public static String getDeviceId(Context context) {
TelephonyManager telManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
return telManager.getDeviceId();
}
}
|
[
"corian1516@gmail.com"
] |
corian1516@gmail.com
|
9c493641ab9b4f781ef7990d961b27461d6e3883
|
e660d52b80a04b6c75c477c60ae5ff4e1ed4f90c
|
/src/gui/GameFrame.java
|
1d6f8bdab80b43c17afe72fc6f5d73a10a108c69
|
[] |
no_license
|
stephb23/CP2406Assignment
|
06585f69a9e74610fe0f71ba614afca3b14d03e6
|
164436730887ed1f4fea4a08d0c8bd570e1a7a78
|
refs/heads/master
| 2021-05-03T16:14:34.164836
| 2016-10-24T11:37:19
| 2016-10-24T11:37:19
| 67,175,612
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,415
|
java
|
package gui;
import cards.Card;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
import java.util.ArrayList;
/**
* Created by Stephanie on 19/10/2016.
*
* This frame holds the game set up and game play panels, and performs updates where required
*
*/
public class GameFrame extends JFrame {
private int numberOfPlayers;
private String playerName;
private Font titleFont = new Font("Monotype Corsiva", Font.PLAIN, 48);
private JLabel setUpTitle = new JLabel("Set Up a Game");
private JPanel setUpTitlePanel = new JPanel();
private GameSetupPanel gameSetupPanel = new GameSetupPanel();
private GamePanel gamePanel = null;
private JPanel setUpPanel;
private Color background = new Color(28, 103, 116);
private boolean enabled;
public GameFrame() {
setDefaultCloseOperation(EXIT_ON_CLOSE);
setTitle("Set Up a Game");
setResizable(false);
setSize(700, 300);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);
setUpTitle.setFont(titleFont);
setUpTitle.setForeground(Color.WHITE);
setUpTitlePanel.setBackground(background);
setUpTitlePanel.add(setUpTitle);
setUpPanel = new JPanel();
setUpPanel.setLayout(new FlowLayout());
setUpPanel.setBackground(background);
setUpPanel.add(setUpTitlePanel);
setUpPanel.add(gameSetupPanel);
add(setUpPanel);
setVisible(true);
}
public String getPlayerName() {
playerName = gameSetupPanel.getPlayerName();
return playerName;
}
public int getNumberOfPlayers() {
numberOfPlayers = gameSetupPanel.getNumberOfPlayers();
return numberOfPlayers;
}
public void prepareGamePanel() {
remove(setUpPanel);
setTitle("GAME TIME!");
gamePanel = new GamePanel();
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
setSize(dim.width, dim.height);
setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);
add(gamePanel);
setVisible(true);
}
public void drawPlayerHand(ArrayList<Card> playerHand) {
gamePanel.drawCardPanel(playerHand);
validate();
repaint();
}
public void drawAIPlayers(int numberOfAIPlayers) {
gamePanel.drawAIPlayers(numberOfAIPlayers);
}
public void drawActiveAIPlayer(int player) {
gamePanel.drawActiveAIPlayer(player);
}
public void drawInactiveAIPlayer(int player) {
gamePanel.drawInactiveAIPlayer(player);
}
public void drawOutAIPlayer(int player, String string) {
gamePanel.drawOutAIPlayer(player, string);
}
public void updateCurrentCard(Card currentCard) {
gamePanel.updateCurrentCard(currentCard);
super.revalidate();
super.repaint();
revalidate();
repaint();
}
public void updateMessage(String string) {
gamePanel.updateMessage(string);
}
public void clearDeckPanel() {
gamePanel.clearDeckPanel();
}
public void disablePanel() {
enabled = false;
}
public void enablePanel() {
enabled = true;
}
public boolean isPanelEnabled() {
return enabled;
}
}
|
[
"stephanie.baker@my.jcu.edu.au"
] |
stephanie.baker@my.jcu.edu.au
|
b1f2ea54b01933e1c12c5497be0b2e54d924d5e5
|
b0120a5510d30b988df8abdf282b1bc916354a94
|
/DecisionTree/src/Tree.java
|
6dab6f9078f10edb59e515317b5ae5e23fbf3457
|
[] |
no_license
|
MuratTaze/DecisionTree
|
41275662fc9b43142ec81b367c34decd9660bd36
|
af99b2f88d327640d05ba59417bb4dced3957866
|
refs/heads/master
| 2021-01-18T22:00:53.776745
| 2016-05-24T14:51:29
| 2016-05-24T14:51:29
| 52,219,327
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 362
|
java
|
import java.util.ArrayList;
public class Tree {
public Tree leftChild;
public Tree rightChild;
public Split split;
public ArrayList<Instance> data;
public int label;
public boolean isLeaf;
public Tree() {
super();
data = new ArrayList<Instance>();
leftChild = null;
rightChild = null;
label = -1;
isLeaf = false;
}
}
|
[
"murat@DESKTOP-2IFES4O"
] |
murat@DESKTOP-2IFES4O
|
c1d1b6f8ae36d7e2557c0fec38877fdc3693ce5f
|
c58bbc813b8d7bb719d34685105fe3300f0b693a
|
/app/src/main/java/com/anmas/star/calculation/MainActivity.java
|
9b64bfbd133c92cfdef8c454f2fefc03f8544b68
|
[] |
no_license
|
cytangjoseph/CelestialNavCalc
|
bddabb6af38e9ff543bcd7361fe154ad20f0ab00
|
5aa80e3dfaf2ffe6b9c0bc4c42d48b5e1c0d6717
|
refs/heads/master
| 2020-12-01T15:56:26.463589
| 2016-05-17T04:34:19
| 2016-05-17T04:34:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 12,374
|
java
|
package com.anmas.star.calculation;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.anmas.starcalc.R;
public class MainActivity extends ActionBarActivity {
private String signDegree;
private String signMinute;
private String[] northSouth;
private String[] eastWest;
/*Views*/
private EditText editTextDegreeDelta, editTextMinuteDelta;
private EditText editTextDegreeTm, editTextMinuteTm;
private EditText editTextDegreeFic, editTextMinuteFic;
private Spinner spinNorthSouthDelta, spinEastWestTm, spinNorthSouthFic;
private TextView textViewAnswerHc, textViewAnswerAc;
private AdapterView.OnItemSelectedListener onSpinnerItemClickListener = new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
doIt();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
signDegree = getResources().getString(R.string.sign_degree);
signMinute = getResources().getString(R.string.sign_minute);
northSouth = getResources().getStringArray(R.array.spin_ns);
eastWest = getResources().getStringArray(R.array.spin_ew);
initViews();
setListeners();
Toast.makeText(this, getResources().getString(R.string.err_empty_field), Toast.LENGTH_SHORT).show();
}
private void initViews() {
editTextDegreeDelta = (EditText) findViewById(R.id.delta_degree);
editTextMinuteDelta = (EditText) findViewById(R.id.delta_minute);
editTextDegreeTm = (EditText) findViewById(R.id.tm_degree);
editTextMinuteTm = (EditText) findViewById(R.id.tm_minute);
editTextDegreeFic = (EditText) findViewById(R.id.fic_degree);
editTextMinuteFic = (EditText) findViewById(R.id.fic_minute);
spinNorthSouthDelta = (Spinner) findViewById(R.id.delta_ns);
spinEastWestTm = (Spinner) findViewById(R.id.tm_ew);
spinNorthSouthFic = (Spinner) findViewById(R.id.fic_ns);
textViewAnswerHc = (TextView) findViewById(R.id.hc);
textViewAnswerAc = (TextView) findViewById(R.id.Ac);
ArrayAdapter adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, northSouth);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinNorthSouthDelta.setAdapter(adapter);
spinNorthSouthDelta.setOnItemSelectedListener(onSpinnerItemClickListener);
spinNorthSouthFic.setAdapter(adapter);
spinNorthSouthFic.setOnItemSelectedListener(onSpinnerItemClickListener);
adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, eastWest);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinEastWestTm.setAdapter(adapter);
spinEastWestTm.setOnItemSelectedListener(onSpinnerItemClickListener);
}
private void setListeners() {
editTextDegreeDelta.addTextChangedListener(new MyTextWatcher(
editTextDegreeDelta));
editTextDegreeTm.addTextChangedListener(new MyTextWatcher(
editTextDegreeTm));
editTextDegreeFic.addTextChangedListener(new MyTextWatcher(
editTextDegreeFic));
editTextMinuteDelta.addTextChangedListener(new MyTextWatcher(
editTextMinuteDelta));
editTextMinuteTm.addTextChangedListener(new MyTextWatcher(
editTextMinuteTm));
editTextMinuteFic.addTextChangedListener(new MyTextWatcher(
editTextMinuteFic));
}
private void doIt() {
if (!allTextFieldsAreFilled())
return;
Input input = readInput();
if (input == null)
return;
Result result = calculate(input);
textViewAnswerHc.setText(result.hc);
textViewAnswerAc.setText(result.ac);
}
private Input readInput() {
Double delta, tm, fic;
try {
double delta_degree = Double.parseDouble(editTextDegreeDelta
.getText().toString());
double delta_minute = Double.parseDouble(editTextMinuteDelta
.getText().toString());
double tm_degree = Double.parseDouble(editTextDegreeTm.getText()
.toString());
double tm_minute = Double.parseDouble(editTextMinuteTm.getText()
.toString());
double fic_degree = Double.parseDouble(editTextDegreeFic.getText()
.toString());
double fic_minute = Double.parseDouble(editTextMinuteFic.getText()
.toString());
delta = delta_degree + delta_minute / 60.0d;
tm = tm_degree + tm_minute / 60.0d;
fic = fic_degree + fic_minute / 60.0d;
} catch (NumberFormatException e) {
if (allTextFieldsAreFilled())
Toast.makeText(this, getResources().getString(R.string.err_input), Toast.LENGTH_SHORT).show();
else
Toast.makeText(this, getResources().getString(R.string.err_empty_field), Toast.LENGTH_SHORT).show();
clearResults();
return null;
}
Direction directionDelta = readSpinners(spinNorthSouthDelta);
Direction directionTm = readSpinners(spinEastWestTm);
Direction directionFic = readSpinners(spinNorthSouthFic);
if (directionDelta == Direction.SOUTH)
delta *= -1.0d;
if (directionTm == Direction.WEST)
tm *= -1.0d;
if (directionFic == Direction.SOUTH)
fic *= -1.0d;
return new Input(delta, directionDelta, tm, directionTm, fic,
directionFic);
}
private boolean allTextFieldsAreFilled() {
return isTextViewFilled(editTextDegreeDelta) &&
isTextViewFilled(editTextMinuteDelta) &&
isTextViewFilled(editTextDegreeTm) &&
isTextViewFilled(editTextMinuteTm) &&
isTextViewFilled(editTextDegreeFic) &&
isTextViewFilled(editTextMinuteFic);
}
private boolean isTextViewFilled(TextView view) {
return view.getText().toString().length() > 0;
}
private Direction readSpinners(Spinner v) {
int selected = v.getSelectedItemPosition();
switch (selected) {
case 0:
if ((v.getId() == R.id.fic_ns) | (v.getId() == R.id.delta_ns))
return Direction.NORTH;
if (v.getId() == R.id.tm_ew)
return Direction.EAST;
break;
case 1:
if ((v.getId() == R.id.fic_ns) | (v.getId() == R.id.delta_ns))
return Direction.SOUTH;
if (v.getId() == R.id.tm_ew)
return Direction.WEST;
break;
}
return null;
}
private Result calculate(Input inputData) {
Double delta = Math.toRadians(inputData.delta);
Double tm = Math.toRadians(inputData.tm);
Double fic = Math.toRadians(inputData.fic);
Double hc, ac;
String result_hc, result_ac;
hc = Math.asin(Math.sin(fic) * Math.sin(delta) + Math.cos(fic)
* Math.cos(delta) * Math.cos(tm));
ac = Math.toDegrees(Math.acos((Math.sin(delta) - Math.sin(fic)
* Math.sin(hc))
/ (Math.cos(hc) * Math.cos(fic))));
hc = Math.toDegrees(hc);
result_hc = formatHc(hc);
result_ac = formatAc(ac, inputData);
return new Result(result_hc, result_ac);
}
private String formatHc(Double hc) {
return String.format("%2.0f", Math.floor(hc)) + signDegree + " "
+ String.format("%.1f", (hc - Math.floor(hc)) * 60)
+ signMinute;
}
private String formatAc(Double ac, Input inputData) {
String tempAc = String.format("%2.0f", Math.floor(ac)) + signDegree
+ " " + String.format("%.1f", (ac - Math.floor(ac)) * 60)
+ signMinute;
tempAc += " N";
if (inputData.directionTm == Direction.WEST)
tempAc += "W";
else
tempAc += "E";
return tempAc;
}
private void clearAllFields() {
editTextDegreeDelta.setText("");
editTextMinuteDelta.setText("");
editTextDegreeTm.setText("");
editTextMinuteTm.setText("");
editTextDegreeFic.setText("");
editTextMinuteFic.setText("");
clearResults();
}
private void clearResults() {
textViewAnswerHc.setText("");
textViewAnswerAc.setText("");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.act_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_clear:
clearAllFields();
break;
}
return super.onOptionsItemSelected(item);
}
private enum Direction {
NORTH, SOUTH, EAST, WEST
}
private class Input {
Double delta;
Double tm;
Double fic;
Direction directionDelta, directionTm, directionFic;
public Input(Double delta, Direction directionDelta, Double tm,
Direction directionTm, Double fic, Direction directionFic) {
this.delta = delta;
this.tm = tm;
this.fic = fic;
this.directionDelta = directionDelta;
this.directionTm = directionTm;
this.directionFic = directionFic;
}
}
private class Result {
String hc;
String ac;
public Result(String hc, String ac) {
this.hc = hc;
this.ac = ac;
}
}
private class MyTextWatcher implements TextWatcher {
private View v;
private Double value;
MyTextWatcher(View v) {
this.v = v;
}
@Override
public void afterTextChanged(Editable s) {
String string = String.valueOf(s);
try {
value = Double.valueOf(string);
} catch (NumberFormatException e) {
clearResults();
return;
}
switch (v.getId()) {
case R.id.fic_degree:
if (value > 89.0d)
editTextDegreeFic.setText("89");
break;
case R.id.tm_degree:
if (value > 179.0d)
editTextDegreeTm.setText("179");
break;
case R.id.delta_degree:
if (value > 89.0d)
editTextDegreeDelta.setText("89");
break;
case R.id.fic_minute:
if (value > 59.9d)
editTextMinuteFic.setText("59.9");
break;
case R.id.tm_minute:
if (value > 59.9d)
editTextMinuteTm.setText("59.9");
break;
case R.id.delta_minute:
if (value > 59.9d)
editTextMinuteDelta.setText("59.9");
break;
}
doIt();
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
}
}
}
|
[
"andrew.masalykin@gmail.com"
] |
andrew.masalykin@gmail.com
|
a17b2f66bf17e501a7f6df65a9eb37a5bdc6e18a
|
e4656f742ec0b4ba38169a71288b6a34df220479
|
/core/src/main/java/com/bnsf/drools/poc/events/BNSFEvent.java
|
9f2f226d153789904b14d5a8ec23e5c55789fe33
|
[] |
no_license
|
kanigicharla8/poc_web
|
ca286153a5152bbd409bcbcd1db09ce817899c30
|
2122cfd1265208522f1721d8898f2de98f6d8f63
|
refs/heads/master
| 2021-01-10T09:35:56.592082
| 2015-10-12T04:11:44
| 2015-10-12T04:11:44
| 44,081,645
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 152
|
java
|
package com.bnsf.drools.poc.events;
import java.io.Serializable;
/**
*
* @author rakesh
*
*/
public interface BNSFEvent extends Serializable{
}
|
[
"gupta78@gmail.com"
] |
gupta78@gmail.com
|
66103f3a2fe5d216d75b6309d3ba880927c9cb0b
|
204d2214e7c9a0bda5e2161f840d3330d8730974
|
/lft/Lab/Esercizi/Es05_traduttore/Es05_03/src/Token.java
|
f311ac468e99e7951a13bb37a9e82b73c5de9723
|
[] |
no_license
|
andreadlm/unito
|
dd8135e1c47f1100d2fcbec9d7215c79547f4c60
|
fa3e74b0de96dbd3098bfdbdc2537caea7651000
|
refs/heads/master
| 2022-02-28T17:43:47.039257
| 2022-02-16T09:42:28
| 2022-02-16T09:42:28
| 213,619,211
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 559
|
java
|
public class Token {
public final int tag;
public Token(int t) { tag = t; }
public String toString() { return "<" + tag + ">"; }
public static final Token
not = new Token('!'),
lpt = new Token('('),
rpt = new Token(')'),
lpg = new Token('{'),
rpg = new Token('}'),
plus = new Token('+'),
minus = new Token('-'),
mult = new Token('*'),
div = new Token('/'),
assign = new Token('='),
semicolon = new Token(';');
}
|
[
"delmastro2000@gmail.com"
] |
delmastro2000@gmail.com
|
4d2d8a28e1a43fd6399a8c1c36076366466fa417
|
6b9845e153d319ec1caabf69ed22f7fd542bf376
|
/src/chess/ChessMatch.java
|
1c0b6c267182af4ec99a5ed9f41c8c0ebbc32ea3
|
[] |
no_license
|
DylanPachecoCoder/jogoXadrez
|
04ae8d7de5d013cefda6abd3a89411aa41b520c9
|
229a2673cd78105e186c1a8eebe8681f6d214225
|
refs/heads/master
| 2020-06-28T18:28:29.367248
| 2019-08-07T05:04:30
| 2019-08-07T05:04:30
| 200,308,434
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 10,581
|
java
|
package chess;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import boardgame.Board;
import boardgame.Piece;
import boardgame.Position;
import chess.pieces.Bishop;
import chess.pieces.King;
import chess.pieces.Knight;
import chess.pieces.Pawn;
import chess.pieces.Queen;
import chess.pieces.Rook;
public class ChessMatch {
private int turn;
private Color currentPlayer;
private Board board;
private boolean check;
private boolean checkMate;
private ChessPiece enPassantVulnerable;
private List<Piece> piecesOnTheBoard = new ArrayList<>();
private List<Piece> capturedPieces = new ArrayList<>();
public ChessMatch() {
board = new Board(8, 8);
turn = 1;
currentPlayer = Color.WHITE;
initialSetup();
}
public int getTurn() {
return turn;
}
public Color getCurrentPlayer() {
return currentPlayer;
}
public boolean getCheck() {
return check;
}
public boolean getCheckMate() {
return checkMate;
}
public ChessPiece getEnPassantVulnerable() {
return enPassantVulnerable;
}
public ChessPiece[][] getPieces() {
ChessPiece[][] mat = new ChessPiece[board.getRows()][board.getColumns()];
for (int i=0; i<board.getRows(); i++) {
for (int j=0; j<board.getColumns(); j++) {
mat[i][j] = (ChessPiece) board.piece(i, j);
}
}
return mat;
}
public boolean[][] possibleMoves(ChessPosition sourcePosition) {
Position position = sourcePosition.toPosition();
validateSourcePosition(position);
return board.piece(position).possibleMoves();
}
public ChessPiece performChessMove(ChessPosition sourcePosition, ChessPosition targetPosition) {
Position source = sourcePosition.toPosition();
Position target = targetPosition.toPosition();
validateSourcePosition(source);
validateTargetPosition(source, target);
Piece capturedPiece = makeMove(source, target);
if (testCheck(currentPlayer)) {
undoMove(source, target, capturedPiece);
throw new ChessException("You can't put yourself in check");
}
ChessPiece movedPiece = (ChessPiece)board.piece(target);
check = (testCheck(opponent(currentPlayer))) ? true : false;
if (testCheckMate(opponent(currentPlayer))) {
checkMate = true;
}
else {
nextTurn();
}
// #specialmove en passant
if (movedPiece instanceof Pawn && (target.getRow() == source.getRow() - 2 || target.getRow() == source.getRow() + 2)) {
enPassantVulnerable = movedPiece;
}
else {
enPassantVulnerable = null;
}
return (ChessPiece)capturedPiece;
}
private Piece makeMove(Position source, Position target) {
ChessPiece p = (ChessPiece)board.removePiece(source);
p.increaseMoveCount();
Piece capturedPiece = board.removePiece(target);
board.placePiece(p, target);
if (capturedPiece != null) {
piecesOnTheBoard.remove(capturedPiece);
capturedPieces.add(capturedPiece);
}
// #specialmove castling kingside rook
if (p instanceof King && target.getColumn() == source.getColumn() + 2) {
Position sourceT = new Position(source.getRow(), source.getColumn() + 3);
Position targetT = new Position(source.getRow(), source.getColumn() + 1);
ChessPiece rook = (ChessPiece)board.removePiece(sourceT);
board.placePiece(rook, targetT);
rook.increaseMoveCount();
}
// #specialmove castling queenside rook
if (p instanceof King && target.getColumn() == source.getColumn() - 2) {
Position sourceT = new Position(source.getRow(), source.getColumn() - 4);
Position targetT = new Position(source.getRow(), source.getColumn() - 1);
ChessPiece rook = (ChessPiece)board.removePiece(sourceT);
board.placePiece(rook, targetT);
rook.increaseMoveCount();
}
// #specialmove en passant
if (p instanceof Pawn) {
if (source.getColumn() != target.getColumn() && capturedPiece == null) {
Position pawnPosition;
if (p.getColor() == Color.WHITE) {
pawnPosition = new Position(target.getRow() + 1, target.getColumn());
}
else {
pawnPosition = new Position(target.getRow() - 1, target.getColumn());
}
capturedPiece = board.removePiece(pawnPosition);
capturedPieces.add(capturedPiece);
piecesOnTheBoard.remove(capturedPiece);
}
}
return capturedPiece;
}
private void undoMove(Position source, Position target, Piece capturedPiece) {
ChessPiece p = (ChessPiece)board.removePiece(target);
p.decreaseMoveCount();
board.placePiece(p, source);
if (capturedPiece != null) {
board.placePiece(capturedPiece, target);
capturedPieces.remove(capturedPiece);
piecesOnTheBoard.add(capturedPiece);
}
// #specialmove castling kingside rook
if (p instanceof King && target.getColumn() == source.getColumn() + 2) {
Position sourceT = new Position(source.getRow(), source.getColumn() + 3);
Position targetT = new Position(source.getRow(), source.getColumn() + 1);
ChessPiece rook = (ChessPiece)board.removePiece(targetT);
board.placePiece(rook, sourceT);
rook.decreaseMoveCount();
}
// #specialmove castling queenside rook
if (p instanceof King && target.getColumn() == source.getColumn() - 2) {
Position sourceT = new Position(source.getRow(), source.getColumn() - 4);
Position targetT = new Position(source.getRow(), source.getColumn() - 1);
ChessPiece rook = (ChessPiece)board.removePiece(targetT);
board.placePiece(rook, sourceT);
rook.decreaseMoveCount();
}
// #specialmove en passant
if (p instanceof Pawn) {
if (source.getColumn() != target.getColumn() && capturedPiece == enPassantVulnerable) {
ChessPiece pawn = (ChessPiece)board.removePiece(target);
Position pawnPosition;
if (p.getColor() == Color.WHITE) {
pawnPosition = new Position(3, target.getColumn());
}
else {
pawnPosition = new Position(4, target.getColumn());
}
board.placePiece(pawn, pawnPosition);
}
}
}
private void validateSourcePosition(Position position) {
if (!board.thereIsAPiece(position)) {
throw new ChessException("There is no piece on source position");
}
if (currentPlayer != ((ChessPiece)board.piece(position)).getColor()) {
throw new ChessException("The chosen piece is not yours");
}
if (!board.piece(position).isThereAnyPosition()) {
throw new ChessException("There is no possible moves for the chosen piece");
}
}
private void validateTargetPosition(Position source, Position target) {
if (!board.piece(source).possibleMoves(target)) {
throw new ChessException("The chosen piece can't move to target position");
}
}
private void nextTurn() {
turn++;
currentPlayer = (currentPlayer == Color.WHITE) ? Color.BLACK : Color.WHITE;
}
private Color opponent(Color color) {
return (color == Color.WHITE) ? Color.BLACK : Color.WHITE;
}
private ChessPiece king(Color color) {
List<Piece> list = piecesOnTheBoard.stream().filter(x -> ((ChessPiece)x).getColor() == color).collect(Collectors.toList());
for (Piece p : list) {
if (p instanceof King) {
return (ChessPiece)p;
}
}
throw new IllegalStateException("There is no " + color + " king on the board");
}
private boolean testCheck(Color color) {
Position kingPosition = king(color).getChessPosition().toPosition();
List<Piece> opponentPieces = piecesOnTheBoard.stream().filter(x -> ((ChessPiece)x).getColor() == opponent(color)).collect(Collectors.toList());
for (Piece p : opponentPieces) {
boolean[][] mat = p.possibleMoves();
if (mat[kingPosition.getRow()][kingPosition.getColumn()]) {
return true;
}
}
return false;
}
private boolean testCheckMate(Color color) {
if (!testCheck(color)) {
return false;
}
List<Piece> list = piecesOnTheBoard.stream().filter(x -> ((ChessPiece)x).getColor() == color).collect(Collectors.toList());
for (Piece p : list) {
boolean[][] mat = p.possibleMoves();
for (int i=0; i<board.getRows(); i++) {
for (int j=0; j<board.getColumns(); j++) {
if (mat[i][j]) {
Position source = ((ChessPiece)p).getChessPosition().toPosition();
Position target = new Position(i, j);
Piece capturedPiece = makeMove(source, target);
boolean testCheck = testCheck(color);
undoMove(source, target, capturedPiece);
if (!testCheck) {
return false;
}
}
}
}
}
return true;
}
private void placeNewPiece(char column, int row, ChessPiece piece) {
board.placePiece(piece, new ChessPosition(column, row).toPosition());
piecesOnTheBoard.add(piece);
}
private void initialSetup() {
placeNewPiece('a', 1, new Rook(board, Color.WHITE));
placeNewPiece('b', 1, new Knight(board, Color.WHITE));
placeNewPiece('c', 1, new Bishop(board, Color.WHITE));
placeNewPiece('d', 1, new Queen(board, Color.WHITE));
placeNewPiece('e', 1, new King(board, Color.WHITE, this));
placeNewPiece('f', 1, new Bishop(board, Color.WHITE));
placeNewPiece('g', 1, new Knight(board, Color.WHITE));
placeNewPiece('h', 1, new Rook(board, Color.WHITE));
placeNewPiece('a', 2, new Pawn(board, Color.WHITE, this));
placeNewPiece('b', 2, new Pawn(board, Color.WHITE, this));
placeNewPiece('c', 2, new Pawn(board, Color.WHITE, this));
placeNewPiece('d', 2, new Pawn(board, Color.WHITE, this));
placeNewPiece('e', 2, new Pawn(board, Color.WHITE, this));
placeNewPiece('f', 2, new Pawn(board, Color.WHITE, this));
placeNewPiece('g', 2, new Pawn(board, Color.WHITE, this));
placeNewPiece('h', 2, new Pawn(board, Color.WHITE, this));
placeNewPiece('a', 8, new Rook(board, Color.BLACK));
placeNewPiece('b', 8, new Knight(board, Color.BLACK));
placeNewPiece('c', 8, new Bishop(board, Color.BLACK));
placeNewPiece('d', 8, new Queen(board, Color.BLACK));
placeNewPiece('e', 8, new King(board, Color.BLACK, this));
placeNewPiece('f', 8, new Bishop(board, Color.BLACK));
placeNewPiece('g', 8, new Knight(board, Color.BLACK));
placeNewPiece('h', 8, new Rook(board, Color.BLACK));
placeNewPiece('a', 7, new Pawn(board, Color.BLACK, this));
placeNewPiece('b', 7, new Pawn(board, Color.BLACK, this));
placeNewPiece('c', 7, new Pawn(board, Color.BLACK, this));
placeNewPiece('d', 7, new Pawn(board, Color.BLACK, this));
placeNewPiece('e', 7, new Pawn(board, Color.BLACK, this));
placeNewPiece('f', 7, new Pawn(board, Color.BLACK, this));
placeNewPiece('g', 7, new Pawn(board, Color.BLACK, this));
placeNewPiece('h', 7, new Pawn(board, Color.BLACK, this));
}
}
|
[
"dylanpachecocas@gmail.com"
] |
dylanpachecocas@gmail.com
|
e272ecfd6d3a06ef893c00602ed41c4d6d39fb2d
|
2d5c6766fb7ebbb6fd9b3f81e015b8c56eda2733
|
/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/protocols/JobManagerProtocol.java
|
1190b46d32667f68889d196751c994719fd35f44
|
[] |
no_license
|
bel90/nephele
|
e134197edeb86d5b2bfde138445f2f624f934bae
|
674876a9714a6b48fd7467cadbc48f9eacfd5c84
|
refs/heads/master
| 2021-08-24T00:43:16.161984
| 2017-12-07T09:22:36
| 2017-12-07T09:22:36
| 112,023,086
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,107
|
java
|
/***********************************************************************************************************************
*
* Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
**********************************************************************************************************************/
package eu.stratosphere.nephele.protocols;
import java.io.IOException;
import eu.stratosphere.nephele.instance.HardwareDescription;
import eu.stratosphere.nephele.instance.InstanceConnectionInfo;
import eu.stratosphere.nephele.rpc.RPCProtocol;
import eu.stratosphere.nephele.taskmanager.TaskCheckpointDecisionReason;
import eu.stratosphere.nephele.taskmanager.TaskCheckpointSize;
import eu.stratosphere.nephele.taskmanager.TaskCheckpointState;
import eu.stratosphere.nephele.taskmanager.TaskExecutionState;
import eu.stratosphere.nephele.taskmanager.TaskRecordSkipped;
/**
* The job manager protocol is implemented by the job manager and offers functionality
* to task managers which allows them to register themselves, send heart beat messages
* or to report the results of a task execution.
*
* @author warneke
*/
public interface JobManagerProtocol extends RPCProtocol {
/**
* Sends a heart beat to the job manager.
*
* @param instanceConnectionInfo
* the information the job manager requires to connect to the instance's task manager
* @param hardwareDescription
* a hardware description with details on the instance's compute resources.
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
*/
void sendHeartbeat(InstanceConnectionInfo instanceConnectionInfo, HardwareDescription hardwareDescription)
throws IOException, InterruptedException;
/**
* Reports an update of a task's execution state to the job manager.
*
* @param taskExecutionState
* the new task execution state
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
*/
void updateTaskExecutionState(TaskExecutionState taskExecutionState) throws IOException, InterruptedException;
/**
* Reports an update of a task's checkpoint state to the job manager.
*
* @param taskCheckpointState
* the new checkpoint state of the task
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
*/
void updateCheckpointState(TaskCheckpointState taskCheckpointState) throws IOException, InterruptedException;
/**
* Reports an update of a task's checkpoint decision reason to the job manager.
*
* @param taskCheckpointDecisionReason
* the new checkpoint decision reason of the task
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
* @author bel
*/
void updateCheckpointDecisionReason(TaskCheckpointDecisionReason taskCheckpointDecisionReason) throws IOException, InterruptedException;
/**
* Reports an update of a task's checkpoint size to the job manager.
*
* @param taskCheckpointSize
* the new checkpoint size of the task
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
* @author bel
*/
void newCheckpointSize(TaskCheckpointSize taskCheckpointSize) throws IOException, InterruptedException;
/**
* Reports an update that a Record was skipped to the job manager.
*
* @param taskRecordSkipped
* the information that a record was skipped
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
* @author bel
*/
void recordSkipped(TaskRecordSkipped taskRecordSkipped) throws IOException, InterruptedException;
}
|
[
"belinda.diesslin@campus.tu-berlin.de"
] |
belinda.diesslin@campus.tu-berlin.de
|
648300a05925c87f20ceb54cd19f4307ccdaa44c
|
2522b90b3a9cceb4e9d939c5e4bb130410f73b86
|
/src/main/java/com/oonurkuru/restful/services/EmployeeService.java
|
d0648a3d2b33ee2a491856c457e5a87bf45f50c4
|
[] |
no_license
|
onurkuruu/restful-basics
|
2b0e7fea2ca75e1c497a6b3d207f733d9b6d99b4
|
8208695062678bd1cf8f6dd66b899e5bed48bc0d
|
refs/heads/master
| 2021-01-01T16:57:52.509573
| 2017-07-21T15:27:54
| 2017-07-21T15:27:54
| 97,962,130
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,266
|
java
|
package com.oonurkuru.restful.services;
import com.oonurkuru.restful.domains.Employee;
import com.oonurkuru.restful.exceptions.RestFulException;
import com.oonurkuru.restful.util.QueryParamHandler;
import javax.ws.rs.core.MultivaluedMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by Onur Kuru on 21.7.2017.
*/
/**
* Employee modeline ait servis sınıfıdır. Employee modelin ilgili işlemlerden sorumludur.
*/
public class EmployeeService {
/**
* Veri tabanı bağlantısı kullanılmadığı için kayıtlar bu Map'de tutulmaktadır.
*/
public static Map<Integer, Employee> employeeList = new HashMap<Integer, Employee>();
static {
Employee employee = new Employee(1, "Ahmet", 25, 5000, "AR-GE");
employeeList.put(1, employee);
employee = new Employee(2, "Mehmet", 22, 6000, "AR-GE");
employeeList.put(2, employee);
employee = new Employee(3, "Veli", 30, 5000, "AR-GE");
employeeList.put(3, employee);
employee = new Employee(4, "Hasan", 32, 8000, "AR-GE");
employeeList.put(4, employee);
employee = new Employee(5, "Kazım", 27, 6000, "AR-GE");
employeeList.put(5, employee);
}
/**
* Employee kaynağı eklemek için kullanılır. Eklenecek kaydın tüm alanlarının girilmesi zorlunludur.
*
* @param employee eklenecek kaynak
*/
public void save(Employee employee) throws RestFulException {
//Alanları Kontrol Et
employee.setId(employeeList.size() + 1);
employeeList.put(employeeList.size() + 1, employee);
}
/**
* Kaynak güncelleme metodu
*
* @param newEmployee güncellenecek kaynağa ait veriler
* @throws RestFulException alanların eksik olması durumunda hata fırlatılır.
*/
public void update(Employee newEmployee) throws RestFulException {
Employee oldEmployee = employeeList.get(newEmployee.getId());
if (oldEmployee == null) {
throw new RestFulException(101, "Illegal Access", "Geçerli Bir Nesne Gereklidir.");
}
employeeList.put(newEmployee.getId(), newEmployee);
}
/**
* Query'lere göre kaynak bulma metodu
*
* @param queryList bulunması istenen kriterler
* @return bulunan kaynkalar döndürülür
* @throws RuntimeException
*/
public List<Employee> findEmployeeByQuery(MultivaluedMap<String, String> queryList) throws RuntimeException {
List<Employee> filterList = (List<Employee>) (List<?>) QueryParamHandler.findByQueryParams(new ArrayList<>(employeeList.values()), queryList);
return filterList;
}
/**
* kaynak silme metodu
*
* @param id silinmesi istenen id
* @throws RestFulException
*/
public void delete(Integer id) throws RestFulException {
if (id == null) {
throw new RestFulException(100, "Not Null", "Tüm alanlar gereklidir.");
}
Employee employee = employeeList.get(id);
if (employee == null) {
throw new RestFulException(101, "Illegal Access", "Geçerli Bir Nesne Gereklidir.");
}
employeeList.remove(id);
}
}
|
[
"oonurkuru@gmail.com"
] |
oonurkuru@gmail.com
|
5337ebd740d33b21fca2bec93e6d252847dac668
|
18e93feb7e0ba3a710bca5c5fae9d5d301f2f117
|
/src/main/java/br/com/efb/controller/xml/Gerador.java
|
36bafa90001db7ae586b61fd773766f620330d2c
|
[] |
no_license
|
emersonefb/TesteEFB
|
0fc7b50c7ba4049bd08ef8c0fa1725b2b9b3e538
|
15032b0ee1592e2508a8dd2dd4bf8dbdb9999a3b
|
refs/heads/master
| 2021-01-12T15:11:51.327898
| 2017-09-08T12:32:12
| 2017-09-08T12:32:12
| 71,720,118
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 220
|
java
|
package br.com.efb.controller.xml;
import javax.jws.WebService;
/**
* Created by fepweb on 11/05/17.
*/
@WebService
public class Gerador {
public double geraNumero(){
return Math.random() * 200;
}
}
|
[
"ebarbosa@fepweb.com.br"
] |
ebarbosa@fepweb.com.br
|
aaa2c13886e028e774ccb780aadbc5ce4f82a37c
|
ccaa87cf86004110aa8375b2b093b602f1f035c2
|
/CalculateApi/src/main/java/com/calculate/services/calcmanager/CalcManager.java
|
3cab18b01ce808eadbb89e67def255f8e1543a85
|
[] |
no_license
|
OleksandrSh/testcalc
|
43f41dd7a6a2fe4d2ee8e588b7b952d734dc05ce
|
135a0ee48900343db2c8d9c4a7e5cfe6f8c8f81e
|
refs/heads/master
| 2020-06-03T19:52:10.818233
| 2018-04-24T08:29:35
| 2018-04-24T08:29:35
| 38,681,569
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,007
|
java
|
package com.calculate.services.calcmanager;
import java.util.LinkedList;
import java.util.Stack;
import com.calculate.services.model.CalcEntity;
import com.calculate.services.model.RezultClass;
public class CalcManager {
private boolean isOperator(char c) {
return c == '+' || c == '-' || c == '*' || c == '/';
}
private int priority(char oper) {
if (oper == '*' || oper == '/') {
return 1;
}
else if (oper == '+' || oper == '-') {
return 0;
}
else {
return -1;
}
}
private void letGo(LinkedList<Integer> st, char oper) {
int someOne = st.removeLast();
int someTwo = st.removeLast();
switch (oper) {
case '+':
st.add(someTwo + someOne);
break;
case '-':
st.add(someTwo - someOne);
break;
case '*':
st.add(someTwo * someOne);
break;
case '/':
st.add(someTwo / someOne);
break;
default:
System.out.println("Oops");
}
}
private String eval(String s) {
LinkedList<Integer> someInts = new LinkedList<>();
LinkedList<Character> someOpers = new LinkedList<>();
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c == '(') {
someOpers.add('(');
}
else if (c == ')') {
while (someOpers.getLast() != '(') {
letGo(someInts, someOpers.removeLast());
}
someOpers.removeLast();
}
else if (isOperator(c)) {
while (!someOpers.isEmpty()
&& priority(someOpers.getLast()) >= priority(c)) {
letGo(someInts, someOpers.removeLast());
}
someOpers.add(c);
}
else {
String operand = "";
while (i < s.length() && Character.isDigit(s.charAt(i))) {
operand += s.charAt(i++);
}
--i;
someInts.add(Integer.parseInt(operand));
}
}
while (!someOpers.isEmpty()) {
letGo(someInts, someOpers.removeLast());
}
return Integer.toString(someInts.get(0));
}
public Object getCalc(CalcEntity entity) {
RezultClass rez = new RezultClass();
rez.setResult(eval(entity.getExpressionsForCalculate()));
return rez;
}
}
|
[
"lotusd@mail.ru"
] |
lotusd@mail.ru
|
3c983771f483d93ca0c8d2d20e5271eaf6a69c60
|
98622e5aab7bfd54988f0768c1d5e3b366f7e4bb
|
/src/org/tentackle/appworx/AppDbCursorProgressDialog.java
|
32d602c887155943321cc6aa03cc80b2e8a89a4a
|
[] |
no_license
|
yovannyr/tentackle
|
af6a7717ea50398714fc160bb329ab77418269af
|
ebbaa3986e32783fc78a46ed4fbfbda372993f95
|
refs/heads/master
| 2021-01-10T01:09:48.403574
| 2016-03-24T17:16:21
| 2016-03-24T17:16:21
| 54,660,042
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,437
|
java
|
/**
* Tentackle - a framework for java desktop applications
* Copyright (C) 2001-2008 Harald Krake, harald@krake.de, +49 7722 9508-0
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// $Id: AppDbCursorProgressDialog.java 336 2008-05-09 14:40:20Z harald $
package org.tentackle.appworx;
import org.tentackle.plaf.PlafGlobal;
/**
* Progress dialog for {@link AppDbCursor}.
* <p>
* The modal dialog is shown if more than {@link QbfParameter#warnRowCount}
* rows are retrieved and the user answers the question to retrieve more
* with "yes". The progress dialog shows and updates the numbers of rows retrieved
* and provides an abort button.
*
* @author harald
*/
public class AppDbCursorProgressDialog extends org.tentackle.ui.FormDialog {
private AppDbCursor cursor;
/**
* Creates a progress dialog.
*
* @param cursor the database cursor
*/
public AppDbCursorProgressDialog(AppDbCursor cursor) {
this.cursor = cursor;
initComponents();
}
/**
* Shows the modal dialog.
*/
public void showDialog() {
pack();
setVisible(true);
}
/**
* Updates and displays the row count.
*
* @param rowCount
*/
public void updateRowCount(int rowCount) {
rowCountField.setIntValue(rowCount);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
infoPanel = new org.tentackle.ui.FormPanel();
jLabel1 = new javax.swing.JLabel();
rowCountField = new org.tentackle.ui.IntegerFormField();
buttonPanel = new org.tentackle.ui.FormPanel();
abortButton = new org.tentackle.ui.FormButton();
setAutoPosition(true);
setTitle(Locales.bundle.getString("Loading_objects...")); // NOI18N
setModal(true);
infoPanel.setLayout(new java.awt.GridBagLayout());
jLabel1.setText(Locales.bundle.getString("objects_read_so_far:")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
infoPanel.add(jLabel1, gridBagConstraints);
rowCountField.setColumns(10);
rowCountField.setChangeable(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 5);
infoPanel.add(rowCountField, gridBagConstraints);
getContentPane().add(infoPanel, java.awt.BorderLayout.CENTER);
abortButton.setIcon(PlafGlobal.getIcon("working"));
abortButton.setText(Locales.bundle.getString("abort")); // NOI18N
abortButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
abortButtonActionPerformed(evt);
}
});
buttonPanel.add(abortButton);
getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH);
pack();
}// </editor-fold>//GEN-END:initComponents
private void abortButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_abortButtonActionPerformed
cursor.setAbortRequested(true);
}//GEN-LAST:event_abortButtonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private org.tentackle.ui.FormButton abortButton;
private org.tentackle.ui.FormPanel buttonPanel;
private org.tentackle.ui.FormPanel infoPanel;
private javax.swing.JLabel jLabel1;
private org.tentackle.ui.IntegerFormField rowCountField;
// End of variables declaration//GEN-END:variables
}
|
[
"yovannyr@outlook.com"
] |
yovannyr@outlook.com
|
d6ee9271aca96faa450e13ec45edfe74c65db8f2
|
280da3630f692c94472f2c42abd1051fb73d1344
|
/src/net/minecraft/item/ItemWritableBook.java
|
9a13b9c10c9e58a4f5e870332762d3f3f96fbfa1
|
[] |
no_license
|
MicrowaveClient/Clarinet
|
7c35206c671eb28bc139ee52e503f405a14ccb5b
|
bd387bc30329e0febb6c1c1b06a836d9013093b5
|
refs/heads/master
| 2020-04-02T18:47:52.047731
| 2016-07-14T03:21:46
| 2016-07-14T03:21:46
| 63,297,767
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,522
|
java
|
package net.minecraft.item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.stats.StatList;
import net.minecraft.world.World;
public class ItemWritableBook extends Item {
public ItemWritableBook() {
this.setMaxStackSize(1);
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) {
playerIn.displayGUIBook(itemStackIn);
playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
return itemStackIn;
}
/**
* this method returns true if the book's NBT Tag List "pages" is valid
*/
public static boolean isNBTValid(NBTTagCompound nbt) {
if (nbt == null) {
return false;
} else if (!nbt.hasKey("pages", 9)) {
return false;
} else {
NBTTagList var1 = nbt.getTagList("pages", 8);
for (int var2 = 0; var2 < var1.tagCount(); ++var2) {
String var3 = var1.getStringTagAt(var2);
if (var3 == null) {
return false;
}
if (var3.length() > 32767) {
return false;
}
}
return true;
}
}
}
|
[
"justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704"
] |
justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704
|
1c75171a65fb7db0dd048363eb97131fdd629bc4
|
9501dd18a71fd6bceb8ed516cf4cf213779b4897
|
/Polymorphisme/src/Boulanger.java
|
fd6b1b055e49077b990b831e4a9ffbfff003e680
|
[] |
no_license
|
JoelJoly/StageJava
|
dcfefe351e8cec13fab6d49d2d731c109128858a
|
72a83c0be56d664c6407748f1e71341873d83e88
|
refs/heads/master
| 2016-09-05T16:11:35.451842
| 2014-02-21T09:54:43
| 2014-02-21T09:59:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 361
|
java
|
public class Boulanger extends Personne implements Vivable {
public Boulanger(String nom) {
super(nom);
}
@Override
public void travailler() {
System.out.println("Je fais du pain");
}
@Override
public void manger() {
System.out.println("Je mange... du pain");
}
@Override
public void mourir() {
System.out.println("Arggggh...");
}
}
|
[
"joel.joly@gmail.com"
] |
joel.joly@gmail.com
|
b42e6d0dd49e8d136b273b46cd62b39eaa564810
|
de1d6da8df6daa6027e6fd962ae8c476dfc68f1a
|
/11-01-2018/Linking Database using JDBC/src/creating_connection.java
|
c58b61b14ab9ac810b2848265e52de16853df3fb
|
[] |
no_license
|
sharma-harshit/Java-VMM
|
2aced71906d1f18848a136a0fd41544ddd24cf8a
|
9b4e3dda500ec7143f48ed04616e8b157a1bf7c0
|
refs/heads/master
| 2021-09-04T19:35:52.966827
| 2018-01-21T20:31:54
| 2018-01-21T20:31:54
| 115,340,520
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,122
|
java
|
import java.sql.*;
public class creating_connection
{
public static void main(String[] args) throws SQLException
{
try
{
// Loading and Registering Jdbc Driver
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Driver loaded successfully");
// Creating connection with database
String address = "jdbc:mysql://localhost:3306/db1";
String username = "root";
String password = "127997";
Connection conn = DriverManager.getConnection(address,username,password);
System.out.println("Connectoin built");
//Creating Statement which can just read data by default
Statement stmt = conn.createStatement();
//Executing and collecting results
ResultSet rs = stmt.executeQuery("Select * from student");
System.out.println("Executed sucessfully");
}
catch (ClassNotFoundException ex)
{
ex.printStackTrace();
}
}
}
|
[
"harshit744@gmail.com"
] |
harshit744@gmail.com
|
8e8c754997ad5c79b26e3fa6d842b11fb659e8b4
|
cea591d8923ffb2bc0f3da1a2f7979dc32a27b69
|
/comment/src/main/java/com/buaa/ct/comment/emoji/EmojiconHandler.java
|
24c73061a71c574f4933d5ea85423bd22a50b30c
|
[] |
no_license
|
tunye/AndroidViewDemo
|
34cab5535d7a305a49dc81eb8c69a5257eb5f557
|
78a74829c037824c24ebde974f490982ac6ae92d
|
refs/heads/master
| 2023-03-13T07:38:23.027045
| 2021-02-26T11:21:04
| 2021-02-26T11:21:04
| 200,342,530
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 84,006
|
java
|
/*
* Copyright 2014 Hieu Rocker
*
* 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.buaa.ct.comment.emoji;
import android.content.Context;
import android.text.Spannable;
import android.util.SparseIntArray;
import com.buaa.ct.comment.R;
public final class EmojiconHandler {
private static final SparseIntArray sEmojisMap = new SparseIntArray(846);
private static final SparseIntArray sSoftbanksMap = new SparseIntArray(471);
static {
// People
sEmojisMap.put(0x1f604, R.drawable.emoji_1f604);
sEmojisMap.put(0x1f603, R.drawable.emoji_1f603);
sEmojisMap.put(0x1f600, R.drawable.emoji_1f600);
sEmojisMap.put(0x1f60a, R.drawable.emoji_1f60a);
sEmojisMap.put(0x263a, R.drawable.emoji_263a);
sEmojisMap.put(0x1f609, R.drawable.emoji_1f609);
sEmojisMap.put(0x1f60d, R.drawable.emoji_1f60d);
sEmojisMap.put(0x1f618, R.drawable.emoji_1f618);
sEmojisMap.put(0x1f61a, R.drawable.emoji_1f61a);
sEmojisMap.put(0x1f617, R.drawable.emoji_1f617);
sEmojisMap.put(0x1f619, R.drawable.emoji_1f619);
sEmojisMap.put(0x1f61c, R.drawable.emoji_1f61c);
sEmojisMap.put(0x1f61d, R.drawable.emoji_1f61d);
sEmojisMap.put(0x1f61b, R.drawable.emoji_1f61b);
sEmojisMap.put(0x1f633, R.drawable.emoji_1f633);
sEmojisMap.put(0x1f601, R.drawable.emoji_1f601);
sEmojisMap.put(0x1f614, R.drawable.emoji_1f614);
sEmojisMap.put(0x1f60c, R.drawable.emoji_1f60c);
sEmojisMap.put(0x1f612, R.drawable.emoji_1f612);
sEmojisMap.put(0x1f61e, R.drawable.emoji_1f61e);
sEmojisMap.put(0x1f623, R.drawable.emoji_1f623);
sEmojisMap.put(0x1f622, R.drawable.emoji_1f622);
sEmojisMap.put(0x1f602, R.drawable.emoji_1f602);
sEmojisMap.put(0x1f62d, R.drawable.emoji_1f62d);
sEmojisMap.put(0x1f62a, R.drawable.emoji_1f62a);
sEmojisMap.put(0x1f625, R.drawable.emoji_1f625);
sEmojisMap.put(0x1f630, R.drawable.emoji_1f630);
sEmojisMap.put(0x1f605, R.drawable.emoji_1f605);
sEmojisMap.put(0x1f613, R.drawable.emoji_1f613);
sEmojisMap.put(0x1f629, R.drawable.emoji_1f629);
sEmojisMap.put(0x1f62b, R.drawable.emoji_1f62b);
sEmojisMap.put(0x1f628, R.drawable.emoji_1f628);
sEmojisMap.put(0x1f631, R.drawable.emoji_1f631);
sEmojisMap.put(0x1f620, R.drawable.emoji_1f620);
sEmojisMap.put(0x1f621, R.drawable.emoji_1f621);
sEmojisMap.put(0x1f624, R.drawable.emoji_1f624);
sEmojisMap.put(0x1f616, R.drawable.emoji_1f616);
sEmojisMap.put(0x1f606, R.drawable.emoji_1f606);
sEmojisMap.put(0x1f60b, R.drawable.emoji_1f60b);
sEmojisMap.put(0x1f637, R.drawable.emoji_1f637);
sEmojisMap.put(0x1f60e, R.drawable.emoji_1f60e);
sEmojisMap.put(0x1f634, R.drawable.emoji_1f634);
sEmojisMap.put(0x1f635, R.drawable.emoji_1f635);
sEmojisMap.put(0x1f632, R.drawable.emoji_1f632);
sEmojisMap.put(0x1f61f, R.drawable.emoji_1f61f);
sEmojisMap.put(0x1f626, R.drawable.emoji_1f626);
sEmojisMap.put(0x1f627, R.drawable.emoji_1f627);
sEmojisMap.put(0x1f608, R.drawable.emoji_1f608);
sEmojisMap.put(0x1f47f, R.drawable.emoji_1f47f);
sEmojisMap.put(0x1f62e, R.drawable.emoji_1f62e);
sEmojisMap.put(0x1f62c, R.drawable.emoji_1f62c);
sEmojisMap.put(0x1f610, R.drawable.emoji_1f610);
sEmojisMap.put(0x1f615, R.drawable.emoji_1f615);
sEmojisMap.put(0x1f62f, R.drawable.emoji_1f62f);
sEmojisMap.put(0x1f636, R.drawable.emoji_1f636);
sEmojisMap.put(0x1f607, R.drawable.emoji_1f607);
sEmojisMap.put(0x1f60f, R.drawable.emoji_1f60f);
sEmojisMap.put(0x1f611, R.drawable.emoji_1f611);
sEmojisMap.put(0x1f472, R.drawable.emoji_1f472);
sEmojisMap.put(0x1f473, R.drawable.emoji_1f473);
sEmojisMap.put(0x1f46e, R.drawable.emoji_1f46e);
sEmojisMap.put(0x1f477, R.drawable.emoji_1f477);
sEmojisMap.put(0x1f482, R.drawable.emoji_1f482);
sEmojisMap.put(0x1f476, R.drawable.emoji_1f476);
sEmojisMap.put(0x1f466, R.drawable.emoji_1f466);
sEmojisMap.put(0x1f467, R.drawable.emoji_1f467);
sEmojisMap.put(0x1f468, R.drawable.emoji_1f468);
sEmojisMap.put(0x1f469, R.drawable.emoji_1f469);
sEmojisMap.put(0x1f474, R.drawable.emoji_1f474);
sEmojisMap.put(0x1f475, R.drawable.emoji_1f475);
sEmojisMap.put(0x1f471, R.drawable.emoji_1f471);
sEmojisMap.put(0x1f47c, R.drawable.emoji_1f47c);
sEmojisMap.put(0x1f478, R.drawable.emoji_1f478);
sEmojisMap.put(0x1f63a, R.drawable.emoji_1f63a);
sEmojisMap.put(0x1f638, R.drawable.emoji_1f638);
sEmojisMap.put(0x1f63b, R.drawable.emoji_1f63b);
sEmojisMap.put(0x1f63d, R.drawable.emoji_1f63d);
sEmojisMap.put(0x1f63c, R.drawable.emoji_1f63c);
sEmojisMap.put(0x1f640, R.drawable.emoji_1f640);
sEmojisMap.put(0x1f63f, R.drawable.emoji_1f63f);
sEmojisMap.put(0x1f639, R.drawable.emoji_1f639);
sEmojisMap.put(0x1f63e, R.drawable.emoji_1f63e);
sEmojisMap.put(0x1f479, R.drawable.emoji_1f479);
sEmojisMap.put(0x1f47a, R.drawable.emoji_1f47a);
sEmojisMap.put(0x1f648, R.drawable.emoji_1f648);
sEmojisMap.put(0x1f649, R.drawable.emoji_1f649);
sEmojisMap.put(0x1f64a, R.drawable.emoji_1f64a);
sEmojisMap.put(0x1f480, R.drawable.emoji_1f480);
sEmojisMap.put(0x1f47d, R.drawable.emoji_1f47d);
sEmojisMap.put(0x1f4a9, R.drawable.emoji_1f4a9);
sEmojisMap.put(0x1f525, R.drawable.emoji_1f525);
sEmojisMap.put(0x2728, R.drawable.emoji_2728);
sEmojisMap.put(0x1f31f, R.drawable.emoji_1f31f);
sEmojisMap.put(0x1f4ab, R.drawable.emoji_1f4ab);
sEmojisMap.put(0x1f4a5, R.drawable.emoji_1f4a5);
sEmojisMap.put(0x1f4a2, R.drawable.emoji_1f4a2);
sEmojisMap.put(0x1f4a6, R.drawable.emoji_1f4a6);
sEmojisMap.put(0x1f4a7, R.drawable.emoji_1f4a7);
sEmojisMap.put(0x1f4a4, R.drawable.emoji_1f4a4);
sEmojisMap.put(0x1f4a8, R.drawable.emoji_1f4a8);
sEmojisMap.put(0x1f442, R.drawable.emoji_1f442);
sEmojisMap.put(0x1f440, R.drawable.emoji_1f440);
sEmojisMap.put(0x1f443, R.drawable.emoji_1f443);
sEmojisMap.put(0x1f445, R.drawable.emoji_1f445);
sEmojisMap.put(0x1f444, R.drawable.emoji_1f444);
sEmojisMap.put(0x1f44d, R.drawable.emoji_1f44d);
sEmojisMap.put(0x1f44e, R.drawable.emoji_1f44e);
sEmojisMap.put(0x1f44c, R.drawable.emoji_1f44c);
sEmojisMap.put(0x1f44a, R.drawable.emoji_1f44a);
sEmojisMap.put(0x270a, R.drawable.emoji_270a);
sEmojisMap.put(0x270c, R.drawable.emoji_270c);
sEmojisMap.put(0x1f44b, R.drawable.emoji_1f44b);
sEmojisMap.put(0x270b, R.drawable.emoji_270b);
sEmojisMap.put(0x1f450, R.drawable.emoji_1f450);
sEmojisMap.put(0x1f446, R.drawable.emoji_1f446);
sEmojisMap.put(0x1f447, R.drawable.emoji_1f447);
sEmojisMap.put(0x1f449, R.drawable.emoji_1f449);
sEmojisMap.put(0x1f448, R.drawable.emoji_1f448);
sEmojisMap.put(0x1f64c, R.drawable.emoji_1f64c);
sEmojisMap.put(0x1f64f, R.drawable.emoji_1f64f);
sEmojisMap.put(0x261d, R.drawable.emoji_261d);
sEmojisMap.put(0x1f44f, R.drawable.emoji_1f44f);
sEmojisMap.put(0x1f4aa, R.drawable.emoji_1f4aa);
sEmojisMap.put(0x1f6b6, R.drawable.emoji_1f6b6);
sEmojisMap.put(0x1f3c3, R.drawable.emoji_1f3c3);
sEmojisMap.put(0x1f483, R.drawable.emoji_1f483);
sEmojisMap.put(0x1f46b, R.drawable.emoji_1f46b);
sEmojisMap.put(0x1f46a, R.drawable.emoji_1f46a);
sEmojisMap.put(0x1f46c, R.drawable.emoji_1f46c);
sEmojisMap.put(0x1f46d, R.drawable.emoji_1f46d);
sEmojisMap.put(0x1f48f, R.drawable.emoji_1f48f);
sEmojisMap.put(0x1f491, R.drawable.emoji_1f491);
sEmojisMap.put(0x1f46f, R.drawable.emoji_1f46f);
sEmojisMap.put(0x1f646, R.drawable.emoji_1f646);
sEmojisMap.put(0x1f645, R.drawable.emoji_1f645);
sEmojisMap.put(0x1f481, R.drawable.emoji_1f481);
sEmojisMap.put(0x1f64b, R.drawable.emoji_1f64b);
sEmojisMap.put(0x1f486, R.drawable.emoji_1f486);
sEmojisMap.put(0x1f487, R.drawable.emoji_1f487);
sEmojisMap.put(0x1f485, R.drawable.emoji_1f485);
sEmojisMap.put(0x1f470, R.drawable.emoji_1f470);
sEmojisMap.put(0x1f64e, R.drawable.emoji_1f64e);
sEmojisMap.put(0x1f64d, R.drawable.emoji_1f64d);
sEmojisMap.put(0x1f647, R.drawable.emoji_1f647);
sEmojisMap.put(0x1f3a9, R.drawable.emoji_1f3a9);
sEmojisMap.put(0x1f451, R.drawable.emoji_1f451);
sEmojisMap.put(0x1f452, R.drawable.emoji_1f452);
sEmojisMap.put(0x1f45f, R.drawable.emoji_1f45f);
sEmojisMap.put(0x1f45e, R.drawable.emoji_1f45e);
sEmojisMap.put(0x1f461, R.drawable.emoji_1f461);
sEmojisMap.put(0x1f460, R.drawable.emoji_1f460);
sEmojisMap.put(0x1f462, R.drawable.emoji_1f462);
sEmojisMap.put(0x1f455, R.drawable.emoji_1f455);
sEmojisMap.put(0x1f454, R.drawable.emoji_1f454);
sEmojisMap.put(0x1f45a, R.drawable.emoji_1f45a);
sEmojisMap.put(0x1f457, R.drawable.emoji_1f457);
sEmojisMap.put(0x1f3bd, R.drawable.emoji_1f3bd);
sEmojisMap.put(0x1f456, R.drawable.emoji_1f456);
sEmojisMap.put(0x1f458, R.drawable.emoji_1f458);
sEmojisMap.put(0x1f459, R.drawable.emoji_1f459);
sEmojisMap.put(0x1f4bc, R.drawable.emoji_1f4bc);
sEmojisMap.put(0x1f45c, R.drawable.emoji_1f45c);
sEmojisMap.put(0x1f45d, R.drawable.emoji_1f45d);
sEmojisMap.put(0x1f45b, R.drawable.emoji_1f45b);
sEmojisMap.put(0x1f453, R.drawable.emoji_1f453);
sEmojisMap.put(0x1f380, R.drawable.emoji_1f380);
sEmojisMap.put(0x1f302, R.drawable.emoji_1f302);
sEmojisMap.put(0x1f484, R.drawable.emoji_1f484);
sEmojisMap.put(0x1f49b, R.drawable.emoji_1f49b);
sEmojisMap.put(0x1f499, R.drawable.emoji_1f499);
sEmojisMap.put(0x1f49c, R.drawable.emoji_1f49c);
sEmojisMap.put(0x1f49a, R.drawable.emoji_1f49a);
sEmojisMap.put(0x2764, R.drawable.emoji_2764);
sEmojisMap.put(0x1f494, R.drawable.emoji_1f494);
sEmojisMap.put(0x1f497, R.drawable.emoji_1f497);
sEmojisMap.put(0x1f493, R.drawable.emoji_1f493);
sEmojisMap.put(0x1f495, R.drawable.emoji_1f495);
sEmojisMap.put(0x1f496, R.drawable.emoji_1f496);
sEmojisMap.put(0x1f49e, R.drawable.emoji_1f49e);
sEmojisMap.put(0x1f498, R.drawable.emoji_1f498);
sEmojisMap.put(0x1f48c, R.drawable.emoji_1f48c);
sEmojisMap.put(0x1f48b, R.drawable.emoji_1f48b);
sEmojisMap.put(0x1f48d, R.drawable.emoji_1f48d);
sEmojisMap.put(0x1f48e, R.drawable.emoji_1f48e);
sEmojisMap.put(0x1f464, R.drawable.emoji_1f464);
sEmojisMap.put(0x1f465, R.drawable.emoji_1f465);
sEmojisMap.put(0x1f4ac, R.drawable.emoji_1f4ac);
sEmojisMap.put(0x1f463, R.drawable.emoji_1f463);
sEmojisMap.put(0x1f4ad, R.drawable.emoji_1f4ad);
// Nature
sEmojisMap.put(0x1f436, R.drawable.emoji_1f436);
sEmojisMap.put(0x1f43a, R.drawable.emoji_1f43a);
sEmojisMap.put(0x1f431, R.drawable.emoji_1f431);
sEmojisMap.put(0x1f42d, R.drawable.emoji_1f42d);
sEmojisMap.put(0x1f439, R.drawable.emoji_1f439);
sEmojisMap.put(0x1f430, R.drawable.emoji_1f430);
sEmojisMap.put(0x1f438, R.drawable.emoji_1f438);
sEmojisMap.put(0x1f42f, R.drawable.emoji_1f42f);
sEmojisMap.put(0x1f428, R.drawable.emoji_1f428);
sEmojisMap.put(0x1f43b, R.drawable.emoji_1f43b);
sEmojisMap.put(0x1f437, R.drawable.emoji_1f437);
sEmojisMap.put(0x1f43d, R.drawable.emoji_1f43d);
sEmojisMap.put(0x1f42e, R.drawable.emoji_1f42e);
sEmojisMap.put(0x1f417, R.drawable.emoji_1f417);
sEmojisMap.put(0x1f435, R.drawable.emoji_1f435);
sEmojisMap.put(0x1f412, R.drawable.emoji_1f412);
sEmojisMap.put(0x1f434, R.drawable.emoji_1f434);
sEmojisMap.put(0x1f411, R.drawable.emoji_1f411);
sEmojisMap.put(0x1f418, R.drawable.emoji_1f418);
sEmojisMap.put(0x1f43c, R.drawable.emoji_1f43c);
sEmojisMap.put(0x1f427, R.drawable.emoji_1f427);
sEmojisMap.put(0x1f426, R.drawable.emoji_1f426);
sEmojisMap.put(0x1f424, R.drawable.emoji_1f424);
sEmojisMap.put(0x1f425, R.drawable.emoji_1f425);
sEmojisMap.put(0x1f423, R.drawable.emoji_1f423);
sEmojisMap.put(0x1f414, R.drawable.emoji_1f414);
sEmojisMap.put(0x1f40d, R.drawable.emoji_1f40d);
sEmojisMap.put(0x1f422, R.drawable.emoji_1f422);
sEmojisMap.put(0x1f41b, R.drawable.emoji_1f41b);
sEmojisMap.put(0x1f41d, R.drawable.emoji_1f41d);
sEmojisMap.put(0x1f41c, R.drawable.emoji_1f41c);
sEmojisMap.put(0x1f41e, R.drawable.emoji_1f41e);
sEmojisMap.put(0x1f40c, R.drawable.emoji_1f40c);
sEmojisMap.put(0x1f419, R.drawable.emoji_1f419);
sEmojisMap.put(0x1f41a, R.drawable.emoji_1f41a);
sEmojisMap.put(0x1f420, R.drawable.emoji_1f420);
sEmojisMap.put(0x1f41f, R.drawable.emoji_1f41f);
sEmojisMap.put(0x1f42c, R.drawable.emoji_1f42c);
sEmojisMap.put(0x1f433, R.drawable.emoji_1f433);
sEmojisMap.put(0x1f40b, R.drawable.emoji_1f40b);
sEmojisMap.put(0x1f404, R.drawable.emoji_1f404);
sEmojisMap.put(0x1f40f, R.drawable.emoji_1f40f);
sEmojisMap.put(0x1f400, R.drawable.emoji_1f400);
sEmojisMap.put(0x1f403, R.drawable.emoji_1f403);
sEmojisMap.put(0x1f405, R.drawable.emoji_1f405);
sEmojisMap.put(0x1f407, R.drawable.emoji_1f407);
sEmojisMap.put(0x1f409, R.drawable.emoji_1f409);
sEmojisMap.put(0x1f40e, R.drawable.emoji_1f40e);
sEmojisMap.put(0x1f410, R.drawable.emoji_1f410);
sEmojisMap.put(0x1f413, R.drawable.emoji_1f413);
sEmojisMap.put(0x1f415, R.drawable.emoji_1f415);
sEmojisMap.put(0x1f416, R.drawable.emoji_1f416);
sEmojisMap.put(0x1f401, R.drawable.emoji_1f401);
sEmojisMap.put(0x1f402, R.drawable.emoji_1f402);
sEmojisMap.put(0x1f432, R.drawable.emoji_1f432);
sEmojisMap.put(0x1f421, R.drawable.emoji_1f421);
sEmojisMap.put(0x1f40a, R.drawable.emoji_1f40a);
sEmojisMap.put(0x1f42b, R.drawable.emoji_1f42b);
sEmojisMap.put(0x1f42a, R.drawable.emoji_1f42a);
sEmojisMap.put(0x1f406, R.drawable.emoji_1f406);
sEmojisMap.put(0x1f408, R.drawable.emoji_1f408);
sEmojisMap.put(0x1f429, R.drawable.emoji_1f429);
sEmojisMap.put(0x1f43e, R.drawable.emoji_1f43e);
sEmojisMap.put(0x1f490, R.drawable.emoji_1f490);
sEmojisMap.put(0x1f338, R.drawable.emoji_1f338);
sEmojisMap.put(0x1f337, R.drawable.emoji_1f337);
sEmojisMap.put(0x1f340, R.drawable.emoji_1f340);
sEmojisMap.put(0x1f339, R.drawable.emoji_1f339);
sEmojisMap.put(0x1f33b, R.drawable.emoji_1f33b);
sEmojisMap.put(0x1f33a, R.drawable.emoji_1f33a);
sEmojisMap.put(0x1f341, R.drawable.emoji_1f341);
sEmojisMap.put(0x1f343, R.drawable.emoji_1f343);
sEmojisMap.put(0x1f342, R.drawable.emoji_1f342);
sEmojisMap.put(0x1f33f, R.drawable.emoji_1f33f);
sEmojisMap.put(0x1f33e, R.drawable.emoji_1f33e);
sEmojisMap.put(0x1f344, R.drawable.emoji_1f344);
sEmojisMap.put(0x1f335, R.drawable.emoji_1f335);
sEmojisMap.put(0x1f334, R.drawable.emoji_1f334);
sEmojisMap.put(0x1f332, R.drawable.emoji_1f332);
sEmojisMap.put(0x1f333, R.drawable.emoji_1f333);
sEmojisMap.put(0x1f330, R.drawable.emoji_1f330);
sEmojisMap.put(0x1f331, R.drawable.emoji_1f331);
sEmojisMap.put(0x1f33c, R.drawable.emoji_1f33c);
sEmojisMap.put(0x1f310, R.drawable.emoji_1f310);
sEmojisMap.put(0x1f31e, R.drawable.emoji_1f31e);
sEmojisMap.put(0x1f31d, R.drawable.emoji_1f31d);
sEmojisMap.put(0x1f31a, R.drawable.emoji_1f31a);
sEmojisMap.put(0x1f311, R.drawable.emoji_1f311);
sEmojisMap.put(0x1f312, R.drawable.emoji_1f312);
sEmojisMap.put(0x1f313, R.drawable.emoji_1f313);
sEmojisMap.put(0x1f314, R.drawable.emoji_1f314);
sEmojisMap.put(0x1f315, R.drawable.emoji_1f315);
sEmojisMap.put(0x1f316, R.drawable.emoji_1f316);
sEmojisMap.put(0x1f317, R.drawable.emoji_1f317);
sEmojisMap.put(0x1f318, R.drawable.emoji_1f318);
sEmojisMap.put(0x1f31c, R.drawable.emoji_1f31c);
sEmojisMap.put(0x1f31b, R.drawable.emoji_1f31b);
sEmojisMap.put(0x1f319, R.drawable.emoji_1f319);
sEmojisMap.put(0x1f30d, R.drawable.emoji_1f30d);
sEmojisMap.put(0x1f30e, R.drawable.emoji_1f30e);
sEmojisMap.put(0x1f30f, R.drawable.emoji_1f30f);
sEmojisMap.put(0x1f30b, R.drawable.emoji_1f30b);
sEmojisMap.put(0x1f30c, R.drawable.emoji_1f30c);
sEmojisMap.put(0x1f320, R.drawable.emoji_1f303);
sEmojisMap.put(0x2b50, R.drawable.emoji_2b50);
sEmojisMap.put(0x2600, R.drawable.emoji_2600);
sEmojisMap.put(0x26c5, R.drawable.emoji_26c5);
sEmojisMap.put(0x2601, R.drawable.emoji_2601);
sEmojisMap.put(0x26a1, R.drawable.emoji_26a1);
sEmojisMap.put(0x2614, R.drawable.emoji_2614);
sEmojisMap.put(0x2744, R.drawable.emoji_2744);
sEmojisMap.put(0x26c4, R.drawable.emoji_26c4);
sEmojisMap.put(0x1f300, R.drawable.emoji_1f300);
sEmojisMap.put(0x1f301, R.drawable.emoji_1f301);
sEmojisMap.put(0x1f308, R.drawable.emoji_1f308);
sEmojisMap.put(0x1f30a, R.drawable.emoji_1f30a);
// Objects
sEmojisMap.put(0x1f38d, R.drawable.emoji_1f38d);
sEmojisMap.put(0x1f49d, R.drawable.emoji_1f49d);
sEmojisMap.put(0x1f38e, R.drawable.emoji_1f38e);
sEmojisMap.put(0x1f392, R.drawable.emoji_1f392);
sEmojisMap.put(0x1f393, R.drawable.emoji_1f393);
sEmojisMap.put(0x1f38f, R.drawable.emoji_1f38f);
sEmojisMap.put(0x1f386, R.drawable.emoji_1f386);
sEmojisMap.put(0x1f387, R.drawable.emoji_1f387);
sEmojisMap.put(0x1f390, R.drawable.emoji_1f390);
sEmojisMap.put(0x1f391, R.drawable.emoji_1f391);
sEmojisMap.put(0x1f383, R.drawable.emoji_1f383);
sEmojisMap.put(0x1f47b, R.drawable.emoji_1f47b);
sEmojisMap.put(0x1f385, R.drawable.emoji_1f385);
sEmojisMap.put(0x1f384, R.drawable.emoji_1f384);
sEmojisMap.put(0x1f381, R.drawable.emoji_1f381);
sEmojisMap.put(0x1f38b, R.drawable.emoji_1f38b);
sEmojisMap.put(0x1f389, R.drawable.emoji_1f389);
sEmojisMap.put(0x1f38a, R.drawable.emoji_1f38a);
sEmojisMap.put(0x1f388, R.drawable.emoji_1f388);
sEmojisMap.put(0x1f38c, R.drawable.emoji_1f38c);
sEmojisMap.put(0x1f52e, R.drawable.emoji_1f52e);
sEmojisMap.put(0x1f3a5, R.drawable.emoji_1f3a5);
sEmojisMap.put(0x1f4f7, R.drawable.emoji_1f4f7);
sEmojisMap.put(0x1f4f9, R.drawable.emoji_1f4f9);
sEmojisMap.put(0x1f4fc, R.drawable.emoji_1f4fc);
sEmojisMap.put(0x1f4bf, R.drawable.emoji_1f4bf);
sEmojisMap.put(0x1f4c0, R.drawable.emoji_1f4c0);
sEmojisMap.put(0x1f4bd, R.drawable.emoji_1f4bd);
sEmojisMap.put(0x1f4be, R.drawable.emoji_1f4be);
sEmojisMap.put(0x1f4bb, R.drawable.emoji_1f4bb);
sEmojisMap.put(0x1f4f1, R.drawable.emoji_1f4f1);
sEmojisMap.put(0x260e, R.drawable.emoji_260e);
sEmojisMap.put(0x1f4de, R.drawable.emoji_1f4de);
sEmojisMap.put(0x1f4df, R.drawable.emoji_1f4df);
sEmojisMap.put(0x1f4e0, R.drawable.emoji_1f4e0);
sEmojisMap.put(0x1f4e1, R.drawable.emoji_1f4e1);
sEmojisMap.put(0x1f4fa, R.drawable.emoji_1f4fa);
sEmojisMap.put(0x1f4fb, R.drawable.emoji_1f4fb);
sEmojisMap.put(0x1f50a, R.drawable.emoji_1f50a);
sEmojisMap.put(0x1f509, R.drawable.emoji_1f509);
sEmojisMap.put(0x1f508, R.drawable.emoji_1f508);
sEmojisMap.put(0x1f507, R.drawable.emoji_1f507);
sEmojisMap.put(0x1f514, R.drawable.emoji_1f514);
sEmojisMap.put(0x1f515, R.drawable.emoji_1f515);
sEmojisMap.put(0x1f4e2, R.drawable.emoji_1f4e2);
sEmojisMap.put(0x1f4e3, R.drawable.emoji_1f4e3);
sEmojisMap.put(0x23f3, R.drawable.emoji_23f3);
sEmojisMap.put(0x231b, R.drawable.emoji_231b);
sEmojisMap.put(0x23f0, R.drawable.emoji_23f0);
sEmojisMap.put(0x231a, R.drawable.emoji_231a);
sEmojisMap.put(0x1f513, R.drawable.emoji_1f513);
sEmojisMap.put(0x1f512, R.drawable.emoji_1f512);
sEmojisMap.put(0x1f50f, R.drawable.emoji_1f50f);
sEmojisMap.put(0x1f510, R.drawable.emoji_1f510);
sEmojisMap.put(0x1f511, R.drawable.emoji_1f511);
sEmojisMap.put(0x1f50e, R.drawable.emoji_1f50e);
sEmojisMap.put(0x1f4a1, R.drawable.emoji_1f4a1);
sEmojisMap.put(0x1f526, R.drawable.emoji_1f526);
sEmojisMap.put(0x1f506, R.drawable.emoji_1f506);
sEmojisMap.put(0x1f505, R.drawable.emoji_1f505);
sEmojisMap.put(0x1f50c, R.drawable.emoji_1f50c);
sEmojisMap.put(0x1f50b, R.drawable.emoji_1f50b);
sEmojisMap.put(0x1f50d, R.drawable.emoji_1f50d);
sEmojisMap.put(0x1f6c1, R.drawable.emoji_1f6c1);
sEmojisMap.put(0x1f6c0, R.drawable.emoji_1f6c0);
sEmojisMap.put(0x1f6bf, R.drawable.emoji_1f6bf);
sEmojisMap.put(0x1f6bd, R.drawable.emoji_1f6bd);
sEmojisMap.put(0x1f527, R.drawable.emoji_1f527);
sEmojisMap.put(0x1f529, R.drawable.emoji_1f529);
sEmojisMap.put(0x1f528, R.drawable.emoji_1f528);
sEmojisMap.put(0x1f6aa, R.drawable.emoji_1f6aa);
sEmojisMap.put(0x1f6ac, R.drawable.emoji_1f6ac);
sEmojisMap.put(0x1f4a3, R.drawable.emoji_1f4a3);
sEmojisMap.put(0x1f52b, R.drawable.emoji_1f52b);
sEmojisMap.put(0x1f52a, R.drawable.emoji_1f52a);
sEmojisMap.put(0x1f48a, R.drawable.emoji_1f48a);
sEmojisMap.put(0x1f489, R.drawable.emoji_1f489);
sEmojisMap.put(0x1f4b0, R.drawable.emoji_1f4b0);
sEmojisMap.put(0x1f4b4, R.drawable.emoji_1f4b4);
sEmojisMap.put(0x1f4b5, R.drawable.emoji_1f4b5);
sEmojisMap.put(0x1f4b7, R.drawable.emoji_1f4b7);
sEmojisMap.put(0x1f4b6, R.drawable.emoji_1f4b6);
sEmojisMap.put(0x1f4b3, R.drawable.emoji_1f4b3);
sEmojisMap.put(0x1f4b8, R.drawable.emoji_1f4b8);
sEmojisMap.put(0x1f4f2, R.drawable.emoji_1f4f2);
sEmojisMap.put(0x1f4e7, R.drawable.emoji_1f4e7);
sEmojisMap.put(0x1f4e5, R.drawable.emoji_1f4e5);
sEmojisMap.put(0x1f4e4, R.drawable.emoji_1f4e4);
sEmojisMap.put(0x2709, R.drawable.emoji_2709);
sEmojisMap.put(0x1f4e9, R.drawable.emoji_1f4e9);
sEmojisMap.put(0x1f4e8, R.drawable.emoji_1f4e8);
sEmojisMap.put(0x1f4ef, R.drawable.emoji_1f4ef);
sEmojisMap.put(0x1f4eb, R.drawable.emoji_1f4eb);
sEmojisMap.put(0x1f4ea, R.drawable.emoji_1f4ea);
sEmojisMap.put(0x1f4ec, R.drawable.emoji_1f4ec);
sEmojisMap.put(0x1f4ed, R.drawable.emoji_1f4ed);
sEmojisMap.put(0x1f4ee, R.drawable.emoji_1f4ee);
sEmojisMap.put(0x1f4e6, R.drawable.emoji_1f4e6);
sEmojisMap.put(0x1f4dd, R.drawable.emoji_1f4dd);
sEmojisMap.put(0x1f4c4, R.drawable.emoji_1f4c4);
sEmojisMap.put(0x1f4c3, R.drawable.emoji_1f4c3);
sEmojisMap.put(0x1f4d1, R.drawable.emoji_1f4d1);
sEmojisMap.put(0x1f4ca, R.drawable.emoji_1f4ca);
sEmojisMap.put(0x1f4c8, R.drawable.emoji_1f4c8);
sEmojisMap.put(0x1f4c9, R.drawable.emoji_1f4c9);
sEmojisMap.put(0x1f4dc, R.drawable.emoji_1f4dc);
sEmojisMap.put(0x1f4cb, R.drawable.emoji_1f4cb);
sEmojisMap.put(0x1f4c5, R.drawable.emoji_1f4c5);
sEmojisMap.put(0x1f4c6, R.drawable.emoji_1f4c6);
sEmojisMap.put(0x1f4c7, R.drawable.emoji_1f4c7);
sEmojisMap.put(0x1f4c1, R.drawable.emoji_1f4c1);
sEmojisMap.put(0x1f4c2, R.drawable.emoji_1f4c2);
sEmojisMap.put(0x2702, R.drawable.emoji_2702);
sEmojisMap.put(0x1f4cc, R.drawable.emoji_1f4cc);
sEmojisMap.put(0x1f4ce, R.drawable.emoji_1f4ce);
sEmojisMap.put(0x2712, R.drawable.emoji_2712);
sEmojisMap.put(0x270f, R.drawable.emoji_270f);
sEmojisMap.put(0x1f4cf, R.drawable.emoji_1f4cf);
sEmojisMap.put(0x1f4d0, R.drawable.emoji_1f4d0);
sEmojisMap.put(0x1f4d5, R.drawable.emoji_1f4d5);
sEmojisMap.put(0x1f4d7, R.drawable.emoji_1f4d7);
sEmojisMap.put(0x1f4d8, R.drawable.emoji_1f4d8);
sEmojisMap.put(0x1f4d9, R.drawable.emoji_1f4d9);
sEmojisMap.put(0x1f4d3, R.drawable.emoji_1f4d3);
sEmojisMap.put(0x1f4d4, R.drawable.emoji_1f4d4);
sEmojisMap.put(0x1f4d2, R.drawable.emoji_1f4d2);
sEmojisMap.put(0x1f4da, R.drawable.emoji_1f4da);
sEmojisMap.put(0x1f4d6, R.drawable.emoji_1f4d6);
sEmojisMap.put(0x1f516, R.drawable.emoji_1f516);
sEmojisMap.put(0x1f4db, R.drawable.emoji_1f4db);
sEmojisMap.put(0x1f52c, R.drawable.emoji_1f52c);
sEmojisMap.put(0x1f52d, R.drawable.emoji_1f52d);
sEmojisMap.put(0x1f4f0, R.drawable.emoji_1f4f0);
sEmojisMap.put(0x1f3a8, R.drawable.emoji_1f3a8);
sEmojisMap.put(0x1f3ac, R.drawable.emoji_1f3ac);
sEmojisMap.put(0x1f3a4, R.drawable.emoji_1f3a4);
sEmojisMap.put(0x1f3a7, R.drawable.emoji_1f3a7);
sEmojisMap.put(0x1f3bc, R.drawable.emoji_1f3bc);
sEmojisMap.put(0x1f3b5, R.drawable.emoji_1f3b5);
sEmojisMap.put(0x1f3b6, R.drawable.emoji_1f3b6);
sEmojisMap.put(0x1f3b9, R.drawable.emoji_1f3b9);
sEmojisMap.put(0x1f3bb, R.drawable.emoji_1f3bb);
sEmojisMap.put(0x1f3ba, R.drawable.emoji_1f3ba);
sEmojisMap.put(0x1f3b7, R.drawable.emoji_1f3b7);
sEmojisMap.put(0x1f3b8, R.drawable.emoji_1f3b8);
sEmojisMap.put(0x1f47e, R.drawable.emoji_1f47e);
sEmojisMap.put(0x1f3ae, R.drawable.emoji_1f3ae);
sEmojisMap.put(0x1f0cf, R.drawable.emoji_1f0cf);
sEmojisMap.put(0x1f3b4, R.drawable.emoji_1f3b4);
sEmojisMap.put(0x1f004, R.drawable.emoji_1f004);
sEmojisMap.put(0x1f3b2, R.drawable.emoji_1f3b2);
sEmojisMap.put(0x1f3af, R.drawable.emoji_1f3af);
sEmojisMap.put(0x1f3c8, R.drawable.emoji_1f3c8);
sEmojisMap.put(0x1f3c0, R.drawable.emoji_1f3c0);
sEmojisMap.put(0x26bd, R.drawable.emoji_26bd);
sEmojisMap.put(0x26be, R.drawable.emoji_26be);
sEmojisMap.put(0x1f3be, R.drawable.emoji_1f3be);
sEmojisMap.put(0x1f3b1, R.drawable.emoji_1f3b1);
sEmojisMap.put(0x1f3c9, R.drawable.emoji_1f3c9);
sEmojisMap.put(0x1f3b3, R.drawable.emoji_1f3b3);
sEmojisMap.put(0x26f3, R.drawable.emoji_26f3);
sEmojisMap.put(0x1f6b5, R.drawable.emoji_1f6b5);
sEmojisMap.put(0x1f6b4, R.drawable.emoji_1f6b4);
sEmojisMap.put(0x1f3c1, R.drawable.emoji_1f3c1);
sEmojisMap.put(0x1f3c7, R.drawable.emoji_1f3c7);
sEmojisMap.put(0x1f3c6, R.drawable.emoji_1f3c6);
sEmojisMap.put(0x1f3bf, R.drawable.emoji_1f3bf);
sEmojisMap.put(0x1f3c2, R.drawable.emoji_1f3c2);
sEmojisMap.put(0x1f3ca, R.drawable.emoji_1f3ca);
sEmojisMap.put(0x1f3c4, R.drawable.emoji_1f3c4);
sEmojisMap.put(0x1f3a3, R.drawable.emoji_1f3a3);
sEmojisMap.put(0x2615, R.drawable.emoji_2615);
sEmojisMap.put(0x1f375, R.drawable.emoji_1f375);
sEmojisMap.put(0x1f376, R.drawable.emoji_1f376);
sEmojisMap.put(0x1f37c, R.drawable.emoji_1f37c);
sEmojisMap.put(0x1f37a, R.drawable.emoji_1f37a);
sEmojisMap.put(0x1f37b, R.drawable.emoji_1f37b);
sEmojisMap.put(0x1f378, R.drawable.emoji_1f378);
sEmojisMap.put(0x1f379, R.drawable.emoji_1f379);
sEmojisMap.put(0x1f377, R.drawable.emoji_1f377);
sEmojisMap.put(0x1f374, R.drawable.emoji_1f374);
sEmojisMap.put(0x1f355, R.drawable.emoji_1f355);
sEmojisMap.put(0x1f354, R.drawable.emoji_1f354);
sEmojisMap.put(0x1f35f, R.drawable.emoji_1f35f);
sEmojisMap.put(0x1f357, R.drawable.emoji_1f357);
sEmojisMap.put(0x1f356, R.drawable.emoji_1f356);
sEmojisMap.put(0x1f35d, R.drawable.emoji_1f35d);
sEmojisMap.put(0x1f35b, R.drawable.emoji_1f35b);
sEmojisMap.put(0x1f364, R.drawable.emoji_1f364);
sEmojisMap.put(0x1f371, R.drawable.emoji_1f371);
sEmojisMap.put(0x1f363, R.drawable.emoji_1f363);
sEmojisMap.put(0x1f365, R.drawable.emoji_1f365);
sEmojisMap.put(0x1f359, R.drawable.emoji_1f359);
sEmojisMap.put(0x1f358, R.drawable.emoji_1f358);
sEmojisMap.put(0x1f35a, R.drawable.emoji_1f35a);
sEmojisMap.put(0x1f35c, R.drawable.emoji_1f35c);
sEmojisMap.put(0x1f372, R.drawable.emoji_1f372);
sEmojisMap.put(0x1f362, R.drawable.emoji_1f362);
sEmojisMap.put(0x1f361, R.drawable.emoji_1f361);
sEmojisMap.put(0x1f373, R.drawable.emoji_1f373);
sEmojisMap.put(0x1f35e, R.drawable.emoji_1f35e);
sEmojisMap.put(0x1f369, R.drawable.emoji_1f369);
sEmojisMap.put(0x1f36e, R.drawable.emoji_1f36e);
sEmojisMap.put(0x1f366, R.drawable.emoji_1f366);
sEmojisMap.put(0x1f368, R.drawable.emoji_1f368);
sEmojisMap.put(0x1f367, R.drawable.emoji_1f367);
sEmojisMap.put(0x1f382, R.drawable.emoji_1f382);
sEmojisMap.put(0x1f370, R.drawable.emoji_1f370);
sEmojisMap.put(0x1f36a, R.drawable.emoji_1f36a);
sEmojisMap.put(0x1f36b, R.drawable.emoji_1f36b);
sEmojisMap.put(0x1f36c, R.drawable.emoji_1f36c);
sEmojisMap.put(0x1f36d, R.drawable.emoji_1f36d);
sEmojisMap.put(0x1f36f, R.drawable.emoji_1f36f);
sEmojisMap.put(0x1f34e, R.drawable.emoji_1f34e);
sEmojisMap.put(0x1f34f, R.drawable.emoji_1f34f);
sEmojisMap.put(0x1f34a, R.drawable.emoji_1f34a);
sEmojisMap.put(0x1f34b, R.drawable.emoji_1f34b);
sEmojisMap.put(0x1f352, R.drawable.emoji_1f352);
sEmojisMap.put(0x1f347, R.drawable.emoji_1f347);
sEmojisMap.put(0x1f349, R.drawable.emoji_1f349);
sEmojisMap.put(0x1f353, R.drawable.emoji_1f353);
sEmojisMap.put(0x1f351, R.drawable.emoji_1f351);
sEmojisMap.put(0x1f348, R.drawable.emoji_1f348);
sEmojisMap.put(0x1f34c, R.drawable.emoji_1f34c);
sEmojisMap.put(0x1f350, R.drawable.emoji_1f350);
sEmojisMap.put(0x1f34d, R.drawable.emoji_1f34d);
sEmojisMap.put(0x1f360, R.drawable.emoji_1f360);
sEmojisMap.put(0x1f346, R.drawable.emoji_1f346);
sEmojisMap.put(0x1f345, R.drawable.emoji_1f345);
sEmojisMap.put(0x1f33d, R.drawable.emoji_1f33d);
// Places
sEmojisMap.put(0x1f3e0, R.drawable.emoji_1f3e0);
sEmojisMap.put(0x1f3e1, R.drawable.emoji_1f3e1);
sEmojisMap.put(0x1f3eb, R.drawable.emoji_1f3eb);
sEmojisMap.put(0x1f3e2, R.drawable.emoji_1f3e2);
sEmojisMap.put(0x1f3e3, R.drawable.emoji_1f3e3);
sEmojisMap.put(0x1f3e5, R.drawable.emoji_1f3e5);
sEmojisMap.put(0x1f3e6, R.drawable.emoji_1f3e6);
sEmojisMap.put(0x1f3ea, R.drawable.emoji_1f3ea);
sEmojisMap.put(0x1f3e9, R.drawable.emoji_1f3e9);
sEmojisMap.put(0x1f3e8, R.drawable.emoji_1f3e8);
sEmojisMap.put(0x1f492, R.drawable.emoji_1f492);
sEmojisMap.put(0x26ea, R.drawable.emoji_26ea);
sEmojisMap.put(0x1f3ec, R.drawable.emoji_1f3ec);
sEmojisMap.put(0x1f3e4, R.drawable.emoji_1f3e4);
sEmojisMap.put(0x1f307, R.drawable.emoji_1f307);
sEmojisMap.put(0x1f306, R.drawable.emoji_1f306);
sEmojisMap.put(0x1f3ef, R.drawable.emoji_1f3ef);
sEmojisMap.put(0x1f3f0, R.drawable.emoji_1f3f0);
sEmojisMap.put(0x26fa, R.drawable.emoji_26fa);
sEmojisMap.put(0x1f3ed, R.drawable.emoji_1f3ed);
sEmojisMap.put(0x1f5fc, R.drawable.emoji_1f5fc);
sEmojisMap.put(0x1f5fe, R.drawable.emoji_1f5fe);
sEmojisMap.put(0x1f5fb, R.drawable.emoji_1f5fb);
sEmojisMap.put(0x1f304, R.drawable.emoji_1f304);
sEmojisMap.put(0x1f305, R.drawable.emoji_1f305);
sEmojisMap.put(0x1f303, R.drawable.emoji_1f303);
sEmojisMap.put(0x1f5fd, R.drawable.emoji_1f5fd);
sEmojisMap.put(0x1f309, R.drawable.emoji_1f309);
sEmojisMap.put(0x1f3a0, R.drawable.emoji_1f3a0);
sEmojisMap.put(0x1f3a1, R.drawable.emoji_1f3a1);
sEmojisMap.put(0x26f2, R.drawable.emoji_26f2);
sEmojisMap.put(0x1f3a2, R.drawable.emoji_1f3a2);
sEmojisMap.put(0x1f6a2, R.drawable.emoji_1f6a2);
sEmojisMap.put(0x26f5, R.drawable.emoji_26f5);
sEmojisMap.put(0x1f6a4, R.drawable.emoji_1f6a4);
sEmojisMap.put(0x1f6a3, R.drawable.emoji_1f6a3);
sEmojisMap.put(0x2693, R.drawable.emoji_2693);
sEmojisMap.put(0x1f680, R.drawable.emoji_1f680);
sEmojisMap.put(0x2708, R.drawable.emoji_2708);
sEmojisMap.put(0x1f4ba, R.drawable.emoji_1f4ba);
sEmojisMap.put(0x1f681, R.drawable.emoji_1f681);
sEmojisMap.put(0x1f682, R.drawable.emoji_1f682);
sEmojisMap.put(0x1f68a, R.drawable.emoji_1f68a);
sEmojisMap.put(0x1f689, R.drawable.emoji_1f689);
sEmojisMap.put(0x1f69e, R.drawable.emoji_1f69e);
sEmojisMap.put(0x1f686, R.drawable.emoji_1f686);
sEmojisMap.put(0x1f684, R.drawable.emoji_1f684);
sEmojisMap.put(0x1f685, R.drawable.emoji_1f685);
sEmojisMap.put(0x1f688, R.drawable.emoji_1f688);
sEmojisMap.put(0x1f687, R.drawable.emoji_1f687);
sEmojisMap.put(0x1f69d, R.drawable.emoji_1f69d);
sEmojisMap.put(0x1f68b, R.drawable.emoji_1f68b);
sEmojisMap.put(0x1f683, R.drawable.emoji_1f683);
sEmojisMap.put(0x1f68e, R.drawable.emoji_1f68e);
sEmojisMap.put(0x1f68c, R.drawable.emoji_1f68c);
sEmojisMap.put(0x1f68d, R.drawable.emoji_1f68d);
sEmojisMap.put(0x1f699, R.drawable.emoji_1f699);
sEmojisMap.put(0x1f698, R.drawable.emoji_1f698);
sEmojisMap.put(0x1f697, R.drawable.emoji_1f697);
sEmojisMap.put(0x1f695, R.drawable.emoji_1f695);
sEmojisMap.put(0x1f696, R.drawable.emoji_1f696);
sEmojisMap.put(0x1f69b, R.drawable.emoji_1f69b);
sEmojisMap.put(0x1f69a, R.drawable.emoji_1f69a);
sEmojisMap.put(0x1f6a8, R.drawable.emoji_1f6a8);
sEmojisMap.put(0x1f693, R.drawable.emoji_1f693);
sEmojisMap.put(0x1f694, R.drawable.emoji_1f694);
sEmojisMap.put(0x1f692, R.drawable.emoji_1f692);
sEmojisMap.put(0x1f691, R.drawable.emoji_1f691);
sEmojisMap.put(0x1f690, R.drawable.emoji_1f690);
sEmojisMap.put(0x1f6b2, R.drawable.emoji_1f6b2);
sEmojisMap.put(0x1f6a1, R.drawable.emoji_1f6a1);
sEmojisMap.put(0x1f69f, R.drawable.emoji_1f69f);
sEmojisMap.put(0x1f6a0, R.drawable.emoji_1f6a0);
sEmojisMap.put(0x1f69c, R.drawable.emoji_1f69c);
sEmojisMap.put(0x1f488, R.drawable.emoji_1f488);
sEmojisMap.put(0x1f68f, R.drawable.emoji_1f68f);
sEmojisMap.put(0x1f3ab, R.drawable.emoji_1f3ab);
sEmojisMap.put(0x1f6a6, R.drawable.emoji_1f6a6);
sEmojisMap.put(0x1f6a5, R.drawable.emoji_1f6a5);
sEmojisMap.put(0x26a0, R.drawable.emoji_26a0);
sEmojisMap.put(0x1f6a7, R.drawable.emoji_1f6a7);
sEmojisMap.put(0x1f530, R.drawable.emoji_1f530);
sEmojisMap.put(0x26fd, R.drawable.emoji_26fd);
sEmojisMap.put(0x1f3ee, R.drawable.emoji_1f3ee);
sEmojisMap.put(0x1f3b0, R.drawable.emoji_1f3b0);
sEmojisMap.put(0x2668, R.drawable.emoji_2668);
sEmojisMap.put(0x1f5ff, R.drawable.emoji_1f5ff);
sEmojisMap.put(0x1f3aa, R.drawable.emoji_1f3aa);
sEmojisMap.put(0x1f3ad, R.drawable.emoji_1f3ad);
sEmojisMap.put(0x1f4cd, R.drawable.emoji_1f4cd);
sEmojisMap.put(0x1f6a9, R.drawable.emoji_1f6a9);
// Emoji.fromChars("\ud83c\uddef\ud83c\uddf5");
// Emoji.fromChars("\ud83c\uddf0\ud83c\uddf7");
// Emoji.fromChars("\ud83c\udde9\ud83c\uddea");
// Emoji.fromChars("\ud83c\udde8\ud83c\uddf3");
// Emoji.fromChars("\ud83c\uddfa\ud83c\uddf8");
// Emoji.fromChars("\ud83c\uddeb\ud83c\uddf7");
// Emoji.fromChars("\ud83c\uddea\ud83c\uddf8");
// Emoji.fromChars("\ud83c\uddee\ud83c\uddf9");
// Emoji.fromChars("\ud83c\uddf7\ud83c\uddfa");
// Emoji.fromChars("\ud83c\uddec\ud83c\udde7");
// Symbols
// Emoji.fromChars("\u0031\u20e3"),
// Emoji.fromChars("\u0032\u20e3"),
// Emoji.fromChars("\u0033\u20e3"),
// Emoji.fromChars("\u0034\u20e3"),
// Emoji.fromChars("\u0035\u20e3"),
// Emoji.fromChars("\u0036\u20e3"),
// Emoji.fromChars("\u0037\u20e3"),
// Emoji.fromChars("\u0038\u20e3"),
// Emoji.fromChars("\u0039\u20e3"),
// Emoji.fromChars("\u0030\u20e3"),
sEmojisMap.put(0x1f51f, R.drawable.emoji_1f51f);
sEmojisMap.put(0x1f522, R.drawable.emoji_1f522);
// Emoji.fromChars("\u0023\u20e3"),
sEmojisMap.put(0x1f523, R.drawable.emoji_1f523);
sEmojisMap.put(0x2b06, R.drawable.emoji_2b06);
sEmojisMap.put(0x2b07, R.drawable.emoji_2b07);
sEmojisMap.put(0x2b05, R.drawable.emoji_2b05);
sEmojisMap.put(0x27a1, R.drawable.emoji_27a1);
sEmojisMap.put(0x1f520, R.drawable.emoji_1f520);
sEmojisMap.put(0x1f521, R.drawable.emoji_1f521);
sEmojisMap.put(0x1f524, R.drawable.emoji_1f524);
sEmojisMap.put(0x2197, R.drawable.emoji_2197);
sEmojisMap.put(0x2196, R.drawable.emoji_2196);
sEmojisMap.put(0x2198, R.drawable.emoji_2198);
sEmojisMap.put(0x2199, R.drawable.emoji_2199);
sEmojisMap.put(0x2194, R.drawable.emoji_2194);
sEmojisMap.put(0x2195, R.drawable.emoji_2195);
sEmojisMap.put(0x1f504, R.drawable.emoji_1f504);
sEmojisMap.put(0x25c0, R.drawable.emoji_25c0);
sEmojisMap.put(0x25b6, R.drawable.emoji_25b6);
sEmojisMap.put(0x1f53c, R.drawable.emoji_1f53c);
sEmojisMap.put(0x1f53d, R.drawable.emoji_1f53d);
sEmojisMap.put(0x21a9, R.drawable.emoji_21a9);
sEmojisMap.put(0x21aa, R.drawable.emoji_21aa);
sEmojisMap.put(0x2139, R.drawable.emoji_2139);
sEmojisMap.put(0x23ea, R.drawable.emoji_23ea);
sEmojisMap.put(0x23e9, R.drawable.emoji_23e9);
sEmojisMap.put(0x23eb, R.drawable.emoji_23eb);
sEmojisMap.put(0x23ec, R.drawable.emoji_23ec);
sEmojisMap.put(0x2935, R.drawable.emoji_2935);
sEmojisMap.put(0x2934, R.drawable.emoji_2934);
sEmojisMap.put(0x1f197, R.drawable.emoji_1f197);
sEmojisMap.put(0x1f500, R.drawable.emoji_1f500);
sEmojisMap.put(0x1f501, R.drawable.emoji_1f501);
sEmojisMap.put(0x1f502, R.drawable.emoji_1f502);
sEmojisMap.put(0x1f195, R.drawable.emoji_1f195);
sEmojisMap.put(0x1f199, R.drawable.emoji_1f199);
sEmojisMap.put(0x1f192, R.drawable.emoji_1f192);
sEmojisMap.put(0x1f193, R.drawable.emoji_1f193);
sEmojisMap.put(0x1f196, R.drawable.emoji_1f196);
sEmojisMap.put(0x1f4f6, R.drawable.emoji_1f4f6);
sEmojisMap.put(0x1f3a6, R.drawable.emoji_1f3a6);
sEmojisMap.put(0x1f201, R.drawable.emoji_1f201);
sEmojisMap.put(0x1f22f, R.drawable.emoji_1f22f);
sEmojisMap.put(0x1f233, R.drawable.emoji_1f233);
sEmojisMap.put(0x1f235, R.drawable.emoji_1f235);
sEmojisMap.put(0x1f234, R.drawable.emoji_1f234);
sEmojisMap.put(0x1f232, R.drawable.emoji_1f232);
sEmojisMap.put(0x1f250, R.drawable.emoji_1f250);
sEmojisMap.put(0x1f239, R.drawable.emoji_1f239);
sEmojisMap.put(0x1f23a, R.drawable.emoji_1f23a);
sEmojisMap.put(0x1f236, R.drawable.emoji_1f236);
sEmojisMap.put(0x1f21a, R.drawable.emoji_1f21a);
sEmojisMap.put(0x1f6bb, R.drawable.emoji_1f6bb);
sEmojisMap.put(0x1f6b9, R.drawable.emoji_1f6b9);
sEmojisMap.put(0x1f6ba, R.drawable.emoji_1f6ba);
sEmojisMap.put(0x1f6bc, R.drawable.emoji_1f6bc);
sEmojisMap.put(0x1f6be, R.drawable.emoji_1f6be);
sEmojisMap.put(0x1f6b0, R.drawable.emoji_1f6b0);
sEmojisMap.put(0x1f6ae, R.drawable.emoji_1f6ae);
sEmojisMap.put(0x1f17f, R.drawable.emoji_1f17f);
sEmojisMap.put(0x267f, R.drawable.emoji_267f);
sEmojisMap.put(0x1f6ad, R.drawable.emoji_1f6ad);
sEmojisMap.put(0x1f237, R.drawable.emoji_1f237);
sEmojisMap.put(0x1f238, R.drawable.emoji_1f238);
sEmojisMap.put(0x1f202, R.drawable.emoji_1f202);
sEmojisMap.put(0x24c2, R.drawable.emoji_24c2);
sEmojisMap.put(0x1f6c2, R.drawable.emoji_1f6c2);
sEmojisMap.put(0x1f6c4, R.drawable.emoji_1f6c4);
sEmojisMap.put(0x1f6c5, R.drawable.emoji_1f6c5);
sEmojisMap.put(0x1f6c3, R.drawable.emoji_1f6c3);
sEmojisMap.put(0x1f251, R.drawable.emoji_1f251);
sEmojisMap.put(0x3299, R.drawable.emoji_3299);
sEmojisMap.put(0x3297, R.drawable.emoji_3297);
sEmojisMap.put(0x1f191, R.drawable.emoji_1f191);
sEmojisMap.put(0x1f198, R.drawable.emoji_1f198);
sEmojisMap.put(0x1f194, R.drawable.emoji_1f194);
sEmojisMap.put(0x1f6ab, R.drawable.emoji_1f6ab);
sEmojisMap.put(0x1f51e, R.drawable.emoji_1f51e);
sEmojisMap.put(0x1f4f5, R.drawable.emoji_1f4f5);
sEmojisMap.put(0x1f6af, R.drawable.emoji_1f6af);
sEmojisMap.put(0x1f6b1, R.drawable.emoji_1f6b1);
sEmojisMap.put(0x1f6b3, R.drawable.emoji_1f6b3);
sEmojisMap.put(0x1f6b7, R.drawable.emoji_1f6b7);
sEmojisMap.put(0x1f6b8, R.drawable.emoji_1f6b8);
sEmojisMap.put(0x26d4, R.drawable.emoji_26d4);
sEmojisMap.put(0x2733, R.drawable.emoji_2733);
sEmojisMap.put(0x2747, R.drawable.emoji_2747);
sEmojisMap.put(0x274e, R.drawable.emoji_274e);
sEmojisMap.put(0x2705, R.drawable.emoji_2705);
sEmojisMap.put(0x2734, R.drawable.emoji_2734);
sEmojisMap.put(0x1f49f, R.drawable.emoji_1f49f);
sEmojisMap.put(0x1f19a, R.drawable.emoji_1f19a);
sEmojisMap.put(0x1f4f3, R.drawable.emoji_1f4f3);
sEmojisMap.put(0x1f4f4, R.drawable.emoji_1f4f4);
sEmojisMap.put(0x1f170, R.drawable.emoji_1f170);
sEmojisMap.put(0x1f171, R.drawable.emoji_1f171);
sEmojisMap.put(0x1f18e, R.drawable.emoji_1f18e);
sEmojisMap.put(0x1f17e, R.drawable.emoji_1f17e);
sEmojisMap.put(0x1f4a0, R.drawable.emoji_1f4a0);
sEmojisMap.put(0x27bf, R.drawable.emoji_27bf);
sEmojisMap.put(0x267b, R.drawable.emoji_267b);
sEmojisMap.put(0x2648, R.drawable.emoji_2648);
sEmojisMap.put(0x2649, R.drawable.emoji_2649);
sEmojisMap.put(0x264a, R.drawable.emoji_264a);
sEmojisMap.put(0x264b, R.drawable.emoji_264b);
sEmojisMap.put(0x264c, R.drawable.emoji_264c);
sEmojisMap.put(0x264d, R.drawable.emoji_264d);
sEmojisMap.put(0x264e, R.drawable.emoji_264e);
sEmojisMap.put(0x264f, R.drawable.emoji_264f);
sEmojisMap.put(0x2650, R.drawable.emoji_2650);
sEmojisMap.put(0x2651, R.drawable.emoji_2651);
sEmojisMap.put(0x2652, R.drawable.emoji_2652);
sEmojisMap.put(0x2653, R.drawable.emoji_2653);
sEmojisMap.put(0x26ce, R.drawable.emoji_26ce);
sEmojisMap.put(0x1f52f, R.drawable.emoji_1f52f);
sEmojisMap.put(0x1f3e7, R.drawable.emoji_1f3e7);
sEmojisMap.put(0x1f4b9, R.drawable.emoji_1f4b9);
sEmojisMap.put(0x1f4b2, R.drawable.emoji_1f4b2);
sEmojisMap.put(0x1f4b1, R.drawable.emoji_1f4b1);
sEmojisMap.put(0x00a9, R.drawable.emoji_00a9);
sEmojisMap.put(0x00ae, R.drawable.emoji_00ae);
sEmojisMap.put(0x2122, R.drawable.emoji_2122);
sEmojisMap.put(0x274c, R.drawable.emoji_274c);
sEmojisMap.put(0x203c, R.drawable.emoji_203c);
sEmojisMap.put(0x2049, R.drawable.emoji_2049);
sEmojisMap.put(0x2757, R.drawable.emoji_2757);
sEmojisMap.put(0x2753, R.drawable.emoji_2753);
sEmojisMap.put(0x2755, R.drawable.emoji_2755);
sEmojisMap.put(0x2754, R.drawable.emoji_2754);
sEmojisMap.put(0x2b55, R.drawable.emoji_2b55);
sEmojisMap.put(0x1f51d, R.drawable.emoji_1f51d);
sEmojisMap.put(0x1f51a, R.drawable.emoji_1f51a);
sEmojisMap.put(0x1f519, R.drawable.emoji_1f519);
sEmojisMap.put(0x1f51b, R.drawable.emoji_1f51b);
sEmojisMap.put(0x1f51c, R.drawable.emoji_1f51c);
sEmojisMap.put(0x1f503, R.drawable.emoji_1f503);
sEmojisMap.put(0x1f55b, R.drawable.emoji_1f55b);
sEmojisMap.put(0x1f567, R.drawable.emoji_1f567);
sEmojisMap.put(0x1f550, R.drawable.emoji_1f550);
sEmojisMap.put(0x1f55c, R.drawable.emoji_1f55c);
sEmojisMap.put(0x1f551, R.drawable.emoji_1f551);
sEmojisMap.put(0x1f55d, R.drawable.emoji_1f55d);
sEmojisMap.put(0x1f552, R.drawable.emoji_1f552);
sEmojisMap.put(0x1f55e, R.drawable.emoji_1f55e);
sEmojisMap.put(0x1f553, R.drawable.emoji_1f553);
sEmojisMap.put(0x1f55f, R.drawable.emoji_1f55f);
sEmojisMap.put(0x1f554, R.drawable.emoji_1f554);
sEmojisMap.put(0x1f560, R.drawable.emoji_1f560);
sEmojisMap.put(0x1f555, R.drawable.emoji_1f555);
sEmojisMap.put(0x1f556, R.drawable.emoji_1f556);
sEmojisMap.put(0x1f557, R.drawable.emoji_1f557);
sEmojisMap.put(0x1f558, R.drawable.emoji_1f558);
sEmojisMap.put(0x1f559, R.drawable.emoji_1f559);
sEmojisMap.put(0x1f55a, R.drawable.emoji_1f55a);
sEmojisMap.put(0x1f561, R.drawable.emoji_1f561);
sEmojisMap.put(0x1f562, R.drawable.emoji_1f562);
sEmojisMap.put(0x1f563, R.drawable.emoji_1f563);
sEmojisMap.put(0x1f564, R.drawable.emoji_1f564);
sEmojisMap.put(0x1f565, R.drawable.emoji_1f565);
sEmojisMap.put(0x1f566, R.drawable.emoji_1f566);
sEmojisMap.put(0x2716, R.drawable.emoji_2716);
sEmojisMap.put(0x2795, R.drawable.emoji_2795);
sEmojisMap.put(0x2796, R.drawable.emoji_2796);
sEmojisMap.put(0x2797, R.drawable.emoji_2797);
sEmojisMap.put(0x2660, R.drawable.emoji_2660);
sEmojisMap.put(0x2665, R.drawable.emoji_2665);
sEmojisMap.put(0x2663, R.drawable.emoji_2663);
sEmojisMap.put(0x2666, R.drawable.emoji_2666);
sEmojisMap.put(0x1f4ae, R.drawable.emoji_1f4ae);
sEmojisMap.put(0x1f4af, R.drawable.emoji_1f4af);
sEmojisMap.put(0x2714, R.drawable.emoji_2714);
sEmojisMap.put(0x2611, R.drawable.emoji_2611);
sEmojisMap.put(0x1f518, R.drawable.emoji_1f518);
sEmojisMap.put(0x1f517, R.drawable.emoji_1f517);
sEmojisMap.put(0x27b0, R.drawable.emoji_27b0);
sEmojisMap.put(0x3030, R.drawable.emoji_3030);
sEmojisMap.put(0x303d, R.drawable.emoji_303d);
sEmojisMap.put(0x1f531, R.drawable.emoji_1f531);
sEmojisMap.put(0x25fc, R.drawable.emoji_25fc);
sEmojisMap.put(0x25fb, R.drawable.emoji_25fb);
sEmojisMap.put(0x25fe, R.drawable.emoji_25fe);
sEmojisMap.put(0x25fd, R.drawable.emoji_25fd);
sEmojisMap.put(0x25aa, R.drawable.emoji_25aa);
sEmojisMap.put(0x25ab, R.drawable.emoji_25ab);
sEmojisMap.put(0x1f53a, R.drawable.emoji_1f53a);
sEmojisMap.put(0x1f532, R.drawable.emoji_1f532);
sEmojisMap.put(0x1f533, R.drawable.emoji_1f533);
sEmojisMap.put(0x26ab, R.drawable.emoji_26ab);
sEmojisMap.put(0x26aa, R.drawable.emoji_26aa);
sEmojisMap.put(0x1f534, R.drawable.emoji_1f534);
sEmojisMap.put(0x1f535, R.drawable.emoji_1f535);
sEmojisMap.put(0x1f53b, R.drawable.emoji_1f53b);
sEmojisMap.put(0x2b1c, R.drawable.emoji_2b1c);
sEmojisMap.put(0x2b1b, R.drawable.emoji_2b1b);
sEmojisMap.put(0x1f536, R.drawable.emoji_1f536);
sEmojisMap.put(0x1f537, R.drawable.emoji_1f537);
sEmojisMap.put(0x1f538, R.drawable.emoji_1f538);
sEmojisMap.put(0x1f539, R.drawable.emoji_1f539);
sSoftbanksMap.put(0xe001, R.drawable.emoji_1f466);
sSoftbanksMap.put(0xe002, R.drawable.emoji_1f467);
sSoftbanksMap.put(0xe003, R.drawable.emoji_1f48b);
sSoftbanksMap.put(0xe004, R.drawable.emoji_1f468);
sSoftbanksMap.put(0xe005, R.drawable.emoji_1f469);
sSoftbanksMap.put(0xe006, R.drawable.emoji_1f455);
sSoftbanksMap.put(0xe007, R.drawable.emoji_1f45e);
sSoftbanksMap.put(0xe008, R.drawable.emoji_1f4f7);
sSoftbanksMap.put(0xe009, R.drawable.emoji_1f4de);
sSoftbanksMap.put(0xe00a, R.drawable.emoji_1f4f1);
sSoftbanksMap.put(0xe00b, R.drawable.emoji_1f4e0);
sSoftbanksMap.put(0xe00c, R.drawable.emoji_1f4bb);
sSoftbanksMap.put(0xe00d, R.drawable.emoji_1f44a);
sSoftbanksMap.put(0xe00e, R.drawable.emoji_1f44d);
sSoftbanksMap.put(0xe00f, R.drawable.emoji_261d);
sSoftbanksMap.put(0xe010, R.drawable.emoji_270a);
sSoftbanksMap.put(0xe011, R.drawable.emoji_270c);
sSoftbanksMap.put(0xe012, R.drawable.emoji_1f64b);
sSoftbanksMap.put(0xe013, R.drawable.emoji_1f3bf);
sSoftbanksMap.put(0xe014, R.drawable.emoji_26f3);
sSoftbanksMap.put(0xe015, R.drawable.emoji_1f3be);
sSoftbanksMap.put(0xe016, R.drawable.emoji_26be);
sSoftbanksMap.put(0xe017, R.drawable.emoji_1f3c4);
sSoftbanksMap.put(0xe018, R.drawable.emoji_26bd);
sSoftbanksMap.put(0xe019, R.drawable.emoji_1f3a3);
sSoftbanksMap.put(0xe01a, R.drawable.emoji_1f434);
sSoftbanksMap.put(0xe01b, R.drawable.emoji_1f697);
sSoftbanksMap.put(0xe01c, R.drawable.emoji_26f5);
sSoftbanksMap.put(0xe01d, R.drawable.emoji_2708);
sSoftbanksMap.put(0xe01e, R.drawable.emoji_1f683);
sSoftbanksMap.put(0xe01f, R.drawable.emoji_1f685);
sSoftbanksMap.put(0xe020, R.drawable.emoji_2753);
sSoftbanksMap.put(0xe021, R.drawable.emoji_2757);
sSoftbanksMap.put(0xe022, R.drawable.emoji_2764);
sSoftbanksMap.put(0xe023, R.drawable.emoji_1f494);
sSoftbanksMap.put(0xe024, R.drawable.emoji_1f550);
sSoftbanksMap.put(0xe025, R.drawable.emoji_1f551);
sSoftbanksMap.put(0xe026, R.drawable.emoji_1f552);
sSoftbanksMap.put(0xe027, R.drawable.emoji_1f553);
sSoftbanksMap.put(0xe028, R.drawable.emoji_1f554);
sSoftbanksMap.put(0xe029, R.drawable.emoji_1f555);
sSoftbanksMap.put(0xe02a, R.drawable.emoji_1f556);
sSoftbanksMap.put(0xe02b, R.drawable.emoji_1f557);
sSoftbanksMap.put(0xe02c, R.drawable.emoji_1f558);
sSoftbanksMap.put(0xe02d, R.drawable.emoji_1f559);
sSoftbanksMap.put(0xe02e, R.drawable.emoji_1f55a);
sSoftbanksMap.put(0xe02f, R.drawable.emoji_1f55b);
sSoftbanksMap.put(0xe030, R.drawable.emoji_1f338);
sSoftbanksMap.put(0xe031, R.drawable.emoji_1f531);
sSoftbanksMap.put(0xe032, R.drawable.emoji_1f339);
sSoftbanksMap.put(0xe033, R.drawable.emoji_1f384);
sSoftbanksMap.put(0xe034, R.drawable.emoji_1f48d);
sSoftbanksMap.put(0xe035, R.drawable.emoji_1f48e);
sSoftbanksMap.put(0xe036, R.drawable.emoji_1f3e0);
sSoftbanksMap.put(0xe037, R.drawable.emoji_26ea);
sSoftbanksMap.put(0xe038, R.drawable.emoji_1f3e2);
sSoftbanksMap.put(0xe039, R.drawable.emoji_1f689);
sSoftbanksMap.put(0xe03a, R.drawable.emoji_26fd);
sSoftbanksMap.put(0xe03b, R.drawable.emoji_1f5fb);
sSoftbanksMap.put(0xe03c, R.drawable.emoji_1f3a4);
sSoftbanksMap.put(0xe03d, R.drawable.emoji_1f3a5);
sSoftbanksMap.put(0xe03e, R.drawable.emoji_1f3b5);
sSoftbanksMap.put(0xe03f, R.drawable.emoji_1f511);
sSoftbanksMap.put(0xe040, R.drawable.emoji_1f3b7);
sSoftbanksMap.put(0xe041, R.drawable.emoji_1f3b8);
sSoftbanksMap.put(0xe042, R.drawable.emoji_1f3ba);
sSoftbanksMap.put(0xe043, R.drawable.emoji_1f374);
sSoftbanksMap.put(0xe044, R.drawable.emoji_1f377);
sSoftbanksMap.put(0xe045, R.drawable.emoji_2615);
sSoftbanksMap.put(0xe046, R.drawable.emoji_1f370);
sSoftbanksMap.put(0xe047, R.drawable.emoji_1f37a);
sSoftbanksMap.put(0xe048, R.drawable.emoji_26c4);
sSoftbanksMap.put(0xe049, R.drawable.emoji_2601);
sSoftbanksMap.put(0xe04a, R.drawable.emoji_2600);
sSoftbanksMap.put(0xe04b, R.drawable.emoji_2614);
sSoftbanksMap.put(0xe04c, R.drawable.emoji_1f313);
sSoftbanksMap.put(0xe04d, R.drawable.emoji_1f304);
sSoftbanksMap.put(0xe04e, R.drawable.emoji_1f47c);
sSoftbanksMap.put(0xe04f, R.drawable.emoji_1f431);
sSoftbanksMap.put(0xe050, R.drawable.emoji_1f42f);
sSoftbanksMap.put(0xe051, R.drawable.emoji_1f43b);
sSoftbanksMap.put(0xe052, R.drawable.emoji_1f429);
sSoftbanksMap.put(0xe053, R.drawable.emoji_1f42d);
sSoftbanksMap.put(0xe054, R.drawable.emoji_1f433);
sSoftbanksMap.put(0xe055, R.drawable.emoji_1f427);
sSoftbanksMap.put(0xe056, R.drawable.emoji_1f60a);
sSoftbanksMap.put(0xe057, R.drawable.emoji_1f603);
sSoftbanksMap.put(0xe058, R.drawable.emoji_1f61e);
sSoftbanksMap.put(0xe059, R.drawable.emoji_1f620);
sSoftbanksMap.put(0xe05a, R.drawable.emoji_1f4a9);
sSoftbanksMap.put(0xe101, R.drawable.emoji_1f4ea);
sSoftbanksMap.put(0xe102, R.drawable.emoji_1f4ee);
sSoftbanksMap.put(0xe103, R.drawable.emoji_1f4e7);
sSoftbanksMap.put(0xe104, R.drawable.emoji_1f4f2);
sSoftbanksMap.put(0xe105, R.drawable.emoji_1f61c);
sSoftbanksMap.put(0xe106, R.drawable.emoji_1f60d);
sSoftbanksMap.put(0xe107, R.drawable.emoji_1f631);
sSoftbanksMap.put(0xe108, R.drawable.emoji_1f613);
sSoftbanksMap.put(0xe109, R.drawable.emoji_1f435);
sSoftbanksMap.put(0xe10a, R.drawable.emoji_1f419);
sSoftbanksMap.put(0xe10b, R.drawable.emoji_1f437);
sSoftbanksMap.put(0xe10c, R.drawable.emoji_1f47d);
sSoftbanksMap.put(0xe10d, R.drawable.emoji_1f680);
sSoftbanksMap.put(0xe10e, R.drawable.emoji_1f451);
sSoftbanksMap.put(0xe10f, R.drawable.emoji_1f4a1);
sSoftbanksMap.put(0xe110, R.drawable.emoji_1f331);
sSoftbanksMap.put(0xe111, R.drawable.emoji_1f48f);
sSoftbanksMap.put(0xe112, R.drawable.emoji_1f381);
sSoftbanksMap.put(0xe113, R.drawable.emoji_1f52b);
sSoftbanksMap.put(0xe114, R.drawable.emoji_1f50d);
sSoftbanksMap.put(0xe115, R.drawable.emoji_1f3c3);
sSoftbanksMap.put(0xe116, R.drawable.emoji_1f528);
sSoftbanksMap.put(0xe117, R.drawable.emoji_1f386);
sSoftbanksMap.put(0xe118, R.drawable.emoji_1f341);
sSoftbanksMap.put(0xe119, R.drawable.emoji_1f342);
sSoftbanksMap.put(0xe11a, R.drawable.emoji_1f47f);
sSoftbanksMap.put(0xe11b, R.drawable.emoji_1f47b);
sSoftbanksMap.put(0xe11c, R.drawable.emoji_1f480);
sSoftbanksMap.put(0xe11d, R.drawable.emoji_1f525);
sSoftbanksMap.put(0xe11e, R.drawable.emoji_1f4bc);
sSoftbanksMap.put(0xe11f, R.drawable.emoji_1f4ba);
sSoftbanksMap.put(0xe120, R.drawable.emoji_1f354);
sSoftbanksMap.put(0xe121, R.drawable.emoji_26f2);
sSoftbanksMap.put(0xe122, R.drawable.emoji_26fa);
sSoftbanksMap.put(0xe123, R.drawable.emoji_2668);
sSoftbanksMap.put(0xe124, R.drawable.emoji_1f3a1);
sSoftbanksMap.put(0xe125, R.drawable.emoji_1f3ab);
sSoftbanksMap.put(0xe126, R.drawable.emoji_1f4bf);
sSoftbanksMap.put(0xe127, R.drawable.emoji_1f4c0);
sSoftbanksMap.put(0xe128, R.drawable.emoji_1f4fb);
sSoftbanksMap.put(0xe129, R.drawable.emoji_1f4fc);
sSoftbanksMap.put(0xe12a, R.drawable.emoji_1f4fa);
sSoftbanksMap.put(0xe12b, R.drawable.emoji_1f47e);
sSoftbanksMap.put(0xe12c, R.drawable.emoji_303d);
sSoftbanksMap.put(0xe12d, R.drawable.emoji_1f004);
sSoftbanksMap.put(0xe12e, R.drawable.emoji_1f19a);
sSoftbanksMap.put(0xe12f, R.drawable.emoji_1f4b0);
sSoftbanksMap.put(0xe130, R.drawable.emoji_1f3af);
sSoftbanksMap.put(0xe131, R.drawable.emoji_1f3c6);
sSoftbanksMap.put(0xe132, R.drawable.emoji_1f3c1);
sSoftbanksMap.put(0xe133, R.drawable.emoji_1f3b0);
sSoftbanksMap.put(0xe134, R.drawable.emoji_1f40e);
sSoftbanksMap.put(0xe135, R.drawable.emoji_1f6a4);
sSoftbanksMap.put(0xe136, R.drawable.emoji_1f6b2);
sSoftbanksMap.put(0xe137, R.drawable.emoji_1f6a7);
sSoftbanksMap.put(0xe138, R.drawable.emoji_1f6b9);
sSoftbanksMap.put(0xe139, R.drawable.emoji_1f6ba);
sSoftbanksMap.put(0xe13a, R.drawable.emoji_1f6bc);
sSoftbanksMap.put(0xe13b, R.drawable.emoji_1f489);
sSoftbanksMap.put(0xe13c, R.drawable.emoji_1f4a4);
sSoftbanksMap.put(0xe13d, R.drawable.emoji_26a1);
sSoftbanksMap.put(0xe13e, R.drawable.emoji_1f460);
sSoftbanksMap.put(0xe13f, R.drawable.emoji_1f6c0);
sSoftbanksMap.put(0xe140, R.drawable.emoji_1f6bd);
sSoftbanksMap.put(0xe141, R.drawable.emoji_1f50a);
sSoftbanksMap.put(0xe142, R.drawable.emoji_1f4e2);
sSoftbanksMap.put(0xe143, R.drawable.emoji_1f38c);
sSoftbanksMap.put(0xe144, R.drawable.emoji_1f50f);
sSoftbanksMap.put(0xe145, R.drawable.emoji_1f513);
sSoftbanksMap.put(0xe146, R.drawable.emoji_1f306);
sSoftbanksMap.put(0xe147, R.drawable.emoji_1f373);
sSoftbanksMap.put(0xe148, R.drawable.emoji_1f4c7);
sSoftbanksMap.put(0xe149, R.drawable.emoji_1f4b1);
sSoftbanksMap.put(0xe14a, R.drawable.emoji_1f4b9);
sSoftbanksMap.put(0xe14b, R.drawable.emoji_1f4e1);
sSoftbanksMap.put(0xe14c, R.drawable.emoji_1f4aa);
sSoftbanksMap.put(0xe14d, R.drawable.emoji_1f3e6);
sSoftbanksMap.put(0xe14e, R.drawable.emoji_1f6a5);
sSoftbanksMap.put(0xe14f, R.drawable.emoji_1f17f);
sSoftbanksMap.put(0xe150, R.drawable.emoji_1f68f);
sSoftbanksMap.put(0xe151, R.drawable.emoji_1f6bb);
sSoftbanksMap.put(0xe152, R.drawable.emoji_1f46e);
sSoftbanksMap.put(0xe153, R.drawable.emoji_1f3e3);
sSoftbanksMap.put(0xe154, R.drawable.emoji_1f3e7);
sSoftbanksMap.put(0xe155, R.drawable.emoji_1f3e5);
sSoftbanksMap.put(0xe156, R.drawable.emoji_1f3ea);
sSoftbanksMap.put(0xe157, R.drawable.emoji_1f3eb);
sSoftbanksMap.put(0xe158, R.drawable.emoji_1f3e8);
sSoftbanksMap.put(0xe159, R.drawable.emoji_1f68c);
sSoftbanksMap.put(0xe15a, R.drawable.emoji_1f695);
sSoftbanksMap.put(0xe201, R.drawable.emoji_1f6b6);
sSoftbanksMap.put(0xe202, R.drawable.emoji_1f6a2);
sSoftbanksMap.put(0xe203, R.drawable.emoji_1f201);
sSoftbanksMap.put(0xe204, R.drawable.emoji_1f49f);
sSoftbanksMap.put(0xe205, R.drawable.emoji_2734);
sSoftbanksMap.put(0xe206, R.drawable.emoji_2733);
sSoftbanksMap.put(0xe207, R.drawable.emoji_1f51e);
sSoftbanksMap.put(0xe208, R.drawable.emoji_1f6ad);
sSoftbanksMap.put(0xe209, R.drawable.emoji_1f530);
sSoftbanksMap.put(0xe20a, R.drawable.emoji_267f);
sSoftbanksMap.put(0xe20b, R.drawable.emoji_1f4f6);
sSoftbanksMap.put(0xe20c, R.drawable.emoji_2665);
sSoftbanksMap.put(0xe20d, R.drawable.emoji_2666);
sSoftbanksMap.put(0xe20e, R.drawable.emoji_2660);
sSoftbanksMap.put(0xe20f, R.drawable.emoji_2663);
sSoftbanksMap.put(0xe210, R.drawable.emoji_0023);
sSoftbanksMap.put(0xe211, R.drawable.emoji_27bf);
sSoftbanksMap.put(0xe212, R.drawable.emoji_1f195);
sSoftbanksMap.put(0xe213, R.drawable.emoji_1f199);
sSoftbanksMap.put(0xe214, R.drawable.emoji_1f192);
sSoftbanksMap.put(0xe215, R.drawable.emoji_1f236);
sSoftbanksMap.put(0xe216, R.drawable.emoji_1f21a);
sSoftbanksMap.put(0xe217, R.drawable.emoji_1f237);
sSoftbanksMap.put(0xe218, R.drawable.emoji_1f238);
sSoftbanksMap.put(0xe219, R.drawable.emoji_1f534);
sSoftbanksMap.put(0xe21a, R.drawable.emoji_1f532);
sSoftbanksMap.put(0xe21b, R.drawable.emoji_1f533);
sSoftbanksMap.put(0xe21c, R.drawable.emoji_0031);
sSoftbanksMap.put(0xe21d, R.drawable.emoji_0032);
sSoftbanksMap.put(0xe21e, R.drawable.emoji_0033);
sSoftbanksMap.put(0xe21f, R.drawable.emoji_0034);
sSoftbanksMap.put(0xe220, R.drawable.emoji_0035);
sSoftbanksMap.put(0xe221, R.drawable.emoji_0036);
sSoftbanksMap.put(0xe222, R.drawable.emoji_0037);
sSoftbanksMap.put(0xe223, R.drawable.emoji_0038);
sSoftbanksMap.put(0xe224, R.drawable.emoji_0039);
sSoftbanksMap.put(0xe225, R.drawable.emoji_0030);
sSoftbanksMap.put(0xe226, R.drawable.emoji_1f250);
sSoftbanksMap.put(0xe227, R.drawable.emoji_1f239);
sSoftbanksMap.put(0xe228, R.drawable.emoji_1f202);
sSoftbanksMap.put(0xe229, R.drawable.emoji_1f194);
sSoftbanksMap.put(0xe22a, R.drawable.emoji_1f235);
sSoftbanksMap.put(0xe22b, R.drawable.emoji_1f233);
sSoftbanksMap.put(0xe22c, R.drawable.emoji_1f22f);
sSoftbanksMap.put(0xe22d, R.drawable.emoji_1f23a);
sSoftbanksMap.put(0xe22e, R.drawable.emoji_1f446);
sSoftbanksMap.put(0xe22f, R.drawable.emoji_1f447);
sSoftbanksMap.put(0xe230, R.drawable.emoji_1f448);
sSoftbanksMap.put(0xe231, R.drawable.emoji_1f449);
sSoftbanksMap.put(0xe232, R.drawable.emoji_2b06);
sSoftbanksMap.put(0xe233, R.drawable.emoji_2b07);
sSoftbanksMap.put(0xe234, R.drawable.emoji_27a1);
sSoftbanksMap.put(0xe235, R.drawable.emoji_1f519);
sSoftbanksMap.put(0xe236, R.drawable.emoji_2197);
sSoftbanksMap.put(0xe237, R.drawable.emoji_2196);
sSoftbanksMap.put(0xe238, R.drawable.emoji_2198);
sSoftbanksMap.put(0xe239, R.drawable.emoji_2199);
sSoftbanksMap.put(0xe23a, R.drawable.emoji_25b6);
sSoftbanksMap.put(0xe23b, R.drawable.emoji_25c0);
sSoftbanksMap.put(0xe23c, R.drawable.emoji_23e9);
sSoftbanksMap.put(0xe23d, R.drawable.emoji_23ea);
sSoftbanksMap.put(0xe23e, R.drawable.emoji_1f52e);
sSoftbanksMap.put(0xe23f, R.drawable.emoji_2648);
sSoftbanksMap.put(0xe240, R.drawable.emoji_2649);
sSoftbanksMap.put(0xe241, R.drawable.emoji_264a);
sSoftbanksMap.put(0xe242, R.drawable.emoji_264b);
sSoftbanksMap.put(0xe243, R.drawable.emoji_264c);
sSoftbanksMap.put(0xe244, R.drawable.emoji_264d);
sSoftbanksMap.put(0xe245, R.drawable.emoji_264e);
sSoftbanksMap.put(0xe246, R.drawable.emoji_264f);
sSoftbanksMap.put(0xe247, R.drawable.emoji_2650);
sSoftbanksMap.put(0xe248, R.drawable.emoji_2651);
sSoftbanksMap.put(0xe249, R.drawable.emoji_2652);
sSoftbanksMap.put(0xe24a, R.drawable.emoji_2653);
sSoftbanksMap.put(0xe24b, R.drawable.emoji_26ce);
sSoftbanksMap.put(0xe24c, R.drawable.emoji_1f51d);
sSoftbanksMap.put(0xe24d, R.drawable.emoji_1f197);
sSoftbanksMap.put(0xe24e, R.drawable.emoji_00a9);
sSoftbanksMap.put(0xe24f, R.drawable.emoji_00ae);
sSoftbanksMap.put(0xe250, R.drawable.emoji_1f4f3);
sSoftbanksMap.put(0xe251, R.drawable.emoji_1f4f4);
sSoftbanksMap.put(0xe252, R.drawable.emoji_26a0);
sSoftbanksMap.put(0xe253, R.drawable.emoji_1f481);
sSoftbanksMap.put(0xe301, R.drawable.emoji_1f4c3);
sSoftbanksMap.put(0xe302, R.drawable.emoji_1f454);
sSoftbanksMap.put(0xe303, R.drawable.emoji_1f33a);
sSoftbanksMap.put(0xe304, R.drawable.emoji_1f337);
sSoftbanksMap.put(0xe305, R.drawable.emoji_1f33b);
sSoftbanksMap.put(0xe306, R.drawable.emoji_1f490);
sSoftbanksMap.put(0xe307, R.drawable.emoji_1f334);
sSoftbanksMap.put(0xe308, R.drawable.emoji_1f335);
sSoftbanksMap.put(0xe309, R.drawable.emoji_1f6be);
sSoftbanksMap.put(0xe30a, R.drawable.emoji_1f3a7);
sSoftbanksMap.put(0xe30b, R.drawable.emoji_1f376);
sSoftbanksMap.put(0xe30c, R.drawable.emoji_1f37b);
sSoftbanksMap.put(0xe30d, R.drawable.emoji_3297);
sSoftbanksMap.put(0xe30e, R.drawable.emoji_1f6ac);
sSoftbanksMap.put(0xe30f, R.drawable.emoji_1f48a);
sSoftbanksMap.put(0xe310, R.drawable.emoji_1f388);
sSoftbanksMap.put(0xe311, R.drawable.emoji_1f4a3);
sSoftbanksMap.put(0xe312, R.drawable.emoji_1f389);
sSoftbanksMap.put(0xe313, R.drawable.emoji_2702);
sSoftbanksMap.put(0xe314, R.drawable.emoji_1f380);
sSoftbanksMap.put(0xe315, R.drawable.emoji_3299);
sSoftbanksMap.put(0xe316, R.drawable.emoji_1f4bd);
sSoftbanksMap.put(0xe317, R.drawable.emoji_1f4e3);
sSoftbanksMap.put(0xe318, R.drawable.emoji_1f452);
sSoftbanksMap.put(0xe319, R.drawable.emoji_1f457);
sSoftbanksMap.put(0xe31a, R.drawable.emoji_1f461);
sSoftbanksMap.put(0xe31b, R.drawable.emoji_1f462);
sSoftbanksMap.put(0xe31c, R.drawable.emoji_1f484);
sSoftbanksMap.put(0xe31d, R.drawable.emoji_1f485);
sSoftbanksMap.put(0xe31e, R.drawable.emoji_1f486);
sSoftbanksMap.put(0xe31f, R.drawable.emoji_1f487);
sSoftbanksMap.put(0xe320, R.drawable.emoji_1f488);
sSoftbanksMap.put(0xe321, R.drawable.emoji_1f458);
sSoftbanksMap.put(0xe322, R.drawable.emoji_1f459);
sSoftbanksMap.put(0xe323, R.drawable.emoji_1f45c);
sSoftbanksMap.put(0xe324, R.drawable.emoji_1f3ac);
sSoftbanksMap.put(0xe325, R.drawable.emoji_1f514);
sSoftbanksMap.put(0xe326, R.drawable.emoji_1f3b6);
sSoftbanksMap.put(0xe327, R.drawable.emoji_1f493);
sSoftbanksMap.put(0xe328, R.drawable.emoji_1f48c);
sSoftbanksMap.put(0xe329, R.drawable.emoji_1f498);
sSoftbanksMap.put(0xe32a, R.drawable.emoji_1f499);
sSoftbanksMap.put(0xe32b, R.drawable.emoji_1f49a);
sSoftbanksMap.put(0xe32c, R.drawable.emoji_1f49b);
sSoftbanksMap.put(0xe32d, R.drawable.emoji_1f49c);
sSoftbanksMap.put(0xe32e, R.drawable.emoji_2728);
sSoftbanksMap.put(0xe32f, R.drawable.emoji_2b50);
sSoftbanksMap.put(0xe330, R.drawable.emoji_1f4a8);
sSoftbanksMap.put(0xe331, R.drawable.emoji_1f4a6);
sSoftbanksMap.put(0xe332, R.drawable.emoji_2b55);
sSoftbanksMap.put(0xe333, R.drawable.emoji_2716);
sSoftbanksMap.put(0xe334, R.drawable.emoji_1f4a2);
sSoftbanksMap.put(0xe335, R.drawable.emoji_1f31f);
sSoftbanksMap.put(0xe336, R.drawable.emoji_2754);
sSoftbanksMap.put(0xe337, R.drawable.emoji_2755);
sSoftbanksMap.put(0xe338, R.drawable.emoji_1f375);
sSoftbanksMap.put(0xe339, R.drawable.emoji_1f35e);
sSoftbanksMap.put(0xe33a, R.drawable.emoji_1f366);
sSoftbanksMap.put(0xe33b, R.drawable.emoji_1f35f);
sSoftbanksMap.put(0xe33c, R.drawable.emoji_1f361);
sSoftbanksMap.put(0xe33d, R.drawable.emoji_1f358);
sSoftbanksMap.put(0xe33e, R.drawable.emoji_1f35a);
sSoftbanksMap.put(0xe33f, R.drawable.emoji_1f35d);
sSoftbanksMap.put(0xe340, R.drawable.emoji_1f35c);
sSoftbanksMap.put(0xe341, R.drawable.emoji_1f35b);
sSoftbanksMap.put(0xe342, R.drawable.emoji_1f359);
sSoftbanksMap.put(0xe343, R.drawable.emoji_1f362);
sSoftbanksMap.put(0xe344, R.drawable.emoji_1f363);
sSoftbanksMap.put(0xe345, R.drawable.emoji_1f34e);
sSoftbanksMap.put(0xe346, R.drawable.emoji_1f34a);
sSoftbanksMap.put(0xe347, R.drawable.emoji_1f353);
sSoftbanksMap.put(0xe348, R.drawable.emoji_1f349);
sSoftbanksMap.put(0xe349, R.drawable.emoji_1f345);
sSoftbanksMap.put(0xe34a, R.drawable.emoji_1f346);
sSoftbanksMap.put(0xe34b, R.drawable.emoji_1f382);
sSoftbanksMap.put(0xe34c, R.drawable.emoji_1f371);
sSoftbanksMap.put(0xe34d, R.drawable.emoji_1f372);
sSoftbanksMap.put(0xe401, R.drawable.emoji_1f625);
sSoftbanksMap.put(0xe402, R.drawable.emoji_1f60f);
sSoftbanksMap.put(0xe403, R.drawable.emoji_1f614);
sSoftbanksMap.put(0xe404, R.drawable.emoji_1f601);
sSoftbanksMap.put(0xe405, R.drawable.emoji_1f609);
sSoftbanksMap.put(0xe406, R.drawable.emoji_1f623);
sSoftbanksMap.put(0xe407, R.drawable.emoji_1f616);
sSoftbanksMap.put(0xe408, R.drawable.emoji_1f62a);
sSoftbanksMap.put(0xe409, R.drawable.emoji_1f445);
sSoftbanksMap.put(0xe40a, R.drawable.emoji_1f606);
sSoftbanksMap.put(0xe40b, R.drawable.emoji_1f628);
sSoftbanksMap.put(0xe40c, R.drawable.emoji_1f637);
sSoftbanksMap.put(0xe40d, R.drawable.emoji_1f633);
sSoftbanksMap.put(0xe40e, R.drawable.emoji_1f612);
sSoftbanksMap.put(0xe40f, R.drawable.emoji_1f630);
sSoftbanksMap.put(0xe410, R.drawable.emoji_1f632);
sSoftbanksMap.put(0xe411, R.drawable.emoji_1f62d);
sSoftbanksMap.put(0xe412, R.drawable.emoji_1f602);
sSoftbanksMap.put(0xe413, R.drawable.emoji_1f622);
sSoftbanksMap.put(0xe414, R.drawable.emoji_263a);
sSoftbanksMap.put(0xe415, R.drawable.emoji_1f605);
sSoftbanksMap.put(0xe416, R.drawable.emoji_1f621);
sSoftbanksMap.put(0xe417, R.drawable.emoji_1f61a);
sSoftbanksMap.put(0xe418, R.drawable.emoji_1f618);
sSoftbanksMap.put(0xe419, R.drawable.emoji_1f440);
sSoftbanksMap.put(0xe41a, R.drawable.emoji_1f443);
sSoftbanksMap.put(0xe41b, R.drawable.emoji_1f442);
sSoftbanksMap.put(0xe41c, R.drawable.emoji_1f444);
sSoftbanksMap.put(0xe41d, R.drawable.emoji_1f64f);
sSoftbanksMap.put(0xe41e, R.drawable.emoji_1f44b);
sSoftbanksMap.put(0xe41f, R.drawable.emoji_1f44f);
sSoftbanksMap.put(0xe420, R.drawable.emoji_1f44c);
sSoftbanksMap.put(0xe421, R.drawable.emoji_1f44e);
sSoftbanksMap.put(0xe422, R.drawable.emoji_1f450);
sSoftbanksMap.put(0xe423, R.drawable.emoji_1f645);
sSoftbanksMap.put(0xe424, R.drawable.emoji_1f646);
sSoftbanksMap.put(0xe425, R.drawable.emoji_1f491);
sSoftbanksMap.put(0xe426, R.drawable.emoji_1f647);
sSoftbanksMap.put(0xe427, R.drawable.emoji_1f64c);
sSoftbanksMap.put(0xe428, R.drawable.emoji_1f46b);
sSoftbanksMap.put(0xe429, R.drawable.emoji_1f46f);
sSoftbanksMap.put(0xe42a, R.drawable.emoji_1f3c0);
sSoftbanksMap.put(0xe42b, R.drawable.emoji_1f3c8);
sSoftbanksMap.put(0xe42c, R.drawable.emoji_1f3b1);
sSoftbanksMap.put(0xe42d, R.drawable.emoji_1f3ca);
sSoftbanksMap.put(0xe42e, R.drawable.emoji_1f699);
sSoftbanksMap.put(0xe42f, R.drawable.emoji_1f69a);
sSoftbanksMap.put(0xe430, R.drawable.emoji_1f692);
sSoftbanksMap.put(0xe431, R.drawable.emoji_1f691);
sSoftbanksMap.put(0xe432, R.drawable.emoji_1f693);
sSoftbanksMap.put(0xe433, R.drawable.emoji_1f3a2);
sSoftbanksMap.put(0xe434, R.drawable.emoji_1f687);
sSoftbanksMap.put(0xe435, R.drawable.emoji_1f684);
sSoftbanksMap.put(0xe436, R.drawable.emoji_1f38d);
sSoftbanksMap.put(0xe437, R.drawable.emoji_1f49d);
sSoftbanksMap.put(0xe438, R.drawable.emoji_1f38e);
sSoftbanksMap.put(0xe439, R.drawable.emoji_1f393);
sSoftbanksMap.put(0xe43a, R.drawable.emoji_1f392);
sSoftbanksMap.put(0xe43b, R.drawable.emoji_1f38f);
sSoftbanksMap.put(0xe43c, R.drawable.emoji_1f302);
sSoftbanksMap.put(0xe43d, R.drawable.emoji_1f492);
sSoftbanksMap.put(0xe43e, R.drawable.emoji_1f30a);
sSoftbanksMap.put(0xe43f, R.drawable.emoji_1f367);
sSoftbanksMap.put(0xe440, R.drawable.emoji_1f387);
sSoftbanksMap.put(0xe441, R.drawable.emoji_1f41a);
sSoftbanksMap.put(0xe442, R.drawable.emoji_1f390);
sSoftbanksMap.put(0xe443, R.drawable.emoji_1f300);
sSoftbanksMap.put(0xe444, R.drawable.emoji_1f33e);
sSoftbanksMap.put(0xe445, R.drawable.emoji_1f383);
sSoftbanksMap.put(0xe446, R.drawable.emoji_1f391);
sSoftbanksMap.put(0xe447, R.drawable.emoji_1f343);
sSoftbanksMap.put(0xe448, R.drawable.emoji_1f385);
sSoftbanksMap.put(0xe449, R.drawable.emoji_1f305);
sSoftbanksMap.put(0xe44a, R.drawable.emoji_1f307);
sSoftbanksMap.put(0xe44b, R.drawable.emoji_1f303);
sSoftbanksMap.put(0xe44b, R.drawable.emoji_1f30c);
sSoftbanksMap.put(0xe44c, R.drawable.emoji_1f308);
sSoftbanksMap.put(0xe501, R.drawable.emoji_1f3e9);
sSoftbanksMap.put(0xe502, R.drawable.emoji_1f3a8);
sSoftbanksMap.put(0xe503, R.drawable.emoji_1f3a9);
sSoftbanksMap.put(0xe504, R.drawable.emoji_1f3ec);
sSoftbanksMap.put(0xe505, R.drawable.emoji_1f3ef);
sSoftbanksMap.put(0xe506, R.drawable.emoji_1f3f0);
sSoftbanksMap.put(0xe507, R.drawable.emoji_1f3a6);
sSoftbanksMap.put(0xe508, R.drawable.emoji_1f3ed);
sSoftbanksMap.put(0xe509, R.drawable.emoji_1f5fc);
sSoftbanksMap.put(0xe50b, R.drawable.emoji_1f1ef_1f1f5);
sSoftbanksMap.put(0xe50c, R.drawable.emoji_1f1fa_1f1f8);
sSoftbanksMap.put(0xe50d, R.drawable.emoji_1f1eb_1f1f7);
sSoftbanksMap.put(0xe50e, R.drawable.emoji_1f1e9_1f1ea);
sSoftbanksMap.put(0xe50f, R.drawable.emoji_1f1ee_1f1f9);
sSoftbanksMap.put(0xe510, R.drawable.emoji_1f1ec_1f1e7);
sSoftbanksMap.put(0xe511, R.drawable.emoji_1f1ea_1f1f8);
sSoftbanksMap.put(0xe512, R.drawable.emoji_1f1f7_1f1fa);
sSoftbanksMap.put(0xe513, R.drawable.emoji_1f1e8_1f1f3);
sSoftbanksMap.put(0xe514, R.drawable.emoji_1f1f0_1f1f7);
sSoftbanksMap.put(0xe515, R.drawable.emoji_1f471);
sSoftbanksMap.put(0xe516, R.drawable.emoji_1f472);
sSoftbanksMap.put(0xe517, R.drawable.emoji_1f473);
sSoftbanksMap.put(0xe518, R.drawable.emoji_1f474);
sSoftbanksMap.put(0xe519, R.drawable.emoji_1f475);
sSoftbanksMap.put(0xe51a, R.drawable.emoji_1f476);
sSoftbanksMap.put(0xe51b, R.drawable.emoji_1f477);
sSoftbanksMap.put(0xe51c, R.drawable.emoji_1f478);
sSoftbanksMap.put(0xe51d, R.drawable.emoji_1f5fd);
sSoftbanksMap.put(0xe51e, R.drawable.emoji_1f482);
sSoftbanksMap.put(0xe51f, R.drawable.emoji_1f483);
sSoftbanksMap.put(0xe520, R.drawable.emoji_1f42c);
sSoftbanksMap.put(0xe521, R.drawable.emoji_1f426);
sSoftbanksMap.put(0xe522, R.drawable.emoji_1f420);
sSoftbanksMap.put(0xe523, R.drawable.emoji_1f423);
sSoftbanksMap.put(0xe524, R.drawable.emoji_1f439);
sSoftbanksMap.put(0xe525, R.drawable.emoji_1f41b);
sSoftbanksMap.put(0xe526, R.drawable.emoji_1f418);
sSoftbanksMap.put(0xe527, R.drawable.emoji_1f428);
sSoftbanksMap.put(0xe528, R.drawable.emoji_1f412);
sSoftbanksMap.put(0xe529, R.drawable.emoji_1f411);
sSoftbanksMap.put(0xe52a, R.drawable.emoji_1f43a);
sSoftbanksMap.put(0xe52b, R.drawable.emoji_1f42e);
sSoftbanksMap.put(0xe52c, R.drawable.emoji_1f430);
sSoftbanksMap.put(0xe52d, R.drawable.emoji_1f40d);
sSoftbanksMap.put(0xe52e, R.drawable.emoji_1f414);
sSoftbanksMap.put(0xe52f, R.drawable.emoji_1f417);
sSoftbanksMap.put(0xe530, R.drawable.emoji_1f42b);
sSoftbanksMap.put(0xe531, R.drawable.emoji_1f438);
sSoftbanksMap.put(0xe532, R.drawable.emoji_1f170);
sSoftbanksMap.put(0xe533, R.drawable.emoji_1f171);
sSoftbanksMap.put(0xe534, R.drawable.emoji_1f18e);
sSoftbanksMap.put(0xe535, R.drawable.emoji_1f17e);
sSoftbanksMap.put(0xe536, R.drawable.emoji_1f43e);
sSoftbanksMap.put(0xe537, R.drawable.emoji_2122);
}
private EmojiconHandler() {
}
private static boolean isSoftBankEmoji(char c) {
return ((c >> 12) == 0xe);
}
private static int getEmojiResource(Context context, int codePoint) {
return sEmojisMap.get(codePoint);
}
private static int getSoftbankEmojiResource(char c) {
return sSoftbanksMap.get(c);
}
/**
* Convert emoji characters of the given Spannable to the according emojicon.
*
* @param context
* @param text
* @param emojiSize
*/
public static void addEmojis(Context context, Spannable text, int emojiSize) {
addEmojis(context, text, emojiSize, 0, -1, false);
}
/**
* Convert emoji characters of the given Spannable to the according emojicon.
*
* @param context
* @param text
* @param emojiSize
* @param index
* @param length
*/
public static void addEmojis(Context context, Spannable text, int emojiSize, int index, int length) {
addEmojis(context, text, emojiSize, index, length, false);
}
/**
* Convert emoji characters of the given Spannable to the according emojicon.
*
* @param context
* @param text
* @param emojiSize
* @param useSystemDefault
*/
public static void addEmojis(Context context, Spannable text, int emojiSize, boolean useSystemDefault) {
addEmojis(context, text, emojiSize, 0, -1, useSystemDefault);
}
/**
* Convert emoji characters of the given Spannable to the according emojicon.
*
* @param context
* @param text
* @param emojiSize
* @param index
* @param length
* @param useSystemDefault
*/
public static void addEmojis(Context context, Spannable text, int emojiSize, int index, int length, boolean useSystemDefault) {
if (useSystemDefault) {
return;
}
int textLength = text.length();
int textLengthToProcessMax = textLength - index;
int textLengthToProcess = length < 0 || length >= textLengthToProcessMax ? textLength : (length + index);
// remove spans throughout all text
EmojiconSpan[] oldSpans = text.getSpans(0, textLength, EmojiconSpan.class);
for (int i = 0; i < oldSpans.length; i++) {
text.removeSpan(oldSpans[i]);
}
int skip;
for (int i = index; i < textLengthToProcess; i += skip) {
skip = 0;
int icon = 0;
char c = text.charAt(i);
if (isSoftBankEmoji(c)) {
icon = getSoftbankEmojiResource(c);
skip = icon == 0 ? 0 : 1;
}
if (icon == 0) {
int unicode = Character.codePointAt(text, i);
skip = Character.charCount(unicode);
if (unicode > 0xff) {
icon = getEmojiResource(context, unicode);
}
if (icon == 0 && i + skip < textLengthToProcess) {
int followUnicode = Character.codePointAt(text, i + skip);
if (followUnicode == 0x20e3) {
int followSkip = Character.charCount(followUnicode);
switch (unicode) {
case 0x0031:
icon = R.drawable.emoji_0031;
break;
case 0x0032:
icon = R.drawable.emoji_0032;
break;
case 0x0033:
icon = R.drawable.emoji_0033;
break;
case 0x0034:
icon = R.drawable.emoji_0034;
break;
case 0x0035:
icon = R.drawable.emoji_0035;
break;
case 0x0036:
icon = R.drawable.emoji_0036;
break;
case 0x0037:
icon = R.drawable.emoji_0037;
break;
case 0x0038:
icon = R.drawable.emoji_0038;
break;
case 0x0039:
icon = R.drawable.emoji_0039;
break;
case 0x0030:
icon = R.drawable.emoji_0030;
break;
case 0x0023:
icon = R.drawable.emoji_0023;
break;
default:
followSkip = 0;
break;
}
skip += followSkip;
} else {
int followSkip = Character.charCount(followUnicode);
switch (unicode) {
case 0x1f1ef:
icon = (followUnicode == 0x1f1f5) ? R.drawable.emoji_1f1ef_1f1f5 : 0;
break;
case 0x1f1fa:
icon = (followUnicode == 0x1f1f8) ? R.drawable.emoji_1f1fa_1f1f8 : 0;
break;
case 0x1f1eb:
icon = (followUnicode == 0x1f1f7) ? R.drawable.emoji_1f1eb_1f1f7 : 0;
break;
case 0x1f1e9:
icon = (followUnicode == 0x1f1ea) ? R.drawable.emoji_1f1e9_1f1ea : 0;
break;
case 0x1f1ee:
icon = (followUnicode == 0x1f1f9) ? R.drawable.emoji_1f1ee_1f1f9 : 0;
break;
case 0x1f1ec:
icon = (followUnicode == 0x1f1e7) ? R.drawable.emoji_1f1ec_1f1e7 : 0;
break;
case 0x1f1ea:
icon = (followUnicode == 0x1f1f8) ? R.drawable.emoji_1f1ea_1f1f8 : 0;
break;
case 0x1f1f7:
icon = (followUnicode == 0x1f1fa) ? R.drawable.emoji_1f1f7_1f1fa : 0;
break;
case 0x1f1e8:
icon = (followUnicode == 0x1f1f3) ? R.drawable.emoji_1f1e8_1f1f3 : 0;
break;
case 0x1f1f0:
icon = (followUnicode == 0x1f1f7) ? R.drawable.emoji_1f1f0_1f1f7 : 0;
break;
default:
followSkip = 0;
break;
}
skip += followSkip;
}
}
}
if (icon > 0) {
text.setSpan(new EmojiconSpan(context, icon, emojiSize), i, i + skip, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
}
}
|
[
"chentong1@staff.weibo.com"
] |
chentong1@staff.weibo.com
|
6259eac070999f11344029f2d716171fe1bb59b7
|
286006e83e3d58d9ebb61b64879cd498ab0bad2e
|
/study4j-network/src/main/java/com/yincongyang/httpclient/utils/HttpHostExample.java
|
248bb578ec19da3867253afd23fbcd34b6ee49fa
|
[] |
no_license
|
kuainiao/study4j
|
ad95efe31acc2869735d83216c6e0de25cacc8c9
|
c50bcbb7cb240d5a884ea1d144922e103c23812d
|
refs/heads/master
| 2020-11-26T08:05:45.140917
| 2018-01-02T01:22:54
| 2018-01-02T01:22:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 565
|
java
|
package com.yincongyang.httpclient.utils;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
/**
* HttpHost 常用来设置代理服务器地址
*
* Created by yincongyang on 17/10/9.
*/
public class HttpHostExample {
public static void main(String[] args) {
//初始化代理服务器地址
HttpHost proxy = new HttpHost("127.0.0.1",8080,"http");
//使用RequestConfig对象初始化网络相关配置选项
RequestConfig config = RequestConfig.custom().setProxy(proxy).build();
}
}
|
[
"yincongyang@gmail.com"
] |
yincongyang@gmail.com
|
1238d9ac56c1b5772b721a0014571130927e4e0a
|
d189369fe0a231b46e990e1cb5eb13f192c5e46e
|
/pet-clinic-web/src/main/java/com/springframework/petclinic/controllers/VetController.java
|
e2751da02712b231578edfb10905aa1fb0c2e7f6
|
[] |
no_license
|
annavosbigian/Pet-Clinic
|
7329b0903db620b193350694aa14b34446e3ff6a
|
dff5ec0be19d527b7a3b39ef74096b570b37616f
|
refs/heads/master
| 2020-09-28T05:59:52.933147
| 2019-12-13T18:06:38
| 2019-12-13T18:06:38
| 226,705,987
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 660
|
java
|
package com.springframework.petclinic.controllers;
import com.springframework.petclinic.services.VetService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping("/vets")
@Controller
public class VetController {
private final VetService vetService;
public VetController(VetService vetService) {
this.vetService = vetService;
}
@RequestMapping({"", "/", "/index", "/index.html"})
public String listVets(Model model){
model.addAttribute("vets", vetService.findAll());
return "vets/index";
}
}
|
[
"annavosbigian2017@u.northwestern.edu"
] |
annavosbigian2017@u.northwestern.edu
|
25476a13070c6d0640891358075bd8aae3b9b7f0
|
2ec76790d709b14363d1cacaf4a5b9d85c3aba33
|
/src/test/java/br/fatec/financas2021/Financas2021ApplicationTests.java
|
9ab620d5f94690d28f73db04b0902596755dcb5d
|
[] |
no_license
|
JulianaMonteiroPatrao/financas2021
|
93728f19e18d5e5d71bf29089940e7441cfb1524
|
f8e52d5d74cf4e67b44b50c47062fce49d531200
|
refs/heads/master
| 2023-03-25T18:33:42.882735
| 2021-03-25T21:55:56
| 2021-03-25T21:55:56
| 347,278,951
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 219
|
java
|
package br.fatec.financas2021;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class Financas2021ApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"juliana.monteiro2@fatec.sp.gov.br"
] |
juliana.monteiro2@fatec.sp.gov.br
|
e37e42d5a2b59bfb63390e90d0ae97361419827e
|
1110b124a8d697e1411f5974666e5d3ac5afcc0a
|
/src/java/cd4017be/indlog/item/ItemFluidFilter.java
|
0c977a7435068a0b4afbf821ad0b0a032226118f
|
[
"MIT"
] |
permissive
|
coldino/InductiveLogistics
|
f77c69d6b33fd39a2e310565dac82582cb374235
|
d237896283fb11b71e5a0b0b062149bb5edca812
|
refs/heads/master
| 2020-07-29T23:15:57.914435
| 2017-12-21T16:59:22
| 2017-12-21T16:59:22
| 209,997,815
| 0
| 0
|
MIT
| 2019-09-21T14:19:08
| 2019-09-21T14:19:08
| null |
UTF-8
|
Java
| false
| false
| 5,681
|
java
|
package cd4017be.indlog.item;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.io.IOException;
import java.util.List;
import cd4017be.indlog.render.gui.GuiFluidFilter;
import cd4017be.indlog.util.PipeFilterFluid;
import cd4017be.lib.BlockGuiHandler;
import cd4017be.lib.BlockGuiHandler.ClientItemPacketReceiver;
import cd4017be.lib.util.TooltipUtil;
import cd4017be.lib.Gui.DataContainer;
import cd4017be.lib.Gui.IGuiItem;
import cd4017be.lib.Gui.ITankContainer;
import cd4017be.lib.Gui.ItemGuiData;
import cd4017be.lib.Gui.TileContainer;
import cd4017be.lib.Gui.TileContainer.TankSlot;
import cd4017be.lib.item.BaseItem;
import cd4017be.lib.util.ItemFluidUtil;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
/**
*
* @author CD4017BE
*/
public class ItemFluidFilter extends BaseItem implements IGuiItem, ClientItemPacketReceiver {
public ItemFluidFilter(String id) {
super(id);
}
@Override
public void addInformation(ItemStack item, EntityPlayer player, List<String> list, boolean b) {
if (item.hasTagCompound()) {
String[] states = TooltipUtil.translate("gui.cd4017be.filter.state").split(",");
PipeFilterFluid filter = PipeFilterFluid.load(item.getTagCompound());
String s;
if (states.length >= 8) {
s = states[(filter.mode & 1) == 0 ? 0 : 1];
if ((filter.mode & 2) != 0) s += states[5];
if ((filter.mode & 4) != 0) s += states[(filter.mode & 8) != 0 ? 7 : 6];
} else s = "<invalid lang entry!>";
list.add(s);
for (Fluid stack : filter.list) list.add("> " + stack.getLocalizedName(new FluidStack(stack, 0)));
if (filter.maxAmount != 0) list.add(TooltipUtil.format("gui.cd4017be.filter.stock", TooltipUtil.formatNumber((double)filter.maxAmount / 1000D, 3)));
if (filter.priority != 0) list.add(TooltipUtil.format("gui.cd4017be.priority", filter.priority));
}
super.addInformation(item, player, list, b);
}
public Fluid[] getFluids(NBTTagCompound nbt) {
if (nbt == null || !nbt.hasKey(ItemFluidUtil.Tag_FluidList, 9)) return null;
NBTTagList list = nbt.getTagList(ItemFluidUtil.Tag_FluidList, 8);
Fluid[] fluids = new Fluid[list.tagCount()];
for (int i = 0; i < fluids.length; i++)
fluids[i] = FluidRegistry.getFluid(list.getStringTagAt(i));
return fluids;
}
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
ItemStack item = player.getHeldItem(hand);
BlockGuiHandler.openItemGui(player, hand);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, item);
}
@Override
public Container getContainer(ItemStack item, EntityPlayer player, World world, BlockPos pos, int slot) {
return new TileContainer(new GuiData(), player);
}
@SideOnly(Side.CLIENT)
@Override
public GuiContainer getGui(ItemStack item, EntityPlayer player, World world, BlockPos pos, int slot) {
return new GuiFluidFilter(new TileContainer(new GuiData(), player));
}
@Override
public void onPacketFromClient(PacketBuffer dis, EntityPlayer player, ItemStack item, int slot) throws IOException {
NBTTagCompound nbt;
if (item.hasTagCompound()) nbt = item.getTagCompound();
else item.setTagCompound(nbt = new NBTTagCompound());
byte cmd = dis.readByte();
switch(cmd) {
case 5: nbt.setByte("mode", dis.readByte()); return;
case 6: nbt.setInteger("maxAm", dis.readInt()); return;
case 7: nbt.setByte("prior", dis.readByte()); return;
default: if (cmd < 0 || cmd >= 5) return;
String name = dis.readString(32);
NBTTagList list;
if (nbt.hasKey(ItemFluidUtil.Tag_FluidList, 9)) list = nbt.getTagList(ItemFluidUtil.Tag_FluidList, 8);
else nbt.setTag(ItemFluidUtil.Tag_FluidList, list = new NBTTagList());
if (!name.isEmpty()) {
if (cmd < list.tagCount()) list.set(cmd, new NBTTagString(name));
else list.appendTag(new NBTTagString(name));
} else if (cmd < list.tagCount()) list.removeTag(cmd);
}
}
class GuiData extends ItemGuiData implements ITankContainer {
private InventoryPlayer player;
public GuiData() {super(ItemFluidFilter.this);}
@Override
public void initContainer(DataContainer container) {
TileContainer cont = (TileContainer)container;
for (int i = 0; i < getTanks(); i++)
cont.addTankSlot(new TankSlot(this, i, 26 + 18 * i, 16, (byte)0x11));
cont.addPlayerInventory(8, 50, false, true);
player = cont.player.inventory;
}
@Override
public int getTanks() {return 5;}
@Override
public FluidStack getTank(int i) {
ItemStack item = player.mainInventory.get(player.currentItem);
Fluid[] fluids = item != null ? getFluids(item.getTagCompound()) : null;
return fluids != null && i < fluids.length ? new FluidStack(fluids[i], 0) : null;
}
@Override
public int getCapacity(int i) {return 0;}
@Override
public void setTank(int i, FluidStack fluid) {}
}
}
|
[
"cd4017be@gmail.com"
] |
cd4017be@gmail.com
|
d4c535470db25def75369ada4668489b4a61d425
|
3629291078d0ea863219a65d412025955e9558a8
|
/online-laptop-support/technical/Technical Support/src/java/export/ExportProducts.java
|
27dc3a69b8d3e8716797f9691f7c2cd0827c3d45
|
[] |
no_license
|
bhargavperumalla/online-laptop-support
|
a0d8762ce78463ff4889b0b59fd076a52f130852
|
eea2d3e79861bda7ae7930f406bb23b2283c4ec8
|
refs/heads/master
| 2022-12-15T15:10:33.849286
| 2020-03-03T12:00:53
| 2020-03-03T12:00:53
| 244,622,168
| 0
| 0
| null | 2022-12-08T02:15:09
| 2020-03-03T11:47:05
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 3,983
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package export;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import mybean.DB;
/**
*
* @author Narendra
*/
public class ExportProducts {
public static void main ( String[] args ) throws FileNotFoundException, IOException, Exception {
dataExport();
}
public static void dataExport() throws FileNotFoundException, IOException, Exception{
RandomAccessFile raf=new RandomAccessFile("C:\\Users\\shiva\\Desktop\\Technical Support\\src\\java\\export\\modedata.txt","r");
//RandomAccessFile raf=new RandomAccessFile("/home/CB/NB_Workspace/Technical Support/src/java/export/modedata.txt","r");
String st;
String[] str;
int pid=1;
Connection con=(Connection)getConnection();
con.setAutoCommit(false);
PreparedStatement pst=(PreparedStatement) con.prepareStatement("insert into products values(?,?,?,?,?)");
while((st=raf.readLine())!=null) //check the file endpoint
{
str=st.split(",");
/* for(int i=0; i<str.length; i++){
System.out.print(str[i].trim());
}*/
System.out.println(pid+" "+str[0]+" "+str[1]);
pst.setInt(1,pid);
pst.setString(2,str[0]);
pst.setString(3,null);
pst.setString(4,str[1]);
pst.setInt(5,1);
pst.executeUpdate();
con.commit();
// inserdb(count,str[0].trim(),str[1].trim());
pid++;
System.out.println("");
}
pst.close();
con.close();
raf.close();
}
public static Connection getOracleConnection() throws Exception {
System.out.println("Oracle Connect Example.");
Connection conn = null;
String url = "jdbc:oracle:thin:@localhost:1521:XE";
String driver = "oracle.jdbc.driver.OracleDriver";
String userName = "tech";
String password = "tech";
try {
Class.forName(driver).newInstance();
conn = (Connection) DriverManager.getConnection(url, userName, password);
System.out.println("Connected to the database");
/* conn.close();
System.out.println("Disconnected from database");*/
} catch (Exception e) {
e.printStackTrace();
}
return conn;
}
public static Connection getMYSQLConnection() throws Exception {
System.out.println("MySQL Connect Example.");
Connection conn = null;
String url = "jdbc:mysql://172.17.5.85:3306/";
String dbName = "test";
String driver = "com.mysql.jdbc.Driver";
String userName = "j2ee5";
String password = "j2ee";
try {
Class.forName(driver).newInstance();
conn = (Connection) DriverManager.getConnection(url + dbName, userName, password);
System.out.println("Connected to the database");
/* conn.close();
System.out.println("Disconnected from database");*/
} catch (Exception e) {
e.printStackTrace();
}
return conn;
}
public static Connection getConnection() throws Exception {
//return getMYSQLConnection();
return getOracleConnection();
}
public static void inserdb(int pid,String pname,String productName) throws Exception{
Connection con=getConnection();
con.setAutoCommit(false);
PreparedStatement st=(PreparedStatement) con.prepareStatement("insert into products values(?,?,?,?,?)");
st.setInt(1,pid);
st.setString(2,pname);
st.setString(3,null);
st.setString(4,productName);
st.setInt(5,1);
st.executeUpdate();
con.commit();
st.close();
con.close();
}
}
|
[
"bhargavperumalla123@gmail.com"
] |
bhargavperumalla123@gmail.com
|
1634db5f4ee2a5a91a70f0312253d74e99b688c8
|
435aa6c14add9d8bdf9fc1baeab6fec95ce9f976
|
/app/src/androidTest/java/com/example/jana/motivlearn/ExampleInstrumentedTest.java
|
e3d891076cc69ee850e08a083ab36a1cf0e27069
|
[] |
no_license
|
AleidJana/MotivLearn
|
51bf71320b1a9f7c2d43df5b83c74a8038c6eb8d
|
aa398e83f55850f77b6289381fa8cc7546888fcc
|
refs/heads/master
| 2021-09-14T07:52:30.449676
| 2018-05-10T07:51:05
| 2018-05-10T07:51:05
| 119,282,733
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 755
|
java
|
package com.example.jana.motivlearn;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.jana.motivlearn", appContext.getPackageName());
}
}
|
[
"43200284@student.ksu.edu.sa"
] |
43200284@student.ksu.edu.sa
|
165a2a20a5b2dca500b562de290920416a33fd56
|
890383cb75665806459a245dae96c1b1592942cf
|
/src/test/java/br/com/upbusiness/netpinservices/NetpinServicesApplicationTests.java
|
d8deccdeb69f573668389a8104ae563703bf83c1
|
[] |
no_license
|
rafaelrecalcatti/netpin-service
|
8597874cc41d2ecb57514458d801a3a79412f3e1
|
b7a830993e13015517131f38491d56e276041328
|
refs/heads/master
| 2022-07-24T07:27:26.084324
| 2020-08-05T01:55:53
| 2020-08-05T01:55:53
| 221,798,583
| 0
| 0
| null | 2022-06-25T07:29:40
| 2019-11-14T22:33:40
|
Java
|
UTF-8
|
Java
| false
| false
| 357
|
java
|
package br.com.upbusiness.netpinservices;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class NetpinServicesApplicationTests {
@Test
public void contextLoads() {
}
}
|
[
"rafael.teixeira.recalcatti@gmail.com"
] |
rafael.teixeira.recalcatti@gmail.com
|
ec712560ca6fd857613efb514d29226507a0e250
|
41e2b9702fc3f8c9d38b279e58ee310fa7b189dc
|
/project2/src/com/epam/task/two/text/executor/RegexSupplier.java
|
654b3cd2b9295cce9a024003fe3ea3e74d861fda
|
[] |
no_license
|
AliakseiYermachonak/TrainingRepository
|
a05a92c420ca0735e52c06ae03f0356680f21dbd
|
cf5e9de5068a4f926f7fd96fa04a83f3a065c594
|
refs/heads/master
| 2020-03-11T17:51:23.184890
| 2018-06-29T22:58:05
| 2018-06-29T22:58:05
| 130,159,507
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 385
|
java
|
package com.epam.task.two.text.executor;
import java.util.Locale;
import java.util.ResourceBundle;
public class RegexSupplier {
private static ResourceBundle bundle = ResourceBundle.getBundle("com.epam.task.two.text.property.parser", Locale.getDefault());
public static String getRegex(String key) {
return bundle.getString(key);
}
}
|
[
"Alexey@DESKTOP-MJSLG1J"
] |
Alexey@DESKTOP-MJSLG1J
|
0eb7e56d510abc56dd855636a175b33e6acc1f25
|
769eeb78b0a4e21d0816cb5556eff5e1d339b2c9
|
/app/src/main/java/com/bin/smart/za/ui/StudentActivity/StudentCourses.java
|
a261e63666ae0a99ec5fa038fcaba288e3b6a19b
|
[] |
no_license
|
mohamedabdo99/e-learning
|
4b1b793c2cead82a788d4abb2ca42af284537e56
|
805ce37c478da55287b12e6aa595186812581ead
|
refs/heads/master
| 2023-09-03T01:28:32.323391
| 2021-10-30T10:44:49
| 2021-10-30T10:44:49
| 367,318,195
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,248
|
java
|
package com.bin.smart.za.ui.StudentActivity;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.Toast;
import com.bin.smart.za.Model.Member;
import com.bin.smart.za.R;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
public class StudentCourses extends AppCompatActivity {
Button button;
CheckBox c1,c2,c3,c4,c5,c6;
private FirebaseDatabase database;
private DatabaseReference reference;
private Member member;
int i=0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_subjects);
reference=database.getInstance().getReference().child("subjects");
member=new Member();
button=findViewById(R.id.btn_save);
c1=findViewById(R.id.digital_image);
c2=findViewById(R.id.Computer_Graphics);
c3=findViewById(R.id.Artificial_Intelligence);
c4=findViewById(R.id.Introduction_To_Partial_Differential_Equations);
c5=findViewById(R.id.Functional_Analysis);
c6=findViewById(R.id.Complex_Variable);
final String s1="digital image";
final String s2="Computer Graphics";
final String s3="Artificial Intelligence";
final String s4="Introduction To Partial Differential Equations";
final String s5="Functional Analysis";
final String s6="Complex Variable";
reference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if(dataSnapshot.exists()){
i=(int)dataSnapshot.getChildrenCount();}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
button.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v) {
if(c1.isChecked()){
member.setSubject1(s1);
reference.child(FirebaseAuth.getInstance().getCurrentUser()
.getUid())
.setValue(member);
}
else {
}
if(c2.isChecked()){
member.setSubject2(s2);
reference.child(FirebaseAuth.getInstance().getCurrentUser()
.getUid())
.setValue(member);
}
else {
}
if(c3.isChecked()){
member.setSubject3(s3);
reference.child(FirebaseAuth.getInstance().getCurrentUser().getUid()).setValue(member);
}
else {
}
if(c4.isChecked()){
member.setSubject4(s4);
reference.child(FirebaseAuth.getInstance().getCurrentUser().getUid()).setValue(member);
}
else {
}
if(c5.isChecked()){
member.setSubject5(s5);
reference.child(FirebaseAuth.getInstance().getCurrentUser().getUid()).setValue(member);
}
else {
}
if(c6.isChecked()){
member.setSubject6(s6);
reference.child(FirebaseAuth.getInstance().getCurrentUser().getUid()).setValue(member);
}
else
{
Toast.makeText(StudentCourses.this, "Checked the Subject", Toast.LENGTH_SHORT).show();
}
startActivity( new Intent(StudentCourses.this, ViewSubject.class));
}
});
}
}
|
[
"mmizo1061@gmail.com"
] |
mmizo1061@gmail.com
|
6105113faa801fc445ec14efea85f0b3a40e1679
|
b0007cf1c1335778732f9d3ddb19c21811b30327
|
/src/model/data_structures/IDataStructure.java
|
c51a81d9d98a7cd75106781621eb8ccbe6ac8aea
|
[] |
no_license
|
ISIS1206-1-EQUIPO1/T2_202020
|
da192a5e4d70e45993f178f152b1d26f25f29daa
|
41bdc91efd3387999143cb09c4e87881e32a6aeb
|
refs/heads/master
| 2022-12-12T09:25:04.366010
| 2020-09-02T00:54:50
| 2020-09-02T00:54:50
| 291,053,153
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,982
|
java
|
package model.data_structures;
/**
* Interface que modela las clases de estruturas de datos del programa.
*/
public interface IDataStructure< T extends Comparable< T > >
{
/**
* Retornar el numero de elementos presentes en el arreglo
* @return numero de elementos presentes en el arreglo (posiciones no-null)
*/
int actSize( );
/**
* Agrega el elemento de forma compacta al principio de la lista.
* @param element. Elemento a agregar
* @throws ElementNotFoundException si el elemento a agregar es null o la lista no esta inicializada.
*/
public void addFirst( T element ) throws ElementNotFoundException;
/**
* Agrega el elemento de forma compacta al final de la lista.
* Caso Especial: Si el arreglo esta lleno debe aumentarse su capacidad, agregar el nuevo dato y deben quedar multiples casillas disponibles para futuros nuevos datos.
* @param element. Elemento a agregar.
* @throws ElementNotFoundException si el elemento a agregar es null o la lista no esta inicializada.
*/
public void addLast( T element ) throws ElementNotFoundException;
/**
* Agregar un dato de forma compacta en la posicion que ingresa por parámetro
* @param element. Elemento a agregar.
* @param pos. Posicion donde se debe agregar el elemento. pos >= 1
* @throws InvalidIndexException si la posición es menor a 1 o mayor al tamaño del arreglo.
* @throws ElementNotFoundException si el elemento a agregar es null.
*/
public void insertElement( T element, int pos ) throws ElementNotFoundException, InvalidIndexException;
/**
* Elimina el primer dato del arreglo.
* Los datos restantes deben quedar "compactos" desde la posicion 0.
* @return el elemento eliminado.
* @throws ElementNotFoundException si no hay elementos en el arreglo o no está inicializado.
*/
T removeFirst( ) throws ElementNotFoundException;
/**
* Elimina el ultimo dato del arreglo.
* Los datos restantes deben quedar "compactos" desde la posicion 0.
* @return el elemento eliminado.
* @throws ElementNotFoundException si no hay elementos en el arreglo o no está inicializado.
*/
T removeLast( ) throws ElementNotFoundException;
/**
* Elimina el elemento con la posicion que ingresa por parametro.
* Los datos restantes deben quedar "compactos" desde la posicion 0.
* @param pos. La posicion del elemento que se quiere eliminar. pos >= 1
* @return el elemento eliminado.
* @throws InvalidIndexException si la posición es menor a 1 o mayor al tamaño del arreglo.
* @throws ElementNotFoundException si no hay elementos en el arreglo o no está inicializado.
*/
T deleteElementPos( int pos ) throws ElementNotFoundException, InvalidIndexException;
/**
* Eliminar un dato del arreglo.
* Los datos restantes deben quedar "compactos" desde la posicion 0.
* @param element. Elemento de eliminacion en el arreglo
* @return el elemento eliminado
* @throws ElementNotFoundException si el elemento a eliminar es inválido, no está en el arreglo, no hay elementos en el arreglo o no esta inicializado
*/
T deleteElement( T element ) throws ElementNotFoundException;
/**
* Retorna el primer elemento del arreglo.
* @return primer elemento del arreglo.
* @throws ElementNotFoundException si no hay elementos en el arreglo o no está inicializado.
*/
T firstElement( ) throws ElementNotFoundException;
/**
* Retorna el ultimo elemento del arreglo.
* @return ultimo elemento del arreglo.
* @throws ElementNotFoundException si no hay elementos en el arreglo o no está inicializado.
*/
T lastElement( ) throws ElementNotFoundException;
/**
* Retornar el elemento en la posicion i
* @param i posicion de consulta
* @return elemento de consulta. null si no hay elemento en posicion.
* @throws InvalidIndexException si la posición es menor a 1 o mayor al tamaño del arreglo.
* @throws ElementNotFoundException si no hay elementos en el arreglo o no está inicializado.
*/
T getElementPos( int i ) throws ElementNotFoundException, InvalidIndexException;
/**
* Buscar un dato en el arreglo.
* @param dato Objeto de busqueda en el arreglo
* @return elemento encontrado en el arreglo (si existe). null si no se encontro el dato.
* @throws ElementNotFoundException si el elemento a buscado es inválido, no está en el arreglo, no hay elementos en el arreglo o no esta inicializado
*/
T getElement(T dato) throws ElementNotFoundException;
/**
* Retorna si el arreglo tiene o no elementos.
* @return true si no hay elementos en el arreglo, false de lo contrario.
*/
boolean isEmpty( );
/**
* Retorna la posicion del elemento que ingresa por parametros.
* @param element el elemento a analizar.
* @return posicion del elemento.
* @throws ElementNotFoundException si el elemento a buscado es inválido, no está en el arreglo, no hay elementos en el arreglo o no esta inicializado
*/
public int isPresent( T element ) throws ElementNotFoundException;
/**
* Intercambia la informacion de los elementos en dos posiciones validas
* @param pos1 la posicion del elemento 1.
* @param pos2 la posicion del elemento 2.
* @throws InvalidIndexException si alguno de los indices no está entre 1 y el numero de elementos del arreglo o los indices son iguales.
* @throws ElementNotFoundException si no hay al menos dos elementos en el arreglo o no esta inicializado
*/
public void exchange( int pos1, int pos2 ) throws ElementNotFoundException, InvalidIndexException;
/**
* Actualiza la informacion en una posicion valida.
* @param pos. La posicion donde se quiere actualizar la informacion.
* @param elem. El elemento que se quiere insertar.
* @throws InvalidIndexException si la posición es menor a 1 o mayor al tamaño del arreglo.
* @throws ElementNotFoundException si el elemento a ingresar es inválido o la lista esta vacia o sin inicializar.
*/
public void changeInfo( int pos, T elem ) throws ElementNotFoundException, InvalidIndexException;
}
|
[
"ja.ramirezs2@uniandes.edu.co"
] |
ja.ramirezs2@uniandes.edu.co
|
8820ec1207c9bd825e5416134873729a14c76a9d
|
eac73f2c3940519aede351b19821b9508f964c0e
|
/src/com/qixing/zhuangbei/Beanequdetailphoto.java
|
13ce627115cabb60f90fe92411dcb931769312ec
|
[] |
no_license
|
shuoshuderen/qixing-tianxia
|
713c460174ce08b0d404d21bfcd9ded7bf07d1f2
|
e0f7c6139fbd0f2d42b868e5b51cf6f9db55918e
|
refs/heads/master
| 2021-01-10T03:51:31.118398
| 2015-11-10T11:05:11
| 2015-11-10T11:05:11
| 45,905,955
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,186
|
java
|
package com.qixing.zhuangbei;
import java.io.Serializable;
public class Beanequdetailphoto implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private int equdetailphotoid;
private int equdetailId;
private String photo;
public Beanequdetailphoto() {
super();
}
public Beanequdetailphoto(String photo) {
super();
this.photo = photo;
}
public Beanequdetailphoto(int equdetailphotoid, int equdetailId,
String photo) {
super();
this.equdetailphotoid = equdetailphotoid;
this.equdetailId = equdetailId;
this.photo = photo;
}
public int getEqudetailphotoid() {
return equdetailphotoid;
}
public void setEqudetailphotoid(int equdetailphotoid) {
this.equdetailphotoid = equdetailphotoid;
}
public int getEqudetailId() {
return equdetailId;
}
public void setEqudetailId(int equdetailId) {
this.equdetailId = equdetailId;
}
public String getPhoto() {
return photo;
}
public void setPhoto(String photo) {
this.photo = photo;
}
@Override
public String toString() {
return "Beanequdetailphoto [photo=" + photo + "]";
}
}
|
[
"961173512@qq.com"
] |
961173512@qq.com
|
d4f84d8078b907dec2ba78b98147b6bb33556bfc
|
f2b0be4725f245791a11438af85f6af0d7a139d1
|
/src/view/partials/itemPartials/dialogs/MagicWeaponEditController.java
|
485a2102efeb9b0d7e468d9e2bc74a7f7fdd86ed
|
[] |
no_license
|
RealStandardStudios/PathfinderDataEditor
|
9c853409a208e875180d0346efa39012a1fd2043
|
108c576e17c0a25e2eecd339c8d027ee4218fc7c
|
refs/heads/master
| 2020-12-24T14:56:54.539255
| 2014-10-21T01:13:41
| 2014-10-21T01:13:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,343
|
java
|
package view.partials.itemPartials.dialogs;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import jefXif.view.DialogController;
import org.controlsfx.dialog.Dialogs;
import pathfinder.data.Items.MagicWeapon;
import pathfinder.data.Items.SlotType;
/**
* the controller for the magic weapon edit dialog
*
* @author Real Standard Studios - Joshua Boyd
*/
@SuppressWarnings("deprecation")
public class MagicWeaponEditController extends DialogController {
@FXML
private TextField nameField;
@FXML
private TextField weaponTypeField;
@FXML
private TextField dmgSField;
@FXML
private TextField dmgMField;
@FXML
private TextField criticalField;
@FXML
private TextField rangeField;
@FXML
private TextField dmgTypeField;
@FXML
private TextField specialField;
@FXML
private TextField costField;
@FXML
private TextField weightField;
@FXML
private TextField auraStrengthField;
@FXML
private TextField casterLevelField;
@FXML
private TextField descriptionField;
@FXML
private TextField constructionField;
@FXML
private ComboBox<SlotType> cboSlotType;
private Stage dialogStage;
private MagicWeapon weapon;
/**
* the initialize method implemented from extension
*/
public void initialize() {
}
/**
* Sets the stage of this dialog.
*
* @param dialogStage
*/
public void setDialogStage(Stage dialogStage) {
this.dialogStage = dialogStage;
}
/**
* populates the dialog
* @param a
*/
public void setWeapon(MagicWeapon w)
{
weapon = w;
nameField.setText(w.Name.get());
weaponTypeField.setText(w.WeaponType.get());
dmgSField.setText(w.DmgS.get());
dmgMField.setText(w.DmgM.get());
criticalField.setText(w.Critical.get());
rangeField.setText(w.Range.get());
dmgTypeField.setText(w.WeaponDmgType.get());
specialField.setText(w.Special.get());
costField.setText(w.Cost.get());
weightField.setText(w.Weight.get());
auraStrengthField.setText(w.getAuraStrength());
casterLevelField.setText(w.getCasterLevel());
descriptionField.setText(w.getDescription());
constructionField.setText(w.getConstruction());
}
/**
* checks for valid input
* @returns true if correct
*/
private boolean isInputValid() {
String errorMessage = "";
if (nameField.getText() == null || nameField.getText().length() == 0) {
errorMessage += "No valid weapon name is set!\n";
}
if (weaponTypeField.getText() == null || weaponTypeField.getText().length() == 0) {
errorMessage += "No valid weapon type is set!\n";
}
if (criticalField.getText() == null || criticalField.getText().length() == 0) {
errorMessage += "No valid weapon critical is set!\n";
}
if (dmgSField.getText() == null || dmgSField.getText().length() == 0) {
errorMessage += "No valid small weapon damage is set!\n";
}
if (dmgMField.getText() == null || dmgMField.getText().length() == 0) {
errorMessage += "No valid medium weapon damage is set!\n";
}
if (rangeField.getText() == null || rangeField.getText().length() == 0) {
errorMessage += "No valid weapon range is set!\n";
}
if (dmgTypeField.getText() == null || dmgTypeField.getText().length() == 0) {
errorMessage += "No valid damage type is set!\n";
}
if (specialField.getText() == null || specialField.getText().length() == 0) {
errorMessage += "No valid special weapon conditions is set!\n";
}
if (costField.getText() == null || costField.getText().length() == 0) {
errorMessage += "No valid price is set!\n";
}
if (weightField.getText() == null || weightField.getText().length() == 0) {
errorMessage += "No valid weight is set!\n";
}
if (auraStrengthField.getText() == null || auraStrengthField.getText().length() == 0) {
errorMessage += "No valid aura strength is set!\n";
}
if (casterLevelField.getText() == null || casterLevelField.getText().length() == 0) {
errorMessage += "No valid caster level is set!\n";
}
if (descriptionField.getText() == null || descriptionField.getText().length() == 0) {
errorMessage += "No valid description is set!\n";
}
if (constructionField.getText() == null || constructionField.getText().length() == 0) {
errorMessage += "No valid weight is set!\n";
}
if (errorMessage.length() == 0) {
return true;
} else {
// Show the error message.
Dialogs.create()
.title("Invalid Fields")
.masthead("Please correct invalid fields")
.message(errorMessage)
.showError();
return false;
}
}
/**
* saves data when Ok button pressed
*/
@FXML
public void handleOkay(ActionEvent event) {
if (isInputValid()) {
weapon.Name.set(nameField.getText());
weapon.WeaponType.set(weaponTypeField.getText());
weapon.Critical.set(criticalField.getText());
weapon.DmgS.set(dmgSField.getText());
weapon.DmgM.set(dmgMField.getText());
weapon.Range.set(rangeField.getText());
weapon.WeaponDmgType.set(dmgTypeField.getText());
weapon.Special.set(specialField.getText());
weapon.Weight.set(weightField.getText());
weapon.Cost.set(costField.getText());
weapon.Weight.set(weightField.getText());
weapon.setAuraStrength(auraStrengthField.getText());
weapon.setCasterLevel(casterLevelField.getText());
weapon.setDescription(descriptionField.getText());
weapon.setDescription(descriptionField.getText());
okayClicked = true;
dialogStage.close();
}
}
}
|
[
"lololirpro@gmail.com"
] |
lololirpro@gmail.com
|
01b08da308236d2610a9b37c5726ea3163709a16
|
209aee2e06f1454f144905030dc11439c677b69d
|
/src/main/java/ksm/common/resolver/CustomMapArgumentResolver.java
|
d209d5d4f4a1750ea6552f6a7c9b31b9fac26a24
|
[] |
no_license
|
aster1212/FinalProject
|
57ef0163cfda75ebcb6a0fd49ba3ff3fa8e5eac4
|
0ebc8208be308b6b65f74d4649446d1218bfed6a
|
refs/heads/master
| 2020-04-28T09:31:19.570313
| 2019-03-12T08:58:56
| 2019-03-12T08:58:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,472
|
java
|
package ksm.common.resolver;
import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;
import org.springframework.core.MethodParameter;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
import ksm.common.common.CommandMap;
public class CustomMapArgumentResolver implements HandlerMethodArgumentResolver{
@Override
public boolean supportsParameter(MethodParameter parameter) {
// TODO Auto-generated method stub
return CommandMap.class.isAssignableFrom(parameter.getParameterType());
}
@Override
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
// TODO Auto-generated method stub
CommandMap commandMap = new CommandMap();
HttpServletRequest request = (HttpServletRequest) webRequest.getNativeRequest();
Enumeration<?> enumeration = request.getParameterNames();
String key = null;
String[] values = null;
while(enumeration.hasMoreElements()) {
key = (String) enumeration.nextElement();
values = request.getParameterValues(key);
if(values != null) {
commandMap.put(key, (values.length > 1 ) ? values : values[0]);
}
}
return commandMap;
}
}
|
[
"Tae.hoon K@TaeHoon"
] |
Tae.hoon K@TaeHoon
|
62b16718652761b1b623376d5ebfaa1d6d58e3db
|
fc6dd8b7cb9daaad0c419e3d5bb4a962eee8c669
|
/src/com/ansou/algo/EqualizeTheArray.java
|
7352e717fab1500c4a96cafcd3f50ff1a46fd954
|
[] |
no_license
|
Ansou1/AlghoTraining
|
926bc0881a874763f6de27472d925081de75095c
|
46ad3dfa1fad71356a06de4ed3aa4d53d8d55321
|
refs/heads/master
| 2020-05-01T16:58:52.680740
| 2019-07-24T17:30:26
| 2019-07-24T17:30:26
| 177,587,376
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 648
|
java
|
package com.ansou.algo;
import java.util.HashMap;
import java.util.Map;
public class EqualizeTheArray {
static int equalizeArray(int[] arr) {
int max = 1;
Map<Integer, Integer> nums = new HashMap<>();
for (int i : arr)
if (!nums.containsKey(i))
nums.put(i, 1);
else {
nums.put(i, nums.get(i) + 1);
if (max < nums.get(i))
max = nums.get(i);
}
return arr.length - max;
}
public static void main(String[] args) {
int[] c = {3,3,2,1,3};
System.out.println(equalizeArray(c));
}
}
|
[
"simondaguenet81@gmail.com"
] |
simondaguenet81@gmail.com
|
1fdd7376f5ac9dab47aaada084f2278a3786546f
|
af433e77b704c998bb7a910c84d4f37462ba91d3
|
/common/data/src/main/java/org/thingsboard/server/common/data/firmware/FirmwareUpdateStatus.java
|
3e46174792e3422d8920a5f90e74c5997e320a2d
|
[
"Apache-2.0"
] |
permissive
|
UranKhatolaaa/sturdy-octo-fortnight
|
4f569c594192a97be6fb02817db91d90258d2f12
|
4541bd5fe7b4a805d51594ff2f0f74a09a76eb59
|
refs/heads/main
| 2023-08-23T12:16:58.674536
| 2021-10-20T22:08:47
| 2021-10-20T22:08:47
| 419,312,519
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 791
|
java
|
/**
* Copyright © 2016-2021 The Thingsboard 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.thingsboard.server.common.data.firmware;
public enum FirmwareUpdateStatus {
QUEUED, INITIATED, DOWNLOADING, DOWNLOADED, VERIFIED, UPDATING, UPDATED, FAILED
}
|
[
"zha@Zhas-MBP.lan"
] |
zha@Zhas-MBP.lan
|
773b4bcba47a69e6fbb7e6daffb9d37e21d9ad44
|
96aa018a27ac4c3076caf9b18532be958062cf1a
|
/OnlineTest/src/baidu/Permutations.java
|
8f50030865ab53bbc4d76aaa7fcff2c37be9502e
|
[] |
no_license
|
gongmi/workSpace
|
46a9b6440fe8e0ebcf1cc0b7caea2573668a8579
|
0a3b729d937bce06fd081f69e92413917eedb942
|
refs/heads/master
| 2020-12-24T20:09:47.676222
| 2017-09-09T06:29:12
| 2017-09-09T06:29:12
| 86,234,013
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 470
|
java
|
package baidu;
import java.util.*;
public class Permutations {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int k = in.nextInt();
int[][] dp = new int[n + 1][k + 1];
for (int i = 0; i <= n; i++)
dp[i][0] = 1;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= k; j++)
dp[i][j] = dp[i - 1][j] * (j + 1) + dp[i - 1][j - 1] * (i - j);
System.out.println(dp[n][k]);
}
}
|
[
"450989123@qq.com"
] |
450989123@qq.com
|
fa6ecec5b25d6252d3b290325a68aaf3325725a0
|
5170c2a462f4882e10cee9be815e80260bd9d9b2
|
/src/main/java/com/yngk/usermanage/model/UserExtendRelationInfo.java
|
86e4f11da2a40b3ed0a9a6f08f4d44d7ddc6bfe0
|
[] |
no_license
|
guoyu07/SpringMVC-1
|
94e45a5103fead7ecf643ad1dd4df66a919e6055
|
e99f402aa7f9e8a7fbbe647115da6279deb53342
|
refs/heads/master
| 2021-04-30T10:12:27.766690
| 2017-09-11T15:59:27
| 2017-09-11T15:59:27
| 121,328,805
| 0
| 1
| null | 2018-02-13T02:23:47
| 2018-02-13T02:23:46
| null |
UTF-8
|
Java
| false
| false
| 1,426
|
java
|
package com.yngk.usermanage.model;
import java.io.Serializable;
/**
*
* @ClassName: UserExtendRelationInfo
*/
public class UserExtendRelationInfo implements Serializable
{
/**
* @fieldName: serialVersionUID
* @fieldType: long
* @Description: TODO
*/
private static final long serialVersionUID = -1786521566980745524L;
private String id;
private String mainId;
private String exproId;
private String name;
private String value;
public String getId()
{
return id;
}
public void setId(String id)
{
this.id = id == null ? null : id.trim();
}
public String getMainId()
{
return mainId;
}
public void setMainId(String mainId)
{
this.mainId = mainId == null ? null : mainId.trim();
}
public String getExproId()
{
return exproId;
}
public void setExproId(String exproId)
{
this.exproId = exproId == null ? null : exproId.trim();
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name == null ? null : name.trim();
}
public String getValue()
{
return value;
}
public void setValue(String value)
{
this.value = value == null ? null : value.trim();
}
}
|
[
"liu__xian@126.com"
] |
liu__xian@126.com
|
b55415aba763ab19a58cfe29d839cc9d947a6f3b
|
875d0973278f60b1dfcb6511f728eb35c6b308f5
|
/src/main/java/mk/ukim/finki/moviesapi/model/rest/UserDto.java
|
1b593548572e2c5160cff4a26291ee1bb53ca6a4
|
[] |
no_license
|
exe107/movies-api
|
6ecba6af890ff8adf93ac2c1b00e396457d05ad1
|
8d7555ed2c8ec4e2735c6a41fa01341e669bcec6
|
refs/heads/master
| 2020-11-27T20:22:08.811161
| 2020-07-04T14:43:05
| 2020-07-04T14:43:05
| 229,589,250
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 414
|
java
|
package mk.ukim.finki.moviesapi.model.rest;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public class UserDto {
private String username;
private boolean admin;
private UserPersonalDetailsDto personalDetails;
private List<UserMovieRatingOutDto> movieRatings;
private List<MovieDto> watchlist;
private List<ReviewOutDto> pendingReviews;
}
|
[
"ex177@hotmail.com"
] |
ex177@hotmail.com
|
e6e22c0e5fa6e70fc805ca7840312546b22bf1d5
|
61551f9d15fc656b4c9e9f57996c337c39d26da9
|
/src/main/java/com/rocket/crm/service/impl/BranchServiceImpl.java
|
1ab141135bbc79b857ea32de44088da914bd403f
|
[] |
no_license
|
sandeeppatidar-medsolis/rocket
|
c5a779bf0435ccef7c41174bb5f09404fef2e228
|
49c1e9e2d14f79c4e2bc234d1dbc5b9252bbdfb1
|
refs/heads/master
| 2021-05-18T17:11:46.580735
| 2020-08-11T16:49:47
| 2020-08-11T16:49:47
| 251,332,600
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,818
|
java
|
package com.rocket.crm.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rocket.crm.constants.AppConstants;
import com.rocket.crm.constants.MsgConstants;
import com.rocket.crm.entity.Branch;
import com.rocket.crm.entity.CityMaster;
import com.rocket.crm.entity.CountryMaster;
import com.rocket.crm.entity.StateMaster;
import com.rocket.crm.exception.UserRequestException;
import com.rocket.crm.repository.BranchRepository;
import com.rocket.crm.service.BranchService;
import com.rocket.crm.utility.AppUtility;
import com.rocket.crm.utility.ConversionUtils;
@Service
public class BranchServiceImpl implements BranchService {
@Autowired
BranchRepository branchRepository;
@Override
public Map<String, Object> create(Map<String, Object> map) {
if (AppUtility.isEmpty(map.get(AppConstants.NAME))) {
throw new UserRequestException(MsgConstants.ERROR_NAME_NOT_NULL);
}
Branch branch = new Branch();
branch.setName((String) map.get(AppConstants.NAME));
branch.setAddress((String) map.get(AppConstants.ADDRESS));
if (!AppUtility.isEmpty(map.get(AppConstants.COUNTRY_ID))) {
branch.setCountry(new CountryMaster(new Long((Integer) map.get(AppConstants.COUNTRY_ID))));
}
if (!AppUtility.isEmpty(map.get(AppConstants.STATE_ID))) {
branch.setState(new StateMaster(new Long((Integer) map.get(AppConstants.STATE_ID))));
}
if (!AppUtility.isEmpty(map.get(AppConstants.CITY_ID))) {
branch.setCity(new CityMaster(new Long((Integer) map.get(AppConstants.CITY_ID))));
}
return ConversionUtils.convertEntityToMap(branchRepository.save(branch), 1);
}
@Override
public List<Map<String, Object>> getAllBranch() {
return branchRepository.getAllBranch();
}
}
|
[
"ravindra.m@ninja-ai.com"
] |
ravindra.m@ninja-ai.com
|
2e6c3f6ecfae3aaf318dbd5e15d64aa1d5fe8cb7
|
dce2371c1f3c0ac271ccbbf2fe499b2b12df4cda
|
/src/main/java/net/mcreator/blocktesting/block/SnowyRedContainer2Block.java
|
0ddc02934b573f9f4c857d5abd646218c869be13
|
[] |
no_license
|
ChrisCraddock/Crates-and-Containers
|
1b20304b72618e89b2c4083858366d2726ee0adc
|
5d7af4b399ad93f662e96d0282a3d05dafdb1160
|
refs/heads/master
| 2023-08-24T17:39:59.738030
| 2021-10-29T09:20:15
| 2021-10-29T09:20:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 11,443
|
java
|
package net.mcreator.blocktesting.block;
import net.minecraftforge.registries.ObjectHolder;
import net.minecraftforge.items.wrapper.SidedInvWrapper;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.ToolType;
import net.minecraft.world.World;
import net.minecraft.world.IBlockReader;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.Rotation;
import net.minecraft.util.NonNullList;
import net.minecraft.util.Mirror;
import net.minecraft.util.Hand;
import net.minecraft.util.Direction;
import net.minecraft.util.ActionResultType;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.LockableLootTileEntity;
import net.minecraft.state.StateContainer;
import net.minecraft.state.DirectionProperty;
import net.minecraft.network.play.server.SUpdateTileEntityPacket;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.NetworkManager;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.loot.LootContext;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.BlockItem;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.block.material.Material;
import net.minecraft.block.SoundType;
import net.minecraft.block.DirectionalBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.Block;
import net.mcreator.blocktesting.itemgroup.SnowContainers32x32ItemGroup;
import net.mcreator.blocktesting.gui.WhiteContainerEndsGUIGui;
import net.mcreator.blocktesting.BlocktestingModElements;
import javax.annotation.Nullable;
import java.util.stream.IntStream;
import java.util.List;
import java.util.Collections;
import io.netty.buffer.Unpooled;
@BlocktestingModElements.ModElement.Tag
public class SnowyRedContainer2Block extends BlocktestingModElements.ModElement {
@ObjectHolder("blocktesting:snowy_red_container_2")
public static final Block block = null;
@ObjectHolder("blocktesting:snowy_red_container_2")
public static final TileEntityType<CustomTileEntity> tileEntityType = null;
public SnowyRedContainer2Block(BlocktestingModElements instance) {
super(instance, 133);
FMLJavaModLoadingContext.get().getModEventBus().register(new TileEntityRegisterHandler());
}
@Override
public void initElements() {
elements.blocks.add(() -> new CustomBlock());
elements.items.add(
() -> new BlockItem(block, new Item.Properties().group(SnowContainers32x32ItemGroup.tab)).setRegistryName(block.getRegistryName()));
}
private static class TileEntityRegisterHandler {
@SubscribeEvent
public void registerTileEntity(RegistryEvent.Register<TileEntityType<?>> event) {
event.getRegistry()
.register(TileEntityType.Builder.create(CustomTileEntity::new, block).build(null).setRegistryName("snowy_red_container_2"));
}
}
public static class CustomBlock extends Block {
public static final DirectionProperty FACING = DirectionalBlock.FACING;
public CustomBlock() {
super(Block.Properties.create(Material.IRON).sound(SoundType.METAL).hardnessAndResistance(6f, 10f).setLightLevel(s -> 0).harvestLevel(2)
.harvestTool(ToolType.PICKAXE).setRequiresTool());
this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH));
setRegistryName("snowy_red_container_2");
}
@Override
public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) {
return 15;
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
public BlockState rotate(BlockState state, Rotation rot) {
return state.with(FACING, rot.rotate(state.get(FACING)));
}
public BlockState mirror(BlockState state, Mirror mirrorIn) {
return state.rotate(mirrorIn.toRotation(state.get(FACING)));
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
;
return this.getDefaultState().with(FACING, context.getNearestLookingDirection().getOpposite());
}
@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
return Collections.singletonList(new ItemStack(this, 1));
}
@Override
public ActionResultType onBlockActivated(BlockState blockstate, World world, BlockPos pos, PlayerEntity entity, Hand hand,
BlockRayTraceResult hit) {
super.onBlockActivated(blockstate, world, pos, entity, hand, hit);
int x = pos.getX();
int y = pos.getY();
int z = pos.getZ();
if (entity instanceof ServerPlayerEntity) {
NetworkHooks.openGui((ServerPlayerEntity) entity, new INamedContainerProvider() {
@Override
public ITextComponent getDisplayName() {
return new StringTextComponent("Snowy Red Container 2");
}
@Override
public Container createMenu(int id, PlayerInventory inventory, PlayerEntity player) {
return new WhiteContainerEndsGUIGui.GuiContainerMod(id, inventory,
new PacketBuffer(Unpooled.buffer()).writeBlockPos(new BlockPos(x, y, z)));
}
}, new BlockPos(x, y, z));
}
return ActionResultType.SUCCESS;
}
@Override
public INamedContainerProvider getContainer(BlockState state, World worldIn, BlockPos pos) {
TileEntity tileEntity = worldIn.getTileEntity(pos);
return tileEntity instanceof INamedContainerProvider ? (INamedContainerProvider) tileEntity : null;
}
@Override
public boolean hasTileEntity(BlockState state) {
return true;
}
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new CustomTileEntity();
}
@Override
public boolean eventReceived(BlockState state, World world, BlockPos pos, int eventID, int eventParam) {
super.eventReceived(state, world, pos, eventID, eventParam);
TileEntity tileentity = world.getTileEntity(pos);
return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam);
}
@Override
public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) {
if (state.getBlock() != newState.getBlock()) {
TileEntity tileentity = world.getTileEntity(pos);
if (tileentity instanceof CustomTileEntity) {
InventoryHelper.dropInventoryItems(world, pos, (CustomTileEntity) tileentity);
world.updateComparatorOutputLevel(pos, this);
}
super.onReplaced(state, world, pos, newState, isMoving);
}
}
@Override
public boolean hasComparatorInputOverride(BlockState state) {
return true;
}
@Override
public int getComparatorInputOverride(BlockState blockState, World world, BlockPos pos) {
TileEntity tileentity = world.getTileEntity(pos);
if (tileentity instanceof CustomTileEntity)
return Container.calcRedstoneFromInventory((CustomTileEntity) tileentity);
else
return 0;
}
}
public static class CustomTileEntity extends LockableLootTileEntity implements ISidedInventory {
private NonNullList<ItemStack> stacks = NonNullList.<ItemStack>withSize(60, ItemStack.EMPTY);
protected CustomTileEntity() {
super(tileEntityType);
}
@Override
public void read(BlockState blockState, CompoundNBT compound) {
super.read(blockState, compound);
if (!this.checkLootAndRead(compound)) {
this.stacks = NonNullList.withSize(this.getSizeInventory(), ItemStack.EMPTY);
}
ItemStackHelper.loadAllItems(compound, this.stacks);
}
@Override
public CompoundNBT write(CompoundNBT compound) {
super.write(compound);
if (!this.checkLootAndWrite(compound)) {
ItemStackHelper.saveAllItems(compound, this.stacks);
}
return compound;
}
@Override
public SUpdateTileEntityPacket getUpdatePacket() {
return new SUpdateTileEntityPacket(this.pos, 0, this.getUpdateTag());
}
@Override
public CompoundNBT getUpdateTag() {
return this.write(new CompoundNBT());
}
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) {
this.read(this.getBlockState(), pkt.getNbtCompound());
}
@Override
public int getSizeInventory() {
return stacks.size();
}
@Override
public boolean isEmpty() {
for (ItemStack itemstack : this.stacks)
if (!itemstack.isEmpty())
return false;
return true;
}
@Override
public ITextComponent getDefaultName() {
return new StringTextComponent("snowy_red_container_2");
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
public Container createMenu(int id, PlayerInventory player) {
return new WhiteContainerEndsGUIGui.GuiContainerMod(id, player, new PacketBuffer(Unpooled.buffer()).writeBlockPos(this.getPos()));
}
@Override
public ITextComponent getDisplayName() {
return new StringTextComponent("Snowy Red Container 2");
}
@Override
protected NonNullList<ItemStack> getItems() {
return this.stacks;
}
@Override
protected void setItems(NonNullList<ItemStack> stacks) {
this.stacks = stacks;
}
@Override
public boolean isItemValidForSlot(int index, ItemStack stack) {
return true;
}
@Override
public int[] getSlotsForFace(Direction side) {
return IntStream.range(0, this.getSizeInventory()).toArray();
}
@Override
public boolean canInsertItem(int index, ItemStack stack, @Nullable Direction direction) {
return this.isItemValidForSlot(index, stack);
}
@Override
public boolean canExtractItem(int index, ItemStack stack, Direction direction) {
return true;
}
private final LazyOptional<? extends IItemHandler>[] handlers = SidedInvWrapper.create(this, Direction.values());
@Override
public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing) {
if (!this.removed && facing != null && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
return handlers[facing.ordinal()].cast();
return super.getCapability(capability, facing);
}
@Override
public void remove() {
super.remove();
for (LazyOptional<? extends IItemHandler> handler : handlers)
handler.invalidate();
}
}
}
|
[
"30630937+ChrisCraddock@users.noreply.github.com"
] |
30630937+ChrisCraddock@users.noreply.github.com
|
aafb282718732d148a73cb21a583316844203d2f
|
ed20c341c40aae5aa6aa5995489681b56b1b7246
|
/colplus-dao/src/test/java/org/col/db/mapper/TaxonMapperTreeTest.java
|
e45b267a9ad7669481e8977e456951373542365d
|
[
"Apache-2.0"
] |
permissive
|
ManonGros/colplus-backend
|
bf9a9f6e1c4683d7bf6a97e445f0aa19d907745a
|
62723b45de211c3db98055294a87b90284e850bd
|
refs/heads/master
| 2020-09-01T16:20:41.020309
| 2019-11-01T10:41:42
| 2019-11-01T10:41:42
| 218,999,298
| 0
| 0
|
Apache-2.0
| 2019-11-01T14:18:31
| 2019-11-01T14:18:31
| null |
UTF-8
|
Java
| false
| false
| 1,722
|
java
|
package org.col.db.mapper;
import java.util.List;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import org.col.api.model.DSID;
import org.col.api.model.DSIDValue;
import org.col.api.model.Taxon;
import org.col.api.model.TaxonCountMap;
import org.junit.Test;
import static org.col.api.TestEntityGenerator.DATASET11;
import static org.col.api.TestEntityGenerator.NAME4;
import static org.junit.Assert.*;
public class TaxonMapperTreeTest extends MapperTestBase<TaxonMapper> {
NameUsageMapperTreeTest.CountHandler<Taxon> countHandler;
public TaxonMapperTreeTest() {
super(TaxonMapper.class, TestDataRule.tree());
}
@Test
public void classificationCounts() throws Exception {
DSIDValue<String> key = DSID.key(DATASET11.getKey(), "t20");
List<TaxonCountMap> x = mapper().classificationCounts(key);
assertEquals(6, x.size());
for (TaxonCountMap c : x) {
assertNotNull(c.getId());
assertNotNull(c.getCount());
assertTrue(c.getCount().isEmpty());
}
mapper().updateDatasetSectorCount(key.id("t2"), null);
mapper().updateDatasetSectorCount(key.id("t2"), new Int2IntOpenHashMap());
Int2IntOpenHashMap cnt = new Int2IntOpenHashMap();
cnt.put(45, 6);
cnt.put(4, 666);
cnt.put(13, 169);
mapper().updateDatasetSectorCount(key.id("t3"), cnt);
x = mapper().classificationCounts(key.id("t20"));
assertEquals(6, x.size());
for (TaxonCountMap c : x) {
assertNotNull(c.getId());
assertNotNull(c.getCount());
}
}
@Test
public void classificationSimple() throws Exception {
List<?> cl = mapper().classificationSimple(DSID.key(NAME4.getDatasetKey(), "t15"));
assertEquals(7, cl.size());
}
}
|
[
"m.doering@mac.com"
] |
m.doering@mac.com
|
3ac1d873b8f66463c365a5a6d7f366ba0322f54e
|
a848acb68fe4b49ba77de78c26ee9b990d21f924
|
/app/src/main/java/com/example/leonp/okfood/UserAccount/Account/CreateNewPost/CreatePostActivity.java
|
e98f5942dd08acfec440679bb501ace5f0d39519
|
[] |
no_license
|
KernelFailure/okFood
|
5e66b845c2f4a101b00d441dd88e3725654fecd7
|
5642bca8e92d964d7fafcfac221b44ac040dc1d6
|
refs/heads/master
| 2020-03-18T16:32:51.962212
| 2018-06-14T15:31:27
| 2018-06-14T15:31:27
| 134,972,111
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 11,369
|
java
|
package com.example.leonp.okfood.UserAccount.Account.CreateNewPost;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.media.Image;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.leonp.okfood.R;
import com.example.leonp.okfood.UserAccount.Account.Models.Post;
import com.example.leonp.okfood.UserAccount.Account.Utils.UniversalImageLoader;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.concurrent.ThreadLocalRandom;
import de.hdodenhof.circleimageview.CircleImageView;
/**
* Created by leonp on 4/22/2018.
*/
public class CreatePostActivity extends AppCompatActivity {
private static final String TAG = "CreatePostActivity";
// Constants
private static final int CAMERA_REQUEST_CODE = 111;
private static final int MEMORY_PICK_REQUEST_CODE = 222;
// vars
private Bitmap mPostBitmap;
private String mImagePath;
private String post_id;
// widgets
private ImageView ivFolder;
private ImageView ivCamera;
private FrameLayout mFrameLayout;
private CircleImageView ivPostImage;
private TextView tvSubmitPost;
private EditText etPostTitle, etPostDescription;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_createpost);
ivFolder = (ImageView) findViewById(R.id.ivFolder);
ivCamera = (ImageView) findViewById(R.id.ivCamera);
mFrameLayout = (FrameLayout) findViewById(R.id.container);
ivPostImage = (CircleImageView) findViewById(R.id.ivPostImage);
tvSubmitPost = (TextView) findViewById(R.id.tvSubmitPost);
etPostTitle = (EditText) findViewById(R.id.etPostTitle);
etPostDescription = (EditText) findViewById(R.id.etPostDescription);
init();
}
private void init() {
Log.d(TAG, "init: Starting");
setCameraIconListener();
setFolderIconListener();
setSubmitButtonListener();
}
private void setSubmitButtonListener() {
Log.d(TAG, "setSubmitButtonListener: Starting");
tvSubmitPost.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, "onClick: Attempting to submit post");
if (!etPostTitle.getText().toString().equals("")
&& !etPostDescription.getText().toString().equals("")
&& mPostBitmap != null) {
post_id = FirebaseDatabase.getInstance().getReference().push().getKey();
Log.d(TAG, "onClick: Streaming bytes now");
StorageReference storageReference = FirebaseStorage.getInstance().getReference()
.child("post_images/")
.child(post_id);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
mPostBitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
byte[] bytes = stream.toByteArray();
UploadTask uploadTask = storageReference.putBytes(bytes);
uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Uri downloadUri = taskSnapshot.getDownloadUrl();
mImagePath = downloadUri.toString();
// make sure all required fields aren't empty and upload content to firebase database
if (!etPostTitle.equals("") || !etPostDescription.equals("")) {
// create fork in DB for posts. Ordered by post_ids
Log.d(TAG, "onClick: posting to DB now");
Log.d(TAG, "onSuccess: Image path is: " + mImagePath);
// TODO prepare for upload failures (try/catch or upload task)
Post post = new Post();
post.setTitle(etPostTitle.getText().toString());
post.setPost_description(etPostDescription.getText().toString());
post.setUser_id(FirebaseAuth.getInstance().getCurrentUser().getUid());
post.setPost_id(post_id);
post.setImage_path(mImagePath);
int randomNum = ThreadLocalRandom.current().nextInt(4, 326 + 1);
post.setNumberOfComments(randomNum + " Comments");
DatabaseReference reference = FirebaseDatabase.getInstance().getReference();
reference.child("posts/")
.child(post_id + "/")
.setValue(post);
resetFields();
Toast.makeText(CreatePostActivity.this, "Post Created", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(CreatePostActivity.this, "Fill Out All Fields", Toast.LENGTH_SHORT).show();
}
}
});
uploadTask.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.d(TAG, "onFailure: Upload Failed");
Toast.makeText(CreatePostActivity.this, "Upload Failed", Toast.LENGTH_SHORT).show();
}
});
} else {
Toast.makeText(CreatePostActivity.this, "Fill Out All Fields", Toast.LENGTH_SHORT).show();
}
}
});
}
private void setCameraIconListener() {
Log.d(TAG, "setCameraIconListener: Starting");
ivCamera.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, "onClick: Trying to navigate to camera");
if (cameraPermissionGranted()) {
Log.d(TAG, "onClick: Permissions were already granted");
goToCamera();
} else {
Log.d(TAG, "onClick: Permissions were NOT already granted\nAsking for those now");
requestPermissions();
}
}
});
}
private void setFolderIconListener() {
Log.d(TAG, "setFolderIconListener: Starting");
// Uses simplified way of picking pictures from memory
ivFolder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, MEMORY_PICK_REQUEST_CODE);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CAMERA_REQUEST_CODE && resultCode == RESULT_OK) {
Log.d(TAG, "onActivityResult: Trying to set bitmap from resulst to post image");
Bitmap bitmap = (Bitmap) data.getExtras().get("data");
ivPostImage.setImageBitmap(bitmap);
mPostBitmap = bitmap;
Log.d(TAG, "onActivityResult: Bitmap To String Image Path: " + mImagePath);
} else if (requestCode == MEMORY_PICK_REQUEST_CODE && resultCode == RESULT_OK) {
Log.d(TAG, "onActivityResult: Trying to set pic from memory to post image");
Uri selectedImageUri = data.getData();
ivPostImage.setImageURI(selectedImageUri);
try {
mPostBitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), selectedImageUri);
} catch (IOException e) {
Log.e(TAG, "onActivityResult: IOException: " + e.getMessage());
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
goToCamera();
}
private void requestPermissions() {
Log.d(TAG, "requestPermissions: Starting");
requestPermissions(new String[]{Manifest.permission.CAMERA}, 1);
}
private boolean cameraPermissionGranted() {
Log.d(TAG, "cameraPermissionGranted: Starting");
if (checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
return false;
}
return true;
}
private void goToCamera() {
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST_CODE);
}
private void resetFields() {
Log.d(TAG, "resetFields: Starting");
etPostTitle.setText("");
etPostDescription.setText("");
ivPostImage.setImageResource(R.drawable.ic_upload);
}
private void pickFromMemoryTwo() {
// More complex/custom way of picking from memory
ivFolder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, "onClick: Navigating to gallery fragment ");
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
GalleryFragment fragment = new GalleryFragment();
fragmentTransaction.replace(R.id.container, fragment);
fragmentTransaction.commit();
getSupportFragmentManager().popBackStack();
}
});
}
}
|
[
"leonp1mcg@gmail.com"
] |
leonp1mcg@gmail.com
|
0c2dc45075fca479f66fb081a9bfc6bd6e8fb211
|
23a77546b39d687316a32d3c0741251588df78a3
|
/src/test/java/com/la/sell/repository/ProductInfoRepositoryTest.java
|
ba1823fb8d604cc0d49fbed719ba155a7c7d624e
|
[] |
no_license
|
AngZiZi/sell
|
1652cd08dcc4f3ad4210b024a71c0fa5acb74c70
|
7efd1594205132d378fc7b3cc781e395e9e30e7e
|
refs/heads/master
| 2020-06-17T13:19:00.983969
| 2019-07-11T00:54:58
| 2019-07-11T00:54:58
| 195,936,575
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,378
|
java
|
package com.la.sell.repository;
import com.la.sell.dataObject.ProductInfo;
import org.junit.Assert;
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.math.BigDecimal;
import java.util.List;
import static org.junit.Assert.*;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ProductInfoRepositoryTest {
@Autowired
private ProductInfoRepository repository;
@Test
public void saveTest(){
ProductInfo productInfo = new ProductInfo();
productInfo.setProductId("123456888");
productInfo.setProductName("皮蛋粥");
productInfo.setProductPrice(new BigDecimal(3));
productInfo.setProductStock(100);
productInfo.setProductDescription("很好喝的粥");
productInfo.setProductIcon("http://xxxxx.jpg");
productInfo.setProductStatus(0);
productInfo.setCategoryType(2);
ProductInfo result = repository.save(productInfo);
Assert.assertNotNull(result);
}
@Test
public void findByProductStatus() throws Exception{
List<ProductInfo> productInfoList = repository.findByProductStatus(0);
Assert.assertNotEquals(0,productInfoList.size());
}
}
|
[
"312970857@qq.com"
] |
312970857@qq.com
|
89de0726b1996162b2c036cd9767157ad015058c
|
49fa2be5086e322b381f3c5c33fc3f1f7ba278f3
|
/app/src/main/java/afeka/katz/arkadiy/minesweeper/game/data/Position.java
|
273335c88adf6eade39e59bc8bb6b118431d2823
|
[] |
no_license
|
arko-afeka/Minesweeper
|
55121e30aff931b6104bae97993aa7fe291ad1c9
|
cf999e936cf5a23fcf38a41004f4ab97335cfc81
|
refs/heads/master
| 2021-01-20T22:15:33.798990
| 2017-09-21T21:06:26
| 2017-09-21T21:06:26
| 101,809,722
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 856
|
java
|
package afeka.katz.arkadiy.minesweeper.game.data;
/**
* Created by arkokat on 8/29/2017.
*/
public class Position {
private int x;
private int y;
public Position(int x, int y) {
this.x = x;
this.y = y;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Position)) return false;
Position objPos = (Position)obj;
if (objPos.x == x && objPos.y == y) return true;
return false;
}
@Override
public String toString() {
return "Position{" +
"x=" + x +
", y=" + y +
'}';
}
@Override
public int hashCode() {
return new Integer(x).hashCode() + new Integer(y).hashCode();
}
}
|
[
"arkadiyk@mail.afeka.ac.il"
] |
arkadiyk@mail.afeka.ac.il
|
7fda28299c52facd33c3fc506235c1fcf30ed46a
|
8ba67a9dbd5594f26fd3f7ebc0f7946ca37a8dbe
|
/emf_workspace_v4.240415_DAC15/EMFsoftware/src/com/w3schools/util/W3schoolsSwitch.java
|
2f94b390361b67446586a9f967afd5dee157c6f6
|
[] |
no_license
|
munishjassi/grip_javaPrj
|
ab9191d10a29a4b49492b36feccedbb91aa70eb0
|
62749fe905169a0e8f4862999743d176b7c6bbc9
|
refs/heads/master
| 2021-01-12T08:41:40.114135
| 2016-12-16T16:07:51
| 2016-12-16T16:07:51
| 76,664,059
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 11,973
|
java
|
/**
*/
package com.w3schools.util;
import com.w3schools.*;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
/**
* <!-- begin-user-doc -->
* The <b>Switch</b> for the model's inheritance hierarchy.
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
* to invoke the <code>caseXXX</code> method for each class of the model,
* starting with the actual class of the object
* and proceeding up the inheritance hierarchy
* until a non-null result is returned,
* which is the result of the switch.
* <!-- end-user-doc -->
* @see com.w3schools.W3schoolsPackage
* @generated
*/
public class W3schoolsSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static W3schoolsPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public W3schoolsSwitch() {
if (modelPackage == null) {
modelPackage = W3schoolsPackage.eINSTANCE;
}
}
/**
* Checks whether this is a switch for the given package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @parameter ePackage the package in question.
* @return whether this is a switch for the given package.
* @generated
*/
@Override
protected boolean isSwitchFor(EPackage ePackage) {
return ePackage == modelPackage;
}
/**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
@Override
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case W3schoolsPackage.APPLICATION_TYPE: {
ApplicationType applicationType = (ApplicationType)theEObject;
T result = caseApplicationType(applicationType);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.APP_SPECIFICATIONS_TYPE: {
AppSpecificationsType appSpecificationsType = (AppSpecificationsType)theEObject;
T result = caseAppSpecificationsType(appSpecificationsType);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.DESCRIPTION: {
Description description = (Description)theEObject;
T result = caseDescription(description);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.DOCUMENT_ROOT: {
DocumentRoot documentRoot = (DocumentRoot)theEObject;
T result = caseDocumentRoot(documentRoot);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.HWMAPPING: {
Hwmapping hwmapping = (Hwmapping)theEObject;
T result = caseHwmapping(hwmapping);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.HWMAPPINGS: {
Hwmappings hwmappings = (Hwmappings)theEObject;
T result = caseHwmappings(hwmappings);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.LOOP_SPECIFICATIONS_TYPE: {
LoopSpecificationsType loopSpecificationsType = (LoopSpecificationsType)theEObject;
T result = caseLoopSpecificationsType(loopSpecificationsType);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.LOOP_TYPE: {
LoopType loopType = (LoopType)theEObject;
T result = caseLoopType(loopType);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.MOD_SPECIFICATIONS_TYPE: {
ModSpecificationsType modSpecificationsType = (ModSpecificationsType)theEObject;
T result = caseModSpecificationsType(modSpecificationsType);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.PERFORMANCE: {
Performance performance = (Performance)theEObject;
T result = casePerformance(performance);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.SUBMODULES_TYPE: {
SubmodulesType submodulesType = (SubmodulesType)theEObject;
T result = caseSubmodulesType(submodulesType);
if (result == null) result = defaultCase(theEObject);
return result;
}
case W3schoolsPackage.SUBMODULE_TYPE: {
SubmoduleType submoduleType = (SubmoduleType)theEObject;
T result = caseSubmoduleType(submoduleType);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Application Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Application Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseApplicationType(ApplicationType object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>App Specifications Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>App Specifications Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAppSpecificationsType(AppSpecificationsType object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Description</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Description</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDescription(Description object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Document Root</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Document Root</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDocumentRoot(DocumentRoot object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Hwmapping</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Hwmapping</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseHwmapping(Hwmapping object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Hwmappings</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Hwmappings</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseHwmappings(Hwmappings object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Loop Specifications Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Loop Specifications Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLoopSpecificationsType(LoopSpecificationsType object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Loop Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Loop Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLoopType(LoopType object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Mod Specifications Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Mod Specifications Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseModSpecificationsType(ModSpecificationsType object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Performance</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Performance</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePerformance(Performance object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Submodules Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Submodules Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSubmodulesType(SubmodulesType object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Submodule Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Submodule Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSubmoduleType(SubmoduleType object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch, but this is the last case anyway.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
@Override
public T defaultCase(EObject object) {
return null;
}
} //W3schoolsSwitch
|
[
"munish.jassi@gmail.com"
] |
munish.jassi@gmail.com
|
81845c1932e0abe06edeb57c7a16e9cae32ece7d
|
4d7718d0398eb680062e63723ddfdaf43a99f1d6
|
/app/src/main/java/com/ag/noreader/MainActivity.java
|
b28ba2de6d67f674a98511907ff7812648d8724a
|
[] |
no_license
|
agnunga/noreader_starter
|
e581d00ef0be2e402b61edb55b30a665424c85de
|
db4f05be02000f16d44c9e6737f31d2fdbcacbd3
|
refs/heads/master
| 2021-09-16T22:47:28.856964
| 2018-06-25T19:44:29
| 2018-06-25T19:44:29
| 115,717,656
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,398
|
java
|
package com.ag.noreader;
import android.app.Activity;
import android.app.Notification;
import android.content.ContentResolver;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.ag.noreader.img.MyTessOCR;
import java.io.File;
public class MainActivity extends MyBaseActivity {
private MyTessOCR mTessOCR;
private static final int MIN_SIZE = 5000 * 1024;
private TextView mTextMessage;
private ImageView mImageView;
private Button button1;
ImageView imageView;
TextView username;
private static final int TAKE_PICTURE = 1;
private static final int TAKE_PICTURE2 = 2;
private Uri imageUri;
public void takePhoto2(View view) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File photo = new File(Environment.getExternalStorageDirectory(), "/NoReader/CredoPic.jpg");
intent.putExtra(MediaStore.EXTRA_OUTPUT,
Uri.fromFile(photo));
imageUri = Uri.fromFile(photo);
startActivityForResult(intent, TAKE_PICTURE);
}
public void takePhoto(View view) {
//Intent intent = new Intent(CameraActivity);
// File photo = new File(Environment.getExternalStorageDirectory(), "/NoReader/CredoPic.jpg");
// intent.putExtra(MediaStore.EXTRA_OUTPUT,
// Uri.fromFile(photo));
// imageUri = Uri.fromFile(photo);
// startActivityForResult(intent, TAKE_PICTURE);
Intent intent = new Intent(this, CameraActivity.class);
EditText editText = (EditText) findViewById(R.id.input_email);
String message = editText.getText().toString();
intent.putExtra(Notification.EXTRA_MESSAGES, message);
startActivity(intent);
byte[] byteArray = getIntent().getByteArrayExtra("image");
Bitmap bitmap = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
Log.d("TAG", bitmap.getWidth()+" by "+bitmap.getHeight());
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case TAKE_PICTURE:
if (resultCode == Activity.RESULT_OK) {
Uri selectedImage = imageUri;
getContentResolver().notifyChange(selectedImage, null);
ContentResolver cr = getContentResolver();
Bitmap bitmap;
try {
bitmap = android.provider.MediaStore.Images.Media
.getBitmap(cr, selectedImage);
Log.d("TAG ", " IMAGE SIZE : "+byteSizeOf(bitmap));
if(byteSizeOf(bitmap) > MIN_SIZE){
bitmap = getScaledBitmap(bitmap);
}
Log.d("TAG ", " IMAGE SIZE AFTER : "+byteSizeOf(bitmap));
bitmap = mTessOCR.RemoveNoise(bitmap);
Log.d("TAG ", " AFTER REMOVING NOISE : "+byteSizeOf(bitmap));
imageView.setImageBitmap(bitmap);
Toast.makeText(this, selectedImage.toString(),
Toast.LENGTH_LONG).show();
mTessOCR = new MyTessOCR(MainActivity.this);
// String imageContent = mTessOCR.getOCRResult(bitmap);
String imageContent = mTessOCR.detectText(bitmap);
username.setText(imageContent);
Log.d("TAG ", " SMALLER PIC SAVED? : " +mTessOCR.saveBitmap(bitmap));
} catch (Exception e) {
Toast.makeText(this, "Failed to load", Toast.LENGTH_SHORT)
.show();
Log.e("Camera", e.toString());
}
}
}
}
public static Bitmap getScaledBitmap(Bitmap b)
{
int reqWidth = b.getWidth()/2;
int reqHeight = b.getHeight()/2;
Matrix m = new Matrix();
m.setRectToRect(new RectF(
0, 0, b.getWidth(), b.getHeight()), new RectF(0, 0, reqWidth, reqHeight), Matrix.ScaleToFit.CENTER);
Bitmap reduced_bitmap = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), m, true);
if(byteSizeOf(reduced_bitmap) > MIN_SIZE) {
return getScaledBitmap(reduced_bitmap);
} else {
return reduced_bitmap;
}
}
public static int byteSizeOf(Bitmap bitmap) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return bitmap.getAllocationByteCount();
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
return bitmap.getByteCount();
} else {
return bitmap.getRowBytes() * bitmap.getHeight();
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.image_1);
mTessOCR = new MyTessOCR(MainActivity.this);
imageView = (ImageView) findViewById(R.id.image_1);
username = (TextView) findViewById(R.id.input_email);
byte[] byteArray = getIntent().getByteArrayExtra("image");
if(byteArray != null) {
Bitmap bitmap = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
Log.d("TAG", "Image Loaded " + bitmap.getWidth() + " by " + bitmap.getHeight());
String imageContent = mTessOCR.detectText(bitmap);
Log.d("NUMBERS : ", " NUMBERS from image : " + imageContent);
username.setText(imageContent);
}else{
Log.d("TAG", "byteArray is null " );
}
/*
Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.credopic);
Bitmap image3 = BitmapFactory.decodeResource(getResources(), R.drawable.another);
String photoPath = Environment.getExternalStorageDirectory()+ "/NoReader/CredoPic.jpg";
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 8;
Bitmap image2 = BitmapFactory.decodeFile(photoPath, options);
String photoPath2 = Environment.getExternalStorageDirectory()+ "/NoReader/CredoPic.jpg";
BitmapFactory.Options options2 = new BitmapFactory.Options();
options2.inSampleSize = 8;
Bitmap image22 = BitmapFactory.decodeFile(photoPath2, options2);
String temp = mTessOCR.detectText(image);
String temp2 = mTessOCR.detectText(image2);
String temp3 = mTessOCR.detectText(image3);
Log.d("NUMBERS 1 : ", temp+" NUMBERS 2 : " + temp2+" NUMBERS 3 : " + temp3);
*/
}
public void openCam(View v){
takePhoto(v);
}
}
|
[
"agufed@fedora23.localdomain"
] |
agufed@fedora23.localdomain
|
ba67189e05bd8b2c594ed78e0732809bc97f5c26
|
40959c9abd8345ced73990ae2d3d74792e3ebae9
|
/src/main/java/br/ifpe/web2/service/ContaService.java
|
3c5d4524eefe7756c576e156d95a1b1dcf7b6f9c
|
[] |
no_license
|
francisco-nascimento/fluxofinanceiro
|
d46721a3dae4a9c53abf28e36262a2c85c994638
|
2b16f85f853a7f5f3e0ac45638c838eb7cf07985
|
refs/heads/master
| 2021-02-19T07:18:45.755223
| 2020-03-05T23:38:49
| 2020-03-05T23:38:49
| 245,289,558
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 846
|
java
|
package br.ifpe.web2.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import br.ifpe.web2.acesso.Usuario;
import br.ifpe.web2.model.Conta;
import br.ifpe.web2.persistence.ContaDAO;
@Service
public class ContaService {
@Autowired
private ContaDAO contaDAO;
public List<Conta> listarTodasContas(Usuario usuario){
// return this.contaDAO.findAll(Sort.by("nomeConta"));
return this.contaDAO.findByCriadoPor(usuario, Sort.by("nomeConta"));
}
public void inserirConta(Conta conta) {
this.contaDAO.save(conta);
}
public Conta obterContaPorCodigo(Integer codigo) {
return this.contaDAO.getOne(codigo);
}
public void removerConta(Integer codigo) {
this.contaDAO.deleteById(codigo);
}
}
|
[
"chico.nascimento@gmail.com"
] |
chico.nascimento@gmail.com
|
946688d67891f27a2a1b23cd5b0baaf1dcb484eb
|
167ea134f9b2977d4ba6da4c017f209a56ea980c
|
/MicroserviceExamples/Vid7ProductionReadyService/studentservice/src/main/java/com/lahiru/training/studentservice/service/StudentServiceImpl.java
|
1e1f164ea64848c61d7eb2e8a29f2b069ec66c77
|
[] |
no_license
|
its-lahiru/Krish_SE_training
|
a337e1089f8eeafe76921842e9bc3359fef2e55e
|
4df65542768bdeb169ee5f96a32612e0126e0606
|
refs/heads/main
| 2023-03-03T23:45:43.899261
| 2021-02-14T12:43:12
| 2021-02-14T12:43:12
| 330,018,366
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 538
|
java
|
package com.lahiru.training.studentservice.service;
import com.lahiru.training.librarycloud.commons.model.Student;
import com.lahiru.training.studentservice.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class StudentServiceImpl implements StudentService{
@Autowired
StudentRepository studentRepository;
@Override
public Student save(Student student) {
return studentRepository.save(student);
}
}
|
[
"lahirus250@gmail.com"
] |
lahirus250@gmail.com
|
5ae69aff7e74040fdf2ee4af3a3773c3a4b917eb
|
36f6943f9c94ae49c5c7d0215a7f26d256632b4a
|
/Management_Employee/src/Home/model/PhongBan.java
|
12409a12a90785c0317adc73f1cf853a5dd71103
|
[] |
no_license
|
tungnd1105/HR-Management-Software
|
5ea178f6b1cd96065ee5431eadc3d59597ddbbb4
|
67ab0c26d361dea1f4ed72be53c8f403a87e90e1
|
refs/heads/master
| 2022-04-20T02:58:17.950704
| 2020-04-20T15:59:17
| 2020-04-20T15:59:17
| 257,326,065
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 591
|
java
|
package Home.model;
public class PhongBan {
private String MaPB;
private String TenPB;
public PhongBan(){
}
public PhongBan(String MaPB,String TenPB){
this.MaPB = MaPB;
this.TenPB = TenPB;
}
public String getMaPB() {
return MaPB;
}
public String getTenPB() {
return TenPB;
}
public void setMaPB(String MaPB) {
this.MaPB = MaPB;
}
public void setTenPB(String TenPB) {
this.TenPB = TenPB;
}
@Override
public String toString() {
return TenPB;
}
}
|
[
"64002250+tungnd1105@users.noreply.github.com"
] |
64002250+tungnd1105@users.noreply.github.com
|
be88b30f9d683f0b7338cad9d186d892181e5c9f
|
379c54090aa505725e1845c24cc203e8b022f8bf
|
/NoteService/src/main/java/com/stackroute/keepnote/model/Reminder.java
|
95cb3f8648b745e438fd79ba621e9ff8917fbbb5
|
[] |
no_license
|
poojasolanki9569/KeepNoteSpring
|
9f577fdebfef6b95b92ba09be56d082413c4eed2
|
95edca7f64461a1f90643c77dc07f81fe74d9c8f
|
refs/heads/main
| 2023-05-06T17:47:09.435656
| 2021-05-31T04:56:59
| 2021-05-31T04:56:59
| 372,384,669
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,906
|
java
|
package com.stackroute.keepnote.model;
import java.util.Date;
public class Reminder {
/*
* This class should have six fields
* (reminderId,reminderName,reminderDescription,reminderType,
* reminderCreatedBy,reminderCreationDate). This class should also contain the
* getters and setters for the fields along with the no-arg , parameterized
* constructor and toString method. The value of reminderCreationDate should not
* be accepted from the user but should be always initialized with the system
* date.
*/
private String reminderId;
private String reminderName;
private String reminderDescription;
private String reminderType;
private String reminderCreatedBy;
private Date reminderCreationDate;
public Reminder() {
super();
}
public Reminder(String reminderName, String reminderDescription, String reminderType, String reminderCreatedBy,
Date reminderCreationDate) {
super();
this.reminderName = reminderName;
this.reminderDescription = reminderDescription;
this.reminderType = reminderType;
this.reminderCreatedBy = reminderCreatedBy;
this.reminderCreationDate = reminderCreationDate;
}
public Reminder(String reminderId, String reminderName, String reminderDescription, String reminderType,
String reminderCreatedBy, Date reminderCreationDate) {
super();
this.reminderId = reminderId;
this.reminderName = reminderName;
this.reminderDescription = reminderDescription;
this.reminderType = reminderType;
this.reminderCreatedBy = reminderCreatedBy;
this.reminderCreationDate = reminderCreationDate;
}
public String getReminderId() {
return reminderId;
}
public void setReminderId(String reminderId) {
this.reminderId = reminderId;
}
public String getReminderName() {
return reminderName;
}
public void setReminderName(String reminderName) {
this.reminderName = reminderName;
}
public String getReminderDescription() {
return reminderDescription;
}
public void setReminderDescription(String reminderDescription) {
this.reminderDescription = reminderDescription;
}
public String getReminderType() {
return reminderType;
}
public void setReminderType(String reminderType) {
this.reminderType = reminderType;
}
public String getReminderCreatedBy() {
return reminderCreatedBy;
}
public void setReminderCreatedBy(String reminderCreatedBy) {
this.reminderCreatedBy = reminderCreatedBy;
}
public Date getReminderCreationDate() {
return reminderCreationDate;
}
public void setReminderCreationDate(Date reminderCreationDate) {
this.reminderCreationDate = reminderCreationDate;
}
@Override
public String toString() {
return "Reminder [reminderId=" + reminderId + ", reminderName=" + reminderName + ", reminderDescription="
+ reminderDescription + ", reminderType=" + reminderType + ", reminderCreatedBy=" + reminderCreatedBy
+ ", reminderCreationDate=" + reminderCreationDate + "]";
}
// public String getReminderId() {
// return null;
// }
//
// public void setReminderId(String reminderId) {
//
// }
//
// public String getReminderName() {
// return null;
// }
//
// public void setReminderName(String reminderName) {
//
// }
//
// public String getReminderDescription() {
// return null;
// }
//
// public void setReminderDescription(String reminderDescription) {
//
// }
//
// public String getReminderType() {
// return null;
// }
//
// public void setReminderType(String reminderType) {
//
// }
//
// public String getReminderCreatedBy() {
// return null;
// }
//
// public void setReminderCreatedBy(String reminderCreatedBy) {
//
// }
//
// public Date getReminderCreationDate() {
// return null;
// }
//
// public void setReminderCreationDate(Date reminderCreationDate) {
//
// }
}
|
[
"poojasolanki9569@gmail.com"
] |
poojasolanki9569@gmail.com
|
de1d0b6d11c527437e559f480f5cedbf867b7036
|
a7110ea80e28f90d47b495ecd39cc6ef68df68a2
|
/PubHub-StarterKit/PubHub-StarterKit/src/examples/pubhub/model/Tag.java
|
2e6671a61658e9473a06d71e54360902e7afe5a0
|
[] |
no_license
|
JosephGonzalez03/Revature-Training
|
e08916cd48c3bac7e1eee5d8c7de6bc0fe82b29d
|
137acbb12c26f26cfc0ccfb12be6b7bc4a28594d
|
refs/heads/master
| 2020-03-31T23:01:04.889065
| 2018-10-13T14:19:39
| 2018-10-13T14:19:39
| 152,639,726
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 608
|
java
|
package examples.pubhub.model;
public class Tag {
private String nameTag;
private String isbn13;
// Constructor used when tag specified
public Tag(String nameTag, String isbn13) {
this.nameTag = nameTag;
this.isbn13 = isbn13;
}
// Constructor used when tag not specified
public Tag() {
this.nameTag = null;
this.isbn13 = null;
}
public String getNameTag() {
return this.nameTag;
}
public void setNameTag(String nameTag) {
this.nameTag = nameTag;
}
public String getIsbn13() {
return this.isbn13;
}
public void setIsbn13(String isbn13) {
this.isbn13 = isbn13;
}
}
|
[
"josepdg1@uci.edu"
] |
josepdg1@uci.edu
|
2641e1c07de3ea619452ece5059884416e616e89
|
0b200dc7e662f6ec73f11df8428c682c198a2dcd
|
/orm/hibernate/caveatemptor-hbm-spring/src/main/java/auction/persistence/SessionTransactionInterceptor.java
|
4192482ed4b9459ca3f13248824c7e1a1e38ff9e
|
[
"Apache-2.0"
] |
permissive
|
Tob1112/seungbeomi
|
45ea004bb1e388ccbe89eeced69da448d9b8d9cd
|
845119f6cb5d311bb376bfc9a3e688089a06e83f
|
refs/heads/master
| 2021-01-20T15:37:23.714693
| 2012-05-25T05:23:26
| 2012-05-25T05:23:26
| 41,893,041
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,735
|
java
|
package auction.persistence;
import org.aopalliance.intercept.Invocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.SessionFactory;
import org.hibernate.StaleObjectStateException;
/**
* Wraps a persistence context and a database transaction around a method call.
* <p>
* You can use this filter as-is for a thread-bound <tt>Session</tt>, set your
* <tt>hibernate.transaction.factory_class</tt> accordingly to "thread". It
* could easily be rewritten for programmatic JTA transaction demarcation with
* UserTransaction.
* <p>
* This is a more flexible alternative to a servlet filter, or most other kinds
* of interceptors. You can apply it to anything you can define an AOP pointcut
* for, which is, well, everything. Usually you would wrap this interceptor
* around a service facade method that needs a persistence context, or, in other
* words, that uses DAOs. This filter always propagates a transaction if one
* wrapped method would call another wrapped method. The persistence context is
* also propagated (bound to the thread internally). Note that you will have to
* enhance your bytecode to apply this filter to arbitrary pointcuts. See
* build.xml and META-INF/jboss-aop.xml.
* <p>
* You could rewrite this interceptor easily for a session-per-conversation
* strategy. In its given form it is best used to wrap a service method in a
* typical session-per-request application.
* <p>
* Note that you should not use this interceptor out-of-the-box with enabled
* optimistic concurrency control. Apply your own compensation logic for failed
* conversations, this is totally dependent on your applications design.
*
* @see auction.web.filter.HibernateSessionRequestFilter
* @see auction.web.filter.HibernateExtendedThreadFilter
*
* @author Christian Bauer
*/
public class SessionTransactionInterceptor {
// implements org.jboss.aop.advice.Interceptor
private static Log log = LogFactory
.getLog(SessionTransactionInterceptor.class);
private static SessionFactory sf = HibernateUtil.getSessionFactory();
public String getName() {
return "SessionTransactionInterceptor";
}
public Object invoke(Invocation invocation) throws Throwable {
try {
boolean isActive = sf.getCurrentSession().getTransaction()
.isActive();
if (!isActive) {
log.debug("Starting a database transaction");
sf.getCurrentSession().beginTransaction();
}
log.debug("Invoking the aspectized service method");
Object result = null;
// Object result = invocation.invokeNext();
// Commit and cleanup
if (!isActive) {
log.debug("Committing the database transaction");
sf.getCurrentSession().getTransaction().commit();
}
return result;
} catch (StaleObjectStateException staleEx) {
log.error("This interceptor does not implement optimistic concurrency control!");
log.error("Your application will not work until you add compensation actions!");
// Rollback, close everything, possibly compensate for any permanent
// changes
// during the conversation, and finally restart business
// conversation. Maybe
// give the user of the application a chance to merge some of his
// work with
// fresh data... what you do here depends on your applications
// design.
throw staleEx;
} catch (Throwable ex) {
// Rollback only
try {
log.warn("Trying to rollback database transaction after exception");
sf.getCurrentSession().getTransaction().rollback();
} catch (Throwable rbEx) {
log.error("Could not rollback transaction after exception!",
rbEx);
}
// Let others handle it... maybe another interceptor for exceptions?
throw ex;
}
}
}
|
[
"seungbeomi@bc4883c6-4e87-11de-8d14-a1ddb34ee23c"
] |
seungbeomi@bc4883c6-4e87-11de-8d14-a1ddb34ee23c
|
155d02eb4339b3027d23e57b30e6d0409d88d113
|
6805a91d409e737e2b9e28935f830308bfed1f86
|
/app/src/main/java/ch/beerpro/domain/models/Search.java
|
eeab1ae89e5d92a5b2bed973c4f61e6dec7ddc24
|
[] |
no_license
|
raphi7777/beerpro
|
07b5d87691652cc76e38eadc368cf94137e8c15b
|
9ed3ff29aa49970eb162ae0dc6e9438c1727a9fc
|
refs/heads/master
| 2020-03-30T20:07:56.939869
| 2018-11-08T04:45:54
| 2018-11-08T04:45:54
| 151,574,406
| 1
| 0
| null | 2018-10-04T13:17:07
| 2018-10-04T13:17:06
| null |
UTF-8
|
Java
| false
| false
| 655
|
java
|
package ch.beerpro.domain.models;
import com.google.firebase.firestore.Exclude;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import java.util.Date;
@Data
@NoArgsConstructor
@RequiredArgsConstructor
public class Search implements Entity {
public static final String COLLECTION = "searches";
public static final String FIELD_USER_ID = "userId";
public static final String FIELD_CREATION_DATE = "creationDate";
@Exclude
private String id;
@NonNull
private String userId;
@NonNull
private String term;
private Date creationDate = new Date();
}
|
[
"me@misto.ch"
] |
me@misto.ch
|
b040de379066f079e3f96d60358c3965306be2ea
|
ad6069d8cc500badda0e63b585a3522a7c341931
|
/jpaShop/src/main/java/com/jpaShop/controller/ItemController.java
|
b3d55576dfcb488106fa6039d37f18812f2b2514
|
[] |
no_license
|
pjh2688/JPA-Basic
|
1a3dee2c09dfad506ad30e3b74d52117c4b416e6
|
9d1641374104c1839300c63414ea05dfe1fa4f5b
|
refs/heads/master
| 2023-03-25T08:00:50.593855
| 2021-03-21T08:26:45
| 2021-03-21T08:26:45
| 294,321,509
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,136
|
java
|
package com.jpaShop.controller;
import java.util.List;
import javax.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import com.jpaShop.dto.Item;
import com.jpaShop.dto.item.Book;
import com.jpaShop.form.BookForm;
import com.jpaShop.service.ItemService;
import lombok.RequiredArgsConstructor;
@Controller
@RequiredArgsConstructor // 2.
public class ItemController {
// 1.
private final ItemService itemService;
// 3. 폼
@GetMapping("/items/new")
public String createForm(Model model) {
model.addAttribute("BookForm", new BookForm());
return "items/createItemForm";
}
// 4. 등록
@PostMapping("/items/new") // 5. @Valid 어노테이션이 있으면 해당 객체에 사용된 validation에 설정된 어노테이션을 실행시킨다.
public String create(@Valid BookForm form, BindingResult result) { // 6. BindingResult 객체가 @Valid어노테이션이 쓰인 위치에 매개변수로 있으면 오류 내용이 넘어와 result변수에 저장된다..(Default 에러페이지로 안넘어가고)
Book book = new Book();
// 7. 다음에는 setter를 없애고 함수로 묶어주는게 좋다.
book.setName(form.getName());
book.setPrice(form.getPrice());
book.setStockQuantity(form.getStockQuantity());
book.setAuthor(form.getAuthor());
book.setIsbn(form.getIsbn());
itemService.saveItem(book);
return "redirect:/";
}
// 8. 조회
@GetMapping("/items")
public String list(Model model) {
List<Item> items = itemService.findItems();
model.addAttribute("items", items);
return "items/itemList";
}
// 9. 수정 화면
@GetMapping("/items/{itemId}/edit") // 10. path variable
public String updateItemForm(@PathVariable("itemId") Long itemId, Model model) {
Item item =(Book)itemService.find(itemId);
Book book = (Book)item;
BookForm form = new BookForm();
form.setId(book.getId());
form.setName(book.getName());
form.setPrice(book.getPrice());
form.setStockQuantity(book.getStockQuantity());
form.setAuthor(book.getAuthor());
form.setIsbn(book.getIsbn());
model.addAttribute("BookForm", form);
return "items/updateBookForm";
}
// 10. 수정
@PostMapping("/items/{itemId}/edit") // 10. path variable
public String updateItem(@PathVariable("itemId") Long itemId, @ModelAttribute("BookForm") BookForm form) {
// 1.
// Book book = new Book();
//
// book.setId(form.getId());
// book.setName(form.getName());
// book.setPrice(form.getPrice());
// book.setStockQuantity(form.getStockQuantity());
// book.setAuthor(form.getAuthor());
// book.setIsbn(form.getIsbn());
//
// itemService.saveItem(book);
// 2.
itemService.updateItem(itemId, form.getName(), form.getPrice(), form.getStockQuantity());
return "redirect:/items";
}
}
|
[
"pjh2688@gmail.com"
] |
pjh2688@gmail.com
|
b59d1afa0142bf106c3625ae7538d21683157a4f
|
bb27d738adf03a1a870cccbdc8ee3ad779fdc2a9
|
/src/GUI/Newspaper_Search_And_View_GUI.java
|
52220e35f4584b569a0d5bad724adbde485db3d3
|
[
"MIT"
] |
permissive
|
SaranSenguttuvan/Library_Management_System
|
67b9a0006c942048487318f5dd76a7c72bc9f25f
|
1e5142d6140b77fd8d494c4ea502ee16e7ac5c67
|
refs/heads/master
| 2020-12-05T14:58:11.525549
| 2020-01-09T18:28:48
| 2020-01-09T18:28:48
| 232,146,977
| 0
| 0
| null | 2020-01-06T17:05:18
| 2020-01-06T17:05:17
| null |
UTF-8
|
Java
| false
| false
| 22,094
|
java
|
package GUI;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Extreme
*/
import DB.DB;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Vector;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.view.JasperViewer;
public class Newspaper_Search_And_View_GUI extends javax.swing.JFrame {
/**
* Creates new form Newspaper_Search_And_View_GUI
*/
String reptype;
public Newspaper_Search_And_View_GUI() {
initComponents();
setResizable(false);
jButton6.setEnabled(false);
reptype="";
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLayeredPane1 = new javax.swing.JLayeredPane();
jLayeredPane2 = new javax.swing.JLayeredPane();
DOT = new com.toedter.calendar.JDateChooser();
DOF = new com.toedter.calendar.JDateChooser();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLayeredPane3 = new javax.swing.JLayeredPane();
jScrollPane1 = new javax.swing.JScrollPane();
viewtable = new javax.swing.JTable();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jButton6 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu2 = new javax.swing.JMenu();
jMenuItem8 = new javax.swing.JMenuItem();
jMenuItem2 = new javax.swing.JMenuItem();
jMenuItem3 = new javax.swing.JMenuItem();
jMenuItem4 = new javax.swing.JMenuItem();
jMenuItem5 = new javax.swing.JMenuItem();
jMenuItem6 = new javax.swing.JMenuItem();
jMenuItem7 = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Newspaper Search And View");
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMG/title ori.jpg"))); // NOI18N
jLayeredPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Library Management System", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 24))); // NOI18N
jLayeredPane2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Newspaper Search And View", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 14))); // NOI18N
DOT.setBounds(280, 50, 170, 20);
jLayeredPane2.add(DOT, javax.swing.JLayeredPane.DEFAULT_LAYER);
DOF.setBounds(70, 50, 170, 20);
jLayeredPane2.add(DOF, javax.swing.JLayeredPane.DEFAULT_LAYER);
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMG/Search-Search-icon1`.png"))); // NOI18N
jButton1.setText("Search");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton1.setBounds(480, 50, 90, 25);
jLayeredPane2.add(jButton1, javax.swing.JLayeredPane.DEFAULT_LAYER);
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMG/view.png"))); // NOI18N
jButton2.setText("View All");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton2.setBounds(620, 50, 90, 25);
jLayeredPane2.add(jButton2, javax.swing.JLayeredPane.DEFAULT_LAYER);
jLayeredPane3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED), "View", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 14))); // NOI18N
viewtable.setFont(new java.awt.Font("Cambria", 0, 14)); // NOI18N
viewtable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Date", "Sinhala paper", "English Paper", "Number of Papers", "Price"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
};
boolean[] canEdit = new boolean [] {
false, false, true, false, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
viewtable.setToolTipText("");
viewtable.setEnabled(false);
jScrollPane1.setViewportView(viewtable);
jScrollPane1.setBounds(10, 30, 690, 260);
jLayeredPane3.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER);
jLayeredPane3.setBounds(20, 90, 710, 300);
jLayeredPane2.add(jLayeredPane3, javax.swing.JLayeredPane.DEFAULT_LAYER);
jLabel2.setText("To");
jLabel2.setBounds(250, 50, 34, 20);
jLayeredPane2.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER);
jLabel3.setText("From");
jLabel3.setBounds(30, 50, 24, 20);
jLayeredPane2.add(jLabel3, javax.swing.JLayeredPane.DEFAULT_LAYER);
jLayeredPane2.setBounds(30, 50, 750, 400);
jLayeredPane1.add(jLayeredPane2, javax.swing.JLayeredPane.DEFAULT_LAYER);
jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMG/print_icon.png"))); // NOI18N
jButton6.setText("Genarate Report");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jButton6.setBounds(70, 460, 170, 30);
jLayeredPane1.add(jButton6, javax.swing.JLayeredPane.DEFAULT_LAYER);
jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMG/reset.gif"))); // NOI18N
jButton4.setText("Reset");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jButton4.setBounds(500, 460, 90, 30);
jLayeredPane1.add(jButton4, javax.swing.JLayeredPane.DEFAULT_LAYER);
jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMG/back1.png"))); // NOI18N
jButton3.setText("Back");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jButton3.setBounds(650, 460, 80, 30);
jLayeredPane1.add(jButton3, javax.swing.JLayeredPane.DEFAULT_LAYER);
jMenu2.setText("Navigate");
jMenuItem8.setText("Home");
jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem8ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem8);
jMenuItem2.setText("Manage Members");
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem2);
jMenuItem3.setText("Manage Books");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem3);
jMenuItem4.setText("Manage Book Lending");
jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem4ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem4);
jMenuItem5.setText("Manage Inventory");
jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem5ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem5);
jMenuItem6.setText("Manage Newspaper Reocords");
jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem6ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem6);
jMenuItem7.setText("Manage User Accounts");
jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem7ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem7);
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLayeredPane1)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(2, 2, 2)
.addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 548, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width-816)/2, (screenSize.height-638)/2, 816, 638);
}// </editor-fold>//GEN-END:initComponents
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
new Search_and_View_Main_GUI().setVisible(true);
this.dispose();
}//GEN-LAST:event_jButton3ActionPerformed
private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
new Home_GUI().setVisible(true);
this.dispose();
}//GEN-LAST:event_jMenuItem8ActionPerformed
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
new Manage_Members_GUI().setVisible(true);
this.dispose();
}//GEN-LAST:event_jMenuItem2ActionPerformed
private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
new Manage_Books_GUI().setVisible(true);
this.dispose();
}//GEN-LAST:event_jMenuItem3ActionPerformed
private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
new Manage_Book_Lending().setVisible(true);
this.dispose();
}//GEN-LAST:event_jMenuItem4ActionPerformed
private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
new Manage_Inventory_GUI().setVisible(true);
this.dispose();
}//GEN-LAST:event_jMenuItem5ActionPerformed
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
new Manage_Newspaper_GUI().setVisible(true);
this.dispose();
}//GEN-LAST:event_jMenuItem6ActionPerformed
private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
new Manage_User_GUI().setVisible(true);
this.dispose();
}//GEN-LAST:event_jMenuItem7ActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
try {
DefaultTableModel tb = (DefaultTableModel) viewtable.getModel();
tb.setRowCount(0);
reptype="date";
if((DOF.getDate()==null)||(DOT.getDate()==null))
{
JOptionPane.showMessageDialog(this, "Please Choose the Date fields ", "",JOptionPane.WARNING_MESSAGE);
}
else if(DOF.getDate().compareTo(DOT.getDate())>0)
{
JOptionPane.showMessageDialog(this, "Please Choose the Date field correctly ", "",JOptionPane.WARNING_MESSAGE);
}
else
{
jButton6.setEnabled(true);
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
String DOF1=(String) dateFormat.format(DOF.getDate());
String DOT1=(String) dateFormat.format(DOT.getDate());
Connection con = DB.myCon();
Statement S = con.createStatement();
ResultSet rs1 = S.executeQuery("SELECT * FROM newspapers where Date between '"+DOF1+"' AND '"+DOT1+"'");
if(rs1.next())
{
ResultSet rs = S.executeQuery("SELECT * FROM newspapers where Date between '"+DOF1+"' AND '"+DOT1+"'");
while (rs.next())
{
Vector v = new Vector();
v.add(rs.getDate("Date"));
v.add(rs.getString("Sinhala_Paper"));
v.add(rs.getString("Sinhala_Paper"));
v.add(rs.getInt("Ammount"));
v.add(rs.getFloat("Price"));
tb.addRow(v);
}
}
else
{
JOptionPane.showMessageDialog(this, "No such Records ", "",JOptionPane.WARNING_MESSAGE);
}
}
}
catch (Exception e)
{
JOptionPane.showMessageDialog(this, ""+e.getMessage()+" Error, !","",JOptionPane.ERROR_MESSAGE);
}
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
DefaultTableModel tb = (DefaultTableModel) viewtable.getModel();
tb.setRowCount(0);
DOF.setDate(null);
DOT.setDate(null);
jButton6.setEnabled(false);
}//GEN-LAST:event_jButton4ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
try
{
DefaultTableModel tb = (DefaultTableModel) viewtable.getModel();
tb.setRowCount(0);
reptype="all";
jButton6.setEnabled(true);
DOF.setDate(null);
DOT.setDate(null);
Connection con = DB.myCon();
Statement S = con.createStatement();
ResultSet rs1 = S.executeQuery("SELECT * FROM newspapers");
if(rs1.next())
{
ResultSet rs = S.executeQuery("SELECT * FROM newspapers");
while (rs.next())
{
Vector v = new Vector();
v.add(rs.getDate("Date"));
v.add(rs.getString("Sinhala_Paper"));
v.add(rs.getString("Sinhala_Paper"));
v.add(rs.getInt("Ammount"));
v.add(rs.getFloat("Price"));
tb.addRow(v);
}
}
else
{
JOptionPane.showMessageDialog(this, "No such Records ", "",JOptionPane.WARNING_MESSAGE);
}
}
catch (Exception e)
{
JOptionPane.showMessageDialog(this, ""+e.getMessage()+" Error, !","",JOptionPane.ERROR_MESSAGE);
}
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
new Thread(new Runnable() {
@Override
public void run() {
try
{
JasperReport jr = null;
Connection con = DB.myCon();
//Map<Object, String> pp = new HashMap<Object, String>();
HashMap pp = new HashMap();
if(reptype.equals("all"))
{
jr = JasperCompileManager.compileReport("src\\Report\\allnewspapers.jrxml");
JasperPrint jp = JasperFillManager.fillReport(jr, null, con);
JasperViewer.viewReport(jp, false);
}
else if(reptype.equals("date"))
{
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
String DOF1=(String) dateFormat.format(DOF.getDate());
String DOT1=(String) dateFormat.format(DOT.getDate());
Date f=DOF.getDate();
Date t=DOF.getDate();
jr = JasperCompileManager.compileReport("src\\Report\\newspapercount.jrxml");
pp.put("from", DOF1);
pp.put("to", DOT1);
JasperPrint jp = JasperFillManager.fillReport(jr, pp,con);
JasperViewer.viewReport(jp, false);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
}//GEN-LAST:event_jButton6ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Newspaper_Search_And_View_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Newspaper_Search_And_View_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Newspaper_Search_And_View_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Newspaper_Search_And_View_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Newspaper_Search_And_View_GUI().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private com.toedter.calendar.JDateChooser DOF;
private com.toedter.calendar.JDateChooser DOT;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton6;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLayeredPane jLayeredPane1;
private javax.swing.JLayeredPane jLayeredPane2;
private javax.swing.JLayeredPane jLayeredPane3;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JMenuItem jMenuItem6;
private javax.swing.JMenuItem jMenuItem7;
private javax.swing.JMenuItem jMenuItem8;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable viewtable;
// End of variables declaration//GEN-END:variables
}
|
[
"janakapod@yahoo.com"
] |
janakapod@yahoo.com
|
fc8cdcab4efcc9b162c89dbcb684c816f5ea8490
|
9275b34aae96fab02d10ecf905141b44af4bf11b
|
/instrumentation/src/test/java/eu/mikroskeem/test/shuriken/instrumentation/testclasses/TestTransformable5.java
|
ed58f449a338fc0c5f15d4ab2a56234ac2f31352
|
[
"MIT"
] |
permissive
|
mikroskeem/Shuriken
|
ff9063dcdd741131918704a7813dd52c0f345dec
|
d35ce7eab021da24dccfaf072a1463ada8f914ef
|
refs/heads/master
| 2021-01-19T02:26:59.864013
| 2018-03-22T19:40:43
| 2018-03-22T19:40:43
| 87,278,496
| 6
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 356
|
java
|
package eu.mikroskeem.test.shuriken.instrumentation.testclasses;
import java.util.Properties;
/**
* @author Mark Vainomaa
*/
public class TestTransformable5 {
private String foundProperty;
public void testProperty() {
Properties properties = System.getProperties();
foundProperty = properties.getProperty("java.home");
}
}
|
[
"mikroskeem@mikroskeem.eu"
] |
mikroskeem@mikroskeem.eu
|
1b399f8ddff8e3f484142f5f940996929aded282
|
d23dfd7e9b84df5ac252537df1d2d6c8fded1e3b
|
/PMClient/lib_pm/src/main/java/com/wisn/pmlib/utils/FileUtilsOld.java
|
112c7046af8a8234e0ff90606c6e1d963b394ceb
|
[] |
no_license
|
wisn-mirror/AMClient
|
3838b866978bc4f5cfb883ee166544b8e7e09ea7
|
0614bf0d2af1aab1308a31f6041ff7ff61b28c71
|
refs/heads/master
| 2021-01-12T12:42:11.003621
| 2017-12-29T13:43:38
| 2017-12-29T13:43:38
| 69,642,728
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,098
|
java
|
package com.wisn.pmlib.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
/**
* <b>Create Date:</b> 2016/9/21<br>
* <b>Author:</b> Wisn(吴贻顺)<br>
* <b>Description:</b>
* <p>
* <br>
*/
public class FileUtilsOld {
public static int copy(String fromFile, String toFile) {
//要复制的文件目录
File[] currentFiles;
File root = new File(fromFile);
//如同判断SD卡是否存在或者文件是否存在
//如果不存在则 return出去
if (!root.exists()) {
return -1;
}
//如果存在则获取当前目录下的全部文件 填充数组
currentFiles = root.listFiles();
//目标目录
File targetDir = new File(toFile);
//创建目录
if (!targetDir.exists()) {
targetDir.mkdirs();
}
//遍历要复制该目录下的全部文件
for (int i = 0; i < currentFiles.length; i++) {
if (currentFiles[i].isDirectory())//如果当前项为子目录 进行递归
{
copy(currentFiles[i].getPath() + "/", toFile + currentFiles[i].getName() + "/");
} else//如果当前项为文件则进行文件拷贝
{
CopySdcardFile(currentFiles[i].getPath(), toFile + currentFiles[i].getName());
}
}
return 0;
}
/**
* 文件拷贝
* @param fromFile
* @param toFile
* @return
*/
public static int CopySdcardFile(String fromFile, String toFile) {
try {
InputStream fosfrom = new FileInputStream(fromFile);
OutputStream fosto = new FileOutputStream(toFile);
byte bt[] = new byte[1024];
int c;
while ((c = fosfrom.read(bt)) > 0) {
fosto.write(bt, 0, c);
}
fosfrom.close();
fosto.close();
return 0;
} catch (Exception ex) {
return -1;
}
}
}
|
[
"wuyishun_kmk@outlook.com"
] |
wuyishun_kmk@outlook.com
|
4fb8f9aa94665eb902e428cca70e546c37a2a9eb
|
2e810b5a6085eaa9359f13996ffee90d9c5130a7
|
/app/src/main/java/edu/buffalo/cse/cse486586/groupmessenger1/DatabaseHelper.java
|
f3952435f383c187ffa5f06eab5edaf0afefd8ac
|
[] |
no_license
|
amcs1729/Basic-Group-Text-Messenger
|
adb625d5a522224420510f4c444fb1923b012422
|
c18cb9b776e4143bd58da883bc9ebf4e68c1167b
|
refs/heads/master
| 2021-07-16T02:27:26.369174
| 2017-10-10T07:05:14
| 2017-10-10T07:05:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,274
|
java
|
package edu.buffalo.cse.cse486586.groupmessenger1;
/**
* Created by sumedh on 2/21/17.
* Reference: https://developer.android.com/training/basics/data-storage/databases.html
*/
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class DatabaseHelper extends SQLiteOpenHelper {
public static final String TABLE_Name = "Messages";
public static final String COLUMN_KEY = "key";
public static final String COLUMN_VALUE = "value";
private static final String DATABASE_NAME = "Messages.db";
private static final int DATABASE_VERSION = 1;
private static final String DATABASE_CREATE =
"CREATE TABLE " + TABLE_Name + " (" +
COLUMN_KEY + " TEXT, " +
COLUMN_VALUE + " TEXT);";
public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase database) {
database.execSQL(DATABASE_CREATE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_Name);
onCreate(db);
}
}
|
[
"sumedh0192@gmail.com"
] |
sumedh0192@gmail.com
|
a2d5ab9262bb926f028d558c0f60bc6a95034f8f
|
a6fd4b8bc6f7f2a379f65b3ab29e328cc99626f7
|
/PigDropDiamond/src/PigDrop.java
|
40389de79548b30ec142836182b14c8da73fe4b8
|
[] |
no_license
|
kumakichi/forge-1.8-mods
|
9bf0d5685696e27f1e946c5b9e9b7690311b63fc
|
e4f8056a4f198db8d9b902e6669c8d19b47f9f7d
|
refs/heads/master
| 2021-01-25T05:16:06.717369
| 2015-06-10T07:57:26
| 2015-06-10T07:57:26
| 37,183,191
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,114
|
java
|
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.init.Items;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.util.Random;
/**
* Created by san on 5/25/15.
*/
@Mod(modid = PigDrop.MODID, version = PigDrop.MODVER)
public class PigDrop {
public static final String MODID = "PigDiamond";
public static final String MODVER = "1.0";
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(new PigDrop());
}
@SubscribeEvent
public void dropDiamonds(LivingDeathEvent event) { //which happens when an entity dies
if (!(event.entity instanceof EntityPig))
return;
Random random = new Random();
if(!event.entity.worldObj.isRemote) // not a client world
event.entity.dropItem(Items.diamond, random.nextInt(3));
}
}
|
[
"xbapj1@gmail.com"
] |
xbapj1@gmail.com
|
57da37bb0262a083fec6b390a9a24dbeadf5352b
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/3/3_4cd8a69f6192f2d8f84b9f96771db798e04f1b40/StudyController/3_4cd8a69f6192f2d8f84b9f96771db798e04f1b40_StudyController_s.java
|
4198e115e2428cfd8a5210be1062ffb738631b22
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 5,907
|
java
|
package usask.hci.fastdraw;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
public class StudyController {
private final String[][][] mTrials;
private final StudyLogger mLog;
private int mTrialNum;
private int mTrialIndex;
private int mBlockNum;
private int mSetIndex;
private Set<String> mToSelect;
private Integer[] mTrialOrder;
private long mTrialStart;
private int mNumErrors;
private StringBuilder mErrors;
private int[] mBlocksPerSet;
private int mTimesPainted;
private boolean mFinished;
private long mUITime;
private boolean mWaiting;
private int mNumWaitDots;
public boolean shouldPause;
public StudyController(StudyLogger logger) {
mLog = logger;
mTrials = new String[][][] {
{{"Paintbrush"}, {"Line"}, {"Circle"}, {"Rectangle"},
{"Black"}, {"Red"}, {"Green"}, {"Blue"},
{"White"}, {"Yellow"}, {"Cyan"}, {"Magenta"},
{"Fine"}, {"Thin"}, {"Normal"}, {"Wide"}},
{{"Normal", "Circle"},
{"Blue", "Rectangle"},
{"Fine", "White"},
{"Wide", "Line"},
{"Cyan", "Paintbrush"},
{"Fine", "Green"},
{"Yellow", "Paintbrush"},
{"Magenta", "Circle"},
{"Normal", "Red"},
{"Thin", "Black"}},
{{"Normal", "Red", "Line"},
{"Thin", "Yellow", "Rectangle"},
{"Fine", "White", "Circle"},
{"Wide", "Magenta", "Line"},
{"Normal", "Cyan", "Paintbrush"},
{"Fine", "Green", "Rectangle"},
{"Wide", "White", "Paintbrush"},
{"Normal", "Blue", "Circle"},
{"Wide", "Yellow", "Line"},
{"Thin", "Black", "Paintbrush"}}
};
mBlocksPerSet = new int[] { 5, 5, 5 };
mSetIndex = 0;
mBlockNum = 0;
mFinished = false;
shouldPause = false;
mWaiting = false;
mNumWaitDots = 0;
nextBlock();
}
public void waitStep() {
if (!mWaiting) {
mWaiting = true;
} else if (mNumWaitDots == 3) {
mWaiting = false;
mNumWaitDots = 0;
mTrialStart = System.nanoTime();
} else {
mNumWaitDots++;
}
}
public boolean isFinished() {
return mFinished;
}
public long getTrialStart() {
return mTrialStart;
}
public int getNumSets() {
return mTrials.length;
}
public int getNumBlocks(int set) {
return mBlocksPerSet[set - 1];
}
public void setSetNum(int set) {
mSetIndex = set - 2;
nextSet();
}
public void setBlockNum(int block) {
mBlockNum = block - 1;
nextBlock();
}
public void incrementTimesPainted() {
mTimesPainted++;
}
// Return whether the selection was one of the current targets.
public boolean handleSelected(String selection, boolean gesture) {
if (mFinished)
return false;
if (mToSelect.contains(selection)) {
mToSelect.remove(selection);
if (mToSelect.isEmpty()) {
long now = System.nanoTime();
int numTargets = mTrials[mSetIndex][mTrialIndex].length;
StringBuilder targetString = new StringBuilder();
for (int i = 0; i < numTargets; i++) {
if (i != 0)
targetString.append(",");
targetString.append(mTrials[mSetIndex][mTrialIndex][i]);
}
if (gesture) {
mLog.gestureTrial(now, mSetIndex + 1, mBlockNum, mTrialNum, mTrials[mSetIndex][mTrialIndex].length,
targetString.toString(), mNumErrors, mErrors.toString(),
mTimesPainted, mUITime, now - mTrialStart);
} else {
mLog.chordTrial(now, mSetIndex + 1, mBlockNum, mTrialNum, mTrials[mSetIndex][mTrialIndex].length,
targetString.toString(), mNumErrors, mErrors.toString(),
mTimesPainted, mUITime, now - mTrialStart);
}
nextTrial();
}
return true;
} else {
if (mNumErrors != 0)
mErrors.append(",");
mErrors.append(selection);
mNumErrors++;
return false;
}
}
public void addUITime(long duration) {
mUITime += duration;
}
public String getPrompt() {
return getPrompt(false);
}
public String getPrompt(boolean hideTarget) {
if (mFinished)
return "You are finished!";
String progress = "#" + mBlockNum + " (" + mTrialNum + "/" + mTrials[mSetIndex].length + ")";
if (mWaiting) {
StringBuilder dots = new StringBuilder("");
for (int i = 0; i < mNumWaitDots; i++)
dots.append(".");
return progress + " Please select: " + dots;
}
StringBuilder title = new StringBuilder(progress + " Please select: ");
if (hideTarget)
return title.toString();
for (String toSelect : mToSelect) {
title.append(toSelect);
title.append(", ");
}
return title.substring(0, title.length() - 2);
}
private void nextSet() {
if (mSetIndex == mTrials.length - 1) {
mFinished = true;
return;
}
mSetIndex++;
mBlockNum = 0;
nextBlock();
}
private void nextBlock() {
if (mBlockNum >= mBlocksPerSet[mSetIndex]) {
nextSet();
return;
}
mTrialOrder = new Integer[mTrials[mSetIndex].length];
for (int i = 0; i < mTrialOrder.length; i++)
mTrialOrder[i] = i;
Collections.shuffle(Arrays.asList(mTrialOrder));
mBlockNum++;
mTrialNum = 0;
nextTrial();
shouldPause = true;
}
private void nextTrial() {
if (mTrialNum >= mTrials[mSetIndex].length) {
nextBlock();
return;
}
mTrialStart = System.nanoTime();
mUITime = 0;
mNumErrors = 0;
mTimesPainted = 0;
mErrors = new StringBuilder();
mTrialIndex = mTrialOrder[mTrialNum];
mTrialNum++;
mToSelect = new LinkedHashSet<String>(Arrays.asList(mTrials[mSetIndex][mTrialIndex]));
}
public boolean isOnLastTarget() {
return mToSelect.size() == 1;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
1344f036ca3d88c5df684aef70e206c8e79b5499
|
03a23c3e3e7004c85f54d31669c59774f9e58d33
|
/LearnSelenium/src/ListEx.java
|
056665511468ffbd852dbe60d62b64179ce32886
|
[] |
no_license
|
nshukla1202/HealthCare-Repository
|
68e8a9c715d9196e7e533040a34a3621e70a2e02
|
841dfa30ae175ada3d5d1904d93488c7b9f85842
|
refs/heads/master
| 2021-05-19T13:30:21.299687
| 2020-05-24T21:55:00
| 2020-05-24T21:55:00
| 251,723,920
| 0
| 0
| null | 2020-10-14T00:33:25
| 2020-03-31T20:30:12
|
HTML
|
UTF-8
|
Java
| false
| false
| 354
|
java
|
import java.util.ArrayList;
import java.util.List;
public class ListEx {
public static void main(String[] args) {
List<String> list=new ArrayList<String>();
list.add("abc");
list.add("def");
list.add("abc");
System.out.println("The number of elements:::"+list.size());
System.out.println(list.get(0));
}
}
|
[
"nshukla1202@gmail.com"
] |
nshukla1202@gmail.com
|
08d32675e9bccdea064f11e4c27464b86c0ede5c
|
621636fcf91d28eee01da87b2cd2a28a5f351ccc
|
/webwork/com/opensymphony/webwork/views/velocity/components/CheckBoxDirective.java
|
49bec20131218b5ee91e68ac665d2b7e3b03591a
|
[] |
no_license
|
lxwuchang/dtyd
|
49ed56770ee700e519f40c62e2e7ca13157351b1
|
b05eb117a88768f1fb0b7a7852a097919d710f7a
|
refs/heads/master
| 2021-01-10T07:42:52.207157
| 2016-03-17T12:43:15
| 2016-03-17T12:43:15
| 54,115,985
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 625
|
java
|
package com.opensymphony.webwork.views.velocity.components;
import com.opensymphony.webwork.components.Checkbox;
import com.opensymphony.webwork.components.Component;
import com.opensymphony.xwork.util.OgnlValueStack;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @see Checkbox
*/
public class CheckBoxDirective extends AbstractDirective {
protected Component getBean(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) {
return new Checkbox(stack, req, res);
}
public String getBeanName() {
return "checkbox";
}
}
|
[
"lxwuchang@qq.com"
] |
lxwuchang@qq.com
|
2cb38a47fe75f78efaa57f1d832c0956039511f4
|
be59c0ca127a4f7041758b2709e1327bc71b6e12
|
/qipai/game-mj-dehmj/src/main/java/com/sy599/game/qipai/dehmj/constant/DehMjAction.java
|
fb4aed5eb054dca0f7e56161ae286f3d020de819
|
[] |
no_license
|
Yiwei-TEST/xxqp-server
|
2389dd6b12614b0a9557d59b473f88a3a59620cf
|
c2c683ce8060c0cbaee86c3ee550e0195e1bb7e4
|
refs/heads/main
| 2023-08-14T08:49:37.586893
| 2021-09-15T03:21:13
| 2021-09-15T03:21:13
| 401,583,086
| 1
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,992
|
java
|
package com.sy599.game.qipai.dehmj.constant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class DehMjAction {
public static final int ACTION_SIZE = 18;
/*** 胡*/
public static final int HU = 0;
/*** 碰*/
public static final int PENG =1;
/*** 明杠*/
public static final int MINGGANG = 2;
/*** 暗杠*/
public static final int ANGANG = 3;
/*** 吃*/
public static final int CHI = 4;
/*** 补张*/
public static final int BUZHANG = 5;
/*** 缺一色*/
public static final int QUEYISE = 6;
/*** 暗杠补张*/
public static final int BUZHANG_AN = 16;
/**报听*/
public static final int BaoTING =10;
/*** 自摸*/
public static final int ZIMO = 0;
/*** 大胡自摸*/
public static final int ACTION_COUNT_DAHU_ZIMO = 0 ;
/*** 小胡自摸*/
public static final int ACTION_COUNT_XIAOHU_ZIMO = 1;
/*** 大胡点炮*/
public static final int ACTION_COUNT_DAHU_DIANPAO = 2;
/*** 小胡点炮*/
public static final int ACTION_COUNT_XIAOHU_DIANPAO = 3;
/*** 大胡接炮*/
public static final int ACTION_COUNT_DAHU_JIEPAO = 4;
/*** 小胡接炮*/
public static final int ACTION_COUNT_XIAOHU_JIEPAO = 5;
/** 小胡展示的优先级*/
public static final List<Integer> xiaoHuPriority = Arrays.asList(QUEYISE);
private int [] arr;
public DehMjAction(){
this.arr = new int[ACTION_SIZE];
}
public int[] getArr(){
return arr;
}
public void addHu() {
setVal(HU);
}
public void addPeng() {
setVal(PENG);
}
public void addMingGang() {
setVal(MINGGANG);
}
public void addAnGang() {
setVal(ANGANG);
}
public void addChi() {
setVal(CHI);
}
public void addBuZhang() {
setVal(BUZHANG);
}
public void addQueYiSe() {
setVal(QUEYISE);
}
public void addBuZhangAn(){
setVal(BUZHANG_AN);
}
public void addZiMo(){
setVal(ZIMO);
}
public void addBaoting() {
setVal(BaoTING);
}
public void setVal(int action){
arr[action] = 1 ;
}
/**
* 从可操作列表中提出第一个小胡
* @param actList
* @return
*/
public static int getFirstXiaoHu(List<Integer> actList){
for(int index : xiaoHuPriority){
if(actList.get(index) == 1){
return index;
}
}
return -1;
}
/**
* 是否有胡操作
*
* @param actionList
* @return
*/
public static boolean hasHu(List<Integer> actionList) {
return hasAction(actionList, DehMjAction.HU) || hasAction(actionList,ZIMO);
}
/**
* 是否有操作
*
* @param actionList
* @param action 操作
* @return
*/
private static boolean hasAction(List<Integer> actionList, int action) {
if (actionList != null && actionList.size() > action) {
return actionList.get(action) == 1;
}
return false;
}
/**
* 只保留胡操作
*
* @param actionList
* @return
*/
public static List<Integer> keepHu(List<Integer> actionList) {
if (actionList == null || actionList.size() < HU + 1) {
return Collections.EMPTY_LIST;
}
List<Integer> res = new ArrayList<>();
for (int i = 0; i < actionList.size(); i++) {
if (i == HU) {
res.add(actionList.get(i));
} else {
res.add(0);
}
}
return res;
}
/* *//**
* 是否是起手小胡
* @param xiaoHu
* @return
*//*
public static boolean isQiShouXiaoHu(int xiaoHu){
if(xiaoHu == ZHONGTUSIXI || xiaoHu == ZHONGTULIULIUSHUN){
return false;
}
return true;
}*/
}
|
[
"ee68i5@yeah.net"
] |
ee68i5@yeah.net
|
f1729686cf061124105f1f9b1461b219229e1c04
|
5d532f6a69f5d8614b23369091c96fcb587abf0d
|
/app/src/androidTest/java/com/example/crypt/ExampleInstrumentedTest.java
|
4a8539ab027d264babb000df7e772d161f7ab7c7
|
[] |
no_license
|
Ainzerhald/Crypt
|
0977022f9196f90ae1a7f9eaf49738cb576ddce1
|
8ed22aae971e748052cdb85de99cb0969a9328e5
|
refs/heads/master
| 2023-05-13T16:09:28.586177
| 2021-03-17T12:24:50
| 2021-03-17T12:24:50
| 338,131,616
| 1
| 0
| null | 2021-03-18T17:35:04
| 2021-02-11T19:32:46
|
Java
|
UTF-8
|
Java
| false
| false
| 748
|
java
|
package com.example.crypt;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.crypt", appContext.getPackageName());
}
}
|
[
"89225940713@mail.ru"
] |
89225940713@mail.ru
|
dd55dc3920f1b6c073e44d3fada396a4505ea7b8
|
71df1b58940d3f569e265744632e9515c469a82c
|
/src/sesion18/ICalculadoraLambda.java
|
6aca5041ea2fc9d7d61e4a61b30e4e9f35bcd358
|
[] |
no_license
|
PamelaGuerreroF/h
|
2c4680efe85fa17d2f3c9af7cb369099033b8402
|
359abeab8a8aa65d91c9269bc68abc5398083bf2
|
refs/heads/master
| 2022-07-31T10:42:52.914765
| 2020-05-16T17:28:33
| 2020-05-16T17:28:33
| 264,500,746
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 164
|
java
|
package sesion18;
/**
*
* @author asyou_000
*/
@FunctionalInterface
public interface ICalculadoraLambda {
public int operacion(int x, int y);
}
|
[
"asyou_000@Lenovo-PC"
] |
asyou_000@Lenovo-PC
|
cb4f59f19f2f1989d137611e3855bc166e205336
|
f03d7fb28b4514937bc6d52b92812750dbb43b2b
|
/Android3DEmys/src/uk/ac/hw/lirec/emys3d/EmysModel.java
|
51e7da6f0153b6cc61da19e61ac33879b4b19431
|
[] |
no_license
|
emote-project/Migration-App
|
10fdc366261b4c2e25866925e7bab3ac837f2ae8
|
c9bb60e8b701dac452d5e19fbbcd7c385a458f86
|
refs/heads/master
| 2016-08-11T07:51:42.621498
| 2016-02-29T14:10:25
| 2016-02-29T14:10:25
| 51,437,161
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 14,295
|
java
|
package uk.ac.hw.lirec.emys3d;
import min3d.core.GlMaterial;
import min3d.core.Object3dContainer;
import min3d.vos.Number3d;
import android.util.Log;
/**
* @author iw24
* Class to store the EmysModel and build the hierarchy.
* Construct it with a parsed model of emys, then add the base
* to the scene to use it.
*/
public class EmysModel {
public enum Emotion {
NEUTRAL ("neutral",0,0,0,0,0,0,0,5),
ANGER ("anger",30,0,20,-10,0,0,10,100),
JOY ("joy",0,0,0,5,10,0,0,5),
SADNESS ("sadness",-40,0,0,0,0,30,0,5),
SURPRISE ("surprise",0,20,5,10,10,0,10,100),
SLEEP ("sleep",0,0,45,0,0,5,0,100);
public final float eyeRoll, eyesOut, eyesOpen, upperAngle, lowerAngle, bow,move,blinkRate;
private final String mName;
//IMPORTANT no scaling here, as it'll happen when emotion is set
Emotion(String name, float mEyeRoll, float mEyesOut, float mEyesOpen,
float mUpperAngle, float mLowerAngle, float mBow, float mMove, float rate) {
eyeRoll = mEyeRoll;
eyesOut = mEyesOut;
eyesOpen = mEyesOpen;
upperAngle = mUpperAngle;
lowerAngle = mLowerAngle;
bow = mBow;
move = mMove;
blinkRate = rate;
mName = name;
}
public String getName() {
return mName;
}
public static Emotion getEmotion(String em) {
for (Emotion retEm : Emotion.values() ){
if (retEm.mName.equalsIgnoreCase(em)) return retEm;
}
//otherwise neutral
return Emotion.NEUTRAL;
}
}
// The components, formatting mirrors hierarchy.
public Object3dContainer
base,
neck,
headcentre,
top,
bottom,
middle,
nose,
stalkL,
ballL,
lidL,
stalkR,
ballR,
lidR;
/*
* Some fields for controlling animation.
* These define the target state for the components.
*/
private float mEyeRoll, mEyesOut, mEyesOpen, mUpperAngle, mLowerAngle, mBow;
// This one's a bit different, as it defines how much random movement to add in.
//sets a maximum bound on rotation from ideal plane
private float mMove;
private Number3d mBobCur = new Number3d(0,0,0),
mBobTarget = new Number3d(0,0,0); //this will store degrees rotation really.
//max time in seconds between a blink
private float mBlinkRate = 5;
private long mNextBlink;
private float mEyesBeforeBlink;
private boolean mBlinking = false;
private Emotion mCurEmotion = Emotion.NEUTRAL;
private long mTimeLastFrame;
//todo used for speech
private boolean mSpeaking = false;
private boolean mOpening = true;
private float mLowerBeforeSpeak;
//speeds of rotation should be in degrees/second
private static final float
EYELID_ROT_SPEED = 90,
EYELID_OPEN_SPEED = 720,
HEAD_PART_SPEED = 90,
BOB_SPEED = 7, //speed for random head movement
EYES_OUT_SPEED = 120, //units/second
EYES_OUT_SCALE = 0.7f, //scale to use same units as desktop as input
EYES_CLOSED_ANGLE = -45, //how much to blink the eyes.
MOUTH_OPEN_ANGLE = -5f, ///used for speaking
MOUTH_CLOSED_ANGLE = 5f;
public EmysModel(Object3dContainer parsed) {
buildEmys(parsed);
}
public void selectEmotion(EmysModel.Emotion em) {
setEmotion(em.eyeRoll, em.eyesOut, em.eyesOpen, em.upperAngle, em.lowerAngle, em.bow, em.move, em.blinkRate);
mCurEmotion = em;
}
public Emotion getEmotion() {
return mCurEmotion;
}
//set an emotion directly
//IMPORTANT this may be called from a different thread to the renderer, so be CAREFUL.
public void setEmotion(float eyeRoll, float eyesOut, float eyesOpen,
float upperAngle, float lowerAngle, float bow, float move, float blinkrate) {
this.mEyeRoll = eyeRoll;
this.mEyesOut = eyesOut*EYES_OUT_SCALE;
this.mEyesOpen = -eyesOpen;
this.mUpperAngle = upperAngle;
this.mLowerAngle = -lowerAngle;
this.mBow = -bow;
this.mMove = move*0.8f;
this.mNextBlink = System.currentTimeMillis() + (long)(Math.random()*mBlinkRate*1000);
this.mBlinkRate = blinkrate;
}
/**
* This should be called in the animation loop.
*/
public void updateAnimation () {
long timeElapsed = System.currentTimeMillis() - mTimeLastFrame;
mTimeLastFrame = System.currentTimeMillis();
updateBlink();
updateSpeaking();
updateEyeRoll(timeElapsed);
updateEyesOut(timeElapsed);
updateEyesOpen(timeElapsed);
updateUpper(timeElapsed);
updateLower(timeElapsed);
updateBowHead(timeElapsed);
updateMove(timeElapsed);
}
public void startSpeaking() {
if (!mSpeaking) {
mLowerBeforeSpeak = mLowerAngle;
}
mSpeaking = true;
Log.v("EMYS","START SPEAKING ENDS");
}
public void stopSpeaking() {
mSpeaking = false;
mLowerAngle = mLowerBeforeSpeak;
Log.v("EMYS","STOP SPEAKING");
}
private void updateSpeaking() {
if (mSpeaking) {
//either need to open mouth, close if open
if (bottom.rotation().x == mLowerAngle) {
mOpening = !mOpening;
}
if (mOpening) {
mLowerAngle = MOUTH_OPEN_ANGLE;
}else {
//closing
mLowerAngle = MOUTH_CLOSED_ANGLE;
}
}
//otherwise we're we're waiting to blink.
}
private void updateBlink() {
// either waiting to blink, just blinked or blinking shut/open
if ((!mBlinking) && (System.currentTimeMillis() > mNextBlink)) {
//time to setup a blink
mEyesBeforeBlink = mEyesOpen;
mEyesOpen = EYES_CLOSED_ANGLE;
mBlinking = true;
} else if (mBlinking) {
//either still blinking down, or need to set to back up.
if (lidR.rotation().x == mEyesOpen) {
//we've closed the eyes, so make them open and prepare for next blink
mEyesOpen = mEyesBeforeBlink;
mNextBlink = System.currentTimeMillis() + (long)(Math.random()*mBlinkRate*1000);
mBlinking = false;
}
}
//otherwise we're we're waiting to blink.
}
/**
* @param timeElapsed time since last frame
* move head randomly, one frame.
*/
private void updateMove(long timeElapsed) {
// want to bob about X,Y
float increment = BOB_SPEED * (timeElapsed/1000.0f);
float currentX = mBobCur.x;
float currentY = mBobCur.y;
//remove the old angle
headcentre.rotation().x -= mBobCur.x;
headcentre.rotation().y -= mBobCur.y;
if (mBobCur.equals(mBobTarget)) {
//set target back to 0,0
mBobTarget.setAll(0, 0, 0);
if ( (mMove > 0) && (mBobCur.equals(mBobTarget)) ){
mBobTarget.x = (float) (Math.random()*mMove);
mBobTarget.y = (float) (Math.random()*mMove);
}
}
else {
if (currentX < mBobTarget.x) {
mBobCur.x += increment;
if (mBobCur.x > mBobTarget.x) mBobCur.x = mBobTarget.x;
}
//greater than case
else {
mBobCur.x -= increment;
if (mBobCur.x < mBobTarget.x) mBobCur.x = mBobTarget.x;
}
if (currentY < mBobTarget.y) {
mBobCur.y += increment;
if (mBobCur.y > mBobTarget.y) mBobCur.y = mBobTarget.y;
}
//greater than case
else {
mBobCur.y -= increment;
if (mBobCur.y < mBobTarget.y) mBobCur.y = mBobTarget.y;
}
}
//set the head to angle the delta
headcentre.rotation().x += mBobCur.x;
headcentre.rotation().y += mBobCur.y;
}
/**
* @param timeElapsed time since last frame
* bow head one frame.
*/
private void updateBowHead(long timeElapsed) {
float increment = HEAD_PART_SPEED * (timeElapsed/1000.0f);
float current = headcentre.rotation().x;
if (current == mBow)
return;
else if (current < mBow) {
headcentre.rotation().x += increment;
if (headcentre.rotation().x > mBow) headcentre.rotation().x = mBow;
}
//greater than case
else {
headcentre.rotation().x -= increment;
if (headcentre.rotation().x < mBow) headcentre.rotation().x = mBow;
}
}
/**
* @param timeElapsed time since last frame
* roll the eyes one frame.
*/
private void updateEyeRoll(long timeElapsed) {
// value in mEyeRoll is target for right eye z rotate
float increment = EYELID_ROT_SPEED * (timeElapsed/1000.0f);
float current = lidR.rotation().z;
if (current == mEyeRoll)
return;
else if (current < mEyeRoll) {
lidR.rotation().z += increment;
lidL.rotation().z += -increment;
if (lidR.rotation().z > mEyeRoll) {
lidR.rotation().z = mEyeRoll;
lidL.rotation().z = -mEyeRoll;
}
}
//greater than case
else {
lidR.rotation().z -= increment;
lidL.rotation().z -= -increment;
if (lidR.rotation().z < mEyeRoll) {
lidR.rotation().z = mEyeRoll;
lidL.rotation().z = -mEyeRoll;
}
}
}
/**
* @param timeElapsed time since last frame
* extend the eyes one frame.
*/
private void updateEyesOut(long timeElapsed) {
float increment = EYES_OUT_SPEED * (timeElapsed/1000.0f);
float current = stalkR.position().z;
//add the local O and subtract parent
//-eyes out for axis
if (current == (-mEyesOut + stalkR.getLocalO().z - middle.getLocalO().z))
return;
else if (current < (-mEyesOut + stalkR.getLocalO().z - middle.getLocalO().z)) {
stalkR.position().z += increment;
stalkL.position().z += increment;
if (stalkR.position().z > (-mEyesOut + stalkR.getLocalO().z - middle.getLocalO().z)) {
stalkR.position().z = (-mEyesOut + stalkR.getLocalO().z - middle.getLocalO().z);
stalkL.position().z = (-mEyesOut + stalkL.getLocalO().z - middle.getLocalO().z);
}
}
//greater than case
else {
stalkR.position().z -= increment;
stalkL.position().z -= increment;
if (stalkR.position().z < (-mEyesOut + stalkR.getLocalO().z - middle.getLocalO().z)) {
stalkR.position().z = (-mEyesOut + stalkR.getLocalO().z - middle.getLocalO().z);
stalkL.position().z = (-mEyesOut + stalkL.getLocalO().z - middle.getLocalO().z);
}
}
}
/**
* @param timeElapsed time since last frame
* roll the eyes one frame.
*/
private void updateEyesOpen(long timeElapsed) {
// value in mEyeOpen is target for right eye x rotate
float increment = EYELID_OPEN_SPEED * (timeElapsed/1000.0f);
float current = lidR.rotation().x;
if (current == mEyesOpen)
return;
else if (current < mEyesOpen) {
lidR.rotation().x += increment;
lidL.rotation().x += increment;
if (lidR.rotation().x > mEyesOpen) lidR.rotation().x = mEyesOpen;
if (lidL.rotation().x > mEyesOpen) lidL.rotation().x = mEyesOpen;
}
//greater than case
else {
lidR.rotation().x -= increment;
lidL.rotation().x -= increment;
if (lidR.rotation().x < mEyesOpen) lidR.rotation().x = mEyesOpen;
if (lidL.rotation().x < mEyesOpen) lidL.rotation().x = mEyesOpen;
}
}
/**
* @param timeElapsed time since last frame
* rotate upper head one frame.
*/
private void updateUpper(long timeElapsed) {
float increment = HEAD_PART_SPEED * (timeElapsed/1000.0f);
float current = top.rotation().x;
if (current == mUpperAngle)
return;
else if (current < mUpperAngle) {
top.rotation().x += increment;
if (top.rotation().x > mUpperAngle) top.rotation().x = mUpperAngle;
}
//greater than case
else {
top.rotation().x -= increment;
if (top.rotation().x < mUpperAngle) top.rotation().x = mUpperAngle;
}
}
/**
* @param timeElapsed time since last frame
* rotate lower head one frame.
*/
private void updateLower(long timeElapsed) {
float increment = HEAD_PART_SPEED * (timeElapsed/1000.0f);
float current = bottom.rotation().x;
if (mSpeaking)
increment /=1.5; //AWFUL CAITLIN HACK TOO
if (current == mLowerAngle)
return;
else if (current < mLowerAngle) {
bottom.rotation().x += increment;
if (bottom.rotation().x > mLowerAngle) bottom.rotation().x = mLowerAngle;
}
//greater than case
else {
bottom.rotation().x -= increment;
if (bottom.rotation().x < mLowerAngle) bottom.rotation().x = mLowerAngle;
}
}
public void rebuildEmys() {
setMaterials();
buildHierarchy();
}
private void buildEmys(Object3dContainer parsed) {
//note this loading by number DODGY but name-loading seems broken.
base = new Object3dContainer(parsed.getChildAt(0));
neck = new Object3dContainer(parsed.getChildAt(1));
headcentre = new Object3dContainer(parsed.getChildAt(12));
top = new Object3dContainer(parsed.getChildAt(2));
bottom = new Object3dContainer(parsed.getChildAt(3));
middle = new Object3dContainer(parsed.getChildAt(4));
nose = new Object3dContainer(parsed.getChildAt(6));
stalkL = new Object3dContainer(parsed.getChildAt(7));
ballL = new Object3dContainer(parsed.getChildAt(9));
lidL = new Object3dContainer(parsed.getChildAt(10));
stalkR = new Object3dContainer(parsed.getChildAt(5));
ballR = new Object3dContainer(parsed.getChildAt(8));
lidR = new Object3dContainer(parsed.getChildAt(11));
setMaterials();
/////////////////
buildHierarchy();
setPositions(base);
}
private void setMaterials() {
float[] amb = {1f, 1f, 1f,1f};
float[] diff = {0.9f,0.9f,0.9f,1f};
float[] spec = { 1f,1f,1f, 1f};
float shiny = 30f;
GlMaterial white = new GlMaterial(amb, diff, spec, shiny);
amb = new float[] {0.3f, 0.3f, 0.3f,1f};
diff = new float[] {0.4f,0.4f,0.4f,1f};
spec = new float[] { 0.9f,0.9f,0.9f, 1f};
shiny = 30f;
GlMaterial darkGrey = new GlMaterial(amb, diff, spec, shiny);
//set the colours etc.
base.texturesEnabled(false);
neck.texturesEnabled(false);
headcentre.texturesEnabled(false);
top.texturesEnabled(false);
bottom.texturesEnabled(false);
middle.texturesEnabled(false);
nose.texturesEnabled(false);
nose.setMaterial(darkGrey);
stalkL.texturesEnabled(false);
ballL.setMaterial(white);
lidL.setMaterial(darkGrey);
lidL.texturesEnabled(false);
stalkR.texturesEnabled(false);
ballR.setMaterial(white);
lidR.setMaterial(darkGrey);
lidR.texturesEnabled(false);
}
private void buildHierarchy() {
ballR.addChild(lidR);
stalkR.addChild(ballR);
ballL.addChild(lidL);
stalkL.addChild(ballL);
middle.addChild(nose);
middle.addChild(stalkL);
middle.addChild(stalkR);
headcentre.addChild(top);
headcentre.addChild(middle);
headcentre.addChild(bottom);
neck.addChild(headcentre);
base.addChild(neck);
}
private void setPositions(Object3dContainer root) {
root.position().setAllFrom(root.getLocalO());
if ((root.parent() != null) && (root.parent() instanceof Object3dContainer) ) {
root.position().subtract( ((Object3dContainer)root.parent()).getLocalO() );
}
//set any children
for (int i = 0; i < root.numChildren(); ++i) {
setPositions(root.getChildAt(i));
}
}
}
|
[
"emote.hwu@gmail.com"
] |
emote.hwu@gmail.com
|
16d377059bd953082a814d6ca279496d9d30efa7
|
9ec018af2fe0c3260ff9e75dea58dad1e93cd2d2
|
/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java
|
993228719c23f140c470a3110e6a45c3c4cf55ae
|
[
"Apache-2.0"
] |
permissive
|
apache/openejb
|
932c5a64c47ab4c7ff474855178db67f3d6fc37a
|
f10c077ade927d73bdbd9ed4cc28b79f58a1cd66
|
refs/heads/trunk
| 2023-08-15T17:45:22.852380
| 2013-01-13T22:33:08
| 2013-01-13T22:33:08
| 688,367
| 12
| 15
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,261
|
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.openejb.tools.release.cmd;
import org.apache.openejb.tools.release.Command;
import org.apache.openejb.tools.release.Release;
import org.apache.openejb.tools.release.util.Files;
import org.apache.openejb.tools.release.util.IO;
import org.apache.creadur.tentacles.NexusClient;
import org.apache.xbean.finder.UriSet;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.net.URI;
import java.text.SimpleDateFormat;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
/**
* Little utility that downloads the binaries into
*/
@Command(dependsOn = Close.class)
public class Binaries {
public static void main(String[] args) throws Exception {
final NexusClient client = new NexusClient();
final File dir = Files.file(Release.builddir, "staging-" + Release.build, Release.openejbVersionName);
final URI repo = URI.create(Release.staging);
System.out.println("Downloads: " + dir.getAbsolutePath());
if (!dir.exists() && !dir.mkdirs()) throw new IllegalStateException("Cannot make directory: " + dir.getAbsolutePath());
final UriSet all = new UriSet(client.crawl(repo));
UriSet binaries = all.include(".*\\.(zip|gz|war).*");
binaries = binaries.exclude(".*\\.asc\\.(sha1|md5)");
for (URI uri : binaries.include(".*\\/(tomee|openejb-|apache-tomee|examples)-.*|.*source-release.*")) {
final File file = new File(dir, uri.getPath().replaceAll(".*/", ""));
System.out.println("Downloading " + file.getName());
client.download(uri, file);
if (file.getName().endsWith(".zip")) {
final PrintStream out = new PrintStream(IO.write(new File(file.getAbsolutePath() + ".txt")));
list(file, out);
out.close();
}
}
}
private static void list(File file, PrintStream out) throws IOException {
final SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
final ZipFile zip = new ZipFile(file);
final Enumeration<? extends ZipEntry> enumeration = zip.entries();
while (enumeration.hasMoreElements()) {
ZipEntry entry = enumeration.nextElement();
out.printf("%1$7s %2$2s %3$2s", entry.getSize(), format.format(entry.getTime()), entry.getName() );
out.println();
}
}
}
|
[
"dblevins@apache.org"
] |
dblevins@apache.org
|
8e81fba057b2b3a222b15465edc9616b3d9dd0b9
|
c16ea32a4cddb6b63ad3bacce3c6db0259d2bacd
|
/google/ads/googleads/v5/googleads-java/proto-googleads-java/src/main/java/com/google/ads/googleads/v5/services/FeedItemOperation.java
|
5ad1c557ffd638fa02971bbcda29953b18de09f3
|
[
"Apache-2.0"
] |
permissive
|
dizcology/googleapis-gen
|
74a72b655fba2565233e5a289cfaea6dc7b91e1a
|
478f36572d7bcf1dc66038d0e76b9b3fa2abae63
|
refs/heads/master
| 2023-06-04T15:51:18.380826
| 2021-06-16T20:42:38
| 2021-06-16T20:42:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| true
| 49,867
|
java
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/ads/googleads/v5/services/feed_item_service.proto
package com.google.ads.googleads.v5.services;
/**
* <pre>
* A single operation (create, update, remove) on an feed item.
* </pre>
*
* Protobuf type {@code google.ads.googleads.v5.services.FeedItemOperation}
*/
public final class FeedItemOperation extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.ads.googleads.v5.services.FeedItemOperation)
FeedItemOperationOrBuilder {
private static final long serialVersionUID = 0L;
// Use FeedItemOperation.newBuilder() to construct.
private FeedItemOperation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private FeedItemOperation() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new FeedItemOperation();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private FeedItemOperation(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
com.google.ads.googleads.v5.resources.FeedItem.Builder subBuilder = null;
if (operationCase_ == 1) {
subBuilder = ((com.google.ads.googleads.v5.resources.FeedItem) operation_).toBuilder();
}
operation_ =
input.readMessage(com.google.ads.googleads.v5.resources.FeedItem.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.ads.googleads.v5.resources.FeedItem) operation_);
operation_ = subBuilder.buildPartial();
}
operationCase_ = 1;
break;
}
case 18: {
com.google.ads.googleads.v5.resources.FeedItem.Builder subBuilder = null;
if (operationCase_ == 2) {
subBuilder = ((com.google.ads.googleads.v5.resources.FeedItem) operation_).toBuilder();
}
operation_ =
input.readMessage(com.google.ads.googleads.v5.resources.FeedItem.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.ads.googleads.v5.resources.FeedItem) operation_);
operation_ = subBuilder.buildPartial();
}
operationCase_ = 2;
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
operationCase_ = 3;
operation_ = s;
break;
}
case 34: {
com.google.protobuf.FieldMask.Builder subBuilder = null;
if (updateMask_ != null) {
subBuilder = updateMask_.toBuilder();
}
updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(updateMask_);
updateMask_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ads.googleads.v5.services.FeedItemServiceProto.internal_static_google_ads_googleads_v5_services_FeedItemOperation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ads.googleads.v5.services.FeedItemServiceProto.internal_static_google_ads_googleads_v5_services_FeedItemOperation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ads.googleads.v5.services.FeedItemOperation.class, com.google.ads.googleads.v5.services.FeedItemOperation.Builder.class);
}
private int operationCase_ = 0;
private java.lang.Object operation_;
public enum OperationCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
CREATE(1),
UPDATE(2),
REMOVE(3),
OPERATION_NOT_SET(0);
private final int value;
private OperationCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static OperationCase valueOf(int value) {
return forNumber(value);
}
public static OperationCase forNumber(int value) {
switch (value) {
case 1: return CREATE;
case 2: return UPDATE;
case 3: return REMOVE;
case 0: return OPERATION_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public OperationCase
getOperationCase() {
return OperationCase.forNumber(
operationCase_);
}
public static final int UPDATE_MASK_FIELD_NUMBER = 4;
private com.google.protobuf.FieldMask updateMask_;
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
* @return Whether the updateMask field is set.
*/
@java.lang.Override
public boolean hasUpdateMask() {
return updateMask_ != null;
}
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
* @return The updateMask.
*/
@java.lang.Override
public com.google.protobuf.FieldMask getUpdateMask() {
return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
}
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
*/
@java.lang.Override
public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
return getUpdateMask();
}
public static final int CREATE_FIELD_NUMBER = 1;
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
* @return Whether the create field is set.
*/
@java.lang.Override
public boolean hasCreate() {
return operationCase_ == 1;
}
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
* @return The create.
*/
@java.lang.Override
public com.google.ads.googleads.v5.resources.FeedItem getCreate() {
if (operationCase_ == 1) {
return (com.google.ads.googleads.v5.resources.FeedItem) operation_;
}
return com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
}
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
*/
@java.lang.Override
public com.google.ads.googleads.v5.resources.FeedItemOrBuilder getCreateOrBuilder() {
if (operationCase_ == 1) {
return (com.google.ads.googleads.v5.resources.FeedItem) operation_;
}
return com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
}
public static final int UPDATE_FIELD_NUMBER = 2;
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
* @return Whether the update field is set.
*/
@java.lang.Override
public boolean hasUpdate() {
return operationCase_ == 2;
}
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
* @return The update.
*/
@java.lang.Override
public com.google.ads.googleads.v5.resources.FeedItem getUpdate() {
if (operationCase_ == 2) {
return (com.google.ads.googleads.v5.resources.FeedItem) operation_;
}
return com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
}
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
*/
@java.lang.Override
public com.google.ads.googleads.v5.resources.FeedItemOrBuilder getUpdateOrBuilder() {
if (operationCase_ == 2) {
return (com.google.ads.googleads.v5.resources.FeedItem) operation_;
}
return com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
}
public static final int REMOVE_FIELD_NUMBER = 3;
/**
* <pre>
* Remove operation: A resource name for the removed feed item is
* expected, in this format:
* `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}`
* </pre>
*
* <code>string remove = 3;</code>
* @return Whether the remove field is set.
*/
public boolean hasRemove() {
return operationCase_ == 3;
}
/**
* <pre>
* Remove operation: A resource name for the removed feed item is
* expected, in this format:
* `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}`
* </pre>
*
* <code>string remove = 3;</code>
* @return The remove.
*/
public java.lang.String getRemove() {
java.lang.Object ref = "";
if (operationCase_ == 3) {
ref = operation_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (operationCase_ == 3) {
operation_ = s;
}
return s;
}
}
/**
* <pre>
* Remove operation: A resource name for the removed feed item is
* expected, in this format:
* `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}`
* </pre>
*
* <code>string remove = 3;</code>
* @return The bytes for remove.
*/
public com.google.protobuf.ByteString
getRemoveBytes() {
java.lang.Object ref = "";
if (operationCase_ == 3) {
ref = operation_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (operationCase_ == 3) {
operation_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (operationCase_ == 1) {
output.writeMessage(1, (com.google.ads.googleads.v5.resources.FeedItem) operation_);
}
if (operationCase_ == 2) {
output.writeMessage(2, (com.google.ads.googleads.v5.resources.FeedItem) operation_);
}
if (operationCase_ == 3) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, operation_);
}
if (updateMask_ != null) {
output.writeMessage(4, getUpdateMask());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (operationCase_ == 1) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, (com.google.ads.googleads.v5.resources.FeedItem) operation_);
}
if (operationCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, (com.google.ads.googleads.v5.resources.FeedItem) operation_);
}
if (operationCase_ == 3) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, operation_);
}
if (updateMask_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getUpdateMask());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.ads.googleads.v5.services.FeedItemOperation)) {
return super.equals(obj);
}
com.google.ads.googleads.v5.services.FeedItemOperation other = (com.google.ads.googleads.v5.services.FeedItemOperation) obj;
if (hasUpdateMask() != other.hasUpdateMask()) return false;
if (hasUpdateMask()) {
if (!getUpdateMask()
.equals(other.getUpdateMask())) return false;
}
if (!getOperationCase().equals(other.getOperationCase())) return false;
switch (operationCase_) {
case 1:
if (!getCreate()
.equals(other.getCreate())) return false;
break;
case 2:
if (!getUpdate()
.equals(other.getUpdate())) return false;
break;
case 3:
if (!getRemove()
.equals(other.getRemove())) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasUpdateMask()) {
hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER;
hash = (53 * hash) + getUpdateMask().hashCode();
}
switch (operationCase_) {
case 1:
hash = (37 * hash) + CREATE_FIELD_NUMBER;
hash = (53 * hash) + getCreate().hashCode();
break;
case 2:
hash = (37 * hash) + UPDATE_FIELD_NUMBER;
hash = (53 * hash) + getUpdate().hashCode();
break;
case 3:
hash = (37 * hash) + REMOVE_FIELD_NUMBER;
hash = (53 * hash) + getRemove().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v5.services.FeedItemOperation parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.ads.googleads.v5.services.FeedItemOperation prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* A single operation (create, update, remove) on an feed item.
* </pre>
*
* Protobuf type {@code google.ads.googleads.v5.services.FeedItemOperation}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:google.ads.googleads.v5.services.FeedItemOperation)
com.google.ads.googleads.v5.services.FeedItemOperationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ads.googleads.v5.services.FeedItemServiceProto.internal_static_google_ads_googleads_v5_services_FeedItemOperation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ads.googleads.v5.services.FeedItemServiceProto.internal_static_google_ads_googleads_v5_services_FeedItemOperation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ads.googleads.v5.services.FeedItemOperation.class, com.google.ads.googleads.v5.services.FeedItemOperation.Builder.class);
}
// Construct using com.google.ads.googleads.v5.services.FeedItemOperation.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (updateMaskBuilder_ == null) {
updateMask_ = null;
} else {
updateMask_ = null;
updateMaskBuilder_ = null;
}
operationCase_ = 0;
operation_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.ads.googleads.v5.services.FeedItemServiceProto.internal_static_google_ads_googleads_v5_services_FeedItemOperation_descriptor;
}
@java.lang.Override
public com.google.ads.googleads.v5.services.FeedItemOperation getDefaultInstanceForType() {
return com.google.ads.googleads.v5.services.FeedItemOperation.getDefaultInstance();
}
@java.lang.Override
public com.google.ads.googleads.v5.services.FeedItemOperation build() {
com.google.ads.googleads.v5.services.FeedItemOperation result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.ads.googleads.v5.services.FeedItemOperation buildPartial() {
com.google.ads.googleads.v5.services.FeedItemOperation result = new com.google.ads.googleads.v5.services.FeedItemOperation(this);
if (updateMaskBuilder_ == null) {
result.updateMask_ = updateMask_;
} else {
result.updateMask_ = updateMaskBuilder_.build();
}
if (operationCase_ == 1) {
if (createBuilder_ == null) {
result.operation_ = operation_;
} else {
result.operation_ = createBuilder_.build();
}
}
if (operationCase_ == 2) {
if (updateBuilder_ == null) {
result.operation_ = operation_;
} else {
result.operation_ = updateBuilder_.build();
}
}
if (operationCase_ == 3) {
result.operation_ = operation_;
}
result.operationCase_ = operationCase_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.ads.googleads.v5.services.FeedItemOperation) {
return mergeFrom((com.google.ads.googleads.v5.services.FeedItemOperation)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.ads.googleads.v5.services.FeedItemOperation other) {
if (other == com.google.ads.googleads.v5.services.FeedItemOperation.getDefaultInstance()) return this;
if (other.hasUpdateMask()) {
mergeUpdateMask(other.getUpdateMask());
}
switch (other.getOperationCase()) {
case CREATE: {
mergeCreate(other.getCreate());
break;
}
case UPDATE: {
mergeUpdate(other.getUpdate());
break;
}
case REMOVE: {
operationCase_ = 3;
operation_ = other.operation_;
onChanged();
break;
}
case OPERATION_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.ads.googleads.v5.services.FeedItemOperation parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.ads.googleads.v5.services.FeedItemOperation) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int operationCase_ = 0;
private java.lang.Object operation_;
public OperationCase
getOperationCase() {
return OperationCase.forNumber(
operationCase_);
}
public Builder clearOperation() {
operationCase_ = 0;
operation_ = null;
onChanged();
return this;
}
private com.google.protobuf.FieldMask updateMask_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_;
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
* @return Whether the updateMask field is set.
*/
public boolean hasUpdateMask() {
return updateMaskBuilder_ != null || updateMask_ != null;
}
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
* @return The updateMask.
*/
public com.google.protobuf.FieldMask getUpdateMask() {
if (updateMaskBuilder_ == null) {
return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
} else {
return updateMaskBuilder_.getMessage();
}
}
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
*/
public Builder setUpdateMask(com.google.protobuf.FieldMask value) {
if (updateMaskBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
updateMask_ = value;
onChanged();
} else {
updateMaskBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
*/
public Builder setUpdateMask(
com.google.protobuf.FieldMask.Builder builderForValue) {
if (updateMaskBuilder_ == null) {
updateMask_ = builderForValue.build();
onChanged();
} else {
updateMaskBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
*/
public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) {
if (updateMaskBuilder_ == null) {
if (updateMask_ != null) {
updateMask_ =
com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial();
} else {
updateMask_ = value;
}
onChanged();
} else {
updateMaskBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
*/
public Builder clearUpdateMask() {
if (updateMaskBuilder_ == null) {
updateMask_ = null;
onChanged();
} else {
updateMask_ = null;
updateMaskBuilder_ = null;
}
return this;
}
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
*/
public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() {
onChanged();
return getUpdateMaskFieldBuilder().getBuilder();
}
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
*/
public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
if (updateMaskBuilder_ != null) {
return updateMaskBuilder_.getMessageOrBuilder();
} else {
return updateMask_ == null ?
com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
}
}
/**
* <pre>
* FieldMask that determines which resource fields are modified in an update.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 4;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>
getUpdateMaskFieldBuilder() {
if (updateMaskBuilder_ == null) {
updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>(
getUpdateMask(),
getParentForChildren(),
isClean());
updateMask_ = null;
}
return updateMaskBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v5.resources.FeedItem, com.google.ads.googleads.v5.resources.FeedItem.Builder, com.google.ads.googleads.v5.resources.FeedItemOrBuilder> createBuilder_;
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
* @return Whether the create field is set.
*/
@java.lang.Override
public boolean hasCreate() {
return operationCase_ == 1;
}
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
* @return The create.
*/
@java.lang.Override
public com.google.ads.googleads.v5.resources.FeedItem getCreate() {
if (createBuilder_ == null) {
if (operationCase_ == 1) {
return (com.google.ads.googleads.v5.resources.FeedItem) operation_;
}
return com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
} else {
if (operationCase_ == 1) {
return createBuilder_.getMessage();
}
return com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
}
}
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
*/
public Builder setCreate(com.google.ads.googleads.v5.resources.FeedItem value) {
if (createBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
operation_ = value;
onChanged();
} else {
createBuilder_.setMessage(value);
}
operationCase_ = 1;
return this;
}
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
*/
public Builder setCreate(
com.google.ads.googleads.v5.resources.FeedItem.Builder builderForValue) {
if (createBuilder_ == null) {
operation_ = builderForValue.build();
onChanged();
} else {
createBuilder_.setMessage(builderForValue.build());
}
operationCase_ = 1;
return this;
}
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
*/
public Builder mergeCreate(com.google.ads.googleads.v5.resources.FeedItem value) {
if (createBuilder_ == null) {
if (operationCase_ == 1 &&
operation_ != com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance()) {
operation_ = com.google.ads.googleads.v5.resources.FeedItem.newBuilder((com.google.ads.googleads.v5.resources.FeedItem) operation_)
.mergeFrom(value).buildPartial();
} else {
operation_ = value;
}
onChanged();
} else {
if (operationCase_ == 1) {
createBuilder_.mergeFrom(value);
}
createBuilder_.setMessage(value);
}
operationCase_ = 1;
return this;
}
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
*/
public Builder clearCreate() {
if (createBuilder_ == null) {
if (operationCase_ == 1) {
operationCase_ = 0;
operation_ = null;
onChanged();
}
} else {
if (operationCase_ == 1) {
operationCase_ = 0;
operation_ = null;
}
createBuilder_.clear();
}
return this;
}
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
*/
public com.google.ads.googleads.v5.resources.FeedItem.Builder getCreateBuilder() {
return getCreateFieldBuilder().getBuilder();
}
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
*/
@java.lang.Override
public com.google.ads.googleads.v5.resources.FeedItemOrBuilder getCreateOrBuilder() {
if ((operationCase_ == 1) && (createBuilder_ != null)) {
return createBuilder_.getMessageOrBuilder();
} else {
if (operationCase_ == 1) {
return (com.google.ads.googleads.v5.resources.FeedItem) operation_;
}
return com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
}
}
/**
* <pre>
* Create operation: No resource name is expected for the new feed item.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem create = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v5.resources.FeedItem, com.google.ads.googleads.v5.resources.FeedItem.Builder, com.google.ads.googleads.v5.resources.FeedItemOrBuilder>
getCreateFieldBuilder() {
if (createBuilder_ == null) {
if (!(operationCase_ == 1)) {
operation_ = com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
}
createBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v5.resources.FeedItem, com.google.ads.googleads.v5.resources.FeedItem.Builder, com.google.ads.googleads.v5.resources.FeedItemOrBuilder>(
(com.google.ads.googleads.v5.resources.FeedItem) operation_,
getParentForChildren(),
isClean());
operation_ = null;
}
operationCase_ = 1;
onChanged();;
return createBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v5.resources.FeedItem, com.google.ads.googleads.v5.resources.FeedItem.Builder, com.google.ads.googleads.v5.resources.FeedItemOrBuilder> updateBuilder_;
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
* @return Whether the update field is set.
*/
@java.lang.Override
public boolean hasUpdate() {
return operationCase_ == 2;
}
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
* @return The update.
*/
@java.lang.Override
public com.google.ads.googleads.v5.resources.FeedItem getUpdate() {
if (updateBuilder_ == null) {
if (operationCase_ == 2) {
return (com.google.ads.googleads.v5.resources.FeedItem) operation_;
}
return com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
} else {
if (operationCase_ == 2) {
return updateBuilder_.getMessage();
}
return com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
}
}
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
*/
public Builder setUpdate(com.google.ads.googleads.v5.resources.FeedItem value) {
if (updateBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
operation_ = value;
onChanged();
} else {
updateBuilder_.setMessage(value);
}
operationCase_ = 2;
return this;
}
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
*/
public Builder setUpdate(
com.google.ads.googleads.v5.resources.FeedItem.Builder builderForValue) {
if (updateBuilder_ == null) {
operation_ = builderForValue.build();
onChanged();
} else {
updateBuilder_.setMessage(builderForValue.build());
}
operationCase_ = 2;
return this;
}
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
*/
public Builder mergeUpdate(com.google.ads.googleads.v5.resources.FeedItem value) {
if (updateBuilder_ == null) {
if (operationCase_ == 2 &&
operation_ != com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance()) {
operation_ = com.google.ads.googleads.v5.resources.FeedItem.newBuilder((com.google.ads.googleads.v5.resources.FeedItem) operation_)
.mergeFrom(value).buildPartial();
} else {
operation_ = value;
}
onChanged();
} else {
if (operationCase_ == 2) {
updateBuilder_.mergeFrom(value);
}
updateBuilder_.setMessage(value);
}
operationCase_ = 2;
return this;
}
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
*/
public Builder clearUpdate() {
if (updateBuilder_ == null) {
if (operationCase_ == 2) {
operationCase_ = 0;
operation_ = null;
onChanged();
}
} else {
if (operationCase_ == 2) {
operationCase_ = 0;
operation_ = null;
}
updateBuilder_.clear();
}
return this;
}
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
*/
public com.google.ads.googleads.v5.resources.FeedItem.Builder getUpdateBuilder() {
return getUpdateFieldBuilder().getBuilder();
}
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
*/
@java.lang.Override
public com.google.ads.googleads.v5.resources.FeedItemOrBuilder getUpdateOrBuilder() {
if ((operationCase_ == 2) && (updateBuilder_ != null)) {
return updateBuilder_.getMessageOrBuilder();
} else {
if (operationCase_ == 2) {
return (com.google.ads.googleads.v5.resources.FeedItem) operation_;
}
return com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
}
}
/**
* <pre>
* Update operation: The feed item is expected to have a valid resource
* name.
* </pre>
*
* <code>.google.ads.googleads.v5.resources.FeedItem update = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v5.resources.FeedItem, com.google.ads.googleads.v5.resources.FeedItem.Builder, com.google.ads.googleads.v5.resources.FeedItemOrBuilder>
getUpdateFieldBuilder() {
if (updateBuilder_ == null) {
if (!(operationCase_ == 2)) {
operation_ = com.google.ads.googleads.v5.resources.FeedItem.getDefaultInstance();
}
updateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v5.resources.FeedItem, com.google.ads.googleads.v5.resources.FeedItem.Builder, com.google.ads.googleads.v5.resources.FeedItemOrBuilder>(
(com.google.ads.googleads.v5.resources.FeedItem) operation_,
getParentForChildren(),
isClean());
operation_ = null;
}
operationCase_ = 2;
onChanged();;
return updateBuilder_;
}
/**
* <pre>
* Remove operation: A resource name for the removed feed item is
* expected, in this format:
* `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}`
* </pre>
*
* <code>string remove = 3;</code>
* @return Whether the remove field is set.
*/
@java.lang.Override
public boolean hasRemove() {
return operationCase_ == 3;
}
/**
* <pre>
* Remove operation: A resource name for the removed feed item is
* expected, in this format:
* `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}`
* </pre>
*
* <code>string remove = 3;</code>
* @return The remove.
*/
@java.lang.Override
public java.lang.String getRemove() {
java.lang.Object ref = "";
if (operationCase_ == 3) {
ref = operation_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (operationCase_ == 3) {
operation_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* Remove operation: A resource name for the removed feed item is
* expected, in this format:
* `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}`
* </pre>
*
* <code>string remove = 3;</code>
* @return The bytes for remove.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getRemoveBytes() {
java.lang.Object ref = "";
if (operationCase_ == 3) {
ref = operation_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (operationCase_ == 3) {
operation_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* Remove operation: A resource name for the removed feed item is
* expected, in this format:
* `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}`
* </pre>
*
* <code>string remove = 3;</code>
* @param value The remove to set.
* @return This builder for chaining.
*/
public Builder setRemove(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
operationCase_ = 3;
operation_ = value;
onChanged();
return this;
}
/**
* <pre>
* Remove operation: A resource name for the removed feed item is
* expected, in this format:
* `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}`
* </pre>
*
* <code>string remove = 3;</code>
* @return This builder for chaining.
*/
public Builder clearRemove() {
if (operationCase_ == 3) {
operationCase_ = 0;
operation_ = null;
onChanged();
}
return this;
}
/**
* <pre>
* Remove operation: A resource name for the removed feed item is
* expected, in this format:
* `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}`
* </pre>
*
* <code>string remove = 3;</code>
* @param value The bytes for remove to set.
* @return This builder for chaining.
*/
public Builder setRemoveBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
operationCase_ = 3;
operation_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.ads.googleads.v5.services.FeedItemOperation)
}
// @@protoc_insertion_point(class_scope:google.ads.googleads.v5.services.FeedItemOperation)
private static final com.google.ads.googleads.v5.services.FeedItemOperation DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.ads.googleads.v5.services.FeedItemOperation();
}
public static com.google.ads.googleads.v5.services.FeedItemOperation getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<FeedItemOperation>
PARSER = new com.google.protobuf.AbstractParser<FeedItemOperation>() {
@java.lang.Override
public FeedItemOperation parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new FeedItemOperation(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<FeedItemOperation> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<FeedItemOperation> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.ads.googleads.v5.services.FeedItemOperation getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
|
[
"bazel-bot-development[bot]@users.noreply.github.com"
] |
bazel-bot-development[bot]@users.noreply.github.com
|
394d09bfbd6899f723805b34c4531b5e94c34948
|
923e45e8f5e040e306330b410c7af03ce7eea41b
|
/javaweb笔记/1-java基础/Java Basics/src/pers/zhangdi/practice/wlbcDemo.java
|
a916b78d5ade70a5f26c6f457f6926615a66ecb1
|
[] |
no_license
|
MrZhangD/Study
|
298eb7caf8e826488a0f66855aa9cfeb5ddbb79f
|
04729e323ab1212ab085d3f7b15a0f5de0919916
|
refs/heads/master
| 2020-04-12T09:24:31.237920
| 2019-06-17T12:14:07
| 2019-06-17T12:14:07
| 162,399,798
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 989
|
java
|
package pers.zhangdi.practice;
//服务器端:主要使用ServerSocket
import java.io.PrintStream;
import java.net.ServerSocket;
import java.net.Socket;
//网络程序的开发的两个核心的类:服务器类:ServerSocket 客户端类:Socket
public class wlbcDemo {
public static void main(String[] args)throws Exception {
ServerSocket server = new ServerSocket(9000) ; //所有的服务器都必须有端口
System.out.println("等待客户连接。。。。");
Socket client = server.accept() ; //等待客户端连接
// OutputStream out = client.getOutputStream() ; //取得客户端的输出功能
// byte b[] = new byte[100] ;
// String str = "Hello , word!" ;
// b = str.getBytes() ;
// out.write(b);
// out.close();
//由于输出流不方便,采用打印流
PrintStream out=new PrintStream(client.getOutputStream()); //取得客户端的输出功能
out.print("Hello,word!");
out.close();
client.close();
server.close();
}
}
|
[
"1053338363@qq.com"
] |
1053338363@qq.com
|
d1f298fc2b74417e909b58f77b420bbb3c4206bb
|
fd8497da00acbb551cbf01136b2a31a050d1a540
|
/src/test/java/JSONFileStrategyTest.java
|
12340e67db72928101f32386f2d51bf6122bbeb6
|
[] |
no_license
|
ramyakandasamy7/samplerepo
|
0a76924b075a96f1a758ab9069e694c9796a07c4
|
cf826f2263889296c589e2f35410663a74762e11
|
refs/heads/master
| 2023-04-13T21:46:34.644427
| 2020-04-24T01:15:07
| 2020-04-24T01:15:07
| 258,370,800
| 0
| 0
| null | 2021-04-26T20:12:30
| 2020-04-24T01:11:27
|
Java
|
UTF-8
|
Java
| false
| false
| 843
|
java
|
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.function.Supplier;
import junitx.framework.FileAssert;
import static org.junit.jupiter.api.Assertions.*;
class JSONFileStrategyTest {
JSONFileStrategy test = new JSONFileStrategy();
@org.junit.jupiter.api.Test
void getTest() throws IOException {
test.getOutput("/Users/ramyakandasamy/IdeaProjects/creditCardFileReader/InputFile.json", "/Users/ramyakandasamy/IdeaProjects/creditCardFileReader/TestOutputFile.json");
File file1 = new File("/Users/ramyakandasamy/IdeaProjects/creditCardFileReader/ExpectedOutput.json");
File file2 = new File("/Users/ramyakandasamy/IdeaProjects/creditCardFileReader/TestOutputFile.json");
FileAssert.assertEquals(file1, file2);
}
}
|
[
"ramyakandasamy7@gmail.com"
] |
ramyakandasamy7@gmail.com
|
f5fcad0b455200ad1799aab67509e19e87423a28
|
7f6b8a8e97a361bd76a2f863afb571f4ff745010
|
/com.street.service/src/main/java/com/chasel/family/controller/LoginController.java
|
34b85b4710c3fca2cc6e9adfa2d3219b2046c911
|
[] |
no_license
|
chaselwin/chasel
|
d57ea1cdea69464bc0afd1b476825394632f61d8
|
267590d60cc90504335e85858612b7685bf79312
|
refs/heads/master
| 2021-09-03T12:36:19.277958
| 2018-01-09T05:14:53
| 2018-01-09T05:14:53
| 108,641,718
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,611
|
java
|
package com.chasel.family.controller;
import static com.chasel.family.constant.MessagesConstant.ACCONT_SUCCESS;
import static com.chasel.family.constant.MessagesConstant.ADD_FAIL;
import static com.chasel.family.constant.MessagesConstant.HAS_LOGIN;
import static com.chasel.family.constant.MessagesConstant.LOGOUT_SUCCESS;
import static com.chasel.family.constant.MessagesConstant.NOT_LOGIN;
import javax.servlet.http.HttpSession;
import org.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.chasel.common.constant.BaseController;
import com.chasel.common.constant.ResponseResult;
import com.chasel.family.service.IUserService;
import com.chasel.family.vo.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api("登录信息")
@RestController
@RequestMapping("/login")
public class LoginController extends BaseController {
@Autowired
private IUserService userService;
/**
* 登录
*
* @param user
* @param httpSession
* @return
* @throws JSONException
*/
@ApiOperation("用户登录")
@RequestMapping(path = "/userLogin", method = RequestMethod.POST, produces = "application/json")
public @ResponseBody ResponseResult login(@RequestBody User user, HttpSession httpSession) throws JSONException {
return process(() -> userService.login(user.getAccount(), user.getPassword(), httpSession),ACCONT_SUCCESS,ADD_FAIL);
}
/**
* 登录状态
*
* @param httpSession
* @return
* @throws JSONException
*/
@ApiOperation("是否登录")
@RequestMapping(path = "/isLogin", method = RequestMethod.POST, produces = "application/json")
public @ResponseBody ResponseResult isLogin(HttpSession httpSession) throws JSONException {
return process(() -> userService.isLogin(httpSession),HAS_LOGIN, NOT_LOGIN);
}
/**
* 注销
*
* @param httpSession
* @return
* @throws JSONException
*/
@ApiOperation("注销登录")
@RequestMapping(path = "/logout", method = RequestMethod.POST, produces = "application/json")
public @ResponseBody ResponseResult logout(HttpSession httpSession) throws JSONException {
return process(() -> userService.logout(httpSession),LOGOUT_SUCCESS,LOGOUT_SUCCESS);
}
}
|
[
"1174170757@qq.com"
] |
1174170757@qq.com
|
0cac33af9bbad10f72ea1c19a2da7813b66fceef
|
8cfdf38346668bebacddc3372cd8f266fdc2fdfc
|
/PictureGallery/app/src/main/java/com/example/asiablr/picturegallery/GalleryMain.java
|
4f419e72cb264504199c06207018a12d9b3aace7
|
[] |
no_license
|
k-siva/learn-app
|
050f49ec78b34a00a08f5bc51112692c3f60ab3e
|
0aae5d5f6eb8806dfbd5f0f664c7bb16948cc5b5
|
refs/heads/master
| 2020-03-29T14:22:44.535521
| 2015-07-24T12:46:57
| 2015-07-24T12:46:57
| 37,068,995
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,377
|
java
|
package com.example.asiablr.picturegallery;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
public class GalleryMain extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gallery_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_gallery_main, menu);
return true;
}
// button click
public void OnLocalGalleryButtonClick(View v) {
Intent intent = new Intent(this, LocalGallery.class);
startActivity(intent);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
|
[
"sendtomani@gmail.com"
] |
sendtomani@gmail.com
|
d823e7473972111a3c3368c63b1e3b73871a63d9
|
e27e52b0a0b0766566f6b343b48b67f9a3a3cd02
|
/sample/src/main/java/bootpay/co/kr/samplepayment/LocalHtmlActivity.java
|
4f9e5abec88988aa408df8d265e3427effcb44ed
|
[
"MIT"
] |
permissive
|
jpung0629/client_android_java
|
f90a9f49a265529ada4ccd692ac1eb6c9b5b7e43
|
96c862ed8b9f01edb6e3c5c3f3d71b64718d4d32
|
refs/heads/master
| 2022-11-05T18:54:50.987825
| 2020-06-19T01:24:02
| 2020-06-19T01:24:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,052
|
java
|
package bootpay.co.kr.samplepayment;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
import android.support.annotation.Nullable;
import android.webkit.CookieManager;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import java.net.URISyntaxException;
public class LocalHtmlActivity extends Activity implements WebAppBridgeInterface {
WebView webview;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webapp);
webview = findViewById(R.id.webview);
webview.setWebViewClient(new BWebviewClient());
webview.setWebChromeClient(new BChromeClient());
webview.addJavascriptInterface(new WebAppBridge(this), "Android");
CookieManager.getInstance().setAcceptCookie(true);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setDomStorageEnabled(true);
webview.loadUrl("file:///android_asset/html/index.html");
}
void setDevice() {
doJavascript("BootPay.setDevice('ANDROID');");
}
void startTrace() {
doJavascript("BootPay.startTrace();");
}
void doJavascript(String script) {
final String str = script;
runOnUiThread(new Runnable() {
@Override
public void run() {
webview.loadUrl("javascript:(function(){" + str + "})()");
}
});
}
@Override
public void error(String data) {
System.out.println(data);
}
@Override
public void close(String data) {
System.out.println(data);
}
@Override
public void cancel(String data) {
System.out.println(data);
}
@Override
public void ready(String data) {
System.out.println(data);
}
@Override
public void confirm(String data) {
boolean iWantPay = true;
if(iWantPay == true) {
doJavascript("BootPay.transactionConfirm( " + data + ");");
} else {
doJavascript("BootPay.removePaymentWindow();");
}
}
@Override
public void done(String data) {
System.out.println(data);
}
private class BWebviewClient extends WebViewClient {
private boolean isLoaded = false;
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
if(isLoaded) return;
isLoaded = true;
setDevice();
startTrace();
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Intent intent = parse(url);
if (isIntent(url)) {
if (isExistInfo(intent, view.getContext()) || isExistPackage(intent, view.getContext()))
return start(intent, view.getContext());
else
gotoMarket(intent, view.getContext());
} else if (isMarket(url)) {
return start(intent, view.getContext());
}
return url.contains("https://bootpaymark");
}
private Intent parse(String url) {
try {
Intent intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
if(intent.getPackage() == null) {
if (url == null) return intent;
if (url.startsWith("shinhan-sr-ansimclick")) intent.setPackage("com.shcard.smartpay");
else if (url.startsWith("kftc-bankpay")) intent.setPackage("com.kftc.bankpay");
else if (url.startsWith("ispmobile")) intent.setPackage("kvp.jjy.MispAndroid320");
else if (url.startsWith("hdcardappcardansimclick")) intent.setPackage("com.hyundaicard.appcard");
else if (url.startsWith("kb-acp")) intent.setPackage("com.kbcard.kbkookmincard");
else if (url.startsWith("mpocket.online.ansimclick")) intent.setPackage("kr.co.samsungcard.mpocket");
else if (url.startsWith("lotteappcard")) intent.setPackage("com.lcacApp");
else if (url.startsWith("cloudpay")) intent.setPackage("com.hanaskcard.paycla");
else if (url.startsWith("nhappvardansimclick")) intent.setPackage("nh.smart.nhallonepay");
else if (url.startsWith("citispay")) intent.setPackage("kr.co.citibank.citimobile");
else if (url.startsWith("kakaotalk")) intent.setPackage("com.kakao.talk");
}
return intent;
} catch (URISyntaxException e) {
e.printStackTrace();
return null;
}
}
private Boolean isIntent(String url) {
return url.matches("^intent:?\\w*://\\S+$");
}
private Boolean isMarket(String url) {
return url.matches("^market://\\S+$");
}
private Boolean isExistInfo(Intent intent, Context context) {
try {
return intent != null && context.getPackageManager().getPackageInfo(intent.getPackage(), PackageManager.GET_ACTIVITIES) != null;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return false;
}
}
private Boolean isExistPackage(Intent intent, Context context) {
return intent != null && context.getPackageManager().getLaunchIntentForPackage(intent.getPackage()) != null;
}
private boolean start(Intent intent, Context context) {
context.startActivity(intent);
return true;
}
private boolean gotoMarket(Intent intent, Context context) {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + intent.getPackage())));
return true;
}
}
private class BChromeClient extends WebChromeClient {
@Override
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg);
}
@Override
public void onCloseWindow(WebView window) {
super.onCloseWindow(window);
}
@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
new AlertDialog.Builder(view.getContext())
.setMessage(message)
.setCancelable(true)
.create()
.show();
return true;
}
}
}
|
[
"jungler@cvdv.me"
] |
jungler@cvdv.me
|
a11147c5295df82b1e03eb007f6bd97aeea9325b
|
fb04c9c369f59364e931a1ec544951450e0a3dfb
|
/periscope-ejb/src/main/java/br/ufmt/periscope/indexer/resources/analysis/DataSignaturesAnalyzer.java
|
d203a5f42a8f2e6e522fec5e8dfd4b7851c32529
|
[] |
no_license
|
UFMT/periscope
|
a3412cef0c60e34e69a0372c6b129320d62b4345
|
79f281bb61c23dcb5d0841e46f5dc28d8467f4d6
|
refs/heads/master
| 2021-01-17T13:16:22.841236
| 2017-09-05T14:23:14
| 2017-09-05T14:23:14
| 7,265,431
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,452
|
java
|
package br.ufmt.periscope.indexer.resources.analysis;
import javax.inject.Inject;
import javax.inject.Named;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.core.LowerCaseFilter;
import org.apache.lucene.analysis.core.StopFilter;
import org.apache.lucene.analysis.core.WhitespaceTokenizer;
import org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilter;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.util.Version;
/**
*
*
* @author mattyws
*/
@Named
public class DataSignaturesAnalyzer extends Analyzer {
@Inject
private CommonDescriptorsSet descriptorSet;
public Version matchVersion = Version.LATEST;
@Override
protected TokenStreamComponents createComponents(String field) {
// Tokenizes the string by withespace
Tokenizer source = new WhitespaceTokenizer();
TokenStream sink = null;
// // Break the withespace in pattern and turn in two tokens, one with
// // the acronym and other with the condesed name
// sink = new CondenseTokenFilter(
// // Removes the Common Descriptors of the company
// new CommonDescriptorsTokenFilter(
// // Remove the English stopwords
// new StopFilter(matchVersion,
// // Pass the chars to their ASCII aquivalent
// new ASCIIFoldingFilter(
// // Normalize the string
// new LowerCaseFilter(matchVersion, source)), StandardAnalyzer.STOP_WORDS_SET), descriptorSet));
LowerCaseFilter lowerCaseFilter = new LowerCaseFilter(source);
ASCIIFoldingFilter aSCIIFoldingFilter = new ASCIIFoldingFilter(lowerCaseFilter);
//
StopFilter stopFilter = new StopFilter(aSCIIFoldingFilter, StandardAnalyzer.STOP_WORDS_SET);
//
CommonDescriptorsTokenFilter commonDescriptorsTokenFilter = new CommonDescriptorsTokenFilter(stopFilter, descriptorSet);
//
sink = new DataSignaturesTokenFilter(commonDescriptorsTokenFilter);
// return new TokenStreamComponents(source, commonDescriptorsTokenFilter);
return new TokenStreamComponents(source, sink);
}
}
|
[
"saviobola@gmail.com"
] |
saviobola@gmail.com
|
fd2ca12027b1812bc674d22467ab1efe68db3b22
|
af0dccd6c8da67c0458a4244f9a3b344f6c9e113
|
/CallJugnu/src/com/example/calljugnu/TasteBuds.java
|
34b0bbb871f2e8e058c13910f3fc22a9b98db948
|
[] |
no_license
|
tanujchawla1991/CallJugnu
|
8f568685492ea75a9047ddfe955c8f4bda73f4a6
|
9ee0e579cc666247a994fd0f929e30dc25ed379e
|
refs/heads/master
| 2021-01-10T02:48:04.633612
| 2016-02-04T06:39:09
| 2016-02-04T06:39:09
| 51,056,905
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,680
|
java
|
package com.example.calljugnu;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.database.Cursor;
import android.util.DisplayMetrics;
import android.view.*;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ExpandableListView;
import android.widget.Toast;
import android.widget.ExpandableListView.OnChildClickListener;
import android.widget.ImageButton;
public class TasteBuds extends Activity {
List<Integer> imageList;
List<Integer> childImageList;
List<String> priceList;
List<String> groupList;
List<String> childList;
Map<String, List<String>> itemCollection;
ExpandableListView expListView;
DBAdapter db;
ImageButton ib1;
ImageButton ib2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_taste_buds);
if (!isTablet(this))
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
ib1=(ImageButton)findViewById(R.id.imageButton1);
ib1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(TasteBuds.this, HomePage.class);
startActivity(intent);
}
});
ib2=(ImageButton)findViewById(R.id.imageButton2);
ib2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(TasteBuds.this, Cart.class);
startActivity(intent);
}
});
db = new DBAdapter(this);
createGroupList();
createCollection();
expListView = (ExpandableListView) findViewById(R.id.expandableListView1);
final ExpandableListAdapter expListAdapter = new ExpandableListAdapter(
this, imageList, childImageList, groupList, itemCollection, priceList);
expListView.setAdapter(expListAdapter);
setGroupIndicatorToRight();
expListView.setOnChildClickListener(new OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// TODO Auto-generated method stub
final String sss=groupList.get(groupPosition);
String cost = (String) expListAdapter.getPrice(groupPosition);
Show_Dialog(sss,cost);
return false;
}
});
}
public static boolean isTablet(Context context) {
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
public void CopyDB(InputStream inputStream, OutputStream outputStream)
throws IOException {
//---copy 1K bytes at a time---
byte[] buffer = new byte[1024];
int length;
while ((length = inputStream.read(buffer)) > 0) {
outputStream.write(buffer, 0, length);
}
inputStream.close();
outputStream.close();
}
private void createGroupList() {
groupList = new ArrayList<String>();
imageList = new ArrayList<Integer>();
childImageList = new ArrayList<Integer>();
priceList= new ArrayList<String>();
db.open();
Cursor cursor=db.getAllItems("tastebuds");
if (cursor.moveToFirst()) {
do{
groupList.add(cursor.getString(0));
priceList.add(cursor.getString(1));
String xyz=cursor.getString(3);
String xxyyzz=xyz.replaceAll(".jpg", "");
int resId=getResources().getIdentifier(xxyyzz, "drawable", getPackageName());
imageList.add(resId);
childImageList.add(resId);
} while (cursor.moveToNext());
}
db.close();
}
private void createCollection() {
db.open();
itemCollection = new LinkedHashMap<String, List<String>>();
Cursor cursor=db.getAllItems("tastebuds");
int i=0;
if (cursor.moveToFirst()) {
do{
String item=groupList.get(i);
if (item.equals(cursor.getString(0)))
{
String[] abc={cursor.getString(2)};
loadChild(abc);
}
itemCollection.put(item, childList);
i++;
} while (cursor.moveToNext());
}
db.close();
}
private void loadChild(String[] items001) {
childList = new ArrayList<String>();
for (String model : items001)
childList.add(model);
}
private void setGroupIndicatorToRight() {
/* Get the screen width */
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels;
expListView.setIndicatorBounds(width - getDipsFromPixel(60), width
- getDipsFromPixel(20));
}
// Convert pixel to dip
public int getDipsFromPixel(float pixels) {
// Get the screen's density scale
final float scale = getResources().getDisplayMetrics().density;
// Convert the dps to pixels, based on density scale
return (int) (pixels * scale + 0.5f);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.taste_buds, menu);
return true;
}
public void Show_Dialog(String ss,String cost) {
final QuantityDialog qd = new QuantityDialog(TasteBuds.this);
qd.show();
Button ok = (Button) qd.findViewById(R.id.button1);
Button cancel = (Button) qd.findViewById(R.id.button2);
final String ssss=ss;
final String price=cost;
ok.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
EditText e1=(EditText)qd.findViewById(R.id.editText1);
final String xyz=e1.getText().toString();
db.open();
db.insertContact(ssss, price, xyz);
db.close();
Toast.makeText(getApplicationContext(), xyz+" "+ssss+" added to cart.", Toast.LENGTH_LONG).show();
qd.dismiss();
}
});
cancel.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
qd.dismiss();
}
});
}
}
|
[
"tanujchawla1991@gmail.com"
] |
tanujchawla1991@gmail.com
|
d486d4010a5d5b15c0be5944467335d6b0e1508c
|
ec2679e89626f5d271574e36f18976cc4f2100ff
|
/mod1/src/main/java/FileDownloader/FileDownloader.java
|
d795831df75f587673d84f354f0389058b27e6cc
|
[] |
no_license
|
MichalakJ/zpi3
|
e3e054564e2f0070fcd2621e550808fa00dd0e4f
|
7f3f2d361339ee2fb3046fa56842def328bff8bd
|
refs/heads/master
| 2021-01-12T15:49:50.855495
| 2016-11-29T11:19:36
| 2016-11-29T11:19:36
| 71,878,402
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 636
|
java
|
package FileDownloader;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
/**
* Created by Jakub on 2016-11-14.
*/
public class FileDownloader {
public static void downloadFile(String url, String destination) throws IOException {
URL website = new URL(url);
InputStream in = website.openStream();
Path target = Paths.get(destination);
Files.copy(in, target, StandardCopyOption.REPLACE_EXISTING);
}
}
|
[
"daran.dasaner@gmail.com"
] |
daran.dasaner@gmail.com
|
7f4569e038c6abeb9977eed4b86f31f7e38e6823
|
d7073fc7bfc7166aac6780560a79172f59bc5eec
|
/src/main/java/com/doisbitsw/escolar/api/categorias/CategoriaService.java
|
ed2faac0b5c173d3fe82e376a12055080a71d244
|
[] |
no_license
|
jhaskel/escolar
|
31c798e4f043011b223f513bb503339e169fc4a3
|
ace1484e58001fd391e6933806e7bde05bfeb4ae
|
refs/heads/main
| 2023-02-19T02:35:22.095306
| 2021-01-20T12:00:26
| 2021-01-20T12:00:26
| 330,796,763
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,890
|
java
|
package com.doisbitsw.escolar.api.categorias;
import com.doisbitsw.escolar.api.infra.exception.ObjectNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@Service
public class CategoriaService {
@Autowired
private CategoriaRepository rep;
public List<CategoriaDTO> getCarros() {
List<CategoriaDTO> list = rep.findAll().stream().map(CategoriaDTO::create).collect(Collectors.toList());
return list;
}
public CategoriaDTO getCarroById(Long id) {
Optional<Categoria> carro = rep.findById(id);
return carro.map(CategoriaDTO::create).orElseThrow(() -> new ObjectNotFoundException("Carro não encontrado"));
}
public CategoriaDTO insert(Categoria categoria) {
Assert.isNull(categoria.getId(),"Não foi possível inserir o registro");
return CategoriaDTO.create(rep.save(categoria));
}
public CategoriaDTO update(Categoria categoria, Long id) {
Assert.notNull(id,"Não foi possível atualizar o registro");
// Busca o carro no banco de dados
Optional<Categoria> optional = rep.findById(id);
if(optional.isPresent()) {
Categoria db = optional.get();
// Copiar as propriedades
db.setNome(categoria.getNome());
db.setImage(categoria.getImage());
System.out.println("Carro id " + db.getId());
// Atualiza o carro
rep.save(db);
return CategoriaDTO.create(db);
} else {
return null;
//throw new RuntimeException("Não foi possível atualizar o registro");
}
}
public void delete(Long id) {
rep.deleteById(id);
}
}
|
[
"johaskel@gmail.com"
] |
johaskel@gmail.com
|
d547ba6f5cf534ac9d749208afdbc1e3b641bcd5
|
b408edc4023a09f2ec8d4c227d4ee21e913bc2a7
|
/lib/src/main/java/com/google/samples/apps/iosched/settings/SettingsActivity.java
|
fc7c3aeeaacdc1586b17b17e79edcb3b722b8017
|
[
"Apache-2.0"
] |
permissive
|
liaoqingmo/iosched
|
4ffd4372926399d42948ac075e049348afdf6636
|
6540760a278c111f311ca53db220f3afab8b9687
|
refs/heads/master
| 2021-07-03T21:36:50.802633
| 2019-01-10T15:25:31
| 2019-01-10T15:25:31
| 165,075,251
| 0
| 0
|
Apache-2.0
| 2020-09-09T04:50:00
| 2019-01-10T14:36:12
|
Java
|
UTF-8
|
Java
| false
| false
| 6,952
|
java
|
/*
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.samples.apps.iosched.settings;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.preference.PreferenceFragmentCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.google.samples.apps.iosched.fcm.FcmUtilities;
import com.google.samples.apps.iosched.lib.BuildConfig;
import com.google.samples.apps.iosched.lib.R;
import com.google.samples.apps.iosched.service.SessionCalendarService;
import com.google.samples.apps.iosched.util.PermissionsUtils;
import com.google.samples.apps.iosched.util.RegistrationUtils;
/**
* Activity for customizing app settings.
*/
public class SettingsActivity extends AppCompatActivity {
public static final String[] CALENDAR_PERMISSIONS =
new String[]{Manifest.permission.WRITE_CALENDAR};
/**
* Indicates a permission request because the Calendar sync feature is being turned off. The
* Calendar needs to be cleared and therefore the access is needed to remove entries.
*/
private static final int REQUEST_PERMISSION_REQUEST_CODE_DISABLE_CALENDAR = 222;
/**
* Indicates a permission request because the Calendar sync feature is being turned on.
*/
private static final int REQUEST_PERMISSION_REQUEST_CODE_ENABLE_CALENDAR = 111;
static void scheduleCalendarSync(Activity activity) {
Intent intent;
if (SettingsUtils.shouldSyncCalendar(activity)) {
// Add all calendar entries
intent = new Intent(SessionCalendarService.ACTION_UPDATE_ALL_SESSIONS_CALENDAR);
} else {
// Remove all calendar entries
intent = new Intent(SessionCalendarService.ACTION_CLEAR_ALL_SESSIONS_CALENDAR);
}
intent.setClass(activity, SessionCalendarService.class);
activity.startService(intent);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings_act);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
@Override
public void onRequestPermissionsResult(final int requestCode,
@NonNull final String[] permissions,
@NonNull final int[] grantResults) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// The only permission that is granted is the calendar one so a full sync is needed
// when the permission is granted. This clears the schedule when sync is turned off
// and updates it when it is turned on.
scheduleCalendarSync(this);
} else {
int messageResId = (requestCode == REQUEST_PERMISSION_REQUEST_CODE_DISABLE_CALENDAR ?
R.string.pref_sync_with_calendar_permission_denied_during_disable :
R.string.pref_sync_with_calendar_permission_denied_during_enable);
PermissionsUtils.displayPermissionDeniedSnackbar(this, messageResId);
}
}
/**
* The Fragment is added via the R.layout.settings_act layout xml.
*/
public static class SettingsFragment extends PreferenceFragmentCompat
implements SharedPreferences.OnSharedPreferenceChangeListener {
public SettingsFragment() {
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SettingsUtils.registerOnSharedPreferenceChangeListener(getActivity(), this);
}
@Override
public RecyclerView onCreateRecyclerView(final LayoutInflater inflater,
final ViewGroup parent,
final Bundle savedInstanceState) {
// Override the default list which has horizontal padding. Instead place padding on
// the preference items for nicer touch feedback.
final RecyclerView prefList =
(RecyclerView) inflater.inflate(R.layout.settings_list, parent, false);
prefList.setHasFixedSize(true);
return prefList;
}
@Override
public void onCreatePreferences(Bundle bundle, String s) {
addPreferencesFromResource(R.xml.settings_prefs);
}
@Override
public void onDestroy() {
super.onDestroy();
SettingsUtils.unregisterOnSharedPreferenceChangeListener(getActivity(), this);
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
// The Calendar Sync requires checking the Calendar permission.
if (SettingsUtils.PREF_SYNC_CALENDAR.equals(key)) {
// Request permission when it doesn't exist, saving the information about whether
// the request enabled or disabled the sync via the requestCode.
if (!PermissionsUtils.permissionsAlreadyGranted(getActivity(), CALENDAR_PERMISSIONS)) {
boolean shouldSync = SettingsUtils.shouldSyncCalendar(getActivity());
int requestCode = shouldSync ? REQUEST_PERMISSION_REQUEST_CODE_ENABLE_CALENDAR :
REQUEST_PERMISSION_REQUEST_CODE_DISABLE_CALENDAR;
ActivityCompat.requestPermissions(getActivity(),
CALENDAR_PERMISSIONS, requestCode);
return;
}
scheduleCalendarSync(getActivity());
} else if (BuildConfig.PREF_CONF_MESSAGES_ENABLED.equals(key) ||
BuildConfig.PREF_ATTENDEE_AT_VENUE.equals(key)) {
// This will activate re-registering with the correct FCM topic(s).
FcmUtilities.subscribeTopics(ConfMessageCardUtils.isConfMessageCardsEnabled(getActivity()),
RegistrationUtils.isRegisteredAttendee(getActivity()) ==
RegistrationUtils.REGSTATUS_REGISTERED);
}
}
}
}
|
[
"1043563076@qq.com"
] |
1043563076@qq.com
|
ff289ccbe1d6750b46428288d6062176d4ec543c
|
c6804b632f537151368bf1736c75eeef60a190d9
|
/reading-list/src/main/java/net/shamansoft/readinglist/ConsoleApp.java
|
dccf1227150d7703c2075be1bc630f2d65dd5695
|
[
"MIT"
] |
permissive
|
khisamutdinov/books-petshop
|
f45c049647cb352301ec83db15bdc37006e81b0a
|
ddf1d53faec751941c674be9da6bae7498b52790
|
refs/heads/master
| 2022-08-03T01:22:25.733946
| 2020-05-28T04:39:17
| 2020-05-28T04:39:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 65
|
java
|
package net.shamansoft.readinglist;
public class ConsoleApp {
}
|
[
"alexey-khisamutdinov@users.noreply.github.com"
] |
alexey-khisamutdinov@users.noreply.github.com
|
410d77fe65afea10caaa4b0726ac219ec3d2b12a
|
187f96c587610b1ded809da0ebceca803092aa6d
|
/src/java/scs/auxiliar/UndefinedPropertyHolder.java
|
bc7b40fb8cda4107a59140b24a0b5f1031fbf831
|
[] |
no_license
|
hubefonseca/log-monitor
|
c9da6dbe444d4a3e176d741c72b56e83ed4ccbf8
|
25b274f419bd2df2c3a05610c78a3c540f151fef
|
refs/heads/master
| 2021-01-18T07:45:01.582616
| 2008-10-20T00:44:49
| 2008-10-20T00:44:49
| 66,067
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 889
|
java
|
package scs.auxiliar;
/**
* scs/auxiliar/UndefinedPropertyHolder.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ../../idl/deployment.idl
* Saturday, October 18, 2008 4:06:48 PM BRST
*/
public final class UndefinedPropertyHolder implements org.omg.CORBA.portable.Streamable
{
public scs.auxiliar.UndefinedProperty value = null;
public UndefinedPropertyHolder ()
{
}
public UndefinedPropertyHolder (scs.auxiliar.UndefinedProperty initialValue)
{
value = initialValue;
}
public void _read (org.omg.CORBA.portable.InputStream i)
{
value = scs.auxiliar.UndefinedPropertyHelper.read (i);
}
public void _write (org.omg.CORBA.portable.OutputStream o)
{
scs.auxiliar.UndefinedPropertyHelper.write (o, value);
}
public org.omg.CORBA.TypeCode _type ()
{
return scs.auxiliar.UndefinedPropertyHelper.type ();
}
}
|
[
"azambuja@gmail.com"
] |
azambuja@gmail.com
|
1c725af4dec862856fbe99abc1fdc122dd734088
|
f909ec612f17254be491c3ef9cdc1f0b186e8daf
|
/spring_plugin/spring_demo/spring_threads/src/main/chapter9/Future/Q4/Data.java
|
c09d2d476b6567cb4f77572e5352cb6a15d4e4f0
|
[] |
no_license
|
kingking888/jun_java_plugin
|
8853f845f242ce51aaf01dc996ed88784395fd83
|
f57e31fa496d488fc96b7e9bab3c245f90db5f21
|
refs/heads/master
| 2023-06-04T19:30:29.554726
| 2021-06-24T17:19:55
| 2021-06-24T17:19:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 87
|
java
|
package Future.Q4;
public interface Data {
public abstract String getContent();
}
|
[
"wujun728@hotmail.com"
] |
wujun728@hotmail.com
|
663eb903e7868d23258393e08deb6760a2f806fd
|
9ccb9d678487a7b5fa140f69c8dc08b010ee5185
|
/src/main/java/com/fanyank/pojo/User.java
|
75d7130927d82dbd962bfdc6baf8680026102a31
|
[] |
no_license
|
Fish-Fan/MyBatisDemo
|
6131f8b074d85b33f7513286b81234b7dffda235
|
ed8ab63a274dbb1a2132f957df2e6b6e44bdb37f
|
refs/heads/master
| 2021-01-19T21:40:53.478090
| 2017-04-19T09:07:29
| 2017-04-19T09:07:29
| 88,687,170
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 865
|
java
|
package com.fanyank.pojo;
import java.io.InputStream;
/**
* Created by yanfeng-mac on 2017/4/18.
*/
public class User {
private Integer id;
private String username;
private String password;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "user{" +
"id=" + id +
", username='" + username + '\'' +
", password='" + password + '\'' +
'}';
}
}
|
[
"fanyank@126.com"
] |
fanyank@126.com
|
277addeff71aeef238cc259606121f0675d2f39e
|
98249942c2d0301a787f4bba6e4d0477f7609ecc
|
/src/main/java/com/diettracker/webapp/controller/RegisterController.java
|
cd1786c2b6d90eabc81b4b76ccd5cb8e383a585a
|
[] |
no_license
|
ogzhndgn/DietTracker
|
ee2f82fb60132d864193bc1b484064855ed2b75f
|
66198c1c4d7938ecca667ac5a0cfb4126cd0ce4d
|
refs/heads/master
| 2021-01-17T09:48:53.786019
| 2018-02-01T06:42:49
| 2018-02-01T06:42:49
| 38,979,394
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,856
|
java
|
package com.diettracker.webapp.controller;
import com.diettracker.webapp.controller.base.BaseController;
import com.diettracker.webapp.exception.spec.ServiceException;
import com.diettracker.webapp.model.User;
import com.diettracker.webapp.service.spec.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
/**
* @author the Poet <dogan_oguzhan@hotmail.com> 21.6.2015
*/
@Controller
public class RegisterController extends BaseController {
@Autowired
UserService userService;
@RequestMapping(value = "/register", method = RequestMethod.POST)
public ModelAndView registerPost(HttpServletRequest request) {
try {
String email = request.getParameter("email");
String password = request.getParameter("password");
String confirmPassword = request.getParameter("confirm-password");
User user = userService.registerUser(email, password, confirmPassword);
super.setSessionInfo(user, request);
return new ModelAndView("redirect:/profile");
} catch (ServiceException e) {
return this.returnToRegisterForm(e.getMessage());
}
}
private ModelAndView returnToRegisterForm(String apiErrorCode) {
ModelAndView modelAndView = new ModelAndView("login/login");
modelAndView.addObject("showRegisterForm", true);
modelAndView.addObject("showLoginForm", false);
modelAndView.addObject("showErrorMessage", true);
modelAndView.addObject("errorMessage", apiErrorCode);
return modelAndView;
}
}
|
[
"dogan_oguzhan@hotmail.com"
] |
dogan_oguzhan@hotmail.com
|
b2d8d849d618d7ce3f9c5d754354f3ce8c71d5c1
|
8f006c1b5f0e583b525bd7494f7dabf029eae557
|
/AbstractFactoryPattern/DuckSimulator.java
|
a6a09fc390921568efb236b0be4f743b86441e35
|
[] |
no_license
|
wipa-frn/duckdesignpatterns
|
832f8aedaa976eca30fe59e2a851ff0cb6289545
|
4fde56ff2d42652949bebb998dfefc139c5e8b63
|
refs/heads/master
| 2020-03-31T09:19:41.872427
| 2018-10-08T14:15:35
| 2018-10-08T14:15:35
| 152,091,565
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,621
|
java
|
package AbstractFactoryPattern;
import AdapterPattern.GooseAdapter;
import AdapterPattern.PigeonAdapter;
import DecoratorPattern.QuackCounter;
import Duck.Goose;
import Duck.Pigeon;
import Duck.Quackable;
public class DuckSimulator {
/*Abstract ใช้เพื่อให้ง่ายต่อการสร้างคลาสที่มี Decorator หลายๆอย่าง*/
public static void main(String[] args) {
DuckSimulator simulator = new DuckSimulator();
AbstractDuckFactory duckFactory = new DuckFactory();
AbstractDuckFactory countingDuckFactory = new CountingDuckFactory();
AbstractDuckFactory countingEchoDuckFactory = new EchoAndCountDuckFactory();
simulator.simulate(countingEchoDuckFactory);
}
void simulate(AbstractDuckFactory duckFactory){
Quackable mallardDuck = duckFactory.createMallardDuck();
Quackable redheadDuck = duckFactory.createRedheadDuck();
Quackable duckCall = duckFactory.createDuckCll();
Quackable rubberDuck = duckFactory.createRubberDuck();
Quackable gooseDuck = new GooseAdapter(new Goose());
Quackable pigeonDuck = new PigeonAdapter(new Pigeon());
System.out.println("\nDuck Simulator: Abstract Factory");
simulate(mallardDuck);
simulate(redheadDuck);
simulate(duckCall);
simulate(rubberDuck);
simulate(gooseDuck);
simulate(pigeonDuck);
System.out.println("The ducks quacked " + QuackCounter.getQuack() + " times");
}
void simulate(Quackable duck){
duck.quack();
}
}
|
[
"wipawadee.mo@ku.th"
] |
wipawadee.mo@ku.th
|
4d0ebb951c1c350e6cf77d3ec97df295b432ac58
|
95eca33fdd213984c03837e052cb013cb84785ca
|
/src/main/java/messages/webSocket/BaseServerPlaylistStateSMsg.java
|
b9b7002e0ecd6c39e89985de939e226b27552c12
|
[] |
no_license
|
DenysKomissarov/websocketclient
|
6aefef8b4ea539920f3e60ad4ffb2ecd1431d686
|
6f7a247b585b760cf618d5ec71477943919248d6
|
refs/heads/master
| 2021-06-12T15:11:49.721193
| 2020-01-06T19:21:47
| 2020-01-06T19:21:47
| 183,286,844
| 0
| 0
| null | 2021-06-04T02:14:38
| 2019-04-24T18:40:17
|
Java
|
UTF-8
|
Java
| false
| false
| 1,811
|
java
|
package messages.webSocket;
import entities.SocketPlaylistStatus;
import org.codehaus.jackson.annotate.JsonProperty;
public class BaseServerPlaylistStateSMsg extends BaseServerNotificationSMsg {
@JsonProperty("playlist_id")
private String playlistID;
@JsonProperty("playlist_status")
private SocketPlaylistStatus playlistStatus;
@JsonProperty("track_id")
private String trackID;
@JsonProperty("track_position")
private long trackPosition;
@JsonProperty("action_time")
private long actionTime;
public BaseServerPlaylistStateSMsg(String eventId, String playlistID, SocketPlaylistStatus playlistStatus, String trackID, long trackPosition) {
super(eventId);
this.playlistID = playlistID;
this.playlistStatus = playlistStatus;
this.trackID = trackID;
this.trackPosition = trackPosition;
this.actionTime = System.currentTimeMillis();
}
public long getActionTime() {
return actionTime;
}
public void setActionTime(long actionTime) {
this.actionTime = actionTime;
}
public String getPlaylistID() {
return playlistID;
}
public void setPlaylistID(String playlistID) {
this.playlistID = playlistID;
}
public SocketPlaylistStatus getPlaylistStatus() {
return playlistStatus;
}
public void setPlaylistStatus(SocketPlaylistStatus playlistStatus) {
this.playlistStatus = playlistStatus;
}
public String getTrackID() {
return trackID;
}
public void setTrackID(String trackID) {
this.trackID = trackID;
}
public long getTrackPosition() {
return trackPosition;
}
public void setTrackPosition(long trackPosition) {
this.trackPosition = trackPosition;
}
}
|
[
"komissarov9927@gmail.com"
] |
komissarov9927@gmail.com
|
27e1df88f614f224edce72344e49a6c3a61cccc9
|
a5902db24e25cab51b48a611f558d09ee5b09a0d
|
/src/test/java/cn/acyou/ibloges/practice/Elasticsearch4Student.java
|
f1750f7dfd6635f9d8eb6e6cb571d47ac5fc2cc9
|
[] |
no_license
|
f981545521/iblog-es
|
49e304faa4c562c57d9ad06664cc34a46fff617b
|
39fb80434ed60923840aac30648d0f9a1a85295a
|
refs/heads/master
| 2020-03-28T19:27:23.356372
| 2018-12-13T06:25:02
| 2018-12-13T06:25:02
| 148,978,032
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,803
|
java
|
package cn.acyou.ibloges.practice;
import com.alibaba.fastjson.JSONObject;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.transport.client.PreBuiltTransportClient;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* @author youfang
* @version [1.0.0, 2018-09-18 下午 06:02]
**/
public class Elasticsearch4Student {
private Logger logger = LoggerFactory.getLogger(Elasticsearch4Student.class);
public final static String HOST = "127.0.0.1";
public final static int PORT = 9300;//http请求的端口是9200,客户端是9300
private TransportClient client = null;
@SuppressWarnings("resource")
@Before
public void beforeProduce() throws UnknownHostException {
//创建客户端
Settings settings = Settings.builder().put("cluster.name", "iblog-es").build();
client = new PreBuiltTransportClient(settings).addTransportAddresses(
new InetSocketTransportAddress(InetAddress.getByName(HOST),PORT));
logger.debug("Elasticsearch connect info:" + client.toString());
}
@After
public void afterProduce(){
client.close();
}
@Test
public void prepareTest(){
System.out.println("SUCCESS");
}
/**
* 3、Elasticsearch索引库的创建
* 创建索引库
* 需求:创建一个索引库为:student,类型为:tweet,id为1
* 索引库的名称必须为小写
*/
@Test
public void addIndex1() throws IOException {
IndexResponse response = client.prepareIndex("student", "logs", "1").setSource(XContentFactory.jsonBuilder()
.startObject()//生成文档
.field("id", "1")
.field("name", "刘邦")
.field("age", "11")
.field("birth", new Date())
.field("update_time", new Date())
.endObject()).get();
logger.info("索引名称:" + response.getIndex() + "类型:" + response.getType()
+ "文档ID:" + response.getId() + "当前实例状态:" + response.status());
}
/**
* 删除索引
*/
@Test
public void deleteIndex() {
DeleteIndexResponse response = client.admin().indices()
.prepareDelete("student")
.get();
System.out.println("SUCCESS");
}
/**
* 4、向索引库中添加json字符串
*/
@Test
public void addIndex2() {
String jsonStr = "{" +
"\"userName\":\"张三\"," +
"\"sendDate\":\"2017-11-30\"," +
"\"msg\":\"你好李四\"" +
"}";
IndexResponse response = client.prepareIndex("weixin", "tweet").setSource(jsonStr, XContentType.JSON).get();
logger.info("json索引名称:" + response.getIndex() + "json类型:" + response.getType()
+ "json文档ID:" + response.getId() + "当前实例json状态:" + response.status());
}
/**
* 5、向索引库添加一个Map集合
*/
@Test
public void addIndex3() {
Map<String, Object> map = new HashMap<String,Object>();
map.put("userName", "张三");
map.put("sendDate", new Date());
map.put("msg", "你好李四");
IndexResponse response = client.prepareIndex("momo", "tweet").setSource(map).get();
logger.info("map索引名称:" + response.getIndex() + " map类型:" + response.getType()
+ " map文档ID:" + response.getId() + "当前实例map状态:" + response.status());
}
/**
* 6、向索引库添加JsonObject
* 传递json对象
*/
@Test
public void addIndex4() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("userName", "张三");
jsonObject.put("sendDate", "2017-11-23");
jsonObject.put("msg","你好李四");
IndexResponse response = client.prepareIndex("qq", "tweet").setSource(jsonObject, XContentType.JSON).get();
logger.info("jsonObject索引名称:" + response.getIndex() + " jsonObject类型:" + response.getType()
+ " jsonObject文档ID:" + response.getId() + "当前实例jsonObject状态:" + response.status());
}
/**
* 7、从索引库获取数据
*/
@Test
public void getData1() {
GetResponse getResponse = client.prepareGet("student", "tweet", "1").get();
logger.info("索引库的数据:" + getResponse.getSourceAsString());
}
/**
* 8、更新索引库数据
*/
@Test
public void updateData() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("userName", "王五");
jsonObject.put("sendDate", "2008-08-08");
jsonObject.put("msg","你好,张三,好久不见");
UpdateResponse updateResponse = client.prepareUpdate("msg", "tweet", "1")
.setDoc(jsonObject.toString(),XContentType.JSON).get();
logger.info("updateResponse索引名称:" + updateResponse.getIndex() + " updateResponse类型:" + updateResponse.getType()
+ " updateResponse文档ID:" + updateResponse.getId() + "当前实例updateResponse状态:" + updateResponse.status());
}
/**
* 9、删除索引库的数据
* 根据索引名称,类别,文档ID 删除索引库的数据
*/
@Test
public void deleteData() {
DeleteResponse deleteResponse = client.prepareDelete("student", "tweet", "1").get();
logger.info("deleteResponse索引名称:" + deleteResponse.getIndex() + " deleteResponse类型:" + deleteResponse.getType()
+ " deleteResponse文档ID:" + deleteResponse.getId() + "当前实例deleteResponse状态:" + deleteResponse.status());
}
// 创建索引
@Test
public void createIndex() {
String indexName = "student";
client.admin().indices().create(new CreateIndexRequest(indexName))
.actionGet();
}
}
|
[
"981545521@qq.com"
] |
981545521@qq.com
|
18a9758c5fa496097a031ff4c24e47ddb5c0d799
|
1d1ee8bb1c54b8fcc19add3bd2a1699fbed59b89
|
/src/phoneTester/SimplifyLoopTester.java
|
bf71f7d101d5c887c076dd58e23ffcba339c8f97
|
[] |
no_license
|
xn1990114/GOOG-My-Code
|
49047322db4f39021b843d06db9894e8e8b82a77
|
8fc5126c709a636d6218df3bdfe193538c62a9ff
|
refs/heads/master
| 2021-07-13T01:16:12.717102
| 2020-05-10T00:39:43
| 2020-05-10T00:39:43
| 100,756,319
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,057
|
java
|
package phoneTester;
import static org.junit.Assert.*;
import org.junit.Test;
import phone.SimplifyLoop;
public class SimplifyLoopTester {
@Test
public void test() {
SimplifyLoop tester=new SimplifyLoop();
int[][] nums1={{ 0, 1, 2, 3, 4},
{ 5, 6, 7, 8, 9},
{10,11,12,13,14}};
assertTrue(tester.isCorrectResult(tester.print2DPerfectArray(nums1)));
assertTrue(tester.isCorrectResult(tester.print2DInPerfectArray(nums1)));
int[][] nums2={{ 0, 1, 2,},
{ 3, 4, 5, 6, 7, 8, 9},
{10,11},
{},
null,
{12,13,14},
{15},
null,
{16,17,18,19,20},
{}};
assertTrue(tester.isCorrectResult(tester.print2DInPerfectArray(nums2)));
int[][] nums3={{ 0, 1, 2,},
{ 3, 4, 5, 6, 7, 8, 9},
{10,11},
{},
null,
{12,13,14},
{15},
null,
{16,17,18,19,20},
null};
assertTrue(tester.isCorrectResult(tester.print2DInPerfectArray(nums3)));
}
}
|
[
"xn1990114@hotmail.com"
] |
xn1990114@hotmail.com
|
e2b5b23c804ec4f03960e0d7563b9edb06e96b1f
|
ebaa87421a1a325c747103968d77f81107aefd9d
|
/src/main/java/com/zhrenjie04/alex/util/Base64Util.java
|
00669d709543bb625987a7a411100ce11f4af54e
|
[
"MIT"
] |
permissive
|
shaochanglei/ep-core
|
a2c13ebddd61a87a84353b658e0627933a241120
|
37a48f797137c63cfa5567bbbd568adb236d6c10
|
refs/heads/master
| 2022-12-16T23:22:16.021917
| 2020-09-19T17:43:42
| 2020-09-19T17:43:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,744
|
java
|
package com.zhrenjie04.alex.util;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.CharArrayWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
/**
* Base64 编码和解码。
*
* @author 张人杰
*/
public class Base64Util {
private Base64Util() {
}
/**
* 解码字符串
*
* @param data 源字符串
* @return String
*/
public static byte[] decode(String data) {
return decode(data.toCharArray());
}
/**
* 编码byte[]
*
* @param data 源
* @return char[]
*/
public static String encode(byte[] data) {
char[] out = new char[((data.length + 2) / 3) * 4];
for (int i = 0, index = 0; i < data.length; i += 3, index += 4) {
boolean quad = false;
boolean trip = false;
int val = (0xFF & data[i]);
val <<= 8;
if ((i + 1) < data.length) {
val |= (0xFF & data[i + 1]);
trip = true;
}
val <<= 8;
if ((i + 2) < data.length) {
val |= (0xFF & data[i + 2]);
quad = true;
}
out[index + 3] = alphabet[(quad ? (val & 0x3F) : 64)];
val >>= 6;
out[index + 2] = alphabet[(trip ? (val & 0x3F) : 64)];
val >>= 6;
out[index + 1] = alphabet[val & 0x3F];
val >>= 6;
out[index + 0] = alphabet[val & 0x3F];
}
if (out != null) {
return new String(out);
} else {
return null;
}
}
/**
* 解码
*
* @param data 编码后的字符数组
* @return byte[]
*/
public static byte[] decode(char[] data) {
int tempLen = data.length;
for (int ix = 0; ix < data.length; ix++) {
if ((data[ix] > 255) || codes[data[ix]] < 0) {
--tempLen; // ignore non-valid chars and padding
}
}
// calculate required length:
// -- 3 bytes for every 4 valid base64 chars
// -- plus 2 bytes if there are 3 extra base64 chars,
// or plus 1 byte if there are 2 extra.
int len = (tempLen / 4) * 3;
if ((tempLen % 4) == 3) {
len += 2;
}
if ((tempLen % 4) == 2) {
len += 1;
}
byte[] out = new byte[len];
int shift = 0; // # of excess bits stored in accum
int accum = 0; // excess bits
int index = 0;
// we now go through the entire array (NOT using the 'tempLen' value)
for (int ix = 0; ix < data.length; ix++) {
int value = (data[ix] > 255) ? -1 : codes[data[ix]];
if (value >= 0) { // skip over non-code
accum <<= 6; // bits shift up by 6 each time thru
shift += 6; // loop, with new bits being put in
accum |= value; // at the bottom.
if (shift >= 8) { // whenever there are 8 or more shifted in,
shift -= 8; // write them out (from the top, leaving any
out[index++] = // excess at the bottom for next iteration.
(byte) ((accum >> shift) & 0xff);
}
}
}
// if there is STILL something wrong we just have to throw up now!
if (index != out.length) {
throw new Error("Miscalculated data length (wrote " + index + " instead of " + out.length + ")");
}
return out;
}
/**
* 编码文件
*
* @param file 源文件
*/
public static void encode(File file) throws IOException {
if (!file.exists()) {
System.exit(0);
}
else {
byte[] decoded = readBytes(file);
String encoded = encode(decoded);
writeData(file, encoded);
}
file = null;
}
/**
* 解码文件。
*
* @param file 源文件
* @throws IOException
*/
public static void decode(File file) throws IOException {
if (!file.exists()) {
System.exit(0);
} else {
char[] encoded = readChars(file);
byte[] decoded = decode(encoded);
writeBytes(file, decoded);
}
file = null;
}
//
// code characters for values 0..63
//
private static char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".toCharArray();
//
// lookup table for converting base64 characters to value in range 0..63
//
private static byte[] codes = new byte[256];
static {
for (int i = 0; i < 256; i++) {
codes[i] = -1;
// LoggerUtil.debug(i + "&" + codes[i] + " ");
}
for (int i = 'A'; i <= 'Z'; i++) {
codes[i] = (byte) (i - 'A');
// LoggerUtil.debug(i + "&" + codes[i] + " ");
}
for (int i = 'a'; i <= 'z'; i++) {
codes[i] = (byte) (26 + i - 'a');
// LoggerUtil.debug(i + "&" + codes[i] + " ");
}
for (int i = '0'; i <= '9'; i++) {
codes[i] = (byte) (52 + i - '0');
// LoggerUtil.debug(i + "&" + codes[i] + " ");
}
codes['+'] = 62;
codes['/'] = 63;
}
private static byte[] readBytes(File file) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] b = null;
InputStream fis = null;
InputStream is = null;
try {
fis = new FileInputStream(file);
is = new BufferedInputStream(fis);
int count = 0;
byte[] buf = new byte[16384];
while ((count = is.read(buf)) != -1) {
if (count > 0) {
baos.write(buf, 0, count);
}
}
b = baos.toByteArray();
} finally {
try {
if (fis != null)
fis.close();
if (is != null)
is.close();
if (baos != null)
baos.close();
} catch (Exception e) {
System.out.println(e);
}
}
return b;
}
private static char[] readChars(File file) throws IOException {
CharArrayWriter caw = new CharArrayWriter();
Reader fr = null;
Reader in = null;
try {
fr = new FileReader(file);
in = new BufferedReader(fr);
int count = 0;
char[] buf = new char[16384];
while ((count = in.read(buf)) != -1) {
if (count > 0) {
caw.write(buf, 0, count);
}
}
} finally {
try {
if (caw != null)
caw.close();
if (in != null)
in.close();
if (fr != null)
fr.close();
} catch (Exception e) {
System.out.println(e);
}
}
return caw.toCharArray();
}
private static void writeBytes(File file, byte[] data) throws IOException {
OutputStream fos = null;
OutputStream os = null;
try {
fos = new FileOutputStream(file);
os = new BufferedOutputStream(fos);
os.write(data);
} finally {
try {
if (os != null)
os.close();
if (fos != null)
fos.close();
} catch (Exception e) {
System.out.println(e);
}
}
}
private static void writeData(File file, String data) throws IOException {
Writer fos = null;
Writer os = null;
try {
fos = new FileWriter(file);
os = new BufferedWriter(fos);
os.write(data);
} finally {
try {
if (os != null)
os.close();
if (fos != null)
fos.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
|
[
"zhangrenjie1981@outlook.com"
] |
zhangrenjie1981@outlook.com
|
c978f6eef2efffd8f4b1457db5be5ae3680476aa
|
8d55613d99044d4965592652994a879ec787e3ad
|
/src/main/java/com/crop/seagulls/service/impl/CompanyRejectionServiceImpl.java
|
f7124b7c332ef3dfcb319be5766a7ed000edc595
|
[] |
no_license
|
servanter/seagulls
|
381605b949af9b744fc5768838492480f692cd42
|
524fe3ae0d2f1bc937ae7ea39bcc818d4156a419
|
refs/heads/master
| 2016-08-07T07:07:58.001472
| 2016-02-20T19:05:27
| 2016-02-20T19:05:27
| 39,960,978
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,131
|
java
|
package com.crop.seagulls.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.crop.seagulls.bean.Response;
import com.crop.seagulls.bean.ReturnCode;
import com.crop.seagulls.dao.CompanyRejectionDAO;
import com.crop.seagulls.entities.CompanyRejection;
import com.crop.seagulls.service.CompanyRejectionService;
@Service
public class CompanyRejectionServiceImpl implements CompanyRejectionService {
@Autowired
private CompanyRejectionDAO companyRejectionDAO;
@Override
public Response add(CompanyRejection rejection) {
return companyRejectionDAO.save(rejection) > 0 ? new Response(ReturnCode.SUCCESS) : new Response(ReturnCode.ERROR);
}
@Override
public Response batchAdd(List<CompanyRejection> rejections) {
companyRejectionDAO.batchSave(rejections);
return new Response(ReturnCode.SUCCESS);
}
@Override
public CompanyRejection findByCompanyId(Long id) {
return companyRejectionDAO.getByCompanyId(id);
}
}
|
[
"fengshang@126.com"
] |
fengshang@126.com
|
8927b46be93fd2a88930ff3879c31f153d9e9375
|
4afb523352f5325c6ddb5a15386525a37c12eb9c
|
/src/_2_juc/_1_monitor_mid/App00.java
|
46b82665bbcdc0b84d054eb67c331d6fdfd27629
|
[] |
no_license
|
artemyakovenko28/Multithreading
|
45ec7bad24e570a467ad433dae7ab10178c77096
|
92456ef85fc7ba897989edb4f91cd81f01d3b602
|
refs/heads/master
| 2021-04-29T23:10:02.493237
| 2019-09-14T09:02:50
| 2019-09-14T09:02:50
| 121,549,885
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,199
|
java
|
package _2_juc._1_monitor_mid;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
/**
* j.u.c:
* - queue
* - collections
* - synchronizers
* - atomic
* - ???
*/
//Producers/Consumers
public class App00 {
public static void main(String[] args) {
BlockingQueue<String> queue = new ArrayBlockingQueue<>(16);
//Producer
for (int k = 0; k < 3; k++) {
int finalK = k;
new Thread(new Runnable() {
@Override
public void run() {
int counter = 0;
while (true) {
// throw new Error();
try {
Thread.sleep(300 + 1000 * finalK);
String data = "elem-" + finalK + "/" + ++counter;
queue.put(data);
System.out.println("put: " + data);
} catch (InterruptedException ignore) {/*NOP*/}
}
}
}).start();
//Consumer
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
// System.out.println("... wait for take");
String data = queue.take(); // block thread
// Integer data = queue.poll(5, TimeUnit.SECONDS); // block thread for 5 seconds
// if (data == null) {
// System.out.println("No data");
// }
// Integer data = queue.poll(); // null
// Integer data = queue.remove() // NoSuchElementException
System.out.println("take: " + data);
} catch (InterruptedException ignore) {/*NOP*/}
// process(data);
}
}
}).start();
}
}
private static void process(int data) {
System.out.println("process: " + data);
}
}
|
[
"jeep2801@gmail.com"
] |
jeep2801@gmail.com
|
6c66b0f080fe2271d66a207718812850e9402b5e
|
64706f428df6a5d195100784775d3f3eaab5112a
|
/douyu-parent/service-project/douyu-service-interface/src/main/java/com/lei2j/douyu/vo/FrankVo.java
|
add268f291ab8d51e0e7dca3fb5e33a10eadee9b
|
[] |
no_license
|
SharkeyChen/douyu
|
7febfb91f673cd21b26ca9ac04e29d26875cbc56
|
343e5afc7d67c2d7297be4fae39e43440e61a8ba
|
refs/heads/master
| 2022-11-06T23:59:26.077483
| 2020-06-07T09:46:01
| 2020-06-07T09:46:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,042
|
java
|
package com.lei2j.douyu.vo;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author lei2j
*/
public class FrankVo implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private Integer rid;
private Integer fc;
private String bnn;
private LocalDate currentDate;
public FrankVo() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getRid() {
return rid;
}
public void setRid(Integer rid) {
this.rid = rid;
}
public Integer getFc() {
return fc;
}
public void setFc(Integer fc) {
this.fc = fc;
}
public String getBnn() {
return bnn;
}
public void setBnn(String bnn) {
this.bnn = bnn;
}
public LocalDate getCurrentDate() {
return currentDate;
}
public void setCurrentDate(LocalDate currentDate) {
this.currentDate = currentDate;
}
}
|
[
"leijinjun@panpay.com.cn"
] |
leijinjun@panpay.com.cn
|
f58a3d7b0b484da6dafb46d7dcce34478eafb967
|
783ec023a43eef000c741d8ceaa97d5d5f1c20fa
|
/java/audioplayer/src/main/java/com/hhtd/audioplayer/App.java
|
fd6ba86dca7e1de01e562ee366ab07f7833e548e
|
[
"Apache-2.0"
] |
permissive
|
wardensky/wardensky-demo
|
da21e1e1757e5eec6fa41b4a54ef6c3261f42259
|
9faf1653e8d648799104fe21a4ddd08b0c43a240
|
refs/heads/master
| 2021-09-14T07:02:53.037353
| 2018-05-09T05:37:29
| 2018-05-09T05:37:29
| 107,880,183
| 0
| 0
|
Apache-2.0
| 2018-05-09T06:45:15
| 2017-10-22T15:51:02
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 12,039
|
java
|
package com.hhtd.audioplayer;
import java.awt.Button;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioFormat.Encoding;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.SourceDataLine;
public class App {
private void playSound(byte[] content) throws Exception {
AudioFormat format = new AudioFormat(Encoding.PCM_SIGNED, 44100.0f, 24, 2, 6, 44100.0f, false);
DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info);
line.open(format);// 或者line.open();format参数可有可无
line.start();
line.write(content, 0, content.length);
line.drain();
line.close();
}
private byte[] convertShortArray(short[] shortArray) {
byte[] ret = new byte[shortArray.length * 2];
int i = 0;
for (i = 0; i < shortArray.length; i++) {
ret[i * 2] = (byte) (shortArray[i] & 0xff);
ret[i * 2 + 1] = (byte) ((shortArray[i] >> 8) & 0xff);
}
return ret;
}
private byte[] readContent(String file) throws Exception {
List<Byte> data = new ArrayList<Byte>();
AudioInputStream cin = AudioSystem.getAudioInputStream(new File(file));
int nBytesRead = 0;
byte[] buffer = new byte[512];
while (true) {
nBytesRead = cin.read(buffer, 0, buffer.length);
if (nBytesRead <= 0)
break;
for (int i = 0; i < nBytesRead; i++) {
data.add(buffer[i]);
}
}
byte[] ret = new byte[data.size()];
int i = 0;
for (Byte b : data) {
ret[i] = b;
i++;
}
return ret;
}
private void playWavTest() throws Exception {
byte[] data = this.readContent("/Users/zch/tmp/qqqq.wav");
this.playSound(data);
}
private void playWav() throws Exception {
String file = "/Users/zch/tmp/qqqq.wav";
AudioInputStream cin = AudioSystem.getAudioInputStream(new File(file));
AudioFormat format = cin.getFormat();
DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info);
line.open(format);// 或者line.open();format参数可有可无
line.start();
int nBytesRead = 0;
byte[] buffer = new byte[512];
while (true) {
nBytesRead = cin.read(buffer, 0, buffer.length);
if (nBytesRead <= 0)
break;
line.write(buffer, 0, nBytesRead);
}
line.drain();
line.close();
}
public static void main(String[] args) throws Exception {
App app = new App();
// app.playWav();
app.create();
}
private void create() throws Exception {
for (int i = 0; i < 1; i++) {
playSound((short) 0x33B8, (byte) 0xF9);
System.out.println("33B8F9 频道-");
}
for (int i = 0; i < 2; i++) {
// playSound((short) 0x33B8, (byte) 0x77);
// System.out.println("33B877 频道-");
}
}
/*
* 注释作者:xgh 时间:2017.10.23 作用:播放声音,将最终信号通过耳机口发送出去 参数: userCode:设备ID编号
* dataCode:指令数据码 返回:无
*/
private void playSound(short userCode, byte dataCode) throws Exception {
short[] dst = new short[44100];
short[] recieve = getWave(userCode, dataCode);
for (int i = 0; i < recieve.length; i++) {
dst[i] = recieve[i];
System.out.print(recieve[i]);
}
byte[] data = this.convertShortArray(dst);
this.playSound(data);
}
/*
* 注释作者:xgh 时间:2017.10.23 作用:得到一段时间内的指定占空比的正弦信号的PCM编码 参数: time :时间
* percent:指代红外编码的高低电平 返回:编码结果
*/
private short[] genTone(double time, float percent) {
int numSamples = (int) (time / 1000 * sampleRate);
short generatedSnd[] = new short[numSamples];
// fill out the array
for (int i = 0; i < numSamples; ++i) {
// generatedSnd[i] = (short)(8000*percent*Math.sin(2* Math.PI*
// freqOfTone* i* 1000/sampleRate)+(percent *20000));
// generatedSnd[i] = (short)(30000*percent*Math.sin(2* Math.PI*
// freqOfTone* i* 1000/sampleRate));
generatedSnd[i] = (short) (32000 * percent);
}
return generatedSnd;
}
/*
* 注释作者:xgh 时间:2017.10.23 作用:获取在NEC红外协议里定义的逻辑 0 ,即560us的载波+560us的低电平 参数:无
* 返回:NEC红外协议里定义的逻辑 0 的PCM编码数组
*/
private short[] getLow() {
// (1.125-0.56) + 0.56
// INFRARED_0_HIGH_WIDTH 0.56
// INFRARED_0_LOW_WIDTH 0.565 // 1.125 - 0.56
short[] one = genTone(INFRARED_0_HIGH_WIDTH, 1);
short[] two = genTone(INFRARED_0_LOW_WIDTH, 0);
short[] combined = new short[one.length + two.length];
System.arraycopy(one, 0, combined, 0, one.length);
System.arraycopy(two, 0, combined, one.length, two.length);
return combined;
}
/*
* 注释作者:xgh 时间:2017.10.23 作用:获取在NEC红外协议里定义的逻辑 1 ,即560us的载波+1.69us的低电平 参数:无
* 返回:NEC红外协议里定义的逻辑 1 的PCM编码数组
*/
private short[] getHigh() {
// 0.56ms + (2.25 - 0.56)
// INFRARED_1_HIGH_WIDTH 0.56
// INFRARED_1_LOW_WIDTH 1.69 // 2.25 - 0.56
short[] one = genTone(INFRARED_1_HIGH_WIDTH, 1);
short[] two = genTone(INFRARED_1_LOW_WIDTH, 0);
short[] combined = new short[one.length + two.length];
System.arraycopy(one, 0, combined, 0, one.length);
System.arraycopy(two, 0, combined, one.length, two.length);
return combined;
}
/*
* 注释作者:xgh 时间:2017.10.23 作用:得到NEC消息帧的开始编码 参数:无 返回:一帧消息的组成数组
*/
private short[] getleaderCode() {
// 9.0ms + 4.50ms Infrared
// INFRARED_LEADERCODE_HIGH_WIDTH 9.0
// INFRARED_LEADERCODE_LOW_WIDTH 4.50
short[] one = genTone(INFRARED_LEADERCODE_HIGH_WIDTH, 1);
short[] two = genTone(INFRARED_LEADERCODE_LOW_WIDTH, 0);
short[] combined = new short[one.length + two.length];
System.arraycopy(one, 0, combined, 0, one.length);
System.arraycopy(two, 0, combined, one.length, two.length);
return combined;
}
/*
* 注释作者:xgh 时间:2017.10.23 作用:得到NEC消息帧的中红外协议的设备ID 参数:userCode:设备ID
* 返回:设备ID编码数组
*/
private short[] getUserCodeToWave(short userCode) {
ArrayList<short[]> wave_list = new ArrayList<short[]>();
int totalLength = 0;
for (int i = 0; i < 16; ++i) { // 取最高位
if (((userCode >> (15 - i)) & 0x1) == 1) { // 1
wave_list.add(getHigh());
} else { // 0
wave_list.add(getLow());
}
totalLength += wave_list.get(i).length;
}
int currentPosition = 0;
short userCodeWaveArray[] = new short[totalLength];
for (short[] byteArray : wave_list) {
System.arraycopy(byteArray, 0, userCodeWaveArray, currentPosition, byteArray.length);
currentPosition += byteArray.length;
}
return userCodeWaveArray;
}
/*
* 注释作者:xgh 时间:2017.10.23 作用:得到NEC消息帧的中红外协议的数据码 参数:dataCode:指令数据 返回:指令数据编码数组
*/
private short[] getDataCodeToWave(byte dataCode) {
ArrayList<short[]> wave_list = new ArrayList<short[]>();
int totalLength = 0;
// 取最高位
for (int i = 0; i < 8; ++i) { // sign-and-magnitude
if (((dataCode >> (7 - i)) & 0x1) == 1) { // 1
wave_list.add(getHigh());
} else { // 0
wave_list.add(getLow());
}
totalLength += wave_list.get(i).length;
}
// 取最高位
for (int i = 0; i < 8; ++i) { // ones'complement
if (((dataCode >> (7 - i)) & 0x1) == 1) { // 1
wave_list.add(getLow());
} else { // 0
wave_list.add(getHigh());
}
totalLength += wave_list.get(8 + i).length;
}
int currentPosition = 0;
short userCodeWaveArray[] = new short[totalLength];
for (short[] byteArray : wave_list) {
System.arraycopy(byteArray, 0, userCodeWaveArray, currentPosition, byteArray.length);
currentPosition += byteArray.length;
}
return userCodeWaveArray;
}
/*
* 注释作者:xgh 时间:2017.10.23 作用:得到NEC消息帧的中红外协议的停止位 参数:无 返回:指令数据编码数组
*/
private short[] getStopBit() {
// 0.56ms
// INFRARED_STOPBIT_HIGH_WIDTH 0.56
return genTone(INFRARED_STOPBIT_HIGH_WIDTH, 1);
}
/*
* 注释作者:xgh 时间:2017.10.23 作用:制作一帧消息,将一帧消息中的所有组成添加到一个数组里 参数:无 返回:一帧消息的组成数组
*/
private short[] getWave(short userCode, byte dataCode) {
if (mDebug)
System.out.println(
"userCode = 0x" + Integer.toHexString(userCode) + " dataCode = 0x" + Integer.toHexString(dataCode));
ArrayList<short[]> wave_list = new ArrayList<short[]>();
int totalLength = 0;
// wave_list.add(getTou());
wave_list.add(getleaderCode());
wave_list.add(getUserCodeToWave(userCode));
wave_list.add(getDataCodeToWave(dataCode));
wave_list.add(getStopBit());
wave_list.add(genTone(DELAY_WIDTH, 0));
wave_list.add(getleaderCode());
wave_list.add(getStopBit());
for (short[] byteTmp : wave_list)
totalLength += byteTmp.length;
int currentPosition = 0;
short totalWaveArray[] = new short[totalLength];
for (short[] byteArray : wave_list) {
System.arraycopy(byteArray, 0, totalWaveArray, currentPosition, byteArray.length);
currentPosition += byteArray.length;
}
return totalWaveArray;
}
private short[] getTou() {
ArrayList<short[]> wave_list = new ArrayList<short[]>();
int totalLength = 0;
for (int i = 0; i < 3; ++i) {
wave_list.add(genTone(10, 0)); // 10ms 0 //10ms的低电平编码
// for(int j=1; j<4; ++j) { // 取最高位
// wave_list.add(getLittleHigh());
// }
wave_list.add(genTone(10, 0)); // 10ms 0
}
for (short[] byteTmp : wave_list)
totalLength += byteTmp.length;
int currentPosition = 0;
short userCodeWaveArray[] = new short[totalLength];
for (short[] byteArray : wave_list) {
System.arraycopy(byteArray, 0, userCodeWaveArray, currentPosition, byteArray.length);
currentPosition += byteArray.length;
}
return userCodeWaveArray;
}
/*
* 注释作者:xgh 时间:2017.10.23 作用:唔。。暂时还不知道作用 参数:无 返回:不知作用的数组
*/
private short[] getLittleHigh() {
short[] one = genTone(INFRARED_1_LOW_WIDTH, 0.08f);
short[] two = genTone(INFRARED_1_HIGH_WIDTH, 0);
short[] combined = new short[one.length + two.length];
System.arraycopy(one, 0, combined, 0, one.length);
System.arraycopy(two, 0, combined, one.length, two.length);
return combined;
}
// WaveService wave = new WaveService();
private final String LOG_TAG = "WaveService";
private final boolean mDebug = false;
private final int duration = 10; // seconds
private Button Btn_r;
/**
* 音频采样频率,在录音中同样会有类似参数;通俗讲是每秒进行44100次采样。
* 详见:http://en.wikipedia.org/wiki/44,100_Hz
*/
private final int sampleRate = 44100;
private int numSamples = duration * sampleRate;
// private final double sample[] = new double[numSamples];
private final double freqOfTone = 25000; // hz 20000=>20khz(50us) 最高0.56f ;
// private final byte generatedSnd[] = new byte[2 * numSamples];
/** Data "1" 高电平宽度 */
private final float INFRARED_1_HIGH_WIDTH = 0.56f * 2;
/** Data "1" 低电平宽度 */
private final float INFRARED_1_LOW_WIDTH = 1.69f * 2; // 2.25 - 0.56
/** Data "0" 高电平宽度 */
private final float INFRARED_0_HIGH_WIDTH = 0.56f * 2;
/** Data "0" 低电平宽度 */
private final float INFRARED_0_LOW_WIDTH = 0.565f * 2;// 1.125-0.56
/** Leader code 高电平宽度 */
private final float INFRARED_LEADERCODE_HIGH_WIDTH = 9.0f * 2;
/** Leader code 低电平宽度 */
private final float INFRARED_LEADERCODE_LOW_WIDTH = 4.50f * 2;
/** Stop bit 高电平宽度 */
private final float INFRARED_STOPBIT_HIGH_WIDTH = 0.56f * 2;
/** Stop bit 高电平宽度 */
private final float DELAY_WIDTH = 78;
}
|
[
"zhaochunhui1985@gmail.com"
] |
zhaochunhui1985@gmail.com
|
0288235bfbb747adfcdfedb28e946f693b99d3d3
|
037c7eac3e2b3241eac591828f65d15b397595ff
|
/order-entry/src/test/java/com/singlestone/petstore/orderentry/OrderEntryApplicationTests.java
|
1ccc34fe1b7ab9286cf4dd9eb46576196a890c34
|
[] |
no_license
|
baskar83/single-stone
|
dc5c83c445387830d46baf1f16774455cf136213
|
9f3e08f6b039b889b29e3107edb16cc304a5bdd4
|
refs/heads/master
| 2020-03-26T19:20:23.969545
| 2018-08-20T13:35:58
| 2018-08-20T13:35:58
| 145,259,985
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,182
|
java
|
package com.singlestone.petstore.orderentry;
import com.singlestone.petstore.orderentry.valueobject.OrderSummaryVO;
import com.singlestone.petstore.orderentry.valueobject.OrderVO;
import com.singlestone.petstore.orderentry.valueobject.ProductQuantityVO;
import org.junit.Assert;
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.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class OrderEntryApplicationTests {
@Autowired
private TestRestTemplate restTemplate;
@Test
public void testOrderEntryServices() {
OrderVO orderVO = createOrderVo("1234");
orderVO.getItems().add(createQuatityVO(10, "0a207870"));
restTemplate.postForLocation("/order/entry", orderVO);
ResponseEntity<OrderSummaryVO> summaryResp = restTemplate.getForEntity("/order/entry/summary/1234", OrderSummaryVO.class);
Assert.assertEquals(summaryResp.getStatusCode(), HttpStatus.OK);
OrderSummaryVO summaryVO = summaryResp.getBody();
Assert.assertNotNull(summaryVO);
Assert.assertEquals(orderVO.getCustomerId(), summaryVO.getCustomerId());
Assert.assertEquals(10, summaryVO.getItemsCount());
//10 * 9.95 = 99.50
Assert.assertEquals("99.50", summaryVO.getGrandTotal());
orderVO.getItems().add(createQuatityVO(10, "8ed0e6f7")) ;
restTemplate.postForLocation("/order/entry", orderVO);
summaryResp = restTemplate.getForEntity("/order/entry/summary/1234", OrderSummaryVO.class);
summaryVO = summaryResp.getBody();
Assert.assertEquals(20, summaryVO.getItemsCount());
//(10 * 9.95) + (10 * 124.95) = 1349.00
Assert.assertEquals("1349.00", summaryVO.getGrandTotal());
orderVO.getItems().add(createQuatityVO(10, "c0258525")) ;
restTemplate.postForLocation("/order/entry", orderVO);
summaryResp = restTemplate.getForEntity("/order/entry/summary/1234", OrderSummaryVO.class);
summaryVO = summaryResp.getBody();
Assert.assertEquals(30, summaryVO.getItemsCount());
//(10 * 9.95) + (10 * 124.95) + (10 * 3.50) = 1384.00
Assert.assertEquals("1384.00", summaryVO.getGrandTotal());
}
private OrderVO createOrderVo(String cusId){
OrderVO orderVO = new OrderVO();
orderVO.setCustomerId(cusId);
List<ProductQuantityVO> productQuantityVOS = new ArrayList<>();
orderVO.setItems(productQuantityVOS);
return orderVO;
}
private ProductQuantityVO createQuatityVO(int count, String prdId){
ProductQuantityVO productQuantityVO = new ProductQuantityVO();
productQuantityVO.setProductId(prdId);
productQuantityVO.setQuantity(count);
return productQuantityVO;
}
}
|
[
"baskar.dilli@capitalone.com"
] |
baskar.dilli@capitalone.com
|
425b205cd3d4076073fb66a71cd447a08edb48dd
|
3e0044a8ec6561a3721a39d788895192874f547d
|
/latte-ec/src/main/java/cn/peyton/android/latte/ec/main/sort/list/VerticalListDelegate.java
|
334aa3fa283c49bbe0ad8f0134f5461b9f34b56d
|
[] |
no_license
|
peyton2919/FastEC
|
37210730a0f84052578298fa6f7dd27dee6383c0
|
c9c850340910fff46abfe033780bb8a5c46cecc8
|
refs/heads/master
| 2021-09-03T03:23:40.084901
| 2018-01-05T05:46:15
| 2018-01-05T05:46:15
| 113,952,357
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,420
|
java
|
package cn.peyton.android.latte.ec.main.sort.list;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import java.util.List;
import butterknife.BindView;
import cn.peyton.android.latte.core.delegates.LatteDelegate;
import cn.peyton.android.latte.core.net.RestClient;
import cn.peyton.android.latte.core.net.callback.ISuccess;
import cn.peyton.android.latte.core.ui.recycler.MultipleItemEntity;
import cn.peyton.android.latte.ec.R;
import cn.peyton.android.latte.ec.R2;
import cn.peyton.android.latte.ec.main.sort.SortDelegate;
/**
* <pre>
* 垂直列表
* </pre>
* <p>
* 作者 <a href="http://www.peyton.cn">peyton</a>
* 邮箱 <a href="mailto:fz2919@tom.com">fz2919@tom.com</a>
* 创建时间 ${date} ${time}
* 版本 1.0.0
*/
public class VerticalListDelegate extends LatteDelegate{
@BindView(R2.id.rv_vertical_menu_list)
RecyclerView mRecyclerView = null;
@Override
public Object setLayout() {
return R.layout.delegate_vertical_list;
}
@Override
public void onBindView(@Nullable Bundle savedInstanceState, View rootView) {
initRecyclerView();
}
/**
* 数据软加载
* @param savedInstanceState
*/
@Override
public void onLazyInitView(@Nullable Bundle savedInstanceState) {
super.onLazyInitView(savedInstanceState);
RestClient.builder()
.url("o2o/api/sortdata")
.loader(getContext())
.success(new ISuccess() {
@Override
public void onSuccess(String response) {
final List<MultipleItemEntity> data = new VerticalListDataConverter().setJsonData(response).convert();
final SortDelegate delegate = getParentDelegate();
final SortRecyclerAdapter adapter = new SortRecyclerAdapter(data, delegate);
mRecyclerView.setAdapter(adapter);
}
})
.build()
.get();
}
private void initRecyclerView() {
final LinearLayoutManager manager = new LinearLayoutManager(getContext());
mRecyclerView.setLayoutManager(manager);
//屏蔽动画效果
mRecyclerView.setItemAnimator(null);
}
}
|
[
"fz2919@tom.com"
] |
fz2919@tom.com
|
360b4b2dc6ceaf0451680aa6f4aa7c3f63509267
|
e3988d2db65b93f32197f26022343202084f9f7f
|
/services/rovermar01/src/com/roverpoc/rovermar01/service/TestNcliteProdMessagesService.java
|
f8b486967d38341ba89297dcdae60024d310bca0
|
[] |
no_license
|
stevefoxredhound/roverPOCWebDev
|
af8e1f39961c506c94bc8bed5aac368f24be8c8e
|
b093a64dd0d26906f97dfe9adb7c52fe9a4e939b
|
refs/heads/master
| 2021-01-10T03:28:57.521187
| 2016-02-26T09:46:31
| 2016-02-26T09:46:31
| 51,293,146
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,937
|
java
|
/*Copyright (c) 2015-2016 redhound.net All Rights Reserved.
This software is the confidential and proprietary information of redhound.net You shall not disclose such Confidential Information and shall use it only in accordance
with the terms of the source code license agreement you entered into with redhound.net*/
package com.roverpoc.rovermar01.service;
/*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.wavemaker.runtime.data.expression.QueryFilter;
import com.wavemaker.runtime.data.exception.EntityNotFoundException;
import com.roverpoc.rovermar01.*;
/**
* Service object for domain model class TestNcliteProdMessages.
* @see com.roverpoc.rovermar01.TestNcliteProdMessages
*/
public interface TestNcliteProdMessagesService {
/**
* Creates a new testncliteprodmessages.
*
* @param created
* The information of the created testncliteprodmessages.
* @return The created testncliteprodmessages.
*/
public TestNcliteProdMessages create(TestNcliteProdMessages created);
/**
* Deletes a testncliteprodmessages.
*
* @param testncliteprodmessagesId
* The id of the deleted testncliteprodmessages.
* @return The deleted testncliteprodmessages.
* @throws EntityNotFoundException
* if no testncliteprodmessages is found with the given id.
*/
public TestNcliteProdMessages delete(Integer testncliteprodmessagesId) throws EntityNotFoundException;
/**
* Finds all testncliteprodmessagess.
*
* @return A list of testncliteprodmessagess.
*/
public Page<TestNcliteProdMessages> findAll(QueryFilter[] queryFilters, Pageable pageable);
public Page<TestNcliteProdMessages> findAll(Pageable pageable);
/**
* Finds testncliteprodmessages by id.
*
* @param id
* The id of the wanted testncliteprodmessages.
* @return The found testncliteprodmessages. If no testncliteprodmessages is found, this method returns
* null.
*/
public TestNcliteProdMessages findById(Integer id) throws
EntityNotFoundException;
/**
* Updates the information of a testncliteprodmessages.
*
* @param updated
* The information of the updated testncliteprodmessages.
* @return The updated testncliteprodmessages.
* @throws EntityNotFoundException
* if no testncliteprodmessages is found with given id.
*/
public TestNcliteProdMessages update(TestNcliteProdMessages updated) throws EntityNotFoundException;
/**
* Retrieve the total count of the testncliteprodmessagess in the repository.
*
* @param None
* .
* @return The count of the testncliteprodmessages.
*/
public long countAll();
public Page<TestNcliteProdMessages> findAssociatedValues(Object value, String entityName, String key, Pageable pageable);
}
|
[
"graham.templeton@redhound.net"
] |
graham.templeton@redhound.net
|
cc0f6201bc6d2e512c9252350c6b01d716ea1fe0
|
a0c4f4492c07a2cb7cf6f45376ef20a9363f4370
|
/src/main/java/com.fsm/StateMachine.java
|
27b97abb8d5d57d501bac2c80fb557041c82c150
|
[] |
no_license
|
aggarwal-vibhuti/state-machine
|
741f9ea3f08cb215b7a8ac07fc3d008ac13ef8dd
|
80f9e624d89e62a6b77c9d65063a49c84b9f91b1
|
refs/heads/master
| 2022-11-24T07:05:27.078403
| 2020-07-27T16:37:16
| 2020-07-27T16:37:16
| 282,683,049
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,300
|
java
|
package com.fsm;
import com.fsm.entities.Context;
import com.fsm.entities.EventType;
import com.fsm.entities.Transition;
import com.fsm.executors.ErrorAction;
import com.fsm.executors.EventAction;
import com.fsm.exceptions.FSMRunTimeException;
import com.fsm.exceptions.InvalidTransitionException;
import com.fsm.models.Event;
import com.fsm.models.State;
import com.fsm.services.ActionService;
import com.fsm.services.StateManagementService;
import com.fsm.services.TransitionService;
import com.google.common.collect.Multimap;
import lombok.extern.slf4j.Slf4j;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
@Slf4j
public class StateMachine<C extends Context> {
private final TransitionService transitionService;
private final StateManagementService stateManagementService;
private final ActionService actionService;
public StateMachine(
State startState,
TransitionService transitionService,
StateManagementService stateManagementService,
ActionService actionService) {
this.transitionService = transitionService;
this.stateManagementService = stateManagementService;
this.actionService = actionService;
this.stateManagementService.setFrom(startState);
this.actionService.setHandler(EventType.ERROR, null, null, new DefaultErrorAction());
}
public void addTransition(State state, Transition transition) {
transitionService.addTransition(state, transition);
}
public void addEndStates(Collection<State> endStates) {
stateManagementService.addEndStates(endStates);
}
public Optional<Transition> getTransition(State from, Event event) {
return transitionService.getTransition(from, event);
}
public Set<Transition> getAllowedTransitions(State from) {
Multimap<State, Transition> allTransitions = transitionService.getTransitionDetails();
return (Set<Transition>) allTransitions.get(from);
}
public void fire(final Event event, final C context) {
final State from = context.getFrom();
final Optional<Transition> transition = getTransition(from, event);
if (!transition.isPresent()) {
throw new InvalidTransitionException(
"Invalid Event: " + event + " triggered while in State: " + context.getFrom() + " for " + context);
}
State to = transition.get().getTo();
context.setTo(to);
actionService.handleTransition(context);
}
public <C extends Context> StateMachine<C> onTransition(EventAction<C> transition) {
actionService.onTransition(transition);
return (StateMachine<C>) this;
}
public static class DefaultErrorAction implements ErrorAction<Context> {
@Override
public void call(FSMRunTimeException error, Context context) {
String errorMessage = "Runtime Error in state [" + error.getState() + "]";
if (!Objects.isNull(error.getEvent())) {
errorMessage += "on Event [" + error.getEvent() + "]";
}
errorMessage += "with context [" + error.getContext() + "]";
log.error("ERROR", new Exception(errorMessage, error));
}
}
}
|
[
"vibhuti.a2511@gmail.com"
] |
vibhuti.a2511@gmail.com
|
0285f2d5ccd17d1635e86e9df4db71ff77f5cc3c
|
a5cd85faa0408919a6e3b165804d95894a47c088
|
/SpeechToText/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/v7/viewpager/R.java
|
c7ed759f3346b9b6b9189ac5ada97e26fc8ecf34
|
[] |
no_license
|
SherazHussain110/SpeechToText
|
5221b0497a6e068e7b34895910213ee94b7ef966
|
037af46164708a192333498f19d8b1f5b56d3f11
|
refs/heads/master
| 2020-08-07T07:05:43.543276
| 2019-10-07T10:08:24
| 2019-10-07T10:08:24
| 213,344,583
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 10,459
|
java
|
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.v7.viewpager;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f020027;
public static final int font = 0x7f02007a;
public static final int fontProviderAuthority = 0x7f02007c;
public static final int fontProviderCerts = 0x7f02007d;
public static final int fontProviderFetchStrategy = 0x7f02007e;
public static final int fontProviderFetchTimeout = 0x7f02007f;
public static final int fontProviderPackage = 0x7f020080;
public static final int fontProviderQuery = 0x7f020081;
public static final int fontStyle = 0x7f020082;
public static final int fontVariationSettings = 0x7f020083;
public static final int fontWeight = 0x7f020084;
public static final int ttcIndex = 0x7f02013c;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f04003e;
public static final int notification_icon_bg_color = 0x7f04003f;
public static final int ripple_material_light = 0x7f040049;
public static final int secondary_text_default_material_light = 0x7f04004b;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f05004d;
public static final int compat_button_inset_vertical_material = 0x7f05004e;
public static final int compat_button_padding_horizontal_material = 0x7f05004f;
public static final int compat_button_padding_vertical_material = 0x7f050050;
public static final int compat_control_corner_material = 0x7f050051;
public static final int compat_notification_large_icon_max_height = 0x7f050052;
public static final int compat_notification_large_icon_max_width = 0x7f050053;
public static final int notification_action_icon_size = 0x7f05005d;
public static final int notification_action_text_size = 0x7f05005e;
public static final int notification_big_circle_margin = 0x7f05005f;
public static final int notification_content_margin_start = 0x7f050060;
public static final int notification_large_icon_height = 0x7f050061;
public static final int notification_large_icon_width = 0x7f050062;
public static final int notification_main_column_padding_top = 0x7f050063;
public static final int notification_media_narrow_margin = 0x7f050064;
public static final int notification_right_icon_size = 0x7f050065;
public static final int notification_right_side_padding_top = 0x7f050066;
public static final int notification_small_icon_background_padding = 0x7f050067;
public static final int notification_small_icon_size_as_large = 0x7f050068;
public static final int notification_subtext_size = 0x7f050069;
public static final int notification_top_pad = 0x7f05006a;
public static final int notification_top_pad_large_text = 0x7f05006b;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f060057;
public static final int notification_bg = 0x7f060058;
public static final int notification_bg_low = 0x7f060059;
public static final int notification_bg_low_normal = 0x7f06005a;
public static final int notification_bg_low_pressed = 0x7f06005b;
public static final int notification_bg_normal = 0x7f06005c;
public static final int notification_bg_normal_pressed = 0x7f06005d;
public static final int notification_icon_background = 0x7f06005e;
public static final int notification_template_icon_bg = 0x7f06005f;
public static final int notification_template_icon_low_bg = 0x7f060060;
public static final int notification_tile_bg = 0x7f060061;
public static final int notify_panel_notification_icon_bg = 0x7f060062;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f07000d;
public static final int action_divider = 0x7f07000f;
public static final int action_image = 0x7f070010;
public static final int action_text = 0x7f070017;
public static final int actions = 0x7f070018;
public static final int async = 0x7f07001e;
public static final int blocking = 0x7f070021;
public static final int chronometer = 0x7f07002a;
public static final int forever = 0x7f07003e;
public static final int icon = 0x7f070044;
public static final int icon_group = 0x7f070045;
public static final int info = 0x7f070048;
public static final int italic = 0x7f07004a;
public static final int line1 = 0x7f07004c;
public static final int line3 = 0x7f07004d;
public static final int normal = 0x7f070055;
public static final int notification_background = 0x7f070056;
public static final int notification_main_column = 0x7f070057;
public static final int notification_main_column_container = 0x7f070058;
public static final int right_icon = 0x7f070061;
public static final int right_side = 0x7f070062;
public static final int tag_transition_group = 0x7f070082;
public static final int tag_unhandled_key_event_manager = 0x7f070083;
public static final int tag_unhandled_key_listeners = 0x7f070084;
public static final int text = 0x7f070085;
public static final int text2 = 0x7f070086;
public static final int time = 0x7f070089;
public static final int title = 0x7f07008a;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f080004;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f09001d;
public static final int notification_action_tombstone = 0x7f09001e;
public static final int notification_template_custom_big = 0x7f09001f;
public static final int notification_template_icon_group = 0x7f090020;
public static final int notification_template_part_chronometer = 0x7f090021;
public static final int notification_template_part_time = 0x7f090022;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0b002d;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0c00ed;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00ee;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00ef;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0c00f0;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0c00f1;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0c0159;
public static final int Widget_Compat_NotificationActionText = 0x7f0c015a;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f02007c, 0x7f02007d, 0x7f02007e, 0x7f02007f, 0x7f020080, 0x7f020081 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f02007a, 0x7f020082, 0x7f020083, 0x7f020084, 0x7f02013c };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
|
[
"sherazhussain360@gmil.com"
] |
sherazhussain360@gmil.com
|
ef11ecdfce14b8c19cd2ca6e26869395700390cf
|
9dbdbb5c537619b14f9102dcbe758a06bc969ed0
|
/src/test/java/sanbox/SanBoxAutomation/AppTest.java
|
8a65256e4d764e583b8e87f7d53538971f6c5192
|
[] |
no_license
|
ArpitaLook/SanBox
|
55ce28a297b051586933aa3a02d6688b2096e3e7
|
3d7bf0798604a1870cbca824ae6f586f75c5148c
|
refs/heads/main
| 2023-04-10T23:24:48.669361
| 2021-04-25T19:10:06
| 2021-04-25T19:10:06
| 361,515,545
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 295
|
java
|
package sanbox.SanBoxAutomation;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
|
[
"lookarpu@gmail.com"
] |
lookarpu@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.