blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4cce432c2a8bf20f792768065bc90fff56b91d61 | 249ad8a5846cc16e4ba67b647a61be9c7e72af27 | /Messenger/src/messenger/Messenger.java | 7a94045a4c39e6ea8efcacbe4aa4bc13e8ac7281 | [] | no_license | sumitrastogi1998/Messenger | e95045ac1f90615fab96a2a9f976a08312f858a4 | b7b6b86faee1b1750d741679f6cdb38059485aa0 | refs/heads/master | 2020-04-19T23:23:12.643976 | 2019-01-31T08:58:45 | 2019-01-31T08:58:45 | 168,494,312 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 531 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package messenger;
/**
*
* @author sumit
*/
public class Messenger {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
chat_server obj = new chat_server();
obj.setTitle("Server");
chat_client ob = new chat_client();
ob.setTitle("Client");
}
}
| [
"nanurastogi98"
] | nanurastogi98 |
41872cb0c32f74ba67158ed46d7398865bde8e7b | c2b2e65d514564421a5bb5e3fbf4eb476d23ffc9 | /app/src/main/java/com/company/MainActivity.java | 96a1166356d9c34bd8360a9baab609acb1ba600a | [] | no_license | hubapp-co/android | 31167019d4bf686ef51a4fc457232e5404d1b5b7 | 9bd1db9d65733e223c50d53cb68a2fa120f8981c | refs/heads/master | 2021-04-16T19:29:19.008212 | 2020-03-23T09:52:47 | 2020-03-23T09:52:47 | 249,379,868 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,571 | java | package com.company;
import android.content.Intent;
import android.os.Bundle;
import com.company.hub.R;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.tabs.TabLayout;
import androidx.annotation.NonNull;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import com.company.ui.main.SectionsPagerAdapter;
public class MainActivity extends AppCompatActivity {
boolean doubleBackToExit = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
SectionsPagerAdapter sectionsPagerAdapter = new SectionsPagerAdapter(this, getSupportFragmentManager());
ViewPager viewPager = findViewById(R.id.view_pager);
viewPager.setAdapter(sectionsPagerAdapter);
TabLayout tabs = findViewById(R.id.tabs);
tabs.setupWithViewPager(viewPager);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Add Your Interest Here", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.navigation);
// BottomNavigationViewHelper.disableShiftMode(bottomNavigationView);
Menu menu = bottomNavigationView.getMenu();
MenuItem menuItem = menu.getItem(3);
menuItem.setChecked(true);
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.home:
Intent home = new Intent(MainActivity.this, BottomMainActivity.class);
startActivity(home);
finish();
break;
case R.id.foody:
//
Intent intent2 = new Intent(MainActivity.this, EventsActivity.class);
intent2.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent2);
break;
case R.id.review:
Intent notif = new Intent(MainActivity.this, FeedPostActivity.class);
notif.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(notif);
break;
case R.id.search:
Intent intent1 = new Intent(MainActivity.this, MainActivity.class);
intent1.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent1);
break;
case R.id.profile:
Intent intent4 = new Intent(MainActivity.this, BottomProfileActivity.class);
intent4.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent4);
break;
}
return true;
}
});
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onBackPressed() {
if (doubleBackToExit) {
Intent setIntent = new Intent(Intent.ACTION_MAIN);
setIntent.addCategory(Intent.CATEGORY_HOME);
setIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(setIntent);
} else {
Toast.makeText(this, "Press Back again to Exit.",
Toast.LENGTH_SHORT).show();
doubleBackToExit = true;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
doubleBackToExit = false;
}
}, 3 * 1000);
}
}
} | [
"[email protected]"
] | |
06846a335267bd5489940ca6471ec2f9ca620d69 | f732db9b98b8dbf1aed2e4050e3e5a9a58cbbc91 | /src/main/java/com/benbarron/react/function/Func.java | f6a293fe2e53bfd5314a7f89088d5a0e23cc3ea3 | [
"MIT"
] | permissive | Ben-Barron/React | 07e1829130dda90cb17c18fcdc6b5b321d941f2d | 437a61be2041116081a27bfc4aee5e362228b74e | refs/heads/master | 2021-01-19T08:16:18.743622 | 2015-03-04T09:07:45 | 2015-03-04T09:07:45 | 24,813,692 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 120 | java | package com.benbarron.react.function;
@FunctionalInterface
public interface Func<T> {
T run() throws Exception;
}
| [
"[email protected]"
] | |
b76a45938b5827339e4a0f42ffeb478723df4ba0 | 83d43f5669af117db9e647255bd97670381d2493 | /Spring/SampleAll0319/src/kh/com/a/controller/PollController.java | 73784192a1fecc1ef0046885cbd33b8f94c6da4f | [] | no_license | PSH7766/KH | 3000b568322ccee22523920cf9ae79499c8cb5ce | 26c458c591bd56d69cb635dafef0a6db42f27278 | refs/heads/master | 2023-03-15T22:25:37.537449 | 2018-11-14T08:50:28 | 2018-11-14T08:50:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,748 | java | package kh.com.a.controller;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import kh.com.a.model.MemberDto;
import kh.com.a.model.PollBean;
import kh.com.a.model.PollDto;
import kh.com.a.model.Voter;
import kh.com.a.service.PollService;
@Controller
public class PollController {
private static final Logger logger = LoggerFactory.getLogger(PollController.class);
@Autowired
private PollService pollService;
@RequestMapping(value="polllist.do",method= {RequestMethod.GET,RequestMethod.POST})
public String polllist(HttpServletRequest req, Model model) {
logger.info("PollController polllist");
model.addAttribute("doc_title", "투표목록");
String id = ((MemberDto)req.getSession().getAttribute("login")).getId();
model.addAttribute("plists", pollService.getPollAlllist(id));
return "polllist.tiles";
}
@RequestMapping(value="pollmake.do", method={RequestMethod.GET,RequestMethod.POST})
public String pollmake(Model model) {
logger.info("PollController pollmake");
return "pollmake.tiles";
}
@RequestMapping(value="pollmakeAf.do", method={RequestMethod.GET,RequestMethod.POST})
public String pollmakeAf(PollBean pbeen, Model model) {
logger.info("PollController pollmakeAf");
pollService.makePoll(pbeen);
return "redirect:/polllist.do";
//return "forword:/polllist.do";
}
@RequestMapping(value="polldetail.do", method={RequestMethod.GET,RequestMethod.POST})
public String polldetail(PollDto poll, Model model) {
logger.info("PollController polldetail");
model.addAttribute("doc_title", "투표내용");
model.addAttribute("poll", pollService.getPoll(poll));
model.addAttribute("pollsublist", pollService.getPollSubList(poll));
return "polldetail.tiles";
}
@RequestMapping(value="polling.do", method={RequestMethod.GET,RequestMethod.POST})
public String polling(Voter voter, Model model) {
logger.info("PollController polling");
pollService.polling(voter);
return "redirect:/polllist.do";
}
@RequestMapping(value="pollresult.do", method={RequestMethod.GET,RequestMethod.POST})
public String pollresult(PollDto poll, Model model) {
logger.info("PollController pollresult");
model.addAttribute("doc_title","투표결과");
model.addAttribute("poll", pollService.getPoll(poll));
model.addAttribute("pollsublist", pollService.getPollSubList(poll));
return "pollresult.tiles";
}
} | [
"[email protected]"
] | |
7b25861dd43cc8dafaefe05d261870f7f3451d4b | 00b05565b5258ff11570881ad38e68e062cfd6e2 | /MainActivity/gen/com/example/mobileindustrycast/R.java | 8d65e714773f427a491c34052d15f9f3a521fb04 | [] | no_license | Borisbalde/EclipseWorkspace | a3ec27d0ef4647e4fdc8c80df21571eda2e22792 | 2c39edf59f022b363215d1715f888e32c8fbe7dd | refs/heads/master | 2020-04-26T19:00:33.309459 | 2013-02-12T15:04:09 | 2013-02-12T15:04:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,750 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.example.mobileindustrycast;
public final class R {
public static final class array {
public static final int pref_example_list_titles=0x7f060000;
public static final int pref_example_list_values=0x7f060001;
public static final int pref_sync_frequency_titles=0x7f060002;
public static final int pref_sync_frequency_values=0x7f060003;
}
public static final class attr {
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
public static final int icon1=0x7f020001;
public static final int icon2=0x7f020002;
public static final int searchbutton=0x7f020003;
}
public static final class id {
public static final int ChatRoom=0x7f090007;
public static final int broadcastBtn=0x7f090008;
public static final int chatBox=0x7f09000b;
public static final int email=0x7f090003;
public static final int login=0x7f090005;
public static final int login_form=0x7f090002;
public static final int login_status=0x7f090000;
public static final int login_status_message=0x7f090001;
public static final int menu_forgot_password=0x7f09000c;
public static final int menu_settings=0x7f09000d;
public static final int messageTxt=0x7f09000a;
public static final int password=0x7f090004;
public static final int sendBtn=0x7f090009;
public static final int sign_in_button=0x7f090006;
}
public static final class layout {
public static final int activity_login=0x7f030000;
public static final int activity_main=0x7f030001;
}
public static final class menu {
public static final int activity_login=0x7f080000;
public static final int activity_main=0x7f080001;
}
public static final class string {
public static final int _string=0x7f050003;
public static final int action_sign_in_register=0x7f050007;
public static final int action_sign_in_short=0x7f050008;
public static final int app_name=0x7f050000;
public static final int error_field_required=0x7f05000e;
public static final int error_incorrect_password=0x7f05000d;
public static final int error_invalid_email=0x7f05000b;
public static final int error_invalid_password=0x7f05000c;
public static final int hello_world=0x7f050001;
public static final int login_progress_signing_in=0x7f05000a;
public static final int menu_forgot_password=0x7f050009;
public static final int menu_settings=0x7f050002;
public static final int pref_default_display_name=0x7f050014;
public static final int pref_description_social_recommendations=0x7f050012;
/** Example settings for Data & Sync
*/
public static final int pref_header_data_sync=0x7f050016;
/** Strings related to Settings
Example General settings
*/
public static final int pref_header_general=0x7f050010;
/** Example settings for Notifications
*/
public static final int pref_header_notifications=0x7f050019;
public static final int pref_ringtone_silent=0x7f05001c;
public static final int pref_title_add_friends_to_messages=0x7f050015;
public static final int pref_title_display_name=0x7f050013;
public static final int pref_title_new_message_notifications=0x7f05001a;
public static final int pref_title_ringtone=0x7f05001b;
public static final int pref_title_social_recommendations=0x7f050011;
public static final int pref_title_sync_frequency=0x7f050017;
public static final int pref_title_system_sync_settings=0x7f050018;
public static final int pref_title_vibrate=0x7f05001d;
/** Strings related to login
*/
public static final int prompt_email=0x7f050005;
public static final int prompt_password=0x7f050006;
public static final int title_activity_login=0x7f050004;
public static final int title_activity_settings=0x7f05000f;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f070000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f070001;
public static final int LoginFormContainer=0x7f070002;
}
public static final class xml {
public static final int pref_data_sync=0x7f040000;
public static final int pref_general=0x7f040001;
public static final int pref_headers=0x7f040002;
public static final int pref_notification=0x7f040003;
}
}
| [
"[email protected]"
] | |
b6869bc5e7d60befe770f722693622803e806520 | f7cf8ed98e49df3c8ee99bcfeca1477551f19f71 | /app/src/main/java/com/glc/myapplication/fragment/fragment1.java | 0aaac9dae37c68560a07e524eb50452fe2a4e145 | [] | no_license | zjy2002/Rui | 7a9decd44842ae5b543a559cd10e7d0a1ab45c2d | 83a6f3aa62b200ec4f96a87f861cb007aafd2dc8 | refs/heads/main | 2023-02-13T11:09:22.913699 | 2021-01-02T07:55:32 | 2021-01-02T07:55:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,325 | java | package com.glc.myapplication.fragment;
import android.content.res.AssetManager;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.glc.myapplication.R;
import com.kaisengao.likeview.like.KsgLikeView;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
public class fragment1 extends Fragment {
private TextView tv1;//倒计时
private Handler handler;
private Handler handler2;
private ImageView image1;
private ImageView image2;//小红心
private ImageView image3;
private KsgLikeView mLikeView;
private LinearLayout lv_center;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment1, null);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
tv1 = view.findViewById(R.id.tv_textDaojishi);
image1 = view.findViewById(R.id.f1_image1);
image2 = view.findViewById(R.id.f1_image2);
image3 = view.findViewById(R.id.f1_image3);
lv_center=view.findViewById(R.id.lv_lv_center);
//设置字体样式
AssetManager mgr = getActivity().getAssets();
tv1.setTypeface(Typeface.createFromAsset(mgr, "font/fanxing.ttf"));
mLikeView = view.findViewById(R.id.live_view);
mLikeView.addLikeImage(R.drawable.heart0);
mLikeView.addLikeImage(R.drawable.heart1);
mLikeView.addLikeImage(R.drawable.heart2);
mLikeView.addLikeImage(R.drawable.heart3);
mLikeView.addLikeImage(R.drawable.heart4);
mLikeView.addLikeImage(R.drawable.heart5);
mLikeView.addLikeImage(R.drawable.heart6);
mLikeView.addLikeImage(R.drawable.heart7);
mLikeView.addLikeImage(R.drawable.heart8);
//小红心点击出现飘心效果
lv_center.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mLikeView.addFavor();
}
});
//自动定时执行小心心飘出
handler2=new Handler();
handler2.post(new Runnable() {
@Override
public void run() {
try {
mLikeView.addFavor();//飘出小心心
}catch (Exception e){
e.printStackTrace();
}
handler2.postDelayed(this,1000);
}
});
//时间每隔一秒刷新
handler = new Handler();
handler.post(new Runnable() {
@Override
public void run() {
String s = dateDiff("2020-05-04 22:20:00");
tv1.setText(s);
tv1.setTextColor(Color.parseColor("#DDA0DD"));
handler.postDelayed(this, 1000);
}
});
//设置圆形头像效果
RequestOptions options = RequestOptions.circleCropTransform();
Glide.with(getActivity()).load(R.drawable.f1t1).apply(options).into(image1);
Glide.with(getActivity()).load(R.drawable.f1t2).apply(options).into(image3);
}
/**
* 获取时间差的方法
*
* @param endTime
* @return
*/
public String dateDiff(String endTime) {
String strTime = null;
// 按照传入的格式生成一个simpledateformate对象
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
long nh = 1000 * 60 * 60;// 一小时的毫秒数
long nm = 1000 * 60;// 一分钟的毫秒数
long ns = 1000;// 一秒钟的毫秒数
long diff;
long day = 0;
Date curDate = new Date(System.currentTimeMillis());//获取当前时间
String str = sd.format(curDate);
try {
// 获得两个时间的毫秒时间差异
diff = sd.parse(endTime).getTime()
- sd.parse(str).getTime();
day = diff / nd;// 计算差多少天
long hour = diff % nd / nh;// 计算差多少小时
long min = diff % nd % nh / nm;// 计算差多少分钟
long sec = diff % nd % nh % nm / ns;// 计算差多少秒
String s = day + "天" + hour + "时" + min + "分" + sec + "秒";
return s.replaceAll("-", "");
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
@Override
public void onDestroy() {
super.onDestroy();
handler.removeCallbacksAndMessages(null);
handler2.removeCallbacksAndMessages(null);
}
}
| [
"[email protected]"
] | |
0c3f8345556c638d832b62613b0993c7d12c8298 | 01ec09dcd0649ef99b6f2c62e3829d7c016fdd4a | /coupons-shared/src/main/java/com/chainz/coupon/shared/objects/CouponStatus.java | a0d8f3a9c7afe23acd7e19dd47e2ca2a7deaa98c | [] | no_license | yuzhaocai/coupons | d489142581937139dbfc12e8f54dccb3435ec3f0 | 85a3a3586ef4017f63029d8367637316ed67796c | refs/heads/master | 2020-03-23T16:02:17.002056 | 2017-03-21T06:00:37 | 2017-03-21T06:00:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 130 | java | package com.chainz.coupon.shared.objects;
/** Coupon status. */
public enum CouponStatus {
UNVERIFIED,
VERIFIED,
INVALID
}
| [
"[email protected]"
] | |
ffc1ca255a15026be2d20091fbba3dbbd4e7182e | c757bad7ffafa0b4f60f7525022f470674ccd225 | /src/main/java/com/example/quizapp/QuizFileDao.java | 183d89f5a7573f22b29cf3643f9078a9b2bc750b | [] | no_license | FallstagAtsugi/-MiniGames | c58aa4a9b81975ca67a19fb72018577b08809a3a | 563c7b1ba25bc07079de898028a9596f12f6fd17 | refs/heads/master | 2022-12-19T11:07:34.544878 | 2020-09-24T11:47:03 | 2020-09-24T11:47:03 | 298,261,319 | 0 | 0 | null | 2020-09-29T10:44:04 | 2020-09-24T11:43:11 | Java | UTF-8 | Java | false | false | 1,122 | java | package com.example.quizapp;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
public class QuizFileDao {
private static final String MAKE_TEN = "makeTen.txt";
private static final String FILE_PATH = "quizzes.txt";
public void write(List<Quiz> quizzes) throws IOException {
List<String> lines = new ArrayList<>();
for (Quiz quiz : quizzes) {
lines.add(quiz.toString());
}
Path path = Paths.get(MAKE_TEN);
//第一引数:Path(場所) 第二引数:書き込むデータList<String>
Files.write(path, lines);
}
public List<Quiz> read() throws IOException {
Path path = Paths.get(MAKE_TEN);
List<String> lines = Files.readAllLines(path);
//ListをQuiz型にしてあげる必要がある。からのリストを用意する
List<Quiz> quizzes = new ArrayList<>();
for (String line : lines) {
quizzes.add(Quiz.fromString(line));
}
return quizzes;
}
}
| [
"[email protected]"
] | |
1f7d6e334fb5b6c26bca5a7d8e85b97cd8b792e5 | c85a0a2bfde12b012a00bcfb1cb49bbd57c2e696 | /cmfz/src/main/java/com/baizhi/controller/CountUserController.java | c13502d0218d15bbbe9bff93f37644785712d481 | [] | no_license | dutengfei789/cmfz | a1fb7c527633b58f01f3531f7fefebf36bcddb4f | 512decde6c7b192a74398b22e1328c863f6cfcb6 | refs/heads/master | 2020-04-24T13:26:45.863748 | 2019-02-22T03:51:20 | 2019-02-22T03:51:23 | 171,988,331 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,121 | java | package com.baizhi.controller;
import com.baizhi.entity.CountUser;
import com.baizhi.service.CountUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
* VIEW 前端控制器
* </p>
*
* @author 杜腾飞
* @since 2019-01-08
*/
@Controller
@RequestMapping("/countUser")
public class CountUserController {
@Autowired
private CountUserService countUserService;
@RequestMapping("getCountBySex")
@ResponseBody
public Map getCountBySex() {
Map map = new HashMap();
List<CountUser> list = countUserService.list();
for (CountUser countUser : list) {
if ("男".equals(countUser.getSex())) {
map.put("nan", countUser.getCountSex());
}else {
map.put("nv", countUser.getCountSex());
}
}
return map;
}
}
| [
"[email protected]"
] | |
0ac044a6f8770e2c45e2567afeed598dd75e14cb | ace4f1e8a711dc50cbd155291fc76757b02bc055 | /src/test/java/com/thread/b/MyAQSLockDemo.java | 101bfadebf0d8ecb3db0aba5fbb3556c953fddf2 | [] | no_license | nrq0911/springboot | f88c8f30ec3b7dc634c905f20a9eae3f992e70d9 | 4c17570cf1d71016591ca24fc8d11603ef1f108d | refs/heads/master | 2022-06-23T00:32:37.982719 | 2021-11-18T08:04:23 | 2021-11-18T08:04:23 | 77,655,588 | 0 | 0 | null | 2022-06-17T01:56:44 | 2016-12-30T02:54:42 | Java | UTF-8 | Java | false | false | 3,058 | java | package com.thread.b;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.AbstractQueuedSynchronizer;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
public class MyAQSLockDemo {
private int value;
private MyLock2 lock = new MyLock2();
public int next() {
lock.lock();
try {
Thread.sleep(300);
return value++;
} catch (InterruptedException e) {
throw new RuntimeException();
} finally {
lock.unlock();
}
}
public void a() {
lock.lock();
System.out.println("a");
b();
lock.unlock();
}
public void b() {
lock.lock();
System.out.println("b");
lock.unlock();
}
public static void main(String[] args) {
MyAQSLockDemo m = new MyAQSLockDemo();
new Thread(new Runnable() {
@Override
public void run() {
m.a();
}
}).start();
}
public static class MyLock2 implements Lock {
private Helper helper = new Helper();
private class Helper extends AbstractQueuedSynchronizer {
@Override
protected boolean tryAcquire(int arg) {
// �����һ���߳̽����������õ�����������ǿ��Է���true
// ����ڶ����߳̽��������ò�����������false�����������������ǰ�������̺߳͵�ǰ������߳���ͬһ���̣߳�������õ����������д��ۣ�Ҫ����״ֵ̬
// ����ж��ǵ�һ���߳̽������������߳̽�����
int state = getState();
Thread t = Thread.currentThread();
if (state == 0) {
if (compareAndSetState(0, arg)) {
setExclusiveOwnerThread(t);
return true;
}
} else if (getExclusiveOwnerThread() == t) {
setState(state + 1);
return true;
}
return false;
}
@Override
protected boolean tryRelease(int arg) {
// ���Ļ�ȡ���ͷſ϶���һһ��Ӧ�ģ���ô���ô˷������߳�һ���ǵ�ǰ�߳�
if (Thread.currentThread() != getExclusiveOwnerThread()) {
throw new RuntimeException();
}
int state = getState() - arg;
boolean flag = false;
if (state == 0) {
setExclusiveOwnerThread(null);
flag = true;
}
setState(state);
return flag;
}
Condition newCondition() {
return new ConditionObject();
}
}
@Override
public void lock() {
helper.acquire(1);
}
@Override
public void lockInterruptibly() throws InterruptedException {
helper.acquireInterruptibly(1);
}
@Override
public boolean tryLock() {
return helper.tryAcquire(1);
}
@Override
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
return helper.tryAcquireNanos(1, unit.toNanos(time));
}
@Override
public void unlock() {
helper.release(1);
}
@Override
public Condition newCondition() {
return helper.newCondition();
}
}
}
| [
"[email protected]"
] | |
4549ec41f63c93e61554def7cebbecba81b9b576 | f1c895433e9fc8f6bdaab01112f13159cac9e8e4 | /samples/java/src/main/java/com/objectpartners/aws/iot/sample/utils/CertificateUtils.java | 39db2300e328ea5e38a3771dca3967bc4a9497d8 | [] | no_license | Deepak-Ahirwal/aws-iot-sample | 59fa1a0629de726657d5821729c8190a7b097b95 | 156e76dc7a5254bc763499abfef6f22d6f455abb | refs/heads/master | 2020-03-18T16:36:38.853484 | 2016-11-17T22:34:26 | 2016-11-17T22:34:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,798 | java | package com.objectpartners.aws.iot.sample.utils;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.net.URL;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.SecureRandom;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.util.Properties;
/**
* Per AWS sample codes recommendation, copied from:
* <p>
* <a href="https://github.com/aws/aws-iot-device-sdk-java/blob/master/aws-iot-device-sdk-java-samples/src/main/java/com/amazonaws/services/iot/client/sample/sampleUtil/SampleUtil.java">https://github.com/aws/aws-iot-device-sdk-java/blob/master/aws-iot-device-sdk-java-samples/src/main/java/com/amazonaws/services/iot/client/sample/sampleUtil/SampleUtil.java</a>
* <p>
* This is a helper class to facilitate reading of the configurations and
* certificate from the resource files.
*/
public class CertificateUtils {
private static final String PropertyFile = "aws-iot-sdk-samples.properties";
public static class KeyStorePasswordPair {
public KeyStore keyStore;
public String keyPassword;
public KeyStorePasswordPair(KeyStore keyStore, String keyPassword) {
this.keyStore = keyStore;
this.keyPassword = keyPassword;
}
}
public static String getConfig(String name) {
Properties prop = new Properties();
URL resource = CertificateUtils.class.getResource(PropertyFile);
if (resource == null) {
return null;
}
try (InputStream stream = resource.openStream()) {
prop.load(stream);
} catch (IOException e) {
return null;
}
String value = prop.getProperty(name);
if (value == null || value.trim().length() == 0) {
return null;
} else {
return value;
}
}
public static KeyStorePasswordPair getKeyStorePasswordPair(String certificateFile, String privateKeyFile) {
return getKeyStorePasswordPair(certificateFile, privateKeyFile, null);
}
public static KeyStorePasswordPair getKeyStorePasswordPair(String certificateFile, String privateKeyFile,
String keyAlgorithm) {
if (certificateFile == null || privateKeyFile == null) {
System.out.println("Certificate or private key file missing");
return null;
}
Certificate certificate = loadCertificateFromFile(certificateFile);
PrivateKey privateKey = loadPrivateKeyFromFile(privateKeyFile, keyAlgorithm);
if (certificate == null || privateKey == null) {
return null;
}
return getKeyStorePasswordPair(certificate, privateKey);
}
public static KeyStorePasswordPair getKeyStorePasswordPair(Certificate certificate, PrivateKey privateKey) {
KeyStore keyStore = null;
String keyPassword = null;
try {
keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null);
keyStore.setCertificateEntry("alias", certificate);
// randomly generated key password for the key in the KeyStore
keyPassword = new BigInteger(128, new SecureRandom()).toString(32);
keyStore.setKeyEntry("alias", privateKey, keyPassword.toCharArray(), new Certificate[] { certificate });
} catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException e) {
System.out.println("Failed to create key store");
return null;
}
return new KeyStorePasswordPair(keyStore, keyPassword);
}
private static Certificate loadCertificateFromFile(String filename) {
Certificate certificate = null;
File file = new File(filename);
if (!file.exists()) {
System.out.println("Certificate file not found: " + filename);
return null;
}
try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file))) {
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
certificate = certFactory.generateCertificate(stream);
} catch (IOException | CertificateException e) {
System.out.println("Failed to load certificate file " + filename);
}
return certificate;
}
private static PrivateKey loadPrivateKeyFromFile(String filename, String algorithm) {
PrivateKey privateKey = null;
File file = new File(filename);
if (!file.exists()) {
System.out.println("Private key file not found: " + filename);
return null;
}
try (DataInputStream stream = new DataInputStream(new FileInputStream(file))) {
privateKey = PrivateKeyReader.getPrivateKey(stream, algorithm);
} catch (IOException | GeneralSecurityException e) {
System.out.println("Failed to load private key from file " + filename);
}
return privateKey;
}
}
| [
"[email protected]"
] | |
96b508d7bc45a0aa33a152e67b17337e53a3056b | e0430488db497693b1d2458203ca7a24ecc6890c | /memory-voice-admin/src/main/java/com/mem/vo/business/base/dao/OrganizerPlaceMapper.java | e7907ecad4638824823fdf95a1c7c01c9ed9a828 | [] | no_license | zizhan77/fengjingfantuan | 7556703734c33bf891b24a08003889bfdb859872 | 7a4e01a9ff0edf834e2778b2b249ddfef125460a | refs/heads/main | 2023-06-01T15:23:56.576498 | 2021-06-19T03:06:41 | 2021-06-19T03:06:41 | 324,794,559 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,548 | java | package com.mem.vo.business.base.dao;
import com.mem.vo.business.base.model.po.BasicPlace;
import com.mem.vo.business.base.model.po.OrganizerPlace;
import com.mem.vo.business.base.model.po.OrganizerPlaceExample;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface OrganizerPlaceMapper {
long countByExample(OrganizerPlaceExample example);
int deleteByExample(OrganizerPlaceExample example);
int deleteByPrimaryKey(Long id);
int insert(OrganizerPlace record);
int insertSelective(OrganizerPlace record);
List<OrganizerPlace> selectByExample(OrganizerPlaceExample example);
OrganizerPlace selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") OrganizerPlace record, @Param("example") OrganizerPlaceExample example);
int updateByExample(@Param("record") OrganizerPlace record, @Param("example") OrganizerPlaceExample example);
int updateByPrimaryKeySelective(OrganizerPlace record);
int updateByPrimaryKey(OrganizerPlace record);
@Select("select id, place_id, organizer_id, create_time, create_user, update_time, update_user, is_delete from organizer_place where place_id=#{placeId} and organizer_id=#{userId} and is_delete = 0")
List<BasicPlace> select(Long userId, String placeId);
@Insert("INSERT INTO organizer_place (place_id,organizer_id) VALUES (#{placeId},#{organizerId}) ")
int insertQuery(OrganizerPlace organizerPlace);
} | [
"[email protected]"
] | |
faa29c8476da235615c8b88a331e16de285f10ab | b4ad8a76725884196f4494c1c9ef01350107e8bb | /TopBarDemo/app/src/main/java/gac/com/topbardemo/MainActivity.java | 2cae61b2aa245497b67e1435cd298e87cf956586 | [] | no_license | gacmy/TopBarDemo | 5da45ecfdf05e810c451bdf46addd7ff3f73874c | 71c813d18739f53ac23556ccf30431b7726721cd | refs/heads/master | 2021-01-10T11:09:12.060705 | 2015-11-15T08:03:05 | 2015-11-15T08:03:05 | 46,209,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | package gac.com.topbardemo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_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_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
a47baa9bae6de4c98dc2c6b28bdf00dbf5d4a264 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/MATH-95b-3-3-SPEA2-WeightedSum:TestLen:CallDiversity/org/apache/commons/math/distribution/AbstractContinuousDistribution_ESTest.java | 301f5c81726485350a80c641aba700797766a076 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 937 | java | /*
* This file was automatically generated by EvoSuite
* Mon Apr 06 16:16:10 UTC 2020
*/
package org.apache.commons.math.distribution;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.apache.commons.math.distribution.GammaDistributionImpl;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class AbstractContinuousDistribution_ESTest extends AbstractContinuousDistribution_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
GammaDistributionImpl gammaDistributionImpl0 = new GammaDistributionImpl(Double.POSITIVE_INFINITY, 0.8391976875086766);
// Undeclared exception!
gammaDistributionImpl0.inverseCumulativeProbability(0.8391976875086766);
}
}
| [
"[email protected]"
] | |
3a3ad5645445d1d6b7acc65edeef291ac76c445b | b80467f230265a96d09aaca574e7ba048e16704e | /src/main/java/bitchanger/gui/controls/TablePane.java | 57f4e50a308b291e9d54dd2aa7680d22a0d0ef37 | [
"MIT"
] | permissive | BO-StudentProject-2020/bitchanger | 0d641d7a961c9a7782e54e3e164db3810d81a311 | 06058b3aac5c8f289a52911a930decd1734a5efd | refs/heads/master | 2023-04-24T19:42:50.163540 | 2021-04-30T15:37:34 | 2021-04-30T15:37:34 | 304,052,121 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,588 | java | /*
* Copyright (c) 2020 - Tim Muehle und Moritz Wolter
*
* Entwicklungsprojekt im Auftrag von Professorin K. Brabender und Herrn A. Koch
* Entwickelt fuer das AID-Labor der Hochschule Bochum
*
*/
package bitchanger.gui.controls;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import bitchanger.main.BitchangerLauncher;
import bitchanger.main.BitchangerLauncher.ErrorLevel;
import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
import javafx.collections.MapChangeListener;
import javafx.collections.ObservableList;
import javafx.geometry.HPos;
import javafx.geometry.Pos;
import javafx.geometry.VPos;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.Priority;
import javafx.scene.layout.StackPane;
/** <!-- $LANGUAGE=DE -->
*
*
* @author Tim M\u00FChle
*
* @since Bitchanger 0.1.8
* @version 0.1.8
*
*/
// TODO JavaDoc
public class TablePane extends GridPane {
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
// # #
// # Constants #
// # #
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
public static final String TOP_ROW_STYLE_CLASS = "top-row";
public static final String INNER_ROW_STYLE_CLASS = "inner-row";
public static final String BOTTOM_ROW_STYLE_CLASS = "bottom-row";
public static final String ODD_ROW_STYLE_CLASS = "odd-row";
public static final String EVEN_ROW_STYLE_CLASS = "even-row";
public static final String LEFT_COLUMN_STYLE_CLASS = "left-column";
public static final String INNER_COLUMN_STYLE_CLASS = "inner-column";
public static final String RIGHT_COLUMN_STYLE_CLASS = "right-column";
public static final String ODD_COLUMN_STYLE_CLASS = "odd-column";
public static final String EVEN_COLUMN_STYLE_CLASS = "even-column";
public static final String TOP_LEFT_CELL_STYLE_CLASS = "top-left-cell";
public static final String TOP_RIGHT_CELL_STYLE_CLASS = "top-right-cell";
public static final String BOTTOM_LEFT_CELL_STYLE_CLASS = "bottom-left-cell";
public static final String BOTTOM_RIGHT_CELL_STYLE_CLASS = "bottom-right-cell";
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
// # #
// # Instances #
// # #
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
// # #
// # Fields #
// # #
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
private final ObservableList<Node> children;
private final ObservableList<Node> superChildren;
private final ArrayList<ArrayList<StackCell>> columns;
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
// # #
// # Constructors #
// # #
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
public TablePane() {
super();
this.children = FXCollections.observableArrayList();
this.superChildren = super.getChildren();
this.columns = new ArrayList<>();
observeCells();
observeChildren();
}
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
// # #
// # initializing #
// # #
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
private void observeCells() {
super.getChildren().addListener(new ListChangeListener<Node>() {
@Override
public void onChanged(Change<? extends Node> c) {
while (c.next()) {
setCellStyleClasses();
}
}
});
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
private void observeChildren() {
children.addListener(new ListChangeListener<Node>() {
@Override
public void onChanged(Change<? extends Node> c) {
while (c.next()) {
if (c.wasUpdated()) {
// update item
}
else if (c.wasAdded() || c.wasRemoved()) {
for (Node addedChild : c.getAddedSubList()) {
Integer columnIndex = GridPane.getColumnIndex(addedChild);
Integer rowIndex = GridPane.getRowIndex(addedChild);
positionChild(addedChild, columnIndex, rowIndex);
addedChild.getProperties().addListener(new MapChangeListener<Object, Object>() {
@Override
public void onChanged(Change<? extends Object, ? extends Object> change) {
updateGridConstraints(addedChild);
}
});
}
for (Node removed : c.getRemoved()) {
removeChild(removed);
}
}
}
}
});
}
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
// # #
// # Getter and Setter #
// # #
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
public ObservableList<Node> getCellChildren() {
return this.children;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@Override
public void add(Node child, int columnIndex, int rowIndex) {
GridPane.setConstraints(child, columnIndex, rowIndex);
children.add(child);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@Override
public void add(Node child, int columnIndex, int rowIndex, int colspan, int rowspan) {
GridPane.setConstraints(child, columnIndex, rowIndex, colspan, rowspan);
children.add(child);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@Override
public void addRow(int rowIndex, Node... children) {
for (int i = 0; i < children.length; i++) {
add(children[i], i, rowIndex);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@Override
public void addColumn(int columnIndex, Node... children) {
for (int i = 0; i < children.length; i++) {
add(children[i], columnIndex, i);
}
}
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
// # #
// # private Methods #
// # #
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
private void setCellStyleClasses() {
int lastColumnIndex = this.getColumnCount() - 1;
int lastRowIndex = this.getRowCount() - 1;
for(Node n : super.getChildren()) {
Integer columnIndex = GridPane.getColumnIndex(n);
Integer rowIndex = GridPane.getRowIndex(n);
if(columnIndex == null || columnIndex < 0 || rowIndex == null || rowIndex < 0) {
continue;
}
setStyleClasses(n, columnIndex, rowIndex, lastColumnIndex, lastRowIndex);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
private void setStyleClasses(Node node, int columnIndex, int rowIndex, int lastColumnIndex, int lastRowIndex) {
Set<String> styleClasses = new HashSet<>(node.getStyleClass());
if(columnIndex == 0) styleClasses.add(LEFT_COLUMN_STYLE_CLASS);
else styleClasses.remove(LEFT_COLUMN_STYLE_CLASS);
if(columnIndex != 0 && columnIndex != lastColumnIndex) styleClasses.add(INNER_COLUMN_STYLE_CLASS);
else styleClasses.remove(INNER_COLUMN_STYLE_CLASS);
if(columnIndex == lastColumnIndex) styleClasses.add(RIGHT_COLUMN_STYLE_CLASS);
else styleClasses.remove(RIGHT_COLUMN_STYLE_CLASS);
if(columnIndex % 2 == 0) styleClasses.add(EVEN_COLUMN_STYLE_CLASS);
else styleClasses.remove(EVEN_COLUMN_STYLE_CLASS);
if(columnIndex % 2 != 0) styleClasses.add(ODD_COLUMN_STYLE_CLASS);
else styleClasses.remove(ODD_COLUMN_STYLE_CLASS);
if(rowIndex == 0) styleClasses.add(TOP_ROW_STYLE_CLASS);
else styleClasses.remove(TOP_ROW_STYLE_CLASS);
if(rowIndex != 0 && rowIndex != lastRowIndex) styleClasses.add(INNER_ROW_STYLE_CLASS);
else styleClasses.remove(INNER_ROW_STYLE_CLASS);
if(rowIndex == lastRowIndex) styleClasses.add(BOTTOM_ROW_STYLE_CLASS);
else styleClasses.remove(BOTTOM_ROW_STYLE_CLASS);
if(rowIndex % 2 == 0) styleClasses.add(EVEN_ROW_STYLE_CLASS);
else styleClasses.remove(EVEN_ROW_STYLE_CLASS);
if(rowIndex % 2 != 0) styleClasses.add(ODD_ROW_STYLE_CLASS);
else styleClasses.remove(ODD_ROW_STYLE_CLASS);
if(columnIndex == 0 && rowIndex == 0) styleClasses.add(TOP_LEFT_CELL_STYLE_CLASS);
else styleClasses.remove(TOP_LEFT_CELL_STYLE_CLASS);
if(columnIndex == 0 && rowIndex == lastRowIndex) styleClasses.add(TOP_RIGHT_CELL_STYLE_CLASS);
else styleClasses.remove(TOP_RIGHT_CELL_STYLE_CLASS);
if(columnIndex == lastColumnIndex && rowIndex == 0) styleClasses.add(BOTTOM_LEFT_CELL_STYLE_CLASS);
else styleClasses.remove(BOTTOM_LEFT_CELL_STYLE_CLASS);
if(columnIndex == lastColumnIndex && rowIndex == lastRowIndex) styleClasses.add(BOTTOM_RIGHT_CELL_STYLE_CLASS);
else styleClasses.remove(BOTTOM_RIGHT_CELL_STYLE_CLASS);
node.getStyleClass().clear();
node.getStyleClass().addAll(styleClasses);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
private void updateGridConstraints(Node child) {
Integer columnIndex = GridPane.getColumnIndex(child);
Integer rowIndex = GridPane.getRowIndex(child);
positionChild(child, columnIndex, rowIndex);
Priority hgrow = GridPane.getHgrow(child);
Priority vgrow = GridPane.getVgrow(child);
if(hgrow != null) {
GridPane.setHgrow(child.getParent(), hgrow);
}
if(vgrow != null) {
GridPane.setVgrow(child.getParent(), vgrow);
}
HPos halignment = GridPane.getHalignment(child);
VPos valignment = GridPane.getValignment(child);
StackPane.setAlignment(child, convertPos(valignment, halignment));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
private Pos convertPos(VPos vpos, HPos hpos) {
Pos pos;
try {
pos = Pos.valueOf(vpos.name() + "_" + hpos.toString());
} catch (Exception e) {
BitchangerLauncher.printDebugErr(ErrorLevel.IGNORE, e);
pos = Pos.CENTER;
}
return pos;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
private void positionChild(Node child, Integer columnIndex, Integer rowIndex) {
if(columnIndex == null || columnIndex < 0 || rowIndex == null || rowIndex < 0) {
return;
}
removeChild(child);
while(columnIndex >= columns.size()) {
addColumn();
}
ArrayList<StackCell> rows = columns.get(columnIndex);
while(rowIndex >= rows.size()) {
addRow();
}
StackCell cell = rows.get(rowIndex);
cell.getChildren().add(child);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
private void addRow() {
int columnIndex = 0;
for(ArrayList<StackCell> column : columns) {
StackCell cell = new StackCell();
GridPane.setConstraints(cell, columnIndex, column.size());
column.add(cell);
superChildren.add(cell);
columnIndex++;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
private void addColumn() {
ArrayList<StackCell> column = new ArrayList<>();
columns.add(column);
for (int i = 0; i < this.getRowCount(); i++) {
StackCell cell = new StackCell();
GridPane.setConstraints(cell, columns.size() - 1, i);
column.add(cell);
superChildren.add(cell);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
private void removeChild(Node child) {
Parent parent = child.getParent();
if(parent == null)
return;
if(parent instanceof Pane)
((Pane)parent).getChildren().remove(child);
superChildren.remove(parent);
if(parent.getStyleClass().contains(RIGHT_COLUMN_STYLE_CLASS)) {
removeLastColumn();
}
if(parent.getStyleClass().contains(BOTTOM_ROW_STYLE_CLASS)) {
removeLastRow();
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
private void removeLastColumn() {
ArrayList<StackCell> lastColumn = columns.get(columns.size() - 1);
boolean isEmpty = true;
for(StackCell cell : lastColumn) {
if(! cell.getChildren().isEmpty()) {
isEmpty = false;
break;
}
}
if(isEmpty) {
superChildren.removeAll(lastColumn);
columns.remove(columns.size() - 1);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
private void removeLastRow() {
boolean isEmpty = true;
for(ArrayList<StackCell> column : columns) {
StackCell cell = column.get(column.size() - 1);
if(! cell.getChildren().isEmpty()) {
isEmpty = false;
break;
}
}
if(isEmpty) {
for(ArrayList<StackCell> column : columns) {
StackCell cell = column.get(column.size() - 1);
superChildren.remove(cell);
column.remove(cell);
}
}
}
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
// # #
// # nested Classes #
// # #
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
protected static class StackCell extends StackPane {
public StackCell(Node... children) {
this();
this.getChildren().addAll(children);
}
public StackCell() {
super();
try {
this.getStyleClass().remove("stack-pane");
} catch (Exception e) {
/* ignore */
BitchangerLauncher.printDebugErr(ErrorLevel.IGNORE, e);
}
this.getStyleClass().add("stack-cell");
this.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
GridPane.setFillHeight(this, true);
GridPane.setFillWidth(this, true);
}
}
}
| [
"[email protected]"
] | |
0858d6e54e75851765b9a257e0fe052ac90483d1 | f1e5fde9af08dabad3e624418e4ac3747f23a325 | /app/src/main/java/com/ypwl/xiaotouzi/event/ProfitRangeStatusChangeEvent.java | 9a97dfb433f835afbc48207342bcbcb8aebae914 | [] | no_license | freedomjavaer/XTZ | 63fd7d9b99a5462011db132008c22340fd64e63f | 173a20e9de009b184c1b78bc1470caffa27a6b88 | refs/heads/master | 2021-01-11T02:58:29.446859 | 2016-10-14T07:14:45 | 2016-10-14T07:14:45 | 70,871,985 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 585 | java | package com.ypwl.xiaotouzi.event;
/**
* 收益排行状态改变
*
* Created by PDK on 2016/4/13.
*/
public class ProfitRangeStatusChangeEvent {
private int status;
private int type;
public ProfitRangeStatusChangeEvent(int status,int type) {
this.status = status;
this.type = type;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
| [
"[email protected]"
] | |
e299f1ec3f6ded69bfeb60151444a5d29bd630e5 | 5cd6df5636d631e186b5b2aec616a19dc1952405 | /Przydatne rzeczy/Inspiracje/Pro-master/src/parser/VariableParser.java | a3689eda17a6db692e1f297444ce05f484779b4a | [] | no_license | KuomintanGG/OiAK_Project | 02a2004b25308cc1319e1c76ad81741dc621b23b | d62bf439fbc3790b6a90d7f7c6c82ae82aa4f864 | refs/heads/master | 2020-03-09T18:27:58.552538 | 2018-04-09T20:49:03 | 2018-04-09T20:49:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,155 | java | package me.pogostick29dev.pro.parser;
import me.pogostick29dev.pro.block.Block;
import me.pogostick29dev.pro.block.VariableBlock;
import me.pogostick29dev.pro.tokenizer.Token;
import me.pogostick29dev.pro.tokenizer.TokenType;
import me.pogostick29dev.pro.tokenizer.Tokenizer;
public class VariableParser extends Parser<Block> {
@Override
public boolean shouldParse(String line) {
return line.matches("var [a-zA-Z]+ [a-zA-Z]+ = (\")?[a-zA-Z0-9]*(\")?");
}
@Override
public Block parse(Block superBlock, Tokenizer tokenizer) {
tokenizer.nextToken(); // Skip the var token.
String type = tokenizer.nextToken().getToken();
String name = tokenizer.nextToken().getToken();
tokenizer.nextToken(); // Skip the = token.
Token v = tokenizer.nextToken();
Object value = null;
if (v.getType() == TokenType.INTEGER_LITERAL) {
value = Integer.valueOf(v.getToken());
}
else if (v.getType() == TokenType.STRING_LITERAL) {
value = v.getToken();
}
else /* If it's an identifier */ {
value = superBlock.getVariable(v.getToken()).getValue();
}
return new VariableBlock(superBlock, type, name, value);
}
} | [
"[email protected]"
] | |
2d24f118c8d1e92c94de79f1f2c945538b459392 | ac3ec94b6f0092279cff32bc2c03ec441a253021 | /canhdinh/src/main/java/baseproject/tran/canhdinh/widgets/touch_view_anim/pushdownanim/PushDown.java | 555f92b6f40dd79793d6507998d4e0f56aa78668 | [] | no_license | dinhdeveloper/BaseDinh | c182175c7add5bb658bdb78610d5eb44bf5f4232 | c65b448a9a0ae0a196a72602fc2caed83ba88b9f | refs/heads/master | 2023-05-25T10:53:39.635193 | 2021-06-12T12:35:57 | 2021-06-12T12:35:57 | 376,282,953 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 783 | java | package baseproject.tran.canhdinh.widgets.touch_view_anim.pushdownanim;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
public interface PushDown{
PushDown setScale(float scale);
PushDown setScale(@PushDownAnim.Mode int mode, float scale);
PushDown setDurationPush(long duration);
PushDown setDurationRelease(long duration);
PushDown setInterpolatorPush(AccelerateDecelerateInterpolator interpolatorPush);
PushDown setInterpolatorRelease(AccelerateDecelerateInterpolator interpolatorRelease);
PushDown setOnClickListener(View.OnClickListener clickListener);
PushDown setOnLongClickListener(View.OnLongClickListener clickListener);
PushDown setOnTouchEvent(View.OnTouchListener eventListener);
}
| [
"[email protected]"
] | |
549bc6f257ffbaf299e216bcb64d51ca00dc2888 | 61bbc637907baad137fbc2a3b86a0629fb03ce4a | /src/main/java/oit/is/z1227/kaizi/janken/controller/Lec02Controller.java | 3e1e19c058127a14d108f38f8ec7dcede9de6587 | [] | no_license | kuribayashi1026/janken | dbeca1e5445d7acacba01325ce18f365a950b07b | 893ddac4a0e76271cad4ae15b921b9670b64e564 | refs/heads/master | 2023-01-06T19:37:12.963709 | 2020-11-09T10:14:02 | 2020-11-09T10:14:02 | 299,523,624 | 0 | 0 | null | 2020-11-09T10:14:04 | 2020-09-29T06:23:17 | Java | UTF-8 | Java | false | false | 3,115 | java | package oit.is.z1227.kaizi.janken.controller;
import java.security.Principal;
import java.util.ArrayList;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import org.springframework.ui.ModelMap;
import oit.is.z1227.kaizi.janken.model.Janken;
import oit.is.z1227.kaizi.janken.model.Match;
import oit.is.z1227.kaizi.janken.model.MatchMapper;
import oit.is.z1227.kaizi.janken.model.MatchInfo;
import oit.is.z1227.kaizi.janken.model.MatchInfoMapper;
import oit.is.z1227.kaizi.janken.model.User;
import oit.is.z1227.kaizi.janken.model.UserMapper;
import oit.is.z1227.kaizi.janken.model.Entry;
import oit.is.z1227.kaizi.janken.service.AsyncKekka;
@Controller
public class Lec02Controller {
@Autowired
private Entry entry;
@Autowired
UserMapper userMapper;
@Autowired
MatchMapper matchMapper;
@Autowired
MatchInfoMapper matchInfoMapper;
@Autowired
AsyncKekka asyncKekka;
private int user_id;
@GetMapping("lec02")
public String getlec02(Principal prin, ModelMap model) {
String loginUser = prin.getName();
this.entry.addUser(loginUser);
model.addAttribute("entry", this.entry);
model.addAttribute("user", loginUser);
ArrayList<Match> match2 = matchMapper.selectAllMatches();
model.addAttribute("match2", match2);
ArrayList<User> user2 = userMapper.selectAllUsers();
model.addAttribute("user2", user2);
return "lec02.html";
}
@PostMapping("/lec02")
public String lec02(String name, ModelMap model) {
model.addAttribute("username", name);
return "lec02.html";
}
@GetMapping("/match")
public String Hands(Principal prin, ModelMap model, @RequestParam Integer id) {
var loginUser = prin.getName();
MatchInfo matchInfo = new MatchInfo();
User user = userMapper.selectNameById(id);
matchInfo.setIs_active(true);
matchInfo.setUser_1(user_id);
matchInfo.setUser_2(id);
matchInfoMapper.insertMatchInfo(matchInfo);
model.addAttribute("user", loginUser);
model.addAttribute("user2", user);
return "match.html";
}
@GetMapping("/result")
public String result(Principal prin, ModelMap model, @RequestParam Integer id, @RequestParam Integer hand) {
String loginUser = prin.getName();
Janken janken = new Janken(hand);
Match match = new Match();
match.setUser_1_hand("チョキ");
match.setUser_2_hand(janken.userhand);
match.setUser_1(user_id);
match.setUser_2(id);
matchMapper.insertMatch(match);
model.addAttribute("result", janken.result);
model.addAttribute("user", loginUser);
model.addAttribute("userhand", janken.userhand);
return "wait.html";
}
@GetMapping("check")
public SseEmitter check() {
final SseEmitter sseEmitter = new SseEmitter();
this.asyncKekka.GetActive(sseEmitter);
return sseEmitter;
}
}
| [
"[email protected]"
] | |
227cf291f683cf49924247a8b845873b3f6b11c1 | 2f5254994d3284a6a08f12ad1b08bf4abd64ec76 | /spring-boot-ems-mapping/src/main/java/com/cg/tms/entity/Trainee.java | 6f54f556bbdb0aa9af53839515222139f47b86aa | [] | no_license | kshirisha28/tms | c7a1f99fd1376b2a3541f5af346c311998042b7a | 360150337ca846a67a4f21586dc46bf366930be7 | refs/heads/master | 2022-06-20T00:31:52.749251 | 2020-05-09T09:27:15 | 2020-05-09T09:27:15 | 262,528,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,134 | java | package com.cg.tms.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="tms_tbl")
public class Trainee {
@Id
@Column(name="eid")
private int traineeId;
@Column(name="ename",length=15)
private String traineeName;
@Column(name="eloc",length=15)
private String traineeDomain;
@Column(name="edom",length=15)
private String traineeLocation;
public int getTraineeId() {
return traineeId;
}
public void setTraineeId(int traineeId) {
this.traineeId = traineeId;
}
public String getTraineeName() {
return traineeName;
}
public void setTraineeName(String traineeName) {
this.traineeName = traineeName;
}
public String getTraineeDomain() {
return traineeDomain;
}
public void setTraineeDomain(String traineeDomain) {
this.traineeDomain = traineeDomain;
}
public String getTraineeLocation() {
return traineeLocation;
}
public void setTraineeLocation(String traineeLocation) {
this.traineeLocation = traineeLocation;
}
}
| [
"hp@LAPTOP-3MDVAMJ8"
] | hp@LAPTOP-3MDVAMJ8 |
32cd7e9395b60db19888e05dabac4c46c0e36ed4 | c9dab9685fad7c4d800daa0b42c9865e5f79af05 | /src/main/java/edu/lmu/cs/xlg/roflkode/entities/CallStatement.java | ca97bda90753bf2e2925c8c6e9b7f93df9872c02 | [] | no_license | rtoal/roflkode | 63b71a2dba3505d020558666a2dd3b434f3d6103 | 838a10ba3214dca3fcf3f9d227d3a4c6e9fa4cfc | refs/heads/master | 2016-09-16T01:30:25.326427 | 2015-05-30T21:51:21 | 2015-05-30T21:51:21 | 32,123,436 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,875 | java | package edu.lmu.cs.xlg.roflkode.entities;
import java.util.List;
import edu.lmu.cs.xlg.util.Log;
/**
* A Roflkode call statement. This consists of a function, which must not have a return type,
* being applied to zero or more arguments, in a statement.
*/
public class CallStatement extends Statement {
private String functionName;
private List<Expression> arguments;
private Function function;
public CallStatement(String functionName, List<Expression> arguments) {
this.functionName = functionName;
this.arguments = arguments;
}
public String getFunctionName() {
return functionName;
}
public List<Expression> getArguments() {
return arguments;
}
public Function getFunction() {
return function;
}
/**
* Analyzes the call.
*/
public void analyze(Log log, SymbolTable table, Function owner, boolean inLoop) {
// Analyze arguments first.
for (Expression a: arguments) {
a.analyze(log, table, function, inLoop);
}
// Find out which function we're referring to.
function = table.lookupFunction(functionName, log);
// If there's no such function, just bail on the rest of the analysis because we don't
// want to generate spurious errors when checking to make sure there is no return type
// and checking to see if the arguments match parameters. The error will have already
// been logged in the call to lookupFunction.
if (function == null) {
return;
}
// Ensure it is void.
if (function.getReturnType() != null) {
log.error("non.void.function.in.statement", functionName);
}
// Now check all the arguments against all the parameters.
function.assertCanBeCalledWith(arguments, log);
}
}
| [
"[email protected]"
] | |
7acd2509d57f532143af3031ee07688aa0074e99 | d5f8a5659ebd4b7d7e495e4458d4396664615e2e | /DatabaseExample/app/src/main/java/mx/com/intercam/databaseexample/MainActivity.java | 0691885b3305977159d83083f4255ca33f5127a2 | [] | no_license | jmperezsantos/Diplomado-CIC-5 | fa1898e42445707d0985c6f4186fa260de91cd01 | a1ff16c097b49a0b20e87f7c9f82dc3e5bb0a15b | refs/heads/master | 2020-04-21T22:21:45.654973 | 2019-04-13T20:51:48 | 2019-04-13T20:51:48 | 169,908,526 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,649 | java | package mx.com.intercam.databaseexample;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import java.util.List;
import mx.com.intercam.databaseexample.dao.DocumentDao;
import mx.com.intercam.databaseexample.dao.UserDao;
import mx.com.intercam.databaseexample.database.AppDatabase;
import mx.com.intercam.databaseexample.entity.DocumentEntity;
import mx.com.intercam.databaseexample.entity.UserEntity;
public class MainActivity extends AppCompatActivity {
private static String TAG = MainActivity.class.getName();
public static MainActivity instance;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
instance = this;
setContentView(R.layout.activity_main);
AppDatabase db = AppDatabase.sharedInstance();
UserEntity user = new UserEntity("Juan", "Santos");
//Se obtiene la "implementación" del UserDao
UserDao userDao = db.getUserDao();
DocumentDao documentDao = db.getDocumentDao();
userDao.insert(user);
List<UserEntity> consulted = userDao.getAll();
for (UserEntity u : consulted) {
Log.d(TAG, u.toString());
//Para cada usuario generamos 3 documentos
for (int i = 0; i < 3; i++) {
DocumentEntity document =
new DocumentEntity(
"Path " + i,
"Archivo " + i,
u.getId());
documentDao.insert(document);
}
}
}
}
| [
"[email protected]"
] | |
bbef199e93aad12c61d55d578605cf8a25a9855a | 3a5985651d77a31437cfdac25e594087c27e93d6 | /ojc-core/component-common/xsdmodel/src/org/exolab/castor/types/RecurringDurationDescriptor.java | 436c4c9adccace38f2f110861d060fd960040aa1 | [] | no_license | vitalif/openesb-components | a37d62133d81edb3fdc091abd5c1d72dbe2fc736 | 560910d2a1fdf31879e3d76825edf079f76812c7 | refs/heads/master | 2023-09-04T14:40:55.665415 | 2016-01-25T13:12:22 | 2016-01-25T13:12:33 | 48,222,841 | 0 | 5 | null | null | null | null | UTF-8 | Java | false | false | 13,128 | java | /**
* Redistribution and use of this software and associated documentation
* ("Software"), with or without modification, are permitted provided
* that the following conditions are met:
*
* 1. Redistributions of source code must retain copyright
* statements and notices. Redistributions must also contain a
* copy of this document.
*
* 2. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. The name "Exolab" must not be used to endorse or promote
* products derived from this Software without prior written
* permission of Intalio, Inc. For written permission,
* please contact [email protected].
*
* 4. Products derived from this Software may not be called "Exolab"
* nor may "Exolab" appear in their names without prior written
* permission of Intalio, Inc. Exolab is a registered
* trademark of Intalio, Inc.
*
* 5. Due credit should be given to the Exolab Project
* (http://www.exolab.org/).
*
* THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Copyright 2000 (C) Intalio, Inc. All Rights Reserved.
*
*
*/
package org.exolab.castor.types;
import org.exolab.castor.mapping.MappingException;
import org.exolab.castor.mapping.ClassDescriptor;
import org.exolab.castor.mapping.FieldDescriptor;
import org.exolab.castor.mapping.AccessMode;
import org.exolab.castor.xml.*;
import org.exolab.castor.xml.util.*;
import org.exolab.castor.mapping.ValidityException;
/**
* The RecurringDuration Descriptor
* @author <a href="[email protected]">Keith Visco</a>
* @version
*/
public class RecurringDurationDescriptor
implements XMLClassDescriptor
{
/**
* Used for returning no attribute and no element fields
**/
private static final XMLFieldDescriptor[] _noFields
= new XMLFieldDescriptor[0];
/**
* The TypeValidator to use for validation of the described class
**/
private TypeValidator validator = null;
/**
* The namespace prefix that is to be used when marshalling
**/
private String nsPrefix = null;
/**
* The namespace URI used for both Marshalling and Unmarshalling
**/
private String nsURI = null;
/**
* The name of the XML element.
*/
private static final String _xmlName = "recurringDuration";
private static XMLFieldDescriptorImpl _contentDescriptor = null;
private static FieldDescriptor[] _fields = null;
//----------------/
//- Constructors -/
//----------------/
public RecurringDurationDescriptor() {
super();
if (_contentDescriptor == null) {
_contentDescriptor = new XMLFieldDescriptorImpl(String.class,
"content", "content", NodeType.Text);
//-- setHandler
_contentDescriptor.setHandler(new RecurringDurationFieldHandler());
}
if (_fields == null) {
_fields = new FieldDescriptor[1];
_fields[0] = _contentDescriptor;
}
}
//------------------/
//- Public Methods -/
//------------------/
/**
* Returns the set of XMLFieldDescriptors for all members
* that should be marshalled as XML attributes.
* @return an array of XMLFieldDescriptors for all members
* that should be marshalled as XML attributes.
**/
public XMLFieldDescriptor[] getAttributeDescriptors() {
return _noFields;
} // getAttributeDescriptors
/**
* Returns the XMLFieldDescriptor for the member
* that should be marshalled as text content.
* @return the XMLFieldDescriptor for the member
* that should be marshalled as text content.
**/
public XMLFieldDescriptor getContentDescriptor() {
return _contentDescriptor;
} // getContentDescriptor
/**
* Returns the set of XMLFieldDescriptors for all members
* that should be marshalled as XML elements.
* @return an array of XMLFieldDescriptors for all members
* that should be marshalled as XML elements.
**/
public XMLFieldDescriptor[] getElementDescriptors() {
return _noFields;
} // getElementDescriptors
/**
* @return the namespace prefix to use when marshalling as XML.
**/
public String getNameSpacePrefix() {
return nsPrefix;
} //-- getNameSpacePrefix
/**
* Returns the XML field descriptor matching the given
* xml name and nodeType. If NodeType is null, then
* either an AttributeDescriptor, or ElementDescriptor
* may be returned. Null is returned if no matching
* descriptor is available.
*
* @param name the xml name to match against
* @param nodeType, the NodeType to match against, or null if
* the node type is not known.
* @return the matching descriptor, or null if no matching
* descriptor is available.
*
**/
public XMLFieldDescriptor getFieldDescriptor
(String name, NodeType nodeType)
{
return null;
} //-- getFieldDescriptor
/**
* @return the namespace URI used when marshalling and unmarshalling as XML.
**/
public String getNameSpaceURI() {
return nsURI;
} //-- getNameSpaceURI
/**
* Returns a specific validator for the class described by
* this ClassDescriptor. A null value may be returned
* if no specific validator exists.
*
* @return the type validator for the class described by this
* ClassDescriptor.
**/
public TypeValidator getValidator() {
return validator;
} //-- getValidator
/**
* Returns the XML Name for the Class being described.
*
* @return the XML name.
**/
public String getXMLName() {
return _xmlName;
} //-- getXMLName
/**
* Returns the String representation of this XMLClassDescriptor
* @return the String representation of this XMLClassDescriptor
**/
public String toString() {
String str = super.toString() +
"; descriptor for class: RecurringDuration";
//-- add xml name
str += "; xml name: " + _xmlName;
return str;
} //-- toString
//-------------------------------------/
//- Implementation of ClassDescriptor -/
//-------------------------------------/
/**
* Returns the Java class represented by this descriptor.
*
* @return The Java class
*/
public Class getJavaClass() {
return RecurringDuration.class;
} //-- getJavaClass
/**
* Returns a list of fields represented by this descriptor.
*
* @return A list of fields
*/
public FieldDescriptor[] getFields() {
return _fields;
} //-- getFields
/**
* Returns the class descriptor of the class extended by this class.
*
* @return The extended class descriptor
*/
public ClassDescriptor getExtends() {
return null;
} //-- getExtends
/**
* Returns the identity field, null if this class has no identity.
*
* @return The identity field
*/
public FieldDescriptor getIdentity() {
return null;
} //-- getIdentity
/**
* Returns the access mode specified for this class.
*
* @return The access mode
*/
public AccessMode getAccessMode() {
return null;
} //-- getAccessMode
/**
* <p>Returns true if the given object represented by this XMLClassDescriptor
* can accept a member whose name is given.
* An XMLClassDescriptor can accept a field if it contains a descriptor that matches
* the given name and if the given object can hold this field (i.e a value is not already set for
* this field).
* <p>This is mainly used for container object (that can contains other object), in this particular case
* the implementation will return null.
* @param fieldName the name of the field to check
* @param object the object represented by this XMLCLassDescriptor
* @return true if the given object represented by this XMLClassDescriptor
* can accept a member whose name is given.
*/
public boolean canAccept(String fieldName, Object object) {
return false;
}
/**
* A specialized FieldHandler for the XML Schema
* TimeDuration related types
* @author <a href="[email protected]">Arnaud Blandin</a>
* @version
**/
class RecurringDurationFieldHandler extends XMLFieldHandler {
//----------------/
//- Constructors -/
//----------------/
/**
* Creates a new TimeFieldHandler
**/
public RecurringDurationFieldHandler() {
super();
} //-- TimeFieldHandler
//------------------/
//- Public Methods -/
//------------------/
/**
* Returns the value of the field associated with this
* descriptor from the given target object.
* @param target the object to get the value from
* @return the value of the field associated with this
* descriptor from the given target object.
**/
public Object getValue(Object target)
throws java.lang.IllegalStateException
{
//-- check for TimeDuration class -- add later
RecurringDuration recurr = (RecurringDuration) target;
return recurr.toString();
} //-- getValue
/**
* Sets the value of the field associated with this descriptor.
* @param target the object in which to set the value
* @param value the value of the field
**/
public void setValue(Object target, Object value)
throws java.lang.IllegalStateException
{
if (! (target instanceof RecurringDuration) ) {
//-- throw exception
}
RecurringDuration recurTarget = (RecurringDuration) target;
if (value == null) {
/// do something
}
//-- update current instance of time with new time
try {
RecurringDuration temp = RecurringDuration.parseRecurringDuration(value.toString()) ;
recurTarget.setCentury(temp.getCentury());
recurTarget.setYear(temp.getYear());
recurTarget.setMonth(temp.getMonth());
recurTarget.setDay(temp.getDay());
recurTarget.setHour(temp.getHour());
recurTarget.setMinute(temp.getMinute());
recurTarget.setSecond(temp.getSeconds(), temp.getMilli());
recurTarget.setZone(temp.getZoneHour(),temp.getZoneMinute());
recurTarget.isUTC();
}
catch (Exception ex) {
//-- ignore for now
}
} //-- setValue
public void resetValue(Object target)
throws java.lang.IllegalStateException
{
}
/**
* Checks the field validity. Returns successfully if the field
* can be stored, is valid, etc, throws an exception otherwise.
*
* @param object The object
* @throws ValidityException The field is invalid, is required and
* null, or any other validity violation
* @throws IllegalStateException The Java object has changed and
* is no longer supported by this handler, or the handler
* is not compatiable with the Java object
*/
public void checkValidity( Object object )
throws ValidityException, IllegalStateException
{
// nothing to do?
} //-- checkValidity
/**
* Creates a new instance of the object described by this field.
*
* @param parent The object for which the field is created
* @return A new instance of the field's value
* @throws IllegalStateException This field is a simple type and
* cannot be instantiated
*/
public Object newInstance( Object parent )
throws IllegalStateException
{
return new RecurringDuration();
} //-- newInstance
} //-- RecurringDurationFieldHandler
} //-- RecurringDurationValidator
| [
"[email protected]"
] | |
0cb2858c7fff94f26fec01c8ae5b32a122146228 | 963599f6f1f376ba94cbb504e8b324bcce5de7a3 | /sources/p035ru/unicorn/ujin/market/model/MarketViewModel$loadCompanyList$2.java | ef88277e920595950af851b5808471ff58df59ae | [] | no_license | NikiHard/cuddly-pancake | 563718cb73fdc4b7b12c6233d9bf44f381dd6759 | 3a5aa80d25d12da08fd621dc3a15fbd536d0b3d4 | refs/heads/main | 2023-04-09T06:58:04.403056 | 2021-04-20T00:45:08 | 2021-04-20T00:45:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,042 | java | package p035ru.unicorn.ujin.market.model;
import java.util.List;
import kotlin.Metadata;
import p035ru.unicorn.ujin.data.api.response.marketplace.CompanyListResponseData;
import p035ru.unicorn.ujin.data.realm.Resource;
import p035ru.unicorn.ujin.data.realm.marketplace.Company;
import p035ru.unicorn.ujin.market.repository.MarketLocalRepository;
import p046io.reactivex.functions.Consumer;
@Metadata(mo51341bv = {1, 0, 3}, mo51342d1 = {"\u0000\u0014\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u001a\u0010\u0002\u001a\u0016\u0012\u0004\u0012\u00020\u0004 \u0005*\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0006"}, mo51343d2 = {"<anonymous>", "", "data", "Lru/unicorn/ujin/data/realm/Resource;", "Lru/unicorn/ujin/data/api/response/marketplace/CompanyListResponseData;", "kotlin.jvm.PlatformType", "accept"}, mo51344k = 3, mo51345mv = {1, 4, 1})
/* renamed from: ru.unicorn.ujin.market.model.MarketViewModel$loadCompanyList$2 */
/* compiled from: MarketViewModel.kt */
final class MarketViewModel$loadCompanyList$2<T> implements Consumer<Resource<CompanyListResponseData>> {
final /* synthetic */ int $page;
final /* synthetic */ MarketViewModel this$0;
MarketViewModel$loadCompanyList$2(MarketViewModel marketViewModel, int i) {
this.this$0 = marketViewModel;
this.$page = i;
}
public final void accept(Resource<CompanyListResponseData> resource) {
if (resource != null && resource.getData() != null) {
MarketLocalRepository access$getLocalRepository$p = this.this$0.localRepository;
CompanyListResponseData data = resource.getData();
List companies = data != null ? data.getCompanies() : null;
Class<Company> cls = Company.class;
boolean z = true;
if (this.$page != 1) {
z = false;
}
access$getLocalRepository$p.saveDataAsList(companies, cls, z);
}
}
}
| [
"[email protected]"
] | |
be3779428f5b7bbeff9ea1acfd40fc0a79f10a0e | cdf2441c08aa1fb0aebd0c5a5b6cf89ddec0114b | /src/view/JsonView.java | 449085350302fb6355d75938dd48c49f3c1e50d3 | [] | no_license | haan78/jmm7mvc | c137e747f8b51ebe7a77fcbce32f2449ba10cf4f | ee467b59feef8853c9669b4c20f006822392d595 | refs/heads/master | 2021-04-29T08:46:24.506030 | 2017-10-30T11:04:47 | 2017-10-30T11:04:47 | 77,671,908 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,111 | java | package view;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.http.HttpServletResponse;
import model.ModelBase;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author BARIS
*/
public class JsonView extends ViewBase {
private String dateformat = "yyyy-MM-dd HH:mm:ss";
public JsonView(ModelBase m) {
super(m);
}
public JsonView(ModelBase m, String dateFormat) {
super(m);
this.dateformat = dateFormat;
}
public void setDateformat(String dateformat) {
this.dateformat = dateformat;
}
public String getDateformat() {
return dateformat;
}
@Override
protected void showError(Throwable ex) {
String mess;
mess = ex.getCause().getMessage().replaceAll("\n","").replaceAll("\r","").replaceAll("\"","");
HttpServletResponse r = getResponse();
r.setHeader("Content-Type", "application/json; charset=utf-8");
try {
r.getWriter().print("{ \"type\":\"error\", \"message\":\""+mess+"\" }");
} catch (IOException ex1) {
Logger.getLogger(JsonView.class.getName()).log(Level.SEVERE, null, ex1);
}
}
@Override
protected void showContent(Object data) {
Gson g;
if ( (dateformat!=null) && (!dateformat.isEmpty()) ) {
g = new GsonBuilder().setDateFormat(dateformat).create();
} else {
g = new Gson();
}
try {
HttpServletResponse r = getResponse();
r.setHeader("Content-Type", "application/json; charset=utf-8");
r.getWriter().print(g.toJson(data));
} catch (IOException ex) {
this.showError(ex);
}
}
}
| [
"BARIS@BARIS-PC"
] | BARIS@BARIS-PC |
c39d18cd23bb92ad0aaf5b2b7bd05df6993626b3 | 7aeb8b05ba6b4808ec901da9b76397c6f87c0df0 | /src/main/java/cn/distributedlock/json/Pojo/Course.java | 626b3b07d2d2d039d1e1d5545266ff595cd01023 | [] | no_license | nizhiyong30/MavenProject | 53f160da25b4a1be6b495a260dc4ef5983b3ce1d | f715bffbe68140a3dc1ac6bb83693f6aa6e064b3 | refs/heads/master | 2023-06-24T05:43:00.427512 | 2022-02-21T02:57:13 | 2022-02-21T02:57:13 | 162,069,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 773 | java | package cn.distributedlock.json.Pojo;
/**
* Created by nizy on 2019/2/20.
*/
public class Course {
String courseId;
String courseName;
public String getCourseId() {
return courseId;
}
public void setCourseId(String courseId) {
this.courseId = courseId;
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("Course{");
sb.append("courseId='").append(courseId).append('\'');
sb.append(", courseName='").append(courseName).append('\'');
sb.append('}');
return sb.toString();
}
}
| [
"[email protected]"
] | |
644692795cdc89c9f43466cdf3e8031931beeb5b | 3278ee3fde0c2929c714e2a9d939b8efc5e212fd | /springboot_blog/src/test/java/demo/springboot_biog/SpringbootBiogApplicationTests.java | eedf79d732d745d53a866be279bfcb5358d0f060 | [] | no_license | chinasunboy/demo | 223d1b761f4a8e530097ea62e5ab10ad75e5d515 | 4dc2a21b680e3de9f204a3c71cf69f4c04632043 | refs/heads/master | 2022-12-25T00:41:24.994366 | 2021-01-31T15:33:08 | 2021-01-31T15:33:08 | 248,372,628 | 0 | 0 | null | 2022-12-16T04:26:04 | 2020-03-19T00:20:39 | JavaScript | UTF-8 | Java | false | false | 220 | java | package demo.springboot_biog;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringbootBiogApplicationTests {
@Test
void contextLoads() {
}
}
| [
"[email protected]"
] | |
e48660e511302e5b86ba99d8747ed55e1ac7b884 | 648c1ff7e38ea98b93d9dc33c1a8c0f43f50d8e5 | /src/main/java/action/Action.java | ec6e8ce0c2f6beb05ae2f02ca71e1a69e5ba261c | [] | no_license | executed/nano-medical-ss | c588d565cb10cc7150660d9bf23c50e105abb4f2 | fc29ed7ca3998bee5d30adf896e6ef943b060a93 | refs/heads/master | 2021-12-24T23:40:11.152388 | 2018-11-23T20:44:11 | 2018-11-23T20:44:11 | 166,433,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 254 | java | package action;
import entity.View;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public interface Action {
View execute(HttpServletRequest request, HttpServletResponse response) throws Exception;
}
| [
"[email protected]"
] | |
d5c68ac293990d3b071e52ae5ed6578471b74c71 | 48e843c1f539ecc45580d72312be19b6e2cdf859 | /src/main/java/example6/tzstorm/bolt/TestBolt6.java | 7b19d5f22b94211ab202e706419dd91251ffd77b | [] | no_license | doohee323/tz-storm | db37af38d1629840e9a311f50ebb8159e7d06d04 | 6bbf278e0ef4d174650103c7d9d037930ba405bf | refs/heads/master | 2021-01-16T22:19:10.327807 | 2016-02-22T17:48:19 | 2016-02-22T17:48:19 | 42,700,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,531 | java | package example6.tzstorm.bolt;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import storm.trident.operation.Function;
import storm.trident.operation.TridentCollector;
import storm.trident.operation.TridentOperationContext;
import storm.trident.tuple.TridentTuple;
import com.espertech.esper.client.EPServiceProvider;
import com.google.gson.Gson;
import example6.tzstorm.LogBean;
@SuppressWarnings("rawtypes")
public class TestBolt6 implements Function {
private static final long serialVersionUID = 1L;
static final Logger log = LoggerFactory.getLogger(TestBolt6.class);
private int partitionIndex;
private static final Gson gson = new Gson();
private EsperFunc esperFunc;
private EPServiceProvider epService;
public void prepare(Map conf, TridentOperationContext context) {
// log.info("CountSumFunction.prepare(): partition[{}/{}]", context.getPartitionIndex(), context.numPartitions());
partitionIndex = context.getPartitionIndex();
esperFunc = new EsperFunc();
epService = esperFunc.setUpEsper(epService);
}
public void cleanup() {
System.out.println("");
}
public void execute(TridentTuple tuple, TridentCollector collector) {
List<Object> values = tuple.getValues();
// log.info("execute:" + (String) values.get(0));
LogBean logBean = gson.fromJson((String) values.get(0), LogBean.class);
epService.getEPRuntime().sendEvent(logBean);
}
}
| [
"[email protected]"
] | |
f6d18015a6d1e16d95840c9b0ad652e4f265eef0 | 89a5d17735196e1e0e0ac0bab7c11b7dc05f1926 | /HW8MST/src/hw8mst/HW8MST.java | 7bea230b8ddf4afbd99f1a5bb083c8457ed3f619 | [] | no_license | rfairban/Solo-NetBeans-Projects | c2c7f1068e06fe8b889ffe7b8857257bd0e588a6 | 9da1925e0b62be29c2b1cdeb13fe4cfe60e0a516 | refs/heads/master | 2021-01-19T00:52:29.834856 | 2017-04-04T18:30:19 | 2017-04-04T18:30:19 | 87,215,279 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,807 | java | package hw8mst;
/**
* CSCI 333, Homework 8: Prim's Minimum Spanning Tree Algorithm. Used to test
* the Graph class. Ensures the methods of the Graph class all work to
* specifications, such as the PrimMST() method performing the correct
* operation.
*
* @author Ryan Fairbanks
* @version 11/17/16
*/
public class HW8MST {
/**
* Used to test the Graph, Edge, and Vertex classes. Creates a Graph object
* via the use of a 2D array of Edge objects, each with a boolean value
* indicating that they exist and a weight in between the Vertex objects
* represented by the position. Ensures that the primMST() and printGraph()
* methods in the Graph class work correctly. Prints all of the Vertex
* objects in the Graph after all other method tests have been completed.
*
* @param args Not used.
*/
public static void main(String[] args) {
Edge[][] testEdges = new Edge[][]{
{new Edge(), new Edge(true, 9), new Edge(true, 6), new Edge(true, 4), new Edge()},
{new Edge(true, 9), new Edge(), new Edge(true, 1), new Edge(), new Edge()},
{new Edge(true, 6), new Edge(true, 1), new Edge(), new Edge(true, 2), new Edge()},
{new Edge(true, 4), new Edge(), new Edge(true, 2), new Edge(), new Edge(true, 3)},
{new Edge(), new Edge(), new Edge(), new Edge(true, 3), new Edge()}
};
Graph testGraph = new Graph(testEdges);
testGraph.primMST(); // Perform Prim's Minimum Search Tree algorithm.
testGraph.printGraph(); // Print the graph, the 2D array of Edge objects.
System.out.println();
for (int i = 0; i < testGraph.getN(); i++) { // Print all Vertex objects.
System.out.println(testGraph.getVertex(i).toString());
}
}
}
| [
"[email protected]"
] | |
bf3090f7d0a5a94bb893e59c8bbe7537cc8d7c8c | aae9b96efe65491d4e4c055008fcc92900810150 | /src/test/java/test/multiThread/JoinTest.java | de1713c52ef53c6903a98409215e35acff0a9a37 | [] | no_license | Inzarote/test | a95d4e50d978eb7e25c213ea461c622cf032bc83 | 68e55f8546ef609f7ff64713402f8273cbe1c5c1 | refs/heads/master | 2021-11-04T22:44:32.299439 | 2019-04-28T08:34:11 | 2019-04-28T08:34:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 691 | java | package test.multiThread;
public class JoinTest {
public static void main(String[] args) throws InterruptedException {
Thread other = new Thread(new OtherThread(), "other");
other.start();
other.join();
System.out.println("其他线程结束了,开始执行我的");
}
static class OtherThread implements Runnable {
@Override
public void run() {
System.out.println("a");
System.out.println("b");
System.out.println("c");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
| [
"1qaz1qAZ666"
] | 1qaz1qAZ666 |
638d0ed2f5f8ca4de7521a6bfd5c1a840fa1cd69 | d0e67875a11d63460627a11ca280aecb0a59f61e | /src/main/java/com/github/tasubo/lightmvc/view/ViewELResolver.java | 49ea12cb16d37b771c97823cf23d2b5ea7de1afb | [] | no_license | tasubo/lightmvc | 1855f54bf1660ef1c09e3699a4cb60f44d37da8c | 361f71499a6e8b0189642c65deed0417ba8c58e7 | refs/heads/master | 2021-01-23T17:18:55.502806 | 2012-12-20T00:02:13 | 2012-12-20T00:02:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,170 | java | package com.github.tasubo.lightmvc.view;
import java.beans.FeatureDescriptor;
import java.util.Iterator;
import javax.el.*;
/**
*
* @author Tadas
*/
public class ViewELResolver extends ELResolver {
private final BeanELResolver beanELResolver;
public ViewELResolver(BeanELResolver beanELResolver) {
this.isReadOnly = false;
this.beanELResolver = beanELResolver;
}
public ViewELResolver(BeanELResolver beanELResolver, boolean isReadOnly) {
this.isReadOnly = isReadOnly;
this.beanELResolver = beanELResolver;
}
@Override
public Class<?> getType(ELContext context,
Object base,
Object property) {
if (context == null) {
throw new NullPointerException();
}
if (base != null && base instanceof View) {
context.setPropertyResolved(true);
return String.class;
}
return null;
}
@Override
public Object getValue(ELContext context,
Object base,
Object property) {
if (context == null) {
throw new NullPointerException();
}
if (base != null && base instanceof View) {
context.setPropertyResolved(true);
View view = (View) base;
Object part = view.getPart(property.toString());
if (part == null) {
try {
return beanELResolver.getValue(context, base, property);
} catch (PropertyNotFoundException ex) {
return null;
}
}
return part;
}
return null;
}
@Override
public void setValue(ELContext context,
Object base,
Object property,
Object val) {
if (context == null) {
throw new NullPointerException();
}
if (base != null && base instanceof View) {
context.setPropertyResolved(true);
View view = (View) base;
if (isReadOnly) {
throw new PropertyNotWritableException();
}
view.setPart(property.toString(), val.toString());
}
}
@Override
public boolean isReadOnly(ELContext context,
Object base,
Object property) {
if (context == null) {
throw new NullPointerException();
}
if (base != null && base instanceof View) {
context.setPropertyResolved(true);
View map = (View) base;
return isReadOnly;
}
return false;
}
@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(
ELContext context,
Object base) {
return null;
}
@Override
public Class<?> getCommonPropertyType(ELContext context,
Object base) {
if (base != null && base instanceof View) {
return Object.class;
}
return null;
}
private boolean isReadOnly;
}
| [
"[email protected]"
] | |
4127cb99e7614f4d44425045f600dc85acb067f7 | 7b921d35566f056dc5ceee90bfb54487cfe136c2 | /Datapack/gameserver/data/scripts/org.l2j.scripts/handlers/effecthandlers/PAtk.java | cda2428730f82633e6dc435ab637aa9154e53048 | [] | no_license | format686/L2jOrg | 2013155b7902d3e17626c5232f758c62a81661f9 | fbfd1096ea0adfea9f990a13cfa03d042b79a345 | refs/heads/master | 2021-08-27T21:48:46.792052 | 2021-08-20T01:13:53 | 2021-08-20T01:13:53 | 183,562,706 | 0 | 0 | null | 2019-04-26T05:27:11 | 2019-04-26T05:27:11 | null | UTF-8 | Java | false | false | 984 | java | /*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.effecthandlers;
import org.l2j.gameserver.model.StatsSet;
import org.l2j.gameserver.model.stats.Stats;
/**
* @author Sdw
*/
public class PAtk extends AbstractConditionalHpEffect
{
public PAtk(StatsSet params)
{
super(params, Stats.PHYSICAL_ATTACK);
}
}
| [
"[email protected]"
] | |
cca855491633cf6f16232c261ac582a5c00bcbec | 1398d831c557474891f87b3e8982d8b06b1249f9 | /src/pl/traderate/core/HoldingList.java | 957cf90c0517636eb3d2c5d56277557d6277fe7a | [] | no_license | karolpiczak-old/traderate-pl | 4e77583bb951f6248243f244eef764293126ddb4 | 487da104e0b3ba41af84960a03897bd58e90c128 | refs/heads/master | 2021-05-27T06:10:11.677797 | 2014-06-17T12:32:49 | 2014-06-17T12:32:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,853 | java | /*
* Copyright (C) 2012 Karol Piczak <[email protected]>
*
* This file is part of the TradeRate package.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package pl.traderate.core;
import pl.traderate.core.exception.EntryInsertionException;
import pl.traderate.core.exception.ObjectNotFoundException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.TreeSet;
/**
* A list of financial holdings for a given account or portfolio.
*/
final class HoldingList {
/**
* Open holdings in equities.
*/
private TreeSet<EquityHolding> equityHoldings;
/**
* Closed holdings in equities.
*/
private TreeSet<EquityHolding> closedEquityHoldings;
HoldingList() {
equityHoldings = new TreeSet<>();
closedEquityHoldings = new TreeSet<>();
}
HoldingList(HoldingList holdingList) {
this();
for (EquityHolding holding : holdingList.equityHoldings) {
this.equityHoldings.add(new EquityHolding(holding));
}
for (EquityHolding holding : holdingList.closedEquityHoldings) {
this.closedEquityHoldings.add(new EquityHolding(holding));
}
update();
}
/**
* Merges this list with another holding list.
*
* @param holdingList Holdings to be merged with
*/
void merge(HoldingList holdingList) {
for (EquityHolding otherHolding : holdingList.equityHoldings) {
EquityHolding thisHolding;
try {
thisHolding = ObjectFinder.findByName(otherHolding.ticker, this.equityHoldings);
thisHolding.merge(otherHolding);
} catch (ObjectNotFoundException e) {
this.equityHoldings.add(new EquityHolding(otherHolding));
}
}
for (EquityHolding otherHolding : holdingList.closedEquityHoldings) {
EquityHolding thisHolding;
try {
thisHolding = ObjectFinder.findByName(otherHolding.ticker, this.closedEquityHoldings);
thisHolding.merge(otherHolding);
} catch (ObjectNotFoundException e) {
this.closedEquityHoldings.add(new EquityHolding(otherHolding));
}
}
}
/**
* Adds a new purchase transaction to the holding list.
*
* @param entry An equity purchase journal entry
* @throws EntryInsertionException Thrown when entry processing fails.
*/
void open(BuyEquityTransactionEntry entry) throws EntryInsertionException {
EquityTrade trade = new EquityTrade(entry.account, entry.portfolio, entry.date, entry.comment, entry.ticker, entry.quantity, entry.price, entry.commission);
EquityHolding holding;
try {
holding = ObjectFinder.findByName(entry.ticker, equityHoldings);
} catch (ObjectNotFoundException e) {
holding = new EquityHolding(entry.ticker, false);
equityHoldings.add(holding);
}
EquityPosition position;
try {
position = ObjectFinder.findByName(entry.position, holding.getPositions());
} catch (ObjectNotFoundException e) {
position = new EquityPosition(entry.position, false);
holding.attach(position);
}
position.attach(trade);
holding.attach(trade);
}
/**
* Processes a new sell transaction.
*
* @param entry An equity sell journal entry
* @throws EntryInsertionException Thrown when processing fails.
*/
void close(SellEquityTransactionEntry entry) throws EntryInsertionException {
EquityHolding holding;
try {
holding = ObjectFinder.findByName(entry.ticker, equityHoldings);
} catch (ObjectNotFoundException e) {
throw new EntryInsertionException();
}
TreeSet<EquityTrade> trades = holding.getTrades();
Iterator<EquityTrade> tradeIterator = trades.iterator();
ArrayList<EquityTrade> tradesToClose = new ArrayList<>();
BigDecimal sharesFound = BigDecimal.ZERO;
while (sharesFound.compareTo(entry.quantity) < 0) {
if (tradeIterator.hasNext()) {
EquityTrade trade = tradeIterator.next();
if (trade.getAccount() == entry.account) {
sharesFound = sharesFound.add(trade.getQuantity());
tradesToClose.add(trade);
}
} else {
throw new EntryInsertionException();
}
}
BigDecimal sharesLeftToClose = entry.quantity;
BigDecimal unallocatedCommission = entry.commission;
for (EquityTrade trade : tradesToClose) {
BigDecimal partialCommission = trade.getQuantity().divide(entry.quantity, 10, RoundingMode.HALF_EVEN).multiply(entry.commission).setScale(2, RoundingMode.HALF_EVEN);
if (unallocatedCommission.compareTo(partialCommission) > 0) {
unallocatedCommission = unallocatedCommission.subtract(partialCommission);
} else {
partialCommission = unallocatedCommission;
unallocatedCommission = BigDecimal.ZERO;
}
if (sharesLeftToClose.compareTo(trade.getQuantity()) >= 0) {
trade.close(entry, partialCommission);
moveToClosed(trade);
sharesLeftToClose = sharesLeftToClose.subtract(trade.getQuantity());
} else {
EquityTrade partialTrade = trade.divide(sharesLeftToClose);
partialTrade.close(entry, partialCommission);
moveToClosed(partialTrade);
}
}
}
/**
* Updates holding aggregates.
*/
void update() {
for (EquityHolding holding : equityHoldings) {
holding.update();
}
for (EquityHolding holding : closedEquityHoldings) {
holding.update();
}
}
/**
* Updates prices of all holdings.
*/
void updateQuotes() {
for (EquityHolding holding : equityHoldings) {
holding.updateQuotes();
}
for (EquityHolding holding : closedEquityHoldings) {
holding.updateQuotes();
}
}
private void moveToClosed(EquityTrade trade) {
EquityHolding closedHolding;
try {
closedHolding = ObjectFinder.findByName(trade.getTicker(), closedEquityHoldings);
} catch (ObjectNotFoundException e) {
closedHolding = new EquityHolding(trade.getTicker(), true);
closedEquityHoldings.add(closedHolding);
}
EquityPosition closedPosition;
try {
closedPosition = ObjectFinder.findByName(trade.getParent().getName(), closedHolding.getPositions());
} catch (ObjectNotFoundException e) {
closedPosition = new EquityPosition(trade.getParent().getName(), true);
closedHolding.attach(closedPosition);
}
EquityHolding openHolding = (EquityHolding) trade.getParent().getParent();
EquityPosition openPosition = (EquityPosition) trade.getParent();
openHolding.detach(trade);
openPosition.detach(trade);
if (openHolding.isEmpty()) {
equityHoldings.remove(openHolding);
}
closedPosition.attach(trade);
closedHolding.attach(trade);
}
TreeSet<EquityHolding> getEquityHoldings() {
return equityHoldings;
}
TreeSet<EquityHolding> getClosedEquityHoldings() {
return closedEquityHoldings;
}
public BigDecimal getCurrentValue() {
BigDecimal value = BigDecimal.ZERO;
try {
for (EquityHolding holding : equityHoldings) {
value = value.add(holding.getMarketValue());
}
} catch (NullPointerException e) {
return null;
}
return value.setScale(2);
}
public BigDecimal getOpenValue() {
BigDecimal value = BigDecimal.ZERO;
try {
for (EquityHolding holding : equityHoldings) {
value = value.add(holding.getOpenValue());
}
} catch (NullPointerException e) {
return null;
}
return value.setScale(2);
}
public BigDecimal getPaperGain() {
BigDecimal value = BigDecimal.ZERO;
try {
for (EquityHolding holding : equityHoldings) {
value = value.add(holding.getPaperGain());
}
} catch (NullPointerException e) {
return null;
}
return value.setScale(2);
}
public BigDecimal getRealizedGain() {
BigDecimal value = BigDecimal.ZERO;
try {
for (EquityHolding holding : closedEquityHoldings) {
value = value.add(holding.getRealizedGain());
}
} catch (NullPointerException e) {
return null;
}
return value.setScale(2);
}
public BigDecimal getRealizedIncome() {
BigDecimal value = BigDecimal.ZERO;
try {
for (EquityHolding holding : closedEquityHoldings) {
value = value.add(holding.getCloseValue());
}
} catch (NullPointerException e) {
return null;
}
return value.setScale(2);
}
public BigDecimal getRealizedCost() {
BigDecimal value = BigDecimal.ZERO;
try {
for (EquityHolding holding : closedEquityHoldings) {
value = value.add(holding.getOpenValue());
}
} catch (NullPointerException e) {
return null;
}
return value.setScale(2);
}
}
| [
"[email protected]"
] | |
47241ec598d006e580e68339283b01393d99aaf5 | cc22caa3661bd717dee614a71028c2edda87cc41 | /bookStudy/chapter06/MergeSort.java | ceb4a9326cf5e18eaac573818abaa3d22c5d5892 | [] | no_license | nikerun23/algorithm | 0b1c7f3f7e741c94880ce755cb8b5c05d87d6ad1 | d2f3d20b21850c0641fb1cd1e40f231c3e9779de | refs/heads/master | 2020-04-22T14:55:43.018583 | 2019-09-29T11:23:46 | 2019-09-29T11:23:46 | 170,461,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,496 | java | package algorithm.bookStudy.chapter06;
// 병합 정렬
public class MergeSort {
static int[] buff; // 작업용 배열
// a[left] ~ a[right]를 재귀적으로 병합 정렬
static void __mergeSort(int[] a, int left, int right) {
if (left < right) {
int i;
int center = (left + right) / 2;
int p = 0;
int j = 0;
int k = left;
__mergeSort(a, left, center); // 배열의 앞부분을 병합 정렬합니다.
__mergeSort(a, center + 1, right); // 배열의 뒷부분을 병합 정렬합니다.
for (i = left; i <= center; i++)
buff[p++] = a[i];
while (i <= right && j < p)
a[k++] = (buff[j] <= a[i]) ? buff[j++] : a[i++];
while (j < p)
a[k++] = buff[j++];
}
}
// 병합 정렬
static void mergeSort(int[] a, int n) {
buff = new int[n]; // 작업용 배열을 생성합니다.
__mergeSort(a, 0, n - 1); // 배열 전체를 병합 정렬합니다.
buff = null; // 작업용 배열을 해제합니다.
}
public static void main(String[] args) {
int [] a = {9,8,7,5,4,2,6,3,1};
int n = a.length;
System.out.print("int[] a = {");
for (int i = 0, len = a.length; i < len; i++) {
System.out.print(a[i]+", ");
}
System.out.println("}");
System.out.println("오름 차순으로 정렬합니다");
mergeSort(a, n); // 배열 x를 병합 정렬합니다.
System.out.print("int[] a = {");
for (int i = 0; i < a.length; i++) {
System.out.print(a[i]+", ");
}
System.out.println("}");
}
}
| [
"[email protected]"
] | |
20e0f039249118d6929643331ff0e9ae24f9b1f1 | 3f0d852dc50a896a2ae9dc5c87c4fa0d15470e66 | /src/com/nk/commons/IOUtilities.java | 56d6ca516142ebe849aa5d04188486f2d5b77f11 | [] | no_license | nikhil2050/WebsiteScraperSwing | 680386ce08f3f0dd4c68b6b84b043911f2efba90 | d8c620c5a36c46edf7899f012e34df23cfb8e653 | refs/heads/master | 2021-08-16T11:43:33.171992 | 2017-11-19T20:04:05 | 2017-11-19T20:04:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | package com.nk.commons;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class IOUtilities {
public synchronized void writeContentToTextFile(String fileWithPath, StringBuffer content){
try{
// synchronized (this) {
File file = new File(fileWithPath); // D:/ScrapedText/"+timestamp+"_sentences.txt
FileWriter fw = new FileWriter(file.getAbsoluteFile());
BufferedWriter bw = new BufferedWriter(fw);
bw.write(content.toString());
bw.close();
// }
}catch(IOException e){
System.out.println("IOException caused. "+e);
}
}
}
| [
"Nikhil@KSHIRSAGAR"
] | Nikhil@KSHIRSAGAR |
ae7641bc677210d219e29506a6ab22cf98d5dae7 | ce2ed025fe66374c8bde118bb5e3d6e411ee1091 | /src/main/java/com/github/bagiasn/bookspot/server/HomeController.java | 705bceb1ff6e639ae15696fde35812008f135b32 | [] | no_license | bagiasn/book-spot | 4971d8524cfa4fcdf4fe4502ac2531b30a04c016 | 025484870b5696b606b4143b9b6edb86d0144a1f | refs/heads/master | 2022-10-22T20:45:22.751818 | 2019-07-14T19:47:29 | 2019-07-14T19:47:29 | 197,656,868 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package com.github.bagiasn.bookspot.server;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HomeController {
@RequestMapping("/")
public String home() {
return "Hello from BookSpot!";
}
}
| [
"[email protected]"
] | |
dadbb582844d90abef1decf399d155b0669d034f | 4cd67c8c6d76f0b58bfd3b6f677ed80bfc0c6c87 | /src/main/java/Animal.java | 5fc4fd0b9bb36d1330a1144e2b4e63aa8c44df5e | [] | no_license | mkemmerz/sealed-classes-example | 42c08df597d72fcd07e9380ee0c066396f491ab2 | 4d163817c49d8c6d44015dbef62a6e8c8b6282d1 | refs/heads/master | 2023-08-06T04:22:38.281689 | 2021-10-01T11:29:00 | 2021-10-01T11:29:00 | 296,927,786 | 0 | 0 | null | 2021-10-01T11:29:01 | 2020-09-19T18:24:31 | Java | UTF-8 | Java | false | false | 267 | java | /**
* A sealed interface only allows specific classes to implement the interface it is declared on.
*
* In this case only sub-Animal's of the type Cat, Dog or Duck are allowed.
*/
public sealed interface Animal permits Cat, Dog, Duck {
String makeSound();
}
| [
"[email protected]"
] | |
d7cb994b2ec2c0b09d41e5897439a4589dd31ad0 | 4f38bf1485fa5f6ce307bf6c9c19b28fa5e0be01 | /ProductsCrud/src/main/java/com/serverless/products/model/Product.java | 3f90a7fd0584f7d0aeb3405f4d34627f883528ba | [] | no_license | malhotrarakesh/ProductsPoc | 1ccadc3283d185a6c5aeb8dbf2973e5648dc89f0 | dd1d38e200ce9592be7cbd354b96696e87644448 | refs/heads/master | 2021-01-19T03:56:49.554662 | 2017-05-06T10:49:21 | 2017-05-06T10:49:21 | 84,420,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,908 | java | package com.serverless.products.model;
public class Product {
private int id;
private String title;
private String description;
private String imageSource;
public Product() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getImageSource() {
return imageSource;
}
public void setImageSource(String imageSource) {
this.imageSource = imageSource;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + id;
result = prime * result + ((imageSource == null) ? 0 : imageSource.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Product other = (Product) obj;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (id != other.id)
return false;
if (imageSource == null) {
if (other.imageSource != null)
return false;
} else if (!imageSource.equals(other.imageSource))
return false;
if (title == null) {
if (other.title != null)
return false;
} else if (!title.equals(other.title))
return false;
return true;
}
@Override
public String toString() {
return "Product [id=" + id + ", title=" + title + ", description=" + description + ", imageSource=" + imageSource + "]";
}
}
| [
"[email protected]"
] | |
1fd36767eaf290cbd45d4c71f6a671b605b1e9d6 | 6504352f86c2e4f7ef16cea3f5b7cc00bba96a33 | /WmesWeb/src/com/fsll/wmes/entity/OrderPlanAip.java | 51538454f05b330ddee60f8483f65b8e275f619c | [] | no_license | jedyang/XFAWealth | 1a20c7b4d16c72883b27c4d8aa72d67df4291b9a | 029d45620b3375a86fec8bb1161492325f9f2c6c | refs/heads/master | 2021-05-07T04:53:24.628018 | 2017-08-03T15:25:59 | 2017-08-03T15:25:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,130 | java | package com.fsll.wmes.entity;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Entity
@Table(name = "order_plan_aip")
public class OrderPlanAip {
@Id
@Column(name = "id")
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid.hex")
private String id;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "plan_id")
@JsonIgnore
private OrderPlan plan;
@Column(name = "aip_init_time")
private Date aipInitTime;
@Column(name = "aip_exec_cycle")
private String aipExecCycle;
@Column(name = "aip_time_distance")
private Integer aipTimeDistance;
@Column(name = "aip_amount")
private Double aipAmount;
@Column(name = "aip_end_type")
private String aipEndType;
@Column(name = "aip_end_date")
private Date aipEndDate;
@Column(name = "aip_end_count")
private Integer aipEndCount;
@Column(name = "aip_end_total_amount")
private Double aipEndTotalAmount;
@Column(name = "create_time")
private Date createTime;
@Column(name = "last_update")
private Date lastUpdate;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public OrderPlan getPlan() {
return plan;
}
public void setPlan(OrderPlan plan) {
this.plan = plan;
}
public Date getAipInitTime() {
return aipInitTime;
}
public void setAipInitTime(Date aipInitTime) {
this.aipInitTime = aipInitTime;
}
public String getAipExecCycle() {
return aipExecCycle;
}
public void setAipExecCycle(String aipExecCycle) {
this.aipExecCycle = aipExecCycle;
}
public Integer getAipTimeDistance() {
return aipTimeDistance;
}
public void setAipTimeDistance(Integer aipTimeDistance) {
this.aipTimeDistance = aipTimeDistance;
}
public Date getAipEndDate() {
return aipEndDate;
}
public void setAipEndDate(Date aipEndDate) {
this.aipEndDate = aipEndDate;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getLastUpdate() {
return lastUpdate;
}
public void setLastUpdate(Date lastUpdate) {
this.lastUpdate = lastUpdate;
}
public String getAipEndType() {
return aipEndType;
}
public void setAipEndType(String aipEndType) {
this.aipEndType = aipEndType;
}
public Integer getAipEndCount() {
return aipEndCount;
}
public void setAipEndCount(Integer aipEndCount) {
this.aipEndCount = aipEndCount;
}
public Double getAipEndTotalAmount() {
return aipEndTotalAmount;
}
public void setAipEndTotalAmount(Double aipEndTotalAmount) {
this.aipEndTotalAmount = aipEndTotalAmount;
}
public Double getAipAmount() {
return aipAmount;
}
public void setAipAmount(Double aipAmount) {
this.aipAmount = aipAmount;
}
}
| [
"[email protected]"
] | |
ce78f08fce9b8c962e6386eed7642a3a58828b7b | c241e7f1b5f2cc82d7df75d10d80cde27559d485 | /app/src/main/java/com/dayday/yuntaesik/dayday/function/GalleryActivity.java | 1f0f58532c14f3c416a366b4943ca20d2f2ad060 | [] | no_license | YunTaeSik/DayDay | cf4115b50427e6218d88711710b889c13e0ee4ee | d6d880d212598b14f134a714a9efef32cd6991e0 | refs/heads/master | 2020-12-17T10:30:24.176725 | 2020-01-21T08:48:51 | 2020-01-21T08:48:51 | 235,291,231 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,232 | java | package com.dayday.yuntaesik.dayday.function;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.dayday.yuntaesik.dayday.R;
import com.dayday.yuntaesik.dayday.adapter.GalleryBaseAdapter;
import com.dayday.yuntaesik.dayday.dialog.SignDialog;
import com.dayday.yuntaesik.dayday.main.MainActivity;
import com.dayday.yuntaesik.dayday.slidemenu.SlideMenu;
import com.dayday.yuntaesik.dayday.sqlite.DBManager;
import com.dayday.yuntaesik.dayday.util.Contact;
import java.util.ArrayList;
/**
* Created by YunTaeSik on 2016-08-05.
*/
public class GalleryActivity extends AppCompatActivity implements View.OnClickListener {
private GridView gallery_grid;
private GalleryBaseAdapter galleryBaseAdapter;
private DBManager dbManager;
private ArrayList<String> strings = new ArrayList<>();
private ImageButton slide_btn;
private LinearLayout menuPlay;
private String menuFlag = "on";
private View slide_menu;
private SlideMenu slideMenu = new SlideMenu();
private LinearLayout slide_home;
private LinearLayout slide_write;
private LinearLayout slide_gallrery;
private LinearLayout slide_setting;
private LinearLayout slide_calrendar;
private LinearLayout slide_sign;
private LinearLayout touch_layout;
private RelativeLayout main_layout;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gallery);
gallery_grid = (GridView) findViewById(R.id.gallery_grid);
main_layout = (RelativeLayout) findViewById(R.id.main_layout);
slide_menu = (View) findViewById(R.id.slide_menu);
slide_btn = (ImageButton) findViewById(R.id.slide_btn);
menuPlay = (LinearLayout) findViewById(R.id.menuPlay);
touch_layout = (LinearLayout) slide_menu.findViewById(R.id.touch_layout);
slide_home = (LinearLayout) slide_menu.findViewById(R.id.slide_home);
slide_write = (LinearLayout) slide_menu.findViewById(R.id.slide_write);
slide_gallrery = (LinearLayout) slide_menu.findViewById(R.id.slide_gallrery);
slide_setting = (LinearLayout) slide_menu.findViewById(R.id.slide_setting);
slide_calrendar = (LinearLayout) slide_menu.findViewById(R.id.slide_calrendar);
slide_sign = (LinearLayout) slide_menu.findViewById(R.id.slide_sign);
slide_btn.setOnClickListener(this);
touch_layout.setOnClickListener(this);
menuPlay.setOnClickListener(this);
slide_home.setOnClickListener(this);
slide_write.setOnClickListener(this);
slide_gallrery.setOnClickListener(this);
slide_setting.setOnClickListener(this);
slide_calrendar.setOnClickListener(this);
slide_sign.setOnClickListener(this);
dbManager = new DBManager(getApplicationContext(), "Write", null, 1);
SQLiteDatabase redadb = dbManager.getReadableDatabase();
final Cursor cursor = redadb.rawQuery("select * from '" + Contact.WRITE_LIST + "'", null);
while (cursor.moveToNext()) {
String a = cursor.getString(1);
Log.e("uri", a);
final Cursor imagecurser = redadb.rawQuery("select * from '" + a + "'", null);
while (imagecurser.moveToNext()) {
String image = imagecurser.getString(1);
strings.add(image);
galleryBaseAdapter = new GalleryBaseAdapter(this, strings);
Log.e("uri", image);
}
}
gallery_grid.setAdapter(galleryBaseAdapter);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.menuPlay:
case R.id.slide_btn:
if (menuFlag.equals("on")) {
slideMenu.SlideMenuOn(getApplicationContext(), slide_btn, menuFlag, slide_menu, main_layout, null);
menuFlag = "off";
} else if (menuFlag.equals("off")) {
slideMenu.SlideMenuOff(getApplicationContext(), slide_btn, menuFlag, slide_menu, main_layout, null);
menuFlag = "on";
}
break;
case R.id.touch_layout:
if (menuFlag.equals("off")) {
slideMenu.SlideMenuOff(getApplicationContext(), slide_btn, menuFlag, slide_menu, main_layout, null);
menuFlag = "on";
}
break;
case R.id.slide_home:
if (menuFlag.equals("off")) {
slideMenu.SlideMenuOff(getApplicationContext(), slide_btn, menuFlag, slide_menu, main_layout, null);
menuFlag = "on";
}
Intent homeintent = new Intent(getApplicationContext(), MainActivity.class);
startActivity(homeintent);
break;
case R.id.slide_write:
if (menuFlag.equals("off")) {
slideMenu.SlideMenuOff(getApplicationContext(), slide_btn, menuFlag, slide_menu, main_layout, null);
menuFlag = "on";
}
Intent writeintent = new Intent(getApplicationContext(), WriteActivity.class);
startActivity(writeintent);
break;
case R.id.slide_gallrery:
if (menuFlag.equals("off")) {
slideMenu.SlideMenuOff(getApplicationContext(), slide_btn, menuFlag, slide_menu, main_layout, null);
menuFlag = "on";
}
break;
case R.id.slide_setting:
if (menuFlag.equals("off")) {
slideMenu.SlideMenuOff(getApplicationContext(), slide_btn, menuFlag, slide_menu, main_layout, null);
menuFlag = "on";
}
Intent settingintent = new Intent(getApplicationContext(), SettingActivity.class);
startActivity(settingintent);
break;
case R.id.slide_calrendar:
if (menuFlag.equals("off")) {
slideMenu.SlideMenuOff(getApplicationContext(), slide_btn, menuFlag, slide_menu, main_layout, null);
menuFlag = "on";
}
Intent calintent = new Intent(getApplicationContext(), CalnedarActivity.class);
startActivity(calintent);
break;
case R.id.slide_sign:
if (menuFlag.equals("off")) {
slideMenu.SlideMenuOff(getApplicationContext(), slide_btn, menuFlag, slide_menu, main_layout, null);
menuFlag = "on";
}
Intent signntent = new Intent(getApplicationContext(), SignDialog.class);
startActivity(signntent);
break;
}
}
}
| [
"[email protected]"
] | |
d4cef4ae59e50eae9d5a1acf52db79d8382dec8e | c11133cbcabde80ee6416175bf0aadebcb821be1 | /src/main/java/ru/kc4kt4/reactive/crud/domain/Profile.java | 94e21a5ec56c7c10ec5bd4e7681f6d00cf14a3c4 | [] | no_license | kc4kt4/reactive.crud | c9bcd53589ce6d971d2e9e35f402381269dc7281 | 541ea49cbd4d8e8e222897b8a3a8c1161b5fe895 | refs/heads/master | 2022-06-02T12:54:15.882658 | 2020-05-04T09:17:37 | 2020-05-04T09:17:37 | 259,095,446 | 0 | 0 | null | 2020-05-04T09:17:39 | 2020-04-26T17:46:54 | Java | UTF-8 | Java | false | false | 546 | java | package ru.kc4kt4.reactive.crud.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection = "profile")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Profile {
@Id
private String id;
private String firstName;
private String surname;
@Indexed(unique = true)
private String email;
}
| [
"[email protected]"
] | |
3f53028430b498ceaefd97a8ed9b1414c7257bd4 | 732c4e551891f3d751365a3469e2970820c23219 | /src/main/Part1BFS.java | 5a61d31878c2fb6d67446a2ae9e13cc6e875ec48 | [] | no_license | tnewsome8/Comp560A1 | ef91c984f9f9bd3fcee8dc8a6393dfa7965fded6 | 1a14f0096bbb255cf84c281a4650b853d58efbb5 | refs/heads/master | 2021-01-18T05:46:49.620766 | 2015-09-05T23:39:37 | 2015-09-05T23:39:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,181 | java | package main;
import java.util.ArrayList;
public class Part1BFS extends Searcher{
public Part1BFS(ArrayList<char[]> CharMaze, MazeNode[][] Nodes,int startX, int startY,int goalX,int goalY) {
super(CharMaze, Nodes, startX, startY,goalX,goalY);
// TODO Auto-generated constructor stub
}
@Override
public ArrayList<char[]> search() {
boolean done=false;
while(!done){
if(frontier.isEmpty())return null;
MazeNode current=dequeue();
for (MazeNode n : current.getAdjacentNodes()) {
if(!n.visited&&!n.infrontier){
n.predecessor=current;
if(n.goal){
System.out.println("I FOUND IT");
MazeNode curr=n.predecessor;
while(curr.predecessor!=null){
solution.get(curr.row)[curr.column]='.';
curr=curr.predecessor;
}
return solution;
}
enqueue(n);
n.infrontier=true;
}
}
}
return null;
}
public void enqueue(MazeNode N){
frontier.add(N);
//solution.get(N.row)[N.column]='F';
}
public MazeNode dequeue(){
frontier.get(0).infrontier=false;
frontier.get(0).visited=true;
//solution.get(frontier.get(0).row)[frontier.get(0).column]='C';
return frontier.remove(0);
}
}
| [
"[email protected]"
] | |
a18b5a8296566e0776bc3ed185aab5544f4770f0 | edef3d4ac0ecf94c49595d18903e7f73a4084b2a | /design-patterns/patterns-mediator/src/main/java/com/gourd/design/patterns/mediator/Action.java | df36337b87d70744a57048464f2da50f785fb344 | [
"MIT"
] | permissive | zhaodahan/java-advanced | 092fc261a465bf682018732a5bad4c4b3b605da8 | c79fe267ce8bbbf8ea4e910250c0835b8219ca78 | refs/heads/master | 2020-04-12T10:07:09.351112 | 2018-12-03T11:38:31 | 2018-12-03T11:38:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,766 | java | /*
*
* The MIT License Copyright © 2018-2018 GourdErwa
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.gourd.design.patterns.mediator;
/**
* 动作.
*
* @author wei.Li
*/
public enum Action {
/**
* Buy action.
*/
BUY("购买"),
/**
* The Selling.
*/
SELLING("出售"),
/**
* The Let.
*/
LET("出租"),
/**
* The Let.
*/
RENT("租用"),
/**
* The Look.
*/
LOOK("观望"),
/**
* None action.
*/
NONE("");
private String title;
Action(String title) {
this.title = title;
}
/**
* Gets title.
*
* @return the title
*/
public String getTitle() {
return title;
}
}
| [
"[email protected]"
] | |
4fff676cbe4f9907180b3135c79f3f198038fb5c | 73303d454a5ecadd4e8057dad66970e1ed59a086 | /app/src/main/java/com/charlezz/lintcheck/MainActivity.java | 681b7fbac244f1ff8c0522d56f040435e8afc15c | [] | no_license | Charlezz/LintCheck | c511cf01777f2a5777d96b11c56642bdd3e913da | e2ce626152f22a470846ea9eea17c45639aa2159 | refs/heads/master | 2020-08-03T15:40:44.269273 | 2019-09-30T07:41:01 | 2019-09-30T07:41:01 | 211,803,372 | 9 | 1 | null | null | null | null | UTF-8 | Java | false | false | 456 | java | package com.charlezz.lintcheck;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
DataBindingUtil.setContentView(this, R.layout.activity_main);
}
}
| [
"[email protected]"
] | |
b5237ab534c000c7198896d68c56db29b2d0bccd | 233a9c7db31a3b0941b55ca32abe2db85169270e | /app/src/main/java/com/motor/test/fragment/childfragment/TestCurveWavefragment.java | 50e69eff466509f6e0fdd62d522f33976c798508 | [] | no_license | hulucky/motor | 324175efd445931bfb4e9a53e799db1119ac98fe | 1fb0fc64e1f782993c4adc1fbde0462f12c7a7f2 | refs/heads/master | 2020-05-09T20:10:53.735485 | 2019-04-15T02:23:25 | 2019-04-15T02:23:25 | 181,397,085 | 0 | 0 | null | 2019-04-15T02:39:37 | 2019-04-15T02:18:01 | Java | UTF-8 | Java | false | false | 2,933 | java | package com.motor.test.fragment.childfragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.greendao.manager.motorData;
import com.motor.Tools.DrawViewThi;
import com.sensor.SensorData;
import com.sensor.view.SensorView;
import com.motor.administrator.DATAbase.R;
import com.motor.test.TestActivity;
import java.text.DecimalFormat;
import butterknife.ButterKnife;
import butterknife.Unbinder;
public class TestCurveWavefragment extends Fragment {
DecimalFormat df4 = new DecimalFormat("####0.0");
TestActivity mActivity;
Unbinder unbinder;
View mview;
boolean showfb=true;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
mview = inflater.inflate(R.layout.fragment_test_curve_wave, null);
mview.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mActivity = (TestActivity) getParentFragment().getActivity();
unbinder = ButterKnife.bind(this, mview);
return mview;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
public void SetWindCupState(SensorView msv, float mpower, float msignal, int minf) {
SensorData svData = new SensorData();
// 第二步:设置 SensorData 属性
svData.setStatus(minf)
.setPower(mpower)
.setSignal(msignal);
// 第三步:给SensorView 赋值
msv.setData(svData);
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
public void Draw(motorData mdata) {
try {
LinearLayout layout = (LinearLayout) mview.findViewById(R.id.three);
layout.removeAllViews();
final DrawViewThi view = new DrawViewThi(this.getActivity());
view.setMinimumHeight(400);
view.setMinimumWidth(300);
view.setCurveType(0);
view.setData(mdata);
//通知view组件重绘
view.invalidate();
layout.addView(view);
LinearLayout layout1 = (LinearLayout) mview.findViewById(R.id.single);
final DrawViewThi view1 = new DrawViewThi(this.getActivity());
view1.setMinimumHeight(400);
view1.setMinimumWidth(300);
view1.setCurveType(1);
view1.setData(mdata);
//通知view组件重绘
view1.invalidate();
layout1.addView(view1);
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
bc25e6ac9758fdd7bf9accd612128cc4e9d76ccf | f1a06d83c6bfc6e3a0984cbc393b8b40dc9a2583 | /common/mahout-distribution-0.7-hadoop1/math/target/generated-sources/org/apache/mahout/math/map/OpenShortByteHashMap.java | 4589dfb82b1cb74e1456b847c98cb483be23e80b | [
"Apache-2.0"
] | permissive | genericDataCompany/hsandbox | 84595469fc497d622705571aef61b90b188c7b7c | 114e13223ff98c92f3d1f1054e28113d1d9480df | refs/heads/master | 2021-01-21T23:09:54.777036 | 2013-07-09T10:04:51 | 2013-07-09T10:04:51 | 11,278,139 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,023 | 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.
*/
/*
Copyright � 1999 CERN - European Organization for Nuclear Research.
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose
is hereby granted without fee, provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear in supporting documentation.
CERN makes no representations about the suitability of this software for any purpose.
It is provided "as is" without expressed or implied warranty.
*/
package org.apache.mahout.math.map;
import java.util.Arrays;
import org.apache.mahout.math.function.ShortByteProcedure;
import org.apache.mahout.math.function.ShortProcedure;
import org.apache.mahout.math.list.ShortArrayList;
import org.apache.mahout.math.list.ByteArrayList;
/**
* Open hash map from short keys to byte values.
**/
public class OpenShortByteHashMap extends AbstractShortByteMap {
protected static final byte FREE = 0;
protected static final byte FULL = 1;
protected static final byte REMOVED = 2;
protected static final short NO_KEY_VALUE = 0;
/** The hash table keys. */
protected short[] table;
/** The hash table values. */
protected byte[] values;
/** The state of each hash table entry (FREE, FULL, REMOVED). */
protected byte[] state;
/** The number of table entries in state==FREE. */
protected int freeEntries;
/** Constructs an empty map with default capacity and default load factors. */
public OpenShortByteHashMap() {
this(defaultCapacity);
}
/**
* Constructs an empty map with the specified initial capacity and default load factors.
*
* @param initialCapacity the initial capacity of the map.
* @throws IllegalArgumentException if the initial capacity is less than zero.
*/
public OpenShortByteHashMap(int initialCapacity) {
this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
}
/**
* Constructs an empty map with the specified initial capacity and the specified minimum and maximum load factor.
*
* @param initialCapacity the initial capacity.
* @param minLoadFactor the minimum load factor.
* @param maxLoadFactor the maximum load factor.
* @throws IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) ||
* (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >=
* maxLoadFactor)</tt>.
*/
public OpenShortByteHashMap(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
setUp(initialCapacity, minLoadFactor, maxLoadFactor);
}
/** Removes all (key,value) associations from the receiver. Implicitly calls <tt>trimToSize()</tt>. */
@Override
public void clear() {
Arrays.fill(this.state, FREE);
distinct = 0;
freeEntries = table.length; // delta
trimToSize();
}
/**
* Returns a deep copy of the receiver.
*
* @return a deep copy of the receiver.
*/
@Override
public Object clone() {
OpenShortByteHashMap copy = (OpenShortByteHashMap) super.clone();
copy.table = copy.table.clone();
copy.values = copy.values.clone();
copy.state = copy.state.clone();
return copy;
}
/**
* Returns <tt>true</tt> if the receiver contains the specified key.
*
* @return <tt>true</tt> if the receiver contains the specified key.
*/
@Override
public boolean containsKey(short key) {
return indexOfKey(key) >= 0;
}
/**
* Returns <tt>true</tt> if the receiver contains the specified value.
*
* @return <tt>true</tt> if the receiver contains the specified value.
*/
@Override
public boolean containsValue(byte value) {
return indexOfValue(value) >= 0;
}
/**
* Ensures that the receiver can hold at least the specified number of associations without needing to allocate new
* internal memory. If necessary, allocates new internal memory and increases the capacity of the receiver. <p> This
* method never need be called; it is for performance tuning only. Calling this method before <tt>put()</tt>ing a
* large number of associations boosts performance, because the receiver will grow only once instead of potentially
* many times and hash collisions get less probable.
*
* @param minCapacity the desired minimum capacity.
*/
@Override
public void ensureCapacity(int minCapacity) {
if (table.length < minCapacity) {
int newCapacity = nextPrime(minCapacity);
rehash(newCapacity);
}
}
/**
* Applies a procedure to each key of the receiver, if any. Note: Iterates over the keys in no particular order.
* Subclasses can define a particular order, for example, "sorted by key". All methods which <i>can</i> be expressed
* in terms of this method (most methods can) <i>must guarantee</i> to use the <i>same</i> order defined by this
* method, even if it is no particular order. This is necessary so that, for example, methods <tt>keys</tt> and
* <tt>values</tt> will yield association pairs, not two uncorrelated lists.
*
* @param procedure the procedure to be applied. Stops iteration if the procedure returns <tt>false</tt>, otherwise
* continues.
* @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise.
*/
@Override
public boolean forEachKey(ShortProcedure procedure) {
for (int i = table.length; i-- > 0;) {
if (state[i] == FULL) {
if (!procedure.apply(table[i])) {
return false;
}
}
}
return true;
}
/**
* Applies a procedure to each (key,value) pair of the receiver, if any. Iteration order is guaranteed to be
* <i>identical</i> to the order used by method {@link #forEachKey(ShortProcedure)}.
*
* @param procedure the procedure to be applied. Stops iteration if the procedure returns <tt>false</tt>, otherwise
* continues.
* @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise.
*/
@Override
public boolean forEachPair(ShortByteProcedure procedure) {
for (int i = table.length; i-- > 0;) {
if (state[i] == FULL) {
if (!procedure.apply(table[i], values[i])) {
return false;
}
}
}
return true;
}
/**
* Returns the value associated with the specified key. It is often a good idea to first check with
* containsKey(short) whether the given key has a value associated or not, i.e. whether there exists an association
* for the given key or not.
*
* @param key the key to be searched for.
* @return the value associated with the specified key; <tt>0</tt> if no such key is present.
*/
@Override
public byte get(short key) {
final int i = indexOfKey(key);
if (i < 0) {
return 0;
} //not contained
return values[i];
}
/**
* @param key the key to be added to the receiver.
* @return the index where the key would need to be inserted, if it is not already contained. Returns -index-1 if the
* key is already contained at slot index. Therefore, if the returned index < 0, then it is already contained
* at slot -index-1. If the returned index >= 0, then it is NOT already contained and should be inserted at
* slot index.
*/
protected int indexOfInsertion(short key) {
final int length = table.length;
final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
int i = hash % length;
int decrement = hash % (length - 2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
//int decrement = (hash / length) % length;
if (decrement == 0) {
decrement = 1;
}
// stop if we find a removed or free slot, or if we find the key itself
// do NOT skip over removed slots (yes, open addressing is like that...)
while (state[i] == FULL && table[i] != key) {
i -= decrement;
//hashCollisions++;
if (i < 0) {
i += length;
}
}
if (state[i] == REMOVED) {
// stop if we find a free slot, or if we find the key itself.
// do skip over removed slots (yes, open addressing is like that...)
// assertion: there is at least one FREE slot.
final int j = i;
while (state[i] != FREE && (state[i] == REMOVED || table[i] != key)) {
i -= decrement;
//hashCollisions++;
if (i < 0) {
i += length;
}
}
if (state[i] == FREE) {
i = j;
}
}
if (state[i] == FULL) {
// key already contained at slot i.
// return a negative number identifying the slot.
return -i - 1;
}
// not already contained, should be inserted at slot i.
// return a number >= 0 identifying the slot.
return i;
}
/**
* @param key the key to be searched in the receiver.
* @return the index where the key is contained in the receiver, returns -1 if the key was not found.
*/
protected int indexOfKey(short key) {
final int length = table.length;
final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
int i = hash % length;
int decrement = hash % (length - 2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
//int decrement = (hash / length) % length;
if (decrement == 0) {
decrement = 1;
}
// stop if we find a free slot, or if we find the key itself.
// do skip over removed slots (yes, open addressing is like that...)
while (state[i] != FREE && (state[i] == REMOVED || table[i] != key)) {
i -= decrement;
//hashCollisions++;
if (i < 0) {
i += length;
}
}
if (state[i] == FREE) {
return -1;
} // not found
return i; //found, return index where key is contained
}
/**
* @param value the value to be searched in the receiver.
* @return the index where the value is contained in the receiver, returns -1 if the value was not found.
*/
protected int indexOfValue(byte value) {
byte[] val = values;
byte[] stat = state;
for (int i = stat.length; --i >= 0;) {
if (stat[i] == FULL && val[i] == value) {
return i;
}
}
return -1; // not found
}
/**
* Fills all keys contained in the receiver into the specified list. Fills the list, starting at index 0. After this
* call returns the specified list has a new size that equals <tt>this.size()</tt>. Iteration order is guaranteed to
* be <i>identical</i> to the order used by method {@link #forEachKey(ShortProcedure)}.
* <p> This method can be used
* to iterate over the keys of the receiver.
*
* @param list the list to be filled, can have any size.
*/
@Override
public void keys(ShortArrayList list) {
list.setSize(distinct);
short [] elements = list.elements();
int j = 0;
for (int i = table.length; i-- > 0;) {
if (state[i] == FULL) {
elements[j++] = table[i];
}
}
}
/**
* Fills all pairs satisfying a given condition into the specified lists. Fills into the lists, starting at index 0.
* After this call returns the specified lists both have a new size, the number of pairs satisfying the condition.
* Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link
* #forEachKey(ShortProcedure)}. <p> <b>Example:</b> <br>
* <pre>
* ShortByteProcedure condition = new ShortByteProcedure() { // match even values only
* public boolean apply(short key, byte value) { return value%2==0; }
* }
* keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
* </pre>
*
* @param condition the condition to be matched. Takes the current key as first and the current value as second
* argument.
* @param keyList the list to be filled with keys, can have any size.
* @param valueList the list to be filled with values, can have any size.
*/
@Override
public void pairsMatching(ShortByteProcedure condition,
ShortArrayList keyList,
ByteArrayList valueList) {
keyList.clear();
valueList.clear();
for (int i = table.length; i-- > 0;) {
if (state[i] == FULL && condition.apply(table[i], values[i])) {
keyList.add(table[i]);
valueList.add(values[i]);
}
}
}
/**
* Associates the given key with the given value. Replaces any old <tt>(key,someOtherValue)</tt> association, if
* existing.
*
* @param key the key the value shall be associated with.
* @param value the value to be associated.
* @return <tt>true</tt> if the receiver did not already contain such a key; <tt>false</tt> if the receiver did
* already contain such a key - the new value has now replaced the formerly associated value.
*/
@Override
public boolean put(short key, byte value) {
int i = indexOfInsertion(key);
if (i < 0) { //already contained
i = -i - 1;
this.values[i] = value;
return false;
}
if (this.distinct > this.highWaterMark) {
int newCapacity = chooseGrowCapacity(this.distinct + 1, this.minLoadFactor, this.maxLoadFactor);
rehash(newCapacity);
return put(key, value);
}
this.table[i] = key;
this.values[i] = value;
if (this.state[i] == FREE) {
this.freeEntries--;
}
this.state[i] = FULL;
this.distinct++;
if (this.freeEntries < 1) { //delta
int newCapacity = chooseGrowCapacity(this.distinct + 1, this.minLoadFactor, this.maxLoadFactor);
rehash(newCapacity);
}
return true;
}
@Override
public byte adjustOrPutValue(short key, byte newValue, byte incrValue) {
int i = indexOfInsertion(key);
if (i < 0) { //already contained
i = -i - 1;
this.values[i] += incrValue;
return this.values[i];
} else {
put(key, newValue);
return newValue;
}
}
/**
* Rehashes the contents of the receiver into a new table with a smaller or larger capacity. This method is called
* automatically when the number of keys in the receiver exceeds the high water mark or falls below the low water
* mark.
*/
protected void rehash(int newCapacity) {
int oldCapacity = table.length;
//if (oldCapacity == newCapacity) return;
short[] oldTable = table;
byte[] oldValues = values;
byte[] oldState = state;
this.table = new short[newCapacity];
this.values = new byte[newCapacity];
this.state = new byte[newCapacity];
this.lowWaterMark = chooseLowWaterMark(newCapacity, this.minLoadFactor);
this.highWaterMark = chooseHighWaterMark(newCapacity, this.maxLoadFactor);
this.freeEntries = newCapacity - this.distinct; // delta
for (int i = oldCapacity; i-- > 0;) {
if (oldState[i] == FULL) {
short element = oldTable[i];
int index = indexOfInsertion(element);
this.table[index] = element;
this.values[index] = oldValues[i];
this.state[index] = FULL;
}
}
}
/**
* Removes the given key with its associated element from the receiver, if present.
*
* @param key the key to be removed from the receiver.
* @return <tt>true</tt> if the receiver contained the specified key, <tt>false</tt> otherwise.
*/
@Override
public boolean removeKey(short key) {
int i = indexOfKey(key);
if (i < 0) {
return false;
} // key not contained
this.state[i] = REMOVED;
//this.values[i]=0; // delta
this.distinct--;
if (this.distinct < this.lowWaterMark) {
int newCapacity = chooseShrinkCapacity(this.distinct, this.minLoadFactor, this.maxLoadFactor);
rehash(newCapacity);
}
return true;
}
/**
* Initializes the receiver.
*
* @param initialCapacity the initial capacity of the receiver.
* @param minLoadFactor the minLoadFactor of the receiver.
* @param maxLoadFactor the maxLoadFactor of the receiver.
* @throws IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) ||
* (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >=
* maxLoadFactor)</tt>.
*/
@Override
protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
int capacity = initialCapacity;
super.setUp(capacity, minLoadFactor, maxLoadFactor);
capacity = nextPrime(capacity);
if (capacity == 0) {
capacity = 1;
} // open addressing needs at least one FREE slot at any time.
this.table = new short[capacity];
this.values = new byte[capacity];
this.state = new byte[capacity];
// memory will be exhausted long before this pathological case happens, anyway.
this.minLoadFactor = minLoadFactor;
if (capacity == PrimeFinder.largestPrime) {
this.maxLoadFactor = 1.0;
} else {
this.maxLoadFactor = maxLoadFactor;
}
this.distinct = 0;
this.freeEntries = capacity; // delta
// lowWaterMark will be established upon first expansion.
// establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
// After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
// See ensureCapacity(...)
this.lowWaterMark = 0;
this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
}
/**
* Trims the capacity of the receiver to be the receiver's current size. Releases any superfluous internal memory. An
* application can use this operation to minimize the storage of the receiver.
*/
@Override
public void trimToSize() {
// * 1.2 because open addressing's performance exponentially degrades beyond that point
// so that even rehashing the table can take very long
int newCapacity = nextPrime((int) (1 + 1.2 * size()));
if (table.length > newCapacity) {
rehash(newCapacity);
}
}
/**
* Fills all values contained in the receiver into the specified list. Fills the list, starting at index 0. After this
* call returns the specified list has a new size that equals <tt>this.size()</tt>. Iteration order is guaranteed to
* be <i>identical</i> to the order used by method {@link #forEachKey(ShortProcedure)}.
* <p> This method can be used
* to iterate over the values of the receiver.
*
* @param list the list to be filled, can have any size.
*/
@Override
public void values(ByteArrayList list) {
list.setSize(distinct);
byte[] elements = list.elements();
int j = 0;
for (int i = state.length; i-- > 0;) {
if (state[i] == FULL) {
elements[j++] = values[i];
}
}
}
/**
* Access for unit tests.
* @param capacity
* @param minLoadFactor
* @param maxLoadFactor
*/
protected void getInternalFactors(int[] capacity,
double[] minLoadFactor,
double[] maxLoadFactor) {
capacity[0] = table.length;
minLoadFactor[0] = this.minLoadFactor;
maxLoadFactor[0] = this.maxLoadFactor;
}
}
| [
"[email protected]"
] | |
322cbffa6ebe44553d557b6a2a59e84fd560ec9c | 1fd05b32e1858a7a5a19f1804c32cb7f797443f6 | /trunk/netx-shopping-mall/src/main/java/com/netx/shopping/model/productcenter/ProductSkuSpec.java | 31d67de152cee6886b094cc7c83a3ebaf9d9855d | [] | no_license | biantaiwuzui/netx | 089a81cf53768121f99cb54a3daf2f6a1ec3d4c7 | 56c6e07864bd199befe90f8475bf72988c647392 | refs/heads/master | 2020-03-26T22:57:06.970782 | 2018-09-13T02:25:48 | 2018-09-13T02:25:48 | 145,498,445 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,200 | java | package com.netx.shopping.model.productcenter;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author 黎子安
* @since 2018-05-09
*/
@TableName("product_sku_spec")
public class ProductSkuSpec extends Model<ProductSkuSpec> {
private static final long serialVersionUID = 1L;
private String id;
@TableField("sku_id")
private String skuId;
@TableField("property_id")
private String propertyId;
@TableField("value_id")
private String valueId;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
@TableField(fill = FieldFill.INSERT)
private Integer deleted;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSkuId() {
return skuId;
}
public void setSkuId(String skuId) {
this.skuId = skuId;
}
public String getPropertyId() {
return propertyId;
}
public void setPropertyId(String propertyId) {
this.propertyId = propertyId;
}
public String getValueId() {
return valueId;
}
public void setValueId(String valueId) {
this.valueId = valueId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleted() {
return deleted;
}
public void setDeleted(Integer deleted) {
this.deleted = deleted;
}
@Override
protected Serializable pkVal() {
return this.id;
}
@Override
public String toString() {
return "ProductSkuSpec{" +
"id=" + id +
", skuId=" + skuId +
", propertyId=" + propertyId +
", valueId=" + valueId +
", createTime=" + createTime +
", updateTime=" + updateTime +
", deleted=" + deleted +
"}";
}
}
| [
"[email protected]"
] | |
4f845a5d1083b73c29eab2a8a77ce1707b18e744 | b9ef606e059f7204eb11216b218ad0fb3562b4d6 | /basics/AutoArray.java | 953ce96d68529e4c1ae0026a2c8a1c215b1f49d7 | [] | no_license | northgodoftech/java | e8bec980a535bb0e7f872855e7f9a53ff4be3fd0 | 1daf4893dcdb857ad27ff4d93410510e83da2931 | refs/heads/master | 2023-07-10T20:59:33.596780 | 2020-01-16T07:13:00 | 2020-01-16T07:13:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 256 | java | // An improvied version of the previous program.
class AutoArray {
public static void main(String args[]) {
int month_days[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
System.out.println("April has " + month_days[3] + " days.");
}
}
| [
"[email protected]"
] | |
ff3270d086108f408645c970957bf5a36cd9a191 | 5de971bfdc5550ad2585d8310376a246f79fe230 | /Challenge 7/src/GUI/Viewer.java | 3e026d18f753f4e36e373d15646e1b51928ba17b | [] | no_license | JordyvdZwan/ns | aa621156ccd9fdc1321e7de8911b015a5d82ed67 | 7bdeca9688f04b9ab7db12ac61d27b3df39b3bc5 | refs/heads/master | 2021-01-10T16:39:26.677772 | 2016-03-31T13:52:23 | 2016-03-31T13:52:23 | 51,061,073 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,152 | java | package GUI;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.LinkedBlockingQueue;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import Utils.Position;
/**
* Shows the map of Spiegel with the current location drawn on it
* @author Bernd
*
*/
public class Viewer implements Runnable {
private LinkedBlockingQueue<Position> pos;
public Viewer(LinkedBlockingQueue<Position> pos){
this.pos = pos;
}
@Override
public void run() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setSize(1150, 950);
Image image;
Image backup;
Image point;
try {
image = ImageIO.read(new File("horst.png")); //ImageIO.read(new File("spiegel_beter.png"));
backup = ImageIO.read(new File("horst.png")); //ImageIO.read(new File("spiegel_beter.png"));
point = ImageIO.read(new File("point.png"));
JLabel label = new JLabel(new ImageIcon(image));
JPanel panel = new JPanel(new BorderLayout());
panel.add(label);
frame.add(panel);
frame.setVisible(true);
Graphics draw = image.getGraphics();
draw.setColor(Color.RED);
Position currentPos;
while(true){
currentPos = pos.take();
currentPos = getMapPosition(currentPos);
draw.drawImage(backup, 0, 0, null);
draw.drawImage(point, (int)currentPos.getX()-5, (int)currentPos.getY()-5, null);
label.repaint();
}
} catch (IOException | InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* Translates from map grid coordinates to pixel coordinates used for drawing
* @param pos
* @return
*/
public static Position getMapPosition(Position pos){
double x = pos.getX();
x = x*10;
x = x + 45;
double y = pos.getY();
y = y*10;
y = y + 44;
return new Position(x,y);
}
}
| [
"[email protected]"
] | |
e0373da3935caad1728ac6f38d27345a4ec2ac39 | 8f794eef0fd36d50d6b819102a9b676a200367fe | /Java/遍历二维数组.java | 9e844466b920d806821b6607e40fa1ccc93deedb | [] | no_license | kagurazakayashi/CodeNotebook | 54fc95806d7e65dfec5b9f95b61c4ab486052535 | 621a75cbaf767222dbf24d729c3e04d2f3721a53 | refs/heads/master | 2023-08-17T17:29:33.177215 | 2023-08-13T12:49:12 | 2023-08-13T12:49:12 | 141,578,784 | 21 | 7 | null | null | null | null | UTF-8 | Java | false | false | 755 | java | // for 遍历
int arr[][] = new int[][]{{1},{2,3},{4,5,6}};
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[i].length; j++) {
System.out.print(arr[i][j]);
}
System.out.println();
}
// foreach 遍历
int arr[][] = new int[][]{{4,3},{1,5}};
for (int x[]:arr) { //外层遍历得到一维数组
for (int e:x) { //内层遍历得到数组元素
System.out.print(e);
}
System.out.println();
}
// Arrays toString 遍历
int arr[][] = new int[][]{{9,8},{7,6,5}};
for (int i = 0; i < arr.length; i++) { //循环得到一维数组
System.out.println(Arrays.toString(arr[i])); //将一维数组转化为字符串输出
}
// https://blog.csdn.net/hujutaoseu/article/details/70777774 | [
"[email protected]"
] | |
01efc8918e1c0eb6b1700de58efaf034d4d16952 | 0a1b01240edbe72513e2033eebb259ead850b93a | /Program9.java | a091f21159dca7940b2ce88d70d48b9a35be826b | [] | no_license | Code-With-Shubham/Java-Programs | 21de6d803d93eac623036532890b1419c31eb069 | a9bcad1472ea4c8ef2ce13eb3092017b990fca2d | refs/heads/main | 2023-05-14T17:46:21.982499 | 2021-06-11T07:01:45 | 2021-06-11T07:01:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 590 | java | //9. Program to print age group of a person by taking age as input from command line.
class Program9
{
public static void main(String args[])
{
int age=Integer.parseInt(args[0]);
if(age>0 && age<18)
{
System.out.println("Young Age");
}
else if(age>=18 && age<40)
{
System.out.println("Middle Age");
}
else if(age>=40)
{
System.out.println("Old Age");
}
else
{
System.out.println("Invalid Age ");
}
}
} | [
"[email protected]"
] | |
ee9432a1470e8dbd4cfe70398ddd99b7e3fbfbf0 | ce1b76b6d64bab62e29ce89075aa8e3e8bba93e5 | /app/src/main/java/com/example/manoj/rnhlocator/AddLocationsActivity.java | 17b46fbf220f258636d36c41492434eb47fd4f06 | [] | no_license | hamlakshan/RNHLocator | 2cd16c1e40eea21ce27b8ca53973f20dc5fe77f5 | 4db6d506d2ca43820b287d9d8ae3f701d134c65c | refs/heads/master | 2021-01-01T16:13:42.437431 | 2015-09-06T14:31:52 | 2015-09-06T14:31:52 | 38,558,682 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,354 | java | package com.example.manoj.rnhlocator;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.LatLng;
public class AddLocationsActivity extends Activity {
Spinner dropDown;
Button addnew;
Button getCordinate;
Button markOnmap;
Button exit;
EditText name;
EditText description;
EditText latitude;
EditText longitude;
DatabaseHandler db;
private GoogleMap googleMap;
private static final String TAG_LOG = "myview";
GPSTracker gps;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.add_locations_window);
addSpinner();
addnew = (Button) findViewById(R.id.btnadd); //this button is used to add the new location
getCordinate = (Button) findViewById(R.id.btnGetLocation); //this button id used to add the location codrinates ising GPS tracker
markOnmap = (Button) findViewById(R.id.gotomap); //this button is used to add the location codinates using by touching the map
exit = (Button) findViewById(R.id.btnexit);
name = (EditText) findViewById(R.id.name);
description = (EditText) findViewById(R.id.descriptionTxt);
latitude = (EditText) findViewById(R.id.latitude);
longitude = (EditText) findViewById(R.id.longitude);
addnew.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG_LOG, "add button pressed");
showAlert(AddLocationsActivity.this); //opens the alert window
}
});
//when user paress the generate Codinates button
getCordinate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// create gps class object
gps = new GPSTracker(AddLocationsActivity.this);
// check if GPS enabled
if (gps.canGetLocation()) {
double latitude = gps.getLatitude();
double longitude = gps.getLongitude();
// \n is for new line
Toast.makeText(getApplicationContext(), "Your Location is - \nLat: " + latitude + "\nLong: " + longitude, Toast.LENGTH_LONG).show();
} else {
// can't get location
// GPS or Network is not enabled
// Ask user to enable GPS/network in settings
gps.showSettingsAlert();
}
latitude.setText(Double.toString(gps.getLatitude()));
longitude.setText(Double.toString(gps.getLongitude()));
}
});
//when user paress the mark on map function
markOnmap.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
// Loading map
initilizeMap();
} catch (Exception e) {
e.printStackTrace();
}
}
});
//when exit button is pressed the current window will be closed
exit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
//this method is used to add new user data to the database
public void addData() {
db = new DatabaseHandler(this);
String religion = dropDown.getSelectedItem().toString();
//add new data touple it to the data base as a Location object
db.addLocation(new Location(name.getText().toString(), religion, description.getText().toString(), latitude.getText().toString(), longitude.getText().toString()));
// showAlert();
}
//this method used to create the dropdown menu to select the religion
public void addSpinner() {
dropDown = (Spinner) findViewById(R.id.religion_spinner);
// Create an ArrayAdapter using the string array and a default spinner layout
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.religions, android.R.layout.simple_spinner_item);
// Specify the layout to use when the list of choices appears
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Apply the adapter to the spinner
dropDown.setAdapter(adapter);
dropDown.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
parent.getItemAtPosition(position);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// TODO Auto-generated method stub
}
});
}
//this method is used to show the map if user wants to mark the palce on the map
public void initilizeMap() {
if (googleMap == null) {
googleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
// check if map is created successfully or not
googleMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
googleMap.setMyLocationEnabled(true); // false to disable shows my current location on the map
googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(6.7903917f, 79.9005859f), 14.0f));
if (googleMap == null) {
Toast.makeText(getApplicationContext(), "Sorry! unable to create maps", Toast.LENGTH_SHORT).show();
} else {
//the option to touch the maps and find mark the location
googleMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng position) {
Toast.makeText(getApplicationContext(), position.latitude + " : " + position.longitude, Toast.LENGTH_SHORT).show(); //show the marked pace in the toast
latitude.setText(Double.toString(position.latitude)); //change the edit text
longitude.setText(Double.toString(position.longitude)); //change the edit text
}
});
}
}
}
//this method is used to alert the user before entering the data to the database
public void showAlert(Context context) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
// Setting Dialog Title
alertDialog.setTitle("Adding new data");
// Setting Dialog Message
alertDialog.setMessage("Are you sure you want to add new location");
// Setting Icon to Dialog
alertDialog.setIcon(R.drawable.alert);
// On pressing Settings button
alertDialog.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (name.getText() != null && latitude.getText() != null && longitude.getText() != null) {
addData(); //call the methd to add data to the database
}
}
});
// on pressing cancel button
alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
// Showing Alert Message
Log.d(TAG_LOG, "im here");
// alertDialog.show();
AlertDialog alert11 = alertDialog.create();
alert11.show();
}
}
| [
"="
] | = |
0cbe483f1a5df7c05deb9e727947dc152cdfa131 | ad95c9f10726c84fed75b174591649a540caedfb | /Festivali-back/src/main/java/festival/service/support/MestoDtoToMesto.java | 1b7fe7bde8e181c7b613ce14e8506d7b9d79af03 | [] | no_license | belivuk88/FestivalApplication | 8bd9d7d9cc7d83e64c4da160af491ecc45413efb | ee18d075341814dcd30e7b22c646523a58a1b16d | refs/heads/main | 2023-06-08T01:12:38.554974 | 2021-06-18T18:02:43 | 2021-06-18T18:02:43 | 378,221,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 759 | java | package festival.service.support;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
import festival.model.Mesto;
import festival.service.MestoService;
import festival.service.web.dto.MestoDTO;
@Component
public class MestoDtoToMesto implements Converter<MestoDTO, Mesto> {
@Autowired
private MestoService mestoService;
@Override
public Mesto convert (MestoDTO dto) {
Mesto mesto;
if(dto.getId() == null) {
mesto = new Mesto();
}else {
mesto = mestoService.findOne(dto.getId()).get();
}
if(mesto !=null) {
mesto.setGrad(dto.getGrad());
mesto.setDrzava(dto.getDrzava());
}
return mesto;
}
}
| [
"[email protected]"
] | |
811d9f8ca446f5228599f99e7048bf5ab1ec8a43 | 08985238ed3801338fdb11c69002a17d37728161 | /src/com/portal/usermgr/service/impl/GroupServiceImpl.java | e58764a38eca04de97c55319e88e9d41b79ceb16 | [] | no_license | grrey/javassf | 4a4c0fb67d0add740dac9abf6b85e657c072b631 | 7a9982d021a48a7e970982c2855cf550da4c1b61 | refs/heads/master | 2016-09-05T21:32:18.883646 | 2015-08-18T02:50:08 | 2015-08-18T02:50:08 | 40,946,997 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,414 | java | package com.portal.usermgr.service.impl;
import com.portal.sysmgr.entity.Site;
import com.portal.usermgr.dao.GroupDao;
import com.portal.usermgr.entity.Group;
import com.portal.usermgr.entity.GroupPerm;
import com.portal.usermgr.service.GroupPermService;
import com.portal.usermgr.service.GroupService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class GroupServiceImpl
implements GroupService
{
private GroupDao dao;
private GroupPermService groupPermService;
@Transactional(readOnly=true)
public List<Group> getList(Integer siteId, String sortname, String sortorder)
{
return this.dao.getList(siteId, sortname, sortorder);
}
@Transactional(readOnly=true)
public Group findById(Integer id) {
Group entity = (Group)this.dao.findById(id);
return entity;
}
public Group saveGroup(Group group, GroupPerm groupPerm, Site site) {
group.setSite(site);
save(group);
this.groupPermService.save(group, groupPerm);
return group;
}
public Group updateGroup(Group group, GroupPerm groupPerm) {
update(group);
this.groupPermService.update(groupPerm);
return group;
}
public Group save(Group bean) {
bean.init();
this.dao.save(bean);
return bean;
}
public Group update(Group bean) {
bean = (Group)this.dao.update(bean);
return bean;
}
public Group deleteById(Integer id) {
Group bean = (Group)this.dao.deleteById(id);
return bean;
}
public Group[] deleteByIds(Integer[] ids) {
Group[] beans = new Group[ids.length];
int i = 0; for (int len = ids.length; i < len; i++) {
beans[i] = deleteById(ids[i]);
}
return beans;
}
public Group[] updatePriority(Integer[] ids, Integer[] priority) {
int len = ids.length;
Group[] beans = new Group[len];
for (int i = 0; i < len; i++) {
beans[i] = findById(ids[i]);
beans[i].setPriority(priority[i]);
}
return beans;
}
@Autowired
public void setDao(GroupDao dao)
{
this.dao = dao;
}
@Autowired
public void setGroupPermService(GroupPermService groupPermService) {
this.groupPermService = groupPermService;
}
}
| [
"[email protected]"
] | |
43ac3fb6aeb2607fd3132b11f38c035a23e481a3 | 705a3a1ebde7494bb5f7b01ed041d34c14832100 | /SSB/src/ss/week1/ModulusCounter.java | 7a39efdfc7dccf7a9ca05251b2bf91ed6f28b21b | [] | no_license | Pieterjaninfo/Softwaresystems | 9a17e7fef42b4ace392689a87bec0389caaa22e4 | 1c877cdb4d32b9df8577b081b81c876b4ad222a0 | refs/heads/master | 2021-01-10T16:05:40.576787 | 2015-12-13T13:44:47 | 2015-12-13T13:44:47 | 46,986,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | java | package ss.week1;
public class ModulusCounter {
//----------- Instance variables ----------------------
//----------- Constructor ----------------
public ModulusCounter(int value, int maxValue) {
}
//---------- Queries -------------------
//---------- Commands ------------------
}
| [
"bart@LaptopBdeb"
] | bart@LaptopBdeb |
e3f7d50a3a8a2fdbc21546b4ed816c2a9ca1501e | 17b6c1ad56fef71667440070713129d41ff13018 | /src/main/java/com/ericsson/request/dto/ScanQRRequestDTO.java | 85468174180440f023becbc547e357ecda43f6d6 | [] | no_license | keychain-source/keychain-ws | e5332d8ed7ae3b2bd8858db7dbfc6a1ea97d3ea5 | e37669eff9b886605a26ebf0dd9693346731c0ad | refs/heads/master | 2023-05-05T05:08:23.106407 | 2020-03-26T04:01:42 | 2020-03-26T04:01:42 | 243,442,230 | 0 | 0 | null | 2023-04-14T17:27:23 | 2020-02-27T05:53:30 | Java | UTF-8 | Java | false | false | 845 | java | package com.ericsson.request.dto;
public class ScanQRRequestDTO {
private String qr_code;
private String requester_device_id;
private String qr_code_status;
public String getQr_code() {
return qr_code;
}
public void setQr_code(String qr_code) {
this.qr_code = qr_code;
}
public String getRequester_device_id() {
return requester_device_id;
}
public void setRequester_device_id(String requester_device_id) {
this.requester_device_id = requester_device_id;
}
public String getQr_code_status() {
return qr_code_status;
}
public void setQr_code_status(String qr_code_status) {
this.qr_code_status = qr_code_status;
}
@Override
public String toString() {
return "RegisterQRRequestDTO [qr_code=" + qr_code + ", requester_device_id=" + requester_device_id
+ ", qr_code_status=" + qr_code_status + "]";
}
}
| [
"[email protected]"
] | |
d1de3c5cd4132e1f5a1b1e5d5931baacc1e4cb28 | 0e719c6700400b547ca62cfb2d1ab4c74f8218ff | /P2Pproj/src/test/java/top/zzh/test/JklxTest.java | 3847abbf5bca724f231181787d50644407487b15 | [] | no_license | ChenZhenCZ/JavaWeb | 688a6ad92622af24e238c12ce15cdc5c19e75fd9 | cc308c4decc3ef5d65ccae26453cbcfbbc3871b4 | refs/heads/master | 2021-05-16T05:09:47.967350 | 2018-03-22T00:02:24 | 2018-03-22T00:02:24 | 106,273,182 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,017 | java | package top.zzh.test;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import top.zzh.bean.Bz;
import top.zzh.bean.Jklx;
import top.zzh.service.JklxService;
/**
* @version :1.0
* CREATE TIME :2017/12/25 19:45
* @authro :LH
*/
public class JklxTest extends BaseTest {
@Autowired
private JklxService jklxService;
@Test
public void save(){
Jklx jklx =new Jklx();
jklx.setLxname("12");
jklx.setState((byte)0);
jklxService.save(jklx);
}
@Test
public void update(){
Jklx jklx = new Jklx();
jklx.setLxname("zzz");
jklx.setState((byte)0);
jklx.setLxid(1L);
jklxService.update(jklx);
}
@Test
public void updateState(){
Jklx jklx = new Jklx();
jklx.setState((byte)1);
jklx.setLxid(1L);
jklxService.updateState(jklx);
}
@Test
public void removeById(){
Long lxid = 1L;
jklxService.removeById(lxid);
}
}
| [
"[email protected]"
] | |
e9b1fc7c62d596efc216ac17f39ab21989977667 | bc9cea5786571c0d66b593c8526c40eb1a04da18 | /src/cn/jinty/bookstore/user/servlet/UserServlet.java | c481fec2dd498d586f25edf2d2f4c018b4ecb7f2 | [] | no_license | jinty95/MyBookStore | 62a94f792a7313d95d9f8fb2b668298a22029165 | dedfe90063580fd6de16b1da9a7b19c01fafbcb0 | refs/heads/master | 2020-04-02T14:02:46.247143 | 2018-11-10T12:08:24 | 2018-11-10T12:08:24 | 154,500,361 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,522 | java | package cn.jinty.bookstore.user.servlet;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.itcast.commons.CommonUtils;
import cn.itcast.mail.Mail;
import cn.itcast.mail.MailUtils;
import cn.itcast.servlet.BaseServlet;
import cn.jinty.bookstore.cart.domain.Cart;
import cn.jinty.bookstore.user.domain.User;
import cn.jinty.bookstore.user.service.UserException;
import cn.jinty.bookstore.user.service.UserService;
public class UserServlet extends BaseServlet {
private static final long serialVersionUID = 1L;
private UserService userService=new UserService();
public String regist(HttpServletRequest request,HttpServletResponse response)
{
User form=new User();
form.setUsername(request.getParameter("username"));
form.setPassword(request.getParameter("password"));
form.setEmail(request.getParameter("email"));
form.setUid(CommonUtils.uuid());
form.setCode(CommonUtils.uuid()+CommonUtils.uuid());
Map<String,String> errors = new HashMap<String,String>();
String username=form.getUsername();
if(username==null||username.trim().isEmpty()) {
errors.put("username","用户名不能空");
}else if(username.length()<3||username.length()>10) {
errors.put("username","长度必须在3-10之间");
}
String password=form.getPassword();
if(password==null||password.trim().isEmpty()) {
errors.put("password","密码不能空");
}else if(password.length()<3||password.length()>10) {
errors.put("password","长度必须在3-10之间");
}
String email=form.getEmail();
if(email==null||email.trim().isEmpty()) {
errors.put("email","邮箱不能空");
}else if(!email.matches("[A-Za-z0-9_]+@\\w+\\.\\w+")) {
errors.put("email","email格式错误");
}
if(errors.size()>0) {
request.setAttribute("errors", errors);
request.setAttribute("form", form);
return "f:/JSPS/User/regist.jsp";
}
try {
userService.regist(form);
} catch (UserException e) {
// TODO Auto-generated catch block
request.setAttribute("msg", e.getMessage());
request.setAttribute("form", form);
return "f:/JSPS/User/regist.jsp";
}
java.util.Properties props=new Properties();
try {
props.load(this.getClass().getClassLoader().getResourceAsStream("email_template.properties"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String host=props.getProperty("host");
String userName=props.getProperty("userName");
String passWord=props.getProperty("passWord");
String from=props.getProperty("from");
String to=form.getEmail();
String subject=props.getProperty("subject");
String content=props.getProperty("content");
content=MessageFormat.format(content, form.getCode());
Session session=MailUtils.createSession(host, userName, passWord);
Mail mail=new Mail(from,to,subject,content);
try {
MailUtils.send(session, mail);
} catch (MessagingException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
request.setAttribute("msg", "注册成功!请到邮箱中激活");
return "f:/JSPS/msg.jsp";
}
public String active(HttpServletRequest request,HttpServletResponse response) {
String code=request.getParameter("code");
try {
userService.active(code);
request.setAttribute("msg", "恭喜您激活成功");
return "f:/JSPS/msg.jsp";
} catch (UserException e) {
// TODO Auto-generated catch block
request.setAttribute("msg", e.getMessage());
return "f:/JSPS/msg.jsp";
}
}
public String login(HttpServletRequest request,HttpServletResponse response) {
User form=new User();
form.setUsername(request.getParameter("username"));
form.setPassword(request.getParameter("password"));
try {
User user=userService.login(form);
request.getSession().setAttribute("session_user", user);
//给用户添加购物车到Session中
request.getSession().setAttribute("cart", new Cart());
return "r:/index.jsp";
} catch (UserException e) {
// TODO Auto-generated catch block
request.setAttribute("msg", e.getMessage());
request.setAttribute("form", form);
return "f:/JSPS/User/login.jsp";
}
}
public String quit(HttpServletRequest request,HttpServletResponse response) {
request.getSession().invalidate();
return "r:/index.jsp";
}
}
| [
"[email protected]"
] | |
bc98a19a180a750d0d4f386b95e3c7ddadf10551 | 56ed562061670f967dd3acd13e70fe1d09d928df | /alumniassociation-web/src/main/java/com/alumniassociation/web/common/service/SysGeneratorService.java | 50408f04efab6bae814f9f4cbebef0bc1b2c08ac | [] | no_license | liuyuzhou/alumniassociation | 5ac368e7e020587a7de86ff8ce6e95a18357747a | 1081f000960464bdfd79f3924ac1f89d05603a50 | refs/heads/master | 2023-03-10T23:02:26.411565 | 2022-04-20T11:13:34 | 2022-04-20T11:13:34 | 202,167,937 | 3 | 1 | null | 2023-02-22T01:03:02 | 2019-08-13T14:59:44 | JavaScript | UTF-8 | Java | false | false | 551 | java | package com.alumniassociation.web.common.service;
import java.util.List;
import java.util.Map;
/**
* 代码生成器
*
* @author chenyi
* @email [email protected]
* @date 2016年12月19日 下午3:33:38
*/
public interface SysGeneratorService {
List<Map<String, Object>> queryList(Map<String, Object> map);
int queryTotal(Map<String, Object> map);
Map<String, String> queryTable(String tableName);
List<Map<String, String>> queryColumns(String tableName);
/**
* 生成代码
*/
byte[] generatorCode(String[] tableNames);
}
| [
"[email protected]"
] | |
e29658bcd7bb643c9de18a3bc961e0ae60dd926f | 17fcd4b4a6339003e74a4ba57c187e2bfbd4a9cc | /log-demo-ms2/src/main/java/com/example/LogDemoMs2Application.java | cff42a01e4f3e6e589eefdb83dea1eb96cc35576 | [] | no_license | durbaka/Log4JDemo | b392e340bebeb536ec10d39cff5ac39b80ff5979 | 4954abfbec7a5bf06635566d9da44e0b0b871ae5 | refs/heads/master | 2020-12-31T00:54:40.700268 | 2017-02-02T09:34:28 | 2017-02-02T09:34:28 | 80,592,788 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,724 | java | package com.example;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.sleuth.Span;
import org.springframework.cloud.sleuth.SpanAccessor;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.sampler.AlwaysSampler;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
@RestController
@SpringBootApplication
public class LogDemoMs2Application {
public int multiplier = 10;
@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
}
RestTemplate restTemplate = new RestTemplate();
@Autowired
Tracer tracer;
@Autowired
private SpanAccessor accessor;
/*Logger logger = LoggerFactory.getLogger(LogDemoMs1Application.class);*/
static Logger log = Logger.getLogger(LogDemoMs2Application.class.getName());
Span newSpan1;
@RequestMapping(value="/input/{appId}",method=RequestMethod.GET)
public String getDecision(@PathVariable("appId") int inputId){
return ("output after multiplier is "+ multiplier * inputId);
}
@RequestMapping(value="/1/{input}",method=RequestMethod.GET)
public String service1(@PathVariable("input") int inputId) {
newSpan1 = this.tracer.createSpan("1-service", new AlwaysSampler());
try {
/*Span span = this.accessor.getCurrentSpan();*/
log.info("service 1");
this.tracer.addTag("name", "1-service-tag");
Span currentSpan = LogDemoMs2Application.this.accessor.getCurrentSpan();
/*System.out.println(currentSpan.idToHex(currentSpan.getTraceId())+" traceID");
System.out.println(currentSpan.idToHex(currentSpan.getSpanId())+" spanID");
List<Long> parent = currentSpan.getParents();
System.out.println(currentSpan.idToHex(parent.get(0)) + " parent");
System.out.println(currentSpan.get+" processID");
System.out.println(currentSpan.idToHex(currentSpan.getParents()));
System.out.println(currentSpan);*/
newSpan1.logEvent("1-service-bc2");
restTemplate.postForObject("http://192.168.172.43:9002/2",currentSpan, Object.class);
newSpan1.logEvent("1-service-ac2");
return "service 1" + " " + "";
} finally {
this.tracer.close(newSpan1);
}
}
@RequestMapping(value = "/2", method = RequestMethod.POST, consumes = "application/json")
void service2(@RequestBody Span data) {
Span newSpan2 = this.tracer.createSpan("2-service",data);
//Span s = new Span();
//Span s = Span(data);
/*Span newSpan2 = this.tracer.createSpan("2-service",Span currentSpan);*/
/*Span continuedSpan = this.tracer.continueSpan(newSpan1);*/
/* System.out.println(data);
System.out.println(data.getClass());*/
try {
/*log.trace("service 2");
log.debug("service 2");*/
log.info("service 2");
/*log.warn("service 2");
log.error("service 2");*/
/* this.tracer.addTag("name", "2-service-tag");*/
/*return "service 2";*/
}
finally {
/*this.tracer.close(currentSpan);*/
this.tracer.close(newSpan2);
}
}
public static void main(String[] args) {
SpringApplication.run(LogDemoMs2Application.class, args);
}
}
| [
"[email protected]"
] | |
f68744702bd7230c5fc07311c6f660189deab4c7 | 218eecfeb3de32e2db939b8ca67ce39f05e6edcd | /src/main/java/com/zongs365/open/api/request/device/DeviceListRequest.java | 06b8947e4943f022203729898a07c733d328ab1d | [] | no_license | wjq1028/zongsOpenGatewaySdk | c50d857d84d5b03afece323f5c3065fad6d7a860 | a7ee33988e39767c6cc6c02fec50163d388a2fe1 | refs/heads/master | 2022-11-30T11:12:00.611613 | 2020-08-11T10:40:35 | 2020-08-11T10:40:35 | 286,715,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,061 | java | package com.zongs365.open.api.request.device;
import com.zongs365.open.api.request.base.BaseRequest;
import com.zongs365.open.api.request.base.BaseRequestBody;
import com.zongs365.open.api.response.device.DeviceListResponse;
import lombok.Data;
public class DeviceListRequest extends BaseRequest<DeviceListRequest.DeviceListRequestBody, DeviceListResponse> {
public DeviceListRequest() { }
@Override
public Class<DeviceListResponse> getResponseClass() {
return DeviceListResponse.class;
}
@Override
public void setBody(DeviceListRequestBody body) {
this.body = body;
}
@Override
public String getMethod() {
return "zs.device.list";
}
@Data
public static class DeviceListRequestBody extends BaseRequestBody {
private int pageNum;
private int pageSize;
public DeviceListRequestBody() {
}
public DeviceListRequestBody(int pageNum, int pageSize) {
this.pageNum = pageNum;
this.pageSize = pageSize;
}
}
}
| [
"[email protected]"
] | |
e6491c32e0c011a5f6fe6e5259b2fedd209ea025 | a5ed7edae2659ccf7f42d096b5a98334fa2a03a7 | /src/main/java/com/neovisionaries/ws/client/SocketConnector.java | 3508eefe60912d1f384325d96bde0a4e62e23888 | [
"Apache-2.0"
] | permissive | yagneshshinde/nv-websocket-client | 16122edc00d131c71454f044fea7a5a9b017f666 | d8226b4c32a7f65bb998e5c3c234ab23c4246863 | refs/heads/master | 2020-05-28T00:03:37.973911 | 2016-03-21T11:13:44 | 2016-03-21T11:13:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,497 | java | /*
* Copyright (C) 2016 Neo Visionaries Inc.
*
* 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.neovisionaries.ws.client;
import java.io.IOException;
import java.net.Socket;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
/**
* A class to connect to the server.
*
* @since 1.20
*
* @author Takahiko Kawasaki
*/
class SocketConnector
{
private Socket mSocket;
private final Address mAddress;
private final int mConnectionTimeout;
private final ProxyHandshaker mProxyHandshaker;
private final SSLSocketFactory mSSLSocketFactory;
private final String mHost;
private final int mPort;
SocketConnector(Socket socket, Address address, int timeout)
{
this(socket, address, timeout, null, null, null, 0);
}
SocketConnector(
Socket socket, Address address, int timeout,
ProxyHandshaker handshaker, SSLSocketFactory sslSocketFactory,
String host, int port)
{
mSocket = socket;
mAddress = address;
mConnectionTimeout = timeout;
mProxyHandshaker = handshaker;
mSSLSocketFactory = sslSocketFactory;
mHost = host;
mPort = port;
}
public Socket getSocket()
{
return mSocket;
}
public int getConnectionTimeout()
{
return mConnectionTimeout;
}
public void connect() throws WebSocketException
{
try
{
// Connect to the server (either a proxy or a WebSocket endpoint).
doConnect();
}
catch (WebSocketException e)
{
// Failed to connect the server.
try
{
// Close the socket.
mSocket.close();
}
catch (IOException ioe)
{
// Ignore any error raised by close().
}
throw e;
}
}
private void doConnect() throws WebSocketException
{
// True if a proxy server is set.
boolean proxied = mProxyHandshaker != null;
try
{
// Connect to the server (either a proxy or a WebSocket endpoint).
mSocket.connect(mAddress.toInetSocketAddress(), mConnectionTimeout);
}
catch (IOException e)
{
// Failed to connect the server.
String message = String.format("Failed to connect to %s'%s': %s",
(proxied ? "the proxy " : ""), mAddress, e.getMessage());
// Raise an exception with SOCKET_CONNECT_ERROR.
throw new WebSocketException(WebSocketError.SOCKET_CONNECT_ERROR, message, e);
}
// If a proxy server is set.
if (proxied)
{
// Perform handshake with the proxy server.
// SSL handshake is performed as necessary, too.
handshake();
}
}
/**
* Perform proxy handshake and optionally SSL handshake.
*/
private void handshake() throws WebSocketException
{
try
{
// Perform handshake with the proxy server.
mProxyHandshaker.perform();
}
catch (IOException e)
{
// Handshake with the proxy server failed.
String message = String.format(
"Handshake with the proxy server (%s) failed: %s", mAddress, e.getMessage());
// Raise an exception with PROXY_HANDSHAKE_ERROR.
throw new WebSocketException(WebSocketError.PROXY_HANDSHAKE_ERROR, message, e);
}
if (mSSLSocketFactory == null)
{
// SSL handshake with the WebSocket endpoint is not needed.
return;
}
try
{
// Overlay the existing socket.
mSocket = mSSLSocketFactory.createSocket(mSocket, mHost, mPort, true);
}
catch (IOException e)
{
// Failed to overlay an existing socket.
String message = "Failed to overlay an existing socket: " + e.getMessage();
// Raise an exception with SOCKET_OVERLAY_ERROR.
throw new WebSocketException(WebSocketError.SOCKET_OVERLAY_ERROR, message, e);
}
try
{
// Start the SSL handshake manually. As for the reason, see
// http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/samples/sockets/client/SSLSocketClient.java
((SSLSocket)mSocket).startHandshake();
}
catch (IOException e)
{
// SSL handshake with the WebSocket endpoint failed.
String message = String.format(
"SSL handshake with the WebSocket endpoint (%s) failed: %s", mAddress, e.getMessage());
// Raise an exception with SSL_HANDSHAKE_ERROR.
throw new WebSocketException(WebSocketError.SSL_HANDSHAKE_ERROR, message, e);
}
}
}
| [
"[email protected]"
] | |
6f35ff24a94b97d08f354acf474ef7674309cd37 | 5611d3924b616b27b51e718c4d9ac00d7cec0042 | /src/main/java/br/com/cotiinformatica/config/CorsConfiguration.java | d35bbe49e83f035b5b25ff3f64195459ac94bca7 | [] | no_license | andre-rjmartins/springapi01 | 35936a6f788fcb2f55856e7522f2fb3db38a6c66 | 43793bfd66bb61cf389f1a67ebd8c806a8103a84 | refs/heads/master | 2023-04-15T20:47:19.331496 | 2021-04-06T00:47:14 | 2021-04-06T00:47:14 | 355,012,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 691 | java | package br.com.cotiinformatica.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@SuppressWarnings("deprecation")
@Configuration
@EnableWebMvc
public class CorsConfiguration extends WebMvcConfigurerAdapter{
@Override
public void addCorsMappings(CorsRegistry registry) {
/*
* Criando uma permissão para que qualquer projeto (servidor)
* possa enviar requisições para os métodos da API.
*/
registry.addMapping("/**");
}
}
| [
"[email protected]"
] | |
fc99f981079972425b6c75ef55dc6d5a95f48bd3 | 7ccc08615c898e347252ff1d252aa01a6b4332f8 | /.metadata/.plugins/org.eclipse.wst.server.core/tmp2/work/Catalina/localhost/Project/org/apache/jsp/dummyframe_jsp.java | ac2f685ee47ec7bfe05233964afae45398e75787 | [] | no_license | pratikmathur279/E-Postal-Services-1 | a04717b2e45cd704a4f8a27257c32f977d4b1c6e | 820dd3abd3e0ffbb1ae3086dc9b9b4073921b8b5 | refs/heads/master | 2021-01-01T17:34:29.582272 | 2017-07-23T13:59:29 | 2017-07-23T13:59:29 | 98,101,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,291 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.26
* Generated at: 2014-07-20 04:05:03 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class dummyframe_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=ISO-8859-1");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\r\n");
out.write("<title>Insert title here</title>\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
out.write("\r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"[email protected]"
] | |
71a965e68f950f5d5064c64b5ceb9bea095aaa90 | 74cee2e35f77574297e94c9adae79a77187b93b7 | /app/src/main/java/com/team10/trotot/model/basic_classes/News.java | adf225669277d3b08a017e5de3ab7cfbe9269ba3 | [] | no_license | Pewdiespyse/TroTot | 3ecaf36bbb1c486be7e6811de1f33216f3771206 | 12e7ca762da600e0c06d0241ecaebc11310aa942 | refs/heads/master | 2020-03-08T07:49:20.384601 | 2018-04-04T03:55:13 | 2018-04-04T03:55:13 | 106,942,272 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,008 | java | package com.team10.trotot.model.basic_classes;
/**
* Created by Pewdiespyse on 21/11/2017.
*/
public class News {
String newsId;
String title;
String content;
long timePost;
public News() {
}
public News(String newsId, String title, String content, long timePost) {
this.newsId = newsId;
this.title = title;
this.content = content;
this.timePost = timePost;
}
public String getNewsId() {
return newsId;
}
public void setNewsId(String newsId) {
this.newsId = newsId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public long getTimePost() {
return timePost;
}
public void setTimePost(long timePost) {
this.timePost = timePost;
}
}
| [
"[email protected]"
] | |
40e04ca140fc22a76cb4b814322c87a0f67ad91b | 5674a28d515f2a678ede01798daa248f2857b514 | /app/src/main/java/ir/mbaas/acratest/CustomDialogs.java | 50d34c0e5b4a125342c190cb3fa38b9c713eb8fa | [] | no_license | irmbaas/AcraTest | 34c7be068ff917872e2a01f09d1671ed8c8d2277 | 719e28b9072591ae5b6dbb767a02e51d437d0448 | refs/heads/master | 2021-01-19T04:47:59.667444 | 2016-05-04T08:14:34 | 2016-05-04T08:14:34 | 69,104,074 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,265 | java | package ir.mbaas.acratest;
import android.app.AlertDialog;
import android.content.Context;
/**
* Created by Mahdi Moradi on 12/10/2014.
*/
public class CustomDialogs {
public static void showOkMessage(Context context, String title, String msg) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(msg);
builder.setPositiveButton(android.R.string.ok, null);
builder.create().show();
}
public static void showErrorAlert(Context context, String title, String msg) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(msg);
builder.setNegativeButton(android.R.string.cancel, null);
builder.create().show();
}
public static void showWarningAlert(Context context, String title, String msg) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(msg);
builder.setPositiveButton(android.R.string.cancel, null);
builder.create().show();
}
}
| [
"[email protected]"
] | |
46d0f6b5d3ed20a0810dbf39c55f09adecc219fc | d1e11dc375748192083124862b194f433f7d379c | /src/main/java/org/grible/gribletest/core/helpers/SystemHelpers.java | f691883068bd8f6c9cbeb432eaa3f600492be1bc | [] | no_license | yashaka/gribletest | 586897675a04218c993cbe023542d02a181ec594 | eda4ee75adf1f34a8b0e418632fa2f0072b6a2d3 | refs/heads/master | 2020-12-31T01:36:47.003268 | 2014-03-05T10:28:26 | 2014-03-05T10:28:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 351 | java | package org.grible.gribletest.core.helpers;
/**
* @author ykramarenko
* Date: 12/24/13
* Time: 12:30 PM
*/
public class SystemHelpers {
public static void debugLog(String message){
System.out.println(String.format("DEBUG INFO: %s: %s: ",
System.currentTimeMillis(),
message));
}
}
| [
"[email protected]"
] | |
2c4ef2fcb0321e4d1d18520b992b0b64714f0a57 | c2902123832e99c25e92a1d43fb9b0924fc3618a | /AnilNayakIIB10/JAXB_ApplicationJava/com/anilnayak/esb/ObjectFactory.java | 941ce0d3ae8c244072f45cf424af9323b0a92b68 | [] | no_license | anilnayak0110/IIB_Practice | 2e00585b7be85a6607e607a4f6d724eb73970d2d | 9bf77b3384cfdb97cfd6c617f817043d83060152 | refs/heads/master | 2020-03-22T03:12:28.722593 | 2019-04-08T18:44:09 | 2019-04-08T18:44:09 | 139,418,992 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,807 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.02.12 at 01:16:04 PM IST
//
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
private final static QName _Employee_QNAME = new QName("", "Employee");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package:
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link NewType }
*
*/
public NewType createNewType() {
return new NewType();
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link NewType }{@code >}}
*
*/
@XmlElementDecl(namespace = "", name = "Employee")
public JAXBElement<NewType> createEmployee(NewType value) {
return new JAXBElement<NewType>(_Employee_QNAME, NewType.class, null, value);
}
}
| [
"[email protected]"
] | |
e7f716b21a023cb3c46bcec041f065ce737ed263 | 4800db70dd126582c5ea4e1a1322232c3d6e9a22 | /src/main/java/com/tedu/cloud_note_1/controller/UserLoginController.java | 8f041cf286cc4b15f4a0d38ffd9d0b2e63b19744 | [] | no_license | BitterGeng/BitterGeng | 2d9cbe3088f997e9dc4cd690b3a79ddab15f4686 | 986e3b173475587b14efe0b0122c3a4ac576cb07 | refs/heads/master | 2021-01-23T10:07:42.060893 | 2017-06-07T08:16:34 | 2017-06-07T08:16:34 | 93,040,182 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,270 | java | package com.tedu.cloud_note_1.controller;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.ResponseBody;
import com.tedu.cloud_note_1.entity.User;
import com.tedu.cloud_note_1.service.UserService;
import com.tedu.cloud_note_1.util.NoteResult;
@Controller
@RequestMapping("/user")
public class UserLoginController {
private static Logger logger = LoggerFactory.getLogger(UserLoginController.class);
@Autowired
UserService userService;
@RequestMapping("/login.do")
@ResponseBody
public NoteResult<User> execute(String name,String password,
HttpSession session){
NoteResult<User> result = new NoteResult<User>();
System.out.println(name);
System.out.println(password);
result = userService.checkLogin(name, password);
if(result.getStatus()==0){
session.setAttribute("name", name);
session.setAttribute("password", password);
session.setMaxInactiveInterval((int) (0.5*60));
}
logger.info("这是登录界面的controller日志输出");
return result;
}
}
| [
"839407658@@qq.com"
] | 839407658@@qq.com |
65e3a4d02e018c9c07e593223e711348287c3e15 | 836c8bb37f4305135efe23935dfc9b70b5b93741 | /app/src/main/java/com/zhuxc/farme/framework/utils/MesssageUtil.java | 98490fb4ec37e8a867d7909d522a8dddeb0e851a | [] | no_license | zhuxc/Framework | 3d1f882459928394d4bda35fb49b0b08a1e7c195 | 8de3e31034e899ef1075c8cef2531a84fe13e9ec | refs/heads/master | 2021-01-10T01:47:45.476051 | 2016-02-15T13:31:33 | 2016-02-15T13:31:33 | 51,757,498 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 551 | java | package com.zhuxc.farme.framework.utils;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
/**
* 信息工具类
* @ClassName: MesssageUtil
* @Description: TODO
* @author zhuxc
* @date 2015-5-12 下午1:35:40
*
*/
public class MesssageUtil {
/**
* 打电话
* @param context
* @param phone
*/
public static void call(Context context,String phone){
Intent intent = new Intent("android.intent.action.DIAL",Uri.parse("tel:"+phone));//自定义的Intent
context.startActivity(intent);
}
}
| [
"朱晓晨"
] | 朱晓晨 |
46fe03d6665cd6dfdcf63e58b7736912db276204 | 408350ba1ec19bc9ce3b0feffd994a714b6d9997 | /source/Md5Util.java | bfa5b8f3594747a77dffcd553c72858b14ce5976 | [] | no_license | github24518/wetchatpay-transfer | 96838cf8697161a82af3c65e918556f8bfa4e422 | b933396618a78f87cc977776c5b00662bb11daf1 | refs/heads/master | 2020-09-26T15:06:21.057992 | 2020-03-05T08:40:19 | 2020-03-05T08:40:19 | 226,279,397 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,178 | java |
import java.security.MessageDigest;
/**
* Created by Administrator on 2018/5/15.
*/
public class Md5Util {
private final static String[] hexDigits = {"0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
public static String byteArrayToHexString(byte[] b) {
StringBuffer resultSb = new StringBuffer();
for (int i = 0; i < b.length; i++) {
resultSb.append(byteToHexString(b[i]));
}
return resultSb.toString();
}
private static String byteToHexString(byte b) {
int n = b;
if (n < 0) {
n = 256 + n;
}
int d1 = n / 16;
int d2 = n % 16;
return hexDigits[d1] + hexDigits[d2];
}
public static String MD5Encode(String origin) {
origin = origin.trim();
String resultString = null;
try {
resultString = new String(origin);
MessageDigest md = MessageDigest.getInstance("MD5");
resultString = byteArrayToHexString(md.digest(resultString
.getBytes("UTF-8")));
} catch (Exception ex) {
}
return resultString;
}
}
| [
"[email protected]"
] | |
bc9b5a33fb5cbf2220820f7ccaeceb5ba21a1d9d | d65a33196a495aa0001b89e321d02fae23721eb6 | /quickcall-account/quickcall-account-facade/src/main/java/com/honglu/quickcall/account/facade/enums/RechargeTypeEnum.java | 905e39028fe04ea7e3d663ea60073c748d3be8c7 | [] | no_license | zihanbobo/Repository | 5c168307848d2639fef7649d4121f37c498a2e7c | db9e91931899f5ef3e5af07722ecee0aa9fb1d02 | refs/heads/master | 2021-10-10T08:58:19.052522 | 2018-11-28T13:22:10 | 2018-11-28T13:22:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 729 | java | package com.honglu.quickcall.account.facade.enums;
/**
* @author xiangxianjin
* @date 2018年10月21日 13点29分
* descrption: 充值类型
*/
public enum RechargeTypeEnum {
ALIPAY(1, "支付宝"),
WECHAT(2, "微信"),
APPLE_PAY(3, "苹果内购");
private Integer type;
private String desc;
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
RechargeTypeEnum(Integer code, String desc) {
this.type = code;
this.desc = desc;
}
}
| [
"[email protected]"
] | |
29b2c7ecb5c58aa658bf521080b3e8ff429c582c | e7bb45a13209049f669a3220dd0815c15eab473a | /springboot-webservice/springboot-webservice-clientxfire/src/main/java/com/bo/springboot/user/Remove.java | 86d2b6b84daf2e1256b05ef436b07e11aea30323 | [] | no_license | Nobodylesszb/middle-ware-boot | 75f2a945a5772f16dfe973658d891af332292045 | 5fd0f24dcd9a7914d47703c9dea20a2381cba907 | refs/heads/master | 2023-03-05T17:44:07.960000 | 2022-05-05T03:16:41 | 2022-05-05T03:16:41 | 247,861,475 | 1 | 0 | null | 2023-02-22T07:43:19 | 2020-03-17T02:30:50 | Java | UTF-8 | Java | false | false | 1,224 | java |
package com.bo.springboot.user;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>remove complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType name="remove">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "remove", propOrder = {
"id"
})
public class Remove {
protected Integer id;
/**
* 获取id属性的值。
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getId() {
return id;
}
/**
* 设置id属性的值。
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setId(Integer value) {
this.id = value;
}
}
| [
"[email protected]"
] | |
5380821367112699b3469155c9af4387ec8e2807 | 237a47d7f3d85861670bc4fd7470c243114bd0e0 | /minprogram/src/main/java/com/jiangdong/minprogram/config/service/TransactionManagementConfiguration.java | 2f4292a94c22864bef0989a76fe0f5c81e3428e5 | [] | no_license | GorillaSeven/spingbootminprogram | 6bf6e3547613d139733265a55ea94fcb1349dd61 | 4e4059e06224519965a1a149319a97ee7fa597d4 | refs/heads/master | 2022-07-01T05:23:30.661904 | 2019-05-27T09:11:26 | 2019-05-27T09:11:26 | 188,354,757 | 0 | 0 | null | 2022-06-21T01:10:50 | 2019-05-24T04:57:41 | Java | UTF-8 | Java | false | false | 854 | java | package com.jiangdong.minprogram.config.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.TransactionManagementConfigurer;
import javax.sql.DataSource;
@Configuration
@EnableTransactionManagement
public class TransactionManagementConfiguration implements TransactionManagementConfigurer {
@Autowired
private DataSource dataSource;
@Override
public PlatformTransactionManager annotationDrivenTransactionManager() {
return new DataSourceTransactionManager(dataSource);
}
}
| [
"[email protected]"
] | |
79704904ae86c00b7adcbb05994a58829383468b | e4f83ac0057141dab0da4e5b4d70f7d357ab85bc | /Wizard Game/src/GameObject.java | 34fa606c208b4047081416cf18602c7cd896b72a | [] | no_license | FrankFloris/Wizard-game | af37cc17dc819b19aac0d27f7cedd105415dd8f9 | 01b405c8f5d32eaeee530ea2693e5c3fc10d1d85 | refs/heads/master | 2020-05-25T04:52:27.547124 | 2019-05-20T12:32:42 | 2019-05-20T12:32:42 | 187,636,567 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,084 | java | import java.awt.*;
public abstract class GameObject {
protected int x, y;
protected float velX = 0, velY = 0;
protected ID id;
protected SpriteSheet ss;
public GameObject(int x, int y, ID id, SpriteSheet ss){
this.x = x;
this.y = y;
this.id = id;
this.ss = ss;
}
public abstract void tick();
public abstract void render(Graphics g);
public abstract Rectangle getBounds();
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public float getVelX() {
return velX;
}
public void setVelX(float velX) {
this.velX = velX;
}
public float getVelY() {
return velY;
}
public void setVelY(float velY) {
this.velY = velY;
}
public ID getId() {
return id;
}
public void setId(ID id) {
this.id = id;
}
}
| [
"[email protected]"
] | |
24159baed635c39d2cf648c16ef802e3187ac791 | f032090754669e554f0cdc5d6b7a52cbc0078fdf | /src/main/java/ro/tuc/ds2020/repositories/PacientRepo.java | b9bf9859e8b38dcd0c3d41118c316b2617ecedb2 | [] | no_license | iulianvraja/MedicineApp_Backend | 6437ed0ad59bb391cf02095d8bd42e30d4d90434 | fa6a22542f47f2469d9238886f53069d0c7097ef | refs/heads/master | 2023-02-21T09:49:25.213254 | 2021-01-21T12:58:47 | 2021-01-21T12:58:47 | 331,628,271 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 454 | java | package ro.tuc.ds2020.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import ro.tuc.ds2020.entities.Ingrijitor;
import ro.tuc.ds2020.entities.Pacient;
public interface PacientRepo extends JpaRepository<Pacient,Integer> {
@Query(value = "SELECT p " +
"FROM Pacient p " +
"WHERE p.nume = :nume "
)
Pacient findByNameing(String nume);
}
| [
"[email protected]"
] | |
6c8fc56f30ef7a0ad7cd75797ea0e0dc00e0c2e1 | 09a6f8f8f651eba980f359516b9b5ea319632aeb | /src/java/mpmr/controller/TestResultSampleJpaController.java | 5d448961874a468853749c124f6bfacbb02f36de | [] | no_license | GianFuho/CapstoneBE | e43cabdd08860d2c0cd6f3f2b3c660abd2f49d6f | b4101794d5fad75f1bcceb5862794fd93346ad1d | refs/heads/master | 2023-03-12T14:35:18.799778 | 2021-03-09T08:49:44 | 2021-03-09T08:49:44 | 345,937,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,836 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mpmr.controller;
import java.io.Serializable;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Query;
import javax.persistence.EntityNotFoundException;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import mpmr.dto.Test;
import mpmr.dto.TestResultSample;
import mpmr.controller.exceptions.NonexistentEntityException;
import mpmr.controller.exceptions.PreexistingEntityException;
/**
*
* @author Admin
*/
public class TestResultSampleJpaController implements Serializable {
public TestResultSampleJpaController(EntityManagerFactory emf) {
this.emf = emf;
}
private EntityManagerFactory emf = null;
public EntityManager getEntityManager() {
return emf.createEntityManager();
}
public void create(TestResultSample testResultSample) throws PreexistingEntityException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
Test testId = testResultSample.getTestId();
if (testId != null) {
testId = em.getReference(testId.getClass(), testId.getId());
testResultSample.setTestId(testId);
}
em.persist(testResultSample);
if (testId != null) {
testId.getTestResultSampleCollection().add(testResultSample);
testId = em.merge(testId);
}
em.getTransaction().commit();
} catch (Exception ex) {
if (findTestResultSample(testResultSample.getId()) != null) {
throw new PreexistingEntityException("TestResultSample " + testResultSample + " already exists.", ex);
}
throw ex;
} finally {
if (em != null) {
em.close();
}
}
}
public void edit(TestResultSample testResultSample) throws NonexistentEntityException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
TestResultSample persistentTestResultSample = em.find(TestResultSample.class, testResultSample.getId());
Test testIdOld = persistentTestResultSample.getTestId();
Test testIdNew = testResultSample.getTestId();
if (testIdNew != null) {
testIdNew = em.getReference(testIdNew.getClass(), testIdNew.getId());
testResultSample.setTestId(testIdNew);
}
testResultSample = em.merge(testResultSample);
if (testIdOld != null && !testIdOld.equals(testIdNew)) {
testIdOld.getTestResultSampleCollection().remove(testResultSample);
testIdOld = em.merge(testIdOld);
}
if (testIdNew != null && !testIdNew.equals(testIdOld)) {
testIdNew.getTestResultSampleCollection().add(testResultSample);
testIdNew = em.merge(testIdNew);
}
em.getTransaction().commit();
} catch (Exception ex) {
String msg = ex.getLocalizedMessage();
if (msg == null || msg.length() == 0) {
String id = testResultSample.getId();
if (findTestResultSample(id) == null) {
throw new NonexistentEntityException("The testResultSample with id " + id + " no longer exists.");
}
}
throw ex;
} finally {
if (em != null) {
em.close();
}
}
}
public void destroy(String id) throws NonexistentEntityException {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
TestResultSample testResultSample;
try {
testResultSample = em.getReference(TestResultSample.class, id);
testResultSample.getId();
} catch (EntityNotFoundException enfe) {
throw new NonexistentEntityException("The testResultSample with id " + id + " no longer exists.", enfe);
}
Test testId = testResultSample.getTestId();
if (testId != null) {
testId.getTestResultSampleCollection().remove(testResultSample);
testId = em.merge(testId);
}
em.remove(testResultSample);
em.getTransaction().commit();
} finally {
if (em != null) {
em.close();
}
}
}
public List<TestResultSample> findTestResultSampleEntities() {
return findTestResultSampleEntities(true, -1, -1);
}
public List<TestResultSample> findTestResultSampleEntities(int maxResults, int firstResult) {
return findTestResultSampleEntities(false, maxResults, firstResult);
}
private List<TestResultSample> findTestResultSampleEntities(boolean all, int maxResults, int firstResult) {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
cq.select(cq.from(TestResultSample.class));
Query q = em.createQuery(cq);
if (!all) {
q.setMaxResults(maxResults);
q.setFirstResult(firstResult);
}
return q.getResultList();
} finally {
em.close();
}
}
public TestResultSample findTestResultSample(String id) {
EntityManager em = getEntityManager();
try {
return em.find(TestResultSample.class, id);
} finally {
em.close();
}
}
public int getTestResultSampleCount() {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
Root<TestResultSample> rt = cq.from(TestResultSample.class);
cq.select(em.getCriteriaBuilder().count(rt));
Query q = em.createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
} finally {
em.close();
}
}
public List<TestResultSample> findAll() {
return (List<TestResultSample>) getEntityManager().createNamedQuery("TestResultSample.findAll").getResultList();
}
public List<TestResultSample> findByTestId(String testId) {
return (List<TestResultSample>) getEntityManager().createNamedQuery("TestResultSample.findByTestId").setParameter("testId", testId).getResultList();
}
}
| [
"[email protected]"
] | |
bb30e1b5deb423e7e7f276529036d21e7a2230e8 | ccb5ae67b26dc2796ecb2aa8426ba42abf8d9d36 | /ac.soton.fmusim.components.ui/src/ac/soton/fmusim/components/ui/dialogs/SimulationInputDialog.java | 3aba89b73d79a18534693002f91a268e2ce6ab75 | [] | no_license | vsavicks/fmusim-rodin | 2c504679a80f4e8e210a633b3eed3a8a920dbfc7 | ebcd167da8a9f4583336fa916507a65ad4e91c78 | refs/heads/master | 2021-05-27T11:43:28.184575 | 2014-08-27T01:43:15 | 2014-10-12T21:31:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,057 | java | /**
* Copyright (c) 2013 University of Southampton.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package ac.soton.fmusim.components.ui.dialogs;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
/**
* Simulation parameters input dialog.
* Requires to input simulation time and step size.
*
* @author vitaly
*
*/
public class SimulationInputDialog extends Dialog {
private Text startTimeText;
private Text stopTimeText;
private Text stepSizeText;
private DecoratedInputValidator startTimeValidator;
private DecoratedInputValidator stopTimeValidator;
private DecoratedInputValidator stepSizeValidator;
private long startTime;
private long stopTime;
private long stepSize;
private boolean startTimeValid;
private boolean stopTimeValid;
private boolean stepSizeValid;
private boolean totalTimeValid;
private boolean stepTimeValid;
private ControlDecoration timeErrorDecorator;
private ControlDecoration stepTimeErrorDecorator;
/**
* Simulation start dialog.
*
* @param parentShell shell
* @param time default simulation time
* @param step default step size
*/
public SimulationInputDialog(Shell parentShell, long start, long stop, long step) {
super(parentShell);
startTime = start;
stopTime = stop;
stepSize = step;
startTimeValid = true;
stopTimeValid = true;
stepSizeValid = true;
totalTimeValid = true;
stepTimeValid = true;
}
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText("Simulate");
}
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
// start time
Label label = new Label(composite, SWT.NONE);
label.setText("Start time:");
startTimeText = new Text(composite, SWT.SINGLE | SWT.BORDER);
startTimeText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
startTimeText.setText(Long.toString(startTime));
startTimeText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
validateStartTime();
}
});
// stop time
label = new Label(composite, SWT.NONE);
label.setText("Stop time:");
stopTimeText = new Text(composite, SWT.SINGLE | SWT.BORDER);
stopTimeText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
stopTimeText.setText(Long.toString(stopTime));
stopTimeText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
validateStopTime();
}
});
// step size
label = new Label(composite, SWT.NONE);
label.setText("Step size:");
stepSizeText = new Text(composite, SWT.SINGLE | SWT.BORDER);
stepSizeText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
stepSizeText.setText(Long.toString(stepSize));
stepSizeText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
validateStepSize();
}
});
// validators
addValidators();
return composite;
}
/**
* Adds input field validators.
*/
private void addValidators() {
startTimeValidator = createTextValidator(startTimeText);
stopTimeValidator = createTextValidator2(stopTimeText);
stepSizeValidator = createTextValidator2(stepSizeText);
timeErrorDecorator = DecoratedInputValidator.createDecorator(stopTimeText,
"Stop time should be after start time",
FieldDecorationRegistry.DEC_ERROR, false);
stepTimeErrorDecorator = DecoratedInputValidator.createDecorator(stepSizeText,
"Step size cannot exceed simulation time",
FieldDecorationRegistry.DEC_ERROR, false);
}
/**
* @return
*/
private DecoratedInputValidator createTextValidator(Text text) {
return new DecoratedInputValidator(
DecoratedInputValidator.createDecorator(text,
"Please enter time in ms",
FieldDecorationRegistry.DEC_ERROR, false)) {
@Override
public String isValidInput(String timeString) {
try {
long input = Long.parseLong(timeString);
if (input < 0)
return "Time must be positive";
} catch (NumberFormatException e) {
return "Invalid number format";
}
return null;
}
};
}
/**
* @return
*/
private DecoratedInputValidator createTextValidator2(Text text) {
return new DecoratedInputValidator(
DecoratedInputValidator.createDecorator(text,
"Please enter time in ms",
FieldDecorationRegistry.DEC_ERROR, false)) {
@Override
public String isValidInput(String timeString) {
try {
long input = Long.parseLong(timeString);
if (input <= 0)
return "Time must be greater that zero";
} catch (NumberFormatException e) {
return "Invalid number format";
}
return null;
}
};
}
@Override
protected Control createContents(Composite parent) {
Control contents = super.createContents(parent);
// only here the buttons are available, so that's where OK can be disabled for initial state
update();
return contents;
}
@Override
protected void buttonPressed(int buttonId) {
if (buttonId == OK) {
startTime = Long.parseLong(startTimeText.getText());
stopTime = Long.parseLong(stopTimeText.getText());
stepSize = Long.parseLong(stepSizeText.getText());
}
super.buttonPressed(buttonId);
}
/**
* Validates start time.
*/
protected void validateStartTime() {
if (startTimeValidator != null) {
startTimeValid = startTimeValidator.isValid(startTimeText.getText()) == null;
}
validateTime();
update();
}
/**
* Validates stop time.
*/
protected void validateStopTime() {
if (stopTimeValidator != null) {
stopTimeValid = stopTimeValidator.isValid(stopTimeText.getText()) == null;
}
validateTime();
update();
}
/**
* Validates step size.
*/
protected void validateStepSize() {
if (stepSizeValidator != null) {
stepSizeValid = stepSizeValidator.isValid(stepSizeText.getText()) == null;
}
validateTime();
update();
}
/**
* Validates start time against stop time
* and step size against total simulation time.
*/
private void validateTime() {
if (timeErrorDecorator == null || stepTimeErrorDecorator == null)
return;
if (startTimeValid && stopTimeValid && stepSizeValid) {
long startTime = Long.parseLong(startTimeText.getText());
long stopTime = Long.parseLong(stopTimeText.getText());
long stepSize = Long.parseLong(stepSizeText.getText());
totalTimeValid = stopTime > startTime;
if (totalTimeValid) {
timeErrorDecorator.hide();
} else {
timeErrorDecorator.show();
}
stepTimeValid = stepSize <= (stopTime - startTime);
if (stepTimeValid) {
stepTimeErrorDecorator.hide();
} else {
stepTimeErrorDecorator.show();
}
}
}
/**
* Updates the buttons based on validation results.
*/
private void update() {
Control button = getButton(IDialogConstants.OK_ID);
if (button != null) {
button.setEnabled(startTimeValid && stopTimeValid && stepSizeValid && totalTimeValid && stepTimeValid);
}
}
/**
* @return start time
*/
public long getStartTime() {
return startTime;
}
/**
* @return start time
*/
public long getStopTime() {
return stopTime;
}
/**
* @return step size
*/
public long getStepSize() {
return stepSize;
}
}
| [
"[email protected]"
] | |
b1a8bedcdbf5fc2b1a4be958692a0b13cc6b30d8 | 1f47fb90a5edfbfdccfc1328feac21ad3cc430ff | /ISC/src/Set.java | 5e5398c1fe8208b0a099ba5871a8405a21b3c320 | [] | no_license | sahasatvik/Computer-Project | 73dcb895fadf80ffecd5136ff01a59cdb9b1512b | e1a44eca6345714f0dd52ec5e70ecb37b942bc93 | refs/heads/master | 2020-12-31T00:21:39.885596 | 2019-02-22T07:49:35 | 2019-02-22T07:49:35 | 48,871,881 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,106 | java | import java.util.Iterator;
public class Set implements Iterable<Integer> {
protected int maxSize;
/* Simple list setup */
protected int[] elements;
protected int top;
/* Let the maximum capacity be specified during instantiation */
public Set (int maxSize) {
this.maxSize = maxSize;
this.elements = new int[maxSize];
this.top = -1;
}
/* Returns the number of elements in the set */
public int getSize () {
return top + 1;
}
/* Returns the maximum capacity of the set */
public int getMaxSize () {
return maxSize;
}
/* Expands or contracts the set as necessary, discards elements if
they cannot be accomodated */
public void updateMaxSize (int newMaxSize) {
int[] temp = new int[newMaxSize];
this.maxSize = newMaxSize;
/* Make sure that the top index isn't out of bounds */
this.top = Math.min(top, newMaxSize - 1);
/* Copy data to the new list */
for (int i = 0; i <= top; i++)
temp[i] = elements[i];
this.elements = temp;
}
/* Checks whether an element is present in the set */
public boolean contains (int n) {
int i = indexOfEqualOrGreater(n);
return ((i >= 0) && (i <= top) && (elements[i] == n));
}
/* Checks whether the set is empty */
public boolean isEmpty () {
return top < 0;
}
/* Clears all elements from the set */
public void clear () {
/* Only the top index has to be updated, since values byond it
cannot be accessed */
this.top = -1;
}
/* Adds an element to the set. Returns 'false' if it is already
present, or there isn't enough space. */
public boolean add (int n) {
if (getSize() >= getMaxSize())
return false;
/* Find the breakpoint to shift elements */
int i = indexOfEqualOrGreater(n);
if ((i >= 0) && (i <= top) && (elements[i] == n))
return false;
/* Shift elements greater than 'n' to make room for it */
for (int j = top; j >= i; j--)
elements[j + 1] = elements[j];
elements[i] = n;
top++;
return true;
}
/* Removes an element from the set. Returns 'false' if it isn't
already present. */
public boolean remove (int n) {
if (isEmpty())
return false;
/* Find the location of the element */
int i = indexOfEqualOrGreater(n);
if ((i < 0) || (i > top) || (elements[i] != n))
return false;
/* Shift elements into the desired element, erasing it */
for (int j = i; j < top; j++)
elements[j] = elements[j + 1];
top--;
return true;
}
/* Returns the union of two sets */
public static Set union (Set a, Set b) {
Set r = new Set(a.getSize() + b.getSize());
/* The 'add' methods take care of duplicates */
for (int n : a)
r.add(n);
for (int n : b)
r.add(n);
return r;
}
/* Returns the intersection of two sets */
public static Set intersection (Set a, Set b) {
Set r = new Set(a.getSize());
for (int n : a)
if (b.contains(n))
r.add(n);
return r;
}
/* Returns the difference of two sets */
public static Set difference (Set a, Set b) {
Set r = new Set(a.getSize());
for (int n : a)
if (!b.contains(n))
r.add(n);
return r;
}
/* Finds the index of the element equal to or greater than
the desired element via binary search */
private int indexOfEqualOrGreater (int n) {
int hi = top + 1;
int lo = 0;
while (lo < hi) {
int mid = (lo + hi) / 2;
if (n < elements[mid])
hi = mid;
else if (n > elements[mid])
lo = mid + 1;
else
return mid;
}
return hi;
}
/* Format the set elements as a list */
@Override
public String toString () {
if (getSize() == 0)
return "[]";
String s = "";
for (Integer n : this)
s += n + " ";
return "[" + String.join(", ", s.split("\\s+")) + "]";
}
/* Allow 'Set' to be iterable, providing easy access to elements
without indexing */
@Override
public Iterator<Integer> iterator () {
return new Iterator<Integer>() {
private int currentIndex = 0;
@Override
public boolean hasNext () {
return currentIndex <= top;
}
@Override
public Integer next () {
return elements[currentIndex++];
}
@Override
public void remove () {
throw new UnsupportedOperationException();
}
};
}
}
| [
"[email protected]"
] | |
76c5753c1d1da22559e89c986a472684062c4dd0 | c987ed2f3a5f885917827b6e402adfcf75d404ad | /src/main/java/com/godrabbit/rabbitutilities/libs/RabbitTemplates.java | 00835815e1db6b147974f46fa4bbe00b88cd99be | [] | no_license | GodRabbit/RabbitUtilities | 0daa23808696107a40e156cb1c1e6dc1663556d2 | ee7366326b8fc1d2cc31b90fe59cc353cf1667e9 | refs/heads/master | 2021-01-01T18:29:26.019293 | 2015-12-10T19:51:48 | 2015-12-10T19:51:48 | 42,073,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 34,242 | java | package com.godrabbit.rabbitutilities.libs;
public class RabbitTemplates {
public static DungeonTemplate cow=new DungeonTemplate();
public static DungeonTemplate House=new DungeonTemplate();
static //define cow
{
//define cow:
cow.add(48, 0, 1, 0, 0);
cow.add(48, 0, 0, 0, 2);
cow.add(48, 0, 2, 0, 0);
cow.add(48, 0, 3, 0, 0);
cow.add(48, 0, 0, 0, 4);
cow.add(48, 0, 4, 0, 0);
cow.add(48, 0, 5, 0, 0);
cow.add(48, 0, 0, 0, 6);
cow.add(48, 0, 6, 0, 0);
cow.add(48, 0, 1, 0, 6);
cow.add(48, 0, 7, 0, 0);
cow.add(48, 0, 0, 0, 8);
cow.add(48, 0, 8, 0, 0);
cow.add(48, 0, 9, 0, 0);
cow.add(48, 0, 0, 0, 10);
cow.add(35, 1, 4, 0, 6);
cow.add(35, 1, 6, 0, 4);
cow.add(35, 1, 3, 0, 8);
cow.add(35, 1, 8, 0, 4);
cow.add(48, 0, 10, 0, 2);
cow.add(48, 0, 1, 0, 12);
cow.add(35, 1, 5, 0, 8);
cow.add(48, 0, 2, 0, 12);
cow.add(48, 0, 8, 0, 6);
cow.add(48, 0, 10, 0, 4);
cow.add(48, 0, 3, 0, 12);
cow.add(35, 1, 7, 0, 8);
cow.add(48, 0, 9, 0, 6);
cow.add(48, 0, 4, 0, 12);
cow.add(35, 1, 8, 0, 8);
cow.add(48, 0, 10, 0, 6);
cow.add(48, 0, 5, 0, 12);
cow.add(48, 0, 6, 0, 12);
cow.add(48, 0, 10, 0, 8);
cow.add(48, 0, 7, 0, 12);
cow.add(35, 1, 9, 0, 10);
cow.add(48, 0, 8, 0, 12);
cow.add(48, 0, 10, 0, 10);
cow.add(48, 0, 9, 0, 12);
cow.add(48, 0, 10, 0, 12);
cow.add(48, 0, 0, 1, 0);
cow.add(48, 0, 1, 1, 0);
cow.add(48, 0, 0, 1, 2);
cow.add(48, 0, 2, 1, 0);
cow.add(35, 1, 5, 1, 8);
cow.add(35, 1, 7, 1, 8);
cow.add(48, 0, 0, 0, 1);
cow.add(48, 0, 0, 0, 3);
cow.add(48, 0, 0, 0, 5);
cow.add(48, 0, 0, 0, 7);
cow.add(48, 0, 0, 0, 9);
cow.add(48, 0, 0, 0, 11);
cow.add(35, 1, 5, 2, 8);
cow.add(48, 0, 10, 0, 1);
cow.add(35, 1, 3, 0, 9);
cow.add(35, 1, 9, 0, 3);
cow.add(35, 1, 7, 2, 8);
cow.add(48, 0, 10, 0, 3);
cow.add(35, 1, 3, 0, 11);
cow.add(35, 1, 8, 0, 7);
cow.add(48, 0, 10, 0, 5);
cow.add(35, 1, 8, 0, 9);
cow.add(35, 1, 10, 0, 7);
cow.add(48, 0, 10, 0, 9);
cow.add(48, 0, 10, 0, 11);
cow.add(48, 0, 0, 1, 1);
cow.add(48, 0, 1, 1, 1);
cow.add(35, 1, 7, 3, 8);
}
static //define House
{
//define House:
House.add(17, 1, 2, 4, 2);
House.add(126, 11, 4, 8, 4);
House.add(35, 0, 3, 4, 2);
House.add(136, 0, 7, 12, 6);
House.add(164, 6, 4, 4, 2);
House.add(17, 9, 8, 12, 6);
House.add(35, 0, 5, 4, 2);
House.add(136, 1, 9, 12, 6);
House.add(17, 1, 6, 4, 2);
House.add(35, 0, 7, 4, 2);
House.add(35, 0, 8, 4, 2);
House.add(35, 0, 9, 4, 2);
House.add(17, 1, 10, 4, 2);
House.add(126, 11, 12, 8, 4);
House.add(35, 0, 11, 4, 2);
House.add(136, 1, 13, 8, 4);
House.add(164, 6, 12, 4, 2);
House.add(35, 0, 13, 4, 2);
House.add(17, 1, 14, 4, 2);
House.add(164, 4, 1, 5, 2);
House.add(17, 1, 2, 5, 2);
House.add(136, 0, 4, 9, 4);
House.add(17, 5, 3, 5, 2);
House.add(126, 11, 5, 9, 4);
House.add(17, 5, 4, 5, 2);
House.add(78, 0, 8, 13, 6);
House.add(17, 5, 5, 5, 2);
House.add(17, 1, 6, 5, 2);
House.add(17, 5, 7, 5, 2);
House.add(17, 5, 8, 5, 2);
House.add(17, 5, 9, 5, 2);
House.add(126, 11, 11, 9, 4);
House.add(17, 1, 10, 5, 2);
House.add(136, 1, 12, 9, 4);
House.add(17, 5, 11, 5, 2);
House.add(17, 5, 12, 5, 2);
House.add(17, 5, 13, 5, 2);
House.add(17, 1, 14, 5, 2);
House.add(164, 5, 15, 5, 2);
House.add(136, 0, 1, 6, 2);
House.add(125, 3, 2, 6, 2);
House.add(17, 1, 3, 6, 2);
House.add(136, 0, 5, 10, 4);
House.add(35, 0, 4, 6, 2);
House.add(126, 11, 6, 10, 4);
House.add(35, 0, 5, 6, 2);
House.add(17, 1, 6, 6, 2);
House.add(35, 0, 7, 6, 2);
House.add(35, 0, 8, 6, 2);
House.add(126, 11, 10, 10, 4);
House.add(35, 0, 9, 6, 2);
House.add(136, 1, 11, 10, 4);
House.add(17, 1, 10, 6, 2);
House.add(35, 0, 11, 6, 2);
House.add(35, 0, 12, 6, 2);
House.add(17, 1, 13, 6, 2);
House.add(125, 3, 14, 6, 2);
House.add(136, 1, 15, 6, 2);
House.add(44, 3, 1, 0, 15);
House.add(44, 3, 2, 0, 15);
House.add(44, 3, 3, 0, 15);
House.add(44, 3, 4, 0, 15);
House.add(44, 3, 5, 0, 15);
House.add(44, 3, 6, 0, 15);
House.add(43, 3, 7, 0, 15);
House.add(43, 3, 8, 0, 15);
House.add(43, 3, 9, 0, 15);
House.add(53, 1, 0, 11, 4);
House.add(44, 3, 10, 0, 15);
House.add(44, 3, 11, 0, 15);
House.add(44, 3, 12, 0, 15);
House.add(44, 3, 13, 0, 15);
House.add(136, 0, 2, 7, 2);
House.add(44, 3, 14, 0, 15);
House.add(17, 1, 3, 7, 2);
House.add(44, 3, 15, 0, 15);
House.add(35, 0, 4, 7, 2);
House.add(136, 0, 6, 11, 4);
House.add(35, 0, 5, 7, 2);
House.add(126, 11, 7, 11, 4);
House.add(17, 1, 6, 7, 2);
House.add(17, 9, 8, 11, 4);
House.add(35, 0, 7, 7, 2);
House.add(126, 11, 9, 11, 4);
House.add(35, 0, 8, 7, 2);
House.add(136, 1, 10, 11, 4);
House.add(35, 0, 9, 7, 2);
House.add(17, 1, 10, 7, 2);
House.add(35, 0, 11, 7, 2);
House.add(35, 0, 12, 7, 2);
House.add(17, 1, 13, 7, 2);
House.add(136, 1, 14, 7, 2);
House.add(78, 0, 7, 1, 15);
House.add(78, 0, 9, 1, 15);
House.add(136, 0, 3, 8, 2);
House.add(35, 0, 4, 8, 2);
House.add(35, 0, 5, 8, 2);
House.add(136, 0, 7, 12, 4);
House.add(17, 1, 6, 8, 2);
House.add(17, 9, 8, 12, 4);
House.add(35, 0, 7, 8, 2);
House.add(136, 1, 9, 12, 4);
House.add(35, 0, 8, 8, 2);
House.add(35, 0, 9, 8, 2);
House.add(17, 1, 10, 8, 2);
House.add(35, 0, 11, 8, 2);
House.add(35, 0, 12, 8, 2);
House.add(136, 1, 13, 8, 2);
House.add(136, 0, 4, 9, 2);
House.add(35, 0, 5, 9, 2);
House.add(17, 1, 6, 9, 2);
House.add(78, 0, 8, 13, 4);
House.add(35, 0, 7, 9, 2);
House.add(35, 0, 8, 9, 2);
House.add(35, 0, 9, 9, 2);
House.add(17, 1, 10, 9, 2);
House.add(35, 0, 11, 9, 2);
House.add(136, 1, 12, 9, 2);
House.add(136, 0, 5, 10, 2);
House.add(125, 3, 6, 10, 2);
House.add(17, 5, 7, 10, 2);
House.add(17, 5, 8, 10, 2);
House.add(17, 5, 9, 10, 2);
House.add(125, 3, 10, 10, 2);
House.add(136, 1, 11, 10, 2);
House.add(44, 3, 1, 0, 13);
House.add(17, 9, 2, 0, 13);
House.add(126, 0, 3, 0, 13);
House.add(126, 0, 4, 0, 13);
House.add(126, 0, 5, 0, 13);
House.add(126, 0, 6, 0, 13);
House.add(126, 0, 7, 0, 13);
House.add(126, 0, 8, 0, 13);
House.add(126, 0, 9, 0, 13);
House.add(53, 1, 0, 11, 2);
House.add(126, 0, 10, 0, 13);
House.add(126, 0, 11, 0, 13);
House.add(126, 0, 12, 0, 13);
House.add(126, 0, 13, 0, 13);
House.add(17, 9, 14, 0, 13);
House.add(44, 3, 15, 0, 13);
House.add(136, 0, 6, 11, 2);
House.add(125, 3, 7, 11, 2);
House.add(17, 5, 8, 11, 2);
House.add(125, 3, 9, 11, 2);
House.add(136, 1, 10, 11, 2);
House.add(35, 0, 2, 1, 13);
House.add(35, 0, 14, 1, 13);
House.add(136, 0, 7, 12, 2);
House.add(136, 2, 8, 12, 2);
House.add(136, 1, 9, 12, 2);
House.add(35, 0, 2, 2, 13);
House.add(35, 0, 14, 2, 13);
House.add(35, 0, 2, 3, 13);
House.add(50, 4, 6, 3, 13);
House.add(50, 4, 10, 3, 13);
House.add(35, 0, 14, 3, 13);
House.add(35, 0, 2, 4, 13);
House.add(44, 3, 1, 0, 11);
House.add(17, 9, 2, 0, 11);
House.add(126, 0, 3, 0, 11);
House.add(126, 0, 4, 0, 11);
House.add(126, 0, 5, 0, 11);
House.add(126, 0, 6, 0, 11);
House.add(126, 0, 7, 0, 11);
House.add(126, 0, 8, 0, 11);
House.add(126, 0, 9, 0, 11);
House.add(126, 0, 10, 0, 11);
House.add(126, 0, 11, 0, 11);
House.add(126, 0, 12, 0, 11);
House.add(35, 0, 14, 4, 13);
House.add(126, 0, 13, 0, 11);
House.add(17, 1, 14, 0, 11);
House.add(44, 3, 15, 0, 11);
House.add(17, 9, 2, 5, 13);
House.add(17, 1, 2, 1, 11);
House.add(17, 9, 6, 5, 13);
House.add(126, 8, 7, 5, 13);
House.add(126, 8, 8, 5, 13);
House.add(126, 8, 9, 5, 13);
House.add(17, 9, 10, 5, 13);
House.add(17, 9, 14, 5, 13);
House.add(17, 1, 14, 1, 11);
House.add(136, 0, 1, 6, 13);
House.add(125, 3, 2, 6, 13);
House.add(17, 1, 2, 2, 11);
House.add(125, 3, 14, 6, 13);
House.add(136, 1, 15, 6, 13);
House.add(17, 1, 14, 2, 11);
House.add(53, 1, 0, 11, 15);
House.add(136, 0, 2, 7, 13);
House.add(126, 11, 3, 7, 13);
House.add(17, 1, 2, 3, 11);
House.add(17, 9, 8, 11, 15);
House.add(126, 11, 13, 7, 13);
House.add(136, 1, 14, 7, 13);
House.add(50, 2, 13, 3, 11);
House.add(17, 1, 14, 3, 11);
House.add(136, 0, 3, 8, 13);
House.add(17, 1, 2, 4, 11);
House.add(126, 11, 4, 8, 13);
House.add(44, 3, 1, 0, 9);
House.add(17, 9, 2, 0, 9);
House.add(78, 0, 8, 12, 15);
House.add(126, 0, 3, 0, 9);
House.add(126, 0, 4, 0, 9);
House.add(126, 0, 5, 0, 9);
House.add(126, 0, 6, 0, 9);
House.add(126, 0, 7, 0, 9);
House.add(126, 0, 8, 0, 9);
House.add(126, 11, 12, 8, 13);
House.add(126, 0, 9, 0, 9);
House.add(136, 1, 13, 8, 13);
House.add(126, 0, 10, 0, 9);
House.add(126, 0, 11, 0, 9);
House.add(126, 0, 12, 0, 9);
House.add(17, 1, 14, 4, 11);
House.add(126, 0, 13, 0, 9);
House.add(17, 9, 14, 0, 9);
House.add(44, 3, 15, 0, 9);
House.add(164, 4, 1, 5, 11);
House.add(17, 9, 2, 5, 11);
House.add(136, 0, 4, 9, 13);
House.add(126, 11, 5, 9, 13);
House.add(35, 0, 2, 1, 9);
House.add(17, 9, 6, 5, 11);
House.add(126, 8, 7, 5, 11);
House.add(126, 8, 8, 5, 11);
House.add(126, 8, 9, 5, 11);
House.add(126, 11, 11, 9, 13);
House.add(17, 9, 10, 5, 11);
House.add(136, 1, 12, 9, 13);
House.add(17, 9, 14, 5, 11);
House.add(164, 5, 15, 5, 11);
House.add(35, 0, 14, 1, 9);
House.add(136, 0, 1, 6, 11);
House.add(125, 3, 2, 6, 11);
House.add(136, 0, 5, 10, 13);
House.add(35, 0, 2, 2, 9);
House.add(126, 11, 6, 10, 13);
House.add(126, 11, 10, 10, 13);
House.add(136, 1, 11, 10, 13);
House.add(125, 3, 14, 6, 11);
House.add(136, 1, 15, 6, 11);
House.add(35, 0, 14, 2, 9);
House.add(53, 1, 0, 11, 13);
House.add(136, 0, 2, 7, 11);
House.add(126, 11, 3, 7, 11);
House.add(17, 9, 2, 3, 9);
House.add(136, 0, 6, 11, 13);
House.add(126, 11, 7, 11, 13);
House.add(17, 9, 8, 11, 13);
House.add(126, 11, 9, 11, 13);
House.add(136, 1, 10, 11, 13);
House.add(126, 11, 13, 7, 11);
House.add(136, 1, 14, 7, 11);
House.add(17, 9, 14, 3, 9);
House.add(136, 0, 3, 8, 11);
House.add(35, 0, 2, 4, 9);
House.add(126, 11, 4, 8, 11);
House.add(44, 3, 1, 0, 7);
House.add(136, 0, 7, 12, 13);
House.add(17, 9, 2, 0, 7);
House.add(17, 9, 8, 12, 13);
House.add(126, 0, 3, 0, 7);
House.add(136, 1, 9, 12, 13);
House.add(126, 0, 4, 0, 7);
House.add(126, 0, 5, 0, 7);
House.add(126, 0, 6, 0, 7);
House.add(126, 0, 7, 0, 7);
House.add(126, 0, 8, 0, 7);
House.add(126, 11, 12, 8, 11);
House.add(126, 0, 9, 0, 7);
House.add(136, 1, 13, 8, 11);
House.add(126, 0, 10, 0, 7);
House.add(126, 0, 11, 0, 7);
House.add(126, 0, 12, 0, 7);
House.add(35, 0, 14, 4, 9);
House.add(126, 0, 13, 0, 7);
House.add(17, 9, 14, 0, 7);
House.add(44, 3, 15, 0, 7);
House.add(17, 9, 2, 5, 9);
House.add(136, 0, 4, 9, 11);
House.add(126, 11, 5, 9, 11);
House.add(35, 0, 2, 1, 7);
House.add(78, 0, 8, 13, 13);
House.add(17, 9, 6, 5, 9);
House.add(126, 8, 7, 5, 9);
House.add(126, 8, 8, 5, 9);
House.add(126, 8, 9, 5, 9);
House.add(126, 11, 11, 9, 11);
House.add(17, 9, 10, 5, 9);
House.add(136, 1, 12, 9, 11);
House.add(17, 9, 14, 5, 9);
House.add(35, 0, 14, 1, 7);
House.add(136, 0, 1, 6, 9);
House.add(125, 3, 2, 6, 9);
House.add(136, 0, 5, 10, 11);
House.add(35, 0, 2, 2, 7);
House.add(126, 11, 6, 10, 11);
House.add(126, 11, 10, 10, 11);
House.add(136, 1, 11, 10, 11);
House.add(125, 3, 14, 6, 9);
House.add(136, 1, 15, 6, 9);
House.add(35, 0, 14, 2, 7);
House.add(53, 1, 0, 11, 11);
House.add(136, 0, 2, 7, 9);
House.add(126, 11, 3, 7, 9);
House.add(17, 9, 2, 3, 7);
House.add(136, 0, 6, 11, 11);
House.add(126, 11, 7, 11, 11);
House.add(17, 9, 8, 11, 11);
House.add(126, 11, 9, 11, 11);
House.add(136, 1, 10, 11, 11);
House.add(126, 11, 13, 7, 9);
House.add(136, 1, 14, 7, 9);
House.add(17, 9, 14, 3, 7);
House.add(136, 0, 3, 8, 9);
House.add(35, 0, 2, 4, 7);
House.add(126, 11, 4, 8, 9);
House.add(44, 3, 1, 0, 5);
House.add(136, 0, 7, 12, 11);
House.add(17, 9, 2, 0, 5);
House.add(17, 9, 8, 12, 11);
House.add(126, 0, 3, 0, 5);
House.add(136, 1, 9, 12, 11);
House.add(126, 0, 4, 0, 5);
House.add(126, 0, 5, 0, 5);
House.add(126, 0, 6, 0, 5);
House.add(126, 0, 7, 0, 5);
House.add(126, 0, 8, 0, 5);
House.add(126, 11, 12, 8, 9);
House.add(126, 0, 9, 0, 5);
House.add(136, 1, 13, 8, 9);
House.add(126, 0, 10, 0, 5);
House.add(126, 0, 11, 0, 5);
House.add(126, 0, 12, 0, 5);
House.add(35, 0, 14, 4, 7);
House.add(126, 0, 13, 0, 5);
House.add(17, 9, 14, 0, 5);
House.add(44, 3, 15, 0, 5);
House.add(17, 9, 2, 5, 7);
House.add(136, 0, 4, 9, 9);
House.add(126, 11, 5, 9, 9);
House.add(17, 1, 2, 1, 5);
House.add(78, 0, 8, 13, 11);
House.add(17, 9, 6, 5, 7);
House.add(126, 8, 7, 5, 7);
House.add(126, 8, 8, 5, 7);
House.add(126, 8, 9, 5, 7);
House.add(126, 11, 11, 9, 9);
House.add(17, 9, 10, 5, 7);
House.add(136, 1, 12, 9, 9);
House.add(17, 9, 14, 5, 7);
House.add(17, 1, 14, 1, 5);
House.add(136, 0, 1, 6, 7);
House.add(125, 3, 2, 6, 7);
House.add(136, 0, 5, 10, 9);
House.add(17, 1, 2, 2, 5);
House.add(126, 11, 6, 10, 9);
House.add(126, 11, 10, 10, 9);
House.add(136, 3, 11, 10, 9);
House.add(125, 3, 14, 6, 7);
House.add(136, 1, 15, 6, 7);
House.add(17, 1, 14, 2, 5);
House.add(53, 1, 0, 11, 9);
House.add(136, 0, 2, 7, 7);
House.add(126, 11, 3, 7, 7);
House.add(17, 1, 2, 3, 5);
House.add(136, 0, 6, 11, 9);
House.add(126, 11, 7, 11, 9);
House.add(17, 9, 8, 11, 9);
House.add(126, 11, 9, 11, 9);
House.add(136, 1, 10, 11, 9);
House.add(126, 11, 13, 7, 7);
House.add(136, 1, 14, 7, 7);
House.add(50, 2, 13, 3, 5);
House.add(17, 1, 14, 3, 5);
House.add(136, 0, 3, 8, 7);
House.add(17, 1, 2, 4, 5);
House.add(126, 11, 4, 8, 7);
House.add(44, 3, 1, 0, 3);
House.add(136, 0, 7, 12, 9);
House.add(17, 9, 2, 0, 3);
House.add(17, 9, 8, 12, 9);
House.add(126, 0, 3, 0, 3);
House.add(136, 1, 9, 12, 9);
House.add(126, 0, 4, 0, 3);
House.add(126, 0, 5, 0, 3);
House.add(126, 0, 6, 0, 3);
House.add(126, 0, 7, 0, 3);
House.add(126, 0, 8, 0, 3);
House.add(126, 11, 12, 8, 7);
House.add(126, 0, 9, 0, 3);
House.add(136, 1, 13, 8, 7);
House.add(126, 0, 10, 0, 3);
House.add(126, 0, 11, 0, 3);
House.add(126, 0, 12, 0, 3);
House.add(17, 1, 14, 4, 5);
House.add(126, 0, 13, 0, 3);
House.add(17, 9, 14, 0, 3);
House.add(44, 3, 15, 0, 3);
House.add(164, 4, 1, 5, 5);
House.add(17, 9, 2, 5, 5);
House.add(136, 0, 4, 9, 7);
House.add(126, 11, 5, 9, 7);
House.add(35, 0, 2, 1, 3);
House.add(78, 0, 8, 13, 9);
House.add(17, 9, 6, 5, 5);
House.add(65, 3, 5, 1, 3);
House.add(126, 8, 7, 5, 5);
House.add(126, 8, 8, 5, 5);
House.add(126, 8, 9, 5, 5);
House.add(126, 11, 11, 9, 7);
House.add(17, 9, 10, 5, 5);
House.add(136, 1, 12, 9, 7);
House.add(17, 9, 14, 5, 5);
House.add(164, 5, 15, 5, 5);
House.add(35, 0, 14, 1, 3);
House.add(136, 0, 1, 6, 5);
House.add(125, 3, 2, 6, 5);
House.add(136, 0, 5, 10, 7);
House.add(35, 0, 2, 2, 3);
House.add(126, 11, 6, 10, 7);
House.add(65, 3, 5, 2, 3);
House.add(126, 11, 10, 10, 7);
House.add(136, 1, 11, 10, 7);
House.add(125, 3, 14, 6, 5);
House.add(136, 1, 15, 6, 5);
House.add(35, 0, 14, 2, 3);
House.add(53, 1, 0, 11, 7);
House.add(136, 0, 2, 7, 5);
House.add(126, 11, 3, 7, 5);
House.add(35, 0, 2, 3, 3);
House.add(136, 0, 6, 11, 7);
House.add(126, 11, 7, 11, 7);
House.add(17, 9, 8, 11, 7);
House.add(65, 3, 5, 3, 3);
House.add(126, 11, 9, 11, 7);
House.add(136, 1, 10, 11, 7);
House.add(50, 3, 8, 3, 3);
House.add(126, 11, 13, 7, 5);
House.add(136, 1, 14, 7, 5);
House.add(35, 0, 14, 3, 3);
House.add(136, 0, 3, 8, 5);
House.add(35, 0, 2, 4, 3);
House.add(126, 11, 4, 8, 5);
House.add(44, 3, 1, 0, 1);
House.add(136, 0, 7, 12, 7);
House.add(44, 3, 2, 0, 1);
House.add(17, 9, 8, 12, 7);
House.add(44, 3, 3, 0, 1);
House.add(65, 3, 5, 4, 3);
House.add(136, 1, 9, 12, 7);
House.add(44, 3, 4, 0, 1);
House.add(44, 3, 5, 0, 1);
House.add(44, 3, 6, 0, 1);
House.add(44, 3, 7, 0, 1);
House.add(44, 3, 8, 0, 1);
House.add(126, 11, 12, 8, 5);
House.add(44, 3, 9, 0, 1);
House.add(136, 1, 13, 8, 5);
House.add(44, 3, 10, 0, 1);
House.add(44, 3, 11, 0, 1);
House.add(44, 3, 12, 0, 1);
House.add(35, 0, 14, 4, 3);
House.add(44, 3, 13, 0, 1);
House.add(44, 3, 14, 0, 1);
House.add(44, 3, 15, 0, 1);
House.add(17, 9, 2, 5, 3);
House.add(136, 0, 4, 9, 5);
House.add(126, 11, 5, 9, 5);
House.add(78, 0, 8, 13, 7);
House.add(65, 3, 5, 5, 3);
House.add(17, 9, 6, 5, 3);
House.add(126, 8, 7, 5, 3);
House.add(126, 8, 8, 5, 3);
House.add(126, 8, 9, 5, 3);
House.add(126, 11, 11, 9, 5);
House.add(17, 9, 10, 5, 3);
House.add(136, 1, 12, 9, 5);
House.add(17, 9, 14, 5, 3);
House.add(136, 0, 1, 6, 3);
House.add(125, 3, 2, 6, 3);
House.add(136, 0, 5, 10, 5);
House.add(126, 11, 6, 10, 5);
House.add(65, 3, 5, 6, 3);
House.add(126, 11, 10, 10, 5);
House.add(136, 1, 11, 10, 5);
House.add(125, 3, 14, 6, 3);
House.add(136, 1, 15, 6, 3);
House.add(44, 3, 7, 0, 16);
House.add(44, 3, 8, 0, 16);
House.add(44, 3, 9, 0, 16);
House.add(53, 1, 0, 11, 5);
House.add(136, 0, 2, 7, 3);
House.add(126, 11, 3, 7, 3);
House.add(136, 0, 6, 11, 5);
House.add(126, 11, 7, 11, 5);
House.add(17, 9, 8, 11, 5);
House.add(126, 11, 9, 11, 5);
House.add(136, 1, 10, 11, 5);
House.add(126, 11, 13, 7, 3);
House.add(136, 1, 14, 7, 3);
House.add(136, 0, 3, 8, 3);
House.add(126, 11, 4, 8, 3);
House.add(136, 0, 7, 12, 5);
House.add(17, 9, 8, 12, 5);
House.add(136, 1, 9, 12, 5);
House.add(126, 11, 12, 8, 3);
House.add(136, 1, 13, 8, 3);
House.add(136, 0, 4, 9, 3);
House.add(126, 11, 5, 9, 3);
House.add(78, 0, 8, 13, 5);
House.add(126, 11, 11, 9, 3);
House.add(136, 1, 12, 9, 3);
House.add(136, 0, 1, 6, 1);
House.add(136, 5, 2, 6, 1);
House.add(136, 0, 5, 10, 3);
House.add(126, 11, 6, 10, 3);
House.add(126, 11, 10, 10, 3);
House.add(136, 1, 11, 10, 3);
House.add(136, 4, 14, 6, 1);
House.add(136, 1, 15, 6, 1);
House.add(44, 3, 1, 0, 14);
House.add(17, 1, 2, 0, 14);
House.add(17, 5, 3, 0, 14);
House.add(17, 5, 4, 0, 14);
House.add(17, 5, 5, 0, 14);
House.add(17, 1, 6, 0, 14);
House.add(17, 5, 7, 0, 14);
House.add(17, 5, 8, 0, 14);
House.add(17, 5, 9, 0, 14);
House.add(53, 1, 0, 11, 3);
House.add(17, 1, 10, 0, 14);
House.add(17, 5, 11, 0, 14);
House.add(17, 5, 12, 0, 14);
House.add(17, 5, 13, 0, 14);
House.add(136, 0, 2, 7, 1);
House.add(17, 1, 14, 0, 14);
House.add(136, 5, 3, 7, 1);
House.add(44, 3, 15, 0, 14);
House.add(136, 0, 6, 11, 3);
House.add(126, 11, 7, 11, 3);
House.add(17, 9, 8, 11, 3);
House.add(126, 11, 9, 11, 3);
House.add(136, 1, 10, 11, 3);
House.add(136, 4, 13, 7, 1);
House.add(136, 1, 14, 7, 1);
House.add(17, 1, 2, 1, 14);
House.add(35, 0, 3, 1, 14);
House.add(35, 0, 4, 1, 14);
House.add(35, 0, 5, 1, 14);
House.add(17, 1, 6, 1, 14);
House.add(35, 0, 7, 1, 14);
House.add(193, 1, 8, 1, 14);
House.add(35, 0, 9, 1, 14);
House.add(17, 1, 10, 1, 14);
House.add(35, 0, 11, 1, 14);
House.add(35, 0, 12, 1, 14);
House.add(35, 0, 13, 1, 14);
House.add(17, 1, 14, 1, 14);
House.add(136, 0, 3, 8, 1);
House.add(136, 5, 4, 8, 1);
House.add(136, 0, 7, 12, 3);
House.add(17, 9, 8, 12, 3);
House.add(136, 1, 9, 12, 3);
House.add(136, 4, 12, 8, 1);
House.add(136, 1, 13, 8, 1);
House.add(17, 1, 2, 2, 14);
House.add(35, 0, 3, 2, 14);
House.add(164, 3, 4, 2, 14);
House.add(35, 0, 5, 2, 14);
House.add(17, 1, 6, 2, 14);
House.add(35, 0, 7, 2, 14);
House.add(193, 8, 8, 2, 14);
House.add(35, 0, 9, 2, 14);
House.add(17, 1, 10, 2, 14);
House.add(35, 0, 11, 2, 14);
House.add(164, 3, 12, 2, 14);
House.add(35, 0, 13, 2, 14);
House.add(17, 1, 14, 2, 14);
House.add(136, 0, 4, 9, 1);
House.add(136, 5, 5, 9, 1);
House.add(78, 0, 8, 13, 3);
House.add(136, 4, 11, 9, 1);
House.add(136, 1, 12, 9, 1);
House.add(17, 1, 2, 3, 14);
House.add(35, 0, 3, 3, 14);
House.add(160, 8, 4, 3, 14);
House.add(35, 0, 5, 3, 14);
House.add(17, 1, 6, 3, 14);
House.add(35, 0, 7, 3, 14);
House.add(164, 7, 8, 3, 14);
House.add(35, 0, 9, 3, 14);
House.add(17, 1, 10, 3, 14);
House.add(35, 0, 11, 3, 14);
House.add(160, 8, 12, 3, 14);
House.add(35, 0, 13, 3, 14);
House.add(17, 1, 14, 3, 14);
House.add(136, 0, 5, 10, 1);
House.add(136, 5, 6, 10, 1);
House.add(136, 4, 10, 10, 1);
House.add(136, 1, 11, 10, 1);
House.add(17, 1, 2, 4, 14);
House.add(44, 3, 1, 0, 12);
House.add(35, 0, 3, 4, 14);
House.add(17, 9, 2, 0, 12);
House.add(164, 7, 4, 4, 14);
House.add(126, 0, 3, 0, 12);
House.add(35, 0, 5, 4, 14);
House.add(126, 0, 4, 0, 12);
House.add(17, 1, 6, 4, 14);
House.add(126, 0, 5, 0, 12);
House.add(35, 0, 7, 4, 14);
House.add(126, 0, 6, 0, 12);
House.add(35, 0, 8, 4, 14);
House.add(126, 0, 7, 0, 12);
House.add(35, 0, 9, 4, 14);
House.add(126, 0, 8, 0, 12);
House.add(17, 1, 10, 4, 14);
House.add(126, 0, 9, 0, 12);
House.add(35, 0, 11, 4, 14);
House.add(126, 0, 10, 0, 12);
House.add(164, 7, 12, 4, 14);
House.add(126, 0, 11, 0, 12);
House.add(35, 0, 13, 4, 14);
House.add(126, 0, 12, 0, 12);
House.add(17, 1, 14, 4, 14);
House.add(126, 0, 13, 0, 12);
House.add(17, 9, 14, 0, 12);
House.add(44, 3, 15, 0, 12);
House.add(136, 0, 6, 11, 1);
House.add(136, 5, 7, 11, 1);
House.add(17, 9, 8, 11, 1);
House.add(136, 4, 9, 11, 1);
House.add(136, 1, 10, 11, 1);
House.add(164, 4, 1, 5, 14);
House.add(17, 1, 2, 5, 14);
House.add(17, 5, 3, 5, 14);
House.add(35, 0, 2, 1, 12);
House.add(17, 5, 4, 5, 14);
House.add(17, 5, 5, 5, 14);
House.add(17, 1, 6, 5, 14);
House.add(17, 5, 7, 5, 14);
House.add(17, 5, 8, 5, 14);
House.add(17, 5, 9, 5, 14);
House.add(17, 1, 10, 5, 14);
House.add(17, 5, 11, 5, 14);
House.add(17, 5, 12, 5, 14);
House.add(17, 5, 13, 5, 14);
House.add(17, 1, 14, 5, 14);
House.add(164, 5, 15, 5, 14);
House.add(35, 0, 14, 1, 12);
House.add(136, 0, 7, 12, 1);
House.add(136, 2, 8, 12, 1);
House.add(136, 1, 9, 12, 1);
House.add(136, 0, 1, 6, 14);
House.add(125, 3, 2, 6, 14);
House.add(35, 0, 3, 6, 14);
House.add(35, 0, 2, 2, 12);
House.add(35, 0, 4, 6, 14);
House.add(35, 0, 5, 6, 14);
House.add(17, 1, 6, 6, 14);
House.add(35, 0, 7, 6, 14);
House.add(35, 0, 8, 6, 14);
House.add(35, 0, 9, 6, 14);
House.add(17, 1, 10, 6, 14);
House.add(35, 0, 11, 6, 14);
House.add(35, 0, 12, 6, 14);
House.add(35, 0, 13, 6, 14);
House.add(125, 3, 14, 6, 14);
House.add(136, 1, 15, 6, 14);
House.add(35, 0, 14, 2, 12);
House.add(53, 1, 0, 11, 16);
House.add(136, 0, 2, 7, 14);
House.add(125, 3, 3, 7, 14);
House.add(35, 0, 2, 3, 12);
House.add(35, 0, 4, 7, 14);
House.add(35, 0, 5, 7, 14);
House.add(17, 1, 6, 7, 14);
House.add(35, 0, 7, 7, 14);
House.add(35, 0, 8, 7, 14);
House.add(35, 0, 9, 7, 14);
House.add(17, 1, 10, 7, 14);
House.add(35, 0, 11, 7, 14);
House.add(35, 0, 12, 7, 14);
House.add(125, 3, 13, 7, 14);
House.add(136, 1, 14, 7, 14);
House.add(35, 0, 14, 3, 12);
House.add(136, 0, 3, 8, 14);
House.add(35, 0, 2, 4, 12);
House.add(125, 3, 4, 8, 14);
House.add(44, 3, 1, 0, 10);
House.add(35, 0, 5, 8, 14);
House.add(17, 9, 2, 0, 10);
House.add(17, 1, 6, 8, 14);
House.add(126, 0, 3, 0, 10);
House.add(35, 0, 7, 8, 14);
House.add(126, 0, 4, 0, 10);
House.add(35, 0, 8, 8, 14);
House.add(126, 0, 5, 0, 10);
House.add(35, 0, 9, 8, 14);
House.add(126, 0, 6, 0, 10);
House.add(17, 1, 10, 8, 14);
House.add(126, 0, 7, 0, 10);
House.add(35, 0, 11, 8, 14);
House.add(126, 0, 8, 0, 10);
House.add(125, 3, 12, 8, 14);
House.add(126, 0, 9, 0, 10);
House.add(136, 1, 13, 8, 14);
House.add(126, 0, 10, 0, 10);
House.add(126, 0, 11, 0, 10);
House.add(126, 0, 12, 0, 10);
House.add(35, 0, 14, 4, 12);
House.add(126, 0, 13, 0, 10);
House.add(17, 9, 14, 0, 10);
House.add(44, 3, 15, 0, 10);
House.add(17, 9, 2, 5, 12);
House.add(136, 0, 4, 9, 14);
House.add(125, 3, 5, 9, 14);
House.add(35, 0, 2, 1, 10);
House.add(17, 1, 6, 9, 14);
House.add(35, 0, 7, 9, 14);
House.add(17, 9, 6, 5, 12);
House.add(35, 0, 8, 9, 14);
House.add(126, 8, 7, 5, 12);
House.add(35, 0, 9, 9, 14);
House.add(126, 8, 8, 5, 12);
House.add(17, 1, 10, 9, 14);
House.add(126, 8, 9, 5, 12);
House.add(125, 3, 11, 9, 14);
House.add(17, 9, 10, 5, 12);
House.add(136, 1, 12, 9, 14);
House.add(17, 9, 14, 5, 12);
House.add(35, 0, 14, 1, 10);
House.add(164, 5, 0, 10, 14);
House.add(136, 0, 1, 6, 12);
House.add(125, 3, 2, 6, 12);
House.add(136, 0, 5, 10, 14);
House.add(35, 0, 2, 2, 10);
House.add(125, 3, 6, 10, 14);
House.add(17, 5, 7, 10, 14);
House.add(17, 5, 8, 10, 14);
House.add(17, 5, 9, 10, 14);
House.add(125, 3, 10, 10, 14);
House.add(136, 1, 11, 10, 14);
House.add(125, 3, 14, 6, 12);
House.add(136, 1, 15, 6, 12);
House.add(35, 0, 14, 2, 10);
House.add(53, 1, 0, 11, 14);
House.add(136, 0, 2, 7, 12);
House.add(126, 11, 3, 7, 12);
House.add(17, 9, 2, 3, 10);
House.add(136, 0, 6, 11, 14);
House.add(125, 3, 7, 11, 14);
House.add(17, 9, 8, 11, 14);
House.add(125, 3, 9, 11, 14);
House.add(136, 1, 10, 11, 14);
House.add(126, 11, 13, 7, 12);
House.add(136, 1, 14, 7, 12);
House.add(17, 9, 14, 3, 10);
House.add(136, 0, 3, 8, 12);
House.add(35, 0, 2, 4, 10);
House.add(126, 11, 4, 8, 12);
House.add(44, 3, 1, 0, 8);
House.add(136, 0, 7, 12, 14);
House.add(17, 1, 2, 0, 8);
House.add(136, 3, 8, 12, 14);
House.add(126, 0, 3, 0, 8);
House.add(136, 1, 9, 12, 14);
House.add(126, 0, 4, 0, 8);
House.add(126, 0, 5, 0, 8);
House.add(126, 0, 6, 0, 8);
House.add(126, 0, 7, 0, 8);
House.add(126, 0, 8, 0, 8);
House.add(126, 11, 12, 8, 12);
House.add(126, 0, 9, 0, 8);
House.add(136, 1, 13, 8, 12);
House.add(126, 0, 10, 0, 8);
House.add(126, 0, 11, 0, 8);
House.add(126, 0, 12, 0, 8);
House.add(35, 0, 14, 4, 10);
House.add(126, 0, 13, 0, 8);
House.add(17, 1, 14, 0, 8);
House.add(44, 3, 15, 0, 8);
House.add(17, 9, 2, 5, 10);
House.add(136, 0, 4, 9, 12);
House.add(126, 11, 5, 9, 12);
House.add(17, 1, 2, 1, 8);
House.add(17, 9, 6, 5, 10);
House.add(126, 8, 7, 5, 10);
House.add(126, 8, 8, 5, 10);
House.add(126, 8, 9, 5, 10);
House.add(126, 11, 11, 9, 12);
House.add(17, 9, 10, 5, 10);
House.add(136, 1, 12, 9, 12);
House.add(17, 9, 14, 5, 10);
House.add(17, 1, 14, 1, 8);
House.add(136, 0, 1, 6, 10);
House.add(125, 3, 2, 6, 10);
House.add(136, 0, 5, 10, 12);
House.add(17, 1, 2, 2, 8);
House.add(126, 11, 6, 10, 12);
House.add(126, 11, 10, 10, 12);
House.add(136, 1, 11, 10, 12);
House.add(125, 3, 14, 6, 10);
House.add(136, 1, 15, 6, 10);
House.add(17, 1, 14, 2, 8);
House.add(53, 1, 0, 11, 12);
House.add(136, 0, 2, 7, 10);
House.add(126, 11, 3, 7, 10);
House.add(17, 1, 2, 3, 8);
House.add(136, 0, 6, 11, 12);
House.add(50, 1, 3, 3, 8);
House.add(126, 11, 7, 11, 12);
House.add(17, 9, 8, 11, 12);
House.add(126, 11, 9, 11, 12);
House.add(136, 1, 10, 11, 12);
House.add(126, 11, 13, 7, 10);
House.add(136, 1, 14, 7, 10);
House.add(17, 1, 14, 3, 8);
House.add(136, 0, 3, 8, 10);
House.add(17, 1, 2, 4, 8);
House.add(126, 11, 4, 8, 10);
House.add(44, 3, 1, 0, 6);
House.add(136, 0, 7, 12, 12);
House.add(17, 9, 2, 0, 6);
House.add(17, 9, 8, 12, 12);
House.add(126, 0, 3, 0, 6);
House.add(136, 1, 9, 12, 12);
House.add(126, 0, 4, 0, 6);
House.add(126, 0, 5, 0, 6);
House.add(126, 0, 6, 0, 6);
House.add(126, 0, 7, 0, 6);
House.add(126, 0, 8, 0, 6);
House.add(126, 11, 12, 8, 10);
House.add(126, 0, 9, 0, 6);
House.add(136, 1, 13, 8, 10);
House.add(126, 0, 10, 0, 6);
House.add(126, 0, 11, 0, 6);
House.add(126, 0, 12, 0, 6);
House.add(17, 1, 14, 4, 8);
House.add(126, 0, 13, 0, 6);
House.add(17, 9, 14, 0, 6);
House.add(44, 3, 15, 0, 6);
House.add(164, 4, 1, 5, 8);
House.add(17, 1, 2, 5, 8);
House.add(136, 0, 4, 9, 10);
House.add(126, 11, 5, 9, 10);
House.add(35, 0, 2, 1, 6);
House.add(78, 0, 8, 13, 12);
House.add(17, 9, 6, 5, 8);
House.add(126, 8, 7, 5, 8);
House.add(126, 8, 8, 5, 8);
House.add(126, 8, 9, 5, 8);
House.add(126, 11, 11, 9, 10);
House.add(17, 9, 10, 5, 8);
House.add(136, 1, 12, 9, 10);
House.add(17, 1, 14, 5, 8);
House.add(164, 5, 15, 5, 8);
House.add(35, 0, 14, 1, 6);
House.add(136, 0, 1, 6, 8);
House.add(125, 3, 2, 6, 8);
House.add(136, 0, 5, 10, 10);
House.add(35, 0, 2, 2, 6);
House.add(126, 11, 6, 10, 10);
House.add(17, 1, 6, 6, 8);
House.add(126, 11, 10, 10, 10);
House.add(136, 2, 11, 10, 10);
House.add(17, 1, 10, 6, 8);
House.add(125, 3, 14, 6, 8);
House.add(136, 1, 15, 6, 8);
House.add(35, 0, 14, 2, 6);
House.add(53, 1, 0, 11, 10);
House.add(136, 0, 2, 7, 8);
House.add(126, 11, 3, 7, 8);
House.add(17, 9, 2, 3, 6);
House.add(136, 0, 6, 11, 10);
House.add(126, 11, 7, 11, 10);
House.add(17, 1, 6, 7, 8);
House.add(17, 9, 8, 11, 10);
House.add(126, 11, 9, 11, 10);
House.add(136, 1, 10, 11, 10);
House.add(17, 1, 10, 7, 8);
House.add(126, 11, 13, 7, 8);
House.add(136, 1, 14, 7, 8);
House.add(17, 9, 14, 3, 6);
House.add(136, 0, 3, 8, 8);
House.add(35, 0, 2, 4, 6);
House.add(126, 11, 4, 8, 8);
House.add(44, 3, 1, 0, 4);
House.add(136, 0, 7, 12, 10);
House.add(17, 9, 2, 0, 4);
House.add(17, 1, 6, 8, 8);
House.add(17, 9, 8, 12, 10);
House.add(126, 0, 3, 0, 4);
House.add(50, 1, 7, 8, 8);
House.add(136, 1, 9, 12, 10);
House.add(126, 0, 4, 0, 4);
House.add(126, 0, 5, 0, 4);
House.add(50, 2, 9, 8, 8);
House.add(126, 0, 6, 0, 4);
House.add(17, 1, 10, 8, 8);
House.add(126, 0, 7, 0, 4);
House.add(126, 0, 8, 0, 4);
House.add(126, 11, 12, 8, 8);
House.add(126, 0, 9, 0, 4);
House.add(136, 1, 13, 8, 8);
House.add(126, 0, 10, 0, 4);
House.add(126, 0, 11, 0, 4);
House.add(126, 0, 12, 0, 4);
House.add(35, 0, 14, 4, 6);
House.add(126, 0, 13, 0, 4);
House.add(17, 9, 14, 0, 4);
House.add(44, 3, 15, 0, 4);
House.add(17, 9, 2, 5, 6);
House.add(136, 0, 4, 9, 8);
House.add(126, 11, 5, 9, 8);
House.add(35, 0, 2, 1, 4);
House.add(17, 1, 6, 9, 8);
House.add(78, 0, 8, 13, 10);
House.add(17, 9, 6, 5, 6);
House.add(126, 8, 7, 5, 6);
House.add(126, 8, 8, 5, 6);
House.add(17, 1, 10, 9, 8);
House.add(126, 8, 9, 5, 6);
House.add(126, 11, 11, 9, 8);
House.add(17, 9, 10, 5, 6);
House.add(136, 1, 12, 9, 8);
House.add(17, 9, 14, 5, 6);
House.add(35, 0, 14, 1, 4);
House.add(164, 5, 0, 10, 8);
House.add(136, 0, 1, 6, 6);
House.add(125, 3, 2, 6, 6);
House.add(136, 0, 5, 10, 8);
House.add(35, 0, 2, 2, 4);
House.add(17, 1, 6, 10, 8);
House.add(17, 1, 10, 10, 8);
House.add(136, 1, 11, 10, 8);
House.add(125, 3, 14, 6, 6);
House.add(136, 1, 15, 6, 6);
House.add(35, 0, 14, 2, 4);
House.add(53, 1, 0, 11, 8);
House.add(136, 0, 2, 7, 6);
House.add(126, 11, 3, 7, 6);
House.add(35, 0, 2, 3, 4);
House.add(136, 0, 6, 11, 8);
House.add(126, 11, 7, 11, 8);
House.add(17, 9, 8, 11, 8);
House.add(126, 11, 9, 11, 8);
House.add(136, 1, 10, 11, 8);
House.add(126, 11, 13, 7, 6);
House.add(136, 1, 14, 7, 6);
House.add(35, 0, 14, 3, 4);
House.add(136, 0, 3, 8, 6);
House.add(35, 0, 2, 4, 4);
House.add(126, 11, 4, 8, 6);
House.add(44, 3, 1, 0, 2);
House.add(136, 0, 7, 12, 8);
House.add(17, 1, 2, 0, 2);
House.add(17, 9, 8, 12, 8);
House.add(17, 5, 3, 0, 2);
House.add(136, 1, 9, 12, 8);
House.add(17, 5, 4, 0, 2);
House.add(17, 5, 5, 0, 2);
House.add(17, 1, 6, 0, 2);
House.add(17, 5, 7, 0, 2);
House.add(17, 5, 8, 0, 2);
House.add(126, 11, 12, 8, 6);
House.add(17, 5, 9, 0, 2);
House.add(136, 1, 13, 8, 6);
House.add(17, 1, 10, 0, 2);
House.add(17, 5, 11, 0, 2);
House.add(17, 5, 12, 0, 2);
House.add(35, 0, 14, 4, 4);
House.add(17, 5, 13, 0, 2);
House.add(17, 1, 14, 0, 2);
House.add(44, 3, 15, 0, 2);
House.add(17, 9, 2, 5, 4);
House.add(136, 0, 4, 9, 6);
House.add(126, 11, 5, 9, 6);
House.add(17, 1, 2, 1, 2);
House.add(78, 0, 8, 13, 8);
House.add(35, 0, 3, 1, 2);
House.add(35, 0, 4, 1, 2);
House.add(17, 9, 6, 5, 4);
House.add(35, 0, 5, 1, 2);
House.add(126, 8, 7, 5, 4);
House.add(17, 1, 6, 1, 2);
House.add(126, 8, 8, 5, 4);
House.add(35, 0, 7, 1, 2);
House.add(126, 8, 9, 5, 4);
House.add(126, 11, 11, 9, 6);
House.add(35, 0, 8, 1, 2);
House.add(17, 9, 10, 5, 4);
House.add(136, 3, 12, 9, 6);
House.add(35, 0, 9, 1, 2);
House.add(17, 1, 10, 1, 2);
House.add(35, 0, 11, 1, 2);
House.add(35, 0, 12, 1, 2);
House.add(17, 9, 14, 5, 4);
House.add(35, 0, 13, 1, 2);
House.add(17, 1, 14, 1, 2);
House.add(136, 0, 1, 6, 4);
House.add(125, 3, 2, 6, 4);
House.add(136, 0, 5, 10, 6);
House.add(17, 1, 2, 2, 2);
House.add(126, 11, 6, 10, 6);
House.add(35, 0, 3, 2, 2);
House.add(164, 2, 4, 2, 2);
House.add(35, 0, 5, 2, 2);
House.add(17, 1, 6, 2, 2);
House.add(126, 11, 10, 10, 6);
House.add(35, 0, 7, 2, 2);
House.add(136, 1, 11, 10, 6);
House.add(35, 0, 8, 2, 2);
House.add(35, 0, 9, 2, 2);
House.add(17, 1, 10, 2, 2);
House.add(35, 0, 11, 2, 2);
House.add(164, 2, 12, 2, 2);
House.add(125, 3, 14, 6, 4);
House.add(35, 0, 13, 2, 2);
House.add(136, 1, 15, 6, 4);
House.add(17, 1, 14, 2, 2);
House.add(53, 1, 0, 11, 6);
House.add(136, 0, 2, 7, 4);
House.add(126, 11, 3, 7, 4);
House.add(17, 1, 2, 3, 2);
House.add(136, 0, 6, 11, 6);
House.add(35, 0, 3, 3, 2);
House.add(126, 11, 7, 11, 6);
House.add(160, 8, 4, 3, 2);
House.add(17, 9, 8, 11, 6);
House.add(35, 0, 5, 3, 2);
House.add(126, 11, 9, 11, 6);
House.add(17, 1, 6, 3, 2);
House.add(136, 1, 10, 11, 6);
House.add(17, 5, 7, 3, 2);
House.add(17, 5, 8, 3, 2);
House.add(17, 5, 9, 3, 2);
House.add(17, 1, 10, 3, 2);
House.add(35, 0, 11, 3, 2);
House.add(126, 11, 13, 7, 4);
House.add(160, 8, 12, 3, 2);
House.add(136, 1, 14, 7, 4);
House.add(35, 0, 13, 3, 2);
House.add(17, 1, 14, 3, 2);
House.add(136, 0, 3, 8, 4);
}
}
| [
"[email protected]"
] | |
2f3ac192e453cf7d64542c30abdd03726f38d72a | f48def81a93e2e2c2b5e641515a8f6d2c245e5b6 | /src/main/java/com/px/mwp/entity/StructureFolder.java | b55c03567bed56b1dbd1b043c84696305466bc9b | [] | no_license | oatpava/px-service | d0decd95a6f6ef7a966c01676dece3b017b8e4c3 | 8561ab01cbdc53f523c2dedbc4de797cce6fee84 | refs/heads/master | 2023-04-15T05:35:55.283064 | 2023-01-16T07:50:15 | 2023-01-16T07:50:15 | 189,724,181 | 0 | 0 | null | 2022-11-24T09:26:22 | 2019-06-01T11:19:51 | Java | UTF-8 | Java | false | false | 2,466 | java | package com.px.mwp.entity;
import com.px.share.entity.BaseEntity;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
*
* @author ken
*/
@Entity
@Table(name = "PC_STRUCTURE_FOLDER")
@AttributeOverrides({
@AttributeOverride(name = "id", column = @Column(name = "STRUCTURE_FOLDER_ID"))
})
public class StructureFolder extends BaseEntity {
@Transient
private static final long serialVersionUID = 3670870567982632766L;
@Column(name = "STRUCTURE_FOLDER_NAME", length = 255)
private String structureFolderName;
@Column(name = "STRUCTURE_FOLDER_TYPE", length = 10)
private String structureFolderType;
@Column(name = "STRUCTURE_FOLDER_LINK_ID", columnDefinition = "int default '0'")
private int structureFolderLinkId;
@Column(name = "STRUCTURE_FOLDER_DETAIL", length = 1000)
private String structureFolderDetail;
// @ManyToOne(cascade={CascadeType.DETACH})
// @JoinColumn(name="STRUCTURE_ID", nullable = false)
// private Structure structure;
@Column(name = "STRUCTURE_ID", columnDefinition = "int default '0'")
private int structureId;
public StructureFolder() {
}
public StructureFolder(Integer createdBy) {
super(createdBy);
}
public String getStructureFolderName() {
return structureFolderName;
}
public void setStructureFolderName(String structureFolderName) {
this.structureFolderName = structureFolderName;
}
public String getStructureFolderType() {
return structureFolderType;
}
public void setStructureFolderType(String structureFolderType) {
this.structureFolderType = structureFolderType;
}
public int getStructureFolderLinkId() {
return structureFolderLinkId;
}
public void setStructureFolderLinkId(int structureFolderLinkId) {
this.structureFolderLinkId = structureFolderLinkId;
}
public String getStructureFolderDetail() {
return structureFolderDetail;
}
public void setStructureFolderDetail(String structureFolderDetail) {
this.structureFolderDetail = structureFolderDetail;
}
public int getStructureId() {
return structureId;
}
public void setStructureId(int structureId) {
this.structureId = structureId;
}
}
| [
"[email protected]"
] | |
1319eb6526a39be6619cf1e99ebff472918a81c6 | e008a6527acc5c8bc4d3aaeeeae04ee16e6c8784 | /src/main/java/com/ruby/sun/dp/iterator/iterator/PancakeHouseMenu.java | 5977690ac3ec2233af570323d892c1f2d6b23ff1 | [] | no_license | Hs-RuiSun/java-tutorial | 5ca45b24400ceb5f872fe43e34a6e722c1721224 | cbfc73621c7f97e4d3c706e10c563fd5be9c3c5f | refs/heads/master | 2023-05-12T10:32:41.161750 | 2023-05-02T21:12:23 | 2023-05-02T21:12:23 | 126,377,454 | 0 | 0 | null | 2022-05-25T06:22:27 | 2018-03-22T18:17:07 | Java | UTF-8 | Java | false | false | 682 | java | package com.ruby.sun.dp.iterator.iterator;
import java.util.ArrayList;
public class PancakeHouseMenu implements Menu {
ArrayList<String> menuItems;
public PancakeHouseMenu() {
menuItems = new ArrayList<String>();
addItem("K&B's Pancake Breakfast");
addItem("Regular Pancake Breakfast");
addItem("Blueberry Pancakes");
addItem("Waffles");
}
public void addItem(String name)
{
menuItems.add(name);
}
public ArrayList<String> getMenuItems() {
return menuItems;
}
public Iterator createIterator() {
return new PancakeHouseMenuIterator(menuItems);
}
public String toString() {
return "Pancake House Menu";
}
// other menu methods here
}
| [
"[email protected]"
] | |
880a4ce93c3d1d528c4d38aefee05a6cfe970225 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_158d6cfbba07a9779d908cf8d76b32c941c95569/DefaultVisorManagerTest/11_158d6cfbba07a9779d908cf8d76b32c941c95569_DefaultVisorManagerTest_t.java | 1e2d4d8df867aed2d8d237a930972e4ebd082da4 | [] | 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 | 2,037 | java | /**
* gvSIG. Desktop Geographic Information System.
*
* Copyright (C) 2007-2012 gvSIG Association.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* For any additional information, do not hesitate to contact us
* at info AT gvsig.com, or visit our website www.gvsig.com.
*/
package org.gvsig.visor.impl;
import java.io.File;
import java.net.URL;
import org.gvsig.visor.VisorManager;
import org.gvsig.visor.VisorManagerTest;
/**
* {@link VisorManager} API compatibility tests for the
* {@link DefaultVisorManager} implementation.
*
* @author gvSIG Team
* @version $Id$
*/
public class DefaultVisorManagerTest extends VisorManagerTest {
private File getResource(String pathname) {
URL res = this.getClass().getClassLoader().getResource(pathname);
return new File(res.getPath());
}
@Override
protected void doSetUp() throws Exception {
// TODO Auto-generated method stub
super.doSetUp();
}
@Override
protected File getBlockForTest() {
return getResource("data/blocks.shp");
}
@Override
protected File getPropertiesForTest() {
return getResource("data/properties.shp");
}
@Override
protected File getBackgroundForTest() {
return getResource("data/PNOA.tif");
}
}
| [
"[email protected]"
] | |
3bb70a4c619da70400aab456db61329bd9fc41df | 46698437396aafba1574306571d04e310898fcbe | /shop-product-web/src/main/java/com/bat/gmall/product/controller/SkuController.java | 2f27ec404fe657e8923f5934ee0802623827f20f | [] | no_license | zhou-rain/digital-shop | fbd2958b82ad061793e54a0eee9ca6ec8faa195a | 2b71ef7dcc8bc44f051261155bd6e327171b861f | refs/heads/master | 2022-12-10T17:37:45.654117 | 2020-02-10T11:29:12 | 2020-02-10T11:29:24 | 232,947,997 | 1 | 3 | null | 2022-11-16T12:27:50 | 2020-01-10T02:24:10 | CSS | UTF-8 | Java | false | false | 1,196 | java | package com.bat.gmall.product.controller;
import com.alibaba.dubbo.config.annotation.Reference;
import com.bat.shop.api.bean.pms.PmsSkuInfo;
import com.bat.shop.api.service.pms.SkuService;
import com.bat.qmall.exception.ErrException;
import com.bat.qmall.utils.Validator;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author: zhouR
* @date: Create in 2020/1/16 - 10:26
* @function:
*/
@RestController
@CrossOrigin
public class SkuController {
@Reference
SkuService skuService;
//保存sku信息
@RequestMapping("/saveSkuInfo")
public String saveSkuInfo(@RequestBody PmsSkuInfo pmsSkuInfo){
//前端传值有误,设置默认值
pmsSkuInfo.setProductId(pmsSkuInfo.getSpuId());
//处理默认图片
if(Validator.isEmpty(pmsSkuInfo.getSkuDefaultImg())){
pmsSkuInfo.setSkuDefaultImg(pmsSkuInfo.getSkuImageList().get(0).getImgUrl());
}
try {
skuService.saveSkuInfo(pmsSkuInfo);
} catch (ErrException e) {
return e.getMessage();
}
return "ok";
}
}
| [
"[email protected]"
] | |
8e9a3d7570f03b668d72f348f75c2179ee431496 | af4a572909126d7ee26c497a5c4045d08142656a | /src/sample/LoginPage/DashBoard/SelectWindows/AcademicSession/SelectAcademicSession.java | a3e44810c451b62c9f3fcb92f621bf884583cf4b | [] | no_license | salamay/Educise | c3af7376c2f4842452f9ecf00c25ae4fafcf0168 | 60412717a245dbcd277d69e2258820124256177e | refs/heads/master | 2023-05-01T15:57:14.090978 | 2021-04-30T10:11:34 | 2021-04-30T10:11:34 | 286,864,355 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 895 | java | package sample.LoginPage.DashBoard.SelectWindows.AcademicSession;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Modality;
import javafx.stage.Stage;
import java.io.IOException;
public class SelectAcademicSession {
public void CreateWindow() throws IOException {
Stage window=new Stage();
window.setTitle("Create Academic Session");
Parent root= FXMLLoader.load(getClass().getResource("AcademicSession.fxml"));
Scene scene=new Scene(root);
window.setResizable(false);
window.initModality(Modality.APPLICATION_MODAL);
window.setMaxHeight(800);
window.setMaxWidth(602);
window.getIcons().add(new Image("image/window_icon.png"));
window.centerOnScreen();
window.setScene(scene);
window.show();
}
}
| [
"[email protected]"
] | |
d819288a4d13dc31f4ce0f015d7be40ca704844b | c417af7aa364ce17aaba115b0e18987d03f563b7 | /src/main/java/org/evilco/bot/powersweeper/configuration/CommandLineArgumentConfiguration.java | 112038d3f552cd811324354eba0e75cacc9919ae | [
"Apache-2.0"
] | permissive | LordAkkarin/powersweeper | 31f607ff219cb10a2a98f043af008d553cf308b9 | 7aedb86c48619e7bda38dae8353a8533ce80ac9b | refs/heads/master | 2021-01-18T14:19:29.952862 | 2014-09-07T23:13:05 | 2014-09-07T23:13:05 | 23,047,652 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,623 | java | /*
* Copyright 2014 Johannes Donath <[email protected]>
* 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.evilco.bot.powersweeper.configuration;
import lombok.Getter;
import lombok.NonNull;
import org.apache.commons.cli.*;
import org.evilco.bot.powersweeper.brain.IBrain;
import org.evilco.bot.powersweeper.platform.Driver;
import java.io.File;
/**
* @author Johannes Donath <[email protected]>
* @copyright Copyright (C) 2014 Evil-Co <http://www.evil-co.com>
*/
public class CommandLineArgumentConfiguration implements IConfiguration {
/**
* Defines the default brain.
*/
public static final String DEFAULT_BRAIN = "org.evilco.bot.powersweeper.brain.IdiotBrain";
/**
* Defines the default driver.
*/
public static final String DEFAULT_DRIVER = "CHROME";
/**
* Defines the default storage directory for natives.
*/
public static final String DEFAULT_NATIVE_DIRECTORY = "natives/";
/**
* Defines valid command line options.
*/
public static final Options OPTIONS = (new Options ())
.addOption (OptionBuilder.withLongOpt ("brain").hasArg ().create ("b"))
.addOption (OptionBuilder.withLongOpt ("help").create ("h"))
.addOption (OptionBuilder.withLongOpt ("natives").hasArg ().create ())
.addOption (OptionBuilder.withLongOpt ("nonativedownload").create ())
.addOption (OptionBuilder.withLongOpt ("debug").create ())
.addOption (OptionBuilder.withLongOpt ("dumpunknowntiles").create ())
.addOption (OptionBuilder.withLongOpt ("driver").hasArg ().create ())
.addOption (OptionBuilder.withLongOpt ("trace").create ())
.addOption (OptionBuilder.hasArg ().create ("x"))
.addOption (OptionBuilder.hasArg ().create ("y"));
/**
* Stores the parsed command line.
*/
@Getter
private CommandLine commandLine;
/**
* Constructs a new CommandLineArgumentConfiguration instance.
* @param arguments The command line arguments.
* @throws ParseException Occurs if parsing the input did fail.
*/
public CommandLineArgumentConfiguration (@NonNull String[] arguments) throws ParseException {
this.commandLine = (new PosixParser ()).parse (OPTIONS, arguments);
}
/**
* {@inheritDoc}
*/
@Override
public Class<? extends IBrain> getBrainClass () throws ClassNotFoundException {
return Class.forName ((this.commandLine.hasOption ("brain") ? this.commandLine.getOptionValue ("brain") : DEFAULT_BRAIN)).asSubclass (IBrain.class);
}
/**
* {@inheritDoc}
*/
@Override
public Driver getDriver () {
return (Driver.valueOf ((this.commandLine.hasOption ("driver") ? this.commandLine.getOptionValue ("driver").toUpperCase () : DEFAULT_DRIVER)));
}
/**
* {@inheritDoc}
*/
@Override
public File getNativeLibraryDirectory () {
return (new File ((this.commandLine.hasOption ("natives") ? this.commandLine.getOptionValue ("natives") : DEFAULT_NATIVE_DIRECTORY)));
}
/**
* {@inheritDoc}
*/
@Override
public Long getStartX () {
return (this.commandLine.hasOption ("x") ? Long.parseLong (this.commandLine.getOptionValue ("x")) : null);
}
/**
* {@inheritDoc}
*/
@Override
public Long getStartY () {
return (this.commandLine.hasOption ("y") ? Long.parseLong (this.commandLine.getOptionValue ("y")) : null);
}
/**
* {@inheritDoc}
*/
@Override
public boolean isDebugEnabled () {
return this.commandLine.hasOption ("debug");
}
/**
* {@inheritDoc}
*/
@Override
public boolean isDumpingEnabled () {
return this.commandLine.hasOption ("dumpunknowntiles");
}
/**
* {@inheritDoc}
*/
@Override
public boolean isNativeDownloadEnabled () {
return !this.commandLine.hasOption ("nonativedownload");
}
/**
* {@inheritDoc}
*/
@Override
public boolean isTracingEnabled () {
return this.commandLine.hasOption ("trace");
}
/**
* Prints the command line help.
*/
public static void printHelp () {
(new HelpFormatter ()).printHelp ("Powersweeper <arguments>", OPTIONS);
}
} | [
"[email protected]"
] | |
7fcd5bf680cc39b483f19d964fef8d96a3a97848 | 70d9e0c5da2ff50a964cb844be203f1a1cd912b1 | /app/src/main/java/project/iiitd/loginsample/Login_fragment.java | 14f581b78bab42e35676f8ed2b1544d54e693091 | [] | no_license | cpkumar/Fragments_for_projects | bcf50aae483b1f6c8300069f9db702e21f9c20e3 | 8f8bb30cf2be2bb47ea8d89dcd58861707e21fce | refs/heads/master | 2020-03-29T16:18:48.060659 | 2018-09-24T13:28:51 | 2018-09-24T13:28:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,643 | java | package project.iiitd.loginsample;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link Login_fragment.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link Login_fragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class Login_fragment 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;
private OnFragmentInteractionListener mListener;
public Login_fragment() {
// 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 Login_fragment.
*/
// TODO: Rename and change types and number of parameters
public static Login_fragment newInstance(String param1, String param2) {
Login_fragment fragment = new Login_fragment();
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_login_fragment, container, false);
}
// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}
}
| [
"sunnyjangra98gmail.com"
] | sunnyjangra98gmail.com |
7cb01e5139b6f5537a11a7763e8e846c4123f909 | bfa9fc76064004d9b3f8a55067fa0387a1639f00 | /src/main/java/com/zfc/study/DemoEurekaServerApplication.java | 1d99dfc096ced717237df336b76883ca2b5d0582 | [] | no_license | zufc/demo-eurekaServer | 54f0038ccfd39ffca9c779c61e534746ad5faa3a | 09e0c265f01ff772a899f9a208f1bbc88b0f0b1a | refs/heads/master | 2020-06-10T16:43:11.330822 | 2019-06-27T06:05:36 | 2019-06-27T06:05:36 | 193,679,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package com.zfc.study;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@EnableEurekaServer
@SpringBootApplication
public class DemoEurekaServerApplication {
public static void main(String[] args) {
SpringApplication.run(DemoEurekaServerApplication.class, args);
}
}
| [
"[email protected]"
] | |
3b7e4d26292f4646fe7a8849415f54e9a62f2ccc | db165effe6af30f438e277b15bbbf1c5a96cb659 | /Unidade-II_bibliotecaweb/src/main/java/br/edu/ifpb/bibliotecaweb/converter/SelectItemsUtils.java | b1dfbee63788af33d7df861e01a5c7cc0e5bde3c | [] | no_license | HilbertoFernandes/PWEB-II | 5a57c9f7b58e901e129a4a4b6506e5682d8ae5a3 | 28af25e18891ad25ba0bc3b6c620ce01c1b5664b | refs/heads/master | 2020-03-24T11:45:11.258387 | 2018-08-08T18:03:26 | 2018-08-08T18:03:26 | 127,982,844 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,502 | java | package br.edu.ifpb.bibliotecaweb.converter;
import java.util.Iterator;
import java.util.NoSuchElementException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.model.SelectItem;
import javax.faces.model.SelectItemGroup;
import com.sun.faces.renderkit.SelectItemsIterator;
public final class SelectItemsUtils {
private SelectItemsUtils() {}
@SuppressWarnings({ "unchecked", "rawtypes" })
public static Object findValueByStringConversion(FacesContext context, UIComponent component, String value, Converter converter) {
return findValueByStringConversion(context, component, new SelectItemsIterator(context, component), value, converter);
}
private static Object findValueByStringConversion(FacesContext context, UIComponent component, Iterator<SelectItem> items, String value, Converter converter) {
while (items.hasNext()) {
SelectItem item = items.next();
if (item instanceof SelectItemGroup) {
SelectItem subitems[] = ((SelectItemGroup) item).getSelectItems();
if (!isEmpty(subitems)) {
Object object = findValueByStringConversion(context, component, new ArrayIterator(subitems), value, converter);
if (object != null) {
return object;
}
}
} else if (!item.isNoSelectionOption() && value.equals(converter.getAsString(context, component, item.getValue()))) {
return item.getValue();
}
}
return null;
}
public static boolean isEmpty(Object[] array) {
return array == null || array.length == 0;
}
/**
* This class is based on Mojarra version
*/
static class ArrayIterator implements Iterator<SelectItem> {
public ArrayIterator(SelectItem items[]) {
this.items = items;
}
private SelectItem items[];
private int index = 0;
public boolean hasNext() {
return (index < items.length);
}
public SelectItem next() {
try {
return (items[index++]);
}
catch (IndexOutOfBoundsException e) {
throw new NoSuchElementException();
}
}
public void remove() {
throw new UnsupportedOperationException();
}
}
}
| [
"[email protected]"
] | |
d0edb5b0475398b04da9b3e6505810e4b91512e0 | e9affefd4e89b3c7e2064fee8833d7838c0e0abc | /aws-java-sdk-cloudwatch/src/main/java/com/amazonaws/services/cloudwatch/model/DisableInsightRulesRequest.java | 6104e5490d9c47427c713117f90a05a6db92f4dc | [
"Apache-2.0"
] | permissive | aws/aws-sdk-java | 2c6199b12b47345b5d3c50e425dabba56e279190 | bab987ab604575f41a76864f755f49386e3264b4 | refs/heads/master | 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 | Apache-2.0 | 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null | UTF-8 | Java | false | false | 6,675 | java | /*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.cloudwatch.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableInsightRules" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DisableInsightRulesRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* An array of the rule names to disable. If you need to find out the names of your rules, use <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html"
* >DescribeInsightRules</a>.
* </p>
*/
private com.amazonaws.internal.SdkInternalList<String> ruleNames;
/**
* <p>
* An array of the rule names to disable. If you need to find out the names of your rules, use <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html"
* >DescribeInsightRules</a>.
* </p>
*
* @return An array of the rule names to disable. If you need to find out the names of your rules, use <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html"
* >DescribeInsightRules</a>.
*/
public java.util.List<String> getRuleNames() {
if (ruleNames == null) {
ruleNames = new com.amazonaws.internal.SdkInternalList<String>();
}
return ruleNames;
}
/**
* <p>
* An array of the rule names to disable. If you need to find out the names of your rules, use <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html"
* >DescribeInsightRules</a>.
* </p>
*
* @param ruleNames
* An array of the rule names to disable. If you need to find out the names of your rules, use <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html"
* >DescribeInsightRules</a>.
*/
public void setRuleNames(java.util.Collection<String> ruleNames) {
if (ruleNames == null) {
this.ruleNames = null;
return;
}
this.ruleNames = new com.amazonaws.internal.SdkInternalList<String>(ruleNames);
}
/**
* <p>
* An array of the rule names to disable. If you need to find out the names of your rules, use <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html"
* >DescribeInsightRules</a>.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setRuleNames(java.util.Collection)} or {@link #withRuleNames(java.util.Collection)} if you want to
* override the existing values.
* </p>
*
* @param ruleNames
* An array of the rule names to disable. If you need to find out the names of your rules, use <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html"
* >DescribeInsightRules</a>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableInsightRulesRequest withRuleNames(String... ruleNames) {
if (this.ruleNames == null) {
setRuleNames(new com.amazonaws.internal.SdkInternalList<String>(ruleNames.length));
}
for (String ele : ruleNames) {
this.ruleNames.add(ele);
}
return this;
}
/**
* <p>
* An array of the rule names to disable. If you need to find out the names of your rules, use <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html"
* >DescribeInsightRules</a>.
* </p>
*
* @param ruleNames
* An array of the rule names to disable. If you need to find out the names of your rules, use <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html"
* >DescribeInsightRules</a>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableInsightRulesRequest withRuleNames(java.util.Collection<String> ruleNames) {
setRuleNames(ruleNames);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getRuleNames() != null)
sb.append("RuleNames: ").append(getRuleNames());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DisableInsightRulesRequest == false)
return false;
DisableInsightRulesRequest other = (DisableInsightRulesRequest) obj;
if (other.getRuleNames() == null ^ this.getRuleNames() == null)
return false;
if (other.getRuleNames() != null && other.getRuleNames().equals(this.getRuleNames()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRuleNames() == null) ? 0 : getRuleNames().hashCode());
return hashCode;
}
@Override
public DisableInsightRulesRequest clone() {
return (DisableInsightRulesRequest) super.clone();
}
}
| [
""
] | |
235ae1ca82a2ef113369d8b1eb3b0e97e1048812 | d0de72285784ef2aa919668bff55f6e20dc9548e | /actions/pageObjects/nopCommerce/AdminLoginPO.java | f8bed2dd93b5a6f42539ccfd711bbb6b68ec96d0 | [] | no_license | phuongnguyenth0905/hybrid-pom-nopcommerce | 9b625fb2e1e31dace041be46cfd8695f12db7d16 | c11ca9d811c7007d25d7126106422aacdb92e180 | refs/heads/master | 2023-03-14T18:38:04.360244 | 2021-03-18T08:02:01 | 2021-03-18T08:02:01 | 303,027,778 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,129 | java | package pageObjects.nopCommerce;
import org.openqa.selenium.WebDriver;
import commons.AbstractPage;
import pageUI.nopCommerce.AdminLoginPageUI;
public class AdminLoginPO extends AbstractPage{
WebDriver driver;
public AdminLoginPO(WebDriver driver) {
this.driver = driver;
}
public void inputToEmailTextbox(String email) {
waitToElementVisible(driver, AdminLoginPageUI.EMAIL_TEXTBOX);
sendkeyToElement(driver, AdminLoginPageUI.EMAIL_TEXTBOX, email);
}
public void inputToPasswordTextbox(String password) {
waitToElementVisible(driver, AdminLoginPageUI.PASSWORD_TEXTBOX);
sendkeyToElement(driver, AdminLoginPageUI.PASSWORD_TEXTBOX, password);
}
public AdminDashboardPO clickToLoginButton() {
waitToElementClickAble(driver, AdminLoginPageUI.LOGIN_BUTTON);
clickToElement(driver, AdminLoginPageUI.LOGIN_BUTTON);
return PageGeneratorManagerNopCommerce.getAdminDashboardPO(driver);
}
public AdminDashboardPO loginToSystem(String email, String password) {
inputToEmailTextbox(email);
inputToPasswordTextbox(password);
return clickToLoginButton();
}
}
| [
"[email protected]"
] | |
a930ee91af7a8475430024767552002d2a60115b | a3a6ceae1bfb779d0bc9827078786c11b49b1fb6 | /AGENT/src/main/java/com/exilant/qutap/agent/Uploading.java | ca1bb3affdb98ce40dbb3b191a23d31ecc6869f7 | [] | no_license | akkamahadevi-santosh/MyFirstQProject | b72a17a5b04fffccc8b5644f4b678d79cd614836 | bb99dd7877fe3176130815583eb09c048410775b | refs/heads/master | 2020-04-26T17:46:25.992264 | 2019-02-10T11:28:37 | 2019-02-10T11:28:37 | 173,723,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 188 | java | package com.exilant.qutap.agent;
public interface Uploading {
public String videoUpload(String path,String fileName);
public String screenShotUpload(String path,String fileName);
}
| [
"[email protected]"
] | |
67081ee9a7704f28eb4000d7a1b9cf2455d87843 | bde407f57daa88bab9c5bfe1502ce984bb5a7283 | /edu/lafayette/bci/sigproc/EdgeDetect.java | b8cdb33b94544d03d9960e8e65bba33a9856dc73 | [] | no_license | garrisoh/BCI-Drone-Control | fa8cdfee9dc3b852b617f2ee1a157c80d995f738 | 46ac3c4b767811839544bbf08a41ab2bedc1555d | refs/heads/master | 2020-05-26T19:02:45.361458 | 2015-05-09T02:23:03 | 2015-05-09T02:23:03 | 33,083,395 | 4 | 6 | null | null | null | null | UTF-8 | Java | false | false | 761 | java | package edu.lafayette.bci.sigproc;
/**
* The EdgeDetect algorithm outputs a one when a positive edge
* is detected and a negative one when a negative edge is
* detected.
*
* @author Haley Garrison
*/
public class EdgeDetect extends Algorithm {
double prevVal = -1.0;
/* (non-Javadoc)
* @see Algorithm#process(Point)
*/
@Override
public Point process(Point p) {
// Detect a rising or falling edge
double y = (prevVal == 0.0 && p.getY() == 1.0) ? 1.0 : (prevVal == 1.0 && p.getY() == 0.0) ? -1.0 : 0.0;
// Set the previous value to the current value of y
prevVal = p.getY();
// Return the point
Point processed = new Point(p.getX(), y);
if (this.tap != null) {
this.tap.addPoint(processed);
}
return processed;
}
}
| [
"[email protected]"
] | |
7437f531c0593be0752a85a6e3e798b4e9d78e1e | 42053d2b5bafdbc075b8c13047e4ee0cfbab8142 | /springboottest/src/main/java/com/choe/springboottest/SpringboottestApplication.java | 25e07a9ca98486c7eb6a657107d693985a2dbd39 | [] | no_license | Choe1027/Demo | a1a7c3d47550c83426bda308ecd8d0a92c001a64 | 5c7b636b5cbc58f399da1a576535c398cdda7211 | refs/heads/master | 2020-03-21T17:50:13.816713 | 2018-09-06T08:08:38 | 2018-09-06T08:08:38 | 138,856,925 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package com.choe.springboottest;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringboottestApplication {
public static void main(String[] args) {
SpringApplication.run(SpringboottestApplication.class, args);
}
}
| [
"[email protected]"
] | |
024ac5b31835980efb312b30513780f7c14e24c5 | 96449d2096d88ad50760432c2a7fe74aebc78329 | /src/main/java/omos/controller/MenuuController.java | 1335c4bb347b9f25035311461e215812033d3aba | [] | no_license | scarflq/omos | 8accafa2329adc6d705c1296b33c01ea638685b4 | b5e1db49c089fbac4c1ca733e3c3a7d2ccb92c6d | refs/heads/master | 2021-05-05T04:28:50.033592 | 2017-09-30T15:47:45 | 2017-09-30T15:47:45 | 105,380,936 | 2 | 0 | null | null | null | null | GB18030 | Java | false | false | 4,584 | java | package omos.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import javax.xml.ws.spi.http.HttpContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import omos.bean.Menuu;
import omos.bean.Msg;
import omos.service.MenuuService;
import com.fasterxml.jackson.annotation.JacksonInject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Random;
@Controller
public class MenuuController {
@Autowired
MenuuService menuuService;
@ResponseBody
@RequestMapping(value="/cai/{ids}",method=RequestMethod.DELETE)
public Msg deleteMe(@PathVariable("ids")String ids){
//批量删除
if(ids.contains("-")){
List<Integer> del_ids = new ArrayList<>();
String[] str_ids = ids.split("-");
//组装id的集合
for (String string : str_ids) {
del_ids.add(Integer.parseInt(string));
}
menuuService.deleteBatch(del_ids);
}else{
Integer id = Integer.parseInt(ids);
menuuService.deleteMe(id);
}
return Msg.success();
}
@ResponseBody
@RequestMapping(value="/search/{cName}",method=RequestMethod.GET)
public Msg searchCai(@RequestParam(value = "pn", defaultValue = "1") Integer pn,@PathVariable("cName")String cName) throws UnsupportedEncodingException {
PageHelper.startPage(pn, 5);
String te =new String(cName.getBytes("ISO-8859-1"),"UTF-8");
List<Menuu> men=menuuService.searchName(te);
PageInfo page = new PageInfo(men, 5);
return Msg.success().add("pageInfo", page);
}
@ResponseBody
@RequestMapping(value="/me/{cId}",method=RequestMethod.PUT)
public Msg saveMe(Menuu menuu,HttpServletRequest request){
menuuService.updateMe(menuu);
return Msg.success() ;
}
@RequestMapping(value="/me/{id}",method=RequestMethod.GET)
@ResponseBody
public Msg getMe(@PathVariable("id")Integer id){
Menuu men = menuuService.getMe(id);
return Msg.success().add("menu", men);
}
@RequestMapping(value="/cai",method=RequestMethod.POST)
@ResponseBody
public Msg saveCai(@Valid Menuu menuu,BindingResult result){
menuuService.saveCai(menuu);
return Msg.success();
}
@RequestMapping("/cai")
@ResponseBody
public Msg getMenusWithJson(@RequestParam(value = "pn", defaultValue = "1") Integer pn) {
PageHelper.startPage(pn, 5);
List<Menuu> cai = menuuService.getAll();
PageInfo page = new PageInfo(cai, 5);
return Msg.success().add("pageInfo", page);
}
@RequestMapping("/xian")
@ResponseBody
public Msg getMenus(@RequestParam(value = "pn", defaultValue = "1") Integer pn) {
PageHelper.startPage(pn, 10);
List<Menuu> cai = menuuService.getAll();
PageInfo page = new PageInfo(cai, 5);
return Msg.success().add("pageInfo", page);
}
@RequestMapping("/sort1_sel")
@ResponseBody
public Msg getSort1_sel(
@RequestParam(value = "pn", defaultValue = "1") Integer pn) {
PageHelper.startPage(pn, 5);
List<Menuu> cai = menuuService.getSort1All();
PageInfo page = new PageInfo(cai, 5);
return Msg.success().add("pageInfo", page);
}
@RequestMapping("/sort2_sel")
@ResponseBody
public Msg getSort2_sel(
@RequestParam(value = "pn", defaultValue = "1") Integer pn) {
PageHelper.startPage(pn, 5);
List<Menuu> cai = menuuService.getSort2All();
PageInfo page = new PageInfo(cai, 5);
return Msg.success().add("pageInfo", page);
}
@RequestMapping("/sort3_sel")
@ResponseBody
public Msg getSort3_sel(
@RequestParam(value = "pn", defaultValue = "1") Integer pn) {
PageHelper.startPage(pn, 5);
List<Menuu> cai = menuuService.getSort3All();
PageInfo page = new PageInfo(cai, 5);
return Msg.success().add("pageInfo", page);
}
}
| [
"[email protected]"
] | |
2e0b9cadd7eda5b27b5a66ae2c4e757c81ef0668 | b402f568d7abae3d47ed1bacb794d64c4fbd49b2 | /alexo-chess/src/main/java/ao/chess/v2/state/State.java | d5a119249d6baa0ca728d1698323ffa11d0a95f8 | [] | no_license | midjun/alexo-chess | af813ce6f761070f7c4395cadaa7956183077094 | 195dbb84dccce5b6eaa50571773ce0495463ef65 | refs/heads/master | 2021-01-10T20:14:54.811589 | 2010-10-31T23:57:38 | 2010-10-31T23:57:38 | 32,382,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 48,424 | java | package ao.chess.v2.state;
import ao.chess.v2.data.BitBoard;
import ao.chess.v2.data.BitLoc;
import ao.chess.v2.data.BoardLocation;
import ao.chess.v2.data.Location;
import ao.chess.v2.move.SlidingPieces;
import ao.chess.v2.piece.Colour;
import ao.chess.v2.piece.Figure;
import ao.chess.v2.piece.MaterialTally;
import ao.chess.v2.piece.Piece;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.Map;
/**
* Date: Feb 6, 2009
* Time: 2:07:25 AM
*
* NOTE: can only undo ONE move, after that the reversible moves and
* allowed castles might be out of whack.
*/
public class State
{
//------------------------------------------------------------------------
public static final byte WHITE_K_CASTLE = 1;
public static final byte WHITE_Q_CASTLE = 1 << 1;
public static final byte BLACK_K_CASTLE = 1 << 2;
public static final byte BLACK_Q_CASTLE = 1 << 3;
private static final byte WHITE_CASTLE = WHITE_K_CASTLE |
WHITE_Q_CASTLE;
private static final byte BLACK_CASTLE = BLACK_K_CASTLE |
BLACK_Q_CASTLE;
private static final long WHITE_KING_START =
BitLoc.locationToBitBoard(0, 4);
private static final long BLACK_KING_START =
BitLoc.locationToBitBoard(7, 4);
private static final int WHITE_KING_START_INDEX =
BitLoc.bitBoardToLocation(WHITE_KING_START);
private static final int BLACK_KING_START_INDEX =
BitLoc.bitBoardToLocation(BLACK_KING_START);
private static final long WHITE_K_CASTLE_PATH = WHITE_KING_START |
SlidingPieces.castFiles(WHITE_KING_START, 2);
private static final long WHITE_Q_CASTLE_PATH = WHITE_KING_START |
SlidingPieces.castFiles(WHITE_KING_START, -2);
private static final long BLACK_K_CASTLE_PATH = BLACK_KING_START |
SlidingPieces.castFiles(BLACK_KING_START, 2);
private static final long BLACK_Q_CASTLE_PATH = BLACK_KING_START |
SlidingPieces.castFiles(BLACK_KING_START, -2);
private static final long WHITE_K_CASTLE_CORRIDOR =
SlidingPieces.castFiles(WHITE_KING_START, 2);
private static final long WHITE_Q_CASTLE_CORRIDOR =
SlidingPieces.castFiles(WHITE_KING_START, -3);
private static final long BLACK_K_CASTLE_CORRIDOR =
SlidingPieces.castFiles(BLACK_KING_START, 2);
private static final long BLACK_Q_CASTLE_CORRIDOR =
SlidingPieces.castFiles(BLACK_KING_START, -3);
private static final long WHITE_K_CASTLE_END =
BitLoc.locationToBitBoard(0, 6);
private static final long WHITE_Q_CASTLE_END =
BitLoc.locationToBitBoard(0, 2);
private static final long BLACK_K_CASTLE_END =
BitLoc.locationToBitBoard(7, 6);
private static final long BLACK_Q_CASTLE_END =
BitLoc.locationToBitBoard(7, 2);
private static final int WHITE_K_CASTLE_END_INDEX =
BitLoc.bitBoardToLocation(WHITE_K_CASTLE_END);
private static final int WHITE_Q_CASTLE_END_INDEX =
BitLoc.bitBoardToLocation(WHITE_Q_CASTLE_END);
private static final int BLACK_K_CASTLE_END_INDEX =
BitLoc.bitBoardToLocation(BLACK_K_CASTLE_END);
private static final int BLACK_Q_CASTLE_END_INDEX =
BitLoc.bitBoardToLocation(BLACK_Q_CASTLE_END);
private static final long WHITE_K_CASTLE_MOVE =
WHITE_KING_START ^ WHITE_K_CASTLE_END;
private static final long WHITE_Q_CASTLE_MOVE =
WHITE_KING_START ^ WHITE_Q_CASTLE_END;
private static final long BLACK_K_CASTLE_MOVE =
BLACK_KING_START ^ BLACK_K_CASTLE_END;
private static final long BLACK_Q_CASTLE_MOVE =
BLACK_KING_START ^ BLACK_Q_CASTLE_END;
private static final long WHITE_K_ROOK_START =
BitLoc.locationToBitBoard(0, 7);
private static final long WHITE_Q_ROOK_START =
BitLoc.locationToBitBoard(0, 0);
private static final long BLACK_K_ROOK_START =
BitLoc.locationToBitBoard(7, 7);
private static final long BLACK_Q_ROOK_START =
BitLoc.locationToBitBoard(7, 0);
private static final long WHITE_K_CASTLE_ROOK_END =
BitBoard.offset(WHITE_K_CASTLE_END, 0, -1);
private static final long WHITE_Q_CASTLE_ROOK_END =
BitBoard.offset(WHITE_Q_CASTLE_END, 0, 1);
private static final long BLACK_K_CASTLE_ROOK_END =
BitBoard.offset(BLACK_K_CASTLE_END, 0, -1);
private static final long BLACK_Q_CASTLE_ROOK_END =
BitBoard.offset(BLACK_Q_CASTLE_END, 0, 1);
private static final long WHITE_K_CASTLE_ROOK_MOVE =
WHITE_K_ROOK_START ^ WHITE_K_CASTLE_ROOK_END;
private static final long WHITE_Q_CASTLE_ROOK_MOVE =
WHITE_Q_ROOK_START ^ WHITE_Q_CASTLE_ROOK_END;
private static final long BLACK_K_CASTLE_ROOK_MOVE =
BLACK_K_ROOK_START ^ BLACK_K_CASTLE_ROOK_END;
private static final long BLACK_Q_CASTLE_ROOK_MOVE =
BLACK_Q_ROOK_START ^ BLACK_Q_CASTLE_ROOK_END;
private static final long WHITE_K_CASTLE_ALL_MOVES =
WHITE_K_CASTLE_MOVE ^ WHITE_K_CASTLE_ROOK_MOVE;
private static final long WHITE_Q_CASTLE_ALL_MOVES =
WHITE_Q_CASTLE_MOVE ^ WHITE_Q_CASTLE_ROOK_MOVE;
private static final long BLACK_K_CASTLE_ALL_MOVES =
BLACK_K_CASTLE_MOVE ^ BLACK_K_CASTLE_ROOK_MOVE;
private static final long BLACK_Q_CASTLE_ALL_MOVES =
BLACK_Q_CASTLE_MOVE ^ BLACK_Q_CASTLE_ROOK_MOVE;
//--------------------------------------------------------------------
public static final byte EP_NONE = -1;
private static final byte EP_WHITE_DEST = 5;
private static final byte EP_BLACK_DEST = 2;
public static final String FILES = "abcdefgh";
//--------------------------------------------------------------------
private static final int PAWNS = Figure.PAWN .ordinal();
private static final int KNIGHTS = Figure.KNIGHT.ordinal();
private static final int BISHOPS = Figure.BISHOP.ordinal();
private static final int ROOKS = Figure.ROOK .ordinal();
private static final int QUEENS = Figure.QUEEN .ordinal();
private static final int KING = Figure.KING .ordinal();
private static final int[] NON_KINGS_BY_PROB =
{PAWNS, ROOKS, BISHOPS, KNIGHTS, QUEENS};
//--------------------------------------------------------------------
private long[] wPieces;
private long[] bPieces;
private long whiteBB;
private long blackBB;
private byte nPieces;
private byte enPassant; // available to take for nextToAct
private byte prevEnPassant;
private byte castles;
private byte prevCastles;
private long castlePath;
private long prevCastlePath;
private byte reversibleMoves;
private byte prevReversibleMoves;
private Colour nextToAct;
//--------------------------------------------------------------------
private static State INITIAL = fromFen(
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
public static State initial() {
return INITIAL.prototype();
}
public static State fromFen(String fen) {
return Representation.fromFen(fen);
}
public State(Piece[][] board,
Colour nextToActColour,
byte reversibleMoves,
CastleType.Set castleSet,
byte enPassantFile)
{
wPieces = new long[ Figure.VALUES.length ];
bPieces = new long[ Figure.VALUES.length ];
castles = 0;
whiteBB = 0;
blackBB = 0;
nPieces = 0;
castles = castleSet.toBits();
enPassant = enPassantFile;
nextToAct = nextToActColour;
for (int rank = 0; rank < Location.RANKS; rank++) {
for (int file = 0; file < Location.FILES; file++) {
Piece piece = board[rank][file];
if (piece == null) continue;
long location = BitLoc.locationToBitBoard(rank, file);
if (piece.isWhite()) {
wPieces[ piece.figure().ordinal() ] |= location;
whiteBB |= location;
} else {
bPieces[ piece.figure().ordinal() ] |= location;
blackBB |= location;
}
nPieces++;
}
}
castlePath = 0;
prevCastlePath = 0;
prevCastles = castles;
prevReversibleMoves = reversibleMoves;
}
private State(long[] copyWPieces,
long[] copyBPieces,
byte copyEnPassants,
byte copyCastles,
byte copyReversibleMoves,
Colour copyNextToAct,
byte copyNumberPieces,
long copyWhiteBB,
long copyBlackBB,
byte copyPrevCastles,
byte copyPrevReversibleMoves,
byte copyPrevEnPassants,
long copyCastlePath,
long copyPrevCastlePath
)
{
wPieces = copyWPieces;
bPieces = copyBPieces;
castles = copyCastles;
nextToAct = copyNextToAct;
castlePath = copyCastlePath;
enPassant = copyEnPassants;
reversibleMoves = copyReversibleMoves;
whiteBB = copyWhiteBB;
blackBB = copyBlackBB;
nPieces = copyNumberPieces;
prevCastles = copyPrevCastles;
prevCastlePath = copyPrevCastlePath;
prevEnPassant = copyPrevEnPassants;
prevReversibleMoves = copyPrevReversibleMoves;
}
//--------------------------------------------------------------------
public int[] legalMoves(/*TranspositionTable transTable*/)
{
int[] legalMoves = new int[ Move.MAX_PER_PLY ];
int nMoves = legalMoves(legalMoves/*, transTable*/);
if (nMoves == -1) return null;
return Arrays.copyOf(legalMoves, nMoves);
}
// public int legalMoves(int[] moves)
// {
// return legalMoves(moves, new NullTransTable());
// }
public int legalMoves(
int[] moves/*, TranspositionTable transTable*/)
{
int pseudoMoves[] = new int[ Move.MAX_PER_PLY ];
int nPseudoMoves = moves(pseudoMoves);
if (nPseudoMoves == -1) return -1;
int nextMoveIndex = 0;
for (int i = 0; i < nPseudoMoves; i++)
{
int pseudoMove = pseudoMoves[ i ];
int undoable = Move.apply(pseudoMove, this);
if (! isInCheck(nextToAct.invert())/* &&
! transTable.contains(longHashCode())*/) {
moves[ nextMoveIndex++ ] = undoable;
}
Move.unApply(undoable, this);
}
return nextMoveIndex;
}
/**
* generate all pseudo-legal moves from this position
* i.e. moves at the end of which you might have your king in check
*
* @param moves generate moves into
* @return number of moves generated, or -1 if mate is possible
*/
public int moves(int[] moves)
{
long occupied = whiteBB | blackBB;
long notOccupied = ~occupied;
long proponent, opponent, oppKing, pieces[];
if (nextToAct == Colour.WHITE) {
proponent = whiteBB;
opponent = blackBB;
oppKing = bPieces[ KING ];
pieces = wPieces;
} else {
proponent = blackBB;
opponent = whiteBB;
oppKing = wPieces[ KING ];
pieces = bPieces;
}
oppKing |= castlePath;
opponent |= castlePath;
long notProponent = ~proponent;
long notOpponent = ~opponent;
int offset = 0;
for (Figure f : Figure.VALUES)
{
long bb = pieces[ f.ordinal() ];
while (bb != 0)
{
long pieceBoard = BitBoard.lowestOneBit(bb);
long pseudoMoves = Piece.valueOf(nextToAct, f).moves(
pieceBoard, occupied, notOccupied,
proponent, notProponent, opponent);
if ((oppKing & pseudoMoves) != 0) {
// can mate opponent's king, so either the opponent
// left his king in check (i.e. made a pseudo-legal
// move which has to be undone), or the game
// is over with nextToAct being the winner
return -1;
}
offset = addMoves(
f, pieceBoard, moves, offset,
pseudoMoves, opponent, notOpponent);
// reset LS1B
bb &= bb - 1;
}
}
return addCastles(moves, offset,
proponent, opponent);
}
private int addMoves(
Figure figure,
long fromBB,
int[] moves,
int offset,
long movesBB,
long opponent,
long notOpponent)
{
int from = BitLoc.bitBoardToLocation(fromBB);
int nextOffset;
nextOffset = addMobility(
figure, from, moves, offset, movesBB & notOpponent);
nextOffset = addCaptures(
figure, from, moves, nextOffset, movesBB & opponent);
if (figure == Figure.PAWN) {
if (canPromote(from)) {
nextOffset = addPromotions(
moves, nextOffset - offset, nextOffset);
}
else if (canEnPassant(from))
{
nextOffset = addEnPassant(
from, moves, nextOffset);
}
}
return nextOffset;
}
private int addMobility(
Figure figure,
int from,
int[] moves,
int offset,
long moveBB)
{
while (moveBB != 0)
{
long moveBoard = BitBoard.lowestOneBit(moveBB);
moves[ offset++ ] = Move.mobility(
figure, from, BitLoc.bitBoardToLocation(moveBoard));
moveBB &= moveBB - 1;
}
return offset;
}
private int addCaptures(
Figure figure,
int from,
int[] moves,
int offset,
long moveBB)
{
while (moveBB != 0)
{
long moveBoard = BitBoard.lowestOneBit(moveBB);
moves[ offset++ ] = Move.capture(
figure, from, BitLoc.bitBoardToLocation(moveBoard));
moveBB &= moveBB - 1;
}
return offset;
}
//--------------------------------------------------------------------
private int addCastles(
int[] moves, int offset,
long proponent, long opponent)
{
int kingStart, qKingEnd, kKingEnd;
long kingCastle , kingCorridor;
long queenCastle, queenCorridor;
if (nextToAct == Colour.WHITE) {
if ((castles & WHITE_CASTLE) == 0) return offset;
kingCastle = WHITE_K_CASTLE;
queenCastle = WHITE_Q_CASTLE;
kingCorridor = WHITE_K_CASTLE_CORRIDOR;
queenCorridor = WHITE_Q_CASTLE_CORRIDOR;
kingStart = WHITE_KING_START_INDEX;
kKingEnd = WHITE_K_CASTLE_END_INDEX;
qKingEnd = WHITE_Q_CASTLE_END_INDEX;
} else {
if ((castles & BLACK_CASTLE) == 0) return offset;
kingCastle = BLACK_K_CASTLE;
queenCastle = BLACK_Q_CASTLE;
kingCorridor = BLACK_K_CASTLE_CORRIDOR;
queenCorridor = BLACK_Q_CASTLE_CORRIDOR;
kingStart = BLACK_KING_START_INDEX;
kKingEnd = BLACK_K_CASTLE_END_INDEX;
qKingEnd = BLACK_Q_CASTLE_END_INDEX;
}
int newOffset = offset;
long allPieces = proponent | opponent;
if ((castles & kingCastle) != 0 &&
(allPieces & kingCorridor) == 0) {
moves[ newOffset++ ] = Move.castle(
kingStart, kKingEnd, CastleType.KING_SIDE);
}
if ((castles & queenCastle) != 0 &&
(allPieces & queenCorridor) == 0) {
moves[ newOffset++ ] = Move.castle(
kingStart, qKingEnd, CastleType.QUEEN_SIDE);
}
return newOffset;
}
public void castle(CastleType type)
{
prevCastles = castles;
prevCastlePath = castlePath;
toggleCastle(type);
nextToAct = nextToAct.invert();
prevReversibleMoves = reversibleMoves;
// reversibleMoves = 0;
reversibleMoves++;
prevEnPassant = enPassant;
enPassant = EP_NONE;
}
public void unCastle(CastleType type)
{
nextToAct = nextToAct.invert();
toggleCastle(type);
castles = prevCastles;
enPassant = prevEnPassant;
reversibleMoves = prevReversibleMoves;
castlePath = prevCastlePath;
}
private void toggleCastle(CastleType type)
{
if (nextToAct == Colour.WHITE) {
if (type == CastleType.KING_SIDE) {
wPieces[ KING ] ^= WHITE_K_CASTLE_MOVE;
wPieces[ ROOKS ] ^= WHITE_K_CASTLE_ROOK_MOVE;
whiteBB ^= WHITE_K_CASTLE_ALL_MOVES;
castlePath = WHITE_K_CASTLE_PATH;
} else {
wPieces[ KING ] ^= WHITE_Q_CASTLE_MOVE;
wPieces[ ROOKS ] ^= WHITE_Q_CASTLE_ROOK_MOVE;
whiteBB ^= WHITE_Q_CASTLE_ALL_MOVES;
castlePath = WHITE_Q_CASTLE_PATH;
}
clearCastlingRights(WHITE_CASTLE);
} else {
if (type == CastleType.KING_SIDE) {
bPieces[ KING ] ^= BLACK_K_CASTLE_MOVE;
bPieces[ ROOKS ] ^= BLACK_K_CASTLE_ROOK_MOVE;
blackBB ^= BLACK_K_CASTLE_ALL_MOVES;
castlePath = BLACK_K_CASTLE_PATH;
} else {
bPieces[ KING ] ^= BLACK_Q_CASTLE_MOVE;
bPieces[ ROOKS ] ^= BLACK_Q_CASTLE_ROOK_MOVE;
blackBB ^= BLACK_Q_CASTLE_ALL_MOVES;
castlePath = BLACK_Q_CASTLE_PATH;
}
clearCastlingRights(BLACK_CASTLE);
}
}
private void updateCastlingRightsFrom(
int figure, int from)
{
if (figure == KING) {
if (castles == 0) return;
clearCastlingRights(
(nextToAct == Colour.WHITE)
? WHITE_CASTLE : BLACK_CASTLE);
} else if (figure == ROOKS) {
if (castles == 0) return;
if (nextToAct == Colour.WHITE) {
if (from == 0) {
clearCastlingRights(WHITE_Q_CASTLE);
} else if (from == 7) {
clearCastlingRights(WHITE_K_CASTLE);
}
} else {
if (from == 56) {
clearCastlingRights(BLACK_Q_CASTLE);
} else if (from == 63) {
clearCastlingRights(BLACK_K_CASTLE);
}
}
}
}
private void updateCastlingRightsTo(
int figure, long to)
{
if (figure != ROOKS || castles == 0) return;
if (nextToAct == Colour.WHITE) {
if ((to & BLACK_K_ROOK_START) != 0) {
clearCastlingRights(BLACK_K_CASTLE);
} else if ((to & BLACK_Q_ROOK_START) != 0) {
clearCastlingRights(BLACK_Q_CASTLE);
}
} else {
if ((to & WHITE_K_ROOK_START) != 0) {
clearCastlingRights(WHITE_K_CASTLE);
} else if ((to & WHITE_Q_ROOK_START) != 0) {
clearCastlingRights(WHITE_Q_CASTLE);
}
}
}
private void clearCastlingRights(byte rights)
{
castles &= ~rights;
}
//--------------------------------------------------------------------
private boolean canPromote(int from)
{
int fromRank = Location.rankIndex(from);
if (nextToAct == Colour.WHITE) {
if (fromRank == 6) {
return true;
}
} else if (fromRank == 1) {
return true;
}
return false;
}
private int addPromotions(
int[] moves, int nMoves, int addAt)
{
if (nMoves == 0) return addAt;
int addFrom = addAt - nMoves;
int nextAddAt = addFrom;
for (int f = KNIGHTS; f < KING; f++) {
for (int i = 0; i < nMoves; i++) {
moves[ nextAddAt++ ] =
Move.setPromotion(
moves[addFrom + i], f);
}
}
return nextAddAt;
}
//--------------------------------------------------------------------
public void pushPromote(int from, int to, int promotion)
{
pushPromoteBB(nextToAct, from, to, promotion);
nextToAct = nextToAct.invert();
prevReversibleMoves = reversibleMoves;
reversibleMoves = 0;
prevEnPassant = enPassant;
enPassant = EP_NONE;
prevCastlePath = castlePath;
castlePath = 0;
prevCastles = castles;
}
private void pushPromoteBB(
Colour colour, int from, int to, int promotion) {
long fromBB = BitLoc.locationToBitBoard(from);
long toBB = BitLoc.locationToBitBoard(to);
if (colour == Colour.WHITE) {
wPieces[ PAWNS ] ^= fromBB;
wPieces[ promotion ] ^= toBB;
whiteBB ^= fromBB ^ toBB;
} else {
bPieces[ PAWNS ] ^= fromBB;
bPieces[ promotion ] ^= toBB;
blackBB ^= fromBB ^ toBB;
}
}
public void capturePromote(
int from, int to, int promotion, int captured)
{
long toBB = BitLoc.locationToBitBoard(to);
capturePromote(from, toBB, promotion, captured);
}
public int capturePromote(int from, int to, int promotion)
{
long toBB = BitLoc.locationToBitBoard(to);
int captured = figureAt(toBB, nextToAct.invert());
capturePromote(from, toBB, promotion, captured);
return captured;
}
private void capturePromote(
int from, long toBB, int promotion, int captured)
{
capturePromoteBB(nextToAct, from, toBB, promotion, captured);
prevCastles = castles;
updateCastlingRightsTo(captured, toBB);
prevCastlePath = castlePath;
castlePath = 0;
nextToAct = nextToAct.invert();
prevReversibleMoves = reversibleMoves;
reversibleMoves = 0;
prevEnPassant = enPassant;
enPassant = EP_NONE;
nPieces--;
}
private void capturePromoteBB(Colour colour,
int from, long toBB, int promotion, int captured)
{
long fromBB = BitLoc.locationToBitBoard(from);
if (colour == Colour.WHITE) {
wPieces[ PAWNS ] ^= fromBB;
wPieces[ promotion ] ^= toBB;
whiteBB ^= fromBB ^ toBB;
bPieces[ captured ] ^= toBB;
blackBB ^= toBB;
} else {
bPieces[ PAWNS ] ^= fromBB;
bPieces[ promotion ] ^= toBB;
blackBB ^= fromBB ^ toBB;
wPieces[ captured ] ^= toBB;
whiteBB ^= toBB;
}
}
//--------------------------------------------------------------------
public void unPushPromote(int from, int to, int promotion)
{
nextToAct = nextToAct.invert();
enPassant = prevEnPassant;
reversibleMoves = prevReversibleMoves;
castles = prevCastles;
castlePath = prevCastlePath;
pushPromoteBB(nextToAct, from, to, promotion);
}
public void unCapturePromote(
int from, int to, int promotion, int captured)
{
nextToAct = nextToAct.invert();
castles = prevCastles;
castlePath = prevCastlePath;
enPassant = prevEnPassant;
reversibleMoves = prevReversibleMoves;
long toBB = BitLoc.locationToBitBoard(to);
capturePromoteBB(nextToAct, from, toBB, promotion, captured);
nPieces++;
}
//--------------------------------------------------------------------
public void mobalize(
int figure,
int fromSquareIndex,
int toSquareIndex)
{
prevCastles = castles;
updateCastlingRightsFrom(
figure, fromSquareIndex);
mobalizeBB(nextToAct, figure,
BitLoc.locationToBitBoard(fromSquareIndex),
BitLoc.locationToBitBoard(toSquareIndex));
prevEnPassant = enPassant;
enPassant = EP_NONE;
prevCastlePath = castlePath;
castlePath = 0;
prevReversibleMoves = reversibleMoves;
if (figure == PAWNS) {
reversibleMoves = 0;
updateEnPassantRights(
fromSquareIndex,
toSquareIndex);
} else {
reversibleMoves++;
}
}
private void mobalizeBB(
Colour colour,
int figure,
long from,
long to)
{
long fromTo = from ^ to;
if (colour == Colour.WHITE) {
wPieces[ figure ] ^= fromTo;
whiteBB ^= fromTo;
} else {
bPieces[ figure ] ^= fromTo;
blackBB ^= fromTo;
}
nextToAct = nextToAct.invert();
}
//--------------------------------------------------------------------
public void unMobalize(
int figure,
int fromSquareIndex,
int toSquareIndex)
{
mobalizeBB(nextToAct.invert(), figure,
BitLoc.locationToBitBoard(fromSquareIndex),
BitLoc.locationToBitBoard(toSquareIndex));
castles = prevCastles;
castlePath = prevCastlePath;
enPassant = prevEnPassant;
reversibleMoves = prevReversibleMoves;
}
//--------------------------------------------------------------------
public int capture(
int attacker,
int fromSquareIndex,
int toSquareIndex)
{
long toBB = BitLoc.locationToBitBoard(toSquareIndex);
int captured = figureAt(toBB, nextToAct.invert());
if (captured == -1 || captured >= Figure.VALUES.length) {
figureAt(toBB, nextToAct.invert());
}
capture(attacker, fromSquareIndex, toBB, captured);
return captured;
}
public void capture(
int attacker,
int fromSquareIndex,
int toSquareIndex,
int captured)
{
long toBB = BitLoc.locationToBitBoard(toSquareIndex);
capture(attacker, fromSquareIndex, toBB, captured);
}
private void capture(
int attacker,
int fromSquareIndex,
long toBB,
int captured)
{
prevCastles = castles;
updateCastlingRightsFrom(
attacker, fromSquareIndex);
updateCastlingRightsTo(
captured, toBB);
capture(attacker, captured,
BitLoc.locationToBitBoard(fromSquareIndex), toBB);
prevReversibleMoves = reversibleMoves;
prevEnPassant = enPassant;
enPassant = EP_NONE;
reversibleMoves = 0;
prevCastlePath = castlePath;
castlePath = 0;
nPieces--;
}
private void capture(
int attacker,
int captured,
long from,
long to)
{
long fromTo = from ^ to;
if (nextToAct == Colour.WHITE) {
wPieces[attacker] ^= fromTo;
bPieces[captured] ^= to;
whiteBB ^= fromTo;
blackBB ^= to;
} else {
bPieces[attacker] ^= fromTo;
wPieces[captured] ^= to;
blackBB ^= fromTo;
whiteBB ^= to;
}
nextToAct = nextToAct.invert();
}
//--------------------------------------------------------------------
public void unCapture(
int attacker,
int captured,
int fromSquareIndex,
int toSquareIndex)
{
long from = BitLoc.locationToBitBoard(fromSquareIndex);
long to = BitLoc.locationToBitBoard( toSquareIndex);
long fromTo = from ^ to;
if (nextToAct == Colour.WHITE) {
// black is the attacker
bPieces[ attacker ] ^= fromTo;
wPieces[ captured ] ^= to;
blackBB ^= fromTo;
whiteBB ^= to;
} else {
wPieces[ attacker ] ^= fromTo;
bPieces[ captured ] ^= to;
whiteBB ^= fromTo;
blackBB ^= to;
}
nextToAct = nextToAct.invert();
castles = prevCastles;
enPassant = prevEnPassant;
reversibleMoves = prevReversibleMoves;
nPieces++;
}
//--------------------------------------------------------------------
private boolean canEnPassant(int from)
{
if (enPassant == EP_NONE) return false;
int rank = Location.rankIndex(from);
if (nextToAct == Colour.WHITE) {
if (rank != 4) return false;
}
else if (rank != 3) return false;
int file = Location.fileIndex(from);
return enPassant == (file - 1) ||
enPassant == (file + 1);
}
private int addEnPassant(
int from, int moves[], int nextOffset)
{
if (nextToAct == Colour.BLACK) {
moves[nextOffset] = Move.enPassant(from,
Location.squareIndex(EP_BLACK_DEST, enPassant));
} else {
moves[nextOffset] = Move.enPassant(from,
Location.squareIndex(EP_WHITE_DEST, enPassant));
}
return nextOffset + 1;
}
public void enPassantCapture(
int from, int to, int captured)
{
enPassantSwaps(from, to, captured);
nextToAct = nextToAct.invert();
prevEnPassant = enPassant;
enPassant = EP_NONE;
prevReversibleMoves = reversibleMoves;
reversibleMoves = 0;
prevCastlePath = castlePath;
castlePath = 0;
nPieces--;
}
public void unEnPassantCapture(
int from, int to, int captured)
{
nextToAct = nextToAct.invert();
enPassant = prevEnPassant;
reversibleMoves = prevReversibleMoves;
castlePath = prevCastlePath;
nPieces++;
enPassantSwaps(from, to, captured);
}
private void enPassantSwaps(
int from, int to, int captured)
{
long fromBB = BitLoc.locationToBitBoard(from);
long toBB = BitLoc.locationToBitBoard(to);
long capBB = BitLoc.locationToBitBoard(captured);
long fromToBB = fromBB ^ toBB;
if (nextToAct == Colour.WHITE) {
wPieces[ PAWNS ] ^= fromToBB;
whiteBB ^= fromToBB;
bPieces[ PAWNS ] ^= capBB;
blackBB ^= capBB;
} else {
bPieces[ PAWNS ] ^= fromToBB;
blackBB ^= fromToBB;
wPieces[ PAWNS ] ^= capBB;
whiteBB ^= capBB;
}
}
// requires that a Figure.PAWN is moving
private void updateEnPassantRights(int from, int to)
{
if (Math.abs(Location.rankIndex(from) -
Location.rankIndex(to )) > 1) {
enPassant = (byte) Location.fileIndex(from);
}
}
//--------------------------------------------------------------------
public int tallyAllMaterial() {
int tally = 0, count;
for (Figure figure : Figure.VALUES) {
int figureIndex = figure.ordinal();
count = Long.bitCount(wPieces[ figureIndex ]);
tally = MaterialTally.tally(
tally, Colour.WHITE, figure, count);
count = Long.bitCount(bPieces[ figureIndex ]);
tally = MaterialTally.tally(
tally, Colour.BLACK, figure, count);
}
return tally;
}
public int tallyNonKings(int atMost) {
int tally = 0, count;
for (int figure : NON_KINGS_BY_PROB) {
count = Long.bitCount(wPieces[ figure ]);
tally = MaterialTally.tally(
tally, Colour.WHITE, figure, count);
if ((atMost -= count) <= 0) return -1;
count = Long.bitCount(bPieces[ figure ]);
tally = MaterialTally.tally(
tally, Colour.BLACK, figure, count);
if ((atMost -= count) <= 0) return -1;
}
return tally;
}
public int tallyNonKings() {
int tally = 0, count;
for (int figure : NON_KINGS_BY_PROB) {
count = Long.bitCount(wPieces[ figure ]);
tally = MaterialTally.tally(
tally, Colour.WHITE, figure, count);
count = Long.bitCount(bPieces[ figure ]);
tally = MaterialTally.tally(
tally, Colour.BLACK, figure, count);
}
return tally;
}
public byte pieceCount() {
return nPieces;
}
public Map<BoardLocation, Piece> material() {
Map<BoardLocation, Piece> locationToPiece =
new EnumMap<BoardLocation, Piece>(
BoardLocation.class);
material(locationToPiece, wPieces, Colour.WHITE);
material(locationToPiece, bPieces, Colour.BLACK);
return locationToPiece;
}
private void material(Map<BoardLocation, Piece> addTo,
long[] pieces, Colour col) {
for (Figure f : Figure.VALUES) {
long bb = pieces[ f.ordinal() ];
while (bb != 0) {
addTo.put(BoardLocation.get(
BitLoc.bitBoardToLocation(bb)),
Piece.valueOf(col, f));
bb &= bb - 1;
}
}
}
//--------------------------------------------------------------------
public boolean isInCheck(Colour colour)
{
long occupied = whiteBB | blackBB;
long notOccupied = ~occupied;
long attacker, attacked, targetKing, attackingPieces[];
if (colour == Colour.BLACK) {
attacker = whiteBB;
attacked = blackBB;
targetKing = bPieces[ KING ];
attackingPieces = wPieces;
} else {
attacker = blackBB;
attacked = whiteBB;
targetKing = wPieces[ KING ];
attackingPieces = bPieces;
}
if (colour != nextToAct && castlePath != 0) {
targetKing = castlePath;
attacked |= castlePath;
}
long notAttacker = ~attacker;
Colour attackColour = colour.invert();
for (Figure f : Figure.VALUES)
{
Piece p = Piece.valueOf(attackColour, f);
long bb = attackingPieces[ f.ordinal() ];
while (bb != 0)
{
long pieceBoard = BitBoard.lowestOneBit(bb);
long pseudoMoves = p.moves(
pieceBoard, occupied, notOccupied,
attacker, notAttacker, attacked);
if ((targetKing & pseudoMoves) != 0) return true;
bb &= bb - 1;
}
}
return false;
}
public Colour nextToAct()
{
return nextToAct;
}
//--------------------------------------------------------------------
public byte reversibleMoves() {
return reversibleMoves;
}
public CastleType.Set castlesAvailable() {
return new CastleType.Set(castles);
}
public byte enPassantFile() {
return (enPassant == EP_NONE)
? -1 : enPassant;
}
public boolean isDrawnBy50MovesRule() {
return reversibleMoves > 100;
}
public Outcome knownOutcome() {
if (isDrawnBy50MovesRule()) return Outcome.DRAW;
int moves[] = legalMoves();
if (moves == null) {
if (isInCheck( nextToAct() )) {
return Outcome.loses( nextToAct() );
} else {
System.out.println("State: WTF does this mean??!?");
}
} else if (moves.length == 0) {
if (isInCheck( nextToAct() )) {
return Outcome.loses( nextToAct() );
} else {
return Outcome.DRAW;
}
}
return null;
}
//--------------------------------------------------------------------
/**
* @param rankIndex rank
* @param fileIndex file
* @return Piece at [rankIndex rank, fileIndex index)
* or null if the square is empty
*/
public Piece pieceAt(int rankIndex, int fileIndex)
{
long loc = BitLoc.locationToBitBoard(rankIndex, fileIndex);
for (Figure f : Figure.VALUES) {
if ((wPieces[ f.ordinal() ] & loc) != 0)
return Piece.valueOf(Colour.WHITE, f);
if ((bPieces[ f.ordinal() ] & loc) != 0)
return Piece.valueOf(Colour.BLACK, f);
}
return null;
}
private int figureAt(long location, Colour ofColour)
{
long[] pieces = (ofColour == Colour.WHITE)
? wPieces : bPieces;
for (int f = 0; f < Figure.VALUES.length; f++)
{
long occupied = pieces[ f ];
if ((occupied & location) != 0) return f;
}
return -1;
}
//--------------------------------------------------------------------
public State prototype()
{
return new State(wPieces.clone(),
bPieces.clone(),
enPassant,
castles,
reversibleMoves,
nextToAct,
nPieces,
whiteBB,
blackBB,
prevCastles,
prevReversibleMoves,
prevEnPassant,
castlePath,
prevCastlePath
);
}
//--------------------------------------------------------------------
public boolean checkPieces()
{
if (!(whiteBB == calcPieces(Colour.WHITE) &&
blackBB == calcPieces(Colour.BLACK))) {
// System.out.println("checkPieces: colourBB failed");
return false;
}
if (Long.bitCount(wPieces[ KING ]) != 1 ||
Long.bitCount(bPieces[ KING ]) != 1) {
// System.out.println("checkPieces: not exactly one king");
return false;
}
if (enPassant != EP_NONE) {
if (nextToAct == Colour.WHITE) {
if (pieceAt(3, enPassant) == Piece.WHITE_PAWN &&
pieceAt(2, enPassant) == null &&
pieceAt(1, enPassant) == null) {
return false;
}
} else {
if (pieceAt(4, enPassant) == Piece.WHITE_PAWN &&
pieceAt(5, enPassant) == null &&
pieceAt(6, enPassant) == null) {
return false;
}
}
}
if ((wPieces[PAWNS] & BitBoard.RANK_1) != 0 ||
(bPieces[PAWNS] & BitBoard.RANK_8) != 0) {
return false;
}
if ((castles & WHITE_CASTLE) != 0) {
if ((wPieces[ KING ] & WHITE_KING_START) == 0) {
// System.out.println("white can't castle after king moved");
return false;
}
if ((castles & WHITE_K_CASTLE) != 0 &&
(wPieces[ ROOKS ] & WHITE_K_ROOK_START) == 0) {
// System.out.println("white k castle impossible");
return false;
}
if ((castles & WHITE_Q_CASTLE) != 0 &&
(wPieces[ ROOKS ] & WHITE_Q_ROOK_START) == 0) {
// System.out.println("white q castle impossible");
return false;
}
}
if ((castles & BLACK_CASTLE) != 0) {
if ((bPieces[ KING ] & BLACK_KING_START) == 0) {
// System.out.println("black can't castle after king moved");
return false;
}
if ((castles & BLACK_K_CASTLE) != 0 &&
(bPieces[ ROOKS ] & BLACK_K_ROOK_START) == 0) {
// System.out.println("black k castle impossible");
return false;
}
if ((castles & BLACK_Q_CASTLE) != 0 &&
(bPieces[ ROOKS ] & BLACK_Q_ROOK_START) == 0) {
// System.out.println("black q castle impossible");
return false;
}
}
return true;
}
private long calcPieces(Colour c)
{
long[] pieces = (c == Colour.WHITE)
? wPieces : bPieces;
long bb = 0;
for (Figure f : Figure.VALUES)
{
bb |= pieces[ f.ordinal() ];
}
return bb;
}
//--------------------------------------------------------------------
// public State invert() {
// State inverce = prototype();
//
// long[] tempPieces = inverce.wPieces;
// inverce.wPieces = inverce.bPieces;
// inverce.bPieces = tempPieces;
//
// long tempBB = inverce.whiteBB;
// inverce.whiteBB = inverce.blackBB;
// inverce.blackBB = tempBB;
//
// inverce.castles = (byte)(
// (inverce.castles >> 2) |
// ((inverce.castles << 2) & 0xC));
//
// return inverce;
// }
//--------------------------------------------------------------------
@Override public String toString() {
return Representation.displayPosition(
Representation.board(this),
nextToAct, reversibleMoves,
castlesAvailable(), enPassant);
}
public String toFen()
{
return Representation.fen(
Representation.board(this),
nextToAct, reversibleMoves,
castlesAvailable(), enPassant);
}
//--------------------------------------------------------------------
@Override public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
State state = (State) o;
return castlePath == state.castlePath &&
castles == state.castles &&
enPassant == state.enPassant &&
reversibleMoves == state.reversibleMoves &&
Arrays.equals(bPieces, state.bPieces) &&
nextToAct == state.nextToAct &&
Arrays.equals(wPieces, state.wPieces);
}
@Override public int hashCode() {
int result = Arrays.hashCode(wPieces);
result = 31 * result + Arrays.hashCode(bPieces);
result = 31 * result + (int) enPassant;
result = 31 * result + (int) castles;
result = 31 * result + (int) (castlePath ^ (castlePath >>> 32));
result = 31 * result + (int) reversibleMoves;
result = 31 * result + nextToAct.hashCode();
return result;
}
//--------------------------------------------------------------------
public long longHashCode() {
return nextToActPostprocess(
Zobrist.toggleReversibleMoves(
staticHashCode(), reversibleMoves));
}
public long staticHashCode() {
return nextToActPostprocess(
zobristPiecesEnPassantCastles());
}
private long zobristPiecesEnPassantCastles() {
long zobrist = 0;
zobrist = addZobristPieces(zobrist, Colour.WHITE);
zobrist = addZobristPieces(zobrist, Colour.BLACK);
if (enPassant != EP_NONE) {
zobrist = Zobrist.toggleEnPassant(zobrist, enPassant);
}
return addZobristCastles(zobrist);
}
private long nextToActPostprocess(long zobrist) {
return (nextToAct == Colour.WHITE && zobrist < 0 ||
nextToAct == Colour.BLACK && zobrist >= 0)
? -zobrist : zobrist;
}
private long addZobristPieces(
long zobrist, Colour side) {
long[] pieces =
(side == Colour.WHITE)
? wPieces : bPieces;
for (Figure f : Figure.VALUES) {
Piece piece = Piece.valueOf(side, f);
long bb = pieces[ f.ordinal() ];
while (bb != 0) {
long pieceBoard = BitBoard.lowestOneBit(bb);
int location = BitLoc.bitBoardToLocation(pieceBoard);
zobrist = Zobrist.togglePiece(zobrist, piece, location);
// reset LS1B
bb &= bb - 1;
}
}
return zobrist;
}
private long addZobristCastles(long zobrist) {
if ((castles & WHITE_K_CASTLE) != 0) {
zobrist = Zobrist.toggleCastle(
zobrist, Colour.WHITE, CastleType.KING_SIDE);
}
if ((castles & WHITE_Q_CASTLE) != 0) {
zobrist = Zobrist.toggleCastle(
zobrist, Colour.WHITE, CastleType.QUEEN_SIDE);
}
if ((castles & BLACK_K_CASTLE) != 0) {
zobrist = Zobrist.toggleCastle(
zobrist, Colour.BLACK, CastleType.KING_SIDE);
}
if ((castles & BLACK_Q_CASTLE) != 0) {
zobrist = Zobrist.toggleCastle(
zobrist, Colour.BLACK, CastleType.QUEEN_SIDE);
}
return zobrist;
}
public static boolean hashOfWhiteToAct(long longOrStaticHash) {
return longOrStaticHash >= 0;
}
}
| [
"ostrovsky.alex@a51b5712-02d0-11de-9992-cbdf800730d7"
] | ostrovsky.alex@a51b5712-02d0-11de-9992-cbdf800730d7 |
2d38f77e57777bd470e40fe675e229c0ec7a3b80 | 22b1fe6a0af8ab3c662551185967bf2a6034a5d2 | /experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/sub1/Class_7488.java | 46a548e7a89424a2e75343ffc7d2ac52ca1495da | [
"Apache-2.0"
] | permissive | lesaint/experimenting-annotation-processing | b64ed2182570007cb65e9b62bb2b1b3f69d168d6 | 1e9692ceb0d3d2cda709e06ccc13290262f51b39 | refs/heads/master | 2021-01-23T11:20:19.836331 | 2014-11-13T10:37:14 | 2014-11-13T10:37:14 | 26,336,984 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 151 | java | package fr.javatronic.blog.massive.annotation1.sub1;
import fr.javatronic.blog.processor.Annotation_001;
@Annotation_001
public class Class_7488 {
}
| [
"[email protected]"
] | |
90410534db5e65d2234fbf4191a1907eb0e531d7 | 743b257e0721737404f4db2f6e7e9618f1f04f67 | /fundamentos/src/oo/heranca/TestDrive.java | 7bdb03817f0ee5efac0ab57146782935b8da9b42 | [] | no_license | fdalessio1150/java-fundamentos-programacao | 821123effaa926d6188d9321d44f2b36df37b352 | 5ab809a35282dee578f579a94c4c264d0673d39a | refs/heads/develop | 2021-04-09T10:21:01.423164 | 2018-03-16T01:19:28 | 2018-03-16T01:19:28 | 125,445,341 | 0 | 1 | null | 2018-03-16T01:20:20 | 2018-03-16T01:08:34 | Java | UTF-8 | Java | false | false | 272 | java | package oo.heranca;
public class TestDrive {
public static void main(String[] args) {
Carro c = new Civic();
c.acelerar();
System.out.println(c.getVelocidadeAtual());
c = new Ferrari();
c.acelerar();
System.out.println(c.getVelocidadeAtual());
}
}
| [
"[email protected]"
] | |
2dda2095121df4e729bcd47bdb7e85edcd0fd61b | b721a1a85827bdaef99af0685bdba5c5335e4c3d | /PA4J/DebugLogger.java | f0dcc16dbb1b1bad4c6788c20427074febdbaed2 | [] | no_license | rkanagy/StanfordCompilersCourse | 393700595361d2f32a82660dd35cf0b2f8a2de58 | 0bbd9ec429468c1ffc0a466bd246897557e20644 | refs/heads/master | 2022-11-05T13:12:53.293364 | 2020-06-18T17:43:43 | 2020-06-18T17:43:43 | 273,289,721 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,124 | java | import java.util.logging.*;
public class DebugLogger {
private static DebugLogger instance = null;
private static Logger logger = Logger.getLogger("CoolSemanticAnalyzer");
public static DebugLogger Instance() {
if (instance == null) {
instance = new DebugLogger();
setupLogger();
}
return instance;
}
public void logMessage(String msg) {
logger.log(Level.INFO, msg);
}
public void setLoggingOn() {
logger.setLevel(Level.INFO);
}
private static void setupLogger() {
// suppress default logging output to the console
Logger rootLogger = Logger.getLogger("");
Handler[] handlers = rootLogger.getHandlers();
if (handlers[0] instanceof ConsoleHandler) {
rootLogger.removeHandler(handlers[0]);
}
logger.setLevel(Level.OFF); // logging turned off by default
ConsoleHandler handler = new ConsoleHandler();
MyPlainTextFormatter formatter = new MyPlainTextFormatter();
handler.setFormatter(formatter);
logger.addHandler(handler);
}
}
class MyPlainTextFormatter extends Formatter {
@Override
public String format(LogRecord rec) {
return rec.getMessage() + "\n";
}
} | [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.